PageSourceSearch

https://www.bestbuy.com/~assets/bby/_com/vendor/bestbuy/gvp-lib-initializer/3.3.6/dist/initializer.min.js

js bestbuy.com collected 2026-09-24 09:07:40 UTC 16,748 bytes, 3 lines download raw bytes

vendor: 5,422 bytes, lines 1-3
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@bestbuy/gvp-lib-action-log"),require("@bestbuy/gvp-lib-config-service"),require("redux"),require("@bestbuy/cj-capture-sdk-context-provider"),require("@bestbuy/cj-capture-sdk")):"function"==typeof define&&define.amd?define(["@bestbuy/gvp-lib-action-log","@bestbuy/gvp-lib-config-service","redux","@bestbuy/cj-capture-sdk-context-provider","@bestbuy/cj-capture-sdk"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).initializer=e(t.actionLog,t.configService,t.Redux,t.cjCaptureSdkContextProvider,t.cjCaptureSdk)}(this,function(t,e,n,r,o){"use strict";function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e,n,r,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){c(i,r,o,a,u,"next",t)}function u(t){c(i,r,o,a,u,"throw",t)}a(void 0)})}}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,v(r.key),r)}}function s(t,e,n){return(e=v(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function p(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function d(){
2/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,s=Object.create(u.prototype);return y(s,"_invoke",function(n,r,o){var i,a,u,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,a=0,u=t,p.n=n,c}};function d(n,r){for(a=n,u=r,e=0;!l&&s&&!o&&e<f.length;e++){var o,i=f[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,a=0))}if(o||n>1)return c;throw l=!0,r}return function(o,f,y){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,y),a=f,u=y;(e=a<2?t:u)||!l;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(l=p.n<0)?u:n.call(r,p))!==c)break}catch(e){i=t,a=1,u=e}finally{s=1}}return{value:e,done:l}}}(n,o,i),!0),s}var c={};function a(){}function u(){}function s(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(y(e={},r,function(){return this}),e),l=s.prototype=a.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,y(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return u.prototype=s,y(l,"constructor",s),y(s,"constructor",u),u.displayName="GeneratorFunction",y(s,o,"GeneratorFunction"),y(l),y(l,o,"Generator"),y(l,r,function(){return this}),y(l,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:p}})()}function y(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}y=function(t,e,n,r){function i(e,n){y(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},y(t,e,n,r)}function m(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
3(t,"string");return"symbol"==typeof e?e:e+""}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}var h="ERROR";var g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="Initializer: Invalid componentDescriptor:",n=t.creatorNamespace,r=t.componentId,o=t.contractVersion;if(!n)throw new Error("".concat(e," must include creatorNamespace"));if(!r)throw new Error("".concat(e," must include componentId"));if(!o)throw new Error("".concat(e," must include contractVersion"))},w=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.creatorNamespace,n=t.componentId,r=t.contractVersion,o=t.componentVersion;return[e,n,r,(void 0===o?"":o).replace(/\./g,"_")].filter(function(t){return!!t}).join(".")},I=function(t){var e=t.split(".");return{creatorNamespace:e[0],componentId:e[1],contractVersion:e[2]}},S=function(t,e,n){var r;function o(){var o=e(t.getState());o!==r&&n(r=o)}var i=t.subscribe(o);return o(),i},O=function(){return Math.random().toString(36).substr(2,9)},E="COMPONENT_LOADING",j="REGISTER_COMPONENT",N="REGISTER_INSTANCE",C="INITIALIZED_INSTANCE",T="REGISTER_INSTANCE_DEINITFN",_=function(t,e){var n=t.components[w(e)];return!n&&e.componentVersion&&(n=t.components[w(l(l({},e),{},{componentVersion:void 0}))]),n},k=function(t,e,n){var r=_(t,n);if(r)return e[r.initFnId]},P=function(t,e){var n=_(t,e);return!(!n||!0!==n.isLoaded)},D=function(t,e){return t.instances[e]};function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}var F=function(t){return t&&"object"===L(t)&&t.constructor===Object},q=function(t){return"string"==typeof t||t instanceof String};function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}var R,z,x=function(){return n=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.store=e,this.initStore={},this.deInitStore={},this.initializedComponentList=[],this.initializedWithoutRegister={}},r=[{key:"log",value:function(e,n,r,o,i){var c=o.creatorNamespace,a=o.componentId,u=o.contractVersion;t.dispatch(function(t,e,n,r,o,i,c){return{type:"LOG",level:t,message:e,error:n,componentId:o,creatorNamespace:r,contractVersion:i,instanceId:c}}(e,n,r,c,a,u,i),"gvp-initializer")}},{key:"initializeComponent",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if("string"!=typeof i){var c=new Error("Initializer: Locale param must be a string");this.logInitFailed(c,n,r)}var a=this.store,u=a.dispatch,s=a.getState,f=n.creatorNamespace,l=n.componentId,p=n.contractVersion,d="#".concat(r," .").concat(f,"-").concat(l),y=k(s(),this.initStore,n);window.depProxy({ca:"lib-initializer",mn:"analytics-q"}).then(function(t){return t.get()}).then(function(t){return t()}).then(function(t){t.dispatch(function(t,e,n,r,o){if(!t||!q(t))throw Error("instanceId is required to register a component");if(o&&!F(o))throw new Error("schemaData should be an object, received a type: ".concat(A(o)," instead"));if((!e||e&&!q(e))&&console.warn("An optional componentType will be deprecated. It will be required in the future."),n){if(!F(n))throw Error("componentDescriptor is not an object");if(!q(n.creatorNamespace))throw Error("componentDescriptor.creatorNamespace is required to register a component");if(!q(n.componentId))throw Error("componentDescriptor.componentId is required to register a component");if(!q(n.contractVersion))throw Error("componentDescriptor.contractVersion is required to register a component")}return{type:"REGISTER_COMPONENT",instanceId:t,componentType:e,componentDescriptor:n,apeData:r,schemaData:o}}(r,"".concat(f,"-").concat(l,"-").concat(p),Object.assign({},n)))}).catch(function(t){console.log(t)}),"string"==typeof o&&(o=(0,eval)("(".concat(o,")")));var m=[r,d,o,i,e.getComponentConfig(f,l)];if(u(function(t,e,n){if(!t||!e||!n)throw new Error("Register instance request must have destructured componentDescriptor props: componentDescriptor, instanceId, elementSelector");g(t,N);var r=w(t);return{type:N,componentFqn:r,instanceId:e,elementSelector:n}}(n,r,d)),y)this.doInit(n,r,y,m);else var v=S(this.store,function(e){return k(e,t.initStore,n)},function(e){t.doInit(n,r,e,m),v()})}},{key:"initComponent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=document.getElementById("".concat(e,"-json"));if(r){var o=JSON.parse(r.textContent);this.initializeComponent(t,e,o,n)}else this.log(h,"Failed to find application/json script containing state for ".concat(e),null,t,e)}},{key:"deInitializeInstance",value:function(t){var e=(0,this.store.getState)(),n=function(t,e,n){var r=D(t,n);if(r)return e[r.deInitFnId]}(e,this.deInitStore,t),r=function(t,e){var n=D(t,e);if(n)return n.elementSelector}(e,t);if(n)try{return n(r),!0}catch(n){var o=I(D(e,t));return this.log(h,"Failed to deInitialize ".concat(t),n,o,t),!1}}},{key:"doInit",value:function(t,e,n,r){var o=this,i=this.store.dispatch;setTimeout(function(){try{var c=n.apply(void 0,m(r));i(function(t){return{type:C,instanceId:t,isInitialized:!0}}(e)),"function"==typeof c&&i(function(t,e,n){if("function"!=typeof n)throw new Error("deInitFn must be type: Function");var r=O();return t[r]=n,{type:T,instanceId:e,deInitFnId:r}}(o.deInitStore,e,c))}catch(n){o.logInitFailed(n,t,e)}},0)}},{key:"logInitFailed",value:function(t,e,n){var r="Initializer failed to initialize component for ".concat(n,". Usually this is caused by an exception in your component's client init function.");throw this.log(h,r,t,e,n),new Error(r)}},{key:"registerComponent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;this.store.dispatch(function(t,e,n){if(!t||!e||!n)throw new Error("Register Component request must include all of the following: initStore, componentDescriptor, initFn");g(e,j);var r=w(e),o=O();return t[o]=n,{type:j,componentFqn:r,isLoading:!1,isLoaded:!0,initFnId:o}}(this.initStore,t,e))}},{key:"onRegister",value:function(t,e){var n=S(this.store,function(e){return P(e,t)},function(t){!0===t&&(setTimeout(function(){e()},0),n())})}},{key:"onLoad",value:function(t,e){var n=S(this.store,function(e){return P(e,t)},function(t){!0===t&&(setTimeout(function(){e()},0),n())})}},{key:"onInitialize",value:function(t,e){var n=S(this.store,function(e){return function(t,e){var n=D(t,e);return!(!n||!0!==n.isInitialized)}(e,t)},function(t){!0===t&&(setTimeout(function(){e()},0),n())})}},{key:"componentIsLoading",value:function(t){var e=this.store,n=e.dispatch,r=e.getState;P(r(),t)||n(function(t){if(!t)throw new Error("Component Loading request must include a componentDescriptor");g(t,E);var e=w(t);return{type:E,componentFqn:e,isLoading:!0}}(t))}},{key:"isComponentLoading",value:function(t){return function(t,e){var n=_(t,e);if(n)return n&&!0===n.isLoading}((0,this.store.getState)(),t)}},{key:"isComponentRegistered",value:function(t){var e=this.store.getState;return P(e(),t)}},{key:"isComponentInitialized",value:function(t){return this.initializedComponentList.indexOf(t)>-1}},{key:"applyLayoutClassList",value:function(t,e){var n=D(this.store.getState(),e),r=document.getElementById(e);n?r?t&&"string"==typeof r.dataset.layoutClassList?(r.className=r.dataset.layoutClassList,r.removeAttribute("data-layout-class-list")):t||"string"!=typeof r.className||(r.dataset.layoutClassList=r.className,r.removeAttribute("class")):this.log(h,"Element for component ".concat(e," not found"),null,I(n.componentFqn),e):this.log(h,"Instance for component ".concat(e," not found"),null,{},e)}}],r&&u(n.prototype,r),o&&u(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(),V=["componentFqn"],G=["componentFqn"],M=["instanceId"],U=["instanceId"],X=["instanceId"],B=n.combineReducers({components:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l({},arguments.length>1?arguments[1]:void 0);switch(e.type){case j:delete e.type;var n=e.componentFqn,r=p(e,V),o={};return o[n]=l({},r),l(l({},t),o);case E:delete e.type;var i=e.componentFqn,c=p(e,G),a={};return a[i]=l({},c),l(l({},t),a);default:return t}},instances:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l({},arguments.length>1?arguments[1]:void 0);switch(e.type){case N:delete e.type;var n=e.instanceId,r=p(e,M),o={};return o[n]=l({},r),l(l({},t),o);case C:delete e.type;var i=e.instanceId,c=p(e,U),a={};return a[i]=l(l({},c),t[i]),l(l({},t),a);case T:delete e.type;var u=e.instanceId,s=p(e,X),f={};return f[u]=l(l({},s),t[u]),l(l({},t),f);default:return t}}}),J="object"===("undefined"==typeof window?"undefined":b(window))&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@bestbuy/gvp-lib-initializer"}):n.compose,W=n.createStore(B,J()),Y={id:"0a3112b5-31dc-4cad-8f36-11274f8aaa35",version:"2"},K=function(){var t;switch((null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.hostname)||""){case"www.bestbuy.com":return"production";case"www.stage.bestbuy.com":return"stage";case"www.test.bestbuy.com":return"test";case"dev.bestbuy.com":return"dev";default:return"local"}},Z=function(){return R||(R=r.DEE_DATA_LAYER("undefined"!=typeof document&&!!document.cookie.split(";").find(function(t){return t.trim().startsWith("et=")}))),R},$=Z;function H(){return Q.apply(this,arguments)}function Q(){return(Q=a(d().m(function t(){var e,n,i,c;return d().w(function(t){for(;;)switch(t.n){case 0:if("undefined"!=typeof window){t.n=1;break}return t.a(2);case 1:return e=Z(),n=K(),i=o.generateUuid(),c="production"!==n,o.configureEventBatcher(10,5e3,14,["load","interaction"],["cjc-page-requests"]),t.n=2,r.cjCaptureContextProvider({schemaName:e,contractObject:Y,env:n,pageViewId:i,loggerConfig:c?5:3,loggerListener:c?function(t){var e={1:"fatal",2:"error",3:"warn",4:"info",5:"debug"}[null==t?void 0:t.level]||"unknown";console.log("[CJ Capture SDK][".concat(e,"]"),t)}:void 0,overrides:{appState:{uuid:i}}});case 2:try{localStorage.setItem("cjc_route_determination",JSON.stringify({sharedAppStateUuid:i,routeName:window.location.pathname,pageViewId:document.title}))}catch(t){console.error("[initializeAnalytics] Failed to write route determination to localStorage: ".concat(t.message))}case 3:return t.a(2)}},t)}))).apply(this,arguments)}(z=a(d().m(function t(){return d().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,H();case 1:return t.a(2)}},t)})),function(){return z.apply(this,arguments)})().catch(function(t){return console.error("[cj-capture-sdk] initialization failed",t)});var tt=new x(W);return tt.version="3.3.6",tt.DEE_DATA_LAYER=$,tt});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.