@letscooee/web-sdk 9.4.0 → 9.4.1
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/analytics-sdk.min.js +3 -3
- package/dist/main.min.js +2 -2
- package/dist/widget-sdk.min.js +1 -1
- package/dist/widget.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var rg=Object.create,xc=Object.defineProperty,ng=Object.defineProperties,ig=Object.getOwnPropertyDescriptor,og=Object.getOwnPropertyDescriptors,sg=Object.getOwnPropertyNames,op=Object.getOwnPropertySymbols,ag=Object.getPrototypeOf,ap=Object.prototype.hasOwnProperty,cg=Object.prototype.propertyIsEnumerable,sp=(e,t,r)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||={})ap.call(t,r)&&sp(e,r,t[r]);if(op)for(var r of op(t))cg.call(t,r)&&sp(e,r,t[r]);return e},ee=(e,t)=>ng(e,og(t)),zi=(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),lg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sg(t))!ap.call(e,i)&&i!==r&&xc(e,i,{get:()=>t[i],enumerable:!(n=ig(t,i))||n.enumerable});return e},Se=(e,t,r)=>(r=e!=null?rg(ag(e)):{},lg(t||!e||!e.__esModule?xc(r,"default",{value:e,enumerable:!0}):r,e)),nn=ur((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,y){return function(){return y.apply(h,arguments)}},c=function(){var h=arguments,y=h[0],E,v;for(v=1;v<h.length;v++)for(E in h[v])!(E in y)&&h[v].hasOwnProperty(E)&&(y[E]=h[v][E]);return y},u=function(h,y){return{value:h,name:y}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var d=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};d.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var y=this.context.filterLevel;return h.value>=y.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,y){i&&this.enabledFor(h)&&i(y,c({level:h},this.context))}};var m=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var y in s)s.hasOwnProperty(y)&&s[y].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(v,_){_.name&&v.unshift("["+_.name+"]")};var y={},E=function(v,_){Function.prototype.apply.call(v,console,_)};return typeof console>"u"?function(){}:function(v,_){v=Array.prototype.slice.call(v);var D=console.log,P;_.level===n.TIME?(P=(_.name?"["+_.name+"] ":"")+v[0],v[1]==="start"?console.time?console.time(P):y[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(D,[P+": "+(new Date().getTime()-y[P])+"ms"])):(_.level===n.WARN&&console.warn?D=console.warn:_.level===n.ERROR&&console.error?D=console.error:_.level===n.INFO&&console.info?D=console.info:_.level===n.DEBUG&&console.debug?D=console.debug:_.level===n.TRACE&&console.trace&&(D=console.trace),h.formatter(v,_),E(D,v))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof t<"u"&&t.exports?t.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(e)}),Dc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MustacheUtils=void 0;var t=class _h{static escapeHtml(n){return String(n).replace(/"/g,i=>_h.entityMap[i])}};e.MustacheUtils=t,t.entityMap={'"':"""}}),Rr=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MilestoneRewardType=e.ProgressBarLayout=e.EngagementContentSource=e.EngagementObjective=e.OnsiteDeliveryType=e.ClickActionType=e.FrequencyGapUnit=e.FrequencyType=e.RedirectBehaviour=e.EngagementPlacementPosition=e.EngagementCollectionSource=e.PromotionType=e.CartFilterEnum=e.CartCurrencyOperator=e.CartCriteria=e.URLCriteria=e.UTMCriteria=e.CartItemSource=e.EngagementItemSource=e.PurchasedVisitor=e.LoggedInVisitor=e.VisitorType=e.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(p){return p[p.ONCE_PER_USER=1]="ONCE_PER_USER",p[p.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",p[p.EVERY_TIME=3]="EVERY_TIME",p}(t||(e.CriteriaFrequency=t={})),r=function(p){return p[p.ONE_TIME=1]="ONE_TIME",p[p.MULTIPLE=2]="MULTIPLE",p[p.RECURRING=3]="RECURRING",p}(r||(e.ScheduleFrequency=r={})),n=function(p){return p[p.NOW=1]="NOW",p[p.LATER=2]="LATER",p[p.NEVER=3]="NEVER",p}(n||(e.TimePreference=n={})),i=function(p){return p[p.PUBLISHED=1]="PUBLISHED",p[p.DRAFT=2]="DRAFT",p[p.PAUSED=3]="PAUSED",p[p.FAILED=4]="FAILED",p[p.STOPPED=5]="STOPPED",p[p.COMPLETED=6]="COMPLETED",p[p.ARCHIVED=7]="ARCHIVED",p[p.UNINSTALLED=8]="UNINSTALLED",p}(i||(e.EngagementStatus=i={})),s=function(p){return p[p.POPUP=1]="POPUP",p[p.LEAD_GENERATION=2]="LEAD_GENERATION",p[p.PRODUCT_WIDGET=3]="PRODUCT_WIDGET",p[p.PRODUCT_BUNDLE=4]="PRODUCT_BUNDLE",p[p.ANNOUNCEMENT_BAR=5]="ANNOUNCEMENT_BAR",p[p.CART_REMINDER=6]="CART_REMINDER",p[p.CRO_COPILOT=10]="CRO_COPILOT",p[p.OTHER=11]="OTHER",p}(s||(e.EngagementType=s={})),o=function(p){return p[p.NONE=0]="NONE",p[p.RULE_BASED=1]="RULE_BASED",p[p.INTENT_BASED=2]="INTENT_BASED",p}(o||(e.TriggerType=o={})),c=function(p){return p[p.SINGLE=1]="SINGLE",p[p.EXCLUSION=2]="EXCLUSION",p[p.ABTESTING=3]="ABTESTING",p}(c||(e.EngagementContentType=c={})),u=function(p){return p[p.ALL=0]="ALL",p[p.NEW_ONLY=1]="NEW_ONLY",p[p.RETURNING_ONLY=2]="RETURNING_ONLY",p}(u||(e.SessionType=u={})),d=function(p){return p[p.ALL=0]="ALL",p[p.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",p[p.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",p[p.PURCHASED=5]="PURCHASED",p[p.NON_PURCHASED=6]="NON_PURCHASED",p[p.ABANDON_CART=7]="ABANDON_CART",p[p.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",p}(d||(e.VisitorType=d={})),m=function(p){return p.ALL="ALL",p.LOGGED_IN="LOGGED_IN",p.NON_LOGGED_IN="NON_LOGGED_IN",p}(m||(e.LoggedInVisitor=m={})),h=function(p){return p.ALL="ALL",p.PURCHASED="PURCHASED",p.NON_PURCHASED="NON_PURCHASED",p}(h||(e.PurchasedVisitor=h={})),y=function(p){return p[p.NONE=0]="NONE",p[p.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",p[p.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",p[p.SINGLE_ITEM=3]="SINGLE_ITEM",p[p.TOP_SELLING=4]="TOP_SELLING",p[p.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",p[p.NEW_ARRIVALS=6]="NEW_ARRIVALS",p[p.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",p[p.EVENT_ITEM=8]="EVENT_ITEM",p[p.CART_ITEM=9]="CART_ITEM",p[p.BUNDLE=10]="BUNDLE",p[p.CURRENT_ITEM=11]="CURRENT_ITEM",p[p.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",p[p.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",p[p.TRENDING_ITEMS=14]="TRENDING_ITEMS",p}(y||(e.EngagementItemSource=y={})),E=function(p){return p[p.LAST_ADDED=1]="LAST_ADDED",p[p.FIRST_ADDED=2]="FIRST_ADDED",p[p.HIGHEST_PRICE=3]="HIGHEST_PRICE",p[p.LOWEST_PRICE=4]="LOWEST_PRICE",p[p.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",p[p.ALL=6]="ALL",p}(E||(e.CartItemSource=E={})),v=function(p){return p[p.ALL=0]="ALL",p[p.ONLY_ORGANIC=1]="ONLY_ORGANIC",p[p.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",p[p.INCLUDES=3]="INCLUDES",p[p.EXCLUDES=4]="EXCLUDES",p}(v||(e.UTMCriteria=v={})),_=function(p){return p[p.NONE=0]="NONE",p[p.LIKE=1]="LIKE",p[p.NOT_LIKE=2]="NOT_LIKE",p[p.EQUALS=3]="EQUALS",p[p.NOT_EQUALS=4]="NOT_EQUALS",p}(_||(e.URLCriteria=_={})),D=function(p){return p[p.NONE=0]="NONE",p[p.LESS_THAN=1]="LESS_THAN",p[p.GREATER_THAN=2]="GREATER_THAN",p[p.BETWEEN=3]="BETWEEN",p[p.EQUALS=4]="EQUALS",p}(D||(e.CartCriteria=D={})),P=function(p){return p[p.ALL=0]="ALL",p[p.INCLUDES=1]="INCLUDES",p[p.EXCLUDES=2]="EXCLUDES",p}(P||(e.CartCurrencyOperator=P={})),M=function(p){return p[p.NONE=0]="NONE",p[p.AMOUNT=1]="AMOUNT",p[p.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",p[p.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",p}(M||(e.CartFilterEnum=M={})),L=function(p){return p[p.NONE=0]="NONE",p[p.ITEM=1]="ITEM",p[p.COLLECTION=2]="COLLECTION",p}(L||(e.PromotionType=L={})),k=function(p){return p[p.NONE=0]="NONE",p[p.SINGLE=1]="SINGLE",p[p.MULTIPLE=2]="MULTIPLE",p}(k||(e.EngagementCollectionSource=k={})),W=function(p){return p.BEFORE="before",p.AFTER="after",p.INSIDE_FIRST="insideFirst",p.INSIDE_LAST="insideLast",p}(W||(e.EngagementPlacementPosition=W={})),ue=function(p){return p.SHOPIFY_CHECKOUT="shopify_checkout",p.THIRD_PARTY_CHECKOUT="third_party_checkout",p.CART_PAGE="cart_page",p.CART_DRAWER="cart_drawer",p}(ue||(e.RedirectBehaviour=ue={})),Me=function(p){return p.ONCE_IN_SESSION="ONCE_IN_SESSION",p.ACROSS_SESSIONS="ACROSS_SESSIONS",p}(Me||(e.FrequencyType=Me={})),B=function(p){return p.DAYS="DAYS",p.HOURS="HOURS",p.MINUTES="MINUTES",p.SECONDS="SECONDS",p}(B||(e.FrequencyGapUnit=B={})),Q=function(p){return p[p.NONE=0]="NONE",p[p.REJECT_POPUP=1]="REJECT_POPUP",p[p.ACCEPT_POPUP=2]="ACCEPT_POPUP",p[p.GO_TO_URL=4]="GO_TO_URL",p[p.SHARE=5]="SHARE",p[p.KEY_VALUE=100]="KEY_VALUE",p[p.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",p[p.ADD_TO_CART=102]="ADD_TO_CART",p[p.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",p[p.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",p[p.OPEN_CART=105]="OPEN_CART",p[p.SUBMIT_FORM=106]="SUBMIT_FORM",p[p.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",p[p.ADD_BUNDLE=108]="ADD_BUNDLE",p[p.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",p}(Q||(e.ClickActionType=Q={})),z=function(p){return p.POPUP="POPUP",p.PAGE_EMBED="PAGE_EMBED",p.CART_EMBED="CART_EMBED",p.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",p}(z||(e.OnsiteDeliveryType=z={})),X=function(p){return p.PRODUCT_PROMOTION="PRODUCT_PROMOTION",p.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",p.CART_RECOVERY="CART_RECOVERY",p.ANNOUNCEMENT="ANNOUNCEMENT",p.LEAD_GENERATION="LEAD_GENERATION",p.DATA_COLLECTION="DATA_COLLECTION",p.SALE_PROMOTION="SALE_PROMOTION",p.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",p.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",p.BYOB="BYOB",p.PROGRESS_BAR="PROGRESS_BAR",p.BUY_NOW="BUY_NOW",p}(X||(e.EngagementObjective=X={})),ge=function(p){return p.COOEE="COOEE",p.KLAVIYO="KLAVIYO",p}(ge||(e.EngagementContentSource=ge={})),$e=function(p){return p.ICONS="ICONS",p.TILES="TILES",p}($e||(e.ProgressBarLayout=$e={})),xe=function(p){return p.FREE_SHIPPING="FREE_SHIPPING",p.DISCOUNT="DISCOUNT",p.FREE_AUTO_GIFT="FREE_AUTO_GIFT",p.FREE_GIFT_SELECT="FREE_GIFT_SELECT",p}(xe||(e.MilestoneRewardType=xe={}))}),Ko=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={}))}),Ac=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayUtils=void 0;var t=class Eh{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--,Eh.swap(n,i,s)}}};e.ArrayUtils=t}),Sf=ur((e,t)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",d="object",m="string",h="major",y="model",E="name",v="type",_="vendor",D="version",P="architecture",M="console",L="mobile",k="tablet",W="smarttv",ue="wearable",Me="embedded",B=500,Q="Amazon",z="Apple",X="ASUS",ge="BlackBerry",$e="Browser",xe="Chrome",p="Edge",Ge="Firefox",ve="Google",ht="Huawei",se="LG",ie="Microsoft",lt="Motorola",tr="Opera",lr="Samsung",dt="Sharp",Hr="Sony",Hn="Xiaomi",rn="Zebra",Zn="Facebook",Vi="Chromium OS",Wn="Mac OS",Mn=" Browser",gt=function(G,ae){var Z={};for(var Ce in G)ae[Ce]&&ae[Ce].length%2===0?Z[Ce]=ae[Ce].concat(G[Ce]):Z[Ce]=G[Ce];return Z},$r=function(G){for(var ae={},Z=0;Z<G.length;Z++)ae[G[Z].toUpperCase()]=G[Z];return ae},Wi=function(G,ae){return typeof G===m?a(ae).indexOf(a(G))!==-1:!1},a=function(G){return G.toLowerCase()},l=function(G){return typeof G===m?G.replace(/[^\d\.]/g,s).split(".")[0]:n},f=function(G,ae){if(typeof G===m)return G=G.replace(/^\s\s*/,s),typeof ae===u?G:G.substring(0,B)},T=function(G,ae){for(var Z=0,Ce,Nt,Tt,Te,ne,$t;Z<ae.length&&!ne;){var Gi=ae[Z],is=ae[Z+1];for(Ce=Nt=0;Ce<Gi.length&&!ne&&Gi[Ce];)if(ne=Gi[Ce++].exec(G),ne)for(Tt=0;Tt<is.length;Tt++)$t=ne[++Nt],Te=is[Tt],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;Z+=2}},A=function(G,ae){for(var Z in ae)if(typeof ae[Z]===d&&ae[Z].length>0){for(var Ce=0;Ce<ae[Z].length;Ce++)if(Wi(ae[Z][Ce],G))return Z===o?n:Z}else if(Wi(ae[Z],G))return Z===o?n:Z;return ae.hasOwnProperty("*")?ae["*"]:G},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","?":"/"},q={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,Ge+" 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"+Mn]],[/fxios\/([\w\.-]+)/i],[D,[E,Ge]],[/\bqihoobrowser\/?([\w\.]*)/i],[D,[E,"360"]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,"$1Browser"],D],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,"$1"+Mn],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,Zn],D],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[E,D],[/\bgsa\/([\w\.]+) .*safari\//i],[D,[E,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[D,[E,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[D,[E,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,xe+" WebView"],D],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[D,[E,"Android "+$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,Ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[E,[D,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[E,[D,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[P,"amd64"]],[/(ia32(?=;))/i],[[P,a]],[/((?:i[346]|x)86)[;\)]/i],[[P,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[P,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[P,"armhf"]],[/windows (ce|mobile); ppc;/i],[[P,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[P,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[P,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[P,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[y,[_,lr],[v,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],[y,[_,lr],[v,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[_,z],[v,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[_,z],[v,k]],[/(macintosh);/i],[y,[_,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[_,dt],[v,L]],[/(?:honor)([-\w ]+)[;\)]/i],[y,[_,"Honor"],[v,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[y,[_,ht],[v,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[_,ht],[v,L]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[_,"OPPO"],[v,L]],[/\b(opd2\d{3}a?) bui/i],[y,[_,"OPPO"],[v,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[_,"Vivo"],[v,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[y,[_,"Realme"],[v,L]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[y,[_,lt],[v,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[_,lt],[v,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[_,se],[v,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[_,se],[v,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[y,[_,"Lenovo"],[v,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[y,/_/g," "],[_,"Nokia"],[v,L]],[/(pixel c)\b/i],[y,[_,ve],[v,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[_,ve],[v,L]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[y,[_,Hr],[v,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[_,Hr],[v,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[_,"OnePlus"],[v,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[_,Q],[v,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[_,Q],[v,L]],[/(playbook);[-\w\),; ]+(rim)/i],[y,_,[v,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[_,ge],[v,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[_,X],[v,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[_,X],[v,L]],[/(nexus 9)/i],[y,[_,"HTC"],[v,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[y,/_/g," "],[v,L]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[y,[_,"TCL"],[v,k]],[/(itel) ((\w+))/i],[[_,a],y,[v,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[_,"Acer"],[v,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[_,"Meizu"],[v,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[y,[_,"Ulefone"],[v,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[y,[_,"Energizer"],[v,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[y,[_,"Cat"],[v,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[y,[_,"Smartfren"],[v,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[y,[_,"Nothing"],[v,L]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[_,y,[v,L]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[_,y,[v,k]],[/(surface duo)/i],[y,[_,ie],[v,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[_,"Fairphone"],[v,L]],[/(u304aa)/i],[y,[_,"AT&T"],[v,L]],[/\bsie-(\w*)/i],[y,[_,"Siemens"],[v,L]],[/\b(rct\w+) b/i],[y,[_,"RCA"],[v,k]],[/\b(venue[\d ]{2,7}) b/i],[y,[_,"Dell"],[v,k]],[/\b(q(?:mv|ta)\w+) b/i],[y,[_,"Verizon"],[v,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[_,"Barnes & Noble"],[v,k]],[/\b(tm\d{3}\w+) b/i],[y,[_,"NuVision"],[v,k]],[/\b(k88) b/i],[y,[_,"ZTE"],[v,k]],[/\b(nx\d{3}j) b/i],[y,[_,"ZTE"],[v,L]],[/\b(gen\d{3}) b.+49h/i],[y,[_,"Swiss"],[v,L]],[/\b(zur\d{3}) b/i],[y,[_,"Swiss"],[v,k]],[/\b((zeki)?tb.*\b) b/i],[y,[_,"Zeki"],[v,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],y,[v,k]],[/\b(ns-?\w{0,9}) b/i],[y,[_,"Insignia"],[v,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[_,"NextBook"],[v,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],y,[v,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],y,[v,L]],[/\b(ph-1) /i],[y,[_,"Essential"],[v,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[_,"Envizen"],[v,k]],[/\b(trio[-\w\. ]+) b/i],[y,[_,"MachSpeed"],[v,k]],[/\btu_(1491) b/i],[y,[_,"Rotor"],[v,k]],[/(shield[\w ]+) b/i],[y,[_,"Nvidia"],[v,k]],[/(sprint) (\w+)/i],[_,y,[v,L]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[_,ie],[v,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[_,rn],[v,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[_,rn],[v,L]],[/smart-tv.+(samsung)/i],[_,[v,W]],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[_,lr],[v,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,se],[v,W]],[/(apple) ?tv/i],[_,[y,z+" TV"],[v,W]],[/crkey/i],[[y,xe+"cast"],[_,ve],[v,W]],[/droid.+aft(\w+)( bui|\))/i],[y,[_,Q],[v,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[_,dt],[v,W]],[/(bravia[\w ]+)( bui|\))/i],[y,[_,Hr],[v,W]],[/(mitv-\w{5}) bui/i],[y,[_,Hn],[v,W]],[/Hbbtv.*(technisat) (.*);/i],[_,y,[v,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,f],[y,f],[v,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,W]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,y,[v,M]],[/droid.+; (shield) bui/i],[y,[_,"Nvidia"],[v,M]],[/(playstation [345portablevi]+)/i],[y,[_,Hr],[v,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[_,ie],[v,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[y,[_,lr],[v,ue]],[/((pebble))app/i],[_,y,[v,ue]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[_,z],[v,ue]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,ue]],[/droid.+; (wt63?0{2,3})\)/i],[y,[_,rn],[v,ue]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,ue]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,y,[v,ue]],[/; (quest( \d| pro)?)/i],[y,[_,Zn],[v,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[v,Me]],[/(aeobc)\b/i],[y,[_,Q],[v,Me]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[y,[v,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[v,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,L]],[/(android[-\w\. ]{0,9});.+buil/i],[y,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[D,[E,p+"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,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[D,A,q],[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,Ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[D,[E,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[D,[E,"watchOS"]],[/crkey\/([\d\.]+)/i],[D,[E,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,Vi],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(G,ae){if(typeof G===d&&(ae=G,G=n),!(this instanceof me))return new me(G,ae).getResult();var Z=typeof r!==u&&r.navigator?r.navigator:n,Ce=G||(Z&&Z.userAgent?Z.userAgent:s),Nt=Z&&Z.userAgentData?Z.userAgentData:n,Tt=ae?gt(Ie,ae):Ie,Te=Z&&Z.userAgent==Ce;return this.getBrowser=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.browser),ne[h]=l(ne[D]),Te&&Z&&Z.brave&&typeof Z.brave.isBrave==c&&(ne[E]="Brave"),ne},this.getCPU=function(){var ne={};return ne[P]=n,T.call(ne,Ce,Tt.cpu),ne},this.getDevice=function(){var ne={};return ne[_]=n,ne[y]=n,ne[v]=n,T.call(ne,Ce,Tt.device),Te&&!ne[v]&&Nt&&Nt.mobile&&(ne[v]=L),Te&&ne[y]=="Macintosh"&&Z&&typeof Z.standalone!==u&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&(ne[y]="iPad",ne[v]=k),ne},this.getEngine=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.engine),ne},this.getOS=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.os),Te&&!ne[E]&&Nt&&Nt.platform&&Nt.platform!="Unknown"&&(ne[E]=Nt.platform.replace(/chrome os/i,Vi).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===m&&ne.length>B?f(ne,B):ne,this},this.setUA(Ce),this};me.VERSION=i,me.BROWSER=$r([E,D,h]),me.CPU=$r([P]),me.DEVICE=$r([y,_,v,M,L,W,k,ue,Me]),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(G){je.setUA(G);var ae=je.getResult();for(var Z in ae)ye.ua[Z]=ae[Z]}}})(typeof window=="object"?window:e)}),If=ur((e,t)=>{"use strict";(function(r){if(typeof e=="object"&&typeof t<"u")t.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function d(y,E){if(!c[y]){if(!o[y]){var v=typeof zi=="function"&&zi;if(!E&&v)return v(y,!0);if(m)return m(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var D=c[y]={exports:{}};o[y][0].call(D.exports,function(P){var M=o[y][1][P];return d(M||P)},D,D.exports,s,o,c,u)}return c[y].exports}for(var m=typeof zi=="function"&&zi,h=0;h<u.length;h++)d(u[h]);return d}({1:[function(s,o,c){(function(u){"use strict";var d=u.MutationObserver||u.WebKitMutationObserver,m;if(d){var h=0,y=new d(P),E=u.document.createTextNode("");y.observe(E,{characterData:!0}),m=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var v=new u.MessageChannel;v.port1.onmessage=P,m=function(){v.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var L=u.document.createElement("script");L.onreadystatechange=function(){P(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null},u.document.documentElement.appendChild(L)}:m=function(){setTimeout(P,0)};var _,D=[];function P(){_=!0;for(var L,k,W=D.length;W;){for(k=D,D=[],L=-1;++L<W;)k[L]();W=D.length}_=!1}o.exports=M;function M(L){D.push(L)===1&&!_&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function d(){}var m={},h=["REJECTED"],y=["FULFILLED"],E=["PENDING"];o.exports=v;function v(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=E,this.queue=[],this.outcome=void 0,B!==d&&M(this,B)}v.prototype.catch=function(B){return this.then(null,B)},v.prototype.then=function(B,Q){if(typeof B!="function"&&this.state===y||typeof Q!="function"&&this.state===h)return this;var z=new this.constructor(d);if(this.state!==E){var X=this.state===y?B:Q;D(z,X,this.outcome)}else this.queue.push(new _(z,B,Q));return z};function _(B,Q,z){this.promise=B,typeof Q=="function"&&(this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){m.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){D(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){m.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){D(this.promise,this.onRejected,B)};function D(B,Q,z){u(function(){var X;try{X=Q(z)}catch(ge){return m.reject(B,ge)}X===B?m.reject(B,new TypeError("Cannot resolve promise with itself")):m.resolve(B,X)})}m.resolve=function(B,Q){var z=L(P,Q);if(z.status==="error")return m.reject(B,z.value);var X=z.value;if(X)M(B,X);else{B.state=y,B.outcome=Q;for(var ge=-1,$e=B.queue.length;++ge<$e;)B.queue[ge].callFulfilled(Q)}return B},m.reject=function(B,Q){B.state=h,B.outcome=Q;for(var z=-1,X=B.queue.length;++z<X;)B.queue[z].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 z=!1;function X(p){z||(z=!0,m.reject(B,p))}function ge(p){z||(z=!0,m.resolve(B,p))}function $e(){Q(ge,X)}var xe=L($e);xe.status==="error"&&X(xe.value)}function L(B,Q){var z={};try{z.value=B(Q),z.status="success"}catch(X){z.status="error",z.value=X}return z}v.resolve=k;function k(B){return B instanceof this?B:m.resolve(new this(d),B)}v.reject=W;function W(B){var Q=new this(d);return m.reject(Q,B)}v.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 z=B.length,X=!1;if(!z)return this.resolve([]);for(var ge=new Array(z),$e=0,xe=-1,p=new this(d);++xe<z;)Ge(B[xe],xe);return p;function Ge(ve,ht){Q.resolve(ve).then(se,function(ie){X||(X=!0,m.reject(p,ie))});function se(ie){ge[ht]=ie,++$e===z&&!X&&(X=!0,m.resolve(p,ge))}}}v.race=Me;function Me(B){var Q=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,X=!1;if(!z)return this.resolve([]);for(var ge=-1,$e=new this(d);++ge<z;)xe(B[ge]);return $e;function xe(p){Q.resolve(p).then(function(Ge){X||(X=!0,m.resolve($e,Ge))},function(Ge){X||(X=!0,m.reject($e,Ge))})}}},{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(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g};function d(g,S){if(!(g instanceof S))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function y(){try{if(!h||!h.open)return!1;var g=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(!g||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function E(g,S){g=g||[],S=S||{};try{return new Blob(g,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<g.length;C+=1)x.append(g[C]);return x.getBlob(S.type)}}typeof Promise>"u"&&s(3);var v=Promise;function _(g,S){S&&g.then(function(I){S(null,I)},function(I){S(I)})}function D(g,S,I){typeof S=="function"&&g.then(S),typeof I=="function"&&g.catch(I)}function P(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}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,W={},ue=Object.prototype.toString,Me="readonly",B="readwrite";function Q(g){for(var S=g.length,I=new ArrayBuffer(S),x=new Uint8Array(I),C=0;C<S;C++)x[C]=g.charCodeAt(C);return I}function z(g){return new v(function(S){var I=g.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 X(g){return typeof k=="boolean"?v.resolve(k):z(g).then(function(S){return k=S,k})}function ge(g){var S=W[g.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(g){var S=W[g.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function xe(g,S){var I=W[g.name],x=I.deferredOperations.pop();if(x)return x.reject(S),x.promise}function p(g,S){return new v(function(I,x){if(W[g.name]=W[g.name]||Hr(),g.db)if(S)ge(g),g.db.close();else return I(g.db);var C=[g.name];S&&C.push(g.version);var O=h.open.apply(h,C);S&&(O.onupgradeneeded=function(R){var j=O.result;try{j.createObjectStore(g.storeName),R.oldVersion<=1&&j.createObjectStore(L)}catch(V){if(V.name==="ConstraintError")console.warn('The database "'+g.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+g.storeName+'" already exists.');else throw V}}),O.onerror=function(R){R.preventDefault(),x(O.error)},O.onsuccess=function(){var R=O.result;R.onversionchange=function(j){j.target.close()},I(R),$e(g)}})}function Ge(g){return p(g,!1)}function ve(g){return p(g,!0)}function ht(g,S){if(!g.db)return!0;var I=!g.db.objectStoreNames.contains(g.storeName),x=g.version<g.db.version,C=g.version>g.db.version;if(x&&(g.version!==S&&console.warn('The database "'+g.name+`" can't be downgraded from version `+g.db.version+" to version "+g.version+"."),g.version=g.db.version),C||I){if(I){var O=g.db.version+1;O>g.version&&(g.version=O)}return!0}return!1}function se(g){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:g.type})},x.readAsBinaryString(g)})}function ie(g){var S=Q(atob(g.data));return E([S],{type:g.type})}function lt(g){return g&&g.__local_forage_encoded_blob}function tr(g){var S=this,I=S._initReady().then(function(){var x=W[S._dbInfo.name];if(x&&x.dbReady)return x.dbReady});return D(I,g,g),I}function lr(g){ge(g);for(var S=W[g.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 g.db=null,Ge(g).then(function(O){return g.db=O,ht(g)?ve(g):O}).then(function(O){g.db=S.db=O;for(var R=0;R<I.length;R++)I[R]._dbInfo.db=O}).catch(function(O){throw xe(g,O),O})}function dt(g,S,I,x){x===void 0&&(x=1);try{var C=g.db.transaction(g.storeName,S);I(null,C)}catch(O){if(x>0&&(!g.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return v.resolve().then(function(){if(!g.db||O.name==="NotFoundError"&&!g.db.objectStoreNames.contains(g.storeName)&&g.version<=g.db.version)return g.db&&(g.version=g.db.version+1),ve(g)}).then(function(){return lr(g).then(function(){dt(g,S,I,x-1)})}).catch(I);I(O)}}function Hr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(g){var S=this,I={db:null};if(g)for(var x in g)I[x]=g[x];var C=W[I.name];C||(C=Hr(),W[I.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=tr);var O=[];function R(){return v.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 v.all(O).then(function(){return I.db=C.db,Ge(I)}).then(function(F){return I.db=F,ht(I,S._defaultConfig.version)?ve(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var Y=0;Y<H.length;Y++){var he=H[Y];he!==S&&(he._dbInfo.db=I.db,he._dbInfo.version=I.version)}})}function rn(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,Me,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.get(g);H.onsuccess=function(){var F=H.result;F===void 0&&(F=null),lt(F)&&(F=ie(F)),C(F)},H.onerror=function(){O(H.error)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function Zn(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,Me,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 Y=H.result;if(Y){var he=Y.value;lt(he)&&(he=ie(he));var Ve=g(he,Y.key,F++);Ve!==void 0?C(Ve):Y.continue()}else C()},H.onerror=function(){O(H.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Vi(g,S,I){var x=this;g=P(g);var C=new v(function(O,R){var j;x.ready().then(function(){return j=x._dbInfo,ue.call(S)==="[object Blob]"?X(j.db).then(function(V){return V?S:se(S)}):S}).then(function(V){dt(x._dbInfo,B,function(H,F){if(H)return R(H);try{var Y=F.objectStore(x._dbInfo.storeName);V===null&&(V=void 0);var he=Y.put(V,g);F.oncomplete=function(){V===void 0&&(V=null),O(V)},F.onabort=F.onerror=function(){var Ve=he.error?he.error:he.transaction.error;R(Ve)}}catch(Ve){R(Ve)}})}).catch(R)});return _(C,I),C}function Wn(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,B,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.delete(g);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 _(x,S),x}function Mn(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(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(){x()},R.onabort=R.onerror=function(){var H=V.error?V.error:V.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return _(I,g),I}function gt(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(S._dbInfo,Me,function(O,R){if(O)return C(O);try{var j=R.objectStore(S._dbInfo.storeName),V=j.count();V.onsuccess=function(){x(V.result)},V.onerror=function(){C(V.error)}}catch(H){C(H)}})}).catch(C)});return _(I,g),I}function $r(g,S){var I=this,x=new v(function(C,O){if(g<0){C(null);return}I.ready().then(function(){dt(I._dbInfo,Me,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 Y=F.result;if(!Y){C(null);return}g===0||H?C(Y.key):(H=!0,Y.advance(g))},F.onerror=function(){O(F.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Wi(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(S._dbInfo,Me,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){x(H);return}H.push(F.key),F.continue()},V.onerror=function(){C(V.error)}}catch(F){C(F)}})}).catch(C)});return _(I,g),I}function a(g,S){S=M.apply(this,arguments);var I=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||I.name,g.storeName=g.storeName||I.storeName);var x=this,C;if(!g.name)C=v.reject("Invalid arguments");else{var O=g.name===I.name&&x._dbInfo.db,R=O?v.resolve(x._dbInfo.db):Ge(g).then(function(j){var V=W[g.name],H=V.forages;V.db=j;for(var F=0;F<H.length;F++)H[F]._dbInfo.db=j;return j});g.storeName?C=R.then(function(j){if(j.objectStoreNames.contains(g.storeName)){var V=j.version+1;ge(g);var H=W[g.name],F=H.forages;j.close();for(var Y=0;Y<F.length;Y++){var he=F[Y];he._dbInfo.db=null,he._dbInfo.version=V}var Ve=new v(function(Re,ut){var qe=h.open(g.name,V);qe.onerror=function(Ht){var wc=qe.result;wc.close(),ut(Ht)},qe.onupgradeneeded=function(){var Ht=qe.result;Ht.deleteObjectStore(g.storeName)},qe.onsuccess=function(){var Ht=qe.result;Ht.close(),Re(Ht)}});return Ve.then(function(Re){H.db=Re;for(var ut=0;ut<F.length;ut++){var qe=F[ut];qe._dbInfo.db=Re,$e(qe._dbInfo)}}).catch(function(Re){throw(xe(g,Re)||v.resolve()).catch(function(){}),Re})}}):C=R.then(function(j){ge(g);var V=W[g.name],H=V.forages;j.close();for(var F=0;F<H.length;F++){var Y=H[F];Y._dbInfo.db=null}var he=new v(function(Ve,Re){var ut=h.deleteDatabase(g.name);ut.onerror=function(){var qe=ut.result;qe&&qe.close(),Re(ut.error)},ut.onblocked=function(){console.warn('dropInstance blocked for database "'+g.name+'" until all open connections are closed')},ut.onsuccess=function(){var qe=ut.result;qe&&qe.close(),Ve(qe)}});return he.then(function(Ve){V.db=Ve;for(var Re=0;Re<H.length;Re++){var ut=H[Re];$e(ut._dbInfo)}}).catch(function(Ve){throw(xe(g,Ve)||v.resolve()).catch(function(){}),Ve})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:Hn,_support:y(),iterate:Zn,getItem:rn,setItem:Vi,removeItem:Wn,clear:Mn,length:gt,key:$r,keys:Wi,dropInstance:a};function f(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,q="__lfsc__:",Ie=q.length,me="arbf",ye="blob",je="si08",G="ui08",ae="uic8",Z="si16",Ce="si32",Nt="ur16",Tt="ui32",Te="fl32",ne="fl64",$t=Ie+me.length,Gi=Object.prototype.toString;function is(g){var S=g.length*.75,I=g.length,x,C=0,O,R,j,V;g[g.length-1]==="="&&(S--,g[g.length-2]==="="&&S--);var H=new ArrayBuffer(S),F=new Uint8Array(H);for(x=0;x<I;x+=4)O=T.indexOf(g[x]),R=T.indexOf(g[x+1]),j=T.indexOf(g[x+2]),V=T.indexOf(g[x+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(g){var S=new Uint8Array(g),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 Wh(g,S){var I="";if(g&&(I=Gi.call(g)),g&&(I==="[object ArrayBuffer]"||g.buffer&&Gi.call(g.buffer)==="[object ArrayBuffer]")){var x,C=q;g instanceof ArrayBuffer?(x=g,C+=me):(x=g.buffer,I==="[object Int8Array]"?C+=je:I==="[object Uint8Array]"?C+=G:I==="[object Uint8ClampedArray]"?C+=ae:I==="[object Int16Array]"?C+=Z:I==="[object Uint16Array]"?C+=Nt:I==="[object Int32Array]"?C+=Ce:I==="[object Uint32Array]"?C+=Tt: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 R=A+g.type+"~"+zo(this.result);S(q+ye+R)},O.readAsArrayBuffer(g)}else try{S(JSON.stringify(g))}catch(R){console.error("Couldn't convert value into a JSON string: ",g),S(null,R)}}function qh(g){if(g.substring(0,Ie)!==q)return JSON.parse(g);var S=g.substring($t),I=g.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=is(S);switch(I){case me:return O;case ye:return E([O],{type:x});case je:return new Int8Array(O);case G:return new Uint8Array(O);case ae:return new Uint8ClampedArray(O);case Z:return new Int16Array(O);case Nt:return new Uint16Array(O);case Ce:return new Int32Array(O);case Tt:return new Uint32Array(O);case Te:return new Float32Array(O);case ne:return new Float64Array(O);default:throw new Error("Unkown type: "+I)}}var ya={serialize:Wh,deserialize:qh,stringToBuffer:is,bufferToString:zo};function Ju(g,S,I,x){g.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],I,x)}function Gh(g){var S=this,I={db:null};if(g)for(var x in g)I[x]=typeof g[x]!="string"?g[x].toString():g[x];var C=new v(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){Ju(j,I,function(){S._dbInfo=I,O()},function(V,H){R(H)})},R)});return I.serializer=ya,C}function Fn(g,S,I,x,C,O){g.executeSql(I,x,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):Ju(V,S,function(){V.executeSql(I,x,C,O)},O)},O):O(R,j)},O)}function Kh(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[g],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 _(x,S),x}function Jh(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT * FROM "+R.storeName,[],function(V,H){for(var F=H.rows,Y=F.length,he=0;he<Y;he++){var Ve=F.item(he),Re=Ve.value;if(Re&&(Re=R.serializer.deserialize(Re)),Re=g(Re,Ve.key,he+1),Re!==void 0){C(Re);return}}C()},function(V,H){O(H)})})}).catch(O)});return _(x,S),x}function Xu(g,S,I,x){var C=this;g=P(g);var O=new v(function(R,j){C.ready().then(function(){S===void 0&&(S=null);var V=S,H=C._dbInfo;H.serializer.serialize(S,function(F,Y){Y?j(Y):H.db.transaction(function(he){Fn(he,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[g,F],function(){R(V)},function(Ve,Re){j(Re)})},function(he){if(he.code===he.QUOTA_ERR){if(x>0){R(Xu.apply(C,[g,V,I,x-1]));return}j(he)}})})}).catch(j)});return _(O,I),O}function Yh(g,S,I){return Xu.apply(this,[g,S,I,1])}function zh(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[g],function(){C()},function(V,H){O(H)})})}).catch(O)});return _(x,S),x}function Xh(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(R,O,"DELETE FROM "+O.storeName,[],function(){x()},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function Qh(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(R,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(j,V){var H=V.rows.item(0).c;x(H)},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function Zh(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[g+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 _(x,S),x}function ep(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(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);x(H)},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function tp(g){return new v(function(S,I){g.transaction(function(x){x.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:g,storeNames:R})},function(C,O){I(O)})},function(x){I(x)})})}function rp(g,S){S=M.apply(this,arguments);var I=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||I.name,g.storeName=g.storeName||I.storeName);var x=this,C;return g.name?C=new v(function(O){var R;g.name===I.name?R=x._dbInfo.db:R=openDatabase(g.name,"","",0),g.storeName?O({db:R,storeNames:[g.storeName]}):O(tp(R))}).then(function(O){return new v(function(R,j){O.db.transaction(function(V){function H(Ve){return new v(function(Re,ut){V.executeSql("DROP TABLE IF EXISTS "+Ve,[],function(){Re()},function(qe,Ht){ut(Ht)})})}for(var F=[],Y=0,he=O.storeNames.length;Y<he;Y++)F.push(H(O.storeNames[Y]));v.all(F).then(function(){R()}).catch(function(Ve){j(Ve)})},function(V){j(V)})})}):C=v.reject("Invalid arguments"),_(C,S),C}var np={_driver:"webSQLStorage",_initStorage:Gh,_support:f(),iterate:Jh,getItem:Kh,setItem:Yh,removeItem:zh,clear:Xh,length:Qh,key:Zh,keys:ep,dropInstance:rp};function ip(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Zu(g,S){var I=g.name+"/";return g.storeName!==S.storeName&&(I+=g.storeName+"/"),I}function lp(){var g="_localforage_support_test";try{return localStorage.setItem(g,!0),localStorage.removeItem(g),!1}catch{return!0}}function up(){return!lp()||localStorage.length>0}function hp(g){var S=this,I={};if(g)for(var x in g)I[x]=g[x];return I.keyPrefix=Zu(g,S._defaultConfig),up()?(S._dbInfo=I,I.serializer=ya,v.resolve()):v.reject()}function dp(g){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,g),I}function pp(g,S){var I=this;g=P(g);var x=I.ready().then(function(){var C=I._dbInfo,O=localStorage.getItem(C.keyPrefix+g);return O&&(O=C.serializer.deserialize(O)),O});return _(x,S),x}function fp(g,S){var I=this,x=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 Y=localStorage.getItem(F);if(Y&&(Y=C.serializer.deserialize(Y)),Y=g(Y,F.substring(R),V++),Y!==void 0)return Y}}});return _(x,S),x}function gp(g,S){var I=this,x=I.ready().then(function(){var C=I._dbInfo,O;try{O=localStorage.key(g)}catch{O=null}return O&&(O=O.substring(C.keyPrefix.length)),O});return _(x,S),x}function mp(g){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo,C=localStorage.length,O=[],R=0;R<C;R++){var j=localStorage.key(R);j.indexOf(x.keyPrefix)===0&&O.push(j.substring(x.keyPrefix.length))}return O});return _(I,g),I}function yp(g){var S=this,I=S.keys().then(function(x){return x.length});return _(I,g),I}function vp(g,S){var I=this;g=P(g);var x=I.ready().then(function(){var C=I._dbInfo;localStorage.removeItem(C.keyPrefix+g)});return _(x,S),x}function bp(g,S,I){var x=this;g=P(g);var C=x.ready().then(function(){S===void 0&&(S=null);var O=S;return new v(function(R,j){var V=x._dbInfo;V.serializer.serialize(S,function(H,F){if(F)j(F);else try{localStorage.setItem(V.keyPrefix+g,H),R(O)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(Y),j(Y)}})})});return _(C,I),C}function wp(g,S){if(S=M.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var I=this.config();g.name=g.name||I.name,g.storeName=g.storeName||I.storeName}var x=this,C;return g.name?C=new v(function(O){g.storeName?O(Zu(g,x._defaultConfig)):O(g.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=v.reject("Invalid arguments"),_(C,S),C}var _p={_driver:"localStorageWrapper",_initStorage:hp,_support:ip(),iterate:fp,getItem:pp,setItem:bp,removeItem:vp,clear:dp,length:yp,key:gp,keys:mp,dropInstance:wp},Ep=function(g,S){return g===S||typeof g=="number"&&typeof S=="number"&&isNaN(g)&&isNaN(S)},Sp=function(g,S){for(var I=g.length,x=0;x<I;){if(Ep(g[x],S))return!0;x++}return!1},vh=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"},ss={},bh={},Yi={INDEXEDDB:l,WEBSQL:np,LOCALSTORAGE:_p},Ip=[Yi.INDEXEDDB._driver,Yi.WEBSQL._driver,Yi.LOCALSTORAGE._driver],Jo=["dropInstance"],Va=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Jo),Tp={description:"",driver:Ip.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Cp(g,S){g[S]=function(){var I=arguments;return g.ready().then(function(){return g[S].apply(g,I)})}}function bc(){for(var g=1;g<arguments.length;g++){var S=arguments[g];if(S)for(var I in S)S.hasOwnProperty(I)&&(vh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var Np=function(){function g(S){d(this,g);for(var I in Yi)if(Yi.hasOwnProperty(I)){var x=Yi[I],C=x._driver;this[I]=C,ss[C]||this.defineDriver(x)}this._defaultConfig=bc({},Tp),this._config=bc({},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 g.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},g.prototype.defineDriver=function(S,I,x){var C=new v(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=Va.concat("_initStorage"),F=0,Y=H.length;F<Y;F++){var he=H[F],Ve=!Sp(Jo,he);if((Ve||S[he])&&typeof S[he]!="function"){R(V);return}}var Re=function(){for(var qe=function(xp){return function(){var Op=new Error("Method "+xp+" is not implemented by the current driver"),wh=v.reject(Op);return _(wh,arguments[arguments.length-1]),wh}},Ht=0,wc=Jo.length;Ht<wc;Ht++){var Sc=Jo[Ht];S[Sc]||(S[Sc]=qe(Sc))}};Re();var ut=function(qe){ss[j]&&console.info("Redefining LocalForage driver: "+j),ss[j]=S,bh[j]=qe,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(ut,R):ut(!!S._support):ut(!0)}catch(qe){R(qe)}});return D(C,I,x),C},g.prototype.driver=function(){return this._driver||null},g.prototype.getDriver=function(S,I,x){var C=ss[S]?v.resolve(ss[S]):v.reject(new Error("Driver not found."));return D(C,I,x),C},g.prototype.getSerializer=function(S){var I=v.resolve(ya);return D(I,S),I},g.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},g.prototype.setDriver=function(S,I,x){var C=this;vh(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 Y=0;function he(){for(;Y<F.length;){var Ve=F[Y];return Y++,C._dbInfo=null,C._ready=null,C.getDriver(Ve).then(j).catch(he)}R();var Re=new Error("No available storage method found.");return C._driverSet=v.reject(Re),C._driverSet}return he()}}var H=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=H.then(function(){var F=O[0];return C._dbInfo=null,C._ready=null,C.getDriver(F).then(function(Y){C._driver=Y._driver,R(),C._wrapLibraryMethodsWithReady(),C._initDriver=V(O)})}).catch(function(){R();var F=new Error("No available storage method found.");return C._driverSet=v.reject(F),C._driverSet}),D(this._driverSet,I,x),this._driverSet},g.prototype.supports=function(S){return!!bh[S]},g.prototype._extend=function(S){bc(this,S)},g.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},g.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,I=Va.length;S<I;S++)Cp(this,Va[S])},g.prototype.createInstance=function(S){return new g(S)},g}(),Dp=new Np;o.exports=Dp},{3:3}]},{},[4])(4)})}),ei=ur(e=>{"use strict";var t=e&&e.__awaiter||function(n,i,s,o){function c(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function m(E){try{y(o.next(E))}catch(v){d(v)}}function h(E){try{y(o.throw(E))}catch(v){d(v)}}function y(E){E.done?u(E.value):c(E.value).then(m,h)}y((o=o.apply(n,i||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.JSUtils=void 0;var r=class{static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static sleep(n){return t(this,void 0,void 0,function*(){return new Promise(i=>setTimeout(i,n))})}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,i){return i.reduce((s,o)=>(n.hasOwnProperty(o)&&n[o]!=null&&s.push({[o]:n[o]}),s),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((i,s)=>(n[s]!==null&&n[s]!==void 0&&(i[s]=n[s]),i),{})}static stringify(n){return JSON.stringify(n,function(i,s){return s===void 0?null:s})}};e.JSUtils=r,r.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)}),ku=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}),th=ur((e,t)=>{"use strict";(function(r,n){typeof e=="object"&&typeof t<"u"?t.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(e,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,d){var m=o.retries,h=o.retryDelay,y=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))m=d.retries;else throw new i("retries must be a positive integer");if(d&&d.retryDelay!==void 0)if(n(d.retryDelay)||typeof d.retryDelay=="function")h=d.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(d&&d.retryOn)if(Array.isArray(d.retryOn)||typeof d.retryOn=="function")y=d.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(E,v){var _=function(P){var M=typeof Request<"u"&&u instanceof Request?u.clone():u;s(M,d).then(function(L){if(Array.isArray(y)&&y.indexOf(L.status)===-1)E(L);else if(typeof y=="function")try{return Promise.resolve(y(P,null,L)).then(function(k){k?D(P,null,L):E(L)}).catch(v)}catch(k){v(k)}else P<m?D(P,null,L):E(L)}).catch(function(L){if(typeof y=="function")try{Promise.resolve(y(P,L,null)).then(function(k){k?D(P,L,null):v(L)}).catch(function(k){v(k)})}catch(k){v(k)}else P<m?D(P,L,null):v(L)})};function D(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})}),cp="9.4.0",N=class Ic{static SDK_VERSION=cp;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_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 CTA_EVENT="letscooee:outbound:cta";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=Ic.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ic.SDK_VERSION_CODE=parseInt(t,10)}},Ct={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`},Ot=Se(nn()),b=class{static log(...e){Ot.default.info(...e)}static debug(...e){Ot.default.debug(...e)}static error(...e){Ot.default.error(...e)}static warn(...e){Ot.default.warn(...e)}static info(...e){Ot.default.info(...e)}static trace(...e){Ot.default.trace(...e)}static configure(e=N.LOG_PREFIX){Ot.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?Ot.default.setLevel(Ot.default[localStorage.cooeeLogLevel]):Ot.default.setLevel(Ct.debug?Ot.default.TRACE:Ot.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
|
|
1
|
+
"use strict";(()=>{var rg=Object.create,xc=Object.defineProperty,ng=Object.defineProperties,ig=Object.getOwnPropertyDescriptor,og=Object.getOwnPropertyDescriptors,sg=Object.getOwnPropertyNames,op=Object.getOwnPropertySymbols,ag=Object.getPrototypeOf,ap=Object.prototype.hasOwnProperty,cg=Object.prototype.propertyIsEnumerable,sp=(e,t,r)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||={})ap.call(t,r)&&sp(e,r,t[r]);if(op)for(var r of op(t))cg.call(t,r)&&sp(e,r,t[r]);return e},ee=(e,t)=>ng(e,og(t)),zi=(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),lg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sg(t))!ap.call(e,i)&&i!==r&&xc(e,i,{get:()=>t[i],enumerable:!(n=ig(t,i))||n.enumerable});return e},Se=(e,t,r)=>(r=e!=null?rg(ag(e)):{},lg(t||!e||!e.__esModule?xc(r,"default",{value:e,enumerable:!0}):r,e)),nn=ur((e,t)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,y){return function(){return y.apply(h,arguments)}},c=function(){var h=arguments,y=h[0],E,v;for(v=1;v<h.length;v++)for(E in h[v])!(E in y)&&h[v].hasOwnProperty(E)&&(y[E]=h[v][E]);return y},u=function(h,y){return{value:h,name:y}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var d=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};d.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var y=this.context.filterLevel;return h.value>=y.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,y){i&&this.enabledFor(h)&&i(y,c({level:h},this.context))}};var m=new d({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var y in s)s.hasOwnProperty(y)&&s[y].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new d(c({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(v,_){_.name&&v.unshift("["+_.name+"]")};var y={},E=function(v,_){Function.prototype.apply.call(v,console,_)};return typeof console>"u"?function(){}:function(v,_){v=Array.prototype.slice.call(v);var D=console.log,P;_.level===n.TIME?(P=(_.name?"["+_.name+"] ":"")+v[0],v[1]==="start"?console.time?console.time(P):y[P]=new Date().getTime():console.timeEnd?console.timeEnd(P):E(D,[P+": "+(new Date().getTime()-y[P])+"ms"])):(_.level===n.WARN&&console.warn?D=console.warn:_.level===n.ERROR&&console.error?D=console.error:_.level===n.INFO&&console.info?D=console.info:_.level===n.DEBUG&&console.debug?D=console.debug:_.level===n.TRACE&&console.trace&&(D=console.trace),h.formatter(v,_),E(D,v))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof t<"u"&&t.exports?t.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(e)}),Dc=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MustacheUtils=void 0;var t=class _h{static escapeHtml(n){return String(n).replace(/"/g,i=>_h.entityMap[i])}};e.MustacheUtils=t,t.entityMap={'"':"""}}),Rr=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MilestoneRewardType=e.ProgressBarLayout=e.EngagementContentSource=e.EngagementObjective=e.OnsiteDeliveryType=e.ClickActionType=e.FrequencyGapUnit=e.FrequencyType=e.RedirectBehaviour=e.EngagementPlacementPosition=e.EngagementCollectionSource=e.PromotionType=e.CartFilterEnum=e.CartCurrencyOperator=e.CartCriteria=e.URLCriteria=e.UTMCriteria=e.CartItemSource=e.EngagementItemSource=e.PurchasedVisitor=e.LoggedInVisitor=e.VisitorType=e.SessionType=e.EngagementContentType=e.TriggerType=e.EngagementType=e.EngagementStatus=e.TimePreference=e.ScheduleFrequency=e.CriteriaFrequency=void 0;var t=function(p){return p[p.ONCE_PER_USER=1]="ONCE_PER_USER",p[p.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",p[p.EVERY_TIME=3]="EVERY_TIME",p}(t||(e.CriteriaFrequency=t={})),r=function(p){return p[p.ONE_TIME=1]="ONE_TIME",p[p.MULTIPLE=2]="MULTIPLE",p[p.RECURRING=3]="RECURRING",p}(r||(e.ScheduleFrequency=r={})),n=function(p){return p[p.NOW=1]="NOW",p[p.LATER=2]="LATER",p[p.NEVER=3]="NEVER",p}(n||(e.TimePreference=n={})),i=function(p){return p[p.PUBLISHED=1]="PUBLISHED",p[p.DRAFT=2]="DRAFT",p[p.PAUSED=3]="PAUSED",p[p.FAILED=4]="FAILED",p[p.STOPPED=5]="STOPPED",p[p.COMPLETED=6]="COMPLETED",p[p.ARCHIVED=7]="ARCHIVED",p[p.UNINSTALLED=8]="UNINSTALLED",p}(i||(e.EngagementStatus=i={})),s=function(p){return p[p.POPUP=1]="POPUP",p[p.LEAD_GENERATION=2]="LEAD_GENERATION",p[p.PRODUCT_WIDGET=3]="PRODUCT_WIDGET",p[p.PRODUCT_BUNDLE=4]="PRODUCT_BUNDLE",p[p.ANNOUNCEMENT_BAR=5]="ANNOUNCEMENT_BAR",p[p.CART_REMINDER=6]="CART_REMINDER",p[p.CRO_COPILOT=10]="CRO_COPILOT",p[p.OTHER=11]="OTHER",p}(s||(e.EngagementType=s={})),o=function(p){return p[p.NONE=0]="NONE",p[p.RULE_BASED=1]="RULE_BASED",p[p.INTENT_BASED=2]="INTENT_BASED",p}(o||(e.TriggerType=o={})),c=function(p){return p[p.SINGLE=1]="SINGLE",p[p.EXCLUSION=2]="EXCLUSION",p[p.ABTESTING=3]="ABTESTING",p}(c||(e.EngagementContentType=c={})),u=function(p){return p[p.ALL=0]="ALL",p[p.NEW_ONLY=1]="NEW_ONLY",p[p.RETURNING_ONLY=2]="RETURNING_ONLY",p}(u||(e.SessionType=u={})),d=function(p){return p[p.ALL=0]="ALL",p[p.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",p[p.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",p[p.PURCHASED=5]="PURCHASED",p[p.NON_PURCHASED=6]="NON_PURCHASED",p[p.ABANDON_CART=7]="ABANDON_CART",p[p.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",p}(d||(e.VisitorType=d={})),m=function(p){return p.ALL="ALL",p.LOGGED_IN="LOGGED_IN",p.NON_LOGGED_IN="NON_LOGGED_IN",p}(m||(e.LoggedInVisitor=m={})),h=function(p){return p.ALL="ALL",p.PURCHASED="PURCHASED",p.NON_PURCHASED="NON_PURCHASED",p}(h||(e.PurchasedVisitor=h={})),y=function(p){return p[p.NONE=0]="NONE",p[p.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",p[p.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",p[p.SINGLE_ITEM=3]="SINGLE_ITEM",p[p.TOP_SELLING=4]="TOP_SELLING",p[p.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",p[p.NEW_ARRIVALS=6]="NEW_ARRIVALS",p[p.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",p[p.EVENT_ITEM=8]="EVENT_ITEM",p[p.CART_ITEM=9]="CART_ITEM",p[p.BUNDLE=10]="BUNDLE",p[p.CURRENT_ITEM=11]="CURRENT_ITEM",p[p.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",p[p.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",p[p.TRENDING_ITEMS=14]="TRENDING_ITEMS",p}(y||(e.EngagementItemSource=y={})),E=function(p){return p[p.LAST_ADDED=1]="LAST_ADDED",p[p.FIRST_ADDED=2]="FIRST_ADDED",p[p.HIGHEST_PRICE=3]="HIGHEST_PRICE",p[p.LOWEST_PRICE=4]="LOWEST_PRICE",p[p.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",p[p.ALL=6]="ALL",p}(E||(e.CartItemSource=E={})),v=function(p){return p[p.ALL=0]="ALL",p[p.ONLY_ORGANIC=1]="ONLY_ORGANIC",p[p.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",p[p.INCLUDES=3]="INCLUDES",p[p.EXCLUDES=4]="EXCLUDES",p}(v||(e.UTMCriteria=v={})),_=function(p){return p[p.NONE=0]="NONE",p[p.LIKE=1]="LIKE",p[p.NOT_LIKE=2]="NOT_LIKE",p[p.EQUALS=3]="EQUALS",p[p.NOT_EQUALS=4]="NOT_EQUALS",p}(_||(e.URLCriteria=_={})),D=function(p){return p[p.NONE=0]="NONE",p[p.LESS_THAN=1]="LESS_THAN",p[p.GREATER_THAN=2]="GREATER_THAN",p[p.BETWEEN=3]="BETWEEN",p[p.EQUALS=4]="EQUALS",p}(D||(e.CartCriteria=D={})),P=function(p){return p[p.ALL=0]="ALL",p[p.INCLUDES=1]="INCLUDES",p[p.EXCLUDES=2]="EXCLUDES",p}(P||(e.CartCurrencyOperator=P={})),M=function(p){return p[p.NONE=0]="NONE",p[p.AMOUNT=1]="AMOUNT",p[p.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",p[p.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",p}(M||(e.CartFilterEnum=M={})),L=function(p){return p[p.NONE=0]="NONE",p[p.ITEM=1]="ITEM",p[p.COLLECTION=2]="COLLECTION",p}(L||(e.PromotionType=L={})),k=function(p){return p[p.NONE=0]="NONE",p[p.SINGLE=1]="SINGLE",p[p.MULTIPLE=2]="MULTIPLE",p}(k||(e.EngagementCollectionSource=k={})),W=function(p){return p.BEFORE="before",p.AFTER="after",p.INSIDE_FIRST="insideFirst",p.INSIDE_LAST="insideLast",p}(W||(e.EngagementPlacementPosition=W={})),ue=function(p){return p.SHOPIFY_CHECKOUT="shopify_checkout",p.THIRD_PARTY_CHECKOUT="third_party_checkout",p.CART_PAGE="cart_page",p.CART_DRAWER="cart_drawer",p}(ue||(e.RedirectBehaviour=ue={})),Me=function(p){return p.ONCE_IN_SESSION="ONCE_IN_SESSION",p.ACROSS_SESSIONS="ACROSS_SESSIONS",p}(Me||(e.FrequencyType=Me={})),B=function(p){return p.DAYS="DAYS",p.HOURS="HOURS",p.MINUTES="MINUTES",p.SECONDS="SECONDS",p}(B||(e.FrequencyGapUnit=B={})),Q=function(p){return p[p.NONE=0]="NONE",p[p.REJECT_POPUP=1]="REJECT_POPUP",p[p.ACCEPT_POPUP=2]="ACCEPT_POPUP",p[p.GO_TO_URL=4]="GO_TO_URL",p[p.SHARE=5]="SHARE",p[p.KEY_VALUE=100]="KEY_VALUE",p[p.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",p[p.ADD_TO_CART=102]="ADD_TO_CART",p[p.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",p[p.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",p[p.OPEN_CART=105]="OPEN_CART",p[p.SUBMIT_FORM=106]="SUBMIT_FORM",p[p.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",p[p.ADD_BUNDLE=108]="ADD_BUNDLE",p[p.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",p}(Q||(e.ClickActionType=Q={})),z=function(p){return p.POPUP="POPUP",p.PAGE_EMBED="PAGE_EMBED",p.CART_EMBED="CART_EMBED",p.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",p}(z||(e.OnsiteDeliveryType=z={})),X=function(p){return p.PRODUCT_PROMOTION="PRODUCT_PROMOTION",p.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",p.CART_RECOVERY="CART_RECOVERY",p.ANNOUNCEMENT="ANNOUNCEMENT",p.LEAD_GENERATION="LEAD_GENERATION",p.DATA_COLLECTION="DATA_COLLECTION",p.SALE_PROMOTION="SALE_PROMOTION",p.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",p.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",p.BYOB="BYOB",p.PROGRESS_BAR="PROGRESS_BAR",p.BUY_NOW="BUY_NOW",p}(X||(e.EngagementObjective=X={})),ge=function(p){return p.COOEE="COOEE",p.KLAVIYO="KLAVIYO",p}(ge||(e.EngagementContentSource=ge={})),$e=function(p){return p.ICONS="ICONS",p.TILES="TILES",p}($e||(e.ProgressBarLayout=$e={})),xe=function(p){return p.FREE_SHIPPING="FREE_SHIPPING",p.DISCOUNT="DISCOUNT",p.FREE_AUTO_GIFT="FREE_AUTO_GIFT",p.FREE_GIFT_SELECT="FREE_GIFT_SELECT",p}(xe||(e.MilestoneRewardType=xe={}))}),Ko=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={}))}),Ac=ur(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayUtils=void 0;var t=class Eh{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--,Eh.swap(n,i,s)}}};e.ArrayUtils=t}),Sf=ur((e,t)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",d="object",m="string",h="major",y="model",E="name",v="type",_="vendor",D="version",P="architecture",M="console",L="mobile",k="tablet",W="smarttv",ue="wearable",Me="embedded",B=500,Q="Amazon",z="Apple",X="ASUS",ge="BlackBerry",$e="Browser",xe="Chrome",p="Edge",Ge="Firefox",ve="Google",ht="Huawei",se="LG",ie="Microsoft",lt="Motorola",tr="Opera",lr="Samsung",dt="Sharp",Hr="Sony",Hn="Xiaomi",rn="Zebra",Zn="Facebook",Vi="Chromium OS",Wn="Mac OS",Mn=" Browser",gt=function(G,ae){var Z={};for(var Ce in G)ae[Ce]&&ae[Ce].length%2===0?Z[Ce]=ae[Ce].concat(G[Ce]):Z[Ce]=G[Ce];return Z},$r=function(G){for(var ae={},Z=0;Z<G.length;Z++)ae[G[Z].toUpperCase()]=G[Z];return ae},Wi=function(G,ae){return typeof G===m?a(ae).indexOf(a(G))!==-1:!1},a=function(G){return G.toLowerCase()},l=function(G){return typeof G===m?G.replace(/[^\d\.]/g,s).split(".")[0]:n},f=function(G,ae){if(typeof G===m)return G=G.replace(/^\s\s*/,s),typeof ae===u?G:G.substring(0,B)},T=function(G,ae){for(var Z=0,Ce,Nt,Tt,Te,ne,$t;Z<ae.length&&!ne;){var Gi=ae[Z],is=ae[Z+1];for(Ce=Nt=0;Ce<Gi.length&&!ne&&Gi[Ce];)if(ne=Gi[Ce++].exec(G),ne)for(Tt=0;Tt<is.length;Tt++)$t=ne[++Nt],Te=is[Tt],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;Z+=2}},A=function(G,ae){for(var Z in ae)if(typeof ae[Z]===d&&ae[Z].length>0){for(var Ce=0;Ce<ae[Z].length;Ce++)if(Wi(ae[Z][Ce],G))return Z===o?n:Z}else if(Wi(ae[Z],G))return Z===o?n:Z;return ae.hasOwnProperty("*")?ae["*"]:G},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","?":"/"},q={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,Ge+" 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"+Mn]],[/fxios\/([\w\.-]+)/i],[D,[E,Ge]],[/\bqihoobrowser\/?([\w\.]*)/i],[D,[E,"360"]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,"$1Browser"],D],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,"$1"+Mn],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,Zn],D],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[E,D],[/\bgsa\/([\w\.]+) .*safari\//i],[D,[E,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[D,[E,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[D,[E,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,xe+" WebView"],D],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[D,[E,"Android "+$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,Ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[E,[D,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[E,[D,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[P,"amd64"]],[/(ia32(?=;))/i],[[P,a]],[/((?:i[346]|x)86)[;\)]/i],[[P,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[P,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[P,"armhf"]],[/windows (ce|mobile); ppc;/i],[[P,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[P,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[P,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[P,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[y,[_,lr],[v,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],[y,[_,lr],[v,L]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[_,z],[v,L]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[_,z],[v,k]],[/(macintosh);/i],[y,[_,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[_,dt],[v,L]],[/(?:honor)([-\w ]+)[;\)]/i],[y,[_,"Honor"],[v,L]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[y,[_,ht],[v,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[_,ht],[v,L]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,L]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[y,/_/g," "],[_,Hn],[v,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[_,"OPPO"],[v,L]],[/\b(opd2\d{3}a?) bui/i],[y,[_,"OPPO"],[v,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[_,"Vivo"],[v,L]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[y,[_,"Realme"],[v,L]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[y,[_,lt],[v,L]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[_,lt],[v,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[_,se],[v,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[_,se],[v,L]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[y,[_,"Lenovo"],[v,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[y,/_/g," "],[_,"Nokia"],[v,L]],[/(pixel c)\b/i],[y,[_,ve],[v,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[_,ve],[v,L]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[y,[_,Hr],[v,L]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[_,Hr],[v,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[_,"OnePlus"],[v,L]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[_,Q],[v,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[_,Q],[v,L]],[/(playbook);[-\w\),; ]+(rim)/i],[y,_,[v,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[_,ge],[v,L]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[_,X],[v,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[_,X],[v,L]],[/(nexus 9)/i],[y,[_,"HTC"],[v,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[y,/_/g," "],[v,L]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[y,[_,"TCL"],[v,k]],[/(itel) ((\w+))/i],[[_,a],y,[v,A,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[_,"Acer"],[v,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[_,"Meizu"],[v,L]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[y,[_,"Ulefone"],[v,L]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[y,[_,"Energizer"],[v,L]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[y,[_,"Cat"],[v,L]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[y,[_,"Smartfren"],[v,L]],[/droid.+; (a(?:015|06[35]|142p?))/i],[y,[_,"Nothing"],[v,L]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[_,y,[v,L]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[_,y,[v,k]],[/(surface duo)/i],[y,[_,ie],[v,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[_,"Fairphone"],[v,L]],[/(u304aa)/i],[y,[_,"AT&T"],[v,L]],[/\bsie-(\w*)/i],[y,[_,"Siemens"],[v,L]],[/\b(rct\w+) b/i],[y,[_,"RCA"],[v,k]],[/\b(venue[\d ]{2,7}) b/i],[y,[_,"Dell"],[v,k]],[/\b(q(?:mv|ta)\w+) b/i],[y,[_,"Verizon"],[v,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[_,"Barnes & Noble"],[v,k]],[/\b(tm\d{3}\w+) b/i],[y,[_,"NuVision"],[v,k]],[/\b(k88) b/i],[y,[_,"ZTE"],[v,k]],[/\b(nx\d{3}j) b/i],[y,[_,"ZTE"],[v,L]],[/\b(gen\d{3}) b.+49h/i],[y,[_,"Swiss"],[v,L]],[/\b(zur\d{3}) b/i],[y,[_,"Swiss"],[v,k]],[/\b((zeki)?tb.*\b) b/i],[y,[_,"Zeki"],[v,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],y,[v,k]],[/\b(ns-?\w{0,9}) b/i],[y,[_,"Insignia"],[v,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[_,"NextBook"],[v,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],y,[v,L]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],y,[v,L]],[/\b(ph-1) /i],[y,[_,"Essential"],[v,L]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[_,"Envizen"],[v,k]],[/\b(trio[-\w\. ]+) b/i],[y,[_,"MachSpeed"],[v,k]],[/\btu_(1491) b/i],[y,[_,"Rotor"],[v,k]],[/(shield[\w ]+) b/i],[y,[_,"Nvidia"],[v,k]],[/(sprint) (\w+)/i],[_,y,[v,L]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[_,ie],[v,L]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[_,rn],[v,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[_,rn],[v,L]],[/smart-tv.+(samsung)/i],[_,[v,W]],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[_,lr],[v,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,se],[v,W]],[/(apple) ?tv/i],[_,[y,z+" TV"],[v,W]],[/crkey/i],[[y,xe+"cast"],[_,ve],[v,W]],[/droid.+aft(\w+)( bui|\))/i],[y,[_,Q],[v,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[_,dt],[v,W]],[/(bravia[\w ]+)( bui|\))/i],[y,[_,Hr],[v,W]],[/(mitv-\w{5}) bui/i],[y,[_,Hn],[v,W]],[/Hbbtv.*(technisat) (.*);/i],[_,y,[v,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,f],[y,f],[v,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,W]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,y,[v,M]],[/droid.+; (shield) bui/i],[y,[_,"Nvidia"],[v,M]],[/(playstation [345portablevi]+)/i],[y,[_,Hr],[v,M]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[_,ie],[v,M]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[y,[_,lr],[v,ue]],[/((pebble))app/i],[_,y,[v,ue]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[_,z],[v,ue]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,ue]],[/droid.+; (wt63?0{2,3})\)/i],[y,[_,rn],[v,ue]],[/droid.+; (glass) \d/i],[y,[_,ve],[v,ue]],[/(pico) (4|neo3(?: link|pro)?)/i],[_,y,[v,ue]],[/; (quest( \d| pro)?)/i],[y,[_,Zn],[v,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[v,Me]],[/(aeobc)\b/i],[y,[_,Q],[v,Me]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[y,[v,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[v,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,L]],[/(android[-\w\. ]{0,9});.+buil/i],[y,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[D,[E,p+"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,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[D,A,q],[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,Ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[D,[E,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[D,[E,"watchOS"]],[/crkey\/([\d\.]+)/i],[D,[E,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[E,Vi],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(G,ae){if(typeof G===d&&(ae=G,G=n),!(this instanceof me))return new me(G,ae).getResult();var Z=typeof r!==u&&r.navigator?r.navigator:n,Ce=G||(Z&&Z.userAgent?Z.userAgent:s),Nt=Z&&Z.userAgentData?Z.userAgentData:n,Tt=ae?gt(Ie,ae):Ie,Te=Z&&Z.userAgent==Ce;return this.getBrowser=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.browser),ne[h]=l(ne[D]),Te&&Z&&Z.brave&&typeof Z.brave.isBrave==c&&(ne[E]="Brave"),ne},this.getCPU=function(){var ne={};return ne[P]=n,T.call(ne,Ce,Tt.cpu),ne},this.getDevice=function(){var ne={};return ne[_]=n,ne[y]=n,ne[v]=n,T.call(ne,Ce,Tt.device),Te&&!ne[v]&&Nt&&Nt.mobile&&(ne[v]=L),Te&&ne[y]=="Macintosh"&&Z&&typeof Z.standalone!==u&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&(ne[y]="iPad",ne[v]=k),ne},this.getEngine=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.engine),ne},this.getOS=function(){var ne={};return ne[E]=n,ne[D]=n,T.call(ne,Ce,Tt.os),Te&&!ne[E]&&Nt&&Nt.platform&&Nt.platform!="Unknown"&&(ne[E]=Nt.platform.replace(/chrome os/i,Vi).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===m&&ne.length>B?f(ne,B):ne,this},this.setUA(Ce),this};me.VERSION=i,me.BROWSER=$r([E,D,h]),me.CPU=$r([P]),me.DEVICE=$r([y,_,v,M,L,W,k,ue,Me]),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(G){je.setUA(G);var ae=je.getResult();for(var Z in ae)ye.ua[Z]=ae[Z]}}})(typeof window=="object"?window:e)}),If=ur((e,t)=>{"use strict";(function(r){if(typeof e=="object"&&typeof t<"u")t.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function d(y,E){if(!c[y]){if(!o[y]){var v=typeof zi=="function"&&zi;if(!E&&v)return v(y,!0);if(m)return m(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var D=c[y]={exports:{}};o[y][0].call(D.exports,function(P){var M=o[y][1][P];return d(M||P)},D,D.exports,s,o,c,u)}return c[y].exports}for(var m=typeof zi=="function"&&zi,h=0;h<u.length;h++)d(u[h]);return d}({1:[function(s,o,c){(function(u){"use strict";var d=u.MutationObserver||u.WebKitMutationObserver,m;if(d){var h=0,y=new d(P),E=u.document.createTextNode("");y.observe(E,{characterData:!0}),m=function(){E.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var v=new u.MessageChannel;v.port1.onmessage=P,m=function(){v.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var L=u.document.createElement("script");L.onreadystatechange=function(){P(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null},u.document.documentElement.appendChild(L)}:m=function(){setTimeout(P,0)};var _,D=[];function P(){_=!0;for(var L,k,W=D.length;W;){for(k=D,D=[],L=-1;++L<W;)k[L]();W=D.length}_=!1}o.exports=M;function M(L){D.push(L)===1&&!_&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function d(){}var m={},h=["REJECTED"],y=["FULFILLED"],E=["PENDING"];o.exports=v;function v(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=E,this.queue=[],this.outcome=void 0,B!==d&&M(this,B)}v.prototype.catch=function(B){return this.then(null,B)},v.prototype.then=function(B,Q){if(typeof B!="function"&&this.state===y||typeof Q!="function"&&this.state===h)return this;var z=new this.constructor(d);if(this.state!==E){var X=this.state===y?B:Q;D(z,X,this.outcome)}else this.queue.push(new _(z,B,Q));return z};function _(B,Q,z){this.promise=B,typeof Q=="function"&&(this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(B){m.resolve(this.promise,B)},_.prototype.otherCallFulfilled=function(B){D(this.promise,this.onFulfilled,B)},_.prototype.callRejected=function(B){m.reject(this.promise,B)},_.prototype.otherCallRejected=function(B){D(this.promise,this.onRejected,B)};function D(B,Q,z){u(function(){var X;try{X=Q(z)}catch(ge){return m.reject(B,ge)}X===B?m.reject(B,new TypeError("Cannot resolve promise with itself")):m.resolve(B,X)})}m.resolve=function(B,Q){var z=L(P,Q);if(z.status==="error")return m.reject(B,z.value);var X=z.value;if(X)M(B,X);else{B.state=y,B.outcome=Q;for(var ge=-1,$e=B.queue.length;++ge<$e;)B.queue[ge].callFulfilled(Q)}return B},m.reject=function(B,Q){B.state=h,B.outcome=Q;for(var z=-1,X=B.queue.length;++z<X;)B.queue[z].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 z=!1;function X(p){z||(z=!0,m.reject(B,p))}function ge(p){z||(z=!0,m.resolve(B,p))}function $e(){Q(ge,X)}var xe=L($e);xe.status==="error"&&X(xe.value)}function L(B,Q){var z={};try{z.value=B(Q),z.status="success"}catch(X){z.status="error",z.value=X}return z}v.resolve=k;function k(B){return B instanceof this?B:m.resolve(new this(d),B)}v.reject=W;function W(B){var Q=new this(d);return m.reject(Q,B)}v.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 z=B.length,X=!1;if(!z)return this.resolve([]);for(var ge=new Array(z),$e=0,xe=-1,p=new this(d);++xe<z;)Ge(B[xe],xe);return p;function Ge(ve,ht){Q.resolve(ve).then(se,function(ie){X||(X=!0,m.reject(p,ie))});function se(ie){ge[ht]=ie,++$e===z&&!X&&(X=!0,m.resolve(p,ge))}}}v.race=Me;function Me(B){var Q=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,X=!1;if(!z)return this.resolve([]);for(var ge=-1,$e=new this(d);++ge<z;)xe(B[ge]);return $e;function xe(p){Q.resolve(p).then(function(Ge){X||(X=!0,m.resolve($e,Ge))},function(Ge){X||(X=!0,m.reject($e,Ge))})}}},{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(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g};function d(g,S){if(!(g instanceof S))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function y(){try{if(!h||!h.open)return!1;var g=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(!g||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function E(g,S){g=g||[],S=S||{};try{return new Blob(g,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<g.length;C+=1)x.append(g[C]);return x.getBlob(S.type)}}typeof Promise>"u"&&s(3);var v=Promise;function _(g,S){S&&g.then(function(I){S(null,I)},function(I){S(I)})}function D(g,S,I){typeof S=="function"&&g.then(S),typeof I=="function"&&g.catch(I)}function P(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}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,W={},ue=Object.prototype.toString,Me="readonly",B="readwrite";function Q(g){for(var S=g.length,I=new ArrayBuffer(S),x=new Uint8Array(I),C=0;C<S;C++)x[C]=g.charCodeAt(C);return I}function z(g){return new v(function(S){var I=g.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 X(g){return typeof k=="boolean"?v.resolve(k):z(g).then(function(S){return k=S,k})}function ge(g){var S=W[g.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(g){var S=W[g.name],I=S.deferredOperations.pop();if(I)return I.resolve(),I.promise}function xe(g,S){var I=W[g.name],x=I.deferredOperations.pop();if(x)return x.reject(S),x.promise}function p(g,S){return new v(function(I,x){if(W[g.name]=W[g.name]||Hr(),g.db)if(S)ge(g),g.db.close();else return I(g.db);var C=[g.name];S&&C.push(g.version);var O=h.open.apply(h,C);S&&(O.onupgradeneeded=function(R){var j=O.result;try{j.createObjectStore(g.storeName),R.oldVersion<=1&&j.createObjectStore(L)}catch(V){if(V.name==="ConstraintError")console.warn('The database "'+g.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+g.storeName+'" already exists.');else throw V}}),O.onerror=function(R){R.preventDefault(),x(O.error)},O.onsuccess=function(){var R=O.result;R.onversionchange=function(j){j.target.close()},I(R),$e(g)}})}function Ge(g){return p(g,!1)}function ve(g){return p(g,!0)}function ht(g,S){if(!g.db)return!0;var I=!g.db.objectStoreNames.contains(g.storeName),x=g.version<g.db.version,C=g.version>g.db.version;if(x&&(g.version!==S&&console.warn('The database "'+g.name+`" can't be downgraded from version `+g.db.version+" to version "+g.version+"."),g.version=g.db.version),C||I){if(I){var O=g.db.version+1;O>g.version&&(g.version=O)}return!0}return!1}function se(g){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:g.type})},x.readAsBinaryString(g)})}function ie(g){var S=Q(atob(g.data));return E([S],{type:g.type})}function lt(g){return g&&g.__local_forage_encoded_blob}function tr(g){var S=this,I=S._initReady().then(function(){var x=W[S._dbInfo.name];if(x&&x.dbReady)return x.dbReady});return D(I,g,g),I}function lr(g){ge(g);for(var S=W[g.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 g.db=null,Ge(g).then(function(O){return g.db=O,ht(g)?ve(g):O}).then(function(O){g.db=S.db=O;for(var R=0;R<I.length;R++)I[R]._dbInfo.db=O}).catch(function(O){throw xe(g,O),O})}function dt(g,S,I,x){x===void 0&&(x=1);try{var C=g.db.transaction(g.storeName,S);I(null,C)}catch(O){if(x>0&&(!g.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return v.resolve().then(function(){if(!g.db||O.name==="NotFoundError"&&!g.db.objectStoreNames.contains(g.storeName)&&g.version<=g.db.version)return g.db&&(g.version=g.db.version+1),ve(g)}).then(function(){return lr(g).then(function(){dt(g,S,I,x-1)})}).catch(I);I(O)}}function Hr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(g){var S=this,I={db:null};if(g)for(var x in g)I[x]=g[x];var C=W[I.name];C||(C=Hr(),W[I.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=tr);var O=[];function R(){return v.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 v.all(O).then(function(){return I.db=C.db,Ge(I)}).then(function(F){return I.db=F,ht(I,S._defaultConfig.version)?ve(I):F}).then(function(F){I.db=C.db=F,S._dbInfo=I;for(var Y=0;Y<H.length;Y++){var he=H[Y];he!==S&&(he._dbInfo.db=I.db,he._dbInfo.version=I.version)}})}function rn(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,Me,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.get(g);H.onsuccess=function(){var F=H.result;F===void 0&&(F=null),lt(F)&&(F=ie(F)),C(F)},H.onerror=function(){O(H.error)}}catch(F){O(F)}})}).catch(O)});return _(x,S),x}function Zn(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,Me,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 Y=H.result;if(Y){var he=Y.value;lt(he)&&(he=ie(he));var Ve=g(he,Y.key,F++);Ve!==void 0?C(Ve):Y.continue()}else C()},H.onerror=function(){O(H.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Vi(g,S,I){var x=this;g=P(g);var C=new v(function(O,R){var j;x.ready().then(function(){return j=x._dbInfo,ue.call(S)==="[object Blob]"?X(j.db).then(function(V){return V?S:se(S)}):S}).then(function(V){dt(x._dbInfo,B,function(H,F){if(H)return R(H);try{var Y=F.objectStore(x._dbInfo.storeName);V===null&&(V=void 0);var he=Y.put(V,g);F.oncomplete=function(){V===void 0&&(V=null),O(V)},F.onabort=F.onerror=function(){var Ve=he.error?he.error:he.transaction.error;R(Ve)}}catch(Ve){R(Ve)}})}).catch(R)});return _(C,I),C}function Wn(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){dt(I._dbInfo,B,function(R,j){if(R)return O(R);try{var V=j.objectStore(I._dbInfo.storeName),H=V.delete(g);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 _(x,S),x}function Mn(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(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(){x()},R.onabort=R.onerror=function(){var H=V.error?V.error:V.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return _(I,g),I}function gt(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(S._dbInfo,Me,function(O,R){if(O)return C(O);try{var j=R.objectStore(S._dbInfo.storeName),V=j.count();V.onsuccess=function(){x(V.result)},V.onerror=function(){C(V.error)}}catch(H){C(H)}})}).catch(C)});return _(I,g),I}function $r(g,S){var I=this,x=new v(function(C,O){if(g<0){C(null);return}I.ready().then(function(){dt(I._dbInfo,Me,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 Y=F.result;if(!Y){C(null);return}g===0||H?C(Y.key):(H=!0,Y.advance(g))},F.onerror=function(){O(F.error)}}catch(Y){O(Y)}})}).catch(O)});return _(x,S),x}function Wi(g){var S=this,I=new v(function(x,C){S.ready().then(function(){dt(S._dbInfo,Me,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){x(H);return}H.push(F.key),F.continue()},V.onerror=function(){C(V.error)}}catch(F){C(F)}})}).catch(C)});return _(I,g),I}function a(g,S){S=M.apply(this,arguments);var I=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||I.name,g.storeName=g.storeName||I.storeName);var x=this,C;if(!g.name)C=v.reject("Invalid arguments");else{var O=g.name===I.name&&x._dbInfo.db,R=O?v.resolve(x._dbInfo.db):Ge(g).then(function(j){var V=W[g.name],H=V.forages;V.db=j;for(var F=0;F<H.length;F++)H[F]._dbInfo.db=j;return j});g.storeName?C=R.then(function(j){if(j.objectStoreNames.contains(g.storeName)){var V=j.version+1;ge(g);var H=W[g.name],F=H.forages;j.close();for(var Y=0;Y<F.length;Y++){var he=F[Y];he._dbInfo.db=null,he._dbInfo.version=V}var Ve=new v(function(Re,ut){var qe=h.open(g.name,V);qe.onerror=function(Ht){var wc=qe.result;wc.close(),ut(Ht)},qe.onupgradeneeded=function(){var Ht=qe.result;Ht.deleteObjectStore(g.storeName)},qe.onsuccess=function(){var Ht=qe.result;Ht.close(),Re(Ht)}});return Ve.then(function(Re){H.db=Re;for(var ut=0;ut<F.length;ut++){var qe=F[ut];qe._dbInfo.db=Re,$e(qe._dbInfo)}}).catch(function(Re){throw(xe(g,Re)||v.resolve()).catch(function(){}),Re})}}):C=R.then(function(j){ge(g);var V=W[g.name],H=V.forages;j.close();for(var F=0;F<H.length;F++){var Y=H[F];Y._dbInfo.db=null}var he=new v(function(Ve,Re){var ut=h.deleteDatabase(g.name);ut.onerror=function(){var qe=ut.result;qe&&qe.close(),Re(ut.error)},ut.onblocked=function(){console.warn('dropInstance blocked for database "'+g.name+'" until all open connections are closed')},ut.onsuccess=function(){var qe=ut.result;qe&&qe.close(),Ve(qe)}});return he.then(function(Ve){V.db=Ve;for(var Re=0;Re<H.length;Re++){var ut=H[Re];$e(ut._dbInfo)}}).catch(function(Ve){throw(xe(g,Ve)||v.resolve()).catch(function(){}),Ve})})}return _(C,S),C}var l={_driver:"asyncStorage",_initStorage:Hn,_support:y(),iterate:Zn,getItem:rn,setItem:Vi,removeItem:Wn,clear:Mn,length:gt,key:$r,keys:Wi,dropInstance:a};function f(){return typeof openDatabase=="function"}var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="~~local_forage_type~",U=/^~~local_forage_type~([^~]+)~/,q="__lfsc__:",Ie=q.length,me="arbf",ye="blob",je="si08",G="ui08",ae="uic8",Z="si16",Ce="si32",Nt="ur16",Tt="ui32",Te="fl32",ne="fl64",$t=Ie+me.length,Gi=Object.prototype.toString;function is(g){var S=g.length*.75,I=g.length,x,C=0,O,R,j,V;g[g.length-1]==="="&&(S--,g[g.length-2]==="="&&S--);var H=new ArrayBuffer(S),F=new Uint8Array(H);for(x=0;x<I;x+=4)O=T.indexOf(g[x]),R=T.indexOf(g[x+1]),j=T.indexOf(g[x+2]),V=T.indexOf(g[x+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(g){var S=new Uint8Array(g),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 Wh(g,S){var I="";if(g&&(I=Gi.call(g)),g&&(I==="[object ArrayBuffer]"||g.buffer&&Gi.call(g.buffer)==="[object ArrayBuffer]")){var x,C=q;g instanceof ArrayBuffer?(x=g,C+=me):(x=g.buffer,I==="[object Int8Array]"?C+=je:I==="[object Uint8Array]"?C+=G:I==="[object Uint8ClampedArray]"?C+=ae:I==="[object Int16Array]"?C+=Z:I==="[object Uint16Array]"?C+=Nt:I==="[object Int32Array]"?C+=Ce:I==="[object Uint32Array]"?C+=Tt: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 R=A+g.type+"~"+zo(this.result);S(q+ye+R)},O.readAsArrayBuffer(g)}else try{S(JSON.stringify(g))}catch(R){console.error("Couldn't convert value into a JSON string: ",g),S(null,R)}}function qh(g){if(g.substring(0,Ie)!==q)return JSON.parse(g);var S=g.substring($t),I=g.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=is(S);switch(I){case me:return O;case ye:return E([O],{type:x});case je:return new Int8Array(O);case G:return new Uint8Array(O);case ae:return new Uint8ClampedArray(O);case Z:return new Int16Array(O);case Nt:return new Uint16Array(O);case Ce:return new Int32Array(O);case Tt:return new Uint32Array(O);case Te:return new Float32Array(O);case ne:return new Float64Array(O);default:throw new Error("Unkown type: "+I)}}var ya={serialize:Wh,deserialize:qh,stringToBuffer:is,bufferToString:zo};function Ju(g,S,I,x){g.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],I,x)}function Gh(g){var S=this,I={db:null};if(g)for(var x in g)I[x]=typeof g[x]!="string"?g[x].toString():g[x];var C=new v(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){Ju(j,I,function(){S._dbInfo=I,O()},function(V,H){R(H)})},R)});return I.serializer=ya,C}function Fn(g,S,I,x,C,O){g.executeSql(I,x,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):Ju(V,S,function(){V.executeSql(I,x,C,O)},O)},O):O(R,j)},O)}function Kh(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[g],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 _(x,S),x}function Jh(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT * FROM "+R.storeName,[],function(V,H){for(var F=H.rows,Y=F.length,he=0;he<Y;he++){var Ve=F.item(he),Re=Ve.value;if(Re&&(Re=R.serializer.deserialize(Re)),Re=g(Re,Ve.key,he+1),Re!==void 0){C(Re);return}}C()},function(V,H){O(H)})})}).catch(O)});return _(x,S),x}function Xu(g,S,I,x){var C=this;g=P(g);var O=new v(function(R,j){C.ready().then(function(){S===void 0&&(S=null);var V=S,H=C._dbInfo;H.serializer.serialize(S,function(F,Y){Y?j(Y):H.db.transaction(function(he){Fn(he,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[g,F],function(){R(V)},function(Ve,Re){j(Re)})},function(he){if(he.code===he.QUOTA_ERR){if(x>0){R(Xu.apply(C,[g,V,I,x-1]));return}j(he)}})})}).catch(j)});return _(O,I),O}function Yh(g,S,I){return Xu.apply(this,[g,S,I,1])}function zh(g,S){var I=this;g=P(g);var x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[g],function(){C()},function(V,H){O(H)})})}).catch(O)});return _(x,S),x}function Xh(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(R,O,"DELETE FROM "+O.storeName,[],function(){x()},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function Qh(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(R,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(j,V){var H=V.rows.item(0).c;x(H)},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function Zh(g,S){var I=this,x=new v(function(C,O){I.ready().then(function(){var R=I._dbInfo;R.db.transaction(function(j){Fn(j,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[g+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 _(x,S),x}function ep(g){var S=this,I=new v(function(x,C){S.ready().then(function(){var O=S._dbInfo;O.db.transaction(function(R){Fn(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);x(H)},function(j,V){C(V)})})}).catch(C)});return _(I,g),I}function tp(g){return new v(function(S,I){g.transaction(function(x){x.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:g,storeNames:R})},function(C,O){I(O)})},function(x){I(x)})})}function rp(g,S){S=M.apply(this,arguments);var I=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||I.name,g.storeName=g.storeName||I.storeName);var x=this,C;return g.name?C=new v(function(O){var R;g.name===I.name?R=x._dbInfo.db:R=openDatabase(g.name,"","",0),g.storeName?O({db:R,storeNames:[g.storeName]}):O(tp(R))}).then(function(O){return new v(function(R,j){O.db.transaction(function(V){function H(Ve){return new v(function(Re,ut){V.executeSql("DROP TABLE IF EXISTS "+Ve,[],function(){Re()},function(qe,Ht){ut(Ht)})})}for(var F=[],Y=0,he=O.storeNames.length;Y<he;Y++)F.push(H(O.storeNames[Y]));v.all(F).then(function(){R()}).catch(function(Ve){j(Ve)})},function(V){j(V)})})}):C=v.reject("Invalid arguments"),_(C,S),C}var np={_driver:"webSQLStorage",_initStorage:Gh,_support:f(),iterate:Jh,getItem:Kh,setItem:Yh,removeItem:zh,clear:Xh,length:Qh,key:Zh,keys:ep,dropInstance:rp};function ip(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Zu(g,S){var I=g.name+"/";return g.storeName!==S.storeName&&(I+=g.storeName+"/"),I}function lp(){var g="_localforage_support_test";try{return localStorage.setItem(g,!0),localStorage.removeItem(g),!1}catch{return!0}}function up(){return!lp()||localStorage.length>0}function hp(g){var S=this,I={};if(g)for(var x in g)I[x]=g[x];return I.keyPrefix=Zu(g,S._defaultConfig),up()?(S._dbInfo=I,I.serializer=ya,v.resolve()):v.reject()}function dp(g){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,g),I}function pp(g,S){var I=this;g=P(g);var x=I.ready().then(function(){var C=I._dbInfo,O=localStorage.getItem(C.keyPrefix+g);return O&&(O=C.serializer.deserialize(O)),O});return _(x,S),x}function fp(g,S){var I=this,x=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 Y=localStorage.getItem(F);if(Y&&(Y=C.serializer.deserialize(Y)),Y=g(Y,F.substring(R),V++),Y!==void 0)return Y}}});return _(x,S),x}function gp(g,S){var I=this,x=I.ready().then(function(){var C=I._dbInfo,O;try{O=localStorage.key(g)}catch{O=null}return O&&(O=O.substring(C.keyPrefix.length)),O});return _(x,S),x}function mp(g){var S=this,I=S.ready().then(function(){for(var x=S._dbInfo,C=localStorage.length,O=[],R=0;R<C;R++){var j=localStorage.key(R);j.indexOf(x.keyPrefix)===0&&O.push(j.substring(x.keyPrefix.length))}return O});return _(I,g),I}function yp(g){var S=this,I=S.keys().then(function(x){return x.length});return _(I,g),I}function vp(g,S){var I=this;g=P(g);var x=I.ready().then(function(){var C=I._dbInfo;localStorage.removeItem(C.keyPrefix+g)});return _(x,S),x}function bp(g,S,I){var x=this;g=P(g);var C=x.ready().then(function(){S===void 0&&(S=null);var O=S;return new v(function(R,j){var V=x._dbInfo;V.serializer.serialize(S,function(H,F){if(F)j(F);else try{localStorage.setItem(V.keyPrefix+g,H),R(O)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&j(Y),j(Y)}})})});return _(C,I),C}function wp(g,S){if(S=M.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var I=this.config();g.name=g.name||I.name,g.storeName=g.storeName||I.storeName}var x=this,C;return g.name?C=new v(function(O){g.storeName?O(Zu(g,x._defaultConfig)):O(g.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=v.reject("Invalid arguments"),_(C,S),C}var _p={_driver:"localStorageWrapper",_initStorage:hp,_support:ip(),iterate:fp,getItem:pp,setItem:bp,removeItem:vp,clear:dp,length:yp,key:gp,keys:mp,dropInstance:wp},Ep=function(g,S){return g===S||typeof g=="number"&&typeof S=="number"&&isNaN(g)&&isNaN(S)},Sp=function(g,S){for(var I=g.length,x=0;x<I;){if(Ep(g[x],S))return!0;x++}return!1},vh=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"},ss={},bh={},Yi={INDEXEDDB:l,WEBSQL:np,LOCALSTORAGE:_p},Ip=[Yi.INDEXEDDB._driver,Yi.WEBSQL._driver,Yi.LOCALSTORAGE._driver],Jo=["dropInstance"],Va=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Jo),Tp={description:"",driver:Ip.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Cp(g,S){g[S]=function(){var I=arguments;return g.ready().then(function(){return g[S].apply(g,I)})}}function bc(){for(var g=1;g<arguments.length;g++){var S=arguments[g];if(S)for(var I in S)S.hasOwnProperty(I)&&(vh(S[I])?arguments[0][I]=S[I].slice():arguments[0][I]=S[I])}return arguments[0]}var Dp=function(){function g(S){d(this,g);for(var I in Yi)if(Yi.hasOwnProperty(I)){var x=Yi[I],C=x._driver;this[I]=C,ss[C]||this.defineDriver(x)}this._defaultConfig=bc({},Tp),this._config=bc({},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 g.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},g.prototype.defineDriver=function(S,I,x){var C=new v(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=Va.concat("_initStorage"),F=0,Y=H.length;F<Y;F++){var he=H[F],Ve=!Sp(Jo,he);if((Ve||S[he])&&typeof S[he]!="function"){R(V);return}}var Re=function(){for(var qe=function(xp){return function(){var Op=new Error("Method "+xp+" is not implemented by the current driver"),wh=v.reject(Op);return _(wh,arguments[arguments.length-1]),wh}},Ht=0,wc=Jo.length;Ht<wc;Ht++){var Sc=Jo[Ht];S[Sc]||(S[Sc]=qe(Sc))}};Re();var ut=function(qe){ss[j]&&console.info("Redefining LocalForage driver: "+j),ss[j]=S,bh[j]=qe,O()};"_support"in S?S._support&&typeof S._support=="function"?S._support().then(ut,R):ut(!!S._support):ut(!0)}catch(qe){R(qe)}});return D(C,I,x),C},g.prototype.driver=function(){return this._driver||null},g.prototype.getDriver=function(S,I,x){var C=ss[S]?v.resolve(ss[S]):v.reject(new Error("Driver not found."));return D(C,I,x),C},g.prototype.getSerializer=function(S){var I=v.resolve(ya);return D(I,S),I},g.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},g.prototype.setDriver=function(S,I,x){var C=this;vh(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 Y=0;function he(){for(;Y<F.length;){var Ve=F[Y];return Y++,C._dbInfo=null,C._ready=null,C.getDriver(Ve).then(j).catch(he)}R();var Re=new Error("No available storage method found.");return C._driverSet=v.reject(Re),C._driverSet}return he()}}var H=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=H.then(function(){var F=O[0];return C._dbInfo=null,C._ready=null,C.getDriver(F).then(function(Y){C._driver=Y._driver,R(),C._wrapLibraryMethodsWithReady(),C._initDriver=V(O)})}).catch(function(){R();var F=new Error("No available storage method found.");return C._driverSet=v.reject(F),C._driverSet}),D(this._driverSet,I,x),this._driverSet},g.prototype.supports=function(S){return!!bh[S]},g.prototype._extend=function(S){bc(this,S)},g.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},g.prototype._wrapLibraryMethodsWithReady=function(){for(var S=0,I=Va.length;S<I;S++)Cp(this,Va[S])},g.prototype.createInstance=function(S){return new g(S)},g}(),Np=new Dp;o.exports=Np},{3:3}]},{},[4])(4)})}),ei=ur(e=>{"use strict";var t=e&&e.__awaiter||function(n,i,s,o){function c(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function m(E){try{y(o.next(E))}catch(v){d(v)}}function h(E){try{y(o.throw(E))}catch(v){d(v)}}function y(E){E.done?u(E.value):c(E.value).then(m,h)}y((o=o.apply(n,i||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.JSUtils=void 0;var r=class{static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static sleep(n){return t(this,void 0,void 0,function*(){return new Promise(i=>setTimeout(i,n))})}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,i){return i.reduce((s,o)=>(n.hasOwnProperty(o)&&n[o]!=null&&s.push({[o]:n[o]}),s),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((i,s)=>(n[s]!==null&&n[s]!==void 0&&(i[s]=n[s]),i),{})}static stringify(n){return JSON.stringify(n,function(i,s){return s===void 0?null:s})}};e.JSUtils=r,r.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)}),ku=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}),th=ur((e,t)=>{"use strict";(function(r,n){typeof e=="object"&&typeof t<"u"?t.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(e,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,d){var m=o.retries,h=o.retryDelay,y=o.retryOn;if(d&&d.retries!==void 0)if(n(d.retries))m=d.retries;else throw new i("retries must be a positive integer");if(d&&d.retryDelay!==void 0)if(n(d.retryDelay)||typeof d.retryDelay=="function")h=d.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(d&&d.retryOn)if(Array.isArray(d.retryOn)||typeof d.retryOn=="function")y=d.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(E,v){var _=function(P){var M=typeof Request<"u"&&u instanceof Request?u.clone():u;s(M,d).then(function(L){if(Array.isArray(y)&&y.indexOf(L.status)===-1)E(L);else if(typeof y=="function")try{return Promise.resolve(y(P,null,L)).then(function(k){k?D(P,null,L):E(L)}).catch(v)}catch(k){v(k)}else P<m?D(P,null,L):E(L)}).catch(function(L){if(typeof y=="function")try{Promise.resolve(y(P,L,null)).then(function(k){k?D(P,L,null):v(L)}).catch(function(k){v(k)})}catch(k){v(k)}else P<m?D(P,L,null):v(L)})};function D(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})}),cp="9.4.1",N=class Ic{static SDK_VERSION=cp;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_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 CTA_EVENT="letscooee:outbound:cta";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=Ic.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ic.SDK_VERSION_CODE=parseInt(t,10)}},Ct={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`},Ot=Se(nn()),b=class{static log(...e){Ot.default.info(...e)}static debug(...e){Ot.default.debug(...e)}static error(...e){Ot.default.error(...e)}static warn(...e){Ot.default.warn(...e)}static info(...e){Ot.default.info(...e)}static trace(...e){Ot.default.trace(...e)}static configure(e=N.LOG_PREFIX){Ot.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?Ot.default.setLevel(Ot.default[localStorage.cooeeLogLevel]):Ot.default.setLevel(Ct.debug?Ot.default.TRACE:Ot.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
font-size: 14px;
|
|
4
4
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|
|
@@ -31,7 +31,7 @@ Event: ${nr(e)}`),!0):ev(e,t.denyUrls)?(De&&K.warn(`Event dropped due to being m
|
|
|
31
31
|
Event: ${nr(e)}.
|
|
32
32
|
Url: ${Ls(e)}`),!0):tv(e,t.allowUrls)?!1:(De&&K.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
33
33
|
Event: ${nr(e)}.
|
|
34
|
-
Url: ${Ls(e)}`),!0)}function Qy(e,t){return e.type||!t||!t.length?!1:rv(e).some(r=>ni(r,t))}function Zy(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?ni(r,t):!1}function ev(e,t){if(!t||!t.length)return!1;let r=Ls(e);return r?ni(r,t):!1}function tv(e,t){if(!t||!t.length)return!0;let r=Ls(e);return r?ni(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 nv(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function iv(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 Ls(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?iv(t):null}catch{return De&&K.error(`Cannot extract url for event ${nr(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 sv="Dedupe",av=()=>{let e;return{name:sv,processEvent(t){if(t.type)return t;try{if(cv(t,e))return De&&K.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Us=av;function cv(e,t){return t?!!(lv(e,t)||uv(e,t)):!1}function lv(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!bm(e,t)||!wm(e,t))}function uv(e,t){let r=Sm(t),n=Sm(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!bm(e,t)||!wm(e,t))}function wm(e,t){let r=ds(e),n=ds(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 bm(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 Sm(e){return e.exception&&e.exception.values&&e.exception.values[0]}var Ye=re,Xl=0;function Ql(){return Xl>0}function bv(){Xl++,setTimeout(()=>{Xl--})}function dn(e,t={},r){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(ln(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=>dn(o,t));return e.apply(this,s)}catch(s){throw bv(),Ds(o=>{o.addEventProcessor(c=>(t.mechanism&&(ai(c,void 0,void 0),Nr(c,t.mechanism)),c.extra=ee(w({},c.extra),{arguments:i}),c)),Ns(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}ps(n,e),Et(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 ks(e,t){let r=tu(e,t),n={type:t&&t.name,value:Dv(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Iv(e,t,r,n){let i=Fe(),s=i&&i.getOptions().normalizeDepth,o=Nv(t),c={__serialized__:Es(t,s)};if(o)return{exception:{values:[ks(e,o)]},extra:c};let u={exception:{values:[{type:cn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:Rv(t,{isUnhandledRejection:n})}]},extra:c};if(r){let d=tu(e,r);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function Zl(e,t){return{exception:{values:[ks(e,t)]}}}function tu(e,t){let r=t.stacktrace||t.stack||"",n=Cv(t),i=xv(t);try{return e(r,n,i)}catch{}return[]}var Tv=/Minified React error #\d+;/i;function Cv(e){return e&&Tv.test(e.message)?1:0}function xv(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Dv(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function xm(e,t,r,n){let i=r&&r.syntheticException||void 0,s=Ms(e,t,i,n);return Nr(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Yt(s)}function Dm(e,t,r="info",n,i){let s=n&&n.syntheticException||void 0,o=eu(e,t,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Yt(o)}function Ms(e,t,r,n,i){let s;if(as(t)&&t.error)return Zl(e,t.error);if(cs(t)||tl(t)){let o=t;if("stack"in t)s=Zl(e,t);else{let c=o.name||(cs(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=eu(e,u,r,n),ai(s,u)}return"code"in o&&(s.tags=ee(w({},s.tags),{"DOMException.code":`${o.code}`})),s}return sn(t)?Zl(e,t):rr(t)||cn(t)?(s=Iv(e,t,r,i),Nr(s,{synthetic:!0}),s):(s=eu(e,t,r,n),ai(s,`${t}`,void 0),Nr(s,{synthetic:!0}),s)}function eu(e,t,r,n){let i={};if(n&&r){let s=tu(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}if(ri(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 Rv(e,{isUnhandledRejection:t}){let r=fl(e),n=t?"promise rejection":"exception";return as(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:cn(e)?`Event \`${Av(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Av(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Nv(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function Rm(e,{metadata:t,tunnel:r,dsn:n}){let i=w(w({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=Ov(e);return _r(i,[s])}function Ov(e){return[{type:"user_report"},e]}var fo=class extends po{constructor(e){let t=w({parentSpanIsAlwaysRootSpan:!0},e),r=Ye.SENTRY_SDK_SOURCE||wl();Jl(t,"browser",["browser"],r),super(t),t.sendClientReports&&Ye.document&&Ye.document.addEventListener("visibilitychange",()=>{Ye.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return xm(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return Dm(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=Rm(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=Ol(e,this._options.tunnel&&gr(this._dsn));this.sendEnvelope(t)}},Am=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke=re,Pv=1e3,Nm,ru,nu;function iu(e){let t="dom";St(t,e),wt(t,Lv)}function Lv(){if(!Ke.document)return;let e=Ze.bind(null,"dom"),t=Om(e,!0);Ke.document.addEventListener("click",t,!1),Ke.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=Ke[r]&&Ke[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ue(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__||{},m=d[s]=d[s]||{refCount:0};if(!m.handler){let h=Om(e);m.handler=h,i.call(this,s,h,c)}m.refCount++}catch{}return i.call(this,s,o,c)}}),Ue(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__||{},m=d[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,c),m.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 Bv(e){if(e.type!==ru)return!1;try{if(!e.target||e.target._sentryId!==nu)return!1}catch{}return!0}function Uv(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function Om(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;let n=kv(r);if(Uv(r.type,n))return;Et(r,"_sentryCaptured",!0),n&&!n._sentryId&&Et(n,"_sentryId",rt());let i=r.type==="keypress"?"input":r.type;Bv(r)||(e({event:r,name:i,global:t}),ru=r.type,nu=n?n._sentryId:void 0),clearTimeout(Nm),Nm=Ke.setTimeout(()=>{nu=void 0,ru=void 0},Pv)}}function kv(e){try{return e.target}catch{return null}}var Fs;function ou(e){let t="history";St(t,e),wt(t,Mv)}function Mv(){if(!Bl())return;let e=Ke.onpopstate;Ke.onpopstate=function(...r){let n=Ke.location.href,i=Fs;if(Fs=n,Ze("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=Fs,o=String(i);Fs=o,Ze("history",{from:s,to:o})}return r.apply(this,n)}}Ue(Ke.history,"pushState",t),Ue(Ke.history,"replaceState",t)}var Hs={};function su(e){let t=Hs[e];if(t)return t;let r=Ke[e];if(no(r))return Hs[e]=r.bind(Ke);let n=Ke.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){Am&&K.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(Hs[e]=r.bind(Ke))}function $s(e){Hs[e]=void 0}var hn="__sentry_xhr_v3__";function au(e){let t="xhr";St(t,e),wt(t,Fv)}function Fv(){if(!Ke.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;Ue(e,"open",function(t){return function(...r){let n=Bt()*1e3,i=_t(r[0])?r[0].toUpperCase():void 0,s=Hv(r[1]);if(!i||!s)return t.apply(this,r);this[hn]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[hn];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:Bt()*1e3,startTimestamp:n,xhr:this};Ze("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ue(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Ue(this,"setRequestHeader",function(c){return function(...u){let[d,m]=u,h=this[hn];return h&&_t(d)&&_t(m)&&(h.request_headers[d.toLowerCase()]=m),c.apply(this,u)}}),t.apply(this,r)}}),Ue(e,"send",function(t){return function(...r){let n=this[hn];if(!n)return t.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:Bt()*1e3,xhr:this};return Ze("xhr",i),t.apply(this,r)}})}function Hv(e){if(_t(e))return e;try{return e.toString()}catch{}}function cu(e,t=su("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=w({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);if(!t)return $s("fetch"),Vr("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 $s("fetch"),r-=o,n--,Vr(u)}}return Os(e,i)}var $v=30,jv=50;function lu(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 Wv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Gv=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Vv=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yv=e=>{let t=Wv.exec(e);if(t){let[,n,i,s]=t;return lu(n,yr,+i,+s)}let r=Gv.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Vv.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=Um(r[1]||yr,r[2]);return lu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Pm=[$v,Yv],zv=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qv=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kv=e=>{let t=zv.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=qv.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]=Um(n,r),lu(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Lm=[jv,Kv],Bm=[Pm,Lm],uu=dl(...Bm),Um=(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]},js=1024,Xv="Breadcrumbs",Qv=(e={})=>{let t=w({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:Xv,setup(r){t.console&&hl(t_(r)),t.dom&&iu(e_(r,t.dom)),t.xhr&&au(r_(r)),t.fetch&&_l(n_(r)),t.history&&ou(i_(r)),t.sentry&&r.on("beforeSendEvent",Zv(r))}}},km=Qv;function Zv(e){return function(t){Fe()===e&&Er({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:nr(t)},{event:t})}}function e_(e,t){return function(r){if(Fe()!==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>js&&(Pr&&K.warn(`\`dom.maxStringLength\` cannot exceed ${js}, but a value of ${o} was configured. Sentry will use ${js} instead.`),o=js),typeof s=="string"&&(s=[s]);try{let u=r.event,d=o_(u)?u.target:u;n=to(d,{keyAttrs:s,maxStringLength:o}),i=ll(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 t_(e){return function(t){if(Fe()!==e)return;let r={category:"console",data:{arguments:t.args,logger:"console"},level:Tl(t.level),message:ls(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)r.message=`Assertion failed: ${ls(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1);else return;Er(r,{input:t.args,level:t.level})}}function r_(e){return function(t){if(Fe()!==e)return;let{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[hn];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,d={method:s,url:o,status_code:c},m={xhr:t.xhr,input:u,startTimestamp:r,endTimestamp:n};Er({category:"xhr",data:d,type:"http"},m)}}function n_(e){return function(t){if(Fe()!==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(w({},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 i_(e){return function(t){if(Fe()!==e)return;let r=t.from,n=t.to,i=oo(Ye.location.href),s=r?oo(r):void 0,o=oo(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 o_(e){return!!e&&!!e.target}var s_=["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"],a_="BrowserApiErrors",c_=(e={})=>{let t=w({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:a_,setupOnce(){t.setTimeout&&Ue(Ye,"setTimeout",Mm),t.setInterval&&Ue(Ye,"setInterval",Mm),t.requestAnimationFrame&&Ue(Ye,"requestAnimationFrame",l_),t.XMLHttpRequest&&"XMLHttpRequest"in Ye&&Ue(XMLHttpRequest.prototype,"send",u_);let r=t.eventTarget;r&&(Array.isArray(r)?r:s_).forEach(p_)}}},Fm=c_;function Mm(e){return function(...t){let r=t[0];return t[0]=dn(r,{mechanism:{data:{function:Vt(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function l_(e){return function(t){return e.apply(this,[dn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Vt(e)},handled:!1,type:"instrument"}})])}}function u_(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Ue(r,n,function(i){let s={mechanism:{data:{function:n,handler:Vt(i)},handled:!1,type:"instrument"}},o=ln(i);return o&&(s.mechanism.data.handler=Vt(o)),dn(i,s)})}),e.apply(this,t)}}function p_(e){let t=Ye,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ue(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=dn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Vt(s),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,dn(s,{mechanism:{data:{function:"addEventListener",handler:Vt(s),target:e},handled:!1,type:"instrument"}}),o])}}),Ue(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 f_="GlobalHandlers",m_=(e={})=>{let t=w({onerror:!0,onunhandledrejection:!0},e);return{name:f_,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(d_(r),Hm("onerror")),t.onunhandledrejection&&(h_(r),Hm("onunhandledrejection"))}}},$m=m_;function d_(e){El(t=>{let{stackParser:r,attachStacktrace:n}=jm();if(Fe()!==e||Ql())return;let{msg:i,url:s,line:o,column:c,error:u}=t,d=v_(Ms(r,u||i,void 0,n,!1),s,o,c);d.level="error",uo(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function h_(e){Sl(t=>{let{stackParser:r,attachStacktrace:n}=jm();if(Fe()!==e||Ql())return;let i=g_(t),s=an(i)?y_(i):Ms(r,i,void 0,n,!0);s.level="error",uo(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function g_(e){if(an(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 y_(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function v_(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,m=isNaN(parseInt(r,10))?void 0:r,h=_t(t)&&t.length>0?t:cl();return u.length===0&&u.push({colno:d,filename:h,function:yr,in_app:!0,lineno:m}),e}function Hm(e){Pr&&K.log(`Global Handler attached: ${e}`)}function jm(){let e=Fe();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Wm=()=>({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=w(w(w({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=ee(w(w({},e.request),t&&{url:t}),{headers:i});e.request=s}}),__="cause",E_=5,S_="LinkedErrors",w_=(e={})=>{let t=e.limit||E_,r=e.key||__;return{name:S_,preprocessEvent(n,i,s){let o=s.getOptions();sl(ks,o.stackParser,o.maxValueLength,r,t,n,i)}}},Gm=w_;function pu(e){return[Bs(),Ps(),Fm(),km(),$m(),Gm(),Us(),Wm()]}var fu=class extends Error{cause;constructor(e,t){super(e),this.cause=t}},Be=class Th{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Th),this.INSTANCE}captureException(t,r,n){b.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){b.error(t,r);let s=this.getNewScope(n,i),o=new fu(t,r);s.captureException(o)}setGlobalContext(t,r){this.contexts[t]=w({context:r},this.contexts[t])}setUser(t){this.user=t}setTags(t){this.tags=t}getNewScope(t,r){let n=new ft;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",te.getTimezone()),n}init(){let t=pu({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new fo({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:cu,stackParser:uu,integrations:t,environment:Ct.mode,release:`web-sdk@${N.SDK_VERSION}`,debug:Ct.debug}),this.client.init()}},te=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=le.get(),n=Le.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||b.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=os.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 Be.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 Vm.JSUtils.sleep(s),i=r.querySelectorAll(e),i.length)return b.debug(`Attempt ${n+1}: ${i.length} elements found with ${e}`),i;b.debug(`Attempt ${n+1}: Elements not found with ${e}. Retrying after ${s}ms.`),n++}return b.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 getCartAttributes(){let e=await Oe.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"}]}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 li(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!1,value:r})}var Ws=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}},Gs=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}},mu=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 Ws(t))??[],this.link=e.link,this.price=new Gs(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 mu(t);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}},Dt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;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"),e.vars&&(this.vars=e.vars.map(t=>new Sr(t))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new xt({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})}},Vs=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}},du=class{enabled;constructor(e){this.enabled=e.enabled}},hu=class extends du{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},Ys=class{productQuantity;constructor(e){e??={},this.productQuantity=new hu(e.productQuantity)}},gn=class{s;g;i;constructor(e){e.s&&(this.s=new He(e.s)),e.g&&(this.g=new mo(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},ho="a-f\\d",b_=`#?[${ho}]{3}[${ho}]?`,I_=`#?[${ho}]{6}([${ho}]{2})?`,T_=new RegExp(`[^#${ho}]`,"gi"),C_=new RegExp(`^${b_}$|^${I_}$`,"i");function gu(e,t={}){if(typeof e!="string"||T_.test(e)||!C_.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 He=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 gu(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}},yn=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new He(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return Ym[this.s??1]}},Ym=(e=>(e[e.SOLID=1]="SOLID",e[e.DASHED=2]="DASHED",e))(Ym||{}),mo=class Ch{static DEFAULT_FALLBACK=new He({h:"#000000",a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new He(t.c)),t.fb&&(this.fb=new He(t.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??Ch.DEFAULT_FALLBACK}},go=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 He(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`}},vn=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}},Ut=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new gn(e.bg)),e.br&&(this.br=new yn(e.br)),e.shd&&(this.shd=new go(e.shd)),e.spc&&(this.spc=new Lr(e.spc)),this.trf=new vn(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||{}),_n=class extends Ut{constructor(e){super(e)}},Br=class extends Ut{src;constructor(e){super(e),this.src=e.src}},ui=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e[e.JUSTIFY=3]="JUSTIFY",e))(ui||{}),zs=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 yu(t))}},yu=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')`}},ct=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return ui[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 He(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new He(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new zs(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}},wr=class extends Ut{typo;constructor(e){super(e);let t=w(w({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new ct(t)}get color(){return this.typography.tc}get typography(){return this.typo}},Yr=class extends wr{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}},qs=class extends Ut{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},pi=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}},fi=class extends wr{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new pi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},Ks=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new He(e.c??{})}get text(){return this.txt}get color(){return this.c}},zr=class extends wr{ph;constructor(e){super(e),this.ph=new Ks(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},mi=class extends zr{constructor(e){e??={},super(e)}},di=class extends zr{},hi=class extends zr{},gi=class extends Br{},En=(e=>(e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH",e))(En||{}),Js=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[]}}},yo=class extends Ut{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 Js(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}`}},Xs=class extends yo{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new qs(e.cont),this.mob=new yo(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new Br(t)):t.t===2?this.elems.push(new Yr(t)):t.t===3?this.elems.push(new Yr(t)):t.t===100?this.elems.push(new _n(t)):t.t===51?this.elems.push(new di(t)):t.t===52?this.elems.push(new hi(t)):t.t===61?this.elems.push(new fi(t)):t.t===15||t.t===16?this.elems.push(new mi(t)):t.t===13&&this.elems.push(new gi(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}},yi=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}},Qs=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}},Zs=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}},ea=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Lr(e.spc),e.size&&(this.size=new Zs(e.size)),e.bg&&(this.bg=new gn(e.bg)),e.br&&(this.br=new yn(e.br)),e.typo&&(this.typo=new ct(e.typo)),e.lout&&(this.lout=new Qs(e.lout)),e.flex&&(this.flex=new yi(e.flex))}},vi=class{sm;lg;constructor(e){e??={},this.sm=new ea(e.sm),this.lg=new ea(e.lg)}},nt=class{t;style;hide;when;clc;constructor(e,t){t??={},this.t=e,this.style=new vi(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}},Sn=class extends it{constructor(e,t){super(e,t??3)}},_i=class extends nt{value;constructor(e){super(6,e),e??={},this.value=e.value}},Ei=class extends it{constructor(e=15,t){super(t,e)}},ta=class extends nt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new He(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}},zm=Se(nn()),vu=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new He(e.color)}},_u=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new He(e.color)}},vo=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(e){e??={},this.navigation=new _u(e.navigation),this.pagination=new vu(e.pagination),this.autoplay=e.autoplay,this.slidesPerView=e.slidesPerView??1,this.maxInRow=e.maxInRow??e.slidesPerView??4,this.gap=e.gap??0}},ra=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 vo(e.conf),this.allowedTypes=e.allowedTypes}},na=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 pi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},qr=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)})}},wn=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 Nh{static getParsedElements(t){let r=[];return t?.forEach(n=>{let i=Nh.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(t){switch(t.t){case 2:return new it(t);case 3:return new Sn(t);case 6:return new _i(t);case 11:return new ia(t);case 12:return new Kr(t);case 61:return new na(t);case 4:return new qr(t);case 1:return new wn(t);case 13:return new wn(t,13);case 14:return new it(t,14);case 15:case 16:return new Ei(t.t,t);case 18:return new Sn(t,18);case 62:return new ra(t);case 19:return new ta(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"}}},Kr=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 _i(e.cBox)),this.elems.push(new wn(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 vi(r.style),n.style.lg.typo=new ct(ee(w({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new ct(ee(w({},n.style.sm.typo),{td:"line-through"})));let i=new qr({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 Ei(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let o=new Sn(e.btn,18);o.hide=!e.show?.btn,this.elems.push(o)}}e.symbol&&(this.symbol=new it(e.symbol))}},ia=class extends nt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Eu(e.conf),this.prod=new Kr(e.prod)}},oa=class extends vo{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Eu=class{lg;sm;constructor(e){e??={},this.lg=new oa(e.lg),this.sm=new oa(e.sm)}},sa=class extends qr{constructor(e){super(e)}},Si=class{cont;elems=[];constructor(e){e=e??{},this.cont=new sa(e.cont),e.elems?.forEach(t=>{this.addRawElement(t)})}addRawElement(e){let t=kt.getParsedElement(e);return t&&this.elems.push(t),t}},qm=Se(Rr()),Su=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 xt(t))}},aa=class{layout;milestones;constructor(e){this.layout=e.layout??qm.ProgressBarLayout.ICONS,this.milestones=e.milestones?.map(t=>new Su(t))??[]}},ca=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}},bu=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===bt.EngagementContentType.EXCLUSION}isABTesting(){return this.contentType===bt.EngagementContentType.ABTESTING}isSingleContent(){return this.contentType===bt.EngagementContentType.SINGLE}},Mt=class Dh extends bu{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;bundleConfig;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;discountData=jt({});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 Si(t.widget)),this.previewType=t.previewType,this.occurred=t.occurred??new Date,this.props=t.props,this.embeddedItems=t.embeddedItems?.map(r=>new xt(r)),this.items=t.items?.map(r=>new Dt(r))??[],this.nonMutableItems=t.items?.map(r=>new Dt(r))??[],this.collections=t.collections?.map(r=>new Vs(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 Ys(t.manipulation),this.contentSource=t.contentSource,this.klaviyoFormID=t.klaviyoFormID,this.hasMultiplePlacement=t.hasMultiplePlacement,this.skipSubscribedItems=t.skipSubscribedItems,t.progressBarConfig&&(this.progressBarConfig=new aa(t.progressBarConfig)),t.bundleConfig&&(this.bundleConfig=new ca(t.bundleConfig)),t.bundleFrom&&(this.bundleFrom=new Dt(t.bundleFrom))}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===bt.EngagementObjective.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===bt.OnsiteDeliveryType.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===bt.OnsiteDeliveryType.PAGE_EMBED}isProgressBar(){return this.objective===bt.EngagementObjective.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===bt.EngagementObjective.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===bt.EngagementObjective.CART_RECOVERY}isProductPromotion(){return this.objective===bt.EngagementObjective.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isBYOB(){return this.objective===bt.EngagementObjective.BYOB}isShoppableVideo(){return this.objective===bt.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:te.formatCurrency(u.price.d),comparePrice:te.formatCurrency(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:de.getCurrent().item_count},c=vt.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 Xs(JSON.parse(c))}calculateDiscountData(t,r){let n=wu.ArrayUtils.sum(t,s=>s.selectedOrFirstVariant.value.price.d),i={actualPrice:n,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!t?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(Jr.DiscountType.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(t,i.discountPercentage,!0),i.discountAmount=i.actualPrice-wu.ArrayUtils.sum(t,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([Jr.DiscountType.UNIQUE_FLAT_ITEMS,Jr.DiscountType.STATIC].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(t,i.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(t,i.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_CHEAPEST_ITEM_FREE){t.sort((o,c)=>c.selectedOrFirstVariant.value.price.d-o.selectedOrFirstVariant.value.price.d);let s=t[t.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return Le.get().skipItemAttribute?{}:{[N.VIA]:"Cooee",[N.CAMPAIGN_ATTRIBUTE]:this.shortID,[N.CONTENT_ATTRIBUTE]:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Le.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=>Dh.SWIPER_ELEMENTS.has(n.t));if(!t)return!1;if(t.t===62)return!0;let r=Lt.get().isMobile()?"sm":"lg";return t.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}getCartMagicVariables(){let t=de.getCurrent();return{productCount:t.item_count,amount:te.formatCurrency(t.total_price/100),originalAmount:te.formatCurrency(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:te.formatNumber(t.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice"].map(n=>{r[n]=te.formatCurrency(t[n])}),r}};function D_(e,t){return t={exports:{}},e(t,t.exports),t.exports}var R_=P_,A_=B_,N_=M_,Ir=[],qt=[],O_=typeof Uint8Array<"u"?Uint8Array:Array,Iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bn=0,Km=Iu.length;bn<Km;++bn)Ir[bn]=Iu[bn],qt[Iu.charCodeAt(bn)]=bn;var bn,Km;qt[45]=62;qt[95]=63;function pd(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 P_(e){var t=pd(e),r=t[0],n=t[1];return(r+n)*3/4-n}function L_(e,t,r){return(t+r)*3/4-r}function B_(e){var t,r=pd(e),n=r[0],i=r[1],s=new O_(L_(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 U_(e){return Ir[e>>18&63]+Ir[e>>12&63]+Ir[e>>6&63]+Ir[e&63]}function k_(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(U_(n));return i.join("")}function M_(e){for(var t,r=e.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(k_(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 Tu={byteLength:R_,toByteArray:A_,fromByteArray:N_},F_=function(e,t,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,d=u>>1,m=-7,h=r?i-1:0,y=r?-1:1,E=e[t+h];for(h+=y,s=E&(1<<-m)-1,E>>=-m,m+=c;m>0;s=s*256+e[t+h],h+=y,m-=8);for(o=s&(1<<-m)-1,s>>=-m,m+=n;m>0;o=o*256+e[t+h],h+=y,m-=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)},H_=function(e,t,r,n,i,s){var o,c,u,d=s*8-i-1,m=(1<<d)-1,h=m>>1,y=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=m):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=y/u:t+=y*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=m?(c=0,o=m):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},wi={read:F_,write:H_},pa=D_(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,f){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(a)}return c(a,l,f)}o.poolSize=8192;function c(a,l,f){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(gt(a,ArrayBuffer)||a&>(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gt(a,SharedArrayBuffer)||a&>(a.buffer,SharedArrayBuffer)))return v(a,l,f);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,f);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,f);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,f){return c(a,l,f)},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,f){return u(a),a<=0?s(a):l!==void 0?typeof f=="string"?s(a).fill(l,f):s(a).fill(l):s(a)}o.alloc=function(a,l,f){return d(a,l,f)};function m(a){return u(a),s(a<0?0:D(a)|0)}o.allocUnsafe=function(a){return m(a)},o.allocUnsafeSlow=function(a){return m(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var f=M(a,l)|0,T=s(f),A=T.write(a,l);return A!==f&&(T=T.slice(0,A)),T}function y(a){for(var l=a.length<0?0:D(a.length)|0,f=s(l),T=0;T<l;T+=1)f[T]=a[T]&255;return f}function E(a){if(gt(a,Uint8Array)){var l=new Uint8Array(a);return v(l.buffer,l.byteOffset,l.byteLength)}return y(a)}function v(a,l,f){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');var T;return l===void 0&&f===void 0?T=new Uint8Array(a):f===void 0?T=new Uint8Array(a,l):T=new Uint8Array(a,l,f),Object.setPrototypeOf(T,o.prototype),T}function _(a){if(o.isBuffer(a)){var l=D(a.length)|0,f=s(l);return f.length===0||a.copy(f,0,0,l),f}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):y(a);if(a.type==="Buffer"&&Array.isArray(a.data))return y(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(gt(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),gt(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 f=a.length,T=l.length,A=0,U=Math.min(f,T);A<U;++A)if(a[A]!==l[A]){f=a[A],T=l[A];break}return f<T?-1:T<f?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 f;if(l===void 0)for(l=0,f=0;f<a.length;++f)l+=a[f].length;var T=o.allocUnsafe(l),A=0;for(f=0;f<a.length;++f){var U=a[f];if(gt(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)||gt(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 f=a.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&f===0)return 0;for(var A=!1;;)switch(l){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return rn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Wn(a).length;default:if(A)return T?-1:rn(a).length;l=(""+l).toLowerCase(),A=!0}}o.byteLength=M;function L(a,l,f){var T=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return ht(this,l,f);case"utf8":case"utf-8":return $e(this,l,f);case"ascii":return Ge(this,l,f);case"latin1":case"binary":return ve(this,l,f);case"base64":return ge(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,l,f);default:if(T)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function k(a,l,f){var T=a[l];a[l]=a[f],a[f]=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?$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,f,T,A){if(gt(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),f===void 0&&(f=a?a.length:0),T===void 0&&(T=0),A===void 0&&(A=this.length),l<0||f>a.length||T<0||A>this.length)throw new RangeError("out of range index");if(T>=A&&l>=f)return 0;if(T>=A)return-1;if(l>=f)return 1;if(l>>>=0,f>>>=0,T>>>=0,A>>>=0,this===a)return 0;for(var U=A-T,q=f-l,Ie=Math.min(U,q),me=this.slice(T,A),ye=a.slice(l,f),je=0;je<Ie;++je)if(me[je]!==ye[je]){U=me[je],q=ye[je];break}return U<q?-1:q<U?1:0};function W(a,l,f,T,A){if(a.length===0)return-1;if(typeof f=="string"?(T=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,$r(f)&&(f=A?0:a.length-1),f<0&&(f=a.length+f),f>=a.length){if(A)return-1;f=a.length-1}else if(f<0)if(A)f=0;else return-1;if(typeof l=="string"&&(l=o.from(l,T)),o.isBuffer(l))return l.length===0?-1:ue(a,l,f,T,A);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(a,l,f):Uint8Array.prototype.lastIndexOf.call(a,l,f):ue(a,[l],f,T,A);throw new TypeError("val must be string, number or Buffer")}function ue(a,l,f,T,A){var U=1,q=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,q/=2,Ie/=2,f/=2}function me(Z,Ce){return U===1?Z[Ce]:Z.readUInt16BE(Ce*U)}var ye;if(A){var je=-1;for(ye=f;ye<q;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(f+Ie>q&&(f=q-Ie),ye=f;ye>=0;ye--){for(var G=!0,ae=0;ae<Ie;ae++)if(me(a,ye+ae)!==me(l,ae)){G=!1;break}if(G)return ye}return-1}o.prototype.includes=function(a,l,f){return this.indexOf(a,l,f)!==-1},o.prototype.indexOf=function(a,l,f){return W(this,a,l,f,!0)},o.prototype.lastIndexOf=function(a,l,f){return W(this,a,l,f,!1)};function Me(a,l,f,T){f=Number(f)||0;var A=a.length-f;T?(T=Number(T),T>A&&(T=A)):T=A;var U=l.length;T>U/2&&(T=U/2);for(var q=0;q<T;++q){var Ie=parseInt(l.substr(q*2,2),16);if($r(Ie))return q;a[f+q]=Ie}return q}function B(a,l,f,T){return Mn(rn(l,a.length-f),a,f,T)}function Q(a,l,f,T){return Mn(Zn(l),a,f,T)}function z(a,l,f,T){return Mn(Wn(l),a,f,T)}function X(a,l,f,T){return Mn(Vi(l,a.length-f),a,f,T)}o.prototype.write=function(a,l,f,T){if(l===void 0)T="utf8",f=this.length,l=0;else if(f===void 0&&typeof l=="string")T=l,f=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(f)?(f=f>>>0,T===void 0&&(T="utf8")):(T=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var A=this.length-l;if((f===void 0||f>A)&&(f=A),a.length>0&&(f<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 Me(this,a,l,f);case"utf8":case"utf-8":return B(this,a,l,f);case"ascii":case"latin1":case"binary":return Q(this,a,l,f);case"base64":return z(this,a,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,a,l,f);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,f){return l===0&&f===a.length?Tu.fromByteArray(a):Tu.fromByteArray(a.slice(l,f))}function $e(a,l,f){f=Math.min(a.length,f);for(var T=[],A=l;A<f;){var U=a[A],q=null,Ie=U>239?4:U>223?3:U>191?2:1;if(A+Ie<=f){var me,ye,je,G;switch(Ie){case 1:U<128&&(q=U);break;case 2:me=a[A+1],(me&192)===128&&(G=(U&31)<<6|me&63,G>127&&(q=G));break;case 3:me=a[A+1],ye=a[A+2],(me&192)===128&&(ye&192)===128&&(G=(U&15)<<12|(me&63)<<6|ye&63,G>2047&&(G<55296||G>57343)&&(q=G));break;case 4:me=a[A+1],ye=a[A+2],je=a[A+3],(me&192)===128&&(ye&192)===128&&(je&192)===128&&(G=(U&15)<<18|(me&63)<<12|(ye&63)<<6|je&63,G>65535&&G<1114112&&(q=G))}}q===null?(q=65533,Ie=1):q>65535&&(q-=65536,T.push(q>>>10&1023|55296),q=56320|q&1023),T.push(q),A+=Ie}return p(T)}var xe=4096;function p(a){var l=a.length;if(l<=xe)return String.fromCharCode.apply(String,a);for(var f="",T=0;T<l;)f+=String.fromCharCode.apply(String,a.slice(T,T+=xe));return f}function Ge(a,l,f){var T="";f=Math.min(a.length,f);for(var A=l;A<f;++A)T+=String.fromCharCode(a[A]&127);return T}function ve(a,l,f){var T="";f=Math.min(a.length,f);for(var A=l;A<f;++A)T+=String.fromCharCode(a[A]);return T}function ht(a,l,f){var T=a.length;(!l||l<0)&&(l=0),(!f||f<0||f>T)&&(f=T);for(var A="",U=l;U<f;++U)A+=Wi[a[U]];return A}function se(a,l,f){for(var T=a.slice(l,f),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 f=this.length;a=~~a,l=l===void 0?f:~~l,a<0?(a+=f,a<0&&(a=0)):a>f&&(a=f),l<0?(l+=f,l<0&&(l=0)):l>f&&(l=f),l<a&&(l=a);var T=this.subarray(a,l);return Object.setPrototypeOf(T,o.prototype),T};function ie(a,l,f){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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 f=this[a]|this[a+1]<<8;return f&32768?f|4294901760:f},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var f=this[a+1]|this[a]<<8;return f&32768?f|4294901760:f},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),wi.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),wi.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),wi.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),wi.read(this,a,!1,52,8)};function lt(a,l,f,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(f+T>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,f,T){if(a=+a,l=l>>>0,f=f>>>0,!T){var A=Math.pow(2,8*f)-1;lt(this,a,l,f,A,0)}var U=1,q=0;for(this[l]=a&255;++q<f&&(U*=256);)this[l+q]=a/U&255;return l+f},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,f,T){if(a=+a,l=l>>>0,f=f>>>0,!T){var A=Math.pow(2,8*f)-1;lt(this,a,l,f,A,0)}var U=f-1,q=1;for(this[l+U]=a&255;--U>=0&&(q*=256);)this[l+U]=a/q&255;return l+f},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*f-1);lt(this,a,l,f,A-1,-A)}var U=0,q=1,Ie=0;for(this[l]=a&255;++U<f&&(q*=256);)a<0&&Ie===0&&this[l+U-1]!==0&&(Ie=1),this[l+U]=(a/q>>0)-Ie&255;return l+f},o.prototype.writeIntBE=function(a,l,f,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*f-1);lt(this,a,l,f,A-1,-A)}var U=f-1,q=1,Ie=0;for(this[l+U]=a&255;--U>=0&&(q*=256);)a<0&&Ie===0&&this[l+U+1]!==0&&(Ie=1),this[l+U]=(a/q>>0)-Ie&255;return l+f},o.prototype.writeInt8=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f,T,A,U){if(f+T>a.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function lr(a,l,f,T,A){return l=+l,f=f>>>0,A||tr(a,l,f,4),wi.write(a,l,f,T,23,4),f+4}o.prototype.writeFloatLE=function(a,l,f){return lr(this,a,l,!0,f)},o.prototype.writeFloatBE=function(a,l,f){return lr(this,a,l,!1,f)};function dt(a,l,f,T,A){return l=+l,f=f>>>0,A||tr(a,l,f,8),wi.write(a,l,f,T,52,8),f+8}o.prototype.writeDoubleLE=function(a,l,f){return dt(this,a,l,!0,f)},o.prototype.writeDoubleBE=function(a,l,f){return dt(this,a,l,!1,f)},o.prototype.copy=function(a,l,f,T){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(f||(f=0),!T&&T!==0&&(T=this.length),l>=a.length&&(l=a.length),l||(l=0),T>0&&T<f&&(T=f),T===f||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=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-f&&(T=a.length-l+f);var A=T-f;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,f,T):Uint8Array.prototype.set.call(a,this.subarray(f,T),l),A},o.prototype.fill=function(a,l,f,T){if(typeof a=="string"){if(typeof l=="string"?(T=l,l=0,f=this.length):typeof f=="string"&&(T=f,f=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<f)throw new RangeError("Out of range index");if(f<=l)return this;l=l>>>0,f=f===void 0?this.length:f>>>0,a||(a=0);var U;if(typeof a=="number")for(U=l;U<f;++U)this[U]=a;else{var q=o.isBuffer(a)?a:o.from(a,T),Ie=q.length;if(Ie===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(U=0;U<f-l;++U)this[U+l]=q[U%Ie]}return this};var Hr=/[^+/0-9A-Za-z-_]/g;function Hn(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 rn(a,l){l=l||1/0;for(var f,T=a.length,A=null,U=[],q=0;q<T;++q){if(f=a.charCodeAt(q),f>55295&&f<57344){if(!A){if(f>56319){(l-=3)>-1&&U.push(239,191,189);continue}else if(q+1===T){(l-=3)>-1&&U.push(239,191,189);continue}A=f;continue}if(f<56320){(l-=3)>-1&&U.push(239,191,189),A=f;continue}f=(A-55296<<10|f-56320)+65536}else A&&(l-=3)>-1&&U.push(239,191,189);if(A=null,f<128){if((l-=1)<0)break;U.push(f)}else if(f<2048){if((l-=2)<0)break;U.push(f>>6|192,f&63|128)}else if(f<65536){if((l-=3)<0)break;U.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((l-=4)<0)break;U.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return U}function Zn(a){for(var l=[],f=0;f<a.length;++f)l.push(a.charCodeAt(f)&255);return l}function Vi(a,l){for(var f,T,A,U=[],q=0;q<a.length&&!((l-=2)<0);++q)f=a.charCodeAt(q),T=f>>8,A=f%256,U.push(A),U.push(T);return U}function Wn(a){return Tu.toByteArray(Hn(a))}function Mn(a,l,f,T){for(var A=0;A<T&&!(A+f>=l.length||A>=a.length);++A)l[A+f]=a[A];return A}function gt(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 Wi=function(){for(var a="0123456789abcdef",l=new Array(256),f=0;f<16;++f)for(var T=f*16,A=0;A<16;++A)l[T+A]=a[f]+a[A];return l}()}),we=pa.Buffer;pa.SlowBuffer;pa.INSPECT_MAX_BYTES;pa.kMaxLength;var Au=function(e,t){return Au=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])},Au(e,t)};function fa(e,t){Au(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Tn=function(e){fa(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),We=function(e){fa(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 la(e){return e&&e.Math==Math&&e}function fd(){return la(typeof globalThis=="object"&&globalThis)||la(typeof window=="object"&&window)||la(typeof self=="object"&&self)||la(typeof global=="object"&&global)||Function("return this")()}function $_(){var e=fd();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var j_=function(e){var t=$_()?"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=we.alloc(e),n=0;n<e;++n)r[n]=Math.floor(Math.random()*256);return r},W_=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(we.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(we.alloc(t))}:j_}},md=W_();function G_(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ou(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function V_(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Y_(e){return wo(e)&&Object.prototype.toString.call(e)==="[object Date]"}function wo(e){return typeof e=="object"&&e!==null}function ma(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 ua(e){if(ArrayBuffer.isView(e))return we.from(e.buffer,e.byteOffset,e.byteLength);if(G_(e))return we.from(e);throw new We("Must use either Buffer or TypedArray")}var z_=/^(?:[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,dd=function(e){return typeof e=="string"&&z_.test(e)},Nu=function(e){if(!dd(e))throw new We('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 we.from(t,"hex")},Jm=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")},BO=Math.pow(2,63)-1,UO=-Math.pow(2,63),q_=Math.pow(2,53),K_=-Math.pow(2,53),hd=4,Cn=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 We("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=we.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=we.from(t,"binary"):Array.isArray(t)?this.buffer=we.from(t):this.buffer=ua(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new We("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new We("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 We("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=we.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=we.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(ua(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 Xm(this.buffer.slice(0,this.position));throw new Tn('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=we.from(t.$binary,"base64")):typeof t.$binary!="string"&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=we.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=Nu(t.$uuid)),!n)throw new We("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===hd?new Xm(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(Cn.prototype,"_bsontype",{value:"Binary"});var Cu=16,Xm=function(e){fa(t,e);function t(r){var n=this,i,s;if(r==null)i=t.generate();else if(r instanceof t)i=we.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===Cu)i=ua(r);else if(typeof r=="string")i=Nu(r);else throw new We("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,hd)||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=Jm(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=Jm(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 Cn(this.id,Cn.SUBTYPE_UUID)},t.generate=function(){var r=md(Cu);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,we.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?dd(r):Ou(r)?r.length!==Cu?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var n=Nu(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}(Cn),da=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(da.prototype,"_bsontype",{value:"Code"});function J_(e){return wo(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Eo=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(Eo.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 Qm=65536,X_=1<<24,Ii=Qm*Qm,gd=Ii*Ii,Zm=gd/2,ed={},td={},J=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=td[t],i)?i:(n=e.fromBits(t,(t|0)<0?-1:0,!0),s&&(td[t]=n),n)):(t|=0,(s=-128<=t&&t<128)&&(i=ed[t],i)?i:(n=e.fromBits(t,t<0?-1:0,!1),s&&(ed[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>=gd)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Zm)return e.MIN_VALUE;if(t+1>=Zm)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Ii|0,t/Ii|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 m=e.fromNumber(Math.pow(n,u));o=o.mul(m).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 wo(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,m=0,h=0,y=0,E=0;return E+=s+d,y+=E>>>16,E&=65535,y+=i+u,h+=y>>>16,y&=65535,h+=n+c,m+=h>>>16,h&=65535,m+=r+o,m&=65535,e.fromBits(y<<16|E,m<<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),m=d.mul(t);m.isNegative()||m.gt(i);)n-=u,d=e.fromNumber(n,this.unsigned),m=d.mul(t);d.isZero()&&(d=e.ONE),s=s.add(d),i=i.sub(m)}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,m=t.low&65535,h=0,y=0,E=0,v=0;return v+=o*m,E+=v>>>16,v&=65535,E+=s*m,y+=E>>>16,E&=65535,E+=o*d,y+=E>>>16,E&=65535,y+=i*m,h+=y>>>16,y&=65535,y+=s*d,h+=y>>>16,y&=65535,y+=o*u,h+=y>>>16,y&=65535,h+=n*m+i*d+s*u+o*c,h&=65535,e.fromBits(E<<16|v,h<<16|y,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)*Ii+(this.low>>>0):this.high*Ii+(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,m=d.toString(t);if(o=u,o.isZero())return m+c;for(;m.length<6;)m="0"+m;c=""+m+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(X_),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(J.prototype,"__isLong__",{value:!0});Object.defineProperty(J.prototype,"_bsontype",{value:"Long"});var Q_=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Z_=/^(\+|-)?(Infinity|inf)$/i,eE=/^(\+|-)?NaN$/i,_o=6111,xu=-6176,rd=6176,tE=34,Du=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),nd=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),id=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),rE=/^([-+])?(\d+)?$/,nE=31,od=16383,iE=30,oE=31;function sd(e){return!isNaN(parseInt(e,10))}function sE(e){var t=J.fromNumber(1e9),r=J.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 J(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function aE(e,t){if(!e&&!t)return{high:J.fromNumber(0),low:J.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new J(e.getLowBits(),0),i=t.shiftRightUnsigned(32),s=new J(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 J(c.getLowBits(),0).add(u).add(d.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),d=c.shiftLeft(32).add(new J(d.getLowBits(),0)),{high:o,low:d}}function cE(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 bi(e,t){throw new We('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Pu=function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ou(t)){if(t.byteLength!==16)throw new We("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new We("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,m=[0],h=0,y=0,E=0,v=0,_=0,D=0,P=new J(0,0),M=new J(0,0),L=0,k=0;if(t.length>=7e3)throw new We(""+t+" not a valid Decimal128 string");var W=t.match(Q_),ue=t.match(Z_),Me=t.match(eE);if(!W&&!ue&&!Me||t.length===0)throw new We(""+t+" not a valid Decimal128 string");if(W){var B=W[2],Q=W[4],z=W[5],X=W[6];Q&&X===void 0&&bi(t,"missing exponent power"),Q&&B===void 0&&bi(t,"missing exponent base"),Q===void 0&&(z||X)&&bi(t,"missing e before exponent")}if((t[k]==="+"||t[k]==="-")&&(r=t[k++]==="-"),!sd(t[k])&&t[k]!=="."){if(t[k]==="i"||t[k]==="I")return new e(we.from(r?nd:id));if(t[k]==="N")return new e(we.from(Du))}for(;sd(t[k])||t[k]===".";){if(t[k]==="."){n&&bi(t,"contains multiple periods"),n=!0,k=k+1;continue}h<34&&(t[k]!=="0"||i)&&(i||(d=o),i=!0,m[y++]=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 We(""+t+" not a valid Decimal128 string");if(t[k]==="e"||t[k]==="E"){var ge=t.substr(++k).match(rE);if(!ge||!ge[2])return new e(we.from(Du));_=parseInt(ge[0],10),k=k+ge[0].length}if(t[k])return new e(we.from(Du));if(E=0,!h)E=0,v=0,m[0]=0,c=1,h=1,s=0;else if(v=h-1,s=c,s!==1)for(;m[d+s-1]===0;)s=s-1;for(_<=u&&u-_>16384?_=xu:_=_-u;_>_o;){if(v=v+1,v-E>tE){var $e=m.join("");if($e.match(/^0+$/)){_=_o;break}bi(t,"overflow")}_=_-1}for(;_<xu||h<c;){if(v===0&&s<h){_=xu,s=0;break}if(h<c?c=c-1:v=v-1,_<_o)_=_+1;else{var $e=m.join("");if($e.match(/^0+$/)){_=_o;break}bi(t,"overflow")}}if(v-E+1<s){var xe=o;n&&(d=d+1,xe=xe+1),r&&(d=d+1,xe=xe+1);var p=parseInt(t[d+v+1],10),Ge=0;if(p>=5&&(Ge=1,p===5)){for(Ge=m[v]%2===1?1:0,D=d+v+2;D<xe;D++)if(parseInt(t[D],10)){Ge=1;break}}if(Ge){for(var ve=v;ve>=0;ve--)if(++m[ve]>9&&(m[ve]=0,ve===0))if(_<_o)_=_+1,m[ve]=1;else return new e(we.from(r?nd:id))}}if(P=J.fromNumber(0),M=J.fromNumber(0),s===0)P=J.fromNumber(0),M=J.fromNumber(0);else if(v-E<17){var ve=E;for(M=J.fromNumber(m[ve++]),P=new J(0,0);ve<=v;ve++)M=M.multiply(J.fromNumber(10)),M=M.add(J.fromNumber(m[ve]))}else{var ve=E;for(P=J.fromNumber(m[ve++]);ve<=v-17;ve++)P=P.multiply(J.fromNumber(10)),P=P.add(J.fromNumber(m[ve]));for(M=J.fromNumber(m[ve++]);ve<=v;ve++)M=M.multiply(J.fromNumber(10)),M=M.add(J.fromNumber(m[ve]))}var ht=aE(P,J.fromString("100000000000000000"));ht.low=ht.low.add(M),cE(ht.low,M)&&(ht.high=ht.high.add(J.fromNumber(1))),L=_+rd;var se={low:J.fromNumber(0),high:J.fromNumber(0)};ht.high.shiftRightUnsigned(49).and(J.fromNumber(1)).equals(J.fromNumber(1))?(se.high=se.high.or(J.fromNumber(3).shiftLeft(61)),se.high=se.high.or(J.fromNumber(L).and(J.fromNumber(16383).shiftLeft(47))),se.high=se.high.or(ht.high.and(J.fromNumber(0x7fffffffffff)))):(se.high=se.high.or(J.fromNumber(L&16383).shiftLeft(49)),se.high=se.high.or(ht.high.and(J.fromNumber(562949953421311)))),se.low=ht.low,r&&(se.high=se.high.or(J.fromString("9223372036854775808")));var ie=we.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,m,h=[];s=0;var y=this.bytes,E=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,v=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,_=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,D=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24;s=0;var P={low:new J(E,v),high:new J(_,D)};P.high.lessThan(J.ZERO)&&h.push("-");var M=D>>26&nE;if(M>>3===3){if(M===iE)return h.join("")+"Infinity";if(M===oE)return"NaN";t=D>>15&od,c=8+(D>>14&1)}else c=D>>14&7,t=D>>17&od;var L=t-rd;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(m=3;m>=0;m--){var k=0,W=sE(u);if(u=W.quotient,k=W.rem.low,!!k)for(d=8;d>=0;d--)n[m*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 Me=r+L;if(Me>0)for(var i=0;i<Me;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");Me++<0;)h.push("0");for(var i=0;i<r-Math.max(Me-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(Pu.prototype,"_bsontype",{value:"Decimal128"});var ha=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(ha.prototype,"_bsontype",{value:"Double"});var ga=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(ga.prototype,"_bsontype",{value:"Int32"});var Lu=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(Lu.prototype,"_bsontype",{value:"MaxKey"});var Bu=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(Bu.prototype,"_bsontype",{value:"MinKey"});var lE=new RegExp("^[0-9a-fA-F]{24}$"),In=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 We("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=we.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 we?r:ua(r);else if(typeof r=="string")if(r.length===12){var n=we.from(r);if(n.byteLength===12)this[br]=n;else throw new We("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&lE.test(r))this[br]=we.from(r,"hex");else throw new We("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new We("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=we.alloc(12);return n.writeUInt32BE(t,0),In===null&&(In=md(5)),n[4]=In[0],n[5]=In[1],n[6]=In[2],n[7]=In[3],n[8]=In[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&&Ou(this.id))return t===we.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 we.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=we.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 We("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(we.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:ma(function(e){return et.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(et.prototype,"getInc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"get_inc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et,"get_inc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"_bsontype",{value:"ObjectID"});function uE(e){return e.split("").sort().join("")}var So=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=uE(r??""),this.pattern.indexOf("\0")!==-1)throw new Tn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new Tn("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 Tn("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 We("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(So.prototype,"_bsontype",{value:"BSONRegExp"});var Uu=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(Uu.prototype,"_bsontype",{value:"Symbol"});var pE=J,yd=function(e){fa(t,e);function t(r,n){var i=this;return i instanceof t?(J.isLong(r)?i=e.call(this,r.low,r.high,!0)||this:wo(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(J.fromInt(r,!0))},t.fromNumber=function(r){return new t(J.fromNumber(r,!0))},t.fromBits=function(r,n){return new t(r,n)},t.fromString=function(r,n){return new t(J.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=J.MAX_UNSIGNED_VALUE,t}(pE);function fE(e){return wo(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var vd=2147483647,_d=-2147483648,Ed=9223372036854776e3,Sd=-9223372036854776e3,mE={$oid:et,$binary:Cn,$uuid:Cn,$symbol:Uu,$numberInt:ga,$numberDecimal:Pu,$numberDouble:ha,$numberLong:J,$minKey:Bu,$maxKey:Lu,$regex:So,$regularExpression:So,$timestamp:yd};function wd(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=_d&&e<=vd)return new ga(e);if(e>=Sd&&e<=Ed)return J.fromNumber(e)}return new ha(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=mE[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)):J.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=wd(e.$scope)),da.fromExtendedJSON(e)}if(J_(e)||e.$dbPointer){var u=e.$ref?e:e.$dbPointer;if(u instanceof Eo)return u;var d=Object.keys(u).filter(function(h){return h.startsWith("$")}),m=!0;if(d.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(m=!1)}),m)return Eo.fromExtendedJSON(u)}return e}function dE(e,t){return e.map(function(r,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Xr(r,t)}finally{t.seenObjects.pop()}})}function ad(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Xr(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 We(`Converting circular structure to EJSON:
|
|
34
|
+
Url: ${Ls(e)}`),!0)}function Qy(e,t){return e.type||!t||!t.length?!1:rv(e).some(r=>ni(r,t))}function Zy(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?ni(r,t):!1}function ev(e,t){if(!t||!t.length)return!1;let r=Ls(e);return r?ni(r,t):!1}function tv(e,t){if(!t||!t.length)return!0;let r=Ls(e);return r?ni(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 nv(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function iv(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 Ls(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?iv(t):null}catch{return De&&K.error(`Cannot extract url for event ${nr(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 sv="Dedupe",av=()=>{let e;return{name:sv,processEvent(t){if(t.type)return t;try{if(cv(t,e))return De&&K.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Us=av;function cv(e,t){return t?!!(lv(e,t)||uv(e,t)):!1}function lv(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!bm(e,t)||!wm(e,t))}function uv(e,t){let r=Sm(t),n=Sm(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!bm(e,t)||!wm(e,t))}function wm(e,t){let r=ds(e),n=ds(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 bm(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 Sm(e){return e.exception&&e.exception.values&&e.exception.values[0]}var Ye=re,Xl=0;function Ql(){return Xl>0}function bv(){Xl++,setTimeout(()=>{Xl--})}function dn(e,t={},r){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(ln(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=>dn(o,t));return e.apply(this,s)}catch(s){throw bv(),Ds(o=>{o.addEventProcessor(c=>(t.mechanism&&(ai(c,void 0,void 0),Nr(c,t.mechanism)),c.extra=ee(w({},c.extra),{arguments:i}),c)),Ns(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}ps(n,e),Et(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 ks(e,t){let r=tu(e,t),n={type:t&&t.name,value:Dv(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Iv(e,t,r,n){let i=Fe(),s=i&&i.getOptions().normalizeDepth,o=Nv(t),c={__serialized__:Es(t,s)};if(o)return{exception:{values:[ks(e,o)]},extra:c};let u={exception:{values:[{type:cn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:Rv(t,{isUnhandledRejection:n})}]},extra:c};if(r){let d=tu(e,r);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function Zl(e,t){return{exception:{values:[ks(e,t)]}}}function tu(e,t){let r=t.stacktrace||t.stack||"",n=Cv(t),i=xv(t);try{return e(r,n,i)}catch{}return[]}var Tv=/Minified React error #\d+;/i;function Cv(e){return e&&Tv.test(e.message)?1:0}function xv(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Dv(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function xm(e,t,r,n){let i=r&&r.syntheticException||void 0,s=Ms(e,t,i,n);return Nr(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Yt(s)}function Dm(e,t,r="info",n,i){let s=n&&n.syntheticException||void 0,o=eu(e,t,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Yt(o)}function Ms(e,t,r,n,i){let s;if(as(t)&&t.error)return Zl(e,t.error);if(cs(t)||tl(t)){let o=t;if("stack"in t)s=Zl(e,t);else{let c=o.name||(cs(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=eu(e,u,r,n),ai(s,u)}return"code"in o&&(s.tags=ee(w({},s.tags),{"DOMException.code":`${o.code}`})),s}return sn(t)?Zl(e,t):rr(t)||cn(t)?(s=Iv(e,t,r,i),Nr(s,{synthetic:!0}),s):(s=eu(e,t,r,n),ai(s,`${t}`,void 0),Nr(s,{synthetic:!0}),s)}function eu(e,t,r,n){let i={};if(n&&r){let s=tu(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}if(ri(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 Rv(e,{isUnhandledRejection:t}){let r=fl(e),n=t?"promise rejection":"exception";return as(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:cn(e)?`Event \`${Av(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Av(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Nv(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function Rm(e,{metadata:t,tunnel:r,dsn:n}){let i=w(w({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=Ov(e);return _r(i,[s])}function Ov(e){return[{type:"user_report"},e]}var fo=class extends po{constructor(e){let t=w({parentSpanIsAlwaysRootSpan:!0},e),r=Ye.SENTRY_SDK_SOURCE||wl();Jl(t,"browser",["browser"],r),super(t),t.sendClientReports&&Ye.document&&Ye.document.addEventListener("visibilitychange",()=>{Ye.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return xm(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return Dm(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=Rm(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=Ol(e,this._options.tunnel&&gr(this._dsn));this.sendEnvelope(t)}},Am=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke=re,Pv=1e3,Nm,ru,nu;function iu(e){let t="dom";St(t,e),wt(t,Lv)}function Lv(){if(!Ke.document)return;let e=Ze.bind(null,"dom"),t=Om(e,!0);Ke.document.addEventListener("click",t,!1),Ke.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=Ke[r]&&Ke[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ue(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__||{},m=d[s]=d[s]||{refCount:0};if(!m.handler){let h=Om(e);m.handler=h,i.call(this,s,h,c)}m.refCount++}catch{}return i.call(this,s,o,c)}}),Ue(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__||{},m=d[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,c),m.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 Bv(e){if(e.type!==ru)return!1;try{if(!e.target||e.target._sentryId!==nu)return!1}catch{}return!0}function Uv(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function Om(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;let n=kv(r);if(Uv(r.type,n))return;Et(r,"_sentryCaptured",!0),n&&!n._sentryId&&Et(n,"_sentryId",rt());let i=r.type==="keypress"?"input":r.type;Bv(r)||(e({event:r,name:i,global:t}),ru=r.type,nu=n?n._sentryId:void 0),clearTimeout(Nm),Nm=Ke.setTimeout(()=>{nu=void 0,ru=void 0},Pv)}}function kv(e){try{return e.target}catch{return null}}var Fs;function ou(e){let t="history";St(t,e),wt(t,Mv)}function Mv(){if(!Bl())return;let e=Ke.onpopstate;Ke.onpopstate=function(...r){let n=Ke.location.href,i=Fs;if(Fs=n,Ze("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=Fs,o=String(i);Fs=o,Ze("history",{from:s,to:o})}return r.apply(this,n)}}Ue(Ke.history,"pushState",t),Ue(Ke.history,"replaceState",t)}var Hs={};function su(e){let t=Hs[e];if(t)return t;let r=Ke[e];if(no(r))return Hs[e]=r.bind(Ke);let n=Ke.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){Am&&K.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(Hs[e]=r.bind(Ke))}function $s(e){Hs[e]=void 0}var hn="__sentry_xhr_v3__";function au(e){let t="xhr";St(t,e),wt(t,Fv)}function Fv(){if(!Ke.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;Ue(e,"open",function(t){return function(...r){let n=Bt()*1e3,i=_t(r[0])?r[0].toUpperCase():void 0,s=Hv(r[1]);if(!i||!s)return t.apply(this,r);this[hn]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[hn];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:Bt()*1e3,startTimestamp:n,xhr:this};Ze("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ue(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Ue(this,"setRequestHeader",function(c){return function(...u){let[d,m]=u,h=this[hn];return h&&_t(d)&&_t(m)&&(h.request_headers[d.toLowerCase()]=m),c.apply(this,u)}}),t.apply(this,r)}}),Ue(e,"send",function(t){return function(...r){let n=this[hn];if(!n)return t.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:Bt()*1e3,xhr:this};return Ze("xhr",i),t.apply(this,r)}})}function Hv(e){if(_t(e))return e;try{return e.toString()}catch{}}function cu(e,t=su("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=w({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);if(!t)return $s("fetch"),Vr("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 $s("fetch"),r-=o,n--,Vr(u)}}return Os(e,i)}var $v=30,jv=50;function lu(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 Wv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Gv=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Vv=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yv=e=>{let t=Wv.exec(e);if(t){let[,n,i,s]=t;return lu(n,yr,+i,+s)}let r=Gv.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Vv.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=Um(r[1]||yr,r[2]);return lu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Pm=[$v,Yv],zv=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qv=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kv=e=>{let t=zv.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=qv.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]=Um(n,r),lu(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Lm=[jv,Kv],Bm=[Pm,Lm],uu=dl(...Bm),Um=(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]},js=1024,Xv="Breadcrumbs",Qv=(e={})=>{let t=w({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:Xv,setup(r){t.console&&hl(t_(r)),t.dom&&iu(e_(r,t.dom)),t.xhr&&au(r_(r)),t.fetch&&_l(n_(r)),t.history&&ou(i_(r)),t.sentry&&r.on("beforeSendEvent",Zv(r))}}},km=Qv;function Zv(e){return function(t){Fe()===e&&Er({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:nr(t)},{event:t})}}function e_(e,t){return function(r){if(Fe()!==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>js&&(Pr&&K.warn(`\`dom.maxStringLength\` cannot exceed ${js}, but a value of ${o} was configured. Sentry will use ${js} instead.`),o=js),typeof s=="string"&&(s=[s]);try{let u=r.event,d=o_(u)?u.target:u;n=to(d,{keyAttrs:s,maxStringLength:o}),i=ll(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 t_(e){return function(t){if(Fe()!==e)return;let r={category:"console",data:{arguments:t.args,logger:"console"},level:Tl(t.level),message:ls(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)r.message=`Assertion failed: ${ls(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1);else return;Er(r,{input:t.args,level:t.level})}}function r_(e){return function(t){if(Fe()!==e)return;let{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[hn];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,d={method:s,url:o,status_code:c},m={xhr:t.xhr,input:u,startTimestamp:r,endTimestamp:n};Er({category:"xhr",data:d,type:"http"},m)}}function n_(e){return function(t){if(Fe()!==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(w({},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 i_(e){return function(t){if(Fe()!==e)return;let r=t.from,n=t.to,i=oo(Ye.location.href),s=r?oo(r):void 0,o=oo(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 o_(e){return!!e&&!!e.target}var s_=["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"],a_="BrowserApiErrors",c_=(e={})=>{let t=w({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:a_,setupOnce(){t.setTimeout&&Ue(Ye,"setTimeout",Mm),t.setInterval&&Ue(Ye,"setInterval",Mm),t.requestAnimationFrame&&Ue(Ye,"requestAnimationFrame",l_),t.XMLHttpRequest&&"XMLHttpRequest"in Ye&&Ue(XMLHttpRequest.prototype,"send",u_);let r=t.eventTarget;r&&(Array.isArray(r)?r:s_).forEach(p_)}}},Fm=c_;function Mm(e){return function(...t){let r=t[0];return t[0]=dn(r,{mechanism:{data:{function:Vt(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function l_(e){return function(t){return e.apply(this,[dn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Vt(e)},handled:!1,type:"instrument"}})])}}function u_(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Ue(r,n,function(i){let s={mechanism:{data:{function:n,handler:Vt(i)},handled:!1,type:"instrument"}},o=ln(i);return o&&(s.mechanism.data.handler=Vt(o)),dn(i,s)})}),e.apply(this,t)}}function p_(e){let t=Ye,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ue(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=dn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Vt(s),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,dn(s,{mechanism:{data:{function:"addEventListener",handler:Vt(s),target:e},handled:!1,type:"instrument"}}),o])}}),Ue(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 f_="GlobalHandlers",m_=(e={})=>{let t=w({onerror:!0,onunhandledrejection:!0},e);return{name:f_,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(d_(r),Hm("onerror")),t.onunhandledrejection&&(h_(r),Hm("onunhandledrejection"))}}},$m=m_;function d_(e){El(t=>{let{stackParser:r,attachStacktrace:n}=jm();if(Fe()!==e||Ql())return;let{msg:i,url:s,line:o,column:c,error:u}=t,d=v_(Ms(r,u||i,void 0,n,!1),s,o,c);d.level="error",uo(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function h_(e){Sl(t=>{let{stackParser:r,attachStacktrace:n}=jm();if(Fe()!==e||Ql())return;let i=g_(t),s=an(i)?y_(i):Ms(r,i,void 0,n,!0);s.level="error",uo(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function g_(e){if(an(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 y_(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function v_(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,m=isNaN(parseInt(r,10))?void 0:r,h=_t(t)&&t.length>0?t:cl();return u.length===0&&u.push({colno:d,filename:h,function:yr,in_app:!0,lineno:m}),e}function Hm(e){Pr&&K.log(`Global Handler attached: ${e}`)}function jm(){let e=Fe();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Wm=()=>({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=w(w(w({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=ee(w(w({},e.request),t&&{url:t}),{headers:i});e.request=s}}),__="cause",E_=5,S_="LinkedErrors",w_=(e={})=>{let t=e.limit||E_,r=e.key||__;return{name:S_,preprocessEvent(n,i,s){let o=s.getOptions();sl(ks,o.stackParser,o.maxValueLength,r,t,n,i)}}},Gm=w_;function pu(e){return[Bs(),Ps(),Fm(),km(),$m(),Gm(),Us(),Wm()]}var fu=class extends Error{cause;constructor(e,t){super(e),this.cause=t}},Be=class Th{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Th),this.INSTANCE}captureException(t,r,n){b.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){b.error(t,r);let s=this.getNewScope(n,i),o=new fu(t,r);s.captureException(o)}setGlobalContext(t,r){this.contexts[t]=w({context:r},this.contexts[t])}setUser(t){this.user=t}setTags(t){this.tags=t}getNewScope(t,r){let n=new ft;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",te.getTimezone()),n}init(){let t=pu({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new fo({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:cu,stackParser:uu,integrations:t,environment:Ct.mode,release:`web-sdk@${N.SDK_VERSION}`,debug:Ct.debug}),this.client.init()}},te=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=le.get(),n=Le.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||b.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=os.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 Be.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 Vm.JSUtils.sleep(s),i=r.querySelectorAll(e),i.length)return b.debug(`Attempt ${n+1}: ${i.length} elements found with ${e}`),i;b.debug(`Attempt ${n+1}: Elements not found with ${e}. Retrying after ${s}ms.`),n++}return b.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 getCartAttributes(){let e=await Oe.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"}]}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 li(e,t,r){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!1,value:r})}var Ws=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}},Gs=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}},mu=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 Ws(t))??[],this.link=e.link,this.price=new Gs(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 mu(t);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}},Dt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;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"),e.vars&&(this.vars=e.vars.map(t=>new Sr(t))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new xt({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})}},Vs=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}},du=class{enabled;constructor(e){this.enabled=e.enabled}},hu=class extends du{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},Ys=class{productQuantity;constructor(e){e??={},this.productQuantity=new hu(e.productQuantity)}},gn=class{s;g;i;constructor(e){e.s&&(this.s=new He(e.s)),e.g&&(this.g=new mo(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},ho="a-f\\d",b_=`#?[${ho}]{3}[${ho}]?`,I_=`#?[${ho}]{6}([${ho}]{2})?`,T_=new RegExp(`[^#${ho}]`,"gi"),C_=new RegExp(`^${b_}$|^${I_}$`,"i");function gu(e,t={}){if(typeof e!="string"||T_.test(e)||!C_.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 He=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 gu(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}},yn=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new He(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return Ym[this.s??1]}},Ym=(e=>(e[e.SOLID=1]="SOLID",e[e.DASHED=2]="DASHED",e))(Ym||{}),mo=class Ch{static DEFAULT_FALLBACK=new He({h:"#000000",a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new He(t.c)),t.fb&&(this.fb=new He(t.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??Ch.DEFAULT_FALLBACK}},go=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 He(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`}},vn=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}},Ut=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new gn(e.bg)),e.br&&(this.br=new yn(e.br)),e.shd&&(this.shd=new go(e.shd)),e.spc&&(this.spc=new Lr(e.spc)),this.trf=new vn(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||{}),_n=class extends Ut{constructor(e){super(e)}},Br=class extends Ut{src;constructor(e){super(e),this.src=e.src}},ui=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e[e.JUSTIFY=3]="JUSTIFY",e))(ui||{}),zs=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 yu(t))}},yu=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')`}},ct=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return ui[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 He(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new He(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new zs(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}},wr=class extends Ut{typo;constructor(e){super(e);let t=w(w({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new ct(t)}get color(){return this.typography.tc}get typography(){return this.typo}},Yr=class extends wr{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}},qs=class extends Ut{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},pi=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}},fi=class extends wr{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new pi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},Ks=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new He(e.c??{})}get text(){return this.txt}get color(){return this.c}},zr=class extends wr{ph;constructor(e){super(e),this.ph=new Ks(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},mi=class extends zr{constructor(e){e??={},super(e)}},di=class extends zr{},hi=class extends zr{},gi=class extends Br{},En=(e=>(e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH",e))(En||{}),Js=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[]}}},yo=class extends Ut{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 Js(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}`}},Xs=class extends yo{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new qs(e.cont),this.mob=new yo(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new Br(t)):t.t===2?this.elems.push(new Yr(t)):t.t===3?this.elems.push(new Yr(t)):t.t===100?this.elems.push(new _n(t)):t.t===51?this.elems.push(new di(t)):t.t===52?this.elems.push(new hi(t)):t.t===61?this.elems.push(new fi(t)):t.t===15||t.t===16?this.elems.push(new mi(t)):t.t===13&&this.elems.push(new gi(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}},yi=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}},Qs=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}},Zs=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}},ea=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Lr(e.spc),e.size&&(this.size=new Zs(e.size)),e.bg&&(this.bg=new gn(e.bg)),e.br&&(this.br=new yn(e.br)),e.typo&&(this.typo=new ct(e.typo)),e.lout&&(this.lout=new Qs(e.lout)),e.flex&&(this.flex=new yi(e.flex))}},vi=class{sm;lg;constructor(e){e??={},this.sm=new ea(e.sm),this.lg=new ea(e.lg)}},nt=class{t;style;hide;when;clc;constructor(e,t){t??={},this.t=e,this.style=new vi(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}},Sn=class extends it{constructor(e,t){super(e,t??3)}},_i=class extends nt{value;constructor(e){super(6,e),e??={},this.value=e.value}},Ei=class extends it{constructor(e=15,t){super(t,e)}},ta=class extends nt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new He(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}},zm=Se(nn()),vu=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new He(e.color)}},_u=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new He(e.color)}},vo=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(e){e??={},this.navigation=new _u(e.navigation),this.pagination=new vu(e.pagination),this.autoplay=e.autoplay,this.slidesPerView=e.slidesPerView??1,this.maxInRow=e.maxInRow??e.slidesPerView??4,this.gap=e.gap??0}},ra=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 vo(e.conf),this.allowedTypes=e.allowedTypes}},na=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 pi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}},qr=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)})}},wn=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 Dh{static getParsedElements(t){let r=[];return t?.forEach(n=>{let i=Dh.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(t){switch(t.t){case 2:return new it(t);case 3:return new Sn(t);case 6:return new _i(t);case 11:return new ia(t);case 12:return new Kr(t);case 61:return new na(t);case 4:return new qr(t);case 1:return new wn(t);case 13:return new wn(t,13);case 14:return new it(t,14);case 15:case 16:return new Ei(t.t,t);case 18:return new Sn(t,18);case 62:return new ra(t);case 19:return new ta(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"}}},Kr=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 _i(e.cBox)),this.elems.push(new wn(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 vi(r.style),n.style.lg.typo=new ct(ee(w({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new ct(ee(w({},n.style.sm.typo),{td:"line-through"})));let i=new qr({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 Ei(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let o=new Sn(e.btn,18);o.hide=!e.show?.btn,this.elems.push(o)}}e.symbol&&(this.symbol=new it(e.symbol))}},ia=class extends nt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Eu(e.conf),this.prod=new Kr(e.prod)}},oa=class extends vo{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Eu=class{lg;sm;constructor(e){e??={},this.lg=new oa(e.lg),this.sm=new oa(e.sm)}},sa=class extends qr{constructor(e){super(e)}},Si=class{cont;elems=[];constructor(e){e=e??{},this.cont=new sa(e.cont),e.elems?.forEach(t=>{this.addRawElement(t)})}addRawElement(e){let t=kt.getParsedElement(e);return t&&this.elems.push(t),t}},qm=Se(Rr()),Su=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 xt(t))}},aa=class{layout;milestones;constructor(e){this.layout=e.layout??qm.ProgressBarLayout.ICONS,this.milestones=e.milestones?.map(t=>new Su(t))??[]}},ca=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}},bu=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===bt.EngagementContentType.EXCLUSION}isABTesting(){return this.contentType===bt.EngagementContentType.ABTESTING}isSingleContent(){return this.contentType===bt.EngagementContentType.SINGLE}},Mt=class Nh extends bu{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;bundleConfig;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;discountData=jt({});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 Si(t.widget)),this.previewType=t.previewType,this.occurred=t.occurred??new Date,this.props=t.props,this.embeddedItems=t.embeddedItems?.map(r=>new xt(r)),this.items=t.items?.map(r=>new Dt(r))??[],this.nonMutableItems=t.items?.map(r=>new Dt(r))??[],this.collections=t.collections?.map(r=>new Vs(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 Ys(t.manipulation),this.contentSource=t.contentSource,this.klaviyoFormID=t.klaviyoFormID,this.hasMultiplePlacement=t.hasMultiplePlacement,this.skipSubscribedItems=t.skipSubscribedItems,t.progressBarConfig&&(this.progressBarConfig=new aa(t.progressBarConfig)),t.bundleConfig&&(this.bundleConfig=new ca(t.bundleConfig)),t.bundleFrom&&(this.bundleFrom=new Dt(t.bundleFrom))}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===bt.EngagementObjective.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===bt.OnsiteDeliveryType.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===bt.OnsiteDeliveryType.PAGE_EMBED}isProgressBar(){return this.objective===bt.EngagementObjective.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===bt.EngagementObjective.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===bt.EngagementObjective.CART_RECOVERY}isProductPromotion(){return this.objective===bt.EngagementObjective.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isBYOB(){return this.objective===bt.EngagementObjective.BYOB}isShoppableVideo(){return this.objective===bt.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:te.formatCurrency(u.price.d),comparePrice:te.formatCurrency(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:de.getCurrent().item_count},c=vt.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 Xs(JSON.parse(c))}calculateDiscountData(t,r){let n=wu.ArrayUtils.sum(t,s=>s.selectedOrFirstVariant.value.price.d),i={actualPrice:n,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!t?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(Jr.DiscountType.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(t,i.discountPercentage,!0),i.discountAmount=i.actualPrice-wu.ArrayUtils.sum(t,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([Jr.DiscountType.UNIQUE_FLAT_ITEMS,Jr.DiscountType.STATIC].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(t,i.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(t,i.discountPercentage);else if(this.discount.type===Jr.DiscountType.UNIQUE_CHEAPEST_ITEM_FREE){t.sort((o,c)=>c.selectedOrFirstVariant.value.price.d-o.selectedOrFirstVariant.value.price.d);let s=t[t.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return Le.get().skipItemAttribute?{}:{[N.VIA]:"Cooee",[N.CAMPAIGN_ATTRIBUTE]:this.shortID,[N.CONTENT_ATTRIBUTE]:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Le.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=>Nh.SWIPER_ELEMENTS.has(n.t));if(!t)return!1;if(t.t===62)return!0;let r=Lt.get().isMobile()?"sm":"lg";return t.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}getCartMagicVariables(){let t=de.getCurrent();return{productCount:t.item_count,amount:te.formatCurrency(t.total_price/100),originalAmount:te.formatCurrency(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:te.formatNumber(t.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice"].map(n=>{r[n]=te.formatCurrency(t[n])}),r}};function D_(e,t){return t={exports:{}},e(t,t.exports),t.exports}var R_=P_,A_=B_,N_=M_,Ir=[],qt=[],O_=typeof Uint8Array<"u"?Uint8Array:Array,Iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bn=0,Km=Iu.length;bn<Km;++bn)Ir[bn]=Iu[bn],qt[Iu.charCodeAt(bn)]=bn;var bn,Km;qt[45]=62;qt[95]=63;function pd(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 P_(e){var t=pd(e),r=t[0],n=t[1];return(r+n)*3/4-n}function L_(e,t,r){return(t+r)*3/4-r}function B_(e){var t,r=pd(e),n=r[0],i=r[1],s=new O_(L_(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 U_(e){return Ir[e>>18&63]+Ir[e>>12&63]+Ir[e>>6&63]+Ir[e&63]}function k_(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(U_(n));return i.join("")}function M_(e){for(var t,r=e.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(k_(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 Tu={byteLength:R_,toByteArray:A_,fromByteArray:N_},F_=function(e,t,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,d=u>>1,m=-7,h=r?i-1:0,y=r?-1:1,E=e[t+h];for(h+=y,s=E&(1<<-m)-1,E>>=-m,m+=c;m>0;s=s*256+e[t+h],h+=y,m-=8);for(o=s&(1<<-m)-1,s>>=-m,m+=n;m>0;o=o*256+e[t+h],h+=y,m-=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)},H_=function(e,t,r,n,i,s){var o,c,u,d=s*8-i-1,m=(1<<d)-1,h=m>>1,y=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=m):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=y/u:t+=y*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=m?(c=0,o=m):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},wi={read:F_,write:H_},pa=D_(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,f){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(a)}return c(a,l,f)}o.poolSize=8192;function c(a,l,f){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(gt(a,ArrayBuffer)||a&>(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gt(a,SharedArrayBuffer)||a&>(a.buffer,SharedArrayBuffer)))return v(a,l,f);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,f);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,f);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,f){return c(a,l,f)},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,f){return u(a),a<=0?s(a):l!==void 0?typeof f=="string"?s(a).fill(l,f):s(a).fill(l):s(a)}o.alloc=function(a,l,f){return d(a,l,f)};function m(a){return u(a),s(a<0?0:D(a)|0)}o.allocUnsafe=function(a){return m(a)},o.allocUnsafeSlow=function(a){return m(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var f=M(a,l)|0,T=s(f),A=T.write(a,l);return A!==f&&(T=T.slice(0,A)),T}function y(a){for(var l=a.length<0?0:D(a.length)|0,f=s(l),T=0;T<l;T+=1)f[T]=a[T]&255;return f}function E(a){if(gt(a,Uint8Array)){var l=new Uint8Array(a);return v(l.buffer,l.byteOffset,l.byteLength)}return y(a)}function v(a,l,f){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');var T;return l===void 0&&f===void 0?T=new Uint8Array(a):f===void 0?T=new Uint8Array(a,l):T=new Uint8Array(a,l,f),Object.setPrototypeOf(T,o.prototype),T}function _(a){if(o.isBuffer(a)){var l=D(a.length)|0,f=s(l);return f.length===0||a.copy(f,0,0,l),f}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):y(a);if(a.type==="Buffer"&&Array.isArray(a.data))return y(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(gt(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),gt(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 f=a.length,T=l.length,A=0,U=Math.min(f,T);A<U;++A)if(a[A]!==l[A]){f=a[A],T=l[A];break}return f<T?-1:T<f?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 f;if(l===void 0)for(l=0,f=0;f<a.length;++f)l+=a[f].length;var T=o.allocUnsafe(l),A=0;for(f=0;f<a.length;++f){var U=a[f];if(gt(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)||gt(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 f=a.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&f===0)return 0;for(var A=!1;;)switch(l){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return rn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Wn(a).length;default:if(A)return T?-1:rn(a).length;l=(""+l).toLowerCase(),A=!0}}o.byteLength=M;function L(a,l,f){var T=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return ht(this,l,f);case"utf8":case"utf-8":return $e(this,l,f);case"ascii":return Ge(this,l,f);case"latin1":case"binary":return ve(this,l,f);case"base64":return ge(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,l,f);default:if(T)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function k(a,l,f){var T=a[l];a[l]=a[f],a[f]=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?$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,f,T,A){if(gt(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),f===void 0&&(f=a?a.length:0),T===void 0&&(T=0),A===void 0&&(A=this.length),l<0||f>a.length||T<0||A>this.length)throw new RangeError("out of range index");if(T>=A&&l>=f)return 0;if(T>=A)return-1;if(l>=f)return 1;if(l>>>=0,f>>>=0,T>>>=0,A>>>=0,this===a)return 0;for(var U=A-T,q=f-l,Ie=Math.min(U,q),me=this.slice(T,A),ye=a.slice(l,f),je=0;je<Ie;++je)if(me[je]!==ye[je]){U=me[je],q=ye[je];break}return U<q?-1:q<U?1:0};function W(a,l,f,T,A){if(a.length===0)return-1;if(typeof f=="string"?(T=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,$r(f)&&(f=A?0:a.length-1),f<0&&(f=a.length+f),f>=a.length){if(A)return-1;f=a.length-1}else if(f<0)if(A)f=0;else return-1;if(typeof l=="string"&&(l=o.from(l,T)),o.isBuffer(l))return l.length===0?-1:ue(a,l,f,T,A);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(a,l,f):Uint8Array.prototype.lastIndexOf.call(a,l,f):ue(a,[l],f,T,A);throw new TypeError("val must be string, number or Buffer")}function ue(a,l,f,T,A){var U=1,q=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,q/=2,Ie/=2,f/=2}function me(Z,Ce){return U===1?Z[Ce]:Z.readUInt16BE(Ce*U)}var ye;if(A){var je=-1;for(ye=f;ye<q;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(f+Ie>q&&(f=q-Ie),ye=f;ye>=0;ye--){for(var G=!0,ae=0;ae<Ie;ae++)if(me(a,ye+ae)!==me(l,ae)){G=!1;break}if(G)return ye}return-1}o.prototype.includes=function(a,l,f){return this.indexOf(a,l,f)!==-1},o.prototype.indexOf=function(a,l,f){return W(this,a,l,f,!0)},o.prototype.lastIndexOf=function(a,l,f){return W(this,a,l,f,!1)};function Me(a,l,f,T){f=Number(f)||0;var A=a.length-f;T?(T=Number(T),T>A&&(T=A)):T=A;var U=l.length;T>U/2&&(T=U/2);for(var q=0;q<T;++q){var Ie=parseInt(l.substr(q*2,2),16);if($r(Ie))return q;a[f+q]=Ie}return q}function B(a,l,f,T){return Mn(rn(l,a.length-f),a,f,T)}function Q(a,l,f,T){return Mn(Zn(l),a,f,T)}function z(a,l,f,T){return Mn(Wn(l),a,f,T)}function X(a,l,f,T){return Mn(Vi(l,a.length-f),a,f,T)}o.prototype.write=function(a,l,f,T){if(l===void 0)T="utf8",f=this.length,l=0;else if(f===void 0&&typeof l=="string")T=l,f=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(f)?(f=f>>>0,T===void 0&&(T="utf8")):(T=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var A=this.length-l;if((f===void 0||f>A)&&(f=A),a.length>0&&(f<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 Me(this,a,l,f);case"utf8":case"utf-8":return B(this,a,l,f);case"ascii":case"latin1":case"binary":return Q(this,a,l,f);case"base64":return z(this,a,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,a,l,f);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,f){return l===0&&f===a.length?Tu.fromByteArray(a):Tu.fromByteArray(a.slice(l,f))}function $e(a,l,f){f=Math.min(a.length,f);for(var T=[],A=l;A<f;){var U=a[A],q=null,Ie=U>239?4:U>223?3:U>191?2:1;if(A+Ie<=f){var me,ye,je,G;switch(Ie){case 1:U<128&&(q=U);break;case 2:me=a[A+1],(me&192)===128&&(G=(U&31)<<6|me&63,G>127&&(q=G));break;case 3:me=a[A+1],ye=a[A+2],(me&192)===128&&(ye&192)===128&&(G=(U&15)<<12|(me&63)<<6|ye&63,G>2047&&(G<55296||G>57343)&&(q=G));break;case 4:me=a[A+1],ye=a[A+2],je=a[A+3],(me&192)===128&&(ye&192)===128&&(je&192)===128&&(G=(U&15)<<18|(me&63)<<12|(ye&63)<<6|je&63,G>65535&&G<1114112&&(q=G))}}q===null?(q=65533,Ie=1):q>65535&&(q-=65536,T.push(q>>>10&1023|55296),q=56320|q&1023),T.push(q),A+=Ie}return p(T)}var xe=4096;function p(a){var l=a.length;if(l<=xe)return String.fromCharCode.apply(String,a);for(var f="",T=0;T<l;)f+=String.fromCharCode.apply(String,a.slice(T,T+=xe));return f}function Ge(a,l,f){var T="";f=Math.min(a.length,f);for(var A=l;A<f;++A)T+=String.fromCharCode(a[A]&127);return T}function ve(a,l,f){var T="";f=Math.min(a.length,f);for(var A=l;A<f;++A)T+=String.fromCharCode(a[A]);return T}function ht(a,l,f){var T=a.length;(!l||l<0)&&(l=0),(!f||f<0||f>T)&&(f=T);for(var A="",U=l;U<f;++U)A+=Wi[a[U]];return A}function se(a,l,f){for(var T=a.slice(l,f),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 f=this.length;a=~~a,l=l===void 0?f:~~l,a<0?(a+=f,a<0&&(a=0)):a>f&&(a=f),l<0?(l+=f,l<0&&(l=0)):l>f&&(l=f),l<a&&(l=a);var T=this.subarray(a,l);return Object.setPrototypeOf(T,o.prototype),T};function ie(a,l,f){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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,f){a=a>>>0,l=l>>>0,f||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 f=this[a]|this[a+1]<<8;return f&32768?f|4294901760:f},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||ie(a,2,this.length);var f=this[a+1]|this[a]<<8;return f&32768?f|4294901760:f},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),wi.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||ie(a,4,this.length),wi.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),wi.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||ie(a,8,this.length),wi.read(this,a,!1,52,8)};function lt(a,l,f,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(f+T>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,f,T){if(a=+a,l=l>>>0,f=f>>>0,!T){var A=Math.pow(2,8*f)-1;lt(this,a,l,f,A,0)}var U=1,q=0;for(this[l]=a&255;++q<f&&(U*=256);)this[l+q]=a/U&255;return l+f},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,f,T){if(a=+a,l=l>>>0,f=f>>>0,!T){var A=Math.pow(2,8*f)-1;lt(this,a,l,f,A,0)}var U=f-1,q=1;for(this[l+U]=a&255;--U>=0&&(q*=256);)this[l+U]=a/q&255;return l+f},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*f-1);lt(this,a,l,f,A-1,-A)}var U=0,q=1,Ie=0;for(this[l]=a&255;++U<f&&(q*=256);)a<0&&Ie===0&&this[l+U-1]!==0&&(Ie=1),this[l+U]=(a/q>>0)-Ie&255;return l+f},o.prototype.writeIntBE=function(a,l,f,T){if(a=+a,l=l>>>0,!T){var A=Math.pow(2,8*f-1);lt(this,a,l,f,A-1,-A)}var U=f-1,q=1,Ie=0;for(this[l+U]=a&255;--U>=0&&(q*=256);)a<0&&Ie===0&&this[l+U+1]!==0&&(Ie=1),this[l+U]=(a/q>>0)-Ie&255;return l+f},o.prototype.writeInt8=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,f){return a=+a,l=l>>>0,f||lt(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,f){return a=+a,l=l>>>0,f||lt(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,f){return a=+a,l=l>>>0,f||lt(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,f,T,A,U){if(f+T>a.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function lr(a,l,f,T,A){return l=+l,f=f>>>0,A||tr(a,l,f,4),wi.write(a,l,f,T,23,4),f+4}o.prototype.writeFloatLE=function(a,l,f){return lr(this,a,l,!0,f)},o.prototype.writeFloatBE=function(a,l,f){return lr(this,a,l,!1,f)};function dt(a,l,f,T,A){return l=+l,f=f>>>0,A||tr(a,l,f,8),wi.write(a,l,f,T,52,8),f+8}o.prototype.writeDoubleLE=function(a,l,f){return dt(this,a,l,!0,f)},o.prototype.writeDoubleBE=function(a,l,f){return dt(this,a,l,!1,f)},o.prototype.copy=function(a,l,f,T){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(f||(f=0),!T&&T!==0&&(T=this.length),l>=a.length&&(l=a.length),l||(l=0),T>0&&T<f&&(T=f),T===f||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=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-f&&(T=a.length-l+f);var A=T-f;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,f,T):Uint8Array.prototype.set.call(a,this.subarray(f,T),l),A},o.prototype.fill=function(a,l,f,T){if(typeof a=="string"){if(typeof l=="string"?(T=l,l=0,f=this.length):typeof f=="string"&&(T=f,f=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<f)throw new RangeError("Out of range index");if(f<=l)return this;l=l>>>0,f=f===void 0?this.length:f>>>0,a||(a=0);var U;if(typeof a=="number")for(U=l;U<f;++U)this[U]=a;else{var q=o.isBuffer(a)?a:o.from(a,T),Ie=q.length;if(Ie===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(U=0;U<f-l;++U)this[U+l]=q[U%Ie]}return this};var Hr=/[^+/0-9A-Za-z-_]/g;function Hn(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 rn(a,l){l=l||1/0;for(var f,T=a.length,A=null,U=[],q=0;q<T;++q){if(f=a.charCodeAt(q),f>55295&&f<57344){if(!A){if(f>56319){(l-=3)>-1&&U.push(239,191,189);continue}else if(q+1===T){(l-=3)>-1&&U.push(239,191,189);continue}A=f;continue}if(f<56320){(l-=3)>-1&&U.push(239,191,189),A=f;continue}f=(A-55296<<10|f-56320)+65536}else A&&(l-=3)>-1&&U.push(239,191,189);if(A=null,f<128){if((l-=1)<0)break;U.push(f)}else if(f<2048){if((l-=2)<0)break;U.push(f>>6|192,f&63|128)}else if(f<65536){if((l-=3)<0)break;U.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((l-=4)<0)break;U.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return U}function Zn(a){for(var l=[],f=0;f<a.length;++f)l.push(a.charCodeAt(f)&255);return l}function Vi(a,l){for(var f,T,A,U=[],q=0;q<a.length&&!((l-=2)<0);++q)f=a.charCodeAt(q),T=f>>8,A=f%256,U.push(A),U.push(T);return U}function Wn(a){return Tu.toByteArray(Hn(a))}function Mn(a,l,f,T){for(var A=0;A<T&&!(A+f>=l.length||A>=a.length);++A)l[A+f]=a[A];return A}function gt(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 Wi=function(){for(var a="0123456789abcdef",l=new Array(256),f=0;f<16;++f)for(var T=f*16,A=0;A<16;++A)l[T+A]=a[f]+a[A];return l}()}),we=pa.Buffer;pa.SlowBuffer;pa.INSPECT_MAX_BYTES;pa.kMaxLength;var Au=function(e,t){return Au=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])},Au(e,t)};function fa(e,t){Au(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Tn=function(e){fa(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),We=function(e){fa(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 la(e){return e&&e.Math==Math&&e}function fd(){return la(typeof globalThis=="object"&&globalThis)||la(typeof window=="object"&&window)||la(typeof self=="object"&&self)||la(typeof global=="object"&&global)||Function("return this")()}function $_(){var e=fd();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var j_=function(e){var t=$_()?"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=we.alloc(e),n=0;n<e;++n)r[n]=Math.floor(Math.random()*256);return r},W_=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(we.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(we.alloc(t))}:j_}},md=W_();function G_(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ou(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function V_(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Y_(e){return wo(e)&&Object.prototype.toString.call(e)==="[object Date]"}function wo(e){return typeof e=="object"&&e!==null}function ma(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 ua(e){if(ArrayBuffer.isView(e))return we.from(e.buffer,e.byteOffset,e.byteLength);if(G_(e))return we.from(e);throw new We("Must use either Buffer or TypedArray")}var z_=/^(?:[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,dd=function(e){return typeof e=="string"&&z_.test(e)},Nu=function(e){if(!dd(e))throw new We('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 we.from(t,"hex")},Jm=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")},BO=Math.pow(2,63)-1,UO=-Math.pow(2,63),q_=Math.pow(2,53),K_=-Math.pow(2,53),hd=4,Cn=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 We("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=we.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=we.from(t,"binary"):Array.isArray(t)?this.buffer=we.from(t):this.buffer=ua(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new We("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new We("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 We("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=we.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=we.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(ua(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 Xm(this.buffer.slice(0,this.position));throw new Tn('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=we.from(t.$binary,"base64")):typeof t.$binary!="string"&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=we.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=Nu(t.$uuid)),!n)throw new We("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===hd?new Xm(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(Cn.prototype,"_bsontype",{value:"Binary"});var Cu=16,Xm=function(e){fa(t,e);function t(r){var n=this,i,s;if(r==null)i=t.generate();else if(r instanceof t)i=we.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===Cu)i=ua(r);else if(typeof r=="string")i=Nu(r);else throw new We("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,hd)||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=Jm(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=Jm(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 Cn(this.id,Cn.SUBTYPE_UUID)},t.generate=function(){var r=md(Cu);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,we.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?dd(r):Ou(r)?r.length!==Cu?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var n=Nu(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}(Cn),da=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(da.prototype,"_bsontype",{value:"Code"});function J_(e){return wo(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Eo=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(Eo.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 Qm=65536,X_=1<<24,Ii=Qm*Qm,gd=Ii*Ii,Zm=gd/2,ed={},td={},J=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=td[t],i)?i:(n=e.fromBits(t,(t|0)<0?-1:0,!0),s&&(td[t]=n),n)):(t|=0,(s=-128<=t&&t<128)&&(i=ed[t],i)?i:(n=e.fromBits(t,t<0?-1:0,!1),s&&(ed[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>=gd)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Zm)return e.MIN_VALUE;if(t+1>=Zm)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Ii|0,t/Ii|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 m=e.fromNumber(Math.pow(n,u));o=o.mul(m).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 wo(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,m=0,h=0,y=0,E=0;return E+=s+d,y+=E>>>16,E&=65535,y+=i+u,h+=y>>>16,y&=65535,h+=n+c,m+=h>>>16,h&=65535,m+=r+o,m&=65535,e.fromBits(y<<16|E,m<<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),m=d.mul(t);m.isNegative()||m.gt(i);)n-=u,d=e.fromNumber(n,this.unsigned),m=d.mul(t);d.isZero()&&(d=e.ONE),s=s.add(d),i=i.sub(m)}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,m=t.low&65535,h=0,y=0,E=0,v=0;return v+=o*m,E+=v>>>16,v&=65535,E+=s*m,y+=E>>>16,E&=65535,E+=o*d,y+=E>>>16,E&=65535,y+=i*m,h+=y>>>16,y&=65535,y+=s*d,h+=y>>>16,y&=65535,y+=o*u,h+=y>>>16,y&=65535,h+=n*m+i*d+s*u+o*c,h&=65535,e.fromBits(E<<16|v,h<<16|y,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)*Ii+(this.low>>>0):this.high*Ii+(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,m=d.toString(t);if(o=u,o.isZero())return m+c;for(;m.length<6;)m="0"+m;c=""+m+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(X_),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(J.prototype,"__isLong__",{value:!0});Object.defineProperty(J.prototype,"_bsontype",{value:"Long"});var Q_=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Z_=/^(\+|-)?(Infinity|inf)$/i,eE=/^(\+|-)?NaN$/i,_o=6111,xu=-6176,rd=6176,tE=34,Du=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),nd=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),id=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),rE=/^([-+])?(\d+)?$/,nE=31,od=16383,iE=30,oE=31;function sd(e){return!isNaN(parseInt(e,10))}function sE(e){var t=J.fromNumber(1e9),r=J.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 J(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function aE(e,t){if(!e&&!t)return{high:J.fromNumber(0),low:J.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new J(e.getLowBits(),0),i=t.shiftRightUnsigned(32),s=new J(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 J(c.getLowBits(),0).add(u).add(d.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),d=c.shiftLeft(32).add(new J(d.getLowBits(),0)),{high:o,low:d}}function cE(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 bi(e,t){throw new We('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Pu=function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ou(t)){if(t.byteLength!==16)throw new We("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new We("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,m=[0],h=0,y=0,E=0,v=0,_=0,D=0,P=new J(0,0),M=new J(0,0),L=0,k=0;if(t.length>=7e3)throw new We(""+t+" not a valid Decimal128 string");var W=t.match(Q_),ue=t.match(Z_),Me=t.match(eE);if(!W&&!ue&&!Me||t.length===0)throw new We(""+t+" not a valid Decimal128 string");if(W){var B=W[2],Q=W[4],z=W[5],X=W[6];Q&&X===void 0&&bi(t,"missing exponent power"),Q&&B===void 0&&bi(t,"missing exponent base"),Q===void 0&&(z||X)&&bi(t,"missing e before exponent")}if((t[k]==="+"||t[k]==="-")&&(r=t[k++]==="-"),!sd(t[k])&&t[k]!=="."){if(t[k]==="i"||t[k]==="I")return new e(we.from(r?nd:id));if(t[k]==="N")return new e(we.from(Du))}for(;sd(t[k])||t[k]===".";){if(t[k]==="."){n&&bi(t,"contains multiple periods"),n=!0,k=k+1;continue}h<34&&(t[k]!=="0"||i)&&(i||(d=o),i=!0,m[y++]=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 We(""+t+" not a valid Decimal128 string");if(t[k]==="e"||t[k]==="E"){var ge=t.substr(++k).match(rE);if(!ge||!ge[2])return new e(we.from(Du));_=parseInt(ge[0],10),k=k+ge[0].length}if(t[k])return new e(we.from(Du));if(E=0,!h)E=0,v=0,m[0]=0,c=1,h=1,s=0;else if(v=h-1,s=c,s!==1)for(;m[d+s-1]===0;)s=s-1;for(_<=u&&u-_>16384?_=xu:_=_-u;_>_o;){if(v=v+1,v-E>tE){var $e=m.join("");if($e.match(/^0+$/)){_=_o;break}bi(t,"overflow")}_=_-1}for(;_<xu||h<c;){if(v===0&&s<h){_=xu,s=0;break}if(h<c?c=c-1:v=v-1,_<_o)_=_+1;else{var $e=m.join("");if($e.match(/^0+$/)){_=_o;break}bi(t,"overflow")}}if(v-E+1<s){var xe=o;n&&(d=d+1,xe=xe+1),r&&(d=d+1,xe=xe+1);var p=parseInt(t[d+v+1],10),Ge=0;if(p>=5&&(Ge=1,p===5)){for(Ge=m[v]%2===1?1:0,D=d+v+2;D<xe;D++)if(parseInt(t[D],10)){Ge=1;break}}if(Ge){for(var ve=v;ve>=0;ve--)if(++m[ve]>9&&(m[ve]=0,ve===0))if(_<_o)_=_+1,m[ve]=1;else return new e(we.from(r?nd:id))}}if(P=J.fromNumber(0),M=J.fromNumber(0),s===0)P=J.fromNumber(0),M=J.fromNumber(0);else if(v-E<17){var ve=E;for(M=J.fromNumber(m[ve++]),P=new J(0,0);ve<=v;ve++)M=M.multiply(J.fromNumber(10)),M=M.add(J.fromNumber(m[ve]))}else{var ve=E;for(P=J.fromNumber(m[ve++]);ve<=v-17;ve++)P=P.multiply(J.fromNumber(10)),P=P.add(J.fromNumber(m[ve]));for(M=J.fromNumber(m[ve++]);ve<=v;ve++)M=M.multiply(J.fromNumber(10)),M=M.add(J.fromNumber(m[ve]))}var ht=aE(P,J.fromString("100000000000000000"));ht.low=ht.low.add(M),cE(ht.low,M)&&(ht.high=ht.high.add(J.fromNumber(1))),L=_+rd;var se={low:J.fromNumber(0),high:J.fromNumber(0)};ht.high.shiftRightUnsigned(49).and(J.fromNumber(1)).equals(J.fromNumber(1))?(se.high=se.high.or(J.fromNumber(3).shiftLeft(61)),se.high=se.high.or(J.fromNumber(L).and(J.fromNumber(16383).shiftLeft(47))),se.high=se.high.or(ht.high.and(J.fromNumber(0x7fffffffffff)))):(se.high=se.high.or(J.fromNumber(L&16383).shiftLeft(49)),se.high=se.high.or(ht.high.and(J.fromNumber(562949953421311)))),se.low=ht.low,r&&(se.high=se.high.or(J.fromString("9223372036854775808")));var ie=we.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,m,h=[];s=0;var y=this.bytes,E=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,v=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,_=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24,D=y[s++]|y[s++]<<8|y[s++]<<16|y[s++]<<24;s=0;var P={low:new J(E,v),high:new J(_,D)};P.high.lessThan(J.ZERO)&&h.push("-");var M=D>>26&nE;if(M>>3===3){if(M===iE)return h.join("")+"Infinity";if(M===oE)return"NaN";t=D>>15&od,c=8+(D>>14&1)}else c=D>>14&7,t=D>>17&od;var L=t-rd;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(m=3;m>=0;m--){var k=0,W=sE(u);if(u=W.quotient,k=W.rem.low,!!k)for(d=8;d>=0;d--)n[m*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 Me=r+L;if(Me>0)for(var i=0;i<Me;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");Me++<0;)h.push("0");for(var i=0;i<r-Math.max(Me-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(Pu.prototype,"_bsontype",{value:"Decimal128"});var ha=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(ha.prototype,"_bsontype",{value:"Double"});var ga=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(ga.prototype,"_bsontype",{value:"Int32"});var Lu=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(Lu.prototype,"_bsontype",{value:"MaxKey"});var Bu=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(Bu.prototype,"_bsontype",{value:"MinKey"});var lE=new RegExp("^[0-9a-fA-F]{24}$"),In=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 We("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=we.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 we?r:ua(r);else if(typeof r=="string")if(r.length===12){var n=we.from(r);if(n.byteLength===12)this[br]=n;else throw new We("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&lE.test(r))this[br]=we.from(r,"hex");else throw new We("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new We("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=we.alloc(12);return n.writeUInt32BE(t,0),In===null&&(In=md(5)),n[4]=In[0],n[5]=In[1],n[6]=In[2],n[7]=In[3],n[8]=In[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&&Ou(this.id))return t===we.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 we.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=we.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 We("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(we.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:ma(function(e){return et.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(et.prototype,"getInc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"get_inc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et,"get_inc",{value:ma(function(){return et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(et.prototype,"_bsontype",{value:"ObjectID"});function uE(e){return e.split("").sort().join("")}var So=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=uE(r??""),this.pattern.indexOf("\0")!==-1)throw new Tn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new Tn("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 Tn("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 We("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(So.prototype,"_bsontype",{value:"BSONRegExp"});var Uu=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(Uu.prototype,"_bsontype",{value:"Symbol"});var pE=J,yd=function(e){fa(t,e);function t(r,n){var i=this;return i instanceof t?(J.isLong(r)?i=e.call(this,r.low,r.high,!0)||this:wo(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(J.fromInt(r,!0))},t.fromNumber=function(r){return new t(J.fromNumber(r,!0))},t.fromBits=function(r,n){return new t(r,n)},t.fromString=function(r,n){return new t(J.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=J.MAX_UNSIGNED_VALUE,t}(pE);function fE(e){return wo(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var vd=2147483647,_d=-2147483648,Ed=9223372036854776e3,Sd=-9223372036854776e3,mE={$oid:et,$binary:Cn,$uuid:Cn,$symbol:Uu,$numberInt:ga,$numberDecimal:Pu,$numberDouble:ha,$numberLong:J,$minKey:Bu,$maxKey:Lu,$regex:So,$regularExpression:So,$timestamp:yd};function wd(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=_d&&e<=vd)return new ga(e);if(e>=Sd&&e<=Ed)return J.fromNumber(e)}return new ha(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=mE[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)):J.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=wd(e.$scope)),da.fromExtendedJSON(e)}if(J_(e)||e.$dbPointer){var u=e.$ref?e:e.$dbPointer;if(u instanceof Eo)return u;var d=Object.keys(u).filter(function(h){return h.startsWith("$")}),m=!0;if(d.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(m=!1)}),m)return Eo.fromExtendedJSON(u)}return e}function dE(e,t){return e.map(function(r,n){t.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Xr(r,t)}finally{t.seenObjects.pop()}})}function ad(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Xr(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 We(`Converting circular structure to EJSON:
|
|
35
35
|
`+" ".concat(i).concat(s).concat(o).concat(c,`
|
|
36
36
|
`)+" ".concat(u,"\\").concat(d,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return dE(e,t);if(e===void 0)return null;if(e instanceof Date||Y_(e)){var m=e.getTime(),h=m>-1&&m<2534023188e5;return t.legacy?t.relaxed&&h?{$date:e.getTime()}:{$date:ad(e)}:t.relaxed&&h?{$date:ad(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var y=e>=_d&&e<=vd,E=e>=Sd&&e<=Ed;if(y)return{$numberInt:e.toString()};if(E)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||V_(e)){var v=e.flags;if(v===void 0){var _=e.toString().match(/[gimuy]*$/);_&&(v=_[0])}var D=new So(e.source,v);return D.toExtendedJSON(t)}return e!=null&&typeof e=="object"?gE(e,t):e}var hE={Binary:function(e){return new Cn(e.value(),e.sub_type)},Code:function(e){return new da(e.code,e.scope)},DBRef:function(e){return new Eo(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Pu(e.bytes)},Double:function(e){return new ha(e.value)},Int32:function(e){return new ga(e.value)},Long:function(e){return J.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 Lu},MinKey:function(){return new Bu},ObjectID:function(e){return new et(e)},ObjectId:function(e){return new et(e)},BSONRegExp:function(e){return new So(e.pattern,e.options)},Symbol:function(e){return new Uu(e.value)},Timestamp:function(e){return yd.fromBits(e.low,e.high)}};function gE(e,t){if(e==null||typeof e!="object")throw new Tn("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=Xr(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(fE(e)){var o=e;if(typeof o.toExtendedJSON!="function"){var c=hE[e._bsontype];if(!c)throw new We("Unrecognized or invalid _bsontype: "+e._bsontype);o=c(o)}return r==="Code"&&o.scope?o=new da(o.code,Xr(o.scope,t)):r==="DBRef"&&o.oid&&(o=new Eo(Xr(o.collection,t),Xr(o.oid,t),Xr(o.db,t),Xr(o.fields,t))),o.toExtendedJSON(t)}else throw new Tn("_bsontype must be a string, but was: "+typeof r)}var cd;(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 Tn("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(u)));return wd(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}]}),m=Xr(s,d);return JSON.stringify(m,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})(cd||(cd={}));var ld,ud=fd();ud.Map?ld=ud.Map:ld=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 kO=J.fromNumber(q_),MO=J.fromNumber(K_),Ru=new Uint8Array(8),FO=new DataView(Ru.buffer,Ru.byteOffset,Ru.byteLength),yE=1024*1024*17,HO=we.alloc(yE),Ti=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}},_e=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 Ti(r)),this.newEvent=!n}trigger;items;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale},Rt=class{static injectScriptURL(e,t){if(!e)return;let r=document.createElement("script");r.id=t??"",r.src=e,r.defer=!0,e.includes("localhost")&&(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 injectStylesheet(e,t=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e==="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.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)}},pe=class{static storage=new Map;static get(e){return this.storage.has(e)||this.storage.set(e,e.getInstance()),this.storage.get(e)}},bd=Se(ku()),bo=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 bd.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)}),w(w({},r),t)}},Tr=class xh{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 xh(w({origin:location.origin,path:t,qs:location.search,referrer:bo.getReferrer(),name:le.get().pageName},bo.getUTMParams()))}};function ce(e){return typeof e=="function"}function va(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 Ea=va(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(`
|
|
@@ -67,4 +67,4 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
|
67
67
|
<span class="${n}"
|
|
68
68
|
style="background-color: ${t.pagination.color?.rgba};">
|
|
69
69
|
</span>
|
|
70
|
-
`},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},autoplay:t.autoplay?.enabled?{delay:t.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return e.style.setProperty("--swiper-navigation-size",`${t.navigation.size}px`),r}function ac(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 Ho=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&&oc().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(w({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:ac(this.configuration,r,n)})}else t=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((r,n)=>this.getProductFragment(r,n!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(t.flexDirection==="row"){if(e)t.maxWidth="100%",t.overflowY="auto";else if(this.configuration.disp===1){let r=this.props.triggerContext.triggerData,n=r.items.length,i;r.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?n*2-1:n:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`}}return t}getProductFragment(e,t=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}},$o=class extends Ae{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){oc().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:()=>this.onClick({clickAction:this.getClickAction(n)}),children:this.renderElement(n)}));return ac(e.conf,t,r)}getComponentStyles(){return{}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return $(Mr,{element:t,triggerContext:this.props.triggerContext});case 4:return $(Fr,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:b.warn("Unknown slide type for carousal")}}valueAddedSlide(e,t){let r=JSON.stringify(e),n=vt.render(r,{form:t});return kt.getParsedElement(JSON.parse(n))}getClickAction(e){let t=w({},this.props.element.clc),r=JSON.stringify(t),n=vt.render(r,{form:e});return JSON.parse(n)}},tn=class extends Ae{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),at(()=>{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 $(Lo,{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 $(Mr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(Ho,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $($o,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},jo=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(){at(()=>{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:()=>{this.onClick({clickAction:this.clickAction})},children:$(tn,{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){if(this.isClickable)return super.onClick(e)}},At=class Zi{constructor(t){this.engagementTrigger=t,this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=le.get();widgetAPIService=pe.get(cr);safeHTTPService=pe.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(t=>Be.getInstance().captureException(t,w({},this.engagementTrigger.sentryContext())))}destroy(){b.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(t=>{t?.disconnect&&t.disconnect()}),this.rootContainer?.remove(),Zi.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){b.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(t){return this.engagementTrigger.shortID===t.shortID}update(t){mh.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(t.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){b.log(`${this.engagementTrigger} already has required data to render widget`);return}let t=await this.observeWidgetContainerInViewport();this.handleVariationResponse(t)}handleVariationResponse(t){t&&(b.log(`${this.engagementTrigger} visitor has been assigned to variation ${t.variation}`),t.items?.length&&(this.engagementTrigger.items=t.items.map(r=>new Dt(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new Dt(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new Dt(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=w(w({},this.engagementTrigger.props),t.props)),this.triggerContext.triggerData.widget=this.widget=new Si(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.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){Zi.renderedEngagements.push(this)}async getVariation(){b.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){b.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){b.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let t=window.innerHeight*.3,r={root:null,rootMargin:`-${t}px 0px ${t}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((s,o)=>{s.forEach(async c=>{if(c.isIntersecting){b.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=On(window,"scroll").pipe(ar(Zi.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(Zi.engagementIDsWithTrackedDisplay.has(t)||!await this.isInViewport())return;let r={};this.triggerContext.triggerData.items?.length&&(r.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,i=new _e(n,r,this.engagementTrigger);i.name===N.EVENT_CAMPAIGN_HOLDOUT&&(i.trigger.holdout=!0),this.safeHTTPService.sendEvent(i),Zi.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let t=(await this.getWidgetContainer())?.getBoundingClientRect();if(!t)return!1;let r=window.innerHeight||document.documentElement.clientHeight,n=(Math.min(t.bottom,r)-Math.max(t.top,0))*t.width,i=t.width*t.height,s=n/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(t){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(t);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(t){let r=this.engagementTrigger.placement;if(!r?.selector)return b.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);i=(await te.retrySelector(u[0].trim()))?.shadowRoot,n=u[1].trim(),i&&Rt.injectStylesheet(Ct.styleURL,i);let d=Le.get().website.commonCSS;i&&d&&Rt.injectRawCSS(d,i)}b.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let s=await te.retrySelector(n,10,i??document);if(!s)return b.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 Wo.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Wo.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Wo.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Wo.EngagementPlacementPosition.AFTER:default:s.parentElement?.insertBefore(c,s.nextSibling)}return c}async startRendering(){let t;try{t=await ki.refreshItems(this.engagementTrigger)}catch(r){b.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!t?.length&&this.engagementTrigger.isProductPromoted()){b.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=t,this.renderContainer()}getParentElement(t,r=document){let n=r.getElementById(t);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let t=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let r=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),n=Le.get().website.commonCSS;n&&Rt.injectRawCSS(n,r),Rt.injectStylesheet(Ct.styleURL,r),Rt.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",r),t=r}tf(Mc(jo,{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)ph.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 At{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"){b.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}},cc=class Fh{constructor(t,r){this.engagementTrigger=t,this.element=r,this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(t){let r=t.placement;if(!r?.selector){b.warn(`No placement available for ${t.objective}`,t.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){b.warn(`No placement found for ${t.objective}`,t.shortID);return}for(let i of n)new Fh(t,i).render()}render(){let t=this.findCartItemFromHTMLElement();if(!t||this.engagementTrigger.skipSubscribedItems&&t.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===t.id.toString());if(!n)return;let i=new Sr(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let m of i.sellingPlans??[])m.mID===s.id.toString()&&(m.isSelected=!0,i.changeSellingPlan(m));let o=new Dt(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 Mt(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&&(b.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))})}},dh=Se(Rr()),lc=class extends Dr{ctaListener=new Zr;constructor(e){super(e),xr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Yu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),t=[...this.engagementTrigger.progressBarConfig.milestones].reverse().find(r=>r.minValue<e.amount);if(!t){b.log("No milestone achieved yet");return}if(b.log("Current milestone",t),t.rewardType===dh.MilestoneRewardType.FREE_AUTO_GIFT){let r=t.items[0];if(e.items.find(n=>n.vID===r.vID||n.mID===r.mID)){b.log(`Item(vID:${r.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(r,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});return}else{let n=await this.ctaListener.performAddToCart([r],this.engagementTrigger);ze.get().refreshUI(n,!1),await this.removeOtherFreeGifts(r)}}}async removeOtherFreeGifts(e){let t=(await de.getCurrent().getNormalisedCart()).items.filter(r=>r.vID!==e?.vID&&r.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(t.length)for(let r of t)await this.ctaListener.performUpdate(r,{quantity:0})}},hh=Se(Rr()),uc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.items=this.triggerContext.triggerData.items,e.engagementTrigger=this.engagementTrigger,e.addEventListener("triggerClicked",t=>{let r=t.detail;this.safeHTTPService.sendEvent(r)}),e.addEventListener("performCTA",async t=>{let r={at:hh.ClickActionType.ADD_TO_CART,applyDiscount:!0},n=t.detail;await new en(this.triggerContext).execute({clickAction:r,item:n})}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}},gh=Se(ei()),pc=class extends At{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(!gh.JSUtils.hasKeys(n)){b.error(`No detail received for ${r}`);return}b.log("Detail received for BYOB",n);let i=n.campaignID??n.campaignId??n.campaign_id;if(i!==t.shortID&&i!==t.engagementID){b.warn(`Current ${r} is not BYOB. Received: ${i}`);return}let s=n.items;if(!s?.length)return;let o=s.map(c=>new xt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new en(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},Fi=class{runtimeData=le.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let t=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let r of e)b.log(`\u{1F4E3} ${r} received as cart embed`),!this.findAndUpdateCurrent(r,t)&&(b.log(`${r} is new`),r.isProgressBar()?new lc(r).renderSilently():r.isSubscriptionUpsell()?cc.renderCartUpsell(r):new Dr(r).renderSilently());this.removeOldWidgets(t)}processPageWidgetResponse(e){let t=[...At.renderedEngagements];At.renderedEngagements.length=0;for(let r of e)b.log(`\u{1F4E3} ${r} received as page embed`),!this.findAndUpdateCurrent(r,t)&&(b.log(`${r} is new`),r.isShoppableVideo()?new uc(r).renderSilently():r.isBYOB()?new pc(r).renderSilently():new At(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()}},cr=class Hh{static INSTANCE;httpService=pe.get(mt);sessionManager=pe.get(st);runtimeData=le.get();loadWidgetsSubject=new It;constructor(){this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(t=>b.error("Unable to initiate cart widgets",t)),this.loadPageWidgets().catch(t=>b.error("Unable to initiate page widgets",t))}),xr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Hh),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(t=>b.error("Unable to initiate load page widgets",t))})}loadCartWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(t=>b.error("Unable to initiate cart widgets",t))})}loadWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let t=await this.getWidgetProps();b.log("Load widgets",t),this.httpService.post("/v1/engagement/page-widgets",t).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processPageWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async loadCartWidgets(){let t=await this.getWidgetProps();b.log("Load cart widgets",t),this.httpService.post("/v1/engagement/cart-widgets",t).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processCartWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async getVariation(t){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",w(w({},t),r))}renderCachedCartWidgets(){new Fi().processCartWidgetResponse(this.runtimeData.cartEngagements)}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()}addAvailableEngagementShortIDs(){let t=document.querySelectorAll(".letscooee-engagement"),r=[];return t.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let t={};t.engagementIDs=this.addAvailableEngagementShortIDs(),t.locale=this.runtimeData.locale,await this.addSessionContext(t),t.currentItem=this.runtimeData.getCurrentItem();try{t.cart=await de.getCurrent().getNormalisedCart()}catch(s){b.error("Error fetching Shopify cart before sending widget call",s)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?t.previewIDs=n.trim().split(",").filter(s=>Number.isInteger(+s)):this.runtimeData.previewIDs?.length&&(t.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?t.previewVariant=i:this.runtimeData.previewVariant&&(t.previewVariant=this.runtimeData.previewVariant),t}},fc=class{runtimeData=le.get();widgetAPIService=pe.get(cr);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.previewWidget=be.previewWidget.bind(be),e.previewPopup=be.previewPopup.bind(be)}overwritePush(e,t){li(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&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?be.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):be.sendEvent(e[0],e[1]))}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)}},Hi=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))}},$i=class Yo{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=pe.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Yo),this.INSTANCE}resetScrollID(t){Hi.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)}te.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){On(window,"scroll").pipe(ar(Yo.DEBOUNCE_TIME),Nn(()=>{let t=this.getPercentScrolledY();if(t>100){b.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)>=Yo.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=Hi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new _e(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Hi.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)}},mc=class Vh{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=pe.get(fe);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){b.info("Not sending background event as user was inactive on website");return}b.info(`Sending background event with ${t} seconds`);let r={};r[Vh.ACTIVE_DURATION]=t,this.apiService.sendEvent(new _e(N.EVENT_APP_BACKGROUND,r))}},dc=class{compareCartItemSubject=new It;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=>b.error("Unable to process cart change in XMLHttpRequest",r))}),t.apply(this,arguments)},b.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=>b.error("Unable to process cart change in fetch",i)),n))},b.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(b.debug(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(o=>{let c=r?.find(u=>u.vID===o.vID);if(c){if(c.quantity!==o.quantity){let u=c.quantity<o.quantity,d=Math.abs(c.quantity-o.quantity),m=ee(w({},o),{quantity:d});u?i.push(m):s.push(m)}r&&te.removeFromArray(r,c)}else i.push(o)}),r)for(let o of r)s.push(o);b.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)&&xr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:i,itemsRemoved:s})}sendEvent(e,t){let r=new _e(e,t);pe.get(fe).sendEvent(r)}async compareCartItems(){let e=await Oe.get(oe.CURRENT_CART,{}),t=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},hc=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){Be.getInstance().captureError("Failed to modify graphql request",i,{body:JSON.stringify(n?.body)})}return t(r,n)},b.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;b.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 te.getCartAttributes();return e.variables.input.attributes=[...t,...r],JSON.stringify(e)}sendBuyNowEvent(){let e=le.get().getCurrentItem();if(!e)return;let t=new _e(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(t)}},ji=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 _e(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0});fe.getInstance().sendEvent(r),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>b.error(e))}async listen(){this.elements=await te.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener("click",e)})}},gc=class Rc extends ji{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(Rc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rc),this.INSTANCE}},yc=class Zc extends ji{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(Zc.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Zc),this.INSTANCE}},vc=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(){te.onDocumentLoaded(()=>{b.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){b.debug("No clickable cart checkout button found");return}b.debug("Clickable cart checkout button found",t),t.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}},_c=class{trackSilently(){this.track().catch(e=>Be.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){b.warn("No processable data found in",e,t);return}r.referrer=document.referrer,r.url=location.href;let i=await pe.get(st).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){b.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(t=>t.length&&e.test(t))}},Go=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),t={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},r=new _e(N.EVENT_CHECKOUT_STARTED,t);fe.getInstance().sendEvent(r)})}},Ec=class{async migrate(){}};vt.escape=yh.MustacheUtils.escapeHtml;var be=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Ec().migrate(),this.autoAuthenticate(),new fc().meddle(),new mc().listen(),new _c().trackSilently(),new Zr().listen(),new dc().listen(),new hc().listen(),new vc().listen(),pe.get($i).listen(),pe.get(yc).listenSilently(),pe.get(gc).listenSilently(),pe.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||li(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,li(this.globalRef,"config",new Le),li(this.globalRef,"runtimeData",new le),b.debug("Global reference initialised")}static injectWidgetAssets(){Rt.injectScriptURL(Ct.widgetURL,"cooee-widget-sdk"),Rt.injectStylesheet(Ct.styleURL)}static autoAuthenticate(){let e=Pe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let t=e.appID?.trim(),r=e.shopifyShop;if((te.isNull(t)||t.length!==24)&&te.isNull(r)){b.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,pe.get(st).init(e)}static sendEvent(e,t,r){for(let i in t)if(i.length>3&&i.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let n=new _e(e,t);n.occurred=r??new Date,pe.get(fe).sendEvent(n)}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");pe.get(fe).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"&&pe.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){pe.get($i).resetScrollID();return}let n={};r&&(n.ps=r);let i=new _e(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,pe.get(fe).sendEvent(i),pe.get($i).resetScrollID(i.occurred)}static previewPopup(e,t){new Ui(t).render(e)}static previewWidget(e){new At(new Mt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){b.error(e)}window.addEventListener("message",e=>{if(b.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?Go.attachCheckoutListener():window.addEventListener("gokwikLoaded",Go.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)}};b.configure();b.logBrand();b.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(b.debug("Execution order:","IIFE start"),await be.initForMerchantWebsiteOnly(),await be.initForAll(),b.debug("Execution order:","IIFE end")))());b.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 ac(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 Ho=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&&oc().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(w({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:ac(this.configuration,r,n)})}else t=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((r,n)=>this.getProductFragment(r,n!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(t.flexDirection==="row"){if(e)t.maxWidth="100%",t.overflowY="auto";else if(this.configuration.disp===1){let r=this.props.triggerContext.triggerData,n=r.items.length,i;r.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?n*2-1:n:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`}}return t}getProductFragment(e,t=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}},$o=class extends Ae{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t)}componentDidMount(){oc().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:()=>this.onClick({clickAction:this.getClickAction(n)}),children:this.renderElement(n)}));return ac(e.conf,t,r)}getComponentStyles(){return{}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return $(Mr,{element:t,triggerContext:this.props.triggerContext});case 4:return $(Fr,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:b.warn("Unknown slide type for carousal")}}valueAddedSlide(e,t){let r=JSON.stringify(e),n=vt.render(r,{form:t});return kt.getParsedElement(JSON.parse(n))}getClickAction(e){let t=w({},this.props.element.clc),r=JSON.stringify(t),n=vt.render(r,{form:e});return JSON.parse(n)}},tn=class extends Ae{constructor(e,t){super(e,t),this.setState(()=>({decoration:"unset"})),at(()=>{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 $(Lo,{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 $(Mr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(Ho,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $($o,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}},jo=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(){at(()=>{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:()=>{this.onClick({clickAction:this.clickAction})},children:$(tn,{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){if(this.isClickable)return super.onClick(e)}},At=class Zi{constructor(t){this.engagementTrigger=t,this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=le.get();widgetAPIService=pe.get(cr);safeHTTPService=pe.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(t=>Be.getInstance().captureException(t,w({},this.engagementTrigger.sentryContext())))}destroy(){b.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(t=>{t?.disconnect&&t.disconnect()}),this.rootContainer?.remove(),Zi.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){b.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(t){return this.engagementTrigger.shortID===t.shortID}update(t){mh.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(t.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){b.log(`${this.engagementTrigger} already has required data to render widget`);return}let t=await this.observeWidgetContainerInViewport();this.handleVariationResponse(t)}handleVariationResponse(t){t&&(b.log(`${this.engagementTrigger} visitor has been assigned to variation ${t.variation}`),t.items?.length&&(this.engagementTrigger.items=t.items.map(r=>new Dt(r)),this.engagementTrigger.nonMutableItems=t.items.map(r=>new Dt(r))),t.bundleFrom&&(this.engagementTrigger.bundleFrom=new Dt(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=w(w({},this.engagementTrigger.props),t.props)),this.triggerContext.triggerData.widget=this.widget=new Si(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.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){Zi.renderedEngagements.push(this)}async getVariation(){b.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){b.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){b.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let t=window.innerHeight*.3,r={root:null,rootMargin:`-${t}px 0px ${t}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((s,o)=>{s.forEach(async c=>{if(c.isIntersecting){b.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=On(window,"scroll").pipe(ar(Zi.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let t=this.engagementTrigger.shortID;if(Zi.engagementIDsWithTrackedDisplay.has(t)||!await this.isInViewport())return;let r={};this.triggerContext.triggerData.items?.length&&(r.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,i=new _e(n,r,this.engagementTrigger);i.name===N.EVENT_CAMPAIGN_HOLDOUT&&(i.trigger.holdout=!0),this.safeHTTPService.sendEvent(i),Zi.engagementIDsWithTrackedDisplay.add(t),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let t=(await this.getWidgetContainer())?.getBoundingClientRect();if(!t)return!1;let r=window.innerHeight||document.documentElement.clientHeight,n=(Math.min(t.bottom,r)-Math.max(t.top,0))*t.width,i=t.width*t.height,s=n/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(t){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(t);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(t){let r=this.engagementTrigger.placement;if(!r?.selector)return b.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);i=(await te.retrySelector(u[0].trim()))?.shadowRoot,n=u[1].trim(),i&&Rt.injectStylesheet(Ct.styleURL,i);let d=Le.get().website.commonCSS;i&&d&&Rt.injectRawCSS(d,i)}b.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let s=await te.retrySelector(n,10,i??document);if(!s)return b.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 Wo.EngagementPlacementPosition.BEFORE:{s.parentElement?.insertBefore(c,s);break}case Wo.EngagementPlacementPosition.INSIDE_FIRST:{s.insertBefore(c,s.firstChild);break}case Wo.EngagementPlacementPosition.INSIDE_LAST:{s.appendChild(c);break}case Wo.EngagementPlacementPosition.AFTER:default:s.parentElement?.insertBefore(c,s.nextSibling)}return c}async startRendering(){let t;try{t=await ki.refreshItems(this.engagementTrigger)}catch(r){b.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!t?.length&&this.engagementTrigger.isProductPromoted()){b.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=t,this.renderContainer()}getParentElement(t,r=document){let n=r.getElementById(t);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=t,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let t=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let r=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),n=Le.get().website.commonCSS;n&&Rt.injectRawCSS(n,r),Rt.injectStylesheet(Ct.styleURL,r),Rt.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",r),t=r}tf(Mc(jo,{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)ph.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 At{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"){b.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}},cc=class Fh{constructor(t,r){this.engagementTrigger=t,this.element=r,this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(t){let r=t.placement;if(!r?.selector){b.warn(`No placement available for ${t.objective}`,t.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){b.warn(`No placement found for ${t.objective}`,t.shortID);return}for(let i of n)new Fh(t,i).render()}render(){let t=this.findCartItemFromHTMLElement();if(!t||this.engagementTrigger.skipSubscribedItems&&t.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===t.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===t.id.toString());if(!n)return;let i=new Sr(n),s=t.selling_plan_allocation?.selling_plan;if(s)for(let m of i.sellingPlans??[])m.mID===s.id.toString()&&(m.isSelected=!0,i.changeSellingPlan(m));let o=new Dt(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 Mt(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&&(b.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))})}},dh=Se(Rr()),lc=class extends Dr{ctaListener=new Zr;constructor(e){super(e),xr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Yu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),t=[...this.engagementTrigger.progressBarConfig.milestones];for(let r of t){if(e.amount<r.minValue)break;if(b.log("Current milestone",r),r.rewardType===dh.MilestoneRewardType.FREE_AUTO_GIFT){let n=r.items[0];if(e.items.find(i=>i.vID===n.vID||i.mID===n.mID)){b.log(`Item(vID:${n.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(n,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});break}else{let i=await this.ctaListener.performAddToCart([n],this.engagementTrigger);ze.get().refreshUI(i,!1),await this.removeOtherFreeGifts(n)}}}}async removeOtherFreeGifts(e){let t=(await de.getCurrent().getNormalisedCart()).items.filter(r=>r.vID!==e?.vID&&r.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(t.length)for(let r of t)await this.ctaListener.performUpdate(r,{quantity:0})}},hh=Se(Rr()),uc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.items=this.triggerContext.triggerData.items,e.engagementTrigger=this.engagementTrigger,e.addEventListener("triggerClicked",t=>{let r=t.detail;this.safeHTTPService.sendEvent(r)}),e.addEventListener("performCTA",async t=>{let r={at:hh.ClickActionType.ADD_TO_CART,applyDiscount:!0},n=t.detail;await new en(this.triggerContext).execute({clickAction:r,item:n})}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}},gh=Se(ei()),pc=class extends At{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(!gh.JSUtils.hasKeys(n)){b.error(`No detail received for ${r}`);return}b.log("Detail received for BYOB",n);let i=n.campaignID??n.campaignId??n.campaign_id;if(i!==t.shortID&&i!==t.engagementID){b.warn(`Current ${r} is not BYOB. Received: ${i}`);return}let s=n.items;if(!s?.length)return;let o=s.map(c=>new xt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new en(this.triggerContext).execute({embeddedItems:o,clickAction:{at:108,applyDiscount:!0}})}},Fi=class{runtimeData=le.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let t=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let r of e)b.log(`\u{1F4E3} ${r} received as cart embed`),!this.findAndUpdateCurrent(r,t)&&(b.log(`${r} is new`),r.isProgressBar()?new lc(r).renderSilently():r.isSubscriptionUpsell()?cc.renderCartUpsell(r):new Dr(r).renderSilently());this.removeOldWidgets(t)}processPageWidgetResponse(e){let t=[...At.renderedEngagements];At.renderedEngagements.length=0;for(let r of e)b.log(`\u{1F4E3} ${r} received as page embed`),!this.findAndUpdateCurrent(r,t)&&(b.log(`${r} is new`),r.isShoppableVideo()?new uc(r).renderSilently():r.isBYOB()?new pc(r).renderSilently():new At(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()}},cr=class Hh{static INSTANCE;httpService=pe.get(mt);sessionManager=pe.get(st);runtimeData=le.get();loadWidgetsSubject=new It;constructor(){this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(t=>b.error("Unable to initiate cart widgets",t)),this.loadPageWidgets().catch(t=>b.error("Unable to initiate page widgets",t))}),xr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Hh),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(t=>b.error("Unable to initiate load page widgets",t))})}loadCartWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(t=>b.error("Unable to initiate cart widgets",t))})}loadWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let t=await this.getWidgetProps();b.log("Load widgets",t),this.httpService.post("/v1/engagement/page-widgets",t).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processPageWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async loadCartWidgets(){let t=await this.getWidgetProps();b.log("Load cart widgets",t),this.httpService.post("/v1/engagement/cart-widgets",t).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processCartWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async getVariation(t){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",w(w({},t),r))}renderCachedCartWidgets(){new Fi().processCartWidgetResponse(this.runtimeData.cartEngagements)}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()}addAvailableEngagementShortIDs(){let t=document.querySelectorAll(".letscooee-engagement"),r=[];return t.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let t={};t.engagementIDs=this.addAvailableEngagementShortIDs(),t.locale=this.runtimeData.locale,await this.addSessionContext(t),t.currentItem=this.runtimeData.getCurrentItem();try{t.cart=await de.getCurrent().getNormalisedCart()}catch(s){b.error("Error fetching Shopify cart before sending widget call",s)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?t.previewIDs=n.trim().split(",").filter(s=>Number.isInteger(+s)):this.runtimeData.previewIDs?.length&&(t.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?t.previewVariant=i:this.runtimeData.previewVariant&&(t.previewVariant=this.runtimeData.previewVariant),t}},fc=class{runtimeData=le.get();widgetAPIService=pe.get(cr);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.previewWidget=be.previewWidget.bind(be),e.previewPopup=be.previewPopup.bind(be)}overwritePush(e,t){li(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&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?be.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):be.sendEvent(e[0],e[1]))}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)}},Hi=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))}},$i=class Yo{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=pe.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(t){this._lastScreenOrScroll=t}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Yo),this.INSTANCE}resetScrollID(t){Hi.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)}te.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){On(window,"scroll").pipe(ar(Yo.DEBOUNCE_TIME),Nn(()=>{let t=this.getPercentScrolledY();if(t>100){b.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)>=Yo.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=Hi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new _e(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Hi.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)}},mc=class Vh{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=pe.get(fe);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){b.info("Not sending background event as user was inactive on website");return}b.info(`Sending background event with ${t} seconds`);let r={};r[Vh.ACTIVE_DURATION]=t,this.apiService.sendEvent(new _e(N.EVENT_APP_BACKGROUND,r))}},dc=class{compareCartItemSubject=new It;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=>b.error("Unable to process cart change in XMLHttpRequest",r))}),t.apply(this,arguments)},b.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=>b.error("Unable to process cart change in fetch",i)),n))},b.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(b.debug(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(o=>{let c=r?.find(u=>u.vID===o.vID);if(c){if(c.quantity!==o.quantity){let u=c.quantity<o.quantity,d=Math.abs(c.quantity-o.quantity),m=ee(w({},o),{quantity:d});u?i.push(m):s.push(m)}r&&te.removeFromArray(r,c)}else i.push(o)}),r)for(let o of r)s.push(o);b.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)&&xr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:i,itemsRemoved:s})}sendEvent(e,t){let r=new _e(e,t);pe.get(fe).sendEvent(r)}async compareCartItems(){let e=await Oe.get(oe.CURRENT_CART,{}),t=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,t)}},hc=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){Be.getInstance().captureError("Failed to modify graphql request",i,{body:JSON.stringify(n?.body)})}return t(r,n)},b.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;b.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 te.getCartAttributes();return e.variables.input.attributes=[...t,...r],JSON.stringify(e)}sendBuyNowEvent(){let e=le.get().getCurrentItem();if(!e)return;let t=new _e(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(t)}},ji=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 _e(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0});fe.getInstance().sendEvent(r),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>b.error(e))}async listen(){this.elements=await te.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener("click",e)})}},gc=class Rc extends ji{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(Rc.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rc),this.INSTANCE}},yc=class Zc extends ji{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(Zc.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Zc),this.INSTANCE}},vc=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(){te.onDocumentLoaded(()=>{b.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){b.debug("No clickable cart checkout button found");return}b.debug("Clickable cart checkout button found",t),t.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}},_c=class{trackSilently(){this.track().catch(e=>Be.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){b.warn("No processable data found in",e,t);return}r.referrer=document.referrer,r.url=location.href;let i=await pe.get(st).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){b.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(t=>t.length&&e.test(t))}},Go=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),t={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},r=new _e(N.EVENT_CHECKOUT_STARTED,t);fe.getInstance().sendEvent(r)})}},Ec=class{async migrate(){}};vt.escape=yh.MustacheUtils.escapeHtml;var be=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Ec().migrate(),this.autoAuthenticate(),new fc().meddle(),new mc().listen(),new _c().trackSilently(),new Zr().listen(),new dc().listen(),new hc().listen(),new vc().listen(),pe.get($i).listen(),pe.get(yc).listenSilently(),pe.get(gc).listenSilently(),pe.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||li(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,li(this.globalRef,"config",new Le),li(this.globalRef,"runtimeData",new le),b.debug("Global reference initialised")}static injectWidgetAssets(){Rt.injectScriptURL(Ct.widgetURL,"cooee-widget-sdk"),Rt.injectStylesheet(Ct.styleURL)}static autoAuthenticate(){let e=Pe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let t=e.appID?.trim(),r=e.shopifyShop;if((te.isNull(t)||t.length!==24)&&te.isNull(r)){b.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,pe.get(st).init(e)}static sendEvent(e,t,r){for(let i in t)if(i.length>3&&i.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let n=new _e(e,t);n.occurred=r??new Date,pe.get(fe).sendEvent(n)}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");pe.get(fe).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"&&pe.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){pe.get($i).resetScrollID();return}let n={};r&&(n.ps=r);let i=new _e(N.EVENT_SCREEN_VIEW,n);i.occurred=t.jsLoadTime,pe.get(fe).sendEvent(i),pe.get($i).resetScrollID(i.occurred)}static previewPopup(e,t){new Ui(t).render(e)}static previewWidget(e){new At(new Mt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){b.error(e)}window.addEventListener("message",e=>{if(b.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?Go.attachCheckoutListener():window.addEventListener("gokwikLoaded",Go.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)}};b.configure();b.logBrand();b.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(b.debug("Execution order:","IIFE start"),await be.initForMerchantWebsiteOnly(),await be.initForAll(),b.debug("Execution order:","IIFE end")))());b.debug("Execution order:","bottom");})();
|