diff --git a/d/vs.b.js b/d/vs.b.js index 6a945b8..48c0690 100644 --- a/d/vs.b.js +++ b/d/vs.b.js @@ -1,2 +1,2 @@ -(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=4)})({4:function(){(function(a){'use strict';function b(){let a=document.head||document.getElementsByTagName('head')[0],b=document.createElement('style');b.type='text/css',b.styleSheet?b.styleSheet.cssText=g:b.appendChild(document.createTextNode(g)),a.appendChild(b)}function c(a,b){var c;return'fontawesome'===a?(c=document.createElement('i'),c.className='fa fa-microphone',c.style=iconStyle):'icon'===a?(c=document.createElement('img'),c.src=b.icon,c.style=imgStyle):(c=document.createElement('i'),c.classList.add('icon'),c.innerHTML=''),c}function d(a){let d=document.createElement('div'),f=c(this.agent.mic,this.agent),g=document.createElement('dialog');g.innerHTML='

Listening ...

',e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),document.body.appendChild(d),d.addEventListener('click',a)}function e(a){this.agent=new f,Object.assign(this.agent,k,a),this.agent.onresult=l.bind(this.agent),this.agent.onspeechend=h.bind(this.agent),this.agent.onerror=i.bind(this.agent),this.agent.onnomatch=j.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=a.SpeechRecognition||a.webkitSpeechRecognition;if(!f)return!1;const g=`.vs,.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite}@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff}.vs .icon{display:inline-block;border-radius:50%;width:60px;height:60px;background:-webkit-radial-gradient(#ff8308,#ec9f52);color:#fff;box-shadow:0 0 5px #000;padding-top:10px}.vs dialog .icon{animation-name:listening;box-shadow:0 0 50px #afabab}.vs .icon path{fill:#fff}.vs dialog{position:fixed; width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}`,h=function(){e.mic.style.animationName='none',this.stop()},i=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},j=function(){console.log('Could not recognise the speech, try again...'),this.stop()},k={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},l=function(a){var b,c=a.results[0][0].transcript.toLowerCase();a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${c}'`,b=this.dictionary[c]?dictionary[c]:this.baseUrl+'?q='+encodeURI(c),'function'==typeof this.cb&&this.cb(c,b),window.location=b};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}}); +(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=3)})({3:function(){(function(a){'use strict';function b(){let a=document.head||document.getElementsByTagName('head')[0],b=document.createElement('style');b.type='text/css',b.styleSheet?b.styleSheet.cssText=g:b.appendChild(document.createTextNode(g)),a.appendChild(b)}function c(a,b){var c;return'fontawesome'===a?(c=document.createElement('i'),c.className='fa fa-microphone',c.style=iconStyle):'icon'===a?(c=document.createElement('img'),c.src=b.icon,c.style=imgStyle):(c=document.createElement('i'),c.classList.add('icon'),c.innerHTML=''),c}function d(a){let d=document.createElement('div'),f=c(this.agent.mic,this.agent),g=document.createElement('dialog');g.innerHTML='

Listening ...

',e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),document.body.appendChild(d),d.addEventListener('click',a)}function e(a){this.agent=new f,Object.assign(this.agent,k,a),this.agent.onresult=l.bind(this.agent),this.agent.onspeechend=h.bind(this.agent),this.agent.onerror=i.bind(this.agent),this.agent.onnomatch=j.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=a.SpeechRecognition||a.webkitSpeechRecognition;if(!f)return!1;const g=`.vs,.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite}@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff}.vs .icon{display:inline-block;border-radius:50%;width:60px;height:60px;background:-webkit-radial-gradient(#ff8308,#ec9f52);color:#fff;box-shadow:0 0 5px #000;padding-top:10px}.vs dialog .icon{animation-name:listening;box-shadow:0 0 50px #afabab}.vs .icon path{fill:#fff}.vs dialog{position:fixed; width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}`,h=function(){e.mic.style.animationName='none',this.stop()},i=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},j=function(){console.log('Could not recognise the speech, try again...'),this.stop()},k={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},l=function(a){var b,c=a.results[0][0].transcript.toLowerCase();a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${c}'`,b=this.dictionary[c]?dictionary[c]:this.baseUrl+'?q='+encodeURI(c),'function'==typeof this.cb&&this.cb(c,b),window.location=b};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}}); //# sourceMappingURL=vs.b.js.map \ No newline at end of file diff --git a/d/vs.b.js.map b/d/vs.b.js.map index 0eaaa73..dfea34d 100644 --- a/d/vs.b.js.map +++ b/d/vs.b.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 62ad087b6755785796b1","webpack:///./vs.bottom.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,2BC/CA,aACA,CAEA,yBA0DA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,gBACA,IAEA,GAkBA,MAjBA,4CACA,iBACA,2BAEA,WACA,qCACA,eACA,aAIA,oCACA,qBACA,oBAGA,+SAGA,cACA,8BACA,+BACA,gCACA,YAIA,UAFA,2CAIA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,6BAEA,mDACA,yCAEA,WACA,iBACA,6BAEA,kCACA,UAEA,cAgCA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCAEA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,8BA1LA,2BACA,GAmCA,iBAEA,0jCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IAsEA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,IAGA,gCAFA,gBAIA,wEAA6E,iBAE7E,WACA,cAEA,iCAGA,aACA,iCAGA,eACA,UAEA,8BAgCA,2BACA,uBACA,OAEA,6BACA,2BACA,kBACA,MAEA,8BACA,2BACA,kBACA,OAEA,IAEA,aAAC","file":"vs.b.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 62ad087b6755785796b1","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\n\n\n(function(root) {\n \"use strict\";\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if(!WebSpeechRecognition){\n return false;\n }\n\n// const styles = `\n// @keyframes listening{\n// 0%{box-shadow: 0px 0px 50px #afabab;}\n// 10%{box-shadow: 0px 0px 45px #afabab;}\n// 20%{box-shadow: 0px 0px 43px #afabab;}\n// 30%{box-shadow: 0px 0px 40px #afabab;}\n// 40%{box-shadow: 0px 0px 30px #afabab;}\n// 50%{box-shadow: 0px 0px 27px #afabab;}\n// 60%{box-shadow: 0px 0px 25px #afabab;}\n// 70%{box-shadow: 0px 0px 20px #afabab;}\n// 80%{box-shadow: 0px 0px 15px #afabab;}\n// 90%{box-shadow: 0px 0px 10px #afabab;}\n// 100%{box-shadow: 0px 0px 0px #afabab;}\n// }\n// .vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite;}\n// .vs .icon{\n// display: inline-block;\n// border-radius: 50%;\n// width: 60px;\n// height: 60px;\n// background: -webkit-radial-gradient(#ff8308,#ec9f52);\n// color: #fff;\n// box-shadow: 0px 0px 5px #000;\n// padding-top: 10px;\n// }\n// .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;}\n// .vs .icon path{fill:#fff}\n// .vs dialog{position:fixed; width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n// .vs .vs-head{font-size: 1em;}\n// .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n// `;\n \n const styles = `.vs,.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite}@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff}.vs .icon{display:inline-block;border-radius:50%;width:60px;height:60px;background:-webkit-radial-gradient(#ff8308,#ec9f52);color:#fff;box-shadow:0 0 5px #000;padding-top:10px}.vs dialog .icon{animation-name:listening;box-shadow:0 0 50px #afabab}.vs .icon path{fill:#fff}.vs dialog{position:fixed; width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}`;\n\n const onspeechend = function() {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function(event) { \n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function() {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory(type, options){\n var icon;\n switch (type) {\n case 'fontawesome':\n icon = document.createElement('i');\n icon.className = 'fa fa-microphone';\n icon.style = iconStyle;\n break;\n case 'icon': {\n icon = document.createElement('img');\n icon.src = options.icon;\n icon.style = imgStyle;\n }\n break;\n default: {\n icon = document.createElement('i');\n icon.classList.add('icon');\n icon.innerHTML = ''\n }\n }\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory(this.agent.mic, this.agent);\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n\n dialog.innerHTML = header;\n\n Recognition.dialog = dialog;\n\n addStyle();\n \n container.classList.add('vs');\n\n if(this.agent.bgColor){\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if(this.agent.borderColor){\n container.style.borderColor = this.agent.borderColor;\n }\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n document.body.appendChild(container);\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function(event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var url;\n\n event.stopImmediatePropagation();\n\n Recognition.dialog.querySelector('.vs-head').innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if(typeof this.cb === 'function'){\n this.cb(keyword, url);\n }\n\n window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n\n this.agent.onstart = function(){ \n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function(){\n Recognition.dialogHead.innerHTML = 'Listening ...'\n };\n this.agent.onsoundend = function(){\n Recognition.mic.style.animationName = 'none';\n };\n this.agent.onaudiostart = function(){\n Recognition.dialogHead.innerHTML = 'Speak Now ...'\n };\n this.agent.onaudioend = function(){\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function() {\n Recognition.mic.style.animationName = 'listening';\n this.agent.start();\n };\n\n Recognition.prototype.stop = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.stop();\n };\n\n Recognition.prototype.abort = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.bottom.js\n// module id = 4\n// module chunks = 4"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap be808d9344b390408bca","webpack:///./vs.bottom.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,2BC/CA,aACA,CAEA,yBA0DA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,gBACA,IAEA,GAkBA,MAjBA,4CACA,iBACA,2BAEA,WACA,qCACA,eACA,aAIA,oCACA,qBACA,oBAGA,+SAGA,cACA,8BACA,+BACA,gCACA,YAIA,UAFA,2CAIA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,6BAEA,mDACA,yCAEA,WACA,iBACA,6BAEA,kCACA,UAEA,cAgCA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCAEA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,8BA1LA,2BACA,GAmCA,iBAEA,0jCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IAsEA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,IAGA,gCAFA,gBAIA,wEAA6E,iBAE7E,WACA,cAEA,iCAGA,aACA,iCAGA,eACA,UAEA,8BAgCA,2BACA,uBACA,OAEA,6BACA,2BACA,kBACA,MAEA,8BACA,2BACA,kBACA,OAEA,IAEA,aAAC","file":"vs.b.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap be808d9344b390408bca","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\n\n\n(function(root) {\n \"use strict\";\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if(!WebSpeechRecognition){\n return false;\n }\n\n// const styles = `\n// @keyframes listening{\n// 0%{box-shadow: 0px 0px 50px #afabab;}\n// 10%{box-shadow: 0px 0px 45px #afabab;}\n// 20%{box-shadow: 0px 0px 43px #afabab;}\n// 30%{box-shadow: 0px 0px 40px #afabab;}\n// 40%{box-shadow: 0px 0px 30px #afabab;}\n// 50%{box-shadow: 0px 0px 27px #afabab;}\n// 60%{box-shadow: 0px 0px 25px #afabab;}\n// 70%{box-shadow: 0px 0px 20px #afabab;}\n// 80%{box-shadow: 0px 0px 15px #afabab;}\n// 90%{box-shadow: 0px 0px 10px #afabab;}\n// 100%{box-shadow: 0px 0px 0px #afabab;}\n// }\n// .vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite;}\n// .vs .icon{\n// display: inline-block;\n// border-radius: 50%;\n// width: 60px;\n// height: 60px;\n// background: -webkit-radial-gradient(#ff8308,#ec9f52);\n// color: #fff;\n// box-shadow: 0px 0px 5px #000;\n// padding-top: 10px;\n// }\n// .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;}\n// .vs .icon path{fill:#fff}\n// .vs dialog{position:fixed; width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n// .vs .vs-head{font-size: 1em;}\n// .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n// `;\n \n const styles = `.vs,.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite}@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{z-index:2;position:fixed;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff}.vs .icon{display:inline-block;border-radius:50%;width:60px;height:60px;background:-webkit-radial-gradient(#ff8308,#ec9f52);color:#fff;box-shadow:0 0 5px #000;padding-top:10px}.vs dialog .icon{animation-name:listening;box-shadow:0 0 50px #afabab}.vs .icon path{fill:#fff}.vs dialog{position:fixed; width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}`;\n\n const onspeechend = function() {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function(event) { \n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function() {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory(type, options){\n var icon;\n switch (type) {\n case 'fontawesome':\n icon = document.createElement('i');\n icon.className = 'fa fa-microphone';\n icon.style = iconStyle;\n break;\n case 'icon': {\n icon = document.createElement('img');\n icon.src = options.icon;\n icon.style = imgStyle;\n }\n break;\n default: {\n icon = document.createElement('i');\n icon.classList.add('icon');\n icon.innerHTML = ''\n }\n }\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory(this.agent.mic, this.agent);\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n\n dialog.innerHTML = header;\n\n Recognition.dialog = dialog;\n\n addStyle();\n \n container.classList.add('vs');\n\n if(this.agent.bgColor){\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if(this.agent.borderColor){\n container.style.borderColor = this.agent.borderColor;\n }\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n document.body.appendChild(container);\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function(event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var url;\n\n event.stopImmediatePropagation();\n\n Recognition.dialog.querySelector('.vs-head').innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if(typeof this.cb === 'function'){\n this.cb(keyword, url);\n }\n\n window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n\n this.agent.onstart = function(){ \n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function(){\n Recognition.dialogHead.innerHTML = 'Listening ...'\n };\n this.agent.onsoundend = function(){\n Recognition.mic.style.animationName = 'none';\n };\n this.agent.onaudiostart = function(){\n Recognition.dialogHead.innerHTML = 'Speak Now ...'\n };\n this.agent.onaudioend = function(){\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function() {\n Recognition.mic.style.animationName = 'listening';\n this.agent.start();\n };\n\n Recognition.prototype.stop = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.stop();\n };\n\n Recognition.prototype.abort = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.bottom.js\n// module id = 3\n// module chunks = 4"],"sourceRoot":""} \ No newline at end of file diff --git a/d/vs.c.js b/d/vs.c.js index 97550a3..b72e6b9 100644 --- a/d/vs.c.js +++ b/d/vs.c.js @@ -1,2 +1,2 @@ -(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=0)})([function(){(function(a){function b(a){this.data=a.options,this.filterNames=a.filterNames}function c(){this.filtersToBeHandled=['size','price'],this.viewType={MOBILE:'mobileData',DESKTOP:'desktopData'},this.desktopData={size:['Size','Shoe Size'],price:['Price'],popupElement:$('#allFilterPopupTop'),element:function(a){return $(`.filterLeftContent > .h6[data-ref="${a}_tab"]`)}},this.mobileData={size:['standard_size','sh_size'],price:['price'],popupElement:$('#mobile-filter'),element:function(a){return $(`#filter-container > li.${a}>.h6`)}},this.filterTrigger='jb:catalog:onMobileFilterApplied'}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}function e(b){a.location=k+'?q='+encodeURI(b)}function f(){a.Recognition.dialog.open&&a.Recognition.dialog.close()}function g(a,b){if(a)return a;return b?b:''}function h(){if(a.sessionStorage)return sessionStorage.getItem('cat')}function j(b,c){a.sessionStorage&&sessionStorage.setItem('cat',g(b,c))}function i(a){this.store=new b(a),this.domManipulator=new c,this.selectedFilters}var k='https://dev.jabong.com/find/',l=$('#search');b.prototype.get=function(a,b){var c;return this.data&&this.data[a]&&this.data[a][b]&&(c=this.data[a][b]),c},c.prototype.getElement=function(a,b){var c,d=this[a];for(let e of d[b])if(c=d.element(e),c[0])return c;return c},c.prototype.openPopUp=function(a,b){var c=this.getElement(a,b);return!!c[0]&&($(this[a].popupElement).click(),c.click(),!0)},c.prototype.checkWordForPopup=function(a){return!!this.filtersToBeHandled.includes(a)&&(setTimeout(f,1e3),m()?this.openPopUp(this.viewType.DESKTOP,a):this.openPopUp(this.viewType.MOBILE,a))};var m=function(){var b=!0;return($('html').hasClass('touch-enabled')&&1024>=$(a).width()||1024>$(a).width())&&(b=!1),function(){return b}}();i.prototype.getFromSearchBox=function(){if(''!==l.val()){var a=l.val();return words=a.split(' '),this.getCategoryWord('categories',words)}return''},i.prototype.getCategoryWord=function(a,b){for(var c=0;c=this.selectedFilters.length&&e(c),b&&$(a).trigger(this.domManipulator.filterTrigger,[this.selectedFilters])},i.prototype.filters=function(a){for(var b,c=0;c .h6[data-ref="${a}_tab"]`)}},this.mobileData={size:['standard_size','sh_size'],price:['price'],popupElement:$('#mobile-filter'),element:function(a){return $(`#filter-container > li.${a}>.h6`)}},this.filterTrigger='jb:catalog:onMobileFilterApplied'}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}function e(b){a.location=k+'?q='+encodeURI(b)}function f(){a.Recognition.dialog.open&&a.Recognition.dialog.close()}function g(a,b){if(a)return a;return b?b:''}function h(){if(a.sessionStorage)return sessionStorage.getItem('cat')}function j(b,c){a.sessionStorage&&sessionStorage.setItem('cat',g(b,c))}function i(a){this.store=new b(a),this.domManipulator=new c,this.selectedFilters}var k=`https://${a.location.host}`,l=$('#search');b.prototype.get=function(a,b){var c;return this.data&&this.data[a]&&this.data[a][b]&&(c=this.data[a][b]),c},c.prototype.getElement=function(a,b){var c,d=this[a];for(let e of d[b])if(c=d.element(e),c[0])return c;return c},c.prototype.openPopUp=function(a,b){var c=this.getElement(a,b);return!!c[0]&&($(this[a].popupElement).click(),c.click(),!0)},c.prototype.checkWordForPopup=function(a){return!!this.filtersToBeHandled.includes(a)&&(setTimeout(f,1e3),m()?this.openPopUp(this.viewType.DESKTOP,a):this.openPopUp(this.viewType.MOBILE,a))};var m=function(){var b=!0;return($('html').hasClass('touch-enabled')&&1024>=$(a).width()||1024>$(a).width())&&(b=!1),function(){return b}}();i.prototype.getFromSearchBox=function(){if(''!==l.val()){var a=l.val();return words=a.split(' '),this.getCategoryWord('categories',words)}return''},i.prototype.getCategoryWord=function(a,b){for(var c=0;c=this.selectedFilters.length&&e(c),b&&$(a).trigger(this.domManipulator.filterTrigger,[this.selectedFilters])},i.prototype.filters=function(a){for(var b,c=0;c .h6[data-ref=\"${type}_tab\"]`);\n\t\t\t}\n\t\t};\n\t\tthis.mobileData = {\n\t\t\tsize: ['standard_size', 'sh_size'],\n\t\t\tprice: ['price'],\n\t\t\tpopupElement: $('#mobile-filter'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`#filter-container > li.${type}>.h6`);\n\t\t\t}\n\t\t};\n\t\tthis.filterTrigger = 'jb:catalog:onMobileFilterApplied';\n\t}\n\n\tDOMManipulator.prototype.getElement = function (viewType, word) {\n\t\tvar viewTypeData = this[viewType];\n\t\tvar domElement;\n\n\t\tfor (let value of viewTypeData[word]) {\n\t\t\tdomElement = viewTypeData.element(value);\n\t\t\tif (domElement[0]) {\n\t\t\t\treturn domElement;\n\t\t\t}\n\t\t}\n\t\treturn domElement;\n\t}\n\n\tDOMManipulator.prototype.openPopUp = function (viewType, word) {\n\t\tvar domElement = this.getElement(viewType, word);\n\t\tif (domElement[0]) {\n\t\t\t$(this[viewType].popupElement).click();\n\t\t\tdomElement.click();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tDOMManipulator.prototype.checkWordForPopup = function (word) {\n\t\tif (this.filtersToBeHandled.includes(word)) {\n\t\t\tsetTimeout(closeDialog, 1000);\n\t\t\tif (isDesktop()) {\n\t\t\t\treturn this.openPopUp(this.viewType.DESKTOP, word);\n\t\t\t} else {\n\t\t\t\treturn this.openPopUp(this.viewType.MOBILE, word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}\n\n\tfunction redirect(keyword) {\n\t\twindow.location = baseUrl + \"?q=\" + encodeURI(keyword);\n\t}\n\n\tfunction closeDialog() {\n\t\tif (window.Recognition.dialog.open) {\n\t\t\twindow.Recognition.dialog.close();\n\t\t}\n\t}\n\n\tfunction addInSession(newCategoryWord, oldCategoryWord) {\n\t\tif (newCategoryWord) {\n\t\t\treturn newCategoryWord;\n\t\t} else if (oldCategoryWord) {\n\t\t\treturn oldCategoryWord;\n\t\t}\n\t\t// This is passed when a category not present in array is encountered\n\t\treturn '';\n\t}\n\n\tfunction getFromSession() {\n\t\tif (window.sessionStorage) {\n\t\t\treturn sessionStorage.getItem('cat');\n\t\t}\n\t}\n\n\tfunction storeInSession(newCategoryWord, oldCategory) {\n\t\tif (window.sessionStorage) {\n\t\t\tsessionStorage.setItem('cat', addInSession(newCategoryWord, oldCategory));\n\t\t}\n\t}\n\n\tvar isDesktop = (function () {\n\t\tvar isDesktop = true;\n\t\tif (($('html').hasClass('touch-enabled') && $(window).width() <= 1024) || $(window).width() < 1024) {\n\t\t\tisDesktop = false;\n\t\t}\n\t\treturn function () {\n\t\t\treturn isDesktop;\n\t\t};\n\t})();\n\n\n\tfunction VoiceTextHandler(data) {\n\t\tthis.store = new Store(data);\n\t\tthis.domManipulator = new DOMManipulator();\n\t\tthis.selectedFilters;\n\t}\n\n\tVoiceTextHandler.prototype.getFromSearchBox = function () {\n\t\tif ($searchValue.val() !== '') {\n\t\t\tvar query = $searchValue.val();\n\t\t\twords = query.split(\" \");\n\t\t\treturn this.getCategoryWord('categories', words)\n\t\t}\n\t\treturn '';\n\t}\n\n\tVoiceTextHandler.prototype.getCategoryWord = function (baseKey, nestedKey) {\n\t\tfor (var i = 0; i < nestedKey.length; i++) {\n\t\t\tfor (var j = 0; j < nestedKey.length; j++) {\n\n\t\t\t\t// A check for n-grams if available in the categories\n\t\t\t\tvar joinedStr = nestedKey.slice(i, j + 1).join(\" \");\n\t\t\t\tif (this.store.get(baseKey, joinedStr)) {\n\t\t\t\t\treturn joinedStr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n\tVoiceTextHandler.prototype.applyFilter = function (redirectFlag, keyword) {\n\t\tsetTimeout(closeDialog, 1000);\n\t\tif (redirectFlag && this.selectedFilters.length <= 0) {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tif (redirectFlag) {\n\t\t\t$(window).trigger(this.domManipulator.filterTrigger, [this.selectedFilters]);\n\t\t}\n\t}\n\n\tVoiceTextHandler.prototype.filters = function (nestedKey) {\n\t\tfor (var i = 0; i < this.store.filterNames.length; i++) {\n\t\t\tvar identifier = this.store.get(this.store.filterNames[i], nestedKey);\n\t\t\tif (identifier) {\n\t\t\t\tthis.selectedFilters.push({\n\t\t\t\t\tparent: this.store.filterNames[i],\n\t\t\t\t\tvalue: capitalizeFirstLetter(nestedKey),\n\t\t\t\t\ttype: identifier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tVoiceTextHandler.prototype.checkFilter = function (keyword) {\n\t\tvar popupOpened = false;\n\t\tvar words = keyword.split(\" \");\n\t\tthis.selectedFilters = [];\n\n\t\tvar oldCategory = getFromSession() || this.getFromSearchBox();\n\t\tvar newCategory = this.getCategoryWord('categories', words);\n\n\t\tif (!oldCategory || oldCategory !== newCategory) {\n\t\t\tfor (var i = 0; i < words.length; i++) {\n\t\t\t\tif (this.domManipulator.filtersToBeHandled.includes(words[i])) {\n\t\t\t\t\tpopupOpened = this.domManipulator.checkWordForPopup(words[i]);\n\t\t\t\t}\n\t\t\t\tpopupOpened = true;\n\t\t\t\tif (popupOpened) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tthis.filters(words[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.applyFilter(!popupOpened, keyword);\n\t\t} else {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tstoreInSession(newCategory, oldCategory);\n\t};\n\twindow.VoiceTextHandler = new VoiceTextHandler({\n\t\toptions: {\n\t\t\t'categories': {\n\t\t\t\t'shoes': 'true', 'jewellery': 'true', 'accessories': 'true', 'home and furniture': 'true', 'sports': 'true',\n\t\t\t\t'clothing': 'true', 'peep toes': 'true', 'toys': 'true', 'kids toys': 'true', 'kids shoes': 'true', 'sandals': 'true', 'slippers': 'true',\n\t\t\t\t'sneakers': 'true', 'flip flops': 'true', 'bellies': 'true', 'formal shoes': 'true', 'boots': 'true', 'floaters': 'true', 'beauty': 'true',\n\t\t\t\t'women beauty': 'true', 'fragrances': 'true', 'perfumes and edts': 'true', 'deodorants and colognes': 'true', 'gift sets': 'true',\n\t\t\t\t'make up': 'true', 'lips': 'true', 'lipstick': 'true', 'lip gloss': 'true', 'lip liner': 'true', 'lip pencil': 'true', 'lip pallete': 'true',\n\t\t\t\t'lip brush': 'true', 'eye': 'true', 'kajal': 'true', 'eye liner': 'true', 'kurta': 'true', 'kurti': 'true', 'suits': 'true',\n\t\t\t\t'saree': 'true', 'tops': 'true', 'tees': 'true', 'shirt': 'true', 'jeans': 'true', 'leggings': 'true', 'sunglasses': 'true', 'dresses': 'true',\n\t\t\t\t'watches': 'true', 'polos': 'true', 'shorts': 'true', 'skirts': 'true'\n\t\t\t},\n\t\t\t'colors': {\n\t\t\t\t'black': 'checkbox', 'brown': 'checkbox', 'purple': 'checkbox', 'blue': 'checkbox', 'red': 'checkbox',\n\t\t\t\t'green': 'checkbox', 'tan': 'checkbox', 'transparent': 'checkbox', 'white': 'checkbox', 'yellow': 'checkbox',\n\t\t\t\t'maroon': 'checkbox', 'orange': 'checkbox', 'copper': 'checkbox', 'silver': 'checkbox', 'khaki': 'checkbox'\n\t\t\t},\n\t\t\t'gender': {\n\t\t\t\t'men': 'input', 'women': 'input', 'kids': 'input', 'girls': 'input', 'boys': 'input', 'unisex': 'input'\n\t\t\t}\n\t\t},\n\t\tfilterNames: ['colors', 'gender']\n\t});\n\n})(window);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.catalog.initiator.js\n// module id = 0\n// module chunks = 0 3"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap be808d9344b390408bca","webpack:///./vs.catalog.initiator.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,0BC5DA,YACA,cAIA,WACA,2BACA,aAEA,aASA,MACA,kDACA,QACA,qBAEA,gCACA,CACA,0BACA,+BACA,yCACA,UAAmD,uCACnD,SAEA,mBACA,CACA,iCACA,+BACA,qCACA,UAAuC,2BACvC,OAEA,sBACA,kCAEA,cAoCA,0CACA,EAEA,cACA,oBACA,YAEA,aACA,sBACA,2BAEA,OAEA,gBACA,CACA,KAKA,oBACA,EAEA,aACA,MACA,6CAEA,MAEA,gBACA,GACA,6CAEA,OAEA,cAYA,YACA,6BACA,WACA,eAEA,kBAjI0B,eAC1B,OAEA,wCAMA,IACA,GAIA,qCAHA,oBAEA,aAGA,sCA0BA,IAGA,KAFA,oBAGA,aACA,aACA,GAGA,SACA,QAEA,qCACA,YACA,0BACA,6BACA,UAIA,WAEA,2CACA,iCACA,cACA,kBACA,iCAEA,wCAIA,UAEA,kBAqCA,IACA,sEACA,qBAEA,gBACA,CACA,QACA,CAGA,2CAOA,iBACA,SACA,2BACA,uCACA,MACA,OACA,EAEA,2CACA,WAAiB,MAAsB,OACvC,gBAAkB,MAAsB,OAGxC,6BACA,gBACA,SAIA,eACA,EAEA,uCACA,CACA,qBACA,gCAGA,6DAEA,iBAEA,iCACA,aAAiB,2BAAmC,OACpD,gCAEA,+CACA,mBACA,qBACA,KAIA,QAEA,qCACA,IACA,gBACA,UAEA,mCACA,0CAEA,6BACA,WAAkB,MAAkB,yDAEpC,gDAEA,OAIA,SAPA,iBAUA,uBACA,KACA,KAEA,MACA,MACA,2BACA,CAoBA,osCAGA,iCAAC,G","file":"vs.c.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap be808d9344b390408bca","\n(function (window) {\n\tvar baseUrl = `https://${window.location.host}`,\n\t\t$searchValue = $('#search');\n\n\tfunction Store(data) {\n\t\tthis.data = data['options'];\n\t\tthis.filterNames = data['filterNames'];\n\t}\n\n\tStore.prototype.get = function (baseKey, nestedKey) {\n\t\tvar returnVal;\n\t\tif (this.data && this.data[baseKey] && this.data[baseKey][nestedKey]) {\n\t\t\treturnVal = this.data[baseKey][nestedKey];\n\t\t}\n\t\treturn returnVal;\n\t};\n\n\tfunction DOMManipulator() {\n\t\tthis.filtersToBeHandled = ['size', 'price'];\n\t\tthis.viewType = {\n\t\t\tMOBILE: 'mobileData',\n\t\t\tDESKTOP: 'desktopData'\n\t\t};\n\t\tthis.desktopData = {\n\t\t\tsize: ['Size', 'Shoe Size'],\n\t\t\tprice: ['Price'],\n\t\t\tpopupElement: $('#allFilterPopupTop'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`.filterLeftContent > .h6[data-ref=\"${type}_tab\"]`);\n\t\t\t}\n\t\t};\n\t\tthis.mobileData = {\n\t\t\tsize: ['standard_size', 'sh_size'],\n\t\t\tprice: ['price'],\n\t\t\tpopupElement: $('#mobile-filter'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`#filter-container > li.${type}>.h6`);\n\t\t\t}\n\t\t};\n\t\tthis.filterTrigger = 'jb:catalog:onMobileFilterApplied';\n\t}\n\n\tDOMManipulator.prototype.getElement = function (viewType, word) {\n\t\tvar viewTypeData = this[viewType];\n\t\tvar domElement;\n\n\t\tfor (let value of viewTypeData[word]) {\n\t\t\tdomElement = viewTypeData.element(value);\n\t\t\tif (domElement[0]) {\n\t\t\t\treturn domElement;\n\t\t\t}\n\t\t}\n\t\treturn domElement;\n\t}\n\n\tDOMManipulator.prototype.openPopUp = function (viewType, word) {\n\t\tvar domElement = this.getElement(viewType, word);\n\t\tif (domElement[0]) {\n\t\t\t$(this[viewType].popupElement).click();\n\t\t\tdomElement.click();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tDOMManipulator.prototype.checkWordForPopup = function (word) {\n\t\tif (this.filtersToBeHandled.includes(word)) {\n\t\t\tsetTimeout(closeDialog, 1000);\n\t\t\tif (isDesktop()) {\n\t\t\t\treturn this.openPopUp(this.viewType.DESKTOP, word);\n\t\t\t} else {\n\t\t\t\treturn this.openPopUp(this.viewType.MOBILE, word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}\n\n\tfunction redirect(keyword) {\n\t\twindow.location = baseUrl + \"?q=\" + encodeURI(keyword);\n\t}\n\n\tfunction closeDialog() {\n\t\tif (window.Recognition.dialog.open) {\n\t\t\twindow.Recognition.dialog.close();\n\t\t}\n\t}\n\n\tfunction addInSession(newCategoryWord, oldCategoryWord) {\n\t\tif (newCategoryWord) {\n\t\t\treturn newCategoryWord;\n\t\t} else if (oldCategoryWord) {\n\t\t\treturn oldCategoryWord;\n\t\t}\n\t\t// This is passed when a category not present in array is encountered\n\t\treturn '';\n\t}\n\n\tfunction getFromSession() {\n\t\tif (window.sessionStorage) {\n\t\t\treturn sessionStorage.getItem('cat');\n\t\t}\n\t}\n\n\tfunction storeInSession(newCategoryWord, oldCategory) {\n\t\tif (window.sessionStorage) {\n\t\t\tsessionStorage.setItem('cat', addInSession(newCategoryWord, oldCategory));\n\t\t}\n\t}\n\n\tvar isDesktop = (function () {\n\t\tvar isDesktop = true;\n\t\tif (($('html').hasClass('touch-enabled') && $(window).width() <= 1024) || $(window).width() < 1024) {\n\t\t\tisDesktop = false;\n\t\t}\n\t\treturn function () {\n\t\t\treturn isDesktop;\n\t\t};\n\t})();\n\n\n\tfunction VoiceTextHandler(data) {\n\t\tthis.store = new Store(data);\n\t\tthis.domManipulator = new DOMManipulator();\n\t\tthis.selectedFilters;\n\t}\n\n\tVoiceTextHandler.prototype.getFromSearchBox = function () {\n\t\tif ($searchValue.val() !== '') {\n\t\t\tvar query = $searchValue.val();\n\t\t\twords = query.split(\" \");\n\t\t\treturn this.getCategoryWord('categories', words)\n\t\t}\n\t\treturn '';\n\t}\n\n\tVoiceTextHandler.prototype.getCategoryWord = function (baseKey, nestedKey) {\n\t\tfor (var i = 0; i < nestedKey.length; i++) {\n\t\t\tfor (var j = 0; j < nestedKey.length; j++) {\n\n\t\t\t\t// A check for n-grams if available in the categories\n\t\t\t\tvar joinedStr = nestedKey.slice(i, j + 1).join(\" \");\n\t\t\t\tif (this.store.get(baseKey, joinedStr)) {\n\t\t\t\t\treturn joinedStr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n\tVoiceTextHandler.prototype.applyFilter = function (redirectFlag, keyword) {\n\t\tsetTimeout(closeDialog, 1000);\n\t\tif (redirectFlag && this.selectedFilters.length <= 0) {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tif (redirectFlag) {\n\t\t\t$(window).trigger(this.domManipulator.filterTrigger, [this.selectedFilters]);\n\t\t}\n\t}\n\n\tVoiceTextHandler.prototype.filters = function (nestedKey) {\n\t\tfor (var i = 0; i < this.store.filterNames.length; i++) {\n\t\t\tvar identifier = this.store.get(this.store.filterNames[i], nestedKey);\n\t\t\tif (identifier) {\n\t\t\t\tthis.selectedFilters.push({\n\t\t\t\t\tparent: this.store.filterNames[i],\n\t\t\t\t\tvalue: capitalizeFirstLetter(nestedKey),\n\t\t\t\t\ttype: identifier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tVoiceTextHandler.prototype.checkFilter = function (keyword) {\n\t\tvar popupOpened = false;\n\t\tvar words = keyword.split(\" \");\n\t\tthis.selectedFilters = [];\n\n\t\tvar oldCategory = getFromSession() || this.getFromSearchBox();\n\t\tvar newCategory = this.getCategoryWord('categories', words);\n\n\t\tif (!oldCategory || oldCategory !== newCategory) {\n\t\t\tfor (var i = 0; i < words.length; i++) {\n\t\t\t\tif (this.domManipulator.filtersToBeHandled.includes(words[i])) {\n\t\t\t\t\tpopupOpened = this.domManipulator.checkWordForPopup(words[i]);\n\t\t\t\t}\n\t\t\t\tpopupOpened = true;\n\t\t\t\tif (popupOpened) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tthis.filters(words[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.applyFilter(!popupOpened, keyword);\n\t\t} else {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tstoreInSession(newCategory, oldCategory);\n\t};\n\twindow.VoiceTextHandler = new VoiceTextHandler({\n\t\toptions: {\n\t\t\t'categories': {\n\t\t\t\t'shoes': 'true', 'jewellery': 'true', 'accessories': 'true', 'home and furniture': 'true', 'sports': 'true',\n\t\t\t\t'clothing': 'true', 'peep toes': 'true', 'toys': 'true', 'kids toys': 'true', 'kids shoes': 'true', 'sandals': 'true', 'slippers': 'true',\n\t\t\t\t'sneakers': 'true', 'flip flops': 'true', 'bellies': 'true', 'formal shoes': 'true', 'boots': 'true', 'floaters': 'true', 'beauty': 'true',\n\t\t\t\t'women beauty': 'true', 'fragrances': 'true', 'perfumes and edts': 'true', 'deodorants and colognes': 'true', 'gift sets': 'true',\n\t\t\t\t'make up': 'true', 'lips': 'true', 'lipstick': 'true', 'lip gloss': 'true', 'lip liner': 'true', 'lip pencil': 'true', 'lip pallete': 'true',\n\t\t\t\t'lip brush': 'true', 'eye': 'true', 'kajal': 'true', 'eye liner': 'true', 'kurta': 'true', 'kurti': 'true', 'suits': 'true',\n\t\t\t\t'saree': 'true', 'tops': 'true', 'tees': 'true', 'shirt': 'true', 'jeans': 'true', 'leggings': 'true', 'sunglasses': 'true', 'dresses': 'true',\n\t\t\t\t'watches': 'true', 'polos': 'true', 'shorts': 'true', 'skirts': 'true'\n\t\t\t},\n\t\t\t'colors': {\n\t\t\t\t'black': 'checkbox', 'brown': 'checkbox', 'purple': 'checkbox', 'blue': 'checkbox', 'red': 'checkbox',\n\t\t\t\t'green': 'checkbox', 'tan': 'checkbox', 'transparent': 'checkbox', 'white': 'checkbox', 'yellow': 'checkbox',\n\t\t\t\t'maroon': 'checkbox', 'orange': 'checkbox', 'copper': 'checkbox', 'silver': 'checkbox', 'khaki': 'checkbox'\n\t\t\t},\n\t\t\t'gender': {\n\t\t\t\t'men': 'input', 'women': 'input', 'kids': 'input', 'girls': 'input', 'boys': 'input', 'unisex': 'input'\n\t\t\t}\n\t\t},\n\t\tfilterNames: ['colors', 'gender']\n\t});\n\n})(window);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.catalog.initiator.js\n// module id = 0\n// module chunks = 0 1 3"],"sourceRoot":""} \ No newline at end of file diff --git a/d/vs.js b/d/vs.js index 696df84..d79efc0 100644 --- a/d/vs.js +++ b/d/vs.js @@ -1,2 +1,2 @@ -(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=1)})([,function(){(function(a){'use strict';function b(){let a=document.head||document.getElementsByTagName('head')[0],b=document.createElement('style');b.type='text/css',b.styleSheet?b.styleSheet.cssText=j:b.appendChild(document.createTextNode(j)),a.appendChild(b)}function c(a,b){var c;return'fontawesome'===a?(c=document.createElement('i'),c.className='fa fa-microphone',c.style=h):'icon'===a?(c=document.createElement('img'),c.src=b.icon,c.style=i):(c=document.createElement('i'),c.innerHTML=''),c}function d(a){let d=document.createElement('div'),f=c(this.agent.mic,this.agent);e.mic=d,b(),d.style=g,this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),d.appendChild(f),document.body.appendChild(d),d.addEventListener('click',a)}function e(a){this.agent=new f,Object.assign(this.agent,n,a),this.agent.onresult=o.bind(this.agent),this.agent.onspeechend=k.bind(this.agent),this.agent.onerror=l.bind(this.agent),this.agent.onnomatch=m.bind(this.agent),this.agent.onstart=function(){console.log('I am starting')},this.agent.onsoundstart=function(){console.log('Sound Started')},this.agent.onsoundend=function(){console.log('Sound ended')},this.agent.onaudiostart=function(){console.log('Audio Started')},this.agent.onaudioend=function(){console.log('Audio ended')},d.call(this,this.start.bind(this))}var f=a.SpeechRecognition||a.webkitSpeechRecognition;if(!f)return!1;const g='position:fixed;height:45px;width:45px;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite',h='height:25px;position:fixed;display:block;bottom:20px;right:25px;font-size:40px;',i='height:25px;position:fixed;display:block;bottom:20px;right:25px;',j='@keyframes listening{0%{border-width:22.5px}10%{border-width:19px}20%{border-width:16px}30%{border-width:13px}40%{border-width:10px}50%{border-width:8px}60%{border-width:6px}70%{border-width:4px}80%{border-width:2px}90%{border-width:1px}100%{border-width:0}}',k=function(){e.mic.style.animationName='none',this.stop()},l=function(a){console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},m=function(){console.log('Could not recognise the speech, try again...'),this.stop()},n={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},o=function(a){var b,c=a.results[0][0].transcript.toLowerCase();a.stopImmediatePropagation(),b=this.dictionary[c]?dictionary[c]:this.baseUrl+'?q='+encodeURI(c),window.location=b};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}]); +(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=2)})({2:function(){(function(a){'use strict';function b(){let a=document.head||document.getElementsByTagName('head')[0],b=document.createElement('style');b.type='text/css',b.styleSheet?b.styleSheet.cssText=j:b.appendChild(document.createTextNode(j)),a.appendChild(b)}function c(a,b){var c;return'fontawesome'===a?(c=document.createElement('i'),c.className='fa fa-microphone',c.style=h):'icon'===a?(c=document.createElement('img'),c.src=b.icon,c.style=i):(c=document.createElement('i'),c.innerHTML=''),c}function d(a){let d=document.createElement('div'),f=c(this.agent.mic,this.agent);e.mic=d,b(),d.style=g,this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),d.appendChild(f),document.body.appendChild(d),d.addEventListener('click',a)}function e(a){this.agent=new f,Object.assign(this.agent,n,a),this.agent.onresult=o.bind(this.agent),this.agent.onspeechend=k.bind(this.agent),this.agent.onerror=l.bind(this.agent),this.agent.onnomatch=m.bind(this.agent),this.agent.onstart=function(){console.log('I am starting')},this.agent.onsoundstart=function(){console.log('Sound Started')},this.agent.onsoundend=function(){console.log('Sound ended')},this.agent.onaudiostart=function(){console.log('Audio Started')},this.agent.onaudioend=function(){console.log('Audio ended')},d.call(this,this.start.bind(this))}var f=a.SpeechRecognition||a.webkitSpeechRecognition;if(!f)return!1;const g='position:fixed;height:45px;width:45px;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite',h='height:25px;position:fixed;display:block;bottom:20px;right:25px;font-size:40px;',i='height:25px;position:fixed;display:block;bottom:20px;right:25px;',j='@keyframes listening{0%{border-width:22.5px}10%{border-width:19px}20%{border-width:16px}30%{border-width:13px}40%{border-width:10px}50%{border-width:8px}60%{border-width:6px}70%{border-width:4px}80%{border-width:2px}90%{border-width:1px}100%{border-width:0}}',k=function(){e.mic.style.animationName='none',this.stop()},l=function(a){console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},m=function(){console.log('Could not recognise the speech, try again...'),this.stop()},n={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},o=function(a){var b,c=a.results[0][0].transcript.toLowerCase();a.stopImmediatePropagation(),b=this.dictionary[c]?dictionary[c]:this.baseUrl+'?q='+encodeURI(c),window.location=b};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}}); //# sourceMappingURL=vs.js.map \ No newline at end of file diff --git a/d/vs.js.map b/d/vs.js.map index 0debf95..c855ea1 100644 --- a/d/vs.js.map +++ b/d/vs.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 62ad087b6755785796b1","webpack:///./vs.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,0BC/CA,aACA,CAEA,yBA4BA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,gBACA,IAEA,GAiBA,MAhBA,4CACA,iBACA,qBAEA,SACA,qCACA,eACA,OAIA,mCACA,iBAGA,KAGA,cACA,8BACA,+BAEA,SACA,MAEA,MAEA,mBACA,6CAGA,oBACA,6CAGA,eACA,6BAEA,kCACA,UAEA,cAyBA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,qCAAoC,4BACpC,qCAAyC,4BACzC,mCAAuC,0BACvC,qCAAyC,4BACzC,mCAAuC,0BAEvC,8BACA,MAEA,8BA5HA,2BACA,GAGA,iBACA,sOACA,oFACA,qEAGA,iRACA,2BACA,YACA,MAEA,eACA,yEACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA0DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,IAGA,gCAFA,gBAIA,kCACA,cAEA,iCAEA,oBACA,UAEA,8BAmBA,2BACA,uBACA,OAEA,6BACA,2BACA,kBACA,MAEA,8BACA,2BACA,kBACA,OAEA,IAEA,aAAC","file":"vs.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 62ad087b6755785796b1","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\n\n\n(function(root) {\n \"use strict\";\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if(!WebSpeechRecognition){\n return false;\n }\n /* Styles */\n const containerStyle = 'position:fixed;height:45px;width:45px;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite';\n const iconStyle = 'height:25px;position:fixed;display:block;bottom:20px;right:25px;font-size:40px;';\n const imgStyle = 'height:25px;position:fixed;display:block;bottom:20px;right:25px;';\n const animationStyle = '@keyframes listening{0%{border-width:22.5px}10%{border-width:19px}20%{border-width:16px}30%{border-width:13px}40%{border-width:10px}50%{border-width:8px}60%{border-width:6px}70%{border-width:4px}80%{border-width:2px}90%{border-width:1px}100%{border-width:0}}';\n\n\n const onspeechend = function() {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function(event) {\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function() {\n console.log('Could not recognise the speech, try again...')\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = animationStyle;\n } else {\n style.appendChild(document.createTextNode(animationStyle));\n }\n head.appendChild(style);\n }\n\n function iconFactory(type, options){\n var icon;\n switch (type) {\n case 'fontawesome':\n icon = document.createElement('i');\n icon.className = 'fa fa-microphone';\n icon.style = iconStyle;\n break;\n case 'icon': {\n icon = document.createElement('img');\n icon.src = options.icon;\n icon.style = imgStyle;\n }\n break;\n default: {\n icon = document.createElement('i');\n icon.innerHTML = ''\n }\n }\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory(this.agent.mic, this.agent);\n\n Recognition.mic = container;\n addStyle();\n \n container.style = containerStyle;\n\n if(this.agent.bgColor){\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if(this.agent.borderColor){\n container.style.borderColor = this.agent.borderColor;\n }\n\n container.appendChild(icon);\n document.body.appendChild(container);\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function(event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var url;\n\n event.stopImmediatePropagation();\n\n if (this.dictionary[keyword]) {\n url = dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function(){console.log(\"I am starting\")};\n this.agent.onsoundstart = function(){console.log(\"Sound Started\")};\n this.agent.onsoundend = function(){console.log(\"Sound ended\")};\n this.agent.onaudiostart = function(){console.log(\"Audio Started\")};\n this.agent.onaudioend = function(){console.log(\"Audio ended\")};\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function() {\n Recognition.mic.style.animationName = 'listening';\n this.agent.start();\n };\n\n Recognition.prototype.stop = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.stop();\n };\n\n Recognition.prototype.abort = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.js\n// module id = 1\n// module chunks = 2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap be808d9344b390408bca","webpack:///./vs.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,2BC/CA,aACA,CAEA,yBA4BA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,gBACA,IAEA,GAiBA,MAhBA,4CACA,iBACA,qBAEA,SACA,qCACA,eACA,OAIA,mCACA,iBAGA,KAGA,cACA,8BACA,+BAEA,SACA,MAEA,MAEA,mBACA,6CAGA,oBACA,6CAGA,eACA,6BAEA,kCACA,UAEA,cAyBA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,qCAAoC,4BACpC,qCAAyC,4BACzC,mCAAuC,0BACvC,qCAAyC,4BACzC,mCAAuC,0BAEvC,8BACA,MAEA,8BA5HA,2BACA,GAGA,iBACA,sOACA,oFACA,qEAGA,iRACA,2BACA,YACA,MAEA,eACA,yEACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA0DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,IAGA,gCAFA,gBAIA,kCACA,cAEA,iCAEA,oBACA,UAEA,8BAmBA,2BACA,uBACA,OAEA,6BACA,2BACA,kBACA,MAEA,8BACA,2BACA,kBACA,OAEA,IAEA,aAAC","file":"vs.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap be808d9344b390408bca","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\n\n\n(function(root) {\n \"use strict\";\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if(!WebSpeechRecognition){\n return false;\n }\n /* Styles */\n const containerStyle = 'position:fixed;height:45px;width:45px;right:10px;bottom:10px;border-radius:50%;background:#f68c24;box-sizing:border-box;text-align:center;color:#fff;border:0 solid #fff;animation-duration:1s;animation-iteration-count:infinite';\n const iconStyle = 'height:25px;position:fixed;display:block;bottom:20px;right:25px;font-size:40px;';\n const imgStyle = 'height:25px;position:fixed;display:block;bottom:20px;right:25px;';\n const animationStyle = '@keyframes listening{0%{border-width:22.5px}10%{border-width:19px}20%{border-width:16px}30%{border-width:13px}40%{border-width:10px}50%{border-width:8px}60%{border-width:6px}70%{border-width:4px}80%{border-width:2px}90%{border-width:1px}100%{border-width:0}}';\n\n\n const onspeechend = function() {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function(event) {\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function() {\n console.log('Could not recognise the speech, try again...')\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = animationStyle;\n } else {\n style.appendChild(document.createTextNode(animationStyle));\n }\n head.appendChild(style);\n }\n\n function iconFactory(type, options){\n var icon;\n switch (type) {\n case 'fontawesome':\n icon = document.createElement('i');\n icon.className = 'fa fa-microphone';\n icon.style = iconStyle;\n break;\n case 'icon': {\n icon = document.createElement('img');\n icon.src = options.icon;\n icon.style = imgStyle;\n }\n break;\n default: {\n icon = document.createElement('i');\n icon.innerHTML = ''\n }\n }\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory(this.agent.mic, this.agent);\n\n Recognition.mic = container;\n addStyle();\n \n container.style = containerStyle;\n\n if(this.agent.bgColor){\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if(this.agent.borderColor){\n container.style.borderColor = this.agent.borderColor;\n }\n\n container.appendChild(icon);\n document.body.appendChild(container);\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function(event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var url;\n\n event.stopImmediatePropagation();\n\n if (this.dictionary[keyword]) {\n url = dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function(){console.log(\"I am starting\")};\n this.agent.onsoundstart = function(){console.log(\"Sound Started\")};\n this.agent.onsoundend = function(){console.log(\"Sound ended\")};\n this.agent.onaudiostart = function(){console.log(\"Audio Started\")};\n this.agent.onaudioend = function(){console.log(\"Audio ended\")};\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function() {\n Recognition.mic.style.animationName = 'listening';\n this.agent.start();\n };\n\n Recognition.prototype.stop = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.stop();\n };\n\n Recognition.prototype.abort = function() {\n Recognition.mic.style.animationName = 'none';\n this.agent.abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.js\n// module id = 2\n// module chunks = 2"],"sourceRoot":""} \ No newline at end of file diff --git a/d/vs.only.js b/d/vs.only.js index eab0e02..c78ae0c 100644 --- a/d/vs.only.js +++ b/d/vs.only.js @@ -1,2 +1,2 @@ -(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=3)})({3:function(){(function(a){'use strict';function b(){let a=document.head||document.getElementsByTagName('head')[0],b=document.createElement('style');b.type='text/css',b.styleSheet?b.styleSheet.cssText=g:b.appendChild(document.createTextNode(g)),a.appendChild(b)}function c(){var a;return a=document.createElement('i'),a.innerHTML=``,a.classList.add('icon'),a}function d(a){let d=document.createElement('div'),f=c(),g=document.createElement('dialog'),h=document.querySelector(this.agent.target)||document.body;g.innerHTML='

Listening ...

',e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),this.agent.micColor&&d.classList.add(this.agent.micColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),h.appendChild(d),d.addEventListener('click',a)}function e(a){this.agent=new f,Object.assign(this.agent,k,a),this.agent.onresult=l.bind(this.agent),this.agent.onspeechend=h.bind(this.agent),this.agent.onerror=i.bind(this.agent),this.agent.onnomatch=j.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=a.SpeechRecognition||a.webkitSpeechRecognition;if(!f)return!1;const g=`@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:15px;top:15px;box-sizing:border-box;text-align:center;color:#fff}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}@media (max-width:767px){.main-header .top-search-input .search-containter{display:none}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`,h=function(){e.mic.style.animationName='none',this.stop()},i=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},j=function(){console.log('Could not recognise the speech, try again...'),this.stop()},k={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},l=function(a){var b,c=a.results[0][0].transcript.toLowerCase();a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${c}'`,b=this.dictionary[c]?this.dictionary[c]:this.baseUrl+'?q='+encodeURI(c),'function'==typeof this.cb&&this.cb(c,b),window.location=b};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}}); +(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=1)})([function(){(function(a){function b(a){this.data=a.options,this.filterNames=a.filterNames}function c(){this.filtersToBeHandled=['size','price'],this.viewType={MOBILE:'mobileData',DESKTOP:'desktopData'},this.desktopData={size:['Size','Shoe Size'],price:['Price'],popupElement:$('#allFilterPopupTop'),element:function(a){return $(`.filterLeftContent > .h6[data-ref="${a}_tab"]`)}},this.mobileData={size:['standard_size','sh_size'],price:['price'],popupElement:$('#mobile-filter'),element:function(a){return $(`#filter-container > li.${a}>.h6`)}},this.filterTrigger='jb:catalog:onMobileFilterApplied'}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}function e(b){a.location=k+'?q='+encodeURI(b)}function f(){a.Recognition.dialog.open&&a.Recognition.dialog.close()}function g(a,b){if(a)return a;return b?b:''}function h(){if(a.sessionStorage)return sessionStorage.getItem('cat')}function j(b,c){a.sessionStorage&&sessionStorage.setItem('cat',g(b,c))}function i(a){this.store=new b(a),this.domManipulator=new c,this.selectedFilters}var k=`https://${a.location.host}`,l=$('#search');b.prototype.get=function(a,b){var c;return this.data&&this.data[a]&&this.data[a][b]&&(c=this.data[a][b]),c},c.prototype.getElement=function(a,b){var c,d=this[a];for(let e of d[b])if(c=d.element(e),c[0])return c;return c},c.prototype.openPopUp=function(a,b){var c=this.getElement(a,b);return!!c[0]&&($(this[a].popupElement).click(),c.click(),!0)},c.prototype.checkWordForPopup=function(a){return!!this.filtersToBeHandled.includes(a)&&(setTimeout(f,1e3),m()?this.openPopUp(this.viewType.DESKTOP,a):this.openPopUp(this.viewType.MOBILE,a))};var m=function(){var b=!0;return($('html').hasClass('touch-enabled')&&1024>=$(a).width()||1024>$(a).width())&&(b=!1),function(){return b}}();i.prototype.getFromSearchBox=function(){if(''!==l.val()){var a=l.val();return words=a.split(' '),this.getCategoryWord('categories',words)}return''},i.prototype.getCategoryWord=function(a,b){for(var c=0;c=this.selectedFilters.length&&e(c),b&&$(a).trigger(this.domManipulator.filterTrigger,[this.selectedFilters])},i.prototype.filters=function(a){for(var b,c=0;c`,a.classList.add('icon'),a}function d(a){let d=document.createElement('div'),f=c(),g=document.createElement('dialog'),h=document.querySelector(this.agent.target)||document.body;g.innerHTML='

Listening ...

',e.mic=d,e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),h.appendChild(d),d.style.opacity='1',d.addEventListener('click',a)}function e(a){this.agent=new g,Object.assign(this.agent,l,a),this.agent.onresult=m.bind(this.agent),this.agent.onspeechend=i.bind(this.agent),this.agent.onerror=j.bind(this.agent),this.agent.onnomatch=k.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=$('#main').attr('data-view'),g=a.SpeechRecognition||a.webkitSpeechRecognition;if(!g)return!1;const h=`@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`,i=function(){e.mic.style.animationName='none',this.stop()},j=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},k=function(){console.log('Could not recognise the speech, try again...'),this.stop()},l={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},m=function(a){var b=a.results[0][0].transcript.toLowerCase(),c=new RegExp(['\\bsearch\\b','\\bfor\\b','\\bshow\\b','\\bfind\\b','\\bget\\b','\\bextract\\b','\\bgive\\b','\\bsame\\b','\\bsimilar\\b','\\bwant\\b','\\bwants\\b','\\bme\\b','\\bi\\b','\\bfetch\\b','\\bdo\\b','\\btake\\b','\\bto\\b','\\bgo\\b','\\bsome\\b'].join('|'),'g');if(b=b.replace(c,''),-1!==window.location.href.indexOf('/customer/self-help-desk')){var d=b.match(/return|order|cancel|refund|exchange/g);if(d){if(e.dialog.querySelector('.vs-head').innerHTML=`Checking for '${d[0]}'`,'order'===d[0])return window.location.href='/customer/self-help-desk/view/order';if('return'===d[0])return window.location.href='/customer/self-help-desk/view/return';if('cancel'===d[0])return window.location.href='/customer/self-help-desk/view/cancellation';if('refund'===d[0])return window.location.href='/customer/self-help-desk/view/refunds';if('exchange'===d[0])return window.location.href='/customer/self-help-desk/view/exchange'}}var g=b.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);if(g){if(e.dialog.querySelector('.vs-head').innerHTML=`Taking you to '${g[0]}'`,'cart'===g[0])return window.location.href='/cart';if('account'===g[0])return window.location.href='/account';if('wishlist'===g[0])return window.location.href='/quicklist';if('sign in'===g[0]||'log in'===g[0]||'login'===g[0])return window.location.href='/customer/account/login';if('sign up'===g[0])return window.location.href='/customer/account/create';if('order'===g[0])return window.location.href='/customer/order';if('help'===g[0])return window.location.href='/customer/self-help-desk';if('track my order'===g[0]||'track order'===g[0])return window.location.href='/customer/order/trackorder'}var h;a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${b}'`,h=this.dictionary[b]?this.dictionary[b]:this.baseUrl+'?q='+encodeURI(b),'function'==typeof this.cb&&this.cb(b,h),'catalog'===f?window.VoiceTextHandler.checkFilter(b):window.location=h};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}]); //# sourceMappingURL=vs.only.js.map \ No newline at end of file diff --git a/d/vs.only.js.map b/d/vs.only.js.map index 57e3a2f..2a88b10 100644 --- a/d/vs.only.js.map +++ b/d/vs.only.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 62ad087b6755785796b1","webpack:///./vs.only.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,2BChDA,aACA,CAEA,yBAyDA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,aACA,IACA,GAMA,gCALA,iBAEA,6TAEA,SAGA,cACA,8BACA,SACA,6BACA,gEAGA,OACA,UAHA,2CAKA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,wBACA,qCAIA,0BAEA,mDACA,yCAEA,WACA,iBACA,iBAEA,kCACA,UAEA,cAmCA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,8BAnLA,2BACA,GAmCA,iBACA,8wCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA8DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,IAGA,gCAFA,gBAIA,2BACA,EACA,qBACA,sBAAyC,iBAEzC,WACA,mBAEA,iCAGA,aACA,iCAGA,eACA,UAEA,8BA+BA,2BACA,uBACA,OAEA,6BACA,2BACA,kBACA,MAEA,8BACA,2BACA,kBACA,OAEA,IAEA,aAAC","file":"vs.only.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 62ad087b6755785796b1","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\n\n(function (root) {\n \"use strict\";\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if (!WebSpeechRecognition) {\n return false;\n }\n\n// Style sheet\n// const styles = `\n// @keyframes listening{\n// 0%{box-shadow: 0px 0px 50px #afabab;}\n// 10%{box-shadow: 0px 0px 45px #afabab;}\n// 20%{box-shadow: 0px 0px 43px #afabab;}\n// 30%{box-shadow: 0px 0px 40px #afabab;}\n// 40%{box-shadow: 0px 0px 30px #afabab;}\n// 50%{box-shadow: 0px 0px 27px #afabab;}\n// 60%{box-shadow: 0px 0px 25px #afabab;}\n// 70%{box-shadow: 0px 0px 20px #afabab;}\n// 80%{box-shadow: 0px 0px 15px #afabab;}\n// 90%{box-shadow: 0px 0px 10px #afabab;}\n// 100%{box-shadow: 0px 0px 0px #afabab;}\n// }\n// .vs{position: absolute;right: 15px;top: 15px;box-sizing: border-box;text-align: center;color: #fff;}\n// .vs .icon{display: inline-block;width: 50px;height: 50px;color: #fff;}\n// .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;width: 66px;background-color: #f78f26;border-radius: 50%;color: #fff;height:66px;padding-top:20px;}\n// .vs.jb .icon path{fill:#f79026}\n// .vs .icon path{fill:#b2b2b2}\n// .vs dialog .icon path, .vs.jb dialog .icon path{fill:#fff}\n// .vs dialog{position:fixed;width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n// .vs .vs-head{font-size: 1em;text-transform:capitalize}\n// .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n// .show-close-btn .vs{display:none}\n// @media (max-width: 767px){\n// .main-header .top-search-input .search-containter {display:none}\n// .main-header.show-close-btn .top-search-input .search-containter{display: block} \n// }\n// `;\n\n \n const styles = `@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:15px;top:15px;box-sizing:border-box;text-align:center;color:#fff}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}@media (max-width:767px){.main-header .top-search-input .search-containter{display:none}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`;\n const onspeechend = function() {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function(event) { \n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function() {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory() {\n var icon;\n icon = document.createElement('i');\n icon.innerHTML = ``;\n\n icon.classList.add('icon');\n\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory();\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n let target = document.querySelector(this.agent.target) || document.body;\n\n dialog.innerHTML = header;\n Recognition.dialog = dialog;\n\n addStyle();\n\n container.classList.add('vs');\n\n if (this.agent.bgColor) {\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if (this.agent.borderColor) {\n container.style.borderColor = this.agent.borderColor;\n }\n\n if (this.agent.micColor) {\n container.classList.add(this.agent.micColor);\n }\n\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n target.appendChild(container);\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function (event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var url;\n\n event.stopImmediatePropagation();\n\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = this.dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if(typeof this.cb === 'function'){\n this.cb(keyword, url);\n }\n\n window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function(){ \n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function(){\n Recognition.dialogHead.innerHTML = 'Listening ...';\n };\n this.agent.onsoundend = function(){\n Recognition.mic.style.animationName = 'none';;\n };\n this.agent.onaudiostart = function(){\n Recognition.dialogHead.innerHTML = 'Speak Now ...';\n };\n this.agent.onaudioend = function(){\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function () {\n Recognition.mic.style.animationName = 'listening';\n this.agent.start();\n };\n\n Recognition.prototype.stop = function () {\n Recognition.mic.style.animationName = 'none';\n this.agent.stop();\n };\n\n Recognition.prototype.abort = function () {\n Recognition.mic.style.animationName = 'none';\n this.agent.abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.only.js\n// module id = 3\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap be808d9344b390408bca","webpack:///./vs.catalog.initiator.js","webpack:///./vs.target.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,0BC5DA,YACA,cAIA,WACA,2BACA,aAEA,aASA,MACA,kDACA,QACA,qBAEA,gCACA,CACA,0BACA,+BACA,yCACA,UAAmD,uCACnD,SAEA,mBACA,CACA,iCACA,+BACA,qCACA,UAAuC,2BACvC,OAEA,sBACA,kCAEA,cAoCA,0CACA,EAEA,cACA,oBACA,YAEA,aACA,sBACA,2BAEA,OAEA,gBACA,CACA,KAKA,oBACA,EAEA,aACA,MACA,6CAEA,MAEA,gBACA,GACA,6CAEA,OAEA,cAYA,YACA,6BACA,WACA,eAEA,kBAjI0B,eAC1B,OAEA,wCAMA,IACA,GAIA,qCAHA,oBAEA,aAGA,sCA0BA,IAGA,KAFA,oBAGA,aACA,aACA,GAGA,SACA,QAEA,qCACA,YACA,0BACA,6BACA,UAIA,WAEA,2CACA,iCACA,cACA,kBACA,iCAEA,wCAIA,UAEA,kBAqCA,IACA,sEACA,qBAEA,gBACA,CACA,QACA,CAGA,2CAOA,iBACA,SACA,2BACA,uCACA,MACA,OACA,EAEA,2CACA,WAAiB,MAAsB,OACvC,gBAAkB,MAAsB,OAGxC,6BACA,gBACA,SAIA,eACA,EAEA,uCACA,CACA,qBACA,gCAGA,6DAEA,iBAEA,iCACA,aAAiB,2BAAmC,OACpD,gCAEA,+CACA,mBACA,qBACA,KAIA,QAEA,qCACA,IACA,gBACA,UAEA,mCACA,0CAEA,6BACA,WAAkB,MAAkB,yDAEpC,gDAEA,OAIA,SAPA,iBAUA,uBACA,KACA,KAEA,MACA,MACA,2BACA,CAoBA,osCAGA,iCAAC,G,wBCvND,GAEA,eACA,CAEA,yBA0DA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,aACA,IACA,GAMA,gCALA,iBAEA,6TAEA,SAGA,cACA,8BACA,SACA,6BACA,gEAGA,OAEA,UAJA,2CAKA,QAEA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,6BAEA,mDACA,yCAEA,WACA,iBACA,iBACA,+BAEA,uBACA,UAEA,cA4FA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,uBA3OA,sCAEA,2BACA,GAiCA,iBAEA,mzCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA4DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,kCAGA,2RACA,sBACA,kEACA,eACA,6CACA,IACA,EACA,qBACA,uCAAkD,IAClD,IACA,2CAEA,yCACA,4CAEA,0CACA,4CAEA,gDACA,4CAEA,2CACA,8CAEA,wCACA,CACA,eACA,kGACA,IACA,EACA,qBACA,wCAA+C,IAC/C,IACA,0CAEA,WACA,6CAEA,cACA,8CAEA,mDACA,2CAEA,6BACA,6CAEA,8BACA,2CAEA,qBACA,0CAEA,uDACA,iDAEA,4BACA,IACA,KAEA,2BACA,EACA,qBACA,sBAAyC,iBAEzC,WACA,mBAEA,iCAGA,aACA,iCAEA,oEACA,UAEA,8BA+BA,2BACA,YACA,KACA,MACA,OAEA,6BACA,2BACA,OACA,KACA,MACA,MAEA,8BACA,2BACA,OACA,KACA,MACA,OAEA,IAEA,aAAC","file":"vs.only.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap be808d9344b390408bca","\n(function (window) {\n\tvar baseUrl = `https://${window.location.host}`,\n\t\t$searchValue = $('#search');\n\n\tfunction Store(data) {\n\t\tthis.data = data['options'];\n\t\tthis.filterNames = data['filterNames'];\n\t}\n\n\tStore.prototype.get = function (baseKey, nestedKey) {\n\t\tvar returnVal;\n\t\tif (this.data && this.data[baseKey] && this.data[baseKey][nestedKey]) {\n\t\t\treturnVal = this.data[baseKey][nestedKey];\n\t\t}\n\t\treturn returnVal;\n\t};\n\n\tfunction DOMManipulator() {\n\t\tthis.filtersToBeHandled = ['size', 'price'];\n\t\tthis.viewType = {\n\t\t\tMOBILE: 'mobileData',\n\t\t\tDESKTOP: 'desktopData'\n\t\t};\n\t\tthis.desktopData = {\n\t\t\tsize: ['Size', 'Shoe Size'],\n\t\t\tprice: ['Price'],\n\t\t\tpopupElement: $('#allFilterPopupTop'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`.filterLeftContent > .h6[data-ref=\"${type}_tab\"]`);\n\t\t\t}\n\t\t};\n\t\tthis.mobileData = {\n\t\t\tsize: ['standard_size', 'sh_size'],\n\t\t\tprice: ['price'],\n\t\t\tpopupElement: $('#mobile-filter'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`#filter-container > li.${type}>.h6`);\n\t\t\t}\n\t\t};\n\t\tthis.filterTrigger = 'jb:catalog:onMobileFilterApplied';\n\t}\n\n\tDOMManipulator.prototype.getElement = function (viewType, word) {\n\t\tvar viewTypeData = this[viewType];\n\t\tvar domElement;\n\n\t\tfor (let value of viewTypeData[word]) {\n\t\t\tdomElement = viewTypeData.element(value);\n\t\t\tif (domElement[0]) {\n\t\t\t\treturn domElement;\n\t\t\t}\n\t\t}\n\t\treturn domElement;\n\t}\n\n\tDOMManipulator.prototype.openPopUp = function (viewType, word) {\n\t\tvar domElement = this.getElement(viewType, word);\n\t\tif (domElement[0]) {\n\t\t\t$(this[viewType].popupElement).click();\n\t\t\tdomElement.click();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tDOMManipulator.prototype.checkWordForPopup = function (word) {\n\t\tif (this.filtersToBeHandled.includes(word)) {\n\t\t\tsetTimeout(closeDialog, 1000);\n\t\t\tif (isDesktop()) {\n\t\t\t\treturn this.openPopUp(this.viewType.DESKTOP, word);\n\t\t\t} else {\n\t\t\t\treturn this.openPopUp(this.viewType.MOBILE, word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}\n\n\tfunction redirect(keyword) {\n\t\twindow.location = baseUrl + \"?q=\" + encodeURI(keyword);\n\t}\n\n\tfunction closeDialog() {\n\t\tif (window.Recognition.dialog.open) {\n\t\t\twindow.Recognition.dialog.close();\n\t\t}\n\t}\n\n\tfunction addInSession(newCategoryWord, oldCategoryWord) {\n\t\tif (newCategoryWord) {\n\t\t\treturn newCategoryWord;\n\t\t} else if (oldCategoryWord) {\n\t\t\treturn oldCategoryWord;\n\t\t}\n\t\t// This is passed when a category not present in array is encountered\n\t\treturn '';\n\t}\n\n\tfunction getFromSession() {\n\t\tif (window.sessionStorage) {\n\t\t\treturn sessionStorage.getItem('cat');\n\t\t}\n\t}\n\n\tfunction storeInSession(newCategoryWord, oldCategory) {\n\t\tif (window.sessionStorage) {\n\t\t\tsessionStorage.setItem('cat', addInSession(newCategoryWord, oldCategory));\n\t\t}\n\t}\n\n\tvar isDesktop = (function () {\n\t\tvar isDesktop = true;\n\t\tif (($('html').hasClass('touch-enabled') && $(window).width() <= 1024) || $(window).width() < 1024) {\n\t\t\tisDesktop = false;\n\t\t}\n\t\treturn function () {\n\t\t\treturn isDesktop;\n\t\t};\n\t})();\n\n\n\tfunction VoiceTextHandler(data) {\n\t\tthis.store = new Store(data);\n\t\tthis.domManipulator = new DOMManipulator();\n\t\tthis.selectedFilters;\n\t}\n\n\tVoiceTextHandler.prototype.getFromSearchBox = function () {\n\t\tif ($searchValue.val() !== '') {\n\t\t\tvar query = $searchValue.val();\n\t\t\twords = query.split(\" \");\n\t\t\treturn this.getCategoryWord('categories', words)\n\t\t}\n\t\treturn '';\n\t}\n\n\tVoiceTextHandler.prototype.getCategoryWord = function (baseKey, nestedKey) {\n\t\tfor (var i = 0; i < nestedKey.length; i++) {\n\t\t\tfor (var j = 0; j < nestedKey.length; j++) {\n\n\t\t\t\t// A check for n-grams if available in the categories\n\t\t\t\tvar joinedStr = nestedKey.slice(i, j + 1).join(\" \");\n\t\t\t\tif (this.store.get(baseKey, joinedStr)) {\n\t\t\t\t\treturn joinedStr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n\tVoiceTextHandler.prototype.applyFilter = function (redirectFlag, keyword) {\n\t\tsetTimeout(closeDialog, 1000);\n\t\tif (redirectFlag && this.selectedFilters.length <= 0) {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tif (redirectFlag) {\n\t\t\t$(window).trigger(this.domManipulator.filterTrigger, [this.selectedFilters]);\n\t\t}\n\t}\n\n\tVoiceTextHandler.prototype.filters = function (nestedKey) {\n\t\tfor (var i = 0; i < this.store.filterNames.length; i++) {\n\t\t\tvar identifier = this.store.get(this.store.filterNames[i], nestedKey);\n\t\t\tif (identifier) {\n\t\t\t\tthis.selectedFilters.push({\n\t\t\t\t\tparent: this.store.filterNames[i],\n\t\t\t\t\tvalue: capitalizeFirstLetter(nestedKey),\n\t\t\t\t\ttype: identifier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tVoiceTextHandler.prototype.checkFilter = function (keyword) {\n\t\tvar popupOpened = false;\n\t\tvar words = keyword.split(\" \");\n\t\tthis.selectedFilters = [];\n\n\t\tvar oldCategory = getFromSession() || this.getFromSearchBox();\n\t\tvar newCategory = this.getCategoryWord('categories', words);\n\n\t\tif (!oldCategory || oldCategory !== newCategory) {\n\t\t\tfor (var i = 0; i < words.length; i++) {\n\t\t\t\tif (this.domManipulator.filtersToBeHandled.includes(words[i])) {\n\t\t\t\t\tpopupOpened = this.domManipulator.checkWordForPopup(words[i]);\n\t\t\t\t}\n\t\t\t\tpopupOpened = true;\n\t\t\t\tif (popupOpened) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tthis.filters(words[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.applyFilter(!popupOpened, keyword);\n\t\t} else {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tstoreInSession(newCategory, oldCategory);\n\t};\n\twindow.VoiceTextHandler = new VoiceTextHandler({\n\t\toptions: {\n\t\t\t'categories': {\n\t\t\t\t'shoes': 'true', 'jewellery': 'true', 'accessories': 'true', 'home and furniture': 'true', 'sports': 'true',\n\t\t\t\t'clothing': 'true', 'peep toes': 'true', 'toys': 'true', 'kids toys': 'true', 'kids shoes': 'true', 'sandals': 'true', 'slippers': 'true',\n\t\t\t\t'sneakers': 'true', 'flip flops': 'true', 'bellies': 'true', 'formal shoes': 'true', 'boots': 'true', 'floaters': 'true', 'beauty': 'true',\n\t\t\t\t'women beauty': 'true', 'fragrances': 'true', 'perfumes and edts': 'true', 'deodorants and colognes': 'true', 'gift sets': 'true',\n\t\t\t\t'make up': 'true', 'lips': 'true', 'lipstick': 'true', 'lip gloss': 'true', 'lip liner': 'true', 'lip pencil': 'true', 'lip pallete': 'true',\n\t\t\t\t'lip brush': 'true', 'eye': 'true', 'kajal': 'true', 'eye liner': 'true', 'kurta': 'true', 'kurti': 'true', 'suits': 'true',\n\t\t\t\t'saree': 'true', 'tops': 'true', 'tees': 'true', 'shirt': 'true', 'jeans': 'true', 'leggings': 'true', 'sunglasses': 'true', 'dresses': 'true',\n\t\t\t\t'watches': 'true', 'polos': 'true', 'shorts': 'true', 'skirts': 'true'\n\t\t\t},\n\t\t\t'colors': {\n\t\t\t\t'black': 'checkbox', 'brown': 'checkbox', 'purple': 'checkbox', 'blue': 'checkbox', 'red': 'checkbox',\n\t\t\t\t'green': 'checkbox', 'tan': 'checkbox', 'transparent': 'checkbox', 'white': 'checkbox', 'yellow': 'checkbox',\n\t\t\t\t'maroon': 'checkbox', 'orange': 'checkbox', 'copper': 'checkbox', 'silver': 'checkbox', 'khaki': 'checkbox'\n\t\t\t},\n\t\t\t'gender': {\n\t\t\t\t'men': 'input', 'women': 'input', 'kids': 'input', 'girls': 'input', 'boys': 'input', 'unisex': 'input'\n\t\t\t}\n\t\t},\n\t\tfilterNames: ['colors', 'gender']\n\t});\n\n})(window);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.catalog.initiator.js\n// module id = 0\n// module chunks = 0 1 3","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\nvar vsCatalog = require('./vs.catalog.initiator');\n\n(function (root) {\n \"use strict\";\n\n var $dataView = $('#main').attr('data-view');\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if (!WebSpeechRecognition) {\n return false;\n }\n\n // Style sheet\n // const styles = `\n // @keyframes listening{\n // 0%{box-shadow: 0px 0px 50px #afabab;}\n // 10%{box-shadow: 0px 0px 45px #afabab;}\n // 20%{box-shadow: 0px 0px 43px #afabab;}\n // 30%{box-shadow: 0px 0px 40px #afabab;}\n // 40%{box-shadow: 0px 0px 30px #afabab;}\n // 50%{box-shadow: 0px 0px 27px #afabab;}\n // 60%{box-shadow: 0px 0px 25px #afabab;}\n // 70%{box-shadow: 0px 0px 20px #afabab;}\n // 80%{box-shadow: 0px 0px 15px #afabab;}\n // 90%{box-shadow: 0px 0px 10px #afabab;}\n // 100%{box-shadow: 0px 0px 0px #afabab;}\n // }\n // .vs{position: absolute;right: 50px;top: 15px;box-sizing: border-box;text-align: center;color: #fff;}\n // .vs .icon{display: inline-block;width: 50px;height: 50px;color: #fff;}\n // .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;width: 66px;background-color: #f78f26;border-radius: 50%;color: #fff;height:66px;padding-top:16px;}\n // .vs .icon path{fill:#b2b2b2}\n // .vs dialog .icon path{fill:#fff}\n // .vs dialog{position:fixed;width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n // .vs .vs-head{font-size: 1em;text-transform:capitalize}\n // .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n // .show-close-btn .vs{display:none}\n // @media (max-width: 767px){\n // .main-header .top-search-input .search-containter {top:10px;width: 50px}\n // .main-header.show-close-btn .close-search{right: 76px;top: 10px;background-position: -49px -199px}\n // }\n // `;\n\n const styles = `@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`;\n\n const onspeechend = function () {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function (event) {\n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function () {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory() {\n var icon;\n icon = document.createElement('i');\n icon.innerHTML = ``;\n\n icon.classList.add('icon');\n\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory();\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n let target = document.querySelector(this.agent.target) || document.body;\n\n dialog.innerHTML = header;\n\n Recognition.mic = container;\n Recognition.dialog = dialog;\n\n addStyle();\n\n container.classList.add('vs');\n\n if (this.agent.bgColor) {\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if (this.agent.borderColor) {\n container.style.borderColor = this.agent.borderColor;\n }\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n target.appendChild(container);\n container.style.opacity = '1';\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function (event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var arr = [\n \"\\\\bsearch\\\\b\", \"\\\\bfor\\\\b\", \"\\\\bshow\\\\b\", \"\\\\bfind\\\\b\", \"\\\\bget\\\\b\", \"\\\\bextract\\\\b\", \"\\\\bgive\\\\b\", \"\\\\bsame\\\\b\", \"\\\\bsimilar\\\\b\", \"\\\\bwant\\\\b\", \"\\\\bwants\\\\b\", \"\\\\bme\\\\b\", \"\\\\bi\\\\b\", \"\\\\bfetch\\\\b\", \"\\\\bdo\\\\b\", \"\\\\btake\\\\b\", \"\\\\bto\\\\b\", \"\\\\bgo\\\\b\", \"\\\\bsome\\\\b\"\n ], arrRegex = new RegExp(arr.join('|'), 'g');\n keyword = keyword.replace(arrRegex, '');\n if ((window.location.href).indexOf(\"/customer/self-help-desk\") !== -1) {\n var filter = keyword.match(/return|order|cancel|refund|exchange/g);\n if (filter) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Checking for '${filter[0]}'`;\n if (filter[0] === 'order') {\n return window.location.href = '/customer/self-help-desk/view/order';\n }\n if (filter[0] === 'return') {\n return window.location.href = '/customer/self-help-desk/view/return';\n }\n if (filter[0] === 'cancel') {\n return window.location.href = '/customer/self-help-desk/view/cancellation';\n }\n if (filter[0] === 'refund') {\n return window.location.href = '/customer/self-help-desk/view/refunds';\n }\n if (filter[0] === 'exchange') {\n return window.location.href = '/customer/self-help-desk/view/exchange';\n }\n }\n }\n var command = keyword.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);\n if (command) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Taking you to '${command[0]}'`;\n if (command[0] === 'cart') {\n return window.location.href = '/cart';\n }\n if (command[0] === 'account') {\n return window.location.href = '/account';\n }\n if (command[0] === 'wishlist') {\n return window.location.href = '/quicklist';\n }\n if (command[0] === 'sign in' || command[0] === 'log in' || command[0] === 'login') {\n return window.location.href = '/customer/account/login';\n }\n if (command[0] === 'sign up') {\n return window.location.href = '/customer/account/create';\n }\n if (command[0] === 'order') {\n return window.location.href = '/customer/order';\n }\n if (command[0] === 'help') {\n return window.location.href = '/customer/self-help-desk';\n }\n if (command[0] === 'track my order' || command[0] === 'track order') {\n return window.location.href = '/customer/order/trackorder';\n }\n }\n var url;\n event.stopImmediatePropagation();\n\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = this.dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if (typeof this.cb === 'function') {\n this.cb(keyword, url);\n }\n $dataView === 'catalog' ? window.VoiceTextHandler.checkFilter(keyword) : window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function () {\n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function () {\n Recognition.dialogHead.innerHTML = 'Listening ...';\n };\n this.agent.onsoundend = function () {\n Recognition.mic.style.animationName = 'none';;\n };\n this.agent.onaudiostart = function () {\n Recognition.dialogHead.innerHTML = 'Speak Now ...';\n };\n this.agent.onaudioend = function () {\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function () {\n Recognition.mic.style.animationName = 'listening';\n this\n .agent\n .start();\n };\n\n Recognition.prototype.stop = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .stop();\n };\n\n Recognition.prototype.abort = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.target.js\n// module id = 1\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/d/vs.tg.js b/d/vs.tg.js index a5334e9..878fe7c 100644 --- a/d/vs.tg.js +++ b/d/vs.tg.js @@ -1,2 +1,2 @@ -(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=2)})([function(){(function(a){function b(a){this.data=a.options,this.filterNames=a.filterNames}function c(){this.filtersToBeHandled=['size','price'],this.viewType={MOBILE:'mobileData',DESKTOP:'desktopData'},this.desktopData={size:['Size','Shoe Size'],price:['Price'],popupElement:$('#allFilterPopupTop'),element:function(a){return $(`.filterLeftContent > .h6[data-ref="${a}_tab"]`)}},this.mobileData={size:['standard_size','sh_size'],price:['price'],popupElement:$('#mobile-filter'),element:function(a){return $(`#filter-container > li.${a}>.h6`)}},this.filterTrigger='jb:catalog:onMobileFilterApplied'}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}function e(b){a.location=k+'?q='+encodeURI(b)}function f(){a.Recognition.dialog.open&&a.Recognition.dialog.close()}function g(a,b){if(a)return a;return b?b:''}function h(){if(a.sessionStorage)return sessionStorage.getItem('cat')}function j(b,c){a.sessionStorage&&sessionStorage.setItem('cat',g(b,c))}function i(a){this.store=new b(a),this.domManipulator=new c,this.selectedFilters}var k='https://dev.jabong.com/find/',l=$('#search');b.prototype.get=function(a,b){var c;return this.data&&this.data[a]&&this.data[a][b]&&(c=this.data[a][b]),c},c.prototype.getElement=function(a,b){var c,d=this[a];for(let e of d[b])if(c=d.element(e),c[0])return c;return c},c.prototype.openPopUp=function(a,b){var c=this.getElement(a,b);return!!c[0]&&($(this[a].popupElement).click(),c.click(),!0)},c.prototype.checkWordForPopup=function(a){return!!this.filtersToBeHandled.includes(a)&&(setTimeout(f,1e3),m()?this.openPopUp(this.viewType.DESKTOP,a):this.openPopUp(this.viewType.MOBILE,a))};var m=function(){var b=!0;return($('html').hasClass('touch-enabled')&&1024>=$(a).width()||1024>$(a).width())&&(b=!1),function(){return b}}();i.prototype.getFromSearchBox=function(){if(''!==l.val()){var a=l.val();return words=a.split(' '),this.getCategoryWord('categories',words)}return''},i.prototype.getCategoryWord=function(a,b){for(var c=0;c=this.selectedFilters.length&&e(c),b&&$(a).trigger(this.domManipulator.filterTrigger,[this.selectedFilters])},i.prototype.filters=function(a){for(var b,c=0;c`,a.classList.add('icon'),a}function d(a){let d=document.createElement('div'),f=c(),g=document.createElement('dialog'),h=document.querySelector(this.agent.target)||document.body;g.innerHTML='

Listening ...

',e.mic=d,e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),h.appendChild(d),d.style.opacity='1',d.addEventListener('click',a)}function e(a){this.agent=new g,Object.assign(this.agent,l,a),this.agent.onresult=m.bind(this.agent),this.agent.onspeechend=i.bind(this.agent),this.agent.onerror=j.bind(this.agent),this.agent.onnomatch=k.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=$('#main').attr('data-view'),g=a.SpeechRecognition||a.webkitSpeechRecognition;if(!g)return!1;const h=`@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`,i=function(){e.mic.style.animationName='none',this.stop()},j=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},k=function(){console.log('Could not recognise the speech, try again...'),this.stop()},l={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},m=function(a){var b=a.results[0][0].transcript.toLowerCase(),c=new RegExp(['\\bsearch\\b','\\bfor\\b','\\bshow\\b','\\bfind\\b','\\bget\\b','\\bextract\\b','\\bgive\\b','\\bsame\\b','\\bsimilar\\b','\\bwant\\b','\\bwants\\b','\\bme\\b','\\bi\\b','\\bfetch\\b','\\bdo\\b','\\btake\\b','\\bto\\b','\\bgo\\b','\\bsome\\b'].join('|'),'g');if(b=b.replace(c,''),-1!==window.location.href.indexOf('/customer/self-help-desk')){var d=b.match(/return|order|cancel|refund|exchange/g);if(d){if(e.dialog.querySelector('.vs-head').innerHTML=`Checking for '${d[0]}'`,'order'===d[0])return window.location.href='/customer/self-help-desk/view/order';if('return'===d[0])return window.location.href='/customer/self-help-desk/view/return';if('cancel'===d[0])return window.location.href='/customer/self-help-desk/view/cancellation';if('refund'===d[0])return window.location.href='/customer/self-help-desk/view/refunds';if('exchange'===d[0])return window.location.href='/customer/self-help-desk/view/exchange'}}var g=b.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);if(g){if(e.dialog.querySelector('.vs-head').innerHTML=`Taking you to '${g[0]}'`,'cart'===g[0])return window.location.href='/cart';if('account'===g[0])return window.location.href='/account';if('wishlist'===g[0])return window.location.href='/quicklist';if('sign in'===g[0]||'log in'===g[0]||'login'===g[0])return window.location.href='/customer/account/login';if('sign up'===g[0])return window.location.href='/customer/account/create';if('order'===g[0])return window.location.href='/customer/order';if('help'===g[0])return window.location.href='/customer/self-help-desk';if('track my order'===g[0]||'track order'===g[0])return window.location.href='/customer/order/trackorder'}var h;a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${b}'`,h=this.dictionary[b]?this.dictionary[b]:this.baseUrl+'?q='+encodeURI(b),'function'==typeof this.cb&&this.cb(b,h),'catalog'===f?window.VoiceTextHandler.checkFilter(b):window.location=h};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}]); +(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=1)})([function(){(function(a){function b(a){this.data=a.options,this.filterNames=a.filterNames}function c(){this.filtersToBeHandled=['size','price'],this.viewType={MOBILE:'mobileData',DESKTOP:'desktopData'},this.desktopData={size:['Size','Shoe Size'],price:['Price'],popupElement:$('#allFilterPopupTop'),element:function(a){return $(`.filterLeftContent > .h6[data-ref="${a}_tab"]`)}},this.mobileData={size:['standard_size','sh_size'],price:['price'],popupElement:$('#mobile-filter'),element:function(a){return $(`#filter-container > li.${a}>.h6`)}},this.filterTrigger='jb:catalog:onMobileFilterApplied'}function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}function e(b){a.location=k+'?q='+encodeURI(b)}function f(){a.Recognition.dialog.open&&a.Recognition.dialog.close()}function g(a,b){if(a)return a;return b?b:''}function h(){if(a.sessionStorage)return sessionStorage.getItem('cat')}function j(b,c){a.sessionStorage&&sessionStorage.setItem('cat',g(b,c))}function i(a){this.store=new b(a),this.domManipulator=new c,this.selectedFilters}var k=`https://${a.location.host}`,l=$('#search');b.prototype.get=function(a,b){var c;return this.data&&this.data[a]&&this.data[a][b]&&(c=this.data[a][b]),c},c.prototype.getElement=function(a,b){var c,d=this[a];for(let e of d[b])if(c=d.element(e),c[0])return c;return c},c.prototype.openPopUp=function(a,b){var c=this.getElement(a,b);return!!c[0]&&($(this[a].popupElement).click(),c.click(),!0)},c.prototype.checkWordForPopup=function(a){return!!this.filtersToBeHandled.includes(a)&&(setTimeout(f,1e3),m()?this.openPopUp(this.viewType.DESKTOP,a):this.openPopUp(this.viewType.MOBILE,a))};var m=function(){var b=!0;return($('html').hasClass('touch-enabled')&&1024>=$(a).width()||1024>$(a).width())&&(b=!1),function(){return b}}();i.prototype.getFromSearchBox=function(){if(''!==l.val()){var a=l.val();return words=a.split(' '),this.getCategoryWord('categories',words)}return''},i.prototype.getCategoryWord=function(a,b){for(var c=0;c=this.selectedFilters.length&&e(c),b&&$(a).trigger(this.domManipulator.filterTrigger,[this.selectedFilters])},i.prototype.filters=function(a){for(var b,c=0;c`,a.classList.add('icon'),a}function d(a){let d=document.createElement('div'),f=c(),g=document.createElement('dialog'),h=document.querySelector(this.agent.target)||document.body;g.innerHTML='

Listening ...

',e.mic=d,e.dialog=g,b(),d.classList.add('vs'),this.agent.bgColor&&(d.style.backgroundColor=this.agent.bgColor),this.agent.borderColor&&(d.style.borderColor=this.agent.borderColor),g.appendChild(f.cloneNode(!0)),e.dialogHead=e.dialog.querySelector('.vs-head'),e.mic=e.dialog.querySelector('.icon'),d.appendChild(g),d.appendChild(f),h.appendChild(d),d.style.opacity='1',d.addEventListener('click',a)}function e(a){this.agent=new g,Object.assign(this.agent,l,a),this.agent.onresult=m.bind(this.agent),this.agent.onspeechend=i.bind(this.agent),this.agent.onerror=j.bind(this.agent),this.agent.onnomatch=k.bind(this.agent),this.agent.onstart=function(){e.dialogHead.innerHTML='Getting ready to serve you!',e.dialog.open||e.dialog.showModal()},this.agent.onsoundstart=function(){e.dialogHead.innerHTML='Listening ...'},this.agent.onsoundend=function(){e.mic.style.animationName='none'},this.agent.onaudiostart=function(){e.dialogHead.innerHTML='Speak Now ...'},this.agent.onaudioend=function(){e.mic.style.animationName='none'},d.call(this,this.start.bind(this))}var f=$('#main').attr('data-view'),g=a.SpeechRecognition||a.webkitSpeechRecognition;if(!g)return!1;const h=`@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`,i=function(){e.mic.style.animationName='none',this.stop()},j=function(a){e.mic.style.animationName='none',e.dialogHead.innerHTML='Could not recognise the speech. Please try again!',console.log('Speech recognition error detected: '+a.error+' message '+a.message),this.stop()},k=function(){console.log('Could not recognise the speech, try again...'),this.stop()},l={lang:'en-US',continuous:!1,maxAlternatives:1,interimResults:!1,dictionary:{},mic:'icon',bgColor:'#fff'},m=function(a){var b=a.results[0][0].transcript.toLowerCase(),c=new RegExp(['\\bsearch\\b','\\bfor\\b','\\bshow\\b','\\bfind\\b','\\bget\\b','\\bextract\\b','\\bgive\\b','\\bsame\\b','\\bsimilar\\b','\\bwant\\b','\\bwants\\b','\\bme\\b','\\bi\\b','\\bfetch\\b','\\bdo\\b','\\btake\\b','\\bto\\b','\\bgo\\b','\\bsome\\b'].join('|'),'g');if(b=b.replace(c,''),-1!==window.location.href.indexOf('/customer/self-help-desk')){var d=b.match(/return|order|cancel|refund|exchange/g);if(d){if(e.dialog.querySelector('.vs-head').innerHTML=`Checking for '${d[0]}'`,'order'===d[0])return window.location.href='/customer/self-help-desk/view/order';if('return'===d[0])return window.location.href='/customer/self-help-desk/view/return';if('cancel'===d[0])return window.location.href='/customer/self-help-desk/view/cancellation';if('refund'===d[0])return window.location.href='/customer/self-help-desk/view/refunds';if('exchange'===d[0])return window.location.href='/customer/self-help-desk/view/exchange'}}var g=b.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);if(g){if(e.dialog.querySelector('.vs-head').innerHTML=`Taking you to '${g[0]}'`,'cart'===g[0])return window.location.href='/cart';if('account'===g[0])return window.location.href='/account';if('wishlist'===g[0])return window.location.href='/quicklist';if('sign in'===g[0]||'log in'===g[0]||'login'===g[0])return window.location.href='/customer/account/login';if('sign up'===g[0])return window.location.href='/customer/account/create';if('order'===g[0])return window.location.href='/customer/order';if('help'===g[0])return window.location.href='/customer/self-help-desk';if('track my order'===g[0]||'track order'===g[0])return window.location.href='/customer/order/trackorder'}var h;a.stopImmediatePropagation(),e.dialog.querySelector('.vs-head').innerHTML=`Looking for '${b}'`,h=this.dictionary[b]?this.dictionary[b]:this.baseUrl+'?q='+encodeURI(b),'function'==typeof this.cb&&this.cb(b,h),'catalog'===f?window.VoiceTextHandler.checkFilter(b):window.location=h};e.prototype.start=function(){e.mic.style.animationName='listening',this.agent.start()},e.prototype.stop=function(){e.mic.style.animationName='none',this.agent.stop()},e.prototype.abort=function(){e.mic.style.animationName='none',this.agent.abort()},a.Recognition=e})(window)}]); //# sourceMappingURL=vs.tg.js.map \ No newline at end of file diff --git a/d/vs.tg.js.map b/d/vs.tg.js.map index 2bf9663..e14e8bf 100644 --- a/d/vs.tg.js.map +++ b/d/vs.tg.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 62ad087b6755785796b1","webpack:///./vs.catalog.initiator.js","webpack:///./vs.target.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,0BC5DA,YACA,cAIA,WACA,2BACA,aAEA,aASA,MACA,kDACA,QACA,qBAEA,gCACA,CACA,0BACA,+BACA,yCACA,UAAmD,uCACnD,SAEA,mBACA,CACA,iCACA,+BACA,qCACA,UAAuC,2BACvC,OAEA,sBACA,kCAEA,cAoCA,0CACA,EAEA,cACA,oBACA,YAEA,aACA,sBACA,2BAEA,OAEA,gBACA,CACA,KAKA,oBACA,EAEA,aACA,MACA,6CAEA,MAEA,gBACA,GACA,6CAEA,OAEA,cAYA,YACA,6BACA,WACA,eAEA,OAhIA,mCAEA,wCAMA,IACA,GAIA,qCAHA,oBAEA,aAGA,sCA0BA,IAGA,KAFA,oBAGA,aACA,aACA,GAGA,SACA,QAEA,qCACA,YACA,0BACA,6BACA,UAIA,WAEA,2CACA,iCACA,cACA,kBACA,iCAEA,wCAIA,UAEA,kBAqCA,IACA,sEACA,qBAEA,gBACA,CACA,QACA,CAGA,2CAOA,iBACA,SACA,2BACA,uCACA,MACA,OACA,EAEA,2CACA,WAAiB,MAAsB,OACvC,gBAAkB,MAAsB,OAGxC,6BACA,gBACA,SAIA,eACA,EAEA,uCACA,CACA,qBACA,gCAGA,6DAEA,iBAEA,iCACA,aAAiB,2BAAmC,OACpD,gCAEA,+CACA,mBACA,qBACA,KAIA,QAEA,qCACA,IACA,gBACA,UAEA,mCACA,0CAEA,6BACA,WAAkB,MAAkB,yDAEpC,gDAEA,OAIA,SAPA,iBAUA,uBACA,KACA,KAEA,MACA,MACA,2BACA,CAoBA,osCAGA,iCAAC,G,yBCvND,GAEA,eACA,CAEA,yBA0DA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,aACA,IACA,GAMA,gCALA,iBAEA,6TAEA,SAGA,cACA,8BACA,SACA,6BACA,gEAGA,OAEA,UAJA,2CAKA,QAEA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,6BAEA,mDACA,yCAEA,WACA,iBACA,iBACA,+BAEA,uBACA,UAEA,cA4FA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,uBA3OA,sCAEA,2BACA,GAiCA,iBAEA,mzCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA4DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,kCAGA,2RACA,sBACA,kEACA,eACA,6CACA,IACA,EACA,qBACA,uCAAkD,IAClD,IACA,2CAEA,yCACA,4CAEA,0CACA,4CAEA,gDACA,4CAEA,2CACA,8CAEA,wCACA,CACA,eACA,kGACA,IACA,EACA,qBACA,wCAA+C,IAC/C,IACA,0CAEA,WACA,6CAEA,cACA,8CAEA,mDACA,2CAEA,6BACA,6CAEA,8BACA,2CAEA,qBACA,0CAEA,uDACA,iDAEA,4BACA,IACA,KAEA,2BACA,EACA,qBACA,sBAAyC,iBAEzC,WACA,mBAEA,iCAGA,aACA,iCAEA,oEACA,UAEA,8BA+BA,2BACA,YACA,KACA,MACA,OAEA,6BACA,2BACA,OACA,KACA,MACA,MAEA,8BACA,2BACA,OACA,KACA,MACA,OAEA,IAEA,aAAC","file":"vs.tg.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 62ad087b6755785796b1","\n(function (window) {\n\tvar baseUrl = 'https://dev.jabong.com/find/',\n\t\t$searchValue = $('#search');\n\n\tfunction Store(data) {\n\t\tthis.data = data['options'];\n\t\tthis.filterNames = data['filterNames'];\n\t}\n\n\tStore.prototype.get = function (baseKey, nestedKey) {\n\t\tvar returnVal;\n\t\tif (this.data && this.data[baseKey] && this.data[baseKey][nestedKey]) {\n\t\t\treturnVal = this.data[baseKey][nestedKey];\n\t\t}\n\t\treturn returnVal;\n\t};\n\n\tfunction DOMManipulator() {\n\t\tthis.filtersToBeHandled = ['size', 'price'];\n\t\tthis.viewType = {\n\t\t\tMOBILE: 'mobileData',\n\t\t\tDESKTOP: 'desktopData'\n\t\t};\n\t\tthis.desktopData = {\n\t\t\tsize: ['Size', 'Shoe Size'],\n\t\t\tprice: ['Price'],\n\t\t\tpopupElement: $('#allFilterPopupTop'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`.filterLeftContent > .h6[data-ref=\"${type}_tab\"]`);\n\t\t\t}\n\t\t};\n\t\tthis.mobileData = {\n\t\t\tsize: ['standard_size', 'sh_size'],\n\t\t\tprice: ['price'],\n\t\t\tpopupElement: $('#mobile-filter'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`#filter-container > li.${type}>.h6`);\n\t\t\t}\n\t\t};\n\t\tthis.filterTrigger = 'jb:catalog:onMobileFilterApplied';\n\t}\n\n\tDOMManipulator.prototype.getElement = function (viewType, word) {\n\t\tvar viewTypeData = this[viewType];\n\t\tvar domElement;\n\n\t\tfor (let value of viewTypeData[word]) {\n\t\t\tdomElement = viewTypeData.element(value);\n\t\t\tif (domElement[0]) {\n\t\t\t\treturn domElement;\n\t\t\t}\n\t\t}\n\t\treturn domElement;\n\t}\n\n\tDOMManipulator.prototype.openPopUp = function (viewType, word) {\n\t\tvar domElement = this.getElement(viewType, word);\n\t\tif (domElement[0]) {\n\t\t\t$(this[viewType].popupElement).click();\n\t\t\tdomElement.click();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tDOMManipulator.prototype.checkWordForPopup = function (word) {\n\t\tif (this.filtersToBeHandled.includes(word)) {\n\t\t\tsetTimeout(closeDialog, 1000);\n\t\t\tif (isDesktop()) {\n\t\t\t\treturn this.openPopUp(this.viewType.DESKTOP, word);\n\t\t\t} else {\n\t\t\t\treturn this.openPopUp(this.viewType.MOBILE, word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}\n\n\tfunction redirect(keyword) {\n\t\twindow.location = baseUrl + \"?q=\" + encodeURI(keyword);\n\t}\n\n\tfunction closeDialog() {\n\t\tif (window.Recognition.dialog.open) {\n\t\t\twindow.Recognition.dialog.close();\n\t\t}\n\t}\n\n\tfunction addInSession(newCategoryWord, oldCategoryWord) {\n\t\tif (newCategoryWord) {\n\t\t\treturn newCategoryWord;\n\t\t} else if (oldCategoryWord) {\n\t\t\treturn oldCategoryWord;\n\t\t}\n\t\t// This is passed when a category not present in array is encountered\n\t\treturn '';\n\t}\n\n\tfunction getFromSession() {\n\t\tif (window.sessionStorage) {\n\t\t\treturn sessionStorage.getItem('cat');\n\t\t}\n\t}\n\n\tfunction storeInSession(newCategoryWord, oldCategory) {\n\t\tif (window.sessionStorage) {\n\t\t\tsessionStorage.setItem('cat', addInSession(newCategoryWord, oldCategory));\n\t\t}\n\t}\n\n\tvar isDesktop = (function () {\n\t\tvar isDesktop = true;\n\t\tif (($('html').hasClass('touch-enabled') && $(window).width() <= 1024) || $(window).width() < 1024) {\n\t\t\tisDesktop = false;\n\t\t}\n\t\treturn function () {\n\t\t\treturn isDesktop;\n\t\t};\n\t})();\n\n\n\tfunction VoiceTextHandler(data) {\n\t\tthis.store = new Store(data);\n\t\tthis.domManipulator = new DOMManipulator();\n\t\tthis.selectedFilters;\n\t}\n\n\tVoiceTextHandler.prototype.getFromSearchBox = function () {\n\t\tif ($searchValue.val() !== '') {\n\t\t\tvar query = $searchValue.val();\n\t\t\twords = query.split(\" \");\n\t\t\treturn this.getCategoryWord('categories', words)\n\t\t}\n\t\treturn '';\n\t}\n\n\tVoiceTextHandler.prototype.getCategoryWord = function (baseKey, nestedKey) {\n\t\tfor (var i = 0; i < nestedKey.length; i++) {\n\t\t\tfor (var j = 0; j < nestedKey.length; j++) {\n\n\t\t\t\t// A check for n-grams if available in the categories\n\t\t\t\tvar joinedStr = nestedKey.slice(i, j + 1).join(\" \");\n\t\t\t\tif (this.store.get(baseKey, joinedStr)) {\n\t\t\t\t\treturn joinedStr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n\tVoiceTextHandler.prototype.applyFilter = function (redirectFlag, keyword) {\n\t\tsetTimeout(closeDialog, 1000);\n\t\tif (redirectFlag && this.selectedFilters.length <= 0) {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tif (redirectFlag) {\n\t\t\t$(window).trigger(this.domManipulator.filterTrigger, [this.selectedFilters]);\n\t\t}\n\t}\n\n\tVoiceTextHandler.prototype.filters = function (nestedKey) {\n\t\tfor (var i = 0; i < this.store.filterNames.length; i++) {\n\t\t\tvar identifier = this.store.get(this.store.filterNames[i], nestedKey);\n\t\t\tif (identifier) {\n\t\t\t\tthis.selectedFilters.push({\n\t\t\t\t\tparent: this.store.filterNames[i],\n\t\t\t\t\tvalue: capitalizeFirstLetter(nestedKey),\n\t\t\t\t\ttype: identifier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tVoiceTextHandler.prototype.checkFilter = function (keyword) {\n\t\tvar popupOpened = false;\n\t\tvar words = keyword.split(\" \");\n\t\tthis.selectedFilters = [];\n\n\t\tvar oldCategory = getFromSession() || this.getFromSearchBox();\n\t\tvar newCategory = this.getCategoryWord('categories', words);\n\n\t\tif (!oldCategory || oldCategory !== newCategory) {\n\t\t\tfor (var i = 0; i < words.length; i++) {\n\t\t\t\tif (this.domManipulator.filtersToBeHandled.includes(words[i])) {\n\t\t\t\t\tpopupOpened = this.domManipulator.checkWordForPopup(words[i]);\n\t\t\t\t}\n\t\t\t\tpopupOpened = true;\n\t\t\t\tif (popupOpened) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tthis.filters(words[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.applyFilter(!popupOpened, keyword);\n\t\t} else {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tstoreInSession(newCategory, oldCategory);\n\t};\n\twindow.VoiceTextHandler = new VoiceTextHandler({\n\t\toptions: {\n\t\t\t'categories': {\n\t\t\t\t'shoes': 'true', 'jewellery': 'true', 'accessories': 'true', 'home and furniture': 'true', 'sports': 'true',\n\t\t\t\t'clothing': 'true', 'peep toes': 'true', 'toys': 'true', 'kids toys': 'true', 'kids shoes': 'true', 'sandals': 'true', 'slippers': 'true',\n\t\t\t\t'sneakers': 'true', 'flip flops': 'true', 'bellies': 'true', 'formal shoes': 'true', 'boots': 'true', 'floaters': 'true', 'beauty': 'true',\n\t\t\t\t'women beauty': 'true', 'fragrances': 'true', 'perfumes and edts': 'true', 'deodorants and colognes': 'true', 'gift sets': 'true',\n\t\t\t\t'make up': 'true', 'lips': 'true', 'lipstick': 'true', 'lip gloss': 'true', 'lip liner': 'true', 'lip pencil': 'true', 'lip pallete': 'true',\n\t\t\t\t'lip brush': 'true', 'eye': 'true', 'kajal': 'true', 'eye liner': 'true', 'kurta': 'true', 'kurti': 'true', 'suits': 'true',\n\t\t\t\t'saree': 'true', 'tops': 'true', 'tees': 'true', 'shirt': 'true', 'jeans': 'true', 'leggings': 'true', 'sunglasses': 'true', 'dresses': 'true',\n\t\t\t\t'watches': 'true', 'polos': 'true', 'shorts': 'true', 'skirts': 'true'\n\t\t\t},\n\t\t\t'colors': {\n\t\t\t\t'black': 'checkbox', 'brown': 'checkbox', 'purple': 'checkbox', 'blue': 'checkbox', 'red': 'checkbox',\n\t\t\t\t'green': 'checkbox', 'tan': 'checkbox', 'transparent': 'checkbox', 'white': 'checkbox', 'yellow': 'checkbox',\n\t\t\t\t'maroon': 'checkbox', 'orange': 'checkbox', 'copper': 'checkbox', 'silver': 'checkbox', 'khaki': 'checkbox'\n\t\t\t},\n\t\t\t'gender': {\n\t\t\t\t'men': 'input', 'women': 'input', 'kids': 'input', 'girls': 'input', 'boys': 'input', 'unisex': 'input'\n\t\t\t}\n\t\t},\n\t\tfilterNames: ['colors', 'gender']\n\t});\n\n})(window);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.catalog.initiator.js\n// module id = 0\n// module chunks = 0 3","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\nvar vsCatalog = require('./vs.catalog.initiator');\n\n(function (root) {\n \"use strict\";\n\n var $dataView = $('#main').attr('data-view');\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if (!WebSpeechRecognition) {\n return false;\n }\n\n // Style sheet\n // const styles = `\n // @keyframes listening{\n // 0%{box-shadow: 0px 0px 50px #afabab;}\n // 10%{box-shadow: 0px 0px 45px #afabab;}\n // 20%{box-shadow: 0px 0px 43px #afabab;}\n // 30%{box-shadow: 0px 0px 40px #afabab;}\n // 40%{box-shadow: 0px 0px 30px #afabab;}\n // 50%{box-shadow: 0px 0px 27px #afabab;}\n // 60%{box-shadow: 0px 0px 25px #afabab;}\n // 70%{box-shadow: 0px 0px 20px #afabab;}\n // 80%{box-shadow: 0px 0px 15px #afabab;}\n // 90%{box-shadow: 0px 0px 10px #afabab;}\n // 100%{box-shadow: 0px 0px 0px #afabab;}\n // }\n // .vs{position: absolute;right: 50px;top: 15px;box-sizing: border-box;text-align: center;color: #fff;}\n // .vs .icon{display: inline-block;width: 50px;height: 50px;color: #fff;}\n // .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;width: 66px;background-color: #f78f26;border-radius: 50%;color: #fff;height:66px;padding-top:16px;}\n // .vs .icon path{fill:#b2b2b2}\n // .vs dialog .icon path{fill:#fff}\n // .vs dialog{position:fixed;width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n // .vs .vs-head{font-size: 1em;text-transform:capitalize}\n // .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n // .show-close-btn .vs{display:none}\n // @media (max-width: 767px){\n // .main-header .top-search-input .search-containter {top:10px;width: 50px}\n // .main-header.show-close-btn .close-search{right: 76px;top: 10px;background-position: -49px -199px}\n // }\n // `;\n\n const styles = `@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`;\n\n const onspeechend = function () {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function (event) {\n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function () {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory() {\n var icon;\n icon = document.createElement('i');\n icon.innerHTML = ``;\n\n icon.classList.add('icon');\n\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory();\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n let target = document.querySelector(this.agent.target) || document.body;\n\n dialog.innerHTML = header;\n\n Recognition.mic = container;\n Recognition.dialog = dialog;\n\n addStyle();\n\n container.classList.add('vs');\n\n if (this.agent.bgColor) {\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if (this.agent.borderColor) {\n container.style.borderColor = this.agent.borderColor;\n }\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n target.appendChild(container);\n container.style.opacity = '1';\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function (event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var arr = [\n \"\\\\bsearch\\\\b\", \"\\\\bfor\\\\b\", \"\\\\bshow\\\\b\", \"\\\\bfind\\\\b\", \"\\\\bget\\\\b\", \"\\\\bextract\\\\b\", \"\\\\bgive\\\\b\", \"\\\\bsame\\\\b\", \"\\\\bsimilar\\\\b\", \"\\\\bwant\\\\b\", \"\\\\bwants\\\\b\", \"\\\\bme\\\\b\", \"\\\\bi\\\\b\", \"\\\\bfetch\\\\b\", \"\\\\bdo\\\\b\", \"\\\\btake\\\\b\", \"\\\\bto\\\\b\", \"\\\\bgo\\\\b\", \"\\\\bsome\\\\b\"\n ], arrRegex = new RegExp(arr.join('|'), 'g');\n keyword = keyword.replace(arrRegex, '');\n if ((window.location.href).indexOf(\"/customer/self-help-desk\") !== -1) {\n var filter = keyword.match(/return|order|cancel|refund|exchange/g);\n if (filter) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Checking for '${filter[0]}'`;\n if (filter[0] === 'order') {\n return window.location.href = '/customer/self-help-desk/view/order';\n }\n if (filter[0] === 'return') {\n return window.location.href = '/customer/self-help-desk/view/return';\n }\n if (filter[0] === 'cancel') {\n return window.location.href = '/customer/self-help-desk/view/cancellation';\n }\n if (filter[0] === 'refund') {\n return window.location.href = '/customer/self-help-desk/view/refunds';\n }\n if (filter[0] === 'exchange') {\n return window.location.href = '/customer/self-help-desk/view/exchange';\n }\n }\n }\n var command = keyword.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);\n if (command) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Taking you to '${command[0]}'`;\n if (command[0] === 'cart') {\n return window.location.href = '/cart';\n }\n if (command[0] === 'account') {\n return window.location.href = '/account';\n }\n if (command[0] === 'wishlist') {\n return window.location.href = '/quicklist';\n }\n if (command[0] === 'sign in' || command[0] === 'log in' || command[0] === 'login') {\n return window.location.href = '/customer/account/login';\n }\n if (command[0] === 'sign up') {\n return window.location.href = '/customer/account/create';\n }\n if (command[0] === 'order') {\n return window.location.href = '/customer/order';\n }\n if (command[0] === 'help') {\n return window.location.href = '/customer/self-help-desk';\n }\n if (command[0] === 'track my order' || command[0] === 'track order') {\n return window.location.href = '/customer/order/trackorder';\n }\n }\n var url;\n event.stopImmediatePropagation();\n\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = this.dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if (typeof this.cb === 'function') {\n this.cb(keyword, url);\n }\n $dataView === 'catalog' ? window.VoiceTextHandler.checkFilter(keyword) : window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function () {\n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function () {\n Recognition.dialogHead.innerHTML = 'Listening ...';\n };\n this.agent.onsoundend = function () {\n Recognition.mic.style.animationName = 'none';;\n };\n this.agent.onaudiostart = function () {\n Recognition.dialogHead.innerHTML = 'Speak Now ...';\n };\n this.agent.onaudioend = function () {\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function () {\n Recognition.mic.style.animationName = 'listening';\n this\n .agent\n .start();\n };\n\n Recognition.prototype.stop = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .stop();\n };\n\n Recognition.prototype.abort = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.target.js\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap be808d9344b390408bca","webpack:///./vs.catalog.initiator.js","webpack:///./vs.target.js"],"names":[],"mappings":"YACA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,CAAe,QAChD,EAEA,aADA,QAIA,mBAAsD,wCAA+D,SAGrH,MAGA,0BC5DA,YACA,cAIA,WACA,2BACA,aAEA,aASA,MACA,kDACA,QACA,qBAEA,gCACA,CACA,0BACA,+BACA,yCACA,UAAmD,uCACnD,SAEA,mBACA,CACA,iCACA,+BACA,qCACA,UAAuC,2BACvC,OAEA,sBACA,kCAEA,cAoCA,0CACA,EAEA,cACA,oBACA,YAEA,aACA,sBACA,2BAEA,OAEA,gBACA,CACA,KAKA,oBACA,EAEA,aACA,MACA,6CAEA,MAEA,gBACA,GACA,6CAEA,OAEA,cAYA,YACA,6BACA,WACA,eAEA,kBAjI0B,eAC1B,OAEA,wCAMA,IACA,GAIA,qCAHA,oBAEA,aAGA,sCA0BA,IAGA,KAFA,oBAGA,aACA,aACA,GAGA,SACA,QAEA,qCACA,YACA,0BACA,6BACA,UAIA,WAEA,2CACA,iCACA,cACA,kBACA,iCAEA,wCAIA,UAEA,kBAqCA,IACA,sEACA,qBAEA,gBACA,CACA,QACA,CAGA,2CAOA,iBACA,SACA,2BACA,uCACA,MACA,OACA,EAEA,2CACA,WAAiB,MAAsB,OACvC,gBAAkB,MAAsB,OAGxC,6BACA,gBACA,SAIA,eACA,EAEA,uCACA,CACA,qBACA,gCAGA,6DAEA,iBAEA,iCACA,aAAiB,2BAAmC,OACpD,gCAEA,+CACA,mBACA,qBACA,KAIA,QAEA,qCACA,IACA,gBACA,UAEA,mCACA,0CAEA,6BACA,WAAkB,MAAkB,yDAEpC,gDAEA,OAIA,SAPA,iBAUA,uBACA,KACA,KAEA,MACA,MACA,2BACA,CAoBA,osCAGA,iCAAC,G,wBCvND,GAEA,eACA,CAEA,yBA0DA,4DACA,4BACA,gBACA,aACA,wBAEA,iCAEA,qBACA,cAEA,aACA,IACA,GAMA,gCALA,iBAEA,6TAEA,SAGA,cACA,8BACA,SACA,6BACA,gEAGA,OAEA,UAJA,2CAKA,QAEA,SAEA,oBAEA,iBACA,6CAGA,oBACA,6CAGA,6BAEA,mDACA,yCAEA,WACA,iBACA,iBACA,+BAEA,uBACA,UAEA,cA4FA,YAEA,yBAEA,2CACA,0CACA,sCACA,wCACA,oCACA,wBACA,sDACA,WAEA,oCACA,wBACA,eACA,kCACA,2BACA,MACA,oCACA,wBACA,eACA,kCACA,2BACA,MAEA,8BACA,MAEA,uBA3OA,sCAEA,2BACA,GAiCA,iBAEA,mzCACA,2BACA,YACA,MAEA,eACA,2BACA,8BACA,4HACA,cACA,MAEA,cACA,aACA,qDACA,MAEA,IA4DA,MACA,QACA,8BACA,EACA,kBACA,kBACA,eAGA,qBACA,kCAGA,2RACA,sBACA,kEACA,eACA,6CACA,IACA,EACA,qBACA,uCAAkD,IAClD,IACA,2CAEA,yCACA,4CAEA,0CACA,4CAEA,gDACA,4CAEA,2CACA,8CAEA,wCACA,CACA,eACA,kGACA,IACA,EACA,qBACA,wCAA+C,IAC/C,IACA,0CAEA,WACA,6CAEA,cACA,8CAEA,mDACA,2CAEA,6BACA,6CAEA,8BACA,2CAEA,qBACA,0CAEA,uDACA,iDAEA,4BACA,IACA,KAEA,2BACA,EACA,qBACA,sBAAyC,iBAEzC,WACA,mBAEA,iCAGA,aACA,iCAEA,oEACA,UAEA,8BA+BA,2BACA,YACA,KACA,MACA,OAEA,6BACA,2BACA,OACA,KACA,MACA,MAEA,8BACA,2BACA,OACA,KACA,MACA,OAEA,IAEA,aAAC","file":"vs.tg.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap be808d9344b390408bca","\n(function (window) {\n\tvar baseUrl = `https://${window.location.host}`,\n\t\t$searchValue = $('#search');\n\n\tfunction Store(data) {\n\t\tthis.data = data['options'];\n\t\tthis.filterNames = data['filterNames'];\n\t}\n\n\tStore.prototype.get = function (baseKey, nestedKey) {\n\t\tvar returnVal;\n\t\tif (this.data && this.data[baseKey] && this.data[baseKey][nestedKey]) {\n\t\t\treturnVal = this.data[baseKey][nestedKey];\n\t\t}\n\t\treturn returnVal;\n\t};\n\n\tfunction DOMManipulator() {\n\t\tthis.filtersToBeHandled = ['size', 'price'];\n\t\tthis.viewType = {\n\t\t\tMOBILE: 'mobileData',\n\t\t\tDESKTOP: 'desktopData'\n\t\t};\n\t\tthis.desktopData = {\n\t\t\tsize: ['Size', 'Shoe Size'],\n\t\t\tprice: ['Price'],\n\t\t\tpopupElement: $('#allFilterPopupTop'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`.filterLeftContent > .h6[data-ref=\"${type}_tab\"]`);\n\t\t\t}\n\t\t};\n\t\tthis.mobileData = {\n\t\t\tsize: ['standard_size', 'sh_size'],\n\t\t\tprice: ['price'],\n\t\t\tpopupElement: $('#mobile-filter'),\n\t\t\telement: function (type) {\n\t\t\t\treturn $(`#filter-container > li.${type}>.h6`);\n\t\t\t}\n\t\t};\n\t\tthis.filterTrigger = 'jb:catalog:onMobileFilterApplied';\n\t}\n\n\tDOMManipulator.prototype.getElement = function (viewType, word) {\n\t\tvar viewTypeData = this[viewType];\n\t\tvar domElement;\n\n\t\tfor (let value of viewTypeData[word]) {\n\t\t\tdomElement = viewTypeData.element(value);\n\t\t\tif (domElement[0]) {\n\t\t\t\treturn domElement;\n\t\t\t}\n\t\t}\n\t\treturn domElement;\n\t}\n\n\tDOMManipulator.prototype.openPopUp = function (viewType, word) {\n\t\tvar domElement = this.getElement(viewType, word);\n\t\tif (domElement[0]) {\n\t\t\t$(this[viewType].popupElement).click();\n\t\t\tdomElement.click();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tDOMManipulator.prototype.checkWordForPopup = function (word) {\n\t\tif (this.filtersToBeHandled.includes(word)) {\n\t\t\tsetTimeout(closeDialog, 1000);\n\t\t\tif (isDesktop()) {\n\t\t\t\treturn this.openPopUp(this.viewType.DESKTOP, word);\n\t\t\t} else {\n\t\t\t\treturn this.openPopUp(this.viewType.MOBILE, word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction capitalizeFirstLetter(string) {\n\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}\n\n\tfunction redirect(keyword) {\n\t\twindow.location = baseUrl + \"?q=\" + encodeURI(keyword);\n\t}\n\n\tfunction closeDialog() {\n\t\tif (window.Recognition.dialog.open) {\n\t\t\twindow.Recognition.dialog.close();\n\t\t}\n\t}\n\n\tfunction addInSession(newCategoryWord, oldCategoryWord) {\n\t\tif (newCategoryWord) {\n\t\t\treturn newCategoryWord;\n\t\t} else if (oldCategoryWord) {\n\t\t\treturn oldCategoryWord;\n\t\t}\n\t\t// This is passed when a category not present in array is encountered\n\t\treturn '';\n\t}\n\n\tfunction getFromSession() {\n\t\tif (window.sessionStorage) {\n\t\t\treturn sessionStorage.getItem('cat');\n\t\t}\n\t}\n\n\tfunction storeInSession(newCategoryWord, oldCategory) {\n\t\tif (window.sessionStorage) {\n\t\t\tsessionStorage.setItem('cat', addInSession(newCategoryWord, oldCategory));\n\t\t}\n\t}\n\n\tvar isDesktop = (function () {\n\t\tvar isDesktop = true;\n\t\tif (($('html').hasClass('touch-enabled') && $(window).width() <= 1024) || $(window).width() < 1024) {\n\t\t\tisDesktop = false;\n\t\t}\n\t\treturn function () {\n\t\t\treturn isDesktop;\n\t\t};\n\t})();\n\n\n\tfunction VoiceTextHandler(data) {\n\t\tthis.store = new Store(data);\n\t\tthis.domManipulator = new DOMManipulator();\n\t\tthis.selectedFilters;\n\t}\n\n\tVoiceTextHandler.prototype.getFromSearchBox = function () {\n\t\tif ($searchValue.val() !== '') {\n\t\t\tvar query = $searchValue.val();\n\t\t\twords = query.split(\" \");\n\t\t\treturn this.getCategoryWord('categories', words)\n\t\t}\n\t\treturn '';\n\t}\n\n\tVoiceTextHandler.prototype.getCategoryWord = function (baseKey, nestedKey) {\n\t\tfor (var i = 0; i < nestedKey.length; i++) {\n\t\t\tfor (var j = 0; j < nestedKey.length; j++) {\n\n\t\t\t\t// A check for n-grams if available in the categories\n\t\t\t\tvar joinedStr = nestedKey.slice(i, j + 1).join(\" \");\n\t\t\t\tif (this.store.get(baseKey, joinedStr)) {\n\t\t\t\t\treturn joinedStr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t};\n\n\tVoiceTextHandler.prototype.applyFilter = function (redirectFlag, keyword) {\n\t\tsetTimeout(closeDialog, 1000);\n\t\tif (redirectFlag && this.selectedFilters.length <= 0) {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tif (redirectFlag) {\n\t\t\t$(window).trigger(this.domManipulator.filterTrigger, [this.selectedFilters]);\n\t\t}\n\t}\n\n\tVoiceTextHandler.prototype.filters = function (nestedKey) {\n\t\tfor (var i = 0; i < this.store.filterNames.length; i++) {\n\t\t\tvar identifier = this.store.get(this.store.filterNames[i], nestedKey);\n\t\t\tif (identifier) {\n\t\t\t\tthis.selectedFilters.push({\n\t\t\t\t\tparent: this.store.filterNames[i],\n\t\t\t\t\tvalue: capitalizeFirstLetter(nestedKey),\n\t\t\t\t\ttype: identifier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\tVoiceTextHandler.prototype.checkFilter = function (keyword) {\n\t\tvar popupOpened = false;\n\t\tvar words = keyword.split(\" \");\n\t\tthis.selectedFilters = [];\n\n\t\tvar oldCategory = getFromSession() || this.getFromSearchBox();\n\t\tvar newCategory = this.getCategoryWord('categories', words);\n\n\t\tif (!oldCategory || oldCategory !== newCategory) {\n\t\t\tfor (var i = 0; i < words.length; i++) {\n\t\t\t\tif (this.domManipulator.filtersToBeHandled.includes(words[i])) {\n\t\t\t\t\tpopupOpened = this.domManipulator.checkWordForPopup(words[i]);\n\t\t\t\t}\n\t\t\t\tpopupOpened = true;\n\t\t\t\tif (popupOpened) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tthis.filters(words[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.applyFilter(!popupOpened, keyword);\n\t\t} else {\n\t\t\tredirect(keyword);\n\t\t}\n\t\tstoreInSession(newCategory, oldCategory);\n\t};\n\twindow.VoiceTextHandler = new VoiceTextHandler({\n\t\toptions: {\n\t\t\t'categories': {\n\t\t\t\t'shoes': 'true', 'jewellery': 'true', 'accessories': 'true', 'home and furniture': 'true', 'sports': 'true',\n\t\t\t\t'clothing': 'true', 'peep toes': 'true', 'toys': 'true', 'kids toys': 'true', 'kids shoes': 'true', 'sandals': 'true', 'slippers': 'true',\n\t\t\t\t'sneakers': 'true', 'flip flops': 'true', 'bellies': 'true', 'formal shoes': 'true', 'boots': 'true', 'floaters': 'true', 'beauty': 'true',\n\t\t\t\t'women beauty': 'true', 'fragrances': 'true', 'perfumes and edts': 'true', 'deodorants and colognes': 'true', 'gift sets': 'true',\n\t\t\t\t'make up': 'true', 'lips': 'true', 'lipstick': 'true', 'lip gloss': 'true', 'lip liner': 'true', 'lip pencil': 'true', 'lip pallete': 'true',\n\t\t\t\t'lip brush': 'true', 'eye': 'true', 'kajal': 'true', 'eye liner': 'true', 'kurta': 'true', 'kurti': 'true', 'suits': 'true',\n\t\t\t\t'saree': 'true', 'tops': 'true', 'tees': 'true', 'shirt': 'true', 'jeans': 'true', 'leggings': 'true', 'sunglasses': 'true', 'dresses': 'true',\n\t\t\t\t'watches': 'true', 'polos': 'true', 'shorts': 'true', 'skirts': 'true'\n\t\t\t},\n\t\t\t'colors': {\n\t\t\t\t'black': 'checkbox', 'brown': 'checkbox', 'purple': 'checkbox', 'blue': 'checkbox', 'red': 'checkbox',\n\t\t\t\t'green': 'checkbox', 'tan': 'checkbox', 'transparent': 'checkbox', 'white': 'checkbox', 'yellow': 'checkbox',\n\t\t\t\t'maroon': 'checkbox', 'orange': 'checkbox', 'copper': 'checkbox', 'silver': 'checkbox', 'khaki': 'checkbox'\n\t\t\t},\n\t\t\t'gender': {\n\t\t\t\t'men': 'input', 'women': 'input', 'kids': 'input', 'girls': 'input', 'boys': 'input', 'unisex': 'input'\n\t\t\t}\n\t\t},\n\t\tfilterNames: ['colors', 'gender']\n\t});\n\n})(window);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.catalog.initiator.js\n// module id = 0\n// module chunks = 0 1 3","/**\n * ***********************************\n * *********** Recognition ***********\n * ***********************************\n */\n\n/**\n * Usage\n * const reco = new Recognition({\n * baseUrl: 'https://www.google.co.in/search'\n * });\n */\nvar vsCatalog = require('./vs.catalog.initiator');\n\n(function (root) {\n \"use strict\";\n\n var $dataView = $('#main').attr('data-view');\n\n var WebSpeechRecognition = root.SpeechRecognition || root.webkitSpeechRecognition;\n\n if (!WebSpeechRecognition) {\n return false;\n }\n\n // Style sheet\n // const styles = `\n // @keyframes listening{\n // 0%{box-shadow: 0px 0px 50px #afabab;}\n // 10%{box-shadow: 0px 0px 45px #afabab;}\n // 20%{box-shadow: 0px 0px 43px #afabab;}\n // 30%{box-shadow: 0px 0px 40px #afabab;}\n // 40%{box-shadow: 0px 0px 30px #afabab;}\n // 50%{box-shadow: 0px 0px 27px #afabab;}\n // 60%{box-shadow: 0px 0px 25px #afabab;}\n // 70%{box-shadow: 0px 0px 20px #afabab;}\n // 80%{box-shadow: 0px 0px 15px #afabab;}\n // 90%{box-shadow: 0px 0px 10px #afabab;}\n // 100%{box-shadow: 0px 0px 0px #afabab;}\n // }\n // .vs{position: absolute;right: 50px;top: 15px;box-sizing: border-box;text-align: center;color: #fff;}\n // .vs .icon{display: inline-block;width: 50px;height: 50px;color: #fff;}\n // .vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name: listening;box-shadow: 0px 0px 50px #afabab;width: 66px;background-color: #f78f26;border-radius: 50%;color: #fff;height:66px;padding-top:16px;}\n // .vs .icon path{fill:#b2b2b2}\n // .vs dialog .icon path{fill:#fff}\n // .vs dialog{position:fixed;width: 93vw;padding: 40px 0;top: 70px;border: transparent;background-color: #f2f2f2;}\n // .vs .vs-head{font-size: 1em;text-transform:capitalize}\n // .vs dialog::backdrop{background-color:rgba(0, 0, 0, 0.83)}\n // .show-close-btn .vs{display:none}\n // @media (max-width: 767px){\n // .main-header .top-search-input .search-containter {top:10px;width: 50px}\n // .main-header.show-close-btn .close-search{right: 76px;top: 10px;background-position: -49px -199px}\n // }\n // `;\n\n const styles = `@keyframes listening{0%{box-shadow:0 0 50px #afabab}10%{box-shadow:0 0 45px #afabab}20%{box-shadow:0 0 43px #afabab}30%{box-shadow:0 0 40px #afabab}40%{box-shadow:0 0 30px #afabab}50%{box-shadow:0 0 27px #afabab}60%{box-shadow:0 0 25px #afabab}70%{box-shadow:0 0 20px #afabab}80%{box-shadow:0 0 15px #afabab}90%{box-shadow:0 0 10px #afabab}100%{box-shadow:0 0 0 #afabab}}.vs{position:absolute;right:0;top:6px;box-sizing:border-box;text-align:center;color:#fff; cursor:pointer;}.vs .icon{display:inline-block;width:50px;height:50px;color:#fff}.vs dialog .icon{animation-duration:1s;animation-iteration-count:infinite;animation-name:listening;box-shadow:0 0 50px #afabab;width:66px;background-color:#f78f26;border-radius:50%;color:#fff;height:66px;padding-top:20px}.vs.jb .icon path{fill:#f79026}.vs .icon path{fill:#b2b2b2}.vs dialog .icon path,.vs.jb dialog .icon path{fill:#fff}.vs dialog{position:fixed;width:93vw;padding:40px 0;top:70px;border:transparent;background-color:#f2f2f2}.vs .vs-head{font-size:1em;text-transform:capitalize}.vs dialog::backdrop{background-color:rgba(0,0,0,.83)}.show-close-btn .vs{display:none}.search-containter{display:none}@media (max-width:767px){.main-header .top-search-input .vs{right:20px;top:15px}.main-header.show-close-btn .top-search-input .search-containter{display:block}}`;\n\n const onspeechend = function () {\n Recognition.mic.style.animationName = 'none';\n this.stop();\n };\n\n const onerror = function (event) {\n Recognition.mic.style.animationName = 'none';\n Recognition.dialogHead.innerHTML = 'Could not recognise the speech. Please try again!';\n console.log('Speech recognition error detected: ' + event.error + \" message \" + event.message);\n this.stop();\n };\n\n const onnomatch = function () {\n console.log('Could not recognise the speech, try again...');\n this.stop();\n };\n\n function addStyle() {\n let head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = styles;\n } else {\n style.appendChild(document.createTextNode(styles));\n }\n head.appendChild(style);\n }\n\n function iconFactory() {\n var icon;\n icon = document.createElement('i');\n icon.innerHTML = ``;\n\n icon.classList.add('icon');\n\n return icon;\n }\n\n function decorate(handler) {\n let container = document.createElement('div');\n let icon = iconFactory();\n let dialog = document.createElement('dialog');\n let header = '

Listening ...

';\n let target = document.querySelector(this.agent.target) || document.body;\n\n dialog.innerHTML = header;\n\n Recognition.mic = container;\n Recognition.dialog = dialog;\n\n addStyle();\n\n container.classList.add('vs');\n\n if (this.agent.bgColor) {\n container.style.backgroundColor = this.agent.bgColor;\n }\n\n if (this.agent.borderColor) {\n container.style.borderColor = this.agent.borderColor;\n }\n\n dialog.appendChild(icon.cloneNode(true));\n\n Recognition.dialogHead = Recognition.dialog.querySelector('.vs-head');\n Recognition.mic = Recognition.dialog.querySelector('.icon');\n\n container.appendChild(dialog);\n container.appendChild(icon);\n target.appendChild(container);\n container.style.opacity = '1';\n\n container.addEventListener('click', handler);\n }\n\n const defaults = {\n lang: 'en-US',\n continuous: false,\n maxAlternatives: 1,\n interimResults: false,\n dictionary: {},\n mic: 'icon',\n bgColor: '#fff'\n }\n\n const onresult = function (event) {\n var keyword = event.results[0][0].transcript.toLowerCase();\n var arr = [\n \"\\\\bsearch\\\\b\", \"\\\\bfor\\\\b\", \"\\\\bshow\\\\b\", \"\\\\bfind\\\\b\", \"\\\\bget\\\\b\", \"\\\\bextract\\\\b\", \"\\\\bgive\\\\b\", \"\\\\bsame\\\\b\", \"\\\\bsimilar\\\\b\", \"\\\\bwant\\\\b\", \"\\\\bwants\\\\b\", \"\\\\bme\\\\b\", \"\\\\bi\\\\b\", \"\\\\bfetch\\\\b\", \"\\\\bdo\\\\b\", \"\\\\btake\\\\b\", \"\\\\bto\\\\b\", \"\\\\bgo\\\\b\", \"\\\\bsome\\\\b\"\n ], arrRegex = new RegExp(arr.join('|'), 'g');\n keyword = keyword.replace(arrRegex, '');\n if ((window.location.href).indexOf(\"/customer/self-help-desk\") !== -1) {\n var filter = keyword.match(/return|order|cancel|refund|exchange/g);\n if (filter) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Checking for '${filter[0]}'`;\n if (filter[0] === 'order') {\n return window.location.href = '/customer/self-help-desk/view/order';\n }\n if (filter[0] === 'return') {\n return window.location.href = '/customer/self-help-desk/view/return';\n }\n if (filter[0] === 'cancel') {\n return window.location.href = '/customer/self-help-desk/view/cancellation';\n }\n if (filter[0] === 'refund') {\n return window.location.href = '/customer/self-help-desk/view/refunds';\n }\n if (filter[0] === 'exchange') {\n return window.location.href = '/customer/self-help-desk/view/exchange';\n }\n }\n }\n var command = keyword.match(/cart|account|wishlist|sign in|log in|login|sign up|track my order|track order|help|order/g);\n if (command) {\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Taking you to '${command[0]}'`;\n if (command[0] === 'cart') {\n return window.location.href = '/cart';\n }\n if (command[0] === 'account') {\n return window.location.href = '/account';\n }\n if (command[0] === 'wishlist') {\n return window.location.href = '/quicklist';\n }\n if (command[0] === 'sign in' || command[0] === 'log in' || command[0] === 'login') {\n return window.location.href = '/customer/account/login';\n }\n if (command[0] === 'sign up') {\n return window.location.href = '/customer/account/create';\n }\n if (command[0] === 'order') {\n return window.location.href = '/customer/order';\n }\n if (command[0] === 'help') {\n return window.location.href = '/customer/self-help-desk';\n }\n if (command[0] === 'track my order' || command[0] === 'track order') {\n return window.location.href = '/customer/order/trackorder';\n }\n }\n var url;\n event.stopImmediatePropagation();\n\n Recognition\n .dialog\n .querySelector('.vs-head')\n .innerHTML = `Looking for '${keyword}'`;\n\n if (this.dictionary[keyword]) {\n url = this.dictionary[keyword];\n } else {\n url = this.baseUrl + \"?q=\" + encodeURI(keyword);\n }\n\n if (typeof this.cb === 'function') {\n this.cb(keyword, url);\n }\n $dataView === 'catalog' ? window.VoiceTextHandler.checkFilter(keyword) : window.location = url;\n };\n\n function Recognition(options) {\n this.agent = new WebSpeechRecognition();\n\n Object.assign(this.agent, defaults, options);\n\n this.agent.onresult = onresult.bind(this.agent);\n this.agent.onspeechend = onspeechend.bind(this.agent);\n this.agent.onerror = onerror.bind(this.agent);\n this.agent.onnomatch = onnomatch.bind(this.agent);\n this.agent.onstart = function () {\n Recognition.dialogHead.innerHTML = 'Getting ready to serve you!'\n !Recognition.dialog.open && Recognition.dialog.showModal();\n };\n\n this.agent.onsoundstart = function () {\n Recognition.dialogHead.innerHTML = 'Listening ...';\n };\n this.agent.onsoundend = function () {\n Recognition.mic.style.animationName = 'none';;\n };\n this.agent.onaudiostart = function () {\n Recognition.dialogHead.innerHTML = 'Speak Now ...';\n };\n this.agent.onaudioend = function () {\n Recognition.mic.style.animationName = 'none';\n };\n\n decorate.call(this, this.start.bind(this));\n };\n\n Recognition.prototype.start = function () {\n Recognition.mic.style.animationName = 'listening';\n this\n .agent\n .start();\n };\n\n Recognition.prototype.stop = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .stop();\n };\n\n Recognition.prototype.abort = function () {\n Recognition.mic.style.animationName = 'none';\n this\n .agent\n .abort();\n };\n\n root.Recognition = Recognition;\n\n}(window));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./vs.target.js\n// module id = 1\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 0edd64c..efe6e91 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ module.exports = { entry: { "vs": "./vs.js", "vs.tg": "./vs.target.js", - "vs.only": "./vs.only.js", + "vs.only": "./vs.target.js", "vs.b": "./vs.bottom.js", "vs.c": "./vs.catalog.initiator.js" },