@letscooee/web-sdk 9.8.1 → 9.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.min.js +2 -2
- package/dist/widget.min.js +2 -2
- package/package.json +1 -1
package/dist/main.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var cg=Object.create,Lc=Object.defineProperty,lg=Object.defineProperties,ug=Object.getOwnPropertyDescriptor,pg=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertyNames,fp=Object.getOwnPropertySymbols,mg=Object.getPrototypeOf,dp=Object.prototype.hasOwnProperty,dg=Object.prototype.propertyIsEnumerable,mp=(e,t,r)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||={})dp.call(t,r)&&mp(e,r,t[r]);if(fp)for(var r of fp(t))dg.call(t,r)&&mp(e,r,t[r]);return e},te=(e,t)=>lg(e,pg(t)),Ki=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),ur=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fg(t))!dp.call(e,i)&&i!==r&&Lc(e,i,{get:()=>t[i],enumerable:!(n=ug(t,i))||n.enumerable});return e},Se=(e,t,r)=>(r=e!=null?cg(mg(e)):{},hg(t||!e||!e.__esModule?Lc(r,"default",{value:e,enumerable:!0}):r,e)),sn=ur((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,y){return function(){return y.apply(h,arguments)}},c=function(){var h=arguments,y=h[0],E,v;for(v=1;v<h.length;v++)for(E in h[v])!(E in y)&&h[v].hasOwnProperty(E)&&(y[E]=h[v][E]);return y},u=function(h,y){return{value:h,name:y}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var d=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};d.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var y=this.context.filterLevel;return h.value>=y.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,y){i&&this.enabledFor(h)&&i(y,c({level:h},this.context))}};var m=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var y in s)s.hasOwnProperty(y)&&s[y].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(v,_){_.name&&v.unshift("["+_.name+"]")};var y={},E=function(v,_){Function.prototype.apply.call(v,console,_)};return typeof console>"u"?function(){}:function(v,_){v=Array.prototype.slice.call(v);var D=console.log,P;_.level===n.TIME?(P=(_.name?"["+_.name+"] ":"")+v[0],v[1]==="start"?console.time?console.time(P):y[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(D,[P+": "+(new Date().getTime()-y[P])+"ms"])):(_.level===n.WARN&&console.warn?D=console.warn:_.level===n.ERROR&&console.error?D=console.error:_.level===n.INFO&&console.info?D=console.info:_.level===n.DEBUG&&console.debug?D=console.debug:_.level===n.TRACE&&console.trace&&(D=console.trace),h.formatter(v,_),E(D,v))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof t<"u"&&t.exports?t.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(e)}),Bc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MustacheUtils=void 0;var t=class Oh{static escapeHtml(n){return String(n).replace(/"/g,i=>Oh.entityMap[i])}};e.MustacheUtils=t,t.entityMap={'"':"""}}),Rr=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MilestoneRewardType=e.ProgressBarLayout=e.EngagementContentSource=e.EngagementObjective=e.OnsiteDeliveryType=e.ClickActionType=e.FrequencyGapUnit=e.FrequencyType=e.RedirectBehaviour=e.EngagementPlacementPosition=e.EngagementCollectionSource=e.PromotionType=e.CartFilterEnum=e.CartCurrencyOperator=e.CartCriteria=e.URLCriteria=e.UTMCriteria=e.CartItemSource=e.EngagementItemSource=e.PurchasedVisitor=e.LoggedInVisitor=e.VisitorType=e.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(g){return g[g.ONCE_PER_USER=1]="ONCE_PER_USER",g[g.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",g[g.EVERY_TIME=3]="EVERY_TIME",g}(t||(e.CriteriaFrequency=t={})),r=function(g){return g[g.ONE_TIME=1]="ONE_TIME",g[g.MULTIPLE=2]="MULTIPLE",g[g.RECURRING=3]="RECURRING",g}(r||(e.ScheduleFrequency=r={})),n=function(g){return g[g.NOW=1]="NOW",g[g.LATER=2]="LATER",g[g.NEVER=3]="NEVER",g}(n||(e.TimePreference=n={})),i=function(g){return g[g.PUBLISHED=1]="PUBLISHED",g[g.DRAFT=2]="DRAFT",g[g.PAUSED=3]="PAUSED",g[g.FAILED=4]="FAILED",g[g.STOPPED=5]="STOPPED",g[g.COMPLETED=6]="COMPLETED",g[g.ARCHIVED=7]="ARCHIVED",g[g.UNINSTALLED=8]="UNINSTALLED",g}(i||(e.EngagementStatus=i={})),s=function(g){return g.CAMPAIGN="CAMPAIGN",g.NATIVE_AB="NATIVE_AB",g.CRO_COPILOT="CRO_COPILOT",g}(s||(e.EngagementType=s={})),o=function(g){return g[g.NONE=0]="NONE",g[g.RULE_BASED=1]="RULE_BASED",g[g.INTENT_BASED=2]="INTENT_BASED",g}(o||(e.TriggerType=o={})),c=function(g){return g[g.SINGLE=1]="SINGLE",g[g.EXCLUSION=2]="EXCLUSION",g[g.ABTESTING=3]="ABTESTING",g}(c||(e.EngagementContentType=c={})),u=function(g){return g[g.ALL=0]="ALL",g[g.NEW_ONLY=1]="NEW_ONLY",g[g.RETURNING_ONLY=2]="RETURNING_ONLY",g}(u||(e.SessionType=u={})),d=function(g){return g[g.ALL=0]="ALL",g[g.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",g[g.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",g[g.PURCHASED=5]="PURCHASED",g[g.NON_PURCHASED=6]="NON_PURCHASED",g[g.ABANDON_CART=7]="ABANDON_CART",g[g.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",g}(d||(e.VisitorType=d={})),m=function(g){return g.ALL="ALL",g.LOGGED_IN="LOGGED_IN",g.NON_LOGGED_IN="NON_LOGGED_IN",g}(m||(e.LoggedInVisitor=m={})),h=function(g){return g.ALL="ALL",g.PURCHASED="PURCHASED",g.NON_PURCHASED="NON_PURCHASED",g}(h||(e.PurchasedVisitor=h={})),y=function(g){return g[g.NONE=0]="NONE",g[g.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",g[g.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",g[g.SINGLE_ITEM=3]="SINGLE_ITEM",g[g.TOP_SELLING=4]="TOP_SELLING",g[g.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",g[g.NEW_ARRIVALS=6]="NEW_ARRIVALS",g[g.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",g[g.EVENT_ITEM=8]="EVENT_ITEM",g[g.CART_ITEM=9]="CART_ITEM",g[g.BUNDLE=10]="BUNDLE",g[g.CURRENT_ITEM=11]="CURRENT_ITEM",g[g.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",g[g.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",g[g.TRENDING_ITEMS=14]="TRENDING_ITEMS",g}(y||(e.EngagementItemSource=y={})),E=function(g){return g[g.LAST_ADDED=1]="LAST_ADDED",g[g.FIRST_ADDED=2]="FIRST_ADDED",g[g.HIGHEST_PRICE=3]="HIGHEST_PRICE",g[g.LOWEST_PRICE=4]="LOWEST_PRICE",g[g.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",g[g.ALL=6]="ALL",g}(E||(e.CartItemSource=E={})),v=function(g){return g[g.ALL=0]="ALL",g[g.ONLY_ORGANIC=1]="ONLY_ORGANIC",g[g.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",g[g.INCLUDES=3]="INCLUDES",g[g.EXCLUDES=4]="EXCLUDES",g}(v||(e.UTMCriteria=v={})),_=function(g){return g[g.NONE=0]="NONE",g[g.LIKE=1]="LIKE",g[g.NOT_LIKE=2]="NOT_LIKE",g[g.EQUALS=3]="EQUALS",g[g.NOT_EQUALS=4]="NOT_EQUALS",g}(_||(e.URLCriteria=_={})),D=function(g){return g[g.NONE=0]="NONE",g[g.LESS_THAN=1]="LESS_THAN",g[g.GREATER_THAN=2]="GREATER_THAN",g[g.BETWEEN=3]="BETWEEN",g[g.EQUALS=4]="EQUALS",g}(D||(e.CartCriteria=D={})),P=function(g){return g[g.ALL=0]="ALL",g[g.INCLUDES=1]="INCLUDES",g[g.EXCLUDES=2]="EXCLUDES",g}(P||(e.CartCurrencyOperator=P={})),M=function(g){return g[g.NONE=0]="NONE",g[g.AMOUNT=1]="AMOUNT",g[g.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",g[g.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",g}(M||(e.CartFilterEnum=M={})),L=function(g){return g[g.NONE=0]="NONE",g[g.ITEM=1]="ITEM",g[g.COLLECTION=2]="COLLECTION",g}(L||(e.PromotionType=L={})),R=function(g){return g[g.NONE=0]="NONE",g[g.SINGLE=1]="SINGLE",g[g.MULTIPLE=2]="MULTIPLE",g}(R||(e.EngagementCollectionSource=R={})),q=function(g){return g.BEFORE="before",g.AFTER="after",g.INSIDE_FIRST="insideFirst",g.INSIDE_LAST="insideLast",g}(q||(e.EngagementPlacementPosition=q={})),he=function(g){return g.SHOPIFY_CHECKOUT="shopify_checkout",g.THIRD_PARTY_CHECKOUT="third_party_checkout",g.CART_PAGE="cart_page",g.CART_DRAWER="cart_drawer",g}(he||(e.RedirectBehaviour=he={})),$e=function(g){return g.ONCE_IN_SESSION="ONCE_IN_SESSION",g.ACROSS_SESSIONS="ACROSS_SESSIONS",g}($e||(e.FrequencyType=$e={})),B=function(g){return g.DAYS="DAYS",g.HOURS="HOURS",g.MINUTES="MINUTES",g.SECONDS="SECONDS",g}(B||(e.FrequencyGapUnit=B={})),Z=function(g){return g[g.NONE=0]="NONE",g[g.REJECT_POPUP=1]="REJECT_POPUP",g[g.ACCEPT_POPUP=2]="ACCEPT_POPUP",g[g.GO_TO_URL=4]="GO_TO_URL",g[g.SHARE=5]="SHARE",g[g.KEY_VALUE=100]="KEY_VALUE",g[g.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",g[g.ADD_TO_CART=102]="ADD_TO_CART",g[g.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",g[g.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",g[g.OPEN_CART=105]="OPEN_CART",g[g.SUBMIT_FORM=106]="SUBMIT_FORM",g[g.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",g[g.ADD_BUNDLE=108]="ADD_BUNDLE",g[g.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",g}(Z||(e.ClickActionType=Z={})),z=function(g){return g.POPUP="POPUP",g.PAGE_EMBED="PAGE_EMBED",g.CART_EMBED="CART_EMBED",g.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",g}(z||(e.OnsiteDeliveryType=z={})),Q=function(g){return g.PRODUCT_PROMOTION="PRODUCT_PROMOTION",g.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",g.CART_RECOVERY="CART_RECOVERY",g.ANNOUNCEMENT="ANNOUNCEMENT",g.LEAD_GENERATION="LEAD_GENERATION",g.DATA_COLLECTION="DATA_COLLECTION",g.SALE_PROMOTION="SALE_PROMOTION",g.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",g.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",g.BYOB="BYOB",g.PROGRESS_BAR="PROGRESS_BAR",g.BUY_NOW="BUY_NOW",g.EXPERIMENT="EXPERIMENT",g}(Q||(e.EngagementObjective=Q={})),ge=function(g){return g.COOEE="COOEE",g.KLAVIYO="KLAVIYO",g}(ge||(e.EngagementContentSource=ge={})),je=function(g){return g.ICONS="ICONS",g.TILES="TILES",g}(je||(e.ProgressBarLayout=je={})),xe=function(g){return g.FREE_SHIPPING="FREE_SHIPPING",g.DISCOUNT="DISCOUNT",g.FREE_AUTO_GIFT="FREE_AUTO_GIFT",g.FREE_GIFT_SELECT="FREE_GIFT_SELECT",g}(xe||(e.MilestoneRewardType=xe={}))}),Jo=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PriceRuleType=e.DiscountType=void 0;var t=function(n){return n[n.NONE=0]="NONE",n[n.STATIC=1]="STATIC",n[n.UNIQUE_FLAT=2]="UNIQUE_FLAT",n[n.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",n[n.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",n[n.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",n[n.BXGY=6]="BXGY",n}(t||(e.DiscountType=t={})),r=function(n){return n.FIXED_AMOUNT="fixed_amount",n.PERCENTAGE="percentage",n}(r||(e.PriceRuleType=r={}))}),Uc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayUtils=void 0;var t=class Ah{static of(n,i){return i!==void 0?new Array(n).fill(i):Array.from({length:n},(s,o)=>o)}static remove(n,i){let s=n.indexOf(i);return s===-1?!1:(n.splice(s,1),!0)}static swap(n,i,s){[n[i],n[s]]=[n[s],n[i]]}static sum(n,i){return n.reduce((s,o)=>s+Math.max(i?i(o):+o,0),0)}static unique(n,i){return n.filter((s,o,c)=>c.findIndex(u=>u[i]===s[i])===o)}static shuffle(n){let i=n.length;for(;i!=0;){let s=Math.floor(Math.random()*i);i--,Ah.swap(n,i,s)}}};e.ArrayUtils=t}),Df=ur((e,t)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",d="object",m="string",h="major",y="model",E="name",v="type",_="vendor",D="version",P="architecture",M="console",L="mobile",R="tablet",q="smarttv",he="wearable",$e="embedded",B=500,Z="Amazon",z="Apple",Q="ASUS",ge="BlackBerry",je="Browser",xe="Chrome",g="Edge",Ke="Firefox",ve="Google",vt="Huawei",ae="LG",ie="Microsoft",pt="Motorola",tr="Opera",lr="Samsung",_t="Sharp",Vr="Sony",Hn="Xiaomi",on="Zebra",ei="Facebook",qi="Chromium OS",Gn="Mac OS",$n=" Browser",Et=function(W,ce){var ee={};for(var Ce in W)ce[Ce]&&ce[Ce].length%2===0?ee[Ce]=ce[Ce].concat(W[Ce]):ee[Ce]=W[Ce];return ee},$r=function(W){for(var ce={},ee=0;ee<W.length;ee++)ce[W[ee].toUpperCase()]=W[ee];return ce},Gi=function(W,ce){return typeof W===m?a(ce).indexOf(a(W))!==-1:!1},a=function(W){return W.toLowerCase()},l=function(W){return typeof W===m?W.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(W,ce){if(typeof W===m)return W=W.replace(/^\s\s*/,s),typeof ce===u?W:W.substring(0,B)},T=function(W,ce){for(var ee=0,Ce,Rt,Ot,Te,ne,$t;ee<ce.length&&!ne;){var Yi=ce[ee],cs=ce[ee+1];for(Ce=Rt=0;Ce<Yi.length&&!ne&&Yi[Ce];)if(ne=Yi[Ce++].exec(W),ne)for(Ot=0;Ot<cs.length;Ot++)$t=ne[++Rt],Te=cs[Ot],typeof Te===d&&Te.length>0?Te.length===2?typeof Te[1]==c?this[Te[0]]=Te[1].call(this,$t):this[Te[0]]=Te[1]:Te.length===3?typeof Te[1]===c&&!(Te[1].exec&&Te[1].test)?this[Te[0]]=$t?Te[1].call(this,$t,Te[2]):n:this[Te[0]]=$t?$t.replace(Te[1],Te[2]):n:Te.length===4&&(this[Te[0]]=$t?Te[3].call(this,$t.replace(Te[1],Te[2])):n):this[Te]=$t||n;ee+=2}},A=function(W,ce){for(var ee in ce)if(typeof ce[ee]===d&&ce[ee].length>0){for(var Ce=0;Ce<ce[ee].length;Ce++)if(Gi(ce[ee][Ce],W))return ee===o?n:ee}else if(Gi(ce[ee],W))return ee===o?n:ee;return ce.hasOwnProperty("*")?ce["*"]:W},U={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ie={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[D,[E,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[D,[E,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[E,D],[/opios[\/ ]+([\w\.]+)/i],[D,[E,tr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[D,[E,tr+" GX"]],[/\bopr\/([\w\.]+)/i],[D,[E,tr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[D,[E,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[D,[E,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[E,D],[/quark(?:pc)?\/([-\w\.]+)/i],[D,[E,"Quark"]],[/\bddg\/([\w\.]+)/i],[D,[E,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[D,[E,"UC"+je]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[D,[E,"WeChat"]],[/konqueror\/([\w\.]+)/i],[D,[E,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[D,[E,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[D,[E,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[D,[E,"Smart Lenovo "+je]],[/(avast|avg)\/([\w\.]+)/i],[[E,/(.+)/,"$1 Secure "+je],D],[/\bfocus\/([\w\.]+)/i],[D,[E,Ke+" Focus"]],[/\bopt\/([\w\.]+)/i],[D,[E,tr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[D,[E,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[D,[E,"Dolphin"]],[/coast\/([\w\.]+)/i],[D,[E,tr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[D,[E,"MIUI"+$n]],[/fxios\/([\w\.-]+)/i],[D,[E,Ke]],[/\bqihoobrowser\/?([\w\.]*)/i],[D,[E,"360"]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,"$1Browser"],D],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,"$1"+$n],D],[/samsungbrowser\/([\w\.]+)/i],[D,[E,lr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[D,[E,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[E,"Sogou Mobile"],D],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[E,D],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[E],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[D,E],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[E,ei],D],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[E,D],[/\bgsa\/([\w\.]+) .*safari\//i],[D,[E,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[D,[E,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[D,[E,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,xe+" WebView"],D],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[D,[E,"Android "+je]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[E,D],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[D,[E,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[D,E],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[E,[D,A,U]],[/(webkit|khtml)\/([\w\.]+)/i],[E,D],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[E,"Netscape"],D],[/(wolvic|librewolf)\/([\w\.]+)/i],[E,D],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[D,[E,Ke+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[E,[D,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[E,[D,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[P,"amd64"]],[/(ia32(?=;))/i],[[P,a]],[/((?:i[346]|x)86)[;\)]/i],[[P,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[P,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[P,"armhf"]],[/windows (ce|mobile); ppc;/i],[[P,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[P,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[P,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[P,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[y,[_,lr],[v,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[y,[_,lr],[v,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[_,z],[v,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[_,z],[v,R]],[/(macintosh);/i],[y,[_,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[_,_t],[v,L]],[/(?:honor)([-\w ]+)[;\)]/i],[y,[_,"Honor"],[v,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[y,[_,vt],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[_,vt],[v,L]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[_,"OPPO"],[v,L]],[/\b(opd2\d{3}a?) bui/i],[y,[_,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[_,"Vivo"],[v,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[y,[_,"Realme"],[v,L]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[y,[_,pt],[v,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[_,pt],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[_,ae],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[_,ae],[v,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[y,[_,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[y,/_/g," "],[_,"Nokia"],[v,L]],[/(pixel c)\b/i],[y,[_,ve],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[_,ve],[v,L]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[y,[_,Vr],[v,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[_,Vr],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[_,"OnePlus"],[v,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[_,Z],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[_,Z],[v,L]],[/(playbook);[-\w\),; ]+(rim)/i],[y,_,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[_,ge],[v,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[_,Q],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[_,Q],[v,L]],[/(nexus 9)/i],[y,[_,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[y,/_/g," "],[v,L]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[y,[_,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[_,a],y,[v,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[_,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[_,"Meizu"],[v,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[y,[_,"Ulefone"],[v,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[y,[_,"Energizer"],[v,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[y,[_,"Cat"],[v,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[y,[_,"Smartfren"],[v,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[y,[_,"Nothing"],[v,L]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[_,y,[v,L]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[_,y,[v,R]],[/(surface duo)/i],[y,[_,ie],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[_,"Fairphone"],[v,L]],[/(u304aa)/i],[y,[_,"AT&T"],[v,L]],[/\bsie-(\w*)/i],[y,[_,"Siemens"],[v,L]],[/\b(rct\w+) b/i],[y,[_,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[y,[_,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[y,[_,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[_,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[y,[_,"NuVision"],[v,R]],[/\b(k88) b/i],[y,[_,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[y,[_,"ZTE"],[v,L]],[/\b(gen\d{3}) b.+49h/i],[y,[_,"Swiss"],[v,L]],[/\b(zur\d{3}) b/i],[y,[_,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[y,[_,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],y,[v,R]],[/\b(ns-?\w{0,9}) b/i],[y,[_,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[_,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],y,[v,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],y,[v,L]],[/\b(ph-1) /i],[y,[_,"Essential"],[v,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[_,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[y,[_,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[y,[_,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[y,[_,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[_,y,[v,L]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[_,ie],[v,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[_,on],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[_,on],[v,L]],[/smart-tv.+(samsung)/i],[_,[v,q]],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[_,lr],[v,q]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,ae],[v,q]],[/(apple) ?tv/i],[_,[y,z+" TV"],[v,q]],[/crkey/i],[[y,xe+"cast"],[_,ve],[v,q]],[/droid.+aft(\w+)( bui|\))/i],[y,[_,Z],[v,q]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[_,_t],[v,q]],[/(bravia[\w ]+)( bui|\))/i],[y,[_,Vr],[v,q]],[/(mitv-\w{5}) bui/i],[y,[_,Hn],[v,q]],[/Hbbtv.*(technisat) (.*);/i],[_,y,[v,q]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,p],[y,p],[v,q]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,q]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,y,[v,M]],[/droid.+; (shield) bui/i],[y,[_,"Nvidia"],[v,M]],[/(playstation [345portablevi]+)/i],[y,[_,Vr],[v,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[_,ie],[v,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[y,[_,lr],[v,he]],[/((pebble))app/i],[_,y,[v,he]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[_,z],[v,he]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,he]],[/droid.+; (wt63?0{2,3})\)/i],[y,[_,on],[v,he]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,he]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,y,[v,he]],[/; (quest( \d| pro)?)/i],[y,[_,ei],[v,he]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[v,$e]],[/(aeobc)\b/i],[y,[_,Z],[v,$e]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[y,[v,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[v,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,L]],[/(android[-\w\. ]{0,9});.+buil/i],[y,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[D,[E,g+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[E,D],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[D,[E,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[E,D],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[D,E]],os:[[/microsoft (windows) (vista|xp)/i],[E,D],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[E,[D,A,G]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[D,A,G],[E,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[D,/_/g,"."],[E,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[E,Gn],[D,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[D,E],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[E,D],[/\(bb(10);/i],[D,[E,ge]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[D,[E,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[D,[E,Ke+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[D,[E,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[D,[E,"watchOS"]],[/crkey\/([\d\.]+)/i],[D,[E,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,qi],D],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[E,D],[/(sunos) ?([\w\.\d]*)/i],[[E,"Solaris"],D],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[E,D]]},me=function(W,ce){if(typeof W===d&&(ce=W,W=n),!(this instanceof me))return new me(W,ce).getResult();var ee=typeof r!==u&&r.navigator?r.navigator:n,Ce=W||(ee&&ee.userAgent?ee.userAgent:s),Rt=ee&&ee.userAgentData?ee.userAgentData:n,Ot=ce?Et(Ie,ce):Ie,Te=ee&&ee.userAgent==Ce;return this.getBrowser=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.browser),ne[h]=l(ne[D]),Te&&ee&&ee.brave&&typeof ee.brave.isBrave==c&&(ne[E]="Brave"),ne},this.getCPU=function(){var ne={};return ne[P]=n,T.call(ne,Ce,Ot.cpu),ne},this.getDevice=function(){var ne={};return ne[_]=n,ne[y]=n,ne[v]=n,T.call(ne,Ce,Ot.device),Te&&!ne[v]&&Rt&&Rt.mobile&&(ne[v]=L),Te&&ne[y]=="Macintosh"&&ee&&typeof ee.standalone!==u&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&(ne[y]="iPad",ne[v]=R),ne},this.getEngine=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.engine),ne},this.getOS=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.os),Te&&!ne[E]&&Rt&&Rt.platform&&Rt.platform!="Unknown"&&(ne[E]=Rt.platform.replace(/chrome os/i,qi).replace(/macos/i,Gn)),ne},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ce},this.setUA=function(ne){return Ce=typeof ne===m&&ne.length>B?p(ne,B):ne,this},this.setUA(Ce),this};me.VERSION=i,me.BROWSER=$r([E,D,h]),me.CPU=$r([P]),me.DEVICE=$r([y,_,v,M,L,q,R,he,$e]),me.ENGINE=me.OS=$r([E,D]),typeof e!==u?(typeof t!==u&&t.exports&&(e=t.exports=me),e.UAParser=me):typeof define===c&&define.amd?define(function(){return me}):typeof r!==u&&(r.UAParser=me);var ye=typeof r!==u&&(r.jQuery||r.Zepto);if(ye&&!ye.ua){var Fe=new me;ye.ua=Fe.getResult(),ye.ua.get=function(){return Fe.getUA()},ye.ua.set=function(W){Fe.setUA(W);var ce=Fe.getResult();for(var ee in ce)ye.ua[ee]=ce[ee]}}})(typeof window=="object"?window:e)}),Nf=ur((e,t)=>{"use strict";(function(r){if(typeof e=="object"&&typeof t<"u")t.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function d(y,E){if(!c[y]){if(!o[y]){var v=typeof Ki=="function"&&Ki;if(!E&&v)return v(y,!0);if(m)return m(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var D=c[y]={exports:{}};o[y][0].call(D.exports,function(P){var M=o[y][1][P];return d(M||P)},D,D.exports,s,o,c,u)}return c[y].exports}for(var m=typeof Ki=="function"&&Ki,h=0;h<u.length;h++)d(u[h]);return d}({1:[function(s,o,c){(function(u){"use strict";var d=u.MutationObserver||u.WebKitMutationObserver,m;if(d){var h=0,y=new d(P),E=u.document.createTextNode("");y.observe(E,{characterData:!0}),m=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var v=new u.MessageChannel;v.port1.onmessage=P,m=function(){v.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var L=u.document.createElement("script");L.onreadystatechange=function(){P(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null},u.document.documentElement.appendChild(L)}:m=function(){setTimeout(P,0)};var _,D=[];function P(){_=!0;for(var L,R,q=D.length;q;){for(R=D,D=[],L=-1;++L<q;)R[L]();q=D.length}_=!1}o.exports=M;function M(L){D.push(L)===1&&!_&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function d(){}var m={},h=["REJECTED"],y=["FULFILLED"],E=["PENDING"];o.exports=v;function v(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=E,this.queue=[],this.outcome=void 0,B!==d&&M(this,B)}v.prototype.catch=function(B){return this.then(null,B)},v.prototype.then=function(B,Z){if(typeof B!="function"&&this.state===y||typeof Z!="function"&&this.state===h)return this;var z=new this.constructor(d);if(this.state!==E){var Q=this.state===y?B:Z;D(z,Q,this.outcome)}else this.queue.push(new _(z,B,Z));return z};function _(B,Z,z){this.promise=B,typeof Z=="function"&&(this.onFulfilled=Z,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){m.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){D(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){m.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){D(this.promise,this.onRejected,B)};function D(B,Z,z){u(function(){var Q;try{Q=Z(z)}catch(ge){return m.reject(B,ge)}Q===B?m.reject(B,new TypeError("Cannot resolve promise with itself")):m.resolve(B,Q)})}m.resolve=function(B,Z){var z=L(P,Z);if(z.status==="error")return m.reject(B,z.value);var Q=z.value;if(Q)M(B,Q);else{B.state=y,B.outcome=Z;for(var ge=-1,je=B.queue.length;++ge<je;)B.queue[ge].callFulfilled(Z)}return B},m.reject=function(B,Z){B.state=h,B.outcome=Z;for(var z=-1,Q=B.queue.length;++z<Q;)B.queue[z].callRejected(Z);return B};function P(B){var Z=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof Z=="function")return function(){Z.apply(B,arguments)}}function M(B,Z){var z=!1;function Q(g){z||(z=!0,m.reject(B,g))}function ge(g){z||(z=!0,m.resolve(B,g))}function je(){Z(ge,Q)}var xe=L(je);xe.status==="error"&&Q(xe.value)}function L(B,Z){var z={};try{z.value=B(Z),z.status="success"}catch(Q){z.status="error",z.value=Q}return z}v.resolve=R;function R(B){return B instanceof this?B:m.resolve(new this(d),B)}v.reject=q;function q(B){var Z=new this(d);return m.reject(Z,B)}v.all=he;function he(B){var Z=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,Q=!1;if(!z)return this.resolve([]);for(var ge=new Array(z),je=0,xe=-1,g=new this(d);++xe<z;)Ke(B[xe],xe);return g;function Ke(ve,vt){Z.resolve(ve).then(ae,function(ie){Q||(Q=!0,m.reject(g,ie))});function ae(ie){ge[vt]=ie,++je===z&&!Q&&(Q=!0,m.resolve(g,ge))}}}v.race=$e;function $e(B){var Z=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,Q=!1;if(!z)return this.resolve([]);for(var ge=-1,je=new this(d);++ge<z;)xe(B[ge]);return je;function xe(g){Z.resolve(g).then(function(Ke){Q||(Q=!0,m.resolve(je,Ke))},function(Ke){Q||(Q=!0,m.reject(je,Ke))})}}},{1:1}],3:[function(s,o,c){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f};function d(f,S){if(!(f instanceof S))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function y(){try{if(!h||!h.open)return!1;var f=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!f||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function E(f,S){f=f||[],S=S||{};try{return new Blob(f,S)}catch(O){if(O.name!=="TypeError")throw O;for(var I=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,x=new I,C=0;C<f.length;C+=1)x.append(f[C]);return x.getBlob(S.type)}}typeof Promise>"u"&&s(3);var v=Promise;function _(f,S){S&&f.then(function(I){S(null,I)},function(I){S(I)})}function D(f,S,I){typeof S=="function"&&f.then(S),typeof I=="function"&&f.catch(I)}function P(f){return typeof f!="string"&&(console.warn(f+" used as a key, but it is not a string."),f=String(f)),f}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L="local-forage-detect-blob-support",R=void 0,q={},he=Object.prototype.toString,$e="readonly",B="readwrite";function Z(f){for(var S=f.length,I=new ArrayBuffer(S),x=new Uint8Array(I),C=0;C<S;C++)x[C]=f.charCodeAt(C);return I}function z(f){return new v(function(S){var I=f.transaction(L,B),x=E([""]);I.objectStore(L).put(x,"key"),I.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},I.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),O=navigator.userAgent.match(/Edge\//);S(O||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function Q(f){return typeof R=="boolean"?v.resolve(R):z(f).then(function(S){return R=S,R})}function ge(f){var S=q[f.name],I={};I.promise=new v(function(x,C){I.resolve=x,I.reject=C}),S.deferredOperations.push(I),S.dbReady?S.dbReady=S.dbReady.then(function(){return I.promise}):S.dbReady=I.promise}function je(f){var S=q[f.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function xe(f,S){var I=q[f.name],x=I.deferredOperations.pop();if(x)return x.reject(S),x.promise}function g(f,S){return new v(function(I,x){if(q[f.name]=q[f.name]||Vr(),f.db)if(S)ge(f),f.db.close();else return I(f.db);var C=[f.name];S&&C.push(f.version);var O=h.open.apply(h,C);S&&(O.onupgradeneeded=function(k){var j=O.result;try{j.createObjectStore(f.storeName),k.oldVersion<=1&&j.createObjectStore(L)}catch(H){if(H.name==="ConstraintError")console.warn('The database "'+f.name+'" has been upgraded from version '+k.oldVersion+" to version "+k.newVersion+', but the storage "'+f.storeName+'" already exists.');else throw H}}),O.onerror=function(k){k.preventDefault(),x(O.error)},O.onsuccess=function(){var k=O.result;k.onversionchange=function(j){j.target.close()},I(k),je(f)}})}function Ke(f){return g(f,!1)}function ve(f){return g(f,!0)}function vt(f,S){if(!f.db)return!0;var I=!f.db.objectStoreNames.contains(f.storeName),x=f.version<f.db.version,C=f.version>f.db.version;if(x&&(f.version!==S&&console.warn('The database "'+f.name+`" can't be downgraded from version `+f.db.version+" to version "+f.version+"."),f.version=f.db.version),C||I){if(I){var O=f.db.version+1;O>f.version&&(f.version=O)}return!0}return!1}function ae(f){return new v(function(S,I){var x=new FileReader;x.onerror=I,x.onloadend=function(C){var O=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:O,type:f.type})},x.readAsBinaryString(f)})}function ie(f){var S=Z(atob(f.data));return E([S],{type:f.type})}function pt(f){return f&&f.__local_forage_encoded_blob}function tr(f){var S=this,I=S._initReady().then(function(){var x=q[S._dbInfo.name];if(x&&x.dbReady)return x.dbReady});return D(I,f,f),I}function lr(f){ge(f);for(var S=q[f.name],I=S.forages,x=0;x<I.length;x++){var C=I[x];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return f.db=null,Ke(f).then(function(O){return f.db=O,vt(f)?ve(f):O}).then(function(O){f.db=S.db=O;for(var k=0;k<I.length;k++)I[k]._dbInfo.db=O}).catch(function(O){throw xe(f,O),O})}function _t(f,S,I,x){x===void 0&&(x=1);try{var C=f.db.transaction(f.storeName,S);I(null,C)}catch(O){if(x>0&&(!f.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return v.resolve().then(function(){if(!f.db||O.name==="NotFoundError"&&!f.db.objectStoreNames.contains(f.storeName)&&f.version<=f.db.version)return f.db&&(f.version=f.db.version+1),ve(f)}).then(function(){return lr(f).then(function(){_t(f,S,I,x-1)})}).catch(I);I(O)}}function Vr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(f){var S=this,I={db:null};if(f)for(var x in f)I[x]=f[x];var C=q[I.name];C||(C=Vr(),q[I.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=tr);var O=[];function k(){return v.resolve()}for(var j=0;j<C.forages.length;j++){var H=C.forages[j];H!==S&&O.push(H._initReady().catch(k))}var V=C.forages.slice(0);return v.all(O).then(function(){return I.db=C.db,Ke(I)}).then(function(F){return I.db=F,vt(I,S._defaultConfig.version)?ve(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var Y=0;Y<V.length;Y++){var pe=V[Y];pe!==S&&(pe._dbInfo.db=I.db,pe._dbInfo.version=I.version)}})}function on(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.get(f);V.onsuccess=function(){var F=V.result;F===void 0&&(F=null),pt(F)&&(F=ie(F)),C(F)},V.onerror=function(){O(V.error)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function ei(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.openCursor(),F=1;V.onsuccess=function(){var Y=V.result;if(Y){var pe=Y.value;pt(pe)&&(pe=ie(pe));var Ge=f(pe,Y.key,F++);Ge!==void 0?C(Ge):Y.continue()}else C()},V.onerror=function(){O(V.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function qi(f,S,I){var x=this;f=P(f);var C=new v(function(O,k){var j;x.ready().then(function(){return j=x._dbInfo,he.call(S)==="[object Blob]"?Q(j.db).then(function(H){return H?S:ae(S)}):S}).then(function(H){_t(x._dbInfo,B,function(V,F){if(V)return k(V);try{var Y=F.objectStore(x._dbInfo.storeName);H===null&&(H=void 0);var pe=Y.put(H,f);F.oncomplete=function(){H===void 0&&(H=null),O(H)},F.onabort=F.onerror=function(){var Ge=pe.error?pe.error:pe.transaction.error;k(Ge)}}catch(Ge){k(Ge)}})}).catch(k)});return _(C,I),C}function Gn(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,B,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.delete(f);j.oncomplete=function(){C()},j.onerror=function(){O(V.error)},j.onabort=function(){var F=V.error?V.error:V.transaction.error;O(F)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function $n(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,B,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.clear();k.oncomplete=function(){x()},k.onabort=k.onerror=function(){var V=H.error?H.error:H.transaction.error;C(V)}}catch(V){C(V)}})}).catch(C)});return _(I,f),I}function Et(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,$e,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.count();H.onsuccess=function(){x(H.result)},H.onerror=function(){C(H.error)}}catch(V){C(V)}})}).catch(C)});return _(I,f),I}function $r(f,S){var I=this,x=new v(function(C,O){if(f<0){C(null);return}I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=!1,F=H.openKeyCursor();F.onsuccess=function(){var Y=F.result;if(!Y){C(null);return}f===0||V?C(Y.key):(V=!0,Y.advance(f))},F.onerror=function(){O(F.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Gi(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,$e,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.openKeyCursor(),V=[];H.onsuccess=function(){var F=H.result;if(!F){x(V);return}V.push(F.key),F.continue()},H.onerror=function(){C(H.error)}}catch(F){C(F)}})}).catch(C)});return _(I,f),I}function a(f,S){S=M.apply(this,arguments);var I=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||I.name,f.storeName=f.storeName||I.storeName);var x=this,C;if(!f.name)C=v.reject("Invalid arguments");else{var O=f.name===I.name&&x._dbInfo.db,k=O?v.resolve(x._dbInfo.db):Ke(f).then(function(j){var H=q[f.name],V=H.forages;H.db=j;for(var F=0;F<V.length;F++)V[F]._dbInfo.db=j;return j});f.storeName?C=k.then(function(j){if(j.objectStoreNames.contains(f.storeName)){var H=j.version+1;ge(f);var V=q[f.name],F=V.forages;j.close();for(var Y=0;Y<F.length;Y++){var pe=F[Y];pe._dbInfo.db=null,pe._dbInfo.version=H}var Ge=new v(function(Ae,ft){var We=h.open(f.name,H);We.onerror=function(Ht){var Dc=We.result;Dc.close(),ft(Ht)},We.onupgradeneeded=function(){var Ht=We.result;Ht.deleteObjectStore(f.storeName)},We.onsuccess=function(){var Ht=We.result;Ht.close(),Ae(Ht)}});return Ge.then(function(Ae){V.db=Ae;for(var ft=0;ft<F.length;ft++){var We=F[ft];We._dbInfo.db=Ae,je(We._dbInfo)}}).catch(function(Ae){throw(xe(f,Ae)||v.resolve()).catch(function(){}),Ae})}}):C=k.then(function(j){ge(f);var H=q[f.name],V=H.forages;j.close();for(var F=0;F<V.length;F++){var Y=V[F];Y._dbInfo.db=null}var pe=new v(function(Ge,Ae){var ft=h.deleteDatabase(f.name);ft.onerror=function(){var We=ft.result;We&&We.close(),Ae(ft.error)},ft.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},ft.onsuccess=function(){var We=ft.result;We&&We.close(),Ge(We)}});return pe.then(function(Ge){H.db=Ge;for(var Ae=0;Ae<V.length;Ae++){var ft=V[Ae];je(ft._dbInfo)}}).catch(function(Ge){throw(xe(f,Ge)||v.resolve()).catch(function(){}),Ge})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:Hn,_support:y(),iterate:ei,getItem:on,setItem:qi,removeItem:Gn,clear:$n,length:Et,key:$r,keys:Gi,dropInstance:a};function p(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,G="__lfsc__:",Ie=G.length,me="arbf",ye="blob",Fe="si08",W="ui08",ce="uic8",ee="si16",Ce="si32",Rt="ur16",Ot="ui32",Te="fl32",ne="fl64",$t=Ie+me.length,Yi=Object.prototype.toString;function cs(f){var S=f.length*.75,I=f.length,x,C=0,O,k,j,H;f[f.length-1]==="="&&(S--,f[f.length-2]==="="&&S--);var V=new ArrayBuffer(S),F=new Uint8Array(V);for(x=0;x<I;x+=4)O=T.indexOf(f[x]),k=T.indexOf(f[x+1]),j=T.indexOf(f[x+2]),H=T.indexOf(f[x+3]),F[C++]=O<<2|k>>4,F[C++]=(k&15)<<4|j>>2,F[C++]=(j&3)<<6|H&63;return V}function Qo(f){var S=new Uint8Array(f),I="",x;for(x=0;x<S.length;x+=3)I+=T[S[x]>>2],I+=T[(S[x]&3)<<4|S[x+1]>>4],I+=T[(S[x+1]&15)<<2|S[x+2]>>6],I+=T[S[x+2]&63];return S.length%3===2?I=I.substring(0,I.length-1)+"=":S.length%3===1&&(I=I.substring(0,I.length-2)+"=="),I}function np(f,S){var I="";if(f&&(I=Yi.call(f)),f&&(I==="[object ArrayBuffer]"||f.buffer&&Yi.call(f.buffer)==="[object ArrayBuffer]")){var x,C=G;f instanceof ArrayBuffer?(x=f,C+=me):(x=f.buffer,I==="[object Int8Array]"?C+=Fe:I==="[object Uint8Array]"?C+=W:I==="[object Uint8ClampedArray]"?C+=ce:I==="[object Int16Array]"?C+=ee:I==="[object Uint16Array]"?C+=Rt:I==="[object Int32Array]"?C+=Ce:I==="[object Uint32Array]"?C+=Ot:I==="[object Float32Array]"?C+=Te:I==="[object Float64Array]"?C+=ne:S(new Error("Failed to get type for BinaryArray"))),S(C+Qo(x))}else if(I==="[object Blob]"){var O=new FileReader;O.onload=function(){var k=A+f.type+"~"+Qo(this.result);S(G+ye+k)},O.readAsArrayBuffer(f)}else try{S(JSON.stringify(f))}catch(k){console.error("Couldn't convert value into a JSON string: ",f),S(null,k)}}function ip(f){if(f.substring(0,Ie)!==G)return JSON.parse(f);var S=f.substring($t),I=f.substring(Ie,$t),x;if(I===ye&&U.test(S)){var C=S.match(U);x=C[1],S=S.substring(C[0].length)}var O=cs(S);switch(I){case me:return O;case ye:return E([O],{type:x});case Fe:return new Int8Array(O);case W:return new Uint8Array(O);case ce:return new Uint8ClampedArray(O);case ee:return new Int16Array(O);case Rt:return new Uint16Array(O);case Ce:return new Int32Array(O);case Ot:return new Uint32Array(O);case Te:return new Float32Array(O);case ne:return new Float64Array(O);default:throw new Error("Unkown type: "+I)}}var za={serialize:np,deserialize:ip,stringToBuffer:cs,bufferToString:Qo};function Ih(f,S,I,x){f.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],I,x)}function sp(f){var S=this,I={db:null};if(f)for(var x in f)I[x]=typeof f[x]!="string"?f[x].toString():f[x];var C=new v(function(O,k){try{I.db=openDatabase(I.name,String(I.version),I.description,I.size)}catch(j){return k(j)}I.db.transaction(function(j){Ih(j,I,function(){S._dbInfo=I,O()},function(H,V){k(V)})},k)});return I.serializer=za,C}function Vn(f,S,I,x,C,O){f.executeSql(I,x,C,function(k,j){j.code===j.SYNTAX_ERR?k.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(H,V){V.rows.length?O(H,j):Ih(H,S,function(){H.executeSql(I,x,C,O)},O)},O):O(k,j)},O)}function ap(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT * FROM "+k.storeName+" WHERE key = ? LIMIT 1",[f],function(H,V){var F=V.rows.length?V.rows.item(0).value:null;F&&(F=k.serializer.deserialize(F)),C(F)},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function cp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT * FROM "+k.storeName,[],function(H,V){for(var F=V.rows,Y=F.length,pe=0;pe<Y;pe++){var Ge=F.item(pe),Ae=Ge.value;if(Ae&&(Ae=k.serializer.deserialize(Ae)),Ae=f(Ae,Ge.key,pe+1),Ae!==void 0){C(Ae);return}}C()},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function Th(f,S,I,x){var C=this;f=P(f);var O=new v(function(k,j){C.ready().then(function(){S===void 0&&(S=null);var H=S,V=C._dbInfo;V.serializer.serialize(S,function(F,Y){Y?j(Y):V.db.transaction(function(pe){Vn(pe,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[f,F],function(){k(H)},function(Ge,Ae){j(Ae)})},function(pe){if(pe.code===pe.QUOTA_ERR){if(x>0){k(Th.apply(C,[f,H,I,x-1]));return}j(pe)}})})}).catch(j)});return _(O,I),O}function lp(f,S,I){return Th.apply(this,[f,S,I,1])}function up(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[f],function(){C()},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function pp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"DELETE FROM "+O.storeName,[],function(){x()},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function gp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(j,H){var V=H.rows.item(0).c;x(V)},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function yp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT key FROM "+k.storeName+" WHERE id = ? LIMIT 1",[f+1],function(H,V){var F=V.rows.length?V.rows.item(0).key:null;C(F)},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function vp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"SELECT key FROM "+O.storeName,[],function(j,H){for(var V=[],F=0;F<H.rows.length;F++)V.push(H.rows.item(F).key);x(V)},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function bp(f){return new v(function(S,I){f.transaction(function(x){x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,O){for(var k=[],j=0;j<O.rows.length;j++)k.push(O.rows.item(j).name);S({db:f,storeNames:k})},function(C,O){I(O)})},function(x){I(x)})})}function wp(f,S){S=M.apply(this,arguments);var I=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||I.name,f.storeName=f.storeName||I.storeName);var x=this,C;return f.name?C=new v(function(O){var k;f.name===I.name?k=x._dbInfo.db:k=openDatabase(f.name,"","",0),f.storeName?O({db:k,storeNames:[f.storeName]}):O(bp(k))}).then(function(O){return new v(function(k,j){O.db.transaction(function(H){function V(Ge){return new v(function(Ae,ft){H.executeSql("DROP TABLE IF EXISTS "+Ge,[],function(){Ae()},function(We,Ht){ft(Ht)})})}for(var F=[],Y=0,pe=O.storeNames.length;Y<pe;Y++)F.push(V(O.storeNames[Y]));v.all(F).then(function(){k()}).catch(function(Ge){j(Ge)})},function(H){j(H)})})}):C=v.reject("Invalid arguments"),_(C,S),C}var _p={_driver:"webSQLStorage",_initStorage:sp,_support:p(),iterate:cp,getItem:ap,setItem:lp,removeItem:up,clear:pp,length:gp,key:yp,keys:vp,dropInstance:wp};function Ep(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ch(f,S){var I=f.name+"/";return f.storeName!==S.storeName&&(I+=f.storeName+"/"),I}function Sp(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function Ip(){return!Sp()||localStorage.length>0}function Tp(f){var S=this,I={};if(f)for(var x in f)I[x]=f[x];return I.keyPrefix=Ch(f,S._defaultConfig),Ip()?(S._dbInfo=I,I.serializer=za,v.resolve()):v.reject()}function Cp(f){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var O=localStorage.key(C);O.indexOf(x)===0&&localStorage.removeItem(O)}});return _(I,f),I}function Np(f,S){var I=this;f=P(f);var x=I.ready().then(function(){var C=I._dbInfo,O=localStorage.getItem(C.keyPrefix+f);return O&&(O=C.serializer.deserialize(O)),O});return _(x,S),x}function Dp(f,S){var I=this,x=I.ready().then(function(){for(var C=I._dbInfo,O=C.keyPrefix,k=O.length,j=localStorage.length,H=1,V=0;V<j;V++){var F=localStorage.key(V);if(F.indexOf(O)===0){var Y=localStorage.getItem(F);if(Y&&(Y=C.serializer.deserialize(Y)),Y=f(Y,F.substring(k),H++),Y!==void 0)return Y}}});return _(x,S),x}function xp(f,S){var I=this,x=I.ready().then(function(){var C=I._dbInfo,O;try{O=localStorage.key(f)}catch{O=null}return O&&(O=O.substring(C.keyPrefix.length)),O});return _(x,S),x}function Op(f){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo,C=localStorage.length,O=[],k=0;k<C;k++){var j=localStorage.key(k);j.indexOf(x.keyPrefix)===0&&O.push(j.substring(x.keyPrefix.length))}return O});return _(I,f),I}function Ap(f){var S=this,I=S.keys().then(function(x){return x.length});return _(I,f),I}function Pp(f,S){var I=this;f=P(f);var x=I.ready().then(function(){var C=I._dbInfo;localStorage.removeItem(C.keyPrefix+f)});return _(x,S),x}function Rp(f,S,I){var x=this;f=P(f);var C=x.ready().then(function(){S===void 0&&(S=null);var O=S;return new v(function(k,j){var H=x._dbInfo;H.serializer.serialize(S,function(V,F){if(F)j(F);else try{localStorage.setItem(H.keyPrefix+f,V),k(O)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(Y),j(Y)}})})});return _(C,I),C}function kp(f,S){if(S=M.apply(this,arguments),f=typeof f!="function"&&f||{},!f.name){var I=this.config();f.name=f.name||I.name,f.storeName=f.storeName||I.storeName}var x=this,C;return f.name?C=new v(function(O){f.storeName?O(Ch(f,x._defaultConfig)):O(f.name+"/")}).then(function(O){for(var k=localStorage.length-1;k>=0;k--){var j=localStorage.key(k);j.indexOf(O)===0&&localStorage.removeItem(j)}}):C=v.reject("Invalid arguments"),_(C,S),C}var Lp={_driver:"localStorageWrapper",_initStorage:Tp,_support:Ep(),iterate:Dp,getItem:Np,setItem:Rp,removeItem:Pp,clear:Cp,length:Ap,key:xp,keys:Op,dropInstance:kp},Up=function(f,S){return f===S||typeof f=="number"&&typeof S=="number"&&isNaN(f)&&isNaN(S)},Mp=function(f,S){for(var I=f.length,x=0;x<I;){if(Up(f[x],S))return!0;x++}return!1},Nh=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},to={},Dh={},zi={INDEXEDDB:l,WEBSQL:_p,LOCALSTORAGE:Lp},Bp=[zi.INDEXEDDB._driver,zi.WEBSQL._driver,zi.LOCALSTORAGE._driver],Xo=["dropInstance"],Qa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Xo),$p={description:"",driver:Bp.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function jp(f,S){f[S]=function(){var I=arguments;return f.ready().then(function(){return f[S].apply(f,I)})}}function Nc(){for(var f=1;f<arguments.length;f++){var S=arguments[f];if(S)for(var I in S)S.hasOwnProperty(I)&&(Nh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var Fp=function(){function f(S){d(this,f);for(var I in zi)if(zi.hasOwnProperty(I)){var x=zi[I],C=x._driver;this[I]=C,to[C]||this.defineDriver(x)}this._defaultConfig=Nc({},$p),this._config=Nc({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return f.prototype.config=function(S){if((typeof S>"u"?"undefined":u(S))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var I in S){if(I==="storeName"&&(S[I]=S[I].replace(/\W/g,"_")),I==="version"&&typeof S[I]!="number")return new Error("Database version must be a number.");this._config[I]=S[I]}return"driver"in S&&S.driver?this.setDriver(this._config.driver):!0}else return typeof S=="string"?this._config[S]:this._config},f.prototype.defineDriver=function(S,I,x){var C=new v(function(O,k){try{var j=S._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!S._driver){k(H);return}for(var V=Qa.concat("_initStorage"),F=0,Y=V.length;F<Y;F++){var pe=V[F],Ge=!Mp(Xo,pe);if((Ge||S[pe])&&typeof S[pe]!="function"){k(H);return}}var Ae=function(){for(var We=function(Hp){return function(){var qp=new Error("Method "+Hp+" is not implemented by the current driver"),xh=v.reject(qp);return _(xh,arguments[arguments.length-1]),xh}},Ht=0,Dc=Xo.length;Ht<Dc;Ht++){var Oc=Xo[Ht];S[Oc]||(S[Oc]=We(Oc))}};Ae();var ft=function(We){to[j]&&console.info("Redefining LocalForage driver: "+j),to[j]=S,Dh[j]=We,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(ft,k):ft(!!S._support):ft(!0)}catch(We){k(We)}});return D(C,I,x),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(S,I,x){var C=to[S]?v.resolve(to[S]):v.reject(new Error("Driver not found."));return D(C,I,x),C},f.prototype.getSerializer=function(S){var I=v.resolve(za);return D(I,S),I},f.prototype.ready=function(S){var I=this,x=I._driverSet.then(function(){return I._ready===null&&(I._ready=I._initDriver()),I._ready});return D(x,S,S),x},f.prototype.setDriver=function(S,I,x){var C=this;Nh(S)||(S=[S]);var O=this._getSupportedDrivers(S);function k(){C._config.driver=C.driver()}function j(F){return C._extend(F),k(),C._ready=C._initStorage(C._config),C._ready}function H(F){return function(){var Y=0;function pe(){for(;Y<F.length;){var Ge=F[Y];return Y++,C._dbInfo=null,C._ready=null,C.getDriver(Ge).then(j).catch(pe)}k();var Ae=new Error("No available storage method found.");return C._driverSet=v.reject(Ae),C._driverSet}return pe()}}var V=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=V.then(function(){var F=O[0];return C._dbInfo=null,C._ready=null,C.getDriver(F).then(function(Y){C._driver=Y._driver,k(),C._wrapLibraryMethodsWithReady(),C._initDriver=H(O)})}).catch(function(){k();var F=new Error("No available storage method found.");return C._driverSet=v.reject(F),C._driverSet}),D(this._driverSet,I,x),this._driverSet},f.prototype.supports=function(S){return!!Dh[S]},f.prototype._extend=function(S){Nc(this,S)},f.prototype._getSupportedDrivers=function(S){for(var I=[],x=0,C=S.length;x<C;x++){var O=S[x];this.supports(O)&&I.push(O)}return I},f.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,I=Qa.length;S<I;S++)jp(this,Qa[S])},f.prototype.createInstance=function(S){return new f(S)},f}(),Vp=new Fp;o.exports=Vp},{3:3}]},{},[4])(4)})}),ti=ur(e=>{"use strict";var t=e&&e.__awaiter||function(n,i,s,o){function c(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function m(E){try{y(o.next(E))}catch(v){d(v)}}function h(E){try{y(o.throw(E))}catch(v){d(v)}}function y(E){E.done?u(E.value):c(E.value).then(m,h)}y((o=o.apply(n,i||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.JSUtils=void 0;var r=class{static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static sleep(n){return t(this,void 0,void 0,function*(){return new Promise(i=>setTimeout(i,n))})}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,i){return i.reduce((s,o)=>(n.hasOwnProperty(o)&&n[o]!=null&&s.push({[o]:n[o]}),s),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((i,s)=>(n[s]!==null&&n[s]!==void 0&&(i[s]=n[s]),i),{})}static stringify(n){return JSON.stringify(n,function(i,s){return s===void 0?null:s})}};e.JSUtils=r,r.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)}),Zu=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URLBuilder=void 0;var t=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();e.URLBuilder=t}),oh=ur((e,t)=>{"use strict";(function(r,n){typeof e=="object"&&typeof t<"u"?t.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(e,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,d){var m=o.retries,h=o.retryDelay,y=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))m=d.retries;else throw new i("retries must be a positive integer");if(d&&d.retryDelay!==void 0)if(n(d.retryDelay)||typeof d.retryDelay=="function")h=d.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(d&&d.retryOn)if(Array.isArray(d.retryOn)||typeof d.retryOn=="function")y=d.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(E,v){var _=function(P){var M=typeof Request<"u"&&u instanceof Request?u.clone():u;s(M,d).then(function(L){if(Array.isArray(y)&&y.indexOf(L.status)===-1)E(L);else if(typeof y=="function")try{return Promise.resolve(y(P,null,L)).then(function(R){R?D(P,null,L):E(L)}).catch(v)}catch(R){v(R)}else P<m?D(P,null,L):E(L)}).catch(function(L){if(typeof y=="function")try{Promise.resolve(y(P,L,null)).then(function(R){R?D(P,L,null):v(L)}).catch(function(R){v(R)})}catch(R){v(R)}else P<m?D(P,L,null):v(L)})};function D(P,M,L){var R=typeof h=="function"?h(P,M,L):h;setTimeout(function(){_(++P)},R)}_(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),hp="9.8.1",N=class Ac{static SDK_VERSION=hp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let t=Ac.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ac.SDK_VERSION_CODE=parseInt(t,10)}},mt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.js`},Pt=Se(sn()),w=class{static log(...e){Pt.default.info(...e)}static debug(...e){Pt.default.debug(...e)}static error(...e){Pt.default.error(...e)}static warn(...e){Pt.default.warn(...e)}static info(...e){Pt.default.info(...e)}static trace(...e){Pt.default.trace(...e)}static configure(e=N.LOG_PREFIX){Pt.default.useDefaults({formatter:function(r){r.unshift(`${e} (v${N.SDK_VERSION}):`)}});let t=this.getDebugParam();(t==="1"||t==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Pt.default.setLevel(Pt.default[localStorage.cooeeLogLevel]):Pt.default.setLevel(mt.debug?Pt.default.TRACE:Pt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
|
|
1
|
+
"use strict";(()=>{var cg=Object.create,Lc=Object.defineProperty,lg=Object.defineProperties,ug=Object.getOwnPropertyDescriptor,pg=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertyNames,fp=Object.getOwnPropertySymbols,mg=Object.getPrototypeOf,dp=Object.prototype.hasOwnProperty,dg=Object.prototype.propertyIsEnumerable,mp=(e,t,r)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||={})dp.call(t,r)&&mp(e,r,t[r]);if(fp)for(var r of fp(t))dg.call(t,r)&&mp(e,r,t[r]);return e},te=(e,t)=>lg(e,pg(t)),Ki=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),ur=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fg(t))!dp.call(e,i)&&i!==r&&Lc(e,i,{get:()=>t[i],enumerable:!(n=ug(t,i))||n.enumerable});return e},Se=(e,t,r)=>(r=e!=null?cg(mg(e)):{},hg(t||!e||!e.__esModule?Lc(r,"default",{value:e,enumerable:!0}):r,e)),sn=ur((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,y){return function(){return y.apply(h,arguments)}},c=function(){var h=arguments,y=h[0],E,v;for(v=1;v<h.length;v++)for(E in h[v])!(E in y)&&h[v].hasOwnProperty(E)&&(y[E]=h[v][E]);return y},u=function(h,y){return{value:h,name:y}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var d=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};d.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var y=this.context.filterLevel;return h.value>=y.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,y){i&&this.enabledFor(h)&&i(y,c({level:h},this.context))}};var m=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var y in s)s.hasOwnProperty(y)&&s[y].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(v,_){_.name&&v.unshift("["+_.name+"]")};var y={},E=function(v,_){Function.prototype.apply.call(v,console,_)};return typeof console>"u"?function(){}:function(v,_){v=Array.prototype.slice.call(v);var D=console.log,P;_.level===n.TIME?(P=(_.name?"["+_.name+"] ":"")+v[0],v[1]==="start"?console.time?console.time(P):y[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(D,[P+": "+(new Date().getTime()-y[P])+"ms"])):(_.level===n.WARN&&console.warn?D=console.warn:_.level===n.ERROR&&console.error?D=console.error:_.level===n.INFO&&console.info?D=console.info:_.level===n.DEBUG&&console.debug?D=console.debug:_.level===n.TRACE&&console.trace&&(D=console.trace),h.formatter(v,_),E(D,v))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof t<"u"&&t.exports?t.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(e)}),Bc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MustacheUtils=void 0;var t=class Oh{static escapeHtml(n){return String(n).replace(/"/g,i=>Oh.entityMap[i])}};e.MustacheUtils=t,t.entityMap={'"':"""}}),Rr=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MilestoneRewardType=e.ProgressBarLayout=e.EngagementContentSource=e.EngagementObjective=e.OnsiteDeliveryType=e.ClickActionType=e.FrequencyGapUnit=e.FrequencyType=e.RedirectBehaviour=e.EngagementPlacementPosition=e.EngagementCollectionSource=e.PromotionType=e.CartFilterEnum=e.CartCurrencyOperator=e.CartCriteria=e.URLCriteria=e.UTMCriteria=e.CartItemSource=e.EngagementItemSource=e.PurchasedVisitor=e.LoggedInVisitor=e.VisitorType=e.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(g){return g[g.ONCE_PER_USER=1]="ONCE_PER_USER",g[g.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",g[g.EVERY_TIME=3]="EVERY_TIME",g}(t||(e.CriteriaFrequency=t={})),r=function(g){return g[g.ONE_TIME=1]="ONE_TIME",g[g.MULTIPLE=2]="MULTIPLE",g[g.RECURRING=3]="RECURRING",g}(r||(e.ScheduleFrequency=r={})),n=function(g){return g[g.NOW=1]="NOW",g[g.LATER=2]="LATER",g[g.NEVER=3]="NEVER",g}(n||(e.TimePreference=n={})),i=function(g){return g[g.PUBLISHED=1]="PUBLISHED",g[g.DRAFT=2]="DRAFT",g[g.PAUSED=3]="PAUSED",g[g.FAILED=4]="FAILED",g[g.STOPPED=5]="STOPPED",g[g.COMPLETED=6]="COMPLETED",g[g.ARCHIVED=7]="ARCHIVED",g[g.UNINSTALLED=8]="UNINSTALLED",g}(i||(e.EngagementStatus=i={})),s=function(g){return g.CAMPAIGN="CAMPAIGN",g.NATIVE_AB="NATIVE_AB",g.CRO_COPILOT="CRO_COPILOT",g}(s||(e.EngagementType=s={})),o=function(g){return g[g.NONE=0]="NONE",g[g.RULE_BASED=1]="RULE_BASED",g[g.INTENT_BASED=2]="INTENT_BASED",g}(o||(e.TriggerType=o={})),c=function(g){return g[g.SINGLE=1]="SINGLE",g[g.EXCLUSION=2]="EXCLUSION",g[g.ABTESTING=3]="ABTESTING",g}(c||(e.EngagementContentType=c={})),u=function(g){return g[g.ALL=0]="ALL",g[g.NEW_ONLY=1]="NEW_ONLY",g[g.RETURNING_ONLY=2]="RETURNING_ONLY",g}(u||(e.SessionType=u={})),d=function(g){return g[g.ALL=0]="ALL",g[g.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",g[g.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",g[g.PURCHASED=5]="PURCHASED",g[g.NON_PURCHASED=6]="NON_PURCHASED",g[g.ABANDON_CART=7]="ABANDON_CART",g[g.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",g}(d||(e.VisitorType=d={})),m=function(g){return g.ALL="ALL",g.LOGGED_IN="LOGGED_IN",g.NON_LOGGED_IN="NON_LOGGED_IN",g}(m||(e.LoggedInVisitor=m={})),h=function(g){return g.ALL="ALL",g.PURCHASED="PURCHASED",g.NON_PURCHASED="NON_PURCHASED",g}(h||(e.PurchasedVisitor=h={})),y=function(g){return g[g.NONE=0]="NONE",g[g.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",g[g.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",g[g.SINGLE_ITEM=3]="SINGLE_ITEM",g[g.TOP_SELLING=4]="TOP_SELLING",g[g.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",g[g.NEW_ARRIVALS=6]="NEW_ARRIVALS",g[g.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",g[g.EVENT_ITEM=8]="EVENT_ITEM",g[g.CART_ITEM=9]="CART_ITEM",g[g.BUNDLE=10]="BUNDLE",g[g.CURRENT_ITEM=11]="CURRENT_ITEM",g[g.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",g[g.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",g[g.TRENDING_ITEMS=14]="TRENDING_ITEMS",g}(y||(e.EngagementItemSource=y={})),E=function(g){return g[g.LAST_ADDED=1]="LAST_ADDED",g[g.FIRST_ADDED=2]="FIRST_ADDED",g[g.HIGHEST_PRICE=3]="HIGHEST_PRICE",g[g.LOWEST_PRICE=4]="LOWEST_PRICE",g[g.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",g[g.ALL=6]="ALL",g}(E||(e.CartItemSource=E={})),v=function(g){return g[g.ALL=0]="ALL",g[g.ONLY_ORGANIC=1]="ONLY_ORGANIC",g[g.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",g[g.INCLUDES=3]="INCLUDES",g[g.EXCLUDES=4]="EXCLUDES",g}(v||(e.UTMCriteria=v={})),_=function(g){return g[g.NONE=0]="NONE",g[g.LIKE=1]="LIKE",g[g.NOT_LIKE=2]="NOT_LIKE",g[g.EQUALS=3]="EQUALS",g[g.NOT_EQUALS=4]="NOT_EQUALS",g}(_||(e.URLCriteria=_={})),D=function(g){return g[g.NONE=0]="NONE",g[g.LESS_THAN=1]="LESS_THAN",g[g.GREATER_THAN=2]="GREATER_THAN",g[g.BETWEEN=3]="BETWEEN",g[g.EQUALS=4]="EQUALS",g}(D||(e.CartCriteria=D={})),P=function(g){return g[g.ALL=0]="ALL",g[g.INCLUDES=1]="INCLUDES",g[g.EXCLUDES=2]="EXCLUDES",g}(P||(e.CartCurrencyOperator=P={})),M=function(g){return g[g.NONE=0]="NONE",g[g.AMOUNT=1]="AMOUNT",g[g.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",g[g.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",g}(M||(e.CartFilterEnum=M={})),L=function(g){return g[g.NONE=0]="NONE",g[g.ITEM=1]="ITEM",g[g.COLLECTION=2]="COLLECTION",g}(L||(e.PromotionType=L={})),R=function(g){return g[g.NONE=0]="NONE",g[g.SINGLE=1]="SINGLE",g[g.MULTIPLE=2]="MULTIPLE",g}(R||(e.EngagementCollectionSource=R={})),q=function(g){return g.BEFORE="before",g.AFTER="after",g.INSIDE_FIRST="insideFirst",g.INSIDE_LAST="insideLast",g}(q||(e.EngagementPlacementPosition=q={})),he=function(g){return g.SHOPIFY_CHECKOUT="shopify_checkout",g.THIRD_PARTY_CHECKOUT="third_party_checkout",g.CART_PAGE="cart_page",g.CART_DRAWER="cart_drawer",g}(he||(e.RedirectBehaviour=he={})),$e=function(g){return g.ONCE_IN_SESSION="ONCE_IN_SESSION",g.ACROSS_SESSIONS="ACROSS_SESSIONS",g}($e||(e.FrequencyType=$e={})),B=function(g){return g.DAYS="DAYS",g.HOURS="HOURS",g.MINUTES="MINUTES",g.SECONDS="SECONDS",g}(B||(e.FrequencyGapUnit=B={})),Z=function(g){return g[g.NONE=0]="NONE",g[g.REJECT_POPUP=1]="REJECT_POPUP",g[g.ACCEPT_POPUP=2]="ACCEPT_POPUP",g[g.GO_TO_URL=4]="GO_TO_URL",g[g.SHARE=5]="SHARE",g[g.KEY_VALUE=100]="KEY_VALUE",g[g.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",g[g.ADD_TO_CART=102]="ADD_TO_CART",g[g.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",g[g.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",g[g.OPEN_CART=105]="OPEN_CART",g[g.SUBMIT_FORM=106]="SUBMIT_FORM",g[g.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",g[g.ADD_BUNDLE=108]="ADD_BUNDLE",g[g.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",g}(Z||(e.ClickActionType=Z={})),z=function(g){return g.POPUP="POPUP",g.PAGE_EMBED="PAGE_EMBED",g.CART_EMBED="CART_EMBED",g.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",g}(z||(e.OnsiteDeliveryType=z={})),Q=function(g){return g.PRODUCT_PROMOTION="PRODUCT_PROMOTION",g.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",g.CART_RECOVERY="CART_RECOVERY",g.ANNOUNCEMENT="ANNOUNCEMENT",g.LEAD_GENERATION="LEAD_GENERATION",g.DATA_COLLECTION="DATA_COLLECTION",g.SALE_PROMOTION="SALE_PROMOTION",g.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",g.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",g.BYOB="BYOB",g.PROGRESS_BAR="PROGRESS_BAR",g.BUY_NOW="BUY_NOW",g.EXPERIMENT="EXPERIMENT",g}(Q||(e.EngagementObjective=Q={})),ge=function(g){return g.COOEE="COOEE",g.KLAVIYO="KLAVIYO",g}(ge||(e.EngagementContentSource=ge={})),je=function(g){return g.ICONS="ICONS",g.TILES="TILES",g}(je||(e.ProgressBarLayout=je={})),xe=function(g){return g.FREE_SHIPPING="FREE_SHIPPING",g.DISCOUNT="DISCOUNT",g.FREE_AUTO_GIFT="FREE_AUTO_GIFT",g.FREE_GIFT_SELECT="FREE_GIFT_SELECT",g}(xe||(e.MilestoneRewardType=xe={}))}),Jo=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PriceRuleType=e.DiscountType=void 0;var t=function(n){return n[n.NONE=0]="NONE",n[n.STATIC=1]="STATIC",n[n.UNIQUE_FLAT=2]="UNIQUE_FLAT",n[n.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",n[n.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",n[n.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",n[n.BXGY=6]="BXGY",n}(t||(e.DiscountType=t={})),r=function(n){return n.FIXED_AMOUNT="fixed_amount",n.PERCENTAGE="percentage",n}(r||(e.PriceRuleType=r={}))}),Uc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayUtils=void 0;var t=class Ah{static of(n,i){return i!==void 0?new Array(n).fill(i):Array.from({length:n},(s,o)=>o)}static remove(n,i){let s=n.indexOf(i);return s===-1?!1:(n.splice(s,1),!0)}static swap(n,i,s){[n[i],n[s]]=[n[s],n[i]]}static sum(n,i){return n.reduce((s,o)=>s+Math.max(i?i(o):+o,0),0)}static unique(n,i){return n.filter((s,o,c)=>c.findIndex(u=>u[i]===s[i])===o)}static shuffle(n){let i=n.length;for(;i!=0;){let s=Math.floor(Math.random()*i);i--,Ah.swap(n,i,s)}}};e.ArrayUtils=t}),Df=ur((e,t)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",d="object",m="string",h="major",y="model",E="name",v="type",_="vendor",D="version",P="architecture",M="console",L="mobile",R="tablet",q="smarttv",he="wearable",$e="embedded",B=500,Z="Amazon",z="Apple",Q="ASUS",ge="BlackBerry",je="Browser",xe="Chrome",g="Edge",Ke="Firefox",ve="Google",vt="Huawei",ae="LG",ie="Microsoft",pt="Motorola",tr="Opera",lr="Samsung",_t="Sharp",Vr="Sony",Hn="Xiaomi",on="Zebra",ei="Facebook",qi="Chromium OS",Gn="Mac OS",$n=" Browser",Et=function(W,ce){var ee={};for(var Ce in W)ce[Ce]&&ce[Ce].length%2===0?ee[Ce]=ce[Ce].concat(W[Ce]):ee[Ce]=W[Ce];return ee},$r=function(W){for(var ce={},ee=0;ee<W.length;ee++)ce[W[ee].toUpperCase()]=W[ee];return ce},Gi=function(W,ce){return typeof W===m?a(ce).indexOf(a(W))!==-1:!1},a=function(W){return W.toLowerCase()},l=function(W){return typeof W===m?W.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(W,ce){if(typeof W===m)return W=W.replace(/^\s\s*/,s),typeof ce===u?W:W.substring(0,B)},T=function(W,ce){for(var ee=0,Ce,Rt,Ot,Te,ne,$t;ee<ce.length&&!ne;){var Yi=ce[ee],cs=ce[ee+1];for(Ce=Rt=0;Ce<Yi.length&&!ne&&Yi[Ce];)if(ne=Yi[Ce++].exec(W),ne)for(Ot=0;Ot<cs.length;Ot++)$t=ne[++Rt],Te=cs[Ot],typeof Te===d&&Te.length>0?Te.length===2?typeof Te[1]==c?this[Te[0]]=Te[1].call(this,$t):this[Te[0]]=Te[1]:Te.length===3?typeof Te[1]===c&&!(Te[1].exec&&Te[1].test)?this[Te[0]]=$t?Te[1].call(this,$t,Te[2]):n:this[Te[0]]=$t?$t.replace(Te[1],Te[2]):n:Te.length===4&&(this[Te[0]]=$t?Te[3].call(this,$t.replace(Te[1],Te[2])):n):this[Te]=$t||n;ee+=2}},A=function(W,ce){for(var ee in ce)if(typeof ce[ee]===d&&ce[ee].length>0){for(var Ce=0;Ce<ce[ee].length;Ce++)if(Gi(ce[ee][Ce],W))return ee===o?n:ee}else if(Gi(ce[ee],W))return ee===o?n:ee;return ce.hasOwnProperty("*")?ce["*"]:W},U={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ie={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[D,[E,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[D,[E,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[E,D],[/opios[\/ ]+([\w\.]+)/i],[D,[E,tr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[D,[E,tr+" GX"]],[/\bopr\/([\w\.]+)/i],[D,[E,tr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[D,[E,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[D,[E,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[E,D],[/quark(?:pc)?\/([-\w\.]+)/i],[D,[E,"Quark"]],[/\bddg\/([\w\.]+)/i],[D,[E,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[D,[E,"UC"+je]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[D,[E,"WeChat"]],[/konqueror\/([\w\.]+)/i],[D,[E,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[D,[E,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[D,[E,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[D,[E,"Smart Lenovo "+je]],[/(avast|avg)\/([\w\.]+)/i],[[E,/(.+)/,"$1 Secure "+je],D],[/\bfocus\/([\w\.]+)/i],[D,[E,Ke+" Focus"]],[/\bopt\/([\w\.]+)/i],[D,[E,tr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[D,[E,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[D,[E,"Dolphin"]],[/coast\/([\w\.]+)/i],[D,[E,tr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[D,[E,"MIUI"+$n]],[/fxios\/([\w\.-]+)/i],[D,[E,Ke]],[/\bqihoobrowser\/?([\w\.]*)/i],[D,[E,"360"]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,"$1Browser"],D],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,"$1"+$n],D],[/samsungbrowser\/([\w\.]+)/i],[D,[E,lr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[D,[E,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[E,"Sogou Mobile"],D],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[E,D],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[E],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[D,E],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[E,ei],D],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[E,D],[/\bgsa\/([\w\.]+) .*safari\//i],[D,[E,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[D,[E,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[D,[E,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,xe+" WebView"],D],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[D,[E,"Android "+je]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[E,D],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[D,[E,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[D,E],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[E,[D,A,U]],[/(webkit|khtml)\/([\w\.]+)/i],[E,D],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[E,"Netscape"],D],[/(wolvic|librewolf)\/([\w\.]+)/i],[E,D],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[D,[E,Ke+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[E,[D,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[E,[D,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[P,"amd64"]],[/(ia32(?=;))/i],[[P,a]],[/((?:i[346]|x)86)[;\)]/i],[[P,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[P,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[P,"armhf"]],[/windows (ce|mobile); ppc;/i],[[P,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[P,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[P,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[P,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[y,[_,lr],[v,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[y,[_,lr],[v,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[_,z],[v,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[_,z],[v,R]],[/(macintosh);/i],[y,[_,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[_,_t],[v,L]],[/(?:honor)([-\w ]+)[;\)]/i],[y,[_,"Honor"],[v,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[y,[_,vt],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[_,vt],[v,L]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[_,"OPPO"],[v,L]],[/\b(opd2\d{3}a?) bui/i],[y,[_,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[_,"Vivo"],[v,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[y,[_,"Realme"],[v,L]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[y,[_,pt],[v,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[_,pt],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[_,ae],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[_,ae],[v,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[y,[_,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[y,/_/g," "],[_,"Nokia"],[v,L]],[/(pixel c)\b/i],[y,[_,ve],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[_,ve],[v,L]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[y,[_,Vr],[v,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[_,Vr],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[_,"OnePlus"],[v,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[_,Z],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[_,Z],[v,L]],[/(playbook);[-\w\),; ]+(rim)/i],[y,_,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[_,ge],[v,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[_,Q],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[_,Q],[v,L]],[/(nexus 9)/i],[y,[_,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[y,/_/g," "],[v,L]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[y,[_,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[_,a],y,[v,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[_,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[_,"Meizu"],[v,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[y,[_,"Ulefone"],[v,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[y,[_,"Energizer"],[v,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[y,[_,"Cat"],[v,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[y,[_,"Smartfren"],[v,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[y,[_,"Nothing"],[v,L]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[_,y,[v,L]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[_,y,[v,R]],[/(surface duo)/i],[y,[_,ie],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[_,"Fairphone"],[v,L]],[/(u304aa)/i],[y,[_,"AT&T"],[v,L]],[/\bsie-(\w*)/i],[y,[_,"Siemens"],[v,L]],[/\b(rct\w+) b/i],[y,[_,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[y,[_,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[y,[_,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[_,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[y,[_,"NuVision"],[v,R]],[/\b(k88) b/i],[y,[_,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[y,[_,"ZTE"],[v,L]],[/\b(gen\d{3}) b.+49h/i],[y,[_,"Swiss"],[v,L]],[/\b(zur\d{3}) b/i],[y,[_,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[y,[_,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],y,[v,R]],[/\b(ns-?\w{0,9}) b/i],[y,[_,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[_,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],y,[v,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],y,[v,L]],[/\b(ph-1) /i],[y,[_,"Essential"],[v,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[_,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[y,[_,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[y,[_,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[y,[_,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[_,y,[v,L]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[_,ie],[v,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[_,on],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[_,on],[v,L]],[/smart-tv.+(samsung)/i],[_,[v,q]],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[_,lr],[v,q]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,ae],[v,q]],[/(apple) ?tv/i],[_,[y,z+" TV"],[v,q]],[/crkey/i],[[y,xe+"cast"],[_,ve],[v,q]],[/droid.+aft(\w+)( bui|\))/i],[y,[_,Z],[v,q]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[_,_t],[v,q]],[/(bravia[\w ]+)( bui|\))/i],[y,[_,Vr],[v,q]],[/(mitv-\w{5}) bui/i],[y,[_,Hn],[v,q]],[/Hbbtv.*(technisat) (.*);/i],[_,y,[v,q]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,p],[y,p],[v,q]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,q]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,y,[v,M]],[/droid.+; (shield) bui/i],[y,[_,"Nvidia"],[v,M]],[/(playstation [345portablevi]+)/i],[y,[_,Vr],[v,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[_,ie],[v,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[y,[_,lr],[v,he]],[/((pebble))app/i],[_,y,[v,he]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[_,z],[v,he]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,he]],[/droid.+; (wt63?0{2,3})\)/i],[y,[_,on],[v,he]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,he]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,y,[v,he]],[/; (quest( \d| pro)?)/i],[y,[_,ei],[v,he]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[v,$e]],[/(aeobc)\b/i],[y,[_,Z],[v,$e]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[y,[v,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[v,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,L]],[/(android[-\w\. ]{0,9});.+buil/i],[y,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[D,[E,g+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[E,D],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[D,[E,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[E,D],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[D,E]],os:[[/microsoft (windows) (vista|xp)/i],[E,D],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[E,[D,A,G]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[D,A,G],[E,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[D,/_/g,"."],[E,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[E,Gn],[D,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[D,E],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[E,D],[/\(bb(10);/i],[D,[E,ge]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[D,[E,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[D,[E,Ke+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[D,[E,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[D,[E,"watchOS"]],[/crkey\/([\d\.]+)/i],[D,[E,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,qi],D],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[E,D],[/(sunos) ?([\w\.\d]*)/i],[[E,"Solaris"],D],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[E,D]]},me=function(W,ce){if(typeof W===d&&(ce=W,W=n),!(this instanceof me))return new me(W,ce).getResult();var ee=typeof r!==u&&r.navigator?r.navigator:n,Ce=W||(ee&&ee.userAgent?ee.userAgent:s),Rt=ee&&ee.userAgentData?ee.userAgentData:n,Ot=ce?Et(Ie,ce):Ie,Te=ee&&ee.userAgent==Ce;return this.getBrowser=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.browser),ne[h]=l(ne[D]),Te&&ee&&ee.brave&&typeof ee.brave.isBrave==c&&(ne[E]="Brave"),ne},this.getCPU=function(){var ne={};return ne[P]=n,T.call(ne,Ce,Ot.cpu),ne},this.getDevice=function(){var ne={};return ne[_]=n,ne[y]=n,ne[v]=n,T.call(ne,Ce,Ot.device),Te&&!ne[v]&&Rt&&Rt.mobile&&(ne[v]=L),Te&&ne[y]=="Macintosh"&&ee&&typeof ee.standalone!==u&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&(ne[y]="iPad",ne[v]=R),ne},this.getEngine=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.engine),ne},this.getOS=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Ot.os),Te&&!ne[E]&&Rt&&Rt.platform&&Rt.platform!="Unknown"&&(ne[E]=Rt.platform.replace(/chrome os/i,qi).replace(/macos/i,Gn)),ne},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ce},this.setUA=function(ne){return Ce=typeof ne===m&&ne.length>B?p(ne,B):ne,this},this.setUA(Ce),this};me.VERSION=i,me.BROWSER=$r([E,D,h]),me.CPU=$r([P]),me.DEVICE=$r([y,_,v,M,L,q,R,he,$e]),me.ENGINE=me.OS=$r([E,D]),typeof e!==u?(typeof t!==u&&t.exports&&(e=t.exports=me),e.UAParser=me):typeof define===c&&define.amd?define(function(){return me}):typeof r!==u&&(r.UAParser=me);var ye=typeof r!==u&&(r.jQuery||r.Zepto);if(ye&&!ye.ua){var Fe=new me;ye.ua=Fe.getResult(),ye.ua.get=function(){return Fe.getUA()},ye.ua.set=function(W){Fe.setUA(W);var ce=Fe.getResult();for(var ee in ce)ye.ua[ee]=ce[ee]}}})(typeof window=="object"?window:e)}),Nf=ur((e,t)=>{"use strict";(function(r){if(typeof e=="object"&&typeof t<"u")t.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function d(y,E){if(!c[y]){if(!o[y]){var v=typeof Ki=="function"&&Ki;if(!E&&v)return v(y,!0);if(m)return m(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var D=c[y]={exports:{}};o[y][0].call(D.exports,function(P){var M=o[y][1][P];return d(M||P)},D,D.exports,s,o,c,u)}return c[y].exports}for(var m=typeof Ki=="function"&&Ki,h=0;h<u.length;h++)d(u[h]);return d}({1:[function(s,o,c){(function(u){"use strict";var d=u.MutationObserver||u.WebKitMutationObserver,m;if(d){var h=0,y=new d(P),E=u.document.createTextNode("");y.observe(E,{characterData:!0}),m=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var v=new u.MessageChannel;v.port1.onmessage=P,m=function(){v.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var L=u.document.createElement("script");L.onreadystatechange=function(){P(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null},u.document.documentElement.appendChild(L)}:m=function(){setTimeout(P,0)};var _,D=[];function P(){_=!0;for(var L,R,q=D.length;q;){for(R=D,D=[],L=-1;++L<q;)R[L]();q=D.length}_=!1}o.exports=M;function M(L){D.push(L)===1&&!_&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function d(){}var m={},h=["REJECTED"],y=["FULFILLED"],E=["PENDING"];o.exports=v;function v(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=E,this.queue=[],this.outcome=void 0,B!==d&&M(this,B)}v.prototype.catch=function(B){return this.then(null,B)},v.prototype.then=function(B,Z){if(typeof B!="function"&&this.state===y||typeof Z!="function"&&this.state===h)return this;var z=new this.constructor(d);if(this.state!==E){var Q=this.state===y?B:Z;D(z,Q,this.outcome)}else this.queue.push(new _(z,B,Z));return z};function _(B,Z,z){this.promise=B,typeof Z=="function"&&(this.onFulfilled=Z,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){m.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){D(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){m.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){D(this.promise,this.onRejected,B)};function D(B,Z,z){u(function(){var Q;try{Q=Z(z)}catch(ge){return m.reject(B,ge)}Q===B?m.reject(B,new TypeError("Cannot resolve promise with itself")):m.resolve(B,Q)})}m.resolve=function(B,Z){var z=L(P,Z);if(z.status==="error")return m.reject(B,z.value);var Q=z.value;if(Q)M(B,Q);else{B.state=y,B.outcome=Z;for(var ge=-1,je=B.queue.length;++ge<je;)B.queue[ge].callFulfilled(Z)}return B},m.reject=function(B,Z){B.state=h,B.outcome=Z;for(var z=-1,Q=B.queue.length;++z<Q;)B.queue[z].callRejected(Z);return B};function P(B){var Z=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof Z=="function")return function(){Z.apply(B,arguments)}}function M(B,Z){var z=!1;function Q(g){z||(z=!0,m.reject(B,g))}function ge(g){z||(z=!0,m.resolve(B,g))}function je(){Z(ge,Q)}var xe=L(je);xe.status==="error"&&Q(xe.value)}function L(B,Z){var z={};try{z.value=B(Z),z.status="success"}catch(Q){z.status="error",z.value=Q}return z}v.resolve=R;function R(B){return B instanceof this?B:m.resolve(new this(d),B)}v.reject=q;function q(B){var Z=new this(d);return m.reject(Z,B)}v.all=he;function he(B){var Z=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,Q=!1;if(!z)return this.resolve([]);for(var ge=new Array(z),je=0,xe=-1,g=new this(d);++xe<z;)Ke(B[xe],xe);return g;function Ke(ve,vt){Z.resolve(ve).then(ae,function(ie){Q||(Q=!0,m.reject(g,ie))});function ae(ie){ge[vt]=ie,++je===z&&!Q&&(Q=!0,m.resolve(g,ge))}}}v.race=$e;function $e(B){var Z=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,Q=!1;if(!z)return this.resolve([]);for(var ge=-1,je=new this(d);++ge<z;)xe(B[ge]);return je;function xe(g){Z.resolve(g).then(function(Ke){Q||(Q=!0,m.resolve(je,Ke))},function(Ke){Q||(Q=!0,m.reject(je,Ke))})}}},{1:1}],3:[function(s,o,c){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f};function d(f,S){if(!(f instanceof S))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function y(){try{if(!h||!h.open)return!1;var f=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!f||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function E(f,S){f=f||[],S=S||{};try{return new Blob(f,S)}catch(O){if(O.name!=="TypeError")throw O;for(var I=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,x=new I,C=0;C<f.length;C+=1)x.append(f[C]);return x.getBlob(S.type)}}typeof Promise>"u"&&s(3);var v=Promise;function _(f,S){S&&f.then(function(I){S(null,I)},function(I){S(I)})}function D(f,S,I){typeof S=="function"&&f.then(S),typeof I=="function"&&f.catch(I)}function P(f){return typeof f!="string"&&(console.warn(f+" used as a key, but it is not a string."),f=String(f)),f}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L="local-forage-detect-blob-support",R=void 0,q={},he=Object.prototype.toString,$e="readonly",B="readwrite";function Z(f){for(var S=f.length,I=new ArrayBuffer(S),x=new Uint8Array(I),C=0;C<S;C++)x[C]=f.charCodeAt(C);return I}function z(f){return new v(function(S){var I=f.transaction(L,B),x=E([""]);I.objectStore(L).put(x,"key"),I.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},I.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),O=navigator.userAgent.match(/Edge\//);S(O||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function Q(f){return typeof R=="boolean"?v.resolve(R):z(f).then(function(S){return R=S,R})}function ge(f){var S=q[f.name],I={};I.promise=new v(function(x,C){I.resolve=x,I.reject=C}),S.deferredOperations.push(I),S.dbReady?S.dbReady=S.dbReady.then(function(){return I.promise}):S.dbReady=I.promise}function je(f){var S=q[f.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function xe(f,S){var I=q[f.name],x=I.deferredOperations.pop();if(x)return x.reject(S),x.promise}function g(f,S){return new v(function(I,x){if(q[f.name]=q[f.name]||Vr(),f.db)if(S)ge(f),f.db.close();else return I(f.db);var C=[f.name];S&&C.push(f.version);var O=h.open.apply(h,C);S&&(O.onupgradeneeded=function(k){var j=O.result;try{j.createObjectStore(f.storeName),k.oldVersion<=1&&j.createObjectStore(L)}catch(H){if(H.name==="ConstraintError")console.warn('The database "'+f.name+'" has been upgraded from version '+k.oldVersion+" to version "+k.newVersion+', but the storage "'+f.storeName+'" already exists.');else throw H}}),O.onerror=function(k){k.preventDefault(),x(O.error)},O.onsuccess=function(){var k=O.result;k.onversionchange=function(j){j.target.close()},I(k),je(f)}})}function Ke(f){return g(f,!1)}function ve(f){return g(f,!0)}function vt(f,S){if(!f.db)return!0;var I=!f.db.objectStoreNames.contains(f.storeName),x=f.version<f.db.version,C=f.version>f.db.version;if(x&&(f.version!==S&&console.warn('The database "'+f.name+`" can't be downgraded from version `+f.db.version+" to version "+f.version+"."),f.version=f.db.version),C||I){if(I){var O=f.db.version+1;O>f.version&&(f.version=O)}return!0}return!1}function ae(f){return new v(function(S,I){var x=new FileReader;x.onerror=I,x.onloadend=function(C){var O=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:O,type:f.type})},x.readAsBinaryString(f)})}function ie(f){var S=Z(atob(f.data));return E([S],{type:f.type})}function pt(f){return f&&f.__local_forage_encoded_blob}function tr(f){var S=this,I=S._initReady().then(function(){var x=q[S._dbInfo.name];if(x&&x.dbReady)return x.dbReady});return D(I,f,f),I}function lr(f){ge(f);for(var S=q[f.name],I=S.forages,x=0;x<I.length;x++){var C=I[x];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return f.db=null,Ke(f).then(function(O){return f.db=O,vt(f)?ve(f):O}).then(function(O){f.db=S.db=O;for(var k=0;k<I.length;k++)I[k]._dbInfo.db=O}).catch(function(O){throw xe(f,O),O})}function _t(f,S,I,x){x===void 0&&(x=1);try{var C=f.db.transaction(f.storeName,S);I(null,C)}catch(O){if(x>0&&(!f.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return v.resolve().then(function(){if(!f.db||O.name==="NotFoundError"&&!f.db.objectStoreNames.contains(f.storeName)&&f.version<=f.db.version)return f.db&&(f.version=f.db.version+1),ve(f)}).then(function(){return lr(f).then(function(){_t(f,S,I,x-1)})}).catch(I);I(O)}}function Vr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(f){var S=this,I={db:null};if(f)for(var x in f)I[x]=f[x];var C=q[I.name];C||(C=Vr(),q[I.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=tr);var O=[];function k(){return v.resolve()}for(var j=0;j<C.forages.length;j++){var H=C.forages[j];H!==S&&O.push(H._initReady().catch(k))}var V=C.forages.slice(0);return v.all(O).then(function(){return I.db=C.db,Ke(I)}).then(function(F){return I.db=F,vt(I,S._defaultConfig.version)?ve(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var Y=0;Y<V.length;Y++){var pe=V[Y];pe!==S&&(pe._dbInfo.db=I.db,pe._dbInfo.version=I.version)}})}function on(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.get(f);V.onsuccess=function(){var F=V.result;F===void 0&&(F=null),pt(F)&&(F=ie(F)),C(F)},V.onerror=function(){O(V.error)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function ei(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.openCursor(),F=1;V.onsuccess=function(){var Y=V.result;if(Y){var pe=Y.value;pt(pe)&&(pe=ie(pe));var Ge=f(pe,Y.key,F++);Ge!==void 0?C(Ge):Y.continue()}else C()},V.onerror=function(){O(V.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function qi(f,S,I){var x=this;f=P(f);var C=new v(function(O,k){var j;x.ready().then(function(){return j=x._dbInfo,he.call(S)==="[object Blob]"?Q(j.db).then(function(H){return H?S:ae(S)}):S}).then(function(H){_t(x._dbInfo,B,function(V,F){if(V)return k(V);try{var Y=F.objectStore(x._dbInfo.storeName);H===null&&(H=void 0);var pe=Y.put(H,f);F.oncomplete=function(){H===void 0&&(H=null),O(H)},F.onabort=F.onerror=function(){var Ge=pe.error?pe.error:pe.transaction.error;k(Ge)}}catch(Ge){k(Ge)}})}).catch(k)});return _(C,I),C}function Gn(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){_t(I._dbInfo,B,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=H.delete(f);j.oncomplete=function(){C()},j.onerror=function(){O(V.error)},j.onabort=function(){var F=V.error?V.error:V.transaction.error;O(F)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function $n(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,B,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.clear();k.oncomplete=function(){x()},k.onabort=k.onerror=function(){var V=H.error?H.error:H.transaction.error;C(V)}}catch(V){C(V)}})}).catch(C)});return _(I,f),I}function Et(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,$e,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.count();H.onsuccess=function(){x(H.result)},H.onerror=function(){C(H.error)}}catch(V){C(V)}})}).catch(C)});return _(I,f),I}function $r(f,S){var I=this,x=new v(function(C,O){if(f<0){C(null);return}I.ready().then(function(){_t(I._dbInfo,$e,function(k,j){if(k)return O(k);try{var H=j.objectStore(I._dbInfo.storeName),V=!1,F=H.openKeyCursor();F.onsuccess=function(){var Y=F.result;if(!Y){C(null);return}f===0||V?C(Y.key):(V=!0,Y.advance(f))},F.onerror=function(){O(F.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Gi(f){var S=this,I=new v(function(x,C){S.ready().then(function(){_t(S._dbInfo,$e,function(O,k){if(O)return C(O);try{var j=k.objectStore(S._dbInfo.storeName),H=j.openKeyCursor(),V=[];H.onsuccess=function(){var F=H.result;if(!F){x(V);return}V.push(F.key),F.continue()},H.onerror=function(){C(H.error)}}catch(F){C(F)}})}).catch(C)});return _(I,f),I}function a(f,S){S=M.apply(this,arguments);var I=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||I.name,f.storeName=f.storeName||I.storeName);var x=this,C;if(!f.name)C=v.reject("Invalid arguments");else{var O=f.name===I.name&&x._dbInfo.db,k=O?v.resolve(x._dbInfo.db):Ke(f).then(function(j){var H=q[f.name],V=H.forages;H.db=j;for(var F=0;F<V.length;F++)V[F]._dbInfo.db=j;return j});f.storeName?C=k.then(function(j){if(j.objectStoreNames.contains(f.storeName)){var H=j.version+1;ge(f);var V=q[f.name],F=V.forages;j.close();for(var Y=0;Y<F.length;Y++){var pe=F[Y];pe._dbInfo.db=null,pe._dbInfo.version=H}var Ge=new v(function(Ae,ft){var We=h.open(f.name,H);We.onerror=function(Ht){var Dc=We.result;Dc.close(),ft(Ht)},We.onupgradeneeded=function(){var Ht=We.result;Ht.deleteObjectStore(f.storeName)},We.onsuccess=function(){var Ht=We.result;Ht.close(),Ae(Ht)}});return Ge.then(function(Ae){V.db=Ae;for(var ft=0;ft<F.length;ft++){var We=F[ft];We._dbInfo.db=Ae,je(We._dbInfo)}}).catch(function(Ae){throw(xe(f,Ae)||v.resolve()).catch(function(){}),Ae})}}):C=k.then(function(j){ge(f);var H=q[f.name],V=H.forages;j.close();for(var F=0;F<V.length;F++){var Y=V[F];Y._dbInfo.db=null}var pe=new v(function(Ge,Ae){var ft=h.deleteDatabase(f.name);ft.onerror=function(){var We=ft.result;We&&We.close(),Ae(ft.error)},ft.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},ft.onsuccess=function(){var We=ft.result;We&&We.close(),Ge(We)}});return pe.then(function(Ge){H.db=Ge;for(var Ae=0;Ae<V.length;Ae++){var ft=V[Ae];je(ft._dbInfo)}}).catch(function(Ge){throw(xe(f,Ge)||v.resolve()).catch(function(){}),Ge})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:Hn,_support:y(),iterate:ei,getItem:on,setItem:qi,removeItem:Gn,clear:$n,length:Et,key:$r,keys:Gi,dropInstance:a};function p(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,G="__lfsc__:",Ie=G.length,me="arbf",ye="blob",Fe="si08",W="ui08",ce="uic8",ee="si16",Ce="si32",Rt="ur16",Ot="ui32",Te="fl32",ne="fl64",$t=Ie+me.length,Yi=Object.prototype.toString;function cs(f){var S=f.length*.75,I=f.length,x,C=0,O,k,j,H;f[f.length-1]==="="&&(S--,f[f.length-2]==="="&&S--);var V=new ArrayBuffer(S),F=new Uint8Array(V);for(x=0;x<I;x+=4)O=T.indexOf(f[x]),k=T.indexOf(f[x+1]),j=T.indexOf(f[x+2]),H=T.indexOf(f[x+3]),F[C++]=O<<2|k>>4,F[C++]=(k&15)<<4|j>>2,F[C++]=(j&3)<<6|H&63;return V}function Qo(f){var S=new Uint8Array(f),I="",x;for(x=0;x<S.length;x+=3)I+=T[S[x]>>2],I+=T[(S[x]&3)<<4|S[x+1]>>4],I+=T[(S[x+1]&15)<<2|S[x+2]>>6],I+=T[S[x+2]&63];return S.length%3===2?I=I.substring(0,I.length-1)+"=":S.length%3===1&&(I=I.substring(0,I.length-2)+"=="),I}function np(f,S){var I="";if(f&&(I=Yi.call(f)),f&&(I==="[object ArrayBuffer]"||f.buffer&&Yi.call(f.buffer)==="[object ArrayBuffer]")){var x,C=G;f instanceof ArrayBuffer?(x=f,C+=me):(x=f.buffer,I==="[object Int8Array]"?C+=Fe:I==="[object Uint8Array]"?C+=W:I==="[object Uint8ClampedArray]"?C+=ce:I==="[object Int16Array]"?C+=ee:I==="[object Uint16Array]"?C+=Rt:I==="[object Int32Array]"?C+=Ce:I==="[object Uint32Array]"?C+=Ot:I==="[object Float32Array]"?C+=Te:I==="[object Float64Array]"?C+=ne:S(new Error("Failed to get type for BinaryArray"))),S(C+Qo(x))}else if(I==="[object Blob]"){var O=new FileReader;O.onload=function(){var k=A+f.type+"~"+Qo(this.result);S(G+ye+k)},O.readAsArrayBuffer(f)}else try{S(JSON.stringify(f))}catch(k){console.error("Couldn't convert value into a JSON string: ",f),S(null,k)}}function ip(f){if(f.substring(0,Ie)!==G)return JSON.parse(f);var S=f.substring($t),I=f.substring(Ie,$t),x;if(I===ye&&U.test(S)){var C=S.match(U);x=C[1],S=S.substring(C[0].length)}var O=cs(S);switch(I){case me:return O;case ye:return E([O],{type:x});case Fe:return new Int8Array(O);case W:return new Uint8Array(O);case ce:return new Uint8ClampedArray(O);case ee:return new Int16Array(O);case Rt:return new Uint16Array(O);case Ce:return new Int32Array(O);case Ot:return new Uint32Array(O);case Te:return new Float32Array(O);case ne:return new Float64Array(O);default:throw new Error("Unkown type: "+I)}}var za={serialize:np,deserialize:ip,stringToBuffer:cs,bufferToString:Qo};function Ih(f,S,I,x){f.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],I,x)}function sp(f){var S=this,I={db:null};if(f)for(var x in f)I[x]=typeof f[x]!="string"?f[x].toString():f[x];var C=new v(function(O,k){try{I.db=openDatabase(I.name,String(I.version),I.description,I.size)}catch(j){return k(j)}I.db.transaction(function(j){Ih(j,I,function(){S._dbInfo=I,O()},function(H,V){k(V)})},k)});return I.serializer=za,C}function Vn(f,S,I,x,C,O){f.executeSql(I,x,C,function(k,j){j.code===j.SYNTAX_ERR?k.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(H,V){V.rows.length?O(H,j):Ih(H,S,function(){H.executeSql(I,x,C,O)},O)},O):O(k,j)},O)}function ap(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT * FROM "+k.storeName+" WHERE key = ? LIMIT 1",[f],function(H,V){var F=V.rows.length?V.rows.item(0).value:null;F&&(F=k.serializer.deserialize(F)),C(F)},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function cp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT * FROM "+k.storeName,[],function(H,V){for(var F=V.rows,Y=F.length,pe=0;pe<Y;pe++){var Ge=F.item(pe),Ae=Ge.value;if(Ae&&(Ae=k.serializer.deserialize(Ae)),Ae=f(Ae,Ge.key,pe+1),Ae!==void 0){C(Ae);return}}C()},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function Th(f,S,I,x){var C=this;f=P(f);var O=new v(function(k,j){C.ready().then(function(){S===void 0&&(S=null);var H=S,V=C._dbInfo;V.serializer.serialize(S,function(F,Y){Y?j(Y):V.db.transaction(function(pe){Vn(pe,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[f,F],function(){k(H)},function(Ge,Ae){j(Ae)})},function(pe){if(pe.code===pe.QUOTA_ERR){if(x>0){k(Th.apply(C,[f,H,I,x-1]));return}j(pe)}})})}).catch(j)});return _(O,I),O}function lp(f,S,I){return Th.apply(this,[f,S,I,1])}function up(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[f],function(){C()},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function pp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"DELETE FROM "+O.storeName,[],function(){x()},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function gp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(j,H){var V=H.rows.item(0).c;x(V)},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function yp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Vn(j,k,"SELECT key FROM "+k.storeName+" WHERE id = ? LIMIT 1",[f+1],function(H,V){var F=V.rows.length?V.rows.item(0).key:null;C(F)},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function vp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Vn(k,O,"SELECT key FROM "+O.storeName,[],function(j,H){for(var V=[],F=0;F<H.rows.length;F++)V.push(H.rows.item(F).key);x(V)},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function bp(f){return new v(function(S,I){f.transaction(function(x){x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,O){for(var k=[],j=0;j<O.rows.length;j++)k.push(O.rows.item(j).name);S({db:f,storeNames:k})},function(C,O){I(O)})},function(x){I(x)})})}function wp(f,S){S=M.apply(this,arguments);var I=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||I.name,f.storeName=f.storeName||I.storeName);var x=this,C;return f.name?C=new v(function(O){var k;f.name===I.name?k=x._dbInfo.db:k=openDatabase(f.name,"","",0),f.storeName?O({db:k,storeNames:[f.storeName]}):O(bp(k))}).then(function(O){return new v(function(k,j){O.db.transaction(function(H){function V(Ge){return new v(function(Ae,ft){H.executeSql("DROP TABLE IF EXISTS "+Ge,[],function(){Ae()},function(We,Ht){ft(Ht)})})}for(var F=[],Y=0,pe=O.storeNames.length;Y<pe;Y++)F.push(V(O.storeNames[Y]));v.all(F).then(function(){k()}).catch(function(Ge){j(Ge)})},function(H){j(H)})})}):C=v.reject("Invalid arguments"),_(C,S),C}var _p={_driver:"webSQLStorage",_initStorage:sp,_support:p(),iterate:cp,getItem:ap,setItem:lp,removeItem:up,clear:pp,length:gp,key:yp,keys:vp,dropInstance:wp};function Ep(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ch(f,S){var I=f.name+"/";return f.storeName!==S.storeName&&(I+=f.storeName+"/"),I}function Sp(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function Ip(){return!Sp()||localStorage.length>0}function Tp(f){var S=this,I={};if(f)for(var x in f)I[x]=f[x];return I.keyPrefix=Ch(f,S._defaultConfig),Ip()?(S._dbInfo=I,I.serializer=za,v.resolve()):v.reject()}function Cp(f){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var O=localStorage.key(C);O.indexOf(x)===0&&localStorage.removeItem(O)}});return _(I,f),I}function Np(f,S){var I=this;f=P(f);var x=I.ready().then(function(){var C=I._dbInfo,O=localStorage.getItem(C.keyPrefix+f);return O&&(O=C.serializer.deserialize(O)),O});return _(x,S),x}function Dp(f,S){var I=this,x=I.ready().then(function(){for(var C=I._dbInfo,O=C.keyPrefix,k=O.length,j=localStorage.length,H=1,V=0;V<j;V++){var F=localStorage.key(V);if(F.indexOf(O)===0){var Y=localStorage.getItem(F);if(Y&&(Y=C.serializer.deserialize(Y)),Y=f(Y,F.substring(k),H++),Y!==void 0)return Y}}});return _(x,S),x}function xp(f,S){var I=this,x=I.ready().then(function(){var C=I._dbInfo,O;try{O=localStorage.key(f)}catch{O=null}return O&&(O=O.substring(C.keyPrefix.length)),O});return _(x,S),x}function Op(f){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo,C=localStorage.length,O=[],k=0;k<C;k++){var j=localStorage.key(k);j.indexOf(x.keyPrefix)===0&&O.push(j.substring(x.keyPrefix.length))}return O});return _(I,f),I}function Ap(f){var S=this,I=S.keys().then(function(x){return x.length});return _(I,f),I}function Pp(f,S){var I=this;f=P(f);var x=I.ready().then(function(){var C=I._dbInfo;localStorage.removeItem(C.keyPrefix+f)});return _(x,S),x}function Rp(f,S,I){var x=this;f=P(f);var C=x.ready().then(function(){S===void 0&&(S=null);var O=S;return new v(function(k,j){var H=x._dbInfo;H.serializer.serialize(S,function(V,F){if(F)j(F);else try{localStorage.setItem(H.keyPrefix+f,V),k(O)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(Y),j(Y)}})})});return _(C,I),C}function kp(f,S){if(S=M.apply(this,arguments),f=typeof f!="function"&&f||{},!f.name){var I=this.config();f.name=f.name||I.name,f.storeName=f.storeName||I.storeName}var x=this,C;return f.name?C=new v(function(O){f.storeName?O(Ch(f,x._defaultConfig)):O(f.name+"/")}).then(function(O){for(var k=localStorage.length-1;k>=0;k--){var j=localStorage.key(k);j.indexOf(O)===0&&localStorage.removeItem(j)}}):C=v.reject("Invalid arguments"),_(C,S),C}var Lp={_driver:"localStorageWrapper",_initStorage:Tp,_support:Ep(),iterate:Dp,getItem:Np,setItem:Rp,removeItem:Pp,clear:Cp,length:Ap,key:xp,keys:Op,dropInstance:kp},Up=function(f,S){return f===S||typeof f=="number"&&typeof S=="number"&&isNaN(f)&&isNaN(S)},Mp=function(f,S){for(var I=f.length,x=0;x<I;){if(Up(f[x],S))return!0;x++}return!1},Nh=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},to={},Dh={},zi={INDEXEDDB:l,WEBSQL:_p,LOCALSTORAGE:Lp},Bp=[zi.INDEXEDDB._driver,zi.WEBSQL._driver,zi.LOCALSTORAGE._driver],Xo=["dropInstance"],Qa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Xo),$p={description:"",driver:Bp.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function jp(f,S){f[S]=function(){var I=arguments;return f.ready().then(function(){return f[S].apply(f,I)})}}function Nc(){for(var f=1;f<arguments.length;f++){var S=arguments[f];if(S)for(var I in S)S.hasOwnProperty(I)&&(Nh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var Fp=function(){function f(S){d(this,f);for(var I in zi)if(zi.hasOwnProperty(I)){var x=zi[I],C=x._driver;this[I]=C,to[C]||this.defineDriver(x)}this._defaultConfig=Nc({},$p),this._config=Nc({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return f.prototype.config=function(S){if((typeof S>"u"?"undefined":u(S))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var I in S){if(I==="storeName"&&(S[I]=S[I].replace(/\W/g,"_")),I==="version"&&typeof S[I]!="number")return new Error("Database version must be a number.");this._config[I]=S[I]}return"driver"in S&&S.driver?this.setDriver(this._config.driver):!0}else return typeof S=="string"?this._config[S]:this._config},f.prototype.defineDriver=function(S,I,x){var C=new v(function(O,k){try{var j=S._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!S._driver){k(H);return}for(var V=Qa.concat("_initStorage"),F=0,Y=V.length;F<Y;F++){var pe=V[F],Ge=!Mp(Xo,pe);if((Ge||S[pe])&&typeof S[pe]!="function"){k(H);return}}var Ae=function(){for(var We=function(Hp){return function(){var qp=new Error("Method "+Hp+" is not implemented by the current driver"),xh=v.reject(qp);return _(xh,arguments[arguments.length-1]),xh}},Ht=0,Dc=Xo.length;Ht<Dc;Ht++){var Oc=Xo[Ht];S[Oc]||(S[Oc]=We(Oc))}};Ae();var ft=function(We){to[j]&&console.info("Redefining LocalForage driver: "+j),to[j]=S,Dh[j]=We,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(ft,k):ft(!!S._support):ft(!0)}catch(We){k(We)}});return D(C,I,x),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(S,I,x){var C=to[S]?v.resolve(to[S]):v.reject(new Error("Driver not found."));return D(C,I,x),C},f.prototype.getSerializer=function(S){var I=v.resolve(za);return D(I,S),I},f.prototype.ready=function(S){var I=this,x=I._driverSet.then(function(){return I._ready===null&&(I._ready=I._initDriver()),I._ready});return D(x,S,S),x},f.prototype.setDriver=function(S,I,x){var C=this;Nh(S)||(S=[S]);var O=this._getSupportedDrivers(S);function k(){C._config.driver=C.driver()}function j(F){return C._extend(F),k(),C._ready=C._initStorage(C._config),C._ready}function H(F){return function(){var Y=0;function pe(){for(;Y<F.length;){var Ge=F[Y];return Y++,C._dbInfo=null,C._ready=null,C.getDriver(Ge).then(j).catch(pe)}k();var Ae=new Error("No available storage method found.");return C._driverSet=v.reject(Ae),C._driverSet}return pe()}}var V=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=V.then(function(){var F=O[0];return C._dbInfo=null,C._ready=null,C.getDriver(F).then(function(Y){C._driver=Y._driver,k(),C._wrapLibraryMethodsWithReady(),C._initDriver=H(O)})}).catch(function(){k();var F=new Error("No available storage method found.");return C._driverSet=v.reject(F),C._driverSet}),D(this._driverSet,I,x),this._driverSet},f.prototype.supports=function(S){return!!Dh[S]},f.prototype._extend=function(S){Nc(this,S)},f.prototype._getSupportedDrivers=function(S){for(var I=[],x=0,C=S.length;x<C;x++){var O=S[x];this.supports(O)&&I.push(O)}return I},f.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,I=Qa.length;S<I;S++)jp(this,Qa[S])},f.prototype.createInstance=function(S){return new f(S)},f}(),Vp=new Fp;o.exports=Vp},{3:3}]},{},[4])(4)})}),ti=ur(e=>{"use strict";var t=e&&e.__awaiter||function(n,i,s,o){function c(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function m(E){try{y(o.next(E))}catch(v){d(v)}}function h(E){try{y(o.throw(E))}catch(v){d(v)}}function y(E){E.done?u(E.value):c(E.value).then(m,h)}y((o=o.apply(n,i||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.JSUtils=void 0;var r=class{static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static sleep(n){return t(this,void 0,void 0,function*(){return new Promise(i=>setTimeout(i,n))})}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,i){return i.reduce((s,o)=>(n.hasOwnProperty(o)&&n[o]!=null&&s.push({[o]:n[o]}),s),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((i,s)=>(n[s]!==null&&n[s]!==void 0&&(i[s]=n[s]),i),{})}static stringify(n){return JSON.stringify(n,function(i,s){return s===void 0?null:s})}};e.JSUtils=r,r.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)}),Zu=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URLBuilder=void 0;var t=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();e.URLBuilder=t}),oh=ur((e,t)=>{"use strict";(function(r,n){typeof e=="object"&&typeof t<"u"?t.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(e,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,d){var m=o.retries,h=o.retryDelay,y=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))m=d.retries;else throw new i("retries must be a positive integer");if(d&&d.retryDelay!==void 0)if(n(d.retryDelay)||typeof d.retryDelay=="function")h=d.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(d&&d.retryOn)if(Array.isArray(d.retryOn)||typeof d.retryOn=="function")y=d.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(E,v){var _=function(P){var M=typeof Request<"u"&&u instanceof Request?u.clone():u;s(M,d).then(function(L){if(Array.isArray(y)&&y.indexOf(L.status)===-1)E(L);else if(typeof y=="function")try{return Promise.resolve(y(P,null,L)).then(function(R){R?D(P,null,L):E(L)}).catch(v)}catch(R){v(R)}else P<m?D(P,null,L):E(L)}).catch(function(L){if(typeof y=="function")try{Promise.resolve(y(P,L,null)).then(function(R){R?D(P,L,null):v(L)}).catch(function(R){v(R)})}catch(R){v(R)}else P<m?D(P,L,null):v(L)})};function D(P,M,L){var R=typeof h=="function"?h(P,M,L):h;setTimeout(function(){_(++P)},R)}_(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),hp="9.8.2",N=class Ac{static SDK_VERSION=hp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let t=Ac.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ac.SDK_VERSION_CODE=parseInt(t,10)}},mt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.js`},Pt=Se(sn()),w=class{static log(...e){Pt.default.info(...e)}static debug(...e){Pt.default.debug(...e)}static error(...e){Pt.default.error(...e)}static warn(...e){Pt.default.warn(...e)}static info(...e){Pt.default.info(...e)}static trace(...e){Pt.default.trace(...e)}static configure(e=N.LOG_PREFIX){Pt.default.useDefaults({formatter:function(r){r.unshift(`${e} (v${N.SDK_VERSION}):`)}});let t=this.getDebugParam();(t==="1"||t==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Pt.default.setLevel(Pt.default[localStorage.cooeeLogLevel]):Pt.default.setLevel(mt.debug?Pt.default.TRACE:Pt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
font-size: 14px;
|
|
4
4
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|
|
@@ -67,4 +67,4 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
|
67
67
|
<span class="${n}"
|
|
68
68
|
style="background-color: ${t.pagination.color?.rgba};">
|
|
69
69
|
</span>
|
|
70
|
-
`},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},autoplay:t.autoplay?.enabled?{delay:t.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return e.style.setProperty("--swiper-navigation-size",`${t.navigation.size}px`),r}function mc(e,t,r){let n={color:e.navigation.color?.rgba};return e.pagination.enabled&&(n.transform="translateY(-25%)"),$("div",{class:"swiper-container",ref:t,children:[$("div",{class:"swiper-wrapper",children:r()}),e.navigation.enabled&&$("div",{class:"swiper-button-next",style:n,children:$("span",{})}),e.navigation.enabled&&$("div",{class:"swiper-button-prev",style:n,children:$("span",{})}),e.pagination.enabled&&$("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:e.pagination.color?.rgba}})]})}var jo=class extends Ne{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&at.loadSwiperScript().then(()=>{this.swiperInstance=fc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let t;if(this.configuration.disp===2){let r=i=>{this.swiperRef=i},n=()=>e?.map(i=>$("div",{class:"swiper-slide",children:this.getProductFragment(i)}));t=$("div",{style:te(b({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:mc(this.configuration,r,n)})}else t=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((r,n)=>this.getProductFragment(r,n!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(t.flexDirection==="row"){if(e)t.maxWidth="100%",t.overflowY="auto";else if(this.configuration.disp===1){let r=this.props.triggerContext.triggerData,n=r.items.length,i;r.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?n*2-1:n:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`}}return t}getProductFragment(e,t=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}},Vo=class extends Ne{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){at.loadSwiperScript().then(()=>{this.swiperInstance=fc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,t=n=>{this.swiperRef=n},r=()=>e.values?.map(n=>$("div",{class:"swiper-slide",onClick:i=>this.onClick(i,{clickAction:this.getClickAction(n)}),children:this.renderElement(n)}));return mc(e.conf,t,r)}getComponentStyles(){return{}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return $(Fr,{element:t,triggerContext:this.props.triggerContext});case 4:return $(Hr,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:w.warn("Unknown slide type for carousal")}}valueAddedSlide(e,t){let r=JSON.stringify(e),n=bt.render(r,{form:t});return kt.getParsedElement(JSON.parse(n))}getClickAction(e){let t=b({},this.props.element.clc),r=JSON.stringify(t),n=bt.render(r,{form:e});return JSON.parse(n)}},rn=class extends Ne{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),lt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let t=e;return $(Hr,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return $(Mo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?$(Un,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return $(Ft,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return $(Fr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(jo,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $(Vo,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},Wo=class extends Ne{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){lt(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return $(fr,{children:[$("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:e=>{this.onClick(e,{clickAction:this.clickAction})},children:$(rn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&$("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e,t){if(this.isClickable)return super.onClick(e,t)}},Nt=class ss{constructor(t){this.engagementTrigger=t,this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=ue.get();widgetAPIService=se.get(cr);safeHTTPService=se.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(t=>Le.getInstance().captureException(t,b({},this.engagementTrigger.sentryContext())))}destroy(){w.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(t=>{t?.disconnect&&t.disconnect()}),this.rootContainer?.remove(),ss.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let t=await this.getVariation();this.handleVariationResponse(t)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){w.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(t){return this.engagementTrigger.shortID===t.shortID}update(t){_h.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(t.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){w.log(`${this.engagementTrigger} already has required data to render widget`);return}let t=await this.observeWidgetContainerInViewport();this.handleVariationResponse(t)}handleVariationResponse(t){t&&(w.log(`${this.engagementTrigger} visitor has been assigned to variation ${t.variation}`),t.items?.length&&(this.engagementTrigger.items=t.items.map(r=>new At(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new At(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new At(t.bundleFrom)),t.discount&&(this.engagementTrigger.discount=t.discount),t.placement&&(this.triggerContext.triggerData.placement=t.placement),t.props&&Eh.JSUtils.hasKeys(t.props)&&(this.engagementTrigger.props=b(b({},this.engagementTrigger.props),t.props)),this.triggerContext.triggerData.widget=this.widget=new bi(t.widget),this.triggerContext.triggerData.contentID=t.contentID,this.triggerContext.triggerData.variation=this.variation=t.variation,this.triggerContext.triggerData.placement=t.placement,this.triggerContext.triggerData.manipulation=t.manipulation,this.triggerContext.triggerData.content=t.content,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){ss.renderedEngagements.push(this)}async getVariation(){w.log(`${this.engagementTrigger} get variation`);let t={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(t)}catch(r){w.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){w.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let t=window.innerHeight*.3,r={root:null,rootMargin:`-${t}px 0px ${t}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((s,o)=>{s.forEach(async c=>{if(c.isIntersecting){w.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let u=await this.getVariation();n(u),o.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=Pn(window,"scroll").pipe(ar(ss.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(ss.engagementIDsWithTrackedDisplay.has(t)||!await this.isInViewport())return;let r={};this.triggerContext.triggerData.items?.length&&(r.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,i=new Ee(n,r,this.engagementTrigger);i.name===N.EVENT_CAMPAIGN_HOLDOUT&&(i.trigger.holdout=!0),this.safeHTTPService.sendEvent(i),ss.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let t=(await this.getWidgetContainer())?.getBoundingClientRect();if(!t)return!1;let r=window.innerHeight||document.documentElement.clientHeight,n=(Math.min(t.bottom,r)-Math.max(t.top,0))*t.width,i=t.width*t.height,s=n/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(t){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(t);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(t){let r=this.engagementTrigger.placement;if(!r?.selector)return w.warn(`${this.engagementTrigger} does not have a selector`),null;let n=r.selector,i;if(n.includes(N.SHADOW_SPLITTER)){let u=n.split(N.SHADOW_SPLITTER),d=Pe.get().website.commonCSS;i=(await J.retrySelector(u[0].trim()))?.shadowRoot,n=u[1].trim(),i&&(at.injectRawCSS(d,i),at.injectStylesheet(mt.styleURL,i))}w.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let s=await J.retrySelector(n,10,i??document);if(!s)return w.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let o=this.generateParentElementID(),c=this.getParentElement(o);if(!t)return c;switch(r.position){case Go.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Go.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Go.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Go.EngagementPlacementPosition.AFTER:default:s.parentElement?.insertBefore(c,s.nextSibling)}return c}async startRendering(){let t;try{t=await Ui.refreshItems(this.engagementTrigger)}catch(r){w.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!this.engagementTrigger.isCollectionPromoted()&&!t?.length&&this.engagementTrigger.isProductPromoted()){w.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=t,this.renderContainer()}getParentElement(t,r=document){let n=r.getElementById(t);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let t=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let r=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),n=Pe.get().website.commonCSS;at.injectRawCSS(n,r),at.injectStylesheet(mt.styleURL,r),at.injectSwiperCSS(r),t=r}lf(Gc(Wo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),t),this.addToRendered()}updateItems(t,r){let n=this.getItemDiff(t,r),i=this.getItemDiff(r,t);r.push(...n);for(let s of i)vh.ArrayUtils.remove(r,s)}getItemDiff(t,r){return t.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}},Dr=class Yh extends Nt{static renderedEngagements=[];constructor(t){super(t)}addToRendered(){Yh.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let t=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(t+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),t}async checkAndSendEvent(){if(!ze.get().isOpen()&&this.runtimeData.pageName!=="cart"){w.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}},dc=class Xh{constructor(t,r){this.engagementTrigger=t,this.element=r,this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(t){let r=t.placement;if(!r?.selector){w.warn(`No placement available for ${t.objective}`,t.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){w.warn(`No placement found for ${t.objective}`,t.shortID);return}for(let i of n)new Xh(t,i).render()}render(){let t=this.findCartItemFromHTMLElement();if(!t||this.engagementTrigger.skipSubscribedItems&&t.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===t.id.toString());if(!n)return;let i=new Sr(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let m of i.sellingPlans??[])m.mID===s.id.toString()&&(m.isSelected=!0,i.changeSellingPlan(m));let o=new At(r);o.vars=[i],o.selectedOrFirstVariant.value=i;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(c);let u=new xt(this.engagementTrigger);u.placement.selector=`.${c}`,u.items=[o];let d=new Dr(u);d.renderSilently(),this.watchForCartItemDeletion(d,c)}watchForCartItemDeletion(t,r){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{o===this.element&&(w.debug(`${r} has been removed`),t.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let t=this.element.innerHTML;return this.cartItems.find(r=>{if(!(t.includes(r.url)||t.includes(r.variant_id))&&(!t.includes(r.product_title)||r.variant_title&&!t.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!t.includes(n))})}},Sh=Se(Rr()),hc=class extends Dr{ctaListener=new tn;constructor(e){super(e),Cr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Qu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),t=[...this.engagementTrigger.progressBarConfig.milestones];for(let r of t){if(e.amount<r.minValue)break;if(w.log("Current milestone",r),r.rewardType===Sh.MilestoneRewardType.FREE_AUTO_GIFT){let n=r.items[0],i=e.items.find(s=>s.vID===n.vID||s.mID===n.mID);if(i)w.log(`Item(vID:${n.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(i,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});else{let s=await this.ctaListener.performAddToCart([n],this.engagementTrigger);ze.get().refreshUI(s,!1)}}}}async removeOtherFreeGifts(e){let t=(await de.getCurrent().getNormalisedCart()).items.filter(r=>r.vID!==e?.vID&&r.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(t.length)for(let r of t)await this.ctaListener.performUpdate(r,{quantity:0})}},gc=class extends Nt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.triggerContext=this.triggerContext,e.addEventListener("sendEvent",t=>{let r=t.detail;this.safeHTTPService.sendEvent(r)}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}},bh=Se(ti()),yc=class extends Nt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(N.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let t=this.engagementTrigger,r=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,n=e.detail;if(!bh.JSUtils.hasKeys(n)){w.error(`No detail received for ${r}`);return}w.log("Detail received for BYOB",n);let i=n.campaignID??n.campaignId??n.campaign_id;if(i!==t.shortID&&i!==t.engagementID){w.warn(`Current ${r} is not BYOB. Received: ${i}`);return}let s=n.items;if(!s?.length)return;let o=s.map(c=>new dt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new ki(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},Hi=class{runtimeData=ue.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let t=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let r of e)w.log(`\u{1F4E3} ${r} received as cart embed`),!this.findAndUpdateCurrent(r,t)&&(w.log(`${r} is new`),r.isProgressBar()?new hc(r).renderSilently():r.isSubscriptionUpsell()?dc.renderCartUpsell(r):new Dr(r).renderSilently());this.removeOldWidgets(t)}processPageWidgetResponse(e){let t=[...Nt.renderedEngagements];Nt.renderedEngagements.length=0;for(let r of e)w.log(`\u{1F4E3} ${r} received as page embed`),!this.findAndUpdateCurrent(r,t)&&(w.log(`${r} is new`),r.isShoppableVideo()?new gc(r).renderSilently():r.isBYOB()?new yc(r).renderSilently():new Nt(r).renderSilently());this.removeOldWidgets(t)}findAndUpdateCurrent(e,t){let r=t.findIndex(n=>n.isSameTrigger(e));return r<0||e.isSubscriptionUpsell()?!1:(t[r].update(e),t[r].renderSilently(),t.splice(r,1),!0)}removeOldWidgets(e){for(let t of e)t.destroy()}},$i=class{runtimeData=ue.get();httpService=se.get(yt);sessionManager=se.get(qe);constructor(){}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),e.locale=this.runtimeData.locale,await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await de.getCurrent().getNormalisedCart()}catch(i){w.error("Error fetching Shopify cart before sending widget call",i)}let t=new URLSearchParams(location.search),r=t.get("cooee-preview");r?e.previewIDs=r.trim().split(",").filter(i=>Number.isInteger(+i)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let n=t.get("cooee-variant");return n?e.previewVariant=n:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}async addSessionContext(e){let t=await this.sessionManager.checkSessionAndGetContext();e.sessionID=t[0],e.sessionNumber=t[1],e.landingPage=t[2],e.page=Tr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),t=[];return e.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&t.push(n)}),t}},cr=class zh extends $i{static INSTANCE;loadWidgetsSubject=new Dt;constructor(){super(),this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(t=>w.error("Unable to initiate cart widgets",t)),this.loadPageWidgets().catch(t=>w.error("Unable to initiate page widgets",t))}),Cr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zh),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(t=>w.error("Unable to initiate load page widgets",t))})}loadCartWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(t=>w.error("Unable to initiate cart widgets",t))})}loadWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let t=await this.getWidgetProps();w.log("Load widgets",t),this.httpService.post("/v1/engagement/page-widgets",t).then(async r=>{let n=r.widgets.map(i=>new xt(i));new Hi().processPageWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async loadCartWidgets(){let t=await this.getWidgetProps();w.log("Load cart widgets",t),this.httpService.post("/v1/engagement/cart-widgets",t).then(async r=>{let n=r.widgets.map(i=>new xt(i));new Hi().processCartWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async getVariation(t){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",b(b({},t),r))}renderCachedCartWidgets(){new Hi().processCartWidgetResponse(this.runtimeData.cartEngagements)}},vc=class{eventAPIService;constructor(){this.eventAPIService=se.get(nn)}processResponse(e){for(let t of e)t.experimentConfig&&(this.runExperiment(t),this.trackExperimentRan(t));document.querySelector("#lc-hide-body")?.remove()}async runExperiment(e){let t=e.experimentConfig?.experiments;if(!t?.length){w.log("Nothing to experiment",e.toString());return}for(let r of t){if(!r.cssSelector){w.debug("No CSS Selector available",e.toString());continue}let n;try{n=await J.retrySelectors(r.cssSelector)}catch{w.error("Fail to get CSS selector for experiment",e.toString());return}if(!n?.length)return;for(let i of n)Object.assign(i.style,r.style),r.type==="TEXT"&&r.text&&(i.innerHTML=r.text)}}trackExperimentRan(e){this.eventAPIService.trackExperiment({name:N.EVENT_EXPERIMENT_START,experiment:new Zr(e)}).catch(t=>{w.error("Fail to track experiment",t)})}},nn=class Qh extends $i{static INSTANCE;constructor(){super()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Qh),this.INSTANCE}loadExperimentSilently(){De.get(oe.SDK_TOKEN).then(t=>{t?this.loadExperiments().catch(r=>w.error("Unable to initiate experiment",r)):qe.replaySubject.subscribe(async()=>{this.loadExperiments().catch(r=>w.error("Unable to initiate experiment",r))})})}async loadExperiments(){if(!this.runtimeData.activeExperiment)return;let t=await this.getWidgetProps();w.log("Load experiments",t),this.httpService.post("/v1/engagement/experiments",t).then(async r=>{let n=r.experiments.map(i=>new xt(i));new vc().processResponse(n)}).catch(r=>{w.error("Error sending experiment getter",r)})}async trackExperiment(t){await this.addSessionContext(t),await this.httpService.post("/v1/event/experiment",t)}},Ec=class{runtimeData=ue.get();widgetAPIService=se.get(cr);experimentAPIService=se.get(nn);meddle(){let e=we.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=we.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.loadExperiments=()=>{this.experimentAPIService.loadExperimentSilently()},e.previewWidget=we.previewWidget.bind(we),e.previewPopup=we.previewPopup.bind(we)}overwritePush(e,t){ui(e,"push",t)}meddleAccount(){this.overwritePush(we.globalRef.account,(...e)=>{this.processAccount(e[0])}),we.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(we.globalRef.events,(...e)=>{this.processEvent(e[0])}),we.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(we.globalRef.profile,(...e)=>{this.processProfile(e[0])}),we.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(we.globalRef.screen,(...e)=>{this.processPageName(e[0])}),we.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&we.authenticate(e),e.flags&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?we.sendEvent(e[0],e[1],b({occurred:this.runtimeData.jsLoadTime},e[2])):we.sendEvent(e[0],e[1],e[2]))}processProfile(e){e&&we.updateProfile(e)}processPageName(e){e&&we.setPageName(e)}meddlePage(){this.overwritePush(we.globalRef.page,(...e)=>{this.processPage(e[0])}),we.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&we.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiment=e.activeExperiment)}},ji=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=N.COOEE.concat("-");static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}},Vi=class zo{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=se.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zo),this.INSTANCE}resetScrollID(t){ji.remove(N.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=t??new Date}listen(){if(window.scrollY){let t=this.getPercentScrolledY();this.shouldSendScroll(t)&&this.sendScroll(t)}J.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){Pn(window,"scroll").pipe(ar(zo.DEBOUNCE_TIME),On(()=>{let t=this.getPercentScrolledY();if(t>100){w.warn("Received scroll percent is more than 100",t);return}if(this.shouldSendScroll(t))return t})).subscribe(t=>{this.sendScroll(t)})}shouldSendScroll(t){return Math.abs(this.lastPercent-t)>=zo.THRESHOLD||this.lastPercent!==t&&t===100}sendScroll(t){if(t==null)return;let r={percent:t,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=t;let n=ji.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new Ee(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),ji.setString(N.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let t=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/t*100)}},_c=class Zh{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=se.get(fe);runtimeData=ue.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let t=await this.runtimeData.setInactive();if(t===0){w.info("Not sending background event as user was inactive on website");return}w.info(`Sending background event with ${t} seconds`);let r={};r[Zh.ACTIVE_DURATION]=t,this.apiService.sendEvent(new Ee(N.EVENT_APP_BACKGROUND,r))}},Sc=class{compareCartItemSubject=new Dt;constructor(){this.compareCartItemSubject.pipe(ar(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,t=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(r=>w.error("Unable to process cart change in XMLHttpRequest",r))}),t.apply(this,arguments)},w.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,t=window.fetch;window.fetch=function(r){return t.apply(window,arguments).then(n=>(e.performEvent(r.toString()).catch(i=>w.error("Unable to process cart change in fetch",i)),n))},w.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(ue.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,t){let r=e?.items,n=t.items,i=[],s=[];if(w.debug(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(o=>{let c=r?.find(u=>u.vID===o.vID);if(c){if(c.quantity!==o.quantity){let u=c.quantity<o.quantity,d=Math.abs(c.quantity-o.quantity),m=te(b({},o),{quantity:d});u?i.push(m):s.push(m)}r&&J.removeFromArray(r,c)}else i.push(o)}),r)for(let o of r)s.push(o);w.debug(`Cart delta: added: ${i.length}, removed: ${s.length}`),i.length&&this.sendEvent(N.EVENT_ADD_TO_CART,{items:i}),s.length&&e.token===t.token&&this.sendEvent(N.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||i.length)&&Cr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:i,itemsRemoved:s})}sendEvent(e,t){let r=new Ee(e,t);se.get(fe).sendEvent(r)}async compareCartItems(){let e=await De.get(oe.CURRENT_CART,{}),t=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},bc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,t=window.fetch;window.fetch=async function(r,n){try{await e.modifyRequest(r,n)}catch(i){Le.getInstance().captureError("Failed to modify graphql request",i,{body:JSON.stringify(n?.body)})}return t(r,n)},w.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,t){let r=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(r.includes("graphql.json")&&t?.method==="POST")||!t.body)return;let n;if(typeof t.body=="string")try{n=JSON.parse(t.body)}catch{return}else n=t.body;w.debug("Intercepted fetch request of:",r),n?.query.includes("cartCreate")&&(t.body=await this.updatedBody(n),this.sendBuyNowEvent())}async updatedBody(e){let t=e.variables.input.attributes??[],r=await J.getCartAttributes();return e.variables.input.attributes=[...t,...r],JSON.stringify(e)}sendBuyNowEvent(){let e=ue.get().getCurrentItem();if(!e)return;let t=new Ee(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(t)}},Wi=class{constructor(e,t){this.selectors=e,this.eventName=t,this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget,r=new Ee(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0});fe.getInstance().sendEvent(r),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await J.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener("click",e)})}},wc=class Mc extends Wi{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(Mc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Mc),this.INSTANCE}},Ic=class sl extends Wi{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(sl.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new sl),this.INSTANCE}},Tc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){J.onDocumentLoaded(()=>{w.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(N.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(N.THIRD_PARTY_CHECKOUT_EVENT));let t=document.querySelector(this.selector);if(!t){w.debug("No clickable cart checkout button found");return}w.debug("Clickable cart checkout button found",t),t.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}},Cc=class{trackSilently(){this.track().catch(e=>Le.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,t=window.Shopify?.Checkout;if(!e&&!t)return;let r={};this.processSmallCheckout(e,r),this.processBigCheckout(t,r);let n=this.getTokenFromCurrentURLPath();if(n&&(r.urlToken=n),!Object.keys(r).length){w.warn("No processable data found in",e,t);return}r.referrer=document.referrer,r.url=location.href;let i=await se.get(qe).checkSessionAndGetContext();r.sessionID=i[0],this.trackOrder(r)}processSmallCheckout(e,t){e&&(e.order_id&&(t.orderID=e.order_id.toString()),e.token&&(t.checkoutToken=e.token.toString()),e.customer_id&&(t.customerID=e.customer_id.toString()))}processBigCheckout(e,t){e&&(e.token&&!t.checkoutToken&&(t.checkoutToken=e.token.toString()),e.cartToken&&(t.cartToken=e.cartToken.toString()))}trackOrder(e){w.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(t=>t.length&&e.test(t))}},Yo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),t={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},r=new Ee(N.EVENT_CHECKOUT_STARTED,t);fe.getInstance().sendEvent(r)})}},xc=class{async migrate(){}};bt.escape=wh.MustacheUtils.escapeHtml;var we=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new xc().migrate(),this.autoAuthenticate(),new Ec().meddle(),se.get(nn).loadExperimentSilently(),new _c().listen(),new Cc().trackSilently(),new Sc().listen(),new bc().listen(),new Tc().listen(),se.get(Vi).listen(),se.get(Ic).listenSilently(),se.get(wc).listenSilently(),se.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||ui(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,ui(this.globalRef,"config",new Pe),ui(this.globalRef,"runtimeData",new ue),w.debug("Global reference initialised")}static injectWidgetAssets(){at.injectScriptURL(mt.widgetURL,"cooee-widget-sdk"),at.injectStylesheet(mt.styleURL)}static autoAuthenticate(){let e=Me.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let t=e.appID?.trim(),r=e.shopifyShop;if((J.isNull(t)||t.length!==24)&&J.isNull(r)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,se.get(qe).init(e)}static sendEvent(e,t,r){let n=new Ee(e,t,r?.triggerData);r?.occurred&&(n.occurred=r.occurred),se.get(fe).sendEvent(n)}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");se.get(fe).updateProfile(e)}static setPageName(e){if(!e)return;let t=ue.get(),r=t.pageName;if(e===r)return;if(t.pageName=e,e==="cart"&&se.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){se.get(Vi).resetScrollID();return}let n={};r&&(n.ps=r);let i=new Ee(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,se.get(fe).sendEvent(i),se.get(Vi).resetScrollID(i.occurred)}static previewPopup(e,t){new Mi(t).render(e)}static previewWidget(e){new Nt(new xt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){w.error(e)}window.addEventListener("message",e=>{if(w.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let t=e.data;typeof t=="object"&&(t.action==="POPUP_PREVIEW"?(this.previewPopup(t.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):t.action==="WIDGET_PREVIEW"&&(this.previewWidget(t.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=ue.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",t=>{let{token:r}=t.detail;r&&this.updateProfile({goKwikToken:r})}),window.gokwikSdk?Yo.attachCheckoutListener():window.addEventListener("gokwikLoaded",Yo.attachCheckoutListener)}static storePreviewParams(){let e=ue.get(),t=new URLSearchParams(location.search),r=t.get("cooee-preview");r&&(e.previewIDs=r.trim().split(",").filter(i=>Number.isInteger(+i)));let n=t.get("cooee-variant");n&&(e.previewVariant=n)}};w.configure();w.logBrand();w.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.debug("Execution order:","IIFE start"),await we.initForMerchantWebsiteOnly(),await we.initForAll(),w.debug("Execution order:","IIFE end")))());w.debug("Execution order:","bottom");})();
|
|
70
|
+
`},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},autoplay:t.autoplay?.enabled?{delay:t.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return e.style.setProperty("--swiper-navigation-size",`${t.navigation.size}px`),r}function mc(e,t,r){let n={color:e.navigation.color?.rgba};return e.pagination.enabled&&(n.transform="translateY(-25%)"),$("div",{class:"swiper-container",ref:t,children:[$("div",{class:"swiper-wrapper",children:r()}),e.navigation.enabled&&$("div",{class:"swiper-button-next",style:n,children:$("span",{})}),e.navigation.enabled&&$("div",{class:"swiper-button-prev",style:n,children:$("span",{})}),e.pagination.enabled&&$("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:e.pagination.color?.rgba}})]})}var jo=class extends Ne{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&at.loadSwiperScript().then(()=>{this.swiperInstance=fc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let t;if(this.configuration.disp===2){let r=i=>{this.swiperRef=i},n=()=>e?.map(i=>$("div",{class:"swiper-slide",children:this.getProductFragment(i)}));t=$("div",{style:te(b({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:mc(this.configuration,r,n)})}else t=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((r,n)=>this.getProductFragment(r,n!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(t.flexDirection==="row"){if(e)t.maxWidth="100%",t.overflowY="auto";else if(this.configuration.disp===1){let r=this.props.triggerContext.triggerData,n=r.items.length,i;r.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?n*2-1:n:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`}}return t}getProductFragment(e,t=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}},Vo=class extends Ne{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){at.loadSwiperScript().then(()=>{this.swiperInstance=fc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,t=n=>{this.swiperRef=n},r=()=>e.values?.map(n=>$("div",{class:"swiper-slide",onClick:i=>this.onClick(i,{clickAction:this.getClickAction(n)}),children:this.renderElement(n)}));return mc(e.conf,t,r)}getComponentStyles(){return{}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return $(Fr,{element:t,triggerContext:this.props.triggerContext});case 4:return $(Hr,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:w.warn("Unknown slide type for carousal")}}valueAddedSlide(e,t){let r=JSON.stringify(e),n=bt.render(r,{form:t});return kt.getParsedElement(JSON.parse(n))}getClickAction(e){let t=b({},this.props.element.clc),r=JSON.stringify(t),n=bt.render(r,{form:e});return JSON.parse(n)}},rn=class extends Ne{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),lt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let t=e;return $(Hr,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return $(Mo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?$(Un,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return $(Ft,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return $(Fr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(jo,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $(Vo,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},Wo=class extends Ne{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){lt(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return $(fr,{children:[$("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:e=>{this.onClick(e,{clickAction:this.clickAction})},children:$(rn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&$("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e,t){if(this.isClickable)return super.onClick(e,t)}},Nt=class ss{constructor(t){this.engagementTrigger=t,this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=ue.get();widgetAPIService=se.get(cr);safeHTTPService=se.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(t=>Le.getInstance().captureException(t,b({},this.engagementTrigger.sentryContext())))}destroy(){w.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(t=>{t?.disconnect&&t.disconnect()}),this.rootContainer?.remove(),ss.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let t=await this.getVariation();this.handleVariationResponse(t)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){w.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(t){return this.engagementTrigger.shortID===t.shortID}update(t){_h.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(t.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){w.log(`${this.engagementTrigger} already has required data to render widget`);return}let t=await this.observeWidgetContainerInViewport();this.handleVariationResponse(t)}handleVariationResponse(t){t&&(w.log(`${this.engagementTrigger} visitor has been assigned to variation ${t.variation}`),t.items?.length&&(this.engagementTrigger.items=t.items.map(r=>new At(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new At(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new At(t.bundleFrom)),t.discount&&(this.engagementTrigger.discount=t.discount),t.placement&&(this.triggerContext.triggerData.placement=t.placement),t.props&&Eh.JSUtils.hasKeys(t.props)&&(this.engagementTrigger.props=b(b({},this.engagementTrigger.props),t.props)),this.triggerContext.triggerData.widget=this.widget=new bi(t.widget),this.triggerContext.triggerData.contentID=t.contentID,this.triggerContext.triggerData.variation=this.variation=t.variation,this.triggerContext.triggerData.placement=t.placement,this.triggerContext.triggerData.manipulation=t.manipulation,this.triggerContext.triggerData.content=t.content,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){ss.renderedEngagements.push(this)}async getVariation(){w.log(`${this.engagementTrigger} get variation`);let t={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(t)}catch(r){w.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){w.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let t=window.innerHeight*.3,r={root:null,rootMargin:`-${t}px 0px ${t}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((s,o)=>{s.forEach(async c=>{if(c.isIntersecting){w.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let u=await this.getVariation();n(u),o.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=Pn(window,"scroll").pipe(ar(ss.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(ss.engagementIDsWithTrackedDisplay.has(t)||!await this.isInViewport())return;let r={};this.triggerContext.triggerData.items?.length&&(r.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,i=new Ee(n,r,this.engagementTrigger);i.name===N.EVENT_CAMPAIGN_HOLDOUT&&(i.trigger.holdout=!0),this.safeHTTPService.sendEvent(i),ss.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let t=(await this.getWidgetContainer())?.getBoundingClientRect();if(!t)return!1;let r=window.innerHeight||document.documentElement.clientHeight,n=(Math.min(t.bottom,r)-Math.max(t.top,0))*t.width,i=t.width*t.height,s=n/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(t){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(t);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(t){let r=this.engagementTrigger.placement;if(!r?.selector)return w.warn(`${this.engagementTrigger} does not have a selector`),null;let n=r.selector,i;if(n.includes(N.SHADOW_SPLITTER)){let u=n.split(N.SHADOW_SPLITTER),d=Pe.get().website.commonCSS;i=(await J.retrySelector(u[0].trim()))?.shadowRoot,n=u[1].trim(),i&&(at.injectRawCSS(d,i),at.injectStylesheet(mt.styleURL,i))}w.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let s=await J.retrySelector(n,10,i??document);if(!s)return w.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let o=this.generateParentElementID(),c=this.getParentElement(o);if(!t)return c;switch(r.position){case Go.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Go.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Go.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Go.EngagementPlacementPosition.AFTER:default:s.parentElement?.insertBefore(c,s.nextSibling)}return c}async startRendering(){let t;try{t=await Ui.refreshItems(this.engagementTrigger)}catch(r){w.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!this.engagementTrigger.isCollectionPromoted()&&!t?.length&&this.engagementTrigger.isProductPromoted()){w.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=t,this.renderContainer()}getParentElement(t,r=document){let n=r.getElementById(t);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let t=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let r=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),n=Pe.get().website.commonCSS;at.injectRawCSS(n,r),at.injectStylesheet(mt.styleURL,r),at.injectSwiperCSS(r),t=r}lf(Gc(Wo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),t),this.addToRendered()}updateItems(t,r){let n=this.getItemDiff(t,r),i=this.getItemDiff(r,t);r.push(...n);for(let s of i)vh.ArrayUtils.remove(r,s)}getItemDiff(t,r){return t.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}},Dr=class Yh extends Nt{static renderedEngagements=[];constructor(t){super(t)}addToRendered(){Yh.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let t=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(t+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),t}async checkAndSendEvent(){if(!ze.get().isOpen()&&this.runtimeData.pageName!=="cart"){w.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}},dc=class Xh{constructor(t,r){this.engagementTrigger=t,this.element=r,this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(t){let r=t.placement;if(!r?.selector){w.warn(`No placement available for ${t.objective}`,t.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){w.warn(`No placement found for ${t.objective}`,t.shortID);return}for(let i of n)new Xh(t,i).render()}render(){let t=this.findCartItemFromHTMLElement();if(!t||this.engagementTrigger.skipSubscribedItems&&t.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===t.id.toString());if(!n)return;let i=new Sr(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let m of i.sellingPlans??[])m.mID===s.id.toString()&&(m.isSelected=!0,i.changeSellingPlan(m));let o=new At(r);o.vars=[i],o.selectedOrFirstVariant.value=i;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(c);let u=new xt(this.engagementTrigger);u.placement.selector=`.${c}`,u.items=[o];let d=new Dr(u);d.renderSilently(),this.watchForCartItemDeletion(d,c)}watchForCartItemDeletion(t,r){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{o===this.element&&(w.debug(`${r} has been removed`),t.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let t=this.element.innerHTML;return this.cartItems.find(r=>{if(!(t.includes(r.url)||t.includes(r.variant_id))&&(!t.includes(r.product_title)||r.variant_title&&!t.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!t.includes(n))})}},Sh=Se(Rr()),hc=class extends Dr{ctaListener=new tn;constructor(e){super(e),Cr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Qu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),t=[...this.engagementTrigger.progressBarConfig.milestones];for(let r of t){if(e.amount<r.minValue)break;if(w.log("Current milestone",r),r.rewardType===Sh.MilestoneRewardType.FREE_AUTO_GIFT){let n=r.items[0],i=e.items.find(s=>s.vID===n.vID||s.mID===n.mID);if(i)w.log(`Item(vID:${n.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(i,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});else{let s=await this.ctaListener.performAddToCart([n],this.engagementTrigger);ze.get().refreshUI(s,!1)}}}}async removeOtherFreeGifts(e){let t=(await de.getCurrent().getNormalisedCart()).items.filter(r=>r.vID!==e?.vID&&r.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(t.length)for(let r of t)await this.ctaListener.performUpdate(r,{quantity:0})}},gc=class extends Nt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.triggerContext=this.triggerContext,e.addEventListener("sendEvent",t=>{let r=t.detail;this.safeHTTPService.sendEvent(r)}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}},bh=Se(ti()),yc=class extends Nt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(N.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let t=this.engagementTrigger,r=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,n=e.detail;if(!bh.JSUtils.hasKeys(n)){w.error(`No detail received for ${r}`);return}w.log("Detail received for BYOB",n);let i=n.campaignID??n.campaignId??n.campaign_id;if(i!==t.shortID&&i!==t.engagementID){w.warn(`Current ${r} is not BYOB. Received: ${i}`);return}let s=n.items;if(!s?.length)return;let o=s.map(c=>new dt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new ki(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},Hi=class{runtimeData=ue.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let t=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let r of e)w.log(`\u{1F4E3} ${r} received as cart embed`),!this.findAndUpdateCurrent(r,t)&&(w.log(`${r} is new`),r.isProgressBar()?new hc(r).renderSilently():r.isSubscriptionUpsell()?dc.renderCartUpsell(r):new Dr(r).renderSilently());this.removeOldWidgets(t)}processPageWidgetResponse(e){let t=[...Nt.renderedEngagements];Nt.renderedEngagements.length=0;for(let r of e)w.log(`\u{1F4E3} ${r} received as page embed`),!this.findAndUpdateCurrent(r,t)&&(w.log(`${r} is new`),r.isShoppableVideo()?new gc(r).renderSilently():r.isBYOB()?new yc(r).renderSilently():new Nt(r).renderSilently());this.removeOldWidgets(t)}findAndUpdateCurrent(e,t){let r=t.findIndex(n=>n.isSameTrigger(e));return r<0||e.isSubscriptionUpsell()?!1:(t[r].update(e),t[r].renderSilently(),t.splice(r,1),!0)}removeOldWidgets(e){for(let t of e)t.destroy()}},$i=class{runtimeData=ue.get();httpService=se.get(yt);sessionManager=se.get(qe);constructor(){}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),e.locale=this.runtimeData.locale,await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await de.getCurrent().getNormalisedCart()}catch(i){w.error("Error fetching Shopify cart before sending widget call",i)}let t=new URLSearchParams(location.search),r=t.get("cooee-preview");r?e.previewIDs=r.trim().split(",").filter(i=>Number.isInteger(+i)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let n=t.get("cooee-variant");return n?e.previewVariant=n:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}async addSessionContext(e){let t=await this.sessionManager.checkSessionAndGetContext();e.sessionID=t[0],e.sessionNumber=t[1],e.landingPage=t[2],e.page=Tr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),t=[];return e.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&t.push(n)}),t}},cr=class zh extends $i{static INSTANCE;loadWidgetsSubject=new Dt;constructor(){super(),this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(t=>w.error("Unable to initiate cart widgets",t)),this.loadPageWidgets().catch(t=>w.error("Unable to initiate page widgets",t))}),Cr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zh),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(t=>w.error("Unable to initiate load page widgets",t))})}loadCartWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(t=>w.error("Unable to initiate cart widgets",t))})}loadWidgetsSilently(){qe.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let t=await this.getWidgetProps();w.log("Load widgets",t),this.httpService.post("/v1/engagement/page-widgets",t).then(async r=>{let n=r.widgets.map(i=>new xt(i));new Hi().processPageWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async loadCartWidgets(){let t=await this.getWidgetProps();w.log("Load cart widgets",t),this.httpService.post("/v1/engagement/cart-widgets",t).then(async r=>{let n=r.widgets.map(i=>new xt(i));new Hi().processCartWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async getVariation(t){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",b(b({},t),r))}renderCachedCartWidgets(){new Hi().processCartWidgetResponse(this.runtimeData.cartEngagements)}},vc=class{eventAPIService;constructor(){this.eventAPIService=se.get(nn)}processResponse(e){for(let t of e)t.experimentConfig&&(this.runExperiment(t),this.trackExperimentRan(t));document.querySelector("#lc-hide-body")?.remove()}async runExperiment(e){let t=e.experimentConfig?.experiments;if(!t?.length){w.log("Nothing to experiment",e.toString());return}for(let r of t)this.executeSingleExperiment(e,r).catch(n=>w.error("Fail to execute experiment",n))}async executeSingleExperiment(e,t){if(!t.cssSelector){w.debug("No CSS Selector available",e.toString());return}let r=await J.retrySelectors(t.cssSelector);for(let n of r)Object.assign(n.style,t.style),t.type==="TEXT"&&t.text&&(n.innerHTML=t.text)}trackExperimentRan(e){this.eventAPIService.trackExperiment({name:N.EVENT_EXPERIMENT_START,experiment:new Zr(e)}).catch(t=>{w.error("Fail to track experiment",t)})}},nn=class Qh extends $i{static INSTANCE;constructor(){super()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Qh),this.INSTANCE}loadExperimentSilently(){De.get(oe.SDK_TOKEN).then(t=>{t?this.loadExperiments().catch(r=>w.error("Unable to initiate experiment",r)):qe.replaySubject.subscribe(async()=>{this.loadExperiments().catch(r=>w.error("Unable to initiate experiment",r))})})}async loadExperiments(){if(!this.runtimeData.activeExperiment)return;let t=await this.getWidgetProps();w.log("Load experiments",t),this.httpService.post("/v1/engagement/experiments",t).then(async r=>{let n=r.experiments.map(i=>new xt(i));new vc().processResponse(n)}).catch(r=>{w.error("Error sending experiment getter",r)})}async trackExperiment(t){await this.addSessionContext(t),await this.httpService.post("/v1/event/experiment",t)}},Ec=class{runtimeData=ue.get();widgetAPIService=se.get(cr);experimentAPIService=se.get(nn);meddle(){let e=we.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=we.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.loadExperiments=()=>{this.experimentAPIService.loadExperimentSilently()},e.previewWidget=we.previewWidget.bind(we),e.previewPopup=we.previewPopup.bind(we)}overwritePush(e,t){ui(e,"push",t)}meddleAccount(){this.overwritePush(we.globalRef.account,(...e)=>{this.processAccount(e[0])}),we.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(we.globalRef.events,(...e)=>{this.processEvent(e[0])}),we.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(we.globalRef.profile,(...e)=>{this.processProfile(e[0])}),we.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(we.globalRef.screen,(...e)=>{this.processPageName(e[0])}),we.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&we.authenticate(e),e.flags&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?we.sendEvent(e[0],e[1],b({occurred:this.runtimeData.jsLoadTime},e[2])):we.sendEvent(e[0],e[1],e[2]))}processProfile(e){e&&we.updateProfile(e)}processPageName(e){e&&we.setPageName(e)}meddlePage(){this.overwritePush(we.globalRef.page,(...e)=>{this.processPage(e[0])}),we.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&we.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiment=e.activeExperiment)}},ji=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=N.COOEE.concat("-");static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}},Vi=class zo{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=se.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zo),this.INSTANCE}resetScrollID(t){ji.remove(N.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=t??new Date}listen(){if(window.scrollY){let t=this.getPercentScrolledY();this.shouldSendScroll(t)&&this.sendScroll(t)}J.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){Pn(window,"scroll").pipe(ar(zo.DEBOUNCE_TIME),On(()=>{let t=this.getPercentScrolledY();if(t>100){w.warn("Received scroll percent is more than 100",t);return}if(this.shouldSendScroll(t))return t})).subscribe(t=>{this.sendScroll(t)})}shouldSendScroll(t){return Math.abs(this.lastPercent-t)>=zo.THRESHOLD||this.lastPercent!==t&&t===100}sendScroll(t){if(t==null)return;let r={percent:t,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=t;let n=ji.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new Ee(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),ji.setString(N.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let t=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/t*100)}},_c=class Zh{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=se.get(fe);runtimeData=ue.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let t=await this.runtimeData.setInactive();if(t===0){w.info("Not sending background event as user was inactive on website");return}w.info(`Sending background event with ${t} seconds`);let r={};r[Zh.ACTIVE_DURATION]=t,this.apiService.sendEvent(new Ee(N.EVENT_APP_BACKGROUND,r))}},Sc=class{compareCartItemSubject=new Dt;constructor(){this.compareCartItemSubject.pipe(ar(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,t=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(r=>w.error("Unable to process cart change in XMLHttpRequest",r))}),t.apply(this,arguments)},w.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,t=window.fetch;window.fetch=function(r){return t.apply(window,arguments).then(n=>(e.performEvent(r.toString()).catch(i=>w.error("Unable to process cart change in fetch",i)),n))},w.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(ue.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,t){let r=e?.items,n=t.items,i=[],s=[];if(w.debug(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(o=>{let c=r?.find(u=>u.vID===o.vID);if(c){if(c.quantity!==o.quantity){let u=c.quantity<o.quantity,d=Math.abs(c.quantity-o.quantity),m=te(b({},o),{quantity:d});u?i.push(m):s.push(m)}r&&J.removeFromArray(r,c)}else i.push(o)}),r)for(let o of r)s.push(o);w.debug(`Cart delta: added: ${i.length}, removed: ${s.length}`),i.length&&this.sendEvent(N.EVENT_ADD_TO_CART,{items:i}),s.length&&e.token===t.token&&this.sendEvent(N.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||i.length)&&Cr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:i,itemsRemoved:s})}sendEvent(e,t){let r=new Ee(e,t);se.get(fe).sendEvent(r)}async compareCartItems(){let e=await De.get(oe.CURRENT_CART,{}),t=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},bc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,t=window.fetch;window.fetch=async function(r,n){try{await e.modifyRequest(r,n)}catch(i){Le.getInstance().captureError("Failed to modify graphql request",i,{body:JSON.stringify(n?.body)})}return t(r,n)},w.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,t){let r=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(r.includes("graphql.json")&&t?.method==="POST")||!t.body)return;let n;if(typeof t.body=="string")try{n=JSON.parse(t.body)}catch{return}else n=t.body;w.debug("Intercepted fetch request of:",r),n?.query.includes("cartCreate")&&(t.body=await this.updatedBody(n),this.sendBuyNowEvent())}async updatedBody(e){let t=e.variables.input.attributes??[],r=await J.getCartAttributes();return e.variables.input.attributes=[...t,...r],JSON.stringify(e)}sendBuyNowEvent(){let e=ue.get().getCurrentItem();if(!e)return;let t=new Ee(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(t)}},Wi=class{constructor(e,t){this.selectors=e,this.eventName=t,this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget,r=new Ee(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0});fe.getInstance().sendEvent(r),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await J.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener("click",e)})}},wc=class Mc extends Wi{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(Mc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Mc),this.INSTANCE}},Ic=class sl extends Wi{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(sl.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new sl),this.INSTANCE}},Tc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){J.onDocumentLoaded(()=>{w.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(N.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(N.THIRD_PARTY_CHECKOUT_EVENT));let t=document.querySelector(this.selector);if(!t){w.debug("No clickable cart checkout button found");return}w.debug("Clickable cart checkout button found",t),t.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}},Cc=class{trackSilently(){this.track().catch(e=>Le.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,t=window.Shopify?.Checkout;if(!e&&!t)return;let r={};this.processSmallCheckout(e,r),this.processBigCheckout(t,r);let n=this.getTokenFromCurrentURLPath();if(n&&(r.urlToken=n),!Object.keys(r).length){w.warn("No processable data found in",e,t);return}r.referrer=document.referrer,r.url=location.href;let i=await se.get(qe).checkSessionAndGetContext();r.sessionID=i[0],this.trackOrder(r)}processSmallCheckout(e,t){e&&(e.order_id&&(t.orderID=e.order_id.toString()),e.token&&(t.checkoutToken=e.token.toString()),e.customer_id&&(t.customerID=e.customer_id.toString()))}processBigCheckout(e,t){e&&(e.token&&!t.checkoutToken&&(t.checkoutToken=e.token.toString()),e.cartToken&&(t.cartToken=e.cartToken.toString()))}trackOrder(e){w.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(t=>t.length&&e.test(t))}},Yo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),t={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},r=new Ee(N.EVENT_CHECKOUT_STARTED,t);fe.getInstance().sendEvent(r)})}},xc=class{async migrate(){}};bt.escape=wh.MustacheUtils.escapeHtml;var we=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new xc().migrate(),this.autoAuthenticate(),new Ec().meddle(),se.get(nn).loadExperimentSilently(),new _c().listen(),new Cc().trackSilently(),new Sc().listen(),new bc().listen(),new Tc().listen(),se.get(Vi).listen(),se.get(Ic).listenSilently(),se.get(wc).listenSilently(),se.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||ui(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,ui(this.globalRef,"config",new Pe),ui(this.globalRef,"runtimeData",new ue),w.debug("Global reference initialised")}static injectWidgetAssets(){at.injectScriptURL(mt.widgetURL,"cooee-widget-sdk"),at.injectStylesheet(mt.styleURL)}static autoAuthenticate(){let e=Me.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let t=e.appID?.trim(),r=e.shopifyShop;if((J.isNull(t)||t.length!==24)&&J.isNull(r)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,se.get(qe).init(e)}static sendEvent(e,t,r){let n=new Ee(e,t,r?.triggerData);r?.occurred&&(n.occurred=r.occurred),se.get(fe).sendEvent(n)}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");se.get(fe).updateProfile(e)}static setPageName(e){if(!e)return;let t=ue.get(),r=t.pageName;if(e===r)return;if(t.pageName=e,e==="cart"&&se.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){se.get(Vi).resetScrollID();return}let n={};r&&(n.ps=r);let i=new Ee(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,se.get(fe).sendEvent(i),se.get(Vi).resetScrollID(i.occurred)}static previewPopup(e,t){new Mi(t).render(e)}static previewWidget(e){new Nt(new xt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){w.error(e)}window.addEventListener("message",e=>{if(w.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let t=e.data;typeof t=="object"&&(t.action==="POPUP_PREVIEW"?(this.previewPopup(t.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):t.action==="WIDGET_PREVIEW"&&(this.previewWidget(t.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=ue.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",t=>{let{token:r}=t.detail;r&&this.updateProfile({goKwikToken:r})}),window.gokwikSdk?Yo.attachCheckoutListener():window.addEventListener("gokwikLoaded",Yo.attachCheckoutListener)}static storePreviewParams(){let e=ue.get(),t=new URLSearchParams(location.search),r=t.get("cooee-preview");r&&(e.previewIDs=r.trim().split(",").filter(i=>Number.isInteger(+i)));let n=t.get("cooee-variant");n&&(e.previewVariant=n)}};w.configure();w.logBrand();w.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.debug("Execution order:","IIFE start"),await we.initForMerchantWebsiteOnly(),await we.initForAll(),w.debug("Execution order:","IIFE end")))());w.debug("Execution order:","bottom");})();
|