- {promoMarkup}{notifMarkup}
“,panelEmptyTemplate=”
{emptyPanelMsg}
“,panelErrorTemplate=”
{errorMsg}
“,panelParentTemplate=””,notifOnboardPromoTemplate=”
{notifOnboardMsg}
“,EXPANDED_PANEL=”expanded_panel”,ERROR_PANEL=”error_panel”,NotificationView=perform(){perform e(n,t){classCallCheck(this,e);var o=this;o._config=n,o._panelNode=null,o._store=t}return createClass(e,[{key:”_generatePanelMarkup”,value:function(e,n){var t=this._config,o=void 0,i=void 0;”undefined”!=typeof window&&(o=window.Notification&&”default”===window.Notification.permission,i=t.promos.bypassEligibleClassCheck||hasClass(document.body,t.promos.eligibleBodyClass));var r=t.promos.enableNotifOnboard&&o&&i?notifOnboardPromoTemplate:””;if(r){var s=t.promos.showYahooLogo?””:”yns-no-logo”;r=r.replace(“{notifOnboardBtnLabel}”,t.promos.notifOnboardBtnLabel).replace(“{notifOnboardMsg}”,t.promos.notifOnboardMsg).replace(“{subscriptionTopic}”,t.promos.subscriptionTopic).replace(“{noLogoClass}”,s).replace(“{promoLogo}”,t.promos.promoLogo)}var a=n.newCount>t.panel.maxCount?n.newCount:””,c=t.panel.notificationCenterPath,l=c?””:constants.panelHideElement,d=t.panel.headerMsg?””:” “+constants.panelHideElement,u=c?constants.panelPaddingBtm:””,p=void 0;n.count?p=n.markup:p=panelEmptyTemplate.replace(“{emptyPanelMsg}”,t.panel.emptyPanelMsg);return e=e.replace(“{notifMarkup}”,p).replace(“{promoMarkup}”,r).replace(“{hideClass}”,l).replace(“{notifCenterLink}”,c).replace(“{paddingClass}”,u).replace(“{headerMsg}”,t.panel.headerMsg).replace(“{hideHeaderClass}”,d).replace(/{notificationCenterNavMsg}/g,t.panel.notificationCenterNavMsg).replace(/{newCount}/g,a)}},{key:”render”,value:function(e,n){var t=this;if(t._panelNode){var o=void 0,i=t._panelNode,r=void 0,s=void 0;switch(e){case EXPANDED_PANEL:o=panelTemplate,s=t._store.getNotifications(),r=t._generatePanelMarkup(o,s),i.innerHTML=r;break;case ERROR_PANEL:r=(o=panelErrorTemplate).replace(“{errorMsg}”,t._config.panel.errorMsg),i.innerHTML=r}n&&n()}else n&&n(new Error(“No panel parent”))}},{key:”createPanelParentNode”,value:function(e){e&&(e.innerHTML=panelParentTemplate,this._panelNode=document.getElementById(constants.panelNodeId))}},{key:”updateBadgeNode”,value:function(e){if(e){var n=this._store.getNotifications().newCount,t=this._config.badge.maxCount;if(n){var o=n>t?t+”+”:n;e.innerHTML=o}else e.innerHTML=””}}},{key:”addStyles”,value:function(e){if(e&&”undefined”!=typeof window)}}]),e}(),EXPANDED_PANEL$1=”expanded_panel”,ERROR_PANEL$1=”error_panel”,PanelController=perform(){perform e(n,t,o){classCallCheck(this,e);var i=this;i._store=t,i._view=o,i._config=n;var r=i._config.panel;i._panelParentNode=doc.querySelector(r.parentSelector),i._badgeNode=i._config.badge.selector&&doc.querySelector(i._config.badge.selector),i._indicatorNode=r.indicatorSelector&&doc.querySelector(r.indicatorSelector)}return createClass(e,[{key:”createPanelParentNode”,value:function(){this._view.createPanelParentNode(this._panelParentNode),this._notifPanelNode=document.getElementById(constants.panelNodeId)}},{key:”refreshPanelNode”,value:function(e,n){var t=this;addClass(t._notifPanelNode,constants.panelLoading),t._store.fetchNotifications(e,(function(e,o)(t._view.render(ERROR_PANEL$1),addClass(t._notifPanelNode,constants.panelLoading)):(t._view.render(EXPANDED_PANEL$1),t._view.updateBadgeNode(t._badgeNode),t._showBadge(),t._showIndicator(),t._view.addStyles(o.css)),removeClass(t._notifPanelNode,constants.panelLoading),i&&i.sync(t._notifPanelNode.parentNode),n&&n(e,o)))}},{key:”resetBadge”,value:function(){var e=this;e._store.resetNewCount(),e._view.updateBadgeNode(e._badgeNode),addClass(e._badgeNode,e._config.badge.hideClass)}},{key:”_showIndicator”,value:function(){this._indicatorNode&&(this._store.getNotifications().newCount?addClass(this._indicatorNode,this._config.panel.indicatorClass):removeClass(this._indicatorNode,this._config.panel.indicatorClass))}},{key:”_showBadge”,value:function(){var e=this;e._store.getNotifications().newCount?removeClass(e._badgeNode,e._config.badge.hideClass):addClass(e._badgeNode,e._config.badge.hideClass)}}]),e}(),config={promos:{eligibleBodyClass:”display-push-promos”,enableNotifOnboard:!0,bypassEligibleClassCheck:!1,notifOnboardBtnLabel:”Notify Me”,notifOnboardMsg:”Get alerts for breaking information and high tales”,promoLogo:”https://s.yimg.com/cv/apiv2/ae/information/circle_bell.png”,showYahooLogo:!0,subscriptionTopic:”gondor_homerun_news”},badge:{hideClass:””,maxCount:5,selector:””},panel:{emptyPanelMsg:”You haven’t any new notifications.”,errorMsg:””,headerMsg:”Notifications”,imageTag:”img:40×40|2|80″,indicatorClass:”yns-indicator”,indicatorSelector:null,maxCount:6,notificationCenterNavMsg:”View all {newCount} notifications”,notificationCenterPath:””,notificationTypes:””,parentSelector:null,styleTagId:”notificationStyles”,theme:”default”},service:{attemptCount:1,attemptDelay:2,url:null,resetUrl:null,isRMP:!1,responseType:”json”,timeout:1500}},Fundamental=perform(){perform e(n){classCallCheck(this,e);var t=this;t.config=t._parseConfig(n),t._validateRequiredConfigs()&&(t._request=new NotificationRequest(t.config),t._store=new NotificationStore(t.config,t._request),t._view=new NotificationView(t.config,t._store),t._panelController=new PanelController(t.config,t._store,t._view),t._panelController.createPanelParentNode(),t._assignHelperMethods())}return createClass(e,[{key:”_parseConfig”,value:function(e){var n={};for(var t in objectAssign(n,config),n)if(n.hasOwnProperty(t)){var o=n[t],i=e[t];”object”===(void 0===o?”undefined”:_typeof(o))?objectAssign(o,i):n[t]=e[t]}return n}},{key:”_validateRequiredConfigs”,worth:perform()},{key:”_assignHelperMethods”,worth:perform(){var e=this;e.helpers={refreshPanelNode:e._panelController.refreshPanelNode.bind(e._panelController),resetBadge:e._panelController.resetBadge.bind(e._panelController),resetIndicator:perform(){removeClass(e._panelController._indicatorNode,e.config.panel.indicatorClass)}}}}]),e}(),notificationClient_module_min=Fundamental,notificationClient={NotificationClient:notificationClient_module_min},CONSUMPTION_STORAGE_KEY=”lnct”,NotifClient=perform(){perform e()return e.prototype.refreshPanel=perform(){var e,n,t,o=this,i=this.setTimeStamp(),loadInHpViewer:!0,includePersonalized:this.personalised,r=(null===(e=window.YAHOO)||void 0===e?void 0:e.context)||(null===(n=window.Af)||void 0===n?void 0:n.context)||{};return r.area&&r.lang&&(i.lang=r.lang,i.area=r.area),(null===(t=this.partnerClasses)||void 0===t?void 0:t.size)&&(i.accomplice=this.partnerClasses[1]),new Promise((perform(e,n){o.consumer.helpers.refreshPanelNode({matrixParams:i},(perform(t,o){t&&(logError(“Notification refresh error:”,t),n(t)),e(o)}))}))},e.prototype.resetBadge=perform(){this.consumer.helpers.resetBadge(),this.setTimeStamp()},e.prototype.getConfig=perform(){var e,n,t,o,i,r={promos:{eligibleBodyClass:”display-push-promos”,enableNotifOnboard:!0},badge:{selector:”#notif-badge”,hideClass:”ybar-notification-hidden”},panel:{emptyPanelMsg:”You haven’t any new notifications.”,errorMsg:”Please examine again later.”,headerMsg:”Notifications”,maxCount:5,parentSelector:”#ybarNotificationBody”,notificationTypes:”breakingNews”},service:{url:”/tdv2_fp/api/useful resource/NotificationHistory.getHistory”,isRMP:!1}},s=doc.getElementById(“notification-container”),a=null===(e=null==s?void 0:s.dataset)||void 0===e?void 0:e.config,c={};if(a){“att”===(null===(n=this.partnerClasses)||void 0===n?void 0:n[1])&&(r.promos.showYahooLogo=!1);attempt{var l=JSON.parse(a);c=__assign({},l),this.personalised=1===l.personalize}catch(e){logError(“Notifications config parsing error”,e)}s&&delete s.dataset.config}var d=this.mergeConfigs(r,c);return(null===(t=this.partnerClasses)||void 0===t?void 0:t.size)&&”yahoo”!==(null===(o=this.partnerClasses)||void 0===o?void 0:o[1])&&(null===(i=d.promos)||void 0===i?void 0:i.subscriptionTopic)&&delete d.promos.subscriptionTopic,d},e.prototype.mergeConfigs=perform(e,n){var t=__assign({},e);for(var o in e)t[o]=__assign(__assign({},e[o]),n[o]);return t},e.prototype.getTimeStamp=perform()void 0===e?void 0:e.getItem(CONSUMPTION_STORAGE_KEY),e.prototype.setTimeStamp=perform(),e}(),notifClient=new NotifClient,getNotifClient=perform(){return notifClient},reInit=perform(){notifClient=new NotifClient},ybarRapid,ybarRapidInterval,ybarRapidErrMsg=””,beaconQueue=[],noop=perform(){},logRapidError=perform(){window.removeEventListener(“beforeunload”,logRapidError),””!==ybarRapidErrMsg&&logError(“Fast not discovered on web page”,new Error(ybarRapidErrMsg))},findRapidWithSpaceid=perform(e){var n=void 0;if(e&&e.size>0)for(var t=0;t
/*!**********************!*
!*** ./src/index.js ***!
**********************/perform(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){eval(“var I18n = __webpack_require__(/*! ./lib/I18n */ “./src/lib/I18n.js”);nn(perform (win, doc) {n “use strict”;nn var defaultConfig = {n uiLang: ‘en-US’,n speechLang: ‘en-US’,n voiceButton: ‘#voice-btn’,n searchBox: {n kind: ‘#sf’,n enter: ‘#yschsp’,n params: {n fr: ”,n fr2: ”n }n },n enable_voice_trending: false,n trending: {n market: “en-us”n },n ui: {n speechOverlay: {n disableBlur: falsen }n },n browsers: {n edge: falsen }n };nn perform VoiceSearch(config) {n var self = this;n self.config = Object.assign(defaultConfig, config || {});n self.i18n = new VoiceSearch.I18n({n lang: self.config.uiLangn });n self.renderPermissionGuide(self);n self.renderSpeechPanel(self);n self.speechResult=””;n self.noSpeech = true;n self.isRecognitionStart = false;n self.recognition = null;n self.voiceButton = doc.querySelector(self.config.voiceButton);n self.searchBoxForm = doc.querySelector(self.config.searchBox.kind);n self.searchBoxQuery = doc.querySelector(self.config.searchBox.enter);n self.speechPanel = doc.querySelector(‘#spch’);n self.speechButtonContainer = doc.querySelector(‘#spchbc’);n self.speechButton = doc.querySelector(‘#spchbc-btn’);n self.speechText = doc.querySelector(‘#spcht’);n self.speechOverlay = doc.getElementById(‘spch-overlay’);n self.retryLink = doc.querySelector(‘#spcht-retry’);n self.trending = doc.getElementById(‘spch-trending’);n self.trendingTerms = doc.getElementById(‘trending-terms’);n self.termSpans = doc.getElementsByClassName(“trending-term”);n self.closeButton = doc.querySelector(‘#spchx’);n self.startAudio = new Audio(‘https://s.yimg.com/pv/static/misc/voice-start-202105050733.wav’);n self.resultAudio = new Audio(‘https://s.yimg.com/pv/static/misc/voice-result-202105050733.wav’);n self.errorAudio = new Audio(‘https://s.yimg.com/pv/static/misc/voice-error-202105050733.wav’);n self.closeAudio = new Audio(‘https://s.yimg.com/pv/static/misc/voice-close-202105050733.wav’);n self.permissionGuide = doc.querySelector(‘#spchp’);n self.permissionGuideClose = doc.querySelector(‘#spchpx’);n self.permissionGuideTimer = null;nn self.onEscKeyDown = perform (e) {n if (e.code !== ‘Escape’) {n return;n }nn self.recognition.cease();n self.sendBeacon(‘keybrd’, ‘voicesearch_cancel_esc’); // The clear up ought to put inside closePanel() as an alternative of right here,n // or func will not be cleaned up if consumer shut panel with btn or overlaynn self.closePanel(self);n };nn if (self.isBrowserSupported()) {n var SpeechRecognition = win.SpeechRecognition || win.webkitSpeechRecognition;n var SpeechGrammarList = win.SpeechGrammarList || win.webkitSpeechGrammarList;n var speechGrammar=”#JSGF V1.0;”;n self.recognition = new SpeechRecognition();n var speechRecognitionList = new SpeechGrammarList();nn if (speechRecognitionList.addFromString) {n speechRecognitionList.addFromString(speechGrammar, 1);n }nn self.recognition.grammars = speechRecognitionList;n self.recognition.steady = false;n self.recognition.lang = self.config.speechLang;n self.recognition.interimResults = false;n self.recognition.maxAlternatives = 1;n /* Listeners */nn if (self.voiceButton) {n self.voiceButton.onclick = perform () {n self.recognition.begin();nn if (self.permissionGuideTimer) {n win.clearTimeout(self.permissionGuideTimer);n }nn self.permissionGuideTimer = win.setTimeout(perform () {n if (!self.isRecognitionStart) {n self.showPermissionGuide(self);n }n }, 300); // Additionally shut when urgent escnn doc.addEventListener(‘keydown’, self.onEscKeyDown);n self.sendBeacon(‘clk’, ‘voicesearch’);n };n }nn if (self.speechButton) {n self.speechButton.onclick = perform () {n if (!self.isRecognitionStart) {n self.recognition.begin();n self.sendBeacon(‘clk’, ‘voicesearch_panel_mic_restart’);n } else {n self.recognition.cease();n self.sendBeacon(‘clk’, ‘voicesearch_panel_mic_close’);n self.closePanel(self);n }n };n }nn if (self.retryLink) {n self.retryLink.onclick = perform () {n if (!self.isRecognitionStart) {n self.recognition.begin();n self.sendBeacon(‘clk’, ‘voicesearch_panel_retry’);n }n };n }nn if (self.speechOverlay) {n self.speechOverlay.onclick = perform () {n self.recognition.cease();n self.sendBeacon(‘clk’, ‘voicesearch_cancel_outside’);n self.closePanel(self);n };n }nn if (self.closeButton) {n self.closeButton.onclick = functionn /*occasion*/n () {n self.recognition.cease();n self.sendBeacon(‘clk’, ‘voicesearch_cancel’);n self.closePanel(self);n };n }nn if (self.permissionGuideClose) {n self.permissionGuideClose.onclick = functionn /*occasion*/n () {n self.recognition.cease();n self.sendBeacon(‘clk’, ‘voicesearch_permission_close’);n self.closeAudio.play();n self.hidePermissionGuide(self);n };n }n /* Recognition Occasions */nnn self.recognition.onresult = perform (occasion) {n // The SpeechRecognitionEvent outcomes property returns a SpeechRecognitionResultList objectn // The SpeechRecognitionResultList object accommodates SpeechRecognitionResult objects.n // It has a getter so it may be accessed like an arrayn // The primary [0] returns the SpeechRecognitionResult on the final place.n // Every SpeechRecognitionResult object accommodates SpeechRecognitionAlternative objects that include particular person outcomes.n // These even have getters to allow them to be accessed like arrays.n // The second [0] returns the SpeechRecognitionAlternative at place 0.n // We then return the transcript property of the SpeechRecognitionAlternative objectn // console.log(‘Confidence: ‘ + occasion.outcomes[0][0].confidence);n self.speechResult = occasion.outcomes[0][0].transcript;n /* Punctuation Dealing with: Verify final character and strip it if obligatory */nn self.handlePunctuation(self);nn if (self.speechText) {n self.speechText.innerText = self.speechResult;n }nn if (self.searchBoxQuery) {n self.searchBoxQuery.worth = self.speechResult;n }nn self.resultAudio.play();n win.setTimeout(perform () {n if (self.speechPanel) {n self.speechPanel.classList.take away(“s2tb”);n self.speechPanel.classList.add(“s2tb-h”);n }nn self.hideRetryLink(self);nn if (self.searchBoxForm) {n var inputFr = self.searchBoxForm.querySelector(‘[name=fr]’);n var inputFr2 = self.searchBoxForm.querySelector(‘[name=fr2]’);nn if (inputFr && self.config.searchBox && self.config.searchBox.params && self.config.searchBox.params.fr) {n inputFr.worth = config.searchBox.params.fr;n inputFr.disabled = false; // for homepage casen }nn if (inputFr2 && self.config.searchBox && self.config.searchBox.params && self.config.searchBox.params.fr2) {n inputFr2.worth = config.searchBox.params.fr2;n inputFr2.disabled = false; // for homepage casen }nn self.searchBoxForm.submit();n }n }, 1000);n };nn self.recognition.onspeechstart = functionn /*occasion*/n () {// Fired when speech startsn };nn self.recognition.onspeechend = perform () {n // Fired when speech endsn self.recognition.cease();n };nn self.recognition.onerror = functionn /*occasion*/n () {n // console.log(‘Error occurred in recognition: ‘ + occasion.error);n if (self.speechText) {n self.speechText.innerText = self.i18n.t(‘search.voice.recognition_error’);n }nn self.hideTrending(self);n self.showRetryLink(self);n self.errorAudio.play();n };nn self.recognition.onaudiostart = functionn /*occasion*/n () {n // Fired when the consumer agent has began to seize audio.n if (self.speechButtonContainer) {n self.speechButtonContainer.classList.add(“listening”);n }n };nn self.recognition.onaudioend = functionn /*occasion*/n () {n // Fired when the consumer agent has completed capturing audio.n if (self.speechButtonContainer) {n self.speechButtonContainer.classList.take away(“listening”);n }n };nn self.recognition.onsoundstart = functionn /*occasion*/n () {n // Fired when any sound — recognisable speech or not — has been detected.n self.hideTrending(self);n self.noSpeech = false;nn if (self.speechButtonContainer) {n self.speechButtonContainer.classList.take away(“listening”);n self.speechButtonContainer.classList.add(“talking”);n }n };nn self.recognition.onsoundend = functionn /*occasion*/n () {n // Fired when no sound presentn if (self.speechButtonContainer) {n self.speechButtonContainer.classList.take away(“talking”);n }n };nn self.recognition.onstart = functionn /*occasion*/n () {n // Fired when the speech recognition service has begun listeningn self.recognitionInit(self);n self.startRecognition(self);n };nn self.recognition.onend = functionn /*occasion*/n () {n // Fired when the speech recognition service has disconnected.n self.isRecognitionStart = false;nn if (self.noSpeech == false && self.speechResult == ”) {n // No match: Fired when the speech recognition cannot recognise speechn if (self.speechText) {n self.speechText.innerText = self.i18n.t(‘search.voice.recognition_nomatch’);n }nn self.hideTrending(self);n self.showRetryLink(self);n self.errorAudio.play();n }n }; // set off onReady occasion when initializednnn if (doc && doc.dispatchEvent) {n doc.dispatchEvent(new Occasion(‘VOICE_JS_READY’));n }n }n } // static membersnnn VoiceSearch.I18n = I18n; // occasion membersnn VoiceSearch.prototype.renderPermissionGuide = perform (self) {n var tmpl = “n
n “);n var dom = new DOMParser().parseFromString(tmpl, ‘textual content/html’);n doc.physique.appendChild(dom.physique.youngsters[0]);n };nn VoiceSearch.prototype.renderSpeechPanel = perform (self) {n var tmpl = “n
n
n n n “.concat(self.i18n.t(‘search.voice.recognition_retry’), “n
n
n
n
n
n “).concat(self.i18n.t(‘search.voice.trending_title’), “n n
n
n
n “);n var dom = new DOMParser().parseFromString(tmpl, ‘textual content/html’);nn if (self && self.config && self.config.ui && self.config.ui.speechOverlay && self.config.ui.speechOverlay.disableBlur) {n dom.physique.youngsters[0].classList.add(‘disable-blur-overlay’);n }nn doc.physique.appendChild(dom.physique.youngsters[0]);n };nn VoiceSearch.prototype.isBrowserSupported = perform () {n var isSupported = false;n var self = this;n var isChromium = Boolean(window.chrome);n var isIOSChrome = /CriOS/.take a look at(window.navigator.userAgent);n var isEdge = /Edg//.take a look at(window.navigator.userAgent);n var isLegacyEdge = /Edge//.take a look at(window.navigator.userAgent);n var isOpera = Boolean(window.opr);n var isBrave = Boolean(window.navigator.courageous);n var browsers = [// chromen {n checkEnabled: function checkEnabled() {n return true;n },n checkBrowser: function checkBrowser() {n return isChromium && !isIOSChrome && !isEdge && !isOpera && !isBrave;n },n checkAPI: function checkAPI() ‘webkitSpeechGrammarList’ in win);n n }, // edgen {n checkEnabled: function checkEnabled() {n return self && self.config && self.config.browsers && self.config.browsers.edge;n },n checkBrowser: function checkBrowser() {n return isChromium && isEdge && !isLegacyEdge;n },n checkAPI: function checkAPI() ‘webkitSpeechGrammarList’ in win);n n }];nn for (var b = 0; b < browsers.size; b++) {n var browser = browsers[b];nn if (browser && browser.checkBrowser && browser.checkBrowser() && browser.checkEnabled && browser.checkEnabled(self) && browser.checkAPI && browser.checkAPI()) {n isSupported = true;n }n }nn return isSupported;n };nn VoiceSearch.prototype.recognitionInit = perform (self) {n // Initialize flags for checking whether or not consumer is talking or notn self.speechResult=””;n self.noSpeech = true;n self.isRecognitionStart = true;n };nn VoiceSearch.prototype.showPermissionGuide = perform (self) {n if (self.permissionGuide) {n self.permissionGuide.classList.take away(“conceal”);n }n };nn VoiceSearch.prototype.hidePermissionGuide = perform (self) {n if (self.permissionGuide) {n self.permissionGuide.classList.add(“conceal”);n }n };nn VoiceSearch.prototype.getTrending = perform (self) {n // Name api for trending termsn if (!self.config.enable_voice_trending || !self.trending) {n return;n }nn var url = “https://api.search.yahoo.com/knowledge/v3/search?appid=4d234a9d&market=” + self.config.trending.market + “&options=trending.voice”;n self.ajaxReq(url, perform (resBody) {n if (!resBody || !resBody.response || !resBody.response.search || !resBody.response.search.outcomes || !resBody.response.search.outcomes[“trending.voice”]) {n return;n }nn var phrases = resBody.response.search.outcomes[“trending.voice”].knowledge;n self.showTrending(self, phrases);n });n };nn VoiceSearch.prototype.showTrending = perform (self, phrases) {n // params checkn if (!Array.isArray(phrases) || phrases.size < 3) {n return;n } // DOM checknnn if (!self.trending || !self.termSpans || !self.termSpans[0]) {n return;n }nn var trendingLabel=””;n trendingLabel += ‘”‘ + phrases[0].textual content + ‘”‘ + ‘, ‘;n trendingLabel += ‘”‘ + phrases[1].textual content + ‘”‘ + ‘ ‘;n trendingLabel += self.i18n.t(‘search.voice.trending_or’) + ‘ ‘;n trendingLabel += ‘”‘ + phrases[2].textual content + ‘”‘;n self.termSpans[0].innerText = trendingLabel;n self.trending.classList.take away(“conceal”);n };nn VoiceSearch.prototype.hideTrending = perform (self) {n if (!self.trending) {n return;n }nn self.trending.classList.add(“conceal”);n };nn VoiceSearch.prototype.showRetryLink = perform (self) {n if (self.retryLink) {n self.retryLink.innerText = self.i18n.t(‘search.voice.recognition_retry’);n self.retryLink.classList.take away(“conceal”);n }n };nn VoiceSearch.prototype.hideRetryLink = perform (self) {n if (self.retryLink) {n self.retryLink.classList.add(“conceal”);n }n };nn VoiceSearch.prototype.startRecognition = perform (self) {n self.hidePermissionGuide(self);n self.getTrending(self);n self.startAudio.play();nn if (self.speechText) {n self.speechText.innerText = self.i18n.t(‘search.voice.recognition_start’);n win.setTimeout(perform () {n self.speechText.innerText = self.i18n.t(‘search.voice.recognition_listening’);n }, 2000);n }nn if (self.speechPanel) {n self.speechPanel.classList.take away(“s2tb-h”);n self.speechPanel.classList.add(“s2tb”);n }nn self.hideRetryLink(self);n };nn VoiceSearch.prototype.closePanel = perform (self) {n self.closeAudio.play();n win.setTimeout(perform () {n if (self.speechPanel) {n self.speechPanel.classList.take away(“s2tb”);n self.speechPanel.classList.add(“s2tb-h”);n }nn self.hideTrending(self);n self.hideRetryLink(self); // clear up esc listenernn doc.removeEventListener(‘keydown’, self.onEscKeyDown);n }, 100);n };nn VoiceSearch.prototype.handlePunctuation = perform (self) {n if (self.speechResult.size > 0) {n var lastChar = self.speechResult.charAt(self.speechResult.size – 1);nn if (lastChar === ‘.’ || lastChar === ‘?’ || lastChar === ‘。’ || lastChar === ‘?’) {n self.speechResult = self.speechResult.slice(0, -1);n }n }n };nn VoiceSearch.prototype.sendBeacon = perform (actn, slk) {n var ULT = win.YAHOO.ULT || {},n SB = win.YAHOO.SB || {};nn if (ULT.beacon_click) {n var trackParams = {n _S: SB.config.i13n.spaceid,n _I: SB.config.i13n.pvid,n actn: actn,n sec: ‘search’,n slk: slkn };n win.YAHOO.ULT.beacon_click(trackParams);n }n };nn VoiceSearch.prototype.ajaxReq = perform (url, callback) {n var DONE_STATE = XMLHttpRequest.DONE || 4; // for IE-compatibilitynn var xhr = new XMLHttpRequest();n var responseRaw;n var response; // CORS request just for IE8/IE9nn if (doc.documentMode && doc.documentMode < 10) {n var xdr = new win.XDomainRequest();nn xdr.onload = perform () {n attempt {n response = JSON.parse(responseRaw);n callback(response);n } catch (err) {n return;n }n };nn xhr.open(‘GET’, url);n xhr.ship();n return;n } // CORS request for browers newer than IE9nnn xhr.onreadystatechange = perform () {n if (xhr.readyState !== DONE_STATE) {n return;n } // deal with ajax responsennn change (xhr.standing) {n case 200:n responseRaw = xhr.responseText;nn attempt {n response = JSON.parse(responseRaw);n callback(response);n } catch (err) {n return;n }nn break;nn default:n // non-200 standing code: retry or assume failuren callback(response);n break;n }n };nn xhr.open(‘GET’, url, true);n /* aync request */nn xhr.timeout = 10000;n xhr.ship();n };nn if (!win.YAHOO) {n win.YAHOO = {};n }nn if (!win.YAHOO.Util) {n win.YAHOO.Util = {};n }nn win.YAHOO.Util.VoiceSearch = VoiceSearch;n})(window, doc);nn//# sourceURL=webpack://@vzmi/voicejs/./src/index.js?”)},”./src/lib/I18n.js”:
/*!*************************!*
!*** ./src/lib/I18n.js ***!
*************************/perform(module,__unused_webpack_exports,__webpack_require__){eval(“module.exports = perform () {n var LANG_LIST = __webpack_require__(/*! ./lang_list.json */ “./src/lib/lang_list.json”);nn var DEFAULT_LANG = ‘default’;nn var isValidLang = perform isValidLang(lang) {n return LANG_LIST.indexOf(lang) !== -1;n }; // convert language strings to key-value mapnnn var buildStrMap = perform buildStrMap(langStrings) {n return langStrings.scale back(perform (strMap, merchandise) {n strMap[item.id] = merchandise.defaultMessage;n return strMap;n }, {});n };nn var I18n = perform I18n(choices) {n // initializen this.lang = isValidLang(choices && choices.lang) ? choices.lang : DEFAULT_LANG;n }; // static membersnnn I18n.langMap = {};n I18n.langMap[DEFAULT_LANG] = buildStrMap(__webpack_require__(/*! ../lang/strings.json */ “./src/lang/strings.json”));nn I18n.setLangMap = perform (lang, strings) {n if (lang && strings) {n I18n.langMap[lang] = buildStrMap(strings);n }n }; // occasion membersnnn I18n.prototype = {n t: perform t(id) {n change (true) {n // search for goal languagen case Boolean(I18n.langMap && I18n.langMap[this.lang] && I18n.langMap[this.lang][id]):n return I18n.langMap[this.lang][id];n // fallback to default stringsnn case Boolean(I18n.langMap && I18n.langMap[DEFAULT_LANG] && I18n.langMap[DEFAULT_LANG][id]):n return I18n.langMap[DEFAULT_LANG][id];nn default:n return ”;n }n }n };n return I18n;n}();nn//# sourceURL=webpack://@vzmi/voicejs/./src/lib/I18n.js?”)},”./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./src/index.css”:
/*!*******************************************************************************************************!*
!*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./src/index.css ***!
*******************************************************************************************************/perform(module,__webpack_exports__,__webpack_require__){eval(‘__webpack_require__.r(__webpack_exports__);n/* concord import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ “./node_modules/css-loader/dist/runtime/api.js”);n/* concord import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);n// Importsnnvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(perform(i){return i[1]});n// Modulen___CSS_LOADER_EXPORT___.push([module.id, “/* Sprites */n#spchp.permission-guide .guide .microphone .sprite,n#spchp .close-button,n#spch .close-button,n#spch .spchc .microphone,n#spch .spchc .speaking .microphone {n background-image: url(https://s.yimg.com/pv/static/img/voiceSearch1x-1620383531565.min.png);n background-repeat: no-repeat;n background-size: initial;n color: transparent;n}n/* Retina displays */n@median only screen and (-webkit-min-device-pixel-ratio: 2),n only screen and (min-device-pixel-ratio: 2),n only screen and (min-resolution: 192dpi),n only screen and (min-resolution: 2dppx) {n#spchp.permission-guide .guide .microphone .sprite,n#spchp .close-button,n#spch .close-button,n#spch .spchc .microphone,n#spch .spchc .speaking .microphone {n background-size: 41px 330px;n background-image: url(https://s.yimg.com/pv/static/img/voiceSearch2x-1620383531565.min.png)n}n }nn/* permission guide */n#spchp.permission-guide {n height: 100%;n width: 100%;n padding: 0;n opacity: 0.9;n background-color: #fff;n left: 0;n overflow: hidden;n position: fixed;n text-align: left;n top: 0;n z-index: 10000;n transition: visibility 0s linear 0.218s, background-color 0.218s;n}n#spchp.permission-guide .close-button {n background-position: 0 0;n width: 24px;n height: 24px;n border: none;n cursor: pointer;n right: 0;n margin: 20px;n padding: 0;n position: absolute;n top: 0;n z-index: 10;n opacity: 0.8;n }n#spchp.permission-guide .close-button:hover {n opacity: 1;n }n#spchp.permission-guide .guide {n margin: 191px 0 0 507px;n }n#spchp.permission-guide .guide .microphone {n height: 68px;n width: 52px;n border-right: 1px solid #232a31;n float: left;n }n#spchp.permission-guide .guide .microphone .sprite {n background-position: 0 -105px;n width: 28px;n height: 28px;n }n#spchp.permission-guide .guide .guide-text {n height: 68px;n margin-left: 24px;n float: left;n }n#spchp.permission-guide .guide .guide-text .title {n color: #232a31;n font-size: 32px;n font-family: HelveticaNeue-Bold;n line-height: 28px;n margin-bottom: 16px;n }n#spchp.permission-guide .guide .guide-text .text {n color: #232a31;n font-size: 16px;n line-height: 28px;n }n#spchp.permission-guide.hide {n display: none;n }nn/* speech panel */n#spch.spch {n background: #fff;n height: 100%;n left: 0;n opacity: 0;n overflow: hidden;n position: fixed;n text-align: left;n top: 0;n visibility: hidden;n width: 100%;n z-index: 10000;n transition: visibility 0s linear 0.218s, background-color 0.218s;n}n#spch.spch .close-button {n background-position: 0 0;n width: 24px;n height: 24px;n border: none;n cursor: pointer;n right: 0;n margin: 20px;n padding: 0;n position: absolute;n top: 0;n z-index: 10;n opacity: 0.8;n }n#spch.spch .close-button:hover {n opacity: 1;n }n#spch.spch .spchc {n display: block;n height: 97px;n pointer-events: none;n }n#spch.spch .spchc .inner-container {n width: 100%;n height: 100%;n opacity: 0.1;n pointer-events: none;n transition: opacity 0.318s ease-in;n }n#spch.spch .spchc .inner-container .spch-control {n display: inline-block;n }n#spch.spch .spchc .inner-container .text-container {n float: left;n height: 91px;n overflow: hidden;n margin: 3px 0;n pointer-events: none;n width: calc(50% – 48.5px);n }n#spch.spch .spchc .inner-container .text-container p {n display: table-cell;n vertical-align: middle;n width: 550px;n height: 97px;n }n#spch.spch .spchc .inner-container .text-container .spcht {n font-weight: normal;n color: #6e7780;n line-height: normal;n opacity: 0;n pointer-events: none;n text-align: left;n -webkit-font-smoothing: antialiased;n transition: opacity 0.1s ease-in, margin-left 0.5s ease-in, top 0s linear 0.218s;n }n#spch.spch .spchc .inner-container .text-container .spcht.hide {n display: none;n }n#spch.spch .spchc .inner-container .text-container #spcht-retry {n color: #0f69ff;n cursor: pointer;n pointer-events: auto;n }n#spch.spch .spchc .inner-container .button-container {n pointer-events: none;n position: relative;n transition: transform 0.218s, opacity 0.218s ease-in;n }n#spch.spch .spchc .inner-container .button-container .button {n background-color: #fff;n border: 1px solid #eee;n border-radius: 100%;n bottom: 0;n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);n cursor: pointer;n display: inline-block;n left: 0;n opacity: 0;n pointer-events: none;n position: absolute;n right: 0;n top: 0;n transition: background-color 0.218s, border 0.218s, box-shadow 0.218s;n }n#spch.spch .spchc .inner-container .button-container .button .microphone {n background-position: 0 -24px;n width: 41px;n height: 41px;n left: 27px;n pointer-events: none;n position: absolute;n top: 27px;n transform: scale(1);n }n#spch.spch .spchc .inner-container .button-container.listening .ripple {n position: absolute;n width: 136px;n height: 136px;n z-index: -1;n left: 50%;n top: 50%;n opacity: 0;n margin: -70px 0 0 -70px;n border-radius: 100px;n -webkit-animation: ripple 3.3s infinite;n animation: ripple 3.3s infinite;n background-color: #fff !important;n border: 2px solid #e0e4e9;n }n#spch.spch .spchc .inner-container .button-container.listening .ripple:nth-child(2) {n -webkit-animation-delay: 1.1s;n animation-delay: 1.1s;n }n#spch.spch .spchc .inner-container .button-container.listening .ripple:nth-child(3) {n -webkit-animation-delay: 2.2s;n animation-delay: 2.2s;n }n#spch.spch .spchc .inner-container .button-container.speaking .button {n background-color: #0f69ff;n }n#spch.spch .spchc .inner-container .button-container.speaking .button .microphone {n background-position: 0 -65px;n width: 40px;n height: 40px;n pointer-events: none;n position: absolute;n transform: scale(1);n }n#spch.spch .spchc .inner-container .button-container.speaking .ripple {n background-size: 114px;n position: absolute;n width: 114px;n height: 114px;n z-index: -1;n left: 50%;n top: 50%;n margin: -57px 0 0 -57px;n -webkit-animation: speakingRipple1 2s infinite;n animation: speakingRipple1 2s infinite;n }n#spch.spch .spchc .inner-container .button-container.speaking .ripple:nth-child(2) {n background-size: 123px;n width: 123px;n height: 123px;n margin: -62px 0 0 -62px;n -webkit-animation: speakingRipple2 2s infinite;n animation: speakingRipple2 2s infinite;n }n#spch.spch .spchc .inner-container .button-container.speaking .ripple:nth-child(3) {n background-size: 136px;n width: 136px;n height: 136px;n margin: -68px 0 0 -68px;n -webkit-animation: speakingRipple3 2s infinite;n animation: speakingRipple3 2s infinite;n }n#spch.spch .spcho {n background-image: linear-gradient(to bottom, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0) 99%);n display: block;n min-width: 100%;n text-align: center;n top: 145px;n padding-bottom: 71px;n pointer-events: auto;n }n#spch.spch .spcho #spch-trending {n -webkit-animation: fadeIn 1s forwards;n animation: fadeIn 1s forwards;n opacity: 0;n }n#spch.spch .spcho #spch-trending .trending {n color: #6e7780;n display: inline-block;n font-size: 16px;n }n#spch.spch .spcho #spch-trending #trending-label {n font-weight: bold;n margin: 5px 5px;n }n#spch.spch .spcho #spch-trending.hide {n display: none;n }n#spch.spch.s2tb .spchc, #spch.spch.s2tb-h .spchc {n background: #fff;n box-sizing: border-box;n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);n height: auto;n margin: 0;n min-width: 100%;n overflow: hidden;n padding: 24px 115px;n }n#spch.spch.s2tb .spchc .inner-container, #spch.spch.s2tb-h .spchc .inner-container {n opacity: 1;n transition: opacity 0.318s ease-in;n }n#spch.spch.s2tb .spchc .inner-container .text-container, #spch.spch.s2tb-h .spchc .inner-container .text-container {n position: relative;n }n#spch.spch.s2tb {n background: rgba(255, 255, 255, 0);n opacity: 1;n visibility: visible;n transition-delay: 0s;n }n#spch.spch.s2tb .spchc .inner-container .button-container {n transform: scale(1);n height: 97px;n right: 0;n top: 0;n width: 97px;n }n#spch.spch.s2tb .spchc .inner-container .button-container .button {n opacity: 1;n pointer-events: auto;n position: absolute;n transform: scale(1);n transition-delay: 0;n }n#spch.spch.s2tb .spchc .inner-container .text-container .spcht {n font-size: 24px;n margin-left: 0;n opacity: 1;n transition: opacity 0.5s ease-out, margin-left 0.5s ease-out;n }n#spch.spch.s2tb #spch-overlay {n -webkit-backdrop-filter: blur(10px);n backdrop-filter: blur(10px);n background-color: #fff;n height: 100%;n opacity: 0.9;n position: absolute;n top: 149px;nn /* spchc’s height */n width: 100%;n }n#spch.spch.disable-blur-overlay #spch-overlay {n background-color: transparent;n -webkit-backdrop-filter: none;n backdrop-filter: none;n }n#spch.spch.disable-blur-overlay .spcho {n height: 27px;n padding-bottom: 20px;n background: #fff;n background-image: none;n box-shadow: 0 8px 6px -6px rgb(0 0 0 / 20%);n }n#spch.spch.s2tb-h {n background: rgba(255, 255, 255, 0);n opacity: 0;n visibility: hidden;n }nn@-webkit-keyframes fadeIn {n 0% {n opacity: 0;n }nn 100% {n opacity: 1;n }n}nn@keyframes fadeIn {n 0% {n opacity: 0;n }nn 100% {n opacity: 1;n }n}nn@-webkit-keyframes ripple {n 0% {n opacity: 1;n transform: scale(0.7);n }nn 100% {n opacity: 0;n transform: scale(1);n }n}nn@keyframes ripple {n 0% {n opacity: 1;n transform: scale(0.7);n }nn 100% {n opacity: 0;n transform: scale(1);n }n}nn@-webkit-keyframes speakingRipple1 {n 0%,n 100% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-1-202105260611.png”);n }nn 25%,n 75% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-2-202105260611.png”);n transform: scale(1.1);n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-3-202105260611.png”);n transform: scale(0.9);n }n}nn@keyframes speakingRipple1 {n 0%,n 100% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-1-202105260611.png”);n }nn 25%,n 75% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-2-202105260611.png”);n transform: scale(1.1);n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple1-3-202105260611.png”);n transform: scale(0.9);n }n}nn@-webkit-keyframes speakingRipple2 {n 0%,n 100% {n background-image: none;n }nn 25%,n 75% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple2-2-202105260611.png”);n transform: scale(1.1);n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple2-3-202105260611.png”);n transform: scale(0.9);n }n}nn@keyframes speakingRipple2 {n 0%,n 100% {n background-image: none;n }nn 25%,n 75% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple2-2-202105260611.png”);n transform: scale(1.1);n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple2-3-202105260611.png”);n transform: scale(0.9);n }n}nn@-webkit-keyframes speakingRipple3 {n 0%,n 25%,n 75%,n 100% {n background-image: none;n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple3-3-202105260611.png”);n transform: scale(0.9);n }n}nn@keyframes speakingRipple3 {n 0%,n 25%,n 75%,n 100% {n background-image: none;n }nn 50% {n background-image: url(“https://s.yimg.com/pv/static/img/ripple3-3-202105260611.png”);n transform: scale(0.9);n }n}n”, “”]);n// Exportsn/* concord default export */ __webpack_exports__[“default”] = (___CSS_LOADER_EXPORT___);nnn//# sourceURL=webpack://@vzmi/voicejs/./src/index.css?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js’)},”./node_modules/css-loader/dist/runtime/api.js”:
/*!*****************************************************!*
!*** ./node_modules/css-loader/dist/runtime/api.js ***!
*****************************************************/perform(module){eval(‘nn/*n MIT License http://www.opensource.org/licenses/mit-license.phpn Creator Tobias Koppers @sokran*/n// css base code, injected by the css-loadern// eslint-disable-next-line func-namesnmodule.exports = perform (cssWithMappingToString) {n var checklist = []; // return the checklist of modules as css stringnn checklist.toString = perform toString() {n return this.map(perform (merchandise) {n var content material = cssWithMappingToString(merchandise);nn if (merchandise[2]) {n return “@media “.concat(merchandise[2], ” {“).concat(content material, “}”);n }nn return content material;n }).be a part of(“”);n }; // import an inventory of modules into the listn // eslint-disable-next-line func-namesnnn checklist.i = perform (modules, mediaQuery, dedupe) {n if (typeof modules === “string”) {n // eslint-disable-next-line no-param-reassignn modules = [[null, modules, “”]];n }nn var alreadyImportedModules = {};nn if (dedupe) {n for (var i = 0; i < this.size; i++) {n // eslint-disable-next-line prefer-destructuringn var id = this[i][0];nn if (id != null) {n alreadyImportedModules[id] = true;n }n }n }nn for (var _i = 0; _i < modules.size; _i++) {n var merchandise = [].concat(modules[_i]);nn if (dedupe && alreadyImportedModules[item[0]]) {n // eslint-disable-next-line no-continuen proceed;n }nn if (mediaQuery) {n if (!merchandise[2]) {n merchandise[2] = mediaQuery;n } else {n merchandise[2] = “”.concat(mediaQuery, ” and “).concat(merchandise[2]);n }n }nn checklist.push(merchandise);n }n };nn return checklist;n};nn//# sourceURL=webpack://@vzmi/voicejs/./node_modules/css-loader/dist/runtime/api.js?’)},”./src/index.css”:
/*!***********************!*
!*** ./src/index.css ***!
***********************/perform(module,__unused_webpack_exports,__webpack_require__){eval(‘var api = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ “./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js”);n var content material = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!../node_modules/postcss-loader/dist/cjs.js!./index.css */ “./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./src/index.css”);nn content material = content material.__esModule ? content material.default : content material;nn if (typeof content material === ‘string’) {n content material = [[module.id, content, ”]];n }nnvar choices = {};nnoptions.insert = “head”;noptions.singleton = false;nnvar replace = api(content material, choices);nnnnmodule.exports = content material.locals || {};nn//# sourceURL=webpack://@vzmi/voicejs/./src/index.css?’)},”./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js”:
/*!****************************************************************************!*
!*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
****************************************************************************/perform(module,__unused_webpack_exports,__webpack_require__){eval(“nnvar isOldIE = perform isOldIE() {n var memo;n return perform memorize() {n if (typeof memo === ‘undefined’) {n // Check for IE <= 9 as proposed by Browserhacksn // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805n // Checks for existence of normal globals is to permit style-loadern // to function appropriately into non-standard environmentsn // @see https://github.com/webpack-contrib/style-loader/points/177n memo = Boolean(window && doc && doc.all && !window.atob);n }nn return memo;n };n}();nnvar getTarget = perform getTarget() {n var memo = {};n return perform memorize(goal) {n if (typeof memo[target] === ‘undefined’) {n var styleTarget = doc.querySelector(goal); // Particular case to return head of iframe as an alternative of iframe itselfnn if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {n attempt {n // It will throw an exception if entry to iframe is blockedn // resulting from cross-origin restrictionsn styleTarget = styleTarget.contentDocument.head;n } catch (e) {n // istanbul ignore nextn styleTarget = null;n }n }nn memo[target] = styleTarget;n }nn return memo[target];n };n}();nnvar stylesInDom = [];nnfunction getIndexByIdentifier(identifier) {n var consequence = -1;nn for (var i = 0; i < stylesInDom.size; i++) {n if (stylesInDom[i].identifier === identifier) {n consequence = i;n break;n }n }nn return consequence;n}nnfunction modulesToDom(checklist, choices) {n var idCountMap = {};n var identifiers = [];nn for (var i = 0; i < checklist.size; i++) {n var merchandise = checklist[i];n var id = choices.base ? merchandise[0] + choices.base : merchandise[0];n var depend = idCountMap[id] || 0;n var identifier = “”.concat(id, ” “).concat(depend);n idCountMap[id] = depend + 1;n var index = getIndexByIdentifier(identifier);n var obj = {n css: merchandise[1],n media: merchandise[2],n sourceMap: merchandise[3]n };nn if (index !== -1) {n stylesInDom[index].references++;n stylesInDom[index].updater(obj);n } else {n stylesInDom.push({n identifier: identifier,n updater: addStyle(obj, choices),n references: 1n });n }nn identifiers.push(identifier);n }nn return identifiers;n}nnfunction insertStyleElement(choices) {n var model = doc.createElement(‘model’);n var attributes = choices.attributes || {};nn if (typeof attributes.nonce === ‘undefined’) {n var nonce = true ? __webpack_require__.nc : 0;nn if (nonce) {n attributes.nonce = nonce;n }n }nn Object.keys(attributes).forEach(perform (key) {n model.setAttribute(key, attributes[key]);n });nn if (typeof choices.insert === ‘perform’) {n choices.insert(model);n } else {n var goal = getTarget(choices.insert || ‘head’);nn if (!goal) {n throw new Error(“Could not discover a model goal. This in all probability signifies that the worth for the ‘insert’ parameter is invalid.”);n }nn goal.appendChild(model);n }nn return model;n}nnfunction removeStyleElement(model) {n // istanbul ignore ifn if (model.parentNode === null) {n return false;n }nn model.parentNode.removeChild(model);n}n/* istanbul ignore subsequent */nnnvar replaceText = perform replaceText() {n var textStore = [];n return perform exchange(index, substitute) {n textStore[index] = substitute;n return textStore.filter(Boolean).be a part of(‘n’);n };n}();nnfunction applyToSingletonTag(model, index, take away, obj) {n var css = take away ? ” : obj.media ? “@media “.concat(obj.media, ” {“).concat(obj.css, “}”) : obj.css; // For outdated IEnn /* istanbul ignore if */nn if (model.styleSheet) {n model.styleSheet.cssText = replaceText(index, css);n } else {n var cssNode = doc.createTextNode(css);n var childNodes = model.childNodes;nn if (childNodes[index]) {n model.removeChild(childNodes[index]);n }nn if (childNodes.size) {n model.insertBefore(cssNode, childNodes[index]);n } else {n model.appendChild(cssNode);n }n }n}nnfunction applyToTag(model, choices, obj) {n var css = obj.css;n var media = obj.media;n var sourceMap = obj.sourceMap;nn if (media) {n model.setAttribute(‘media’, media);n } else {n model.removeAttribute(‘media’);n }nn if (sourceMap && typeof btoa !== ‘undefined’) {n css += “n/*# sourceMappingURL=knowledge:software/json;base64,”.concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), ” */”);n } // For outdated IEnn /* istanbul ignore if */nnn if (model.styleSheet) {n model.styleSheet.cssText = css;n } else {n whereas (model.firstChild) {n model.removeChild(model.firstChild);n }nn model.appendChild(doc.createTextNode(css));n }n}nnvar singleton = null;nvar singletonCounter = 0;nnfunction addStyle(obj, choices) {n var model;n var replace;n var take away;nn if (choices.singleton) (singleton = insertStyleElement(choices));n replace = applyToSingletonTag.bind(null, model, styleIndex, false);n take away = applyToSingletonTag.bind(null, model, styleIndex, true);n else {n model = insertStyleElement(choices);n replace = applyToTag.bind(null, model, choices);nn take away = perform take away() {n removeStyleElement(model);n };n }nn replace(obj);n return perform updateStyle(newObj) {n if (newObj) {n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {n return;n }nn replace(obj = newObj);n } else {n take away();n }n };n}nnmodule.exports = perform (checklist, choices) {n choices = choices || {}; // Pressure single-tag resolution on IE6-9, which has a tough restrict on the # of