LocalCDN-Firefox-Chrome-Brave/resources/findify-bundle/6.9.15/initializer.js.map

1 line
105 KiB
Plaintext

{"version":3,"sources":["webpack:///../analytics-dom/lib/bindings/events.js","webpack:///../analytics-dom/lib/bindings/filters.js","webpack:///./src/helpers/scrollTo.ts","webpack:///./src/helpers/SignalCombinator.ts","webpack:///./src/core/events.ts","webpack:///./src/initialize.ts","webpack:///./src/helpers/addEventListeners.ts","webpack:///./src/helpers/capitalize.ts","webpack:///./src/features/create.ts","webpack:///./src/core/location.ts","webpack:///../analytics-dom/lib/helpers/decamelize.js","webpack:///./src/helpers/fallbackNode.ts","webpack:///../analytics-dom/lib/index.js","webpack:///./src/helpers/getParentNode.ts","webpack:///./src/core/emitter.ts","webpack:///./src/features/custom/index.ts","webpack:///./src/features/autocomplete/index.ts","webpack:///./src/helpers/setupPlatforms.ts","webpack:///./src/core/render.ts","webpack:///./src/core/widgets.ts","webpack:///./src/features/autocomplete/handlers.ts","webpack:///./src/helpers/documentReady.ts","webpack:///./src/helpers/findClosestElement.ts","webpack:///./src/features/recommendation/index.ts","webpack:///./src/features/content/index.ts","webpack:///./src/features/search/index.ts","webpack:///./src/features/tabs/index.ts","webpack:///./src/features/smart-collection/index.ts","webpack:///./src/features/recommendation/payload.ts","webpack:///./src/features sync ^\\.\\/.*$","webpack:///../analytics-dom/lib/bindings/dom.js","webpack:///./src/helpers/resolveCallback.ts","webpack:///./src/helpers/debounce.ts"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","__rest","e","indexOf","getOwnPropertySymbols","defineProperty","exports","value","types_1","__webpack_require__","decamelize_1","nodeToArray","node","Array","slice","normalizeKeys","obj","keys","reduce","acc","key","_a","decamelize","replace","normalizeClass","name","product_id","price_currency_code","order_number","getPropsFromChildren","nodeList","element","dataset","className","children","innerText","concat","getEventData","ownProps","EventName","purchase","updateCart","includes","event","line_items","map","childrenProps","getEventsOnPage","root","querySelectorAll","_b","rest","getDeprecatedEvents","events","pageViewNode","querySelector","purchaseNode","pageViewContent","item_id","innerHTML","line_item","data","revenue","amount","unit_price","parseFloat","getFiltersOnPage","getAttribute","type","values","isNaN","Number","Error","JSON","parse","split","v","trim","filter","r","_jump","__esModule","default","_debounce","nodes","Map","scrollTo","debounce","selector","offset","document","get","string","join","set","getBoundingClientRect","top","c","5Ihg","isArray","o","a","Symbol","iterator","next","done","push","return","TypeError","enumerable","configurable","writable","SignalCombinator","states","initialState","_defineProperty","state","transitor","transitionMapping","signalProcessor","defaultValue","signalProcessors","createSignalProcessor","signal","names","_this","signalSumName","x","processorToSignalMapping","sort","wrappedSignalProcessor","forEach","jointName","_this2","signalProcessingCache","argsToApply","signals","signalResult","apply","result","args","_this3","possibleStates","entries","_ref","_ref2","_slicedToArray","_ref3","_ref4","every","item","console","error","_len","_key","Events","_analyticsDom","_interopRequireDefault","_analytics","_emitter","_resolveCallback","_setupPlatforms","_events","_log","_scrollTo","location","_interopRequireWildcard","getOwnPropertyDescriptor","_objectSpread","asyncGeneratorStep","u","Promise","resolve","then","_asyncToGenerator","isReady","global","findify","window","listen","emitter","emit","addListeners","invalidate","isString","String","_callee","_config","asyncConfig","currency","cfg","extra","_require","fromJS","_require2","documentReady","_require3","createWidgets","bulkAddWidgets","_require4","renderWidgets","widgetsRenderNeeded","regeneratorRuntime","wrap","_callee$","_context","prev","abrupt","m","code","sent","currency_config","components","k","eval","findifyJsonp","config","analytics","platform","removeFindifyID","widgets","utils","selectors","list","test","navigator","userAgent","vendor","postMessage","__findify","store","version","mjs_version","id","merchant_id","origin","FindifyAnalytics","Analytics","stop","listeners","callback","context","withCapture","index","addEventListener","removeEventListener","capitalize","charAt","toUpperCase","camelize","FgcQ","createFeature","_react","constructor","setPrototypeOf","getPrototypeOf","__proto__","ReferenceError","l","f","FeatureCreator","props","_getPrototypeOf","_assertThisInitialized","component","mark","widget","updater","initial","setState","_component","createElement","unsubscribeForceUpdate","nextConfig","updateConfig","Component","_","_createBrowserHistory","_qs","isIE9","history","pushHistory","isAllPropsSame","collectionPath","pathname","toLowerCase","collections","getIn","listenHistory","str","search","prefix","elements","decoder","decodeURIComponent","ignoreQueryPrefix","buildQuery","_query","query","stringify","encoder","encodeURIComponent","addQueryPrefix","b","localeCompare","q","href","options","separator","fallback","style","display","visibility","showFallback","hideLoader","loaders","Mf9s","analyticsInstance","analytics_1","events_1","filters_1","dom_1","element_dataset_1","initialize","eventsConfig","filters","startDOMListeners","sendEvent","viewPage","analyticsDOM","readyState","body","__analytics","renderIn","innerWidth","parentElement","createChangeEmitter","_src","Custom","_reactConnect","_location","_handlers","_SignalCombinator","_agent","empty","createTrendingSearchesAgent","AutocompleteAgent","immutable","user","defaults","toJS","autocompleteComponent","Autocomplete","autocompleteTrendingComponent","isTrendingSearches","rerender","trendingSearchesAgent","agent","getQuery","apiKey","combinator","createSignal","trending","createSignalSum","suggestionCount","ui","noTs","transitionTo","renderTrendingSearches","AutocompleteProvider","registerHandlers","on","suggestions","meta","size","transition","_axios","disabled","shopify","persist","res","uniq_id","uid","visit_id","sid","axios","post","_reactDom","_create","_getParentNode","d","y","g","create","h","Portal","_classCallCheck","_possibleConstructorReturn","parent","getParentNode","insertBefore","firstChild","appendChild","removeChild","createPortal","RootElement","attach","toString","from","_toConsumableArray","detach","render","div","Agents","_immutable","_capitalize","cache","createAgent","instance","slot","createConfig","customs","withMutations","mergeDeep","isImmutable","_type","search-button","recommendations","isCollection","getEntity","widgetToRemove","find","findByType","types","_key2","findifyCreateFeature","propertyIsEnumerable","_objectWithoutProperties","_addEventListeners","_findClosestElement","findClosestForm","findClosestElement","container","subscribers","findifyElementFocused","setAttribute","handleWindowScroll","childNodes","_node$getBoundingClie","width","left","height","_top","scrollY","documentElement","scrollTop","_left","scrollX","scrollLeft","ghost","styles","_typeof","position","will-change","resetReferencedAgentsLogging","reset","log","updateReferencedAgents","noLogs","_value","isSearch","redirectToSearch","addEventListeners","target","relatedTarget","insideAutocomplete","hasAttribute","autocompleteFocusLost","form","preventDefault","evt","path","currentElement","tagName","unsubscribe","prop","fn","requestAnimationFrame","qgiQ","el","matchesFn","some","s5RT","_fallbackNode","_payload","getPayload","items","isEmpty","hideFallback","RecommendationProvider","Recommendation","setQuery","stopListenLocation","action","applyState","ContentProvider","Content","fallbackAgent","w","renderZeroResults","RecommendationAgent","ZeroResults","collectionNotFound","redirect","rid","suggestion","_x","_x2","SearchProvider","Search","parentNode","_createState","_widgets","counter","active","hydrate","TabsLayout","updateCount","onClick","toggle","title","count","getState","tZwI","rules","SmartCollectionProvider","v7cu","_get","_getIdsFromEvents","item_ids","multipleIds","payload","./autocomplete","./autocomplete/","./autocomplete/handlers","./autocomplete/handlers.ts","./autocomplete/index","./autocomplete/index.ts","./content","./content/","./content/index","./content/index.ts","./create","./create.ts","./custom","./custom/","./custom/index","./custom/index.ts","./recommendation","./recommendation/","./recommendation/index","./recommendation/index.ts","./recommendation/payload","./recommendation/payload.ts","./search","./search/","./search/index","./search/index.ts","./smart-collection","./smart-collection/","./smart-collection/index","./smart-collection/index.ts","./tabs","./tabs/","./tabs/index","./tabs/index.ts","webpackContext","req","webpackContextResolve","module","wNdy","proto","Element","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","track","yyga","callbacks","findifyCallbacks","cb","promises","all","wait","timeout","ctx","clearTimeout","setTimeout"],"mappings":"6FACA,IAAAA,EAAAC,WAAAD,UAAAE,OAAAC,QAAA,SAAAC,GACA,QAAAC,EAAAC,EAAA,EAAAC,EAAAC,UAAAC,OAA4CH,EAAAC,EAAOD,IAEnD,QAAAI,KADAL,EAAAG,UAAAF,GACAJ,OAAAS,UAAAC,eAAAC,KAAAR,EAAAK,KACAN,EAAAM,GAAAL,EAAAK,IAEA,OAAAN,GAEAU,EAAAb,WAAAa,QAAA,SAAAT,EAAAU,GACA,IAAAX,KACA,QAAAM,KAAAL,EAAAH,OAAAS,UAAAC,eAAAC,KAAAR,EAAAK,IAAAK,EAAAC,QAAAN,GAAA,IACAN,EAAAM,GAAAL,EAAAK,IACA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uU,KAAA,SAAA1kB,EAAAX,EAAAG,GAAA,aAAAL,OAAAgB,eAAAd,EAAA,cAAAgB,OAAA,IAAAhB,EAAA2F,aAAA,EAAA3F,EAAA2F,QCtBU,SAAAlC,GAAI,OAAI,IAAI2H,QAAQ,SAAAC,GACjC,IAAMia,EAAY3Z,OAAO4Z,iBAAmB5Z,OAAO4Z,qBAEnD,GADA5Z,OAAO4Z,iBAAiBpe,KAAO,SAACqe,GAAD,OAAQA,EAAG/hB,KACrC6hB,EAAW,OAAOja,IAEvB,IADA,IAAMoa,KACG7V,EAAQ,EAAGA,EAAQ0V,EAAUjlB,OAAQuP,IAAS,CACrD,IAAMH,EAAW6V,EAAU1V,GACvBH,aAAoBrE,QACtBqa,EAASte,KAAKsI,EAAShM,IAEvBgM,EAAShM,GAGb,OAAO2H,QAAQsa,IAAID,GAAUna,KAAKD,uHCjBP,SAAC0T,EAAI4G,GACjC,IAAIC,EACJ,OAAO,WACJ,IAAMC,EAAMhmB,KACNwJ,EAAOjJ,UACf0lB,aAAaF,GACbA,EAAUG,WAAW,kBAAMhH,EAAG5V,MAAM0c,EAAKxc,IAAOsc,GAAQ","file":"initializer.js","sourcesContent":["\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar types_1 = require(\"@findify/analytics/lib/types\");\nvar decamelize_1 = require(\"../helpers/decamelize\");\nvar nodeToArray = function (node) { return Array.prototype.slice.call(node); };\nvar normalizeKeys = function (obj) {\n if (obj === void 0) { obj = {}; }\n return Object.keys(obj).reduce(function (acc, key) {\n return (__assign({}, acc, (_a = {}, _a[decamelize_1.decamelize(key).replace('findify_', '')] = obj[key], _a)));\n var _a;\n }, {});\n};\nvar normalizeClass = function (name) {\n return ({\n product_id: 'item_id',\n price_currency_code: 'currency',\n order_number: 'order_id',\n }[name] || name);\n};\nvar getPropsFromChildren = function (nodeList) {\n return nodeToArray(nodeList).reduce(function (acc, element) {\n return (__assign({}, acc, normalizeKeys(element.dataset), (!!element.className && (_a = {},\n _a[normalizeClass(element.className)] = (!element.children.length &&\n element.innerText) || (acc[normalizeClass(element.className)] || []).concat([\n getPropsFromChildren(element.children),\n ]),\n _a))));\n var _a;\n }, {});\n};\nexports.getEventData = function (node) {\n var ownProps = normalizeKeys(node.dataset);\n if ([types_1.EventName.purchase, types_1.EventName.updateCart].includes(ownProps.event)) {\n return __assign({}, ownProps, { line_items: nodeToArray(node.children).map(function (e) { return normalizeKeys(e.dataset); }) });\n }\n var childrenProps = getPropsFromChildren(node.children);\n return __assign({}, ownProps, childrenProps);\n};\nexports.getEventsOnPage = function (root) {\n return nodeToArray(root.querySelectorAll('[data-findify-event]'))\n .map(exports.getEventData)\n .reduce(function (acc, _a) {\n var event = _a.event, rest = __rest(_a, [\"event\"]);\n return (__assign({}, acc, (_b = {}, _b[event] = rest, _b)));\n var _b;\n }, {});\n};\nexports.getDeprecatedEvents = function (root) {\n var events = {};\n var pageViewNode = root.querySelector('.findify_page_product');\n var purchaseNode = root.querySelector('.findify_purchase_order');\n if (!!pageViewNode) {\n var pageViewContent = { item_id: pageViewNode.innerHTML };\n events['page-view'] = pageViewContent;\n events['view-page'] = pageViewContent;\n }\n if (!!purchaseNode) {\n var _a = getPropsFromChildren(purchaseNode.children), line_item = _a.line_item, data = __rest(_a, [\"line_item\"]);\n events['purchase'] = __assign({}, data, { line_items: line_item, revenue: line_item &&\n line_item.length &&\n line_item.reduce(function (amount, _a) {\n var unit_price = _a.unit_price;\n return amount + parseFloat(unit_price);\n }, 0) });\n }\n return events;\n};\n//# sourceMappingURL=events.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar NAME_SELECTOR = 'data-findify-filter';\nvar VALUE_SELECTOR = 'data-findify-filter-value';\nvar TYPE_SELECTOR = 'data-findify-filter-type';\nexports.getFiltersOnPage = function (root) {\n return Array.prototype.slice\n .call(root.querySelectorAll(\"[data-findify-filter]\"))\n .map(function (node) {\n var name = node.getAttribute(NAME_SELECTOR);\n var value = node.getAttribute(VALUE_SELECTOR);\n var type = node.getAttribute(TYPE_SELECTOR);\n var values = void 0;\n try {\n if (!isNaN(Number(value)))\n throw new Error();\n values = JSON.parse(value);\n }\n catch (e) {\n values = [{ value: value.split(/,|>/).map(function (v) { return v && v.trim(); }) }];\n }\n return { name: name, values: values, type: type || undefined };\n })\n .filter(function (i) { return !!i; });\n};\n//# sourceMappingURL=filters.js.map","import jump from 'jump.js';\nimport { debounce } from './debounce';\n\nconst nodes = new Map();\n\nconst registerNode = (string) => {\n const node = document.querySelector(string.split(' ').map(i => '.' + i).join(''));\n nodes.set(string, node);\n return node;\n}\n\nexport const scrollTo: any = debounce((selector, offset = 0) => {\n if (!document) return;\n const node = nodes.get(selector) || registerNode(selector);\n if (!node) return;\n const { top } = node.getBoundingClientRect();\n if (top > 0) return;\n return jump(node, { offset });\n}, 200);\n","type FunctionMap = { [x: string]: Function }\ntype NullableFunctionMap = { [x: string]: Function | null }\ntype SignalSumArgument = string | Function;\n/**\n * SignalCombinator is a variation of Finite State Machine, which makes the following assumptions:\n * 1. Every state can transition to every state and itself\n * 2. State transitions are derived using a sum of signals, processed by signal processors. Each signal is a named variable,\n * each signal processor is a function, that accepts signal value (or if it's a signal summator, values) and returns\n * array of possible transitions\n * 3. For any combination of signals and signal-sums there is just one possible transition from one state to itself or another\n */\nexport default class SignalCombinator {\n /** List of possible states for transitioning */\n private states: string[];\n\n /**\n * Mapping of transitions to states.\n * SignalCombinator makes an assumption, that every state can transition to every state,\n * including itself\n */\n private transitionMapping: FunctionMap = {};\n\n /**\n * Mapping of signal processors, that receive signal (or signals) and return possible transition states to signals\n */\n private signalProcessors: NullableFunctionMap = {};\n\n /**\n * Signal values\n */\n private signals = {};\n\n\n /**\n * Used for looking up signal values, that signal processors want\n */\n private processorToSignalMapping = new Map<Function, string>();\n\n /**\n * Used for caching subsequent calls to processSignal() in one transition,\n * mainly to avoid calling signal summator twice or more times\n */\n private signalProcessingCache = {};\n\n /**\n * Holds current state\n */\n public state: string;\n\n /**\n * Create new SignalCombinator instance\n * @param states List of states to transition to\n * @param initialState Initial state, if not provided first state from states array is used\n */\n constructor(states: string[], initialState: string) {\n this.states = states;\n this.state === initialState || states[0];\n }\n\n\n /**\n * Used to register transition to state\n * @param state state to transition to\n * @param transitor function to perform transition\n */\n transitionTo(state: string, transitor: Function) {\n this.transitionMapping[state] = transitor;\n }\n\n\n /**\n * Used to register signal\n * @param name signal name\n * @param signalProcessor function, that accepts signal data and returns possible transition states\n * @param defaultValue default value for signal\n */\n createSignal(name: string, signalProcessor: Function, defaultValue: any) {\n this.signalProcessors[name] = this.createSignalProcessor(name, [name], signalProcessor);\n this.signal(name, defaultValue);\n }\n\n /**\n * Used to register override for signal processing.\n * For example, if I have signals A, B and C and want to use not A & B & C but (A & C) & B for determining transition,\n * then I register signal sum for signals A, C\n * You can also pass a processor previously returned by createSignal or createSignalSum, to make things like ((A & C) & (Z & B))\n * @param names array of signal name or processors to register sum handler for\n * @param signalProcessor function, that accepts signal values in order they were provided in names argument and returns possible transition states\n */\n createSignalSum(names: SignalSumArgument[], signalProcessor: Function) {\n /** JavaScript's sorting is not technically correct, since it sorts by ascii value, but in that case we just need a reproducible name */\n const signalSumName = names.map(x => (\n typeof x === 'string' ? x : ('<' + this.processorToSignalMapping.get(x)! + '>')\n )).sort().join('|')\n const wrappedSignalProcessor = this.createSignalProcessor(signalSumName, names, signalProcessor);\n names.forEach((x) => typeof x === 'string' && (this.signalProcessors[x] = null));\n this.signalProcessors[signalSumName] = wrappedSignalProcessor;\n this.processorToSignalMapping.set(wrappedSignalProcessor, signalSumName)\n return wrappedSignalProcessor\n }\n\n\n /**\n * Used to create a signal processor, function, that handles signal caching & processing\n * @param jointName name of signal processor. For single signals it's just signal name, for sums - sorted sum, joined by '|', i.e. x|y\n * @param names array of signals that processor is responsible for\n * @param signalProcessor function, that accepts signal values in order they were provided in names argument and returns possible transition states\n * @returns object with properties: names - specifies signal arguments that were passed to createSignalProcessor,\n * args - unwrapped arguments passed to actual signal processor\n * result - signal processor result\n */\n createSignalProcessor(jointName: string, names: SignalSumArgument[], signalProcessor: Function) {\n return () => {\n if (this.signalProcessingCache[jointName]) return this.signalProcessingCache[jointName];\n const argsToApply = names.map(name => typeof name === 'string' ? this.signals[name] : (<Function>name)());\n const signalResult = signalProcessor.apply(null, argsToApply);\n const result = { names, args: argsToApply, result: signalResult };\n this.signalProcessingCache[jointName] = result;\n return result;\n }\n }\n\n\n /**\n * Used to change signal values\n * @param name signal name\n * @param signal new signal value\n */\n signal(name: string, signal: any) {\n this.signals[name] = signal;\n }\n\n\n /**\n * Run transition, possibly to itself\n * @param args any arguments provided to transition() will be provided to transition function\n */\n transition(...args) {\n this.signalProcessingCache = {};\n const possibleStates = this.states.filter(state => (\n Object.entries(this.signalProcessors)\n .filter(([_, v]) => v)\n .map(([_, getSignalValue]) => getSignalValue!().result.includes(state))\n .every(item => item))\n );\n if (possibleStates.length === 0) console.error('SignalCombinator Invariant: unable to form a meaningful transition from state', this.state, 'using signals', this.signals);\n if (possibleStates.length > 1) console.error('SignalCombinator Invariant: more than 1 possible states for transitioning detected:', possibleStates, 'using signals', this.signals);\n this.state = possibleStates[0];\n return this.transitionMapping[this.state].apply(null, args);\n }\n}\n","export enum Events {\n /**\n * Creates new widget\n * @prop [selector: string] - Element where to inject widget\n * @prop [type: string] - Type of widget\n * @prop [config: object] - Config which will extend base config\n */\n attach = 'attachWidget',\n\n /**\n * Removes exist widget\n * @prop [entity: object] - widget to remove\n */\n detach = 'detachWidget',\n\n /**\n * Will rerender component\n * @prop [entity: object] - widget to hydrate\n */\n hydrate = 'hydrate',\n\n /**\n * Will navigate to search page with passed value as search query\n * @prop [value: string] - search query\n */\n search = 'search',\n\n /**\n * Will rerender widget with new config\n * @prop [key: string|number] - widget key\n * @prop [config: Immutable.Map] - new config\n */\n updateConfig = 'updateConfig',\n\n /**\n * Input lost focus\n * @prop [key: string|number] - widget key\n * @prop [config: Immutable.Map]\n */\n autocompleteFocusLost = 'autocompleteFocusLost',\n\n /**\n * Invalidate widgets\n */\n invalidate = 'invalidate',\n\n /**\n * Mobile elements\n */\n showMobileFacets = 'showMobileFacets',\n showMobileSort = 'showMobileSort',\n hideMobileFacets = 'hideMobileFacets',\n hideMobileSort = 'hideMobileSort',\n\n /**\n * Calls when collection was not set up\n */\n collectionNotFound = 'collectionNotFound',\n}\n","import 'regenerator-runtime/runtime';\nimport 'raf/polyfill';\n\n// tslint:disable-next-line:import-name\nimport AnalyticsDOM from '@findify/analytics-dom';\n// tslint:disable-next-line:import-name\nimport Analytics from '@findify/analytics';\nimport emitter from './core/emitter';\nimport resolveCallback from './helpers/resolveCallback';\nimport setupPlatforms from './helpers/setupPlatforms';\nimport { Events } from './core/events';\nimport log from './helpers/log';\nimport { scrollTo } from './helpers/scrollTo';\nimport * as location from './core/location';\n\n/**\n * Create global namespace\n */\nconst isReady = (() => {\n if ((global as any).findify) return false;\n (global as any).findify = {};\n __root.listen = emitter.listen;\n __root.emit = emitter.emit;\n __root.addListeners = emitter.addListeners;\n __root.invalidate = () => {\n for (const key in __webpack_require__.c) { delete __webpack_require__.c[key] }\n emitter.emit(Events.invalidate);\n };\n return true;\n})();\n\nconst isString = (value) => typeof value === 'string' || value instanceof String;\n\nexport default async (\n _config\n) => {\n if (!isReady) return;\n\n // We loading config independently from webpack and this promise is always resolved\n const { default: asyncConfig } = await import(/* webpackMode: \"weak\" */'./config');\n \n // Fallback currency settings for versions < 6.8.2\n const currency = asyncConfig.currency_config || asyncConfig.currency;\n\n const cfg = {\n ..._config,\n ...asyncConfig,\n currency\n };\n\n // Register custom components\n if (cfg.components) {\n const extra = Object.keys(cfg.components).reduce(\n (acc, k) => ({\n ...acc,\n [k]: isString(cfg.components[k]) ? eval(cfg.components[k]) : cfg.components[k]\n }), {}\n )\n __root.invalidate();\n window.findifyJsonp.push([['extra'], extra]);\n delete cfg.components;\n }\n\n\n /* Load Dependencies in closure to support polyfills */\n const { fromJS } = require('immutable');\n const { documentReady } = require('./helpers/documentReady');\n const { createWidgets, bulkAddWidgets } = require('./core/widgets');\n const { renderWidgets } = require('./core/render');\n\n __root.config = fromJS(cfg);\n\n /** Setup analytics */\n __root.analytics = AnalyticsDOM({ platform: cfg.platform, key: cfg.key, events: cfg.analytics || {} });\n if (cfg.platform) setupPlatforms(cfg.platform, cfg.removeFindifyID);\n\n await documentReady;\n\n const widgetsRenderNeeded = !['paused', 'disabled'].includes(__root.config.get('status'));\n\n if (widgetsRenderNeeded) {\n __root.widgets = createWidgets(__root.config);\n }\n\n /** Expose utils */\n __root.utils = { ...location, scrollTo };\n\n await resolveCallback(__root);\n\n if (widgetsRenderNeeded) {\n bulkAddWidgets(cfg.selectors);\n renderWidgets(__root.widgets);\n log('widgets:', '' , __root.widgets.list());\n } else {\n log(`findify ${__root.config.get('status')}`, 'color: #D9463F');\n }\n\n\n /**\n * Notify devtools about installation\n */\n if (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)) {\n window.postMessage({\n type: 'init', __findify: true, store: { version: cfg.mjs_version, id: cfg.merchant_id }\n }, window.location.origin);\n }\n\n (global as any).FindifyAnalytics = Analytics;\n}\n","export const addEventListeners = (listeners, callback, context: Document | Window | HTMLElement = document, withCapture = true) => {\n for (let index = 0; index < listeners.length; index++) {\n context.addEventListener(listeners[index], callback, withCapture);\n }\n return () => {\n for (let index = 0; index < listeners.length; index++) {\n context.removeEventListener(listeners[index], callback, withCapture);\n }\n }\n}\n","export const capitalize = s => s.charAt(0).toUpperCase() + s.slice(1);\n\nexport const camelize = s => s.split('-').map(capitalize).join('');\n","import { Component, createElement } from 'react';\nimport { Events } from '../core/events';\n\nclass FeatureCreator extends Component<any>{\n initial: any;\n unsubscribeForceUpdate: any;\n state = { component: null };\n\n static displayName = 'FeatureCreator';\n\n constructor(props) {\n super(props);\n const { widget, updater, key } = props;\n this.initial = updater(widget, this.callback);\n this.state = { component: this.initial };\n this.unsubscribeForceUpdate = __root.listen((type, key, nextConfig) => {\n\n // Listen to modules invalidation\n if (type === Events.invalidate) this.invalidate();\n\n // Listen to config change\n if (type !== Events.updateConfig || key !== widget.key) return;\n widget.config = nextConfig;\n this.initial = updater(widget, this.callback);\n this.setState({ component: this.initial });\n });\n }\n\n invalidate = async () => {\n const { widget } = this.props;\n const updater = require(`./${widget.type}`).default;\n this.initial = updater(widget, this.callback);\n return this.setState({ component: this.initial });\n }\n\n callback = (_component, props, children) => {\n let component;\n if (!_component) component = null;\n if (_component === 'initial') component = this.initial;\n if (typeof _component === 'function') component = createElement(_component, props, children);\n this.setState({ component });\n }\n\n shouldComponentUpdate(_, next) {\n return next.component !== this.state.component;\n }\n\n componentWillUnmount() {\n this.unsubscribeForceUpdate();\n }\n\n render() {\n return this.state.component;\n }\n}\n\nexport const createFeature = (widget) => {\n const updater = require(`./${widget.type}`).default;\n return createElement(FeatureCreator, { widget, updater })\n};\n","import 'core-js/fn/array/includes';\nimport createBrowserHistory from 'history/createBrowserHistory';\nimport { parse, stringify } from 'qs';\n\nconst isIE9 = !('pushState' in window.location);\n\nconst history = createBrowserHistory();\n\nconst pushHistory = (props) => {\n const isAllPropsSame = Object\n .keys(props)\n .reduce((acc, key) => acc && props[key] === history.location[key], true);\n\n /* Special for IE9: prevent page reload if query is the same */\n if (isIE9 && isAllPropsSame) return;\n\n return history.push(props);\n};\n\nexport const collectionPath = () => history\n .location\n .pathname\n .replace(/^\\/|\\/$/g, '')\n .toLowerCase();\n\nexport const isCollection = (collections) => collections && collections.includes(\n collectionPath()\n);\n\nexport const isSearch = () =>\n history.location.pathname === __root.config.getIn(['location', 'searchUrl']);\n\nexport const listenHistory = history.listen;\n\nexport const getQuery = () => {\n const str = history.location.search;\n const prefix = __root.config.getIn(['location', 'prefix']);\n const elements = parse(str,\n { decoder: (value) => decodeURIComponent(value.replace(/\\+/g, ' ')), ignoreQueryPrefix: true }\n );\n return Object.keys(elements).reduce((acc, key) => {\n const _key = prefix ? key.replace(`${prefix}_`, '') : key;\n return {\n ...acc,\n [_key]: ['limit', 'offset'].includes(_key)\n ? Number(elements[key])\n : elements[key]\n }\n }, {});\n};\n\nexport const buildQuery = (_query = {}) => {\n const prefix = __root.config.getIn(['location', 'prefix']);\n const query = Object.keys(_query).reduce((acc, key) =>\n ({ ...acc, [`${!!prefix ? prefix + '_' : ''}${key}`]: _query[key] })\n , {});\n return stringify(query, {\n encoder: encodeURIComponent,\n addQueryPrefix: true,\n sort: (a, b) => a.localeCompare(b)\n })\n}\n\nexport const redirectToSearch = (q) => {\n window.location.href =\n __root.config.getIn(['location', 'searchUrl']) +\n buildQuery({ q });\n};\n\nexport const setQuery = (query) => {\n const search = buildQuery(query);\n\n return pushHistory({ search });\n};\n\nexport const setPathname = (pathname) => pushHistory({ pathname });\n\nexport const getLocation = () => history.location;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar separateWords = function (string, options) {\n if (options === void 0) { options = {}; }\n var separator = options.separator || '_';\n var split = options.split || /(?=[A-Z])/;\n return string.split(split).join(separator);\n};\nexports.decamelize = function (string, options) { return separateWords(string, options).toLowerCase(); };\n//# sourceMappingURL=decamelize.js.map","export const hideFallback = (node) => {\n const fallback = [].slice.call(node.querySelectorAll('.findify-fallback'));\n for (let index = 0; index < fallback.length; index++) {\n const element = fallback[index];\n element.style.display = 'none';\n element.style.visibility = 'hidden';\n }\n}\n\nexport const showFallback = (node) => {\n const fallback = [].slice.call(node.querySelectorAll('.findify-fallback'));\n for (let index = 0; index < fallback.length; index++) {\n const element = fallback[index];\n element.style.display = '';\n element.style.visibility = '';\n }\n}\n\nexport const hideLoader = (node) => {\n const loaders = [].slice.call(node.querySelectorAll('.findify-component-spinner'));\n for (let index = 0; index < loaders.length; index++) {\n const element = loaders[index];\n element.style.display = 'none';\n element.style.visibility = 'hidden';\n }\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nrequire(\"core-js/fn/array/includes\");\nvar analytics_1 = require(\"@findify/analytics\");\nvar events_1 = require(\"./bindings/events\");\nvar filters_1 = require(\"./bindings/filters\");\nvar dom_1 = require(\"./bindings/dom\");\nvar element_dataset_1 = require(\"element-dataset\");\nvar types_1 = require(\"@findify/analytics/lib/types\");\nelement_dataset_1.default();\nvar analyticsInstance;\nvar initialize = function (config) {\n if (config === void 0) { config = { events: {} }; }\n var eventsConfig = config && config.events || {};\n analyticsInstance.state = __assign({}, analyticsInstance.state, { filters: filters_1.getFiltersOnPage(document) });\n analyticsInstance.invalidate(events_1.getDeprecatedEvents(document));\n analyticsInstance.invalidate(events_1.getEventsOnPage(document));\n dom_1.startDOMListeners(analyticsInstance.sendEvent, document);\n if (eventsConfig[types_1.EventName.viewPage] !== false &&\n !analyticsInstance.state.events[types_1.EventName.viewPage]) {\n analyticsInstance.sendEvent(types_1.EventName.viewPage, {});\n }\n};\nvar analyticsDOM = function (props, context) {\n if (context === void 0) { context = document; }\n if (typeof props === 'function')\n return analytics_1.default(props);\n if (analyticsInstance)\n return analyticsInstance;\n analyticsInstance = analytics_1.default(props);\n if (['complete', 'loaded', 'interactive'].includes(document.readyState) && document.body) {\n initialize(props);\n }\n else {\n document.addEventListener('DOMContentLoaded', function () { return initialize(props); }, false);\n }\n return analyticsInstance;\n};\nanalyticsDOM.prototype.__analytics = analytics_1.default;\nexports.default = analyticsDOM;\n//# sourceMappingURL=index.js.map","export const getParentNode = ({ config, node, type }) => {\n const renderIn = config.get('renderIn');\n\n if (\n type === 'autocomplete' &&\n window.innerWidth < config.get('mobileBreakpoint', 700) &&\n config.get('mobileViewType') === 'sidebar'\n ) return document.body;\n if (renderIn === 'self' || !renderIn) return node;\n if (renderIn === 'body') return document.body;\n if (renderIn === 'parent') return node.parentElement;\n}\n","import { createChangeEmitter } from '@findify/change-emitter';\n\nexport default createChangeEmitter();\n","import { createElement } from \"react\";\nimport { Custom } from '@findify/react-components/src/';\n\nexport default (widget) => createElement(Custom, widget);\n","import { createElement } from 'react';\nimport { AutocompleteProvider } from \"@findify/react-connect\";\nimport { getQuery, setQuery } from '../../core/location';\nimport { Items } from '../../test.components';\nimport { registerHandlers } from './handlers';\nimport SignalCombinator from '../../helpers/SignalCombinator';\nimport { Autocomplete } from '@findify/react-components/src/';\nimport { Autocomplete as AutocompleteAgent } from \"@findify/agent\";\n\nconst empty = () => null\n\nconst createTrendingSearchesAgent = (config) => new AutocompleteAgent({\n key: config.get('key'),\n immutable: true,\n user: __root.analytics.user\n})\n.defaults({ ...config.get('meta').toJS() })\n\nconst autocompleteComponent = createElement(Autocomplete);\nconst autocompleteTrendingComponent = createElement(Autocomplete, { isTrendingSearches: true });\n\nexport default (widget, rerender) => {\n const { node, agent, config } = widget;\n const state: any = getQuery();\n const apiKey = config.get('key');\n let trendingSearchesAgent;\n\n if (state.q) node.value = state.q;\n\n const combinator = new SignalCombinator(['closed', 'trending', 'open'], 'closed');\n combinator.createSignal('trendingSearchesDisabled', empty, config.get('trendingSearchesDisabled', false));\n combinator.createSignal('visible', empty, false);\n combinator.createSignal('query', empty, '');\n combinator.createSignal('suggestionCount', empty, 0);\n\n const trending = combinator.createSignalSum(['query', 'suggestionCount'], (query, suggestionCount) => {\n if (query === '' || suggestionCount === 0) return ['closed', 'trending'];\n return ['closed', 'open'];\n })\n\n combinator.createSignalSum(\n ['visible', 'trendingSearchesDisabled', trending],\n (ui, noTs, { result }) => {\n const isTrendingMode = result.includes('trending');\n if ((isTrendingMode && noTs) || !ui) return ['closed'];\n return ['open', 'trending'];\n }\n )\n\n combinator.transitionTo('closed', () => rerender());\n combinator.transitionTo('open', () => rerender('initial'));\n combinator.transitionTo('trending', () => renderTrendingSearches());\n\n const renderTrendingSearches = () => {\n if (!trendingSearchesAgent) {\n trendingSearchesAgent = createTrendingSearchesAgent(config)\n trendingSearchesAgent.set('q', '')\n }\n rerender(\n AutocompleteProvider,\n { apiKey, config, agent: trendingSearchesAgent, isTrendingSearches: true },\n autocompleteTrendingComponent\n )\n }\n\n registerHandlers(widget, combinator);\n\n agent.on('change:suggestions', (suggestions, meta) => {\n combinator.signal('suggestionCount', suggestions.size)\n combinator.signal('query', meta.get('q', ''))\n combinator.transition();\n })\n\n const props = { apiKey, agent, config, key: 'normalAutocomplete' };\n /** Render */\n return createElement(AutocompleteProvider, props, autocompleteComponent);\n}\n","import axios from 'axios';\n\nexport default (platform, disabled) => {\n if (!platform.shopify) return;\n const user = __root.analytics.user;\n if (!user.persist) {\n const res = disabled\n ? ''\n : JSON.stringify({ uniq_id: user.uid, visit_id: user.sid });\n axios.post('/cart/update.js', `attributes[_findify_id]=${res}`);\n }\n}\n","import { Component, createElement } from 'react';\nimport { render, createPortal } from 'react-dom';\nimport { createFeature } from '../features/create';\nimport { getParentNode } from '../helpers/getParentNode';\nimport { debounce } from '../helpers/debounce';\nimport { Events } from './events';\n\nconst createRoot = () => {\n const div = document.createElement('div');\n div.id = 'findify-root';\n div.style.display = 'none';\n document.body.appendChild(div);\n return div;\n}\n\nclass Portal extends Component<any>{\n element: HTMLElement;\n component: any;\n parent: any;\n\n static displayName = 'Container'\n state = { component: null }\n\n constructor(props) {\n super(props);\n const { widget } = props;\n this.element = document.createElement('div');\n this.element.className = `findify-container ${widget.config.get('cssSelector')}`;\n this.parent = getParentNode(widget);\n this.component = createFeature(widget)\n }\n\n componentDidMount() {\n const { widget } = this.props;\n if (widget.type === 'tabs') {\n this.parent.insertBefore(this.element, this.parent.firstChild);\n } else {\n this.parent.appendChild(this.element);\n }\n }\n\n componentWillUnmount() {\n this.parent.removeChild(this.element);\n }\n\n render() {\n return createPortal(this.component, this.element)\n }\n}\n\nclass RootElement extends Component{\n state = { widgets: [] }\n\n static displayName = 'Findify'\n\n constructor(props){\n super(props);\n this.state = { widgets: props.widgets.list() };\n __root.listen((event, widget) => {\n if (event === Events.attach) {\n this.setState(({ widgets }: any) =>\n ({ widgets: [...widgets, widget] })\n )\n }\n if (event === Events.detach) {\n this.setState(({ widgets }: any) =>\n ({ widgets: widgets.filter(({ key }) => key !== widget.key) })\n )\n }\n })\n }\n\n render() {\n const { widgets } = this.state;\n return widgets.map((widget: any) => \n createElement(Portal, { widget, key: widget.key })\n );\n }\n}\n\nexport const renderWidgets = debounce((widgets) =>\n render(createElement(RootElement, { widgets }), createRoot())\n);\n","\nimport 'core-js/fn/array/includes';\nimport * as Agents from '@findify/agent';\nimport { fromJS, isImmutable, Map } from 'immutable';\nimport { camelize } from '../helpers/capitalize';\nimport { isCollection } from './location';\nimport { Events } from './events';\n\nconst attrSelector = 'data-findify';\nconst keySelector = 'data-key';\n\nlet index: number = 0;\nlet cache: any[] = [];\nlet config: Map<any, any> = Map();\nconst noop = () => {};\nconst getType = type => ({\n 'search-button': 'autocomplete',\n 'recommendations': 'recommendation'\n}[type] || type);\n\nconst createAgent = (type, config) => {\n const agent = Agents[camelize(type)];\n if (!agent) return null;\n const instance = new agent({\n key: config.get('key'),\n user: __root.analytics.user,\n immutable: true,\n ...(config.get('slot') && { slot: config.get('slot') } || {})\n });\n\n // Setup initial request\n if (!config.get('disableAutoRequest')) {\n instance.defaults(config.get('meta', Map()), true);\n }\n\n return instance;\n}\n\nconst createConfig = (type, node, key, customs = Map()) => {\n const cfg = type === 'recommendation'\n && config.getIn(['features', 'recommendations', '#' + node.getAttribute('id')])\n || config.getIn(['features', type]);\n\n return config.withMutations(c =>\n c.mergeDeep(cfg)\n .mergeDeep(customs)\n .set('node', node)\n .set('widgetKey', key)\n .set('cssSelector', `findify-${type} findify-widget-${key}`)\n );\n};\n\nconst getNodes = selector => [].slice.call(document.querySelectorAll(selector));\n\nconst getEntity = (selector, _type?, _config?) =>\n(\n typeof selector === 'string'\n ? getNodes(selector)\n : [selector]\n)\n.map(node => {\n let type = getType(_type || node.getAttribute(attrSelector));\n const key = (_config && _config.get('widgetKey')) || node.getAttribute(keySelector) || ++index;\n\n let config = createConfig(type, node, key, _config);\n\n /** Change feature type to collection if we are on collection page */\n if (type === 'search' && isCollection(config.get('collections'))) {\n type = 'smart-collection';\n config = config.set('type', type);\n }\n\n const agent = createAgent(type, config);\n\n /** Actual widget */\n const widget = { type, key, node, agent, config };\n\n /** Notify everyone that widget was created */\n __root.emit(Events.attach, widget);\n return widget;\n})\n\nconst widgets = {\n /** Add new widget */\n attach(selector, type?, config?) {\n const cfg = config && !isImmutable(config) ? fromJS(config) : config;\n cache = [...cache, ...getEntity(selector, type, cfg)];\n return cache;\n },\n\n /** Remove exist widget */\n detach(key) {\n const widgetToRemove = widgets.get(key);\n cache = cache.filter(widget => key !== widget.key);\n __root.emit(Events.detach, widgetToRemove);\n },\n\n /** Get all rendered widget */\n list(){\n return cache;\n },\n\n get(_key){\n return cache.find(({ key }) => key === _key)\n },\n\n findByType(...types) {\n return cache.filter(({ agent }) => agent && types.includes(agent.type));\n }\n};\n\nexport const createWidgets = (_config) => {\n config = _config;\n\n // DY: Legacy\n // TODO: Remove after they will release new version\n (global as any).findifyCreateFeature = (selector, { type, ...config }) =>\n widgets.attach(selector, type, config);\n\n return widgets;\n}\n\nexport const bulkAddWidgets = (selectors = {}) => {\n /** Attach default nodes */\n widgets.attach(`[${attrSelector}]`);\n\n /** Attach nodes specified in configuration */\n for (const key in selectors) {\n widgets.attach(key, selectors[key]);\n }\n}\n","import { findDomNode } from 'react-dom';\nimport { List } from 'immutable'\nimport { addEventListeners } from '../../helpers/addEventListeners';\nimport { findClosestElement } from '../../helpers/findClosestElement';\nimport { isSearch, setQuery, buildQuery, redirectToSearch } from '../../core/location';\nimport { Events } from '../../core/events';\nimport { debounce } from '../../helpers/debounce';\n\nconst findClosestForm = findClosestElement('form');\n\nconst stylesUpdater = (ghost, styles: any) => {\n let cache: any = {};\n if (!ghost.childNodes.length) return;\n for (const key in styles) {\n if (cache[key] === styles[key]) return;\n const type = typeof styles[key];\n ghost.style[key] = type === 'string' ? styles[key] : styles[key] + 'px';\n }\n return cache = styles;\n}\n\nexport const registerHandlers = (widget, combinator) => {\n const { node, config, agent } = widget;\n const subscribers: any = [];\n let container: any;\n let findifyElementFocused = true;\n if (node.getAttribute('autocomplete') !== 'off') node.setAttribute('autocomplete', 'off')\n\n /** Track input position and update container styles */\n const handleWindowScroll = debounce(() => {\n container = container || document.querySelector(`.findify-widget-${widget.key}`);\n if (!container.childNodes.length) return;\n\n const { width, top, left, height } = node.getBoundingClientRect();\n const _top = top + (window.scrollY || document.documentElement.scrollTop);\n const _left = left + (window.scrollX || document.documentElement.scrollLeft);\n if (top + height < 0 || left < 0) return;\n\n return stylesUpdater(container, {\n width,\n height: 0,\n top: _top + height,\n left: _left,\n position: 'absolute',\n 'will-change': 'top, left'\n });\n })\n\n const resetReferencedAgentsLogging = debounce((value) => {\n __root.widgets\n .findByType('search', 'smart-collection', 'content')\n .forEach(({ agent }) => agent.reset().defaults({ log: true }).set('q', value || ''));\n }, 1000);\n\n const updateReferencedAgents = (value, noLogs?) =>\n __root.widgets\n .findByType('search', 'smart-collection', 'content')\n .forEach(({ agent }) => {\n agent.reset();\n if (noLogs) {\n agent.defaults({ log: false });\n resetReferencedAgentsLogging(value);\n }\n agent.set('q', value || '')\n });\n\n /** Handle input change */\n const handleInputChange = (e) => {\n const value = e.target.value || '';\n if (config.get('renderIn') === 'body') handleWindowScroll();\n if (config.get('instant') && isSearch()) {\n \n return updateReferencedAgents(value, true);\n }\n agent.set('q', value);\n combinator.signal('visible', true);\n combinator.signal('query', value);\n combinator.transition()\n };\n\n const insideAutocomplete = (node: HTMLElement) => {\n if (!node || !node.parentElement) return false;\n if (node.hasAttribute && node.hasAttribute('data-findify-autocomplete')) return true;\n return insideAutocomplete(node.parentElement);\n }\n\n const isAutocompleteRelated = (e) => (\n e.relatedTarget && insideAutocomplete(e.relatedTarget)\n )\n\n /** Handle input blur */\n const handleInputBlur = (e) =>\n (!findifyElementFocused && !isAutocompleteRelated(e)) &&\n e.target === node &&\n __root.emit(Events.autocompleteFocusLost, widget.key)\n\n const handleKeydown = ({ key, target }) => {\n return key === 'Enter' && search(target.value)\n }\n\n /** search for the value */\n const search = (_value?) => {\n const value = _value || agent.state.get('q') || '';\n if (!isSearch()) return redirectToSearch(value);\n\n updateReferencedAgents(value);\n\n __root.widgets\n .findByType('autocomplete')\n .forEach(({ node }) => node.value = value);\n combinator.signal('visible', false);\n combinator.transition();\n };\n\n const handleFormSubmit = e => {\n if (e) e.preventDefault();\n search(node.value);\n }\n\n /** Listen for input change */\n subscribers.push(addEventListeners(\n ['input', 'cut', 'paste'],\n handleInputChange,\n node\n ));\n\n subscribers.push(addEventListeners(\n ['focus'],\n (e) => {\n if (config.get('instant') && isSearch()) return;\n findifyElementFocused = true;\n if (!agent.state.get('q')) {\n agent.set('q', e.target.value);\n combinator.signal('query', e.target.value);\n }\n combinator.signal('visible', true);\n combinator.transition();\n },\n node\n ));\n\n /** Listen for input blur */\n subscribers.push(addEventListeners(\n ['focusout'],\n handleInputBlur,\n document.body\n ));\n\n subscribers.push(addEventListeners(\n ['keydown'],\n handleKeydown,\n node,\n false\n ))\n\n /** Listen for form submit */\n if (!config.get('disableFormSubmit')) {\n const form = findClosestForm(node);\n if (form) {\n subscribers.push(addEventListeners(\n ['submit'],\n handleFormSubmit,\n form\n ))\n }\n }\n\n /** Update container position */\n if (config.get('renderIn') === 'body') {\n subscribers.push(addEventListeners(\n [\n 'mousemove',\n 'webkitTransitionEnd',\n 'otransitionend',\n 'oTransitionEnd',\n 'msTransitionEnd',\n 'transitionend',\n 'animationiteration',\n 'webkitAnimationIteration',\n 'oanimationiteration',\n 'MSAnimationIteration'\n ],\n handleWindowScroll,\n document\n ));\n subscribers.push(addEventListeners(\n ['scroll'],\n debounce(handleWindowScroll),\n window\n ))\n }\n\n const getEventPath = (evt) => {\n if (evt.path) return evt.path; // Chrome only, for now\n // (Semi)-Polyfill for other browsers, like Edge & IE\n // Semi, because originally path keeps the original DOM before mutations,\n // that could've occured after event was dispatched but before it was received\n // Recursion might be more beatiful, but in that case we will need more speed\n const path: any[] = [];\n let currentElement = evt.target;\n while (currentElement) {\n path.push(currentElement);\n currentElement = currentElement.tagName !== 'HTML' ? currentElement.parentElement : null;\n }\n path.push(document);\n path.push(window);\n return path;\n\n }\n\n const handleActiveElementChange = (evt) => {\n findifyElementFocused = !!((getEventPath(evt)).find(item => item.hasAttribute && item.hasAttribute('data-findify-autocomplete')))\n }\n\n subscribers.push(addEventListeners(\n ['mousemove', 'touchmove'],\n debounce(handleActiveElementChange),\n document\n ))\n\n /** Unsubscribe from events on instance destroy */\n const unsubscribe = __root.listen((event, prop, ...args) => {\n if (event === Events.search && prop === widget.key) return search(...args);\n if (event === Events.autocompleteFocusLost && prop === widget.key) {\n combinator.signal('visible', false);\n combinator.transition();\n }\n if (event !== Events.detach || prop !== widget) return;\n subscribers.forEach(fn => fn());\n unsubscribe();\n })\n\n window.requestAnimationFrame(() => {\n combinator.signal('visible', false)\n combinator.transition();\n })\n return;\n}\n","import 'core-js/es6/promise';\n\nexport const documentReady = new Promise((resolve) => {\n if (\n ['complete', 'loaded', 'interactive'].includes(document.readyState) &&\n document.body\n ) {\n resolve();\n } else {\n document.addEventListener('DOMContentLoaded', resolve, false);\n }\n})\n","/**\n * Find closest element by child\n * @param selector Parent selector\n */\nexport const findClosestElement = selector => el => {\n let matchesFn;\n let parent;\n\n [\n 'matches',\n 'webkitMatchesSelector',\n 'mozMatchesSelector',\n 'msMatchesSelector',\n 'oMatchesSelector',\n ].some(fn => {\n if (typeof document.body[fn] === 'function') {\n matchesFn = fn;\n return true;\n }\n return false;\n });\n\n while (el) {\n parent = el.parentElement;\n if (parent && parent[matchesFn](selector)) {\n return parent;\n }\n el = parent;\n }\n\n return null;\n};\n","import { createElement } from 'react';\nimport { RecommendationProvider } from \"@findify/react-connect\";\nimport { getQuery, setQuery } from '../../core/location';\nimport { hideFallback, hideLoader } from '../../helpers/fallbackNode';\nimport { getPayload } from './payload';\nimport { Recommendation } from '@findify/react-components/src/';\n\nexport default (widget) => {\n const { node, agent, config } = widget;\n const props = { agent, config, apiKey: config.get('key') };\n\n if (!config.get('disableAutoRequest')) {\n agent.defaults(getPayload(config, __root.analytics.state));\n }\n\n /** Remove entity and instance if nothing was found */\n agent.on('change:items', items => {\n if (items.isEmpty()) return __root.widgets.detach(widget.key);\n hideFallback(node);\n hideLoader(node);\n })\n\n /** Render */\n return createElement(RecommendationProvider, props, createElement(Recommendation));\n}\n","import { createElement } from 'react';\nimport { ContentProvider } from \"@findify/react-connect\";\nimport { Recommendation as RecommendationAgent } from \"@findify/agent\";\nimport { getQuery, setQuery, isSearch, listenHistory } from '../../core/location';\nimport { hideFallback, hideLoader } from '../../helpers/fallbackNode';\nimport { Events } from '../../core/events';\nimport { scrollTo } from '../../helpers/scrollTo';\nimport { Content } from '@findify/react-components/src/';\n\nexport default (widget, render) => {\n const { agent, config, node } = widget;\n const apiKey = config.get('key');\n const { q } = getQuery();\n const { type } = node.dataset;\n const props = { agent, apiKey, config };\n\n agent.defaults({ type: [type] });\n agent.set('q', q);\n\n /** Listen to changes */\n agent.on('change:query', (q, meta) => {\n setQuery(q.toJS())\n render('initial');\n });\n\n /** Listen to location back/fwd */\n const stopListenLocation = listenHistory((_, action) => {\n if (action !== 'POP') return;\n const { q } = getQuery();\n agent.applyState({ q });\n render('initial');\n });\n\n /** Switch to recommendation if query not present */\n agent.on('change:items', (items) => {\n if (!items.isEmpty()) {\n hideFallback(node);\n hideLoader(node);\n if (!config.getIn(['view', 'infinite']) && config.get('scrollTop') !== false) {\n scrollTo(config.get('cssSelector'), config.get('scrollTop'))\n }\n return render('initial');\n }\n })\n\n /** Unsubscribe from events on instance destroy */\n const unsubscribe = __root.listen((event, prop, ...args) => {\n if (event !== Events.detach || prop !== widget) return;\n stopListenLocation();\n unsubscribe();\n })\n\n /** Render */\n\n return createElement(ContentProvider, props, createElement(Content))\n}\n","import { createElement } from 'react';\nimport { SearchProvider, RecommendationProvider, ContentProvider } from \"@findify/react-connect\";\nimport { Recommendation as RecommendationAgent } from \"@findify/agent\";\nimport { getQuery, setQuery, isSearch, listenHistory } from '../../core/location';\nimport { hideFallback, showFallback, hideLoader } from '../../helpers/fallbackNode';\nimport { Events } from '../../core/events';\nimport { scrollTo } from '../../helpers/scrollTo';\nimport { Search, ZeroResults } from '@findify/react-components/src/';\n\nconst createFallbackAgent = (config, node) => new RecommendationAgent({\n key: config.get('key'),\n immutable: true,\n user: __root.analytics.user\n})\n.defaults({ ...config.get('meta').toJS(), type: config.get('zeroResultsType') })\n.on('change:items', () => {\n hideFallback(node);\n hideLoader(node);\n});\n\nexport default (widget, render) => {\n const { agent, config, node } = widget;\n const state = getQuery();\n const apiKey = config.get('key');\n const props = { agent, apiKey, config };\n let fallbackAgent;\n\n const renderZeroResults = () => {\n if (!fallbackAgent) fallbackAgent = createFallbackAgent(config, node);\n return render(\n RecommendationProvider,\n { agent: fallbackAgent, apiKey, config },\n createElement(ZeroResults, getQuery())\n )\n }\n\n if (!isSearch()) {\n showFallback(node);\n hideLoader(node);\n __root.emit(Events.collectionNotFound, widget);\n return null;\n }\n\n /** Setup initial request */\n if (!config.get('disableAutoRequest')) {\n agent.applyState(state);\n }\n\n /** Listen to changes */\n agent.on('change:query', (q, meta) => {\n setQuery(q.toJS())\n if (!meta.get('total')) return renderZeroResults();\n render('initial');\n });\n\n agent.on('change:redirect', async (redirect, meta) => {\n render();\n await __root.analytics.sendEvent('redirect', {\n ...redirect.toJS(),\n rid: meta.get('rid'),\n suggestion: meta.get('q')\n });\n document.location.href = redirect.get('url');\n });\n\n /** Listen to location back/fwd */\n const stopListenLocation = listenHistory((_, action) => {\n if (action !== 'POP') return;\n agent.applyState(getQuery());\n render('initial');\n });\n\n /** Switch to recommendation if query not present */\n agent.on('change:items', (items) => {\n if (!items.isEmpty()) {\n hideFallback(node);\n hideLoader(node);\n if (!config.getIn(['view', 'infinite']) && config.get('scrollTop') !== false) {\n scrollTo(config.get('cssSelector'), config.get('scrollTop'))\n }\n return render('initial');\n }\n hideLoader(node);\n return renderZeroResults();\n })\n\n /** Unsubscribe from events on instance destroy */\n const unsubscribe = __root.listen((event, prop, ...args) => {\n if (event !== Events.detach || prop !== widget) return;\n stopListenLocation();\n unsubscribe();\n })\n\n /** Render */\n\n return createElement(SearchProvider, props, createElement(Search))\n}\n","import { TabsLayout } from '@findify/react-components/src/';\nimport { Events } from '../../core/events';\n\nconst getNestedWidgets = root => {\n const children = Array.from(root.children);\n return __root.widgets.list()\n .filter(({ node }) => node.parentNode === root)\n .sort((prev, next) => children.indexOf(prev.node) - children.indexOf(next.node));\n}\n\nconst getProps = (widgets, state, updateCount) => ({\n onClick: updateCount,\n widgets: widgets.map(({ node, key }, index) => ({\n key,\n active: state.active === key,\n title: node.dataset.title,\n count: state.counter[index]\n }))\n});\n\nconst createState = (_widgets, render) => {\n const widgets = [..._widgets];\n const state = {\n counter: {},\n active: widgets[0] && widgets[0].key\n }\n\n const hydrate = () => {\n widgets.forEach(widget => {\n widget.active = widget.key === state.active;\n widget.node.style.display = widget.key === state.active ? 'block' : 'none';\n });\n render(TabsLayout, getProps(widgets, state, toggle))\n }\n\n const toggle = (key) => {\n state.active = key;\n __root.emit(Events.hydrate, key);\n hydrate()\n };\n\n const updateCount = (index, count) => {\n state.counter[index] = count;\n hydrate();\n };\n\n const getState = () => state;\n\n return { updateCount, toggle, getState }\n}\n\n\nexport default (widget, render) => {\n const { node } = widget;\n const widgets = getNestedWidgets(node);\n const { updateCount, getState } = createState(widgets, render);\n \n\n widgets.forEach(({ type, agent }, index) => agent.on('change:meta', (meta) => {\n updateCount(index, type === 'recommendation' ? meta.get('limit') : meta.get('total'));\n }));\n\n const unsubscribe = __root.listen((event, prop) => {\n if (event !== Events.detach || prop !== widget) return;\n unsubscribe();\n render();\n });\n\n return null;\n}\n","import { createElement } from 'react';\nimport { SmartCollectionProvider } from \"@findify/react-connect\";\nimport { getQuery, setQuery, collectionPath, listenHistory } from '../../core/location';\nimport { Events } from '../../core/events';\nimport emitter from '../../core/emitter';\nimport { Items } from '../../test.components';\nimport { scrollTo } from '../../helpers/scrollTo';\nimport { hideFallback, showFallback, hideLoader } from '../../helpers/fallbackNode';\nimport { Search, ZeroResults } from '@findify/react-components/src/';\n\nexport default (widget, render) => {\n const { agent, config, node } = widget;\n const apiKey = config.get('key');\n const props = { agent, apiKey, config };\n const state = getQuery();\n\n /** Listen to location back/fwd */\n const stopListenLocation = listenHistory((_, action) => {\n if (action !== 'POP') return;\n agent.applyState(getQuery());\n render('initial');\n });\n\n /** Switch to recommendation if query not present */\n agent.on('change:items', (items) => {\n if (!items.isEmpty()) {\n hideFallback(node);\n hideLoader(node);\n if (!config.getIn(['view', 'infinite']) && config.get('scrollTop') !== false) {\n scrollTo(config.get('cssSelector'), config.get('scrollTop'))\n }\n render('initial');\n } else {\n showFallback(node);\n hideLoader(node);\n __root.emit(Events.collectionNotFound, widget);\n render();\n }\n })\n\n agent.on('change:redirect', async (redirect, meta) => {\n await __root.analytics.sendEvent('redirect', {\n ...redirect.toJS(),\n rid: meta.get('rid'),\n suggestion: meta.get('q')\n });\n document.location.href = redirect.get('url');\n });\n\n agent.on('error', () => {\n showFallback(node);\n hideLoader(node);\n render();\n })\n\n /** Setup initial request */\n if (!config.get('disableAutoRequest')) {\n agent.defaults({\n slot: collectionPath(),\n rules: config.get('includeRulesInCollection') ? __root.analytics.state.filters : void 0\n });\n agent.applyState(state);\n }\n\n /** Listen to changes */\n agent.on('change:query', q => setQuery(q.toJS()));\n\n /** Switch to recommendation if query not present */\n // agent.on('change:items', handleFirstResponse);\n\n /** Unsubscribe from events on instance destroy */\n const unsubscribe = __root.listen((event, prop, ...args) => {\n if (event !== Events.detach || prop !== widget) return;\n stopListenLocation();\n unsubscribe();\n });\n\n /** Render */\n return createElement(SmartCollectionProvider, props, createElement(Search, { isCollection: true }));\n}\n","import get from 'lodash/get';\n\nconst getIdsFromEvents = events => ({\n item_id: get(events, ['view-page', 'item_id']),\n item_ids: get(events, ['update-cart', 'line_items'], []).map(\n i => i.item_id || i.product_id\n ),\n});\n\nexport const getPayload = (config, { events, filters }) => {\n const { item_id, item_ids } = getIdsFromEvents(events)\n const type = config.get('type');\n const slot = config.get('slot');\n const multipleIds = config.get('multipleIds');\n\n const payload: any = { slot, type };\n\n if (filters && !!filters.length) {\n payload.rules = filters;\n }\n\n if (['bought', 'viewed'].includes(type)) {\n payload.item_ids = [item_id];\n }\n\n if (type === 'purchasedTogether') {\n payload.item_ids = multipleIds ? item_ids : [item_id];\n }\n\n return payload;\n};\n","var map = {\n\t\"./autocomplete\": \"c3pS\",\n\t\"./autocomplete/\": \"c3pS\",\n\t\"./autocomplete/handlers\": \"k8c5\",\n\t\"./autocomplete/handlers.ts\": \"k8c5\",\n\t\"./autocomplete/index\": \"c3pS\",\n\t\"./autocomplete/index.ts\": \"c3pS\",\n\t\"./content\": \"sQLV\",\n\t\"./content/\": \"sQLV\",\n\t\"./content/index\": \"sQLV\",\n\t\"./content/index.ts\": \"sQLV\",\n\t\"./create\": \"FgcQ\",\n\t\"./create.ts\": \"FgcQ\",\n\t\"./custom\": \"Y70t\",\n\t\"./custom/\": \"Y70t\",\n\t\"./custom/index\": \"Y70t\",\n\t\"./custom/index.ts\": \"Y70t\",\n\t\"./recommendation\": \"s5RT\",\n\t\"./recommendation/\": \"s5RT\",\n\t\"./recommendation/index\": \"s5RT\",\n\t\"./recommendation/index.ts\": \"s5RT\",\n\t\"./recommendation/payload\": \"v7cu\",\n\t\"./recommendation/payload.ts\": \"v7cu\",\n\t\"./search\": \"saiO\",\n\t\"./search/\": \"saiO\",\n\t\"./search/index\": \"saiO\",\n\t\"./search/index.ts\": \"saiO\",\n\t\"./smart-collection\": \"tZwI\",\n\t\"./smart-collection/\": \"tZwI\",\n\t\"./smart-collection/index\": \"tZwI\",\n\t\"./smart-collection/index.ts\": \"tZwI\",\n\t\"./tabs\": \"sor5\",\n\t\"./tabs/\": \"sor5\",\n\t\"./tabs/index\": \"sor5\",\n\t\"./tabs/index.ts\": \"sor5\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"vRk2\";","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar events_1 = require(\"./events\");\nfunction matches(el, selector) {\n var proto = Element.prototype;\n var fn = proto.matches\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector;\n return fn.call(el, selector);\n}\nexports.startDOMListeners = function (sendEvent, root) {\n return root.addEventListener('click', function (e) {\n if (!matches(e.target, '[data-findify-track]'))\n return;\n var _a = events_1.getEventData(e.target), track = _a.track, props = __rest(_a, [\"track\"]);\n sendEvent(track, props);\n }, false);\n};\n//# sourceMappingURL=dom.js.map","declare module window {\n const findifyCallback: Promise<any> | undefined | any\n}\n\nexport default root => new Promise(resolve => {\n const callbacks = window.findifyCallbacks = window.findifyCallbacks || [];\n window.findifyCallbacks.push = (cb) => cb(root);\n if (!callbacks) return resolve();\n const promises = [];\n for (let index = 0; index < callbacks.length; index++) {\n const callback = callbacks[index];\n if (callback instanceof Promise) {\n promises.push(callback(root));\n } else {\n callback(root);\n }\n }\n return Promise.all(promises).then(resolve);\n});\n","export const debounce: any = (fn, wait?) => {\n\tlet timeout;\n\treturn function () {\n const ctx = this;\n const args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(() => fn.apply(ctx, args), wait || 0);\n\t};\n};\n"],"sourceRoot":""}