@letscooee/web-sdk 9.9.0 → 9.9.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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var cg=Object.create,Mc=Object.defineProperty,lg=Object.defineProperties,ug=Object.getOwnPropertyDescriptor,pg=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertyNames,mp=Object.getOwnPropertySymbols,mg=Object.getPrototypeOf,hp=Object.prototype.hasOwnProperty,dg=Object.prototype.propertyIsEnumerable,dp=(e,t,r)=>t in e?Mc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||={})hp.call(t,r)&&dp(e,r,t[r]);if(mp)for(var r of mp(t))dg.call(t,r)&&dp(e,r,t[r]);return e},te=(e,t)=>lg(e,pg(t)),Xi=(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))!hp.call(e,i)&&i!==r&&Mc(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?Mc(r,"default",{value:e,enumerable:!0}):r,e)),an=ur((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,m){return function(){return m.apply(h,arguments)}},c=function(){var h=arguments,m=h[0],E,v;for(v=1;v<h.length;v++)for(E in h[v])!(E in m)&&h[v].hasOwnProperty(E)&&(m[E]=h[v][E]);return m},u=function(h,m){return{value:h,name:m}};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 m=this.context.filterLevel;return h.value>=m.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,m){i&&this.enabledFor(h)&&i(m,c({level:h},this.context))}};var g=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var m in s)s.hasOwnProperty(m)&&s[m].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(v,_){_.name&&v.unshift("["+_.name+"]")};var m={},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):m[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(D,[P+": "+(new Date().getTime()-m[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)}),kc=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={'"':"&quot;"}}),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.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(y){return y[y.ONCE_PER_USER=1]="ONCE_PER_USER",y[y.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",y[y.EVERY_TIME=3]="EVERY_TIME",y}(t||(e.CriteriaFrequency=t={})),r=function(y){return y[y.ONE_TIME=1]="ONE_TIME",y[y.MULTIPLE=2]="MULTIPLE",y[y.RECURRING=3]="RECURRING",y}(r||(e.ScheduleFrequency=r={})),n=function(y){return y[y.NOW=1]="NOW",y[y.LATER=2]="LATER",y[y.NEVER=3]="NEVER",y}(n||(e.TimePreference=n={})),i=function(y){return y[y.PUBLISHED=1]="PUBLISHED",y[y.DRAFT=2]="DRAFT",y[y.PAUSED=3]="PAUSED",y[y.STOPPED=5]="STOPPED",y[y.COMPLETED=6]="COMPLETED",y[y.UNINSTALLED=8]="UNINSTALLED",y}(i||(e.EngagementStatus=i={})),s=function(y){return y.CAMPAIGN="CAMPAIGN",y.NATIVE_AB="NATIVE_AB",y.CRO_COPILOT="CRO_COPILOT",y}(s||(e.EngagementType=s={})),o=function(y){return y[y.NONE=0]="NONE",y[y.RULE_BASED=1]="RULE_BASED",y[y.INTENT_BASED=2]="INTENT_BASED",y}(o||(e.TriggerType=o={})),c=function(y){return y[y.SINGLE=1]="SINGLE",y[y.EXCLUSION=2]="EXCLUSION",y[y.ABTESTING=3]="ABTESTING",y}(c||(e.EngagementContentType=c={})),u=function(y){return y[y.ALL=0]="ALL",y[y.NEW_ONLY=1]="NEW_ONLY",y[y.RETURNING_ONLY=2]="RETURNING_ONLY",y}(u||(e.SessionType=u={})),d=function(y){return y.ALL="ALL",y.LOGGED_IN="LOGGED_IN",y.NON_LOGGED_IN="NON_LOGGED_IN",y}(d||(e.LoggedInVisitor=d={})),g=function(y){return y.ALL="ALL",y.PURCHASED="PURCHASED",y.NON_PURCHASED="NON_PURCHASED",y}(g||(e.PurchasedVisitor=g={})),h=function(y){return y[y.NONE=0]="NONE",y[y.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",y[y.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",y[y.SINGLE_ITEM=3]="SINGLE_ITEM",y[y.TOP_SELLING=4]="TOP_SELLING",y[y.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",y[y.NEW_ARRIVALS=6]="NEW_ARRIVALS",y[y.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",y[y.EVENT_ITEM=8]="EVENT_ITEM",y[y.CART_ITEM=9]="CART_ITEM",y[y.BUNDLE=10]="BUNDLE",y[y.CURRENT_ITEM=11]="CURRENT_ITEM",y[y.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",y[y.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",y[y.TRENDING_ITEMS=14]="TRENDING_ITEMS",y}(h||(e.EngagementItemSource=h={})),m=function(y){return y[y.LAST_ADDED=1]="LAST_ADDED",y[y.FIRST_ADDED=2]="FIRST_ADDED",y[y.HIGHEST_PRICE=3]="HIGHEST_PRICE",y[y.LOWEST_PRICE=4]="LOWEST_PRICE",y[y.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",y[y.ALL=6]="ALL",y}(m||(e.CartItemSource=m={})),E=function(y){return y[y.ALL=0]="ALL",y[y.ONLY_ORGANIC=1]="ONLY_ORGANIC",y[y.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",y[y.INCLUDES=3]="INCLUDES",y[y.EXCLUDES=4]="EXCLUDES",y}(E||(e.UTMCriteria=E={})),v=function(y){return y[y.NONE=0]="NONE",y[y.LIKE=1]="LIKE",y[y.NOT_LIKE=2]="NOT_LIKE",y[y.EQUALS=3]="EQUALS",y[y.NOT_EQUALS=4]="NOT_EQUALS",y}(v||(e.URLCriteria=v={})),_=function(y){return y[y.NONE=0]="NONE",y[y.LESS_THAN=1]="LESS_THAN",y[y.GREATER_THAN=2]="GREATER_THAN",y[y.BETWEEN=3]="BETWEEN",y[y.EQUALS=4]="EQUALS",y}(_||(e.CartCriteria=_={})),D=function(y){return y[y.ALL=0]="ALL",y[y.INCLUDES=1]="INCLUDES",y[y.EXCLUDES=2]="EXCLUDES",y}(D||(e.CartCurrencyOperator=D={})),P=function(y){return y[y.NONE=0]="NONE",y[y.AMOUNT=1]="AMOUNT",y[y.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",y[y.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",y}(P||(e.CartFilterEnum=P={})),M=function(y){return y[y.NONE=0]="NONE",y[y.ITEM=1]="ITEM",y[y.COLLECTION=2]="COLLECTION",y}(M||(e.PromotionType=M={})),L=function(y){return y[y.NONE=0]="NONE",y[y.SINGLE=1]="SINGLE",y[y.MULTIPLE=2]="MULTIPLE",y}(L||(e.EngagementCollectionSource=L={})),R=function(y){return y.BEFORE="before",y.AFTER="after",y.INSIDE_FIRST="insideFirst",y.INSIDE_LAST="insideLast",y}(R||(e.EngagementPlacementPosition=R={})),G=function(y){return y.SHOPIFY_CHECKOUT="shopify_checkout",y.THIRD_PARTY_CHECKOUT="third_party_checkout",y.CART_PAGE="cart_page",y.CART_DRAWER="cart_drawer",y}(G||(e.RedirectBehaviour=G={})),he=function(y){return y.ONCE_IN_SESSION="ONCE_IN_SESSION",y.ACROSS_SESSIONS="ACROSS_SESSIONS",y}(he||(e.FrequencyType=he={})),Ae=function(y){return y.DAYS="DAYS",y.HOURS="HOURS",y.MINUTES="MINUTES",y.SECONDS="SECONDS",y}(Ae||(e.FrequencyGapUnit=Ae={})),B=function(y){return y[y.NONE=0]="NONE",y[y.REJECT_POPUP=1]="REJECT_POPUP",y[y.ACCEPT_POPUP=2]="ACCEPT_POPUP",y[y.GO_TO_URL=4]="GO_TO_URL",y[y.SHARE=5]="SHARE",y[y.KEY_VALUE=100]="KEY_VALUE",y[y.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",y[y.ADD_TO_CART=102]="ADD_TO_CART",y[y.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",y[y.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",y[y.OPEN_CART=105]="OPEN_CART",y[y.SUBMIT_FORM=106]="SUBMIT_FORM",y[y.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",y[y.ADD_BUNDLE=108]="ADD_BUNDLE",y[y.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",y}(B||(e.ClickActionType=B={})),Z=function(y){return y.POPUP="POPUP",y.PAGE_EMBED="PAGE_EMBED",y.CART_EMBED="CART_EMBED",y.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",y}(Z||(e.OnsiteDeliveryType=Z={})),Y=function(y){return y.PRODUCT_PROMOTION="PRODUCT_PROMOTION",y.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",y.CART_RECOVERY="CART_RECOVERY",y.ANNOUNCEMENT="ANNOUNCEMENT",y.LEAD_GENERATION="LEAD_GENERATION",y.DATA_COLLECTION="DATA_COLLECTION",y.SALE_PROMOTION="SALE_PROMOTION",y.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",y.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",y.BYOB="BYOB",y.PROGRESS_BAR="PROGRESS_BAR",y.BUY_NOW="BUY_NOW",y.STICKY_ATC="STICKY_ATC",y.EXPERIMENT="EXPERIMENT",y}(Y||(e.EngagementObjective=Y={})),Q=function(y){return y.COOEE="COOEE",y.KLAVIYO="KLAVIYO",y}(Q||(e.EngagementContentSource=Q={})),ge=function(y){return y.ICONS="ICONS",y.TILES="TILES",y}(ge||(e.ProgressBarLayout=ge={})),$e=function(y){return y.FREE_SHIPPING="FREE_SHIPPING",y.DISCOUNT="DISCOUNT",y.FREE_AUTO_GIFT="FREE_AUTO_GIFT",y.FREE_GIFT_SELECT="FREE_GIFT_SELECT",y}($e||(e.MilestoneRewardType=$e={}))}),Qo=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",g="string",h="major",m="model",E="name",v="type",_="vendor",D="version",P="architecture",M="console",L="mobile",R="tablet",G="smarttv",he="wearable",Ae="embedded",B=500,Z="Amazon",Y="Apple",Q="ASUS",ge="BlackBerry",$e="Browser",y="Chrome",ft="Edge",We="Firefox",ve="Google",_t="Huawei",ae="LG",ie="Microsoft",Ke="Motorola",tr="Opera",lr="Samsung",Et="Sharp",Vr="Sony",Gn="Xiaomi",sn="Zebra",ti="Facebook",zi="Chromium OS",Wn="Mac OS",$n=" Browser",St=function(z,ce){var ee={};for(var Ce in z)ce[Ce]&&ce[Ce].length%2===0?ee[Ce]=ce[Ce].concat(z[Ce]):ee[Ce]=z[Ce];return ee},$r=function(z){for(var ce={},ee=0;ee<z.length;ee++)ce[z[ee].toUpperCase()]=z[ee];return ce},qi=function(z,ce){return typeof z===g?a(ce).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},l=function(z){return typeof z===g?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,ce){if(typeof z===g)return z=z.replace(/^\s\s*/,s),typeof ce===u?z:z.substring(0,B)},T=function(z,ce){for(var ee=0,Ce,At,Ot,Te,ne,$t;ee<ce.length&&!ne;){var Ki=ce[ee],ls=ce[ee+1];for(Ce=At=0;Ce<Ki.length&&!ne&&Ki[Ce];)if(ne=Ki[Ce++].exec(z),ne)for(Ot=0;Ot<ls.length;Ot++)$t=ne[++At],Te=ls[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(z,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(qi(ce[ee][Ce],z))return ee===o?n:ee}else if(qi(ce[ee],z))return ee===o?n:ee;return ce.hasOwnProperty("*")?ce["*"]:z},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","?":"/"},W={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"+$e]],[/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 "+$e]],[/(avast|avg)\/([\w\.]+)/i],[[E,/(.+)/,"$1 Secure "+$e],D],[/\bfocus\/([\w\.]+)/i],[D,[E,We+" 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,We]],[/\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,ti],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,y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,y+" WebView"],D],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[D,[E,"Android "+$e]],[/(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,We+" 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],[m,[_,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],[m,[_,lr],[v,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[m,[_,Y],[v,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[m,[_,Y],[v,R]],[/(macintosh);/i],[m,[_,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[_,Et],[v,L]],[/(?:honor)([-\w ]+)[;\)]/i],[m,[_,"Honor"],[v,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[m,[_,_t],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[m,[_,_t],[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],[[m,/_/g," "],[_,Gn],[v,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[m,/_/g," "],[_,Gn],[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],[m,[_,"OPPO"],[v,L]],[/\b(opd2\d{3}a?) bui/i],[m,[_,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[_,"Vivo"],[v,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[_,"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],[m,[_,Ke],[v,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[_,Ke],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[_,ae],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[_,ae],[v,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[m,[_,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[m,/_/g," "],[_,"Nokia"],[v,L]],[/(pixel c)\b/i],[m,[_,ve],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[m,[_,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],[m,[_,Vr],[v,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[_,Vr],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[_,"OnePlus"],[v,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[_,Z],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[_,Z],[v,L]],[/(playbook);[-\w\),; ]+(rim)/i],[m,_,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[m,[_,ge],[v,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[_,Q],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[_,Q],[v,L]],[/(nexus 9)/i],[m,[_,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[m,/_/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],[m,[_,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[_,a],m,[v,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[_,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[_,"Meizu"],[v,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[_,"Ulefone"],[v,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[_,"Energizer"],[v,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[_,"Cat"],[v,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[_,"Smartfren"],[v,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[m,[_,"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],[_,m,[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],[_,m,[v,R]],[/(surface duo)/i],[m,[_,ie],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[_,"Fairphone"],[v,L]],[/(u304aa)/i],[m,[_,"AT&T"],[v,L]],[/\bsie-(\w*)/i],[m,[_,"Siemens"],[v,L]],[/\b(rct\w+) b/i],[m,[_,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[m,[_,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[m,[_,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[m,[_,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[m,[_,"NuVision"],[v,R]],[/\b(k88) b/i],[m,[_,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[m,[_,"ZTE"],[v,L]],[/\b(gen\d{3}) b.+49h/i],[m,[_,"Swiss"],[v,L]],[/\b(zur\d{3}) b/i],[m,[_,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[m,[_,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],m,[v,R]],[/\b(ns-?\w{0,9}) b/i],[m,[_,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[m,[_,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],m,[v,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],m,[v,L]],[/\b(ph-1) /i],[m,[_,"Essential"],[v,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[m,[_,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[m,[_,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[m,[_,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[m,[_,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[_,m,[v,L]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[_,ie],[v,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[_,sn],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[_,sn],[v,L]],[/smart-tv.+(samsung)/i],[_,[v,G]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[_,lr],[v,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,ae],[v,G]],[/(apple) ?tv/i],[_,[m,Y+" TV"],[v,G]],[/crkey/i],[[m,y+"cast"],[_,ve],[v,G]],[/droid.+aft(\w+)( bui|\))/i],[m,[_,Z],[v,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[_,Et],[v,G]],[/(bravia[\w ]+)( bui|\))/i],[m,[_,Vr],[v,G]],[/(mitv-\w{5}) bui/i],[m,[_,Gn],[v,G]],[/Hbbtv.*(technisat) (.*);/i],[_,m,[v,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,p],[m,p],[v,G]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,G]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,m,[v,M]],[/droid.+; (shield) bui/i],[m,[_,"Nvidia"],[v,M]],[/(playstation [345portablevi]+)/i],[m,[_,Vr],[v,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[_,ie],[v,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[m,[_,lr],[v,he]],[/((pebble))app/i],[_,m,[v,he]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[_,Y],[v,he]],[/droid.+; (glass) \d/i],[m,[_,ve],[v,he]],[/droid.+; (wt63?0{2,3})\)/i],[m,[_,sn],[v,he]],[/droid.+; (glass) \d/i],[m,[_,ve],[v,he]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,m,[v,he]],[/; (quest( \d| pro)?)/i],[m,[_,ti],[v,he]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[v,Ae]],[/(aeobc)\b/i],[m,[_,Z],[v,Ae]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[m,[v,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[m,[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],[m,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[D,[E,ft+"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,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[D,A,W],[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,Wn],[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,We+" 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,y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,zi],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(z,ce){if(typeof z===d&&(ce=z,z=n),!(this instanceof me))return new me(z,ce).getResult();var ee=typeof r!==u&&r.navigator?r.navigator:n,Ce=z||(ee&&ee.userAgent?ee.userAgent:s),At=ee&&ee.userAgentData?ee.userAgentData:n,Ot=ce?St(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[m]=n,ne[v]=n,T.call(ne,Ce,Ot.device),Te&&!ne[v]&&At&&At.mobile&&(ne[v]=L),Te&&ne[m]=="Macintosh"&&ee&&typeof ee.standalone!==u&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&(ne[m]="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]&&At&&At.platform&&At.platform!="Unknown"&&(ne[E]=At.platform.replace(/chrome os/i,zi).replace(/macos/i,Wn)),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===g&&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([m,_,v,M,L,G,R,he,Ae]),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 je=new me;ye.ua=je.getResult(),ye.ua.get=function(){return je.getUA()},ye.ua.set=function(z){je.setUA(z);var ce=je.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(m,E){if(!c[m]){if(!o[m]){var v=typeof Xi=="function"&&Xi;if(!E&&v)return v(m,!0);if(g)return g(m,!0);var _=new Error("Cannot find module '"+m+"'");throw _.code="MODULE_NOT_FOUND",_}var D=c[m]={exports:{}};o[m][0].call(D.exports,function(P){var M=o[m][1][P];return d(M||P)},D,D.exports,s,o,c,u)}return c[m].exports}for(var g=typeof Xi=="function"&&Xi,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,g;if(d){var h=0,m=new d(P),E=u.document.createTextNode("");m.observe(E,{characterData:!0}),g=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var v=new u.MessageChannel;v.port1.onmessage=P,g=function(){v.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=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)}:g=function(){setTimeout(P,0)};var _,D=[];function P(){_=!0;for(var L,R,G=D.length;G;){for(R=D,D=[],L=-1;++L<G;)R[L]();G=D.length}_=!1}o.exports=M;function M(L){D.push(L)===1&&!_&&g()}}).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 g={},h=["REJECTED"],m=["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===m||typeof Z!="function"&&this.state===h)return this;var Y=new this.constructor(d);if(this.state!==E){var Q=this.state===m?B:Z;D(Y,Q,this.outcome)}else this.queue.push(new _(Y,B,Z));return Y};function _(B,Z,Y){this.promise=B,typeof Z=="function"&&(this.onFulfilled=Z,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){g.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){D(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){g.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){D(this.promise,this.onRejected,B)};function D(B,Z,Y){u(function(){var Q;try{Q=Z(Y)}catch(ge){return g.reject(B,ge)}Q===B?g.reject(B,new TypeError("Cannot resolve promise with itself")):g.resolve(B,Q)})}g.resolve=function(B,Z){var Y=L(P,Z);if(Y.status==="error")return g.reject(B,Y.value);var Q=Y.value;if(Q)M(B,Q);else{B.state=m,B.outcome=Z;for(var ge=-1,$e=B.queue.length;++ge<$e;)B.queue[ge].callFulfilled(Z)}return B},g.reject=function(B,Z){B.state=h,B.outcome=Z;for(var Y=-1,Q=B.queue.length;++Y<Q;)B.queue[Y].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 Y=!1;function Q(ft){Y||(Y=!0,g.reject(B,ft))}function ge(ft){Y||(Y=!0,g.resolve(B,ft))}function $e(){Z(ge,Q)}var y=L($e);y.status==="error"&&Q(y.value)}function L(B,Z){var Y={};try{Y.value=B(Z),Y.status="success"}catch(Q){Y.status="error",Y.value=Q}return Y}v.resolve=R;function R(B){return B instanceof this?B:g.resolve(new this(d),B)}v.reject=G;function G(B){var Z=new this(d);return g.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 Y=B.length,Q=!1;if(!Y)return this.resolve([]);for(var ge=new Array(Y),$e=0,y=-1,ft=new this(d);++y<Y;)We(B[y],y);return ft;function We(ve,_t){Z.resolve(ve).then(ae,function(ie){Q||(Q=!0,g.reject(ft,ie))});function ae(ie){ge[_t]=ie,++$e===Y&&!Q&&(Q=!0,g.resolve(ft,ge))}}}v.race=Ae;function Ae(B){var Z=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=B.length,Q=!1;if(!Y)return this.resolve([]);for(var ge=-1,$e=new this(d);++ge<Y;)y(B[ge]);return $e;function y(ft){Z.resolve(ft).then(function(We){Q||(Q=!0,g.resolve($e,We))},function(We){Q||(Q=!0,g.reject($e,We))})}}},{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 g(){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=g();function m(){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,G={},he=Object.prototype.toString,Ae="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 Y(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):Y(f).then(function(S){return R=S,R})}function ge(f){var S=G[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 $e(f){var S=G[f.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function y(f,S){var I=G[f.name],x=I.deferredOperations.pop();if(x)return x.reject(S),x.promise}function ft(f,S){return new v(function(I,x){if(G[f.name]=G[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),$e(f)}})}function We(f){return ft(f,!1)}function ve(f){return ft(f,!0)}function _t(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 Ke(f){return f&&f.__local_forage_encoded_blob}function tr(f){var S=this,I=S._initReady().then(function(){var x=G[S._dbInfo.name];if(x&&x.dbReady)return x.dbReady});return D(I,f,f),I}function lr(f){ge(f);for(var S=G[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,We(f).then(function(O){return f.db=O,_t(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 y(f,O),O})}function Et(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(){Et(f,S,I,x-1)})}).catch(I);I(O)}}function Vr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Gn(f){var S=this,I={db:null};if(f)for(var x in f)I[x]=f[x];var C=G[I.name];C||(C=Vr(),G[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,We(I)}).then(function(F){return I.db=F,_t(I,S._defaultConfig.version)?ve(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var q=0;q<V.length;q++){var pe=V[q];pe!==S&&(pe._dbInfo.db=I.db,pe._dbInfo.version=I.version)}})}function sn(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){Et(I._dbInfo,Ae,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),Ke(F)&&(F=ie(F)),C(F)},V.onerror=function(){O(V.error)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function ti(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){Et(I._dbInfo,Ae,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 q=V.result;if(q){var pe=q.value;Ke(pe)&&(pe=ie(pe));var Fe=f(pe,q.key,F++);Fe!==void 0?C(Fe):q.continue()}else C()},V.onerror=function(){O(V.error)}}catch(q){O(q)}})}).catch(O)});return _(x,S),x}function zi(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){Et(x._dbInfo,B,function(V,F){if(V)return k(V);try{var q=F.objectStore(x._dbInfo.storeName);H===null&&(H=void 0);var pe=q.put(H,f);F.oncomplete=function(){H===void 0&&(H=null),O(H)},F.onabort=F.onerror=function(){var Fe=pe.error?pe.error:pe.transaction.error;k(Fe)}}catch(Fe){k(Fe)}})}).catch(k)});return _(C,I),C}function Wn(f,S){var I=this;f=P(f);var x=new v(function(C,O){I.ready().then(function(){Et(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(){Et(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 St(f){var S=this,I=new v(function(x,C){S.ready().then(function(){Et(S._dbInfo,Ae,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(){Et(I._dbInfo,Ae,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 q=F.result;if(!q){C(null);return}f===0||V?C(q.key):(V=!0,q.advance(f))},F.onerror=function(){O(F.error)}}catch(q){O(q)}})}).catch(O)});return _(x,S),x}function qi(f){var S=this,I=new v(function(x,C){S.ready().then(function(){Et(S._dbInfo,Ae,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):We(f).then(function(j){var H=G[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=G[f.name],F=V.forages;j.close();for(var q=0;q<F.length;q++){var pe=F[q];pe._dbInfo.db=null,pe._dbInfo.version=H}var Fe=new v(function(xe,pt){var Ge=h.open(f.name,H);Ge.onerror=function(Ht){var Oc=Ge.result;Oc.close(),pt(Ht)},Ge.onupgradeneeded=function(){var Ht=Ge.result;Ht.deleteObjectStore(f.storeName)},Ge.onsuccess=function(){var Ht=Ge.result;Ht.close(),xe(Ht)}});return Fe.then(function(xe){V.db=xe;for(var pt=0;pt<F.length;pt++){var Ge=F[pt];Ge._dbInfo.db=xe,$e(Ge._dbInfo)}}).catch(function(xe){throw(y(f,xe)||v.resolve()).catch(function(){}),xe})}}):C=k.then(function(j){ge(f);var H=G[f.name],V=H.forages;j.close();for(var F=0;F<V.length;F++){var q=V[F];q._dbInfo.db=null}var pe=new v(function(Fe,xe){var pt=h.deleteDatabase(f.name);pt.onerror=function(){var Ge=pt.result;Ge&&Ge.close(),xe(pt.error)},pt.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},pt.onsuccess=function(){var Ge=pt.result;Ge&&Ge.close(),Fe(Ge)}});return pe.then(function(Fe){H.db=Fe;for(var xe=0;xe<V.length;xe++){var pt=V[xe];$e(pt._dbInfo)}}).catch(function(Fe){throw(y(f,Fe)||v.resolve()).catch(function(){}),Fe})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:Gn,_support:m(),iterate:ti,getItem:sn,setItem:zi,removeItem:Wn,clear:$n,length:St,key:$r,keys:qi,dropInstance:a};function p(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",Ie=W.length,me="arbf",ye="blob",je="si08",z="ui08",ce="uic8",ee="si16",Ce="si32",At="ur16",Ot="ui32",Te="fl32",ne="fl64",$t=Ie+me.length,Ki=Object.prototype.toString;function ls(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 Zo(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 ip(f,S){var I="";if(f&&(I=Ki.call(f)),f&&(I==="[object ArrayBuffer]"||f.buffer&&Ki.call(f.buffer)==="[object ArrayBuffer]")){var x,C=W;f instanceof ArrayBuffer?(x=f,C+=me):(x=f.buffer,I==="[object Int8Array]"?C+=je:I==="[object Uint8Array]"?C+=z:I==="[object Uint8ClampedArray]"?C+=ce:I==="[object Int16Array]"?C+=ee:I==="[object Uint16Array]"?C+=At: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+Zo(x))}else if(I==="[object Blob]"){var O=new FileReader;O.onload=function(){var k=A+f.type+"~"+Zo(this.result);S(W+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 op(f){if(f.substring(0,Ie)!==W)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=ls(S);switch(I){case me:return O;case ye:return E([O],{type:x});case je:return new Int8Array(O);case z:return new Uint8Array(O);case ce:return new Uint8ClampedArray(O);case ee:return new Int16Array(O);case At: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 qa={serialize:ip,deserialize:op,stringToBuffer:ls,bufferToString:Zo};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 ap(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=qa,C}function Hn(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 cp(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){Hn(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 lp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Hn(j,k,"SELECT * FROM "+k.storeName,[],function(H,V){for(var F=V.rows,q=F.length,pe=0;pe<q;pe++){var Fe=F.item(pe),xe=Fe.value;if(xe&&(xe=k.serializer.deserialize(xe)),xe=f(xe,Fe.key,pe+1),xe!==void 0){C(xe);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,q){q?j(q):V.db.transaction(function(pe){Hn(pe,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[f,F],function(){k(H)},function(Fe,xe){j(xe)})},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 up(f,S,I){return Th.apply(this,[f,S,I,1])}function pp(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){Hn(j,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[f],function(){C()},function(H,V){O(V)})})}).catch(O)});return _(x,S),x}function fp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Hn(k,O,"DELETE FROM "+O.storeName,[],function(){x()},function(j,H){C(H)})})}).catch(C)});return _(I,f),I}function yp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Hn(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 vp(f,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var k=I._dbInfo;k.db.transaction(function(j){Hn(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 bp(f){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(k){Hn(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 wp(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 _p(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(wp(k))}).then(function(O){return new v(function(k,j){O.db.transaction(function(H){function V(Fe){return new v(function(xe,pt){H.executeSql("DROP TABLE IF EXISTS "+Fe,[],function(){xe()},function(Ge,Ht){pt(Ht)})})}for(var F=[],q=0,pe=O.storeNames.length;q<pe;q++)F.push(V(O.storeNames[q]));v.all(F).then(function(){k()}).catch(function(Fe){j(Fe)})},function(H){j(H)})})}):C=v.reject("Invalid arguments"),_(C,S),C}var Ep={_driver:"webSQLStorage",_initStorage:ap,_support:p(),iterate:lp,getItem:cp,setItem:up,removeItem:pp,clear:fp,length:yp,key:vp,keys:bp,dropInstance:_p};function Sp(){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 Ip(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function Tp(){return!Ip()||localStorage.length>0}function Cp(f){var S=this,I={};if(f)for(var x in f)I[x]=f[x];return I.keyPrefix=Ch(f,S._defaultConfig),Tp()?(S._dbInfo=I,I.serializer=qa,v.resolve()):v.reject()}function Dp(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 xp(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 q=localStorage.getItem(F);if(q&&(q=C.serializer.deserialize(q)),q=f(q,F.substring(k),H++),q!==void 0)return q}}});return _(x,S),x}function Op(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 Ap(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 Pp(f){var S=this,I=S.keys().then(function(x){return x.length});return _(I,f),I}function Rp(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 kp(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(q){(q.name==="QuotaExceededError"||q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(q),j(q)}})})});return _(C,I),C}function Lp(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 Up={_driver:"localStorageWrapper",_initStorage:Cp,_support:Sp(),iterate:xp,getItem:Np,setItem:kp,removeItem:Rp,clear:Dp,length:Pp,key:Op,keys:Ap,dropInstance:Lp},Mp=function(f,S){return f===S||typeof f=="number"&&typeof S=="number"&&isNaN(f)&&isNaN(S)},Bp=function(f,S){for(var I=f.length,x=0;x<I;){if(Mp(f[x],S))return!0;x++}return!1},Dh=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},ro={},Nh={},Yi={INDEXEDDB:l,WEBSQL:Ep,LOCALSTORAGE:Up},$p=[Yi.INDEXEDDB._driver,Yi.WEBSQL._driver,Yi.LOCALSTORAGE._driver],Jo=["dropInstance"],Za=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Jo),jp={description:"",driver:$p.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Fp(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)&&(Dh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var Vp=function(){function f(S){d(this,f);for(var I in Yi)if(Yi.hasOwnProperty(I)){var x=Yi[I],C=x._driver;this[I]=C,ro[C]||this.defineDriver(x)}this._defaultConfig=Nc({},jp),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=Za.concat("_initStorage"),F=0,q=V.length;F<q;F++){var pe=V[F],Fe=!Bp(Jo,pe);if((Fe||S[pe])&&typeof S[pe]!="function"){k(H);return}}var xe=function(){for(var Ge=function(Gp){return function(){var Wp=new Error("Method "+Gp+" is not implemented by the current driver"),xh=v.reject(Wp);return _(xh,arguments[arguments.length-1]),xh}},Ht=0,Oc=Jo.length;Ht<Oc;Ht++){var Ac=Jo[Ht];S[Ac]||(S[Ac]=Ge(Ac))}};xe();var pt=function(Ge){ro[j]&&console.info("Redefining LocalForage driver: "+j),ro[j]=S,Nh[j]=Ge,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(pt,k):pt(!!S._support):pt(!0)}catch(Ge){k(Ge)}});return D(C,I,x),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(S,I,x){var C=ro[S]?v.resolve(ro[S]):v.reject(new Error("Driver not found."));return D(C,I,x),C},f.prototype.getSerializer=function(S){var I=v.resolve(qa);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;Dh(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 q=0;function pe(){for(;q<F.length;){var Fe=F[q];return q++,C._dbInfo=null,C._ready=null,C.getDriver(Fe).then(j).catch(pe)}k();var xe=new Error("No available storage method found.");return C._driverSet=v.reject(xe),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(q){C._driver=q._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!!Nh[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=Za.length;S<I;S++)Fp(this,Za[S])},f.prototype.createInstance=function(S){return new f(S)},f}(),Hp=new Vp;o.exports=Hp},{3:3}]},{},[4])(4)})}),ri=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 g(E){try{m(o.next(E))}catch(v){d(v)}}function h(E){try{m(o.throw(E))}catch(v){d(v)}}function m(E){E.done?u(E.value):c(E.value).then(g,h)}m((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)/)}),ep=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 g=o.retries,h=o.retryDelay,m=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))g=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")m=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(m)&&m.indexOf(L.status)===-1)E(L);else if(typeof m=="function")try{return Promise.resolve(m(P,null,L)).then(function(R){R?D(P,null,L):E(L)}).catch(v)}catch(R){v(R)}else P<g?D(P,null,L):E(L)}).catch(function(L){if(typeof m=="function")try{Promise.resolve(m(P,L,null)).then(function(R){R?D(P,L,null):v(L)}).catch(function(R){v(R)})}catch(R){v(R)}else P<g?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})}),gp="9.9.0",N=class Pc{static SDK_VERSION=gp;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=Pc.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Pc.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(an()),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 Dg=Object.create,Wc=Object.defineProperty,Rg=Object.defineProperties,Ag=Object.getOwnPropertyDescriptor,Ng=Object.getOwnPropertyDescriptors,Og=Object.getOwnPropertyNames,Ip=Object.getOwnPropertySymbols,Pg=Object.getPrototypeOf,Cp=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,Tp=(e,t,r)=>t in e?Wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||={})Cp.call(t,r)&&Tp(e,r,t[r]);if(Ip)for(var r of Ip(t))Lg.call(t,r)&&Tp(e,r,t[r]);return e},ee=(e,t)=>Rg(e,Ng(t)),eo=(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')}),lr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Og(t))!Cp.call(e,i)&&i!==r&&Wc(e,i,{get:()=>t[i],enumerable:!(n=Ag(t,i))||n.enumerable});return e},_e=(e,t,r)=>(r=e!=null?Dg(Pg(e)):{},Mg(t||!e||!e.__esModule?Wc(r,"default",{value:e,enumerable:!0}):r,e)),cn=lr((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,m){return function(){return m.apply(h,arguments)}},c=function(){var h=arguments,m=h[0],E,y;for(y=1;y<h.length;y++)for(E in h[y])!(E in m)&&h[y].hasOwnProperty(E)&&(m[E]=h[y][E]);return m},u=function(h,m){return{value:h,name:m}};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 m=this.context.filterLevel;return h.value>=m.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,m){i&&this.enabledFor(h)&&i(m,c({level:h},this.context))}};var g=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var m in s)s.hasOwnProperty(m)&&s[m].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(y,_){_.name&&y.unshift("["+_.name+"]")};var m={},E=function(y,_){Function.prototype.apply.call(y,console,_)};return typeof console>"u"?function(){}:function(y,_){y=Array.prototype.slice.call(y);var x=console.log,P;_.level===n.TIME?(P=(_.name?"["+_.name+"] ":"")+y[0],y[1]==="start"?console.time?console.time(P):m[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(x,[P+": "+(new Date().getTime()-m[P])+"ms"])):(_.level===n.WARN&&console.warn?x=console.warn:_.level===n.ERROR&&console.error?x=console.error:_.level===n.INFO&&console.info?x=console.info:_.level===n.DEBUG&&console.debug?x=console.debug:_.level===n.TRACE&&console.trace&&(x=console.trace),h.formatter(y,_),E(x,y))}},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)}),Yc=lr(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MustacheUtils=void 0;var t=class Yh{static escapeHtml(n){return String(n).replace(/"/g,i=>Yh.entityMap[i])}};e.MustacheUtils=t,t.entityMap={'"':"&quot;"}}),Dr=lr(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.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(v){return v[v.ONCE_PER_USER=1]="ONCE_PER_USER",v[v.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",v[v.EVERY_TIME=3]="EVERY_TIME",v}(t||(e.CriteriaFrequency=t={})),r=function(v){return v[v.ONE_TIME=1]="ONE_TIME",v[v.MULTIPLE=2]="MULTIPLE",v[v.RECURRING=3]="RECURRING",v}(r||(e.ScheduleFrequency=r={})),n=function(v){return v[v.NOW=1]="NOW",v[v.LATER=2]="LATER",v[v.NEVER=3]="NEVER",v}(n||(e.TimePreference=n={})),i=function(v){return v[v.PUBLISHED=1]="PUBLISHED",v[v.DRAFT=2]="DRAFT",v[v.PAUSED=3]="PAUSED",v[v.STOPPED=5]="STOPPED",v[v.COMPLETED=6]="COMPLETED",v[v.UNINSTALLED=8]="UNINSTALLED",v}(i||(e.EngagementStatus=i={})),s=function(v){return v.CAMPAIGN="CAMPAIGN",v.NATIVE_AB="NATIVE_AB",v.CRO_COPILOT="CRO_COPILOT",v}(s||(e.EngagementType=s={})),o=function(v){return v[v.NONE=0]="NONE",v[v.RULE_BASED=1]="RULE_BASED",v[v.INTENT_BASED=2]="INTENT_BASED",v}(o||(e.TriggerType=o={})),c=function(v){return v[v.SINGLE=1]="SINGLE",v[v.EXCLUSION=2]="EXCLUSION",v[v.ABTESTING=3]="ABTESTING",v}(c||(e.EngagementContentType=c={})),u=function(v){return v[v.ALL=0]="ALL",v[v.NEW_ONLY=1]="NEW_ONLY",v[v.RETURNING_ONLY=2]="RETURNING_ONLY",v}(u||(e.SessionType=u={})),d=function(v){return v.ALL="ALL",v.LOGGED_IN="LOGGED_IN",v.NON_LOGGED_IN="NON_LOGGED_IN",v}(d||(e.LoggedInVisitor=d={})),g=function(v){return v.ALL="ALL",v.PURCHASED="PURCHASED",v.NON_PURCHASED="NON_PURCHASED",v}(g||(e.PurchasedVisitor=g={})),h=function(v){return v[v.NONE=0]="NONE",v[v.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",v[v.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",v[v.SINGLE_ITEM=3]="SINGLE_ITEM",v[v.TOP_SELLING=4]="TOP_SELLING",v[v.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",v[v.NEW_ARRIVALS=6]="NEW_ARRIVALS",v[v.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",v[v.EVENT_ITEM=8]="EVENT_ITEM",v[v.CART_ITEM=9]="CART_ITEM",v[v.BUNDLE=10]="BUNDLE",v[v.CURRENT_ITEM=11]="CURRENT_ITEM",v[v.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",v[v.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",v[v.TRENDING_ITEMS=14]="TRENDING_ITEMS",v}(h||(e.EngagementItemSource=h={})),m=function(v){return v[v.LAST_ADDED=1]="LAST_ADDED",v[v.FIRST_ADDED=2]="FIRST_ADDED",v[v.HIGHEST_PRICE=3]="HIGHEST_PRICE",v[v.LOWEST_PRICE=4]="LOWEST_PRICE",v[v.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",v[v.ALL=6]="ALL",v}(m||(e.CartItemSource=m={})),E=function(v){return v[v.ALL=0]="ALL",v[v.ONLY_ORGANIC=1]="ONLY_ORGANIC",v[v.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",v[v.INCLUDES=3]="INCLUDES",v[v.EXCLUDES=4]="EXCLUDES",v}(E||(e.UTMCriteria=E={})),y=function(v){return v[v.NONE=0]="NONE",v[v.LIKE=1]="LIKE",v[v.NOT_LIKE=2]="NOT_LIKE",v[v.EQUALS=3]="EQUALS",v[v.NOT_EQUALS=4]="NOT_EQUALS",v}(y||(e.URLCriteria=y={})),_=function(v){return v[v.NONE=0]="NONE",v[v.LESS_THAN=1]="LESS_THAN",v[v.GREATER_THAN=2]="GREATER_THAN",v[v.BETWEEN=3]="BETWEEN",v[v.EQUALS=4]="EQUALS",v}(_||(e.CartCriteria=_={})),x=function(v){return v[v.ALL=0]="ALL",v[v.INCLUDES=1]="INCLUDES",v[v.EXCLUDES=2]="EXCLUDES",v}(x||(e.CartCurrencyOperator=x={})),P=function(v){return v[v.NONE=0]="NONE",v[v.AMOUNT=1]="AMOUNT",v[v.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",v[v.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",v}(P||(e.CartFilterEnum=P={})),M=function(v){return v[v.NONE=0]="NONE",v[v.ITEM=1]="ITEM",v[v.COLLECTION=2]="COLLECTION",v}(M||(e.PromotionType=M={})),L=function(v){return v[v.NONE=0]="NONE",v[v.SINGLE=1]="SINGLE",v[v.MULTIPLE=2]="MULTIPLE",v}(L||(e.EngagementCollectionSource=L={})),k=function(v){return v.BEFORE="before",v.AFTER="after",v.INSIDE_FIRST="insideFirst",v.INSIDE_LAST="insideLast",v}(k||(e.EngagementPlacementPosition=k={})),G=function(v){return v.SHOPIFY_CHECKOUT="shopify_checkout",v.THIRD_PARTY_CHECKOUT="third_party_checkout",v.CART_PAGE="cart_page",v.CART_DRAWER="cart_drawer",v}(G||(e.RedirectBehaviour=G={})),ue=function(v){return v.ONCE_IN_SESSION="ONCE_IN_SESSION",v.ACROSS_SESSIONS="ACROSS_SESSIONS",v}(ue||(e.FrequencyType=ue={})),Re=function(v){return v.DAYS="DAYS",v.HOURS="HOURS",v.MINUTES="MINUTES",v.SECONDS="SECONDS",v}(Re||(e.FrequencyGapUnit=Re={})),B=function(v){return v[v.NONE=0]="NONE",v[v.REJECT_POPUP=1]="REJECT_POPUP",v[v.ACCEPT_POPUP=2]="ACCEPT_POPUP",v[v.GO_TO_URL=4]="GO_TO_URL",v[v.SHARE=5]="SHARE",v[v.KEY_VALUE=100]="KEY_VALUE",v[v.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",v[v.ADD_TO_CART=102]="ADD_TO_CART",v[v.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",v[v.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",v[v.OPEN_CART=105]="OPEN_CART",v[v.SUBMIT_FORM=106]="SUBMIT_FORM",v[v.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",v[v.ADD_BUNDLE=108]="ADD_BUNDLE",v[v.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",v}(B||(e.ClickActionType=B={})),Q=function(v){return v.POPUP="POPUP",v.PAGE_EMBED="PAGE_EMBED",v.CART_EMBED="CART_EMBED",v.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",v}(Q||(e.OnsiteDeliveryType=Q={})),Y=function(v){return v.PRODUCT_PROMOTION="PRODUCT_PROMOTION",v.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",v.CART_RECOVERY="CART_RECOVERY",v.ANNOUNCEMENT="ANNOUNCEMENT",v.LEAD_GENERATION="LEAD_GENERATION",v.DATA_COLLECTION="DATA_COLLECTION",v.SALE_PROMOTION="SALE_PROMOTION",v.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",v.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",v.BYOB="BYOB",v.PROGRESS_BAR="PROGRESS_BAR",v.BUY_NOW="BUY_NOW",v.STICKY_ATC="STICKY_ATC",v.EXPERIMENT="EXPERIMENT",v}(Y||(e.EngagementObjective=Y={})),J=function(v){return v.COOEE="COOEE",v.KLAVIYO="KLAVIYO",v}(J||(e.EngagementContentSource=J={})),de=function(v){return v.ICONS="ICONS",v.TILES="TILES",v}(de||(e.ProgressBarLayout=de={})),Be=function(v){return v.FREE_SHIPPING="FREE_SHIPPING",v.DISCOUNT="DISCOUNT",v.FREE_AUTO_GIFT="FREE_AUTO_GIFT",v.FREE_GIFT_SELECT="FREE_GIFT_SELECT",v}(Be||(e.MilestoneRewardType=Be={}))}),ns=lr(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={}))}),qc=lr(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayUtils=void 0;var t=class Jh{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--,Jh.swap(n,i,s)}}};e.ArrayUtils=t}),$f=lr((e,t)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",d="object",g="string",h="major",m="model",E="name",y="type",_="vendor",x="version",P="architecture",M="console",L="mobile",k="tablet",G="smarttv",ue="wearable",Re="embedded",B=500,Q="Amazon",Y="Apple",J="ASUS",de="BlackBerry",Be="Browser",v="Chrome",ut="Edge",Ve="Firefox",ye="Google",vt="Huawei",se="LG",ie="Microsoft",ze="Motorola",er="Opera",cr="Samsung",yt="Sharp",Hr="Sony",qn="Xiaomi",an="Zebra",ii="Facebook",Xi="Chromium OS",zn="Mac OS",jn=" Browser",Et=function(q,ae){var Z={};for(var Te in q)ae[Te]&&ae[Te].length%2===0?Z[Te]=ae[Te].concat(q[Te]):Z[Te]=q[Te];return Z},$r=function(q){for(var ae={},Z=0;Z<q.length;Z++)ae[q[Z].toUpperCase()]=q[Z];return ae},Ji=function(q,ae){return typeof q===g?a(ae).indexOf(a(q))!==-1:!1},a=function(q){return q.toLowerCase()},l=function(q){return typeof q===g?q.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(q,ae){if(typeof q===g)return q=q.replace(/^\s\s*/,s),typeof ae===u?q:q.substring(0,B)},T=function(q,ae){for(var Z=0,Te,At,Dt,Ie,ne,Ut;Z<ae.length&&!ne;){var Qi=ae[Z],ts=ae[Z+1];for(Te=At=0;Te<Qi.length&&!ne&&Qi[Te];)if(ne=Qi[Te++].exec(q),ne)for(Dt=0;Dt<ts.length;Dt++)Ut=ne[++At],Ie=ts[Dt],typeof Ie===d&&Ie.length>0?Ie.length===2?typeof Ie[1]==c?this[Ie[0]]=Ie[1].call(this,Ut):this[Ie[0]]=Ie[1]:Ie.length===3?typeof Ie[1]===c&&!(Ie[1].exec&&Ie[1].test)?this[Ie[0]]=Ut?Ie[1].call(this,Ut,Ie[2]):n:this[Ie[0]]=Ut?Ut.replace(Ie[1],Ie[2]):n:Ie.length===4&&(this[Ie[0]]=Ut?Ie[3].call(this,Ut.replace(Ie[1],Ie[2])):n):this[Ie]=Ut||n;Z+=2}},A=function(q,ae){for(var Z in ae)if(typeof ae[Z]===d&&ae[Z].length>0){for(var Te=0;Te<ae[Z].length;Te++)if(Ji(ae[Z][Te],q))return Z===o?n:Z}else if(Ji(ae[Z],q))return Z===o?n:Z;return ae.hasOwnProperty("*")?ae["*"]:q},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","?":"/"},W={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"},we={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[x,[E,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[x,[E,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[E,x],[/opios[\/ ]+([\w\.]+)/i],[x,[E,er+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[x,[E,er+" GX"]],[/\bopr\/([\w\.]+)/i],[x,[E,er]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[x,[E,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[x,[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,x],[/quark(?:pc)?\/([-\w\.]+)/i],[x,[E,"Quark"]],[/\bddg\/([\w\.]+)/i],[x,[E,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[x,[E,"UC"+Be]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[x,[E,"WeChat"]],[/konqueror\/([\w\.]+)/i],[x,[E,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[x,[E,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[x,[E,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[x,[E,"Smart Lenovo "+Be]],[/(avast|avg)\/([\w\.]+)/i],[[E,/(.+)/,"$1 Secure "+Be],x],[/\bfocus\/([\w\.]+)/i],[x,[E,Ve+" Focus"]],[/\bopt\/([\w\.]+)/i],[x,[E,er+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[x,[E,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[x,[E,"Dolphin"]],[/coast\/([\w\.]+)/i],[x,[E,er+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[x,[E,"MIUI"+jn]],[/fxios\/([\w\.-]+)/i],[x,[E,Ve]],[/\bqihoobrowser\/?([\w\.]*)/i],[x,[E,"360"]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,"$1Browser"],x],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,"$1"+jn],x],[/samsungbrowser\/([\w\.]+)/i],[x,[E,cr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[x,[E,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[E,"Sogou Mobile"],x],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[E,x],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[E],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[x,E],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[E,ii],x],[/(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,x],[/\bgsa\/([\w\.]+) .*safari\//i],[x,[E,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[x,[E,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[x,[E,v+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,v+" WebView"],x],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[x,[E,"Android "+Be]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[E,x],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[x,[E,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[x,E],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[E,[x,A,U]],[/(webkit|khtml)\/([\w\.]+)/i],[E,x],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[E,"Netscape"],x],[/(wolvic|librewolf)\/([\w\.]+)/i],[E,x],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[x,[E,Ve+" 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,[x,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[E,[x,/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],[m,[_,cr],[y,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[m,[_,cr],[y,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[m,[_,Y],[y,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[m,[_,Y],[y,k]],[/(macintosh);/i],[m,[_,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[_,yt],[y,L]],[/(?:honor)([-\w ]+)[;\)]/i],[m,[_,"Honor"],[y,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[m,[_,vt],[y,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[m,[_,vt],[y,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],[[m,/_/g," "],[_,qn],[y,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[m,/_/g," "],[_,qn],[y,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[_,"OPPO"],[y,L]],[/\b(opd2\d{3}a?) bui/i],[m,[_,"OPPO"],[y,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[_,"Vivo"],[y,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[_,"Realme"],[y,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],[m,[_,ze],[y,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[_,ze],[y,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[_,se],[y,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[_,se],[y,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[m,[_,"Lenovo"],[y,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[m,/_/g," "],[_,"Nokia"],[y,L]],[/(pixel c)\b/i],[m,[_,ye],[y,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[m,[_,ye],[y,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],[m,[_,Hr],[y,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[_,Hr],[y,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[_,"OnePlus"],[y,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[_,Q],[y,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[_,Q],[y,L]],[/(playbook);[-\w\),; ]+(rim)/i],[m,_,[y,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[m,[_,de],[y,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[_,J],[y,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[_,J],[y,L]],[/(nexus 9)/i],[m,[_,"HTC"],[y,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[m,/_/g," "],[y,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],[m,[_,"TCL"],[y,k]],[/(itel) ((\w+))/i],[[_,a],m,[y,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[_,"Acer"],[y,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[_,"Meizu"],[y,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[_,"Ulefone"],[y,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[_,"Energizer"],[y,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[_,"Cat"],[y,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[_,"Smartfren"],[y,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[m,[_,"Nothing"],[y,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],[_,m,[y,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],[_,m,[y,k]],[/(surface duo)/i],[m,[_,ie],[y,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[_,"Fairphone"],[y,L]],[/(u304aa)/i],[m,[_,"AT&T"],[y,L]],[/\bsie-(\w*)/i],[m,[_,"Siemens"],[y,L]],[/\b(rct\w+) b/i],[m,[_,"RCA"],[y,k]],[/\b(venue[\d ]{2,7}) b/i],[m,[_,"Dell"],[y,k]],[/\b(q(?:mv|ta)\w+) b/i],[m,[_,"Verizon"],[y,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[m,[_,"Barnes & Noble"],[y,k]],[/\b(tm\d{3}\w+) b/i],[m,[_,"NuVision"],[y,k]],[/\b(k88) b/i],[m,[_,"ZTE"],[y,k]],[/\b(nx\d{3}j) b/i],[m,[_,"ZTE"],[y,L]],[/\b(gen\d{3}) b.+49h/i],[m,[_,"Swiss"],[y,L]],[/\b(zur\d{3}) b/i],[m,[_,"Swiss"],[y,k]],[/\b((zeki)?tb.*\b) b/i],[m,[_,"Zeki"],[y,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],m,[y,k]],[/\b(ns-?\w{0,9}) b/i],[m,[_,"Insignia"],[y,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[m,[_,"NextBook"],[y,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],m,[y,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],m,[y,L]],[/\b(ph-1) /i],[m,[_,"Essential"],[y,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[m,[_,"Envizen"],[y,k]],[/\b(trio[-\w\. ]+) b/i],[m,[_,"MachSpeed"],[y,k]],[/\btu_(1491) b/i],[m,[_,"Rotor"],[y,k]],[/(shield[\w ]+) b/i],[m,[_,"Nvidia"],[y,k]],[/(sprint) (\w+)/i],[_,m,[y,L]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[_,ie],[y,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[_,an],[y,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[_,an],[y,L]],[/smart-tv.+(samsung)/i],[_,[y,G]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[_,cr],[y,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,se],[y,G]],[/(apple) ?tv/i],[_,[m,Y+" TV"],[y,G]],[/crkey/i],[[m,v+"cast"],[_,ye],[y,G]],[/droid.+aft(\w+)( bui|\))/i],[m,[_,Q],[y,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[_,yt],[y,G]],[/(bravia[\w ]+)( bui|\))/i],[m,[_,Hr],[y,G]],[/(mitv-\w{5}) bui/i],[m,[_,qn],[y,G]],[/Hbbtv.*(technisat) (.*);/i],[_,m,[y,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,p],[m,p],[y,G]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[y,G]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,m,[y,M]],[/droid.+; (shield) bui/i],[m,[_,"Nvidia"],[y,M]],[/(playstation [345portablevi]+)/i],[m,[_,Hr],[y,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[_,ie],[y,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[m,[_,cr],[y,ue]],[/((pebble))app/i],[_,m,[y,ue]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[_,Y],[y,ue]],[/droid.+; (glass) \d/i],[m,[_,ye],[y,ue]],[/droid.+; (wt63?0{2,3})\)/i],[m,[_,an],[y,ue]],[/droid.+; (glass) \d/i],[m,[_,ye],[y,ue]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,m,[y,ue]],[/; (quest( \d| pro)?)/i],[m,[_,ii],[y,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[y,Re]],[/(aeobc)\b/i],[m,[_,Q],[y,Re]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[m,[y,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[m,[y,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[y,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[y,L]],[/(android[-\w\. ]{0,9});.+buil/i],[m,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[x,[E,ut+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[E,x],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[x,[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,x],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[x,E]],os:[[/microsoft (windows) (vista|xp)/i],[E,x],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[E,[x,A,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[x,A,W],[E,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[x,/_/g,"."],[E,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[E,zn],[x,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[x,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,x],[/\(bb(10);/i],[x,[E,de]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[x,[E,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[x,[E,Ve+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[x,[E,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[x,[E,"watchOS"]],[/crkey\/([\d\.]+)/i],[x,[E,v+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,Xi],x],[/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,x],[/(sunos) ?([\w\.\d]*)/i],[[E,"Solaris"],x],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[E,x]]},fe=function(q,ae){if(typeof q===d&&(ae=q,q=n),!(this instanceof fe))return new fe(q,ae).getResult();var Z=typeof r!==u&&r.navigator?r.navigator:n,Te=q||(Z&&Z.userAgent?Z.userAgent:s),At=Z&&Z.userAgentData?Z.userAgentData:n,Dt=ae?Et(we,ae):we,Ie=Z&&Z.userAgent==Te;return this.getBrowser=function(){var ne={};return ne[E]=n,ne[x]=n,T.call(ne,Te,Dt.browser),ne[h]=l(ne[x]),Ie&&Z&&Z.brave&&typeof Z.brave.isBrave==c&&(ne[E]="Brave"),ne},this.getCPU=function(){var ne={};return ne[P]=n,T.call(ne,Te,Dt.cpu),ne},this.getDevice=function(){var ne={};return ne[_]=n,ne[m]=n,ne[y]=n,T.call(ne,Te,Dt.device),Ie&&!ne[y]&&At&&At.mobile&&(ne[y]=L),Ie&&ne[m]=="Macintosh"&&Z&&typeof Z.standalone!==u&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&(ne[m]="iPad",ne[y]=k),ne},this.getEngine=function(){var ne={};return ne[E]=n,ne[x]=n,T.call(ne,Te,Dt.engine),ne},this.getOS=function(){var ne={};return ne[E]=n,ne[x]=n,T.call(ne,Te,Dt.os),Ie&&!ne[E]&&At&&At.platform&&At.platform!="Unknown"&&(ne[E]=At.platform.replace(/chrome os/i,Xi).replace(/macos/i,zn)),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 Te},this.setUA=function(ne){return Te=typeof ne===g&&ne.length>B?p(ne,B):ne,this},this.setUA(Te),this};fe.VERSION=i,fe.BROWSER=$r([E,x,h]),fe.CPU=$r([P]),fe.DEVICE=$r([m,_,y,M,L,G,k,ue,Re]),fe.ENGINE=fe.OS=$r([E,x]),typeof e!==u?(typeof t!==u&&t.exports&&(e=t.exports=fe),e.UAParser=fe):typeof define===c&&define.amd?define(function(){return fe}):typeof r!==u&&(r.UAParser=fe);var ge=typeof r!==u&&(r.jQuery||r.Zepto);if(ge&&!ge.ua){var je=new fe;ge.ua=je.getResult(),ge.ua.get=function(){return je.getUA()},ge.ua.set=function(q){je.setUA(q);var ae=je.getResult();for(var Z in ae)ge.ua[Z]=ae[Z]}}})(typeof window=="object"?window:e)}),Wf=lr((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(m,E){if(!c[m]){if(!o[m]){var y=typeof eo=="function"&&eo;if(!E&&y)return y(m,!0);if(g)return g(m,!0);var _=new Error("Cannot find module '"+m+"'");throw _.code="MODULE_NOT_FOUND",_}var x=c[m]={exports:{}};o[m][0].call(x.exports,function(P){var M=o[m][1][P];return d(M||P)},x,x.exports,s,o,c,u)}return c[m].exports}for(var g=typeof eo=="function"&&eo,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,g;if(d){var h=0,m=new d(P),E=u.document.createTextNode("");m.observe(E,{characterData:!0}),g=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var y=new u.MessageChannel;y.port1.onmessage=P,g=function(){y.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=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)}:g=function(){setTimeout(P,0)};var _,x=[];function P(){_=!0;for(var L,k,G=x.length;G;){for(k=x,x=[],L=-1;++L<G;)k[L]();G=x.length}_=!1}o.exports=M;function M(L){x.push(L)===1&&!_&&g()}}).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 g={},h=["REJECTED"],m=["FULFILLED"],E=["PENDING"];o.exports=y;function y(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)}y.prototype.catch=function(B){return this.then(null,B)},y.prototype.then=function(B,Q){if(typeof B!="function"&&this.state===m||typeof Q!="function"&&this.state===h)return this;var Y=new this.constructor(d);if(this.state!==E){var J=this.state===m?B:Q;x(Y,J,this.outcome)}else this.queue.push(new _(Y,B,Q));return Y};function _(B,Q,Y){this.promise=B,typeof Q=="function"&&(this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){g.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){x(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){g.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){x(this.promise,this.onRejected,B)};function x(B,Q,Y){u(function(){var J;try{J=Q(Y)}catch(de){return g.reject(B,de)}J===B?g.reject(B,new TypeError("Cannot resolve promise with itself")):g.resolve(B,J)})}g.resolve=function(B,Q){var Y=L(P,Q);if(Y.status==="error")return g.reject(B,Y.value);var J=Y.value;if(J)M(B,J);else{B.state=m,B.outcome=Q;for(var de=-1,Be=B.queue.length;++de<Be;)B.queue[de].callFulfilled(Q)}return B},g.reject=function(B,Q){B.state=h,B.outcome=Q;for(var Y=-1,J=B.queue.length;++Y<J;)B.queue[Y].callRejected(Q);return B};function P(B){var Q=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof Q=="function")return function(){Q.apply(B,arguments)}}function M(B,Q){var Y=!1;function J(ut){Y||(Y=!0,g.reject(B,ut))}function de(ut){Y||(Y=!0,g.resolve(B,ut))}function Be(){Q(de,J)}var v=L(Be);v.status==="error"&&J(v.value)}function L(B,Q){var Y={};try{Y.value=B(Q),Y.status="success"}catch(J){Y.status="error",Y.value=J}return Y}y.resolve=k;function k(B){return B instanceof this?B:g.resolve(new this(d),B)}y.reject=G;function G(B){var Q=new this(d);return g.reject(Q,B)}y.all=ue;function ue(B){var Q=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=B.length,J=!1;if(!Y)return this.resolve([]);for(var de=new Array(Y),Be=0,v=-1,ut=new this(d);++v<Y;)Ve(B[v],v);return ut;function Ve(ye,vt){Q.resolve(ye).then(se,function(ie){J||(J=!0,g.reject(ut,ie))});function se(ie){de[vt]=ie,++Be===Y&&!J&&(J=!0,g.resolve(ut,de))}}}y.race=Re;function Re(B){var Q=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=B.length,J=!1;if(!Y)return this.resolve([]);for(var de=-1,Be=new this(d);++de<Y;)v(B[de]);return Be;function v(ut){Q.resolve(ut).then(function(Ve){J||(J=!0,g.resolve(Be,Ve))},function(Ve){J||(J=!0,g.reject(Be,Ve))})}}},{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 g(){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=g();function m(){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,D=new I,C=0;C<f.length;C+=1)D.append(f[C]);return D.getBlob(S.type)}}typeof Promise>"u"&&s(3);var y=Promise;function _(f,S){S&&f.then(function(I){S(null,I)},function(I){S(I)})}function x(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",k=void 0,G={},ue=Object.prototype.toString,Re="readonly",B="readwrite";function Q(f){for(var S=f.length,I=new ArrayBuffer(S),D=new Uint8Array(I),C=0;C<S;C++)D[C]=f.charCodeAt(C);return I}function Y(f){return new y(function(S){var I=f.transaction(L,B),D=E([""]);I.objectStore(L).put(D,"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 J(f){return typeof k=="boolean"?y.resolve(k):Y(f).then(function(S){return k=S,k})}function de(f){var S=G[f.name],I={};I.promise=new y(function(D,C){I.resolve=D,I.reject=C}),S.deferredOperations.push(I),S.dbReady?S.dbReady=S.dbReady.then(function(){return I.promise}):S.dbReady=I.promise}function Be(f){var S=G[f.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function v(f,S){var I=G[f.name],D=I.deferredOperations.pop();if(D)return D.reject(S),D.promise}function ut(f,S){return new y(function(I,D){if(G[f.name]=G[f.name]||Hr(),f.db)if(S)de(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(R){var j=O.result;try{j.createObjectStore(f.storeName),R.oldVersion<=1&&j.createObjectStore(L)}catch(V){if(V.name==="ConstraintError")console.warn('The database "'+f.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+f.storeName+'" already exists.');else throw V}}),O.onerror=function(R){R.preventDefault(),D(O.error)},O.onsuccess=function(){var R=O.result;R.onversionchange=function(j){j.target.close()},I(R),Be(f)}})}function Ve(f){return ut(f,!1)}function ye(f){return ut(f,!0)}function vt(f,S){if(!f.db)return!0;var I=!f.db.objectStoreNames.contains(f.storeName),D=f.version<f.db.version,C=f.version>f.db.version;if(D&&(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 se(f){return new y(function(S,I){var D=new FileReader;D.onerror=I,D.onloadend=function(C){var O=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:O,type:f.type})},D.readAsBinaryString(f)})}function ie(f){var S=Q(atob(f.data));return E([S],{type:f.type})}function ze(f){return f&&f.__local_forage_encoded_blob}function er(f){var S=this,I=S._initReady().then(function(){var D=G[S._dbInfo.name];if(D&&D.dbReady)return D.dbReady});return x(I,f,f),I}function cr(f){de(f);for(var S=G[f.name],I=S.forages,D=0;D<I.length;D++){var C=I[D];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return f.db=null,Ve(f).then(function(O){return f.db=O,vt(f)?ye(f):O}).then(function(O){f.db=S.db=O;for(var R=0;R<I.length;R++)I[R]._dbInfo.db=O}).catch(function(O){throw v(f,O),O})}function yt(f,S,I,D){D===void 0&&(D=1);try{var C=f.db.transaction(f.storeName,S);I(null,C)}catch(O){if(D>0&&(!f.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return y.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),ye(f)}).then(function(){return cr(f).then(function(){yt(f,S,I,D-1)})}).catch(I);I(O)}}function Hr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function qn(f){var S=this,I={db:null};if(f)for(var D in f)I[D]=f[D];var C=G[I.name];C||(C=Hr(),G[I.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=er);var O=[];function R(){return y.resolve()}for(var j=0;j<C.forages.length;j++){var V=C.forages[j];V!==S&&O.push(V._initReady().catch(R))}var H=C.forages.slice(0);return y.all(O).then(function(){return I.db=C.db,Ve(I)}).then(function(F){return I.db=F,vt(I,S._defaultConfig.version)?ye(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var z=0;z<H.length;z++){var he=H[z];he!==S&&(he._dbInfo.db=I.db,he._dbInfo.version=I.version)}})}function an(f,S){var I=this;f=P(f);var D=new y(function(C,O){I.ready().then(function(){yt(I._dbInfo,Re,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.get(f);H.onsuccess=function(){var F=H.result;F===void 0&&(F=null),ze(F)&&(F=ie(F)),C(F)},H.onerror=function(){O(H.error)}}catch(F){O(F)}})}).catch(O)});return _(D,S),D}function ii(f,S){var I=this,D=new y(function(C,O){I.ready().then(function(){yt(I._dbInfo,Re,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.openCursor(),F=1;H.onsuccess=function(){var z=H.result;if(z){var he=z.value;ze(he)&&(he=ie(he));var Fe=f(he,z.key,F++);Fe!==void 0?C(Fe):z.continue()}else C()},H.onerror=function(){O(H.error)}}catch(z){O(z)}})}).catch(O)});return _(D,S),D}function Xi(f,S,I){var D=this;f=P(f);var C=new y(function(O,R){var j;D.ready().then(function(){return j=D._dbInfo,ue.call(S)==="[object Blob]"?J(j.db).then(function(V){return V?S:se(S)}):S}).then(function(V){yt(D._dbInfo,B,function(H,F){if(H)return R(H);try{var z=F.objectStore(D._dbInfo.storeName);V===null&&(V=void 0);var he=z.put(V,f);F.oncomplete=function(){V===void 0&&(V=null),O(V)},F.onabort=F.onerror=function(){var Fe=he.error?he.error:he.transaction.error;R(Fe)}}catch(Fe){R(Fe)}})}).catch(R)});return _(C,I),C}function zn(f,S){var I=this;f=P(f);var D=new y(function(C,O){I.ready().then(function(){yt(I._dbInfo,B,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.delete(f);j.oncomplete=function(){C()},j.onerror=function(){O(H.error)},j.onabort=function(){var F=H.error?H.error:H.transaction.error;O(F)}}catch(F){O(F)}})}).catch(O)});return _(D,S),D}function jn(f){var S=this,I=new y(function(D,C){S.ready().then(function(){yt(S._dbInfo,B,function(O,R){if(O)return C(O);try{var j=R.objectStore(S._dbInfo.storeName),V=j.clear();R.oncomplete=function(){D()},R.onabort=R.onerror=function(){var H=V.error?V.error:V.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return _(I,f),I}function Et(f){var S=this,I=new y(function(D,C){S.ready().then(function(){yt(S._dbInfo,Re,function(O,R){if(O)return C(O);try{var j=R.objectStore(S._dbInfo.storeName),V=j.count();V.onsuccess=function(){D(V.result)},V.onerror=function(){C(V.error)}}catch(H){C(H)}})}).catch(C)});return _(I,f),I}function $r(f,S){var I=this,D=new y(function(C,O){if(f<0){C(null);return}I.ready().then(function(){yt(I._dbInfo,Re,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=!1,F=V.openKeyCursor();F.onsuccess=function(){var z=F.result;if(!z){C(null);return}f===0||H?C(z.key):(H=!0,z.advance(f))},F.onerror=function(){O(F.error)}}catch(z){O(z)}})}).catch(O)});return _(D,S),D}function Ji(f){var S=this,I=new y(function(D,C){S.ready().then(function(){yt(S._dbInfo,Re,function(O,R){if(O)return C(O);try{var j=R.objectStore(S._dbInfo.storeName),V=j.openKeyCursor(),H=[];V.onsuccess=function(){var F=V.result;if(!F){D(H);return}H.push(F.key),F.continue()},V.onerror=function(){C(V.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 D=this,C;if(!f.name)C=y.reject("Invalid arguments");else{var O=f.name===I.name&&D._dbInfo.db,R=O?y.resolve(D._dbInfo.db):Ve(f).then(function(j){var V=G[f.name],H=V.forages;V.db=j;for(var F=0;F<H.length;F++)H[F]._dbInfo.db=j;return j});f.storeName?C=R.then(function(j){if(j.objectStoreNames.contains(f.storeName)){var V=j.version+1;de(f);var H=G[f.name],F=H.forages;j.close();for(var z=0;z<F.length;z++){var he=F[z];he._dbInfo.db=null,he._dbInfo.version=V}var Fe=new y(function(Ce,lt){var He=h.open(f.name,V);He.onerror=function(Ft){var $c=He.result;$c.close(),lt(Ft)},He.onupgradeneeded=function(){var Ft=He.result;Ft.deleteObjectStore(f.storeName)},He.onsuccess=function(){var Ft=He.result;Ft.close(),Ce(Ft)}});return Fe.then(function(Ce){H.db=Ce;for(var lt=0;lt<F.length;lt++){var He=F[lt];He._dbInfo.db=Ce,Be(He._dbInfo)}}).catch(function(Ce){throw(v(f,Ce)||y.resolve()).catch(function(){}),Ce})}}):C=R.then(function(j){de(f);var V=G[f.name],H=V.forages;j.close();for(var F=0;F<H.length;F++){var z=H[F];z._dbInfo.db=null}var he=new y(function(Fe,Ce){var lt=h.deleteDatabase(f.name);lt.onerror=function(){var He=lt.result;He&&He.close(),Ce(lt.error)},lt.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},lt.onsuccess=function(){var He=lt.result;He&&He.close(),Fe(He)}});return he.then(function(Fe){V.db=Fe;for(var Ce=0;Ce<H.length;Ce++){var lt=H[Ce];Be(lt._dbInfo)}}).catch(function(Fe){throw(v(f,Fe)||y.resolve()).catch(function(){}),Fe})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:qn,_support:m(),iterate:ii,getItem:an,setItem:Xi,removeItem:zn,clear:jn,length:Et,key:$r,keys:Ji,dropInstance:a};function p(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",we=W.length,fe="arbf",ge="blob",je="si08",q="ui08",ae="uic8",Z="si16",Te="si32",At="ur16",Dt="ui32",Ie="fl32",ne="fl64",Ut=we+fe.length,Qi=Object.prototype.toString;function ts(f){var S=f.length*.75,I=f.length,D,C=0,O,R,j,V;f[f.length-1]==="="&&(S--,f[f.length-2]==="="&&S--);var H=new ArrayBuffer(S),F=new Uint8Array(H);for(D=0;D<I;D+=4)O=T.indexOf(f[D]),R=T.indexOf(f[D+1]),j=T.indexOf(f[D+2]),V=T.indexOf(f[D+3]),F[C++]=O<<2|R>>4,F[C++]=(R&15)<<4|j>>2,F[C++]=(j&3)<<6|V&63;return H}function Zo(f){var S=new Uint8Array(f),I="",D;for(D=0;D<S.length;D+=3)I+=T[S[D]>>2],I+=T[(S[D]&3)<<4|S[D+1]>>4],I+=T[(S[D+1]&15)<<2|S[D+2]>>6],I+=T[S[D+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 Hp(f,S){var I="";if(f&&(I=Qi.call(f)),f&&(I==="[object ArrayBuffer]"||f.buffer&&Qi.call(f.buffer)==="[object ArrayBuffer]")){var D,C=W;f instanceof ArrayBuffer?(D=f,C+=fe):(D=f.buffer,I==="[object Int8Array]"?C+=je:I==="[object Uint8Array]"?C+=q:I==="[object Uint8ClampedArray]"?C+=ae:I==="[object Int16Array]"?C+=Z:I==="[object Uint16Array]"?C+=At:I==="[object Int32Array]"?C+=Te:I==="[object Uint32Array]"?C+=Dt:I==="[object Float32Array]"?C+=Ie:I==="[object Float64Array]"?C+=ne:S(new Error("Failed to get type for BinaryArray"))),S(C+Zo(D))}else if(I==="[object Blob]"){var O=new FileReader;O.onload=function(){var R=A+f.type+"~"+Zo(this.result);S(W+ge+R)},O.readAsArrayBuffer(f)}else try{S(JSON.stringify(f))}catch(R){console.error("Couldn't convert value into a JSON string: ",f),S(null,R)}}function Vp(f){if(f.substring(0,we)!==W)return JSON.parse(f);var S=f.substring(Ut),I=f.substring(we,Ut),D;if(I===ge&&U.test(S)){var C=S.match(U);D=C[1],S=S.substring(C[0].length)}var O=ts(S);switch(I){case fe:return O;case ge:return E([O],{type:D});case je:return new Int8Array(O);case q:return new Uint8Array(O);case ae:return new Uint8ClampedArray(O);case Z:return new Int16Array(O);case At:return new Uint16Array(O);case Te:return new Int32Array(O);case Dt:return new Uint32Array(O);case Ie:return new Float32Array(O);case ne:return new Float64Array(O);default:throw new Error("Unkown type: "+I)}}var nc={serialize:Hp,deserialize:Vp,stringToBuffer:ts,bufferToString:Zo};function Gh(f,S,I,D){f.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],I,D)}function Gp(f){var S=this,I={db:null};if(f)for(var D in f)I[D]=typeof f[D]!="string"?f[D].toString():f[D];var C=new y(function(O,R){try{I.db=openDatabase(I.name,String(I.version),I.description,I.size)}catch(j){return R(j)}I.db.transaction(function(j){Gh(j,I,function(){S._dbInfo=I,O()},function(V,H){R(H)})},R)});return I.serializer=nc,C}function Wn(f,S,I,D,C,O){f.executeSql(I,D,C,function(R,j){j.code===j.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(V,H){H.rows.length?O(V,j):Gh(V,S,function(){V.executeSql(I,D,C,O)},O)},O):O(R,j)},O)}function Wp(f,S){var I=this;f=P(f);var D=new y(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Wn(j,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[f],function(V,H){var F=H.rows.length?H.rows.item(0).value:null;F&&(F=R.serializer.deserialize(F)),C(F)},function(V,H){O(H)})})}).catch(O)});return _(D,S),D}function Kp(f,S){var I=this,D=new y(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Wn(j,R,"SELECT * FROM "+R.storeName,[],function(V,H){for(var F=H.rows,z=F.length,he=0;he<z;he++){var Fe=F.item(he),Ce=Fe.value;if(Ce&&(Ce=R.serializer.deserialize(Ce)),Ce=f(Ce,Fe.key,he+1),Ce!==void 0){C(Ce);return}}C()},function(V,H){O(H)})})}).catch(O)});return _(D,S),D}function Wh(f,S,I,D){var C=this;f=P(f);var O=new y(function(R,j){C.ready().then(function(){S===void 0&&(S=null);var V=S,H=C._dbInfo;H.serializer.serialize(S,function(F,z){z?j(z):H.db.transaction(function(he){Wn(he,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[f,F],function(){R(V)},function(Fe,Ce){j(Ce)})},function(he){if(he.code===he.QUOTA_ERR){if(D>0){R(Wh.apply(C,[f,V,I,D-1]));return}j(he)}})})}).catch(j)});return _(O,I),O}function qp(f,S,I){return Wh.apply(this,[f,S,I,1])}function zp(f,S){var I=this;f=P(f);var D=new y(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Wn(j,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[f],function(){C()},function(V,H){O(H)})})}).catch(O)});return _(D,S),D}function Xp(f){var S=this,I=new y(function(D,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Wn(R,O,"DELETE FROM "+O.storeName,[],function(){D()},function(j,V){C(V)})})}).catch(C)});return _(I,f),I}function Yp(f){var S=this,I=new y(function(D,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Wn(R,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(j,V){var H=V.rows.item(0).c;D(H)},function(j,V){C(V)})})}).catch(C)});return _(I,f),I}function Jp(f,S){var I=this,D=new y(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Wn(j,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[f+1],function(V,H){var F=H.rows.length?H.rows.item(0).key:null;C(F)},function(V,H){O(H)})})}).catch(O)});return _(D,S),D}function Qp(f){var S=this,I=new y(function(D,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Wn(R,O,"SELECT key FROM "+O.storeName,[],function(j,V){for(var H=[],F=0;F<V.rows.length;F++)H.push(V.rows.item(F).key);D(H)},function(j,V){C(V)})})}).catch(C)});return _(I,f),I}function Zp(f){return new y(function(S,I){f.transaction(function(D){D.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,O){for(var R=[],j=0;j<O.rows.length;j++)R.push(O.rows.item(j).name);S({db:f,storeNames:R})},function(C,O){I(O)})},function(D){I(D)})})}function ef(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 D=this,C;return f.name?C=new y(function(O){var R;f.name===I.name?R=D._dbInfo.db:R=openDatabase(f.name,"","",0),f.storeName?O({db:R,storeNames:[f.storeName]}):O(Zp(R))}).then(function(O){return new y(function(R,j){O.db.transaction(function(V){function H(Fe){return new y(function(Ce,lt){V.executeSql("DROP TABLE IF EXISTS "+Fe,[],function(){Ce()},function(He,Ft){lt(Ft)})})}for(var F=[],z=0,he=O.storeNames.length;z<he;z++)F.push(H(O.storeNames[z]));y.all(F).then(function(){R()}).catch(function(Fe){j(Fe)})},function(V){j(V)})})}):C=y.reject("Invalid arguments"),_(C,S),C}var tf={_driver:"webSQLStorage",_initStorage:Gp,_support:p(),iterate:Kp,getItem:Wp,setItem:qp,removeItem:zp,clear:Xp,length:Yp,key:Jp,keys:Qp,dropInstance:ef};function rf(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Kh(f,S){var I=f.name+"/";return f.storeName!==S.storeName&&(I+=f.storeName+"/"),I}function nf(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function sf(){return!nf()||localStorage.length>0}function of(f){var S=this,I={};if(f)for(var D in f)I[D]=f[D];return I.keyPrefix=Kh(f,S._defaultConfig),sf()?(S._dbInfo=I,I.serializer=nc,y.resolve()):y.reject()}function af(f){var S=this,I=S.ready().then(function(){for(var D=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var O=localStorage.key(C);O.indexOf(D)===0&&localStorage.removeItem(O)}});return _(I,f),I}function cf(f,S){var I=this;f=P(f);var D=I.ready().then(function(){var C=I._dbInfo,O=localStorage.getItem(C.keyPrefix+f);return O&&(O=C.serializer.deserialize(O)),O});return _(D,S),D}function Vf(f,S){var I=this,D=I.ready().then(function(){for(var C=I._dbInfo,O=C.keyPrefix,R=O.length,j=localStorage.length,V=1,H=0;H<j;H++){var F=localStorage.key(H);if(F.indexOf(O)===0){var z=localStorage.getItem(F);if(z&&(z=C.serializer.deserialize(z)),z=f(z,F.substring(R),V++),z!==void 0)return z}}});return _(D,S),D}function eg(f,S){var I=this,D=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 _(D,S),D}function tg(f){var S=this,I=S.ready().then(function(){for(var D=S._dbInfo,C=localStorage.length,O=[],R=0;R<C;R++){var j=localStorage.key(R);j.indexOf(D.keyPrefix)===0&&O.push(j.substring(D.keyPrefix.length))}return O});return _(I,f),I}function rg(f){var S=this,I=S.keys().then(function(D){return D.length});return _(I,f),I}function ng(f,S){var I=this;f=P(f);var D=I.ready().then(function(){var C=I._dbInfo;localStorage.removeItem(C.keyPrefix+f)});return _(D,S),D}function ig(f,S,I){var D=this;f=P(f);var C=D.ready().then(function(){S===void 0&&(S=null);var O=S;return new y(function(R,j){var V=D._dbInfo;V.serializer.serialize(S,function(H,F){if(F)j(F);else try{localStorage.setItem(V.keyPrefix+f,H),R(O)}catch(z){(z.name==="QuotaExceededError"||z.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(z),j(z)}})})});return _(C,I),C}function sg(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 D=this,C;return f.name?C=new y(function(O){f.storeName?O(Kh(f,D._defaultConfig)):O(f.name+"/")}).then(function(O){for(var R=localStorage.length-1;R>=0;R--){var j=localStorage.key(R);j.indexOf(O)===0&&localStorage.removeItem(j)}}):C=y.reject("Invalid arguments"),_(C,S),C}var og={_driver:"localStorageWrapper",_initStorage:of,_support:rf(),iterate:Vf,getItem:cf,setItem:ig,removeItem:ng,clear:af,length:rg,key:eg,keys:tg,dropInstance:sg},ag=function(f,S){return f===S||typeof f=="number"&&typeof S=="number"&&isNaN(f)&&isNaN(S)},cg=function(f,S){for(var I=f.length,D=0;D<I;){if(ag(f[D],S))return!0;D++}return!1},qh=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},rs={},zh={},Zi={INDEXEDDB:l,WEBSQL:tf,LOCALSTORAGE:og},lg=[Zi.INDEXEDDB._driver,Zi.WEBSQL._driver,Zi.LOCALSTORAGE._driver],ms=["dropInstance"],cc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ms),ug={description:"",driver:lg.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function hg(f,S){f[S]=function(){var I=arguments;return f.ready().then(function(){return f[S].apply(f,I)})}}function Uc(){for(var f=1;f<arguments.length;f++){var S=arguments[f];if(S)for(var I in S)S.hasOwnProperty(I)&&(qh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var dg=function(){function f(S){d(this,f);for(var I in Zi)if(Zi.hasOwnProperty(I)){var D=Zi[I],C=D._driver;this[I]=C,rs[C]||this.defineDriver(D)}this._defaultConfig=Uc({},ug),this._config=Uc({},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,D){var C=new y(function(O,R){try{var j=S._driver,V=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!S._driver){R(V);return}for(var H=cc.concat("_initStorage"),F=0,z=H.length;F<z;F++){var he=H[F],Fe=!cg(ms,he);if((Fe||S[he])&&typeof S[he]!="function"){R(V);return}}var Ce=function(){for(var He=function(fg){return function(){var gg=new Error("Method "+fg+" is not implemented by the current driver"),Xh=y.reject(gg);return _(Xh,arguments[arguments.length-1]),Xh}},Ft=0,$c=ms.length;Ft<$c;Ft++){var jc=ms[Ft];S[jc]||(S[jc]=He(jc))}};Ce();var lt=function(He){rs[j]&&console.info("Redefining LocalForage driver: "+j),rs[j]=S,zh[j]=He,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(lt,R):lt(!!S._support):lt(!0)}catch(He){R(He)}});return x(C,I,D),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(S,I,D){var C=rs[S]?y.resolve(rs[S]):y.reject(new Error("Driver not found."));return x(C,I,D),C},f.prototype.getSerializer=function(S){var I=y.resolve(nc);return x(I,S),I},f.prototype.ready=function(S){var I=this,D=I._driverSet.then(function(){return I._ready===null&&(I._ready=I._initDriver()),I._ready});return x(D,S,S),D},f.prototype.setDriver=function(S,I,D){var C=this;qh(S)||(S=[S]);var O=this._getSupportedDrivers(S);function R(){C._config.driver=C.driver()}function j(F){return C._extend(F),R(),C._ready=C._initStorage(C._config),C._ready}function V(F){return function(){var z=0;function he(){for(;z<F.length;){var Fe=F[z];return z++,C._dbInfo=null,C._ready=null,C.getDriver(Fe).then(j).catch(he)}R();var Ce=new Error("No available storage method found.");return C._driverSet=y.reject(Ce),C._driverSet}return he()}}var H=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=H.then(function(){var F=O[0];return C._dbInfo=null,C._ready=null,C.getDriver(F).then(function(z){C._driver=z._driver,R(),C._wrapLibraryMethodsWithReady(),C._initDriver=V(O)})}).catch(function(){R();var F=new Error("No available storage method found.");return C._driverSet=y.reject(F),C._driverSet}),x(this._driverSet,I,D),this._driverSet},f.prototype.supports=function(S){return!!zh[S]},f.prototype._extend=function(S){Uc(this,S)},f.prototype._getSupportedDrivers=function(S){for(var I=[],D=0,C=S.length;D<C;D++){var O=S[D];this.supports(O)&&I.push(O)}return I},f.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,I=cc.length;S<I;S++)hg(this,cc[S])},f.prototype.createInstance=function(S){return new f(S)},f}(),pg=new dg;o.exports=pg},{3:3}]},{},[4])(4)})}),oi=lr(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 g(E){try{m(o.next(E))}catch(y){d(y)}}function h(E){try{m(o.throw(E))}catch(y){d(y)}}function m(E){E.done?u(E.value):c(E.value).then(g,h)}m((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)/)}),pp=lr(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}),Th=lr((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 g=o.retries,h=o.retryDelay,m=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))g=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")m=d.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(E,y){var _=function(P){var M=typeof Request<"u"&&u instanceof Request?u.clone():u;s(M,d).then(function(L){if(Array.isArray(m)&&m.indexOf(L.status)===-1)E(L);else if(typeof m=="function")try{return Promise.resolve(m(P,null,L)).then(function(k){k?x(P,null,L):E(L)}).catch(y)}catch(k){y(k)}else P<g?x(P,null,L):E(L)}).catch(function(L){if(typeof m=="function")try{Promise.resolve(m(P,L,null)).then(function(k){k?x(P,L,null):y(L)}).catch(function(k){y(k)})}catch(k){y(k)}else P<g?x(P,L,null):y(L)})};function x(P,M,L){var k=typeof h=="function"?h(P,M,L):h;setTimeout(function(){_(++P)},k)}_(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),xp="9.9.2",N=class Fc{static SDK_VERSION=xp;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=Fc.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Fc.SDK_VERSION_CODE=parseInt(t,10)}},pt={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`},Nt=_e(cn()),w=class{static log(...e){Nt.default.info(...e)}static debug(...e){Nt.default.debug(...e)}static error(...e){Nt.default.error(...e)}static warn(...e){Nt.default.warn(...e)}static info(...e){Nt.default.info(...e)}static trace(...e){Nt.default.trace(...e)}};function Rp(e=N.LOG_PREFIX){Nt.default.useDefaults({formatter:function(r){r.unshift(`${e} (v${N.SDK_VERSION}):`)}});let t=Gc();(t==="1"||t==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Nt.default.setLevel(Nt.default[localStorage.cooeeLogLevel]):Nt.default.setLevel(pt.debug?Nt.default.TRACE:Nt.default.OFF)}function Gc(){return new URL(location.href).searchParams?.get("cooee-debug")}function Ap(){let e=`
2
2
  display: inline-block;
3
3
  font-size: 14px;
4
4
  background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
@@ -13,29 +13,29 @@
13
13
  `,t+=`
14
14
 
15
15
  `,t+=`Learn more: https://www.letscooee.com
16
- Cooee SDK: v${N.SDK_VERSION}`,console.group("%c Elevate your ecommerce experience with Cooee \u{1F680} ",e),console.log(`%c${t}`,"font-size: 13px; line-height: 1.8;"),console.groupEnd()}},wh=Se(kc()),Pe=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}},at=Se(Rr()),Jr=Se(Qo()),ga=Se(Uc()),ns,_e,Zp,jc,cn,Kp,ef,Fc,tf,Vc,Hc,$c,yg,Ji={},rf=[],vg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wc=Array.isArray;function Wr(e,t){for(var r in t)e[r]=t[r];return e}function Gc(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Yc(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?ns.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return ts(e,o,n,i,null)}function ts(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Zp,__i:-1,__u:0};return i==null&&_e.vnode!=null&&_e.vnode(s),s}function fr(e){return e.children}function pr(e,t){this.props=e,this.context=t}function zn(e,t){if(t==null)return e.__?zn(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?zn(e):null}function nf(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return nf(e)}}function Xp(e){(!e.__d&&(e.__d=!0)&&cn.push(e)&&!rs.__r++||Kp!==_e.debounceRendering)&&((Kp=_e.debounceRendering)||ef)(rs)}function rs(){var e,t,r,n,i,s,o,c;for(cn.sort(Fc);e=cn.shift();)e.__d&&(t=cn.length,n=void 0,s=(i=(r=e).__v).__e,o=[],c=[],r.__P&&((n=Wr({},i)).__v=i.__v+1,_e.vnode&&_e.vnode(n),zc(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,o,s??zn(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,af(o,n,c),n.__e!=s&&nf(n)),cn.length>t&&cn.sort(Fc));rs.__r=0}function of(e,t,r,n,i,s,o,c,u,d,g){var h,m,E,v,_,D,P=n&&n.__k||rf,M=t.length;for(u=Eg(r,t,P,u,M),h=0;h<M;h++)(E=r.__k[h])!=null&&(m=E.__i===-1?Ji:P[E.__i]||Ji,E.__i=h,D=zc(e,E,m,i,s,o,c,u,d,g),v=E.__e,E.ref&&m.ref!=E.ref&&(m.ref&&qc(m.ref,null,E),g.push(E.ref,E.__c||v,E)),_==null&&v!=null&&(_=v),4&E.__u||m.__k===E.__k?u=sf(E,u,e):typeof E.type=="function"&&D!==void 0?u=D:v&&(u=v.nextSibling),E.__u&=-7);return r.__e=_,u}function Eg(e,t,r,n,i){var s,o,c,u,d,g=r.length,h=g,m=0;for(e.__k=new Array(i),s=0;s<i;s++)(o=t[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=s+m,(o=e.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?ts(null,o,null,null,null):Wc(o)?ts(fr,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?ts(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,c=null,(d=o.__i=_g(o,r,u,h))!==-1&&(h--,(c=r[d])&&(c.__u|=2)),c==null||c.__v===null?(d==-1&&m--,typeof o.type!="function"&&(o.__u|=4)):d!=u&&(d==u-1?m--:d==u+1?m++:(d>u?m--:m++,o.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<g;s++)(c=r[s])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=zn(c)),cf(c,c));return n}function sf(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=sf(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=zn(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function _g(e,t,r,n){var i,s,o=e.key,c=e.type,u=t[r];if(u===null||u&&o==u.key&&c===u.type&&(2&u.__u)==0)return r;if(n>(u!=null&&(2&u.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<t.length;){if(i>=0){if((u=t[i])&&(2&u.__u)==0&&o==u.key&&c===u.type)return i;i--}if(s<t.length){if((u=t[s])&&(2&u.__u)==0&&o==u.key&&c===u.type)return s;s++}}return-1}function Jp(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||vg.test(t)?r:r+"px"}function es(e,t,r,n,i){var s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Jp(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Jp(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(tf,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=Vc,e.addEventListener(t,s?$c:Hc,s)):e.removeEventListener(t,s?$c:Hc,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Qp(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Vc++;else if(t.t<r.u)return;return r(_e.event?_e.event(t):t)}}}function zc(e,t,r,n,i,s,o,c,u,d){var g,h,m,E,v,_,D,P,M,L,R,G,he,Ae,B,Z,Y,Q=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),s=[c=t.__e=r.__e]),(g=_e.__b)&&g(t);e:if(typeof Q=="function")try{if(P=t.props,M="prototype"in Q&&Q.prototype.render,L=(g=Q.contextType)&&n[g.__c],R=g?L?L.props.value:g.__:n,r.__c?D=(h=t.__c=r.__c).__=h.__E:(M?t.__c=h=new Q(P,R):(t.__c=h=new pr(P,R),h.constructor=Q,h.render=bg),L&&L.sub(h),h.props=P,h.state||(h.state={}),h.context=R,h.__n=n,m=h.__d=!0,h.__h=[],h._sb=[]),M&&h.__s==null&&(h.__s=h.state),M&&Q.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Wr({},h.__s)),Wr(h.__s,Q.getDerivedStateFromProps(P,h.__s))),E=h.props,v=h.state,h.__v=t,m)M&&Q.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),M&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(M&&Q.getDerivedStateFromProps==null&&P!==E&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(P,R),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(P,h.__s,R)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=P,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ge){ge&&(ge.__=t)}),G=0;G<h._sb.length;G++)h.__h.push(h._sb[G]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(P,h.__s,R),M&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(E,v,_)})}if(h.context=R,h.props=P,h.__P=e,h.__e=!1,he=_e.__r,Ae=0,M){for(h.state=h.__s,h.__d=!1,he&&he(t),g=h.render(h.props,h.state,h.context),B=0;B<h._sb.length;B++)h.__h.push(h._sb[B]);h._sb=[]}else do h.__d=!1,he&&he(t),g=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++Ae<25);h.state=h.__s,h.getChildContext!=null&&(n=Wr(Wr({},n),h.getChildContext())),M&&!m&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(E,v)),c=of(e,Wc(Z=g!=null&&g.type===fr&&g.key==null?g.props.children:g)?Z:[Z],t,r,n,i,s,o,c,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),D&&(h.__E=h.__=null)}catch(ge){if(t.__v=null,u||s!=null)if(ge.then){for(t.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,t.__e=c}else for(Y=s.length;Y--;)Gc(s[Y]);else t.__e=r.__e,t.__k=r.__k;_e.__e(ge,t,r)}else s==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):c=t.__e=Sg(r.__e,t,r,n,i,s,o,u,d);return(g=_e.diffed)&&g(t),128&t.__u?void 0:c}function af(e,t,r){for(var n=0;n<r.length;n++)qc(r[n],r[++n],r[++n]);_e.__c&&_e.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){_e.__e(s,i.__v)}})}function Sg(e,t,r,n,i,s,o,c,u){var d,g,h,m,E,v,_,D=r.props,P=t.props,M=t.type;if(M=="svg"?i="http://www.w3.org/2000/svg":M=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(d=0;d<s.length;d++)if((E=s[d])&&"setAttribute"in E==!!M&&(M?E.localName==M:E.nodeType==3)){e=E,s[d]=null;break}}if(e==null){if(M==null)return document.createTextNode(P);e=document.createElementNS(i,M,P.is&&P),c&&(_e.__m&&_e.__m(t,s),c=!1),s=null}if(M===null)D===P||c&&e.data===P||(e.data=P);else{if(s=s&&ns.call(e.childNodes),D=r.props||Ji,!c&&s!=null)for(D={},d=0;d<e.attributes.length;d++)D[(E=e.attributes[d]).name]=E.value;for(d in D)if(E=D[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=E;else if(!(d in P)){if(d=="value"&&"defaultValue"in P||d=="checked"&&"defaultChecked"in P)continue;es(e,d,null,E,i)}}for(d in P)E=P[d],d=="children"?m=E:d=="dangerouslySetInnerHTML"?g=E:d=="value"?v=E:d=="checked"?_=E:c&&typeof E!="function"||D[d]===E||es(e,d,E,D[d],i);if(g)c||h&&(g.__html===h.__html||g.__html===e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(h&&(e.innerHTML=""),of(e,Wc(m)?m:[m],t,r,n,M=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&zn(r,0),c,u),s!=null)for(d=s.length;d--;)Gc(s[d]);c||(d="value",M=="progress"&&v==null?e.removeAttribute("value"):v!==void 0&&(v!==e[d]||M=="progress"&&!v||M=="option"&&v!==D[d])&&es(e,d,v,D[d],i),d="checked",_!==void 0&&_!==e[d]&&es(e,d,_,D[d],i))}return e}function qc(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){_e.__e(i,r)}}function cf(e,t,r){var n,i;if(_e.unmount&&_e.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||qc(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){_e.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&cf(n[i],t,r||typeof e.type!="function");r||Gc(e.__e),e.__c=e.__=e.__e=void 0}function bg(e,t,r){return this.constructor(e,r)}function lf(e,t,r){var n,i,s,o;t==document&&(t=document.documentElement),_e.__&&_e.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],o=[],zc(t,e=(!n&&r||t).__k=Yc(fr,null,[e]),i||Ji,Ji,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?ns.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,o),af(s,e,o)}ns=rf.slice,_e={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(c){e=c}throw e}},Zp=0,jc=function(e){return e!=null&&e.constructor==null},pr.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wr({},this.state),typeof e=="function"&&(e=e(Wr({},r),this.props)),e&&Wr(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Xp(this))},pr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xp(this))},pr.prototype.render=fr,cn=[],ef=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fc=function(e,t){return e.__v.__b-t.__v.__b},rs.__r=0,tf=/(PointerCapture)$|Capture$/i,Vc=0,Hc=Qp(!1),$c=Qp(!0),yg=0;var Xc,Lt,Kc,uf,pf=0,Ef=[],Je=_e,ff=Je.__b,mf=Je.__r,df=Je.diffed,hf=Je.__c,gf=Je.unmount,yf=Je.__;function wg(e,t){Je.__h&&Je.__h(Lt,e,pf||t),pf=0;var r=Lt.__H||(Lt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Qc(e,t){var r=wg(Xc++,7);return Cg(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ig(){for(var e;e=Ef.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(is),e.__H.__h.forEach(Jc),e.__H.__h=[]}catch(t){e.__H.__h=[],Je.__e(t,e.__v)}}Je.__b=function(e){Lt=null,ff&&ff(e)},Je.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yf&&yf(e,t)},Je.__r=function(e){mf&&mf(e),Xc=0;var t=(Lt=e.__c).__H;t&&(Kc===Lt?(t.__h=[],Lt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(is),t.__h.forEach(Jc),t.__h=[],Xc=0)),Kc=Lt},Je.diffed=function(e){df&&df(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ef.push(t)!==1&&uf===Je.requestAnimationFrame||((uf=Je.requestAnimationFrame)||Tg)(Ig)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Kc=Lt=null},Je.__c=function(e,t){t.some(function(r){try{r.__h.forEach(is),r.__h=r.__h.filter(function(n){return!n.__||Jc(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Je.__e(n,r.__v)}}),hf&&hf(e,t)},Je.unmount=function(e){gf&&gf(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{is(n)}catch(i){t=i}}),r.__H=void 0,t&&Je.__e(t,r.__v))};var vf=typeof requestAnimationFrame=="function";function Tg(e){var t,r=function(){clearTimeout(n),vf&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);vf&&(t=requestAnimationFrame(r))}function is(e){var t=Lt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Lt=t}function Jc(e){var t=Lt;e.__c=e.__(),Lt=t}function Cg(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var xg=Symbol.for("preact-signals");function el(){if(qn>1)qn--;else{for(var e,t=!1;Qi!==void 0;){var r=Qi;for(Qi=void 0,Zc++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Sf(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Zc=0,qn--,t)throw e}}var Oe=void 0,Qi=void 0,qn=0,Zc=0,os=0;function _f(e){if(Oe!==void 0){var t=e.n;if(t===void 0||t.t!==Oe)return t={i:0,S:e,p:Oe.s,n:void 0,t:Oe,e:void 0,x:void 0,r:t},Oe.s!==void 0&&(Oe.s.n=t),Oe.s=t,e.n=t,32&Oe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Oe.s,t.n=void 0,Oe.s.n=t,Oe.s=t),t}}function Qe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}Qe.prototype.brand=xg;Qe.prototype.h=function(){return!0};Qe.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};Qe.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};Qe.prototype.subscribe=function(e){var t=this;return ut(function(){var r=t.value,n=Oe;Oe=void 0;try{e(r)}finally{Oe=n}})};Qe.prototype.valueOf=function(){return this.value};Qe.prototype.toString=function(){return this.value+""};Qe.prototype.toJSON=function(){return this.value};Qe.prototype.peek=function(){var e=Oe;Oe=void 0;try{return this.value}finally{Oe=e}};Object.defineProperty(Qe.prototype,"value",{get:function(){var e=_f(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Zc>100)throw new Error("Cycle detected");this.v=e,this.i++,os++,qn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{el()}}}});function jt(e){return new Qe(e)}function Sf(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function bf(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function wf(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Kn(e){Qe.call(this,void 0),this.x=e,this.s=void 0,this.g=os-1,this.f=4}(Kn.prototype=new Qe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===os))return!0;if(this.g=os,this.f|=1,this.i>0&&!Sf(this))return this.f&=-2,!0;var e=Oe;try{bf(this),Oe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Oe=e,wf(this),this.f&=-2,!0};Kn.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Qe.prototype.S.call(this,e)};Kn.prototype.U=function(e){if(this.t!==void 0&&(Qe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Kn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Kn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=_f(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function tl(e){return new Kn(e)}function If(e){var t=e.u;if(e.u=void 0,typeof t=="function"){qn++;var r=Oe;Oe=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,rl(e),n}finally{Oe=r,el()}}}function rl(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,If(e)}function Dg(e){if(Oe!==this)throw new Error("Out-of-order effect");wf(this),Oe=e,this.f&=-2,8&this.f&&rl(this),el()}function Zi(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Zi.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};Zi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,If(this),bf(this),qn++;var e=Oe;return Oe=this,Dg.bind(this,e)};Zi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qi,Qi=this)};Zi.prototype.d=function(){this.f|=8,1&this.f||rl(this)};function ut(e){var t=new Zi(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var il,nl;function Xn(e,t){_e[e]=t.bind(null,_e[e]||function(){})}function ss(e){nl&&nl(),nl=e&&e.S()}function Tf(e){var t=this,r=e.data,n=Ag(r);n.value=r;var i=Qc(function(){for(var s=t.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return t.__$u.c=function(){var o,c=t.__$u.S(),u=i.value;c(),jc(u)||((o=t.base)==null?void 0:o.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=u},tl(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}Tf.displayName="_st";Object.defineProperties(Qe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Tf},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Xn("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var s=n[i];s instanceof Qe&&(r||(t.__np=r={}),r[i]=s,n[i]=s.peek())}}e(t)});Xn("__r",function(e,t){ss();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var s;return ut(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),il=n,ss(r),e(t)});Xn("__e",function(e,t,r,n){ss(),il=void 0,e(t,r,n)});Xn("diffed",function(e,t){ss(),il=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var s=r.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in n)&&(c.d(),s[o]=void 0)}else r.U=s={};for(var u in n){var d=s[u],g=n[u];d===void 0?(d=Rg(r,u,g,i),s[u]=d):d.o(g,i)}}}e(t)});function Rg(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,s=jt(r);return{o:function(o,c){s.value=o,n=c},d:ut(function(){var o=s.value.value;n[t]!==o&&(n[t]=o,i?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}Xn("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var s=n[i];s&&s.d()}}}}else{var o=t.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}e(t)});Xn("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});pr.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Ag(e){return Qc(function(){return jt(e)},[])}var Ng=Object.prototype.toString,Qn=Array.isArray||function(e){return Ng.call(e)==="[object Array]"};function sl(e){return typeof e=="function"}function Og(e){return Qn(e)?"array":typeof e}function ol(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Cf(e,t){return e!=null&&typeof e=="object"&&t in e}function Pg(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Lg=RegExp.prototype.test;function Mg(e,t){return Lg.call(e,t)}var kg=/\S/;function Bg(e){return!Mg(kg,e)}var Ug={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Fg(e){return String(e).replace(/[&<>"'`=\/]/g,function(t){return Ug[t]})}var Hg=/\s*/,$g=/\s+/,xf=/\s*=/,jg=/\s*\}/,Vg=/#|\^|\/|>|\{|&|=|!/;function Wg(e,t){if(!e)return[];var r=!1,n=[],i=[],s=[],o=!1,c=!1,u="",d=0;function g(){if(o&&!c)for(;s.length;)delete i[s.pop()];else s=[];o=!1,c=!1}var h,m,E;function v(B){if(typeof B=="string"&&(B=B.split($g,2)),!Qn(B)||B.length!==2)throw new Error("Invalid tags: "+B);h=new RegExp(ol(B[0])+"\\s*"),m=new RegExp("\\s*"+ol(B[1])),E=new RegExp("\\s*"+ol("}"+B[1]))}v(t||Vt.tags);for(var _=new to(e),D,P,M,L,R,G;!_.eos();){if(D=_.pos,M=_.scanUntil(h),M)for(var he=0,Ae=M.length;he<Ae;++he)L=M.charAt(he),Bg(L)?(s.push(i.length),u+=L):(c=!0,r=!0,u+=" "),i.push(["text",L,D,D+1]),D+=1,L===`
17
- `&&(g(),u="",d=0,r=!1);if(!_.scan(h))break;if(o=!0,P=_.scan(Vg)||"name",_.scan(Hg),P==="="?(M=_.scanUntil(xf),_.scan(xf),_.scanUntil(m)):P==="{"?(M=_.scanUntil(E),_.scan(jg),_.scanUntil(m),P="&"):M=_.scanUntil(m),!_.scan(m))throw new Error("Unclosed tag at "+_.pos);if(P==">"?R=[P,M,D,_.pos,u,d,r]:R=[P,M,D,_.pos],d++,i.push(R),P==="#"||P==="^")n.push(R);else if(P==="/"){if(G=n.pop(),!G)throw new Error('Unopened section "'+M+'" at '+D);if(G[1]!==M)throw new Error('Unclosed section "'+G[1]+'" at '+D)}else P==="name"||P==="{"||P==="&"?c=!0:P==="="&&v(M)}if(g(),G=n.pop(),G)throw new Error('Unclosed section "'+G[1]+'" at '+_.pos);return Yg(Gg(i))}function Gg(e){for(var t=[],r,n,i=0,s=e.length;i<s;++i)r=e[i],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(t.push(r),n=r));return t}function Yg(e){for(var t=[],r=t,n=[],i,s,o=0,c=e.length;o<c;++o)switch(i=e[o],i[0]){case"#":case"^":r.push(i),n.push(i),r=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],r=n.length>0?n[n.length-1][4]:t;break;default:r.push(i)}return t}function to(e){this.string=e,this.tail=e,this.pos=0}to.prototype.eos=function(){return this.tail===""};to.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};to.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function Jn(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Jn.prototype.push=function(e){return new Jn(e,this)};Jn.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var n=this,i,s,o,c=!1;n;){if(e.indexOf(".")>0)for(i=n.view,s=e.split("."),o=0;i!=null&&o<s.length;)o===s.length-1&&(c=Cf(i,s[o])||Pg(i,s[o])),i=i[s[o++]];else i=n.view[e],c=Cf(n.view,e);if(c){r=i;break}n=n.parent}t[e]=r}return sl(r)&&(r=r.call(this.view)),r};function bt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}bt.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};bt.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||Vt.tags).join(":"),i=typeof r<"u",s=i?r.get(n):void 0;return s==null&&(s=Wg(e,t),i&&r.set(n,s)),s};bt.prototype.render=function(e,t,r,n){var i=this.getConfigTags(n),s=this.parse(e,i),o=t instanceof Jn?t:new Jn(t,void 0);return this.renderTokens(s,o,r,e,n)};bt.prototype.renderTokens=function(e,t,r,n,i){for(var s="",o,c,u,d=0,g=e.length;d<g;++d)u=void 0,o=e[d],c=o[0],c==="#"?u=this.renderSection(o,t,r,n,i):c==="^"?u=this.renderInverted(o,t,r,n,i):c===">"?u=this.renderPartial(o,t,r,i):c==="&"?u=this.unescapedValue(o,t):c==="name"?u=this.escapedValue(o,t,i):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(s+=u);return s};bt.prototype.renderSection=function(e,t,r,n,i){var s=this,o="",c=t.lookup(e[1]);function u(h){return s.render(h,t,r,i)}if(c){if(Qn(c))for(var d=0,g=c.length;d<g;++d)o+=this.renderTokens(e[4],t.push(c[d]),r,n,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),r,n,i);else if(sl(c)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,n.slice(e[3],e[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,r,n,i);return o}};bt.prototype.renderInverted=function(e,t,r,n,i){var s=t.lookup(e[1]);if(!s||Qn(s)&&s.length===0)return this.renderTokens(e[4],t,r,n,i)};bt.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split(`
16
+ Cooee SDK: v${N.SDK_VERSION}`,console.group("%c Elevate your ecommerce experience with Cooee \u{1F680} ",e),console.log(`%c${t}`,"font-size: 13px; line-height: 1.8;"),console.groupEnd()}var Vh=_e(Yc()),Pe=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}},ot=_e(Dr()),Jr=_e(ns()),Ca=_e(qc()),cs,Ee,mf,Qc,ln,lf,df,Kc,hf,Zc,Xc,Jc,Bg,to={},gf=[],Ug=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,el=Array.isArray;function Vr(e,t){for(var r in t)e[r]=t[r];return e}function tl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rl(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?cs.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return ss(e,o,n,i,null)}function ss(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++mf,__i:-1,__u:0};return i==null&&Ee.vnode!=null&&Ee.vnode(s),s}function pr(e){return e.children}function ur(e,t){this.props=e,this.context=t}function Kn(e,t){if(t==null)return e.__?Kn(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Kn(e):null}function yf(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return yf(e)}}function uf(e){(!e.__d&&(e.__d=!0)&&ln.push(e)&&!as.__r++||lf!==Ee.debounceRendering)&&((lf=Ee.debounceRendering)||df)(as)}function as(){var e,t,r,n,i,s,o,c;for(ln.sort(Kc);e=ln.shift();)e.__d&&(t=ln.length,n=void 0,s=(i=(r=e).__v).__e,o=[],c=[],r.__P&&((n=Vr({},i)).__v=i.__v+1,Ee.vnode&&Ee.vnode(n),nl(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,o,s??Kn(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,_f(o,n,c),n.__e!=s&&yf(n)),ln.length>t&&ln.sort(Kc));as.__r=0}function vf(e,t,r,n,i,s,o,c,u,d,g){var h,m,E,y,_,x,P=n&&n.__k||gf,M=t.length;for(u=Fg(r,t,P,u,M),h=0;h<M;h++)(E=r.__k[h])!=null&&(m=E.__i===-1?to:P[E.__i]||to,E.__i=h,x=nl(e,E,m,i,s,o,c,u,d,g),y=E.__e,E.ref&&m.ref!=E.ref&&(m.ref&&il(m.ref,null,E),g.push(E.ref,E.__c||y,E)),_==null&&y!=null&&(_=y),4&E.__u||m.__k===E.__k?u=Ef(E,u,e):typeof E.type=="function"&&x!==void 0?u=x:y&&(u=y.nextSibling),E.__u&=-7);return r.__e=_,u}function Fg(e,t,r,n,i){var s,o,c,u,d,g=r.length,h=g,m=0;for(e.__k=new Array(i),s=0;s<i;s++)(o=t[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=s+m,(o=e.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?ss(null,o,null,null,null):el(o)?ss(pr,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?ss(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,c=null,(d=o.__i=Hg(o,r,u,h))!==-1&&(h--,(c=r[d])&&(c.__u|=2)),c==null||c.__v===null?(d==-1&&m--,typeof o.type!="function"&&(o.__u|=4)):d!=u&&(d==u-1?m--:d==u+1?m++:(d>u?m--:m++,o.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<g;s++)(c=r[s])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=Kn(c)),Sf(c,c));return n}function Ef(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ef(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Kn(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Hg(e,t,r,n){var i,s,o=e.key,c=e.type,u=t[r];if(u===null||u&&o==u.key&&c===u.type&&(2&u.__u)==0)return r;if(n>(u!=null&&(2&u.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<t.length;){if(i>=0){if((u=t[i])&&(2&u.__u)==0&&o==u.key&&c===u.type)return i;i--}if(s<t.length){if((u=t[s])&&(2&u.__u)==0&&o==u.key&&c===u.type)return s;s++}}return-1}function pf(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Ug.test(t)?r:r+"px"}function os(e,t,r,n,i){var s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||pf(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||pf(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(hf,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=Zc,e.addEventListener(t,s?Jc:Xc,s)):e.removeEventListener(t,s?Jc:Xc,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ff(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Zc++;else if(t.t<r.u)return;return r(Ee.event?Ee.event(t):t)}}}function nl(e,t,r,n,i,s,o,c,u,d){var g,h,m,E,y,_,x,P,M,L,k,G,ue,Re,B,Q,Y,J=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),s=[c=t.__e=r.__e]),(g=Ee.__b)&&g(t);e:if(typeof J=="function")try{if(P=t.props,M="prototype"in J&&J.prototype.render,L=(g=J.contextType)&&n[g.__c],k=g?L?L.props.value:g.__:n,r.__c?x=(h=t.__c=r.__c).__=h.__E:(M?t.__c=h=new J(P,k):(t.__c=h=new ur(P,k),h.constructor=J,h.render=jg),L&&L.sub(h),h.props=P,h.state||(h.state={}),h.context=k,h.__n=n,m=h.__d=!0,h.__h=[],h._sb=[]),M&&h.__s==null&&(h.__s=h.state),M&&J.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Vr({},h.__s)),Vr(h.__s,J.getDerivedStateFromProps(P,h.__s))),E=h.props,y=h.state,h.__v=t,m)M&&J.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),M&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(M&&J.getDerivedStateFromProps==null&&P!==E&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(P,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(P,h.__s,k)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=P,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(de){de&&(de.__=t)}),G=0;G<h._sb.length;G++)h.__h.push(h._sb[G]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(P,h.__s,k),M&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(E,y,_)})}if(h.context=k,h.props=P,h.__P=e,h.__e=!1,ue=Ee.__r,Re=0,M){for(h.state=h.__s,h.__d=!1,ue&&ue(t),g=h.render(h.props,h.state,h.context),B=0;B<h._sb.length;B++)h.__h.push(h._sb[B]);h._sb=[]}else do h.__d=!1,ue&&ue(t),g=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++Re<25);h.state=h.__s,h.getChildContext!=null&&(n=Vr(Vr({},n),h.getChildContext())),M&&!m&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(E,y)),c=vf(e,el(Q=g!=null&&g.type===pr&&g.key==null?g.props.children:g)?Q:[Q],t,r,n,i,s,o,c,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),x&&(h.__E=h.__=null)}catch(de){if(t.__v=null,u||s!=null)if(de.then){for(t.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,t.__e=c}else for(Y=s.length;Y--;)tl(s[Y]);else t.__e=r.__e,t.__k=r.__k;Ee.__e(de,t,r)}else s==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):c=t.__e=$g(r.__e,t,r,n,i,s,o,u,d);return(g=Ee.diffed)&&g(t),128&t.__u?void 0:c}function _f(e,t,r){for(var n=0;n<r.length;n++)il(r[n],r[++n],r[++n]);Ee.__c&&Ee.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){Ee.__e(s,i.__v)}})}function $g(e,t,r,n,i,s,o,c,u){var d,g,h,m,E,y,_,x=r.props,P=t.props,M=t.type;if(M=="svg"?i="http://www.w3.org/2000/svg":M=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(d=0;d<s.length;d++)if((E=s[d])&&"setAttribute"in E==!!M&&(M?E.localName==M:E.nodeType==3)){e=E,s[d]=null;break}}if(e==null){if(M==null)return document.createTextNode(P);e=document.createElementNS(i,M,P.is&&P),c&&(Ee.__m&&Ee.__m(t,s),c=!1),s=null}if(M===null)x===P||c&&e.data===P||(e.data=P);else{if(s=s&&cs.call(e.childNodes),x=r.props||to,!c&&s!=null)for(x={},d=0;d<e.attributes.length;d++)x[(E=e.attributes[d]).name]=E.value;for(d in x)if(E=x[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=E;else if(!(d in P)){if(d=="value"&&"defaultValue"in P||d=="checked"&&"defaultChecked"in P)continue;os(e,d,null,E,i)}}for(d in P)E=P[d],d=="children"?m=E:d=="dangerouslySetInnerHTML"?g=E:d=="value"?y=E:d=="checked"?_=E:c&&typeof E!="function"||x[d]===E||os(e,d,E,x[d],i);if(g)c||h&&(g.__html===h.__html||g.__html===e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(h&&(e.innerHTML=""),vf(e,el(m)?m:[m],t,r,n,M=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&Kn(r,0),c,u),s!=null)for(d=s.length;d--;)tl(s[d]);c||(d="value",M=="progress"&&y==null?e.removeAttribute("value"):y!==void 0&&(y!==e[d]||M=="progress"&&!y||M=="option"&&y!==x[d])&&os(e,d,y,x[d],i),d="checked",_!==void 0&&_!==e[d]&&os(e,d,_,x[d],i))}return e}function il(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){Ee.__e(i,r)}}function Sf(e,t,r){var n,i;if(Ee.unmount&&Ee.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||il(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){Ee.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Sf(n[i],t,r||typeof e.type!="function");r||tl(e.__e),e.__c=e.__=e.__e=void 0}function jg(e,t,r){return this.constructor(e,r)}function bf(e,t,r){var n,i,s,o;t==document&&(t=document.documentElement),Ee.__&&Ee.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],o=[],nl(t,e=(!n&&r||t).__k=rl(pr,null,[e]),i||to,to,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?cs.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,o),_f(s,e,o)}cs=gf.slice,Ee={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(c){e=c}throw e}},mf=0,Qc=function(e){return e!=null&&e.constructor==null},ur.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Vr({},this.state),typeof e=="function"&&(e=e(Vr({},r),this.props)),e&&Vr(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),uf(this))},ur.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),uf(this))},ur.prototype.render=pr,ln=[],df=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Kc=function(e,t){return e.__v.__b-t.__v.__b},as.__r=0,hf=/(PointerCapture)$|Capture$/i,Zc=0,Xc=ff(!1),Jc=ff(!0),Bg=0;var sl,Ot,ol,wf,If=0,Of=[],Ke=Ee,Tf=Ke.__b,Cf=Ke.__r,xf=Ke.diffed,Df=Ke.__c,Rf=Ke.unmount,Af=Ke.__;function Vg(e,t){Ke.__h&&Ke.__h(Ot,e,If||t),If=0;var r=Ot.__H||(Ot.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function cl(e,t){var r=Vg(sl++,7);return Yg(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Wg(){for(var e;e=Of.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ls),e.__H.__h.forEach(al),e.__H.__h=[]}catch(t){e.__H.__h=[],Ke.__e(t,e.__v)}}Ke.__b=function(e){Ot=null,Tf&&Tf(e)},Ke.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Af&&Af(e,t)},Ke.__r=function(e){Cf&&Cf(e),sl=0;var t=(Ot=e.__c).__H;t&&(ol===Ot?(t.__h=[],Ot.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(ls),t.__h.forEach(al),t.__h=[],sl=0)),ol=Ot},Ke.diffed=function(e){xf&&xf(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Of.push(t)!==1&&wf===Ke.requestAnimationFrame||((wf=Ke.requestAnimationFrame)||Gg)(Wg)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),ol=Ot=null},Ke.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ls),r.__h=r.__h.filter(function(n){return!n.__||al(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ke.__e(n,r.__v)}}),Df&&Df(e,t)},Ke.unmount=function(e){Rf&&Rf(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ls(n)}catch(i){t=i}}),r.__H=void 0,t&&Ke.__e(t,r.__v))};var Nf=typeof requestAnimationFrame=="function";function Gg(e){var t,r=function(){clearTimeout(n),Nf&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Nf&&(t=requestAnimationFrame(r))}function ls(e){var t=Ot,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Ot=t}function al(e){var t=Ot;e.__c=e.__(),Ot=t}function Yg(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var zg=Symbol.for("preact-signals");function ul(){if(Xn>1)Xn--;else{for(var e,t=!1;ro!==void 0;){var r=ro;for(ro=void 0,ll++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Lf(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(ll=0,Xn--,t)throw e}}var Ne=void 0,ro=void 0,Xn=0,ll=0,us=0;function Pf(e){if(Ne!==void 0){var t=e.n;if(t===void 0||t.t!==Ne)return t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t}}function Xe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}Xe.prototype.brand=zg;Xe.prototype.h=function(){return!0};Xe.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};Xe.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};Xe.prototype.subscribe=function(e){var t=this;return ct(function(){var r=t.value,n=Ne;Ne=void 0;try{e(r)}finally{Ne=n}})};Xe.prototype.valueOf=function(){return this.value};Xe.prototype.toString=function(){return this.value+""};Xe.prototype.toJSON=function(){return this.value};Xe.prototype.peek=function(){var e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}};Object.defineProperty(Xe.prototype,"value",{get:function(){var e=Pf(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ll>100)throw new Error("Cycle detected");this.v=e,this.i++,us++,Xn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{ul()}}}});function Ht(e){return new Xe(e)}function Lf(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Mf(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function kf(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Jn(e){Xe.call(this,void 0),this.x=e,this.s=void 0,this.g=us-1,this.f=4}(Jn.prototype=new Xe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===us))return!0;if(this.g=us,this.f|=1,this.i>0&&!Lf(this))return this.f&=-2,!0;var e=Ne;try{Mf(this),Ne=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Ne=e,kf(this),this.f&=-2,!0};Jn.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Xe.prototype.S.call(this,e)};Jn.prototype.U=function(e){if(this.t!==void 0&&(Xe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Jn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Jn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Pf(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function pl(e){return new Jn(e)}function Bf(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Xn++;var r=Ne;Ne=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,fl(e),n}finally{Ne=r,ul()}}}function fl(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Bf(e)}function qg(e){if(Ne!==this)throw new Error("Out-of-order effect");kf(this),Ne=e,this.f&=-2,8&this.f&&fl(this),ul()}function no(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}no.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};no.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Bf(this),Mf(this),Xn++;var e=Ne;return Ne=this,qg.bind(this,e)};no.prototype.N=function(){2&this.f||(this.f|=2,this.o=ro,ro=this)};no.prototype.d=function(){this.f|=8,1&this.f||fl(this)};function ct(e){var t=new no(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var dl,ml;function Qn(e,t){Ee[e]=t.bind(null,Ee[e]||function(){})}function ps(e){ml&&ml(),ml=e&&e.S()}function Uf(e){var t=this,r=e.data,n=Xg(r);n.value=r;var i=cl(function(){for(var s=t.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return t.__$u.c=function(){var o,c=t.__$u.S(),u=i.value;c(),Qc(u)||((o=t.base)==null?void 0:o.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=u},pl(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}Uf.displayName="_st";Object.defineProperties(Xe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Uf},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Qn("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var s=n[i];s instanceof Xe&&(r||(t.__np=r={}),r[i]=s,n[i]=s.peek())}}e(t)});Qn("__r",function(e,t){ps();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var s;return ct(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),dl=n,ps(r),e(t)});Qn("__e",function(e,t,r,n){ps(),dl=void 0,e(t,r,n)});Qn("diffed",function(e,t){ps(),dl=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var s=r.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in n)&&(c.d(),s[o]=void 0)}else r.U=s={};for(var u in n){var d=s[u],g=n[u];d===void 0?(d=Kg(r,u,g,i),s[u]=d):d.o(g,i)}}}e(t)});function Kg(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,s=Ht(r);return{o:function(o,c){s.value=o,n=c},d:ct(function(){var o=s.value.value;n[t]!==o&&(n[t]=o,i?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}Qn("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var s=n[i];s&&s.d()}}}}else{var o=t.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}e(t)});Qn("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});ur.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Xg(e){return cl(function(){return Ht(e)},[])}var Jg=Object.prototype.toString,ei=Array.isArray||function(e){return Jg.call(e)==="[object Array]"};function gl(e){return typeof e=="function"}function Qg(e){return ei(e)?"array":typeof e}function hl(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ff(e,t){return e!=null&&typeof e=="object"&&t in e}function Zg(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var ey=RegExp.prototype.test;function ty(e,t){return ey.call(e,t)}var ry=/\S/;function ny(e){return!ty(ry,e)}var iy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function oy(e){return String(e).replace(/[&<>"'`=\/]/g,function(t){return iy[t]})}var sy=/\s*/,ay=/\s+/,Hf=/\s*=/,cy=/\s*\}/,ly=/#|\^|\/|>|\{|&|=|!/;function uy(e,t){if(!e)return[];var r=!1,n=[],i=[],s=[],o=!1,c=!1,u="",d=0;function g(){if(o&&!c)for(;s.length;)delete i[s.pop()];else s=[];o=!1,c=!1}var h,m,E;function y(B){if(typeof B=="string"&&(B=B.split(ay,2)),!ei(B)||B.length!==2)throw new Error("Invalid tags: "+B);h=new RegExp(hl(B[0])+"\\s*"),m=new RegExp("\\s*"+hl(B[1])),E=new RegExp("\\s*"+hl("}"+B[1]))}y(t||$t.tags);for(var _=new oo(e),x,P,M,L,k,G;!_.eos();){if(x=_.pos,M=_.scanUntil(h),M)for(var ue=0,Re=M.length;ue<Re;++ue)L=M.charAt(ue),ny(L)?(s.push(i.length),u+=L):(c=!0,r=!0,u+=" "),i.push(["text",L,x,x+1]),x+=1,L===`
17
+ `&&(g(),u="",d=0,r=!1);if(!_.scan(h))break;if(o=!0,P=_.scan(ly)||"name",_.scan(sy),P==="="?(M=_.scanUntil(Hf),_.scan(Hf),_.scanUntil(m)):P==="{"?(M=_.scanUntil(E),_.scan(cy),_.scanUntil(m),P="&"):M=_.scanUntil(m),!_.scan(m))throw new Error("Unclosed tag at "+_.pos);if(P==">"?k=[P,M,x,_.pos,u,d,r]:k=[P,M,x,_.pos],d++,i.push(k),P==="#"||P==="^")n.push(k);else if(P==="/"){if(G=n.pop(),!G)throw new Error('Unopened section "'+M+'" at '+x);if(G[1]!==M)throw new Error('Unclosed section "'+G[1]+'" at '+x)}else P==="name"||P==="{"||P==="&"?c=!0:P==="="&&y(M)}if(g(),G=n.pop(),G)throw new Error('Unclosed section "'+G[1]+'" at '+_.pos);return fy(py(i))}function py(e){for(var t=[],r,n,i=0,s=e.length;i<s;++i)r=e[i],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(t.push(r),n=r));return t}function fy(e){for(var t=[],r=t,n=[],i,s,o=0,c=e.length;o<c;++o)switch(i=e[o],i[0]){case"#":case"^":r.push(i),n.push(i),r=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],r=n.length>0?n[n.length-1][4]:t;break;default:r.push(i)}return t}function oo(e){this.string=e,this.tail=e,this.pos=0}oo.prototype.eos=function(){return this.tail===""};oo.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};oo.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function Zn(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Zn.prototype.push=function(e){return new Zn(e,this)};Zn.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var n=this,i,s,o,c=!1;n;){if(e.indexOf(".")>0)for(i=n.view,s=e.split("."),o=0;i!=null&&o<s.length;)o===s.length-1&&(c=Ff(i,s[o])||Zg(i,s[o])),i=i[s[o++]];else i=n.view[e],c=Ff(n.view,e);if(c){r=i;break}n=n.parent}t[e]=r}return gl(r)&&(r=r.call(this.view)),r};function _t(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}_t.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};_t.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||$t.tags).join(":"),i=typeof r<"u",s=i?r.get(n):void 0;return s==null&&(s=uy(e,t),i&&r.set(n,s)),s};_t.prototype.render=function(e,t,r,n){var i=this.getConfigTags(n),s=this.parse(e,i),o=t instanceof Zn?t:new Zn(t,void 0);return this.renderTokens(s,o,r,e,n)};_t.prototype.renderTokens=function(e,t,r,n,i){for(var s="",o,c,u,d=0,g=e.length;d<g;++d)u=void 0,o=e[d],c=o[0],c==="#"?u=this.renderSection(o,t,r,n,i):c==="^"?u=this.renderInverted(o,t,r,n,i):c===">"?u=this.renderPartial(o,t,r,i):c==="&"?u=this.unescapedValue(o,t):c==="name"?u=this.escapedValue(o,t,i):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(s+=u);return s};_t.prototype.renderSection=function(e,t,r,n,i){var s=this,o="",c=t.lookup(e[1]);function u(h){return s.render(h,t,r,i)}if(c){if(ei(c))for(var d=0,g=c.length;d<g;++d)o+=this.renderTokens(e[4],t.push(c[d]),r,n,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),r,n,i);else if(gl(c)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,n.slice(e[3],e[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,r,n,i);return o}};_t.prototype.renderInverted=function(e,t,r,n,i){var s=t.lookup(e[1]);if(!s||ei(s)&&s.length===0)return this.renderTokens(e[4],t,r,n,i)};_t.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split(`
18
18
  `),s=0;s<i.length;s++)i[s].length&&(s>0||!r)&&(i[s]=n+i[s]);return i.join(`
19
- `)};bt.prototype.renderPartial=function(e,t,r,n){if(r){var i=this.getConfigTags(n),s=sl(r)?r(e[1]):r[e[1]];if(s!=null){var o=e[6],c=e[5],u=e[4],d=s;c==0&&u&&(d=this.indentPartial(s,u,o));var g=this.parse(d,i);return this.renderTokens(g,t,r,d,n)}}};bt.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};bt.prototype.escapedValue=function(e,t,r){var n=this.getConfigEscape(r)||Vt.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&n===Vt.escape?String(i):n(i)};bt.prototype.rawValue=function(e){return e[1]};bt.prototype.getConfigTags=function(e){return Qn(e)?e:e&&typeof e=="object"?e.tags:void 0};bt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Qn(e))return e.escape};var Vt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){eo.templateCache=e},get templateCache(){return eo.templateCache}},eo=new bt;Vt.clearCache=function(){return eo.clearCache()};Vt.parse=function(e,t){return eo.parse(e,t)};Vt.render=function(e,t,r,n){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Og(e)+'" was given as the first argument for mustache#render(template, view, partials)');return eo.render(e,t,r,n)};Vt.escape=Fg;Vt.Scanner=to;Vt.Context=Jn;Vt.Writer=bt;var wt=Vt,Rf=Se(Df()),Mt=class jn{static DOCUMENT_STANDARD_MODE="CSS1Compat";static _instance;parentContainer;scalingFactor=1;doc=document;parser=new Rf.default;constructor(){}static get(){return jn._instance||(jn._instance=new jn),jn._instance}getUAParser(){return this.parser}getWidth(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===jn.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===jn.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}isMobile(){return this.parser.getDevice().type==="mobile"}calculateScalingFactor(t){let r=t.max,n=t.cont.w,i=t.cont.h,s=t.spc,o=jn.get().getWidth(),c=jn.get().getHeight();r&&(o=o?Math.min(o,r):r,c=c?Math.min(c,r):r),c&&(o-=s.getHorizontal(),c-=s.getVertical(),o/c<n/i?this.scalingFactor=o/n:this.scalingFactor=c/i,this.scalingFactor=Math.min(this.scalingFactor,1))}getScalingFactor(){return this.scalingFactor}createElement(t){return this.doc.createElement(t)}appendChild(t,r){t.appendChild(r)}setStyles(t,r){Object.assign(t.style,r)}setStyle(t,r,n){if(r){if(!n){t.style.removeProperty(r);return}t.style.setProperty(r,n,"important")}}setAttribute(t,r,n){t.setAttribute(r,n)}removeInApp(t){let r=document.querySelector(`.${t.rootClassName}`);r&&r.parentElement.removeChild(r)}setParentContainer(t){this.parentContainer=t,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")}isParentNotBody(){return this.parentContainer!==document.body}},oe=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"},cl=Se(Nf());function Zn(e){return cl.default.createInstance({name:"lc",storeName:e,driver:cl.default.LOCALSTORAGE})}var Gr=class{static storage;static async get(e,t){return await this.storage?.getItem(e)??t}static set(e,t){return this.storage?.setItem(e,t)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},nt=class extends Gr{static storeName="ses";static{this.storage=Zn(this.storeName)}},De=class extends Gr{static storeName="usr";static{this.storage=Zn(this.storeName)}},dt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price}},ue=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;activeExperiment;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(e){this._currencyCode=e}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(e){this.currentItem=new dt(e)}},ke=class{static COOEE_URL_PREFIX="?from=cooee";static isShopify(){return!!window.Shopify}static getShopName(){if(this.isShopify())return window.Shopify.shop?.split(".")?.[0]}static getPageName(){if(!this.isShopify())return;let e=new URL(window.location.href).pathname.slice(1).split("/"),t=e[0];if(t==="")return"home";if(t==="collections")return e[2]==="products"?"product":"collection";if(t==="products")return"product";if(t==="cart")return"cart";if(location.href.includes("thank_you"))return"thank_you"}static getProductSlug(e){let t=(e.includes("://")?new URL(e).pathname:e).match(/\/products\/([^/]+?)(?:\.html)?$/);return t?t[1]:null}static getRootPrefix(){return window.Shopify?.routes?.root??"/"}static getCartURL(e){return this.getRootPrefix()+e+this.COOEE_URL_PREFIX}},ei=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e()}else this.isLocked=!1}},fe=class Ph{static CURRENT;token;items;total_price;original_total_price;currency;item_count;attributes;lock=new ei;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new Ph),this.CURRENT}async getNormalisedCart(t){await this.fetchCartFromShopify(t);let r=this.convertToCooeeCart();return t&&await De.set(oe.CURRENT_CART,r),r}async addCooeeAttributes(){await this.lock.acquire();let t=await nt.get(oe.ID),r=await De.get(oe.DEVICE_ID);if(this.attributes?.letscooee_did===r&&this.attributes?.letscooee_sid===t){w.debug("Not calling Shopify update.js API.","Current attributes:",this.attributes),this.lock.release();return}let n={letscooee_did:r,letscooee_sid:t,__letscooee_time:new Date().toLocaleString()};w.debug("Updating Shopify cart with attributes:",n);let i=ke.getCartURL("cart/update.js"),s=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:n})})).json();w.debug("Updated cart attributes",JSON.stringify(s)),this.update(s),this.lock.release()}update(t){return this.token=t.token,this.items=t.items,this.total_price=t.total_price,this.original_total_price=t.original_total_price,this.currency=t.currency,this.item_count=t.item_count,this.attributes=t.attributes,ue.get().currencyCode=this.currency,w.log("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}convertToCooeeCart(){return{amount:this.total_price/100,originalAmount:this.original_total_price/100,currency:this.currency,itemCount:this.item_count,items:this.normaliseItems(this.items),token:this.token}}normaliseItems(t){if(!t)return w.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let r=[];for(let n of t){if(!n.id||!n.title){w.warn("Invalid item received",n);continue}let i={name:n.title,quantity:+n.quantity||1,mID:n.product_id?.toString(),vID:n.id.toString(),price:+n.price/100||0,properties:n.properties,key:n.key},s=n.selling_plan_allocation?.selling_plan;if(!s){r.push(i);continue}i.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:s.fixed_selling_plan,id:s.id,name:s.name,recurringDeliveries:s.recurring_deliveries}},r.push(i)}return r}async fetchCartFromShopify(t){if(!t&&this.token){w.debug("Not fetching cart");return}w.debug("Fetching cart");let r=ke.getCartURL("cart.js"),n=await(await fetch(r)).json();this.update(n)}},cs=class{static format(e,t){let r=/{{\s*(\w+)\s*}}/;return t.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return n}})}static formatWithDelimiters(e,t=2,r=",",n="."){if(isNaN(e)||e==null)return"0";let i=(e/100).toFixed(t).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}},Qm=Se(ri()),Of=Object.prototype.toString;function ln(e){switch(Of.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return mr(e,Error)}}function ni(e,t){return Of.call(e)===`[object ${t}]`}function us(e){return ni(e,"ErrorEvent")}function ps(e){return ni(e,"DOMError")}function ll(e){return ni(e,"DOMException")}function It(e){return ni(e,"String")}function ii(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||ii(e)||typeof e!="object"&&typeof e!="function"}function rr(e){return ni(e,"Object")}function pn(e){return typeof Event<"u"&&mr(e,Event)}function ul(e){return typeof Element<"u"&&mr(e,Element)}function pl(e){return ni(e,"RegExp")}function Ar(e){return!!(e&&e.then&&typeof e.then=="function")}function fl(e){return rr(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function mr(e,t){try{return e instanceof t}catch{return!1}}function no(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function dr(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function fs(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let i=e[n];try{no(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Pf(e,t,r=!1){return It(e)?pl(t)?t.test(e):It(t)?r?e===t:e.includes(t):!1:!1}function oi(e,t=[],r=!1){return t.some(n=>Pf(e,n,r))}function dl(e,t,r=250,n,i,s,o){if(!s.exception||!s.exception.values||!o||!mr(o.originalException,Error))return;let c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;c&&(s.exception.values=qg(ml(e,t,i,o.originalException,n,s.exception.values,c,0),r))}function ml(e,t,r,n,i,s,o,c){if(s.length>=r+1)return s;let u=[...s];if(mr(n[i],Error)){Lf(o,c);let d=e(t,n[i]),g=u.length;Mf(d,i,g,c),u=ml(e,t,r,n[i],i,[d,...u],d,g)}return Array.isArray(n.errors)&&n.errors.forEach((d,g)=>{if(mr(d,Error)){Lf(o,c);let h=e(t,d),m=u.length;Mf(h,`errors[${g}]`,m,c),u=ml(e,t,r,d,i,[h,...u],h,m)}}),u}function Lf(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=te(b(b({},e.mechanism),e.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:t})}function Mf(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=te(b({},e.mechanism),{type:"chained",source:t,exception_id:r,parent_id:n})}function qg(e,t){return e.map(r=>(r.value&&(r.value=dr(r.value,t)),r))}var Wt="8.18.0",re=globalThis;function si(e,t,r){let n=r||re,i=n.__SENTRY__=n.__SENTRY__||{},s=i[Wt]=i[Wt]||{};return s[e]||(s[e]=t())}var hl=re,Kg=80;function io(e,t={}){if(!e)return"<unknown>";try{let r=e,n=5,i=[],s=0,o=0,c=" > ",u=c.length,d,g=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||Kg;for(;r&&s++<n&&(d=Xg(r,g),!(d==="html"||s>1&&o+i.length*u+d.length>=h));)i.push(d),o+=d.length,r=r.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function Xg(e,t){let r=e,n=[];if(!r||!r.tagName)return"";if(hl.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());let i=t&&t.length?t.filter(o=>r.getAttribute(o)).map(o=>[o,r.getAttribute(o)]):null;if(i&&i.length)i.forEach(o=>{n.push(`[${o[0]}="${o[1]}"]`)});else{r.id&&n.push(`#${r.id}`);let o=r.className;if(o&&It(o)){let c=o.split(/\s+/);for(let u of c)n.push(`.${u}`)}}let s=["aria-label","type","name","title","alt"];for(let o of s){let c=r.getAttribute(o);c&&n.push(`[${o}="${c}"]`)}return n.join("")}function gl(){try{return hl.document.location.href}catch{return""}}function yl(e){if(!hl.HTMLElement)return null;let t=e,r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}var hr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Jg="Sentry Logger ",oo=["debug","info","warn","error","log","assert","trace"],ai={};function ci(e){if(!("console"in re))return e();let t=re.console,r={},n=Object.keys(ai);n.forEach(i=>{let s=ai[i];r[i]=t[i],t[i]=s});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function Qg(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return hr?oo.forEach(r=>{t[r]=(...n)=>{e&&ci(()=>{re.console[r](`${Jg}[${r}]:`,...n)})}}):oo.forEach(r=>{t[r]=()=>{}}),t}var K=Qg(),Zg=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ey(e){return e==="http"||e==="https"}function gr(e,t=!1){let{host:r,path:n,pass:i,port:s,projectId:o,protocol:c,publicKey:u}=e;return`${c}://${u}${t&&i?`:${i}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${o}`}function kf(e){let t=Zg.exec(e);if(!t){ci(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,n,i="",s="",o="",c=""]=t.slice(1),u="",d=c,g=d.split("/");if(g.length>1&&(u=g.slice(0,-1).join("/"),d=g.pop()),d){let h=d.match(/^\d+/);h&&(d=h[0])}return Bf({host:s,pass:i,path:u,projectId:d,port:o,protocol:r,publicKey:n})}function Bf(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ty(e){if(!hr)return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(K.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?ey(n)?t&&isNaN(parseInt(t,10))?(K.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(K.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(K.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function ms(e){let t=typeof e=="string"?kf(e):Bf(e);if(!(!t||!ty(t)))return t}var ht=class extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function Be(e,t,r){if(!(t in e))return;let n=e[t],i=r(n);typeof i=="function"&&ds(i,n),e[t]=i}function Tt(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{hr&&K.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ds(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,Tt(e,"__sentry_original__",t)}catch{}}function fn(e){return e.__sentry_original__}function El(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function hs(e){if(ln(e))return b({message:e.message,name:e.name,stack:e.stack},Ff(e));if(pn(e)){let t=b({type:e.type,target:Uf(e.target),currentTarget:Uf(e.currentTarget)},Ff(e));return typeof CustomEvent<"u"&&mr(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Uf(e){try{return ul(e)?io(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Ff(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function _l(e,t=40){let r=Object.keys(hs(e));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return dr(n,t);for(let i=r.length;i>0;i--){let s=r.slice(0,i).join(", ");if(!(s.length>t))return i===r.length?s:dr(s,t)}return""}function Ze(e){return vl(e,new Map)}function vl(e,t){if(ry(e)){let r=t.get(e);if(r!==void 0)return r;let n={};t.set(e,n);for(let i of Object.keys(e))typeof e[i]<"u"&&(n[i]=vl(e[i],t));return n}if(Array.isArray(e)){let r=t.get(e);if(r!==void 0)return r;let n=[];return t.set(e,n),e.forEach(i=>{n.push(vl(i,t))}),n}return e}function ry(e){if(!rr(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}var yr="?",Hf=/\(error: (.*)\)/,$f=/captureMessage|captureException/;function bl(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{let s=[],o=r.split(`
20
- `);for(let c=n;c<o.length;c++){let u=o[c];if(u.length>1024)continue;let d=Hf.test(u)?u.replace(Hf,"$1"):u;if(!d.match(/\S*Error: /)){for(let g of t){let h=g(d);if(h){s.push(h);break}}if(s.length>=50+i)break}}return jf(s.slice(i))}}function jf(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(gs(t).function||"")&&t.pop(),t.reverse(),$f.test(gs(t).function||"")&&(t.pop(),$f.test(gs(t).function||"")&&t.pop()),t.slice(0,50).map(r=>te(b({},r),{filename:r.filename||gs(t).filename,function:r.function||yr}))}function gs(e){return e[e.length-1]||{}}var Sl="<anonymous>";function Gt(e){try{return!e||typeof e!="function"?Sl:e.name||Sl}catch{return Sl}}function ys(e){let t=e.exception;if(t){let r=[];try{return t.values.forEach(n=>{n.stacktrace.frames&&r.push(...n.stacktrace.frames)}),r}catch{return}}}var vs={},Vf={};function Ct(e,t){vs[e]=vs[e]||[],vs[e].push(t)}function xt(e,t){Vf[e]||(t(),Vf[e]=!0)}function et(e,t){let r=e&&vs[e];if(r)for(let n of r)try{n(t)}catch(i){hr&&K.error(`Error while triggering instrumentation handler.
19
+ `)};_t.prototype.renderPartial=function(e,t,r,n){if(r){var i=this.getConfigTags(n),s=gl(r)?r(e[1]):r[e[1]];if(s!=null){var o=e[6],c=e[5],u=e[4],d=s;c==0&&u&&(d=this.indentPartial(s,u,o));var g=this.parse(d,i);return this.renderTokens(g,t,r,d,n)}}};_t.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};_t.prototype.escapedValue=function(e,t,r){var n=this.getConfigEscape(r)||$t.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&n===$t.escape?String(i):n(i)};_t.prototype.rawValue=function(e){return e[1]};_t.prototype.getConfigTags=function(e){return ei(e)?e:e&&typeof e=="object"?e.tags:void 0};_t.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!ei(e))return e.escape};var $t={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){io.templateCache=e},get templateCache(){return io.templateCache}},io=new _t;$t.clearCache=function(){return io.clearCache()};$t.parse=function(e,t){return io.parse(e,t)};$t.render=function(e,t,r,n){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Qg(e)+'" was given as the first argument for mustache#render(template, view, partials)');return io.render(e,t,r,n)};$t.escape=oy;$t.Scanner=oo;$t.Context=Zn;$t.Writer=_t;var St=$t,jf=_e($f()),Pt=class Vn{static DOCUMENT_STANDARD_MODE="CSS1Compat";static _instance;parentContainer;scalingFactor=1;doc=document;parser=new jf.default;constructor(){}static get(){return Vn._instance||(Vn._instance=new Vn),Vn._instance}getUAParser(){return this.parser}getWidth(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===Vn.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===Vn.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}isMobile(){return this.parser.getDevice().type==="mobile"}calculateScalingFactor(t){let r=t.max,n=t.cont.w,i=t.cont.h,s=t.spc,o=Vn.get().getWidth(),c=Vn.get().getHeight();r&&(o=o?Math.min(o,r):r,c=c?Math.min(c,r):r),c&&(o-=s.getHorizontal(),c-=s.getVertical(),o/c<n/i?this.scalingFactor=o/n:this.scalingFactor=c/i,this.scalingFactor=Math.min(this.scalingFactor,1))}getScalingFactor(){return this.scalingFactor}createElement(t){return this.doc.createElement(t)}appendChild(t,r){t.appendChild(r)}setStyles(t,r){Object.assign(t.style,r)}setStyle(t,r,n){if(r){if(!n){t.style.removeProperty(r);return}t.style.setProperty(r,n,"important")}}setAttribute(t,r,n){t.setAttribute(r,n)}removeInApp(t){let r=document.querySelector(`.${t.rootClassName}`);r&&r.parentElement.removeChild(r)}setParentContainer(t){this.parentContainer=t,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")}isParentNotBody(){return this.parentContainer!==document.body}},oe=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"},vl=_e(Wf());function ti(e){return vl.default.createInstance({name:"lc",storeName:e,driver:vl.default.LOCALSTORAGE})}var Wr=class{static storage;static async get(e,t){return await this.storage?.getItem(e)??t}static set(e,t){return this.storage?.setItem(e,t)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},tt=class extends Wr{static storeName="ses";static{this.storage=ti(this.storeName)}},xe=class extends Wr{static storeName="usr";static{this.storage=ti(this.storeName)}},ft=class{id;mID;vID;vName;imageURL;name;link;quantity;price;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price}},le=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;activeExperiment;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(e){this._currencyCode=e}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(e){this.currentItem=new ft(e)}},my="?from=cooee";function ao(){return!!window.Shopify}function Gf(){if(ao())return window.Shopify.shop?.split(".")?.[0]}function Yf(e){let t=(e.includes("://")?new URL(e).pathname:e).match(/\/products\/([^/]+?)(?:\.html)?$/);return t?t[1]:null}function ri(){return window.Shopify?.routes?.root??"/"}function un(e){return ri()+e+my}var ni=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e()}else this.isLocked=!1}},pe=class Qh{static CURRENT;token;items;total_price;original_total_price;currency;item_count;attributes;lock=new ni;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new Qh),this.CURRENT}async getNormalisedCart(t){await this.fetchCartFromShopify(t);let r=this.convertToCooeeCart();return t&&await xe.set(oe.CURRENT_CART,r),r}async addCooeeAttributes(){await this.lock.acquire();let t=await tt.get(oe.ID),r=await xe.get(oe.DEVICE_ID);if(this.attributes?.letscooee_did===r&&this.attributes?.letscooee_sid===t){w.debug("Not calling Shopify update.js API.","Current attributes:",this.attributes),this.lock.release();return}let n={letscooee_did:r,letscooee_sid:t,__letscooee_time:new Date().toLocaleString()};w.debug("Updating Shopify cart with attributes:",n);let i=un("cart/update.js"),s=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:n})})).json();w.debug("Updated cart attributes",JSON.stringify(s)),this.update(s),this.lock.release()}update(t){return this.token=t.token,this.items=t.items,this.total_price=t.total_price,this.original_total_price=t.original_total_price,this.currency=t.currency,this.item_count=t.item_count,this.attributes=t.attributes,le.get().currencyCode=this.currency,w.log("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}convertToCooeeCart(){return{amount:this.total_price/100,originalAmount:this.original_total_price/100,currency:this.currency,itemCount:this.item_count,items:this.normaliseItems(this.items),token:this.token}}normaliseItems(t){if(!t)return w.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let r=[];for(let n of t){if(!n.id||!n.title){w.warn("Invalid item received",n);continue}let i={name:n.title,quantity:+n.quantity||1,mID:n.product_id?.toString(),vID:n.id.toString(),price:+n.price/100||0,properties:n.properties,key:n.key},s=n.selling_plan_allocation?.selling_plan;if(!s){r.push(i);continue}i.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:s.fixed_selling_plan,id:s.id,name:s.name,recurringDeliveries:s.recurring_deliveries}},r.push(i)}return r}async fetchCartFromShopify(t){if(!t&&this.token){w.debug("Not fetching cart");return}w.debug("Fetching cart");let r=un("cart.js"),n=await(await fetch(r)).json();this.update(n)}},dd=_e(oi()),zf=Object.prototype.toString;function pn(e){switch(zf.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return fr(e,Error)}}function si(e,t){return zf.call(e)===`[object ${t}]`}function ds(e){return si(e,"ErrorEvent")}function hs(e){return si(e,"DOMError")}function El(e){return si(e,"DOMException")}function bt(e){return si(e,"String")}function ai(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function fn(e){return e===null||ai(e)||typeof e!="object"&&typeof e!="function"}function tr(e){return si(e,"Object")}function mn(e){return typeof Event<"u"&&fr(e,Event)}function _l(e){return typeof Element<"u"&&fr(e,Element)}function Sl(e){return si(e,"RegExp")}function Rr(e){return!!(e&&e.then&&typeof e.then=="function")}function bl(e){return tr(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function fr(e,t){try{return e instanceof t}catch{return!1}}function co(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function mr(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function gs(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let i=e[n];try{co(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function qf(e,t,r=!1){return bt(e)?Sl(t)?t.test(e):bt(t)?r?e===t:e.includes(t):!1:!1}function ci(e,t=[],r=!1){return t.some(n=>qf(e,n,r))}function Il(e,t,r=250,n,i,s,o){if(!s.exception||!s.exception.values||!o||!fr(o.originalException,Error))return;let c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;c&&(s.exception.values=hy(wl(e,t,i,o.originalException,n,s.exception.values,c,0),r))}function wl(e,t,r,n,i,s,o,c){if(s.length>=r+1)return s;let u=[...s];if(fr(n[i],Error)){Kf(o,c);let d=e(t,n[i]),g=u.length;Xf(d,i,g,c),u=wl(e,t,r,n[i],i,[d,...u],d,g)}return Array.isArray(n.errors)&&n.errors.forEach((d,g)=>{if(fr(d,Error)){Kf(o,c);let h=e(t,d),m=u.length;Xf(h,`errors[${g}]`,m,c),u=wl(e,t,r,d,i,[h,...u],h,m)}}),u}function Kf(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=ee(b(b({},e.mechanism),e.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:t})}function Xf(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=ee(b({},e.mechanism),{type:"chained",source:t,exception_id:r,parent_id:n})}function hy(e,t){return e.map(r=>(r.value&&(r.value=mr(r.value,t)),r))}var jt="8.18.0",te=globalThis;function li(e,t,r){let n=r||te,i=n.__SENTRY__=n.__SENTRY__||{},s=i[jt]=i[jt]||{};return s[e]||(s[e]=t())}var Tl=te,gy=80;function lo(e,t={}){if(!e)return"<unknown>";try{let r=e,n=5,i=[],s=0,o=0,c=" > ",u=c.length,d,g=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||gy;for(;r&&s++<n&&(d=yy(r,g),!(d==="html"||s>1&&o+i.length*u+d.length>=h));)i.push(d),o+=d.length,r=r.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function yy(e,t){let r=e,n=[];if(!r||!r.tagName)return"";if(Tl.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());let i=t&&t.length?t.filter(o=>r.getAttribute(o)).map(o=>[o,r.getAttribute(o)]):null;if(i&&i.length)i.forEach(o=>{n.push(`[${o[0]}="${o[1]}"]`)});else{r.id&&n.push(`#${r.id}`);let o=r.className;if(o&&bt(o)){let c=o.split(/\s+/);for(let u of c)n.push(`.${u}`)}}let s=["aria-label","type","name","title","alt"];for(let o of s){let c=r.getAttribute(o);c&&n.push(`[${o}="${c}"]`)}return n.join("")}function Cl(){try{return Tl.document.location.href}catch{return""}}function xl(e){if(!Tl.HTMLElement)return null;let t=e,r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}var dr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,vy="Sentry Logger ",uo=["debug","info","warn","error","log","assert","trace"],ui={};function pi(e){if(!("console"in te))return e();let t=te.console,r={},n=Object.keys(ui);n.forEach(i=>{let s=ui[i];r[i]=t[i],t[i]=s});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function Ey(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return dr?uo.forEach(r=>{t[r]=(...n)=>{e&&pi(()=>{te.console[r](`${vy}[${r}]:`,...n)})}}):uo.forEach(r=>{t[r]=()=>{}}),t}var K=Ey(),_y=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Sy(e){return e==="http"||e==="https"}function hr(e,t=!1){let{host:r,path:n,pass:i,port:s,projectId:o,protocol:c,publicKey:u}=e;return`${c}://${u}${t&&i?`:${i}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${o}`}function Jf(e){let t=_y.exec(e);if(!t){pi(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,n,i="",s="",o="",c=""]=t.slice(1),u="",d=c,g=d.split("/");if(g.length>1&&(u=g.slice(0,-1).join("/"),d=g.pop()),d){let h=d.match(/^\d+/);h&&(d=h[0])}return Qf({host:s,pass:i,path:u,projectId:d,port:o,protocol:r,publicKey:n})}function Qf(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function by(e){if(!dr)return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(K.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?Sy(n)?t&&isNaN(parseInt(t,10))?(K.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(K.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(K.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function ys(e){let t=typeof e=="string"?Jf(e):Qf(e);if(!(!t||!by(t)))return t}var mt=class extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function Me(e,t,r){if(!(t in e))return;let n=e[t],i=r(n);typeof i=="function"&&vs(i,n),e[t]=i}function wt(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{dr&&K.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function vs(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,wt(e,"__sentry_original__",t)}catch{}}function dn(e){return e.__sentry_original__}function Rl(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Es(e){if(pn(e))return b({message:e.message,name:e.name,stack:e.stack},em(e));if(mn(e)){let t=b({type:e.type,target:Zf(e.target),currentTarget:Zf(e.currentTarget)},em(e));return typeof CustomEvent<"u"&&fr(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Zf(e){try{return _l(e)?lo(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function em(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function Al(e,t=40){let r=Object.keys(Es(e));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return mr(n,t);for(let i=r.length;i>0;i--){let s=r.slice(0,i).join(", ");if(!(s.length>t))return i===r.length?s:mr(s,t)}return""}function Je(e){return Dl(e,new Map)}function Dl(e,t){if(wy(e)){let r=t.get(e);if(r!==void 0)return r;let n={};t.set(e,n);for(let i of Object.keys(e))typeof e[i]<"u"&&(n[i]=Dl(e[i],t));return n}if(Array.isArray(e)){let r=t.get(e);if(r!==void 0)return r;let n=[];return t.set(e,n),e.forEach(i=>{n.push(Dl(i,t))}),n}return e}function wy(e){if(!tr(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}var gr="?",tm=/\(error: (.*)\)/,rm=/captureMessage|captureException/;function Ol(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{let s=[],o=r.split(`
20
+ `);for(let c=n;c<o.length;c++){let u=o[c];if(u.length>1024)continue;let d=tm.test(u)?u.replace(tm,"$1"):u;if(!d.match(/\S*Error: /)){for(let g of t){let h=g(d);if(h){s.push(h);break}}if(s.length>=50+i)break}}return nm(s.slice(i))}}function nm(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(_s(t).function||"")&&t.pop(),t.reverse(),rm.test(_s(t).function||"")&&(t.pop(),rm.test(_s(t).function||"")&&t.pop()),t.slice(0,50).map(r=>ee(b({},r),{filename:r.filename||_s(t).filename,function:r.function||gr}))}function _s(e){return e[e.length-1]||{}}var Nl="<anonymous>";function Vt(e){try{return!e||typeof e!="function"?Nl:e.name||Nl}catch{return Nl}}function Ss(e){let t=e.exception;if(t){let r=[];try{return t.values.forEach(n=>{n.stacktrace.frames&&r.push(...n.stacktrace.frames)}),r}catch{return}}}var bs={},im={};function It(e,t){bs[e]=bs[e]||[],bs[e].push(t)}function Tt(e,t){im[e]||(t(),im[e]=!0)}function Qe(e,t){let r=e&&bs[e];if(r)for(let n of r)try{n(t)}catch(i){dr&&K.error(`Error while triggering instrumentation handler.
21
21
  Type: ${e}
22
- Name: ${Gt(n)}
23
- Error:`,i)}}function wl(e){let t="console";Ct(t,e),xt(t,ny)}function ny(){"console"in re&&oo.forEach(function(e){e in re.console&&Be(re.console,e,function(t){return ai[e]=t,function(...r){et("console",{args:r,level:e});let n=ai[e];n&&n.apply(re.console,r)}})})}var Il=re;function Wf(){if(!("fetch"in Il))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function so(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Tl(){if(typeof EdgeRuntime=="string")return!0;if(!Wf())return!1;if(so(Il.fetch))return!0;let e=!1,t=Il.document;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=so(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){hr&&K.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}var Gf=1e3;function vr(){return Date.now()/Gf}function iy(){let{performance:e}=re;if(!e||!e.now)return vr;let t=Date.now()-e.now(),r=e.timeOrigin==null?t:e.timeOrigin;return()=>(r+e.now())/Gf}var kt=iy(),ao,oy=(()=>{let{performance:e}=re;if(!e||!e.now){ao="none";return}let t=3600*1e3,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,s=i<t,o=e.timing&&e.timing.navigationStart,c=typeof o=="number"?Math.abs(o+r-n):t,u=c<t;return s||u?i<=c?(ao="timeOrigin",e.timeOrigin):(ao="navigationStart",o):(ao="dateNow",n)})();function xl(e){let t="fetch";Ct(t,e),xt(t,sy)}function sy(){Tl()&&Be(re,"fetch",function(e){return function(...t){let{method:r,url:n}=ay(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:kt()*1e3};et("fetch",b({},i));let s=new Error().stack;return e.apply(re,t).then(o=>{let c=te(b({},i),{endTimestamp:kt()*1e3,response:o});return et("fetch",c),o},o=>{let c=te(b({},i),{endTimestamp:kt()*1e3,error:o});throw et("fetch",c),ln(o)&&o.stack===void 0&&(o.stack=s,Tt(o,"framesToPop",1)),o})}})}function Cl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Yf(e){return typeof e=="string"?e:e?Cl(e,"url")?e.url:e.toString?e.toString():"":""}function ay(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[r,n]=e;return{url:Yf(r),method:Cl(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Yf(t),method:Cl(t,"method")?String(t.method).toUpperCase():"GET"}}var Es=null;function Dl(e){let t="error";Ct(t,e),xt(t,cy)}function cy(){Es=re.onerror,re.onerror=function(e,t,r,n,i){return et("error",{column:n,error:i,line:r,msg:e,url:t}),Es&&!Es.__SENTRY_LOADER__?Es.apply(this,arguments):!1},re.onerror.__SENTRY_INSTRUMENTED__=!0}var _s=null;function Rl(e){let t="unhandledrejection";Ct(t,e),xt(t,ly)}function ly(){_s=re.onunhandledrejection,re.onunhandledrejection=function(e){return et("unhandledrejection",e),_s&&!_s.__SENTRY_LOADER__?_s.apply(this,arguments):!0},re.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Al(){return"npm"}function zf(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(i){if(e)return t.has(i)?!0:(t.add(i),!1);for(let s=0;s<t.length;s++)if(t[s]===i)return!0;return t.push(i),!1}function n(i){if(e)t.delete(i);else for(let s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}}return[r,n]}function it(){let e=re,t=e.crypto||e.msCrypto,r=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{let n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function qf(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function nr(e){let{message:t,event_id:r}=e;if(t)return t;let n=qf(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function li(e,t,r){let n=e.exception=e.exception||{},i=n.values=n.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function Nr(e,t){let r=qf(e);if(!r)return;let n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism=b(b(b({},n),i),t),t&&"data"in t){let s=b(b({},i&&i.data),t.data);r.mechanism.data=s}}function Ss(e){if(e&&e.__sentry_captured__)return!0;try{Tt(e,"__sentry_captured__",!0)}catch{}return!1}function bs(e){return Array.isArray(e)?e:[e]}function ir(e,t=100,r=1/0){try{return Nl("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function ws(e,t=3,r=100*1024){let n=ir(e,t);return my(n)>r?ws(e,t-1,r):n}function Nl(e,t,r=1/0,n=1/0,i=zf()){let[s,o]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!Number.isNaN(t))return t;let c=uy(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;let u=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(u===0)return c.replace("object ","");if(s(t))return"[Circular ~]";let d=t;if(d&&typeof d.toJSON=="function")try{let E=d.toJSON();return Nl("",E,u-1,n,i)}catch{}let g=Array.isArray(t)?[]:{},h=0,m=hs(t);for(let E in m){if(!Object.prototype.hasOwnProperty.call(m,E))continue;if(h>=n){g[E]="[MaxProperties ~]";break}let v=m[E];g[E]=Nl(E,v,u-1,n,i),h++}return o(t),g}function uy(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(no(t))return"[VueViewModel]";if(fl(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Gt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let r=py(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function py(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function fy(e){return~-encodeURI(e).split(/%..|./).length}function my(e){return fy(JSON.stringify(e))}var Or;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let r=2;e[e.REJECTED=r]="REJECTED"})(Or||(Or={}));function Yt(e){return new or(t=>{t(e)})}function Yr(e){return new or((t,r)=>{r(e)})}var or=class Yn{constructor(t){Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),Yn.prototype.__init3.call(this),Yn.prototype.__init4.call(this),this._state=Or.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(r){this._reject(r)}}then(t,r){return new Yn((n,i)=>{this._handlers.push([!1,s=>{if(!t)n(s);else try{n(t(s))}catch(o){i(o)}},s=>{if(!r)i(s);else try{n(r(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new Yn((r,n)=>{let i,s;return this.then(o=>{s=!1,i=o,t&&t()},o=>{s=!0,i=o,t&&t()}).then(()=>{if(s){n(i);return}r(i)})})}__init(){this._resolve=t=>{this._setResult(Or.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Or.REJECTED,t)}}__init3(){this._setResult=(t,r)=>{if(this._state===Or.PENDING){if(Ar(r)){r.then(this._resolve,this._reject);return}this._state=t,this._value=r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Or.PENDING)return;let t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===Or.RESOLVED&&r[1](this._value),this._state===Or.REJECTED&&r[2](this._value),r[0]=!0)})}}};function Ol(e){let t=[];function r(){return e===void 0||t.length<e}function n(o){return t.splice(t.indexOf(o),1)[0]||Promise.resolve(void 0)}function i(o){if(!r())return Yr(new ht("Not adding Promise because buffer limit was reached."));let c=o();return t.indexOf(c)===-1&&t.push(c),c.then(()=>n(c)).then(null,()=>n(c).then(null,()=>{})),c}function s(o){return new or((c,u)=>{let d=t.length;if(!d)return c(!0);let g=setTimeout(()=>{o&&o>0&&c(!1)},o);t.forEach(h=>{Yt(h).then(()=>{--d||(clearTimeout(g),c(!0))},u)})})}return{$:t,add:i,drain:s}}function co(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}var Kf=["fatal","error","warning","log","info","debug"];function Pl(e){return e==="warn"?"warning":Kf.includes(e)?e:"log"}var Jf="sentry-",Qf=/^sentry-/;function Ll(e){let t=Zf(e);if(!t)return;let r=Object.entries(t).reduce((n,[i,s])=>{if(i.match(Qf)){let o=i.slice(Jf.length);n[o]=s}return n},{});if(Object.keys(r).length>0)return r}function Zf(e){if(!(!e||!It(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{let n=Xf(r);return Object.entries(n).forEach(([i,s])=>{t[i]=s}),t},{}):Xf(e)}function Xf(e){return e.split(",").map(t=>t.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}function Er(e,t=[]){return[e,t]}function kl(e,t){let[r,n]=e;return[r,[...n,t]]}function Is(e,t){let r=e[1];for(let n of r){let i=n[0].type;if(t(n,i))return!0}return!1}function Ml(e){return re.__SENTRY__&&re.__SENTRY__.encodePolyfill?re.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function Bl(e){let[t,r]=e,n=JSON.stringify(t);function i(s){typeof n=="string"?n=typeof s=="string"?n+s:[Ml(n),s]:n.push(typeof s=="string"?Ml(s):s)}for(let s of r){let[o,c]=s;if(i(`
22
+ Name: ${Vt(n)}
23
+ Error:`,i)}}function Pl(e){let t="console";It(t,e),Tt(t,Iy)}function Iy(){"console"in te&&uo.forEach(function(e){e in te.console&&Me(te.console,e,function(t){return ui[e]=t,function(...r){Qe("console",{args:r,level:e});let n=ui[e];n&&n.apply(te.console,r)}})})}var Ll=te;function om(){if(!("fetch"in Ll))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function po(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ml(){if(typeof EdgeRuntime=="string")return!0;if(!om())return!1;if(po(Ll.fetch))return!0;let e=!1,t=Ll.document;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=po(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){dr&&K.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}var sm=1e3;function yr(){return Date.now()/sm}function Ty(){let{performance:e}=te;if(!e||!e.now)return yr;let t=Date.now()-e.now(),r=e.timeOrigin==null?t:e.timeOrigin;return()=>(r+e.now())/sm}var Lt=Ty(),fo,Cy=(()=>{let{performance:e}=te;if(!e||!e.now){fo="none";return}let t=3600*1e3,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,s=i<t,o=e.timing&&e.timing.navigationStart,c=typeof o=="number"?Math.abs(o+r-n):t,u=c<t;return s||u?i<=c?(fo="timeOrigin",e.timeOrigin):(fo="navigationStart",o):(fo="dateNow",n)})();function Bl(e){let t="fetch";It(t,e),Tt(t,xy)}function xy(){Ml()&&Me(te,"fetch",function(e){return function(...t){let{method:r,url:n}=Dy(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Lt()*1e3};Qe("fetch",b({},i));let s=new Error().stack;return e.apply(te,t).then(o=>{let c=ee(b({},i),{endTimestamp:Lt()*1e3,response:o});return Qe("fetch",c),o},o=>{let c=ee(b({},i),{endTimestamp:Lt()*1e3,error:o});throw Qe("fetch",c),pn(o)&&o.stack===void 0&&(o.stack=s,wt(o,"framesToPop",1)),o})}})}function kl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function am(e){return typeof e=="string"?e:e?kl(e,"url")?e.url:e.toString?e.toString():"":""}function Dy(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[r,n]=e;return{url:am(r),method:kl(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:am(t),method:kl(t,"method")?String(t.method).toUpperCase():"GET"}}var ws=null;function Ul(e){let t="error";It(t,e),Tt(t,Ry)}function Ry(){ws=te.onerror,te.onerror=function(e,t,r,n,i){return Qe("error",{column:n,error:i,line:r,msg:e,url:t}),ws&&!ws.__SENTRY_LOADER__?ws.apply(this,arguments):!1},te.onerror.__SENTRY_INSTRUMENTED__=!0}var Is=null;function Fl(e){let t="unhandledrejection";It(t,e),Tt(t,Ay)}function Ay(){Is=te.onunhandledrejection,te.onunhandledrejection=function(e){return Qe("unhandledrejection",e),Is&&!Is.__SENTRY_LOADER__?Is.apply(this,arguments):!0},te.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Hl(){return"npm"}function cm(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(i){if(e)return t.has(i)?!0:(t.add(i),!1);for(let s=0;s<t.length;s++)if(t[s]===i)return!0;return t.push(i),!1}function n(i){if(e)t.delete(i);else for(let s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}}return[r,n]}function rt(){let e=te,t=e.crypto||e.msCrypto,r=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{let n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function lm(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function rr(e){let{message:t,event_id:r}=e;if(t)return t;let n=lm(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function fi(e,t,r){let n=e.exception=e.exception||{},i=n.values=n.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function Ar(e,t){let r=lm(e);if(!r)return;let n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism=b(b(b({},n),i),t),t&&"data"in t){let s=b(b({},i&&i.data),t.data);r.mechanism.data=s}}function Ts(e){if(e&&e.__sentry_captured__)return!0;try{wt(e,"__sentry_captured__",!0)}catch{}return!1}function Cs(e){return Array.isArray(e)?e:[e]}function nr(e,t=100,r=1/0){try{return $l("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function xs(e,t=3,r=100*1024){let n=nr(e,t);return Ly(n)>r?xs(e,t-1,r):n}function $l(e,t,r=1/0,n=1/0,i=cm()){let[s,o]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!Number.isNaN(t))return t;let c=Ny(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;let u=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(u===0)return c.replace("object ","");if(s(t))return"[Circular ~]";let d=t;if(d&&typeof d.toJSON=="function")try{let E=d.toJSON();return $l("",E,u-1,n,i)}catch{}let g=Array.isArray(t)?[]:{},h=0,m=Es(t);for(let E in m){if(!Object.prototype.hasOwnProperty.call(m,E))continue;if(h>=n){g[E]="[MaxProperties ~]";break}let y=m[E];g[E]=$l(E,y,u-1,n,i),h++}return o(t),g}function Ny(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(co(t))return"[VueViewModel]";if(bl(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Vt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let r=Oy(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Oy(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Py(e){return~-encodeURI(e).split(/%..|./).length}function Ly(e){return Py(JSON.stringify(e))}var Nr;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let r=2;e[e.REJECTED=r]="REJECTED"})(Nr||(Nr={}));function Wt(e){return new ir(t=>{t(e)})}function Gr(e){return new ir((t,r)=>{r(e)})}var ir=class Yn{constructor(t){Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),Yn.prototype.__init3.call(this),Yn.prototype.__init4.call(this),this._state=Nr.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(r){this._reject(r)}}then(t,r){return new Yn((n,i)=>{this._handlers.push([!1,s=>{if(!t)n(s);else try{n(t(s))}catch(o){i(o)}},s=>{if(!r)i(s);else try{n(r(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new Yn((r,n)=>{let i,s;return this.then(o=>{s=!1,i=o,t&&t()},o=>{s=!0,i=o,t&&t()}).then(()=>{if(s){n(i);return}r(i)})})}__init(){this._resolve=t=>{this._setResult(Nr.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Nr.REJECTED,t)}}__init3(){this._setResult=(t,r)=>{if(this._state===Nr.PENDING){if(Rr(r)){r.then(this._resolve,this._reject);return}this._state=t,this._value=r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Nr.PENDING)return;let t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===Nr.RESOLVED&&r[1](this._value),this._state===Nr.REJECTED&&r[2](this._value),r[0]=!0)})}}};function jl(e){let t=[];function r(){return e===void 0||t.length<e}function n(o){return t.splice(t.indexOf(o),1)[0]||Promise.resolve(void 0)}function i(o){if(!r())return Gr(new mt("Not adding Promise because buffer limit was reached."));let c=o();return t.indexOf(c)===-1&&t.push(c),c.then(()=>n(c)).then(null,()=>n(c).then(null,()=>{})),c}function s(o){return new ir((c,u)=>{let d=t.length;if(!d)return c(!0);let g=setTimeout(()=>{o&&o>0&&c(!1)},o);t.forEach(h=>{Wt(h).then(()=>{--d||(clearTimeout(g),c(!0))},u)})})}return{$:t,add:i,drain:s}}function mo(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}var um=["fatal","error","warning","log","info","debug"];function Vl(e){return e==="warn"?"warning":um.includes(e)?e:"log"}var fm="sentry-",mm=/^sentry-/;function Wl(e){let t=dm(e);if(!t)return;let r=Object.entries(t).reduce((n,[i,s])=>{if(i.match(mm)){let o=i.slice(fm.length);n[o]=s}return n},{});if(Object.keys(r).length>0)return r}function dm(e){if(!(!e||!bt(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{let n=pm(r);return Object.entries(n).forEach(([i,s])=>{t[i]=s}),t},{}):pm(e)}function pm(e){return e.split(",").map(t=>t.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}function vr(e,t=[]){return[e,t]}function Yl(e,t){let[r,n]=e;return[r,[...n,t]]}function Ds(e,t){let r=e[1];for(let n of r){let i=n[0].type;if(t(n,i))return!0}return!1}function Gl(e){return te.__SENTRY__&&te.__SENTRY__.encodePolyfill?te.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function zl(e){let[t,r]=e,n=JSON.stringify(t);function i(s){typeof n=="string"?n=typeof s=="string"?n+s:[Gl(n),s]:n.push(typeof s=="string"?Gl(s):s)}for(let s of r){let[o,c]=s;if(i(`
24
24
  ${JSON.stringify(o)}
25
- `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(ir(c))}i(u)}}return typeof n=="string"?n:dy(n)}function dy(e){let t=e.reduce((i,s)=>i+s.length,0),r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function Ul(e){let t=typeof e.data=="string"?Ml(e.data):e.data;return[Ze({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}var hy={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Ts(e){return hy[e]}function Cs(e){if(!e||!e.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function Fl(e,t,r,n){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return b(b(b({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!r&&n&&{dsn:gr(n)}),i&&{trace:Ze(b({},i))})}function Hl(e,t,r){let n=[{type:"client_report"},{timestamp:r||vr(),discarded_events:e}];return Er(t?{dsn:t}:{},[n])}function em(e,t=Date.now()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}function tm(e,t){return e[t]||e.all||0}function $l(e,t,r=Date.now()){return tm(e,t)>r}function jl(e,{statusCode:t,headers:r},n=Date.now()){let i=b({},e),s=r&&r["x-sentry-rate-limits"],o=r&&r["retry-after"];if(s)for(let c of s.trim().split(",")){let[u,d,,,g]=c.split(":",5),h=parseInt(u,10),m=(isNaN(h)?60:h)*1e3;if(!d)i.all=n+m;else for(let E of d.split(";"))E==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[E]=n+m):i[E]=n+m}else o?i.all=n+em(o,n):t===429&&(i.all=n+60*1e3);return i}function xs(){return{traceId:it(),spanId:it().substring(16)}}var Ds=re;function Vl(){let e=Ds.chrome,t=e&&e.app&&e.app.runtime,r="history"in Ds&&!!Ds.history.pushState&&!!Ds.history.replaceState;return!t&&r}var Re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function mn(){return lo(re),re}function lo(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Wt,t[Wt]=t[Wt]||{}}function uo(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||kt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:it()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}var Wl="_sentrySpan";function Gl(e,t){t?Tt(e,Wl,t):delete e[Wl]}function Yl(e){return e[Wl]}var vy=100,zl=class Rh{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=xs()}clone(){let t=new Rh;return t._breadcrumbs=[...this._breadcrumbs],t._tags=b({},this._tags),t._extra=b({},this._extra),t._contexts=b({},this._contexts),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata=b({},this._sdkProcessingMetadata),t._propagationContext=b({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,Gl(t,Yl(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&uo(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags=b(b({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,r){return this._tags=te(b({},this._tags),{[t]:r}),this._notifyScopeListeners(),this}setExtras(t){return this._extra=b(b({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,r){return this._extra=te(b({},this._extra),{[t]:r}),this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let r=typeof t=="function"?t(this):t,[n,i]=r instanceof gt?[r.getScopeData(),r.getRequestSession()]:rr(r)?[t,t.requestSession]:[],{tags:s,extra:o,user:c,contexts:u,level:d,fingerprint:g=[],propagationContext:h}=n||{};return this._tags=b(b({},this._tags),s),this._extra=b(b({},this._extra),o),this._contexts=b(b({},this._contexts),u),c&&Object.keys(c).length&&(this._user=c),d&&(this._level=d),g.length&&(this._fingerprint=g),h&&(this._propagationContext=h),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Gl(this,void 0),this._attachments=[],this._propagationContext=xs(),this._notifyScopeListeners(),this}addBreadcrumb(t,r){let n=typeof r=="number"?r:vy;if(n<=0)return this;let i=b({timestamp:vr()},t),s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Yl(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=b(b({},this._sdkProcessingMetadata),t),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){let n=r&&r.event_id?r.event_id:it();if(!this._client)return K.warn("No client configured on scope - will not capture exception!"),n;let i=new Error("Sentry syntheticException");return this._client.captureException(t,te(b({originalException:t,syntheticException:i},r),{event_id:n}),this),n}captureMessage(t,r,n){let i=n&&n.event_id?n.event_id:it();if(!this._client)return K.warn("No client configured on scope - will not capture message!"),i;let s=new Error(t);return this._client.captureMessage(t,r,te(b({originalException:t,syntheticException:s},n),{event_id:i}),this),i}captureEvent(t,r){let n=r&&r.event_id?r.event_id:it();return this._client?(this._client.captureEvent(t,te(b({},r),{event_id:n}),this),n):(K.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}},gt=zl;function rm(){return si("defaultCurrentScope",()=>new gt)}function nm(){return si("defaultIsolationScope",()=>new gt)}var ql=class{constructor(e,t){let r;e?r=e:r=new gt;let n;t?n=t:n=new gt,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){let t=this._pushScope(),r;try{r=e(t)}catch(n){throw this._popScope(),n}return Ar(r)?r.then(n=>(this._popScope(),n),n=>{throw this._popScope(),n}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function ui(){let e=mn(),t=lo(e);return t.stack=t.stack||new ql(rm(),nm())}function Ey(e){return ui().withScope(e)}function _y(e,t){let r=ui();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function im(e){return ui().withScope(()=>e(ui().getIsolationScope()))}function om(){return{withIsolationScope:im,withScope:Ey,withSetScope:_y,withSetIsolationScope:(e,t)=>im(t),getCurrentScope:()=>ui().getScope(),getIsolationScope:()=>ui().getIsolationScope()}}function Rs(e){let t=lo(e);return t.acs?t.acs:om()}function dn(){let e=mn();return Rs(e).getCurrentScope()}function hn(){let e=mn();return Rs(e).getIsolationScope()}function As(){return si("globalScope",()=>new gt)}function Ns(...e){let t=mn(),r=Rs(t);if(e.length===2){let[n,i]=e;return n?r.withSetScope(n,i):r.withScope(i)}return r.withScope(e[0])}function He(){return dn().getClient()}var Sy="_sentryMetrics";function sm(e){let t=e[Sy];if(!t)return;let r={};for(let[,[n,i]]of t)(r[n]||(r[n]=[])).push(Ze(i));return r}var Kl="sentry.source",Xl="sentry.sample_rate",Jl="sentry.op",Ql="sentry.origin",by=1;function lm(e){let{spanId:t,traceId:r}=e.spanContext(),{parent_span_id:n}=gn(e);return Ze({parent_span_id:n,span_id:t,trace_id:r})}function am(e){return typeof e=="number"?cm(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?cm(e.getTime()):kt()}function cm(e){return e>9999999999?e/1e3:e}function gn(e){if(Iy(e))return e.getSpanJSON();try{let{spanId:t,traceId:r}=e.spanContext();if(wy(e)){let{attributes:n,startTime:i,name:s,endTime:o,parentSpanId:c,status:u}=e;return Ze({span_id:t,trace_id:r,data:n,description:s,parent_span_id:c,start_timestamp:am(i),timestamp:am(o)||void 0,status:Ty(u),op:n[Jl],origin:n[Ql],_metrics_summary:sm(e)})}return{span_id:t,trace_id:r}}catch{return{}}}function wy(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Iy(e){return typeof e.getSpanJSON=="function"}function um(e){let{traceFlags:t}=e.spanContext();return t===by}function Ty(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"unknown_error"}var Cy="_sentryRootSpan";function po(e){return e[Cy]||e}var Os="production",xy="_frozenDsc";function Zl(e,t){let r=t.getOptions(),{publicKey:n}=t.getDsn()||{},i=Ze({environment:r.environment||Os,release:r.release,public_key:n,trace_id:e});return t.emit("createDsc",i),i}function pm(e){let t=He();if(!t)return{};let r=Zl(gn(e).trace_id||"",t),n=po(e),i=n[xy];if(i)return i;let s=n.spanContext().traceState,o=s&&s.get("sentry.dsc"),c=o&&Ll(o);if(c)return c;let u=gn(n),d=u.data||{},g=d[Xl];g!=null&&(r.sample_rate=`${g}`);let h=d[Kl],m=u.description;return h!=="url"&&m&&(r.transaction=m),r.sampled=String(um(n)),t.emit("createDsc",r,n),r}function fm(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(typeof t!="number"||isNaN(t)||t<0||t>1){Re&&K.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}function Dy(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function mm(e,t,r,n){let i=Cs(r),s=b(b({sent_at:new Date().toISOString()},i&&{sdk:i}),!!n&&t&&{dsn:gr(t)}),o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Er(s,[o])}function dm(e,t,r,n){let i=Cs(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Dy(e,r&&r.sdk);let o=Fl(e,i,n,t);return delete e.sdkProcessingMetadata,Er(o,[[{type:s},e]])}function Ps(e,t,r,n=0){return new or((i,s)=>{let o=e[n];if(t===null||typeof o!="function")i(t);else{let c=o(b({},t),r);Re&&o.id&&c===null&&K.log(`Event processor "${o.id}" dropped event`),Ar(c)?c.then(u=>Ps(e,u,r,n+1).then(i)).then(null,s):Ps(e,c,r,n+1).then(i).then(null,s)}})}function hm(e,t){let{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:s}=t;Ry(e,t),n&&Oy(e,n),Py(e,r),Ay(e,i),Ny(e,s)}function eu(e,t){let{extra:r,tags:n,user:i,contexts:s,level:o,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:g,attachments:h,propagationContext:m,transactionName:E,span:v}=t;fo(e,"extra",r),fo(e,"tags",n),fo(e,"user",i),fo(e,"contexts",s),fo(e,"sdkProcessingMetadata",c),o&&(e.level=o),E&&(e.transactionName=E),v&&(e.span=v),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),g.length&&(e.eventProcessors=[...e.eventProcessors,...g]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext=b(b({},e.propagationContext),m)}function fo(e,t,r){if(r&&Object.keys(r).length){e[t]=b({},e[t]);for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[t][n]=r[n])}}function Ry(e,t){let{extra:r,tags:n,user:i,contexts:s,level:o,transactionName:c}=t,u=Ze(r);u&&Object.keys(u).length&&(e.extra=b(b({},u),e.extra));let d=Ze(n);d&&Object.keys(d).length&&(e.tags=b(b({},d),e.tags));let g=Ze(i);g&&Object.keys(g).length&&(e.user=b(b({},g),e.user));let h=Ze(s);h&&Object.keys(h).length&&(e.contexts=b(b({},h),e.contexts)),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function Ay(e,t){let r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function Ny(e,t){e.sdkProcessingMetadata=b(b({},e.sdkProcessingMetadata),t)}function Oy(e,t){e.contexts=b({trace:lm(t)},e.contexts),e.sdkProcessingMetadata=b({dynamicSamplingContext:pm(t)},e.sdkProcessingMetadata);let r=po(t),n=gn(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function Py(e,t){e.fingerprint=e.fingerprint?bs(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}function ym(e,t,r,n,i,s){let{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,u=te(b({},t),{event_id:t.event_id||r.event_id||it(),timestamp:t.timestamp||vr()}),d=r.integrations||e.integrations.map(_=>_.name);Ly(u,e),By(u,d),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&My(u,e.stackParser);let g=Fy(n,r.captureContext);r.mechanism&&Nr(u,r.mechanism);let h=i?i.getEventProcessors():[],m=As().getScopeData();if(s){let _=s.getScopeData();eu(m,_)}if(g){let _=g.getScopeData();eu(m,_)}let E=[...r.attachments||[],...m.attachments];E.length&&(r.attachments=E),hm(u,m);let v=[...h,...m.eventProcessors];return Ps(v,u,r).then(_=>(_&&ky(_),typeof o=="number"&&o>0?Uy(_,o,c):_))}function Ly(e,t){let{environment:r,release:n,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?r:Os),e.release===void 0&&n!==void 0&&(e.release=n),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&(e.message=dr(e.message,s));let o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=dr(o.value,s));let c=e.request;c&&c.url&&(c.url=dr(c.url,s))}var gm=new WeakMap;function My(e,t){let r=re._sentryDebugIds;if(!r)return;let n,i=gm.get(t);i?n=i:(n=new Map,gm.set(t,n));let s=Object.entries(r).reduce((o,[c,u])=>{let d,g=n.get(c);g?d=g:(d=t(c),n.set(c,d));for(let h=d.length-1;h>=0;h--){let m=d[h];if(m.filename){o[m.filename]=u;break}}return o},{});try{e.exception.values.forEach(o=>{o.stacktrace.frames.forEach(c=>{c.filename&&(c.debug_id=s[c.filename])})})}catch{}}function ky(e){let t={};try{e.exception.values.forEach(n=>{n.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.entries(t).forEach(([n,i])=>{r.push({type:"sourcemap",code_file:n,debug_id:i})})}function By(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Uy(e,t,r){if(!e)return null;let n=b(b(b(b(b({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>b(b({},i),i.data&&{data:ir(i.data,t,r)}))}),e.user&&{user:ir(e.user,t,r)}),e.contexts&&{contexts:ir(e.contexts,t,r)}),e.extra&&{extra:ir(e.extra,t,r)});return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=ir(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(i=>b(b({},i),i.data&&{data:ir(i.data,t,r)}))),n}function Fy(e,t){if(!t)return e;let r=e?e.clone():new gt;return r.update(t),r}function vm(e){if(e)return Hy(e)?{captureContext:e}:jy(e)?{captureContext:e}:e}function Hy(e){return e instanceof gt||typeof e=="function"}var $y=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function jy(e){return Object.keys(e).some(t=>$y.includes(t))}function Ls(e,t){return dn().captureException(e,vm(t))}function mo(e,t){return dn().captureEvent(e,t)}var Vy="7";function Wy(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Gy(e){return`${Wy(e)}${e.projectId}/envelope/`}function Yy(e,t){return El(b({sentry_key:e.publicKey,sentry_version:Vy},t&&{sentry_client:`${t.name}/${t.version}`}))}function _m(e,t,r){return t||`${Gy(e)}?${Yy(e,r)}`}var Sm=[];function bm(e,t){let r={};return t.forEach(n=>{n&&ru(e,n,r)}),r}function tu(e,t){for(let r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function ru(e,t,r){if(r[t.name]){Re&&K.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,Sm.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),Sm.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>n(i,s,e))}if(typeof t.processEvent=="function"){let n=t.processEvent.bind(t),i=Object.assign((s,o)=>n(s,o,e),{id:t.name});e.addEventProcessor(i)}Re&&K.log(`Integration installed: ${t.name}`)}var wm="Not capturing exception because it's already been captured.",ho=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ms(e.dsn):Re&&K.warn("No DSN provided, client will not send events."),this._dsn){let t=_m(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(te(b({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,r){let n=it();if(Ss(e))return Re&&K.log(wm),n;let i=b({event_id:n},t);return this._process(this.eventFromException(e,i).then(s=>this._captureEvent(s,i,r))),i.event_id}captureMessage(e,t,r,n){let i=b({event_id:it()},r),s=ii(e)?e:String(e),o=un(e)?this.eventFromMessage(s,t,i):this.eventFromException(e,i);return this._process(o.then(c=>this._captureEvent(c,i,n))),i.event_id}captureEvent(e,t,r){let n=it();if(t&&t.originalException&&Ss(t.originalException))return Re&&K.log(wm),n;let i=b({event_id:n},t),s=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,s||r)),i.event_id}captureSession(e){typeof e.release!="string"?Re&&K.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),uo(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>t.flush(e).then(n=>r&&n))):Yt(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,this.emit("close"),t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];ru(this,e,this._integrations),t||tu(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=dm(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])r=kl(r,Ul(i));let n=this.sendEnvelope(r);n&&n.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let t=mm(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){let n=`${e}:${t}`;Re&&K.log(`Adding outcome: "${n}"`),this._outcomes[n]=(this._outcomes[n]||0)+1}}on(e,t){let r=this._hooks[e]=this._hooks[e]||[];return r.push(t),()=>{let n=r.indexOf(t);n>-1&&r.splice(n,1)}}emit(e,...t){let r=this._hooks[e];r&&r.forEach(n=>n(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,t=>(Re&&K.error("Error while sending event:",t),t)):(Re&&K.error("Transport disabled"),Yt({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=bm(this,e),tu(this,e)}_updateSessionFromEvent(e,t){let r=!1,n=!1,i=t.exception&&t.exception.values;if(i){n=!0;for(let o of i){let c=o.mechanism;if(c&&c.handled===!1){r=!0;break}}}let s=e.status==="ok";(s&&e.errors===0||s&&r)&&(uo(e,te(b({},r&&{status:"crashed"}),{errors:e.errors||Number(n||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new or(t=>{let r=0,n=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),t(!0)):(r+=n,e&&r>=e&&(clearInterval(i),t(!1)))},n)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r,n=hn()){let i=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s.length>0&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||n.setLastEventId(e.event_id||t.event_id),ym(i,e,t,r,this,n).then(o=>{if(o===null)return o;let c=b(b({},n.getPropagationContext()),r?r.getPropagationContext():void 0);if(!(o.contexts&&o.contexts.trace)&&c){let{traceId:u,spanId:d,parentSpanId:g,dsc:h}=c;o.contexts=b({trace:Ze({trace_id:u,span_id:d,parent_span_id:g})},o.contexts);let m=h||Zl(u,this);o.sdkProcessingMetadata=b({dynamicSamplingContext:m},o.sdkProcessingMetadata)}return o})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(n=>n.event_id,n=>{if(Re){let i=n;i.logLevel==="log"?K.log(i.message):K.warn(i)}})}_processEvent(e,t,r){let n=this.getOptions(),{sampleRate:i}=n,s=nu(e),o=Im(e),c=e.type||"error",u=`before send for type \`${c}\``,d=typeof i>"u"?void 0:fm(i);if(o&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),Yr(new ht(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let g=c==="replay_event"?"replay":c,h=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,h).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",g,e),new ht("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return m;let E=qy(this,n,m,t);return zy(E,u)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",g,e),nu(e)){let _=1+(e.spans||[]).length;this._outcomes.span=(this._outcomes.span||0)+_}throw new ht(`${u} returned \`null\`, will not send event.`,"log")}let E=r&&r.getSession();!s&&E&&this._updateSessionFromEvent(E,m);let v=m.transaction_info;if(s&&v&&m.transaction!==e.transaction){let _="custom";m.transaction_info=te(b({},v),{source:_})}return this.sendEvent(m,t),m}).then(null,m=>{throw m instanceof ht?m:(this.captureException(m,{data:{__sentry__:!0},originalException:m}),new ht(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
26
- Reason: ${m}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([t,r])=>{let[n,i]=t.split(":");return{reason:n,category:i,quantity:r}})}};function zy(e,t){let r=`${t} must return \`null\` or a valid event.`;if(Ar(e))return e.then(n=>{if(!rr(n)&&n!==null)throw new ht(r);return n},n=>{throw new ht(`${t} rejected with ${n}`)});if(!rr(e)&&e!==null)throw new ht(r);return e}function qy(e,t,r,n){let{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o}=t;if(Im(r)&&i)return i(r,n);if(nu(r)){if(r.spans&&o){let c=[];for(let u of r.spans){let d=o(u);d?c.push(d):e.recordDroppedEvent("before_send","span")}r.spans=c}if(s)return s(r,n)}return r}function Im(e){return e.type===void 0}function nu(e){return e.type==="transaction"}var Ky=64;function Ms(e,t,r=Ol(e.bufferSize||Ky)){let n={},i=o=>r.drain(o);function s(o){let c=[];if(Is(o,(h,m)=>{let E=Ts(m);if($l(n,E)){let v=Tm(h,m);e.recordDroppedEvent("ratelimit_backoff",E,v)}else c.push(h)}),c.length===0)return Yt({});let u=Er(o[0],c),d=h=>{Is(u,(m,E)=>{let v=Tm(m,E);e.recordDroppedEvent(h,Ts(E),v)})},g=()=>t({body:Bl(u)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&Re&&K.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),n=jl(n,h),h),h=>{throw d("network_error"),h});return r.add(g).then(h=>h,h=>{if(h instanceof ht)return Re&&K.error("Skipped sending event because buffer is full."),d("queue_overflow"),Yt({});throw h})}return{send:s,flush:i}}function Tm(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function iu(e,t,r=[t],n="npm"){let i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:r.map(s=>({name:`${n}:@sentry/${s}`,version:Wt})),version:Wt}),e._metadata=i}var Xy=100;function _r(e,t){let r=He(),n=hn();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:s=Xy}=r.getOptions();if(s<=0)return;let o=vr(),c=b({timestamp:o},e),u=i?ci(()=>i(c,t)):c;u!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",u,t),n.addBreadcrumb(u,s))}var Cm,Jy="FunctionToString",xm=new WeakMap,Qy=()=>({name:Jy,setupOnce(){Cm=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=fn(this),r=xm.has(He())&&t!==void 0?t:this;return Cm.apply(r,e)}}catch{}},setup(e){xm.set(e,!0)}}),ks=Qy,Zy=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],ev="InboundFilters",tv=(e={})=>({name:ev,processEvent(t,r,n){let i=n.getOptions(),s=rv(e,i);return nv(t,s)?null:t}}),Us=tv;function rv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Zy],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function nv(e,t){return t.ignoreInternal&&lv(e)?(Re&&K.warn(`Event dropped due to being internal Sentry Error.
27
- Event: ${nr(e)}`),!0):iv(e,t.ignoreErrors)?(Re&&K.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
28
- Event: ${nr(e)}`),!0):pv(e)?(Re&&K.warn(`Event dropped due to not having an error message, error type or stacktrace.
29
- Event: ${nr(e)}`),!0):ov(e,t.ignoreTransactions)?(Re&&K.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
30
- Event: ${nr(e)}`),!0):sv(e,t.denyUrls)?(Re&&K.warn(`Event dropped due to being matched by \`denyUrls\` option.
31
- Event: ${nr(e)}.
32
- Url: ${Bs(e)}`),!0):av(e,t.allowUrls)?!1:(Re&&K.warn(`Event dropped due to not being matched by \`allowUrls\` option.
33
- Event: ${nr(e)}.
34
- Url: ${Bs(e)}`),!0)}function iv(e,t){return e.type||!t||!t.length?!1:cv(e).some(r=>oi(r,t))}function ov(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?oi(r,t):!1}function sv(e,t){if(!t||!t.length)return!1;let r=Bs(e);return r?oi(r,t):!1}function av(e,t){if(!t||!t.length)return!0;let r=Bs(e);return r?oi(r,t):!0}function cv(e){let t=[];e.message&&t.push(e.message);let r;try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),t}function lv(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function uv(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Bs(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?uv(t):null}catch{return Re&&K.error(`Cannot extract url for event ${nr(e)}`),null}}function pv(e){return e.type||!e.exception||!e.exception.values||e.exception.values.length===0?!1:!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value)}var fv="Dedupe",mv=()=>{let e;return{name:fv,processEvent(t){if(t.type)return t;try{if(dv(t,e))return Re&&K.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Fs=mv;function dv(e,t){return t?!!(hv(e,t)||gv(e,t)):!1}function hv(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Am(e,t)||!Rm(e,t))}function gv(e,t){let r=Dm(t),n=Dm(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Am(e,t)||!Rm(e,t))}function Rm(e,t){let r=ys(e),n=ys(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Am(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Dm(e){return e.exception&&e.exception.values&&e.exception.values[0]}var Ye=re,ou=0;function su(){return ou>0}function Rv(){ou++,setTimeout(()=>{ou--})}function yn(e,t={},r){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(fn(e))return e}catch{return e}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>yn(o,t));return e.apply(this,s)}catch(s){throw Rv(),Ns(o=>{o.addEventProcessor(c=>(t.mechanism&&(li(c,void 0,void 0),Nr(c,t.mechanism)),c.extra=te(b({},c.extra),{arguments:i}),c)),Ls(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}ds(n,e),Tt(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}var Pr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Hs(e,t){let r=lu(e,t),n={type:t&&t.name,value:Lv(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Av(e,t,r,n){let i=He(),s=i&&i.getOptions().normalizeDepth,o=Bv(t),c={__serialized__:ws(t,s)};if(o)return{exception:{values:[Hs(e,o)]},extra:c};let u={exception:{values:[{type:pn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:Mv(t,{isUnhandledRejection:n})}]},extra:c};if(r){let d=lu(e,r);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function au(e,t){return{exception:{values:[Hs(e,t)]}}}function lu(e,t){let r=t.stacktrace||t.stack||"",n=Ov(t),i=Pv(t);try{return e(r,n,i)}catch{}return[]}var Nv=/Minified React error #\d+;/i;function Ov(e){return e&&Nv.test(e.message)?1:0}function Pv(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Lv(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Lm(e,t,r,n){let i=r&&r.syntheticException||void 0,s=$s(e,t,i,n);return Nr(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Yt(s)}function Mm(e,t,r="info",n,i){let s=n&&n.syntheticException||void 0,o=cu(e,t,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Yt(o)}function $s(e,t,r,n,i){let s;if(us(t)&&t.error)return au(e,t.error);if(ps(t)||ll(t)){let o=t;if("stack"in t)s=au(e,t);else{let c=o.name||(ps(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=cu(e,u,r,n),li(s,u)}return"code"in o&&(s.tags=te(b({},s.tags),{"DOMException.code":`${o.code}`})),s}return ln(t)?au(e,t):rr(t)||pn(t)?(s=Av(e,t,r,i),Nr(s,{synthetic:!0}),s):(s=cu(e,t,r,n),li(s,`${t}`,void 0),Nr(s,{synthetic:!0}),s)}function cu(e,t,r,n){let i={};if(n&&r){let s=lu(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}if(ii(t)){let{__sentry_template_string__:s,__sentry_template_values__:o}=t;return i.logentry={message:s,params:o},i}return i.message=t,i}function Mv(e,{isUnhandledRejection:t}){let r=_l(e),n=t?"promise rejection":"exception";return us(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:pn(e)?`Event \`${kv(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function kv(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Bv(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function km(e,{metadata:t,tunnel:r,dsn:n}){let i=b(b({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!r&&!!n&&{dsn:gr(n)}),s=Uv(e);return Er(i,[s])}function Uv(e){return[{type:"user_report"},e]}var go=class extends ho{constructor(e){let t=b({parentSpanIsAlwaysRootSpan:!0},e),r=Ye.SENTRY_SDK_SOURCE||Al();iu(t,"browser",["browser"],r),super(t),t.sendClientReports&&Ye.document&&Ye.document.addEventListener("visibilitychange",()=>{Ye.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return Lm(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return Mm(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Pr&&K.warn("SDK not enabled, will not capture user feedback.");return}let t=km(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){Pr&&K.log("No outcomes to send");return}if(!this._dsn){Pr&&K.log("No dsn provided, will not send outcomes");return}Pr&&K.log("Sending outcomes:",e);let t=Hl(e,this._options.tunnel&&gr(this._dsn));this.sendEnvelope(t)}},Bm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xe=re,Fv=1e3,Um,uu,pu;function fu(e){let t="dom";Ct(t,e),xt(t,Hv)}function Hv(){if(!Xe.document)return;let e=et.bind(null,"dom"),t=Fm(e,!0);Xe.document.addEventListener("click",t,!1),Xe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=Xe[r]&&Xe[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Be(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},g=d[s]=d[s]||{refCount:0};if(!g.handler){let h=Fm(e);g.handler=h,i.call(this,s,h,c)}g.refCount++}catch{}return i.call(this,s,o,c)}}),Be(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__||{},g=d[s];g&&(g.refCount--,g.refCount<=0&&(i.call(this,s,g.handler,c),g.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function $v(e){if(e.type!==uu)return!1;try{if(!e.target||e.target._sentryId!==pu)return!1}catch{}return!0}function jv(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function Fm(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Vv(r);if(jv(r.type,n))return;Tt(r,"_sentryCaptured",!0),n&&!n._sentryId&&Tt(n,"_sentryId",it());let i=r.type==="keypress"?"input":r.type;$v(r)||(e({event:r,name:i,global:t}),uu=r.type,pu=n?n._sentryId:void 0),clearTimeout(Um),Um=Xe.setTimeout(()=>{pu=void 0,uu=void 0},Fv)}}function Vv(e){try{return e.target}catch{return null}}var js;function mu(e){let t="history";Ct(t,e),xt(t,Wv)}function Wv(){if(!Vl())return;let e=Xe.onpopstate;Xe.onpopstate=function(...r){let n=Xe.location.href,i=js;if(js=n,et("history",{from:i,to:n}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=js,o=String(i);js=o,et("history",{from:s,to:o})}return r.apply(this,n)}}Be(Xe.history,"pushState",t),Be(Xe.history,"replaceState",t)}var Vs={};function du(e){let t=Vs[e];if(t)return t;let r=Xe[e];if(so(r))return Vs[e]=r.bind(Xe);let n=Xe.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(i)}catch(i){Bm&&K.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(Vs[e]=r.bind(Xe))}function Ws(e){Vs[e]=void 0}var vn="__sentry_xhr_v3__";function hu(e){let t="xhr";Ct(t,e),xt(t,Gv)}function Gv(){if(!Xe.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;Be(e,"open",function(t){return function(...r){let n=kt()*1e3,i=It(r[0])?r[0].toUpperCase():void 0,s=Yv(r[1]);if(!i||!s)return t.apply(this,r);this[vn]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[vn];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:kt()*1e3,startTimestamp:n,xhr:this};et("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Be(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Be(this,"setRequestHeader",function(c){return function(...u){let[d,g]=u,h=this[vn];return h&&It(d)&&It(g)&&(h.request_headers[d.toLowerCase()]=g),c.apply(this,u)}}),t.apply(this,r)}}),Be(e,"send",function(t){return function(...r){let n=this[vn];if(!n)return t.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:kt()*1e3,xhr:this};return et("xhr",i),t.apply(this,r)}})}function Yv(e){if(It(e))return e;try{return e.toString()}catch{}}function gu(e,t=du("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=b({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);if(!t)return Ws("fetch"),Yr("No fetch implementation available");try{return t(e.url,c).then(u=>(r-=o,n--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return Ws("fetch"),r-=o,n--,Yr(u)}}return Ms(e,i)}var zv=30,qv=50;function yu(e,t,r,n){let i={filename:e,function:t==="<anonymous>"?yr:t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var Kv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Xv=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jv=/\((\S*)(?::(\d+))(?::(\d+))\)/,Qv=e=>{let t=Kv.exec(e);if(t){let[,n,i,s]=t;return yu(n,yr,+i,+s)}let r=Xv.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Jv.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=Vm(r[1]||yr,r[2]);return yu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Hm=[zv,Qv],Zv=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tE=e=>{let t=Zv.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=eE.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],n=t[1]||yr;return[n,r]=Vm(n,r),yu(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},$m=[qv,tE],jm=[Hm,$m],vu=bl(...jm),Vm=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:yr,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Gs=1024,nE="Breadcrumbs",iE=(e={})=>{let t=b({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:nE,setup(r){t.console&&wl(aE(r)),t.dom&&fu(sE(r,t.dom)),t.xhr&&hu(cE(r)),t.fetch&&xl(lE(r)),t.history&&mu(uE(r)),t.sentry&&r.on("beforeSendEvent",oE(r))}}},Wm=iE;function oE(e){return function(t){He()===e&&_r({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:nr(t)},{event:t})}}function sE(e,t){return function(r){if(He()!==e)return;let n,i,s=typeof t=="object"?t.serializeAttribute:void 0,o=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;o&&o>Gs&&(Pr&&K.warn(`\`dom.maxStringLength\` cannot exceed ${Gs}, but a value of ${o} was configured. Sentry will use ${Gs} instead.`),o=Gs),typeof s=="string"&&(s=[s]);try{let u=r.event,d=pE(u)?u.target:u;n=io(d,{keyAttrs:s,maxStringLength:o}),i=yl(d)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),_r(c,{event:r.event,name:r.name,global:r.global})}}function aE(e){return function(t){if(He()!==e)return;let r={category:"console",data:{arguments:t.args,logger:"console"},level:Pl(t.level),message:fs(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)r.message=`Assertion failed: ${fs(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1);else return;_r(r,{input:t.args,level:t.level})}}function cE(e){return function(t){if(He()!==e)return;let{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[vn];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,d={method:s,url:o,status_code:c},g={xhr:t.xhr,input:u,startTimestamp:r,endTimestamp:n};_r({category:"xhr",data:d,type:"http"},g)}}function lE(e){return function(t){if(He()!==e)return;let{startTimestamp:r,endTimestamp:n}=t;if(n&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){let i=t.fetchData,s={data:t.error,input:t.args,startTimestamp:r,endTimestamp:n};_r({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=t.response,s=te(b({},t.fetchData),{status_code:i&&i.status}),o={input:t.args,response:i,startTimestamp:r,endTimestamp:n};_r({category:"fetch",data:s,type:"http"},o)}}}function uE(e){return function(t){if(He()!==e)return;let r=t.from,n=t.to,i=co(Ye.location.href),s=r?co(r):void 0,o=co(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),_r({category:"navigation",data:{from:r,to:n}})}}function pE(e){return!!e&&!!e.target}var fE=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],mE="BrowserApiErrors",dE=(e={})=>{let t=b({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:mE,setupOnce(){t.setTimeout&&Be(Ye,"setTimeout",Gm),t.setInterval&&Be(Ye,"setInterval",Gm),t.requestAnimationFrame&&Be(Ye,"requestAnimationFrame",hE),t.XMLHttpRequest&&"XMLHttpRequest"in Ye&&Be(XMLHttpRequest.prototype,"send",gE);let r=t.eventTarget;r&&(Array.isArray(r)?r:fE).forEach(yE)}}},Ym=dE;function Gm(e){return function(...t){let r=t[0];return t[0]=yn(r,{mechanism:{data:{function:Gt(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function hE(e){return function(t){return e.apply(this,[yn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Gt(e)},handled:!1,type:"instrument"}})])}}function gE(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Be(r,n,function(i){let s={mechanism:{data:{function:n,handler:Gt(i)},handled:!1,type:"instrument"}},o=fn(i);return o&&(s.mechanism.data.handler=Gt(o)),yn(i,s)})}),e.apply(this,t)}}function yE(e){let t=Ye,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Be(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=yn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Gt(s),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,yn(s,{mechanism:{data:{function:"addEventListener",handler:Gt(s),target:e},handled:!1,type:"instrument"}}),o])}}),Be(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let u=c&&c.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,c,o)}}))}var vE="GlobalHandlers",EE=(e={})=>{let t=b({onerror:!0,onunhandledrejection:!0},e);return{name:vE,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(_E(r),zm("onerror")),t.onunhandledrejection&&(SE(r),zm("onunhandledrejection"))}}},qm=EE;function _E(e){Dl(t=>{let{stackParser:r,attachStacktrace:n}=Km();if(He()!==e||su())return;let{msg:i,url:s,line:o,column:c,error:u}=t,d=IE($s(r,u||i,void 0,n,!1),s,o,c);d.level="error",mo(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function SE(e){Rl(t=>{let{stackParser:r,attachStacktrace:n}=Km();if(He()!==e||su())return;let i=bE(t),s=un(i)?wE(i):$s(r,i,void 0,n,!0);s.level="error",mo(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function bE(e){if(un(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function wE(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function IE(e,t,r,n){let i=e.exception=e.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},u=c.frames=c.frames||[],d=isNaN(parseInt(n,10))?void 0:n,g=isNaN(parseInt(r,10))?void 0:r,h=It(t)&&t.length>0?t:gl();return u.length===0&&u.push({colno:d,filename:h,function:yr,in_app:!0,lineno:g}),e}function zm(e){Pr&&K.log(`Global Handler attached: ${e}`)}function Km(){let e=He();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Xm=()=>({name:"HttpContext",preprocessEvent(e){if(!Ye.navigator&&!Ye.location&&!Ye.document)return;let t=e.request&&e.request.url||Ye.location&&Ye.location.href,{referrer:r}=Ye.document||{},{userAgent:n}=Ye.navigator||{},i=b(b(b({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=te(b(b({},e.request),t&&{url:t}),{headers:i});e.request=s}}),TE="cause",CE=5,xE="LinkedErrors",DE=(e={})=>{let t=e.limit||CE,r=e.key||TE;return{name:xE,preprocessEvent(n,i,s){let o=s.getOptions();dl(Hs,o.stackParser,o.maxValueLength,r,t,n,i)}}},Jm=DE;function Eu(e){return[Us(),ks(),Ym(),Wm(),qm(),Jm(),Fs(),Xm()]}var _u=class extends Error{cause;constructor(e,t){super(e),this.cause=t}},Le=class kh{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kh),this.INSTANCE}captureException(t,r,n){w.error(t),this.getNewScope(r,n).captureException(t)}captureMessage(t,r,n,i){this.getNewScope(n,i).captureMessage(t,r??"error")}captureError(t,r,n,i){w.error(t,r);let s=this.getNewScope(n,i),o=new _u(t,r);s.captureException(o)}setGlobalContext(t,r){this.contexts[t]=b({context:r},this.contexts[t])}setUser(t){this.user=t}setTags(t){this.tags=t}getNewScope(t,r){let n=new gt;if(n.setClient(this.client),n.setUser(this.user),t?.triggerContext){let i=t.triggerContext;n.setExtras(i.triggerData.sentryContext()),delete t.triggerContext}return t&&n.setExtras(t),this.tags&&n.setTags(this.tags),r&&n.setTags(r),Object.keys(this.contexts).forEach(i=>{n.setContext(i,this.contexts[i])}),n.setTag("language",navigator.language),n.setTag("timezone",J.getTimezone()),n}init(){let t=Eu({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new go({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:gu,stackParser:vu,integrations:t,environment:mt.mode,release:`web-sdk@${N.SDK_VERSION}`,debug:mt.debug}),this.client.init()}},J=class{static tz;static isValidURL(e){try{return new URL(e)}catch{return}}static isNull(e){return!e||e==="null"||e==="undefined"}static removeFromArray(e,t){let r=e.indexOf(t);return r===-1?!1:(e.splice(r,1),!0)}static formatCurrency(e,t){if(e==0&&t)return"Free";let r=ue.get(),n=Pe.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||w.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=cs.format(e*100,o);else{let u;try{u=new Intl.NumberFormat(this.getLang(),{style:"currency",currency:s||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(d){return Le.getInstance().captureException(d,{currentCurrency:s,shopCurrency:i}),""}c=u.format(e),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))}return c}static formatNumber(e){return new Intl.NumberFormat(this.getLang(),{notation:"compact"}).format(e)}static getLang(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}static getTimezone(){if(this.tz)return this.tz;try{return this.tz=Intl.DateTimeFormat().resolvedOptions().timeZone,this.tz}catch{return""}}static documentReady(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}static onDocumentLoaded(e){document.readyState==="complete"?e():document.addEventListener("readystatechange",()=>{document.readyState==="complete"&&e()})}static showSnackbar(e){let t=document.createElement("span");t.id="snackbar",t.innerText=e,document.body.appendChild(t),t.className="show",setTimeout(()=>{t.classList.remove("show"),document.body.removeChild(t)},3e3)}static async retrySelectorForElements(e,t=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<t;){let s=Math.min(100*2**n,5e3);if(await Qm.JSUtils.sleep(s),i=r.querySelectorAll(e),i.length)return w.debug(`Attempt ${n+1}: ${i.length} elements found with ${e}`),i;w.debug(`Attempt ${n+1}: Elements not found with ${e}. Retrying after ${s}ms.`),n++}return w.warn(`Max attempts reached. Element not found with ${e}.`),i}static async retrySelector(e,t=10,r=document){return(await this.retrySelectorForElements(e,t,r)).item(0)}static async retrySelectors(e,t=10,r=document){let n=await this.retrySelectorForElements(e,t,r);return Array.from(n)}static async getCartAttributes(){let e=await De.get(oe.DEVICE_ID),t=await nt.get(oe.ID,"");return[{key:"letscooee_did",value:e},{key:"letscooee_sid",value:t},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}]}static onNodesRemoved(e,t,r=document.body){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{(o===e||o.contains(e))&&(t(),n.disconnect())})})});n.observe(r,{childList:!0})}};function pi(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!1,value:r})}var Ys=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}},zs=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}},Su=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},Sr=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(t=>new Ys(t))??[],this.link=e.link,this.price=new zs(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.effectivePrice=jt(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=jt(void 0)),this.sellingPlans=e.sellingPlans?.map(t=>{let r=new Su(t);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}},Nt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=jt(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=jt(this.selectedVariant)}get imageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}update(e){return this.id=e.id,this.mID=e.mID,this.name=e.name,this.status=e.status,this.ctg=e.ctg,this.imgs=e.imgs,this.desc=e.desc,this.sDesc=e.sDesc,this.link=e.link,this.slug=e.slug,this.quantity=e.quantity,this.meta=e.meta,this.category=e.category,this.videos=e.videos,this.reviews=e.reviews,this.portraitVideos=e.videos?.filter(t=>t.orientation==="PORTRAIT"),this.tags=e.tags,e.vars&&(this.vars=e.vars.map(t=>new Sr(t))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new dt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}},qs=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}},bu=class{enabled;constructor(e){this.enabled=e.enabled}},wu=class extends bu{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},Ks=class{productQuantity;constructor(e){e??={},this.productQuantity=new wu(e.productQuantity)}},En=class{s;g;i;constructor(e){e.s&&(this.s=new Me(e.s)),e.g&&(this.g=new yo(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},vo="a-f\\d",RE=`#?[${vo}]{3}[${vo}]?`,AE=`#?[${vo}]{6}([${vo}]{2})?`,NE=new RegExp(`[^#${vo}]`,"gi"),OE=new RegExp(`^${RE}$|^${AE}$`,"i");function Iu(e,t={}){if(typeof e!="string"||NE.test(e)||!OE.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let r=1;e.length===8&&(r=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(r=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let n=Number.parseInt(e,16),i=n>>16,s=n>>8&255,o=n&255,c=typeof t.alpha=="number"?t.alpha:r;if(t.format==="array")return[i,s,o,c];if(t.format==="css"){let u=c===1?"":` / ${Number((c*100).toFixed(2))}%`;return`rgb(${i} ${s} ${o}${u})`}return{red:i,green:s,blue:o,alpha:c}}var Me=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return Iu(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}},Lr=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new Me(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return Xs[this.s??1]}},Xs=(e=>(e[e.SOLID=1]="SOLID",e[e.DASHED=2]="DASHED",e))(Xs||{}),yo=class Lh{static DEFAULT_FALLBACK=new Me({h:"#000000",a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new Me(t.c)),t.fb&&(this.fb=new Me(t.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??Lh.DEFAULT_FALLBACK}},Eo=class{blur;spr;clr;x;y;constructor(e){e=e??{},this.blur=e.blur??0,this.spr=e.spr??0,this.x=e.x??0,this.y=e.y??0,this.clr=new Me(e.clr)}getStyle(e){return`${this.x*e}px ${this.y*e}px ${this.blur*e}px ${this.spr*e}px ${this.clr.rgba}`}},Mr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(e){e=e??{},this.pl=e.pl??0,this.pr=e.pr??0,this.pt=e.pt??0,this.pb=e.pb??0,this.ml=e.ml??0,this.mr=e.mr??0,this.mt=e.mt??0,this.mb=e.mb??0,this.cent=e.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}},_n=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}},Bt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new En(e.bg)),e.br&&(this.br=new Lr(e.br)),e.shd&&(this.shd=new Eo(e.shd)),e.spc&&(this.spc=new Mr(e.spc)),this.trf=new _n(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return Ue[this.t]}get click(){return this.clc}},Ue=(e=>(e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.BUTTON=3]="BUTTON",e[e.FLEXBOX=4]="FLEXBOX",e[e.MULTI_COLUMN=5]="MULTI_COLUMN",e[e.CHECKBOX=6]="CHECKBOX",e[e.PRODUCTS=11]="PRODUCTS",e[e.PRODUCT=12]="PRODUCT",e[e.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",e[e.PRODUCT_TITLE=14]="PRODUCT_TITLE",e[e.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",e[e.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",e[e.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",e[e.PRODUCT_RATING=19]="PRODUCT_RATING",e[e.EMAIL_INPUT=51]="EMAIL_INPUT",e[e.PHONE_INPUT=52]="PHONE_INPUT",e[e.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",e[e.CAROUSEL=62]="CAROUSEL",e[e.SHAPE=100]="SHAPE",e))(Ue||{}),Sn=class extends Bt{constructor(e){super(e)}},kr=class extends Bt{src;constructor(e){super(e),this.src=e.src}},fi=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e[e.JUSTIFY=3]="JUSTIFY",e))(fi||{}),Js=class{name;fonts;constructor(e){e=e??{},e.name&&(e.name=e.name!=="Arial"?e.name:""),this.name=e.name,this.fonts=e.fonts?.map(t=>new Tu(t))}},Tu=class{style;url;constructor(e){e=e??{},this.style=e.style,this.url=e.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}},tt=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return fi[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(e){e=e??{},e.lh&&(this.lh=e.lh),e.tdc&&(this.tdc=new Me(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new Me(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new Js(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}},br=class extends Bt{typo;constructor(e){super(e);let t=b(b({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new tt(t)}get color(){return this.typography.tc}get typography(){return this.typo}},zr=class extends br{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}},Qs=class extends Bt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},mi=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,t){let r=new Date;e===2?(r.setSeconds(r.getSeconds()+this.ss),r.setMinutes(r.getMinutes()+this.mm),r.setHours(r.getHours()+this.hh),r.setDate(r.getDate()+this.dd)):r=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=r.getTime()-i;if(s<1){clearInterval(n);return}let o=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),u=Math.floor(s%(1e3*60*60)/(1e3*60)),d=Math.floor(s%(1e3*60)/1e3);t({days:o,hours:c,minutes:u,seconds:d})},1e3);return n}},di=class extends br{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new mi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},Zs=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new Me(e.c??{})}get text(){return this.txt}get color(){return this.c}},qr=class extends br{ph;constructor(e){super(e),this.ph=new Zs(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},hi=class extends qr{constructor(e){e??={},super(e)}},gi=class extends qr{},yi=class extends qr{},vi=class extends kr{},bn=(e=>(e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH",e))(bn||{}),ea=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}},_o=class extends Bt{gvt;max;cover;anim;embedded;position;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new ea(e.anim),this.embedded=e.embedded,this.position=e.position??1,this.spc||(this.spc=new Mr({pl:N.IN_APP_DEFAULT_PADDING,pr:N.IN_APP_DEFAULT_PADDING,pt:N.IN_APP_DEFAULT_PADDING,pb:N.IN_APP_DEFAULT_PADDING}))}isEmbedded(){return this.position===2&&!!this.embedded}getEmbeddedSelector(){return`.letscooee-engagement.container-${this.embedded}`}},ta=class extends _o{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new Qs(e.cont),this.mob=new _o(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new kr(t)):t.t===2?this.elems.push(new zr(t)):t.t===3?this.elems.push(new zr(t)):t.t===100?this.elems.push(new Sn(t)):t.t===51?this.elems.push(new gi(t)):t.t===52?this.elems.push(new yi(t)):t.t===61?this.elems.push(new di(t)):t.t===15||t.t===16?this.elems.push(new hi(t)):t.t===13&&this.elems.push(new vi(t))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},t,r;return this.gvt===1?(t="flex-start",r="flex-start"):this.gvt===2?(t="center",r="flex-start"):this.gvt===3?(t="flex-end",r="flex-start"):this.gvt===4?(t="flex-start",r="center"):this.gvt===6?(t="flex-end",r="center"):this.gvt===7?(t="flex-start",r="flex-end"):this.gvt===8?(t="center",r="flex-end"):this.gvt===9?(t="flex-end",r="flex-end"):(t="center",r="center"),e.alignItems=r,e.justifyContent=t,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim,this.position=this.mob.position??this.position,this.embedded=this.mob.embedded??this.embedded}},Ei=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}},ra=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}},na=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}},ia=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Mr(e.spc),e.size&&(this.size=new na(e.size)),e.bg&&(this.bg=new En(e.bg)),e.br&&(this.br=new Lr(e.br)),e.typo&&(this.typo=new tt(e.typo)),e.lout&&(this.lout=new ra(e.lout)),e.flex&&(this.flex=new Ei(e.flex))}},_i=class{sm;lg;constructor(e){e??={},this.sm=new ia(e.sm),this.lg=new ia(e.lg)}},ot=class{t;style;hide;when;clc;constructor(e,t){t??={},this.t=e,this.style=new _i(t.style),this.hide=t.hide,t.when?.op&&(this.when=t.when),t.clc&&(this.clc=t.clc)}get stringType(){return Ue[this.t]}},st=class extends ot{text;constructor(e,t){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(t??2,e),e??={},this.text=e.text}},wn=class extends st{constructor(e,t){super(e,t??3)}},Si=class extends ot{value;constructor(e){super(6,e),e??={},this.value=e.value}},bi=class extends st{constructor(e=15,t){super(t,e)}},oa=class extends ot{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new Me(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}},Zm=Se(an()),Cu=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new Me(e.color)}},xu=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new Me(e.color)}},So=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(e){e??={},this.navigation=new xu(e.navigation),this.pagination=new Cu(e.pagination),this.autoplay=e.autoplay,this.slidesPerView=e.slidesPerView??1,this.maxInRow=e.maxInRow??e.slidesPerView??4,this.gap=e.gap??0}},sa=class extends ot{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=Ut.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new So(e.conf),this.allowedTypes=e.allowedTypes}},aa=class extends st{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new mi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},Kr=class extends ot{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(t=>{let r=Ut.getParsedElement(t);r&&this.elems.push(r)})}},In=class extends ot{src;sm;lg;constructor(e,t){super(t??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}},Ut=class Uh{static getParsedElements(t){let r=[];return t?.forEach(n=>{let i=Uh.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(t){switch(t.t){case 2:return new st(t);case 3:return new wn(t);case 6:return new Si(t);case 11:return new ca(t);case 12:return new Xr(t);case 61:return new aa(t);case 4:return new Kr(t);case 1:return new In(t);case 13:return new In(t,13);case 14:return new st(t,14);case 15:case 16:return new bi(t.t,t);case 18:return new wn(t,18);case 62:return new sa(t);case 19:return new oa(t);default:Zm.default.error("Unknown element type",t.t);return}}static parseAlignmentToJustifyContent(t){switch(t){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}},Xr=class extends ot{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=Ut.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new Si(e.cBox)),this.elems.push(new In(e.img,13));let t=new st(e.title,14);t.hide=!e.show?.title,t.text="{{ product.name }}",this.elems.push(t);let r=new st(e.price);r.text="{{ product.price }}",r.hide=!e.show?.price;let n=new st(e.compareAt);n.text="{{ product.compare_price }}",n.hide=!e.show?.price,e.compareAt||(n.style=new _i(r.style),n.style.lg.typo=new tt(te(b({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new tt(te(b({},n.style.sm.typo),{td:"line-through"})));let i=new Kr({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Ut.parseAlignmentToJustifyContent(r.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(r),this.elems.push(i);let s=new bi(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let o=new wn(e.btn,18);o.hide=!e.show?.btn,this.elems.push(o)}}e.symbol&&(this.symbol=new st(e.symbol))}},ca=class extends ot{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Du(e.conf),this.prod=new Xr(e.prod)}},la=class extends So{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Du=class{lg;sm;constructor(e){e??={},this.lg=new la(e.lg),this.sm=new la(e.sm)}},ua=class extends Kr{constructor(e){super(e)}},wi=class{cont;elems=[];constructor(e){e=e??{},this.cont=new ua(e.cont),e.elems?.forEach(t=>{this.addRawElement(t)})}addRawElement(e){let t=Ut.getParsedElement(e);return t&&this.elems.push(t),t}},ed=Se(Rr()),Ru=class{minValue;rewardType;label;reachingText;reachedText;discount;items;calculatedAlignment;constructor(e){this.minValue=e.minValue,this.rewardType=e.rewardType,this.label=e.label,this.reachingText=e.reachingText,this.reachedText=e.reachedText,this.discount=e.discount,this.items=e.items?.map(t=>new dt(t))}},pa=class{layout;milestones;onlyLatestGift;noConfetti;constructor(e){this.layout=e.layout??ed.ProgressBarLayout.ICONS,this.milestones=e.milestones?.map(t=>new Ru(t))??[],this.onlyLatestGift=e.onlyLatestGift,this.noConfetti=e.noConfetti}},fa=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}},ma=class{id;alt;sources;items;durationMS;thumbnail;constructor(e={}){this.id=e.id,this.alt=e.alt,this.sources=e.sources,this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(t=>new dt(t)):[]}},da=class{videos;source;template;heading;constructor(e={}){this.videos=e.videos?.map(t=>new ma(t))??[],this.source=e.source,this.template=e.template,this.heading=e.heading}},ha=class{experiments;constructor(e){this.experiments=e.experiments?.map(t=>new Au(t))}},Au=class{cssSelector;type;display;bg;typo;br;text;constructor(e={}){this.cssSelector=e.cssSelector??"",this.type=e.type??"OTHER",this.display=e.display,e.bg&&(this.bg=new Me(e.bg)),e.typo&&(this.typo=new tt(e.typo)),e.br&&(this.br=new Lr(e.br)),this.text=e.text}get style(){let e={};return this.display==="HIDE"?e.display="none":this.display==="BLOCK"?e.display="block":this.display==="INLINE"&&(e.display="inline"),this.br?.r&&(e.borderRadius=this.br.r+"px"),this.br?.w&&(e.borderWidth=this.br.w+"px"),this.br?.s&&(e.borderStyle=Xs[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type==="TEXT"&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+"px"),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??"none")),e}},Nu=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===at.EngagementContentType.EXCLUSION}isABTesting(){return this.contentType===at.EngagementContentType.ABTESTING}isSingleContent(){return this.contentType===at.EngagementContentType.SINGLE}},Dt=class Mh extends Nu{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=jt({});constructor(t){super(t),this.id=t.id,this.nudgeID=t.nudgeID,this.currency=ue.get().currencyCode??"USD",this.contentID=t.contentID,this.variation=t.variation,t.widget&&(this.widget=new wi(t.widget)),this.previewType=t.previewType,this.occurred=t.occurred??new Date,this.props=t.props,this.embeddedItems=t.embeddedItems?.map(r=>new dt(r)),this.items=t.items?.map(r=>new Nt(r))??[],this.nonMutableItems=t.items?.map(r=>new Nt(r))??[],this.collections=t.collections?.map(r=>new qs(r))??[],this.discount=t.discount,this.placement=t.placement,this.customerData=t.customerData,this.ian=t.ian?this.processPopup(t.ian):void 0,this.promotionType=t.promotionType,this.manipulation=new Ks(t.manipulation),this.contentSource=t.contentSource,this.klaviyoFormID=t.klaviyoFormID,this.hasMultiplePlacement=t.hasMultiplePlacement,this.skipSubscribedItems=t.skipSubscribedItems,this.stickyATCConfig=t.stickyATCConfig,t.experimentConfig&&(this.experimentConfig=new ha(t.experimentConfig)),t.progressBarConfig&&(this.progressBarConfig=new pa(t.progressBarConfig)),t.bundleConfig&&(this.bundleConfig=new fa(t.bundleConfig)),t.bundleFrom&&(this.bundleFrom=new Nt(t.bundleFrom)),t.content?.videoConfig&&(this.content={videoConfig:new da(t.content.videoConfig)})}shouldDelay(){return this.delay>0}sentryContext(){return{id:this.id,shortID:this.shortID,currency:this.currency,contentType:this.contentType,objective:this.objective,onsiteDeliveryType:this.onsiteDeliveryType,engagementID:this.engagementID,contentID:this.contentID,nudgeID:this.nudgeID,variation:this.variation}}getDelaySeconds(){let t=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-t}isBundle(){return this.objective===at.EngagementObjective.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===at.OnsiteDeliveryType.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===at.OnsiteDeliveryType.PAGE_EMBED}isProgressBar(){return this.objective===at.EngagementObjective.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===at.EngagementObjective.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===at.EngagementObjective.CART_RECOVERY}isProductPromotion(){return this.objective===at.EngagementObjective.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===at.PromotionType.COLLECTION}isBYOB(){return this.objective===at.EngagementObjective.BYOB}isStickyATC(){return this.objective===at.EngagementObjective.STICKY_ATC}isShoppableVideo(){return this.objective===at.EngagementObjective.SHOPPABLE_VIDEO}processPopup(t){let r=JSON.stringify(t),n=this.items[0],i={},s={};if(n){let u=n.selectedOrFirstVariant.value;i={name:n.name,id:n.mID,link:n.link,vID:u.mID,image:n.variantImage,price:J.formatCurrency(u.price.d),comparePrice:J.formatCurrency(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:fe.getCurrent().item_count},c=wt.render(r,{product:i,variant:s,cart:o,discount:this.discount,customer:this.customerData});return n&&(c=c.replace(new RegExp(N.PLACEHOLDER_IMAGE,"gi"),n.variantImage??n.imageURL)),new ta(JSON.parse(c))}calculateDiscountData(t,r){let n=ga.ArrayUtils.sum(t,o=>o.selectedOrFirstVariant.value.price.d),i=ga.ArrayUtils.sum(t,o=>{let c=o.selectedOrFirstVariant.value.price;return c.cmp??c.d}),s={actualPrice:n,totalComparePrice:i,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!t?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(s);return}if(Jr.DiscountType.BXGY===this.discount.type&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],this.updateEffectivePrice(t,s.discountPercentage,!0),s.discountAmount=s.actualPrice-ga.ArrayUtils.sum(t,o=>o.selectedOrFirstVariant.value.effectivePrice.value);else if([Jr.DiscountType.UNIQUE_FLAT_ITEMS,Jr.DiscountType.STATIC].includes(this.discount.type)&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],s.discountAmount=s.actualPrice*s.discountPercentage/100,this.updateEffectivePrice(t,s.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)s.discountAmount=s.actualPrice-this.discount.values[0],s.discountPercentage=s.discountAmount/s.actualPrice*100,this.updateEffectivePrice(t,s.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_CHEAPEST_ITEM_FREE){t.sort((c,u)=>u.selectedOrFirstVariant.value.price.d-c.selectedOrFirstVariant.value.price.d);let o=t[t.length-1];o.selectedOrFirstVariant.value.effectivePrice.value=0,s.discountAmount=o.selectedOrFirstVariant.value.price.d,s.discountPercentage=s.discountAmount/s.actualPrice*100}s.discountedPrice=s.actualPrice-s.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(s)}getPrivateAttributesForLineItem(){return Pe.get().skipItemAttribute?{}:{[N.VIA]:"Cooee",[N.CAMPAIGN_ATTRIBUTE]:this.shortID,[N.CONTENT_ATTRIBUTE]:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Pe.get().skipItemAttribute?[]:[{key:N.VIA,value:"Cooee"},{key:N.CAMPAIGN_ATTRIBUTE,value:this.shortID},{key:N.CONTENT_ATTRIBUTE,value:this.contentID}]}isBundleDiscount(){return[Jr.DiscountType.UNIQUE_FIXED_ITEMS,Jr.DiscountType.UNIQUE_FLAT_ITEMS].includes(this.discount.type)}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){let t=this.widget?.elems.find(n=>Mh.SWIPER_ELEMENTS.has(n.t));if(!t)return!1;if(t.t===62)return!0;let r=Mt.get().isMobile()?"sm":"lg";return t.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}getCartMagicVariables(){let t=fe.getCurrent();return{productCount:t.item_count,amount:J.formatCurrency(t.total_price/100),originalAmount:J.formatCurrency(t.original_total_price/100)}}updateEffectivePrice(t,r,n=!1){let i=ue.get().getCurrentItem();t.forEach(s=>{let o=s.selectedOrFirstVariant.value,c=o.price;if(n&&s.mID===i.mID)o.effectivePrice.value=c.d;else{let u=c.d*r/100;o.effectivePrice.value=c.d-u}})}formatCurrencyAndNumber(t){if(!t)return{};let r={discountPercentage:J.formatNumber(t.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{r[n]=J.formatCurrency(t[n])}),r}};function LE(e,t){return t={exports:{}},e(t,t.exports),t.exports}var ME=FE,kE=$E,BE=WE,Ir=[],qt=[],UE=typeof Uint8Array<"u"?Uint8Array:Array,Ou="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tn=0,td=Ou.length;Tn<td;++Tn)Ir[Tn]=Ou[Tn],qt[Ou.charCodeAt(Tn)]=Tn;var Tn,td;qt[45]=62;qt[95]=63;function yd(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function FE(e){var t=yd(e),r=t[0],n=t[1];return(r+n)*3/4-n}function HE(e,t,r){return(t+r)*3/4-r}function $E(e){var t,r=yd(e),n=r[0],i=r[1],s=new UE(HE(e,n,i)),o=0,c=i>0?n-4:n,u;for(u=0;u<c;u+=4)t=qt[e.charCodeAt(u)]<<18|qt[e.charCodeAt(u+1)]<<12|qt[e.charCodeAt(u+2)]<<6|qt[e.charCodeAt(u+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=qt[e.charCodeAt(u)]<<2|qt[e.charCodeAt(u+1)]>>4,s[o++]=t&255),i===1&&(t=qt[e.charCodeAt(u)]<<10|qt[e.charCodeAt(u+1)]<<4|qt[e.charCodeAt(u+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function jE(e){return Ir[e>>18&63]+Ir[e>>12&63]+Ir[e>>6&63]+Ir[e&63]}function VE(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(jE(n));return i.join("")}function WE(e){for(var t,r=e.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(VE(e,o,o+s>c?c:o+s));return n===1?(t=e[r-1],i.push(Ir[t>>2]+Ir[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Ir[t>>10]+Ir[t>>4&63]+Ir[t<<2&63]+"=")),i.join("")}var Pu={byteLength:ME,toByteArray:kE,fromByteArray:BE},GE=function(e,t,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,d=u>>1,g=-7,h=r?i-1:0,m=r?-1:1,E=e[t+h];for(h+=m,s=E&(1<<-g)-1,E>>=-g,g+=c;g>0;s=s*256+e[t+h],h+=m,g-=8);for(o=s&(1<<-g)-1,s>>=-g,g+=n;g>0;o=o*256+e[t+h],h+=m,g-=8);if(s===0)s=1-d;else{if(s===u)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-d}return(E?-1:1)*o*Math.pow(2,s-n)},YE=function(e,t,r,n,i,s){var o,c,u,d=s*8-i-1,g=(1<<d)-1,h=g>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,v=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=g):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=m/u:t+=m*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=g?(c=0,o=g):o+h>=1?(c=(t*u-1)*Math.pow(2,i),o=o+h):(c=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+E]=c&255,E+=v,c/=256,i-=8);for(o=o<<i|c,d+=i;d>0;e[r+E]=o&255,E+=v,o/=256,d-=8);e[r+E-v]|=_*128},Ii={read:GE,write:YE},Ea=LE(function(e,t){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=P,t.INSPECT_MAX_BYTES=50;var n=2147483647;t.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var a=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(a,l),a.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(a){if(a>n)throw new RangeError('The value "'+a+'" is invalid for option "size"');var l=new Uint8Array(a);return Object.setPrototypeOf(l,o.prototype),l}function o(a,l,p){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(a)}return c(a,l,p)}o.poolSize=8192;function c(a,l,p){if(typeof a=="string")return h(a,l);if(ArrayBuffer.isView(a))return E(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(St(a,ArrayBuffer)||a&&St(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(St(a,SharedArrayBuffer)||a&&St(a.buffer,SharedArrayBuffer)))return v(a,l,p);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var T=a.valueOf&&a.valueOf();if(T!=null&&T!==a)return o.from(T,l,p);var A=_(a);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return o.from(a[Symbol.toPrimitive]("string"),l,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}o.from=function(a,l,p){return c(a,l,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function d(a,l,p){return u(a),a<=0?s(a):l!==void 0?typeof p=="string"?s(a).fill(l,p):s(a).fill(l):s(a)}o.alloc=function(a,l,p){return d(a,l,p)};function g(a){return u(a),s(a<0?0:D(a)|0)}o.allocUnsafe=function(a){return g(a)},o.allocUnsafeSlow=function(a){return g(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var p=M(a,l)|0,T=s(p),A=T.write(a,l);return A!==p&&(T=T.slice(0,A)),T}function m(a){for(var l=a.length<0?0:D(a.length)|0,p=s(l),T=0;T<l;T+=1)p[T]=a[T]&255;return p}function E(a){if(St(a,Uint8Array)){var l=new Uint8Array(a);return v(l.buffer,l.byteOffset,l.byteLength)}return m(a)}function v(a,l,p){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(p||0))throw new RangeError('"length" is outside of buffer bounds');var T;return l===void 0&&p===void 0?T=new Uint8Array(a):p===void 0?T=new Uint8Array(a,l):T=new Uint8Array(a,l,p),Object.setPrototypeOf(T,o.prototype),T}function _(a){if(o.isBuffer(a)){var l=D(a.length)|0,p=s(l);return p.length===0||a.copy(p,0,0,l),p}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):m(a);if(a.type==="Buffer"&&Array.isArray(a.data))return m(a.data)}function D(a){if(a>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return a|0}function P(a){return+a!=a&&(a=0),o.alloc(+a)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(St(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),St(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;for(var p=a.length,T=l.length,A=0,U=Math.min(p,T);A<U;++A)if(a[A]!==l[A]){p=a[A],T=l[A];break}return p<T?-1:T<p?1:0},o.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<a.length;++p)l+=a[p].length;var T=o.allocUnsafe(l),A=0;for(p=0;p<a.length;++p){var U=a[p];if(St(U,Uint8Array))A+U.length>T.length?o.from(U).copy(T,A):Uint8Array.prototype.set.call(T,U,A);else if(o.isBuffer(U))U.copy(T,A);else throw new TypeError('"list" argument must be an Array of Buffers');A+=U.length}return T};function M(a,l){if(o.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||St(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var p=a.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&p===0)return 0;for(var A=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return sn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Wn(a).length;default:if(A)return T?-1:sn(a).length;l=(""+l).toLowerCase(),A=!0}}o.byteLength=M;function L(a,l,p){var T=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return _t(this,l,p);case"utf8":case"utf-8":return $e(this,l,p);case"ascii":return We(this,l,p);case"latin1":case"binary":return ve(this,l,p);case"base64":return ge(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,l,p);default:if(T)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function R(a,l,p){var T=a[l];a[l]=a[p],a[p]=T}o.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<a;l+=2)R(this,l,l+1);return this},o.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<a;l+=4)R(this,l,l+3),R(this,l+1,l+2);return this},o.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<a;l+=8)R(this,l,l+7),R(this,l+1,l+6),R(this,l+2,l+5),R(this,l+3,l+4);return this},o.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?$e(this,0,a):L.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){var a="",l=t.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,p,T,A){if(St(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(l===void 0&&(l=0),p===void 0&&(p=a?a.length:0),T===void 0&&(T=0),A===void 0&&(A=this.length),l<0||p>a.length||T<0||A>this.length)throw new RangeError("out of range index");if(T>=A&&l>=p)return 0;if(T>=A)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,T>>>=0,A>>>=0,this===a)return 0;for(var U=A-T,W=p-l,Ie=Math.min(U,W),me=this.slice(T,A),ye=a.slice(l,p),je=0;je<Ie;++je)if(me[je]!==ye[je]){U=me[je],W=ye[je];break}return U<W?-1:W<U?1:0};function G(a,l,p,T,A){if(a.length===0)return-1;if(typeof p=="string"?(T=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,$r(p)&&(p=A?0:a.length-1),p<0&&(p=a.length+p),p>=a.length){if(A)return-1;p=a.length-1}else if(p<0)if(A)p=0;else return-1;if(typeof l=="string"&&(l=o.from(l,T)),o.isBuffer(l))return l.length===0?-1:he(a,l,p,T,A);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(a,l,p):Uint8Array.prototype.lastIndexOf.call(a,l,p):he(a,[l],p,T,A);throw new TypeError("val must be string, number or Buffer")}function he(a,l,p,T,A){var U=1,W=a.length,Ie=l.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(a.length<2||l.length<2)return-1;U=2,W/=2,Ie/=2,p/=2}function me(ee,Ce){return U===1?ee[Ce]:ee.readUInt16BE(Ce*U)}var ye;if(A){var je=-1;for(ye=p;ye<W;ye++)if(me(a,ye)===me(l,je===-1?0:ye-je)){if(je===-1&&(je=ye),ye-je+1===Ie)return je*U}else je!==-1&&(ye-=ye-je),je=-1}else for(p+Ie>W&&(p=W-Ie),ye=p;ye>=0;ye--){for(var z=!0,ce=0;ce<Ie;ce++)if(me(a,ye+ce)!==me(l,ce)){z=!1;break}if(z)return ye}return-1}o.prototype.includes=function(a,l,p){return this.indexOf(a,l,p)!==-1},o.prototype.indexOf=function(a,l,p){return G(this,a,l,p,!0)},o.prototype.lastIndexOf=function(a,l,p){return G(this,a,l,p,!1)};function Ae(a,l,p,T){p=Number(p)||0;var A=a.length-p;T?(T=Number(T),T>A&&(T=A)):T=A;var U=l.length;T>U/2&&(T=U/2);for(var W=0;W<T;++W){var Ie=parseInt(l.substr(W*2,2),16);if($r(Ie))return W;a[p+W]=Ie}return W}function B(a,l,p,T){return $n(sn(l,a.length-p),a,p,T)}function Z(a,l,p,T){return $n(ti(l),a,p,T)}function Y(a,l,p,T){return $n(Wn(l),a,p,T)}function Q(a,l,p,T){return $n(zi(l,a.length-p),a,p,T)}o.prototype.write=function(a,l,p,T){if(l===void 0)T="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")T=l,p=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(p)?(p=p>>>0,T===void 0&&(T="utf8")):(T=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var A=this.length-l;if((p===void 0||p>A)&&(p=A),a.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");for(var U=!1;;)switch(T){case"hex":return Ae(this,a,l,p);case"utf8":case"utf-8":return B(this,a,l,p);case"ascii":case"latin1":case"binary":return Z(this,a,l,p);case"base64":return Y(this,a,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,a,l,p);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),U=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ge(a,l,p){return l===0&&p===a.length?Pu.fromByteArray(a):Pu.fromByteArray(a.slice(l,p))}function $e(a,l,p){p=Math.min(a.length,p);for(var T=[],A=l;A<p;){var U=a[A],W=null,Ie=U>239?4:U>223?3:U>191?2:1;if(A+Ie<=p){var me,ye,je,z;switch(Ie){case 1:U<128&&(W=U);break;case 2:me=a[A+1],(me&192)===128&&(z=(U&31)<<6|me&63,z>127&&(W=z));break;case 3:me=a[A+1],ye=a[A+2],(me&192)===128&&(ye&192)===128&&(z=(U&15)<<12|(me&63)<<6|ye&63,z>2047&&(z<55296||z>57343)&&(W=z));break;case 4:me=a[A+1],ye=a[A+2],je=a[A+3],(me&192)===128&&(ye&192)===128&&(je&192)===128&&(z=(U&15)<<18|(me&63)<<12|(ye&63)<<6|je&63,z>65535&&z<1114112&&(W=z))}}W===null?(W=65533,Ie=1):W>65535&&(W-=65536,T.push(W>>>10&1023|55296),W=56320|W&1023),T.push(W),A+=Ie}return ft(T)}var y=4096;function ft(a){var l=a.length;if(l<=y)return String.fromCharCode.apply(String,a);for(var p="",T=0;T<l;)p+=String.fromCharCode.apply(String,a.slice(T,T+=y));return p}function We(a,l,p){var T="";p=Math.min(a.length,p);for(var A=l;A<p;++A)T+=String.fromCharCode(a[A]&127);return T}function ve(a,l,p){var T="";p=Math.min(a.length,p);for(var A=l;A<p;++A)T+=String.fromCharCode(a[A]);return T}function _t(a,l,p){var T=a.length;(!l||l<0)&&(l=0),(!p||p<0||p>T)&&(p=T);for(var A="",U=l;U<p;++U)A+=qi[a[U]];return A}function ae(a,l,p){for(var T=a.slice(l,p),A="",U=0;U<T.length-1;U+=2)A+=String.fromCharCode(T[U]+T[U+1]*256);return A}o.prototype.slice=function(a,l){var p=this.length;a=~~a,l=l===void 0?p:~~l,a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<a&&(l=a);var T=this.subarray(a,l);return Object.setPrototypeOf(T,o.prototype),T};function ie(a,l,p){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a],A=1,U=0;++U<l&&(A*=256);)T+=this[a+U]*A;return T},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a+--l],A=1;l>0&&(A*=256);)T+=this[a+--l]*A;return T},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||ie(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||ie(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||ie(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a],A=1,U=0;++U<l&&(A*=256);)T+=this[a+U]*A;return A*=128,T>=A&&(T-=Math.pow(2,8*l)),T},o.prototype.readIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=l,A=1,U=this[a+--T];T>0&&(A*=256);)U+=this[a+--T]*A;return A*=128,U>=A&&(U-=Math.pow(2,8*l)),U},o.prototype.readInt8=function(a,l){return a=a>>>0,l||ie(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var p=this[a]|this[a+1]<<8;return p&32768?p|4294901760:p},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var p=this[a+1]|this[a]<<8;return p&32768?p|4294901760:p},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),Ii.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),Ii.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),Ii.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),Ii.read(this,a,!1,52,8)};function Ke(a,l,p,T,A,U){if(!o.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>A||l<U)throw new RangeError('"value" argument is out of bounds');if(p+T>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,p,T){if(a=+a,l=l>>>0,p=p>>>0,!T){var A=Math.pow(2,8*p)-1;Ke(this,a,l,p,A,0)}var U=1,W=0;for(this[l]=a&255;++W<p&&(U*=256);)this[l+W]=a/U&255;return l+p},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,p,T){if(a=+a,l=l>>>0,p=p>>>0,!T){var A=Math.pow(2,8*p)-1;Ke(this,a,l,p,A,0)}var U=p-1,W=1;for(this[l+U]=a&255;--U>=0&&(W*=256);)this[l+U]=a/W&255;return l+p},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeIntLE=function(a,l,p,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*p-1);Ke(this,a,l,p,A-1,-A)}var U=0,W=1,Ie=0;for(this[l]=a&255;++U<p&&(W*=256);)a<0&&Ie===0&&this[l+U-1]!==0&&(Ie=1),this[l+U]=(a/W>>0)-Ie&255;return l+p},o.prototype.writeIntBE=function(a,l,p,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*p-1);Ke(this,a,l,p,A-1,-A)}var U=p-1,W=1,Ie=0;for(this[l+U]=a&255;--U>=0&&(W*=256);)a<0&&Ie===0&&this[l+U+1]!==0&&(Ie=1),this[l+U]=(a/W>>0)-Ie&255;return l+p},o.prototype.writeInt8=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||Ke(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function tr(a,l,p,T,A,U){if(p+T>a.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function lr(a,l,p,T,A){return l=+l,p=p>>>0,A||tr(a,l,p,4),Ii.write(a,l,p,T,23,4),p+4}o.prototype.writeFloatLE=function(a,l,p){return lr(this,a,l,!0,p)},o.prototype.writeFloatBE=function(a,l,p){return lr(this,a,l,!1,p)};function Et(a,l,p,T,A){return l=+l,p=p>>>0,A||tr(a,l,p,8),Ii.write(a,l,p,T,52,8),p+8}o.prototype.writeDoubleLE=function(a,l,p){return Et(this,a,l,!0,p)},o.prototype.writeDoubleBE=function(a,l,p){return Et(this,a,l,!1,p)},o.prototype.copy=function(a,l,p,T){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(p||(p=0),!T&&T!==0&&(T=this.length),l>=a.length&&(l=a.length),l||(l=0),T>0&&T<p&&(T=p),T===p||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),a.length-l<T-p&&(T=a.length-l+p);var A=T-p;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,p,T):Uint8Array.prototype.set.call(a,this.subarray(p,T),l),A},o.prototype.fill=function(a,l,p,T){if(typeof a=="string"){if(typeof l=="string"?(T=l,l=0,p=this.length):typeof p=="string"&&(T=p,p=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!o.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(a.length===1){var A=a.charCodeAt(0);(T==="utf8"&&A<128||T==="latin1")&&(a=A)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,a||(a=0);var U;if(typeof a=="number")for(U=l;U<p;++U)this[U]=a;else{var W=o.isBuffer(a)?a:o.from(a,T),Ie=W.length;if(Ie===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(U=0;U<p-l;++U)this[U+l]=W[U%Ie]}return this};var Vr=/[^+/0-9A-Za-z-_]/g;function Gn(a){if(a=a.split("=")[0],a=a.trim().replace(Vr,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function sn(a,l){l=l||1/0;for(var p,T=a.length,A=null,U=[],W=0;W<T;++W){if(p=a.charCodeAt(W),p>55295&&p<57344){if(!A){if(p>56319){(l-=3)>-1&&U.push(239,191,189);continue}else if(W+1===T){(l-=3)>-1&&U.push(239,191,189);continue}A=p;continue}if(p<56320){(l-=3)>-1&&U.push(239,191,189),A=p;continue}p=(A-55296<<10|p-56320)+65536}else A&&(l-=3)>-1&&U.push(239,191,189);if(A=null,p<128){if((l-=1)<0)break;U.push(p)}else if(p<2048){if((l-=2)<0)break;U.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;U.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;U.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return U}function ti(a){for(var l=[],p=0;p<a.length;++p)l.push(a.charCodeAt(p)&255);return l}function zi(a,l){for(var p,T,A,U=[],W=0;W<a.length&&!((l-=2)<0);++W)p=a.charCodeAt(W),T=p>>8,A=p%256,U.push(A),U.push(T);return U}function Wn(a){return Pu.toByteArray(Gn(a))}function $n(a,l,p,T){for(var A=0;A<T&&!(A+p>=l.length||A>=a.length);++A)l[A+p]=a[A];return A}function St(a,l){return a instanceof l||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===l.name}function $r(a){return a!==a}var qi=function(){for(var a="0123456789abcdef",l=new Array(256),p=0;p<16;++p)for(var T=p*16,A=0;A<16;++A)l[T+A]=a[p]+a[A];return l}()}),be=Ea.Buffer;Ea.SlowBuffer;Ea.INSPECT_MAX_BYTES;Ea.kMaxLength;var Uu=function(e,t){return Uu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Uu(e,t)};function Sa(e,t){Uu(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var xn=function(e){Sa(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),Ve=function(e){Sa(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function ya(e){return e&&e.Math==Math&&e}function vd(){return ya(typeof globalThis=="object"&&globalThis)||ya(typeof window=="object"&&window)||ya(typeof self=="object"&&self)||ya(typeof global=="object"&&global)||Function("return this")()}function zE(){var e=vd();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var qE=function(e){var t=zE()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(t);for(var r=be.alloc(e),n=0;n<e;++n)r[n]=Math.floor(Math.random()*256);return r},KE=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(be.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(be.alloc(t))}:qE}},Ed=KE();function XE(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Hu(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function JE(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function QE(e){return To(e)&&Object.prototype.toString.call(e)==="[object Date]"}function To(e){return typeof e=="object"&&e!==null}function ba(e,t){var r=!1;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r||(console.warn(t),r=!0),e.apply(this,i)}return n}function va(e){if(ArrayBuffer.isView(e))return be.from(e.buffer,e.byteOffset,e.byteLength);if(XE(e))return be.from(e);throw new Ve("Must use either Buffer or TypedArray")}var ZE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,_d=function(e){return typeof e=="string"&&ZE.test(e)},Fu=function(e){if(!_d(e))throw new Ve('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return be.from(t,"hex")},rd=function(e,t){return t===void 0&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")},XO=Math.pow(2,63)-1,JO=-Math.pow(2,63),e_=Math.pow(2,53),t_=-Math.pow(2,53),Sd=4,Dn=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new Ve("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=be.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=be.from(t,"binary"):Array.isArray(t)?this.buffer=be.from(t):this.buffer=va(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new Ve("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new Ve("only accepts single character Uint8Array or Array");var r;if(typeof t=="string"?r=t.charCodeAt(0):typeof t=="number"?r=t:r=t[0],r<0||r>255)throw new Ve("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=be.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},e.prototype.write=function(t,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+t.length){var n=be.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(va(t),r),this.position=r+t.byteLength>this.position?r+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,r,t.length,"binary"),this.position=r+t.length>this.position?r+t.length:this.position)},e.prototype.read=function(t,r){return r=r&&r>0?r:this.position,this.buffer.slice(t,t+r)},e.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(t){return this.buffer.toString(t)},e.prototype.toExtendedJSON=function(t){t=t||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return t.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new nd(this.buffer.slice(0,this.position));throw new xn('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){r=r||{};var n,i;if("$binary"in t?r.legacy&&typeof t.$binary=="string"&&"$type"in t?(i=t.$type?parseInt(t.$type,16):0,n=be.from(t.$binary,"base64")):typeof t.$binary!="string"&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=be.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=Fu(t.$uuid)),!n)throw new Ve("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===Sd?new nd(n):new e(n,i)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e}();Object.defineProperty(Dn.prototype,"_bsontype",{value:"Binary"});var Lu=16,nd=function(e){Sa(t,e);function t(r){var n=this,i,s;if(r==null)i=t.generate();else if(r instanceof t)i=be.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===Lu)i=va(r);else if(typeof r=="string")i=Fu(r);else throw new Ve("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=e.call(this,i,Sd)||this,n.__id=s,n}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,t.cacheHexString&&(this.__id=rd(r))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(r){if(r===void 0&&(r=!0),t.cacheHexString&&this.__id)return this.__id;var n=rd(this.id,r);return t.cacheHexString&&(this.__id=n),n},t.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(r){if(!r)return!1;if(r instanceof t)return r.id.equals(this.id);try{return new t(r).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new Dn(this.id,Dn.SUBTYPE_UUID)},t.generate=function(){var r=Ed(Lu);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,be.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?_d(r):Hu(r)?r.length!==Lu?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var n=Fu(r);return new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}(Dn),wa=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},e}();Object.defineProperty(wa.prototype,"_bsontype",{value:"Code"});function r_(e){return To(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var wo=function(){function e(t,r,n,i){if(!(this instanceof e))return new e(t,r,n,i);var s=t.split(".");s.length===2&&(n=s.shift(),t=s.shift()),this.collection=t,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},e.prototype.toExtendedJSON=function(t){t=t||{};var r={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(wo.prototype,"_bsontype",{value:"DBRef"});var zt=void 0;try{zt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var id=65536,n_=1<<24,Ci=id*id,bd=Ci*Ci,od=bd/2,sd={},ad={},X=function(){function e(t,r,n){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,r,n);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!r)):typeof t=="string"?Object.assign(this,e.fromString(t,!!r)):(this.low=t|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromInt=function(t,r){var n,i,s;return r?(t>>>=0,(s=0<=t&&t<256)&&(i=ad[t],i)?i:(n=e.fromBits(t,(t|0)<0?-1:0,!0),s&&(ad[t]=n),n)):(t|=0,(s=-128<=t&&t<128)&&(i=sd[t],i)?i:(n=e.fromBits(t,t<0?-1:0,!1),s&&(sd[t]=n),n))},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=bd)return e.MAX_UNSIGNED_VALUE}else{if(t<=-od)return e.MIN_VALUE;if(t+1>=od)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Ci|0,t/Ci|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return e.fromString(t.substring(1),r,n).neg();for(var s=e.fromNumber(Math.pow(n,8)),o=e.ZERO,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),d=parseInt(t.substring(c,c+u),n);if(u<8){var g=e.fromNumber(Math.pow(n,u));o=o.mul(g).add(e.fromNumber(d))}else o=o.mul(s),o=o.add(e.fromNumber(d))}return o.unsigned=r,o},e.fromBytes=function(t,r,n){return n?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(t){return To(t)&&t.__isLong__===!0},e.fromValue=function(t,r){return typeof t=="number"?e.fromNumber(t,r):typeof t=="string"?e.fromString(t,r):e.fromBits(t.low,t.high,typeof r=="boolean"?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=t.high>>>16,c=t.high&65535,u=t.low>>>16,d=t.low&65535,g=0,h=0,m=0,E=0;return E+=s+d,m+=E>>>16,E&=65535,m+=i+u,h+=m>>>16,m&=65535,h+=n+c,g+=h>>>16,h&=65535,g+=r+o,g&=65535,e.fromBits(m<<16|E,g<<16|h,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(t){return this.compare(t)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(zt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?zt.div_u:zt.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,zt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var n,i,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;s=e.UZERO}else{if(this.eq(e.MIN_VALUE)){if(t.eq(e.ONE)||t.eq(e.NEG_ONE))return e.MIN_VALUE;if(t.eq(e.MIN_VALUE))return e.ONE;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(i=this.sub(t.mul(n)),s=n.add(i.div(t)),s)}else if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=e.ZERO}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),u=c<=48?1:Math.pow(2,c-48),d=e.fromNumber(n),g=d.mul(t);g.isNegative()||g.gt(i);)n-=u,d=e.fromNumber(n,this.unsigned),g=d.mul(t);d.isZero()&&(d=e.ONE),s=s.add(d),i=i.sub(g)}return s},e.prototype.div=function(t){return this.divide(t)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},e.prototype.eq=function(t){return this.equals(t)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(t&1<<r)===0;r--);return this.high!==0?r+33:r+1},e.prototype.greaterThan=function(t){return this.comp(t)>0},e.prototype.gt=function(t){return this.greaterThan(t)},e.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},e.prototype.gte=function(t){return this.greaterThanOrEqual(t)},e.prototype.ge=function(t){return this.greaterThanOrEqual(t)},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.lessThan=function(t){return this.comp(t)<0},e.prototype.lt=function(t){return this.lessThan(t)},e.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},e.prototype.lte=function(t){return this.lessThanOrEqual(t)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),zt){var r=(this.unsigned?zt.rem_u:zt.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,zt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(t){return this.modulo(t)},e.prototype.rem=function(t){return this.modulo(t)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),zt){var r=zt.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,zt.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=t.high>>>16,u=t.high&65535,d=t.low>>>16,g=t.low&65535,h=0,m=0,E=0,v=0;return v+=o*g,E+=v>>>16,v&=65535,E+=s*g,m+=E>>>16,E&=65535,E+=o*d,m+=E>>>16,E&=65535,m+=i*g,h+=m>>>16,m&=65535,m+=s*d,h+=m>>>16,m&=65535,m+=o*u,h+=m>>>16,m&=65535,h+=n*g+i*d+s*u+o*c,h&=65535,e.fromBits(E<<16|v,h<<16|m,this.unsigned)},e.prototype.mul=function(t){return this.multiply(t)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(t){return!this.equals(t)},e.prototype.neq=function(t){return this.notEquals(t)},e.prototype.ne=function(t){return this.notEquals(t)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(t){return this.shiftLeft(t)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(t){return this.shiftRight(t)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var r=this.high;if(t<32){var n=this.low;return e.fromBits(n>>>t|r<<32-t,r>>>t,this.unsigned)}else return t===32?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},e.prototype.shru=function(t){return this.shiftRightUnsigned(t)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(t){return this.subtract(t)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*Ci+(this.low>>>0):this.high*Ci+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var s=e.fromNumber(Math.pow(t,6),this.unsigned),o=this,c="";;){var u=o.div(s),d=o.sub(u.mul(s)).toInt()>>>0,g=d.toString(t);if(o=u,o.isZero())return g+c;for(;g.length<6;)g="0"+g;c=""+g+c}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(t){return this.lessThanOrEqual(t)},e.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var n=e.fromString(t.$numberLong);return r&&r.relaxed?n.toNumber():n},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(n_),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(X.prototype,"__isLong__",{value:!0});Object.defineProperty(X.prototype,"_bsontype",{value:"Long"});var i_=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,o_=/^(\+|-)?(Infinity|inf)$/i,s_=/^(\+|-)?NaN$/i,bo=6111,Mu=-6176,cd=6176,a_=34,ku=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),ld=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),ud=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),c_=/^([-+])?(\d+)?$/,l_=31,pd=16383,u_=30,p_=31;function fd(e){return!isNaN(parseInt(e,10))}function f_(e){var t=X.fromNumber(1e9),r=X.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new X(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function m_(e,t){if(!e&&!t)return{high:X.fromNumber(0),low:X.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new X(e.getLowBits(),0),i=t.shiftRightUnsigned(32),s=new X(t.getLowBits(),0),o=r.multiply(i),c=r.multiply(s),u=n.multiply(i),d=n.multiply(s);return o=o.add(c.shiftRightUnsigned(32)),c=new X(c.getLowBits(),0).add(u).add(d.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),d=c.shiftLeft(32).add(new X(d.getLowBits(),0)),{high:o,low:d}}function d_(e,t){var r=e.high>>>0,n=t.high>>>0;if(r<n)return!0;if(r===n){var i=e.low>>>0,s=t.low>>>0;if(i<s)return!0}return!1}function Ti(e,t){throw new Ve('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var $u=function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Hu(t)){if(t.byteLength!==16)throw new Ve("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new Ve("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var r=!1,n=!1,i=!1,s=0,o=0,c=0,u=0,d=0,g=[0],h=0,m=0,E=0,v=0,_=0,D=0,P=new X(0,0),M=new X(0,0),L=0,R=0;if(t.length>=7e3)throw new Ve(""+t+" not a valid Decimal128 string");var G=t.match(i_),he=t.match(o_),Ae=t.match(s_);if(!G&&!he&&!Ae||t.length===0)throw new Ve(""+t+" not a valid Decimal128 string");if(G){var B=G[2],Z=G[4],Y=G[5],Q=G[6];Z&&Q===void 0&&Ti(t,"missing exponent power"),Z&&B===void 0&&Ti(t,"missing exponent base"),Z===void 0&&(Y||Q)&&Ti(t,"missing e before exponent")}if((t[R]==="+"||t[R]==="-")&&(r=t[R++]==="-"),!fd(t[R])&&t[R]!=="."){if(t[R]==="i"||t[R]==="I")return new e(be.from(r?ld:ud));if(t[R]==="N")return new e(be.from(ku))}for(;fd(t[R])||t[R]===".";){if(t[R]==="."){n&&Ti(t,"contains multiple periods"),n=!0,R=R+1;continue}h<34&&(t[R]!=="0"||i)&&(i||(d=o),i=!0,g[m++]=parseInt(t[R],10),h=h+1),i&&(c=c+1),n&&(u=u+1),o=o+1,R=R+1}if(n&&!o)throw new Ve(""+t+" not a valid Decimal128 string");if(t[R]==="e"||t[R]==="E"){var ge=t.substr(++R).match(c_);if(!ge||!ge[2])return new e(be.from(ku));_=parseInt(ge[0],10),R=R+ge[0].length}if(t[R])return new e(be.from(ku));if(E=0,!h)E=0,v=0,g[0]=0,c=1,h=1,s=0;else if(v=h-1,s=c,s!==1)for(;g[d+s-1]===0;)s=s-1;for(_<=u&&u-_>16384?_=Mu:_=_-u;_>bo;){if(v=v+1,v-E>a_){var $e=g.join("");if($e.match(/^0+$/)){_=bo;break}Ti(t,"overflow")}_=_-1}for(;_<Mu||h<c;){if(v===0&&s<h){_=Mu,s=0;break}if(h<c?c=c-1:v=v-1,_<bo)_=_+1;else{var $e=g.join("");if($e.match(/^0+$/)){_=bo;break}Ti(t,"overflow")}}if(v-E+1<s){var y=o;n&&(d=d+1,y=y+1),r&&(d=d+1,y=y+1);var ft=parseInt(t[d+v+1],10),We=0;if(ft>=5&&(We=1,ft===5)){for(We=g[v]%2===1?1:0,D=d+v+2;D<y;D++)if(parseInt(t[D],10)){We=1;break}}if(We){for(var ve=v;ve>=0;ve--)if(++g[ve]>9&&(g[ve]=0,ve===0))if(_<bo)_=_+1,g[ve]=1;else return new e(be.from(r?ld:ud))}}if(P=X.fromNumber(0),M=X.fromNumber(0),s===0)P=X.fromNumber(0),M=X.fromNumber(0);else if(v-E<17){var ve=E;for(M=X.fromNumber(g[ve++]),P=new X(0,0);ve<=v;ve++)M=M.multiply(X.fromNumber(10)),M=M.add(X.fromNumber(g[ve]))}else{var ve=E;for(P=X.fromNumber(g[ve++]);ve<=v-17;ve++)P=P.multiply(X.fromNumber(10)),P=P.add(X.fromNumber(g[ve]));for(M=X.fromNumber(g[ve++]);ve<=v;ve++)M=M.multiply(X.fromNumber(10)),M=M.add(X.fromNumber(g[ve]))}var _t=m_(P,X.fromString("100000000000000000"));_t.low=_t.low.add(M),d_(_t.low,M)&&(_t.high=_t.high.add(X.fromNumber(1))),L=_+cd;var ae={low:X.fromNumber(0),high:X.fromNumber(0)};_t.high.shiftRightUnsigned(49).and(X.fromNumber(1)).equals(X.fromNumber(1))?(ae.high=ae.high.or(X.fromNumber(3).shiftLeft(61)),ae.high=ae.high.or(X.fromNumber(L).and(X.fromNumber(16383).shiftLeft(47))),ae.high=ae.high.or(_t.high.and(X.fromNumber(0x7fffffffffff)))):(ae.high=ae.high.or(X.fromNumber(L&16383).shiftLeft(49)),ae.high=ae.high.or(_t.high.and(X.fromNumber(562949953421311)))),ae.low=_t.low,r&&(ae.high=ae.high.or(X.fromString("9223372036854775808")));var ie=be.alloc(16);return R=0,ie[R++]=ae.low.low&255,ie[R++]=ae.low.low>>8&255,ie[R++]=ae.low.low>>16&255,ie[R++]=ae.low.low>>24&255,ie[R++]=ae.low.high&255,ie[R++]=ae.low.high>>8&255,ie[R++]=ae.low.high>>16&255,ie[R++]=ae.low.high>>24&255,ie[R++]=ae.high.low&255,ie[R++]=ae.high.low>>8&255,ie[R++]=ae.high.low>>16&255,ie[R++]=ae.high.low>>24&255,ie[R++]=ae.high.high&255,ie[R++]=ae.high.high>>8&255,ie[R++]=ae.high.high>>16&255,ie[R++]=ae.high.high>>24&255,new e(ie)},e.prototype.toString=function(){for(var t,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var s=0,o=!1,c,u={parts:[0,0,0,0]},d,g,h=[];s=0;var m=this.bytes,E=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,v=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,_=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,D=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24;s=0;var P={low:new X(E,v),high:new X(_,D)};P.high.lessThan(X.ZERO)&&h.push("-");var M=D>>26&l_;if(M>>3===3){if(M===u_)return h.join("")+"Infinity";if(M===p_)return"NaN";t=D>>15&pd,c=8+(D>>14&1)}else c=D>>14&7,t=D>>17&pd;var L=t-cd;if(u.parts[0]=(D&16383)+((c&15)<<14),u.parts[1]=_,u.parts[2]=v,u.parts[3]=E,u.parts[0]===0&&u.parts[1]===0&&u.parts[2]===0&&u.parts[3]===0)o=!0;else for(g=3;g>=0;g--){var R=0,G=f_(u);if(u=G.quotient,R=G.rem.low,!!R)for(d=8;d>=0;d--)n[g*9+d]=R%10,R=Math.floor(R/10)}if(o)r=1,n[s]=0;else for(r=36;!n[s];)r=r-1,s=s+1;var he=r-1+L;if(he>=34||he<=-7||L>0){if(r>34)return h.push("".concat(0)),L>0?h.push("E+".concat(L)):L<0&&h.push("E".concat(L)),h.join("");h.push("".concat(n[s++])),r=r-1,r&&h.push(".");for(var i=0;i<r;i++)h.push("".concat(n[s++]));h.push("E"),he>0?h.push("+".concat(he)):h.push("".concat(he))}else if(L>=0)for(var i=0;i<r;i++)h.push("".concat(n[s++]));else{var Ae=r+L;if(Ae>0)for(var i=0;i<Ae;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");Ae++<0;)h.push("0");for(var i=0;i<r-Math.max(Ae-1,0);i++)h.push("".concat(n[s++]))}return h.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e}();Object.defineProperty($u.prototype,"_bsontype",{value:"Decimal128"});var Ia=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var n=parseFloat(t.$numberDouble);return r&&r.relaxed?n:new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},e}();Object.defineProperty(Ia.prototype,"_bsontype",{value:"Double"});var Ta=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty(Ta.prototype,"_bsontype",{value:"Int32"});var ju=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(ju.prototype,"_bsontype",{value:"MaxKey"});var Vu=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(Vu.prototype,"_bsontype",{value:"MinKey"});var h_=new RegExp("^[0-9a-fA-F]{24}$"),Cn=null,wr=Symbol("id"),rt=function(){function e(t){if(!(this instanceof e))return new e(t);var r;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new Ve("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=be.from(t.toHexString(),"hex"):r=t.id}else r=t;if(r==null||typeof r=="number")this[wr]=e.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[wr]=r instanceof be?r:va(r);else if(typeof r=="string")if(r.length===12){var n=be.from(r);if(n.byteLength===12)this[wr]=n;else throw new Ve("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&h_.test(r))this[wr]=be.from(r,"hex");else throw new Ve("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Ve("Argument passed in does not match the accepted types");e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[wr]},set:function(t){this[wr]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){typeof t!="number"&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),n=be.alloc(12);return n.writeUInt32BE(t,0),Cn===null&&(Cn=Ed(5)),n[4]=Cn[0],n[5]=Cn[1],n[6]=Cn[2],n[7]=Cn[3],n[8]=Cn[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},e.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(t==null)return!1;if(t instanceof e)return this[wr][11]===t[wr][11]&&this[wr].equals(t[wr]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&Hu(this.id))return t===be.prototype.toString.call(this.id,"latin1");if(typeof t=="string"&&e.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t=="string"&&e.isValid(t)&&t.length===12)return be.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var r=t.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},e.prototype.getTimestamp=function(){var t=new Date,r=this.id.readUInt32BE(0);return t.setTime(Math.floor(r)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var r=be.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new Ve("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(be.from(t,"hex"))},e.isValid=function(t){if(t==null)return!1;try{return new e(t),!0}catch{return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(Math.random()*16777215),e}();Object.defineProperty(rt.prototype,"generate",{value:ba(function(e){return rt.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(rt.prototype,"getInc",{value:ba(function(){return rt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(rt.prototype,"get_inc",{value:ba(function(){return rt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(rt,"get_inc",{value:ba(function(){return rt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(rt.prototype,"_bsontype",{value:"ObjectID"});function g_(e){return e.split("").sort().join("")}var Io=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=g_(r??""),this.pattern.indexOf("\0")!==-1)throw new xn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new xn("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new xn("The regular expression option [".concat(this.options[n],"] is not supported"))}return e.parseOptions=function(t){return t?t.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t)if(typeof t.$regex!="string"){if(t.$regex._bsontype==="BSONRegExp")return t}else return new e(t.$regex,e.parseOptions(t.$options));if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new Ve("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Io.prototype,"_bsontype",{value:"BSONRegExp"});var Wu=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(Wu.prototype,"_bsontype",{value:"Symbol"});var y_=X,wd=function(e){Sa(t,e);function t(r,n){var i=this;return i instanceof t?(X.isLong(r)?i=e.call(this,r.low,r.high,!0)||this:To(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=e.call(this,r.i,r.t,!0)||this:i=e.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new t(r,n)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(r){return new t(X.fromInt(r,!0))},t.fromNumber=function(r){return new t(X.fromNumber(r,!0))},t.fromBits=function(r,n){return new t(r,n)},t.fromString=function(r,n){return new t(X.fromString(r,!0,n))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(r){return new t(r.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=X.MAX_UNSIGNED_VALUE,t}(y_);function v_(e){return To(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var Id=2147483647,Td=-2147483648,Cd=9223372036854776e3,xd=-9223372036854776e3,E_={$oid:rt,$binary:Dn,$uuid:Dn,$symbol:Wu,$numberInt:Ta,$numberDecimal:$u,$numberDouble:Ia,$numberLong:X,$minKey:Vu,$maxKey:ju,$regex:Io,$regularExpression:Io,$timestamp:wd};function Dd(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Td&&e<=Id)return new Ta(e);if(e>=xd&&e<=Cd)return X.fromNumber(e)}return new Ia(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter(function(h){return h.startsWith("$")&&e[h]!=null}),n=0;n<r.length;n++){var i=E_[r[n]];if(i)return i.fromExtendedJSON(e,t)}if(e.$date!=null){var s=e.$date,o=new Date;return t.legacy?typeof s=="number"?o.setTime(s):typeof s=="string"&&o.setTime(Date.parse(s)):typeof s=="string"?o.setTime(Date.parse(s)):X.isLong(s)?o.setTime(s.toNumber()):typeof s=="number"&&t.relaxed&&o.setTime(s),o}if(e.$code!=null){var c=Object.assign({},e);return e.$scope&&(c.$scope=Dd(e.$scope)),wa.fromExtendedJSON(e)}if(r_(e)||e.$dbPointer){var u=e.$ref?e:e.$dbPointer;if(u instanceof wo)return u;var d=Object.keys(u).filter(function(h){return h.startsWith("$")}),g=!0;if(d.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(g=!1)}),g)return wo.fromExtendedJSON(u)}return e}function __(e,t){return e.map(function(r,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Qr(r,t)}finally{t.seenObjects.pop()}})}function md(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Qr(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var r=t.seenObjects.findIndex(function(P){return P.obj===e});if(r!==-1){var n=t.seenObjects.map(function(P){return P.propertyName}),i=n.slice(0,r).map(function(P){return"".concat(P," -> ")}).join(""),s=n[r],o=" -> "+n.slice(r+1,n.length-1).map(function(P){return"".concat(P," -> ")}).join(""),c=n[n.length-1],u=" ".repeat(i.length+s.length/2),d="-".repeat(o.length+(s.length+c.length)/2-1);throw new Ve(`Converting circular structure to EJSON:
25
+ `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(nr(c))}i(u)}}return typeof n=="string"?n:My(n)}function My(e){let t=e.reduce((i,s)=>i+s.length,0),r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function ql(e){let t=typeof e.data=="string"?Gl(e.data):e.data;return[Je({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}var ky={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Rs(e){return ky[e]}function As(e){if(!e||!e.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function Kl(e,t,r,n){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return b(b(b({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!r&&n&&{dsn:hr(n)}),i&&{trace:Je(b({},i))})}function Xl(e,t,r){let n=[{type:"client_report"},{timestamp:r||yr(),discarded_events:e}];return vr(t?{dsn:t}:{},[n])}function hm(e,t=Date.now()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}function gm(e,t){return e[t]||e.all||0}function Jl(e,t,r=Date.now()){return gm(e,t)>r}function Ql(e,{statusCode:t,headers:r},n=Date.now()){let i=b({},e),s=r&&r["x-sentry-rate-limits"],o=r&&r["retry-after"];if(s)for(let c of s.trim().split(",")){let[u,d,,,g]=c.split(":",5),h=parseInt(u,10),m=(isNaN(h)?60:h)*1e3;if(!d)i.all=n+m;else for(let E of d.split(";"))E==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[E]=n+m):i[E]=n+m}else o?i.all=n+hm(o,n):t===429&&(i.all=n+60*1e3);return i}function Ns(){return{traceId:rt(),spanId:rt().substring(16)}}var Os=te;function Zl(){let e=Os.chrome,t=e&&e.app&&e.app.runtime,r="history"in Os&&!!Os.history.pushState&&!!Os.history.replaceState;return!t&&r}var De=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function hn(){return ho(te),te}function ho(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||jt,t[jt]=t[jt]||{}}function go(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Lt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:rt()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}var eu="_sentrySpan";function tu(e,t){t?wt(e,eu,t):delete e[eu]}function ru(e){return e[eu]}var Fy=100,nu=class Zh{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ns()}clone(){let t=new Zh;return t._breadcrumbs=[...this._breadcrumbs],t._tags=b({},this._tags),t._extra=b({},this._extra),t._contexts=b({},this._contexts),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata=b({},this._sdkProcessingMetadata),t._propagationContext=b({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,tu(t,ru(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&go(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags=b(b({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,r){return this._tags=ee(b({},this._tags),{[t]:r}),this._notifyScopeListeners(),this}setExtras(t){return this._extra=b(b({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,r){return this._extra=ee(b({},this._extra),{[t]:r}),this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let r=typeof t=="function"?t(this):t,[n,i]=r instanceof dt?[r.getScopeData(),r.getRequestSession()]:tr(r)?[t,t.requestSession]:[],{tags:s,extra:o,user:c,contexts:u,level:d,fingerprint:g=[],propagationContext:h}=n||{};return this._tags=b(b({},this._tags),s),this._extra=b(b({},this._extra),o),this._contexts=b(b({},this._contexts),u),c&&Object.keys(c).length&&(this._user=c),d&&(this._level=d),g.length&&(this._fingerprint=g),h&&(this._propagationContext=h),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,tu(this,void 0),this._attachments=[],this._propagationContext=Ns(),this._notifyScopeListeners(),this}addBreadcrumb(t,r){let n=typeof r=="number"?r:Fy;if(n<=0)return this;let i=b({timestamp:yr()},t),s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ru(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=b(b({},this._sdkProcessingMetadata),t),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){let n=r&&r.event_id?r.event_id:rt();if(!this._client)return K.warn("No client configured on scope - will not capture exception!"),n;let i=new Error("Sentry syntheticException");return this._client.captureException(t,ee(b({originalException:t,syntheticException:i},r),{event_id:n}),this),n}captureMessage(t,r,n){let i=n&&n.event_id?n.event_id:rt();if(!this._client)return K.warn("No client configured on scope - will not capture message!"),i;let s=new Error(t);return this._client.captureMessage(t,r,ee(b({originalException:t,syntheticException:s},n),{event_id:i}),this),i}captureEvent(t,r){let n=r&&r.event_id?r.event_id:rt();return this._client?(this._client.captureEvent(t,ee(b({},r),{event_id:n}),this),n):(K.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}},dt=nu;function ym(){return li("defaultCurrentScope",()=>new dt)}function vm(){return li("defaultIsolationScope",()=>new dt)}var iu=class{constructor(e,t){let r;e?r=e:r=new dt;let n;t?n=t:n=new dt,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){let t=this._pushScope(),r;try{r=e(t)}catch(n){throw this._popScope(),n}return Rr(r)?r.then(n=>(this._popScope(),n),n=>{throw this._popScope(),n}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function mi(){let e=hn(),t=ho(e);return t.stack=t.stack||new iu(ym(),vm())}function Hy(e){return mi().withScope(e)}function $y(e,t){let r=mi();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function Em(e){return mi().withScope(()=>e(mi().getIsolationScope()))}function _m(){return{withIsolationScope:Em,withScope:Hy,withSetScope:$y,withSetIsolationScope:(e,t)=>Em(t),getCurrentScope:()=>mi().getScope(),getIsolationScope:()=>mi().getIsolationScope()}}function Ps(e){let t=ho(e);return t.acs?t.acs:_m()}function gn(){let e=hn();return Ps(e).getCurrentScope()}function yn(){let e=hn();return Ps(e).getIsolationScope()}function Ls(){return li("globalScope",()=>new dt)}function Ms(...e){let t=hn(),r=Ps(t);if(e.length===2){let[n,i]=e;return n?r.withSetScope(n,i):r.withScope(i)}return r.withScope(e[0])}function Ue(){return gn().getClient()}var jy="_sentryMetrics";function Sm(e){let t=e[jy];if(!t)return;let r={};for(let[,[n,i]]of t)(r[n]||(r[n]=[])).push(Je(i));return r}var ou="sentry.source",su="sentry.sample_rate",au="sentry.op",cu="sentry.origin",Vy=1;function Im(e){let{spanId:t,traceId:r}=e.spanContext(),{parent_span_id:n}=vn(e);return Je({parent_span_id:n,span_id:t,trace_id:r})}function bm(e){return typeof e=="number"?wm(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?wm(e.getTime()):Lt()}function wm(e){return e>9999999999?e/1e3:e}function vn(e){if(Gy(e))return e.getSpanJSON();try{let{spanId:t,traceId:r}=e.spanContext();if(Wy(e)){let{attributes:n,startTime:i,name:s,endTime:o,parentSpanId:c,status:u}=e;return Je({span_id:t,trace_id:r,data:n,description:s,parent_span_id:c,start_timestamp:bm(i),timestamp:bm(o)||void 0,status:Yy(u),op:n[au],origin:n[cu],_metrics_summary:Sm(e)})}return{span_id:t,trace_id:r}}catch{return{}}}function Wy(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Gy(e){return typeof e.getSpanJSON=="function"}function Tm(e){let{traceFlags:t}=e.spanContext();return t===Vy}function Yy(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"unknown_error"}var zy="_sentryRootSpan";function yo(e){return e[zy]||e}var ks="production",qy="_frozenDsc";function lu(e,t){let r=t.getOptions(),{publicKey:n}=t.getDsn()||{},i=Je({environment:r.environment||ks,release:r.release,public_key:n,trace_id:e});return t.emit("createDsc",i),i}function Cm(e){let t=Ue();if(!t)return{};let r=lu(vn(e).trace_id||"",t),n=yo(e),i=n[qy];if(i)return i;let s=n.spanContext().traceState,o=s&&s.get("sentry.dsc"),c=o&&Wl(o);if(c)return c;let u=vn(n),d=u.data||{},g=d[su];g!=null&&(r.sample_rate=`${g}`);let h=d[ou],m=u.description;return h!=="url"&&m&&(r.transaction=m),r.sampled=String(Tm(n)),t.emit("createDsc",r,n),r}function xm(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(typeof t!="number"||isNaN(t)||t<0||t>1){De&&K.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}function Ky(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function Dm(e,t,r,n){let i=As(r),s=b(b({sent_at:new Date().toISOString()},i&&{sdk:i}),!!n&&t&&{dsn:hr(t)}),o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return vr(s,[o])}function Rm(e,t,r,n){let i=As(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Ky(e,r&&r.sdk);let o=Kl(e,i,n,t);return delete e.sdkProcessingMetadata,vr(o,[[{type:s},e]])}function Bs(e,t,r,n=0){return new ir((i,s)=>{let o=e[n];if(t===null||typeof o!="function")i(t);else{let c=o(b({},t),r);De&&o.id&&c===null&&K.log(`Event processor "${o.id}" dropped event`),Rr(c)?c.then(u=>Bs(e,u,r,n+1).then(i)).then(null,s):Bs(e,c,r,n+1).then(i).then(null,s)}})}function Am(e,t){let{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:s}=t;Xy(e,t),n&&Zy(e,n),ev(e,r),Jy(e,i),Qy(e,s)}function uu(e,t){let{extra:r,tags:n,user:i,contexts:s,level:o,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:g,attachments:h,propagationContext:m,transactionName:E,span:y}=t;vo(e,"extra",r),vo(e,"tags",n),vo(e,"user",i),vo(e,"contexts",s),vo(e,"sdkProcessingMetadata",c),o&&(e.level=o),E&&(e.transactionName=E),y&&(e.span=y),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),g.length&&(e.eventProcessors=[...e.eventProcessors,...g]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext=b(b({},e.propagationContext),m)}function vo(e,t,r){if(r&&Object.keys(r).length){e[t]=b({},e[t]);for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[t][n]=r[n])}}function Xy(e,t){let{extra:r,tags:n,user:i,contexts:s,level:o,transactionName:c}=t,u=Je(r);u&&Object.keys(u).length&&(e.extra=b(b({},u),e.extra));let d=Je(n);d&&Object.keys(d).length&&(e.tags=b(b({},d),e.tags));let g=Je(i);g&&Object.keys(g).length&&(e.user=b(b({},g),e.user));let h=Je(s);h&&Object.keys(h).length&&(e.contexts=b(b({},h),e.contexts)),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function Jy(e,t){let r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function Qy(e,t){e.sdkProcessingMetadata=b(b({},e.sdkProcessingMetadata),t)}function Zy(e,t){e.contexts=b({trace:Im(t)},e.contexts),e.sdkProcessingMetadata=b({dynamicSamplingContext:Cm(t)},e.sdkProcessingMetadata);let r=yo(t),n=vn(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function ev(e,t){e.fingerprint=e.fingerprint?Cs(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}function Om(e,t,r,n,i,s){let{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,u=ee(b({},t),{event_id:t.event_id||r.event_id||rt(),timestamp:t.timestamp||yr()}),d=r.integrations||e.integrations.map(_=>_.name);tv(u,e),iv(u,d),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&rv(u,e.stackParser);let g=sv(n,r.captureContext);r.mechanism&&Ar(u,r.mechanism);let h=i?i.getEventProcessors():[],m=Ls().getScopeData();if(s){let _=s.getScopeData();uu(m,_)}if(g){let _=g.getScopeData();uu(m,_)}let E=[...r.attachments||[],...m.attachments];E.length&&(r.attachments=E),Am(u,m);let y=[...h,...m.eventProcessors];return Bs(y,u,r).then(_=>(_&&nv(_),typeof o=="number"&&o>0?ov(_,o,c):_))}function tv(e,t){let{environment:r,release:n,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?r:ks),e.release===void 0&&n!==void 0&&(e.release=n),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&(e.message=mr(e.message,s));let o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=mr(o.value,s));let c=e.request;c&&c.url&&(c.url=mr(c.url,s))}var Nm=new WeakMap;function rv(e,t){let r=te._sentryDebugIds;if(!r)return;let n,i=Nm.get(t);i?n=i:(n=new Map,Nm.set(t,n));let s=Object.entries(r).reduce((o,[c,u])=>{let d,g=n.get(c);g?d=g:(d=t(c),n.set(c,d));for(let h=d.length-1;h>=0;h--){let m=d[h];if(m.filename){o[m.filename]=u;break}}return o},{});try{e.exception.values.forEach(o=>{o.stacktrace.frames.forEach(c=>{c.filename&&(c.debug_id=s[c.filename])})})}catch{}}function nv(e){let t={};try{e.exception.values.forEach(n=>{n.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.entries(t).forEach(([n,i])=>{r.push({type:"sourcemap",code_file:n,debug_id:i})})}function iv(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ov(e,t,r){if(!e)return null;let n=b(b(b(b(b({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>b(b({},i),i.data&&{data:nr(i.data,t,r)}))}),e.user&&{user:nr(e.user,t,r)}),e.contexts&&{contexts:nr(e.contexts,t,r)}),e.extra&&{extra:nr(e.extra,t,r)});return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=nr(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(i=>b(b({},i),i.data&&{data:nr(i.data,t,r)}))),n}function sv(e,t){if(!t)return e;let r=e?e.clone():new dt;return r.update(t),r}function Pm(e){if(e)return av(e)?{captureContext:e}:lv(e)?{captureContext:e}:e}function av(e){return e instanceof dt||typeof e=="function"}var cv=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function lv(e){return Object.keys(e).some(t=>cv.includes(t))}function Us(e,t){return gn().captureException(e,Pm(t))}function Eo(e,t){return gn().captureEvent(e,t)}var uv="7";function pv(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function fv(e){return`${pv(e)}${e.projectId}/envelope/`}function mv(e,t){return Rl(b({sentry_key:e.publicKey,sentry_version:uv},t&&{sentry_client:`${t.name}/${t.version}`}))}function Mm(e,t,r){return t||`${fv(e)}?${mv(e,r)}`}var km=[];function Bm(e,t){let r={};return t.forEach(n=>{n&&fu(e,n,r)}),r}function pu(e,t){for(let r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function fu(e,t,r){if(r[t.name]){De&&K.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,km.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),km.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>n(i,s,e))}if(typeof t.processEvent=="function"){let n=t.processEvent.bind(t),i=Object.assign((s,o)=>n(s,o,e),{id:t.name});e.addEventProcessor(i)}De&&K.log(`Integration installed: ${t.name}`)}var Um="Not capturing exception because it's already been captured.",_o=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ys(e.dsn):De&&K.warn("No DSN provided, client will not send events."),this._dsn){let t=Mm(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(ee(b({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,r){let n=rt();if(Ts(e))return De&&K.log(Um),n;let i=b({event_id:n},t);return this._process(this.eventFromException(e,i).then(s=>this._captureEvent(s,i,r))),i.event_id}captureMessage(e,t,r,n){let i=b({event_id:rt()},r),s=ai(e)?e:String(e),o=fn(e)?this.eventFromMessage(s,t,i):this.eventFromException(e,i);return this._process(o.then(c=>this._captureEvent(c,i,n))),i.event_id}captureEvent(e,t,r){let n=rt();if(t&&t.originalException&&Ts(t.originalException))return De&&K.log(Um),n;let i=b({event_id:n},t),s=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,s||r)),i.event_id}captureSession(e){typeof e.release!="string"?De&&K.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),go(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>t.flush(e).then(n=>r&&n))):Wt(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,this.emit("close"),t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];fu(this,e,this._integrations),t||pu(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=Rm(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])r=Yl(r,ql(i));let n=this.sendEnvelope(r);n&&n.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let t=Dm(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){let n=`${e}:${t}`;De&&K.log(`Adding outcome: "${n}"`),this._outcomes[n]=(this._outcomes[n]||0)+1}}on(e,t){let r=this._hooks[e]=this._hooks[e]||[];return r.push(t),()=>{let n=r.indexOf(t);n>-1&&r.splice(n,1)}}emit(e,...t){let r=this._hooks[e];r&&r.forEach(n=>n(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,t=>(De&&K.error("Error while sending event:",t),t)):(De&&K.error("Transport disabled"),Wt({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Bm(this,e),pu(this,e)}_updateSessionFromEvent(e,t){let r=!1,n=!1,i=t.exception&&t.exception.values;if(i){n=!0;for(let o of i){let c=o.mechanism;if(c&&c.handled===!1){r=!0;break}}}let s=e.status==="ok";(s&&e.errors===0||s&&r)&&(go(e,ee(b({},r&&{status:"crashed"}),{errors:e.errors||Number(n||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new ir(t=>{let r=0,n=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),t(!0)):(r+=n,e&&r>=e&&(clearInterval(i),t(!1)))},n)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r,n=yn()){let i=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s.length>0&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||n.setLastEventId(e.event_id||t.event_id),Om(i,e,t,r,this,n).then(o=>{if(o===null)return o;let c=b(b({},n.getPropagationContext()),r?r.getPropagationContext():void 0);if(!(o.contexts&&o.contexts.trace)&&c){let{traceId:u,spanId:d,parentSpanId:g,dsc:h}=c;o.contexts=b({trace:Je({trace_id:u,span_id:d,parent_span_id:g})},o.contexts);let m=h||lu(u,this);o.sdkProcessingMetadata=b({dynamicSamplingContext:m},o.sdkProcessingMetadata)}return o})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(n=>n.event_id,n=>{if(De){let i=n;i.logLevel==="log"?K.log(i.message):K.warn(i)}})}_processEvent(e,t,r){let n=this.getOptions(),{sampleRate:i}=n,s=mu(e),o=Fm(e),c=e.type||"error",u=`before send for type \`${c}\``,d=typeof i>"u"?void 0:xm(i);if(o&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),Gr(new mt(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let g=c==="replay_event"?"replay":c,h=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,h).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",g,e),new mt("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return m;let E=hv(this,n,m,t);return dv(E,u)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",g,e),mu(e)){let _=1+(e.spans||[]).length;this._outcomes.span=(this._outcomes.span||0)+_}throw new mt(`${u} returned \`null\`, will not send event.`,"log")}let E=r&&r.getSession();!s&&E&&this._updateSessionFromEvent(E,m);let y=m.transaction_info;if(s&&y&&m.transaction!==e.transaction){let _="custom";m.transaction_info=ee(b({},y),{source:_})}return this.sendEvent(m,t),m}).then(null,m=>{throw m instanceof mt?m:(this.captureException(m,{data:{__sentry__:!0},originalException:m}),new mt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
26
+ Reason: ${m}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([t,r])=>{let[n,i]=t.split(":");return{reason:n,category:i,quantity:r}})}};function dv(e,t){let r=`${t} must return \`null\` or a valid event.`;if(Rr(e))return e.then(n=>{if(!tr(n)&&n!==null)throw new mt(r);return n},n=>{throw new mt(`${t} rejected with ${n}`)});if(!tr(e)&&e!==null)throw new mt(r);return e}function hv(e,t,r,n){let{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o}=t;if(Fm(r)&&i)return i(r,n);if(mu(r)){if(r.spans&&o){let c=[];for(let u of r.spans){let d=o(u);d?c.push(d):e.recordDroppedEvent("before_send","span")}r.spans=c}if(s)return s(r,n)}return r}function Fm(e){return e.type===void 0}function mu(e){return e.type==="transaction"}var gv=64;function Fs(e,t,r=jl(e.bufferSize||gv)){let n={},i=o=>r.drain(o);function s(o){let c=[];if(Ds(o,(h,m)=>{let E=Rs(m);if(Jl(n,E)){let y=Hm(h,m);e.recordDroppedEvent("ratelimit_backoff",E,y)}else c.push(h)}),c.length===0)return Wt({});let u=vr(o[0],c),d=h=>{Ds(u,(m,E)=>{let y=Hm(m,E);e.recordDroppedEvent(h,Rs(E),y)})},g=()=>t({body:zl(u)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&De&&K.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),n=Ql(n,h),h),h=>{throw d("network_error"),h});return r.add(g).then(h=>h,h=>{if(h instanceof mt)return De&&K.error("Skipped sending event because buffer is full."),d("queue_overflow"),Wt({});throw h})}return{send:s,flush:i}}function Hm(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function du(e,t,r=[t],n="npm"){let i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:r.map(s=>({name:`${n}:@sentry/${s}`,version:jt})),version:jt}),e._metadata=i}var yv=100;function Er(e,t){let r=Ue(),n=yn();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:s=yv}=r.getOptions();if(s<=0)return;let o=yr(),c=b({timestamp:o},e),u=i?pi(()=>i(c,t)):c;u!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",u,t),n.addBreadcrumb(u,s))}var $m,vv="FunctionToString",jm=new WeakMap,Ev=()=>({name:vv,setupOnce(){$m=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=dn(this),r=jm.has(Ue())&&t!==void 0?t:this;return $m.apply(r,e)}}catch{}},setup(e){jm.set(e,!0)}}),Hs=Ev,_v=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],Sv="InboundFilters",bv=(e={})=>({name:Sv,processEvent(t,r,n){let i=n.getOptions(),s=wv(e,i);return Iv(t,s)?null:t}}),js=bv;function wv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:_v],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function Iv(e,t){return t.ignoreInternal&&Av(e)?(De&&K.warn(`Event dropped due to being internal Sentry Error.
27
+ Event: ${rr(e)}`),!0):Tv(e,t.ignoreErrors)?(De&&K.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
28
+ Event: ${rr(e)}`),!0):Ov(e)?(De&&K.warn(`Event dropped due to not having an error message, error type or stacktrace.
29
+ Event: ${rr(e)}`),!0):Cv(e,t.ignoreTransactions)?(De&&K.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
30
+ Event: ${rr(e)}`),!0):xv(e,t.denyUrls)?(De&&K.warn(`Event dropped due to being matched by \`denyUrls\` option.
31
+ Event: ${rr(e)}.
32
+ Url: ${$s(e)}`),!0):Dv(e,t.allowUrls)?!1:(De&&K.warn(`Event dropped due to not being matched by \`allowUrls\` option.
33
+ Event: ${rr(e)}.
34
+ Url: ${$s(e)}`),!0)}function Tv(e,t){return e.type||!t||!t.length?!1:Rv(e).some(r=>ci(r,t))}function Cv(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?ci(r,t):!1}function xv(e,t){if(!t||!t.length)return!1;let r=$s(e);return r?ci(r,t):!1}function Dv(e,t){if(!t||!t.length)return!0;let r=$s(e);return r?ci(r,t):!0}function Rv(e){let t=[];e.message&&t.push(e.message);let r;try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),t}function Av(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function Nv(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function $s(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Nv(t):null}catch{return De&&K.error(`Cannot extract url for event ${rr(e)}`),null}}function Ov(e){return e.type||!e.exception||!e.exception.values||e.exception.values.length===0?!1:!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value)}var Pv="Dedupe",Lv=()=>{let e;return{name:Pv,processEvent(t){if(t.type)return t;try{if(Mv(t,e))return De&&K.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Vs=Lv;function Mv(e,t){return t?!!(kv(e,t)||Bv(e,t)):!1}function kv(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Gm(e,t)||!Wm(e,t))}function Bv(e,t){let r=Vm(t),n=Vm(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Gm(e,t)||!Wm(e,t))}function Wm(e,t){let r=Ss(e),n=Ss(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Gm(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Vm(e){return e.exception&&e.exception.values&&e.exception.values[0]}var We=te,hu=0;function gu(){return hu>0}function Xv(){hu++,setTimeout(()=>{hu--})}function En(e,t={},r){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(dn(e))return e}catch{return e}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>En(o,t));return e.apply(this,s)}catch(s){throw Xv(),Ms(o=>{o.addEventProcessor(c=>(t.mechanism&&(fi(c,void 0,void 0),Ar(c,t.mechanism)),c.extra=ee(b({},c.extra),{arguments:i}),c)),Us(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}vs(n,e),wt(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}var Or=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Ws(e,t){let r=Eu(e,t),n={type:t&&t.name,value:tE(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Jv(e,t,r,n){let i=Ue(),s=i&&i.getOptions().normalizeDepth,o=iE(t),c={__serialized__:xs(t,s)};if(o)return{exception:{values:[Ws(e,o)]},extra:c};let u={exception:{values:[{type:mn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:rE(t,{isUnhandledRejection:n})}]},extra:c};if(r){let d=Eu(e,r);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function yu(e,t){return{exception:{values:[Ws(e,t)]}}}function Eu(e,t){let r=t.stacktrace||t.stack||"",n=Zv(t),i=eE(t);try{return e(r,n,i)}catch{}return[]}var Qv=/Minified React error #\d+;/i;function Zv(e){return e&&Qv.test(e.message)?1:0}function eE(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function tE(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Km(e,t,r,n){let i=r&&r.syntheticException||void 0,s=Gs(e,t,i,n);return Ar(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Wt(s)}function Xm(e,t,r="info",n,i){let s=n&&n.syntheticException||void 0,o=vu(e,t,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Wt(o)}function Gs(e,t,r,n,i){let s;if(ds(t)&&t.error)return yu(e,t.error);if(hs(t)||El(t)){let o=t;if("stack"in t)s=yu(e,t);else{let c=o.name||(hs(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=vu(e,u,r,n),fi(s,u)}return"code"in o&&(s.tags=ee(b({},s.tags),{"DOMException.code":`${o.code}`})),s}return pn(t)?yu(e,t):tr(t)||mn(t)?(s=Jv(e,t,r,i),Ar(s,{synthetic:!0}),s):(s=vu(e,t,r,n),fi(s,`${t}`,void 0),Ar(s,{synthetic:!0}),s)}function vu(e,t,r,n){let i={};if(n&&r){let s=Eu(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}if(ai(t)){let{__sentry_template_string__:s,__sentry_template_values__:o}=t;return i.logentry={message:s,params:o},i}return i.message=t,i}function rE(e,{isUnhandledRejection:t}){let r=Al(e),n=t?"promise rejection":"exception";return ds(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:mn(e)?`Event \`${nE(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function nE(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function iE(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function Jm(e,{metadata:t,tunnel:r,dsn:n}){let i=b(b({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!r&&!!n&&{dsn:hr(n)}),s=oE(e);return vr(i,[s])}function oE(e){return[{type:"user_report"},e]}var So=class extends _o{constructor(e){let t=b({parentSpanIsAlwaysRootSpan:!0},e),r=We.SENTRY_SDK_SOURCE||Hl();du(t,"browser",["browser"],r),super(t),t.sendClientReports&&We.document&&We.document.addEventListener("visibilitychange",()=>{We.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return Km(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return Xm(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Or&&K.warn("SDK not enabled, will not capture user feedback.");return}let t=Jm(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){Or&&K.log("No outcomes to send");return}if(!this._dsn){Or&&K.log("No dsn provided, will not send outcomes");return}Or&&K.log("Sending outcomes:",e);let t=Xl(e,this._options.tunnel&&hr(this._dsn));this.sendEnvelope(t)}},Qm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,qe=te,sE=1e3,Zm,_u,Su;function bu(e){let t="dom";It(t,e),Tt(t,aE)}function aE(){if(!qe.document)return;let e=Qe.bind(null,"dom"),t=ed(e,!0);qe.document.addEventListener("click",t,!1),qe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=qe[r]&&qe[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Me(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},g=d[s]=d[s]||{refCount:0};if(!g.handler){let h=ed(e);g.handler=h,i.call(this,s,h,c)}g.refCount++}catch{}return i.call(this,s,o,c)}}),Me(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__||{},g=d[s];g&&(g.refCount--,g.refCount<=0&&(i.call(this,s,g.handler,c),g.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function cE(e){if(e.type!==_u)return!1;try{if(!e.target||e.target._sentryId!==Su)return!1}catch{}return!0}function lE(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function ed(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;let n=uE(r);if(lE(r.type,n))return;wt(r,"_sentryCaptured",!0),n&&!n._sentryId&&wt(n,"_sentryId",rt());let i=r.type==="keypress"?"input":r.type;cE(r)||(e({event:r,name:i,global:t}),_u=r.type,Su=n?n._sentryId:void 0),clearTimeout(Zm),Zm=qe.setTimeout(()=>{Su=void 0,_u=void 0},sE)}}function uE(e){try{return e.target}catch{return null}}var Ys;function wu(e){let t="history";It(t,e),Tt(t,pE)}function pE(){if(!Zl())return;let e=qe.onpopstate;qe.onpopstate=function(...r){let n=qe.location.href,i=Ys;if(Ys=n,Qe("history",{from:i,to:n}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=Ys,o=String(i);Ys=o,Qe("history",{from:s,to:o})}return r.apply(this,n)}}Me(qe.history,"pushState",t),Me(qe.history,"replaceState",t)}var zs={};function Iu(e){let t=zs[e];if(t)return t;let r=qe[e];if(po(r))return zs[e]=r.bind(qe);let n=qe.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(i)}catch(i){Qm&&K.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(zs[e]=r.bind(qe))}function qs(e){zs[e]=void 0}var _n="__sentry_xhr_v3__";function Tu(e){let t="xhr";It(t,e),Tt(t,fE)}function fE(){if(!qe.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;Me(e,"open",function(t){return function(...r){let n=Lt()*1e3,i=bt(r[0])?r[0].toUpperCase():void 0,s=mE(r[1]);if(!i||!s)return t.apply(this,r);this[_n]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[_n];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:Lt()*1e3,startTimestamp:n,xhr:this};Qe("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Me(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Me(this,"setRequestHeader",function(c){return function(...u){let[d,g]=u,h=this[_n];return h&&bt(d)&&bt(g)&&(h.request_headers[d.toLowerCase()]=g),c.apply(this,u)}}),t.apply(this,r)}}),Me(e,"send",function(t){return function(...r){let n=this[_n];if(!n)return t.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:Lt()*1e3,xhr:this};return Qe("xhr",i),t.apply(this,r)}})}function mE(e){if(bt(e))return e;try{return e.toString()}catch{}}function Cu(e,t=Iu("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=b({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);if(!t)return qs("fetch"),Gr("No fetch implementation available");try{return t(e.url,c).then(u=>(r-=o,n--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return qs("fetch"),r-=o,n--,Gr(u)}}return Fs(e,i)}var dE=30,hE=50;function xu(e,t,r,n){let i={filename:e,function:t==="<anonymous>"?gr:t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var gE=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yE=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vE=/\((\S*)(?::(\d+))(?::(\d+))\)/,EE=e=>{let t=gE.exec(e);if(t){let[,n,i,s]=t;return xu(n,gr,+i,+s)}let r=yE.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=vE.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=id(r[1]||gr,r[2]);return xu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},td=[dE,EE],_E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,SE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bE=e=>{let t=_E.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=SE.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],n=t[1]||gr;return[n,r]=id(n,r),xu(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},rd=[hE,bE],nd=[td,rd],Du=Ol(...nd),id=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:gr,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ks=1024,IE="Breadcrumbs",TE=(e={})=>{let t=b({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:IE,setup(r){t.console&&Pl(DE(r)),t.dom&&bu(xE(r,t.dom)),t.xhr&&Tu(RE(r)),t.fetch&&Bl(AE(r)),t.history&&wu(NE(r)),t.sentry&&r.on("beforeSendEvent",CE(r))}}},od=TE;function CE(e){return function(t){Ue()===e&&Er({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:rr(t)},{event:t})}}function xE(e,t){return function(r){if(Ue()!==e)return;let n,i,s=typeof t=="object"?t.serializeAttribute:void 0,o=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;o&&o>Ks&&(Or&&K.warn(`\`dom.maxStringLength\` cannot exceed ${Ks}, but a value of ${o} was configured. Sentry will use ${Ks} instead.`),o=Ks),typeof s=="string"&&(s=[s]);try{let u=r.event,d=OE(u)?u.target:u;n=lo(d,{keyAttrs:s,maxStringLength:o}),i=xl(d)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),Er(c,{event:r.event,name:r.name,global:r.global})}}function DE(e){return function(t){if(Ue()!==e)return;let r={category:"console",data:{arguments:t.args,logger:"console"},level:Vl(t.level),message:gs(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)r.message=`Assertion failed: ${gs(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1);else return;Er(r,{input:t.args,level:t.level})}}function RE(e){return function(t){if(Ue()!==e)return;let{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[_n];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,d={method:s,url:o,status_code:c},g={xhr:t.xhr,input:u,startTimestamp:r,endTimestamp:n};Er({category:"xhr",data:d,type:"http"},g)}}function AE(e){return function(t){if(Ue()!==e)return;let{startTimestamp:r,endTimestamp:n}=t;if(n&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){let i=t.fetchData,s={data:t.error,input:t.args,startTimestamp:r,endTimestamp:n};Er({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=t.response,s=ee(b({},t.fetchData),{status_code:i&&i.status}),o={input:t.args,response:i,startTimestamp:r,endTimestamp:n};Er({category:"fetch",data:s,type:"http"},o)}}}function NE(e){return function(t){if(Ue()!==e)return;let r=t.from,n=t.to,i=mo(We.location.href),s=r?mo(r):void 0,o=mo(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),Er({category:"navigation",data:{from:r,to:n}})}}function OE(e){return!!e&&!!e.target}var PE=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],LE="BrowserApiErrors",ME=(e={})=>{let t=b({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:LE,setupOnce(){t.setTimeout&&Me(We,"setTimeout",sd),t.setInterval&&Me(We,"setInterval",sd),t.requestAnimationFrame&&Me(We,"requestAnimationFrame",kE),t.XMLHttpRequest&&"XMLHttpRequest"in We&&Me(XMLHttpRequest.prototype,"send",BE);let r=t.eventTarget;r&&(Array.isArray(r)?r:PE).forEach(UE)}}},ad=ME;function sd(e){return function(...t){let r=t[0];return t[0]=En(r,{mechanism:{data:{function:Vt(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function kE(e){return function(t){return e.apply(this,[En(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Vt(e)},handled:!1,type:"instrument"}})])}}function BE(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Me(r,n,function(i){let s={mechanism:{data:{function:n,handler:Vt(i)},handled:!1,type:"instrument"}},o=dn(i);return o&&(s.mechanism.data.handler=Vt(o)),En(i,s)})}),e.apply(this,t)}}function UE(e){let t=We,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Me(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=En(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Vt(s),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,En(s,{mechanism:{data:{function:"addEventListener",handler:Vt(s),target:e},handled:!1,type:"instrument"}}),o])}}),Me(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let u=c&&c.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,c,o)}}))}var FE="GlobalHandlers",HE=(e={})=>{let t=b({onerror:!0,onunhandledrejection:!0},e);return{name:FE,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&($E(r),cd("onerror")),t.onunhandledrejection&&(jE(r),cd("onunhandledrejection"))}}},ld=HE;function $E(e){Ul(t=>{let{stackParser:r,attachStacktrace:n}=ud();if(Ue()!==e||gu())return;let{msg:i,url:s,line:o,column:c,error:u}=t,d=GE(Gs(r,u||i,void 0,n,!1),s,o,c);d.level="error",Eo(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function jE(e){Fl(t=>{let{stackParser:r,attachStacktrace:n}=ud();if(Ue()!==e||gu())return;let i=VE(t),s=fn(i)?WE(i):Gs(r,i,void 0,n,!0);s.level="error",Eo(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function VE(e){if(fn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function WE(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function GE(e,t,r,n){let i=e.exception=e.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},u=c.frames=c.frames||[],d=isNaN(parseInt(n,10))?void 0:n,g=isNaN(parseInt(r,10))?void 0:r,h=bt(t)&&t.length>0?t:Cl();return u.length===0&&u.push({colno:d,filename:h,function:gr,in_app:!0,lineno:g}),e}function cd(e){Or&&K.log(`Global Handler attached: ${e}`)}function ud(){let e=Ue();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var pd=()=>({name:"HttpContext",preprocessEvent(e){if(!We.navigator&&!We.location&&!We.document)return;let t=e.request&&e.request.url||We.location&&We.location.href,{referrer:r}=We.document||{},{userAgent:n}=We.navigator||{},i=b(b(b({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=ee(b(b({},e.request),t&&{url:t}),{headers:i});e.request=s}}),YE="cause",zE=5,qE="LinkedErrors",KE=(e={})=>{let t=e.limit||zE,r=e.key||YE;return{name:qE,preprocessEvent(n,i,s){let o=s.getOptions();Il(Ws,o.stackParser,o.maxValueLength,r,t,n,i)}}},fd=KE;function Ru(e){return[js(),Hs(),ad(),od(),ld(),fd(),Vs(),pd()]}var Au=class extends Error{cause;constructor(e,t){super(e),this.cause=t}},Oe=class hp{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new hp),this.INSTANCE}captureException(t,r,n){w.error(t),this.getNewScope(r,n).captureException(t)}captureMessage(t,r,n,i){this.getNewScope(n,i).captureMessage(t,r??"error")}captureError(t,r,n,i){w.error(t,r);let s=this.getNewScope(n,i),o=new Au(t,r);s.captureException(o)}setGlobalContext(t,r){this.contexts[t]=b({context:r},this.contexts[t])}setUser(t){this.user=t}setTags(t){this.tags=t}getNewScope(t,r){let n=new dt;if(n.setClient(this.client),n.setUser(this.user),t?.triggerContext){let i=t.triggerContext;n.setExtras(i.triggerData.sentryContext()),delete t.triggerContext}return t&&n.setExtras(t),this.tags&&n.setTags(this.tags),r&&n.setTags(r),Object.keys(this.contexts).forEach(i=>{n.setContext(i,this.contexts[i])}),n.setTag("language",navigator.language),n.setTag("timezone",md()),n}init(){let t=Ru({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new So({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:Cu,stackParser:Du,integrations:t,environment:pt.mode,release:`web-sdk@${N.SDK_VERSION}`,debug:pt.debug}),this.client.init()}},Xs=class{static format(e,t){let r=/{{\s*(\w+)\s*}}/;return t.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return n}})}static formatWithDelimiters(e,t=2,r=",",n="."){if(isNaN(e)||e==null)return"0";let i=(e/100).toFixed(t).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}};function Qs(e){try{return new URL(e)}catch{return}}function Nu(e){return!e||e==="null"||e==="undefined"}function hd(e,t){let r=e.indexOf(t);return r===-1?!1:(e.splice(r,1),!0)}function Gt(e,t){if(e==0&&t)return"Free";let r=le.get(),n=Pe.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||w.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=Xs.format(e*100,o);else{let u;try{u=new Intl.NumberFormat(yd(),{style:"currency",currency:s||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(d){return Oe.getInstance().captureException(d,{currentCurrency:s,shopCurrency:i}),""}c=u.format(e),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))}return c}function gd(e){return new Intl.NumberFormat(yd(),{notation:"compact"}).format(e)}function yd(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}var Js;function md(){if(Js)return Js;try{return Js=Intl.DateTimeFormat().resolvedOptions().timeZone,Js}catch{return""}}function di(e){document.readyState==="complete"?e():document.addEventListener("readystatechange",()=>{document.readyState==="complete"&&e()})}function Yr(e){let t=document.createElement("span");t.id="snackbar",t.innerText=e,document.body.appendChild(t),t.className="show",setTimeout(()=>{t.classList.remove("show"),document.body.removeChild(t)},3e3)}async function Ou(e,t=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<t;){let s=Math.min(100*2**n,5e3);if(await dd.JSUtils.sleep(s),i=r.querySelectorAll(e),i.length)return w.debug(`Attempt ${n+1}: ${i.length} elements found with ${e}`),i;w.debug(`Attempt ${n+1}: Elements not found with ${e}. Retrying after ${s}ms.`),n++}return w.warn(`Max attempts reached. Element not found with ${e}.`),i}async function hi(e,t=10,r=document){return(await Ou(e,t,r)).item(0)}function vd(e,t,r=document.body){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{(o===e||o.contains(e))&&(t(),n.disconnect())})})});n.observe(r,{childList:!0})}async function Zs(){let e=await xe.get(oe.DEVICE_ID),t=await tt.get(oe.ID,"");return[{key:"letscooee_did",value:e},{key:"letscooee_sid",value:t},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}]}function gi(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!1,value:r})}var ea=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}},ta=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}},Pu=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},_r=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(t=>new ea(t))??[],this.link=e.link,this.price=new ta(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.effectivePrice=Ht(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=Ht(void 0)),this.sellingPlans=e.sellingPlans?.map(t=>{let r=new Pu(t);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}},Rt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=Ht(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=Ht(this.selectedVariant)}get imageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}update(e){return this.id=e.id,this.mID=e.mID,this.name=e.name,this.status=e.status,this.ctg=e.ctg,this.imgs=e.imgs,this.desc=e.desc,this.sDesc=e.sDesc,this.link=e.link,this.slug=e.slug,this.quantity=e.quantity,this.meta=e.meta,this.category=e.category,this.videos=e.videos,this.reviews=e.reviews,this.portraitVideos=e.videos?.filter(t=>t.orientation==="PORTRAIT"),this.tags=e.tags,e.vars&&(this.vars=e.vars.map(t=>new _r(t))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new ft({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}},ra=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}},Lu=class{enabled;constructor(e){this.enabled=e.enabled}},Mu=class extends Lu{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},na=class{productQuantity;constructor(e){e??={},this.productQuantity=new Mu(e.productQuantity)}},Sn=class{s;g;i;constructor(e){e.s&&(this.s=new Le(e.s)),e.g&&(this.g=new bo(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},wo="a-f\\d",XE=`#?[${wo}]{3}[${wo}]?`,JE=`#?[${wo}]{6}([${wo}]{2})?`,QE=new RegExp(`[^#${wo}]`,"gi"),ZE=new RegExp(`^${XE}$|^${JE}$`,"i");function ku(e,t={}){if(typeof e!="string"||QE.test(e)||!ZE.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let r=1;e.length===8&&(r=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(r=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let n=Number.parseInt(e,16),i=n>>16,s=n>>8&255,o=n&255,c=typeof t.alpha=="number"?t.alpha:r;if(t.format==="array")return[i,s,o,c];if(t.format==="css"){let u=c===1?"":` / ${Number((c*100).toFixed(2))}%`;return`rgb(${i} ${s} ${o}${u})`}return{red:i,green:s,blue:o,alpha:c}}var Le=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return ku(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}},Pr=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new Le(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return ia[this.s??1]}},ia=(e=>(e[e.SOLID=1]="SOLID",e[e.DASHED=2]="DASHED",e))(ia||{}),bo=class gp{static DEFAULT_FALLBACK=new Le({h:"#000000",a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new Le(t.c)),t.fb&&(this.fb=new Le(t.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??gp.DEFAULT_FALLBACK}},Io=class{blur;spr;clr;x;y;constructor(e){e=e??{},this.blur=e.blur??0,this.spr=e.spr??0,this.x=e.x??0,this.y=e.y??0,this.clr=new Le(e.clr)}getStyle(e){return`${this.x*e}px ${this.y*e}px ${this.blur*e}px ${this.spr*e}px ${this.clr.rgba}`}},Lr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(e){e=e??{},this.pl=e.pl??0,this.pr=e.pr??0,this.pt=e.pt??0,this.pb=e.pb??0,this.ml=e.ml??0,this.mr=e.mr??0,this.mt=e.mt??0,this.mb=e.mb??0,this.cent=e.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}},bn=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}},Mt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new Sn(e.bg)),e.br&&(this.br=new Pr(e.br)),e.shd&&(this.shd=new Io(e.shd)),e.spc&&(this.spc=new Lr(e.spc)),this.trf=new bn(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return ke[this.t]}get click(){return this.clc}},ke=(e=>(e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.BUTTON=3]="BUTTON",e[e.FLEXBOX=4]="FLEXBOX",e[e.MULTI_COLUMN=5]="MULTI_COLUMN",e[e.CHECKBOX=6]="CHECKBOX",e[e.PRODUCTS=11]="PRODUCTS",e[e.PRODUCT=12]="PRODUCT",e[e.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",e[e.PRODUCT_TITLE=14]="PRODUCT_TITLE",e[e.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",e[e.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",e[e.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",e[e.PRODUCT_RATING=19]="PRODUCT_RATING",e[e.EMAIL_INPUT=51]="EMAIL_INPUT",e[e.PHONE_INPUT=52]="PHONE_INPUT",e[e.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",e[e.CAROUSEL=62]="CAROUSEL",e[e.SHAPE=100]="SHAPE",e))(ke||{}),wn=class extends Mt{constructor(e){super(e)}},Mr=class extends Mt{src;constructor(e){super(e),this.src=e.src}},yi=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e[e.JUSTIFY=3]="JUSTIFY",e))(yi||{}),oa=class{name;fonts;constructor(e){e=e??{},e.name&&(e.name=e.name!=="Arial"?e.name:""),this.name=e.name,this.fonts=e.fonts?.map(t=>new Bu(t))}},Bu=class{style;url;constructor(e){e=e??{},this.style=e.style,this.url=e.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}},Ze=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return yi[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(e){e=e??{},e.lh&&(this.lh=e.lh),e.tdc&&(this.tdc=new Le(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new Le(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new oa(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}},Sr=class extends Mt{typo;constructor(e){super(e);let t=b(b({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new Ze(t)}get color(){return this.typography.tc}get typography(){return this.typo}},zr=class extends Sr{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}},sa=class extends Mt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},vi=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,t){let r=new Date;e===2?(r.setSeconds(r.getSeconds()+this.ss),r.setMinutes(r.getMinutes()+this.mm),r.setHours(r.getHours()+this.hh),r.setDate(r.getDate()+this.dd)):r=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=r.getTime()-i;if(s<1){clearInterval(n);return}let o=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),u=Math.floor(s%(1e3*60*60)/(1e3*60)),d=Math.floor(s%(1e3*60)/1e3);t({days:o,hours:c,minutes:u,seconds:d})},1e3);return n}},Ei=class extends Sr{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new vi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},aa=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new Le(e.c??{})}get text(){return this.txt}get color(){return this.c}},qr=class extends Sr{ph;constructor(e){super(e),this.ph=new aa(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},_i=class extends qr{constructor(e){e??={},super(e)}},Si=class extends qr{},bi=class extends qr{},wi=class extends Mr{},In=(e=>(e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH",e))(In||{}),ca=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}},To=class extends Mt{gvt;max;cover;anim;embedded;position;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new ca(e.anim),this.embedded=e.embedded,this.position=e.position??1,this.spc||(this.spc=new Lr({pl:N.IN_APP_DEFAULT_PADDING,pr:N.IN_APP_DEFAULT_PADDING,pt:N.IN_APP_DEFAULT_PADDING,pb:N.IN_APP_DEFAULT_PADDING}))}isEmbedded(){return this.position===2&&!!this.embedded}getEmbeddedSelector(){return`.letscooee-engagement.container-${this.embedded}`}},la=class extends To{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new sa(e.cont),this.mob=new To(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new Mr(t)):t.t===2?this.elems.push(new zr(t)):t.t===3?this.elems.push(new zr(t)):t.t===100?this.elems.push(new wn(t)):t.t===51?this.elems.push(new Si(t)):t.t===52?this.elems.push(new bi(t)):t.t===61?this.elems.push(new Ei(t)):t.t===15||t.t===16?this.elems.push(new _i(t)):t.t===13&&this.elems.push(new wi(t))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},t,r;return this.gvt===1?(t="flex-start",r="flex-start"):this.gvt===2?(t="center",r="flex-start"):this.gvt===3?(t="flex-end",r="flex-start"):this.gvt===4?(t="flex-start",r="center"):this.gvt===6?(t="flex-end",r="center"):this.gvt===7?(t="flex-start",r="flex-end"):this.gvt===8?(t="center",r="flex-end"):this.gvt===9?(t="flex-end",r="flex-end"):(t="center",r="center"),e.alignItems=r,e.justifyContent=t,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim,this.position=this.mob.position??this.position,this.embedded=this.mob.embedded??this.embedded}},Ii=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}},ua=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}},pa=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}},fa=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Lr(e.spc),e.size&&(this.size=new pa(e.size)),e.bg&&(this.bg=new Sn(e.bg)),e.br&&(this.br=new Pr(e.br)),e.typo&&(this.typo=new Ze(e.typo)),e.lout&&(this.lout=new ua(e.lout)),e.flex&&(this.flex=new Ii(e.flex))}},Ti=class{sm;lg;constructor(e){e??={},this.sm=new fa(e.sm),this.lg=new fa(e.lg)}},nt=class{t;style;hide;when;clc;constructor(e,t){t??={},this.t=e,this.style=new Ti(t.style),this.hide=t.hide,t.when?.op&&(this.when=t.when),t.clc&&(this.clc=t.clc)}get stringType(){return ke[this.t]}},it=class extends nt{text;constructor(e,t){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(t??2,e),e??={},this.text=e.text}},Tn=class extends it{constructor(e,t){super(e,t??3)}},Ci=class extends nt{value;constructor(e){super(6,e),e??={},this.value=e.value}},xi=class extends it{constructor(e=15,t){super(t,e)}},ma=class extends nt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new Le(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}},Ed=_e(cn()),Uu=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new Le(e.color)}},Fu=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new Le(e.color)}},Co=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(e){e??={},this.navigation=new Fu(e.navigation),this.pagination=new Uu(e.pagination),this.autoplay=e.autoplay,this.slidesPerView=e.slidesPerView??1,this.maxInRow=e.maxInRow??e.slidesPerView??4,this.gap=e.gap??0}},da=class extends nt{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=kt.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new Co(e.conf),this.allowedTypes=e.allowedTypes}},ha=class extends it{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new vi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},Kr=class extends nt{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(t=>{let r=kt.getParsedElement(t);r&&this.elems.push(r)})}},Cn=class extends nt{src;sm;lg;constructor(e,t){super(t??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}},kt=class vp{static getParsedElements(t){let r=[];return t?.forEach(n=>{let i=vp.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(t){switch(t.t){case 2:return new it(t);case 3:return new Tn(t);case 6:return new Ci(t);case 11:return new ga(t);case 12:return new Xr(t);case 61:return new ha(t);case 4:return new Kr(t);case 1:return new Cn(t);case 13:return new Cn(t,13);case 14:return new it(t,14);case 15:case 16:return new xi(t.t,t);case 18:return new Tn(t,18);case 62:return new da(t);case 19:return new ma(t);default:Ed.default.error("Unknown element type",t.t);return}}static parseAlignmentToJustifyContent(t){switch(t){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}},Xr=class extends nt{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=kt.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new Ci(e.cBox)),this.elems.push(new Cn(e.img,13));let t=new it(e.title,14);t.hide=!e.show?.title,t.text="{{ product.name }}",this.elems.push(t);let r=new it(e.price);r.text="{{ product.price }}",r.hide=!e.show?.price;let n=new it(e.compareAt);n.text="{{ product.compare_price }}",n.hide=!e.show?.price,e.compareAt||(n.style=new Ti(r.style),n.style.lg.typo=new Ze(ee(b({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new Ze(ee(b({},n.style.sm.typo),{td:"line-through"})));let i=new Kr({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:kt.parseAlignmentToJustifyContent(r.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(r),this.elems.push(i);let s=new xi(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let o=new Tn(e.btn,18);o.hide=!e.show?.btn,this.elems.push(o)}}e.symbol&&(this.symbol=new it(e.symbol))}},ga=class extends nt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Hu(e.conf),this.prod=new Xr(e.prod)}},ya=class extends Co{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Hu=class{lg;sm;constructor(e){e??={},this.lg=new ya(e.lg),this.sm=new ya(e.sm)}},va=class extends Kr{constructor(e){super(e)}},Di=class{cont;elems=[];constructor(e){e=e??{},this.cont=new va(e.cont),e.elems?.forEach(t=>{this.addRawElement(t)})}addRawElement(e){let t=kt.getParsedElement(e);return t&&this.elems.push(t),t}},_d=_e(Dr()),$u=class{minValue;rewardType;label;reachingText;reachedText;discount;items;calculatedAlignment;constructor(e){this.minValue=e.minValue,this.rewardType=e.rewardType,this.label=e.label,this.reachingText=e.reachingText,this.reachedText=e.reachedText,this.discount=e.discount,this.items=e.items?.map(t=>new ft(t))}},Ea=class{layout;milestones;onlyLatestGift;noConfetti;constructor(e){this.layout=e.layout??_d.ProgressBarLayout.ICONS,this.milestones=e.milestones?.map(t=>new $u(t))??[],this.onlyLatestGift=e.onlyLatestGift,this.noConfetti=e.noConfetti}},Sa=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}},ba=class{id;alt;sources;items;durationMS;thumbnail;constructor(e={}){this.id=e.id,this.alt=e.alt,this.sources=e.sources,this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(t=>new ft(t)):[]}},wa=class{videos;source;template;heading;slidePerViewCount;autoPlay;footerContent;constructor(e={}){this.videos=e.videos?.map(t=>new ba(t))??[],this.source=e.source,this.template=e.template,this.heading=e.heading,this.slidePerViewCount=e.slidePerViewCount??4,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM"}},Ia=class{modifications;constructor(e={}){e.modifications?.length?this.modifications=e.modifications.map(t=>new Ta(t)):e.experiments?.length&&(this.modifications=e.experiments.map(t=>new Ta(t)))}},Ta=class{cssSelector;type;display;bg;typo;br;text;constructor(e={}){this.cssSelector=e.cssSelector??"",this.type=e.type??"OTHER",this.display=e.display,e.bg&&(this.bg=new Le(e.bg)),e.typo&&(this.typo=new Ze(e.typo)),e.br&&(this.br=new Pr(e.br)),this.text=e.text}get style(){let e={};return this.display==="HIDE"?e.display="none":this.display==="BLOCK"?e.display="block":this.display==="INLINE"&&(e.display="inline"),this.br?.r&&(e.borderRadius=this.br.r+"px"),this.br?.w&&(e.borderWidth=this.br.w+"px"),this.br?.s&&(e.borderStyle=ia[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type==="TEXT"&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+"px"),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??"none")),e}toString(){return`Experiment(cssSelector=${this.cssSelector})`}},ju=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===ot.EngagementContentType.EXCLUSION}isABTesting(){return this.contentType===ot.EngagementContentType.ABTESTING}isSingleContent(){return this.contentType===ot.EngagementContentType.SINGLE}},Ct=class bp extends ju{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=Ht({});constructor(t){super(t),this.id=t.id,this.nudgeID=t.nudgeID,this.currency=le.get().currencyCode??"USD",this.contentID=t.contentID,this.variation=t.variation,t.widget&&(this.widget=new Di(t.widget)),this.previewType=t.previewType,this.occurred=t.occurred??new Date,this.props=t.props,this.embeddedItems=t.embeddedItems?.map(r=>new ft(r)),this.items=t.items?.map(r=>new Rt(r))??[],this.nonMutableItems=t.items?.map(r=>new Rt(r))??[],this.collections=t.collections?.map(r=>new ra(r))??[],this.discount=t.discount,this.placement=t.placement,this.customerData=t.customerData,this.ian=t.ian?this.processPopup(t.ian):void 0,this.promotionType=t.promotionType,this.manipulation=new na(t.manipulation),this.contentSource=t.contentSource,this.klaviyoFormID=t.klaviyoFormID,this.hasMultiplePlacement=t.hasMultiplePlacement,this.skipSubscribedItems=t.skipSubscribedItems,this.stickyATCConfig=t.stickyATCConfig,t.experimentConfig&&(this.experimentConfig=new Ia(t.experimentConfig)),t.progressBarConfig&&(this.progressBarConfig=new Ea(t.progressBarConfig)),t.bundleConfig&&(this.bundleConfig=new Sa(t.bundleConfig)),t.bundleFrom&&(this.bundleFrom=new Rt(t.bundleFrom)),t.content?.videoConfig&&(this.content={videoConfig:new wa(t.content.videoConfig)})}shouldDelay(){return this.delay>0}sentryContext(){return{id:this.id,shortID:this.shortID,currency:this.currency,contentType:this.contentType,objective:this.objective,onsiteDeliveryType:this.onsiteDeliveryType,engagementID:this.engagementID,contentID:this.contentID,nudgeID:this.nudgeID,variation:this.variation}}getDelaySeconds(){let t=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-t}isBundle(){return this.objective===ot.EngagementObjective.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===ot.OnsiteDeliveryType.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===ot.OnsiteDeliveryType.PAGE_EMBED}isProgressBar(){return this.objective===ot.EngagementObjective.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===ot.EngagementObjective.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===ot.EngagementObjective.CART_RECOVERY}isProductPromotion(){return this.objective===ot.EngagementObjective.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===ot.PromotionType.COLLECTION}isBYOB(){return this.objective===ot.EngagementObjective.BYOB}isStickyATC(){return this.objective===ot.EngagementObjective.STICKY_ATC}isShoppableVideo(){return this.objective===ot.EngagementObjective.SHOPPABLE_VIDEO}processPopup(t){let r=JSON.stringify(t),n=this.items[0],i={},s={};if(n){let u=n.selectedOrFirstVariant.value;i={name:n.name,id:n.mID,link:n.link,vID:u.mID,image:n.variantImage,price:Gt(u.price.d),comparePrice:Gt(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:pe.getCurrent().item_count},c=St.render(r,{product:i,variant:s,cart:o,discount:this.discount,customer:this.customerData});return n&&(c=c.replace(new RegExp(N.PLACEHOLDER_IMAGE,"gi"),n.variantImage??n.imageURL)),new la(JSON.parse(c))}calculateDiscountData(t,r){let n=Ca.ArrayUtils.sum(t,o=>o.selectedOrFirstVariant.value.price.d),i=Ca.ArrayUtils.sum(t,o=>{let c=o.selectedOrFirstVariant.value.price;return c.cmp??c.d}),s={actualPrice:n,totalComparePrice:i,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!t?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(s);return}if(Jr.DiscountType.BXGY===this.discount.type&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],this.updateEffectivePrice(t,s.discountPercentage,!0),s.discountAmount=s.actualPrice-Ca.ArrayUtils.sum(t,o=>o.selectedOrFirstVariant.value.effectivePrice.value);else if([Jr.DiscountType.UNIQUE_FLAT_ITEMS,Jr.DiscountType.STATIC].includes(this.discount.type)&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],s.discountAmount=s.actualPrice*s.discountPercentage/100,this.updateEffectivePrice(t,s.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)s.discountAmount=s.actualPrice-this.discount.values[0],s.discountPercentage=s.discountAmount/s.actualPrice*100,this.updateEffectivePrice(t,s.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_CHEAPEST_ITEM_FREE){t.sort((c,u)=>u.selectedOrFirstVariant.value.price.d-c.selectedOrFirstVariant.value.price.d);let o=t[t.length-1];o.selectedOrFirstVariant.value.effectivePrice.value=0,s.discountAmount=o.selectedOrFirstVariant.value.price.d,s.discountPercentage=s.discountAmount/s.actualPrice*100}s.discountedPrice=s.actualPrice-s.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(s)}getPrivateAttributesForLineItem(){return Pe.get().skipItemAttribute?{}:{[N.VIA]:"Cooee",[N.CAMPAIGN_ATTRIBUTE]:this.shortID,[N.CONTENT_ATTRIBUTE]:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Pe.get().skipItemAttribute?[]:[{key:N.VIA,value:"Cooee"},{key:N.CAMPAIGN_ATTRIBUTE,value:this.shortID},{key:N.CONTENT_ATTRIBUTE,value:this.contentID}]}isBundleDiscount(){return[Jr.DiscountType.UNIQUE_FIXED_ITEMS,Jr.DiscountType.UNIQUE_FLAT_ITEMS].includes(this.discount.type)}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){let t=this.widget?.elems.find(n=>bp.SWIPER_ELEMENTS.has(n.t));if(!t)return!1;if(t.t===62)return!0;let r=Pt.get().isMobile()?"sm":"lg";return t.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}getCartMagicVariables(){let t=pe.getCurrent();return{productCount:t.item_count,amount:Gt(t.total_price/100),originalAmount:Gt(t.original_total_price/100)}}updateEffectivePrice(t,r,n=!1){let i=le.get().getCurrentItem();t.forEach(s=>{let o=s.selectedOrFirstVariant.value,c=o.price;if(n&&s.mID===i.mID)o.effectivePrice.value=c.d;else{let u=c.d*r/100;o.effectivePrice.value=c.d-u}})}formatCurrencyAndNumber(t){if(!t)return{};let r={discountPercentage:gd(t.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{r[n]=Gt(t[n])}),r}};function t_(e,t){return t={exports:{}},e(t,t.exports),t.exports}var r_=s_,n_=c_,i_=p_,wr=[],zt=[],o_=typeof Uint8Array<"u"?Uint8Array:Array,Vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(xn=0,Sd=Vu.length;xn<Sd;++xn)wr[xn]=Vu[xn],zt[Vu.charCodeAt(xn)]=xn;var xn,Sd;zt[45]=62;zt[95]=63;function Bd(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function s_(e){var t=Bd(e),r=t[0],n=t[1];return(r+n)*3/4-n}function a_(e,t,r){return(t+r)*3/4-r}function c_(e){var t,r=Bd(e),n=r[0],i=r[1],s=new o_(a_(e,n,i)),o=0,c=i>0?n-4:n,u;for(u=0;u<c;u+=4)t=zt[e.charCodeAt(u)]<<18|zt[e.charCodeAt(u+1)]<<12|zt[e.charCodeAt(u+2)]<<6|zt[e.charCodeAt(u+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=zt[e.charCodeAt(u)]<<2|zt[e.charCodeAt(u+1)]>>4,s[o++]=t&255),i===1&&(t=zt[e.charCodeAt(u)]<<10|zt[e.charCodeAt(u+1)]<<4|zt[e.charCodeAt(u+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function l_(e){return wr[e>>18&63]+wr[e>>12&63]+wr[e>>6&63]+wr[e&63]}function u_(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(l_(n));return i.join("")}function p_(e){for(var t,r=e.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(u_(e,o,o+s>c?c:o+s));return n===1?(t=e[r-1],i.push(wr[t>>2]+wr[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(wr[t>>10]+wr[t>>4&63]+wr[t<<2&63]+"=")),i.join("")}var Wu={byteLength:r_,toByteArray:n_,fromByteArray:i_},f_=function(e,t,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,d=u>>1,g=-7,h=r?i-1:0,m=r?-1:1,E=e[t+h];for(h+=m,s=E&(1<<-g)-1,E>>=-g,g+=c;g>0;s=s*256+e[t+h],h+=m,g-=8);for(o=s&(1<<-g)-1,s>>=-g,g+=n;g>0;o=o*256+e[t+h],h+=m,g-=8);if(s===0)s=1-d;else{if(s===u)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-d}return(E?-1:1)*o*Math.pow(2,s-n)},m_=function(e,t,r,n,i,s){var o,c,u,d=s*8-i-1,g=(1<<d)-1,h=g>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,y=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=g):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=m/u:t+=m*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=g?(c=0,o=g):o+h>=1?(c=(t*u-1)*Math.pow(2,i),o=o+h):(c=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+E]=c&255,E+=y,c/=256,i-=8);for(o=o<<i|c,d+=i;d>0;e[r+E]=o&255,E+=y,o/=256,d-=8);e[r+E-y]|=_*128},Ri={read:f_,write:m_},Ra=t_(function(e,t){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=P,t.INSPECT_MAX_BYTES=50;var n=2147483647;t.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var a=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(a,l),a.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(a){if(a>n)throw new RangeError('The value "'+a+'" is invalid for option "size"');var l=new Uint8Array(a);return Object.setPrototypeOf(l,o.prototype),l}function o(a,l,p){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(a)}return c(a,l,p)}o.poolSize=8192;function c(a,l,p){if(typeof a=="string")return h(a,l);if(ArrayBuffer.isView(a))return E(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(Et(a,ArrayBuffer)||a&&Et(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Et(a,SharedArrayBuffer)||a&&Et(a.buffer,SharedArrayBuffer)))return y(a,l,p);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var T=a.valueOf&&a.valueOf();if(T!=null&&T!==a)return o.from(T,l,p);var A=_(a);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return o.from(a[Symbol.toPrimitive]("string"),l,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}o.from=function(a,l,p){return c(a,l,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function d(a,l,p){return u(a),a<=0?s(a):l!==void 0?typeof p=="string"?s(a).fill(l,p):s(a).fill(l):s(a)}o.alloc=function(a,l,p){return d(a,l,p)};function g(a){return u(a),s(a<0?0:x(a)|0)}o.allocUnsafe=function(a){return g(a)},o.allocUnsafeSlow=function(a){return g(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var p=M(a,l)|0,T=s(p),A=T.write(a,l);return A!==p&&(T=T.slice(0,A)),T}function m(a){for(var l=a.length<0?0:x(a.length)|0,p=s(l),T=0;T<l;T+=1)p[T]=a[T]&255;return p}function E(a){if(Et(a,Uint8Array)){var l=new Uint8Array(a);return y(l.buffer,l.byteOffset,l.byteLength)}return m(a)}function y(a,l,p){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(p||0))throw new RangeError('"length" is outside of buffer bounds');var T;return l===void 0&&p===void 0?T=new Uint8Array(a):p===void 0?T=new Uint8Array(a,l):T=new Uint8Array(a,l,p),Object.setPrototypeOf(T,o.prototype),T}function _(a){if(o.isBuffer(a)){var l=x(a.length)|0,p=s(l);return p.length===0||a.copy(p,0,0,l),p}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):m(a);if(a.type==="Buffer"&&Array.isArray(a.data))return m(a.data)}function x(a){if(a>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return a|0}function P(a){return+a!=a&&(a=0),o.alloc(+a)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Et(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Et(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;for(var p=a.length,T=l.length,A=0,U=Math.min(p,T);A<U;++A)if(a[A]!==l[A]){p=a[A],T=l[A];break}return p<T?-1:T<p?1:0},o.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<a.length;++p)l+=a[p].length;var T=o.allocUnsafe(l),A=0;for(p=0;p<a.length;++p){var U=a[p];if(Et(U,Uint8Array))A+U.length>T.length?o.from(U).copy(T,A):Uint8Array.prototype.set.call(T,U,A);else if(o.isBuffer(U))U.copy(T,A);else throw new TypeError('"list" argument must be an Array of Buffers');A+=U.length}return T};function M(a,l){if(o.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||Et(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var p=a.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&p===0)return 0;for(var A=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return an(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return zn(a).length;default:if(A)return T?-1:an(a).length;l=(""+l).toLowerCase(),A=!0}}o.byteLength=M;function L(a,l,p){var T=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return vt(this,l,p);case"utf8":case"utf-8":return Be(this,l,p);case"ascii":return Ve(this,l,p);case"latin1":case"binary":return ye(this,l,p);case"base64":return de(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,l,p);default:if(T)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function k(a,l,p){var T=a[l];a[l]=a[p],a[p]=T}o.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<a;l+=2)k(this,l,l+1);return this},o.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<a;l+=4)k(this,l,l+3),k(this,l+1,l+2);return this},o.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<a;l+=8)k(this,l,l+7),k(this,l+1,l+6),k(this,l+2,l+5),k(this,l+3,l+4);return this},o.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?Be(this,0,a):L.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){var a="",l=t.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,p,T,A){if(Et(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(l===void 0&&(l=0),p===void 0&&(p=a?a.length:0),T===void 0&&(T=0),A===void 0&&(A=this.length),l<0||p>a.length||T<0||A>this.length)throw new RangeError("out of range index");if(T>=A&&l>=p)return 0;if(T>=A)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,T>>>=0,A>>>=0,this===a)return 0;for(var U=A-T,W=p-l,we=Math.min(U,W),fe=this.slice(T,A),ge=a.slice(l,p),je=0;je<we;++je)if(fe[je]!==ge[je]){U=fe[je],W=ge[je];break}return U<W?-1:W<U?1:0};function G(a,l,p,T,A){if(a.length===0)return-1;if(typeof p=="string"?(T=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,$r(p)&&(p=A?0:a.length-1),p<0&&(p=a.length+p),p>=a.length){if(A)return-1;p=a.length-1}else if(p<0)if(A)p=0;else return-1;if(typeof l=="string"&&(l=o.from(l,T)),o.isBuffer(l))return l.length===0?-1:ue(a,l,p,T,A);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(a,l,p):Uint8Array.prototype.lastIndexOf.call(a,l,p):ue(a,[l],p,T,A);throw new TypeError("val must be string, number or Buffer")}function ue(a,l,p,T,A){var U=1,W=a.length,we=l.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(a.length<2||l.length<2)return-1;U=2,W/=2,we/=2,p/=2}function fe(Z,Te){return U===1?Z[Te]:Z.readUInt16BE(Te*U)}var ge;if(A){var je=-1;for(ge=p;ge<W;ge++)if(fe(a,ge)===fe(l,je===-1?0:ge-je)){if(je===-1&&(je=ge),ge-je+1===we)return je*U}else je!==-1&&(ge-=ge-je),je=-1}else for(p+we>W&&(p=W-we),ge=p;ge>=0;ge--){for(var q=!0,ae=0;ae<we;ae++)if(fe(a,ge+ae)!==fe(l,ae)){q=!1;break}if(q)return ge}return-1}o.prototype.includes=function(a,l,p){return this.indexOf(a,l,p)!==-1},o.prototype.indexOf=function(a,l,p){return G(this,a,l,p,!0)},o.prototype.lastIndexOf=function(a,l,p){return G(this,a,l,p,!1)};function Re(a,l,p,T){p=Number(p)||0;var A=a.length-p;T?(T=Number(T),T>A&&(T=A)):T=A;var U=l.length;T>U/2&&(T=U/2);for(var W=0;W<T;++W){var we=parseInt(l.substr(W*2,2),16);if($r(we))return W;a[p+W]=we}return W}function B(a,l,p,T){return jn(an(l,a.length-p),a,p,T)}function Q(a,l,p,T){return jn(ii(l),a,p,T)}function Y(a,l,p,T){return jn(zn(l),a,p,T)}function J(a,l,p,T){return jn(Xi(l,a.length-p),a,p,T)}o.prototype.write=function(a,l,p,T){if(l===void 0)T="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")T=l,p=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(p)?(p=p>>>0,T===void 0&&(T="utf8")):(T=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var A=this.length-l;if((p===void 0||p>A)&&(p=A),a.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");for(var U=!1;;)switch(T){case"hex":return Re(this,a,l,p);case"utf8":case"utf-8":return B(this,a,l,p);case"ascii":case"latin1":case"binary":return Q(this,a,l,p);case"base64":return Y(this,a,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,a,l,p);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),U=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function de(a,l,p){return l===0&&p===a.length?Wu.fromByteArray(a):Wu.fromByteArray(a.slice(l,p))}function Be(a,l,p){p=Math.min(a.length,p);for(var T=[],A=l;A<p;){var U=a[A],W=null,we=U>239?4:U>223?3:U>191?2:1;if(A+we<=p){var fe,ge,je,q;switch(we){case 1:U<128&&(W=U);break;case 2:fe=a[A+1],(fe&192)===128&&(q=(U&31)<<6|fe&63,q>127&&(W=q));break;case 3:fe=a[A+1],ge=a[A+2],(fe&192)===128&&(ge&192)===128&&(q=(U&15)<<12|(fe&63)<<6|ge&63,q>2047&&(q<55296||q>57343)&&(W=q));break;case 4:fe=a[A+1],ge=a[A+2],je=a[A+3],(fe&192)===128&&(ge&192)===128&&(je&192)===128&&(q=(U&15)<<18|(fe&63)<<12|(ge&63)<<6|je&63,q>65535&&q<1114112&&(W=q))}}W===null?(W=65533,we=1):W>65535&&(W-=65536,T.push(W>>>10&1023|55296),W=56320|W&1023),T.push(W),A+=we}return ut(T)}var v=4096;function ut(a){var l=a.length;if(l<=v)return String.fromCharCode.apply(String,a);for(var p="",T=0;T<l;)p+=String.fromCharCode.apply(String,a.slice(T,T+=v));return p}function Ve(a,l,p){var T="";p=Math.min(a.length,p);for(var A=l;A<p;++A)T+=String.fromCharCode(a[A]&127);return T}function ye(a,l,p){var T="";p=Math.min(a.length,p);for(var A=l;A<p;++A)T+=String.fromCharCode(a[A]);return T}function vt(a,l,p){var T=a.length;(!l||l<0)&&(l=0),(!p||p<0||p>T)&&(p=T);for(var A="",U=l;U<p;++U)A+=Ji[a[U]];return A}function se(a,l,p){for(var T=a.slice(l,p),A="",U=0;U<T.length-1;U+=2)A+=String.fromCharCode(T[U]+T[U+1]*256);return A}o.prototype.slice=function(a,l){var p=this.length;a=~~a,l=l===void 0?p:~~l,a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<a&&(l=a);var T=this.subarray(a,l);return Object.setPrototypeOf(T,o.prototype),T};function ie(a,l,p){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a],A=1,U=0;++U<l&&(A*=256);)T+=this[a+U]*A;return T},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a+--l],A=1;l>0&&(A*=256);)T+=this[a+--l]*A;return T},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||ie(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||ie(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||ie(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=this[a],A=1,U=0;++U<l&&(A*=256);)T+=this[a+U]*A;return A*=128,T>=A&&(T-=Math.pow(2,8*l)),T},o.prototype.readIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||ie(a,l,this.length);for(var T=l,A=1,U=this[a+--T];T>0&&(A*=256);)U+=this[a+--T]*A;return A*=128,U>=A&&(U-=Math.pow(2,8*l)),U},o.prototype.readInt8=function(a,l){return a=a>>>0,l||ie(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var p=this[a]|this[a+1]<<8;return p&32768?p|4294901760:p},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var p=this[a+1]|this[a]<<8;return p&32768?p|4294901760:p},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),Ri.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),Ri.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),Ri.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),Ri.read(this,a,!1,52,8)};function ze(a,l,p,T,A,U){if(!o.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>A||l<U)throw new RangeError('"value" argument is out of bounds');if(p+T>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,p,T){if(a=+a,l=l>>>0,p=p>>>0,!T){var A=Math.pow(2,8*p)-1;ze(this,a,l,p,A,0)}var U=1,W=0;for(this[l]=a&255;++W<p&&(U*=256);)this[l+W]=a/U&255;return l+p},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,p,T){if(a=+a,l=l>>>0,p=p>>>0,!T){var A=Math.pow(2,8*p)-1;ze(this,a,l,p,A,0)}var U=p-1,W=1;for(this[l+U]=a&255;--U>=0&&(W*=256);)this[l+U]=a/W&255;return l+p},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeIntLE=function(a,l,p,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*p-1);ze(this,a,l,p,A-1,-A)}var U=0,W=1,we=0;for(this[l]=a&255;++U<p&&(W*=256);)a<0&&we===0&&this[l+U-1]!==0&&(we=1),this[l+U]=(a/W>>0)-we&255;return l+p},o.prototype.writeIntBE=function(a,l,p,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*p-1);ze(this,a,l,p,A-1,-A)}var U=p-1,W=1,we=0;for(this[l+U]=a&255;--U>=0&&(W*=256);)a<0&&we===0&&this[l+U+1]!==0&&(we=1),this[l+U]=(a/W>>0)-we&255;return l+p},o.prototype.writeInt8=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||ze(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function er(a,l,p,T,A,U){if(p+T>a.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function cr(a,l,p,T,A){return l=+l,p=p>>>0,A||er(a,l,p,4),Ri.write(a,l,p,T,23,4),p+4}o.prototype.writeFloatLE=function(a,l,p){return cr(this,a,l,!0,p)},o.prototype.writeFloatBE=function(a,l,p){return cr(this,a,l,!1,p)};function yt(a,l,p,T,A){return l=+l,p=p>>>0,A||er(a,l,p,8),Ri.write(a,l,p,T,52,8),p+8}o.prototype.writeDoubleLE=function(a,l,p){return yt(this,a,l,!0,p)},o.prototype.writeDoubleBE=function(a,l,p){return yt(this,a,l,!1,p)},o.prototype.copy=function(a,l,p,T){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(p||(p=0),!T&&T!==0&&(T=this.length),l>=a.length&&(l=a.length),l||(l=0),T>0&&T<p&&(T=p),T===p||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),a.length-l<T-p&&(T=a.length-l+p);var A=T-p;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,p,T):Uint8Array.prototype.set.call(a,this.subarray(p,T),l),A},o.prototype.fill=function(a,l,p,T){if(typeof a=="string"){if(typeof l=="string"?(T=l,l=0,p=this.length):typeof p=="string"&&(T=p,p=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!o.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(a.length===1){var A=a.charCodeAt(0);(T==="utf8"&&A<128||T==="latin1")&&(a=A)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,a||(a=0);var U;if(typeof a=="number")for(U=l;U<p;++U)this[U]=a;else{var W=o.isBuffer(a)?a:o.from(a,T),we=W.length;if(we===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(U=0;U<p-l;++U)this[U+l]=W[U%we]}return this};var Hr=/[^+/0-9A-Za-z-_]/g;function qn(a){if(a=a.split("=")[0],a=a.trim().replace(Hr,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function an(a,l){l=l||1/0;for(var p,T=a.length,A=null,U=[],W=0;W<T;++W){if(p=a.charCodeAt(W),p>55295&&p<57344){if(!A){if(p>56319){(l-=3)>-1&&U.push(239,191,189);continue}else if(W+1===T){(l-=3)>-1&&U.push(239,191,189);continue}A=p;continue}if(p<56320){(l-=3)>-1&&U.push(239,191,189),A=p;continue}p=(A-55296<<10|p-56320)+65536}else A&&(l-=3)>-1&&U.push(239,191,189);if(A=null,p<128){if((l-=1)<0)break;U.push(p)}else if(p<2048){if((l-=2)<0)break;U.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;U.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;U.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return U}function ii(a){for(var l=[],p=0;p<a.length;++p)l.push(a.charCodeAt(p)&255);return l}function Xi(a,l){for(var p,T,A,U=[],W=0;W<a.length&&!((l-=2)<0);++W)p=a.charCodeAt(W),T=p>>8,A=p%256,U.push(A),U.push(T);return U}function zn(a){return Wu.toByteArray(qn(a))}function jn(a,l,p,T){for(var A=0;A<T&&!(A+p>=l.length||A>=a.length);++A)l[A+p]=a[A];return A}function Et(a,l){return a instanceof l||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===l.name}function $r(a){return a!==a}var Ji=function(){for(var a="0123456789abcdef",l=new Array(256),p=0;p<16;++p)for(var T=p*16,A=0;A<16;++A)l[T+A]=a[p]+a[A];return l}()}),Se=Ra.Buffer;Ra.SlowBuffer;Ra.INSPECT_MAX_BYTES;Ra.kMaxLength;var Ku=function(e,t){return Ku=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ku(e,t)};function Aa(e,t){Ku(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Rn=function(e){Aa(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),$e=function(e){Aa(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function xa(e){return e&&e.Math==Math&&e}function Ud(){return xa(typeof globalThis=="object"&&globalThis)||xa(typeof window=="object"&&window)||xa(typeof self=="object"&&self)||xa(typeof global=="object"&&global)||Function("return this")()}function d_(){var e=Ud();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var h_=function(e){var t=d_()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(t);for(var r=Se.alloc(e),n=0;n<e;++n)r[n]=Math.floor(Math.random()*256);return r},g_=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(Se.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(Se.alloc(t))}:h_}},Fd=g_();function y_(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ju(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function v_(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function E_(e){return Ao(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Ao(e){return typeof e=="object"&&e!==null}function Na(e,t){var r=!1;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r||(console.warn(t),r=!0),e.apply(this,i)}return n}function Da(e){if(ArrayBuffer.isView(e))return Se.from(e.buffer,e.byteOffset,e.byteLength);if(y_(e))return Se.from(e);throw new $e("Must use either Buffer or TypedArray")}var __=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Hd=function(e){return typeof e=="string"&&__.test(e)},Xu=function(e){if(!Hd(e))throw new $e('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return Se.from(t,"hex")},bd=function(e,t){return t===void 0&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")},yP=Math.pow(2,63)-1,vP=-Math.pow(2,63),S_=Math.pow(2,53),b_=-Math.pow(2,53),$d=4,An=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new $e("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=Se.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=Se.from(t,"binary"):Array.isArray(t)?this.buffer=Se.from(t):this.buffer=Da(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new $e("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new $e("only accepts single character Uint8Array or Array");var r;if(typeof t=="string"?r=t.charCodeAt(0):typeof t=="number"?r=t:r=t[0],r<0||r>255)throw new $e("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Se.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},e.prototype.write=function(t,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+t.length){var n=Se.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(Da(t),r),this.position=r+t.byteLength>this.position?r+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,r,t.length,"binary"),this.position=r+t.length>this.position?r+t.length:this.position)},e.prototype.read=function(t,r){return r=r&&r>0?r:this.position,this.buffer.slice(t,t+r)},e.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(t){return this.buffer.toString(t)},e.prototype.toExtendedJSON=function(t){t=t||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return t.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new wd(this.buffer.slice(0,this.position));throw new Rn('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){r=r||{};var n,i;if("$binary"in t?r.legacy&&typeof t.$binary=="string"&&"$type"in t?(i=t.$type?parseInt(t.$type,16):0,n=Se.from(t.$binary,"base64")):typeof t.$binary!="string"&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=Se.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=Xu(t.$uuid)),!n)throw new $e("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===$d?new wd(n):new e(n,i)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e}();Object.defineProperty(An.prototype,"_bsontype",{value:"Binary"});var Gu=16,wd=function(e){Aa(t,e);function t(r){var n=this,i,s;if(r==null)i=t.generate();else if(r instanceof t)i=Se.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===Gu)i=Da(r);else if(typeof r=="string")i=Xu(r);else throw new $e("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=e.call(this,i,$d)||this,n.__id=s,n}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,t.cacheHexString&&(this.__id=bd(r))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(r){if(r===void 0&&(r=!0),t.cacheHexString&&this.__id)return this.__id;var n=bd(this.id,r);return t.cacheHexString&&(this.__id=n),n},t.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(r){if(!r)return!1;if(r instanceof t)return r.id.equals(this.id);try{return new t(r).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new An(this.id,An.SUBTYPE_UUID)},t.generate=function(){var r=Fd(Gu);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Se.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?Hd(r):Ju(r)?r.length!==Gu?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var n=Xu(r);return new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}(An),Oa=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},e}();Object.defineProperty(Oa.prototype,"_bsontype",{value:"Code"});function w_(e){return Ao(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Do=function(){function e(t,r,n,i){if(!(this instanceof e))return new e(t,r,n,i);var s=t.split(".");s.length===2&&(n=s.shift(),t=s.shift()),this.collection=t,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},e.prototype.toExtendedJSON=function(t){t=t||{};var r={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(Do.prototype,"_bsontype",{value:"DBRef"});var Yt=void 0;try{Yt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var Id=65536,I_=1<<24,Ni=Id*Id,jd=Ni*Ni,Td=jd/2,Cd={},xd={},X=function(){function e(t,r,n){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,r,n);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!r)):typeof t=="string"?Object.assign(this,e.fromString(t,!!r)):(this.low=t|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromInt=function(t,r){var n,i,s;return r?(t>>>=0,(s=0<=t&&t<256)&&(i=xd[t],i)?i:(n=e.fromBits(t,(t|0)<0?-1:0,!0),s&&(xd[t]=n),n)):(t|=0,(s=-128<=t&&t<128)&&(i=Cd[t],i)?i:(n=e.fromBits(t,t<0?-1:0,!1),s&&(Cd[t]=n),n))},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=jd)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Td)return e.MIN_VALUE;if(t+1>=Td)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Ni|0,t/Ni|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return e.fromString(t.substring(1),r,n).neg();for(var s=e.fromNumber(Math.pow(n,8)),o=e.ZERO,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),d=parseInt(t.substring(c,c+u),n);if(u<8){var g=e.fromNumber(Math.pow(n,u));o=o.mul(g).add(e.fromNumber(d))}else o=o.mul(s),o=o.add(e.fromNumber(d))}return o.unsigned=r,o},e.fromBytes=function(t,r,n){return n?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(t){return Ao(t)&&t.__isLong__===!0},e.fromValue=function(t,r){return typeof t=="number"?e.fromNumber(t,r):typeof t=="string"?e.fromString(t,r):e.fromBits(t.low,t.high,typeof r=="boolean"?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=t.high>>>16,c=t.high&65535,u=t.low>>>16,d=t.low&65535,g=0,h=0,m=0,E=0;return E+=s+d,m+=E>>>16,E&=65535,m+=i+u,h+=m>>>16,m&=65535,h+=n+c,g+=h>>>16,h&=65535,g+=r+o,g&=65535,e.fromBits(m<<16|E,g<<16|h,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(t){return this.compare(t)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(Yt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Yt.div_u:Yt.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Yt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var n,i,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;s=e.UZERO}else{if(this.eq(e.MIN_VALUE)){if(t.eq(e.ONE)||t.eq(e.NEG_ONE))return e.MIN_VALUE;if(t.eq(e.MIN_VALUE))return e.ONE;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(i=this.sub(t.mul(n)),s=n.add(i.div(t)),s)}else if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=e.ZERO}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),u=c<=48?1:Math.pow(2,c-48),d=e.fromNumber(n),g=d.mul(t);g.isNegative()||g.gt(i);)n-=u,d=e.fromNumber(n,this.unsigned),g=d.mul(t);d.isZero()&&(d=e.ONE),s=s.add(d),i=i.sub(g)}return s},e.prototype.div=function(t){return this.divide(t)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},e.prototype.eq=function(t){return this.equals(t)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(t&1<<r)===0;r--);return this.high!==0?r+33:r+1},e.prototype.greaterThan=function(t){return this.comp(t)>0},e.prototype.gt=function(t){return this.greaterThan(t)},e.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},e.prototype.gte=function(t){return this.greaterThanOrEqual(t)},e.prototype.ge=function(t){return this.greaterThanOrEqual(t)},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.lessThan=function(t){return this.comp(t)<0},e.prototype.lt=function(t){return this.lessThan(t)},e.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},e.prototype.lte=function(t){return this.lessThanOrEqual(t)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),Yt){var r=(this.unsigned?Yt.rem_u:Yt.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Yt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(t){return this.modulo(t)},e.prototype.rem=function(t){return this.modulo(t)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),Yt){var r=Yt.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,Yt.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=t.high>>>16,u=t.high&65535,d=t.low>>>16,g=t.low&65535,h=0,m=0,E=0,y=0;return y+=o*g,E+=y>>>16,y&=65535,E+=s*g,m+=E>>>16,E&=65535,E+=o*d,m+=E>>>16,E&=65535,m+=i*g,h+=m>>>16,m&=65535,m+=s*d,h+=m>>>16,m&=65535,m+=o*u,h+=m>>>16,m&=65535,h+=n*g+i*d+s*u+o*c,h&=65535,e.fromBits(E<<16|y,h<<16|m,this.unsigned)},e.prototype.mul=function(t){return this.multiply(t)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(t){return!this.equals(t)},e.prototype.neq=function(t){return this.notEquals(t)},e.prototype.ne=function(t){return this.notEquals(t)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(t){return this.shiftLeft(t)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(t){return this.shiftRight(t)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var r=this.high;if(t<32){var n=this.low;return e.fromBits(n>>>t|r<<32-t,r>>>t,this.unsigned)}else return t===32?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},e.prototype.shru=function(t){return this.shiftRightUnsigned(t)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(t){return this.subtract(t)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*Ni+(this.low>>>0):this.high*Ni+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var s=e.fromNumber(Math.pow(t,6),this.unsigned),o=this,c="";;){var u=o.div(s),d=o.sub(u.mul(s)).toInt()>>>0,g=d.toString(t);if(o=u,o.isZero())return g+c;for(;g.length<6;)g="0"+g;c=""+g+c}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(t){return this.lessThanOrEqual(t)},e.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var n=e.fromString(t.$numberLong);return r&&r.relaxed?n.toNumber():n},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(I_),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(X.prototype,"__isLong__",{value:!0});Object.defineProperty(X.prototype,"_bsontype",{value:"Long"});var T_=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,C_=/^(\+|-)?(Infinity|inf)$/i,x_=/^(\+|-)?NaN$/i,xo=6111,Yu=-6176,Dd=6176,D_=34,zu=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Rd=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ad=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),R_=/^([-+])?(\d+)?$/,A_=31,Nd=16383,N_=30,O_=31;function Od(e){return!isNaN(parseInt(e,10))}function P_(e){var t=X.fromNumber(1e9),r=X.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new X(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function L_(e,t){if(!e&&!t)return{high:X.fromNumber(0),low:X.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new X(e.getLowBits(),0),i=t.shiftRightUnsigned(32),s=new X(t.getLowBits(),0),o=r.multiply(i),c=r.multiply(s),u=n.multiply(i),d=n.multiply(s);return o=o.add(c.shiftRightUnsigned(32)),c=new X(c.getLowBits(),0).add(u).add(d.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),d=c.shiftLeft(32).add(new X(d.getLowBits(),0)),{high:o,low:d}}function M_(e,t){var r=e.high>>>0,n=t.high>>>0;if(r<n)return!0;if(r===n){var i=e.low>>>0,s=t.low>>>0;if(i<s)return!0}return!1}function Ai(e,t){throw new $e('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Qu=function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ju(t)){if(t.byteLength!==16)throw new $e("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new $e("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var r=!1,n=!1,i=!1,s=0,o=0,c=0,u=0,d=0,g=[0],h=0,m=0,E=0,y=0,_=0,x=0,P=new X(0,0),M=new X(0,0),L=0,k=0;if(t.length>=7e3)throw new $e(""+t+" not a valid Decimal128 string");var G=t.match(T_),ue=t.match(C_),Re=t.match(x_);if(!G&&!ue&&!Re||t.length===0)throw new $e(""+t+" not a valid Decimal128 string");if(G){var B=G[2],Q=G[4],Y=G[5],J=G[6];Q&&J===void 0&&Ai(t,"missing exponent power"),Q&&B===void 0&&Ai(t,"missing exponent base"),Q===void 0&&(Y||J)&&Ai(t,"missing e before exponent")}if((t[k]==="+"||t[k]==="-")&&(r=t[k++]==="-"),!Od(t[k])&&t[k]!=="."){if(t[k]==="i"||t[k]==="I")return new e(Se.from(r?Rd:Ad));if(t[k]==="N")return new e(Se.from(zu))}for(;Od(t[k])||t[k]===".";){if(t[k]==="."){n&&Ai(t,"contains multiple periods"),n=!0,k=k+1;continue}h<34&&(t[k]!=="0"||i)&&(i||(d=o),i=!0,g[m++]=parseInt(t[k],10),h=h+1),i&&(c=c+1),n&&(u=u+1),o=o+1,k=k+1}if(n&&!o)throw new $e(""+t+" not a valid Decimal128 string");if(t[k]==="e"||t[k]==="E"){var de=t.substr(++k).match(R_);if(!de||!de[2])return new e(Se.from(zu));_=parseInt(de[0],10),k=k+de[0].length}if(t[k])return new e(Se.from(zu));if(E=0,!h)E=0,y=0,g[0]=0,c=1,h=1,s=0;else if(y=h-1,s=c,s!==1)for(;g[d+s-1]===0;)s=s-1;for(_<=u&&u-_>16384?_=Yu:_=_-u;_>xo;){if(y=y+1,y-E>D_){var Be=g.join("");if(Be.match(/^0+$/)){_=xo;break}Ai(t,"overflow")}_=_-1}for(;_<Yu||h<c;){if(y===0&&s<h){_=Yu,s=0;break}if(h<c?c=c-1:y=y-1,_<xo)_=_+1;else{var Be=g.join("");if(Be.match(/^0+$/)){_=xo;break}Ai(t,"overflow")}}if(y-E+1<s){var v=o;n&&(d=d+1,v=v+1),r&&(d=d+1,v=v+1);var ut=parseInt(t[d+y+1],10),Ve=0;if(ut>=5&&(Ve=1,ut===5)){for(Ve=g[y]%2===1?1:0,x=d+y+2;x<v;x++)if(parseInt(t[x],10)){Ve=1;break}}if(Ve){for(var ye=y;ye>=0;ye--)if(++g[ye]>9&&(g[ye]=0,ye===0))if(_<xo)_=_+1,g[ye]=1;else return new e(Se.from(r?Rd:Ad))}}if(P=X.fromNumber(0),M=X.fromNumber(0),s===0)P=X.fromNumber(0),M=X.fromNumber(0);else if(y-E<17){var ye=E;for(M=X.fromNumber(g[ye++]),P=new X(0,0);ye<=y;ye++)M=M.multiply(X.fromNumber(10)),M=M.add(X.fromNumber(g[ye]))}else{var ye=E;for(P=X.fromNumber(g[ye++]);ye<=y-17;ye++)P=P.multiply(X.fromNumber(10)),P=P.add(X.fromNumber(g[ye]));for(M=X.fromNumber(g[ye++]);ye<=y;ye++)M=M.multiply(X.fromNumber(10)),M=M.add(X.fromNumber(g[ye]))}var vt=L_(P,X.fromString("100000000000000000"));vt.low=vt.low.add(M),M_(vt.low,M)&&(vt.high=vt.high.add(X.fromNumber(1))),L=_+Dd;var se={low:X.fromNumber(0),high:X.fromNumber(0)};vt.high.shiftRightUnsigned(49).and(X.fromNumber(1)).equals(X.fromNumber(1))?(se.high=se.high.or(X.fromNumber(3).shiftLeft(61)),se.high=se.high.or(X.fromNumber(L).and(X.fromNumber(16383).shiftLeft(47))),se.high=se.high.or(vt.high.and(X.fromNumber(0x7fffffffffff)))):(se.high=se.high.or(X.fromNumber(L&16383).shiftLeft(49)),se.high=se.high.or(vt.high.and(X.fromNumber(562949953421311)))),se.low=vt.low,r&&(se.high=se.high.or(X.fromString("9223372036854775808")));var ie=Se.alloc(16);return k=0,ie[k++]=se.low.low&255,ie[k++]=se.low.low>>8&255,ie[k++]=se.low.low>>16&255,ie[k++]=se.low.low>>24&255,ie[k++]=se.low.high&255,ie[k++]=se.low.high>>8&255,ie[k++]=se.low.high>>16&255,ie[k++]=se.low.high>>24&255,ie[k++]=se.high.low&255,ie[k++]=se.high.low>>8&255,ie[k++]=se.high.low>>16&255,ie[k++]=se.high.low>>24&255,ie[k++]=se.high.high&255,ie[k++]=se.high.high>>8&255,ie[k++]=se.high.high>>16&255,ie[k++]=se.high.high>>24&255,new e(ie)},e.prototype.toString=function(){for(var t,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var s=0,o=!1,c,u={parts:[0,0,0,0]},d,g,h=[];s=0;var m=this.bytes,E=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,y=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,_=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24,x=m[s++]|m[s++]<<8|m[s++]<<16|m[s++]<<24;s=0;var P={low:new X(E,y),high:new X(_,x)};P.high.lessThan(X.ZERO)&&h.push("-");var M=x>>26&A_;if(M>>3===3){if(M===N_)return h.join("")+"Infinity";if(M===O_)return"NaN";t=x>>15&Nd,c=8+(x>>14&1)}else c=x>>14&7,t=x>>17&Nd;var L=t-Dd;if(u.parts[0]=(x&16383)+((c&15)<<14),u.parts[1]=_,u.parts[2]=y,u.parts[3]=E,u.parts[0]===0&&u.parts[1]===0&&u.parts[2]===0&&u.parts[3]===0)o=!0;else for(g=3;g>=0;g--){var k=0,G=P_(u);if(u=G.quotient,k=G.rem.low,!!k)for(d=8;d>=0;d--)n[g*9+d]=k%10,k=Math.floor(k/10)}if(o)r=1,n[s]=0;else for(r=36;!n[s];)r=r-1,s=s+1;var ue=r-1+L;if(ue>=34||ue<=-7||L>0){if(r>34)return h.push("".concat(0)),L>0?h.push("E+".concat(L)):L<0&&h.push("E".concat(L)),h.join("");h.push("".concat(n[s++])),r=r-1,r&&h.push(".");for(var i=0;i<r;i++)h.push("".concat(n[s++]));h.push("E"),ue>0?h.push("+".concat(ue)):h.push("".concat(ue))}else if(L>=0)for(var i=0;i<r;i++)h.push("".concat(n[s++]));else{var Re=r+L;if(Re>0)for(var i=0;i<Re;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");Re++<0;)h.push("0");for(var i=0;i<r-Math.max(Re-1,0);i++)h.push("".concat(n[s++]))}return h.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e}();Object.defineProperty(Qu.prototype,"_bsontype",{value:"Decimal128"});var Pa=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var n=parseFloat(t.$numberDouble);return r&&r.relaxed?n:new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},e}();Object.defineProperty(Pa.prototype,"_bsontype",{value:"Double"});var La=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty(La.prototype,"_bsontype",{value:"Int32"});var Zu=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(Zu.prototype,"_bsontype",{value:"MaxKey"});var ep=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(ep.prototype,"_bsontype",{value:"MinKey"});var k_=new RegExp("^[0-9a-fA-F]{24}$"),Dn=null,br=Symbol("id"),et=function(){function e(t){if(!(this instanceof e))return new e(t);var r;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new $e("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=Se.from(t.toHexString(),"hex"):r=t.id}else r=t;if(r==null||typeof r=="number")this[br]=e.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[br]=r instanceof Se?r:Da(r);else if(typeof r=="string")if(r.length===12){var n=Se.from(r);if(n.byteLength===12)this[br]=n;else throw new $e("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&k_.test(r))this[br]=Se.from(r,"hex");else throw new $e("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new $e("Argument passed in does not match the accepted types");e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[br]},set:function(t){this[br]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){typeof t!="number"&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),n=Se.alloc(12);return n.writeUInt32BE(t,0),Dn===null&&(Dn=Fd(5)),n[4]=Dn[0],n[5]=Dn[1],n[6]=Dn[2],n[7]=Dn[3],n[8]=Dn[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},e.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(t==null)return!1;if(t instanceof e)return this[br][11]===t[br][11]&&this[br].equals(t[br]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&Ju(this.id))return t===Se.prototype.toString.call(this.id,"latin1");if(typeof t=="string"&&e.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t=="string"&&e.isValid(t)&&t.length===12)return Se.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var r=t.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},e.prototype.getTimestamp=function(){var t=new Date,r=this.id.readUInt32BE(0);return t.setTime(Math.floor(r)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var r=Se.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new $e("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(Se.from(t,"hex"))},e.isValid=function(t){if(t==null)return!1;try{return new e(t),!0}catch{return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(Math.random()*16777215),e}();Object.defineProperty(et.prototype,"generate",{value:Na(function(e){return et.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(et.prototype,"getInc",{value:Na(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"get_inc",{value:Na(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et,"get_inc",{value:Na(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"_bsontype",{value:"ObjectID"});function B_(e){return e.split("").sort().join("")}var Ro=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=B_(r??""),this.pattern.indexOf("\0")!==-1)throw new Rn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new Rn("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new Rn("The regular expression option [".concat(this.options[n],"] is not supported"))}return e.parseOptions=function(t){return t?t.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t)if(typeof t.$regex!="string"){if(t.$regex._bsontype==="BSONRegExp")return t}else return new e(t.$regex,e.parseOptions(t.$options));if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new $e("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Ro.prototype,"_bsontype",{value:"BSONRegExp"});var tp=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(tp.prototype,"_bsontype",{value:"Symbol"});var U_=X,Vd=function(e){Aa(t,e);function t(r,n){var i=this;return i instanceof t?(X.isLong(r)?i=e.call(this,r.low,r.high,!0)||this:Ao(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=e.call(this,r.i,r.t,!0)||this:i=e.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new t(r,n)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(r){return new t(X.fromInt(r,!0))},t.fromNumber=function(r){return new t(X.fromNumber(r,!0))},t.fromBits=function(r,n){return new t(r,n)},t.fromString=function(r,n){return new t(X.fromString(r,!0,n))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(r){return new t(r.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=X.MAX_UNSIGNED_VALUE,t}(U_);function F_(e){return Ao(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var Wd=2147483647,Gd=-2147483648,Yd=9223372036854776e3,zd=-9223372036854776e3,H_={$oid:et,$binary:An,$uuid:An,$symbol:tp,$numberInt:La,$numberDecimal:Qu,$numberDouble:Pa,$numberLong:X,$minKey:ep,$maxKey:Zu,$regex:Ro,$regularExpression:Ro,$timestamp:Vd};function qd(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Gd&&e<=Wd)return new La(e);if(e>=zd&&e<=Yd)return X.fromNumber(e)}return new Pa(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter(function(h){return h.startsWith("$")&&e[h]!=null}),n=0;n<r.length;n++){var i=H_[r[n]];if(i)return i.fromExtendedJSON(e,t)}if(e.$date!=null){var s=e.$date,o=new Date;return t.legacy?typeof s=="number"?o.setTime(s):typeof s=="string"&&o.setTime(Date.parse(s)):typeof s=="string"?o.setTime(Date.parse(s)):X.isLong(s)?o.setTime(s.toNumber()):typeof s=="number"&&t.relaxed&&o.setTime(s),o}if(e.$code!=null){var c=Object.assign({},e);return e.$scope&&(c.$scope=qd(e.$scope)),Oa.fromExtendedJSON(e)}if(w_(e)||e.$dbPointer){var u=e.$ref?e:e.$dbPointer;if(u instanceof Do)return u;var d=Object.keys(u).filter(function(h){return h.startsWith("$")}),g=!0;if(d.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(g=!1)}),g)return Do.fromExtendedJSON(u)}return e}function $_(e,t){return e.map(function(r,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Qr(r,t)}finally{t.seenObjects.pop()}})}function Pd(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Qr(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var r=t.seenObjects.findIndex(function(P){return P.obj===e});if(r!==-1){var n=t.seenObjects.map(function(P){return P.propertyName}),i=n.slice(0,r).map(function(P){return"".concat(P," -> ")}).join(""),s=n[r],o=" -> "+n.slice(r+1,n.length-1).map(function(P){return"".concat(P," -> ")}).join(""),c=n[n.length-1],u=" ".repeat(i.length+s.length/2),d="-".repeat(o.length+(s.length+c.length)/2-1);throw new $e(`Converting circular structure to EJSON:
35
35
  `+" ".concat(i).concat(s).concat(o).concat(c,`
36
- `)+" ".concat(u,"\\").concat(d,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return __(e,t);if(e===void 0)return null;if(e instanceof Date||QE(e)){var g=e.getTime(),h=g>-1&&g<2534023188e5;return t.legacy?t.relaxed&&h?{$date:e.getTime()}:{$date:md(e)}:t.relaxed&&h?{$date:md(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var m=e>=Td&&e<=Id,E=e>=xd&&e<=Cd;if(m)return{$numberInt:e.toString()};if(E)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||JE(e)){var v=e.flags;if(v===void 0){var _=e.toString().match(/[gimuy]*$/);_&&(v=_[0])}var D=new Io(e.source,v);return D.toExtendedJSON(t)}return e!=null&&typeof e=="object"?b_(e,t):e}var S_={Binary:function(e){return new Dn(e.value(),e.sub_type)},Code:function(e){return new wa(e.code,e.scope)},DBRef:function(e){return new wo(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new $u(e.bytes)},Double:function(e){return new Ia(e.value)},Int32:function(e){return new Ta(e.value)},Long:function(e){return X.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_)},MaxKey:function(){return new ju},MinKey:function(){return new Vu},ObjectID:function(e){return new rt(e)},ObjectId:function(e){return new rt(e)},BSONRegExp:function(e){return new Io(e.pattern,e.options)},Symbol:function(e){return new Wu(e.value)},Timestamp:function(e){return wd.fromBits(e.low,e.high)}};function b_(e,t){if(e==null||typeof e!="object")throw new xn("not an object instance");var r=e._bsontype;if(typeof r>"u"){var n={};for(var i in e){t.seenObjects.push({propertyName:i,obj:null});try{var s=Qr(e[i],t);i==="__proto__"?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}finally{t.seenObjects.pop()}}return n}else if(v_(e)){var o=e;if(typeof o.toExtendedJSON!="function"){var c=S_[e._bsontype];if(!c)throw new Ve("Unrecognized or invalid _bsontype: "+e._bsontype);o=c(o)}return r==="Code"&&o.scope?o=new wa(o.code,Qr(o.scope,t)):r==="DBRef"&&o.oid&&(o=new wo(Qr(o.collection,t),Qr(o.oid,t),Qr(o.db,t),Qr(o.fields,t))),o.toExtendedJSON(t)}else throw new xn("_bsontype must be a string, but was: "+typeof r)}var dd;(function(e){function t(s,o){var c=Object.assign({},{relaxed:!0,legacy:!1},o);return typeof c.relaxed=="boolean"&&(c.strict=!c.relaxed),typeof c.strict=="boolean"&&(c.relaxed=!c.strict),JSON.parse(s,function(u,d){if(u.indexOf("\0")!==-1)throw new xn("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(u)));return Dd(d,c)})}e.parse=t;function r(s,o,c,u){c!=null&&typeof c=="object"&&(u=c,c=0),o!=null&&typeof o=="object"&&!Array.isArray(o)&&(u=o,o=void 0,c=0);var d=Object.assign({relaxed:!0,legacy:!1},u,{seenObjects:[{propertyName:"(root)",obj:null}]}),g=Qr(s,d);return JSON.stringify(g,o,c)}e.stringify=r;function n(s,o){return o=o||{},JSON.parse(r(s,o))}e.serialize=n;function i(s,o){return o=o||{},t(JSON.stringify(s),o)}e.deserialize=i})(dd||(dd={}));var hd,gd=vd();gd.Map?hd=gd.Map:hd=function(){function e(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var r=0;r<t.length;r++)if(t[r]!=null){var n=t[r],i=n[0],s=n[1];this._keys.push(i),this._values[i]={v:s,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(t){var r=this._values[t];return r==null?!1:(delete this._values[t],this._keys.splice(r.i,1),!0)},e.prototype.entries=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?[n,t._values[n].v]:void 0,done:n===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];t.call(r,this._values[i].v,i,r)}},e.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},e.prototype.has=function(t){return this._values[t]!=null},e.prototype.keys=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},e.prototype.set=function(t,r){return this._values[t]?(this._values[t].v=r,this):(this._keys.push(t),this._values[t]={v:r,i:this._keys.length-1},this)},e.prototype.values=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?t._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e}();var QO=X.fromNumber(e_),ZO=X.fromNumber(t_),Bu=new Uint8Array(8),eP=new DataView(Bu.buffer,Bu.byteOffset,Bu.byteLength),w_=1024*1024*17,tP=be.alloc(w_),Zr=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}},Ee=class{constructor(e,t={},r,n){this.name=e,this.properties=t,this.id=n?new rt(n):new rt,this.occurred=new Date,r&&(this.trigger=new Zr(r)),this.newEvent=!n}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale},ct=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,t){if(!e)return;let r=document.createElement("script");r.id=t??"",r.src=e,mt.mode==="local"&&(r.type="module"),document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let t=document.createElement("script");t.id="cooee-app-script",t.innerHTML=e,document.head.appendChild(t)}static injectRawCSS(e,t=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,t.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,t=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=n=>{let i=n.currentTarget?.sheet?.cssRules;if(i){for(let s of i)if(s.type==CSSRule.FONT_FACE_RULE){let o=e.split("/"),c=o.slice(0,o.length-1).join("/"),u=s.cssText;u=u.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${c}/$4")`);let d=document.createElement("style");d.appendChild(document.createTextNode(u)),document.head.appendChild(d)}}}),t.appendChild(r)}static loadSwiperScript(){let e="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js";return new Promise(t=>{if(window.Swiper){t();return}if(Array.from(document.scripts).some(n=>n.src.includes(e))){let n=setInterval(()=>{window.Swiper&&(clearInterval(n),t())},50)}let r=document.createElement("script");r.src=e,r.onload=()=>{t()},r.onerror=()=>{r.remove()},document.body.appendChild(r)})}},se=class{static storage=new Map;static get(e){return this.storage.has(e)||this.storage.set(e,e.getInstance()),this.storage.get(e)}};function le(e){return typeof e=="function"}function Ca(e){let t=e(r=>{Error.call(r),r.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var xa=Ca(e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:
36
+ `)+" ".concat(u,"\\").concat(d,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return $_(e,t);if(e===void 0)return null;if(e instanceof Date||E_(e)){var g=e.getTime(),h=g>-1&&g<2534023188e5;return t.legacy?t.relaxed&&h?{$date:e.getTime()}:{$date:Pd(e)}:t.relaxed&&h?{$date:Pd(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var m=e>=Gd&&e<=Wd,E=e>=zd&&e<=Yd;if(m)return{$numberInt:e.toString()};if(E)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||v_(e)){var y=e.flags;if(y===void 0){var _=e.toString().match(/[gimuy]*$/);_&&(y=_[0])}var x=new Ro(e.source,y);return x.toExtendedJSON(t)}return e!=null&&typeof e=="object"?V_(e,t):e}var j_={Binary:function(e){return new An(e.value(),e.sub_type)},Code:function(e){return new Oa(e.code,e.scope)},DBRef:function(e){return new Do(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Qu(e.bytes)},Double:function(e){return new Pa(e.value)},Int32:function(e){return new La(e.value)},Long:function(e){return X.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_)},MaxKey:function(){return new Zu},MinKey:function(){return new ep},ObjectID:function(e){return new et(e)},ObjectId:function(e){return new et(e)},BSONRegExp:function(e){return new Ro(e.pattern,e.options)},Symbol:function(e){return new tp(e.value)},Timestamp:function(e){return Vd.fromBits(e.low,e.high)}};function V_(e,t){if(e==null||typeof e!="object")throw new Rn("not an object instance");var r=e._bsontype;if(typeof r>"u"){var n={};for(var i in e){t.seenObjects.push({propertyName:i,obj:null});try{var s=Qr(e[i],t);i==="__proto__"?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}finally{t.seenObjects.pop()}}return n}else if(F_(e)){var o=e;if(typeof o.toExtendedJSON!="function"){var c=j_[e._bsontype];if(!c)throw new $e("Unrecognized or invalid _bsontype: "+e._bsontype);o=c(o)}return r==="Code"&&o.scope?o=new Oa(o.code,Qr(o.scope,t)):r==="DBRef"&&o.oid&&(o=new Do(Qr(o.collection,t),Qr(o.oid,t),Qr(o.db,t),Qr(o.fields,t))),o.toExtendedJSON(t)}else throw new Rn("_bsontype must be a string, but was: "+typeof r)}var Ld;(function(e){function t(s,o){var c=Object.assign({},{relaxed:!0,legacy:!1},o);return typeof c.relaxed=="boolean"&&(c.strict=!c.relaxed),typeof c.strict=="boolean"&&(c.relaxed=!c.strict),JSON.parse(s,function(u,d){if(u.indexOf("\0")!==-1)throw new Rn("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(u)));return qd(d,c)})}e.parse=t;function r(s,o,c,u){c!=null&&typeof c=="object"&&(u=c,c=0),o!=null&&typeof o=="object"&&!Array.isArray(o)&&(u=o,o=void 0,c=0);var d=Object.assign({relaxed:!0,legacy:!1},u,{seenObjects:[{propertyName:"(root)",obj:null}]}),g=Qr(s,d);return JSON.stringify(g,o,c)}e.stringify=r;function n(s,o){return o=o||{},JSON.parse(r(s,o))}e.serialize=n;function i(s,o){return o=o||{},t(JSON.stringify(s),o)}e.deserialize=i})(Ld||(Ld={}));var Md,kd=Ud();kd.Map?Md=kd.Map:Md=function(){function e(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var r=0;r<t.length;r++)if(t[r]!=null){var n=t[r],i=n[0],s=n[1];this._keys.push(i),this._values[i]={v:s,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(t){var r=this._values[t];return r==null?!1:(delete this._values[t],this._keys.splice(r.i,1),!0)},e.prototype.entries=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?[n,t._values[n].v]:void 0,done:n===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];t.call(r,this._values[i].v,i,r)}},e.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},e.prototype.has=function(t){return this._values[t]!=null},e.prototype.keys=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},e.prototype.set=function(t,r){return this._values[t]?(this._values[t].v=r,this):(this._keys.push(t),this._values[t]={v:r,i:this._keys.length-1},this)},e.prototype.values=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?t._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e}();var EP=X.fromNumber(S_),_P=X.fromNumber(b_),qu=new Uint8Array(8),SP=new DataView(qu.buffer,qu.byteOffset,qu.byteLength),W_=1024*1024*17,bP=Se.alloc(W_),Zr=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}},ve=class{constructor(e,t={},r,n){this.name=e,this.properties=t,this.id=n?new et(n):new et,this.occurred=new Date,r&&(this.trigger=new Zr(r)),this.newEvent=!n}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale},st=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,t){if(!e)return;let r=document.createElement("script");r.id=t??"",r.src=e,pt.mode==="local"&&(r.type="module"),document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let t=document.createElement("script");t.id="cooee-app-script",t.innerHTML=e,document.head.appendChild(t)}static injectRawCSS(e,t=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,t.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,t=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=n=>{let i=n.currentTarget?.sheet?.cssRules;if(i){for(let s of i)if(s.type==CSSRule.FONT_FACE_RULE){let o=e.split("/"),c=o.slice(0,o.length-1).join("/"),u=s.cssText;u=u.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${c}/$4")`);let d=document.createElement("style");d.appendChild(document.createTextNode(u)),document.head.appendChild(d)}}}),t.appendChild(r)}static loadSwiperScript(){let e="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js";return new Promise(t=>{if(window.Swiper){t();return}if(Array.from(document.scripts).some(n=>n.src.includes(e))){let n=setInterval(()=>{window.Swiper&&(clearInterval(n),t())},50)}let r=document.createElement("script");r.src=e,r.onload=()=>{t()},r.onerror=()=>{r.remove()},document.body.appendChild(r)})}},re=class{static storage=new Map;static get(e){return this.storage.has(e)||this.storage.set(e,e.getInstance()),this.storage.get(e)}};function ce(e){return typeof e=="function"}function Ma(e){let t=e(r=>{Error.call(r),r.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ka=Ma(e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:
37
37
  ${t.map((r,n)=>`${n+1}) ${r.toString()}`).join(`
38
- `)}`:"",this.name="UnsubscriptionError",this.errors=t});function Rn(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Kt=class Rc{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let s of r)s.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(le(n))try{n()}catch(s){t=s instanceof xa?s.errors:[s]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let s of i)try{Rd(s)}catch(o){t=t??[],o instanceof xa?t=[...t,...o.errors]:t.push(o)}}if(t)throw new xa(t)}}add(t){var r;if(t&&t!==this)if(this.closed)Rd(t);else{if(t instanceof Rc){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Rn(r,t)}remove(t){let{_finalizers:r}=this;r&&Rn(r,t),t instanceof Rc&&t._removeParent(this)}};Kt.EMPTY=(()=>{let e=new Kt;return e.closed=!0,e})();var Gu=Kt.EMPTY;function Da(e){return e instanceof Kt||e&&"closed"in e&&le(e.remove)&&le(e.add)&&le(e.unsubscribe)}function Rd(e){le(e)?e():e.unsubscribe()}var sr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},xi={setTimeout(e,t,...r){let{delegate:n}=xi;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=xi;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ra(e){xi.setTimeout(()=>{let{onUnhandledError:t}=sr;if(t)t(e);else throw e})}function Yu(){}var Ad=zu("C",void 0,void 0);function Nd(e){return zu("E",void 0,e)}function Od(e){return zu("N",e,void 0)}function zu(e,t,r){return{kind:e,value:t,error:r}}var An=null;function Di(e){if(sr.useDeprecatedSynchronousErrorHandling){let t=!An;if(t&&(An={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=An;if(An=null,r)throw n}}else e()}function Pd(e){sr.useDeprecatedSynchronousErrorHandling&&An&&(An.errorThrown=!0,An.error=e)}var Nn=class extends Kt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Da(e)&&e.add(this)):this.destination=C_}static create(e,t,r){return new Ri(e,t,r)}next(e){this.isStopped?Ku(Od(e),this):this._next(e)}error(e){this.isStopped?Ku(Nd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Ku(Ad,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},I_=Function.prototype.bind;function qu(e,t){return I_.call(e,t)}var Xu=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){Aa(r)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){Aa(r)}else Aa(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Aa(t)}}},Ri=class extends Nn{constructor(e,t,r){super();let n;if(le(e)||!e)n={next:e??void 0,error:t??void 0,complete:r??void 0};else{let i;this&&sr.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),n={next:e.next&&qu(e.next,i),error:e.error&&qu(e.error,i),complete:e.complete&&qu(e.complete,i)}):n=e}this.destination=new Xu(n)}};function Aa(e){sr.useDeprecatedSynchronousErrorHandling?Pd(e):Ra(e)}function T_(e){throw e}function Ku(e,t){let{onStoppedNotification:r}=sr;r&&xi.setTimeout(()=>r(e,t))}var C_={closed:!0,next:Yu,error:T_,complete:Yu},Ai=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Na(e){return e}function Ld(e){return e.length===0?Na:e.length===1?e[0]:function(t){return e.reduce((r,n)=>n(r),t)}}var lt=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,i){let s=D_(r)?r:new Ri(r,n,i);return Di(()=>{let{operator:o,source:c}=this;s.add(o?o.call(s,c):c?this._subscribe(s):this._trySubscribe(s))}),s}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=Md(n),new n((i,s)=>{let o=new Ri({next:c=>{try{r(c)}catch(u){s(u),o.unsubscribe()}},error:s,complete:i});this.subscribe(o)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[Ai](){return this}pipe(...r){return Ld(r)(this)}toPromise(r){return r=Md(r),new r((n,i)=>{let s;this.subscribe(o=>s=o,o=>i(o),()=>n(s))})}}return e.create=t=>new e(t),e})();function Md(e){var t;return(t=e??sr.Promise)!==null&&t!==void 0?t:Promise}function x_(e){return e&&le(e.next)&&le(e.error)&&le(e.complete)}function D_(e){return e&&e instanceof Nn||x_(e)&&Da(e)}function R_(e){return le(e?.lift)}function Xt(e){return t=>{if(R_(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Br(e,t,r,n,i){return new Ju(e,t,r,n,i)}var Ju=class extends Nn{constructor(e,t,r,n,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=t?function(o){try{t(o)}catch(c){e.error(c)}}:super._next,this._error=n?function(o){try{n(o)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(o){e.error(o)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}},kd=Ca(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}),Rt=(()=>{class e extends lt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new Oa(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new kd}next(r){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:i,observers:s}=this;return n||i?Gu:(this.currentObservers=null,s.push(r),new Kt(()=>{this.currentObservers=null,Rn(s,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:i,isStopped:s}=this;n?r.error(i):s&&r.complete()}asObservable(){let r=new lt;return r.source=this,r}}return e.create=(t,r)=>new Oa(t,r),e})(),Oa=class extends Rt{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.next)===null||r===void 0||r.call(t,e)}error(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.error)===null||r===void 0||r.call(t,e)}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e)}_subscribe(e){var t,r;return(r=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&r!==void 0?r:Gu}},Co=class extends Rt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}},xo={now(){return(xo.delegate||Date).now()},delegate:void 0},Do=class extends Rt{constructor(e=1/0,t=1/0,r=xo){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){let{isStopped:t,_buffer:r,_infiniteTimeWindow:n,_timestampProvider:i,_windowTime:s}=this;t||(r.push(e),!n&&r.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:n}=this,i=n.slice();for(let s=0;s<i.length&&!e.closed;s+=r?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:r,_infiniteTimeWindow:n}=this,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){let s=t.now(),o=0;for(let c=1;c<r.length&&r[c]<=s;c+=2)o=c;o&&r.splice(0,o+1)}}},Pa=class extends Kt{constructor(e,t){super()}schedule(e,t=0){return this}},Ro={setInterval(e,t,...r){let{delegate:n}=Ro;return n?.setInterval?n.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){let{delegate:t}=Ro;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},La=class extends Pa{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var r;if(this.closed)return this;this.state=e;let n=this.id,i=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,r=0){return Ro.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return t;t!=null&&Ro.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,t);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r=!1,n;try{this.work(e)}catch(i){r=!0,n=i||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Rn(r,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}},Ni=class Bh{constructor(t,r=Bh.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,n){return new this.schedulerActionCtor(this,t).schedule(n,r)}};Ni.now=xo.now;var Ma=class extends Ni{constructor(e,t=Ni.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},Bd=new Ma(La);function Ud(e){return e&&le(e.schedule)}function A_(e){return e[e.length-1]}function ka(e){return Ud(A_(e))?e.pop():void 0}function Hd(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function c(g){try{d(n.next(g))}catch(h){o(h)}}function u(g){try{d(n.throw(g))}catch(h){o(h)}}function d(g){g.done?s(g.value):i(g.value).then(c,u)}d((n=n.apply(e,t||[])).next())})}function Fd(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function On(e){return this instanceof On?(this.v=e,this):new On(e)}function $d(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(E){return function(v){return Promise.resolve(v).then(E,h)}}function c(E,v){n[E]&&(i[E]=function(_){return new Promise(function(D,P){s.push([E,_,D,P])>1||u(E,_)})},v&&(i[E]=v(i[E])))}function u(E,v){try{d(n[E](v))}catch(_){m(s[0][3],_)}}function d(E){E.value instanceof On?Promise.resolve(E.value.v).then(g,h):m(s[0][2],E)}function g(E){u("next",E)}function h(E){u("throw",E)}function m(E,v){E(v),s.shift(),s.length&&u(s[0][0],s[0][1])}}function jd(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Fd=="function"?Fd(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(c,u){o=e[s](o),i(c,u,o.done,o.value)})}}function i(s,o,c,u){Promise.resolve(u).then(function(d){s({value:d,done:c})},o)}}var Oi=e=>e&&typeof e.length=="number"&&typeof e!="function";function Ba(e){return le(e?.then)}function Ua(e){return le(e[Ai])}function Fa(e){return Symbol.asyncIterator&&le(e?.[Symbol.asyncIterator])}function Ha(e){return new TypeError(`You provided ${e!==null&&typeof e=="object"?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function N_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var $a=N_();function ja(e){return le(e?.[$a])}function Va(e){return $d(this,arguments,function*(){let t=e.getReader();try{for(;;){let{value:r,done:n}=yield On(t.read());if(n)return yield On(void 0);yield yield On(r)}}finally{t.releaseLock()}})}function Wa(e){return le(e?.getReader)}function Jt(e){if(e instanceof lt)return e;if(e!=null){if(Ua(e))return O_(e);if(Oi(e))return P_(e);if(Ba(e))return L_(e);if(Fa(e))return Vd(e);if(ja(e))return M_(e);if(Wa(e))return k_(e)}throw Ha(e)}function O_(e){return new lt(t=>{let r=e[Ai]();if(le(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function P_(e){return new lt(t=>{for(let r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function L_(e){return new lt(t=>{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,Ra)})}function M_(e){return new lt(t=>{for(let r of e)if(t.next(r),t.closed)return;t.complete()})}function Vd(e){return new lt(t=>{B_(e,t).catch(r=>t.error(r))})}function k_(e){return Vd(Va(e))}function B_(e,t){var r,n,i,s;return Hd(this,void 0,void 0,function*(){try{for(r=jd(e);n=yield r.next(),!n.done;){let o=n.value;if(t.next(o),t.closed)return}}catch(o){i={error:o}}finally{try{n&&!n.done&&(s=r.return)&&(yield s.call(r))}finally{if(i)throw i.error}}t.complete()})}function Qt(e,t,r,n=0,i=!1){let s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}function Ga(e,t=0){return Xt((r,n)=>{r.subscribe(Br(n,i=>Qt(n,e,()=>n.next(i),t),()=>Qt(n,e,()=>n.complete(),t),i=>Qt(n,e,()=>n.error(i),t)))})}function Ya(e,t=0){return Xt((r,n)=>{n.add(e.schedule(()=>r.subscribe(n),t))})}function Wd(e,t){return Jt(e).pipe(Ya(t),Ga(t))}function Gd(e,t){return Jt(e).pipe(Ya(t),Ga(t))}function Yd(e,t){return new lt(r=>{let n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function zd(e,t){return new lt(r=>{let n;return Qt(r,t,()=>{n=e[$a](),Qt(r,t,()=>{let i,s;try{({value:i,done:s}=n.next())}catch(o){r.error(o);return}s?r.complete():r.next(i)},0,!0)}),()=>le(n?.return)&&n.return()})}function za(e,t){if(!e)throw new Error("Iterable cannot be null");return new lt(r=>{Qt(r,t,()=>{let n=e[Symbol.asyncIterator]();Qt(r,t,()=>{n.next().then(i=>{i.done?r.complete():r.next(i.value)})},0,!0)})})}function qd(e,t){return za(Va(e),t)}function Kd(e,t){if(e!=null){if(Ua(e))return Wd(e,t);if(Oi(e))return Yd(e,t);if(Ba(e))return Gd(e,t);if(Fa(e))return za(e,t);if(ja(e))return zd(e,t);if(Wa(e))return qd(e,t)}throw Ha(e)}function Xd(e,t){return t?Kd(e,t):Jt(e)}function Pn(e,t){return Xt((r,n)=>{let i=0;r.subscribe(Br(n,s=>{n.next(e.call(t,s,i++))}))})}var{isArray:U_}=Array;function F_(e,t){return U_(t)?e(...t):e(t)}function Jd(e){return Pn(t=>F_(e,t))}function Qd(e,t,r,n,i,s,o,c){let u=[],d=0,g=0,h=!1,m=()=>{h&&!u.length&&!d&&t.complete()},E=_=>d<n?v(_):u.push(_),v=_=>{s&&t.next(_),d++;let D=!1;Jt(r(_,g++)).subscribe(Br(t,P=>{i?.(P),s?E(P):t.next(P)},()=>{D=!0},void 0,()=>{if(D)try{for(d--;u.length&&d<n;){let P=u.shift();o?Qt(t,o,()=>v(P)):v(P)}m()}catch(P){t.error(P)}}))};return e.subscribe(Br(t,E,()=>{h=!0,m()})),()=>{c?.()}}function Ao(e,t,r=1/0){return le(t)?Ao((n,i)=>Pn((s,o)=>t(n,s,i,o))(Jt(e(n,i))),r):(typeof t=="number"&&(r=t),Xt((n,i)=>Qd(n,i,e,r)))}function Zd(e=1/0){return Ao(Na,e)}function eh(){return Zd(1)}function Qu(...e){return eh()(Xd(e,ka(e)))}var H_=["addListener","removeListener"],$_=["addEventListener","removeEventListener"],j_=["on","off"];function Ln(e,t,r,n){if(le(r)&&(n=r,r=void 0),n)return Ln(e,t,r).pipe(Jd(n));let[i,s]=G_(e)?$_.map(o=>c=>e[o](t,c,r)):V_(e)?H_.map(th(e,t)):W_(e)?j_.map(th(e,t)):[];if(!i&&Oi(e))return Ao(o=>Ln(o,t,r))(Jt(e));if(!i)throw new TypeError("Invalid event target");return new lt(o=>{let c=(...u)=>o.next(1<u.length?u:u[0]);return i(c),()=>s(c)})}function th(e,t){return r=>n=>e[r](t,n)}function V_(e){return le(e.addListener)&&le(e.removeListener)}function W_(e){return le(e.on)&&le(e.off)}function G_(e){return le(e.addEventListener)&&le(e.removeEventListener)}function ar(e,t=Bd){return Xt((r,n)=>{let i=null,s=null,o=null,c=()=>{if(i){i.unsubscribe(),i=null;let d=s;s=null,n.next(d)}};function u(){let d=o+e,g=t.now();if(g<d){i=this.schedule(void 0,d-g),n.add(i);return}c()}r.subscribe(Br(n,d=>{s=d,o=t.now(),i||(i=t.schedule(u,e),n.add(i))},()=>{c(),n.complete()},void 0,()=>{s=i=null}))})}function Zu(...e){let t=ka(e);return Xt((r,n)=>{(t?Qu(e,r,t):Qu(e,r)).subscribe(n)})}var rh=Se(ep()),No=class{static UTM_PARAMS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"];static TW_PARAMS={utm_source:"tw_source",utm_campaign:"tw_campaign"};static getReferrer(){if(document.referrer)return document.referrer.replace(location.origin,"")}static getUTMParams(){let e;try{e=new rh.URLBuilder(location.href)}catch{return{}}let t={};this.UTM_PARAMS.forEach(n=>{let i=e.getQueryParam(n);i&&(t[n]=i)});let r={};return Object.keys(this.TW_PARAMS).forEach(n=>{let i=e.getQueryParam(this.TW_PARAMS[n]);i&&(r[n]=i)}),b(b({},r),t)}},Tr=class $h{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(t){this.name=t.name,this.path=t.path,this.qs=t.qs,this.referrer=t.referrer,this.utmSource=t.utmSource||t.utm_source,this.utmMedium=t.utmMedium||t.utm_medium,this.utmCampaign=t.utmCampaign||t.utm_campaign,this.utmId=t.utmId||t.utm_id,this.utmTerm=t.utmTerm||t.utm_term,this.utmContent=t.utmContent||t.utm_content}static parseFromCurrent(){let t=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new $h(b({origin:location.origin,path:t,qs:location.search,referrer:No.getReferrer(),name:ue.get().pageName},No.getUTMParams()))}},z_=" daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|adscanner/|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|cookiehubscan|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firephp|functionize|gomezagent|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|jsjcw_scanner|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scanner\\.|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|zgrab",q_=/bot|crawl|http|lighthouse|scan|search|spider/i,Oo;function K_(){if(Oo instanceof RegExp)return Oo;try{Oo=new RegExp(z_,"i")}catch{Oo=q_}return Oo}function nh(e){return!!e&&K_().test(e)}var tp={d:(e,t)=>{for(var r in t)tp.o(t,r)&&!tp.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},rp={};tp.d(rp,{A:()=>Q_,k:()=>np});var X_=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(d){try{u(n.next(d))}catch(g){s(g)}}function c(d){try{u(n.throw(d))}catch(g){s(g)}}function u(d){var g;d.done?i(d.value):(g=d.value,g instanceof r?g:new r(function(h){h(g)})).then(o,c)}u((n=n.apply(e,t||[])).next())})},J_=function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(d){return function(g){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,g[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&g[0]?n.return:g[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,g[1])).done)return i;switch(n=0,i&&(g=[2&g[0],i.value]),g[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,n=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||g[0]!==6&&g[0]!==2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]<i[3])){o.label=g[1];break}if(g[0]===6&&o.label<i[1]){o.label=i[1],i=g;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(g);break}i[2]&&o.ops.pop(),o.trys.pop();continue}g=t.call(e,o)}catch(h){g=[6,h],n=0}finally{r=i=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([u,d])}}};function np(){return X_(this,void 0,Promise,function(){return J_(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback(e){resolve({isPrivate:e,browserName})}function identifyChromium(){var e=navigator.userAgent;return e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.match(/Edg/)?"Edge":e.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString(e){return e===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch(e){toFixedEngineID=e.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var e=String(Math.random());try{window.indexedDB.open(e,1).onupgradeneeded=function(t){var r,n,i=(r=t.target)===null||r===void 0?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(o){var s=o;return o instanceof Error&&(s=(n=o.message)!==null&&n!==void 0?n:o),typeof s!="string"?void __callback(!1):void __callback(s.includes("BlobURLs are not yet supported"))}finally{i.close(),window.indexedDB.deleteDatabase(e)}}}catch{__callback(!1)}}function oldSafariTest(){var e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return void __callback(!0)}try{t.setItem("test","1"),t.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var e=window;return e.performance!==void 0&&e.performance.memory!==void 0&&e.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(e,t){__callback(Math.round(t/1048576)<2*Math.round(getQuotaLimit()/1048576))},function(e){reject(new Error("detectIncognito somehow failed to query storage quota: "+e.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=np);var Q_=np,ih=rp.A,ek=rp.k,fh=Se(an()),Ka=class{parser;result={};constructor(){this.parser=Mt.get().getUAParser()}async get(){let e=this.result;return this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),await this.getBatteryInfo(),await this.getLocation(),e.locale=navigator.language,e.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},e.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},e.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},e.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},e.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},e.navigatorUA=navigator.userAgent,e.isHeadless=navigator.webdriver,e}getDeviceMemory(){let e=navigator;if(!e.deviceMemory)return;let t=e.deviceMemory;this.result.mem={tot:t*1024}}getNetworkType(){let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(this.result.net={type:t.effectiveType})}getOrientation(){let e=screen.orientation?.type;e&&(this.result.orientation=e)}getDPI(){if(!document.body)return;let e=document.createElement("div");e.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(e);let t=window.devicePixelRatio||1,r=e.offsetWidth*t;return document.body.removeChild(e),r}async getLocation(){if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(e=>{navigator.geolocation.getCurrentPosition(t=>{this.result.coords=[t.coords.latitude,t.coords.longitude],e()},()=>e())})}async getBatteryInfo(){if("getBattery"in navigator)try{let e=await navigator.getBattery();this.result.bat={l:e.level*100,c:e.charging}}catch{}}},Pi=class{static trackDeviceID(e){this.isInstalled()}static trackIntent(e){if(!this.isInstalled())return;let t=bn[e]?.toLowerCase();t&&(w.debug(`Sending ${t} intent to MS Clarity`),window.clarity("set","Cooee Intent",t))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}},uh=Se(Rr()),Li=class{constructor(e,t){this._startTime=e,this._triggerData=t}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e==="test"&&(e="test-"+this.startTime.getTime().toString()),N.IN_APP_WRAPPER_NAME+"-"+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e}closeInApp(e,t){t??={};let r=(new Date().getTime()-this.startTime.getTime())/1e3,n=b({eventName:e,duration:r},t);this.stopIntervals(),this.closeCallback&&this.closeCallback(n)}addInputField(e,t){this.inputFields.push({id:e,type:t,isValid:!1})}updateValidation(e,t){this.inputFields.forEach(r=>{if(r.id===e){r.isValid=t;return}})}hasManipulatedProductQuantity(){let e=this.triggerData.manipulation.productQuantity;return e?.enabled&&e.min!=null&&e.max!=null}getManipulatedQuantity(e){let{min:t=1,max:r=100}=this.triggerData.manipulation.productQuantity;if(t>r)return w.error("Invalid range: min should be less than or equal to max."),e;if(e>=t&&e<=r)return e;let n=e%100;return n<t?t:n>r?r:n}stopIntervals(){this.intervals.forEach(e=>clearInterval(e))}},Xa=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(t=>{t instanceof br&&this.loadFamily(t.typography?.fam)})}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let t=[];e.fonts.forEach(r=>{if(r.url){let n=new FontFace(N.COOEE+e.name,r.getURL(),r.getFontDescriptor());t.push(n.load())}}),this.loadedFonts.push(e.name),(await Promise.all(t)).forEach(r=>{document.fonts.add(r)})}},Ja=class{static updateIdentity(e){if(!this.isInstalled())return;let t={};e.email&&(t.email=e.email),e.mobile&&(t.phone_number=e.mobile),w.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",t])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},Qa=Se(an()),Cr=class jh{static INSTANCE=new jh;topics={};constructor(){}static get(){return this.INSTANCE}broadcast(t,r){this.topics[t]||(this.topics[t]=new Rt),this.topics[t].next(r)}subscriber(t){return this.topics[t]||(this.topics[t]=new Rt),this.topics[t].asObservable()}},ze=class jr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Pe.get().website??{};currentState=!1;drawerSubject=new Co({open:!1,firstOpen:!1});mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[jr.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),document.addEventListener(N.CTA_AFTER_REFRESH_UI,this.updateBubble.bind(this))}get element(){return this.cartDrawerElement}static get(){return jr._instance||(jr._instance=new jr),jr._instance}static forceUpdate(){jr._instance=new jr}isOpen(){let t=this.inShadow?this.isPresent():this.isVisible();return Qa.default.log(`Cart drawer is currently ${t?"open":"close"}`),t}open(){if(this.isOpen()){w.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(N.CTA_OPEN_CART_EVENT));let t=document.querySelector(this.iconSelector);if(!t){w.debug("No clickable cart icon found with selector",this.iconSelector);return}t.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===jr.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(t,r=!0){if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:t}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&t)this.element.classList.remove("is-empty"),this.element.renderContents?.(t);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!t?.items?.[0])return;let n=t.items[0].id,i=t.items[0].quantity,s=t.items[0].price;window.cartGiftUpdate(n,s,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):(w.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent(N.CTA_AFTER_REFRESH_UI)),r&&Cr.get().broadcast(N.CART_UPDATE_BROADCAST)}async initialize(){let t=this.configWebsite.cartDrawerSelector;if(!t){await this.findCartDrawer();return}let r=t.split(N.SHADOW_SPLITTER);r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!ke.isShopify())return;let t=this.selector||this.cartSelector;if(this.cartDrawerElement=await J.retrySelector(t),!this.cartDrawerElement){Qa.default.warn("Max attempts exhausted to find cart drawer");return}Qa.default.log("Found",this.cartDrawerElement,`from selector: ${t}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!ke.isShopify()||!this.shadowParentElementSelector)return;let t=(await J.retrySelector(this.shadowParentElementSelector))?.shadowRoot;t?.mode==="open"&&(this.cartDrawerShadowElement=t,this.createMutationObservers())}isVisible(){if(!this.cartDrawerElement)return!1;if(this.cartDrawerElement.tagName.toLowerCase()===jr.DEFAULT_SELECTOR&&this.cartDrawerElement.open)return!0;if(this.cartDrawerElement.id==="cart-drawer__container")return this.cartDrawerElement.classList.contains("cart-drawer-open");let t=this.cartDrawerElement.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)+.5,n=(window.innerWidth||document.documentElement.clientWidth)+.5,i=t.top<=r&&t.bottom>=0,s=t.left<=n&&t.right>=0,o=i&&s,c=getComputedStyle(this.cartDrawerElement),u=c.display!=="none"&&c.visibility!=="hidden"&&parseFloat(c.opacity)>0,d=!this.cartDrawerElement.hidden,g=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,h=c.transform.match(/matrix\(([^)]+)\)/),m=0,E=0;if(h){let R=h[1].split(", ").map(parseFloat);m=R[4],E=R[5]}let v=m+t.left>n||m+t.right<0||E+t.top>r||E+t.bottom<0,_=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),D=Math.max(0,Math.min(t.bottom,r)-Math.max(t.top,0)),P=_*D,M=t.width*t.height,L=M>0&&P/M>=.1;return(o||!v)&&u&&d&&g&&L}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||(J.onNodesRemoved(this.cartDrawerElement,()=>{this.initialize()}),this.watchForCartToggle())}watchForCartToggle(){let t=this.cartDrawerElement||this.cartDrawerShadowElement,r=new Rt;this.mutationObserver?.disconnect(),this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(t,{attributes:!0,subtree:!0,childList:this.inShadow}),r.pipe(ar(500)).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,this.drawerSubject.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){return!this.selector||!this.cartDrawerShadowElement?!1:!!this.cartDrawerShadowElement.querySelector(this.selector)}async updateBubble(){let t=(await fe.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=t+"")}},Ur=Se(Rr()),sh=Se(oh()),Mn=class{static _flags={};static getFlags(){return this._flags}static setFlags(e){this._flags=e??{}}static isECommerceApp(){return ke.isShopify()}},Z_=(0,sh.default)(fetch),eS={retryDelay:N.API_CALL_RETRY_DELAY,retryOn:(e,t,r)=>e>=N.API_CALL_MAX_ATTEMPTS?!1:!!(t!==null||r?.status&&r?.status>=500)},yt=class Fh{static INSTANCE;apiToken="";firstSeen="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Fh),this.INSTANCE}async validateSession(t){return this.post("/v1/event/validate-session",t)}updateUserData(t){this.put("/v1/user/update",t).then(async r=>{w.log("Updated user profile"),await kn.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{w.error("Error saving user profile",r)})}trackOrder(t){this.post("/v1/event/track-order",t).then(()=>{w.log("Sent Order")}).catch(r=>{w.error("Error sending track order",r)})}generateDiscount(t){return this.post("/v1/event/generate-discount",t)}updateDeviceProps(t){this.put("/v1/device/update",t).then(()=>{w.log("Updated device property")}).catch(async r=>{w.error("Error saving device property",r)})}setAPIToken(t){this.apiToken=t??""}setFirstSeen(t){this.firstSeen=t?.toUTCString()??""}get(t){return this.requestBackend("GET",t)}post(t,r){return this.requestBackend("POST",t,r)}put(t,r){return this.requestBackend("PUT",t,r)}async requestBackend(t,r,n){if(!Mn.isECommerceApp()&&!Mn.getFlags().allowEvents)return w.log(`Rejecting ${t} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=mt.apiURL+r);let i=this.getDefaultHeaders(),s="keepalive"in new Request("");if(n&&!s&&JSON.stringify(n).includes("CE App Background"))try{return this.performXMLHttpRequest(r,i,n)}catch(c){return Le.getInstance().captureException(c,{body:JSON.stringify(n)}),{}}let o={method:t,headers:i,keepalive:!0};return n&&(o.body=JSON.stringify(n)),this.request(r,o)}async request(t,r){let n=b(b({},eS),r),i=await Z_(t,n);if(!i.ok)throw i;return i.json()}performXMLHttpRequest(t,r,n){return new Promise((i,s)=>{let o=new XMLHttpRequest;o.open("POST",t,!0),r.forEach((c,u)=>{o.setRequestHeader(u,c)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{o.getResponseHeader("Content-Type")?.includes("application/json")?i(JSON.parse(o.responseText)):s(new Error("Content-Type of response header is not json"))}catch(c){s(c)}else s(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{s(new Error("Network error occurred during the request."))},o.send(JSON.stringify(n))})}getDefaultHeaders(){let t=new Headers;return t.set("content-type","application/json"),t.set("cooee-sdk",N.SDK),t.set("cooee-sdk-code",N.SDK_VERSION_CODE.toString()),t.set("cooee-sdk-version",N.SDK_VERSION),t.set("cooee-first-seen",this.firstSeen),this.apiToken&&t.append("cooee-sdk-token",this.apiToken),mt.debug&&t.set("cooee-sdk-debug",String(1)),t}},tS=`
38
+ `)}`:"",this.name="UnsubscriptionError",this.errors=t});function Nn(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var qt=class Hc{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let s of r)s.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(ce(n))try{n()}catch(s){t=s instanceof ka?s.errors:[s]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let s of i)try{Kd(s)}catch(o){t=t??[],o instanceof ka?t=[...t,...o.errors]:t.push(o)}}if(t)throw new ka(t)}}add(t){var r;if(t&&t!==this)if(this.closed)Kd(t);else{if(t instanceof Hc){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Nn(r,t)}remove(t){let{_finalizers:r}=this;r&&Nn(r,t),t instanceof Hc&&t._removeParent(this)}};qt.EMPTY=(()=>{let e=new qt;return e.closed=!0,e})();var rp=qt.EMPTY;function Ba(e){return e instanceof qt||e&&"closed"in e&&ce(e.remove)&&ce(e.add)&&ce(e.unsubscribe)}function Kd(e){ce(e)?e():e.unsubscribe()}var or={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Oi={setTimeout(e,t,...r){let{delegate:n}=Oi;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=Oi;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ua(e){Oi.setTimeout(()=>{let{onUnhandledError:t}=or;if(t)t(e);else throw e})}function np(){}var Xd=ip("C",void 0,void 0);function Jd(e){return ip("E",void 0,e)}function Qd(e){return ip("N",e,void 0)}function ip(e,t,r){return{kind:e,value:t,error:r}}var On=null;function Pi(e){if(or.useDeprecatedSynchronousErrorHandling){let t=!On;if(t&&(On={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=On;if(On=null,r)throw n}}else e()}function Zd(e){or.useDeprecatedSynchronousErrorHandling&&On&&(On.errorThrown=!0,On.error=e)}var Pn=class extends qt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Ba(e)&&e.add(this)):this.destination=z_}static create(e,t,r){return new Li(e,t,r)}next(e){this.isStopped?sp(Qd(e),this):this._next(e)}error(e){this.isStopped?sp(Jd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?sp(Xd,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},G_=Function.prototype.bind;function op(e,t){return G_.call(e,t)}var ap=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){Fa(r)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){Fa(r)}else Fa(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Fa(t)}}},Li=class extends Pn{constructor(e,t,r){super();let n;if(ce(e)||!e)n={next:e??void 0,error:t??void 0,complete:r??void 0};else{let i;this&&or.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),n={next:e.next&&op(e.next,i),error:e.error&&op(e.error,i),complete:e.complete&&op(e.complete,i)}):n=e}this.destination=new ap(n)}};function Fa(e){or.useDeprecatedSynchronousErrorHandling?Zd(e):Ua(e)}function Y_(e){throw e}function sp(e,t){let{onStoppedNotification:r}=or;r&&Oi.setTimeout(()=>r(e,t))}var z_={closed:!0,next:np,error:Y_,complete:np},Mi=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Ha(e){return e}function eh(e){return e.length===0?Ha:e.length===1?e[0]:function(t){return e.reduce((r,n)=>n(r),t)}}var at=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,i){let s=K_(r)?r:new Li(r,n,i);return Pi(()=>{let{operator:o,source:c}=this;s.add(o?o.call(s,c):c?this._subscribe(s):this._trySubscribe(s))}),s}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=th(n),new n((i,s)=>{let o=new Li({next:c=>{try{r(c)}catch(u){s(u),o.unsubscribe()}},error:s,complete:i});this.subscribe(o)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[Mi](){return this}pipe(...r){return eh(r)(this)}toPromise(r){return r=th(r),new r((n,i)=>{let s;this.subscribe(o=>s=o,o=>i(o),()=>n(s))})}}return e.create=t=>new e(t),e})();function th(e){var t;return(t=e??or.Promise)!==null&&t!==void 0?t:Promise}function q_(e){return e&&ce(e.next)&&ce(e.error)&&ce(e.complete)}function K_(e){return e&&e instanceof Pn||q_(e)&&Ba(e)}function X_(e){return ce(e?.lift)}function Kt(e){return t=>{if(X_(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function kr(e,t,r,n,i){return new cp(e,t,r,n,i)}var cp=class extends Pn{constructor(e,t,r,n,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=t?function(o){try{t(o)}catch(c){e.error(c)}}:super._next,this._error=n?function(o){try{n(o)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(o){e.error(o)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}},rh=Ma(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}),xt=(()=>{class e extends at{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new $a(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new rh}next(r){Pi(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){Pi(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){Pi(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:i,observers:s}=this;return n||i?rp:(this.currentObservers=null,s.push(r),new qt(()=>{this.currentObservers=null,Nn(s,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:i,isStopped:s}=this;n?r.error(i):s&&r.complete()}asObservable(){let r=new at;return r.source=this,r}}return e.create=(t,r)=>new $a(t,r),e})(),$a=class extends xt{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.next)===null||r===void 0||r.call(t,e)}error(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.error)===null||r===void 0||r.call(t,e)}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e)}_subscribe(e){var t,r;return(r=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&r!==void 0?r:rp}},No=class extends xt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}},Oo={now(){return(Oo.delegate||Date).now()},delegate:void 0},Po=class extends xt{constructor(e=1/0,t=1/0,r=Oo){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){let{isStopped:t,_buffer:r,_infiniteTimeWindow:n,_timestampProvider:i,_windowTime:s}=this;t||(r.push(e),!n&&r.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:n}=this,i=n.slice();for(let s=0;s<i.length&&!e.closed;s+=r?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:r,_infiniteTimeWindow:n}=this,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){let s=t.now(),o=0;for(let c=1;c<r.length&&r[c]<=s;c+=2)o=c;o&&r.splice(0,o+1)}}},ja=class extends qt{constructor(e,t){super()}schedule(e,t=0){return this}},Lo={setInterval(e,t,...r){let{delegate:n}=Lo;return n?.setInterval?n.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){let{delegate:t}=Lo;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},Va=class extends ja{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var r;if(this.closed)return this;this.state=e;let n=this.id,i=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,r=0){return Lo.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return t;t!=null&&Lo.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,t);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r=!1,n;try{this.work(e)}catch(i){r=!0,n=i||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Nn(r,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}},ki=class wp{constructor(t,r=wp.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,n){return new this.schedulerActionCtor(this,t).schedule(n,r)}};ki.now=Oo.now;var Wa=class extends ki{constructor(e,t=ki.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},nh=new Wa(Va);function ih(e){return e&&ce(e.schedule)}function J_(e){return e[e.length-1]}function Ga(e){return ih(J_(e))?e.pop():void 0}function sh(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function c(g){try{d(n.next(g))}catch(h){o(h)}}function u(g){try{d(n.throw(g))}catch(h){o(h)}}function d(g){g.done?s(g.value):i(g.value).then(c,u)}d((n=n.apply(e,t||[])).next())})}function oh(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ln(e){return this instanceof Ln?(this.v=e,this):new Ln(e)}function ah(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(E){return function(y){return Promise.resolve(y).then(E,h)}}function c(E,y){n[E]&&(i[E]=function(_){return new Promise(function(x,P){s.push([E,_,x,P])>1||u(E,_)})},y&&(i[E]=y(i[E])))}function u(E,y){try{d(n[E](y))}catch(_){m(s[0][3],_)}}function d(E){E.value instanceof Ln?Promise.resolve(E.value.v).then(g,h):m(s[0][2],E)}function g(E){u("next",E)}function h(E){u("throw",E)}function m(E,y){E(y),s.shift(),s.length&&u(s[0][0],s[0][1])}}function ch(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof oh=="function"?oh(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(c,u){o=e[s](o),i(c,u,o.done,o.value)})}}function i(s,o,c,u){Promise.resolve(u).then(function(d){s({value:d,done:c})},o)}}var Bi=e=>e&&typeof e.length=="number"&&typeof e!="function";function Ya(e){return ce(e?.then)}function za(e){return ce(e[Mi])}function qa(e){return Symbol.asyncIterator&&ce(e?.[Symbol.asyncIterator])}function Ka(e){return new TypeError(`You provided ${e!==null&&typeof e=="object"?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Q_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Xa=Q_();function Ja(e){return ce(e?.[Xa])}function Qa(e){return ah(this,arguments,function*(){let t=e.getReader();try{for(;;){let{value:r,done:n}=yield Ln(t.read());if(n)return yield Ln(void 0);yield yield Ln(r)}}finally{t.releaseLock()}})}function Za(e){return ce(e?.getReader)}function Xt(e){if(e instanceof at)return e;if(e!=null){if(za(e))return Z_(e);if(Bi(e))return eS(e);if(Ya(e))return tS(e);if(qa(e))return lh(e);if(Ja(e))return rS(e);if(Za(e))return nS(e)}throw Ka(e)}function Z_(e){return new at(t=>{let r=e[Mi]();if(ce(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function eS(e){return new at(t=>{for(let r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function tS(e){return new at(t=>{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,Ua)})}function rS(e){return new at(t=>{for(let r of e)if(t.next(r),t.closed)return;t.complete()})}function lh(e){return new at(t=>{iS(e,t).catch(r=>t.error(r))})}function nS(e){return lh(Qa(e))}function iS(e,t){var r,n,i,s;return sh(this,void 0,void 0,function*(){try{for(r=ch(e);n=yield r.next(),!n.done;){let o=n.value;if(t.next(o),t.closed)return}}catch(o){i={error:o}}finally{try{n&&!n.done&&(s=r.return)&&(yield s.call(r))}finally{if(i)throw i.error}}t.complete()})}function Jt(e,t,r,n=0,i=!1){let s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}function ec(e,t=0){return Kt((r,n)=>{r.subscribe(kr(n,i=>Jt(n,e,()=>n.next(i),t),()=>Jt(n,e,()=>n.complete(),t),i=>Jt(n,e,()=>n.error(i),t)))})}function tc(e,t=0){return Kt((r,n)=>{n.add(e.schedule(()=>r.subscribe(n),t))})}function uh(e,t){return Xt(e).pipe(tc(t),ec(t))}function ph(e,t){return Xt(e).pipe(tc(t),ec(t))}function fh(e,t){return new at(r=>{let n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function mh(e,t){return new at(r=>{let n;return Jt(r,t,()=>{n=e[Xa](),Jt(r,t,()=>{let i,s;try{({value:i,done:s}=n.next())}catch(o){r.error(o);return}s?r.complete():r.next(i)},0,!0)}),()=>ce(n?.return)&&n.return()})}function rc(e,t){if(!e)throw new Error("Iterable cannot be null");return new at(r=>{Jt(r,t,()=>{let n=e[Symbol.asyncIterator]();Jt(r,t,()=>{n.next().then(i=>{i.done?r.complete():r.next(i.value)})},0,!0)})})}function dh(e,t){return rc(Qa(e),t)}function hh(e,t){if(e!=null){if(za(e))return uh(e,t);if(Bi(e))return fh(e,t);if(Ya(e))return ph(e,t);if(qa(e))return rc(e,t);if(Ja(e))return mh(e,t);if(Za(e))return dh(e,t)}throw Ka(e)}function gh(e,t){return t?hh(e,t):Xt(e)}function Mn(e,t){return Kt((r,n)=>{let i=0;r.subscribe(kr(n,s=>{n.next(e.call(t,s,i++))}))})}var{isArray:oS}=Array;function sS(e,t){return oS(t)?e(...t):e(t)}function yh(e){return Mn(t=>sS(e,t))}function vh(e,t,r,n,i,s,o,c){let u=[],d=0,g=0,h=!1,m=()=>{h&&!u.length&&!d&&t.complete()},E=_=>d<n?y(_):u.push(_),y=_=>{s&&t.next(_),d++;let x=!1;Xt(r(_,g++)).subscribe(kr(t,P=>{i?.(P),s?E(P):t.next(P)},()=>{x=!0},void 0,()=>{if(x)try{for(d--;u.length&&d<n;){let P=u.shift();o?Jt(t,o,()=>y(P)):y(P)}m()}catch(P){t.error(P)}}))};return e.subscribe(kr(t,E,()=>{h=!0,m()})),()=>{c?.()}}function Mo(e,t,r=1/0){return ce(t)?Mo((n,i)=>Mn((s,o)=>t(n,s,i,o))(Xt(e(n,i))),r):(typeof t=="number"&&(r=t),Kt((n,i)=>vh(n,i,e,r)))}function Eh(e=1/0){return Mo(Ha,e)}function _h(){return Eh(1)}function lp(...e){return _h()(gh(e,Ga(e)))}var aS=["addListener","removeListener"],cS=["addEventListener","removeEventListener"],lS=["on","off"];function kn(e,t,r,n){if(ce(r)&&(n=r,r=void 0),n)return kn(e,t,r).pipe(yh(n));let[i,s]=fS(e)?cS.map(o=>c=>e[o](t,c,r)):uS(e)?aS.map(Sh(e,t)):pS(e)?lS.map(Sh(e,t)):[];if(!i&&Bi(e))return Mo(o=>kn(o,t,r))(Xt(e));if(!i)throw new TypeError("Invalid event target");return new at(o=>{let c=(...u)=>o.next(1<u.length?u:u[0]);return i(c),()=>s(c)})}function Sh(e,t){return r=>n=>e[r](t,n)}function uS(e){return ce(e.addListener)&&ce(e.removeListener)}function pS(e){return ce(e.on)&&ce(e.off)}function fS(e){return ce(e.addEventListener)&&ce(e.removeEventListener)}function sr(e,t=nh){return Kt((r,n)=>{let i=null,s=null,o=null,c=()=>{if(i){i.unsubscribe(),i=null;let d=s;s=null,n.next(d)}};function u(){let d=o+e,g=t.now();if(g<d){i=this.schedule(void 0,d-g),n.add(i);return}c()}r.subscribe(kr(n,d=>{s=d,o=t.now(),i||(i=t.schedule(u,e),n.add(i))},()=>{c(),n.complete()},void 0,()=>{s=i=null}))})}function up(...e){let t=Ga(e);return Kt((r,n)=>{(t?lp(e,r,t):lp(e,r)).subscribe(n)})}var bh=_e(pp()),ko=class{static UTM_PARAMS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"];static TW_PARAMS={utm_source:"tw_source",utm_campaign:"tw_campaign"};static getReferrer(){if(document.referrer)return document.referrer.replace(location.origin,"")}static getUTMParams(){let e;try{e=new bh.URLBuilder(location.href)}catch{return{}}let t={};this.UTM_PARAMS.forEach(n=>{let i=e.getQueryParam(n);i&&(t[n]=i)});let r={};return Object.keys(this.TW_PARAMS).forEach(n=>{let i=e.getQueryParam(this.TW_PARAMS[n]);i&&(r[n]=i)}),b(b({},r),t)}},Ir=class _p{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(t){this.name=t.name,this.path=t.path,this.qs=t.qs,this.referrer=t.referrer,this.utmSource=t.utmSource||t.utm_source,this.utmMedium=t.utmMedium||t.utm_medium,this.utmCampaign=t.utmCampaign||t.utm_campaign,this.utmId=t.utmId||t.utm_id,this.utmTerm=t.utmTerm||t.utm_term,this.utmContent=t.utmContent||t.utm_content}static parseFromCurrent(){let t=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new _p(b({origin:location.origin,path:t,qs:location.search,referrer:ko.getReferrer(),name:le.get().pageName},ko.getUTMParams()))}},dS=" daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|adscanner/|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|cookiehubscan|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firephp|functionize|gomezagent|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|jsjcw_scanner|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scanner\\.|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|zgrab",hS=/bot|crawl|http|lighthouse|scan|search|spider/i,Bo;function gS(){if(Bo instanceof RegExp)return Bo;try{Bo=new RegExp(dS,"i")}catch{Bo=hS}return Bo}function wh(e){return!!e&&gS().test(e)}var fp={d:(e,t)=>{for(var r in t)fp.o(t,r)&&!fp.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},mp={};fp.d(mp,{A:()=>ES,k:()=>dp});var yS=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(d){try{u(n.next(d))}catch(g){s(g)}}function c(d){try{u(n.throw(d))}catch(g){s(g)}}function u(d){var g;d.done?i(d.value):(g=d.value,g instanceof r?g:new r(function(h){h(g)})).then(o,c)}u((n=n.apply(e,t||[])).next())})},vS=function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(d){return function(g){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,g[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&g[0]?n.return:g[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,g[1])).done)return i;switch(n=0,i&&(g=[2&g[0],i.value]),g[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,n=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||g[0]!==6&&g[0]!==2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]<i[3])){o.label=g[1];break}if(g[0]===6&&o.label<i[1]){o.label=i[1],i=g;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(g);break}i[2]&&o.ops.pop(),o.trys.pop();continue}g=t.call(e,o)}catch(h){g=[6,h],n=0}finally{r=i=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([u,d])}}};function dp(){return yS(this,void 0,Promise,function(){return vS(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback(e){resolve({isPrivate:e,browserName})}function identifyChromium(){var e=navigator.userAgent;return e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.match(/Edg/)?"Edge":e.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString(e){return e===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch(e){toFixedEngineID=e.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var e=String(Math.random());try{window.indexedDB.open(e,1).onupgradeneeded=function(t){var r,n,i=(r=t.target)===null||r===void 0?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(o){var s=o;return o instanceof Error&&(s=(n=o.message)!==null&&n!==void 0?n:o),typeof s!="string"?void __callback(!1):void __callback(s.includes("BlobURLs are not yet supported"))}finally{i.close(),window.indexedDB.deleteDatabase(e)}}}catch{__callback(!1)}}function oldSafariTest(){var e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return void __callback(!0)}try{t.setItem("test","1"),t.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var e=window;return e.performance!==void 0&&e.performance.memory!==void 0&&e.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(e,t){__callback(Math.round(t/1048576)<2*Math.round(getQuotaLimit()/1048576))},function(e){reject(new Error("detectIncognito somehow failed to query storage quota: "+e.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=dp);var ES=dp,Ih=mp.A,Sk=mp.k,Oh=_e(cn()),ic=class{parser;result={};constructor(){this.parser=Pt.get().getUAParser()}async get(){let e=this.result;return this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),await this.getBatteryInfo(),await this.getLocation(),e.locale=navigator.language,e.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},e.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},e.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},e.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},e.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},e.navigatorUA=navigator.userAgent,e.isHeadless=navigator.webdriver,e}getDeviceMemory(){let e=navigator;if(!e.deviceMemory)return;let t=e.deviceMemory;this.result.mem={tot:t*1024}}getNetworkType(){let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(this.result.net={type:t.effectiveType})}getOrientation(){let e=screen.orientation?.type;e&&(this.result.orientation=e)}getDPI(){if(!document.body)return;let e=document.createElement("div");e.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(e);let t=window.devicePixelRatio||1,r=e.offsetWidth*t;return document.body.removeChild(e),r}async getLocation(){if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(e=>{navigator.geolocation.getCurrentPosition(t=>{this.result.coords=[t.coords.latitude,t.coords.longitude],e()},()=>e())})}async getBatteryInfo(){if("getBattery"in navigator)try{let e=await navigator.getBattery();this.result.bat={l:e.level*100,c:e.charging}}catch{}}},Ui=class{static trackDeviceID(e){this.isInstalled()}static trackIntent(e){if(!this.isInstalled())return;let t=In[e]?.toLowerCase();t&&(w.debug(`Sending ${t} intent to MS Clarity`),window.clarity("set","Cooee Intent",t))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}},Ah=_e(Dr()),Fi=class{constructor(e,t){this._startTime=e,this._triggerData=t}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e==="test"&&(e="test-"+this.startTime.getTime().toString()),N.IN_APP_WRAPPER_NAME+"-"+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e}closeInApp(e,t){t??={};let r=(new Date().getTime()-this.startTime.getTime())/1e3,n=b({eventName:e,duration:r},t);this.stopIntervals(),this.closeCallback&&this.closeCallback(n)}addInputField(e,t){this.inputFields.push({id:e,type:t,isValid:!1})}updateValidation(e,t){this.inputFields.forEach(r=>{if(r.id===e){r.isValid=t;return}})}hasManipulatedProductQuantity(){let e=this.triggerData.manipulation.productQuantity;return e?.enabled&&e.min!=null&&e.max!=null}getManipulatedQuantity(e){let{min:t=1,max:r=100}=this.triggerData.manipulation.productQuantity;if(t>r)return w.error("Invalid range: min should be less than or equal to max."),e;if(e>=t&&e<=r)return e;let n=e%100;return n<t?t:n>r?r:n}stopIntervals(){this.intervals.forEach(e=>clearInterval(e))}},oc=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(t=>{t instanceof Sr&&this.loadFamily(t.typography?.fam)})}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let t=[];e.fonts.forEach(r=>{if(r.url){let n=new FontFace(N.COOEE+e.name,r.getURL(),r.getFontDescriptor());t.push(n.load())}}),this.loadedFonts.push(e.name),(await Promise.all(t)).forEach(r=>{document.fonts.add(r)})}},sc=class{static updateIdentity(e){if(!this.isInstalled())return;let t={};e.email&&(t.email=e.email),e.mobile&&(t.phone_number=e.mobile),w.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",t])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},ac=_e(cn()),Tr=class Ep{static INSTANCE=new Ep;topics={};constructor(){}static get(){return this.INSTANCE}broadcast(t,r){this.topics[t]||(this.topics[t]=new xt),this.topics[t].next(r)}subscriber(t){return this.topics[t]||(this.topics[t]=new xt),this.topics[t].asObservable()}},Ge=class jr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Pe.get().website??{};currentState=!1;drawerSubject=new No({open:!1,firstOpen:!1});mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[jr.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),document.addEventListener(N.CTA_AFTER_REFRESH_UI,this.updateBubble.bind(this))}get element(){return this.cartDrawerElement}static get(){return jr._instance||(jr._instance=new jr),jr._instance}static forceUpdate(){jr._instance=new jr}isOpen(){let t=this.inShadow?this.isPresent():this.isVisible();return ac.default.log(`Cart drawer is currently ${t?"open":"close"}`),t}open(){if(this.isOpen()){w.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(N.CTA_OPEN_CART_EVENT));let t=document.querySelector(this.iconSelector);if(!t){w.debug("No clickable cart icon found with selector",this.iconSelector);return}t.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===jr.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(t,r=!0){if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:t}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&t)this.element.classList.remove("is-empty"),this.element.renderContents?.(t);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!t?.items?.[0])return;let n=t.items[0].id,i=t.items[0].quantity,s=t.items[0].price;window.cartGiftUpdate(n,s,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):(w.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent(N.CTA_AFTER_REFRESH_UI)),r&&Tr.get().broadcast(N.CART_UPDATE_BROADCAST)}async initialize(){let t=this.configWebsite.cartDrawerSelector;if(!t){await this.findCartDrawer();return}let r=t.split(N.SHADOW_SPLITTER);r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!ao())return;let t=this.selector||this.cartSelector;if(this.cartDrawerElement=await hi(t),!this.cartDrawerElement){ac.default.warn("Max attempts exhausted to find cart drawer");return}ac.default.log("Found",this.cartDrawerElement,`from selector: ${t}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let t=(await hi(this.shadowParentElementSelector))?.shadowRoot;t?.mode==="open"&&(this.cartDrawerShadowElement=t,this.createMutationObservers())}isVisible(){if(!this.cartDrawerElement)return!1;if(this.cartDrawerElement.tagName.toLowerCase()===jr.DEFAULT_SELECTOR&&this.cartDrawerElement.open)return!0;if(this.cartDrawerElement.id==="cart-drawer__container")return this.cartDrawerElement.classList.contains("cart-drawer-open");let t=this.cartDrawerElement.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)+.5,n=(window.innerWidth||document.documentElement.clientWidth)+.5,i=t.top<=r&&t.bottom>=0,s=t.left<=n&&t.right>=0,o=i&&s,c=getComputedStyle(this.cartDrawerElement),u=c.display!=="none"&&c.visibility!=="hidden"&&parseFloat(c.opacity)>0,d=!this.cartDrawerElement.hidden,g=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,h=c.transform.match(/matrix\(([^)]+)\)/),m=0,E=0;if(h){let k=h[1].split(", ").map(parseFloat);m=k[4],E=k[5]}let y=m+t.left>n||m+t.right<0||E+t.top>r||E+t.bottom<0,_=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),x=Math.max(0,Math.min(t.bottom,r)-Math.max(t.top,0)),P=_*x,M=t.width*t.height,L=M>0&&P/M>=.1;return(o||!y)&&u&&d&&g&&L}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||(vd(this.cartDrawerElement,()=>{this.initialize()}),this.watchForCartToggle())}watchForCartToggle(){let t=this.cartDrawerElement||this.cartDrawerShadowElement,r=new xt;this.mutationObserver?.disconnect(),this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(t,{attributes:!0,subtree:!0,childList:this.inShadow}),r.pipe(sr(500)).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,this.drawerSubject.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){return!this.selector||!this.cartDrawerShadowElement?!1:!!this.cartDrawerShadowElement.querySelector(this.selector)}async updateBubble(){let t=(await pe.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=t+"")}},Br=_e(Dr()),Ch=_e(Th()),Bn=class{static _flags={};static getFlags(){return this._flags}static setFlags(e){this._flags=e??{}}static isECommerceApp(){return ao()}},_S=(0,Ch.default)(fetch),SS={retryDelay:N.API_CALL_RETRY_DELAY,retryOn:(e,t,r)=>e>=N.API_CALL_MAX_ATTEMPTS?!1:!!(t!==null||r?.status&&r?.status>=500)},ht=class Sp{static INSTANCE;apiToken="";firstSeen="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Sp),this.INSTANCE}async validateSession(t){return this.post("/v1/event/validate-session",t)}updateUserData(t){this.put("/v1/user/update",t).then(async r=>{w.log("Updated user profile"),await Un.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{w.error("Error saving user profile",r)})}trackOrder(t){this.post("/v1/event/track-order",t).then(()=>{w.log("Sent Order")}).catch(r=>{w.error("Error sending track order",r)})}generateDiscount(t){return this.post("/v1/event/generate-discount",t)}updateDeviceProps(t){this.put("/v1/device/update",t).then(()=>{w.log("Updated device property")}).catch(async r=>{w.error("Error saving device property",r)})}setAPIToken(t){this.apiToken=t??""}setFirstSeen(t){this.firstSeen=t?.toUTCString()??""}get(t){return this.requestBackend("GET",t)}post(t,r){return this.requestBackend("POST",t,r)}put(t,r){return this.requestBackend("PUT",t,r)}async requestBackend(t,r,n){if(!Bn.isECommerceApp()&&!Bn.getFlags().allowEvents)return w.log(`Rejecting ${t} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=pt.apiURL+r);let i=this.getDefaultHeaders(),s="keepalive"in new Request("");if(n&&!s&&JSON.stringify(n).includes("CE App Background"))try{return this.performXMLHttpRequest(r,i,n)}catch(c){return Oe.getInstance().captureException(c,{body:JSON.stringify(n)}),{}}let o={method:t,headers:i,keepalive:!0};return n&&(o.body=JSON.stringify(n)),this.request(r,o)}async request(t,r){let n=b(b({},SS),r),i=await _S(t,n);if(!i.ok)throw i;return i.json()}performXMLHttpRequest(t,r,n){return new Promise((i,s)=>{let o=new XMLHttpRequest;o.open("POST",t,!0),r.forEach((c,u)=>{o.setRequestHeader(u,c)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{o.getResponseHeader("Content-Type")?.includes("application/json")?i(JSON.parse(o.responseText)):s(new Error("Content-Type of response header is not json"))}catch(c){s(c)}else s(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{s(new Error("Network error occurred during the request."))},o.send(JSON.stringify(n))})}getDefaultHeaders(){let t=new Headers;return t.set("content-type","application/json"),t.set("cooee-sdk",N.SDK),t.set("cooee-sdk-code",N.SDK_VERSION_CODE.toString()),t.set("cooee-sdk-version",N.SDK_VERSION),t.set("cooee-first-seen",this.firstSeen),this.apiToken&&t.append("cooee-sdk-token",this.apiToken),pt.debug&&t.set("cooee-sdk-debug",String(1)),t}},bS=`
39
39
  mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
40
40
  cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
41
41
  cart {
@@ -47,7 +47,7 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
47
47
  }
48
48
  }
49
49
  }
50
- `,en=class{static navigate(e,t,r){let n=`${location.origin}/discount/${e}`;switch(w.log(`Applying discount code ${e}`,t,r),t){case Ur.RedirectBehaviour.CART_PAGE:location.href=`${n}?redirect=/cart`;break;case Ur.RedirectBehaviour.CART_DRAWER:location.href=`${n}?redirect=${location.pathname}#${N.HASH_OPEN_CART_DRAWER}=1`;break;case Ur.RedirectBehaviour.SHOPIFY_CHECKOUT:location.href=`${n}?redirect=/checkout`;break;case Ur.RedirectBehaviour.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods(`${n}?redirect=/cart#${N.HASH_INITIATE_CHECKOUT}=1`);break;default:location.href=`${n}?redirect=${r||location.pathname}`}}static navigateWithoutDiscount(e,t){let r=ze.get();switch(e){case Ur.RedirectBehaviour.CART_PAGE:location.href="/cart";break;case Ur.RedirectBehaviour.SHOPIFY_CHECKOUT:location.href="/checkout";break;case Ur.RedirectBehaviour.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods(`/cart#${N.HASH_INITIATE_CHECKOUT}=1`);break;case Ur.RedirectBehaviour.CART_DRAWER:{r.open();break}}t&&r.refreshUI(t)}static async applyWithStorefront(e){let t=Pe.get().storefrontToken;if(!t)throw new Error("Storefront token not set for the store");let r=new Headers;r.append("Content-Type","application/json"),r.append("X-Shopify-Storefront-Access-Token",t);let n=JSON.stringify({query:tS,variables:{cartId:`gid://shopify/Cart/${fe.getCurrent().token}`,discountCodes:[e]}}),i={method:"POST",headers:r,body:n};await yt.getInstance().request(N.GRAPHQL_API_PATH,i)}static checkThirdPartyMethods(e){window.triggerGokwikCustomCheckout?window.triggerGokwikCustomCheckout():window.shiprocketCheckoutEvents?.buyCart?window.shiprocketCheckoutEvents.buyCart():window.openCheckout?window.openCheckout():window.openRzpCheckout?window.openRzpCheckout():location.href=e}},ah=Se(ri()),rS=`
50
+ `,en=class{static navigate(e,t,r){let n=`${location.origin}/discount/${e}`;switch(w.log(`Applying discount code ${e}`,t,r),t){case Br.RedirectBehaviour.CART_PAGE:location.href=`${n}?redirect=/cart`;break;case Br.RedirectBehaviour.CART_DRAWER:location.href=`${n}?redirect=${location.pathname}#${N.HASH_OPEN_CART_DRAWER}=1`;break;case Br.RedirectBehaviour.SHOPIFY_CHECKOUT:location.href=`${n}?redirect=/checkout`;break;case Br.RedirectBehaviour.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods(`${n}?redirect=/cart#${N.HASH_INITIATE_CHECKOUT}=1`);break;default:location.href=`${n}?redirect=${r||location.pathname}`}}static navigateWithoutDiscount(e,t){let r=Ge.get();switch(e){case Br.RedirectBehaviour.CART_PAGE:location.href="/cart";break;case Br.RedirectBehaviour.SHOPIFY_CHECKOUT:location.href="/checkout";break;case Br.RedirectBehaviour.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods(`/cart#${N.HASH_INITIATE_CHECKOUT}=1`);break;case Br.RedirectBehaviour.CART_DRAWER:{r.open();break}}t&&r.refreshUI(t)}static async applyWithStorefront(e){let t=Pe.get().storefrontToken;if(!t)throw new Error("Storefront token not set for the store");let r=new Headers;r.append("Content-Type","application/json"),r.append("X-Shopify-Storefront-Access-Token",t);let n=JSON.stringify({query:bS,variables:{cartId:`gid://shopify/Cart/${pe.getCurrent().token}`,discountCodes:[e]}}),i={method:"POST",headers:r,body:n};await ht.getInstance().request(N.GRAPHQL_API_PATH,i)}static checkThirdPartyMethods(e){window.triggerGokwikCustomCheckout?window.triggerGokwikCustomCheckout():window.shiprocketCheckoutEvents?.buyCart?window.shiprocketCheckoutEvents.buyCart():window.openCheckout?window.openCheckout():window.openRzpCheckout?window.openRzpCheckout():location.href=e}},xh=_e(oi()),wS=`
51
51
  mutation cartCreate($input: CartInput) {
52
52
  cartCreate(input: $input) {
53
53
  cart {
@@ -60,11 +60,11 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
60
60
  }
61
61
  }
62
62
  }
63
- `,tn=class{async addToCart(e,t){if(!e.length)return;let r=e.map(c=>{let{vID:u,quantity:d}=this.getVIDAndQuantity(c);return{id:u?+u:+c.mID,quantity:d,properties:t.getPrivateAttributesForLineItem()}}),n=ke.getCartURL("cart/add.js"),i={items:r},s=ze.get();s.isMiniCart()?i.sections=["mini-cart"]:s.isShopifyDefaultDrawer()&&(i.sections=s.element.getSectionsToRender?.().map(c=>c.section??c.id));let o=JSON.stringify(i);try{let c=await fetch(n,{body:o,method:"post",headers:{"Content-Type":"application/json"}});if(c.status===200||c.status===302)return w.log(`Added ${e.length} items to Cart`),J.showSnackbar("Product added to your cart"),c.json()}catch(c){w.error("Failed to add product in cart",c)}}async updateLineItem(e,t){if(!ah.JSUtils.hasKeys(t)){w.warn("No update fields provided");return}let r=ke.getCartURL("cart/change.js"),n=b({id:e.key},t),i=JSON.stringify(n);try{let s=await fetch(r,{body:i,method:"post",headers:{"Content-Type":"application/json"}});(s.status===200||s.status===302)&&(w.log(`Updated ${e}`),fe.getCurrent().update(s.json()))}catch(s){w.error("Failed to update item in cart",s,e)}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),w.log(`Code-${e} copied`),J.showSnackbar("Discount code copied")}catch(t){w.error("Failed to copy code",t)}}goToItem(e){if(!e?.link)return;let t=ke.getProductSlug(e.link);t&&(location.pathname=ke.getRootPrefix()+"products/"+t)}async upgradeToSubscription(e,t){if(!e){w.warn("Trying to upgrade to subscription with no item");return}let r=await fe.getCurrent().getNormalisedCart(),n=e.selectedOrFirstVariant.value,i=r.items.findIndex(d=>d.vID===n.mID),s=n.selectedSellingPlan.value,o=ke.getCartURL("cart/change.js"),c={line:i+1,selling_plan:s?.mID||null,properties:t.getPrivateAttributesForLineItem()},u=JSON.stringify(c);try{let d=await fetch(o,{body:u,method:"post",headers:{"Content-Type":"application/json"}});if(d.status===200||d.status===302){w.log(`Upgraded ${e} selling plan`),J.showSnackbar("Line item updated");let g=await d.json();return fe.getCurrent().update(g),g}}catch(d){w.error("Failed to update subscription for item in cart",d)}}async createNewCart(e,t,r){let n=Pe.get().storefrontToken;if(!n)throw new Error("Storefront token not set for the store");if(!e?.vID){w.error("No variant ID found to perform Buy now",e);return}let i=t?[t]:[],s=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:r.getKVFormatPrivateAttributesForLineItem()}],o=await J.getCartAttributes(),c=new Headers;c.append("Content-Type","application/json"),c.append("X-Shopify-Storefront-Access-Token",n);let u=JSON.stringify({query:rS,variables:{input:{lines:s,discountCodes:i,attributes:o}}});return(await yt.getInstance().request(N.GRAPHQL_API_PATH,{method:"POST",headers:c,body:u})).data?.cartCreate?.cart?.checkoutUrl}async process(e){let t=e.clickAction,r=e.items,n=e.triggerData;if(t.at){let i=t;if(w.log(`Performing ${JSON.stringify(i)} action`),i.at===101)r?.length&&this.goToItem(r[0]);else if(i.at===102)r?.length&&await this.addToCart(r,n);else if(i.at===103)await this.copyDiscountCode(n.discount.code);else if(i.at===105)ze.get().open();else if(i.at===104){let s=e.collections;if(!s?.length)return;location.pathname=ke.getRootPrefix()+"collections/"+s[0].handle}}t.applyDiscount&&n.discount?.code&&en.navigate(n.discount.code,n.redirectBehaviour)}getVIDAndQuantity(e){let t,r;if(e instanceof dt)t=e.vID,r=e.quantity??1;else{if(!e.vars?.length)return{};t=e.selectedOrFirstVariant.value.mID,r=1}return{vID:t,quantity:r}}},ec=class{apiService;action;triggerContext;constructor(e,t){this.action=e,this.apiService=de.getInstance(),this.triggerContext=t}async execute(){let e=this.containsCTA()?N.EVENT_TRIGGER_CLICKED:N.EVENT_TRIGGER_CLOSED;switch(this.action.at!==106&&await this.closeTriggerAndSendEvent(e),this.action.at){case 2:break;case 4:this.gotoURLAction();break;case 5:this.shareAction();break;case 106:await this.collectFormData();break;case void 0:case 105:break;default:w.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;J.isValidURL(e)||(e=`//${e}`),window.open(e,"_self")}}prompt(){let e=this.action.pmpt;e&&(e===2&&this.promptLocationPermission(),e===3&&this.promptPushNotificationPermission(),e===1&&this.promptCameraPermission())}async closeTriggerAndSendEvent(e,t){this.triggerContext.closeInApp(e,t),await this.dispatchEvent()}shareAction(){if(this.action.share){if(!navigator.share){w.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(e=>console.log(e)).catch(e=>console.error(e))}}containsCTA(){return this.action.at&&this.action.at!==1?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}promptLocationPermission(){!navigator.geolocation||!navigator.permissions||navigator.geolocation.getCurrentPosition(e=>{this.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),this.sendPermissionData()})}promptPushNotificationPermission(){if(!("Notification"in window)){w.warn("This browser does not support desktop notification");return}if(Notification.permission!=="default"){this.apiService.updateDeviceProps({pnPerm:Notification.permission});return}Notification.requestPermission().then(()=>{this.sendPermissionData()})}promptCameraPermission(){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally(()=>{this.sendPermissionData()})}checkPermission(e){return navigator.permissions.query({name:e}).then(t=>t.state.toString())}async checkAllPermission(){let e=await this.checkPermission("camera"),t=await this.checkPermission("geolocation"),r=Notification.permission;return{camera:e,location:t,notification:r}}sendPermissionData(){this.checkAllPermission().then(e=>{this.apiService.updateDeviceProps({perm:e})})}async collectFormData(){let e={};for(let t of this.triggerContext.inputs){if(!t.isValid)return;let r=document.getElementById(t.id).value;t.type===51?e.email=r:t.type===52&&(e.mobile=r)}await this.closeTriggerAndSendEvent(N.EVENT_FORM_SUBMITTED,{form:e}),J.showSnackbar("Coupon applied on cart"),Ja.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,t={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new tn().process(t);let r={action:this.containsCTA()?N.CAMPAIGN_CLICKED_ACTIVITY:N.CAMPAIGN_CLOSED_ACTIVITY};document.dispatchEvent(new CustomEvent(N.POPUP_ACTIVITY_EVENT,{detail:r}))}},Mi=class{constructor(e){this.scalingFactor=e}getLayoutStyles(e){if(!e)return{display:"block"};let t={display:e.disp};return e.of&&(t.objectFit=e.of),e.pos==="absolute"&&(t.width="auto !important",t.position="absolute",t.right=e.right+"px",t.left=e.left+"px",t.top=e.top+"px",t.bottom=e.bottom+"px"),t}getSizeStyles(e){let t={};return e?.w&&(t.width=e.w),e?.h&&(t.height=e.h),e?.maxW&&(t.maxWidth=e.maxW),e?.maxH&&(t.maxHeight=e.maxH),e?.minW&&(t.minWidth=e.minW),e?.minH&&(t.minHeight=e.minH),t}getBorderStyles(e){if(!e)return{};let t={};return e.radius&&e.radius>0&&(t.borderRadius=this.getSizePx(e.radius)),e.width&&e.width>0&&(t.borderWidth=this.getSizePx(e.width),t.borderStyle=e.style?.toLowerCase(),e.color?this.getColourStyles(e.color,"border-color",t):t.borderColor="black"),t}getFlexStyles(e){return e?{gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai,width:"100%"}:{}}getSpaceStyles(e){let t={};return e?(t.paddingTop=this.getSizePx(e.pt),t.paddingBottom=this.getSizePx(e.pb),t.paddingLeft=this.getSizePx(e.pl),t.paddingRight=this.getSizePx(e.pr),t.marginTop=this.getSizePx(e.mt),t.marginBottom=this.getSizePx(e.mb),t.marginLeft=e.cent?"auto":this.getSizePx(e.ml),t.marginRight=e.cent?"auto":this.getSizePx(e.mr),t):(t.margin="0 !important",t.padding="unset",t)}getBackgroundStyles(e){if(!e)return{};let t={};if(e.glossy){let r="backdrop-filter",n="-webkit-"+r,i=`blur(${e.glossy.radius}px)`;if(!CSS.supports(n,i)&&!CSS.supports(r,i))return{background:e.glossy.fallback.rgba};if(t[n]=i,t[r]=i,e.glossy.color)return this.getColourStyles(e.glossy.color,"background",t)}else if(e.solid){if(e.solid.grad)return this.getGradientStyles(e.solid.grad,"background",t);if(e.solid.hex)return{backgroundColor:e.solid.rgba}}else if(e.img){if(!e.img.src)return{};let r=(e.img.a??0)/100;t.background=`linear-gradient(rgba(0, 0, 0, ${r}), rgba(0, 0, 0, ${r})),url("${e.img.src}") no-repeat center`,t.backgroundSize="cover",e.img.a&&(t["-webkit-backdrop-filter"]=`opacity(${e.img.a})`,t.backdropFilter=`opacity(${e.img.a})`)}return t}getGradientStyles(e,t,r){if(r??={},e.type==="LINEAR"){let n=`linear-gradient(${e.ang}deg, ${e.c1}, ${e.c2}`;e.c3&&(n+=`, ${e.c3}`),n+=")",r[t]=n}return r}getColourStyles(e,t="color",r){return r??={},e?e.grad?this.getGradientStyles(e.grad,t,r):(e.hex&&(r[t]=e.rgba),r):r}getSizePx(e){return this.getScaledSize(e)+"px"}getScaledSize(e){return(e??0)*this.scalingFactor}},Zt=class{renderer=Mt.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,t,r){this.parentHTMLEl=e,this.inappElement=t,this.triggerContext=r,this.stylesConverter=new Mi(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=te(b(b(b(b({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});this.renderer.setStyles(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};this.renderer.setStyles(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let t=(e/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",t)}}processShadow(){let e=this.inappElement.shd;e?this.renderer.setStyle(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):this.renderer.setStyle(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new _n(this.inappElement.trf);e&&e.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",t=>{t.stopPropagation(),new ec(e,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},xr=class extends Zt{constructor(e,t,r){super(e,t,r)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},t=this.inappElement.typography;return t&&(e.fontSize=this.stylesConverter.getSizePx(t.fs),e.fontFamily=N.COOEE+t.fam?.name,e.lineHeight=`${t.lh}`,e.letterSpacing=t.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.renderer.setStyles(this.inappHTMLEl,e),e}processPart(e,t){let r=[];t.u&&r.push("underline"),t.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(e,"font-weight",t.b?"bold":"normal"),this.renderer.setStyle(e,"font-style",t.i?"italic":"normal"),this.renderer.setStyle(e,"text-decoration",r.join(" ")),this.renderer.setStyle(e,"color",t.c??"inherit"),this.renderer.setStyle(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,t=e?fi[e]?.toLowerCase():this.inappElement.typography.alignment;t||(t="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",t)}},Po=class extends xr{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let t=this.renderer.createElement("span");t.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(t,e),this.renderer.appendChild(this.inappHTMLEl,t)}),this.processCommonBlocks()}},Lo=class extends Zt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},Bn=class extends Zt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("img"),this.insertElement()}render(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}},Mo=class Vh extends Zt{constructor(t,r,n){super(t,r,n),this.parent=t,this.inappHTMLEl=this.renderer.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(N.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",Vh.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(t.w)+r.getHorizontal(),i=this.stylesConverter.getScaledSize(t.h)+r.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return b(b({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){if(this.renderer.isParentNotBody()){if(this.triggerContext.triggerData.ian?.isEmbedded()){this.renderer.setStyle(this.inappHTMLEl,"position","block");return}this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}},tc=class extends Zt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(N.IN_APP_CONTAINER_NAME),this}},ki=class extends xr{borderColor="";constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.renderer.setAttribute(this.inappHTMLEl,"placeholder",this.inappElement.placeholderText),this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",t=>{t.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}},rc=class Hh extends ki{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(t,r,n){super(t,r,n)}setInputType(){let t=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","email"),this.renderer.setAttribute(this.inappHTMLEl,"id",t),t}addListener(t,r){t.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(Hh.EMAIL_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},nc=class Gh extends ki{static MOBILE_REGEX=/^\d+$/;constructor(t,r,n){super(t,r,n)}setInputType(){let t=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","tel"),this.renderer.setAttribute(this.inappHTMLEl,"id",t),t}addListener(t,r){t.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(Gh.MOBILE_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},ic=class Vn extends xr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(t,r,n){super(t,r,n),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let t=te(b(b(b({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(t)}getBackgroundStyles(){return{}}processFontBlock(){let t=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",t),this.addStylesToTimer(t),t}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(t){this.elements.forEach(r=>this.renderer.setStyles(r,t))}addTimerChildren(){let t=this.inappElement.show;this.elements=[],t.day&&this.elements.push(this.getChild(Vn.DAYS)),t.hour&&this.elements.push(this.getChild(Vn.HOURS)),t.minute&&this.elements.push(this.getChild(Vn.MINUTES)),t.second&&this.elements.push(this.getChild(Vn.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(t){let r=this.renderer.createElement("div"),n=this.renderer.createElement("span"),i=this.renderer.createElement("span");return i.innerText=t,n.innerText="00",n.id=`lc-${t}`,this.renderer.setStyle(i,"font-size","0.5em"),this.renderer.setStyle(i,"text-align","center"),this.renderer.setStyle(i,"font-family","inherit"),this.renderer.setStyle(n,"text-align","center"),this.renderer.setStyle(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),this.renderer.setStyle(r,"display","flex"),this.renderer.setStyle(r,"flex-direction",this.inappElement.horizontal?"":"column"),this.renderer.setStyle(r,"justify-content","center"),this.renderer.setStyle(r,"align-items","center"),this.renderer.setStyle(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let t=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${Vn.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${Vn.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${Vn.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${Vn.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(t)}},oc=class extends xr{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("select"),this.insertElement()}render(){this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",t=>{t.stopPropagation()}),e.addEventListener("change",()=>{let t=new Sr(JSON.parse(e.value));this.updateItems(t)})}updateItems(e){let t=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[t.toEmbed(e)];let r=this.parentHTMLEl.querySelector("#coo-13");if(!r)return;let n=e.imgs[0]??t.imgs?.at(0);n?.url&&r.setAttribute("src",n.url)}addOptions(){let e=this.triggerContext.triggerData.items,t=this.inappHTMLEl;if(!e?.length){t.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(n=>{t.add(this.createOption(n.name??"Default",n,n.mID===r?.vID))})}createOption(e,t,r){let n=this.renderer.createElement("option");return n.text=e,n.value=JSON.stringify(t),r&&(n.selected=!0),t||(n.disabled=!0),n}},sc=class extends Bn{constructor(e,t,r){super(e,t,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},Bi=class qo{static ACTIVE_TRIGGER_DATA;renderer=Mt.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(t){this.safeHTTP=de.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(t)}setParentContainer(t){this.parent=t??document.body,this.renderer.setParentContainer(this.parent)}render(t){this.renderEngagement(new Dt(t))}async renderEngagement(t){if(this.triggerContext=new Li(new Date,t),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=t.ian,(this.renderer.isMobile()||t.previewType==="mobile")&&this.ian.overrideForMobileView(),this.ian.isEmbedded()){let r=document.querySelector(this.ian.getEmbeddedSelector());this.setParentContainer(r)}await this.preloadImages(t),t.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},t.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!ze.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=ze.get().onToggle().subscribe(({open:t})=>{!t&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){qo.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData;try{this.startRendering()}catch(t){Le.getInstance().captureException(t,{triggerData:JSON.stringify(this.triggerContext.triggerData)});return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let t=this.triggerContext.triggerData;if(!t.previewType&&qo.ACTIVE_TRIGGER_DATA){let n={triggerShown:new Zr(qo.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(t,n),!0}if(ue.get().isGoKwikPopupOpen)return this.skipTrigger(t,{reason:"GoKwik popup is open"}),!0;let r=N.PAYMENT_MODAL_DETAILS.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(t,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Mo(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(t){throw w.error(t),t}}sendTriggerDisplayed(){let t={};this.triggerContext.triggerData.items?.length&&(t.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new Ee(N.EVENT_TRIGGER_DISPLAYED,t,this.triggerContext.triggerData);this.safeHTTP.sendEvent(r);let n={action:N.CAMPAIGN_DISPLAYED_ACTIVITY};document.dispatchEvent(new CustomEvent(N.POPUP_ACTIVITY_EVENT,{detail:n}))}sendTriggerClosed(t){let r=t.eventName;delete t.eventName;let n=new Ee(r,t,this.triggerContext.triggerData);n.name===N.EVENT_TRIGGER_CLICKED&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.safeHTTP.sendEvent(n)}addEnterAnimation(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500})}renderElement(t,r,n){r instanceof gi?new rc(t,r,n).render():r instanceof yi?new nc(t,r,n).render():r instanceof zr?new Po(t,r,n).render():r instanceof vi?new sc(t,r,n).render():r instanceof kr?new Bn(t,r,n).render():r instanceof Sn?new Lo(t,r,n).render():r instanceof di?new ic(t,r,n).render():r instanceof hi?new oc(t,r,n).render():w.error("Unsupported element type- "+r.type)}renderContainer(t){let r=this.ian?.cont;r&&(this.containerHTMLElement=new tc(this.rootContainer,r,t).render().getHTMLElement(),new Xa().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,t)}),this.addEnterAnimation(this.ian.anim))}closeInApp(t){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),qo.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){Mt.get().removeInApp(this.triggerContext)}skipTrigger(t,r){let n=new Ee(N.EVENT_CAMPAIGN_REJECTED,r,t);this.safeHTTP.sendEvent(n)}async preloadImages(t){let r=t.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let s=i.bg?.img?.src;if(s&&n.push(this.getPromise(s)),i.t===1){let o=i.src;if(!o)return;n.push(this.getPromise(o))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(t){return new Promise(r=>{let n=new Image;n.onload=r,n.src=t,n.style.display="none"})}},ch=Se(Rr()),lh=Se(ri()),ac=class{triggerData;safeHttpService=de.getInstance();render(e){e.contentSource===ch.EngagementContentSource.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){w.warn("Received invalid trigger callback");return}switch(t.type){case"open":this.safeHttpService.sendEvent(new Ee(N.EVENT_TRIGGER_DISPLAYED,{form:{id:t.formId}},this.triggerData));break;case"stepSubmit":{let r=this.getFormDetails(t);this.safeHttpService.sendEvent(new Ee(N.EVENT_FORM_SUBMITTED,{form:r},this.triggerData)),this.safeHttpService.updateProfile(r);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.safeHttpService.sendEvent(new Ee(N.EVENT_TRIGGER_CLOSED,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},r=e.metaData;if(lh.JSUtils.hasKeys(r)){let n=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(r).forEach(o=>{n.includes(o)||(t[o]=r[o])}),t.email=r.$email??r.email,t.mobile=r.$phone_number??r.phone_number;let i=r.$first_name??r.first_name,s=r.$last_name??r.last_name;(i?.length||s?.length)&&(t.name=i+" "+s)}return t}},cc=class{static trackIntent(e){if(!this.isInstalled()){w.log("Facebook pixel not installed");return}if(!Pe.get().pixelPush){w.log("Facebook pixel push not enabled");return}let t=bn[e.intent]?.toLowerCase(),r=e.segmentName;!t&&!r||(w.debug(`Sending ${t} intent and ${r} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:t,segment_value:e.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}},Ui=class{static async refreshItems(e){if(e.isCartEmbed()&&!e.isSubscriptionUpsell()){let i=(await fe.getCurrent().getNormalisedCart()).items.map(s=>s.mID);e.items=e.items.filter(s=>!i.includes(s.mID))}if(Pe.get().currencyCount<=1)return e.items;let t=e.items.length,r=e.items.map(i=>this.updatedItem(i,e.engagementID)),n=(await Promise.all(r)).filter(i=>i!=null);if(t&&!n.length){let i="Failed to fetch any product from Ajax API",s=new Ee(N.EVENT_CAMPAIGN_FAILED,{reason:i,currency:e.currency},e);throw de.getInstance().sendEvent(s),new Error(i)}if(e.isCartRecovery()){let i=fe.getCurrent().items,s=[];for(let o of n)for(let c of o.vars){if(!c.isAvailable)continue;let u=i.find(h=>h.variant_id.toString()===c.mID);if(!u)continue;let d=new Nt(o);d.name=u.title;let g=new Sr(c);g.name=u.variant_title,g.price.d=u.discounted_price/100,d.variants=[g],s.push(d)}return s}return n}static async updatedItem(e,t){let r=e,n=Le.getInstance(),i=se.get(yt),s,o=`/products/${r.slug}.js`;try{s=await i.request(o)}catch(u){return w.error(`Failed to fetch ${o}`,u),u instanceof Response?n.captureMessage(`Shopify product fetch failed ${u.status}`,"error",{item:r,path:o},{"engagement.id":t}):n.captureException(u,{item:r,path:o},{"engagement.id":t}),null}if(!s)return w.error("Item not found after AJAX call for:",r),null;r.name=s.title,r.tags=s.tags;let c=r.selectedOrFirstVariant.value;return r.vars.map(u=>{let d=s.variants.find(g=>g.id===+u.mID);u.name=d.title,u.isAvailable=d.available,u.price.d=d.price?d.price/100:d.price,u.price.effective=u.price.d,u.price.cmp=d.compare_at_price?d.compare_at_price/100:d.compare_at_price,+c.mID===d.id&&(c.effectivePrice.value=u.price.d)}),r}},rn=class Wh{static INSTANCE;httpService=se.get(yt);sentryService=se.get(Le);sessionManager=se.get(qe);runtime=ue.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Wh),this.INSTANCE}sendSilently(t){this.send(t).catch(r=>w.error(`Failed to send ${t.name}`,r))}async send(t){if(w.debug(`Sending event ${t.name}`),er.prepend(`Sending event <strong>${t.name}</strong> with id ${t.id}`),this.shouldReject(t)){w.warn(`Rejecting event ${t.name}`);return}await Promise.all([this.addSessionContext(t),this.addShopifyContext(t)]),this.addShopifyAttributes(),t.name!==N.EVENT_APP_BACKGROUND&&this.runtime.setActive(),t.currentItem=this.runtime.getCurrentItem(),t.locale=this.runtime.locale,this.httpService.post("/v1/event/track",t).then(async r=>{w.log("\u2705 Event tracked:",t.name),er.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(t,r)}).catch(r=>{w.error(`Error sending event ${t.name} to server`,r)})}shouldReject(t){return t.trigger?.triggerID==="test"||t.trigger?.triggerID==="preview"?(w.warn("Not sending event as this is a test trigger"),!0):!1}async addSessionContext(t){let r=await this.sessionManager.checkSessionAndGetContext();t.sessionID=r[0],t.sessionNumber=r[1],t.landingPage=r[2],t.page=Tr.parseFromCurrent()}async addShopifyContext(t){if(ke.isShopify())try{t.cart=await fe.getCurrent().getNormalisedCart()}catch(r){w.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(t,r){this.renderWidgetIfAny(t,r).catch(n=>{w.error("Failed to display a campaign",n,t,r),this.sentryService.captureException(n,{event:t,response:r})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(t,r){if(!r.triggerData){w.log(`Nothing to engage after ${t.name}`);return}w.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Dt(r.triggerData);n.occurred=t.occurred;let i;try{i=await Ui.refreshItems(n)}catch(s){w.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===uh.EngagementContentSource.KLAVIYO){new ac().render(n);return}new Bi().renderEngagement(n).catch(s=>{w.error("Failed to render popup",s),this.sentryService.captureException(s,{event:t,triggerData:n})})}utiliseIntentIfCalculated(t){t.intent&&(Pi.trackIntent(t.intent),cc.trackIntent(t),er.prepend(`Intent is <strong>${bn[t.intent]}</strong>`))}addShopifyAttributes(){ke.isShopify()&&fe.getCurrent().addCooeeAttributes().catch(t=>{w.error("Fail to add attributes in cart",t)})}},de=class zh{static INSTANCE;httpApiService=yt.getInstance();eventAPIService=rn.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zh),this.INSTANCE}sendEvent(t){w.debug(`Waiting for auth to send event ${t.name}`),qe.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(t)})}updateProfile(t){qe.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(t??{})})}trackOrder(t){qe.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(t)})}updateDeviceProps(t){qe.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:t})})}generateDiscount(t){return this.httpApiService.generateDiscount(t)}},er=class{static isOn=!1;static element;static watch(){let e=w.getDebugParam();(e==="1"||e==="on")&&de.getInstance().updateDeviceProps({debugTill:this.getDebugMillis()}),e==="on"?sessionStorage.cooeeDebug="1":e==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())}static prepend(e){if(!this.isOn)return;let t=document.createElement("div");t.innerHTML="&#x2022; "+new Date().toLocaleString()+" - "+e,this.element.prepend(t)}static renderDebugBar(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),J.onDocumentLoaded(()=>{document.body.appendChild(this.element)})}static dragElement(){let e=0,t=0,r=0,n=0,i=c=>{c=c||window.event,c.preventDefault(),r=c.clientX,n=c.clientY,document.onmouseup=o,document.onmousemove=s},s=c=>{c=c||window.event,c.preventDefault(),e=r-c.clientX,t=n-c.clientY,r=c.clientX,n=c.clientY,this.element.style.top=this.element.offsetTop-t+"px",this.element.style.left=this.element.offsetLeft-e+"px"},o=()=>{document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=i}static getDebugMillis(){return new Date().getTime()+6*60*60*1e3}},ko=class extends Gr{static storeName="app";static{this.storage=Zn(this.storeName)}},lc=class{static processConfiguration(){let e=Pe.get();!e.gaMeasurementID||!e.gaEnabled||this.sendClientID()}static async sendClientID(){let e=await this.getClientID();e&&de.getInstance().updateDeviceProps({gaClientID:e})}static async getClientID(){let e=await De.get(oe.GA_CLIENT_ID),t=await this.getClientIDViaGTag();if(e!==t)return await De.set(oe.GA_CLIENT_ID,t),t}static async getClientIDViaGTag(){let e=Pe.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag("get",e,"client_id",r=>{t(r)})})}},uc=class qh{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new qh),this.INSTANCE}init(){ko.get(oe.APP_CONFIG,{}).then(t=>this.updateGlobalConfig(t))}async processAppConfigurations(t){w.log("Received app configuration",t),t.currencyCount=t.currencies?.length;let r=this.updateGlobalConfig(t);ko.set(oe.APP_CONFIG,r).catch(n=>w.error(n)),lc.processConfiguration(),r.website&&(ct.injectRawScript(r.website.commonJS),ct.injectRawCSS(r.website.commonCSS)),ze.get().onToggle().subscribe(async({open:n})=>{w.info("Cart drawer is now",n?"open":"closed"),n&&(se.get(cr).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(t){let r=we.globalRef.config.update(t);return ze.forceUpdate(),w.debug("App configurations",r),r}async trackViewCartEvent(){let t=await fe.getCurrent().getNormalisedCart(),r={value:t.amount,currency:t.currency},n={items:t.items,amount:r,drawer:!0};de.getInstance().sendEvent(new Ee(N.EVENT_VIEW_CART,n))}},ph=Se(ep()),pc=class Lc{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(t){this.adID=t.adID,this.campaignID=t.campaignID,this.source=t.source}static getAdParams(){let t;try{t=new ph.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(t.getParams().keys()).includes(n)))return r={source:"META",adID:t.getQueryParam("ad_id")?.trim(),campaignID:t.getQueryParam("campaign_id")?.trim()},new Lc(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(t.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Lc(r)}},kn=class Kh{static INSTANCE;httpAPIService=yt.getInstance();coreService=uc.getInstance();sentryService=Le.getInstance();sdkToken="";userID="";deviceID="";appID="";shopifyShop="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Kh),this.INSTANCE}init(t){this.appID=t.appID,this.shopifyShop=t.shopifyShop}async storeAndPopulateAuthData(t){t&&(t.userID&&(this.userID=t.userID,await De.set(oe.ID,t.userID)),t.deviceID&&(this.deviceID=t.deviceID,await De.set(oe.DEVICE_ID,t.deviceID)),t.sdkToken&&(this.sdkToken=t.sdkToken,await De.set(oe.SDK_TOKEN,t.sdkToken)),this.updateAPIClient())}async validateSession(t){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),w.log("Validating session with server");let r=await this.getSessionValidateData(t);try{let n=await this.httpAPIService.validateSession(r);w.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw w.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await De.get(oe.SDK_TOKEN),!this.sdkToken){w.warn("No SDK token found in local storage");return}this.userID=await De.get(oe.ID),this.deviceID=await De.get(oe.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){w.debug("SDK Token:",this.sdkToken),w.log("Device ID:",this.deviceID),w.log("User ID:",this.userID),Pi.trackDeviceID(this.deviceID),er.prepend(`Device ID: <strong>${this.deviceID}</strong>`),this.httpAPIService.setAPIToken(this.sdkToken),this.sentryService.setGlobalContext("Visitor Info",{device_id:this.deviceID,user_id:this.userID}),this.sentryService.setUser({id:this.deviceID})}async getSessionValidateData(t){let r=await new Ka().get();r.host=location.origin;try{(await ih())?.isPrivate&&(r.private=!0)}catch(i){fh.default.error("Unable to detect private/incognito window",i)}let n=await De.get(oe.DEVICE_ID);return n||(n=new rt().toHexString(),await De.set(oe.DEVICE_ID,n)),te(b({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},t),{sdk:N.SDK,page:Tr.parseFromCurrent(),ad:pc.getAdParams(),occurred:this.getSessionStartTime(ue.get().jsLoadTime),currentItem:ue.get().getCurrentItem(),cart:await fe.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let t=await De.get(oe.FIRST_SEEN),r=t?new Date(t):new Date;t||await De.set(oe.FIRST_SEEN,r.toISOString()),this.httpAPIService.setFirstSeen(r),this.sentryService.setGlobalContext("Visitor Info",{first_seen:r.toISOString()})}getSessionStartTime(t){return(new Date().getTime()-t.getTime())/1e3>N.IDLE_TIME_IN_SECONDS?new Date:t}},qe=class Ko{static replaySubject=new Do(1);static INSTANCE;sentryService=se.get(Le);lock=new ei;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Ko),this.INSTANCE}init(t){if(w.debug("Initialising SDK",t),nh(navigator.userAgent)){w.info("This seems to be a bot. Disabling SDK");return}kn.getInstance().init(t),Ko.INSTANCE.checkForNewSession(!0).then(async()=>{Ko.replaySubject.next(!0),Ko.replaySubject.complete()}).catch(r=>{w.error("Unable to initiate session",r)})}getCurrentSessionID(){return nt.set(oe.SESSION_LAST_USED_TIME,new Date().getTime()),nt.get(oe.ID,"")}async checkSessionAndGetContext(){return await this.checkForNewSession(),this.getContext()}async getContext(){let t=await Promise.all([this.getCurrentSessionID(),this.getCurrentSessionNumber(),this.getLandingPage()]);return this.sentryService.setGlobalContext("Visitor Session",{id:t[0],number:t[1],landing_page:t[2]}),t}async checkForNewSession(t){await this.lock.acquire();let r=!1;if(await this.isNewSessionRequired()?(await this.startNewSession(),t=!0,r=!0):await this.notSynced()&&(r=!0),t){let n=await this.getContext();await kn.getInstance().validateSession({sessionID:n[0],sessionNumber:n[1],landingPage:n[2],newSession:r}),await nt.set(oe.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){w.debug("Starting new session"),await nt.clear(),w.debug("Cleared SessionStorage before starting new session");let t=new Date,r=new rt().toHexString();w.debug("New session ID to be used",r);let n=await De.get(oe.SESSION_NUMBER,0)+1;er.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([De.set(oe.SESSION_NUMBER,n),nt.set(oe.ID,r),nt.set(oe.SESSION_LAST_USED_TIME,t.getTime()),nt.set(oe.SESSION_LANDING_PAGE,Tr.parseFromCurrent())])}getLandingPage(){return nt.get(oe.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return De.get(oe.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await nt.get(oe.ID))return!0;let t=await nt.get(oe.SESSION_LAST_USED_TIME,0);return t?(new Date().getTime()-t)/1e3>N.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await nt.get(oe.SESSION_SYNCED,!1)}},Yo=Se(Rr()),vh=Se(Uc()),Eh=Se(ri()),_h=Se(an()),mh=Se(Qo()),dh=Se(an()),Fi=class{constructor(e){this.triggerContext=e}safeHTTP=de.getInstance();eventAPIService=rn.getInstance();async execute(e){let t=ue.get().getCurrentItem(),r=e.clickAction;if(!r)return;let n=e.item,i=this.triggerContext,s=new tn,o=i.triggerData.redirectBehaviour,c=!!i.triggerData.discount.type&&!!r?.applyDiscount,u={selectedVariants:i.triggerData.nonMutableItems.map(_=>({itemMID:_.mID,mID:_.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},d="",g=[],h=[];if(n?h=[n.toEmbed()]:e.embeddedItem&&(h=[e.embeddedItem]),r.at===108){let _=i.selectedItems;if(h=e.embeddedItems??_.map(D=>D.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let D;e.embeddedItems?D=e.embeddedItems.map(M=>({itemMID:M.mID,mID:M.vID,quantity:M.quantity})):D=_.map(M=>({itemMID:M.mID,mID:M.selectedOrFirstVariant.value.mID}));let P=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&P&&(D.push({itemMID:P.mID,mID:P.selectedOrFirstVariant.value.mID,isPrimary:!0}),h.unshift(P.toEmbed())),u.selectedVariants=D,i.triggerData.isBundleOnPDP()&&u.selectedVariants.forEach(M=>{M.mID===t.vID&&(M.isPrimary=!0)})}else u=void 0;g=e.embeddedItems??_}else if(r.at===107){let _=await fe.getCurrent().getNormalisedCart();h=_.items,u.selectedVariants=_.items.map(D=>({itemMID:D.mID,mID:D.vID}))}else if(r.at===102)g=n?[n]:[e.embeddedItem];else if(r.at===101)d=n?ke.getRootPrefix()+"products/"+n.slug:e.embeddedItem?.link;else if(r.at===4){let _=J.isValidURL(r.gu?.u);_&&(d=_.href)}else if(r.at===109){let _=await s.upgradeToSubscription(n,i.triggerData);this.triggerContext.triggerData.skipSubscribedItems&&this.triggerContext.renderer.destroy(),ze.get().refreshUI(_)}else if(r.at===104){let _=this.triggerContext.triggerData.collections?.[0];_&&(d="collections/"+_.handle)}if(this.sendTriggerClicked(h,{from:"button"},e.video),w.debug({redirectPath:d,redirectBehaviour:o,hasDiscount:c}),!c&&d){location.href=d;return}let m,E=!1;try{m=await this.getOrGenerateDiscountCode(u),w.debug("Discount code (if any) to apply",m)}catch(_){if(!this.triggerContext.triggerData.isBYOB()){dh.default.error("Unable to get a discount code",_);return}}if(m&&r.at===103)await s.copyDiscountCode(m);else if(r.at===110){let _=await s.createNewCart(t,m,i.triggerData);_&&(location.href=_);return}try{m&&await en.applyWithStorefront(m)}catch(_){w.error(_),E=!0}let v;if(g?.length&&(v=await s.addToCart(g,i.triggerData)),E&&m){en.navigate(m,o,d);return}if(d){location.href=d;return}en.navigateWithoutDiscount(o,v)}sendTriggerClicked(e,t,r){let n=new Ee(N.EVENT_TRIGGER_CLICKED,t,this.triggerContext.triggerData);n.items=e,r?.id&&(n.videos=[r.id]),this.eventAPIService.sendSilently(n)}async getOrGenerateDiscountCode(e){let t=this.triggerContext.triggerData.discount;if(!t?.type)return;let r="";if(t.type===mh.DiscountType.STATIC){if(!t.code)throw Le.getInstance().captureMessage("No discount code found","warning",{triggerContext:this.triggerContext}),new Error("No discount code found");return t.code}if(e){if(r=await this.generateDiscount(e),!r)throw w.error("No discount code found",e),new Error("Discount code not found or generated");return r}}async generateDiscount(e){try{return(await this.safeHTTP.generateDiscount(e))?.code}catch(t){throw J.showSnackbar("Failed to generate a discount code"),w.error("Error generating discount code",t,e),Le.getInstance().captureMessage("Failed to generate discount code","error",{discountData:JSON.stringify(e),triggerContext:this.triggerContext,error:t}),t}}},Ne=class extends pr{stylesConverter=new Mi(1);renderer=Mt.get();mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=this.renderer.isMobile()?"sm":"lg",this.clickExecutor=new Fi(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),b(b(te(b(b(b(b(b(b({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:t,rhs:r}=e;switch(e.op){case"eq":return t===r;case"gt":return+t>+r;case"gte":return+t>=+r;case"lt":return+t<+r;case"lte":return+t<=+r;case"ne":return t!==r;case"null":return t==null;case"empty":return t.trim()==="";case"in":return new RegExp(`\\b${r}\\b`).test(t);case"nin":return!new RegExp(`\\b${r}\\b`).test(t);default:return w.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,this.renderer.isMobile()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=b(b({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,t){this.clickExecutor.sendTriggerClicked(e,t)}async onClick(e,t){e.stopPropagation(),!t.clickAction&&(t.clickAction=this.props.element.clc),await this.clickExecutor.execute(t)}},nS=0,tH=Array.isArray;function $(e,t,r,n,i,s){t||(t={});var o,c,u=t;if("ref"in u)for(c in u={},t)c=="ref"?o=t[c]:u[c]=t[c];var d={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--nS,__i:-1,__u:0,__source:i,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(c in o)u[c]===void 0&&(u[c]=o[c]);return _e.vnode&&_e.vnode(d),d}var Ft=class extends Ne{componentDidMount(){this.setState(()=>({text:this.props.element.text})),ut(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),t=this.state.text;return t||(e.display="none",t=""),$("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:$("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:t}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,t={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},r=wt.render(JSON.stringify(this.props.element),t),n=new st(JSON.parse(r));if(!this.matchWhenCondition(n.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:n.text}))}getTypoStyles(){let e={},t=this.mediaStyle.typo??new tt;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily=t.fam.name||"inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,e.textDecoration=t.td??"none",this.stylesConverter.getColourStyles(t.tc,"color",e),e}getComponentStyles(){return b({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}},Un=class extends Ft{render(){return $("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:$("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return te(b({},super.getComponentStyles()),{cursor:"pointer"})}},sp=class extends pr{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?$("div",{style:b(b({},this.getElementStyle()),this.props.styles),children:[$("span",{children:this.props.time}),$("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):$("div",{style:b(b({},this.getElementStyle()),this.props.styles),children:[$("span",{style:this.getTimeLabelStyle(),children:this.props.label}),$("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},Bo=class extends Ft{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>b({},this.labels)),this.processAndStartTimer()}render(){return $("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>$(sp,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return b(b({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>b({},this.labels))})}},Uo=class extends Ne{componentDidMount(){ut(()=>{this.setState(()=>({checked:this.props.item.selected.value}))})}render(){return $("div",{style:this.getCompiledStyles(),className:"lc-checkbox",children:$("input",{type:"checkbox",checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:"auto"}})})}onChange(e){let{checked:t}=e.target;this.props.item.selected.value=t}getTypoStyles(){let e={},t=this.mediaStyle.typo??new tt;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return te(b({},this.getTypoStyles()),{display:"flex"})}},hh=Se(Rr()),Fr=class extends Ne{constructor(e,t){super(e,t)}render(){let e=this.props.element[this.deviceTypeKey],t=e?.src||this.props.element.src||this.props.element.lg?.src;return $("img",{onClick:this.customOnClick.bind(this),className:"lc-image",alt:e?.name||"Image",onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:t,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===hh.ClickActionType.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick("image")}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!=="absolute")return{};let t={zIndex:e.zIndex,cursor:this.props.element.clc?.at?"pointer":"auto"};return this.mediaStyle.size?.w&&(t.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(t.height=this.mediaStyle.size.h),t}handleMouseEnter(e){let t=this.props.element[this.deviceTypeKey]?.secondarySrc;t&&(e.currentTarget.src=t)}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src}},Hr=class extends Ne{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return $("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:$(nn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new Ei,t={display:"flex",gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap==="nowrap"&&e.scroll&&(e.dir==="column"?t["overflow-y"]="auto":t["overflow-x"]="auto"),t}},Fo=class extends Hr{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return $("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:$(Hi,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}},Ho=class extends Ne{render(){return $("select",{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??"",onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){ut(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},t=this.mediaStyle.typo??new tt;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily="inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility="hidden"),b(b({},e),this.getTypoStyles())}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return[];this.props.triggerContext.triggerData.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=!0,t.changeSellingPlan(t.sellingPlans[0])):e.push($("option",{value:"",selected:!t.selectedSellingPlan,children:"One time purchase"}));for(let r of t.sellingPlans??[])e.push($("option",{value:r.mID,selected:r.isSelected,children:r.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(r=>r.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0}},gh=Se(kc()),$o=class extends Ne{colorRegex=new RegExp('fill="#[a-zA-Z0-9]+"');constructor(){super(),wt.escape=gh.MustacheUtils.escapeHtml}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display="none",t=""),$("div",{style:e,className:"lc-star-rating",dangerouslySetInnerHTML:{__html:t}})}getRating(){let e=this.props.element.fullStar,t=this.props.element.halfStart,r={size:this.props.element.iconSize,color:this.props.element.c.hex};e=wt.render(e,{svg:r}),t=wt.render(t,{svg:r});let n=this.props.review;if(!n?.rating)return"";let i="";if(this.props.element.showSingleStar)i=e;else{let s=5,o=`${n.rating}`.split(".");for(let c=0;c<+o[0];c++)i+=e,s--;o[1]&&(i+=t,s--);for(let c=0;c<s;c++)i+=e.replace(this.colorRegex,'fill="#f1f1f1')}return i}getComponentStyles(){return{display:"flex",alignItems:"center"}}},jo=class extends Ne{render(){return $("select",{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){ut(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},t=this.mediaStyle.typo??new tt;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily="inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"&&(e.visibility="hidden"),b(b({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push($("option",{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value;this.props.item.selectedOrFirstVariant.value=this.props.item.vars.find(r=>r.mID===t)}},Hi=class extends Ne{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"}))}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let t=e;return $(Fo,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?$(Uo,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let t=e,r=this.props.item,n=r.variantImage??r.imageURL,i=r.variantSecondaryImage??r.secondaryImageURL;t.lg=t.sm={src:n,name:r.name,secondarySrc:i};let s=$(Fr,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:$("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block"},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let t=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"?void 0:$(jo,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?$(Ho,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?$($o,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?$(Un,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):$(nn,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}renderProductTitle(e){let t=$(Ft,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:$("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block",textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:t})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e})}onMouseEnter(){this.setState(()=>({decoration:"underline"}))}onMouseLeave(){this.setState(()=>({decoration:"unset"}))}},yh=Se(Qo()),Fn=class extends Ne{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"}))}render(){let e=JSON.stringify(this.props.element),t=wt.render(e,this.getProductData());if(this.productElement=new Xr(JSON.parse(t)),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return $("div",{style:b({},this.getCompiledStyles()),class:"lc-single-product",children:$(Hi,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return{flexShrink:0}}getProductData(){if(!this.props.item)return{};let e=this.props.item.selectedOrFirstVariant.value,t=e.price,r=this.props.item.name,n=this.props.item.category,i=J.formatCurrency(t.d,!0),s=this.props.item.variantImage??this.props.item.imageURL,o=this.props.item.meta,c=this.props.item.tags?.join(",")??"",u=this.props.item.reviews?.rating,d=this.props.item.reviews?.totalReviews,g=t.cmp&&t.cmp>t.d,h=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity,m={name:r,price:i,quantity:h,image_url:s,meta:o,category:n,rating:u,reviews:d,tags:c},E=e.effectivePrice.value!==t.d;E&&(m.effective_price=J.formatCurrency(e.effectivePrice.value));let v=this.props.triggerContext.triggerData.discount.type===yh.DiscountType.BXGY;if(!E&&v&&(m.effective_price=J.formatCurrency(e.effectivePrice.value),m.price=""),g){m.compare_price=J.formatCurrency(t.cmp);let D=t.cmp-t.d;m.discount_percent=(D/t.cmp*100).toFixed(0),m.discount_price=J.formatCurrency(D)}let _={name:e.name,quantity:this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(e.quantity):e.quantity};return{product:m,variant:_,svg:{color:()=>"{{svg.color}}",size:()=>"{{svg.size}}"}}}};function fc(e,t){if(!e||!window.Swiper)return;let r=new window.Swiper(e,{loop:!0,slidesPerView:t.maxInRow,spaceBetween:t.gap+"px",pagination:{type:t.pagination.type,el:e.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(n,i)=>`
63
+ `,tn=class{async addToCart(e,t){if(!e.length)return;let r=e.map(c=>{let{vID:u,quantity:d}=this.getVIDAndQuantity(c);return{id:u?+u:+c.mID,quantity:d,properties:t.getPrivateAttributesForLineItem()}}),n=un("cart/add.js"),i={items:r},s=Ge.get();s.isMiniCart()?i.sections=["mini-cart"]:s.isShopifyDefaultDrawer()&&(i.sections=s.element.getSectionsToRender?.().map(c=>c.section??c.id));let o=JSON.stringify(i);try{let c=await fetch(n,{body:o,method:"post",headers:{"Content-Type":"application/json"}});if(c.status===200||c.status===302)return w.log(`Added ${e.length} items to Cart`),Yr("Product added to your cart"),c.json()}catch(c){w.error("Failed to add product in cart",c)}}async updateLineItem(e,t){if(!xh.JSUtils.hasKeys(t)){w.warn("No update fields provided");return}let r=un("cart/change.js"),n=b({id:e.key},t),i=JSON.stringify(n);try{let s=await fetch(r,{body:i,method:"post",headers:{"Content-Type":"application/json"}});(s.status===200||s.status===302)&&(w.log(`Updated ${e}`),pe.getCurrent().update(s.json()))}catch(s){w.error("Failed to update item in cart",s,e)}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),w.log(`Code-${e} copied`),Yr("Discount code copied")}catch(t){w.error("Failed to copy code",t)}}goToItem(e){if(!e?.link)return;let t=Yf(e.link);t&&(location.pathname=ri()+"products/"+t)}async upgradeToSubscription(e,t){if(!e){w.warn("Trying to upgrade to subscription with no item");return}let r=await pe.getCurrent().getNormalisedCart(),n=e.selectedOrFirstVariant.value,i=r.items.findIndex(d=>d.vID===n.mID),s=n.selectedSellingPlan.value,o=un("cart/change.js"),c={line:i+1,selling_plan:s?.mID||null,properties:t.getPrivateAttributesForLineItem()},u=JSON.stringify(c);try{let d=await fetch(o,{body:u,method:"post",headers:{"Content-Type":"application/json"}});if(d.status===200||d.status===302){w.log(`Upgraded ${e} selling plan`),Yr("Line item updated");let g=await d.json();return pe.getCurrent().update(g),g}}catch(d){w.error("Failed to update subscription for item in cart",d)}}async createNewCart(e,t,r){let n=Pe.get().storefrontToken;if(!n)throw new Error("Storefront token not set for the store");if(!e?.vID){w.error("No variant ID found to perform Buy now",e);return}let i=t?[t]:[],s=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:r.getKVFormatPrivateAttributesForLineItem()}],o=await Zs(),c=new Headers;c.append("Content-Type","application/json"),c.append("X-Shopify-Storefront-Access-Token",n);let u=JSON.stringify({query:wS,variables:{input:{lines:s,discountCodes:i,attributes:o}}});return(await ht.getInstance().request(N.GRAPHQL_API_PATH,{method:"POST",headers:c,body:u})).data?.cartCreate?.cart?.checkoutUrl}async process(e){let t=e.clickAction,r=e.items,n=e.triggerData;if(t.at){let i=t;if(w.log(`Performing ${JSON.stringify(i)} action`),i.at===101)r?.length&&this.goToItem(r[0]);else if(i.at===102)r?.length&&await this.addToCart(r,n);else if(i.at===103)await this.copyDiscountCode(n.discount.code);else if(i.at===105)Ge.get().open();else if(i.at===104){let s=e.collections;if(!s?.length)return;location.pathname=ri()+"collections/"+s[0].handle}}t.applyDiscount&&n.discount?.code&&en.navigate(n.discount.code,n.redirectBehaviour)}getVIDAndQuantity(e){let t,r;if(e instanceof ft)t=e.vID,r=e.quantity??1;else{if(!e.vars?.length)return{};t=e.selectedOrFirstVariant.value.mID,r=1}return{vID:t,quantity:r}}},lc=class{apiService;action;triggerContext;constructor(e,t){this.action=e,this.apiService=me.getInstance(),this.triggerContext=t}async execute(){let e=this.containsCTA()?N.EVENT_TRIGGER_CLICKED:N.EVENT_TRIGGER_CLOSED;switch(this.action.at!==106&&await this.closeTriggerAndSendEvent(e),this.action.at){case 2:break;case 4:this.gotoURLAction();break;case 5:this.shareAction();break;case 106:await this.collectFormData();break;case void 0:case 105:break;default:w.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;Qs(e)||(e=`//${e}`),window.open(e,"_self")}}prompt(){let e=this.action.pmpt;e&&(e===2&&this.promptLocationPermission(),e===3&&this.promptPushNotificationPermission(),e===1&&this.promptCameraPermission())}async closeTriggerAndSendEvent(e,t){this.triggerContext.closeInApp(e,t),await this.dispatchEvent()}shareAction(){if(this.action.share){if(!navigator.share){w.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(e=>console.log(e)).catch(e=>console.error(e))}}containsCTA(){return this.action.at&&this.action.at!==1?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}promptLocationPermission(){!navigator.geolocation||!navigator.permissions||navigator.geolocation.getCurrentPosition(e=>{this.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),this.sendPermissionData()})}promptPushNotificationPermission(){if(!("Notification"in window)){w.warn("This browser does not support desktop notification");return}if(Notification.permission!=="default"){this.apiService.updateDeviceProps({pnPerm:Notification.permission});return}Notification.requestPermission().then(()=>{this.sendPermissionData()})}promptCameraPermission(){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally(()=>{this.sendPermissionData()})}checkPermission(e){return navigator.permissions.query({name:e}).then(t=>t.state.toString())}async checkAllPermission(){let e=await this.checkPermission("camera"),t=await this.checkPermission("geolocation"),r=Notification.permission;return{camera:e,location:t,notification:r}}sendPermissionData(){this.checkAllPermission().then(e=>{this.apiService.updateDeviceProps({perm:e})})}async collectFormData(){let e={};for(let t of this.triggerContext.inputs){if(!t.isValid)return;let r=document.getElementById(t.id).value;t.type===51?e.email=r:t.type===52&&(e.mobile=r)}await this.closeTriggerAndSendEvent(N.EVENT_FORM_SUBMITTED,{form:e}),Yr("Coupon applied on cart"),sc.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,t={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new tn().process(t);let r={action:this.containsCTA()?N.CAMPAIGN_CLICKED_ACTIVITY:N.CAMPAIGN_CLOSED_ACTIVITY};document.dispatchEvent(new CustomEvent(N.POPUP_ACTIVITY_EVENT,{detail:r}))}},Hi=class{constructor(e){this.scalingFactor=e}getLayoutStyles(e){if(!e)return{display:"block"};let t={display:e.disp};return e.of&&(t.objectFit=e.of),e.pos==="absolute"&&(t.width="auto !important",t.position="absolute",t.right=e.right+"px",t.left=e.left+"px",t.top=e.top+"px",t.bottom=e.bottom+"px"),t}getSizeStyles(e){let t={};return e?.w&&(t.width=e.w),e?.h&&(t.height=e.h),e?.maxW&&(t.maxWidth=e.maxW),e?.maxH&&(t.maxHeight=e.maxH),e?.minW&&(t.minWidth=e.minW),e?.minH&&(t.minHeight=e.minH),t}getBorderStyles(e){if(!e)return{};let t={};return e.radius&&e.radius>0&&(t.borderRadius=this.getSizePx(e.radius)),e.width&&e.width>0&&(t.borderWidth=this.getSizePx(e.width),t.borderStyle=e.style?.toLowerCase(),e.color?this.getColourStyles(e.color,"border-color",t):t.borderColor="black"),t}getFlexStyles(e){return e?{gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai,width:"100%"}:{}}getSpaceStyles(e){let t={};return e?(t.paddingTop=this.getSizePx(e.pt),t.paddingBottom=this.getSizePx(e.pb),t.paddingLeft=this.getSizePx(e.pl),t.paddingRight=this.getSizePx(e.pr),t.marginTop=this.getSizePx(e.mt),t.marginBottom=this.getSizePx(e.mb),t.marginLeft=e.cent?"auto":this.getSizePx(e.ml),t.marginRight=e.cent?"auto":this.getSizePx(e.mr),t):(t.margin="0 !important",t.padding="unset",t)}getBackgroundStyles(e){if(!e)return{};let t={};if(e.glossy){let r="backdrop-filter",n="-webkit-"+r,i=`blur(${e.glossy.radius}px)`;if(!CSS.supports(n,i)&&!CSS.supports(r,i))return{background:e.glossy.fallback.rgba};if(t[n]=i,t[r]=i,e.glossy.color)return this.getColourStyles(e.glossy.color,"background",t)}else if(e.solid){if(e.solid.grad)return this.getGradientStyles(e.solid.grad,"background",t);if(e.solid.hex)return{backgroundColor:e.solid.rgba}}else if(e.img){if(!e.img.src)return{};let r=(e.img.a??0)/100;t.background=`linear-gradient(rgba(0, 0, 0, ${r}), rgba(0, 0, 0, ${r})),url("${e.img.src}") no-repeat center`,t.backgroundSize="cover",e.img.a&&(t["-webkit-backdrop-filter"]=`opacity(${e.img.a})`,t.backdropFilter=`opacity(${e.img.a})`)}return t}getGradientStyles(e,t,r){if(r??={},e.type==="LINEAR"){let n=`linear-gradient(${e.ang}deg, ${e.c1}, ${e.c2}`;e.c3&&(n+=`, ${e.c3}`),n+=")",r[t]=n}return r}getColourStyles(e,t="color",r){return r??={},e?e.grad?this.getGradientStyles(e.grad,t,r):(e.hex&&(r[t]=e.rgba),r):r}getSizePx(e){return this.getScaledSize(e)+"px"}getScaledSize(e){return(e??0)*this.scalingFactor}},Qt=class{renderer=Pt.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,t,r){this.parentHTMLEl=e,this.inappElement=t,this.triggerContext=r,this.stylesConverter=new Hi(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=ee(b(b(b(b({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});this.renderer.setStyles(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};this.renderer.setStyles(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let t=(e/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",t)}}processShadow(){let e=this.inappElement.shd;e?this.renderer.setStyle(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):this.renderer.setStyle(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new bn(this.inappElement.trf);e&&e.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",t=>{t.stopPropagation(),new lc(e,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},Cr=class extends Qt{constructor(e,t,r){super(e,t,r)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},t=this.inappElement.typography;return t&&(e.fontSize=this.stylesConverter.getSizePx(t.fs),e.fontFamily=N.COOEE+t.fam?.name,e.lineHeight=`${t.lh}`,e.letterSpacing=t.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.renderer.setStyles(this.inappHTMLEl,e),e}processPart(e,t){let r=[];t.u&&r.push("underline"),t.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(e,"font-weight",t.b?"bold":"normal"),this.renderer.setStyle(e,"font-style",t.i?"italic":"normal"),this.renderer.setStyle(e,"text-decoration",r.join(" ")),this.renderer.setStyle(e,"color",t.c??"inherit"),this.renderer.setStyle(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,t=e?yi[e]?.toLowerCase():this.inappElement.typography.alignment;t||(t="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",t)}},Uo=class extends Cr{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let t=this.renderer.createElement("span");t.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(t,e),this.renderer.appendChild(this.inappHTMLEl,t)}),this.processCommonBlocks()}},Fo=class extends Qt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},Fn=class extends Qt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("img"),this.insertElement()}render(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}},Ho=class Np extends Qt{constructor(t,r,n){super(t,r,n),this.parent=t,this.inappHTMLEl=this.renderer.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(N.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",Np.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(t.w)+r.getHorizontal(),i=this.stylesConverter.getScaledSize(t.h)+r.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return b(b({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){if(this.renderer.isParentNotBody()){if(this.triggerContext.triggerData.ian?.isEmbedded()){this.renderer.setStyle(this.inappHTMLEl,"position","block");return}this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}},uc=class extends Qt{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(N.IN_APP_CONTAINER_NAME),this}},$i=class extends Cr{borderColor="";constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.renderer.setAttribute(this.inappHTMLEl,"placeholder",this.inappElement.placeholderText),this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",t=>{t.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}},pc=class Dp extends $i{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(t,r,n){super(t,r,n)}setInputType(){let t=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","email"),this.renderer.setAttribute(this.inappHTMLEl,"id",t),t}addListener(t,r){t.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(Dp.EMAIL_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},fc=class Op extends $i{static MOBILE_REGEX=/^\d+$/;constructor(t,r,n){super(t,r,n)}setInputType(){let t=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","tel"),this.renderer.setAttribute(this.inappHTMLEl,"id",t),t}addListener(t,r){t.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(Op.MOBILE_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},mc=class Gn extends Cr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(t,r,n){super(t,r,n),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let t=ee(b(b(b({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(t)}getBackgroundStyles(){return{}}processFontBlock(){let t=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",t),this.addStylesToTimer(t),t}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(t){this.elements.forEach(r=>this.renderer.setStyles(r,t))}addTimerChildren(){let t=this.inappElement.show;this.elements=[],t.day&&this.elements.push(this.getChild(Gn.DAYS)),t.hour&&this.elements.push(this.getChild(Gn.HOURS)),t.minute&&this.elements.push(this.getChild(Gn.MINUTES)),t.second&&this.elements.push(this.getChild(Gn.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(t){let r=this.renderer.createElement("div"),n=this.renderer.createElement("span"),i=this.renderer.createElement("span");return i.innerText=t,n.innerText="00",n.id=`lc-${t}`,this.renderer.setStyle(i,"font-size","0.5em"),this.renderer.setStyle(i,"text-align","center"),this.renderer.setStyle(i,"font-family","inherit"),this.renderer.setStyle(n,"text-align","center"),this.renderer.setStyle(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),this.renderer.setStyle(r,"display","flex"),this.renderer.setStyle(r,"flex-direction",this.inappElement.horizontal?"":"column"),this.renderer.setStyle(r,"justify-content","center"),this.renderer.setStyle(r,"align-items","center"),this.renderer.setStyle(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let t=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${Gn.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${Gn.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${Gn.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${Gn.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(t)}},dc=class extends Cr{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=this.renderer.createElement("select"),this.insertElement()}render(){this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",t=>{t.stopPropagation()}),e.addEventListener("change",()=>{let t=new _r(JSON.parse(e.value));this.updateItems(t)})}updateItems(e){let t=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[t.toEmbed(e)];let r=this.parentHTMLEl.querySelector("#coo-13");if(!r)return;let n=e.imgs[0]??t.imgs?.at(0);n?.url&&r.setAttribute("src",n.url)}addOptions(){let e=this.triggerContext.triggerData.items,t=this.inappHTMLEl;if(!e?.length){t.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(n=>{t.add(this.createOption(n.name??"Default",n,n.mID===r?.vID))})}createOption(e,t,r){let n=this.renderer.createElement("option");return n.text=e,n.value=JSON.stringify(t),r&&(n.selected=!0),t||(n.disabled=!0),n}},hc=class extends Fn{constructor(e,t,r){super(e,t,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},ji=class is{static ACTIVE_TRIGGER_DATA;renderer=Pt.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(t){this.safeHTTP=me.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(t)}setParentContainer(t){this.parent=t??document.body,this.renderer.setParentContainer(this.parent)}render(t){this.renderEngagement(new Ct(t))}async renderEngagement(t){if(this.triggerContext=new Fi(new Date,t),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=t.ian,(this.renderer.isMobile()||t.previewType==="mobile")&&this.ian.overrideForMobileView(),this.ian.isEmbedded()){let r=document.querySelector(this.ian.getEmbeddedSelector());this.setParentContainer(r)}await this.preloadImages(t),t.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},t.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!Ge.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=Ge.get().onToggle().subscribe(({open:t})=>{!t&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){is.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData;try{this.startRendering()}catch(t){Oe.getInstance().captureException(t,{triggerData:JSON.stringify(this.triggerContext.triggerData)});return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let t=this.triggerContext.triggerData;if(!t.previewType&&is.ACTIVE_TRIGGER_DATA){let n={triggerShown:new Zr(is.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(t,n),!0}if(le.get().isGoKwikPopupOpen)return this.skipTrigger(t,{reason:"GoKwik popup is open"}),!0;let r=N.PAYMENT_MODAL_DETAILS.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(t,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Ho(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(t){throw w.error(t),t}}sendTriggerDisplayed(){let t={};this.triggerContext.triggerData.items?.length&&(t.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new ve(N.EVENT_TRIGGER_DISPLAYED,t,this.triggerContext.triggerData);this.safeHTTP.sendEvent(r);let n={action:N.CAMPAIGN_DISPLAYED_ACTIVITY};document.dispatchEvent(new CustomEvent(N.POPUP_ACTIVITY_EVENT,{detail:n}))}sendTriggerClosed(t){let r=t.eventName;delete t.eventName;let n=new ve(r,t,this.triggerContext.triggerData);n.name===N.EVENT_TRIGGER_CLICKED&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.safeHTTP.sendEvent(n)}addEnterAnimation(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500})}renderElement(t,r,n){r instanceof Si?new pc(t,r,n).render():r instanceof bi?new fc(t,r,n).render():r instanceof zr?new Uo(t,r,n).render():r instanceof wi?new hc(t,r,n).render():r instanceof Mr?new Fn(t,r,n).render():r instanceof wn?new Fo(t,r,n).render():r instanceof Ei?new mc(t,r,n).render():r instanceof _i?new dc(t,r,n).render():w.error("Unsupported element type- "+r.type)}renderContainer(t){let r=this.ian?.cont;r&&(this.containerHTMLElement=new uc(this.rootContainer,r,t).render().getHTMLElement(),new oc().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,t)}),this.addEnterAnimation(this.ian.anim))}closeInApp(t){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),is.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){Pt.get().removeInApp(this.triggerContext)}skipTrigger(t,r){let n=new ve(N.EVENT_CAMPAIGN_REJECTED,r,t);this.safeHTTP.sendEvent(n)}async preloadImages(t){let r=t.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let s=i.bg?.img?.src;if(s&&n.push(this.getPromise(s)),i.t===1){let o=i.src;if(!o)return;n.push(this.getPromise(o))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(t){return new Promise(r=>{let n=new Image;n.onload=r,n.src=t,n.style.display="none"})}},Dh=_e(Dr()),Rh=_e(oi()),gc=class{triggerData;safeHttpService=me.getInstance();render(e){e.contentSource===Dh.EngagementContentSource.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){w.warn("Received invalid trigger callback");return}switch(t.type){case"open":this.safeHttpService.sendEvent(new ve(N.EVENT_TRIGGER_DISPLAYED,{form:{id:t.formId}},this.triggerData));break;case"stepSubmit":{let r=this.getFormDetails(t);this.safeHttpService.sendEvent(new ve(N.EVENT_FORM_SUBMITTED,{form:r},this.triggerData)),this.safeHttpService.updateProfile(r);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.safeHttpService.sendEvent(new ve(N.EVENT_TRIGGER_CLOSED,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},r=e.metaData;if(Rh.JSUtils.hasKeys(r)){let n=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(r).forEach(o=>{n.includes(o)||(t[o]=r[o])}),t.email=r.$email??r.email,t.mobile=r.$phone_number??r.phone_number;let i=r.$first_name??r.first_name,s=r.$last_name??r.last_name;(i?.length||s?.length)&&(t.name=i+" "+s)}return t}},yc=class{static trackIntent(e){if(!this.isInstalled()){w.log("Facebook pixel not installed");return}if(!Pe.get().pixelPush){w.log("Facebook pixel push not enabled");return}let t=In[e.intent]?.toLowerCase(),r=e.segmentName;!t&&!r||(w.debug(`Sending ${t} intent and ${r} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:t,segment_value:e.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}},Vi=class{static async refreshItems(e){if(e.isCartEmbed()&&!e.isSubscriptionUpsell()){let i=(await pe.getCurrent().getNormalisedCart()).items.map(s=>s.mID);e.items=e.items.filter(s=>!i.includes(s.mID))}if(Pe.get().currencyCount<=1)return e.items;let t=e.items.length,r=e.items.map(i=>this.updatedItem(i,e.engagementID)),n=(await Promise.all(r)).filter(i=>i!=null);if(t&&!n.length){let i="Failed to fetch any product from Ajax API",s=new ve(N.EVENT_CAMPAIGN_FAILED,{reason:i,currency:e.currency},e);throw me.getInstance().sendEvent(s),new Error(i)}if(e.isCartRecovery()){let i=pe.getCurrent().items,s=[];for(let o of n)for(let c of o.vars){if(!c.isAvailable)continue;let u=i.find(h=>h.variant_id.toString()===c.mID);if(!u)continue;let d=new Rt(o);d.name=u.title;let g=new _r(c);g.name=u.variant_title,g.price.d=u.discounted_price/100,d.variants=[g],s.push(d)}return s}return n}static async updatedItem(e,t){let r=e,n=Oe.getInstance(),i=re.get(ht),s,o=`/products/${r.slug}.js`;try{s=await i.request(o)}catch(u){return w.error(`Failed to fetch ${o}`,u),u instanceof Response?n.captureMessage(`Shopify product fetch failed ${u.status}`,"error",{item:r,path:o},{"engagement.id":t}):n.captureException(u,{item:r,path:o},{"engagement.id":t}),null}if(!s)return w.error("Item not found after AJAX call for:",r),null;r.name=s.title,r.tags=s.tags;let c=r.selectedOrFirstVariant.value;return r.vars.map(u=>{let d=s.variants.find(g=>g.id===+u.mID);u.name=d.title,u.isAvailable=d.available,u.price.d=d.price?d.price/100:d.price,u.price.effective=u.price.d,u.price.cmp=d.compare_at_price?d.compare_at_price/100:d.compare_at_price,+c.mID===d.id&&(c.effectivePrice.value=u.price.d)}),r}},rn=class Pp{static INSTANCE;httpService=re.get(ht);sentryService=re.get(Oe);sessionManager=re.get(Ye);runtime=le.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Pp),this.INSTANCE}sendSilently(t){this.send(t).catch(r=>w.error(`Failed to send ${t.name}`,r))}async send(t){if(w.debug(`Sending event ${t.name}`),Zt.prepend(`Sending event <strong>${t.name}</strong> with id ${t.id}`),this.shouldReject(t)){w.warn(`Rejecting event ${t.name}`);return}await Promise.all([this.addSessionContext(t),this.addShopifyContext(t)]),this.addShopifyAttributes(),t.name!==N.EVENT_APP_BACKGROUND&&this.runtime.setActive(),t.currentItem=this.runtime.getCurrentItem(),t.locale=this.runtime.locale,this.httpService.post("/v1/event/track",t).then(async r=>{w.log("\u2705 Event tracked:",t.name),Zt.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(t,r)}).catch(r=>{w.error(`Error sending event ${t.name} to server`,r)})}shouldReject(t){return t.trigger?.triggerID==="test"||t.trigger?.triggerID==="preview"?(w.warn("Not sending event as this is a test trigger"),!0):!1}async addSessionContext(t){let r=await this.sessionManager.checkSessionAndGetContext();t.sessionID=r[0],t.sessionNumber=r[1],t.landingPage=r[2],t.page=Ir.parseFromCurrent()}async addShopifyContext(t){try{t.cart=await pe.getCurrent().getNormalisedCart()}catch(r){w.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(t,r){this.renderWidgetIfAny(t,r).catch(n=>{w.error("Failed to display a campaign",n,t,r),this.sentryService.captureException(n,{event:t,response:r})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(t,r){if(!r.triggerData){w.log(`Nothing to engage after ${t.name}`);return}w.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Ct(r.triggerData);n.occurred=t.occurred;let i;try{i=await Vi.refreshItems(n)}catch(s){w.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===Ah.EngagementContentSource.KLAVIYO){new gc().render(n);return}new ji().renderEngagement(n).catch(s=>{w.error("Failed to render popup",s),this.sentryService.captureException(s,{event:t,triggerData:n})})}utiliseIntentIfCalculated(t){t.intent&&(Ui.trackIntent(t.intent),yc.trackIntent(t),Zt.prepend(`Intent is <strong>${In[t.intent]}</strong>`))}addShopifyAttributes(){pe.getCurrent().addCooeeAttributes().catch(t=>{w.error("Fail to add attributes in cart",t)})}},me=class kp{static INSTANCE;httpApiService=ht.getInstance();eventAPIService=rn.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kp),this.INSTANCE}sendEvent(t){w.debug(`Waiting for auth to send event ${t.name}`),Ye.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(t)})}updateProfile(t){Ye.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(t??{})})}trackOrder(t){Ye.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(t)})}updateDeviceProps(t){Ye.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:t})})}generateDiscount(t){return this.httpApiService.generateDiscount(t)}},Zt=class{static isOn=!1;static element;static watch(){let e=Gc();(e==="1"||e==="on")&&me.getInstance().updateDeviceProps({debugTill:this.getDebugMillis()}),e==="on"?sessionStorage.cooeeDebug="1":e==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())}static prepend(e){if(!this.isOn)return;let t=document.createElement("div");t.innerHTML="&#x2022; "+new Date().toLocaleString()+" - "+e,this.element.prepend(t)}static renderDebugBar(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),di(()=>{document.body.appendChild(this.element)})}static dragElement(){let e=0,t=0,r=0,n=0,i=c=>{c=c||window.event,c.preventDefault(),r=c.clientX,n=c.clientY,document.onmouseup=o,document.onmousemove=s},s=c=>{c=c||window.event,c.preventDefault(),e=r-c.clientX,t=n-c.clientY,r=c.clientX,n=c.clientY,this.element.style.top=this.element.offsetTop-t+"px",this.element.style.left=this.element.offsetLeft-e+"px"},o=()=>{document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=i}static getDebugMillis(){return new Date().getTime()+6*60*60*1e3}},$o=class extends Wr{static storeName="app";static{this.storage=ti(this.storeName)}},vc=class{static processConfiguration(){let e=Pe.get();!e.gaMeasurementID||!e.gaEnabled||this.sendClientID()}static async sendClientID(){let e=await this.getClientID();e&&me.getInstance().updateDeviceProps({gaClientID:e})}static async getClientID(){let e=await xe.get(oe.GA_CLIENT_ID),t=await this.getClientIDViaGTag();if(e!==t)return await xe.set(oe.GA_CLIENT_ID,t),t}static async getClientIDViaGTag(){let e=Pe.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag("get",e,"client_id",r=>{t(r)})})}},Ec=class Lp{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Lp),this.INSTANCE}init(){$o.get(oe.APP_CONFIG,{}).then(t=>this.updateGlobalConfig(t))}async processAppConfigurations(t){w.log("Received app configuration",t),t.currencyCount=t.currencies?.length;let r=this.updateGlobalConfig(t);$o.set(oe.APP_CONFIG,r).catch(n=>w.error(n)),vc.processConfiguration(),r.website&&(st.injectRawScript(r.website.commonJS),st.injectRawCSS(r.website.commonCSS)),Ge.get().onToggle().subscribe(async({open:n})=>{w.info("Cart drawer is now",n?"open":"closed"),n&&(re.get(ar).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(t){let r=be.globalRef.config.update(t);return Ge.forceUpdate(),w.debug("App configurations",r),r}async trackViewCartEvent(){let t=await pe.getCurrent().getNormalisedCart(),r={value:t.amount,currency:t.currency},n={items:t.items,amount:r,drawer:!0};me.getInstance().sendEvent(new ve(N.EVENT_VIEW_CART,n))}},Nh=_e(pp()),_c=class Vc{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(t){this.adID=t.adID,this.campaignID=t.campaignID,this.source=t.source}static getAdParams(){let t;try{t=new Nh.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(t.getParams().keys()).includes(n)))return r={source:"META",adID:t.getQueryParam("ad_id")?.trim(),campaignID:t.getQueryParam("campaign_id")?.trim()},new Vc(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(t.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Vc(r)}},Un=class Up{static INSTANCE;httpAPIService=ht.getInstance();coreService=Ec.getInstance();sentryService=Oe.getInstance();sdkToken="";userID="";deviceID="";appID="";shopifyShop="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Up),this.INSTANCE}init(t){this.appID=t.appID,this.shopifyShop=t.shopifyShop}async storeAndPopulateAuthData(t){t&&(t.userID&&(this.userID=t.userID,await xe.set(oe.ID,t.userID)),t.deviceID&&(this.deviceID=t.deviceID,await xe.set(oe.DEVICE_ID,t.deviceID)),t.sdkToken&&(this.sdkToken=t.sdkToken,await xe.set(oe.SDK_TOKEN,t.sdkToken)),this.updateAPIClient())}async validateSession(t){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),w.log("Validating session with server");let r=await this.getSessionValidateData(t);try{let n=await this.httpAPIService.validateSession(r);w.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw w.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await xe.get(oe.SDK_TOKEN),!this.sdkToken){w.warn("No SDK token found in local storage");return}this.userID=await xe.get(oe.ID),this.deviceID=await xe.get(oe.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){w.debug("SDK Token:",this.sdkToken),w.log("Device ID:",this.deviceID),w.log("User ID:",this.userID),Ui.trackDeviceID(this.deviceID),Zt.prepend(`Device ID: <strong>${this.deviceID}</strong>`),this.httpAPIService.setAPIToken(this.sdkToken),this.sentryService.setGlobalContext("Visitor Info",{device_id:this.deviceID,user_id:this.userID}),this.sentryService.setUser({id:this.deviceID})}async getSessionValidateData(t){let r=await new ic().get();r.host=location.origin;try{(await Ih())?.isPrivate&&(r.private=!0)}catch(i){Oh.default.error("Unable to detect private/incognito window",i)}let n=await xe.get(oe.DEVICE_ID);return n||(n=new et().toHexString(),await xe.set(oe.DEVICE_ID,n)),ee(b({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},t),{sdk:N.SDK,page:Ir.parseFromCurrent(),ad:_c.getAdParams(),occurred:this.getSessionStartTime(le.get().jsLoadTime),currentItem:le.get().getCurrentItem(),cart:await pe.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let t=await xe.get(oe.FIRST_SEEN),r=t?new Date(t):new Date;t||await xe.set(oe.FIRST_SEEN,r.toISOString()),this.httpAPIService.setFirstSeen(r),this.sentryService.setGlobalContext("Visitor Info",{first_seen:r.toISOString()})}getSessionStartTime(t){return(new Date().getTime()-t.getTime())/1e3>N.IDLE_TIME_IN_SECONDS?new Date:t}},Ye=class fs{static replaySubject=new Po(1);static INSTANCE;sentryService=re.get(Oe);lock=new ni;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new fs),this.INSTANCE}init(t){if(w.debug("Initialising SDK",t),wh(navigator.userAgent)){w.info("This seems to be a bot. Disabling SDK");return}Un.getInstance().init(t),fs.INSTANCE.checkForNewSession(!0).then(async()=>{fs.replaySubject.next(!0),fs.replaySubject.complete()}).catch(r=>{w.error("Unable to initiate session",r)})}getCurrentSessionID(){return tt.set(oe.SESSION_LAST_USED_TIME,new Date().getTime()),tt.get(oe.ID,"")}async checkSessionAndGetContext(){return await this.checkForNewSession(),this.getContext()}async getContext(){let t=await Promise.all([this.getCurrentSessionID(),this.getCurrentSessionNumber(),this.getLandingPage()]);return this.sentryService.setGlobalContext("Visitor Session",{id:t[0],number:t[1],landing_page:t[2]}),t}async checkForNewSession(t){await this.lock.acquire();let r=!1;if(await this.isNewSessionRequired()?(await this.startNewSession(),t=!0,r=!0):await this.notSynced()&&(r=!0),t){let n=await this.getContext();await Un.getInstance().validateSession({sessionID:n[0],sessionNumber:n[1],landingPage:n[2],newSession:r}),await tt.set(oe.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){w.debug("Starting new session"),await tt.clear(),w.debug("Cleared SessionStorage before starting new session");let t=new Date,r=new et().toHexString();w.debug("New session ID to be used",r);let n=await xe.get(oe.SESSION_NUMBER,0)+1;Zt.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([xe.set(oe.SESSION_NUMBER,n),tt.set(oe.ID,r),tt.set(oe.SESSION_LAST_USED_TIME,t.getTime()),tt.set(oe.SESSION_LANDING_PAGE,Ir.parseFromCurrent())])}getLandingPage(){return tt.get(oe.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return xe.get(oe.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await tt.get(oe.ID))return!0;let t=await tt.get(oe.SESSION_LAST_USED_TIME,0);return t?(new Date().getTime()-t)/1e3>N.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await tt.get(oe.SESSION_SYNCED,!1)}},Jo=_e(Dr()),Uh=_e(qc()),Fh=_e(oi()),Hh=_e(cn()),Ph=_e(ns()),Lh=_e(cn()),nn=class{constructor(e){this.triggerContext=e}safeHTTP=me.getInstance();eventAPIService=rn.getInstance();async execute(e){let t=le.get().getCurrentItem(),r=e.clickAction;if(!r)return;let n=e.item,i=this.triggerContext,s=new tn,o=i.triggerData.redirectBehaviour,c=!!i.triggerData.discount.type&&!!r?.applyDiscount,u={selectedVariants:i.triggerData.nonMutableItems.map(_=>({itemMID:_.mID,mID:_.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},d="",g=[],h=[];if(n?h=[n.toEmbed()]:e.embeddedItem&&(h=[e.embeddedItem]),r.at===108){let _=i.selectedItems;if(h=e.embeddedItems??_.map(x=>x.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let x;e.embeddedItems?x=e.embeddedItems.map(M=>({itemMID:M.mID,mID:M.vID,quantity:M.quantity})):x=_.map(M=>({itemMID:M.mID,mID:M.selectedOrFirstVariant.value.mID}));let P=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&P&&(x.push({itemMID:P.mID,mID:P.selectedOrFirstVariant.value.mID,isPrimary:!0}),h.unshift(P.toEmbed())),u.selectedVariants=x,i.triggerData.isBundleOnPDP()&&u.selectedVariants.forEach(M=>{M.mID===t.vID&&(M.isPrimary=!0)})}else u=void 0;g=e.embeddedItems??_}else if(r.at===107){let _=await pe.getCurrent().getNormalisedCart();h=_.items,u.selectedVariants=_.items.map(x=>({itemMID:x.mID,mID:x.vID}))}else if(r.at===102)g=n?[n]:[e.embeddedItem];else if(r.at===101)d=n?ri()+"products/"+n.slug:e.embeddedItem?.link;else if(r.at===4){let _=Qs(r.gu?.u);_&&(d=_.href)}else if(r.at===109){let _=await s.upgradeToSubscription(n,i.triggerData);this.triggerContext.triggerData.skipSubscribedItems&&this.triggerContext.renderer.destroy(),Ge.get().refreshUI(_)}else if(r.at===104){let _=this.triggerContext.triggerData.collections?.[0];_&&(d="collections/"+_.handle)}if(this.sendTriggerClicked(h,{from:"button"},e.video),w.debug({redirectPath:d,redirectBehaviour:o,hasDiscount:c}),!c&&d){location.href=d;return}let m,E=!1;try{m=await this.getOrGenerateDiscountCode(u),w.debug("Discount code (if any) to apply",m)}catch(_){if(!this.triggerContext.triggerData.isBYOB()){Lh.default.error("Unable to get a discount code",_);return}}if(m&&r.at===103)await s.copyDiscountCode(m);else if(r.at===110){let _=await s.createNewCart(t,m,i.triggerData);_&&(location.href=_);return}try{m&&await en.applyWithStorefront(m)}catch(_){w.error(_),E=!0}let y;if(g?.length&&(y=await s.addToCart(g,i.triggerData)),E&&m){en.navigate(m,o,d);return}if(d){location.href=d;return}en.navigateWithoutDiscount(o,y)}sendTriggerClicked(e,t,r){let n=new ve(N.EVENT_TRIGGER_CLICKED,t,this.triggerContext.triggerData);n.items=e,r?.id&&(n.videos=[r.id]),this.eventAPIService.sendSilently(n)}async getOrGenerateDiscountCode(e){let t=this.triggerContext.triggerData.discount;if(!t?.type)return;let r="";if(t.type===Ph.DiscountType.STATIC){if(!t.code)throw Oe.getInstance().captureMessage("No discount code found","warning",{triggerContext:this.triggerContext}),new Error("No discount code found");return t.code}if(e){if(r=await this.generateDiscount(e),!r)throw w.error("No discount code found",e),new Error("Discount code not found or generated");return r}}async generateDiscount(e){try{return(await this.safeHTTP.generateDiscount(e))?.code}catch(t){throw Yr("Failed to generate a discount code"),w.error("Error generating discount code",t,e),Oe.getInstance().captureMessage("Failed to generate discount code","error",{discountData:JSON.stringify(e),triggerContext:this.triggerContext,error:t}),t}}},Ae=class extends ur{stylesConverter=new Hi(1);renderer=Pt.get();mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=this.renderer.isMobile()?"sm":"lg",this.clickExecutor=new nn(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),b(b(ee(b(b(b(b(b(b({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:t,rhs:r}=e;switch(e.op){case"eq":return t===r;case"gt":return+t>+r;case"gte":return+t>=+r;case"lt":return+t<+r;case"lte":return+t<=+r;case"ne":return t!==r;case"null":return t==null;case"empty":return t.trim()==="";case"in":return new RegExp(`\\b${r}\\b`).test(t);case"nin":return!new RegExp(`\\b${r}\\b`).test(t);default:return w.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,this.renderer.isMobile()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=b(b({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,t){this.clickExecutor.sendTriggerClicked(e,t)}async onClick(e,t){e.stopPropagation(),!t.clickAction&&(t.clickAction=this.props.element.clc),await this.clickExecutor.execute(t)}},IS=0,SH=Array.isArray;function $(e,t,r,n,i,s){t||(t={});var o,c,u=t;if("ref"in u)for(c in u={},t)c=="ref"?o=t[c]:u[c]=t[c];var d={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--IS,__i:-1,__u:0,__source:i,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(c in o)u[c]===void 0&&(u[c]=o[c]);return Ee.vnode&&Ee.vnode(d),d}var Bt=class extends Ae{componentDidMount(){this.setState(()=>({text:this.props.element.text})),ct(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),t=this.state.text;return t||(e.display="none",t=""),$("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:$("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:t}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,t={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},r=St.render(JSON.stringify(this.props.element),t),n=new it(JSON.parse(r));if(!this.matchWhenCondition(n.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:n.text}))}getTypoStyles(){let e={},t=this.mediaStyle.typo??new Ze;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily=t.fam.name||"inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,e.textDecoration=t.td??"none",this.stylesConverter.getColourStyles(t.tc,"color",e),e}getComponentStyles(){return b({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}},Hn=class extends Bt{render(){return $("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:$("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return ee(b({},super.getComponentStyles()),{cursor:"pointer"})}},yp=class extends ur{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?$("div",{style:b(b({},this.getElementStyle()),this.props.styles),children:[$("span",{children:this.props.time}),$("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):$("div",{style:b(b({},this.getElementStyle()),this.props.styles),children:[$("span",{style:this.getTimeLabelStyle(),children:this.props.label}),$("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},jo=class extends Bt{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>b({},this.labels)),this.processAndStartTimer()}render(){return $("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>$(yp,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return b(b({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>b({},this.labels))})}},Bh=_e(ns()),Vo=class extends Ae{componentDidMount(){ct(()=>{this.setState(()=>({checked:this.props.item.selected.value}))})}render(){return $("div",{style:this.getCompiledStyles(),className:"lc-checkbox",children:$("input",{type:"checkbox",checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:"auto"}})})}onChange(e){let{checked:t}=e.target;this.props.item.selected.value=t}getTypoStyles(){let e={},t=this.mediaStyle.typo??new Ze;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return ee(b({},this.getTypoStyles()),{display:"flex"})}},Mh=_e(Dr()),Ur=class extends Ae{constructor(e,t){super(e,t)}render(){let e=this.props.element[this.deviceTypeKey],t=e?.src||this.props.element.src||this.props.element.lg?.src;return $("img",{onClick:this.customOnClick.bind(this),className:"lc-image",alt:e?.name||"Image",onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:t,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===Mh.ClickActionType.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick("image")}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!=="absolute")return{};let t={zIndex:e.zIndex,cursor:this.props.element.clc?.at?"pointer":"auto"};return this.mediaStyle.size?.w&&(t.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(t.height=this.mediaStyle.size.h),t}handleMouseEnter(e){let t=this.props.element[this.deviceTypeKey]?.secondarySrc;t&&(e.currentTarget.src=t)}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src}},Fr=class extends Ae{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return $("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:$(on,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new Ii,t={display:"flex",gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap==="nowrap"&&e.scroll&&(e.dir==="column"?t["overflow-y"]="auto":t["overflow-x"]="auto"),t}},Wo=class extends Fr{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return $("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:$(Wi,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}},Go=class extends Ae{render(){return $("select",{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??"",onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){ct(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},t=this.mediaStyle.typo??new Ze;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily="inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility="hidden"),b(b({},e),this.getTypoStyles())}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return[];this.props.triggerContext.triggerData.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=!0,t.changeSellingPlan(t.sellingPlans[0])):e.push($("option",{value:"",selected:!t.selectedSellingPlan,children:"One time purchase"}));for(let r of t.sellingPlans??[])e.push($("option",{value:r.mID,selected:r.isSelected,children:r.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(r=>r.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0}},kh=_e(Yc()),Yo=class extends Ae{colorRegex=new RegExp('fill="#[a-zA-Z0-9]+"');constructor(){super(),St.escape=kh.MustacheUtils.escapeHtml}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display="none",t=""),$("div",{style:e,className:"lc-star-rating",dangerouslySetInnerHTML:{__html:t}})}getRating(){let e=this.props.element.fullStar,t=this.props.element.halfStart,r={size:this.props.element.iconSize,color:this.props.element.c.hex};e=St.render(e,{svg:r}),t=St.render(t,{svg:r});let n=this.props.review;if(!n?.rating)return"";let i="";if(this.props.element.showSingleStar)i=e;else{let s=5,o=`${n.rating}`.split(".");for(let c=0;c<+o[0];c++)i+=e,s--;o[1]&&(i+=t,s--);for(let c=0;c<s;c++)i+=e.replace(this.colorRegex,'fill="#f1f1f1')}return i}getComponentStyles(){return{display:"flex",alignItems:"center"}}},zo=class extends Ae{render(){return $("select",{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){ct(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},t=this.mediaStyle.typo??new Ze;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+"px",e.lineHeight=t.lh,e.fontFamily="inherit",e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"&&(e.visibility="hidden"),b(b({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push($("option",{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value;this.props.item.selectedOrFirstVariant.value=this.props.item.vars.find(r=>r.mID===t)}},Wi=class extends Ae{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"}))}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let t=e;return $(Wo,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?$(Vo,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let t=e,r=this.props.item,n=r.variantImage??r.imageURL,i=r.variantSecondaryImage??r.secondaryImageURL;t.lg=t.sm={src:n,name:r.name,secondarySrc:i};let s=$(Ur,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:$("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block"},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let t=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"?void 0:$(zo,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?$(Go,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?$(Yo,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?$(Hn,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):$(on,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}renderProductTitle(e){let t=$(Bt,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:$("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block",textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:t})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e})}onMouseEnter(){this.setState(()=>({decoration:"underline"}))}onMouseLeave(){this.setState(()=>({decoration:"unset"}))}},$n=class extends Ae{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"}))}render(){let e=JSON.stringify(this.props.element),t=St.render(e,this.getProductData());if(this.productElement=new Xr(JSON.parse(t)),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return $("div",{style:b({},this.getCompiledStyles()),class:"lc-single-product",children:$(Wi,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return{flexShrink:0}}getProductData(){if(!this.props.item)return{};let e=this.props.item.selectedOrFirstVariant.value,t=e.price,r=this.props.item.name,n=this.props.item.category,i=Gt(t.d,!0),s=this.props.item.variantImage??this.props.item.imageURL,o=this.props.item.meta,c=this.props.item.tags?.join(",")??"",u=this.props.item.reviews?.rating,d=this.props.item.reviews?.totalReviews,g=t.cmp&&t.cmp>t.d,h=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity,m={name:r,price:i,quantity:h,image_url:s,meta:o,category:n,rating:u,reviews:d,tags:c},E=e.effectivePrice.value!==t.d;E&&(m.effective_price=Gt(e.effectivePrice.value));let y=this.props.triggerContext.triggerData.discount.type===Bh.DiscountType.BXGY;if(!E&&y&&(m.effective_price=Gt(e.effectivePrice.value),m.price=""),g){m.compare_price=Gt(t.cmp);let x=t.cmp-t.d;m.discount_percent=(x/t.cmp*100).toFixed(0),m.discount_price=Gt(x)}let _={name:e.name,quantity:this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(e.quantity):e.quantity};return{product:m,variant:_,svg:{color:()=>"{{svg.color}}",size:()=>"{{svg.size}}"}}}};function Sc(e,t){if(!e||!window.Swiper)return;let r=new window.Swiper(e,{loop:!0,slidesPerView:t.maxInRow,spaceBetween:t.gap+"px",pagination:{type:t.pagination.type,el:e.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(n,i)=>`
64
64
  <span class="${i}"
65
65
  style="background-color: ${t.pagination.color?.rgba};"></span>
66
66
  `,renderProgressbar:n=>`
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 Vo=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&&ct.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:[$(Fn,{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)}},Wo=class extends Ne{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){ct.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=wt.render(r,{form:t});return Ut.getParsedElement(JSON.parse(n))}getClickAction(e){let t=b({},this.props.element.clc),r=JSON.stringify(t),n=wt.render(r,{form:e});return JSON.parse(n)}},nn=class extends Ne{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),ut(()=>{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 $(Bo,{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 $(Vo,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(Fn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $(Wo,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},Go=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(){ut(()=>{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:$(nn,{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)}},vt=class as{constructor(t){this.engagementTrigger=t,this.triggerContext=new Li(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);eventAPIService=se.get(rn);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(),as.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.afterRootContainerCreated(),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)}afterRootContainerCreated(){}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 Nt(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new Nt(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new Nt(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 wi(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(){as.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 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=Ln(window,"scroll").pipe(ar(as.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(as.engagementIDsWithTrackedDisplay.has(t)||!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.eventAPIService.sendSilently(i),as.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(t){let r=this.widgetElement=document.createElement(t);return r.className="cooee-root",r.cart=fe.getCurrent(),r.triggerContext=this.triggerContext,r.engagementTrigger=this.engagementTrigger,r.setAttribute("engagement",this.engagementTrigger.shortID),r.addEventListener("cooeeEvent",n=>{let i=n.detail;this.eventAPIService.sendSilently(i)}),this.rootContainer.appendChild(r),this.addToRendered(),r}isInViewport(){let t=this.rootContainer?.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&&(ct.injectRawCSS(d,i),ct.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 Yo.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Yo.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Yo.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Yo.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.objective.toLowerCase().replaceAll("_","-"),s=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${s} ${i}`,n.dataset.engagementId=s,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;ct.injectRawCSS(n,r),ct.injectStylesheet(mt.styleURL,r),ct.injectSwiperCSS(r),t=r}lf(Yc(Go,{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 Jh extends vt{static renderedEngagements=[];constructor(t){super(t)}addToRendered(){Jh.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=fe.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(g=>g.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(g=>g.mID===t.id.toString());if(!n)return;let i=new Sr(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let g of i.sellingPlans??[])g.mID===s.id.toString()&&(g.isSelected=!0,i.changeSellingPlan(g));let o=new Nt(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 Dt(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(Zu(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}this.createAngularWidget("cooee-progressbar")}async checkMilestone(){let e=await fe.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.updateLineItem(i,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});else{let s=await this.ctaListener.addToCart([n],this.engagementTrigger);ze.get().refreshUI(s,!1)}}}}async removeOtherFreeGifts(e){let t=(await fe.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.updateLineItem(r,{quantity:0})}},gc=class extends vt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-shoppable-videos")}},yc=class extends vt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-sticky-atc")}},bh=Se(ri()),vc=class extends vt{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 Fi(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},$i=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=[...vt.renderedEngagements];vt.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 vc(r).renderSilently():r.isStickyATC()?new yc(r).renderSilently():new vt(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()}},ji=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 fe.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 Yh extends ji{static INSTANCE;loadWidgetsSubject=new Rt;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 Yh),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 Dt(i));new $i().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 Dt(i));new $i().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 $i().processCartWidgetResponse(this.runtimeData.cartEngagements)}},Ec=class{eventAPIService;constructor(){this.eventAPIService=se.get(on)}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)})}},on=class Qh extends ji{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 Dt(i));new Ec().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)}},_c=class{runtimeData=ue.get();widgetAPIService=se.get(cr);experimentAPIService=se.get(on);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){pi(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&&Mn.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)}},Vi=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))}},Wi=class Xo{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=se.get(de);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Xo),this.INSTANCE}resetScrollID(t){Vi.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(){Ln(window,"scroll").pipe(ar(Xo.DEBOUNCE_TIME),Pn(()=>{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)>=Xo.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=Vi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new Ee(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Vi.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)}},Sc=class Zh{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=se.get(de);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))}},bc=class{compareCartItemSubject=new Rt;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),g=te(b({},o),{quantity:d});u?i.push(g):s.push(g)}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(de).sendEvent(r)}async compareCartItems(){let e=await De.get(oe.CURRENT_CART,{}),t=await fe.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},wc=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]});de.getInstance().sendEvent(t)}},Gi=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});de.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)})}},Ic=class Bc extends Gi{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(Bc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Bc),this.INSTANCE}},Tc=class al extends Gi{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(al.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new al),this.INSTANCE}},Cc=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()}},xc=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),de.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))}},zo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await fe.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);de.getInstance().sendEvent(r)})}},Dc=class{async migrate(){}};wt.escape=wh.MustacheUtils.escapeHtml;var we=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Dc().migrate(),this.autoAuthenticate(),new _c().meddle(),se.get(on).loadExperimentSilently(),new Sc().listen(),new xc().trackSilently(),new bc().listen(),new wc().listen(),new Cc().listen(),se.get(Wi).listen(),se.get(Tc).listenSilently(),se.get(Ic).listenSilently(),se.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||pi(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,pi(this.globalRef,"config",new Pe),pi(this.globalRef,"runtimeData",new ue),w.debug("Global reference initialised")}static injectWidgetAssets(){ct.injectScriptURL(mt.widgetURL,"cooee-widget-sdk"),ct.injectStylesheet(mt.styleURL)}static autoAuthenticate(){let e=ke.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(de).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(de).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(Wi).resetScrollID();return}let n={};r&&(n.ps=r);let i=new Ee(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,se.get(de).sendEvent(i),se.get(Wi).resetScrollID(i.occurred)}static previewPopup(e,t){new Bi(t).render(e)}static previewWidget(e){new vt(new Dt(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?zo.attachCheckoutListener():window.addEventListener("gokwikLoaded",zo.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 bc(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 qo=class extends Ae{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&&st.loadSwiperScript().then(()=>{this.swiperInstance=Sc(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:ee(b({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:bc(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 $(pr,{children:[$($n,{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:$(Bt,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}},Ko=class extends Ae{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){st.loadSwiperScript().then(()=>{this.swiperInstance=Sc(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 bc(e.conf,t,r)}getComponentStyles(){return{}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return $(Ur,{element:t,triggerContext:this.props.triggerContext});case 4:return $(Fr,{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=St.render(r,{form:t});return kt.getParsedElement(JSON.parse(n))}getClickAction(e){let t=b({},this.props.element.clc),r=JSON.stringify(t),n=St.render(r,{form:e});return JSON.parse(n)}},on=class extends Ae{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),ct(()=>{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 $(Fr,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return $(jo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?$(Hn,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return $(Bt,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return $(Ur,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(qo,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $($n,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $(Ko,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},Xo=class extends Ae{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(){ct(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return $(pr,{children:[$("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:e=>{this.onClick(e,{clickAction:this.clickAction})},children:$(on,{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)}},gt=class es{constructor(t){this.engagementTrigger=t,this.triggerContext=new Fi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=le.get();widgetAPIService=re.get(ar);eventAPIService=re.get(rn);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(t=>Oe.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(),es.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.afterRootContainerCreated(),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){Hh.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(t.items,this.engagementTrigger.items)}afterRootContainerCreated(){}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 Rt(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new Rt(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new Rt(t.bundleFrom)),t.discount&&(this.engagementTrigger.discount=t.discount),t.placement&&(this.triggerContext.triggerData.placement=t.placement),t.props&&Fh.JSUtils.hasKeys(t.props)&&(this.engagementTrigger.props=b(b({},this.engagementTrigger.props),t.props)),this.triggerContext.triggerData.widget=this.widget=new Di(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(){es.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 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=kn(window,"scroll").pipe(sr(es.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(es.engagementIDsWithTrackedDisplay.has(t)||!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 ve(n,r,this.engagementTrigger);i.name===N.EVENT_CAMPAIGN_HOLDOUT&&(i.trigger.holdout=!0),this.eventAPIService.sendSilently(i),es.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(t){let r=this.widgetElement=document.createElement(t);return r.className="cooee-root",r.cart=pe.getCurrent(),r.triggerContext=this.triggerContext,r.engagementTrigger=this.engagementTrigger,r.setAttribute("engagement",this.engagementTrigger.shortID),r.addEventListener("cooeeEvent",n=>{let i=n.detail;this.eventAPIService.sendSilently(i)}),r.addEventListener("cooeeCTA",n=>{new nn(this.triggerContext).execute(n.detail)}),this.rootContainer.appendChild(r),this.addToRendered(),r}isInViewport(){let t=this.rootContainer?.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 hi(u[0].trim()))?.shadowRoot,n=u[1].trim(),i&&(st.injectRawCSS(d,i),st.injectStylesheet(pt.styleURL,i))}w.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let s=await hi(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 Jo.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Jo.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Jo.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Jo.EngagementPlacementPosition.AFTER:default:s.parentElement?.insertBefore(c,s.nextSibling)}return c}async startRendering(){let t;try{t=await Vi.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.objective.toLowerCase().replaceAll("_","-"),s=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${s} ${i}`,n.dataset.engagementId=s,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;st.injectRawCSS(n,r),st.injectStylesheet(pt.styleURL,r),st.injectSwiperCSS(r),t=r}bf(rl(Xo,{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)Uh.ArrayUtils.remove(r,s)}getItemDiff(t,r){return t.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}},xr=class Mp extends gt{static renderedEngagements=[];constructor(t){super(t)}addToRendered(){Mp.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(!Ge.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()}},wc=class $p{constructor(t,r){this.engagementTrigger=t,this.element=r,this.cartItems=pe.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 $p(t,i).render()}render(){let t=this.findCartItemFromHTMLElement();if(!t||this.engagementTrigger.skipSubscribedItems&&t.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(g=>g.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(g=>g.mID===t.id.toString());if(!n)return;let i=new _r(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let g of i.sellingPlans??[])g.mID===s.id.toString()&&(g.isSelected=!0,i.changeSellingPlan(g));let o=new Rt(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 Ct(this.engagementTrigger);u.placement.selector=`.${c}`,u.items=[o];let d=new xr(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))})}},$h=_e(Dr()),Ic=class extends xr{ctaListener=new tn;constructor(e){super(e),Tr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(up(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}this.createAngularWidget("cooee-progressbar")}async checkMilestone(){let e=await pe.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===$h.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.updateLineItem(i,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});else{let s=await this.ctaListener.addToCart([n],this.engagementTrigger);Ge.get().refreshUI(s,!1)}}}}async removeOtherFreeGifts(e){let t=(await pe.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.updateLineItem(r,{quantity:0})}},Tc=class extends gt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-shoppable-videos")}},Cc=class extends gt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-sticky-atc")}},jh=_e(oi()),xc=class extends gt{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(!jh.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 ft({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new nn(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},Gi=class{runtimeData=le.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let t=[...xr.renderedEngagements];xr.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 Ic(r).renderSilently():r.isSubscriptionUpsell()?wc.renderCartUpsell(r):new xr(r).renderSilently());this.removeOldWidgets(t)}processPageWidgetResponse(e){let t=[...gt.renderedEngagements];gt.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 Tc(r).renderSilently():r.isBYOB()?new xc(r).renderSilently():r.isStickyATC()?new Cc(r).renderSilently():new gt(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()}},Yi=class{runtimeData=le.get();httpService=re.get(ht);sessionManager=re.get(Ye);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 pe.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=Ir.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),t=[];return e.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&t.push(n)}),t}},ar=class Bp extends Yi{static INSTANCE;loadWidgetsSubject=new xt;constructor(){super(),this.loadWidgetsSubject.pipe(sr(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))}),Tr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Bp),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(t=>w.error("Unable to initiate load page widgets",t))})}loadCartWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(t=>w.error("Unable to initiate cart widgets",t))})}loadWidgetsSilently(){Ye.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 Ct(i));new Gi().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 Ct(i));new Gi().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 Gi().processCartWidgetResponse(this.runtimeData.cartEngagements)}},Dc=class{eventAPIService;modifications=[];constructor(){this.eventAPIService=re.get(sn)}execute(e){for(let t of e)t.experimentConfig&&(this.executeExperiment(t),this.trackExperimentRan(t));if(document.querySelector("#lc-hide-body")?.remove(),!document.body){re.get(Oe).captureMessage("No body element found","error");return}this.setupMutationObserver()}async executeExperiment(e){let t=e.experimentConfig?.modifications;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}this.modifications.push(r);let n=Array.from(document.querySelectorAll(r.cssSelector));this.executeSingleModification(r,n)}}executeSingleModification(e,t){if(t?.length)for(let r of t)Object.assign(r.style,e.style),e.type==="TEXT"&&e.text&&(r.innerHTML=e.text)}trackExperimentRan(e){this.eventAPIService.trackExperiment({name:N.EVENT_EXPERIMENT_START,experiment:new Zr(e)}).catch(t=>{w.error("Fail to track experiment",t)})}setupMutationObserver(){new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.forEach(r=>{r instanceof HTMLElement&&this.modifications.forEach(n=>{r.matches&&r.matches(n.cssSelector)?(w.debug("Re-applying experiment",n.toString()),this.executeSingleModification(n,[r])):r.querySelectorAll&&(w.debug("Re-applying experiment",n.toString()),this.executeSingleModification(n,Array.from(r.querySelectorAll(n.cssSelector))))})})})}).observe(document.body,{childList:!0,subtree:!0})}},sn=class jp extends Yi{static INSTANCE;constructor(){super()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new jp),this.INSTANCE}loadExperimentSilently(){xe.get(oe.SDK_TOKEN).then(t=>{t?this.loadExperiments().catch(r=>w.error("Unable to initiate experiment",r)):Ye.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 Ct(i));new Dc().execute(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)}},Rc=class{runtimeData=le.get();widgetAPIService=re.get(ar);experimentAPIService=re.get(sn);meddle(){let e=be.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=be.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.loadExperiments=()=>{this.experimentAPIService.loadExperimentSilently()},e.previewWidget=be.previewWidget.bind(be),e.previewPopup=be.previewPopup.bind(be)}overwritePush(e,t){gi(e,"push",t)}meddleAccount(){this.overwritePush(be.globalRef.account,(...e)=>{this.processAccount(e[0])}),be.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(be.globalRef.events,(...e)=>{this.processEvent(e[0])}),be.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(be.globalRef.profile,(...e)=>{this.processProfile(e[0])}),be.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(be.globalRef.screen,(...e)=>{this.processPageName(e[0])}),be.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&be.authenticate(e),e.flags&&Bn.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?be.sendEvent(e[0],e[1],b({occurred:this.runtimeData.jsLoadTime},e[2])):be.sendEvent(e[0],e[1],e[2]))}processProfile(e){e&&be.updateProfile(e)}processPageName(e){e&&be.setPageName(e)}meddlePage(){this.overwritePush(be.globalRef.page,(...e)=>{this.processPage(e[0])}),be.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&&be.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiment=e.activeExperiment)}},zi=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))}},qi=class so{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=re.get(me);lastPercent=0;_lastScreenOrScroll=new Date;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new so),this.INSTANCE}resetScrollID(t){zi.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)}di(()=>{this.observeWindowScroll()})}observeWindowScroll(){kn(window,"scroll").pipe(sr(so.DEBOUNCE_TIME),Mn(()=>{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)>=so.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=zi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new ve(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),zi.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)}},Ac=class Fp{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=re.get(me);runtimeData=le.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[Fp.ACTIVE_DURATION]=t,this.apiService.sendEvent(new ve(N.EVENT_APP_BACKGROUND,r))}},Nc=class{compareCartItemSubject=new xt;constructor(){this.compareCartItemSubject.pipe(sr(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)&&(le.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),g=ee(b({},o),{quantity:d});u?i.push(g):s.push(g)}r&&hd(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)&&Tr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:i,itemsRemoved:s})}sendEvent(e,t){let r=new ve(e,t);re.get(me).sendEvent(r)}async compareCartItems(){let e=await xe.get(oe.CURRENT_CART,{}),t=await pe.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},Oc=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){Oe.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 Zs();return e.variables.input.attributes=[...t,...r],JSON.stringify(e)}sendBuyNowEvent(){let e=le.get().getCurrentItem();if(!e)return;let t=new ve(N.EVENT_BUY_NOW_CLICKED,{items:[e]});me.getInstance().sendEvent(t)}},Ki=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 ve(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0});me.getInstance().sendEvent(r),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await Ou(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener("click",e)})}},Pc=class zc extends Ki{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(zc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new zc),this.INSTANCE}},Lc=class yl extends Ki{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(yl.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new yl),this.INSTANCE}},Mc=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(){di(()=>{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)&&Ge.get().open()}},kc=class{trackSilently(){this.track().catch(e=>Oe.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 re.get(Ye).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),me.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))}},Qo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await pe.getCurrent().getNormalisedCart(),t={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},r=new ve(N.EVENT_CHECKOUT_STARTED,t);me.getInstance().sendEvent(r)})}},Bc=class{async migrate(){}};St.escape=Vh.MustacheUtils.escapeHtml;var be=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Bc().migrate(),this.autoAuthenticate(),new Rc().meddle(),re.get(sn).loadExperimentSilently(),new Ac().listen(),new kc().trackSilently(),new Nc().listen(),new Oc().listen(),new Mc().listen(),re.get(qi).listen(),re.get(Lc).listenSilently(),re.get(Pc).listenSilently(),re.get(ar).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),Zt.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||gi(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,gi(this.globalRef,"config",new Pe),gi(this.globalRef,"runtimeData",new le),w.debug("Global reference initialised")}static injectWidgetAssets(){st.injectScriptURL(pt.widgetURL,"cooee-widget-sdk"),st.injectStylesheet(pt.styleURL)}static autoAuthenticate(){let e=Gf();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let t=e.appID?.trim(),r=e.shopifyShop;if((Nu(t)||t.length!==24)&&Nu(r)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,re.get(Ye).init(e)}static sendEvent(e,t,r){let n=new ve(e,t,r?.triggerData);r?.occurred&&(n.occurred=r.occurred),re.get(me).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 '");re.get(me).updateProfile(e)}static setPageName(e){if(!e)return;let t=le.get(),r=t.pageName;if(e===r)return;if(t.pageName=e,e==="cart"&&re.get(ar).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){re.get(qi).resetScrollID();return}let n={};r&&(n.ps=r);let i=new ve(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,re.get(me).sendEvent(i),re.get(qi).resetScrollID(i.occurred)}static previewPopup(e,t){new ji(t).render(e)}static previewWidget(e){new gt(new Ct(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=le.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?Qo.attachCheckoutListener():window.addEventListener("gokwikLoaded",Qo.attachCheckoutListener)}static storePreviewParams(){let e=le.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)}};Rp();Ap();w.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.debug("Execution order:","IIFE start"),await be.initForMerchantWebsiteOnly(),await be.initForAll(),w.debug("Execution order:","IIFE end")))());w.debug("Execution order:","bottom");})();