wineater-bot 4.5.0 → 4.5.7

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.
@@ -1,29 +1,38 @@
1
- (function($,te){typeof exports=="object"&&typeof module<"u"?module.exports=te():typeof define=="function"&&define.amd?define(te):($=typeof globalThis<"u"?globalThis:$||self,$.WineaterChatbot=te())})(this,function(){"use strict";var np=Object.defineProperty;var Qa=$=>{throw TypeError($)};var sp=($,te,we)=>te in $?np($,te,{enumerable:!0,configurable:!0,writable:!0,value:we}):$[te]=we;var pt=($,te,we)=>sp($,typeof te!="symbol"?te+"":te,we),mr=($,te,we)=>te.has($)||Qa("Cannot "+we);var v=($,te,we)=>(mr($,te,"read from private field"),we?we.call($):te.get($)),X=($,te,we)=>te.has($)?Qa("Cannot add the same private member more than once"):te instanceof WeakSet?te.add($):te.set($,we),F=($,te,we,as)=>(mr($,te,"write to private field"),as?as.call($,we):te.set($,we),we),le=($,te,we)=>(mr($,te,"access private method"),we);var Ga,On,An,tn,nn,ns,Mn,Pn,ye,vr,hn,br,Za,$a,Ge,Ke,fr,ut,sn,ht,Xe,Pe,dt,Tt,Lt,rn,Ft,on,Bt,Ys,Se,ip,rp,wr,$s,ei,yr,$e,ft,We,an,ss,is,Js,Ln,ln,Ka;const $="5";typeof window<"u"&&((Ga=window.__svelte??(window.__svelte={})).v??(Ga.v=new Set)).add($);const te=1,we=2,as=16,el=1,tl=2,nl=4,sl=8,il=16,rl=1,ol=2,Te=Symbol(),al="http://www.w3.org/1999/xhtml",ti=!1;var ni=Array.isArray,ll=Array.prototype.indexOf,si=Array.from,cl=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,ul=Object.getOwnPropertyDescriptors,hl=Object.prototype,dl=Array.prototype,Sr=Object.getPrototypeOf,_r=Object.isExtensible;function fl(t){for(var e=0;e<t.length;e++)t[e]()}function kr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const _e=2,ii=4,ri=8,gt=16,mt=32,zt=64,ls=128,Je=512,xe=1024,Re=2048,vt=4096,Le=8192,bt=16384,oi=32768,Ut=65536,Tr=1<<17,xr=1<<18,fn=1<<19,pl=1<<20,Ht=32768,ai=1<<21,li=1<<22,Et=1<<23,qt=Symbol("$state"),gl=Symbol("legacy props"),ml=Symbol(""),pn=new class extends Error{constructor(){super(...arguments);pt(this,"name","StaleReactionError");pt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function vl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function bl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function wl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function yl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Sl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function _l(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function kl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Tl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function El(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Il(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Cl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Nl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Er(t){return t===this.v}function Dl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Ir(t){return!Dl(t,this.v)}let gn=!1,Rl=!1;function Ol(){gn=!0}let pe=null;function mn(t){pe=t}function It(t,e=!1,n){pe={p:pe,i:!1,c:null,e:null,s:t,x:null,l:gn&&!e?{s:null,u:null,$:[]}:null}}function Ct(t){var e=pe,n=e.e;if(n!==null){e.e=null;for(var s of n)Gr(s)}return t!==void 0&&(e.x=t),e.i=!0,pe=e.p,t??{}}function Fn(){return!gn||pe!==null&&pe.l===null}let Vt=[];function Cr(){var t=Vt;Vt=[],fl(t)}function Bn(t){if(Vt.length===0&&!Wn){var e=Vt;queueMicrotask(()=>{e===Vt&&Cr()})}Vt.push(t)}function Al(){for(;Vt.length>0;)Cr()}function Nr(t){var e=Z;if(e===null)return K.f|=Et,t;if(e.f&oi)vn(t,e);else{if(!(e.f&ls))throw t;e.b.error(t)}}function vn(t,e){for(;e!==null;){if(e.f&ls)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t}const cs=new Set;let Q=null,us=null,ge=null,ze=[],hs=null,ci=!1,Wn=!1;const Xs=class Xs{constructor(){X(this,ye);pt(this,"committed",!1);pt(this,"current",new Map);pt(this,"previous",new Map);X(this,On,new Set);X(this,An,new Set);X(this,tn,0);X(this,nn,0);X(this,ns,null);X(this,Mn,[]);X(this,Pn,[]);pt(this,"skipped_effects",new Set);pt(this,"is_fork",!1)}is_deferred(){return this.is_fork||v(this,nn)>0}process(e){var s;ze=[],us=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)le(this,ye,vr).call(this,i,n);this.is_fork||le(this,ye,Za).call(this),this.is_deferred()?(le(this,ye,hn).call(this,n.effects),le(this,ye,hn).call(this,n.render_effects),le(this,ye,hn).call(this,n.block_effects)):(us=this,Q=null,Rr(n.render_effects),Rr(n.effects),us=null,(s=v(this,ns))==null||s.resolve()),ge=null}capture(e,n){this.previous.has(e)||this.previous.set(e,n),e.f&Et||(this.current.set(e,e.v),ge==null||ge.set(e,e.v))}activate(){Q=this,this.apply()}deactivate(){Q===this&&(Q=null,ge=null)}flush(){if(this.activate(),ze.length>0){if(Dr(),Q!==null&&Q!==this)return}else v(this,tn)===0&&this.process([]);this.deactivate()}discard(){for(const e of v(this,An))e(this);v(this,An).clear()}increment(e){F(this,tn,v(this,tn)+1),e&&F(this,nn,v(this,nn)+1)}decrement(e){F(this,tn,v(this,tn)-1),e&&F(this,nn,v(this,nn)-1),this.revive()}revive(){for(const e of v(this,Mn))Ee(e,Re),Gt(e);for(const e of v(this,Pn))Ee(e,vt),Gt(e);F(this,Mn,[]),F(this,Pn,[]),this.flush()}oncommit(e){v(this,On).add(e)}ondiscard(e){v(this,An).add(e)}settled(){return(v(this,ns)??F(this,ns,kr())).promise}static ensure(){if(Q===null){const e=Q=new Xs;cs.add(Q),Wn||Xs.enqueue(()=>{Q===e&&e.flush()})}return Q}static enqueue(e){Bn(e)}apply(){}};On=new WeakMap,An=new WeakMap,tn=new WeakMap,nn=new WeakMap,ns=new WeakMap,Mn=new WeakMap,Pn=new WeakMap,ye=new WeakSet,vr=function(e,n){var l;e.f^=xe;for(var s=e.first;s!==null;){var i=s.f,r=(i&(mt|zt))!==0,o=r&&(i&xe)!==0,a=o||(i&Le)!==0||this.skipped_effects.has(s);if(s.f&ls&&((l=s.b)!=null&&l.is_pending())&&(n={parent:n,effect:s,effects:[],render_effects:[],block_effects:[]}),!a&&s.fn!==null){r?s.f^=xe:i&ii?n.effects.push(s):Kn(s)&&(s.f&gt&&n.block_effects.push(s),Xn(s));var c=s.first;if(c!==null){s=c;continue}}var u=s.parent;for(s=s.next;s===null&&u!==null;)u===n.effect&&(le(this,ye,hn).call(this,n.effects),le(this,ye,hn).call(this,n.render_effects),le(this,ye,hn).call(this,n.block_effects),n=n.parent),s=u.next,u=u.parent}},hn=function(e){for(const n of e)(n.f&Re?v(this,Mn):v(this,Pn)).push(n),le(this,ye,br).call(this,n.deps),Ee(n,xe)},br=function(e){if(e!==null)for(const n of e)!(n.f&_e)||!(n.f&Ht)||(n.f^=Ht,le(this,ye,br).call(this,n.deps))},Za=function(){if(v(this,nn)===0){for(const e of v(this,On))e();v(this,On).clear()}v(this,tn)===0&&le(this,ye,$a).call(this)},$a=function(){var r;if(cs.size>1){this.previous.clear();var e=ge,n=!0,s={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const o of cs){if(o===this){n=!1;continue}const a=[];for(const[u,l]of this.current){if(o.current.has(u))if(n&&l!==o.current.get(u))o.current.set(u,l);else continue;a.push(u)}if(a.length===0)continue;const c=[...o.current.keys()].filter(u=>!this.current.has(u));if(c.length>0){var i=ze;ze=[];const u=new Set,l=new Map;for(const h of a)Or(h,c,u,l);if(ze.length>0){Q=o,o.apply();for(const h of ze)le(r=o,ye,vr).call(r,h,s);o.deactivate()}ze=i}}Q=null,ge=e}this.committed=!0,cs.delete(this)};let wt=Xs;function Ml(t){var e=Wn;Wn=!0;try{for(var n;;){if(Al(),ze.length===0&&(Q==null||Q.flush(),ze.length===0))return hs=null,n;Dr()}}finally{Wn=e}}function Dr(){var t=Dt;ci=!0;var e=null;try{var n=0;for(vs(!0);ze.length>0;){var s=wt.ensure();if(n++>1e3){var i,r;Pl()}s.process(ze),Nt.clear()}}finally{ci=!1,vs(t),hs=null}}function Pl(){try{_l()}catch(t){vn(t,hs)}}let Qe=null;function Rr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(bt|Le))&&Kn(s)&&(Qe=new Set,Xn(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null&&s.ac===null?Jr(s):s.fn=null),(Qe==null?void 0:Qe.size)>0)){Nt.clear();for(const i of Qe){if(i.f&(bt|Le))continue;const r=[i];let o=i.parent;for(;o!==null;)Qe.has(o)&&(Qe.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(bt|Le)||Xn(c)}}Qe.clear()}}Qe=null}}function Or(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&_e?Or(i,e,n,s):r&(li|gt)&&!(r&Re)&&Ar(i,e,s)&&(Ee(i,Re),Gt(i))}}function Ar(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(e.includes(i))return!0;if(i.f&_e&&Ar(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function Gt(t){for(var e=hs=t;e.parent!==null;){e=e.parent;var n=e.f;if(ci&&e===Z&&n&gt&&!(n&xr))return;if(n&(zt|mt)){if(!(n&xe))return;e.f^=xe}}ze.push(e)}function Ll(t){let e=0,n=Kt(0),s;return()=>{gs()&&(b(n),gi(()=>(e===0&&(s=Yn(()=>t(()=>Hn(n)))),e+=1,()=>{Bn(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Hn(n))})})))}}var Fl=Ut|fn|ls;function Bl(t,e,n){new Wl(t,e,n)}class Wl{constructor(e,n,s){X(this,Se);pt(this,"parent");X(this,Ge,!1);X(this,Ke);X(this,fr,null);X(this,ut);X(this,sn);X(this,ht);X(this,Xe,null);X(this,Pe,null);X(this,dt,null);X(this,Tt,null);X(this,Lt,null);X(this,rn,0);X(this,Ft,0);X(this,on,!1);X(this,Bt,null);X(this,Ys,Ll(()=>(F(this,Bt,Kt(v(this,rn))),()=>{F(this,Bt,null)})));F(this,Ke,e),F(this,ut,n),F(this,sn,s),this.parent=Z.b,F(this,Ge,!!v(this,ut).pending),F(this,ht,ms(()=>{Z.b=this;{var i=le(this,Se,wr).call(this);try{F(this,Xe,Ue(()=>s(i)))}catch(r){this.error(r)}v(this,Ft)>0?le(this,Se,ei).call(this):F(this,Ge,!1)}return()=>{var r;(r=v(this,Lt))==null||r.remove()}},Fl))}is_pending(){return v(this,Ge)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!v(this,ut).pending}update_pending_count(e){le(this,Se,yr).call(this,e),F(this,rn,v(this,rn)+e),v(this,Bt)&&Un(v(this,Bt),v(this,rn))}get_effect_pending(){return v(this,Ys).call(this),b(v(this,Bt))}error(e){var n=v(this,ut).onerror;let s=v(this,ut).failed;if(v(this,on)||!n&&!s)throw e;v(this,Xe)&&(Oe(v(this,Xe)),F(this,Xe,null)),v(this,Pe)&&(Oe(v(this,Pe)),F(this,Pe,null)),v(this,dt)&&(Oe(v(this,dt)),F(this,dt,null));var i=!1,r=!1;const o=()=>{if(i){Nl();return}i=!0,r&&Il(),wt.ensure(),F(this,rn,0),v(this,dt)!==null&&wn(v(this,dt),()=>{F(this,dt,null)}),F(this,Ge,this.has_pending_snippet()),F(this,Xe,le(this,Se,$s).call(this,()=>(F(this,on,!1),Ue(()=>v(this,sn).call(this,v(this,Ke)))))),v(this,Ft)>0?le(this,Se,ei).call(this):F(this,Ge,!1)};var a=K;try{Ae(null),r=!0,n==null||n(e,o),r=!1}catch(c){vn(c,v(this,ht)&&v(this,ht).parent)}finally{Ae(a)}s&&Bn(()=>{F(this,dt,le(this,Se,$s).call(this,()=>{wt.ensure(),F(this,on,!0);try{return Ue(()=>{s(v(this,Ke),()=>e,()=>o)})}catch(c){return vn(c,v(this,ht).parent),null}finally{F(this,on,!1)}}))})}}Ge=new WeakMap,Ke=new WeakMap,fr=new WeakMap,ut=new WeakMap,sn=new WeakMap,ht=new WeakMap,Xe=new WeakMap,Pe=new WeakMap,dt=new WeakMap,Tt=new WeakMap,Lt=new WeakMap,rn=new WeakMap,Ft=new WeakMap,on=new WeakMap,Bt=new WeakMap,Ys=new WeakMap,Se=new WeakSet,ip=function(){try{F(this,Xe,Ue(()=>v(this,sn).call(this,v(this,Ke))))}catch(e){this.error(e)}F(this,Ge,!1)},rp=function(){const e=v(this,ut).pending;e&&(F(this,Pe,Ue(()=>e(v(this,Ke)))),wt.enqueue(()=>{var n=le(this,Se,wr).call(this);F(this,Xe,le(this,Se,$s).call(this,()=>(wt.ensure(),Ue(()=>v(this,sn).call(this,n))))),v(this,Ft)>0?le(this,Se,ei).call(this):(wn(v(this,Pe),()=>{F(this,Pe,null)}),F(this,Ge,!1))}))},wr=function(){var e=v(this,Ke);return v(this,Ge)&&(F(this,Lt,yt()),v(this,Ke).before(v(this,Lt)),e=v(this,Lt)),e},$s=function(e){var n=Z,s=K,i=pe;st(v(this,ht)),Ae(v(this,ht)),mn(v(this,ht).ctx);try{return e()}catch(r){return Nr(r),null}finally{st(n),Ae(s),mn(i)}},ei=function(){const e=v(this,ut).pending;v(this,Xe)!==null&&(F(this,Tt,document.createDocumentFragment()),v(this,Tt).append(v(this,Lt)),$r(v(this,Xe),v(this,Tt))),v(this,Pe)===null&&F(this,Pe,Ue(()=>e(v(this,Ke))))},yr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&le(n=this.parent,Se,yr).call(n,e);return}F(this,Ft,v(this,Ft)+e),v(this,Ft)===0&&(F(this,Ge,!1),v(this,Pe)&&wn(v(this,Pe),()=>{F(this,Pe,null)}),v(this,Tt)&&(v(this,Ke).before(v(this,Tt)),F(this,Tt,null)))};function jn(t,e){return e}function jl(t,e,n){for(var s=[],i=e.length,r=0;r<i;r++)mi(e[r].e,s,!0);Qr(s,()=>{var o=s.length===0&&n!==null;if(o){var a=n,c=a.parentNode;Ql(c),c.append(a),t.items.clear(),et(t,e[0].prev,e[i-1].next)}for(var u=0;u<i;u++){var l=e[u];o||(t.items.delete(l.k),et(t,l.prev,l.next)),Oe(l.e,!o)}t.first===e[0]&&(t.first=e[0].prev)})}function zn(t,e,n,s,i,r=null){var o=t,a=new Map,c=null;{var u=t;o=u.appendChild(yt())}var l=null,h=hi(()=>{var _=n();return ni(_)?_:_==null?[]:si(_)}),d,f=!0;function p(){zl(E,d,o,e,s),l!==null&&(d.length===0?(l.fragment?(o.before(l.fragment),l.fragment=null):vi(l.effect),m.first=l.effect):wn(l.effect,()=>{l=null}))}var m=ms(()=>{d=b(h);for(var _=d.length,x=new Set,T=Q,g=null,w=qr(),k=0;k<_;k+=1){var I=d[k],y=s(I,k),S=f?null:a.get(y);S?(Un(S.v,I),S.i=k,w&&T.skipped_effects.delete(S.e)):(S=Ul(f?o:null,g,I,y,k,i,e,n),f&&(S.o=!0,g===null?c=S:g.next=S,g=S),a.set(y,S)),x.add(y)}if(_===0&&r&&!l)if(f)l={fragment:null,effect:Ue(()=>r(o))};else{var A=document.createDocumentFragment(),W=yt();A.append(W),l={fragment:A,effect:Ue(()=>r(W))}}if(!f)if(w){for(const[B,V]of a)x.has(B)||T.skipped_effects.add(V.e);T.oncommit(p),T.ondiscard(()=>{})}else p();b(h)}),E={effect:m,items:a,first:c};f=!1}function zl(t,e,n,s,i){var r=e.length,o=t.items,a=t.first,c,u=null,l=[],h=[],d,f,p,m;for(m=0;m<r;m+=1){if(d=e[m],f=i(d,m),p=o.get(f),t.first??(t.first=p),!p.o){p.o=!0;var E=u?u.next:a;et(t,u,p),et(t,p,E),ui(p,E,n),u=p,l=[],h=[],a=u.next;continue}if(p.e.f&Le&&vi(p.e),p!==a){if(c!==void 0&&c.has(p)){if(l.length<h.length){var _=h[0],x;u=_.prev;var T=l[0],g=l[l.length-1];for(x=0;x<l.length;x+=1)ui(l[x],_,n);for(x=0;x<h.length;x+=1)c.delete(h[x]);et(t,T.prev,g.next),et(t,u,T),et(t,g,_),a=_,u=g,m-=1,l=[],h=[]}else c.delete(p),ui(p,a,n),et(t,p.prev,p.next),et(t,p,u===null?t.first:u.next),et(t,u,p),u=p;continue}for(l=[],h=[];a!==null&&a.k!==f;)a.e.f&Le||(c??(c=new Set)).add(a),h.push(a),a=a.next;if(a===null)continue;p=a}l.push(p),u=p,a=p.next}if(a!==null||c!==void 0){for(var w=c===void 0?[]:si(c);a!==null;)a.e.f&Le||w.push(a),a=a.next;var k=w.length;if(k>0){var I=r===0?n:null;jl(t,w,I)}}}function Ul(t,e,n,s,i,r,o,a){var c=(o&te)!==0,u=(o&as)===0,l=c?u?Kl(n,!1,!1):Kt(n):n,h=o&we?Kt(i):i,d={i:h,v:l,k:s,a:null,e:null,o:!1,prev:e,next:null};try{if(t===null){var f=document.createDocumentFragment();f.append(t=yt())}return d.e=Ue(()=>r(t,l,h,a)),e!==null&&(e.next=d),d}finally{}}function ui(t,e,n){for(var s=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,r=t.e.nodes_start;r!==null&&r!==s;){var o=qn(r);i.before(r),r=o}}function et(t,e,n){e===null?(t.first=n,t.effect.first=n&&n.e):(e.e.next&&(e.e.next.prev=null),e.next=n,e.e.next=n&&n.e),n===null?t.effect.last=e&&e.e:(n.e.prev&&(n.e.prev.next=null),n.prev=e,n.e.prev=e&&e.e)}function Hl(t,e,n,s){const i=Fn()?fs:hi;if(n.length===0&&t.length===0){s(e.map(i));return}var r=Q,o=Z,a=ql();function c(){Promise.all(n.map(u=>Vl(u))).then(u=>{a();try{s([...e.map(i),...u])}catch(l){o.f&bt||vn(l,o)}r==null||r.deactivate(),ds()}).catch(u=>{vn(u,o)})}t.length>0?Promise.all(t).then(()=>{a();try{return c()}finally{r==null||r.deactivate(),ds()}}):c()}function ql(){var t=Z,e=K,n=pe,s=Q;return function(r=!0){st(t),Ae(e),mn(n),r&&(s==null||s.activate())}}function ds(){st(null),Ae(null),mn(null)}function fs(t){var e=_e|Re,n=K!==null&&K.f&_e?K:null;return Z!==null&&(Z.f|=fn),{ctx:pe,deps:null,effects:null,equals:Er,f:e,fn:t,reactions:null,rv:0,v:Te,wv:0,parent:n??Z,ac:null}}function Vl(t,e){let n=Z;n===null&&bl();var s=n.b,i=void 0,r=Kt(Te),o=!K,a=new Map;return sc(()=>{var d;var c=kr();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{u===Q&&u.committed&&u.deactivate(),ds()})}catch(f){c.reject(f),ds()}var u=Q;if(o){var l=!s.is_pending();s.update_pending_count(1),u.increment(l),(d=a.get(u))==null||d.reject(pn),a.delete(u),a.set(u,c)}const h=(f,p=void 0)=>{if(u.activate(),p)p!==pn&&(r.f|=Et,Un(r,p));else{r.f&Et&&(r.f^=Et),Un(r,f);for(const[m,E]of a){if(a.delete(m),m===u)break;E.reject(pn)}}o&&(s.update_pending_count(-1),u.decrement(l))};c.promise.then(h,f=>h(null,f||"unknown"))}),pi(()=>{for(const c of a.values())c.reject(pn)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function me(t){const e=fs(t);return to(e),e}function hi(t){const e=fs(t);return e.equals=Ir,e}function Mr(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Oe(e[n])}}function Gl(t){for(var e=t.parent;e!==null;){if(!(e.f&_e))return e.f&bt?null:e;e=e.parent}return null}function di(t){var e,n=Z;st(Gl(t));try{t.f&=~Ht,Mr(t),e=oo(t)}finally{st(n)}return e}function Pr(t){var e=di(t);if(t.equals(e)||(Q!=null&&Q.is_fork||(t.v=e),t.wv=io()),!Yt)if(ge!==null)gs()&&ge.set(t,e);else{var n=t.f&Je?xe:vt;Ee(t,n)}}let fi=new Set;const Nt=new Map;let Lr=!1;function Kt(t,e){var n={f:0,v:t,reactions:null,equals:Er,rv:0,wv:0};return n}function ie(t,e){const n=Kt(t);return to(n),n}function Kl(t,e=!1,n=!0){var i;const s=Kt(t);return e||(s.equals=Ir),gn&&n&&pe!==null&&pe.l!==null&&((i=pe.l).s??(i.s=[])).push(s),s}function O(t,e,n=!1){K!==null&&(!nt||K.f&Tr)&&Fn()&&K.f&(_e|gt|li|Tr)&&!(Ne!=null&&Ne.includes(t))&&El();let s=n?tt(e):e;return Un(t,s)}function Un(t,e){if(!t.equals(e)){var n=t.v;Yt?Nt.set(t,e):Nt.set(t,n),t.v=e;var s=wt.ensure();s.capture(t,n),t.f&_e&&(t.f&Re&&di(t),Ee(t,t.f&Je?xe:vt)),t.wv=io(),Br(t,Re),Fn()&&Z!==null&&Z.f&xe&&!(Z.f&(mt|zt))&&(He===null?oc([t]):He.push(t)),!s.is_fork&&fi.size>0&&!Lr&&Xl()}return e}function Xl(){Lr=!1;var t=Dt;vs(!0);const e=Array.from(fi);try{for(const n of e)n.f&xe&&Ee(n,vt),Kn(n)&&Xn(n)}finally{vs(t)}fi.clear()}function Fr(t,e=1){var n=b(t),s=e===1?n++:n--;return O(t,n),s}function Hn(t){O(t,t.v+1)}function Br(t,e){var n=t.reactions;if(n!==null)for(var s=Fn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===Z)){var c=(a&Re)===0;if(c&&Ee(o,e),a&_e){var u=o;ge==null||ge.delete(u),a&Ht||(a&Je&&(o.f|=Ht),Br(u,vt))}else c&&(a&gt&&Qe!==null&&Qe.add(o),Gt(o))}}}function tt(t){if(typeof t!="object"||t===null||qt in t)return t;const e=Sr(t);if(e!==hl&&e!==dl)return t;var n=new Map,s=ni(t),i=ie(0),r=Jt,o=a=>{if(Jt===r)return a();var c=K,u=Jt;Ae(null),so(r);var l=a();return Ae(c),so(u),l};return s&&n.set("length",ie(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Tl();var l=n.get(c);return l===void 0?l=o(()=>{var h=ie(u.value);return n.set(c,h),h}):O(l,u.value,!0),!0},deleteProperty(a,c){var u=n.get(c);if(u===void 0){if(c in a){const l=o(()=>ie(Te));n.set(c,l),Hn(i)}}else O(u,Te),Hn(i);return!0},get(a,c,u){var f;if(c===qt)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(f=dn(a,c))!=null&&f.writable)&&(l=o(()=>{var p=tt(h?a[c]:Te),m=ie(p);return m}),n.set(c,l)),l!==void 0){var d=b(l);return d===Te?void 0:d}return Reflect.get(a,c,u)},getOwnPropertyDescriptor(a,c){var u=Reflect.getOwnPropertyDescriptor(a,c);if(u&&"value"in u){var l=n.get(c);l&&(u.value=b(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Te)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===qt)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Te||Reflect.has(a,c);if(u!==void 0||Z!==null&&(!l||(d=dn(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var f=l?tt(a[c]):Te,p=ie(f);return p}),n.set(c,u));var h=b(u);if(h===Te)return!1}return l},set(a,c,u,l){var T;var h=n.get(c),d=c in a;if(s&&c==="length")for(var f=u;f<h.v;f+=1){var p=n.get(f+"");p!==void 0?O(p,Te):f in a&&(p=o(()=>ie(Te)),n.set(f+"",p))}if(h===void 0)(!d||(T=dn(a,c))!=null&&T.writable)&&(h=o(()=>ie(void 0)),O(h,tt(u)),n.set(c,h));else{d=h.v!==Te;var m=o(()=>tt(u));O(h,m)}var E=Reflect.getOwnPropertyDescriptor(a,c);if(E!=null&&E.set&&E.set.call(l,u),!d){if(s&&typeof c=="string"){var _=n.get("length"),x=Number(c);Number.isInteger(x)&&x>=_.v&&O(_,x+1)}Hn(i)}return!0},ownKeys(a){b(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Te});for(var[u,l]of n)l.v!==Te&&!(u in a)&&c.push(u);return c},setPrototypeOf(){xl()}})}function Wr(t){try{if(t!==null&&typeof t=="object"&&qt in t)return t[qt]}catch{}return t}function Yl(t,e){return Object.is(Wr(t),Wr(e))}var jr,zr,Ur,Hr;function Jl(){if(jr===void 0){jr=window,zr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Ur=dn(e,"firstChild").get,Hr=dn(e,"nextSibling").get,_r(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),_r(n)&&(n.__t=void 0)}}function yt(t=""){return document.createTextNode(t)}function bn(t){return Ur.call(t)}function qn(t){return Hr.call(t)}function P(t,e){return bn(t)}function Xt(t,e=!1){{var n=bn(t);return n instanceof Comment&&n.data===""?qn(n):n}}function G(t,e=1,n=!1){let s=t;for(;e--;)s=qn(s);return s}function Ql(t){t.textContent=""}function qr(){return!1}let Vr=!1;function Zl(){Vr||(Vr=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function ps(t){var e=K,n=Z;Ae(null),st(null);try{return t()}finally{Ae(e),st(n)}}function $l(t,e,n,s=n){t.addEventListener(e,()=>ps(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),Zl()}function ec(t){Z===null&&(K===null&&Sl(),yl()),Yt&&wl()}function tc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function St(t,e,n){var s=Z;s!==null&&s.f&Le&&(t|=Le);var i={ctx:pe,deps:null,nodes_start:null,nodes_end:null,f:t|Re|Je,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Xn(i),i.f|=oi}catch(a){throw Oe(i),a}else e!==null&&Gt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&fn)&&(r=r.first,t&gt&&t&Ut&&r!==null&&(r.f|=Ut)),r!==null&&(r.parent=s,s!==null&&tc(r,s),K!==null&&K.f&_e&&!(t&zt))){var o=K;(o.effects??(o.effects=[])).push(r)}return i}function gs(){return K!==null&&!nt}function pi(t){const e=St(ri,null,!1);return Ee(e,xe),e.teardown=t,e}function Vn(t){ec();var e=Z.f,n=!K&&(e&mt)!==0&&(e&oi)===0;if(n){var s=pe;(s.e??(s.e=[])).push(t)}else return Gr(t)}function Gr(t){return St(ii|pl,t,!1)}function nc(t){wt.ensure();const e=St(zt|fn,t,!0);return(n={})=>new Promise(s=>{n.outro?wn(e,()=>{Oe(e),s(void 0)}):(Oe(e),s(void 0))})}function Kr(t){return St(ii,t,!1)}function sc(t){return St(li|fn,t,!0)}function gi(t,e=0){return St(ri|e,t,!0)}function J(t,e=[],n=[],s=[]){Hl(s,e,n,i=>{St(ri,()=>t(...i.map(b)),!0)})}function ms(t,e=0){var n=St(gt|e,t,!0);return n}function Ue(t){return St(mt|fn,t,!0)}function Xr(t){var e=t.teardown;if(e!==null){const n=Yt,s=K;eo(!0),Ae(null);try{e.call(null)}finally{eo(n),Ae(s)}}}function Yr(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&ps(()=>{i.abort(pn)});var s=n.next;n.f&zt?n.parent=null:Oe(n,e),n=s}}function ic(t){for(var e=t.first;e!==null;){var n=e.next;e.f&mt||Oe(e),e=n}}function Oe(t,e=!0){var n=!1;(e||t.f&xr)&&t.nodes_start!==null&&t.nodes_end!==null&&(rc(t.nodes_start,t.nodes_end),n=!0),Yr(t,e&&!n),bs(t,0),Ee(t,bt);var s=t.transitions;if(s!==null)for(const r of s)r.stop();Xr(t);var i=t.parent;i!==null&&i.first!==null&&Jr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function rc(t,e){for(;t!==null;){var n=t===e?null:qn(t);t.remove(),t=n}}function Jr(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function wn(t,e,n=!0){var s=[];mi(t,s,!0),Qr(s,()=>{n&&Oe(t),e&&e()})}function Qr(t,e){var n=t.length;if(n>0){var s=()=>--n||e();for(var i of t)i.out(s)}else e()}function mi(t,e,n){if(!(t.f&Le)){if(t.f^=Le,t.transitions!==null)for(const o of t.transitions)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var i=s.next,r=(s.f&Ut)!==0||(s.f&mt)!==0&&(t.f&gt)!==0;mi(s,e,r?n:!1),s=i}}}function vi(t){Zr(t,!0)}function Zr(t,e){if(t.f&Le){t.f^=Le,t.f&xe||(Ee(t,Re),Gt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Ut)!==0||(n.f&mt)!==0;Zr(n,i?e:!1),n=s}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function $r(t,e){for(var n=t.nodes_start,s=t.nodes_end;n!==null;){var i=n===s?null:qn(n);e.append(n),n=i}}let Dt=!1;function vs(t){Dt=t}let Yt=!1;function eo(t){Yt=t}let K=null,nt=!1;function Ae(t){K=t}let Z=null;function st(t){Z=t}let Ne=null;function to(t){K!==null&&(Ne===null?Ne=[t]:Ne.push(t))}let De=null,Fe=0,He=null;function oc(t){He=t}let no=1,Gn=0,Jt=Gn;function so(t){Jt=t}function io(){return++no}function Kn(t){var e=t.f;if(e&Re)return!0;if(e&_e&&(t.f&=~Ht),e&vt){var n=t.deps;if(n!==null)for(var s=n.length,i=0;i<s;i++){var r=n[i];if(Kn(r)&&Pr(r),r.wv>t.wv)return!0}e&Je&&ge===null&&Ee(t,xe)}return!1}function ro(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ne!=null&&Ne.includes(t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&_e?ro(r,e,!1):e===r&&(n?Ee(r,Re):r.f&xe&&Ee(r,vt),Gt(r))}}function oo(t){var p;var e=De,n=Fe,s=He,i=K,r=Ne,o=pe,a=nt,c=Jt,u=t.f;De=null,Fe=0,He=null,K=u&(mt|zt)?null:t,Ne=null,mn(t.ctx),nt=!1,Jt=++Gn,t.ac!==null&&(ps(()=>{t.ac.abort(pn)}),t.ac=null);try{t.f|=ai;var l=t.fn,h=l(),d=t.deps;if(De!==null){var f;if(bs(t,Fe),d!==null&&Fe>0)for(d.length=Fe+De.length,f=0;f<De.length;f++)d[Fe+f]=De[f];else t.deps=d=De;if(Dt&&gs()&&t.f&Je)for(f=Fe;f<d.length;f++)((p=d[f]).reactions??(p.reactions=[])).push(t)}else d!==null&&Fe<d.length&&(bs(t,Fe),d.length=Fe);if(Fn()&&He!==null&&!nt&&d!==null&&!(t.f&(_e|vt|Re)))for(f=0;f<He.length;f++)ro(He[f],t);return i!==null&&i!==t&&(Gn++,He!==null&&(s===null?s=He:s.push(...He))),t.f&Et&&(t.f^=Et),h}catch(m){return Nr(m)}finally{t.f^=ai,De=e,Fe=n,He=s,K=i,Ne=r,mn(o),nt=a,Jt=c}}function ac(t,e){let n=e.reactions;if(n!==null){var s=ll.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}n===null&&e.f&_e&&(De===null||!De.includes(e))&&(Ee(e,vt),e.f&Je&&(e.f^=Je,e.f&=~Ht),Mr(e),bs(e,0))}function bs(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)ac(t,n[s])}function Xn(t){var e=t.f;if(!(e&bt)){Ee(t,xe);var n=Z,s=Dt;Z=t,Dt=!0;try{e&gt?ic(t):Yr(t),Xr(t);var i=oo(t);t.teardown=typeof i=="function"?i:null,t.wv=no;var r;ti&&Rl&&t.f&Re&&t.deps}finally{Dt=s,Z=n}}}async function lc(){await Promise.resolve(),Ml()}function b(t){var e=t.f,n=(e&_e)!==0;if(K!==null&&!nt){var s=Z!==null&&(Z.f&bt)!==0;if(!s&&!(Ne!=null&&Ne.includes(t))){var i=K.deps;if(K.f&ai)t.rv<Gn&&(t.rv=Gn,De===null&&i!==null&&i[Fe]===t?Fe++:De===null?De=[t]:De.includes(t)||De.push(t));else{(K.deps??(K.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[K]:r.includes(K)||r.push(K)}}}if(Yt){if(Nt.has(t))return Nt.get(t);if(n){var o=t,a=o.v;return(!(o.f&xe)&&o.reactions!==null||lo(o))&&(a=di(o)),Nt.set(o,a),a}}else n&&!(ge!=null&&ge.has(t))&&(o=t,Kn(o)&&Pr(o),Dt&&gs()&&!(o.f&Je)&&ao(o));if(ge!=null&&ge.has(t))return ge.get(t);if(t.f&Et)throw t.v;return t.v}function ao(t){if(t.deps!==null){t.f^=Je;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&_e&&!(e.f&Je)&&ao(e)}}function lo(t){if(t.v===Te)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Nt.has(e)||e.f&_e&&lo(e))return!0;return!1}function Yn(t){var e=nt;try{return nt=!0,t()}finally{nt=e}}const cc=-7169;function Ee(t,e){t.f=t.f&cc|e}const co=new Set,bi=new Set;function uc(t,e,n,s={}){function i(r){if(s.capture||Jn.call(e,r),!r.cancelBubble)return ps(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Bn(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Qt(t,e,n,s,i){var r={capture:s,passive:i},o=uc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&pi(()=>{e.removeEventListener(t,o,r)})}function ws(t){for(var e=0;e<t.length;e++)co.add(t[e]);for(var n of bi)n(t)}let uo=null;function Jn(t){var E;var e=this,n=e.ownerDocument,s=t.type,i=((E=t.composedPath)==null?void 0:E.call(t))||[],r=i[0]||t.target;uo=t;var o=0,a=uo===t&&t.__root;if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){cl(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=K,h=Z;Ae(null),st(null);try{for(var d,f=[];r!==null;){var p=r.assignedSlot||r.parentNode||r.host||null;try{var m=r["__"+s];m!=null&&(!r.disabled||t.target===r)&&m.call(r,t)}catch(_){d?f.push(_):d=_}if(t.cancelBubble||p===e||p===null)break;r=p}if(d){for(let _ of f)queueMicrotask(()=>{throw _});throw d}}finally{t.__root=e,delete t.currentTarget,Ae(l),st(h)}}}function ho(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Qn(t,e){var n=Z;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function Y(t,e){var n=(e&rl)!==0,s=(e&ol)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=ho(r?t:"<!>"+t),n||(i=bn(i)));var o=s||zr?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=bn(o),c=o.lastChild;Qn(a,c)}else Qn(o,o);return o}}function hc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=ho(i),a=bn(o);r=bn(a)}var c=r.cloneNode(!0);return Qn(c,c),c}}function ys(t,e){return hc(t,e,"svg")}function wi(t=""){{var e=yt(t+"");return Qn(e,e),e}}function yn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=yt();return t.append(e,n),Qn(e,n),t}function L(t,e){t!==null&&t.before(e)}const dc=["touchstart","touchmove"];function fc(t){return dc.includes(t)}function ee(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function pc(t,e){return gc(t,e)}const Sn=new Map;function gc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0}){Jl();var a=new Set,c=h=>{for(var d=0;d<h.length;d++){var f=h[d];if(!a.has(f)){a.add(f);var p=fc(f);e.addEventListener(f,Jn,{passive:p});var m=Sn.get(f);m===void 0?(document.addEventListener(f,Jn,{passive:p}),Sn.set(f,1)):Sn.set(f,m+1)}}};c(si(co)),bi.add(c);var u=void 0,l=nc(()=>{var h=n??e.appendChild(yt());return Bl(h,{pending:()=>{}},d=>{if(r){It({});var f=pe;f.c=r}i&&(s.$$events=i),u=t(d,s)||{},r&&Ct()}),()=>{var p;for(var d of a){e.removeEventListener(d,Jn);var f=Sn.get(d);--f===0?(document.removeEventListener(d,Jn),Sn.delete(d)):Sn.set(d,f)}bi.delete(c),h!==n&&((p=h.parentNode)==null||p.removeChild(h))}});return mc.set(u,l),u}let mc=new WeakMap;class fo{constructor(e,n=!0){pt(this,"anchor");X(this,$e,new Map);X(this,ft,new Map);X(this,We,new Map);X(this,an,new Set);X(this,ss,!0);X(this,is,()=>{var e=Q;if(v(this,$e).has(e)){var n=v(this,$e).get(e),s=v(this,ft).get(n);if(s)vi(s),v(this,an).delete(n);else{var i=v(this,We).get(n);i&&(v(this,ft).set(n,i.effect),v(this,We).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of v(this,$e)){if(v(this,$e).delete(r),r===e)break;const a=v(this,We).get(o);a&&(Oe(a.effect),v(this,We).delete(o))}for(const[r,o]of v(this,ft)){if(r===n||v(this,an).has(r))continue;const a=()=>{if(Array.from(v(this,$e).values()).includes(r)){var u=document.createDocumentFragment();$r(o,u),u.append(yt()),v(this,We).set(r,{effect:o,fragment:u})}else Oe(o);v(this,an).delete(r),v(this,ft).delete(r)};v(this,ss)||!s?(v(this,an).add(r),wn(o,a,!1)):a()}}});X(this,Js,e=>{v(this,$e).delete(e);const n=Array.from(v(this,$e).values());for(const[s,i]of v(this,We))n.includes(s)||(Oe(i.effect),v(this,We).delete(s))});this.anchor=e,F(this,ss,n)}ensure(e,n){var s=Q,i=qr();if(n&&!v(this,ft).has(e)&&!v(this,We).has(e))if(i){var r=document.createDocumentFragment(),o=yt();r.append(o),v(this,We).set(e,{effect:Ue(()=>n(o)),fragment:r})}else v(this,ft).set(e,Ue(()=>n(this.anchor)));if(v(this,$e).set(s,e),i){for(const[a,c]of v(this,ft))a===e?s.skipped_effects.delete(c):s.skipped_effects.add(c);for(const[a,c]of v(this,We))a===e?s.skipped_effects.delete(c.effect):s.skipped_effects.add(c.effect);s.oncommit(v(this,is)),s.ondiscard(v(this,Js))}else v(this,is).call(this)}}$e=new WeakMap,ft=new WeakMap,We=new WeakMap,an=new WeakMap,ss=new WeakMap,is=new WeakMap,Js=new WeakMap;function yi(t){pe===null&&vl(),gn&&pe.l!==null?vc(pe).m.push(t):Vn(()=>{const e=Yn(t);if(typeof e=="function")return e})}function vc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ne(t,e,n=!1){var s=new fo(t),i=n?Ut:0;function r(o,a){s.ensure(o,a)}ms(()=>{var o=!1;e((a,c=!0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function po(t,e,n,s,i){var a;var r=(a=e.$$slots)==null?void 0:a[n],o=!1;r===!0&&(r=e.children,o=!0),r===void 0||r(t,o?()=>s:s)}function bc(t,e,n){var s=new fo(t);ms(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Ut)}function Rt(t,e){Kr(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function go(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=go(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function wc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=go(t))&&(s&&(s+=" "),s+=e);return s}function _n(t){return typeof t=="object"?wc(t):t??""}function yc(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function Ot(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=yc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function mo(t,e,n=!1){if(t.multiple){if(e==null)return;if(!ni(e))return Cl();for(var s of t.options)s.selected=e.includes(vo(s));return}for(s of t.options){var i=vo(s);if(Yl(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Sc(t){var e=new MutationObserver(()=>{mo(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),pi(()=>{e.disconnect()})}function vo(t){return"__value"in t?t.__value:t.value}const _c=Symbol("is custom element"),kc=Symbol("is html");function Tc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ke(t,e,n,s){var i=xc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[ml]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Ec(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function xc(t){return t.__attributes??(t.__attributes={[_c]:t.nodeName.includes("-"),[kc]:t.namespaceURI===al})}var bo=new Map;function Ec(t){var e=t.getAttribute("is")||t.nodeName,n=bo.get(e);if(n)return n;bo.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=ul(i);for(var o in s)s[o].set&&n.push(o);i=Sr(i)}return n}function Ic(t,e,n=e){var s=new WeakSet;$l(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Si(t)?_i(r):r,n(r),Q!==null&&s.add(Q),await lc(),r!==(r=e())){var o=t.selectionStart,a=t.selectionEnd,c=t.value.length;if(t.value=r??"",a!==null){var u=t.value.length;o===a&&a===c&&u>c?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=o,t.selectionEnd=Math.min(a,u))}}}),Yn(e)==null&&t.value&&(n(Si(t)?_i(t.value):t.value),Q!==null&&s.add(Q)),gi(()=>{var i=e();if(t===document.activeElement){var r=us??Q;if(s.has(r))return}Si(t)&&i===_i(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Si(t){var e=t.type;return e==="number"||e==="range"}function _i(t){return t===""?null:+t}function wo(t,e){return t===e||(t==null?void 0:t[qt])===e}function Cc(t={},e,n,s){return Kr(()=>{var i,r;return gi(()=>{i=r,r=[],Yn(()=>{t!==n(...r)&&(e(t,...r),i&&wo(n(...i),t)&&e(null,...i))})}),()=>{Bn(()=>{r&&wo(n(...r),t)&&e(null,...r)})}}),t}let Ss=!1;function Nc(t){var e=Ss;try{return Ss=!1,[t(),Ss]}finally{Ss=e}}function Be(t,e,n,s){var T;var i=!gn||(n&tl)!==0,r=(n&sl)!==0,o=(n&il)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?Yn(s):s),a),l;if(r){var h=qt in t||gl in t;l=((T=dn(t,e))==null?void 0:T.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,f=!1;r?[d,f]=Nc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&kl(),l(d)));var p;if(i?p=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:p=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&nl))return p;if(l){var m=t.$$legacy;return function(g,w){return arguments.length>0?((!i||!w||m||f)&&l(w?p():g),g):p()}}var E=!1,_=(n&el?fs:hi)(()=>(E=!1,p()));r&&b(_);var x=Z;return function(g,w){if(arguments.length>0){const k=w?b(_):i&&r?tt(g):g;return O(_,k),E=!0,a!==void 0&&(a=k),g}return Yt&&E||x.f&bt?_.v:b(_)}}function yo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function ki(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Ti(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function So(){const t="uniqueUserID";let e=Ti(t);return e||(e=yo(),ki(t,e,365)),e}function it(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Ti("uniqueUserID");r||(r=So());const o={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},a=new Date().toISOString();let c=Ti("sessionID");c||(c=yo(),ki("sessionID",c,1));const u={event_type:t,store_id:e,session_id:c,event_time:a,data:n,meta:{...s,user_id:r},device_info:o,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(l=>l.ok?l.json():l.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(l=>{throw console.error("Widget event tracking error:",l),l})}var _o={},Dc=function(t,e,n,s,i){var r=new Worker(_o[e]||(_o[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(o){var a=o.data,c=a.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],i(u,null)}else i(null,a)},r.postMessage(n,s),r},qe=Uint8Array,Me=Uint16Array,_s=Int32Array,ks=new qe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ts=new qe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xi=new qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ko=function(t,e){for(var n=new Me(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new _s(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},To=ko(ks,2),Rc=To.b,xs=To.r;Rc[28]=258,xs[258]=28;for(var Oc=ko(Ts,0),Ei=Oc.r,Es=new Me(32768),se=0;se<32768;++se){var At=(se&43690)>>1|(se&21845)<<1;At=(At&52428)>>2|(At&13107)<<2,At=(At&61680)>>4|(At&3855)<<4,Es[se]=((At&65280)>>8|(At&255)<<8)>>1}for(var kn=function(t,e,n){for(var s=t.length,i=0,r=new Me(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new Me(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new Me(1<<e);var c=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],l=e-t[i],h=o[t[i]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)a[Es[h]>>c]=u}else for(a=new Me(s),i=0;i<s;++i)t[i]&&(a[i]=Es[o[t[i]-1]++]>>15-t[i]);return a},Mt=new qe(288),se=0;se<144;++se)Mt[se]=8;for(var se=144;se<256;++se)Mt[se]=9;for(var se=256;se<280;++se)Mt[se]=7;for(var se=280;se<288;++se)Mt[se]=8;for(var Zn=new qe(32),se=0;se<32;++se)Zn[se]=5;var xo=kn(Mt,9,0),Eo=kn(Zn,5,0),Ii=function(t){return(t+7)/8|0},Io=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new qe(t.subarray(e,n))},Ac=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Co=function(t,e,n){var s=new Error(e||Ac[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Co),!n)throw s;return s},rt=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},Tn=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Is=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Ri,l:0};if(i==1){var o=new qe(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(w,k){return w.f-k.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,h=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[h].f?u++:h++],c=n[u!=l&&n[u].f<n[h].f?u++:h++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=r[0].s,s=1;s<i;++s)r[s].s>d&&(d=r[s].s);var f=new Me(d+1),p=Cs(n[l-1],f,0);if(p>e){var s=0,m=0,E=p-e,_=1<<E;for(r.sort(function(k,I){return f[I.s]-f[k.s]||k.f-I.f});s<i;++s){var x=r[s].s;if(f[x]>e)m+=_-(1<<p-f[x]),f[x]=e;else break}for(m>>=E;m>0;){var T=r[s].s;f[T]<e?m-=1<<e-f[T]++-1:++s}for(;s>=0&&m;--s){var g=r[s].s;f[g]==e&&(--f[g],++m)}p=e}return{t:new qe(f),l:p}},Cs=function(t,e,n){return t.s==-1?Math.max(Cs(t.l,e,n+1),Cs(t.r,e,n+1)):e[t.s]=n},Ci=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Me(++e),s=0,i=t[0],r=1,o=function(c){n[s++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(i),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(i);r=1,i=t[a]}return{c:n.subarray(0,s),n:e}},xn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Ni=function(t,e,n){var s=n.length,i=Ii(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Di=function(t,e,n,s,i,r,o,a,c,u,l){rt(e,l++,n),++i[256];for(var h=Is(i,15),d=h.t,f=h.l,p=Is(r,15),m=p.t,E=p.l,_=Ci(d),x=_.c,T=_.n,g=Ci(m),w=g.c,k=g.n,I=new Me(19),y=0;y<x.length;++y)++I[x[y]&31];for(var y=0;y<w.length;++y)++I[w[y]&31];for(var S=Is(I,7),A=S.t,W=S.l,B=19;B>4&&!A[xi[B-1]];--B);var V=u+5<<3,z=xn(i,Mt)+xn(r,Zn)+o,j=xn(i,d)+xn(r,m)+o+14+3*B+xn(I,A)+2*I[16]+3*I[17]+7*I[18];if(c>=0&&V<=z&&V<=j)return Ni(e,l,t.subarray(c,c+u));var C,R,N,M;if(rt(e,l,1+(j<z)),l+=2,j<z){C=kn(d,f,0),R=d,N=kn(m,E,0),M=m;var re=kn(A,W,0);rt(e,l,T-257),rt(e,l+5,k-1),rt(e,l+10,B-4),l+=14;for(var y=0;y<B;++y)rt(e,l+3*y,A[xi[y]]);l+=3*B;for(var H=[x,w],Ce=0;Ce<2;++Ce)for(var de=H[Ce],y=0;y<de.length;++y){var oe=de[y]&31;rt(e,l,re[oe]),l+=A[oe],oe>15&&(rt(e,l,de[y]>>5&127),l+=de[y]>>12)}}else C=xo,R=Mt,N=Eo,M=Zn;for(var y=0;y<a;++y){var D=s[y];if(D>255){var oe=D>>18&31;Tn(e,l,C[oe+257]),l+=R[oe+257],oe>7&&(rt(e,l,D>>23&31),l+=ks[oe]);var U=D&31;Tn(e,l,N[U]),l+=M[U],U>3&&(Tn(e,l,D>>5&8191),l+=Ts[U])}else Tn(e,l,C[D]),l+=R[D]}return Tn(e,l,C[256]),l+R[256]},No=new _s([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ri=new qe(0),Do=function(t,e,n,s,i,r){var o=r.z||t.length,a=new qe(s+o+5*(1+Math.ceil(o/7e3))+i),c=a.subarray(s,a.length-i),u=r.l,l=(r.r||0)&7;if(e){l&&(c[0]=r.r>>3);for(var h=No[e-1],d=h>>13,f=h&8191,p=(1<<n)-1,m=r.p||new Me(32768),E=r.h||new Me(p+1),_=Math.ceil(n/3),x=2*_,T=function(un){return(t[un]^t[un+1]<<_^t[un+2]<<x)&p},g=new _s(25e3),w=new Me(288),k=new Me(32),I=0,y=0,S=r.i||0,A=0,W=r.w||0,B=0;S+2<o;++S){var V=T(S),z=S&32767,j=E[V];if(m[z]=j,E[V]=z,W<=S){var C=o-S;if((I>7e3||A>24576)&&(C>423||!u)){l=Di(t,c,0,g,w,k,y,A,B,S-B,l),A=I=y=0,B=S;for(var R=0;R<286;++R)w[R]=0;for(var R=0;R<30;++R)k[R]=0}var N=2,M=0,re=f,H=z-j&32767;if(C>2&&V==T(S-H))for(var Ce=Math.min(d,C)-1,de=Math.min(32767,S),oe=Math.min(258,C);H<=de&&--re&&z!=j;){if(t[S+N]==t[S+N-H]){for(var D=0;D<oe&&t[S+D]==t[S+D-H];++D);if(D>N){if(N=D,M=H,D>Ce)break;for(var U=Math.min(H,D-2),fe=0,R=0;R<U;++R){var xt=S-H+R&32767,cn=m[xt],Wt=xt-cn&32767;Wt>fe&&(fe=Wt,j=xt)}}}z=j,j=m[z],H+=z-j&32767}if(M){g[A++]=268435456|xs[N]<<18|Ei[M];var Ye=xs[N]&31,rs=Ei[M]&31;y+=ks[Ye]+Ts[rs],++w[257+Ye],++k[rs],W=S+N,++I}else g[A++]=t[S],++w[t[S]]}}for(S=Math.max(S,W);S<o;++S)g[A++]=t[S],++w[t[S]];l=Di(t,c,u,g,w,k,y,A,B,S-B,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=E,r.p=m,r.i=S,r.w=W)}else{for(var S=r.w||0;S<o+u;S+=65535){var jt=S+65535;jt>=o&&(c[l/8|0]=u,jt=o),l=Ni(c,l+1,t.subarray(S,jt))}r.i=o}return Io(a,0,s+Ii(l)+i)},Ro=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Oo=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Ro[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Oi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new qe(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return Do(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},Mc=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},Ao=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<s.length;++o){var a=s[o],c=r[o];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var l=u.indexOf(" ",8)+1;e+=u.slice(l,u.indexOf("(",l))}else{e+=u;for(var h in a.prototype)e+=";"+c+".prototype."+h+"="+a.prototype[h].toString()}else e+=u}else n[c]=a}return e},Ns=[],Pc=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},Lc=function(t,e,n,s){if(!Ns[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Ao(t[a],i,r);Ns[n]={c:Ao(t[o],i,r),e:r}}var c=Mc({},Ns[n].e);return Dc(Ns[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,Pc(c),s)},Fc=function(){return[qe,Me,_s,ks,Ts,xi,xs,Ei,xo,Mt,Eo,Zn,Es,No,Ri,kn,rt,Tn,Is,Cs,Ci,xn,Ni,Di,Ii,Io,Do,Oi,jc,Mo]},Bc=function(){return[Po,Lo,Ds,Oo,Ro]},Mo=function(t){return postMessage(t,[t.buffer])},Wc=function(t,e,n,s,i,r){var o=Lc(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Ds=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Po=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Ds(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},Lo=function(t){return 10+(t.filename?t.filename.length+1:0)};function jc(t,e){return Oi(t,e||{},0,0)}function zc(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Co(7),Wc(t,e,[Fc,Bc,function(){return[Fo]}],function(s){return Mo(Fo(s.data[0],s.data[1]))},2,n)}function Fo(t,e){e||(e={});var n=Oo(),s=t.length;n.p(t);var i=Oi(t,e,Lo(e),8),r=i.length;return Po(i,e),Ds(i,r-8,n.d()),Ds(i,r-4,s),i}var Uc=typeof TextDecoder<"u"&&new TextDecoder,Hc=0;try{Uc.decode(Ri,{stream:!0}),Hc=1}catch{}class Bo{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class qc{constructor(e){this.dict=new Bo,this.app=e.app,this.isDictDisabled=e.isDictDisabled}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new Bo}}class Vc{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=Gc(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(o=>{o.filters.forEach(c=>{let u;c.type==="fetch"?(u={type:"network_request",subConditions:[],name:o.name},c.filters.forEach(l=>{const h=this.createConditionFromFilter(l);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(c),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],o.name),r.push({...u,name:o.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=En[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(o=>{let a;switch(o.key){case"url":a=e[3];break;case"status":a=e[6];break;case"method":a=e[2];break;case"duration":a=e[8];break}const c=En[o.operator];if(c&&c(a,o.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=En[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=En[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=En[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=En[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const En={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},Gc=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class Kc{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(l=>{const h=JSON.parse(l);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,o={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},a=e??this.app.session.getSessionToken(),c=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(o)});if(c.status===200){const u=await c.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(o=>{o.is_persist&&n.push(o)});let s="";return this.diffPersist(n).forEach(o=>{s+=`${JSON.stringify(o)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(o=>o.key===r.key)===-1)}}const Wo={htmlmasked:"hidden",masked:"obscured"},ot=!(typeof window>"u"),Xc=ot&&navigator.userAgent.match(/firefox|fxios/i),Yc=1e5;let Ai=ot?Date.now()-performance.now():0;function Mi(){Ai=Date.now()-performance.now()}function In(){return Ai}const Ze=ot&&performance.now?()=>Math.round(performance.now()+Ai):()=>Date.now(),Pi="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function jo(t){return t.trim().replace(/\s+/g," ")}function zo(t){return t.startsWith("https://")||t.startsWith("http://")}const Rs="https://docs.openreplay.com",Uo={};function Pt(t,e,n="/"){Uo[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Rs}${n} for more information.`),Uo[t]=!0)}function Li(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Pt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function Zt(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(Wo[e]&&Pt(`"${n}" attribute`,`"${Wo[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function Jc(t){try{return!!t.contentDocument}catch{return!1}}function Ho(t){try{return t instanceof HTMLIFrameElement?t.contentDocument:t instanceof Window?t.document:t instanceof Document?t.defaultView:"nodeType"in t?t.nodeType:"addEventListener"in t&&t.addEventListener,!0}catch(e){if(e instanceof DOMException&&e.name==="SecurityError")return!1}return!0}function qo(t){return t.toString(16).padStart(2,"0")}function Qc(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,qo).join("")):Array.from({length:t},()=>qo(Math.floor(Math.random()*16))).join("")}function Vo(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Fi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function Go(t,e){if(e)return new MutationObserver(t);{const n=Fi("MutationObserver");return new window[n](t)}}function Ko(t,e,n,s,i){if(!Ho(t))return;let r="addEventListener";i||(r=Fi("addEventListener"));try{t[r]?t[r](e,n,s):t.addEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}function Xo(t,e,n,s,i){if(!Ho(t))return;let r="removeEventListener";i||(r=Fi("removeEventListener"));try{t[r]?t[r](e,n,s):t.removeEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}class Zc{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const $c=new Zc;function eu(t){$c.addTask(t)}function Yo(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=Yo(r||{},i):n[s]=i}return n}function $t(t){return[0,t]}function tu(t,e){return[5,t,e]}function nu(t,e){return[6,t,e]}function su(){return[7]}function iu(t,e,n,s,i){return[8,t,e,n,s,i]}function ru(t,e,n){return[9,t,e,n]}function ou(t,e,n){return[10,t,e,n]}function au(t){return[11,t]}function Jo(t,e){return[13,t,e]}function lu(t,e){return[14,t,e]}function cu(t,e,n){return[16,t,e,n]}function uu(t,e,n){return[18,t,e,n]}function hu(t,e){return[19,t,e]}function du(t,e){return[20,t,e]}function fu(t,e){return[22,t,e]}function pu(t,e,n,s,i,r,o,a,c){return[23,t,e,n,s,i,r,o,a,c]}function gu(t,e,n){return[24,t,e,n]}function mu(t,e){return[27,t,e]}function vu(t){return[28,t]}function bu(t){return[29,t]}function Qo(t,e){return[30,t,e]}function wu(t,e,n,s){return[49,t,e,n,s]}function yu(t,e){return[54,t,e]}function Su(t){return[55,t]}function Zo(t,e,n,s){return[57,t,e,n,s]}function $o(t){return[58,t]}function Bi(t,e,n,s){return[60,t,e,n,s]}function _u(t,e,n){return[61,t,e,n]}function ku(t,e){return[63,t,e]}function Tu(t,e){return[64,t,e]}function xu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Wi(t,e){return[70,t,e]}function ea(t,e,n){return[71,t,e,n]}function ji(t,e,n,s){return[73,t,e,n,s]}function ta(t,e){return[75,t,e]}function na(t,e){return[76,t,e]}function Eu(t,e){return[77,t,e]}function zi(t,e,n,s){return[78,t,e,n,s]}function Os(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function Iu(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Cu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function sa(t,e,n){return[113,t,e,n]}function Nu(t){return[114,t]}function ia(t){return[115,t]}function ra(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function As(t){return[117,t]}function en(t){return[118,t]}function Du(t,e){return[119,t,e]}function Ru(t){return[120,t]}function Ou(t,e,n,s){return[122,t,e,n,s]}const Ui=ot&&"performance"in window&&"memory"in performance?performance:{memory:{}},Hi=ot?(navigator.deviceMemory||0)*1024:0,qi=Ui.memory.jsHeapSizeLimit||0;function Au(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const o=()=>{s===void 0||i===void 0||(t.send(wu(s,i,Ui.memory.totalJSHeapSize||0,Ui.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,o(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(o,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1)}const oa="__or__watched_tags__";class Mu{constructor(e){this.intervals={},this.tags=[],this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const n=JSON.parse(e.sessionStorage.getItem(oa)??"[]");this.setTags(n),this.observer=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting&&i.target){const r=i.target.__or_watcher_tagname;r&&this.onTagRendered(r),this.observer.unobserve(i.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(oa,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const Pu={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},Lu={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Ms={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},Fu={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},Bu={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},Wu={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},aa={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Cn={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},ju={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},Nn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},zu={...Nn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},la={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},ca={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},ua={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},Uu={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},ha={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},Hu={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},da={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},fa={fontWeight:"bold"},qu={fontSize:"13px",lineHeight:"auto"},pa={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},Vu={...pa,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},Gu={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},Ku={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},ga={Standard:{width:1280,height:720}};class Xu{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=o=>{o.data.size>0&&this.recordedChunks.push(o.data)},this.mediaRecorder.start()}catch(o){console.error(o)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function Yu(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,o(n.pageX,n.pageY);function o(u,l){let h=u-i,d=l-r;h<=5&&(h=5),d<=5&&(d=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),d>=window.innerHeight-s.height&&(d=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${d}px`}function a(u){o(u.pageX,u.pageY)}document.addEventListener("mousemove",a);const c=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)};document.addEventListener("mouseup",c)},e.ondragstart=function(){return!1}}function Ju(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function Qu(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function Zu(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
1
+ (function(ne,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.WineaterChatbot=ie())})(this,function(){"use strict";var wp=Object.defineProperty;var hl=ne=>{throw TypeError(ne)};var bp=(ne,ie,be)=>ie in ne?wp(ne,ie,{enumerable:!0,configurable:!0,writable:!0,value:be}):ne[ie]=be;var bt=(ne,ie,be)=>bp(ne,typeof ie!="symbol"?ie+"":ie,be),kr=(ne,ie,be)=>ie.has(ne)||hl("Cannot "+be);var v=(ne,ie,be)=>(kr(ne,ie,"read from private field"),be?be.call(ne):ie.get(ne)),U=(ne,ie,be)=>ie.has(ne)?hl("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(ne):ie.set(ne,be),j=(ne,ie,be,ds)=>(kr(ne,ie,"write to private field"),ds?ds.call(ne,be):ie.set(ne,be),be),ke=(ne,ie,be)=>(kr(ne,ie,"access private method"),be);var ol,Mn,Pn,cn,Ln,as,Bn,Ht,gt,Fn,je,Tr,xr,Er,dl,Qe,Sr,mt,un,Me,vt,ze,rt,Et,hn,qt,Wn,jn,zn,It,Zs,ye,yp,Sp,_p,Ir,ni,si,Cr,al,ot,wt,Ue,dn,ls,cs,$s,Un,fn,ll;const ne="5";typeof window<"u"&&((ol=window.__svelte??(window.__svelte={})).v??(ol.v=new Set)).add(ne);const ie=1,be=2,ds=16,fl=1,pl=2,gl=4,ml=8,vl=16,wl=1,bl=2,Te=Symbol(),Nr="http://www.w3.org/1999/xhtml",ii=!1;var ri=Array.isArray,yl=Array.prototype.indexOf,gn=Array.prototype.includes,fs=Array.from,Sl=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,_l=Object.getOwnPropertyDescriptors,kl=Object.prototype,Tl=Array.prototype,Rr=Object.getPrototypeOf,Dr=Object.isExtensible;const xl=()=>{};function El(t){for(var e=0;e<t.length;e++)t[e]()}function Or(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const xe=2,Hn=4,ps=8,Ar=1<<24,yt=16,$e=32,Gt=64,oi=128,qe=512,_e=1024,Ee=2048,et=4096,Be=8192,St=16384,Kt=32768,Xt=65536,Mr=1<<17,Pr=1<<18,vn=1<<19,Il=1<<20,Ct=1<<25,Yt=65536,ai=1<<21,li=1<<22,Nt=1<<23,Jt=Symbol("$state"),Cl=Symbol("legacy props"),Nl=Symbol(""),Qt=new class extends Error{constructor(){super(...arguments);bt(this,"name","StaleReactionError");bt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Rl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Dl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ol(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Al(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ml(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Ll(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Bl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Fl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Wl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function jl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ul(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Hl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Lr(t){return t===this.v}function ql(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Br(t){return!ql(t,this.v)}let wn=!1,Vl=!1;function Gl(){wn=!0}let me=null;function bn(t){me=t}function Rt(t,e=!1,n){me={p:me,i:!1,c:null,e:null,s:t,x:null,l:wn&&!e?{s:null,u:null,$:[]}:null}}function Dt(t){var e=me,n=e.e;if(n!==null){e.e=null;for(var s of n)oo(s)}return t!==void 0&&(e.x=t),e.i=!0,me=e.p,t??{}}function qn(){return!wn||me!==null&&me.l===null}let Zt=[];function Fr(){var t=Zt;Zt=[],El(t)}function Ot(t){if(Zt.length===0&&!Vn){var e=Zt;queueMicrotask(()=>{e===Zt&&Fr()})}Zt.push(t)}function Kl(){for(;Zt.length>0;)Fr()}function Wr(t){var e=Q;if(e===null)return H.f|=Nt,t;if(!(e.f&Kt)&&!(e.f&Hn))throw t;At(t,e)}function At(t,e){for(;e!==null;){if(e.f&oi){if(!(e.f&Kt))throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Xl=-7169;function fe(t,e){t.f=t.f&Xl|e}function ci(t){t.f&qe||t.deps===null?fe(t,_e):fe(t,et)}function jr(t){if(t!==null)for(const e of t)!(e.f&xe)||!(e.f&Yt)||(e.f^=Yt,jr(e.deps))}function zr(t,e,n){t.f&Ee?e.add(t):t.f&et&&n.add(t),jr(t.deps),fe(t,_e)}const gs=new Set;let F=null,ui=null,Ie=null,Re=[],ms=null,hi=!1,Vn=!1;const yr=class yr{constructor(){U(this,je);bt(this,"current",new Map);bt(this,"previous",new Map);U(this,Mn,new Set);U(this,Pn,new Set);U(this,cn,0);U(this,Ln,0);U(this,as,null);U(this,Bn,new Set);U(this,Ht,new Set);U(this,gt,new Map);bt(this,"is_fork",!1);U(this,Fn,!1)}skip_effect(e){v(this,gt).has(e)||v(this,gt).set(e,{d:[],m:[]})}unskip_effect(e){var n=v(this,gt).get(e);if(n){v(this,gt).delete(e);for(var s of n.d)fe(s,Ee),nt(s);for(s of n.m)fe(s,et),nt(s)}}process(e){var i;Re=[],this.apply();var n=[],s=[];for(const r of e)ke(this,je,xr).call(this,r,n,s);if(ke(this,je,Tr).call(this)){ke(this,je,Er).call(this,s),ke(this,je,Er).call(this,n);for(const[r,o]of v(this,gt))Gr(r,o)}else{for(const r of v(this,Mn))r();v(this,Mn).clear(),v(this,cn)===0&&ke(this,je,dl).call(this),ui=this,F=null,Hr(s),Hr(n),v(this,Bn).clear(),v(this,Ht).clear(),ui=null,(i=v(this,as))==null||i.resolve()}Ie=null}capture(e,n){n!==Te&&!this.previous.has(e)&&this.previous.set(e,n),e.f&Nt||(this.current.set(e,e.v),Ie==null||Ie.set(e,e.v))}activate(){F=this,this.apply()}deactivate(){F===this&&(F=null,Ie=null)}flush(){if(this.activate(),Re.length>0){if(Ur(),F!==null&&F!==this)return}else v(this,cn)===0&&this.process([]);this.deactivate()}discard(){for(const e of v(this,Pn))e(this);v(this,Pn).clear()}increment(e){j(this,cn,v(this,cn)+1),e&&j(this,Ln,v(this,Ln)+1)}decrement(e){j(this,cn,v(this,cn)-1),e&&j(this,Ln,v(this,Ln)-1),!v(this,Fn)&&(j(this,Fn,!0),Ot(()=>{j(this,Fn,!1),ke(this,je,Tr).call(this)?Re.length>0&&this.flush():this.revive()}))}revive(){for(const e of v(this,Bn))v(this,Ht).delete(e),fe(e,Ee),nt(e);for(const e of v(this,Ht))fe(e,et),nt(e);this.flush()}oncommit(e){v(this,Mn).add(e)}ondiscard(e){v(this,Pn).add(e)}settled(){return(v(this,as)??j(this,as,Or())).promise}static ensure(){if(F===null){const e=F=new yr;gs.add(F),Vn||Ot(()=>{F===e&&e.flush()})}return F}apply(){}};Mn=new WeakMap,Pn=new WeakMap,cn=new WeakMap,Ln=new WeakMap,as=new WeakMap,Bn=new WeakMap,Ht=new WeakMap,gt=new WeakMap,Fn=new WeakMap,je=new WeakSet,Tr=function(){return this.is_fork||v(this,Ln)>0},xr=function(e,n,s){e.f^=_e;for(var i=e.first;i!==null;){var r=i.f,o=(r&($e|Gt))!==0,a=o&&(r&_e)!==0,c=a||(r&Be)!==0||v(this,gt).has(i);if(!c&&i.fn!==null){o?i.f^=_e:r&Hn?n.push(i):Yn(i)&&(r&yt&&v(this,Ht).add(i),_n(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var l=i.next;if(l!==null){i=l;break}i=i.parent}}},Er=function(e){for(var n=0;n<e.length;n+=1)zr(e[n],v(this,Bn),v(this,Ht))},dl=function(){var i;if(gs.size>1){this.previous.clear();var e=Ie,n=!0;for(const r of gs){if(r===this){n=!1;continue}const o=[];for(const[c,u]of this.current){if(r.current.has(c))if(n&&u!==r.current.get(c))r.current.set(c,u);else continue;o.push(c)}if(o.length===0)continue;const a=[...r.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var s=Re;Re=[];const c=new Set,u=new Map;for(const l of o)qr(l,a,c,u);if(Re.length>0){F=r,r.apply();for(const l of Re)ke(i=r,je,xr).call(i,l,[],[]);r.deactivate()}Re=s}}F=null,Ie=e}v(this,gt).clear(),gs.delete(this)};let Mt=yr;function Yl(t){var e=Vn;Vn=!0;try{for(var n;;){if(Kl(),Re.length===0&&(F==null||F.flush(),Re.length===0))return ms=null,n;Ur()}}finally{Vn=e}}function Ur(){hi=!0;var t=null;try{for(var e=0;Re.length>0;){var n=Mt.ensure();if(e++>1e3){var s,i;Jl()}n.process(Re),Pt.clear()}}finally{Re=[],hi=!1,ms=null}}function Jl(){try{Ll()}catch(t){At(t,ms)}}let tt=null;function Hr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(St|Be))&&Yn(s)&&(tt=new Set,_n(s),s.deps===null&&s.first===null&&s.nodes===null&&s.teardown===null&&s.ac===null&&co(s),(tt==null?void 0:tt.size)>0)){Pt.clear();for(const i of tt){if(i.f&(St|Be))continue;const r=[i];let o=i.parent;for(;o!==null;)tt.has(o)&&(tt.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(St|Be)||_n(c)}}tt.clear()}}tt=null}}function qr(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&xe?qr(i,e,n,s):r&(li|yt)&&!(r&Ee)&&Vr(i,e,s)&&(fe(i,Ee),nt(i))}}function Vr(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(gn.call(e,i))return!0;if(i.f&xe&&Vr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function nt(t){var e=ms=t,n=e.b;if(n!=null&&n.is_pending&&t.f&(Hn|ps|Ar)&&!(t.f&Kt)){n.defer_effect(t);return}for(;e.parent!==null;){e=e.parent;var s=e.f;if(hi&&e===Q&&s&yt&&!(s&Pr)&&s&Kt)return;if(s&(Gt|$e)){if(!(s&_e))return;e.f^=_e}}Re.push(e)}function Gr(t,e){if(!(t.f&$e&&t.f&_e)){t.f&Ee?e.d.push(t):t.f&et&&e.m.push(t),fe(t,_e);for(var n=t.first;n!==null;)Gr(n,e),n=n.next}}function Ql(t){let e=0,n=$t(0),s;return()=>{mi()&&(w(n),wi(()=>(e===0&&(s=Qn(()=>t(()=>Gn(n)))),e+=1,()=>{Ot(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Gn(n))})})))}}var Zl=Xt|vn;function $l(t,e,n,s){new ec(t,e,n,s)}class ec{constructor(e,n,s,i){U(this,ye);bt(this,"parent");bt(this,"is_pending",!1);bt(this,"transform_error");U(this,Qe);U(this,Sr,null);U(this,mt);U(this,un);U(this,Me);U(this,vt,null);U(this,ze,null);U(this,rt,null);U(this,Et,null);U(this,hn,0);U(this,qt,0);U(this,Wn,!1);U(this,jn,new Set);U(this,zn,new Set);U(this,It,null);U(this,Zs,Ql(()=>(j(this,It,$t(v(this,hn))),()=>{j(this,It,null)})));var r;j(this,Qe,e),j(this,mt,n),j(this,un,o=>{var a=Q;a.b=this,a.f|=oi,s(o)}),this.parent=Q.b,this.transform_error=i??((r=this.parent)==null?void 0:r.transform_error)??(o=>o),j(this,Me,ys(()=>{ke(this,ye,Ir).call(this)},Zl))}defer_effect(e){zr(e,v(this,jn),v(this,zn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!v(this,mt).pending}update_pending_count(e){ke(this,ye,Cr).call(this,e),j(this,hn,v(this,hn)+e),!(!v(this,It)||v(this,Wn))&&(j(this,Wn,!0),Ot(()=>{j(this,Wn,!1),v(this,It)&&yn(v(this,It),v(this,hn))}))}get_effect_pending(){return v(this,Zs).call(this),w(v(this,It))}error(e){var n=v(this,mt).onerror;let s=v(this,mt).failed;if(!n&&!s)throw e;v(this,vt)&&(De(v(this,vt)),j(this,vt,null)),v(this,ze)&&(De(v(this,ze)),j(this,ze,null)),v(this,rt)&&(De(v(this,rt)),j(this,rt,null));var i=!1,r=!1;const o=()=>{if(i){Hl();return}i=!0,r&&zl(),v(this,rt)!==null&&en(v(this,rt),()=>{j(this,rt,null)}),ke(this,ye,si).call(this,()=>{Mt.ensure(),ke(this,ye,Ir).call(this)})},a=c=>{try{r=!0,n==null||n(c,o),r=!1}catch(u){At(u,v(this,Me)&&v(this,Me).parent)}s&&j(this,rt,ke(this,ye,si).call(this,()=>{Mt.ensure();try{return Ve(()=>{var u=Q;u.b=this,u.f|=oi,s(v(this,Qe),()=>c,()=>o)})}catch(u){return At(u,v(this,Me).parent),null}}))};Ot(()=>{var c;try{c=this.transform_error(e)}catch(u){At(u,v(this,Me)&&v(this,Me).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,u=>At(u,v(this,Me)&&v(this,Me).parent)):a(c)})}}Qe=new WeakMap,Sr=new WeakMap,mt=new WeakMap,un=new WeakMap,Me=new WeakMap,vt=new WeakMap,ze=new WeakMap,rt=new WeakMap,Et=new WeakMap,hn=new WeakMap,qt=new WeakMap,Wn=new WeakMap,jn=new WeakMap,zn=new WeakMap,It=new WeakMap,Zs=new WeakMap,ye=new WeakSet,yp=function(){try{j(this,vt,Ve(()=>v(this,un).call(this,v(this,Qe))))}catch(e){this.error(e)}},Sp=function(e){const n=v(this,mt).failed;n&&j(this,rt,Ve(()=>{n(v(this,Qe),()=>e,()=>()=>{})}))},_p=function(){const e=v(this,mt).pending;e&&(this.is_pending=!0,j(this,ze,Ve(()=>e(v(this,Qe)))),Ot(()=>{var n=j(this,Et,document.createDocumentFragment()),s=_t();n.append(s),j(this,vt,ke(this,ye,si).call(this,()=>(Mt.ensure(),Ve(()=>v(this,un).call(this,s))))),v(this,qt)===0&&(v(this,Qe).before(n),j(this,Et,null),en(v(this,ze),()=>{j(this,ze,null)}),ke(this,ye,ni).call(this))}))},Ir=function(){try{if(this.is_pending=this.has_pending_snippet(),j(this,qt,0),j(this,hn,0),j(this,vt,Ve(()=>{v(this,un).call(this,v(this,Qe))})),v(this,qt)>0){var e=j(this,Et,document.createDocumentFragment());fo(v(this,vt),e);const n=v(this,mt).pending;j(this,ze,Ve(()=>n(v(this,Qe))))}else ke(this,ye,ni).call(this)}catch(n){this.error(n)}},ni=function(){this.is_pending=!1;for(const e of v(this,jn))fe(e,Ee),nt(e);for(const e of v(this,zn))fe(e,et),nt(e);v(this,jn).clear(),v(this,zn).clear()},si=function(e){var n=Q,s=H,i=me;lt(v(this,Me)),Ge(v(this,Me)),bn(v(this,Me).ctx);try{return e()}catch(r){return Wr(r),null}finally{lt(n),Ge(s),bn(i)}},Cr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&ke(n=this.parent,ye,Cr).call(n,e);return}j(this,qt,v(this,qt)+e),v(this,qt)===0&&(ke(this,ye,ni).call(this),v(this,ze)&&en(v(this,ze),()=>{j(this,ze,null)}),v(this,Et)&&(v(this,Qe).before(v(this,Et)),j(this,Et,null)))};function tc(t,e,n,s){const i=qn()?vs:fi;var r=t.filter(h=>!h.settled);if(n.length===0&&r.length===0){s(e.map(i));return}var o=Q,a=nc(),c=r.length===1?r[0].promise:r.length>1?Promise.all(r.map(h=>h.promise)):null;function u(h){a();try{s(h)}catch(d){o.f&St||At(d,o)}di()}if(n.length===0){c.then(()=>u(e.map(i)));return}function l(){a(),Promise.all(n.map(h=>ic(h))).then(h=>u([...e.map(i),...h])).catch(h=>At(h,o))}c?c.then(l):l()}function nc(){var t=Q,e=H,n=me,s=F;return function(r=!0){lt(t),Ge(e),bn(n),r&&(s==null||s.activate())}}function di(t=!0){lt(null),Ge(null),bn(null),t&&(F==null||F.deactivate())}function sc(){var t=Q.b,e=F,n=t.is_rendered();return t.update_pending_count(1),e.increment(n),()=>{t.update_pending_count(-1),e.decrement(n)}}function vs(t){var e=xe|Ee,n=H!==null&&H.f&xe?H:null;return Q!==null&&(Q.f|=vn),{ctx:me,deps:null,effects:null,equals:Lr,f:e,fn:t,reactions:null,rv:0,v:Te,wv:0,parent:n??Q,ac:null}}function ic(t,e,n){Q===null&&Dl();var i=void 0,r=$t(Te),o=!H,a=new Map;return wc(()=>{var d;var c=Or();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).finally(di)}catch(p){c.reject(p),di()}var u=F;if(o){var l=sc();(d=a.get(u))==null||d.reject(Qt),a.delete(u),a.set(u,c)}const h=(p,f=void 0)=>{if(u.activate(),f)f!==Qt&&(r.f|=Nt,yn(r,f));else{r.f&Nt&&(r.f^=Nt),yn(r,p);for(const[m,y]of a){if(a.delete(m),m===u)break;y.reject(Qt)}}l&&l()};c.promise.then(h,p=>h(null,p||"unknown"))}),vi(()=>{for(const c of a.values())c.reject(Qt)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function ae(t){const e=vs(t);return go(e),e}function fi(t){const e=vs(t);return e.equals=Br,e}function rc(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)De(e[n])}}function oc(t){for(var e=t.parent;e!==null;){if(!(e.f&xe))return e.f&St?null:e;e=e.parent}return null}function pi(t){var e,n=Q;lt(oc(t));try{t.f&=~Yt,rc(t),e=yo(t)}finally{lt(n)}return e}function Kr(t){var e=pi(t);if(!t.equals(e)&&(t.wv=wo(),(!(F!=null&&F.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){fe(t,_e);return}Lt||(Ie!==null?(mi()||F!=null&&F.is_fork)&&Ie.set(t,e):ci(t))}function ac(t){var e,n;if(t.effects!==null)for(const s of t.effects)(s.teardown||s.ac)&&((e=s.teardown)==null||e.call(s),(n=s.ac)==null||n.abort(Qt),s.teardown=xl,s.ac=null,Jn(s,0),bi(s))}function Xr(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&_n(e)}let gi=new Set;const Pt=new Map;let Yr=!1;function $t(t,e){var n={f:0,v:t,reactions:null,equals:Lr,rv:0,wv:0};return n}function le(t,e){const n=$t(t);return go(n),n}function lc(t,e=!1,n=!0){var i;const s=$t(t);return e||(s.equals=Br),wn&&n&&me!==null&&me.l!==null&&((i=me.l).s??(i.s=[])).push(s),s}function D(t,e,n=!1){H!==null&&(!st||H.f&Mr)&&qn()&&H.f&(xe|yt|li|Mr)&&(Ke===null||!gn.call(Ke,t))&&jl();let s=n?at(e):e;return yn(t,s)}function yn(t,e){if(!t.equals(e)){var n=t.v;Lt?Pt.set(t,e):Pt.set(t,n),t.v=e;var s=Mt.ensure();if(s.capture(t,n),t.f&xe){const i=t;t.f&Ee&&pi(i),ci(i)}t.wv=wo(),Qr(t,Ee),qn()&&Q!==null&&Q.f&_e&&!(Q.f&($e|Gt))&&(Xe===null?Sc([t]):Xe.push(t)),!s.is_fork&&gi.size>0&&!Yr&&cc()}return e}function cc(){Yr=!1;for(const t of gi)t.f&_e&&fe(t,et),Yn(t)&&_n(t);gi.clear()}function Jr(t,e=1){var n=w(t),s=e===1?n++:n--;return D(t,n),s}function Gn(t){D(t,t.v+1)}function Qr(t,e){var n=t.reactions;if(n!==null)for(var s=qn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===Q)){var c=(a&Ee)===0;if(c&&fe(o,e),a&xe){var u=o;Ie==null||Ie.delete(u),a&Yt||(a&qe&&(o.f|=Yt),Qr(u,et))}else c&&(a&yt&&tt!==null&&tt.add(o),nt(o))}}}function at(t){if(typeof t!="object"||t===null||Jt in t)return t;const e=Rr(t);if(e!==kl&&e!==Tl)return t;var n=new Map,s=ri(t),i=le(0),r=nn,o=a=>{if(nn===r)return a();var c=H,u=nn;Ge(null),vo(r);var l=a();return Ge(c),vo(u),l};return s&&n.set("length",le(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Fl();var l=n.get(c);return l===void 0?o(()=>{var h=le(u.value);return n.set(c,h),h}):D(l,u.value,!0),!0},deleteProperty(a,c){var u=n.get(c);if(u===void 0){if(c in a){const l=o(()=>le(Te));n.set(c,l),Gn(i)}}else D(u,Te),Gn(i);return!0},get(a,c,u){var p;if(c===Jt)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(p=mn(a,c))!=null&&p.writable)&&(l=o(()=>{var f=at(h?a[c]:Te),m=le(f);return m}),n.set(c,l)),l!==void 0){var d=w(l);return d===Te?void 0:d}return Reflect.get(a,c,u)},getOwnPropertyDescriptor(a,c){var u=Reflect.getOwnPropertyDescriptor(a,c);if(u&&"value"in u){var l=n.get(c);l&&(u.value=w(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Te)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===Jt)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Te||Reflect.has(a,c);if(u!==void 0||Q!==null&&(!l||(d=mn(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var p=l?at(a[c]):Te,f=le(p);return f}),n.set(c,u));var h=w(u);if(h===Te)return!1}return l},set(a,c,u,l){var x;var h=n.get(c),d=c in a;if(s&&c==="length")for(var p=u;p<h.v;p+=1){var f=n.get(p+"");f!==void 0?D(f,Te):p in a&&(f=o(()=>le(Te)),n.set(p+"",f))}if(h===void 0)(!d||(x=mn(a,c))!=null&&x.writable)&&(h=o(()=>le(void 0)),D(h,at(u)),n.set(c,h));else{d=h.v!==Te;var m=o(()=>at(u));D(h,m)}var y=Reflect.getOwnPropertyDescriptor(a,c);if(y!=null&&y.set&&y.set.call(l,u),!d){if(s&&typeof c=="string"){var S=n.get("length"),_=Number(c);Number.isInteger(_)&&_>=S.v&&D(S,_+1)}Gn(i)}return!0},ownKeys(a){w(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Te});for(var[u,l]of n)l.v!==Te&&!(u in a)&&c.push(u);return c},setPrototypeOf(){Wl()}})}function Zr(t){try{if(t!==null&&typeof t=="object"&&Jt in t)return t[Jt]}catch{}return t}function uc(t,e){return Object.is(Zr(t),Zr(e))}var $r,eo,to,no;function hc(){if($r===void 0){$r=window,eo=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;to=mn(e,"firstChild").get,no=mn(e,"nextSibling").get,Dr(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Dr(n)&&(n.__t=void 0)}}function _t(t=""){return document.createTextNode(t)}function Sn(t){return to.call(t)}function Kn(t){return no.call(t)}function A(t,e){return Sn(t)}function ws(t,e=!1){{var n=Sn(t);return n instanceof Comment&&n.data===""?Kn(n):n}}function V(t,e=1,n=!1){let s=t;for(;e--;)s=Kn(s);return s}function dc(t){t.textContent=""}function so(){return!1}function io(t,e,n){return document.createElementNS(Nr,t,void 0)}let ro=!1;function fc(){ro||(ro=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function bs(t){var e=H,n=Q;Ge(null),lt(null);try{return t()}finally{Ge(e),lt(n)}}function pc(t,e,n,s=n){t.addEventListener(e,()=>bs(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),fc()}function gc(t){Q===null&&(H===null&&Pl(),Ml()),Lt&&Al()}function mc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function kt(t,e,n){var s=Q;s!==null&&s.f&Be&&(t|=Be);var i={ctx:me,deps:null,nodes:null,f:t|Ee|qe,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(i)}catch(a){throw De(i),a}else e!==null&&nt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&!(r.f&vn)&&(r=r.first,t&yt&&t&Xt&&r!==null&&(r.f|=Xt)),r!==null&&(r.parent=s,s!==null&&mc(r,s),H!==null&&H.f&xe&&!(t&Gt))){var o=H;(o.effects??(o.effects=[])).push(r)}return i}function mi(){return H!==null&&!st}function vi(t){const e=kt(ps,null,!1);return fe(e,_e),e.teardown=t,e}function Xn(t){gc();var e=Q.f,n=!H&&(e&$e)!==0&&(e&Kt)===0;if(n){var s=me;(s.e??(s.e=[])).push(t)}else return oo(t)}function oo(t){return kt(Hn|Il,t,!1)}function vc(t){Mt.ensure();const e=kt(Gt|vn,t,!0);return(n={})=>new Promise(s=>{n.outro?en(e,()=>{De(e),s(void 0)}):(De(e),s(void 0))})}function ao(t){return kt(Hn,t,!1)}function wc(t){return kt(li|vn,t,!0)}function wi(t,e=0){return kt(ps|e,t,!0)}function X(t,e=[],n=[],s=[]){tc(s,e,n,i=>{kt(ps,()=>t(...i.map(w)),!0)})}function ys(t,e=0){var n=kt(yt|e,t,!0);return n}function Ve(t){return kt($e|vn,t,!0)}function lo(t){var e=t.teardown;if(e!==null){const n=Lt,s=H;po(!0),Ge(null);try{e.call(null)}finally{po(n),Ge(s)}}}function bi(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&bs(()=>{i.abort(Qt)});var s=n.next;n.f&Gt?n.parent=null:De(n,e),n=s}}function bc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&$e||De(e),e=n}}function De(t,e=!0){var n=!1;(e||t.f&Pr)&&t.nodes!==null&&t.nodes.end!==null&&(yc(t.nodes.start,t.nodes.end),n=!0),bi(t,e&&!n),Jn(t,0),fe(t,St);var s=t.nodes&&t.nodes.t;if(s!==null)for(const r of s)r.stop();lo(t);var i=t.parent;i!==null&&i.first!==null&&co(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function yc(t,e){for(;t!==null;){var n=t===e?null:Kn(t);t.remove(),t=n}}function co(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function en(t,e,n=!0){var s=[];uo(t,s,!0);var i=()=>{n&&De(t),e&&e()},r=s.length;if(r>0){var o=()=>--r||i();for(var a of s)a.out(o)}else i()}function uo(t,e,n){if(!(t.f&Be)){t.f^=Be;var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||n)&&e.push(a);for(var i=t.first;i!==null;){var r=i.next,o=(i.f&Xt)!==0||(i.f&$e)!==0&&(t.f&yt)!==0;uo(i,e,o?n:!1),i=r}}}function yi(t){ho(t,!0)}function ho(t,e){if(t.f&Be){t.f^=Be,t.f&_e||(fe(t,Ee),nt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Xt)!==0||(n.f&$e)!==0;ho(n,i?e:!1),n=s}var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||e)&&o.in()}}function fo(t,e){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end;n!==null;){var i=n===s?null:Kn(n);e.append(n),n=i}}let Ss=!1,Lt=!1;function po(t){Lt=t}let H=null,st=!1;function Ge(t){H=t}let Q=null;function lt(t){Q=t}let Ke=null;function go(t){H!==null&&(Ke===null?Ke=[t]:Ke.push(t))}let Oe=null,Fe=0,Xe=null;function Sc(t){Xe=t}let mo=1,tn=0,nn=tn;function vo(t){nn=t}function wo(){return++mo}function Yn(t){var e=t.f;if(e&Ee)return!0;if(e&xe&&(t.f&=~Yt),e&et){for(var n=t.deps,s=n.length,i=0;i<s;i++){var r=n[i];if(Yn(r)&&Kr(r),r.wv>t.wv)return!0}e&qe&&Ie===null&&fe(t,_e)}return!1}function bo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ke!==null&&gn.call(Ke,t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&xe?bo(r,e,!1):e===r&&(n?fe(r,Ee):r.f&_e&&fe(r,et),nt(r))}}function yo(t){var m;var e=Oe,n=Fe,s=Xe,i=H,r=Ke,o=me,a=st,c=nn,u=t.f;Oe=null,Fe=0,Xe=null,H=u&($e|Gt)?null:t,Ke=null,bn(t.ctx),st=!1,nn=++tn,t.ac!==null&&(bs(()=>{t.ac.abort(Qt)}),t.ac=null);try{t.f|=ai;var l=t.fn,h=l();t.f|=Kt;var d=t.deps,p=F==null?void 0:F.is_fork;if(Oe!==null){var f;if(p||Jn(t,Fe),d!==null&&Fe>0)for(d.length=Fe+Oe.length,f=0;f<Oe.length;f++)d[Fe+f]=Oe[f];else t.deps=d=Oe;if(mi()&&t.f&qe)for(f=Fe;f<d.length;f++)((m=d[f]).reactions??(m.reactions=[])).push(t)}else!p&&d!==null&&Fe<d.length&&(Jn(t,Fe),d.length=Fe);if(qn()&&Xe!==null&&!st&&d!==null&&!(t.f&(xe|et|Ee)))for(f=0;f<Xe.length;f++)bo(Xe[f],t);if(i!==null&&i!==t){if(tn++,i.deps!==null)for(let y=0;y<n;y+=1)i.deps[y].rv=tn;if(e!==null)for(const y of e)y.rv=tn;Xe!==null&&(s===null?s=Xe:s.push(...Xe))}return t.f&Nt&&(t.f^=Nt),h}catch(y){return Wr(y)}finally{t.f^=ai,Oe=e,Fe=n,Xe=s,H=i,Ke=r,bn(o),st=a,nn=c}}function _c(t,e){let n=e.reactions;if(n!==null){var s=yl.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}if(n===null&&e.f&xe&&(Oe===null||!gn.call(Oe,e))){var r=e;r.f&qe&&(r.f^=qe,r.f&=~Yt),ci(r),ac(r),Jn(r,0)}}function Jn(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)_c(t,n[s])}function _n(t){var e=t.f;if(!(e&St)){fe(t,_e);var n=Q,s=Ss;Q=t,Ss=!0;try{e&(yt|Ar)?bc(t):bi(t),lo(t);var i=yo(t);t.teardown=typeof i=="function"?i:null,t.wv=mo;var r;ii&&Vl&&t.f&Ee&&t.deps}finally{Ss=s,Q=n}}}async function kc(){await Promise.resolve(),Yl()}function w(t){var e=t.f,n=(e&xe)!==0;if(H!==null&&!st){var s=Q!==null&&(Q.f&St)!==0;if(!s&&(Ke===null||!gn.call(Ke,t))){var i=H.deps;if(H.f&ai)t.rv<tn&&(t.rv=tn,Oe===null&&i!==null&&i[Fe]===t?Fe++:Oe===null?Oe=[t]:Oe.push(t));else{(H.deps??(H.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[H]:gn.call(r,H)||r.push(H)}}}if(Lt&&Pt.has(t))return Pt.get(t);if(n){var o=t;if(Lt){var a=o.v;return(!(o.f&_e)&&o.reactions!==null||_o(o))&&(a=pi(o)),Pt.set(o,a),a}var c=(o.f&qe)===0&&!st&&H!==null&&(Ss||(H.f&qe)!==0),u=(o.f&Kt)===0;Yn(o)&&(c&&(o.f|=qe),Kr(o)),c&&!u&&(Xr(o),So(o))}if(Ie!=null&&Ie.has(t))return Ie.get(t);if(t.f&Nt)throw t.v;return t.v}function So(t){if(t.f|=qe,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&xe&&!(e.f&qe)&&(Xr(e),So(e))}function _o(t){if(t.v===Te)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Pt.has(e)||e.f&xe&&_o(e))return!0;return!1}function Qn(t){var e=st;try{return st=!0,t()}finally{st=e}}const sn=Symbol("events"),ko=new Set,Si=new Set;function Tc(t,e,n,s={}){function i(r){if(s.capture||_i.call(e,r),!r.cancelBubble)return bs(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Ot(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function rn(t,e,n,s,i){var r={capture:s,passive:i},o=Tc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&vi(()=>{e.removeEventListener(t,o,r)})}function kn(t,e,n){(e[sn]??(e[sn]={}))[t]=n}function _s(t){for(var e=0;e<t.length;e++)ko.add(t[e]);for(var n of Si)n(t)}let To=null;function _i(t){var y,S;var e=this,n=e.ownerDocument,s=t.type,i=((y=t.composedPath)==null?void 0:y.call(t))||[],r=i[0]||t.target;To=t;var o=0,a=To===t&&t[sn];if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t[sn]=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){Sl(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=H,h=Q;Ge(null),lt(null);try{for(var d,p=[];r!==null;){var f=r.assignedSlot||r.parentNode||r.host||null;try{var m=(S=r[sn])==null?void 0:S[s];m!=null&&(!r.disabled||t.target===r)&&m.call(r,t)}catch(_){d?p.push(_):d=_}if(t.cancelBubble||f===e||f===null)break;r=f}if(d){for(let _ of p)queueMicrotask(()=>{throw _});throw d}}finally{t[sn]=e,delete t.currentTarget,Ge(l),lt(h)}}}const ki=((al=globalThis==null?void 0:globalThis.window)==null?void 0:al.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function xc(t){return(ki==null?void 0:ki.createHTML(t))??t}function xo(t){var e=io("template");return e.innerHTML=xc(t.replaceAll("<!>","<!---->")),e.content}function Zn(t,e){var n=Q;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function K(t,e){var n=(e&wl)!==0,s=(e&bl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=xo(r?t:"<!>"+t),n||(i=Sn(i)));var o=s||eo?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=Sn(o),c=o.lastChild;Zn(a,c)}else Zn(o,o);return o}}function Ec(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=xo(i),a=Sn(o);r=Sn(a)}var c=r.cloneNode(!0);return Zn(c,c),c}}function ks(t,e){return Ec(t,e,"svg")}function Ti(t=""){{var e=_t(t+"");return Zn(e,e),e}}function xi(){var t=document.createDocumentFragment(),e=document.createComment(""),n=_t();return t.append(e,n),Zn(e,n),t}function P(t,e){t!==null&&t.before(e)}const Ic=["touchstart","touchmove"];function Cc(t){return Ic.includes(t)}function se(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=`${n}`)}function Nc(t,e){return Rc(t,e)}const Ts=new Map;function Rc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0,transformError:a}){hc();var c=void 0,u=vc(()=>{var l=n??e.appendChild(_t());$l(l,{pending:()=>{}},p=>{Rt({});var f=me;r&&(f.c=r),i&&(s.$$events=i),c=t(p,s)||{},Dt()},a);var h=new Set,d=p=>{for(var f=0;f<p.length;f++){var m=p[f];if(!h.has(m)){h.add(m);var y=Cc(m);for(const x of[e,document]){var S=Ts.get(x);S===void 0&&(S=new Map,Ts.set(x,S));var _=S.get(m);_===void 0?(x.addEventListener(m,_i,{passive:y}),S.set(m,1)):S.set(m,_+1)}}}};return d(fs(ko)),Si.add(d),()=>{var y;for(var p of h)for(const S of[e,document]){var f=Ts.get(S),m=f.get(p);--m==0?(S.removeEventListener(p,_i),f.delete(p),f.size===0&&Ts.delete(S)):f.set(p,m)}Si.delete(d),l!==n&&((y=l.parentNode)==null||y.removeChild(l))}});return Dc.set(c,u),c}let Dc=new WeakMap;class Eo{constructor(e,n=!0){bt(this,"anchor");U(this,ot,new Map);U(this,wt,new Map);U(this,Ue,new Map);U(this,dn,new Set);U(this,ls,!0);U(this,cs,()=>{var e=F;if(v(this,ot).has(e)){var n=v(this,ot).get(e),s=v(this,wt).get(n);if(s)yi(s),v(this,dn).delete(n);else{var i=v(this,Ue).get(n);i&&(v(this,wt).set(n,i.effect),v(this,Ue).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of v(this,ot)){if(v(this,ot).delete(r),r===e)break;const a=v(this,Ue).get(o);a&&(De(a.effect),v(this,Ue).delete(o))}for(const[r,o]of v(this,wt)){if(r===n||v(this,dn).has(r))continue;const a=()=>{if(Array.from(v(this,ot).values()).includes(r)){var u=document.createDocumentFragment();fo(o,u),u.append(_t()),v(this,Ue).set(r,{effect:o,fragment:u})}else De(o);v(this,dn).delete(r),v(this,wt).delete(r)};v(this,ls)||!s?(v(this,dn).add(r),en(o,a,!1)):a()}}});U(this,$s,e=>{v(this,ot).delete(e);const n=Array.from(v(this,ot).values());for(const[s,i]of v(this,Ue))n.includes(s)||(De(i.effect),v(this,Ue).delete(s))});this.anchor=e,j(this,ls,n)}ensure(e,n){var s=F,i=so();if(n&&!v(this,wt).has(e)&&!v(this,Ue).has(e))if(i){var r=document.createDocumentFragment(),o=_t();r.append(o),v(this,Ue).set(e,{effect:Ve(()=>n(o)),fragment:r})}else v(this,wt).set(e,Ve(()=>n(this.anchor)));if(v(this,ot).set(s,e),i){for(const[a,c]of v(this,wt))a===e?s.unskip_effect(c):s.skip_effect(c);for(const[a,c]of v(this,Ue))a===e?s.unskip_effect(c.effect):s.skip_effect(c.effect);s.oncommit(v(this,cs)),s.ondiscard(v(this,$s))}else v(this,cs).call(this)}}ot=new WeakMap,wt=new WeakMap,Ue=new WeakMap,dn=new WeakMap,ls=new WeakMap,cs=new WeakMap,$s=new WeakMap;function Ei(t){me===null&&Rl(),wn&&me.l!==null?Oc(me).m.push(t):Xn(()=>{const e=Qn(t);if(typeof e=="function")return e})}function Oc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ce(t,e,n=!1){var s=new Eo(t),i=n?Xt:0;function r(o,a){s.ensure(o,a)}ys(()=>{var o=!1;e((a,c=0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function $n(t,e){return e}function Ac(t,e,n){for(var s=[],i=e.length,r,o=e.length,a=0;a<i;a++){let h=e[a];en(h,()=>{if(r){if(r.pending.delete(h),r.done.add(h),r.pending.size===0){var d=t.outrogroups;Ii(fs(r.done)),d.delete(r),d.size===0&&(t.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=s.length===0&&n!==null;if(c){var u=n,l=u.parentNode;dc(l),l.append(u),t.items.clear()}Ii(e,!c)}else r={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(r)}function Ii(t,e=!0){for(var n=0;n<t.length;n++)De(t[n],e)}var Io;function es(t,e,n,s,i,r=null){var o=t,a=new Map;{var c=t;o=c.appendChild(_t())}var u=null,l=fi(()=>{var y=n();return ri(y)?y:y==null?[]:fs(y)}),h,d=!0;function p(){m.fallback=u,Mc(m,h,o,e,s),u!==null&&(h.length===0?u.f&Ct?(u.f^=Ct,ns(u,null,o)):yi(u):en(u,()=>{u=null}))}var f=ys(()=>{h=w(l);for(var y=h.length,S=new Set,_=F,x=so(),g=0;g<y;g+=1){var b=h[g],E=s(b,g),I=d?null:a.get(E);I?(I.v&&yn(I.v,b),I.i&&yn(I.i,g),x&&_.unskip_effect(I.e)):(I=Pc(a,d?o:Io??(Io=_t()),b,E,g,i,e,n),d||(I.e.f|=Ct),a.set(E,I)),S.add(E)}if(y===0&&r&&!u&&(d?u=Ve(()=>r(o)):(u=Ve(()=>r(Io??(Io=_t()))),u.f|=Ct)),y>S.size&&Ol(),!d)if(x){for(const[k,T]of a)S.has(k)||_.skip_effect(T.e);_.oncommit(p),_.ondiscard(()=>{})}else p();w(l)}),m={effect:f,items:a,outrogroups:null,fallback:u};d=!1}function ts(t){for(;t!==null&&!(t.f&$e);)t=t.next;return t}function Mc(t,e,n,s,i){var k;var r=e.length,o=t.items,a=ts(t.effect.first),c,u=null,l=[],h=[],d,p,f,m;for(m=0;m<r;m+=1){if(d=e[m],p=i(d,m),f=o.get(p).e,t.outrogroups!==null)for(const T of t.outrogroups)T.pending.delete(f),T.done.delete(f);if(f.f&Ct)if(f.f^=Ct,f===a)ns(f,null,n);else{var y=u?u.next:a;f===t.effect.last&&(t.effect.last=f.prev),f.prev&&(f.prev.next=f.next),f.next&&(f.next.prev=f.prev),Bt(t,u,f),Bt(t,f,y),ns(f,y,n),u=f,l=[],h=[],a=ts(u.next);continue}if(f.f&Be&&yi(f),f!==a){if(c!==void 0&&c.has(f)){if(l.length<h.length){var S=h[0],_;u=S.prev;var x=l[0],g=l[l.length-1];for(_=0;_<l.length;_+=1)ns(l[_],S,n);for(_=0;_<h.length;_+=1)c.delete(h[_]);Bt(t,x.prev,g.next),Bt(t,u,x),Bt(t,g,S),a=S,u=g,m-=1,l=[],h=[]}else c.delete(f),ns(f,a,n),Bt(t,f.prev,f.next),Bt(t,f,u===null?t.effect.first:u.next),Bt(t,u,f),u=f;continue}for(l=[],h=[];a!==null&&a!==f;)(c??(c=new Set)).add(a),h.push(a),a=ts(a.next);if(a===null)continue}f.f&Ct||l.push(f),u=f,a=ts(f.next)}if(t.outrogroups!==null){for(const T of t.outrogroups)T.pending.size===0&&(Ii(fs(T.done)),(k=t.outrogroups)==null||k.delete(T));t.outrogroups.size===0&&(t.outrogroups=null)}if(a!==null||c!==void 0){var b=[];if(c!==void 0)for(f of c)f.f&Be||b.push(f);for(;a!==null;)!(a.f&Be)&&a!==t.fallback&&b.push(a),a=ts(a.next);var E=b.length;if(E>0){var I=r===0?n:null;Ac(t,b,I)}}}function Pc(t,e,n,s,i,r,o,a){var c=o&ie?o&ds?$t(n):lc(n,!1,!1):null,u=o&be?$t(i):null;return{v:c,i:u,e:Ve(()=>(r(e,c??n,u??i,a),()=>{t.delete(s)}))}}function ns(t,e,n){if(t.nodes)for(var s=t.nodes.start,i=t.nodes.end,r=e&&!(e.f&Ct)?e.nodes.start:n;s!==null;){var o=Kn(s);if(r.before(s),s===i)return;s=o}}function Bt(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Co(t,e,n,s,i){var a;var r=(a=e.$$slots)==null?void 0:a[n],o=!1;r===!0&&(r=e.children,o=!0),r===void 0||r(t,o?()=>s:s)}function Lc(t,e,n){var s=new Eo(t);ys(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Xt)}function Ft(t,e){ao(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=io("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function No(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=No(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Bc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=No(t))&&(s&&(s+=" "),s+=e);return s}function Tn(t){return typeof t=="object"?Bc(t):t??""}function Fc(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function Wt(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=Fc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function Ro(t,e,n=!1){if(t.multiple){if(e==null)return;if(!ri(e))return Ul();for(var s of t.options)s.selected=e.includes(Do(s));return}for(s of t.options){var i=Do(s);if(uc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Wc(t){var e=new MutationObserver(()=>{Ro(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),vi(()=>{e.disconnect()})}function Do(t){return"__value"in t?t.__value:t.value}const jc=Symbol("is custom element"),zc=Symbol("is html");function Uc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ce(t,e,n,s){var i=Hc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Nl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&qc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Hc(t){return t.__attributes??(t.__attributes={[jc]:t.nodeName.includes("-"),[zc]:t.namespaceURI===Nr})}var Oo=new Map;function qc(t){var e=t.getAttribute("is")||t.nodeName,n=Oo.get(e);if(n)return n;Oo.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=_l(i);for(var o in s)s[o].set&&n.push(o);i=Rr(i)}return n}function Vc(t,e,n=e){var s=new WeakSet;pc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ci(t)?Ni(r):r,n(r),F!==null&&s.add(F),await kc(),r!==(r=e())){var o=t.selectionStart,a=t.selectionEnd,c=t.value.length;if(t.value=r??"",a!==null){var u=t.value.length;o===a&&a===c&&u>c?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=o,t.selectionEnd=Math.min(a,u))}}}),Qn(e)==null&&t.value&&(n(Ci(t)?Ni(t.value):t.value),F!==null&&s.add(F)),wi(()=>{var i=e();if(t===document.activeElement){var r=ui??F;if(s.has(r))return}Ci(t)&&i===Ni(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ci(t){var e=t.type;return e==="number"||e==="range"}function Ni(t){return t===""?null:+t}function Ao(t,e){return t===e||(t==null?void 0:t[Jt])===e}function Gc(t={},e,n,s){return ao(()=>{var i,r;return wi(()=>{i=r,r=[],Qn(()=>{t!==n(...r)&&(e(t,...r),i&&Ao(n(...i),t)&&e(null,...i))})}),()=>{Ot(()=>{r&&Ao(n(...r),t)&&e(null,...r)})}}),t}let xs=!1;function Kc(t){var e=xs;try{return xs=!1,[t(),xs]}finally{xs=e}}function We(t,e,n,s){var x;var i=!wn||(n&pl)!==0,r=(n&ml)!==0,o=(n&vl)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?Qn(s):s),a),l;if(r){var h=Jt in t||Cl in t;l=((x=mn(t,e))==null?void 0:x.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,p=!1;r?[d,p]=Kc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&Bl(),l(d)));var f;if(i?f=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:f=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&gl))return f;if(l){var m=t.$$legacy;return function(g,b){return arguments.length>0?((!i||!b||m||p)&&l(b?f():g),g):f()}}var y=!1,S=(n&fl?vs:fi)(()=>(y=!1,f()));r&&w(S);var _=Q;return function(g,b){if(arguments.length>0){const E=b?w(S):i&&r?at(g):g;return D(S,E),y=!0,a!==void 0&&(a=E),g}return Lt&&y||_.f&St?S.v:w(S)}}function Mo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Ri(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Di(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function Po(){const t="uniqueUserID";let e=Di(t);return e||(e=Mo(),Ri(t,e,365)),e}function ct(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Di("uniqueUserID");r||(r=Po());const o={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},a=new Date().toISOString();let c=Di("sessionID");c||(c=Mo(),Ri("sessionID",c,1));const u={event_type:t,store_id:e,session_id:c,event_time:a,data:n,meta:{...s,user_id:r},device_info:o,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(l=>l.ok?l.json():l.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(l=>{throw console.error("Widget event tracking error:",l),l})}var Lo={},Xc=function(t,e,n,s,i){var r=new Worker(Lo[e]||(Lo[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(o){var a=o.data,c=a.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],i(u,null)}else i(null,a)},r.postMessage(n,s),r},Ye=Uint8Array,Ae=Uint16Array,Es=Int32Array,Is=new Ye([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Cs=new Ye([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Oi=new Ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bo=function(t,e){for(var n=new Ae(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Es(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},Fo=Bo(Is,2),Yc=Fo.b,Ns=Fo.r;Yc[28]=258,Ns[258]=28;for(var Jc=Bo(Cs,0),Ai=Jc.r,Rs=new Ae(32768),oe=0;oe<32768;++oe){var jt=(oe&43690)>>1|(oe&21845)<<1;jt=(jt&52428)>>2|(jt&13107)<<2,jt=(jt&61680)>>4|(jt&3855)<<4,Rs[oe]=((jt&65280)>>8|(jt&255)<<8)>>1}for(var xn=function(t,e,n){for(var s=t.length,i=0,r=new Ae(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new Ae(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new Ae(1<<e);var c=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],l=e-t[i],h=o[t[i]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)a[Rs[h]>>c]=u}else for(a=new Ae(s),i=0;i<s;++i)t[i]&&(a[i]=Rs[o[t[i]-1]++]>>15-t[i]);return a},zt=new Ye(288),oe=0;oe<144;++oe)zt[oe]=8;for(var oe=144;oe<256;++oe)zt[oe]=9;for(var oe=256;oe<280;++oe)zt[oe]=7;for(var oe=280;oe<288;++oe)zt[oe]=8;for(var ss=new Ye(32),oe=0;oe<32;++oe)ss[oe]=5;var Wo=xn(zt,9,0),jo=xn(ss,5,0),Mi=function(t){return(t+7)/8|0},zo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Ye(t.subarray(e,n))},Qc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Uo=function(t,e,n){var s=new Error(e||Qc[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Uo),!n)throw s;return s},ut=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},En=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Ds=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Fi,l:0};if(i==1){var o=new Ye(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(b,E){return b.f-E.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,h=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[h].f?u++:h++],c=n[u!=l&&n[u].f<n[h].f?u++:h++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=r[0].s,s=1;s<i;++s)r[s].s>d&&(d=r[s].s);var p=new Ae(d+1),f=Os(n[l-1],p,0);if(f>e){var s=0,m=0,y=f-e,S=1<<y;for(r.sort(function(E,I){return p[I.s]-p[E.s]||E.f-I.f});s<i;++s){var _=r[s].s;if(p[_]>e)m+=S-(1<<f-p[_]),p[_]=e;else break}for(m>>=y;m>0;){var x=r[s].s;p[x]<e?m-=1<<e-p[x]++-1:++s}for(;s>=0&&m;--s){var g=r[s].s;p[g]==e&&(--p[g],++m)}f=e}return{t:new Ye(p),l:f}},Os=function(t,e,n){return t.s==-1?Math.max(Os(t.l,e,n+1),Os(t.r,e,n+1)):e[t.s]=n},Pi=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ae(++e),s=0,i=t[0],r=1,o=function(c){n[s++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(i),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(i);r=1,i=t[a]}return{c:n.subarray(0,s),n:e}},In=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Li=function(t,e,n){var s=n.length,i=Mi(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Bi=function(t,e,n,s,i,r,o,a,c,u,l){ut(e,l++,n),++i[256];for(var h=Ds(i,15),d=h.t,p=h.l,f=Ds(r,15),m=f.t,y=f.l,S=Pi(d),_=S.c,x=S.n,g=Pi(m),b=g.c,E=g.n,I=new Ae(19),k=0;k<_.length;++k)++I[_[k]&31];for(var k=0;k<b.length;++k)++I[b[k]&31];for(var T=Ds(I,7),M=T.t,G=T.l,z=19;z>4&&!M[Oi[z-1]];--z);var Z=u+5<<3,W=In(i,zt)+In(r,ss)+o,L=In(i,d)+In(r,m)+o+14+3*z+In(I,M)+2*I[16]+3*I[17]+7*I[18];if(c>=0&&Z<=W&&Z<=L)return Li(e,l,t.subarray(c,c+u));var Y,$,R,J;if(ut(e,l,1+(L<W)),l+=2,L<W){Y=xn(d,p,0),$=d,R=xn(m,y,0),J=m;var N=xn(M,G,0);ut(e,l,x-257),ut(e,l+5,E-1),ut(e,l+10,z-4),l+=14;for(var k=0;k<z;++k)ut(e,l+3*k,M[Oi[k]]);l+=3*z;for(var O=[_,b],te=0;te<2;++te)for(var re=O[te],k=0;k<re.length;++k){var ue=re[k]&31;ut(e,l,N[ue]),l+=M[ue],ue>15&&(ut(e,l,re[k]>>5&127),l+=re[k]>>12)}}else Y=Wo,$=zt,R=jo,J=ss;for(var k=0;k<a;++k){var C=s[k];if(C>255){var ue=C>>18&31;En(e,l,Y[ue+257]),l+=$[ue+257],ue>7&&(ut(e,l,C>>23&31),l+=Is[ue]);var B=C&31;En(e,l,R[B]),l+=J[B],B>3&&(En(e,l,C>>5&8191),l+=Cs[B])}else En(e,l,Y[C]),l+=$[C]}return En(e,l,Y[256]),l+$[256]},Ho=new Es([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fi=new Ye(0),qo=function(t,e,n,s,i,r){var o=r.z||t.length,a=new Ye(s+o+5*(1+Math.ceil(o/7e3))+i),c=a.subarray(s,a.length-i),u=r.l,l=(r.r||0)&7;if(e){l&&(c[0]=r.r>>3);for(var h=Ho[e-1],d=h>>13,p=h&8191,f=(1<<n)-1,m=r.p||new Ae(32768),y=r.h||new Ae(f+1),S=Math.ceil(n/3),_=2*S,x=function(pn){return(t[pn]^t[pn+1]<<S^t[pn+2]<<_)&f},g=new Es(25e3),b=new Ae(288),E=new Ae(32),I=0,k=0,T=r.i||0,M=0,G=r.w||0,z=0;T+2<o;++T){var Z=x(T),W=T&32767,L=y[Z];if(m[W]=L,y[Z]=W,G<=T){var Y=o-T;if((I>7e3||M>24576)&&(Y>423||!u)){l=Bi(t,c,0,g,b,E,k,M,z,T-z,l),M=I=k=0,z=T;for(var $=0;$<286;++$)b[$]=0;for(var $=0;$<30;++$)E[$]=0}var R=2,J=0,N=p,O=W-L&32767;if(Y>2&&Z==x(T-O))for(var te=Math.min(d,Y)-1,re=Math.min(32767,T),ue=Math.min(258,Y);O<=re&&--N&&W!=L;){if(t[T+R]==t[T+R-O]){for(var C=0;C<ue&&t[T+C]==t[T+C-O];++C);if(C>R){if(R=C,J=O,C>te)break;for(var B=Math.min(O,C-2),ee=0,$=0;$<B;++$){var Se=T-O+$&32767,Ze=m[Se],Pe=Se-Ze&32767;Pe>ee&&(ee=Pe,L=Se)}}}W=L,L=m[W],O+=W-L&32767}if(J){g[M++]=268435456|Ns[R]<<18|Ai[J];var Le=Ns[R]&31,us=Ai[J]&31;k+=Is[Le]+Cs[us],++b[257+Le],++E[us],G=T+R,++I}else g[M++]=t[T],++b[t[T]]}}for(T=Math.max(T,G);T<o;++T)g[M++]=t[T],++b[t[T]];l=Bi(t,c,u,g,b,E,k,M,z,T-z,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=y,r.p=m,r.i=T,r.w=G)}else{for(var T=r.w||0;T<o+u;T+=65535){var Vt=T+65535;Vt>=o&&(c[l/8|0]=u,Vt=o),l=Li(c,l+1,t.subarray(T,Vt))}r.i=o}return zo(a,0,s+Mi(l)+i)},Vo=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Go=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Vo[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Wi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Ye(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return qo(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},Zc=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},Ko=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<s.length;++o){var a=s[o],c=r[o];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var l=u.indexOf(" ",8)+1;e+=u.slice(l,u.indexOf("(",l))}else{e+=u;for(var h in a.prototype)e+=";"+c+".prototype."+h+"="+a.prototype[h].toString()}else e+=u}else n[c]=a}return e},As=[],$c=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},eu=function(t,e,n,s){if(!As[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Ko(t[a],i,r);As[n]={c:Ko(t[o],i,r),e:r}}var c=Zc({},As[n].e);return Xc(As[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,$c(c),s)},tu=function(){return[Ye,Ae,Es,Is,Cs,Oi,Ns,Ai,Wo,zt,jo,ss,Rs,Ho,Fi,xn,ut,En,Ds,Os,Pi,In,Li,Bi,Mi,zo,qo,Wi,iu,Xo]},nu=function(){return[Yo,Jo,Ms,Go,Vo]},Xo=function(t){return postMessage(t,[t.buffer])},su=function(t,e,n,s,i,r){var o=eu(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Ms=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Yo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Ms(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},Jo=function(t){return 10+(t.filename?t.filename.length+1:0)};function iu(t,e){return Wi(t,e||{},0,0)}function ru(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Uo(7),su(t,e,[tu,nu,function(){return[Qo]}],function(s){return Xo(Qo(s.data[0],s.data[1]))},2,n)}function Qo(t,e){e||(e={});var n=Go(),s=t.length;n.p(t);var i=Wi(t,e,Jo(e),8),r=i.length;return Yo(i,e),Ms(i,r-8,n.d()),Ms(i,r-4,s),i}var ou=typeof TextDecoder<"u"&&new TextDecoder,au=0;try{ou.decode(Fi,{stream:!0}),au=1}catch{}class Zo{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class lu{constructor(e){this.dict=new Zo,this.app=e.app,this.isDictDisabled=e.isDictDisabled}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new Zo}}class cu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=uu(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(o=>{o.filters.forEach(c=>{let u;c.type==="fetch"?(u={type:"network_request",subConditions:[],name:o.name},c.filters.forEach(l=>{const h=this.createConditionFromFilter(l);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(c),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],o.name),r.push({...u,name:o.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(o=>{let a;switch(o.key){case"url":a=e[3];break;case"status":a=e[6];break;case"method":a=e[2];break;case"duration":a=e[8];break}const c=Cn[o.operator];if(c&&c(a,o.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=Cn[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=Cn[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const Cn={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},uu=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class hu{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(l=>{const h=JSON.parse(l);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,o={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},a=e??this.app.session.getSessionToken(),c=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(o)});if(c.status===200){const u=await c.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(o=>{o.is_persist&&n.push(o)});let s="";return this.diffPersist(n).forEach(o=>{s+=`${JSON.stringify(o)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(o=>o.key===r.key)===-1)}}const $o={htmlmasked:"hidden",masked:"obscured"},ht=!(typeof window>"u"),du=ht&&navigator.userAgent.match(/firefox|fxios/i),fu=1e5;let ji=ht?Date.now()-performance.now():0;function zi(){ji=Date.now()-performance.now()}function Nn(){return ji}const it=ht&&performance.now?()=>Math.round(performance.now()+ji):()=>Date.now(),Ui="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function ea(t){return t.trim().replace(/\s+/g," ")}function ta(t){return t.startsWith("https://")||t.startsWith("http://")}const Ps="https://docs.openreplay.com",na={};function Ut(t,e,n="/"){na[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Ps}${n} for more information.`),na[t]=!0)}function Hi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Ut('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function on(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?($o[e]&&Ut(`"${n}" attribute`,`"${$o[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function pu(t){try{return!!t.contentDocument}catch{return!1}}function sa(t){try{return t instanceof HTMLIFrameElement?t.contentDocument:t instanceof Window?t.document:t instanceof Document?t.defaultView:"nodeType"in t?t.nodeType:"addEventListener"in t&&t.addEventListener,!0}catch(e){if(e instanceof DOMException&&e.name==="SecurityError")return!1}return!0}function ia(t){return t.toString(16).padStart(2,"0")}function gu(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,ia).join("")):Array.from({length:t},()=>ia(Math.floor(Math.random()*16))).join("")}function ra(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function qi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function oa(t,e){if(e)return new MutationObserver(t);{const n=qi("MutationObserver");return new window[n](t)}}function aa(t,e,n,s,i){if(!sa(t))return;let r="addEventListener";i||(r=qi("addEventListener"));try{t[r]?t[r](e,n,s):t.addEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}function la(t,e,n,s,i){if(!sa(t))return;let r="removeEventListener";i||(r=qi("removeEventListener"));try{t[r]?t[r](e,n,s):t.removeEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}class mu{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const vu=new mu;function wu(t){vu.addTask(t)}function ca(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=ca(r||{},i):n[s]=i}return n}function an(t){return[0,t]}function bu(t,e){return[5,t,e]}function yu(t,e){return[6,t,e]}function Su(){return[7]}function _u(t,e,n,s,i){return[8,t,e,n,s,i]}function ku(t,e,n){return[9,t,e,n]}function Tu(t,e,n){return[10,t,e,n]}function xu(t){return[11,t]}function ua(t,e){return[13,t,e]}function Eu(t,e){return[14,t,e]}function Iu(t,e,n){return[16,t,e,n]}function Cu(t,e,n){return[18,t,e,n]}function Nu(t,e){return[19,t,e]}function Ru(t,e){return[20,t,e]}function Du(t,e){return[22,t,e]}function Ou(t,e,n,s,i,r,o,a,c){return[23,t,e,n,s,i,r,o,a,c]}function Au(t,e,n){return[24,t,e,n]}function Mu(t,e){return[27,t,e]}function Pu(t){return[28,t]}function Lu(t){return[29,t]}function ha(t,e){return[30,t,e]}function Bu(t,e,n,s){return[49,t,e,n,s]}function Fu(t,e){return[54,t,e]}function Wu(t){return[55,t]}function da(t,e,n,s){return[57,t,e,n,s]}function fa(t){return[58,t]}function Vi(t,e,n,s){return[60,t,e,n,s]}function ju(t,e,n){return[61,t,e,n]}function zu(t,e){return[63,t,e]}function Uu(t,e){return[64,t,e]}function Hu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Gi(t,e){return[70,t,e]}function pa(t,e,n){return[71,t,e,n]}function Ki(t,e,n,s){return[73,t,e,n,s]}function ga(t,e){return[75,t,e]}function ma(t,e){return[76,t,e]}function qu(t,e){return[77,t,e]}function Xi(t,e,n,s){return[78,t,e,n,s]}function Ls(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function Vu(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Gu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function va(t,e,n){return[113,t,e,n]}function Ku(t){return[114,t]}function wa(t){return[115,t]}function ba(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function Bs(t){return[117,t]}function ln(t){return[118,t]}function Xu(t,e){return[119,t,e]}function Yu(t){return[120,t]}function Ju(t,e,n,s){return[122,t,e,n,s]}const Yi=ht&&"performance"in window&&"memory"in performance?performance:{memory:{}},Ji=ht?(navigator.deviceMemory||0)*1024:0,Qi=Yi.memory.jsHeapSizeLimit||0;function Qu(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const o=()=>{s===void 0||i===void 0||(t.send(Bu(s,i,Yi.memory.totalJSHeapSize||0,Yi.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,o(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(o,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1)}const ya="__or__watched_tags__";class Zu{constructor(e){this.intervals={},this.tags=[],this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const n=JSON.parse(e.sessionStorage.getItem(ya)??"[]");this.setTags(n),this.observer=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting&&i.target){const r=i.target.__or_watcher_tagname;r&&this.onTagRendered(r),this.observer.unobserve(i.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(ya,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const $u={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},eh={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Fs={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},th={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},nh={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},sh={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},Sa={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Rn={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},ih={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},Dn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},rh={...Dn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},_a={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},ka={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},Ta={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},oh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},xa={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},ah={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},Ea={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},Ia={fontWeight:"bold"},lh={fontSize:"13px",lineHeight:"auto"},Ca={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},ch={...Ca,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},uh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},hh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Na={Standard:{width:1280,height:720}};class dh{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=o=>{o.data.size>0&&this.recordedChunks.push(o.data)},this.mediaRecorder.start()}catch(o){console.error(o)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function fh(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,o(n.pageX,n.pageY);function o(u,l){let h=u-i,d=l-r;h<=5&&(h=5),d<=5&&(d=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),d>=window.innerHeight-s.height&&(d=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${d}px`}function a(u){o(u.pageX,u.pageY)}document.addEventListener("mousemove",a);const c=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)};document.addEventListener("mouseup",c)},e.ondragstart=function(){return!1}}function ph(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function gh(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function mh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
2
2
  0% { transform: rotate(0deg); }
3
3
  100% { transform: rotate(360deg); }
4
- }`,document.head.appendChild(t)}function $u(){Zu();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,Ku),t}function q(t,e,n,s,i){const r=document.createElement(t);return r.className=e,Object.assign(r.style,n),s&&(r.textContent=s),i&&(r.id=i),r}const Ps="or_uxt_test_start",Vi="or_uxt_task_index",Gi="or_uxt_session_id",eh="or_uxt_test_id";class th{constructor(e,n,s,i,r,o,a,c,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=o,this.removeStorageKey=a,this.getStorageKey=c,this.getSessionId=u,this.durations={testStart:0,tasks:[]},this.getDurations=()=>this.durations,this.setDurations=h=>{this.durations.testStart=h.testStart,this.durations.tasks=h.tasks},this.signalTask=(h,d,f)=>{if(!h)return console.error("User Testing: No Task ID Given");const p=this.durations.tasks.find(_=>_.taskId===h),m=this.getTimestamp(),E=p?m-p.started:0;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,taskId:h,status:d,duration:E,timestamp:m,taskAnswer:f})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const m=this.getSessionId();this.setStorageKey(Gi,m),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(Ps,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(Vi),this.removeStorageKey(Ps);const f=this.durations.testStart||d,p=d-f;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,status:h,duration:p,timestamp:d})})};const l=this.getStorageKey(Ps);l&&(this.durations.testStart=parseInt(l,10))}}class nh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=q("div","bg",Pu,void 0,"__or_ut_bg"),this.container=q("div","container",Lu,void 0,"__or_ut_ct"),this.widgetGuidelinesVisible=!0,this.widgetTasksVisible=!1,this.widgetVisible=!0,this.isActive=!1,this.descriptionSection=null,this.taskSection=null,this.endSection=null,this.stopButton=null,this.stopButtonContainer=null,this.test=null,this.testId=null,this.signalManager=null,this.getTest=(o,a,c)=>{this.testId=o;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${o}`,{headers:{Authorization:`Bearer ${a}`}}).then(l=>l.json()).then(({test:l})=>{this.isActive=!0,this.test=l,this.signalManager=new th(this.app.options.ingestPoint,()=>this.app.timestamp(),a,o,this.storageKey,(h,d)=>this.app.localStorage.setItem(h,d),h=>this.app.localStorage.removeItem(h),h=>this.app.localStorage.getItem(h),()=>this.app.getSessionID()),this.createGreeting(l.title,l.reqMic,l.reqCamera),c&&((l.reqMic||l.reqCamera)&&this.userRecorder.startRecording(30,ga.Standard,l.reqMic,l.reqCamera),this.showWidget(l.description,l.tasks,!0),this.showTaskSection())}).then(()=>o).catch(l=>{console.log("OR: Error fetching test",l)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new Xu(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem(Gi);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem(Gi),this.app.localStorage.removeItem(eh),this.app.localStorage.removeItem(Vi),this.app.localStorage.removeItem(Ps));const r=this.app.localStorage.getItem(Vi);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=q("div","title",Fu,e),r=q("div","description",Bu,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
4
+ }`,document.head.appendChild(t)}function vh(){mh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,hh),t}function q(t,e,n,s,i){const r=document.createElement(t);return r.className=e,Object.assign(r.style,n),s&&(r.textContent=s),i&&(r.id=i),r}const Ws="or_uxt_test_start",Zi="or_uxt_task_index",$i="or_uxt_session_id",wh="or_uxt_test_id";class bh{constructor(e,n,s,i,r,o,a,c,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=o,this.removeStorageKey=a,this.getStorageKey=c,this.getSessionId=u,this.durations={testStart:0,tasks:[]},this.getDurations=()=>this.durations,this.setDurations=h=>{this.durations.testStart=h.testStart,this.durations.tasks=h.tasks},this.signalTask=(h,d,p)=>{if(!h)return console.error("User Testing: No Task ID Given");const f=this.durations.tasks.find(S=>S.taskId===h),m=this.getTimestamp(),y=f?m-f.started:0;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,taskId:h,status:d,duration:y,timestamp:m,taskAnswer:p})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const m=this.getSessionId();this.setStorageKey($i,m),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(Ws,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(Zi),this.removeStorageKey(Ws);const p=this.durations.testStart||d,f=d-p;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,status:h,duration:f,timestamp:d})})};const l=this.getStorageKey(Ws);l&&(this.durations.testStart=parseInt(l,10))}}class yh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=q("div","bg",$u,void 0,"__or_ut_bg"),this.container=q("div","container",eh,void 0,"__or_ut_ct"),this.widgetGuidelinesVisible=!0,this.widgetTasksVisible=!1,this.widgetVisible=!0,this.isActive=!1,this.descriptionSection=null,this.taskSection=null,this.endSection=null,this.stopButton=null,this.stopButtonContainer=null,this.test=null,this.testId=null,this.signalManager=null,this.getTest=(o,a,c)=>{this.testId=o;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${o}`,{headers:{Authorization:`Bearer ${a}`}}).then(l=>l.json()).then(({test:l})=>{this.isActive=!0,this.test=l,this.signalManager=new bh(this.app.options.ingestPoint,()=>this.app.timestamp(),a,o,this.storageKey,(h,d)=>this.app.localStorage.setItem(h,d),h=>this.app.localStorage.removeItem(h),h=>this.app.localStorage.getItem(h),()=>this.app.getSessionID()),this.createGreeting(l.title,l.reqMic,l.reqCamera),c&&((l.reqMic||l.reqCamera)&&this.userRecorder.startRecording(30,Na.Standard,l.reqMic,l.reqCamera),this.showWidget(l.description,l.tasks,!0),this.showTaskSection())}).then(()=>o).catch(l=>{console.log("OR: Error fetching test",l)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new dh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem($i);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem($i),this.app.localStorage.removeItem(wh),this.app.localStorage.removeItem(Zi),this.app.localStorage.removeItem(Ws));const r=this.app.localStorage.getItem(Zi);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=q("div","title",th,e),r=q("div","description",nh,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
5
5
 
6
6
  📹 We're recording this browser tab to learn from your experience.
7
- 🎤 Please enable mic and camera if asked, to give us a complete picture.`),o=q("div","button",Wu,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,ga.Standard,n,s),this.container.removeChild(o),this.container.removeChild(r),this.container.removeChild(i),!1),o.onclick=()=>{var c,u,l,h;this.removeGreeting();const a=(c=this.signalManager)==null?void 0:c.getDurations();a&&this.signalManager&&(a.testStart=this.app.timestamp(),this.signalManager.setDurations(a)),(u=this.signalManager)==null||u.signalTest("begin"),this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ms),this.showWidget(((l=this.test)==null?void 0:l.guidelines)||"",((h=this.test)==null?void 0:h.tasks)||[])},this.container.append(i,r,o),this.bg.appendChild(this.container),document.body.appendChild(this.bg)}showWidget(e,n,s){this.container.innerHTML="",Object.assign(this.bg.style,{position:"fixed",zIndex:99999999999999,right:"8px",left:"unset",width:"fit-content",top:"8px",height:"fit-content",background:"unset",display:"unset",alignItems:"unset",justifyContent:"unset"});const i=this.createTitleSection();this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ms);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=q("div","stop_bn_or",ua,"Abort Session"),c=q("div","stop_ct_or",{fontSize:"13px!important"});c.style.fontSize="13px",c.append(a),this.container.append(i,r,o,c),this.taskSection=o,this.descriptionSection=r,this.stopButton=a,this.stopButtonContainer=c,a.onclick=()=>{var u;this.userRecorder.discard(),(u=this.signalManager)==null||u.signalTest("skipped"),document.body.removeChild(this.bg),window.close()},s?this.toggleDescriptionVisibility():this.hideTaskSection()}createTitleSection(){var a;const e=q("div","title",ju),n=Ju(),s=q("div","title_text",{maxWidth:"19rem",overflow:"hidden",textOverflow:"ellipsis",width:"100%",fontSize:16,lineHeight:"auto",cursor:"pointer"},(a=this.test)==null?void 0:a.title),i=Qu();e.append(n,s,i);const r=c=>(this.widgetVisible=c,this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,this.widgetVisible?Ms:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Nn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Nn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Nn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?ua:{display:"none"}),c),o=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=o,i.onclick=o,Yu(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=q("div","description_section_or",Nn),s=q("div","description_s_title_or",aa),i=q("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=q("div","icon",la,"-"),o=q("div","content",Cn),a=q("div","text_description",{maxHeight:"250px",overflowY:"auto",whiteSpace:"pre-wrap",fontSize:13,color:"#454545",lineHeight:"auto"});a.innerHTML=e;const c=q("div","button_begin_or",ca,"Begin Test");s.append(i,r),o.append(a,c),n.append(s,o);const u=()=>{this.widgetGuidelinesVisible=!this.widgetGuidelinesVisible,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?Cn:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?Cn:{display:"none"}),o.removeChild(c)},c.onclick=()=>{var l,h,d;if(u(),this.test){const f=(l=this.signalManager)==null?void 0:l.getDurations(),p=f?f.tasks.findIndex(m=>this.test&&m.taskId===this.test.tasks[0].task_id):null;f&&p===-1&&(f.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(f)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(c)},n}createTasksSection(e){this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ms);const n=q("div","task_section_or",Nn),s=q("div","description_t_title_or",aa),i=q("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=q("div","icon",la,"-"),o=q("div","content",Cn),a=q("div","pagination",Uu),c=q("div","taskCard",da),u=q("div","taskText",fa),l=q("div","taskDescription",qu),h=q("div","taskButtons",Gu),d=q("div","taskText",fa);d.textContent="Your answer";const f=q("textarea","taskDescription",{resize:"vertical"}),p=q("div","inputArea",da);p.append(d,f);const m=q("div","closePanelButton",pa,"Collapse Panel"),E=q("div","nextButton",Vu,"Done, Next");s.append(i,r),c.append(u,l),h.append(m,E),o.append(a,c,p,h),n.append(s,o);const _=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,l.textContent=g.description,g.allow_typing?p.style.display="flex":p.style.display="none"};e.forEach((g,w)=>{const k=q("span",`or_task_${w}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(w+1).toString());k.id=`or_task_${w}`,a.append(k)});const x=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(o.style,this.widgetTasksVisible?Cn:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(o.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(o.style,Cn),this.widgetTasksVisible=!0,!0);const T=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,ha);for(let w=0;w<this.currentTaskIndex;w++){const k=document.getElementById(`or_task_${w}`);k&&Object.assign(k.style,Hu)}};return s.onclick=x,m.onclick=this.collapseWidget,E.onclick=()=>{var w,k,I,y;const g=e[this.currentTaskIndex].allow_typing?f.value:void 0;if(f.value="",(w=this.signalManager)==null||w.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,_();const S=(k=this.signalManager)==null?void 0:k.getDurations();S&&S.tasks.findIndex(A=>A.taskId===e[this.currentTaskIndex].task_id)===-1&&(S.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(I=this.signalManager)==null||I.setDurations(S)),(y=this.signalManager)==null||y.signalTask(e[this.currentTaskIndex].task_id,"begin"),T()}else this.showEndSection();this.app.localStorage.setItem("or_uxt_task_index",this.currentTaskIndex.toString())},setTimeout(()=>{const g=document.getElementById("or_task_0");g&&Object.assign(g.style,ha),_(),T()},1),n}showEndSection(){var a,c,u,l;let e=!0;(a=this.signalManager)==null||a.signalTest("done");const n=q("div","end_section_or",zu),s=q("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=q("div","end_description_or",{},((c=this.test)==null?void 0:c.conclusion)??`Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
7
+ 🎤 Please enable mic and camera if asked, to give us a complete picture.`),o=q("div","button",sh,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,Na.Standard,n,s),this.container.removeChild(o),this.container.removeChild(r),this.container.removeChild(i),!1),o.onclick=()=>{var c,u,l,h;this.removeGreeting();const a=(c=this.signalManager)==null?void 0:c.getDurations();a&&this.signalManager&&(a.testStart=this.app.timestamp(),this.signalManager.setDurations(a)),(u=this.signalManager)==null||u.signalTest("begin"),this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Fs),this.showWidget(((l=this.test)==null?void 0:l.guidelines)||"",((h=this.test)==null?void 0:h.tasks)||[])},this.container.append(i,r,o),this.bg.appendChild(this.container),document.body.appendChild(this.bg)}showWidget(e,n,s){this.container.innerHTML="",Object.assign(this.bg.style,{position:"fixed",zIndex:99999999999999,right:"8px",left:"unset",width:"fit-content",top:"8px",height:"fit-content",background:"unset",display:"unset",alignItems:"unset",justifyContent:"unset"});const i=this.createTitleSection();this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Fs);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=q("div","stop_bn_or",Ta,"Abort Session"),c=q("div","stop_ct_or",{fontSize:"13px!important"});c.style.fontSize="13px",c.append(a),this.container.append(i,r,o,c),this.taskSection=o,this.descriptionSection=r,this.stopButton=a,this.stopButtonContainer=c,a.onclick=()=>{var u;this.userRecorder.discard(),(u=this.signalManager)==null||u.signalTest("skipped"),document.body.removeChild(this.bg),window.close()},s?this.toggleDescriptionVisibility():this.hideTaskSection()}createTitleSection(){var a;const e=q("div","title",ih),n=ph(),s=q("div","title_text",{maxWidth:"19rem",overflow:"hidden",textOverflow:"ellipsis",width:"100%",fontSize:16,lineHeight:"auto",cursor:"pointer"},(a=this.test)==null?void 0:a.title),i=gh();e.append(n,s,i);const r=c=>(this.widgetVisible=c,this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,this.widgetVisible?Fs:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Dn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Dn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Dn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?Ta:{display:"none"}),c),o=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=o,i.onclick=o,fh(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=q("div","description_section_or",Dn),s=q("div","description_s_title_or",Sa),i=q("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=q("div","icon",_a,"-"),o=q("div","content",Rn),a=q("div","text_description",{maxHeight:"250px",overflowY:"auto",whiteSpace:"pre-wrap",fontSize:13,color:"#454545",lineHeight:"auto"});a.innerHTML=e;const c=q("div","button_begin_or",ka,"Begin Test");s.append(i,r),o.append(a,c),n.append(s,o);const u=()=>{this.widgetGuidelinesVisible=!this.widgetGuidelinesVisible,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?Rn:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?Rn:{display:"none"}),o.removeChild(c)},c.onclick=()=>{var l,h,d;if(u(),this.test){const p=(l=this.signalManager)==null?void 0:l.getDurations(),f=p?p.tasks.findIndex(m=>this.test&&m.taskId===this.test.tasks[0].task_id):null;p&&f===-1&&(p.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(p)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(c)},n}createTasksSection(e){this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Fs);const n=q("div","task_section_or",Dn),s=q("div","description_t_title_or",Sa),i=q("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=q("div","icon",_a,"-"),o=q("div","content",Rn),a=q("div","pagination",oh),c=q("div","taskCard",Ea),u=q("div","taskText",Ia),l=q("div","taskDescription",lh),h=q("div","taskButtons",uh),d=q("div","taskText",Ia);d.textContent="Your answer";const p=q("textarea","taskDescription",{resize:"vertical"}),f=q("div","inputArea",Ea);f.append(d,p);const m=q("div","closePanelButton",Ca,"Collapse Panel"),y=q("div","nextButton",ch,"Done, Next");s.append(i,r),c.append(u,l),h.append(m,y),o.append(a,c,f,h),n.append(s,o);const S=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,l.textContent=g.description,g.allow_typing?f.style.display="flex":f.style.display="none"};e.forEach((g,b)=>{const E=q("span",`or_task_${b}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(b+1).toString());E.id=`or_task_${b}`,a.append(E)});const _=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(o.style,this.widgetTasksVisible?Rn:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(o.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(o.style,Rn),this.widgetTasksVisible=!0,!0);const x=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,xa);for(let b=0;b<this.currentTaskIndex;b++){const E=document.getElementById(`or_task_${b}`);E&&Object.assign(E.style,ah)}};return s.onclick=_,m.onclick=this.collapseWidget,y.onclick=()=>{var b,E,I,k;const g=e[this.currentTaskIndex].allow_typing?p.value:void 0;if(p.value="",(b=this.signalManager)==null||b.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,S();const T=(E=this.signalManager)==null?void 0:E.getDurations();T&&T.tasks.findIndex(M=>M.taskId===e[this.currentTaskIndex].task_id)===-1&&(T.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(I=this.signalManager)==null||I.setDurations(T)),(k=this.signalManager)==null||k.signalTask(e[this.currentTaskIndex].task_id,"begin"),x()}else this.showEndSection();this.app.localStorage.setItem("or_uxt_task_index",this.currentTaskIndex.toString())},setTimeout(()=>{const g=document.getElementById("or_task_0");g&&Object.assign(g.style,xa),S(),x()},1),n}showEndSection(){var a,c,u,l;let e=!0;(a=this.signalManager)==null||a.signalTest("done");const n=q("div","end_section_or",rh),s=q("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=q("div","end_description_or",{},((c=this.test)==null?void 0:c.conclusion)??`Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
8
8
 
9
- We appreciate your time and valuable input.`),r=q("div","end_button_or",ca,"Submitting Feedback"),o=$u();r.appendChild(o),(u=this.test)!=null&&u.reqMic||(l=this.test)!=null&&l.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(o),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(o),r.textContent="End Session",e=!1}):(r.removeChild(o),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function ma(t){return!!t&&t.nodeType!=null}function Ki(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function _t(t){return t.nodeType===Node.ELEMENT_NODE}function sh(t){return t.nodeType===Node.COMMENT_NODE}function Xi(t){return t.nodeType===Node.TEXT_NODE}function Ls(t){return t.nodeType===Node.DOCUMENT_NODE}function Fs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ve(t,e){return t.localName===e}class ih{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!ve(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ve(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(a=>{a.forEach(c=>{c.isIntersecting&&(c.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(c.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const o=Du(i.toString(),r);this.app.send(o);const a=u=>{rh(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,l=>{if(l){if(!this.snapshots[i])return this.app.debug.warn("Canvas not present in snapshots after capture:",this.snapshots,i);this.snapshots[i].images.push({id:this.app.timestamp(),data:l}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[])}})},c=setInterval(()=>{const u=this.app.nodes.getID(s),l=u?this.app.nodes.getNode(u):void 0;if(!this.snapshots[i]){this.app.debug.log("Canvas is not present in {snapshots}"),clearInterval(c);return}if(!l||!ve(l,"canvas")||l!==s){this.app.debug.log("Canvas element not in sync",l,s),clearInterval(c);return}else this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{a(l)}):a(l))},this.interval);this.intervals.push(c)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas)},250)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(o=>{const a=o.data;a&&(i.append("snapshot",a,`${s}_${n}_${o.id}.${this.fileExt}`),this.options.isDebug&&oh(a,`${s}_${n}_${o.id}.${this.fileExt}`))});const r=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(o=>o.status===401?r():!0).catch(o=>{this.app.debug.error("error saving canvas",o)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const va={low:.35,medium:.55,high:.8};function rh(t,e="medium",n,s=!1,i,r){const o=`image/${i}`;if(s){const a=window.devicePixelRatio||1;n.width=t.width/a,n.height=t.height/a;const c=n.getContext("2d");if(!c)return"";c.clearRect(0,0,n.width,n.height),c.drawImage(t,0,0,n.width,n.height),n.toBlob(r,o,va[e])}else t.toBlob(r,o,va[e])}function oh(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const Dn={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class ah{constructor(e=Dn.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(Dn.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(Dn.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(Dn.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(Dn.Errors)&&console.error(...n)},this.level=e}}const lh=1e3;function ch(t,e,n){const s=t.entries();function i(){const r=[];let o=s.next();for(;!o.done&&r.length<e;)r.push(o.value),o=s.next();r.length>0&&(r.forEach(([a,c])=>{c&&n(c)}),setTimeout(i,50))}i()}function uh(t){var e;try{if(!t.isConnected)return[!1,"not connected"];const n=t.nodeType===Node.DOCUMENT_NODE,s=n?t.defaultView:(e=t.ownerDocument)==null?void 0:e.defaultView,i=n?t:t.ownerDocument;return s?s.closed?[!1,"window closed"]:i!=null&&i.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(n){return[!1,n]}}const hh={interval:lh*30,batchSize:2500,enabled:!0};class dh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{ch(this.nodes,this.options.batchSize,i=>{uh(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...hh,...s}}}class fh{constructor(e){this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>s?n(s):void 0)},this.attachNodeListener=(n,s,i,r=!0)=>{const o=this.getID(n);if(o===void 0)return;Ko(n,s,i,r,this.forceNgOff);let a=this.elementListeners.get(o);a===void 0&&(a=[],this.elementListeners.set(o,a)),a.push([s,i,r])},this.unregisterNode=n=>{const s=n[this.node_id];if(s!==void 0){n[this.node_id]=void 0,delete n[this.node_id],this.nodes.delete(s);const i=this.elementListeners.get(s);i!==void 0&&(this.elementListeners.delete(s),i.forEach(r=>Xo(n,r[0],r[1],r[2],this.forceNgOff))),this.totalNodeAmount--}return s},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new dh(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}syntheticMode(e){const n=Number.MAX_SAFE_INTEGER,i=99999999*e;if(i>n)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){return this.nodeCallbacks.push(e)}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(n,e),e[this.node_id]=n),[n,s]}cleanTree(){for(const[e,n]of this.nodes)n&&!document.contains(n)&&this.unregisterNode(n)}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,n]of this.nodes)n&&this.unregisterNode(n);this.nextNodeId=0,this.nodes.clear()}}function Bs(t){if(sh(t))return!0;if(Xi(t))return!1;if(!_t(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function Yi(t){return Fs(t)?!0:!Bs(t)}var at;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(at||(at={}));class Ji{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=Go(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!Yi(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)Yi(i.removedNodes[c])&&this.bindNode(i.removedNodes[c]);for(let c=0;c<i.addedNodes.length;c++)this.bindTree(i.addedNodes[c]);continue}const a=this.app.nodes.getID(r);if(a!==void 0){if(this.recents.has(a)||this.recents.set(a,at.Changed),o==="attributes"){const c=i.attributeName;if(c===null)continue;let u=this.attributesMap.get(a);u===void 0&&this.attributesMap.set(a,u=new Set),u.add(c);continue}o==="characterData"&&this.textSet.add(a)}}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const n=e.contentDocument;if(n&&this.app.nodes.getID(n)!==void 0){const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:c=>Bs(c)||this.app.nodes.getID(c)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const o=this.app.nodes.getNodeCount();for(;i.nextNode();)e.contentDocument.contains(i.currentNode)||(r+=1,this.app.nodes.unregisterNode(i.currentNode));const a=Math.floor(r/o*100);a>30&&this.app.send(ia(a))}}sendNodeAttribute(e,n,s,i){if(Ki(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(Jo(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Bi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substring(0,2)==="on")&&!(s==="value"&&ve(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(Jo(e,s));return}if(s==="style"||s==="href"&&ve(n,"link")){this.app.send(Bi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(ve(n,"style")){this.app.send(_u(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(lu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,at.New):this.recents.get(n)!==at.New&&this.recents.set(n,at.Removed)}bindTree(e){if(!Yi(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),Bs(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===at.Removed){this.app.send(au(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Bs(a)||this.app.nodes.getID(a)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const o=Math.floor(i/r*100);o>30&&this.app.send(ia(o))}}_commitNode(e,n){if(Fs(n))return!0;const s=n.parentNode;let i;if(!ve(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const l=this.app.nodes.getID(r);if(l!==void 0){this.commitNode(l),this.indexes[e]=this.indexes[l]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const o=this.recents.get(e),a=o===at.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(a){if(_t(n)){let l=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=l.clientWidth,d=l.clientHeight;l=n.cloneNode(),l.style.width=`${h}px`,l.style.height=`${d}px`}this.app.send(iu(e,i,c,l.tagName,Ki(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else Xi(n)&&(this.app.send(ru(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===at.Removed&&i!==void 0&&this.app.send(ou(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!_t(n))throw"commitNode: node is not an element";for(const l of u)this.sendNodeAttribute(e,n,l,n.getAttribute(l))}if(this.textSet.has(e)){if(!Xi(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===at.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class ba extends Ji{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.docId=i,this.app.send(Wi(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Wi(e,s))})}}class ph extends Ji{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(Wi(s,i))})}}class gh{constructor(){this.states=new WeakMap}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:o,top:a}=e.iFrame.getBoundingClientRect();e.offset=[o,a]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var a;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var c;s.removeEventListener("scroll",o),(c=s.defaultView)==null||c.removeEventListener("resize",o)}},o=()=>{r.offset=null};s.addEventListener("scroll",o),(a=s.defaultView)==null||a.addEventListener("resize",o),this.states.set(n,r)}clear(){this.states=new WeakMap}}const Qi=ot?Element.prototype.attachShadow:()=>new ShadowRoot;class mh extends Ji{constructor(e){super(e.app,!0),this.iframeOffsets=new gh,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=Object.assign({captureIFrames:!0},e.options),this.app.nodes.attachNodeCallback(n=>{ve(n,"iframe")&&(this.options.captureIFrames&&!Zt(n,"obscured")||Zt(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{_t(n)&&n.shadowRoot!==null&&this.handleShadowRoot(n.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const n=this.app.safe(()=>setTimeout(()=>{const s=this.app.nodes.getID(e);if(s===void 0||!Jc(e))return;const i=e.contentWindow,r=e.contentDocument;if(!r){this.app.debug.warn("no doc for iframe found",e);return}if(r&&this.docObservers.has(r)){this.app.debug.info("doc already observed for",s);return}const o=new ba(this.app);this.iframeObservers.set(e,o),this.docObservers.set(r,o),this.iframeObserversArr.push(o),o.observe(e),this.iframeOffsets.observe(e),i&&i===i.window&&!this.contextsSet.has(i)&&(this.contextsSet.add(i),this.contextCallbacks.forEach(a=>a(i)))},250));e.addEventListener("load",n),n()}handleShadowRoot(e){const n=new ph(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=Qi.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(su()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=Qi.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new ba(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=Qi,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var Ws;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Ws||(Ws={}));const vh=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class bh{constructor(e){this.obscured=new Set,this.hidden=new Set,this.app=e.app,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},e.options)}handleNode(e,n,s){if((this.obscured.has(n)||_t(s)&&(Zt(s,"masked")||Zt(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||_t(s)&&(Zt(s,"htmlmasked")||Zt(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&_t(s)){const i=this.options.domSanitizer(s);i===Ws.Obscured&&this.obscured.add(e),i===Ws.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?vh(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[o,a]=r.split(".");return`${Pi(i)}@${Pi(o)}.${Pi(a)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class wh{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.token||this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.token=e,this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=Qc(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function yh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Sh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?yh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const _h='!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){var e;const n=null==i?void 0:i.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const h={Authorization:`Bearer ${this.token}`};s&&(h["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${null!==(e=this.pageNo)&&void 0!==e?e:"noPageNum"}_${null!=n?n:"noBatchNum"}`,{body:t,method:"POST",headers:h,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,u=null,a=h.NotActive;function o(){u&&u.finaliseBatch()}function c(){return new Promise((t=>{a=h.Stopping,null!==p&&(clearInterval(p),p=null),u&&(u.clean(),u=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{a=h.NotActive,t(null)}),100)}))}function g(){[h.Stopped,h.Stopping].includes(a)||(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let l,p=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{a=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(a=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),u=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===p&&(p=setInterval(o,1e4)),a=h.Active):"auth"===s.type?r?u?(r.authorise(s.token),void(s.beaconSizeLimit&&u.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(u){const t=u;s.forEach((s=>{55===s[0]&&(s[1]?l=setTimeout((()=>g()),18e5):clearTimeout(l)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()}}();\n',$n="canceled",wa="or_uxt_active",Zi="or_buffer_1",kt=t=>({reason:t,success:!1}),ya=t=>({...t,success:!0});var ue;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(ue||(ue={}));const Sa="https://api.openreplay.com/ingest";function $i(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const kh=t=>new Promise(e=>setTimeout(e,t)),he={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",polling:"hello-how-are-you-im-under-the-water-please-help-me"};let Th=class{constructor(e,n,s,i,r){var c,u;this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=ue.NotActive,this.version="14.0.14",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.features={"feature-flags":!0,"usability-test":!0},this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.parentCrossDomainFrameListener=l=>{const{data:h}=l;if(!(!h||l.source===window)){if(h.line===he.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===he.parentAlive&&(this.parentActive=!0),h.line===he.iframeId&&(this.parentActive=!0,this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart()),h.line===he.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,f;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===he.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:he.parentAlive},"*"),(async()=>{var E;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const m=await this.checkNodeId(l.source);if(!m){this.debug.log("Couldnt get node id for iframe",l.source);return}try{this.trackedFrames.includes(h.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(h.context),await this.waitStarted();const _=this.session.getSessionToken(),x=this.trackedFrames.findIndex(g=>g===h.context)+1;x===0&&this.debug.error("Couldnt get order number for iframe",h.context,this.trackedFrames);const T={line:he.iframeId,id:m,token:_,frameOrderNumber:x};this.debug.log("Got child frame signal; nodeId",m,l.source,T),(E=l.source)==null||E.postMessage(T,"*")}catch(_){console.error(_)}})()),h.line===he.iframeBatch){const m=h.messages.map(E=>{if(E[0]===20){let _=E;return this.pageFrames.forEach(x=>{if(x.contentWindow===l.source){const[T,g,w]=E,{left:k,top:I}=x.getBoundingClientRect();_=[T,g+k,w+I]}}),_}if(E[0]===68){let _=E;return this.pageFrames.forEach(x=>{if(x.contentWindow===l.source){const[T,g,w,k,I,y,S]=E,{left:A,top:W,width:B,height:V}=x.getBoundingClientRect(),z=document.documentElement.scrollWidth,j=document.documentElement.scrollHeight,C=y/100*B+A,R=S/100*V+W,N=C/z,M=R/j;_=[T,g,w,k,I,Math.round(N*1e3)/10,Math.round(M*1e3)/10]}}),_}return E});this.messages.push(...m)}if(h.line===he.polling){if(!this.pollingQueue.order.length)return;const p=this.pollingQueue.order[0];if(p&&this.pollingQueue[p].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(m=>m!==p);return}this.pollingQueue[p].includes(h.context)&&(this.pollingQueue[p]=this.pollingQueue[p].filter(m=>m!==h.context),(f=l.source)==null||f.postMessage({line:p},"*"),this.pollingQueue[p].length===0&&this.pollingQueue.order.shift())}}},this.pollingQueue={order:[]},this.addCommand=l=>{this.pollingQueue.order.push(l),this.pollingQueue[l]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(he.startIframe)},this.killChildrenFrames=()=>{this.addCommand(he.killIframe)},this.signalIframeTracker=()=>{var _;const l=this.session.getTabId();window.parent.postMessage({line:he.iframeSignal,source:l,context:this.contextId},((_=this.options.crossdomain)==null?void 0:_.parentDomain)??"*");const h=10;let d=0,f=250,p=0,m=!1;const E=()=>{var x;if(m||this.checkStatus()){m=!0;return}window.parent.postMessage({line:he.iframeSignal,source:l,context:this.contextId},((x=this.options.crossdomain)==null?void 0:x.parentDomain)??"*"),this.debug.info("Trying to signal to parent, attempt:",d+1),d++};for(let x=0;x<h;x++){if(this.checkStatus()){m=!0;break}p+=f,setTimeout(()=>{E()},p),f*=1.5}},this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.startCallbacks.push(l)},this.attachStopCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.stopCallbacks.push(l)},this.attachEventListener=(l,h,d,f=!0,p=!0)=>{f&&(d=this.safe(d));const m=()=>l?Ko(l,h,d,p,this.options.forceNgOff):null,E=()=>l?Xo(l,h,d,p,this.options.forceNgOff):null;this.attachStartCallback(m,f),this.attachStopCallback(E,f)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var l;(l=this.canvasRecorder)==null||l.restartTracking()},this.flushBuffer=async l=>new Promise(h=>{let d=!1;const f=[l.shift()];for(;!d;){const p=l[0];!p||p[0]===0?d=!0:f.push(l.shift())}this.postToWorker(f),h(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(l=>["fixedCanvasScaling","disableCanvas"].includes(l))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Sa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:Dn.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1};if(this.options=Yo(o,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const l=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${l}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new bh({app:this,options:s}),this.nodes=new fh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new mh({app:this,options:s}),this.ticker=new Sh(this),this.ticker.attach(()=>this.commit()),this.debug=new ah(this.options.__debug__),this.session=new wh({app:this,options:this.options}),this.attributeSender=new qc({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new Kc(this),this.tagWatcher=new Mu({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(Ru(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(vu(l)),h!=null&&Object.entries(h).forEach(([d,f])=>this.send(Qo(d,f)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),setInterval(()=>{var l;document.hidden||window.parent.postMessage({line:he.polling,context:this.contextId},((l=s.crossdomain)==null?void 0:l.parentDomain)??"*")},250)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener)),this.bc!==null&&(this.bc.postMessage({line:he.ask,source:a,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=l=>{if(l.data.context!==this.contextId){if(l.data.line===he.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===he.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===he.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?he.reg:he.resp,token:h,source:a,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(r=>r.contentWindow===e)}if(!n)return null;let s=0;for(;s<100;){const i=n[this.options.node_id];if(i!==void 0)return s=100,i;s++,await kh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([_h],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(ue.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(s=>{this.debug.info("Worker restarted, session was too long",s)}).catch(s=>{this.debug.error("Worker restart failed",s)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?zc(e.batch,{mtime:0},(r,o)=>{var a,c;r?(this.debug.error("Openreplay compression error:",r),(a=this.worker)==null||a.postMessage({type:"uncompressed",batch:s})):(c=this.worker)==null||c.postMessage({type:"compressed",batch:o})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==ue.NotActive&&(this.activityState===ue.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===ue.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(en(this.session.getTabId())),this.messages.unshift($t(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:he.iframeBatch,messages:this.messages},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length))try{eu(()=>{var n;this.messages.unshift(en(this.session.getTabId())),this.messages.unshift($t(this.timestamp())),(n=this.worker)==null||n.postMessage(this.messages),this.commitCallbacks.forEach(s=>s(this.messages)),this.messages.length=0})}catch(n){this._debug("worker_commit",n),this.stop(!0),setTimeout(()=>{this.start()},500)}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId())),this.bufferedMessages2.push($t(this.timestamp())),this.bufferedMessages2.push(en(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===ue.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return Ze()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,c=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=Ze()-i;return`${c}?jumpto=${u}`}return c}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===ue.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Mi(),this.coldStartTs=Ze(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push($t(this.timestamp())),this.bufferedMessages2.push(en(this.session.getTabId()))),this.stop(!1),this.activityState=ue.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(As(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var f,p;this.conditionsManager=new Vc(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:Ze(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Hi,jsHeapSizeLimit:qi,timezone:$i(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,projectID:l,features:h}=await n.json();this.features=h||this.features,this.session.assign({projectID:l}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});const d={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(m=>m(d)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(p=this.conditionsManager)==null||p.processFlags(this.featureFlags.flags)),await this.tagWatcher.fetchTags(this.options.ingestPoint,s)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);Mi(),this.coldStartTs=Ze();const i=this.localStorage.getItem(Zi);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(Zi)}this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId())),this.activityState=ue.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(r)),s||this.send(As(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(Zi,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,f;this.stop(!1);const e=Ze();(d=this.worker)==null||d.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Hi,jsHeapSizeLimit:qi,timezone:$i()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((f=this.worker)==null||f.postMessage({type:"auth",token:s,beaconSizeLimit:l}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){var c,u,l,h,d;Object.keys(e).length!==0&&(this.prevOpts=e);const i=this.activityState===ue.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const f="No worker found: perhaps, CSP is not set.";return this.signalError(f,[]),Promise.resolve(kt(f))}if(this.activityState===ue.Active||this.activityState===ue.Starting)return Promise.resolve(kt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=ue.Starting,i||Mi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=Ze();(c=this.worker)==null||c.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const o=this.session.getSessionToken(),a=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{const f=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:Hi,jsHeapSizeLimit:qi,timezone:$i(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(f.status!==200){const N=await f.text(),M=N===$n?$n:`Server error: ${f.status}. ${N}`;return kt(M)}if(!this.worker&&!this.insideIframe){const N="no worker found after start request (this should not happen in real world)";return this.signalError(N,[]),kt(N)}const{token:p,userUUID:m,projectID:E,beaconSizeLimit:_,compressionThreshold:x,delay:T,sessionID:g,startTimestamp:w,userBrowser:k,userCity:I,userCountry:y,userDevice:S,userOS:A,userState:W,canvasEnabled:B,canvasQuality:V,canvasFPS:z,assistOnly:j,features:C}=await f.json();if(this.features=C||this.features,typeof p!="string"||typeof m!="string"||typeof w!="number"&&typeof w<"u"||typeof g!="string"||typeof T!="number"||typeof _!="number"&&typeof _<"u"){const N=`Incorrect server response: ${JSON.stringify(f)}`;return this.signalError(N,[]),kt(N)}this.delay=T,this.session.setSessionToken(p),this.session.setUserInfo({userBrowser:k,userCity:I,userCountry:y,userDevice:S,userOS:A,userState:W}),this.session.assign({sessionID:g,timestamp:w||r,projectID:E}),j?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:p,beaconSizeLimit:_}),!a&&p===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(As(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([N,M])=>this.send(Qo(N,M))),this.localStorage.setItem(this.options.local_uuid_key,m),this.compressionThreshold=x;const R={sessionToken:p,userUUID:m,sessionID:g};if(this.startCallbacks.forEach(N=>N(R)),e.startCallback&&e.startCallback(ya(R)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,p),this.activityState=ue.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),B&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new ih(this,{fps:z,quality:V,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const N=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;N.length>0;)await this.flushBuffer(N);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();if((d=this.canvasRecorder)==null||d.startTracking(),this.features["usability-test"]&&!this.insideIframe){this.uxtManager=this.uxtManager?this.uxtManager:new nh(this,wa);let N;const M=this.localStorage.getItem(wa);if(M&&(N=parseInt(M,10)),location!=null&&location.search){const re=new URLSearchParams(location.search);if(re.has("oruxt")){const H=re.get("oruxt");N=H?parseInt(H,10):void 0}}N&&(this.uxtManager.isActive?this.onUxtCb.forEach(re=>re(N)):this.uxtManager.getTest(N,p,!!M).then(re=>{re&&this.onUxtCb.forEach(H=>H(re))}))}return ya(R)}catch(f){if(this.stop(),this.session.reset(),!f)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),kt("Unknown error");if(f===$n)return this.signalError($n,[]),kt($n);this._debug("session_start",f);const p=f instanceof Error?f.message:f.toString();return this.signalError(p,[]),kt(p)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(ue.Active)}async waitStatus(e){return new Promise(n=>{const s=()=>{this.activityState===e?n(!0):setTimeout(s,25)};s()})}async start(...e){return this.activityState===ue.Active||this.activityState===ue.Starting?Promise.resolve(kt("OpenReplay: trying to call `start()` on the instance that has been started already.")):(this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e)))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(Iu("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==ue.NotActive)try{!this.insideIframe&&((n=this.options.crossdomain)!=null&&n.enabled)&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(s=this.canvasRecorder)==null||s.clear(),this.messages.length=0,this.parentActive=!1}finally{this.activityState=ue.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function xh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(yu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const _a=ot&&"InstallTrigger"in window?t=>t.message+`
10
- `+t.stack:t=>t.stack||t.message;function er(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?_a(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function Eh(t){return typeof t!="number"?"NaN":t.toString()}function Ih(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function ka(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return _a(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(er).join(", ");return`Array(${e})[${n}]`}if(typeof t=="object"){const e=[];let n=0;for(const s in t){if(++n===10)break;const i=t[s];e.push(s+": "+er(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Ch(t){return typeof t[0]=="string"&&t.unshift(t.shift().replace(/%(o|s|f|d|i)/g,(e,n)=>{const s=t.shift();if(s===void 0)return e;switch(n){case"o":return ka(s);case"s":return er(s);case"f":return Eh(s);case"d":case"i":return Ih(s);default:return e}})),t.map(ka).join(" ")}const Ta=["log","info","warn","error","debug","assert"];function Nh(t,e){const n=Object.assign({consoleMethods:Ta,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((c,u)=>t.send(fu(c,Ch(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const o=(c,u)=>{const l={apply:function(h,d,f){Reflect.apply(h,u,f),i=i+1,!(i>n.consoleThrottling)&&s(h.name,f)}};n.consoleMethods.forEach(h=>{if(Ta.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const d=u.console[h];c[h]=new Proxy(d,l)})},a=t.safe(c=>o(c.console,c));a(window),t.observer.attachContextCallback(a)}const Dh=/(^|@)\S+:\d+/,xa=/^\s*at .*(\S+:\d+|\(native\))/m,Rh=/^(eval@)?(\[native code\])?$/;function Oh(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return Fh(t);if(t.stack&&t.stack.match(xa))return Ah(t);if(t.stack)return Ph(t);throw new Error("Cannot parse given Error object")}function tr(t){if(!t.includes(":"))return[t,void 0,void 0];const n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]}function es(t,e){return t}function Ah(t,e){return Mh(t.stack)}function Mh(t,e){return es(t.split(`
11
- `).filter(s=>!!s.match(xa))).map(s=>{s.includes("(eval ")&&(s=s.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=s.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const r=i.match(/ (\(.+\)$)/);i=r?i.replace(r[0],""):i;const o=tr(r?r[1]:i),a=r&&i||void 0,c=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:c,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:s}})}function Ph(t,e){return Lh(t.stack)}function Lh(t,e){return es(t.split(`
12
- `).filter(s=>!s.match(Rh))).map(s=>{if(s.includes(" > eval")&&(s=s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!s.includes("@")&&!s.includes(":"))return{function:s};{const i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=s.match(i),o=r&&r[1]?r[1]:void 0,a=tr(s.replace(i,""));return{function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:s}}})}function Fh(t,e){return!t.stacktrace||t.message.includes(`
9
+ We appreciate your time and valuable input.`),r=q("div","end_button_or",ka,"Submitting Feedback"),o=vh();r.appendChild(o),(u=this.test)!=null&&u.reqMic||(l=this.test)!=null&&l.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(o),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(o),r.textContent="End Session",e=!1}):(r.removeChild(o),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function Ra(t){return!!t&&t.nodeType!=null}function er(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function Tt(t){return t.nodeType===Node.ELEMENT_NODE}function Sh(t){return t.nodeType===Node.COMMENT_NODE}function tr(t){return t.nodeType===Node.TEXT_NODE}function js(t){return t.nodeType===Node.DOCUMENT_NODE}function zs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ve(t,e){return t.localName===e}class _h{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!ve(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ve(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(a=>{a.forEach(c=>{c.isIntersecting&&(c.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(c.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const o=Xu(i.toString(),r);this.app.send(o);const a=u=>{kh(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,l=>{if(l){if(!this.snapshots[i])return this.app.debug.warn("Canvas not present in snapshots after capture:",this.snapshots,i);this.snapshots[i].images.push({id:this.app.timestamp(),data:l}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[])}})},c=setInterval(()=>{const u=this.app.nodes.getID(s),l=u?this.app.nodes.getNode(u):void 0;if(!this.snapshots[i]){this.app.debug.log("Canvas is not present in {snapshots}"),clearInterval(c);return}if(!l||!ve(l,"canvas")||l!==s){this.app.debug.log("Canvas element not in sync",l,s),clearInterval(c);return}else this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{a(l)}):a(l))},this.interval);this.intervals.push(c)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas)},250)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(o=>{const a=o.data;a&&(i.append("snapshot",a,`${s}_${n}_${o.id}.${this.fileExt}`),this.options.isDebug&&Th(a,`${s}_${n}_${o.id}.${this.fileExt}`))});const r=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(o=>o.status===401?r():!0).catch(o=>{this.app.debug.error("error saving canvas",o)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const Da={low:.35,medium:.55,high:.8};function kh(t,e="medium",n,s=!1,i,r){const o=`image/${i}`;if(s){const a=window.devicePixelRatio||1;n.width=t.width/a,n.height=t.height/a;const c=n.getContext("2d");if(!c)return"";c.clearRect(0,0,n.width,n.height),c.drawImage(t,0,0,n.width,n.height),n.toBlob(r,o,Da[e])}else t.toBlob(r,o,Da[e])}function Th(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const On={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class xh{constructor(e=On.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(On.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(On.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(On.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(On.Errors)&&console.error(...n)},this.level=e}}const Eh=1e3;function Ih(t,e,n){const s=t.entries();function i(){const r=[];let o=s.next();for(;!o.done&&r.length<e;)r.push(o.value),o=s.next();r.length>0&&(r.forEach(([a,c])=>{c&&n(c)}),setTimeout(i,50))}i()}function Ch(t){var e;try{if(!t.isConnected)return[!1,"not connected"];const n=t.nodeType===Node.DOCUMENT_NODE,s=n?t.defaultView:(e=t.ownerDocument)==null?void 0:e.defaultView,i=n?t:t.ownerDocument;return s?s.closed?[!1,"window closed"]:i!=null&&i.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(n){return[!1,n]}}const Nh={interval:Eh*30,batchSize:2500,enabled:!0};class Rh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{Ih(this.nodes,this.options.batchSize,i=>{Ch(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Nh,...s}}}class Dh{constructor(e){this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>s?n(s):void 0)},this.attachNodeListener=(n,s,i,r=!0)=>{const o=this.getID(n);if(o===void 0)return;aa(n,s,i,r,this.forceNgOff);let a=this.elementListeners.get(o);a===void 0&&(a=[],this.elementListeners.set(o,a)),a.push([s,i,r])},this.unregisterNode=n=>{const s=n[this.node_id];if(s!==void 0){n[this.node_id]=void 0,delete n[this.node_id],this.nodes.delete(s);const i=this.elementListeners.get(s);i!==void 0&&(this.elementListeners.delete(s),i.forEach(r=>la(n,r[0],r[1],r[2],this.forceNgOff))),this.totalNodeAmount--}return s},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new Rh(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}syntheticMode(e){const n=Number.MAX_SAFE_INTEGER,i=99999999*e;if(i>n)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){return this.nodeCallbacks.push(e)}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(n,e),e[this.node_id]=n),[n,s]}cleanTree(){for(const[e,n]of this.nodes)n&&!document.contains(n)&&this.unregisterNode(n)}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,n]of this.nodes)n&&this.unregisterNode(n);this.nextNodeId=0,this.nodes.clear()}}function Us(t){if(Sh(t))return!0;if(tr(t))return!1;if(!Tt(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function nr(t){return zs(t)?!0:!Us(t)}var dt;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(dt||(dt={}));class sr{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=oa(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!nr(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)nr(i.removedNodes[c])&&this.bindNode(i.removedNodes[c]);for(let c=0;c<i.addedNodes.length;c++)this.bindTree(i.addedNodes[c]);continue}const a=this.app.nodes.getID(r);if(a!==void 0){if(this.recents.has(a)||this.recents.set(a,dt.Changed),o==="attributes"){const c=i.attributeName;if(c===null)continue;let u=this.attributesMap.get(a);u===void 0&&this.attributesMap.set(a,u=new Set),u.add(c);continue}o==="characterData"&&this.textSet.add(a)}}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const n=e.contentDocument;if(n&&this.app.nodes.getID(n)!==void 0){const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:c=>Us(c)||this.app.nodes.getID(c)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const o=this.app.nodes.getNodeCount();for(;i.nextNode();)e.contentDocument.contains(i.currentNode)||(r+=1,this.app.nodes.unregisterNode(i.currentNode));const a=Math.floor(r/o*100);a>30&&this.app.send(wa(a))}}sendNodeAttribute(e,n,s,i){if(er(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(ua(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Vi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substring(0,2)==="on")&&!(s==="value"&&ve(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ua(e,s));return}if(s==="style"||s==="href"&&ve(n,"link")){this.app.send(Vi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(ve(n,"style")){this.app.send(ju(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Eu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,dt.New):this.recents.get(n)!==dt.New&&this.recents.set(n,dt.Removed)}bindTree(e){if(!nr(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),Us(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===dt.Removed){this.app.send(xu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Us(a)||this.app.nodes.getID(a)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const o=Math.floor(i/r*100);o>30&&this.app.send(wa(o))}}_commitNode(e,n){if(zs(n))return!0;const s=n.parentNode;let i;if(!ve(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const l=this.app.nodes.getID(r);if(l!==void 0){this.commitNode(l),this.indexes[e]=this.indexes[l]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const o=this.recents.get(e),a=o===dt.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(a){if(Tt(n)){let l=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=l.clientWidth,d=l.clientHeight;l=n.cloneNode(),l.style.width=`${h}px`,l.style.height=`${d}px`}this.app.send(_u(e,i,c,l.tagName,er(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else tr(n)&&(this.app.send(ku(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===dt.Removed&&i!==void 0&&this.app.send(Tu(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!Tt(n))throw"commitNode: node is not an element";for(const l of u)this.sendNodeAttribute(e,n,l,n.getAttribute(l))}if(this.textSet.has(e)){if(!tr(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===dt.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class Oa extends sr{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.docId=i,this.app.send(Gi(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Gi(e,s))})}}class Oh extends sr{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(Gi(s,i))})}}class Ah{constructor(){this.states=new WeakMap}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:o,top:a}=e.iFrame.getBoundingClientRect();e.offset=[o,a]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var a;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var c;s.removeEventListener("scroll",o),(c=s.defaultView)==null||c.removeEventListener("resize",o)}},o=()=>{r.offset=null};s.addEventListener("scroll",o),(a=s.defaultView)==null||a.addEventListener("resize",o),this.states.set(n,r)}clear(){this.states=new WeakMap}}const ir=ht?Element.prototype.attachShadow:()=>new ShadowRoot;class Mh extends sr{constructor(e){super(e.app,!0),this.iframeOffsets=new Ah,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=Object.assign({captureIFrames:!0},e.options),this.app.nodes.attachNodeCallback(n=>{ve(n,"iframe")&&(this.options.captureIFrames&&!on(n,"obscured")||on(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{Tt(n)&&n.shadowRoot!==null&&this.handleShadowRoot(n.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const n=this.app.safe(()=>setTimeout(()=>{const s=this.app.nodes.getID(e);if(s===void 0||!pu(e))return;const i=e.contentWindow,r=e.contentDocument;if(!r){this.app.debug.warn("no doc for iframe found",e);return}if(r&&this.docObservers.has(r)){this.app.debug.info("doc already observed for",s);return}const o=new Oa(this.app);this.iframeObservers.set(e,o),this.docObservers.set(r,o),this.iframeObserversArr.push(o),o.observe(e),this.iframeOffsets.observe(e),i&&i===i.window&&!this.contextsSet.has(i)&&(this.contextsSet.add(i),this.contextCallbacks.forEach(a=>a(i)))},250));e.addEventListener("load",n),n()}handleShadowRoot(e){const n=new Oh(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=ir.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(Su()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=ir.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Oa(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=ir,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var Hs;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Hs||(Hs={}));const Ph=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class Lh{constructor(e){this.obscured=new Set,this.hidden=new Set,this.app=e.app,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},e.options)}handleNode(e,n,s){if((this.obscured.has(n)||Tt(s)&&(on(s,"masked")||on(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||Tt(s)&&(on(s,"htmlmasked")||on(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&Tt(s)){const i=this.options.domSanitizer(s);i===Hs.Obscured&&this.obscured.add(e),i===Hs.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Ph(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[o,a]=r.split(".");return`${Ui(i)}@${Ui(o)}.${Ui(a)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class Bh{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.token||this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.token=e,this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=gu(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function Fh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Wh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?Fh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const jh='!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){var e;const n=null==i?void 0:i.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const h={Authorization:`Bearer ${this.token}`};s&&(h["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${null!==(e=this.pageNo)&&void 0!==e?e:"noPageNum"}_${null!=n?n:"noBatchNum"}`,{body:t,method:"POST",headers:h,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,u=null,a=h.NotActive;function o(){u&&u.finaliseBatch()}function c(){return new Promise((t=>{a=h.Stopping,null!==p&&(clearInterval(p),p=null),u&&(u.clean(),u=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{a=h.NotActive,t(null)}),100)}))}function g(){[h.Stopped,h.Stopping].includes(a)||(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let l,p=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{a=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(a=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),u=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===p&&(p=setInterval(o,1e4)),a=h.Active):"auth"===s.type?r?u?(r.authorise(s.token),void(s.beaconSizeLimit&&u.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(u){const t=u;s.forEach((s=>{55===s[0]&&(s[1]?l=setTimeout((()=>g()),18e5):clearTimeout(l)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()}}();\n',is="canceled",Aa="or_uxt_active",rr="or_buffer_1",xt=t=>({reason:t,success:!1}),Ma=t=>({...t,success:!0});var pe;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(pe||(pe={}));const Pa="https://api.openreplay.com/ingest";function or(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const zh=t=>new Promise(e=>setTimeout(e,t)),ge={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",polling:"hello-how-are-you-im-under-the-water-please-help-me"};let Uh=class{constructor(e,n,s,i,r){var c,u;this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=pe.NotActive,this.version="14.0.14",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.features={"feature-flags":!0,"usability-test":!0},this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.parentCrossDomainFrameListener=l=>{const{data:h}=l;if(!(!h||l.source===window)){if(h.line===ge.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===ge.parentAlive&&(this.parentActive=!0),h.line===ge.iframeId&&(this.parentActive=!0,this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart()),h.line===ge.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,p;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===ge.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:ge.parentAlive},"*"),(async()=>{var y;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const m=await this.checkNodeId(l.source);if(!m){this.debug.log("Couldnt get node id for iframe",l.source);return}try{this.trackedFrames.includes(h.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(h.context),await this.waitStarted();const S=this.session.getSessionToken(),_=this.trackedFrames.findIndex(g=>g===h.context)+1;_===0&&this.debug.error("Couldnt get order number for iframe",h.context,this.trackedFrames);const x={line:ge.iframeId,id:m,token:S,frameOrderNumber:_};this.debug.log("Got child frame signal; nodeId",m,l.source,x),(y=l.source)==null||y.postMessage(x,"*")}catch(S){console.error(S)}})()),h.line===ge.iframeBatch){const m=h.messages.map(y=>{if(y[0]===20){let S=y;return this.pageFrames.forEach(_=>{if(_.contentWindow===l.source){const[x,g,b]=y,{left:E,top:I}=_.getBoundingClientRect();S=[x,g+E,b+I]}}),S}if(y[0]===68){let S=y;return this.pageFrames.forEach(_=>{if(_.contentWindow===l.source){const[x,g,b,E,I,k,T]=y,{left:M,top:G,width:z,height:Z}=_.getBoundingClientRect(),W=document.documentElement.scrollWidth,L=document.documentElement.scrollHeight,Y=k/100*z+M,$=T/100*Z+G,R=Y/W,J=$/L;S=[x,g,b,E,I,Math.round(R*1e3)/10,Math.round(J*1e3)/10]}}),S}return y});this.messages.push(...m)}if(h.line===ge.polling){if(!this.pollingQueue.order.length)return;const f=this.pollingQueue.order[0];if(f&&this.pollingQueue[f].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(m=>m!==f);return}this.pollingQueue[f].includes(h.context)&&(this.pollingQueue[f]=this.pollingQueue[f].filter(m=>m!==h.context),(p=l.source)==null||p.postMessage({line:f},"*"),this.pollingQueue[f].length===0&&this.pollingQueue.order.shift())}}},this.pollingQueue={order:[]},this.addCommand=l=>{this.pollingQueue.order.push(l),this.pollingQueue[l]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(ge.startIframe)},this.killChildrenFrames=()=>{this.addCommand(ge.killIframe)},this.signalIframeTracker=()=>{var S;const l=this.session.getTabId();window.parent.postMessage({line:ge.iframeSignal,source:l,context:this.contextId},((S=this.options.crossdomain)==null?void 0:S.parentDomain)??"*");const h=10;let d=0,p=250,f=0,m=!1;const y=()=>{var _;if(m||this.checkStatus()){m=!0;return}window.parent.postMessage({line:ge.iframeSignal,source:l,context:this.contextId},((_=this.options.crossdomain)==null?void 0:_.parentDomain)??"*"),this.debug.info("Trying to signal to parent, attempt:",d+1),d++};for(let _=0;_<h;_++){if(this.checkStatus()){m=!0;break}f+=p,setTimeout(()=>{y()},f),p*=1.5}},this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.startCallbacks.push(l)},this.attachStopCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.stopCallbacks.push(l)},this.attachEventListener=(l,h,d,p=!0,f=!0)=>{p&&(d=this.safe(d));const m=()=>l?aa(l,h,d,f,this.options.forceNgOff):null,y=()=>l?la(l,h,d,f,this.options.forceNgOff):null;this.attachStartCallback(m,p),this.attachStopCallback(y,p)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var l;(l=this.canvasRecorder)==null||l.restartTracking()},this.flushBuffer=async l=>new Promise(h=>{let d=!1;const p=[l.shift()];for(;!d;){const f=l[0];!f||f[0]===0?d=!0:p.push(l.shift())}this.postToWorker(p),h(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(l=>["fixedCanvasScaling","disableCanvas"].includes(l))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Pa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:On.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1};if(this.options=ca(o,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const l=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${l}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new Lh({app:this,options:s}),this.nodes=new Dh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new Mh({app:this,options:s}),this.ticker=new Wh(this),this.ticker.attach(()=>this.commit()),this.debug=new xh(this.options.__debug__),this.session=new Bh({app:this,options:this.options}),this.attributeSender=new lu({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new hu(this),this.tagWatcher=new Zu({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(Yu(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(Pu(l)),h!=null&&Object.entries(h).forEach(([d,p])=>this.send(ha(d,p)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),setInterval(()=>{var l;document.hidden||window.parent.postMessage({line:ge.polling,context:this.contextId},((l=s.crossdomain)==null?void 0:l.parentDomain)??"*")},250)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener)),this.bc!==null&&(this.bc.postMessage({line:ge.ask,source:a,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=l=>{if(l.data.context!==this.contextId){if(l.data.line===ge.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?ge.reg:ge.resp,token:h,source:a,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(r=>r.contentWindow===e)}if(!n)return null;let s=0;for(;s<100;){const i=n[this.options.node_id];if(i!==void 0)return s=100,i;s++,await zh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([jh],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(pe.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(s=>{this.debug.info("Worker restarted, session was too long",s)}).catch(s=>{this.debug.error("Worker restart failed",s)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?ru(e.batch,{mtime:0},(r,o)=>{var a,c;r?(this.debug.error("Openreplay compression error:",r),(a=this.worker)==null||a.postMessage({type:"uncompressed",batch:s})):(c=this.worker)==null||c.postMessage({type:"compressed",batch:o})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==pe.NotActive&&(this.activityState===pe.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===pe.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(ln(this.session.getTabId())),this.messages.unshift(an(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:ge.iframeBatch,messages:this.messages},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length))try{wu(()=>{var n;this.messages.unshift(ln(this.session.getTabId())),this.messages.unshift(an(this.timestamp())),(n=this.worker)==null||n.postMessage(this.messages),this.commitCallbacks.forEach(s=>s(this.messages)),this.messages.length=0})}catch(n){this._debug("worker_commit",n),this.stop(!0),setTimeout(()=>{this.start()},500)}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId())),this.bufferedMessages2.push(an(this.timestamp())),this.bufferedMessages2.push(ln(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===pe.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return it()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,c=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=it()-i;return`${c}?jumpto=${u}`}return c}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===pe.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,zi(),this.coldStartTs=it(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(an(this.timestamp())),this.bufferedMessages2.push(ln(this.session.getTabId()))),this.stop(!1),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Bs(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var p,f;this.conditionsManager=new cu(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:it(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:or(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,projectID:l,features:h}=await n.json();this.features=h||this.features,this.session.assign({projectID:l}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});const d={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(m=>m(d)),await((p=this.conditionsManager)==null?void 0:p.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(f=this.conditionsManager)==null||f.processFlags(this.featureFlags.flags)),await this.tagWatcher.fetchTags(this.options.ingestPoint,s)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);zi(),this.coldStartTs=it();const i=this.localStorage.getItem(rr);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(rr)}this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId())),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(r)),s||this.send(Bs(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(rr,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,p;this.stop(!1);const e=it();(d=this.worker)==null||d.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:or()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((p=this.worker)==null||p.postMessage({type:"auth",token:s,beaconSizeLimit:l}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){var c,u,l,h,d;Object.keys(e).length!==0&&(this.prevOpts=e);const i=this.activityState===pe.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const p="No worker found: perhaps, CSP is not set.";return this.signalError(p,[]),Promise.resolve(xt(p))}if(this.activityState===pe.Active||this.activityState===pe.Starting)return Promise.resolve(xt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=pe.Starting,i||zi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=it();(c=this.worker)==null||c.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const o=this.session.getSessionToken(),a=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{const p=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:or(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(p.status!==200){const R=await p.text(),J=R===is?is:`Server error: ${p.status}. ${R}`;return xt(J)}if(!this.worker&&!this.insideIframe){const R="no worker found after start request (this should not happen in real world)";return this.signalError(R,[]),xt(R)}const{token:f,userUUID:m,projectID:y,beaconSizeLimit:S,compressionThreshold:_,delay:x,sessionID:g,startTimestamp:b,userBrowser:E,userCity:I,userCountry:k,userDevice:T,userOS:M,userState:G,canvasEnabled:z,canvasQuality:Z,canvasFPS:W,assistOnly:L,features:Y}=await p.json();if(this.features=Y||this.features,typeof f!="string"||typeof m!="string"||typeof b!="number"&&typeof b<"u"||typeof g!="string"||typeof x!="number"||typeof S!="number"&&typeof S<"u"){const R=`Incorrect server response: ${JSON.stringify(p)}`;return this.signalError(R,[]),xt(R)}this.delay=x,this.session.setSessionToken(f),this.session.setUserInfo({userBrowser:E,userCity:I,userCountry:k,userDevice:T,userOS:M,userState:G}),this.session.assign({sessionID:g,timestamp:b||r,projectID:y}),L?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:f,beaconSizeLimit:S}),!a&&f===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Bs(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([R,J])=>this.send(ha(R,J))),this.localStorage.setItem(this.options.local_uuid_key,m),this.compressionThreshold=_;const $={sessionToken:f,userUUID:m,sessionID:g};if(this.startCallbacks.forEach(R=>R($)),e.startCallback&&e.startCallback(Ma($)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,f),this.activityState=pe.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),z&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new _h(this,{fps:W,quality:Z,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const R=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;R.length>0;)await this.flushBuffer(R);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();if((d=this.canvasRecorder)==null||d.startTracking(),this.features["usability-test"]&&!this.insideIframe){this.uxtManager=this.uxtManager?this.uxtManager:new yh(this,Aa);let R;const J=this.localStorage.getItem(Aa);if(J&&(R=parseInt(J,10)),location!=null&&location.search){const N=new URLSearchParams(location.search);if(N.has("oruxt")){const O=N.get("oruxt");R=O?parseInt(O,10):void 0}}R&&(this.uxtManager.isActive?this.onUxtCb.forEach(N=>N(R)):this.uxtManager.getTest(R,f,!!J).then(N=>{N&&this.onUxtCb.forEach(O=>O(N))}))}return Ma($)}catch(p){if(this.stop(),this.session.reset(),!p)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),xt("Unknown error");if(p===is)return this.signalError(is,[]),xt(is);this._debug("session_start",p);const f=p instanceof Error?p.message:p.toString();return this.signalError(f,[]),xt(f)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(pe.Active)}async waitStatus(e){return new Promise(n=>{const s=()=>{this.activityState===e?n(!0):setTimeout(s,25)};s()})}async start(...e){return this.activityState===pe.Active||this.activityState===pe.Starting?Promise.resolve(xt("OpenReplay: trying to call `start()` on the instance that has been started already.")):(this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e)))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(Vu("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==pe.NotActive)try{!this.insideIframe&&((n=this.options.crossdomain)!=null&&n.enabled)&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(s=this.canvasRecorder)==null||s.clear(),this.messages.length=0,this.parentActive=!1}finally{this.activityState=pe.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function Hh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Fu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const La=ht&&"InstallTrigger"in window?t=>t.message+`
10
+ `+t.stack:t=>t.stack||t.message;function ar(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?La(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function qh(t){return typeof t!="number"?"NaN":t.toString()}function Vh(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function Ba(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return La(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(ar).join(", ");return`Array(${e})[${n}]`}if(typeof t=="object"){const e=[];let n=0;for(const s in t){if(++n===10)break;const i=t[s];e.push(s+": "+ar(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Gh(t){return typeof t[0]=="string"&&t.unshift(t.shift().replace(/%(o|s|f|d|i)/g,(e,n)=>{const s=t.shift();if(s===void 0)return e;switch(n){case"o":return Ba(s);case"s":return ar(s);case"f":return qh(s);case"d":case"i":return Vh(s);default:return e}})),t.map(Ba).join(" ")}const Fa=["log","info","warn","error","debug","assert"];function Kh(t,e){const n=Object.assign({consoleMethods:Fa,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((c,u)=>t.send(Du(c,Gh(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const o=(c,u)=>{const l={apply:function(h,d,p){Reflect.apply(h,u,p),i=i+1,!(i>n.consoleThrottling)&&s(h.name,p)}};n.consoleMethods.forEach(h=>{if(Fa.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const d=u.console[h];c[h]=new Proxy(d,l)})},a=t.safe(c=>o(c.console,c));a(window),t.observer.attachContextCallback(a)}const Xh=/(^|@)\S+:\d+/,Wa=/^\s*at .*(\S+:\d+|\(native\))/m,Yh=/^(eval@)?(\[native code\])?$/;function Jh(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return td(t);if(t.stack&&t.stack.match(Wa))return Qh(t);if(t.stack)return $h(t);throw new Error("Cannot parse given Error object")}function lr(t){if(!t.includes(":"))return[t,void 0,void 0];const n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]}function rs(t,e){return t}function Qh(t,e){return Zh(t.stack)}function Zh(t,e){return rs(t.split(`
11
+ `).filter(s=>!!s.match(Wa))).map(s=>{s.includes("(eval ")&&(s=s.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=s.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const r=i.match(/ (\(.+\)$)/);i=r?i.replace(r[0],""):i;const o=lr(r?r[1]:i),a=r&&i||void 0,c=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:c,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:s}})}function $h(t,e){return ed(t.stack)}function ed(t,e){return rs(t.split(`
12
+ `).filter(s=>!s.match(Yh))).map(s=>{if(s.includes(" > eval")&&(s=s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!s.includes("@")&&!s.includes(":"))return{function:s};{const i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=s.match(i),o=r&&r[1]?r[1]:void 0,a=lr(s.replace(i,""));return{function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:s}}})}function td(t,e){return!t.stacktrace||t.message.includes(`
13
13
  `)&&t.message.split(`
14
14
  `).length>t.stacktrace.split(`
15
- `).length?Bh(t):t.stack?jh(t):Wh(t)}function Bh(t,e){const n=/Line (\d+).*script (?:in )?(\S+)/i,s=t.message.split(`
16
- `),i=[];for(let r=2,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({file:a[2],line:+a[1],raw:s[r]})}return es(i)}function Wh(t,e){const n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,s=t.stacktrace.split(`
17
- `),i=[];for(let r=0,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:s[r]})}return es(i)}function jh(t,e){return es(t.stack.split(`
18
- `).filter(s=>!!s.match(Dh)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=tr(i.pop()),o=i.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let c;o.match(/\(([^)]*)\)/)&&(c=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const u=c===void 0||c==="[arguments not available]"?void 0:c.split(",");return{function:a,args:u,file:r[0],line:r[1]?+r[1]:void 0,col:r[2]?+r[2]:void 0,raw:s}})}function zh(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function Uh(t,e){return zh(Oh(t))}function Ea(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function js(t,e,n={}){let s=e;try{s=Uh(t)}catch{}return zi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function Ia(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return js(t.error,Ea(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),zi(s,i,JSON.stringify(Ea(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return js(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return zi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function Hh(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=Ia(o,i);a!=null&&t.send(a)}try{t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}catch(o){console.error("Error while attaching to error proto contexts",o)}}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Ca(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function qh(t){return Xc&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const Vh="https://static.openreplay.com/tracker/placeholder.jpeg";function Gh(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",Vh);const{width:u,height:l}=c.getBoundingClientRect();c.hasAttribute("width")||t.attributeSender.sendSetAttribute(a,"width",String(u)),c.hasAttribute("height")||t.attributeSender.sendSetAttribute(a,"height",String(l))}const n=function(a,c){const{srcset:u}=c;if(!u)return;const l=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Ca(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>Yc&&e(a,c),t.send(Bi(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=Ca(a.src||"");zo(c)&&t.send(ra(t.timestamp(),0,0,0,0,0,c,"img",0,!1))}),r=t.safe(function(a){const c=t.nodes.getID(a);c!==void 0&&a.complete&&(a.naturalHeight===0&&a.naturalWidth===0&&!qh(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=Go(t.safe(a=>{for(const c of a)if(c.type==="attributes"){const u=c.target,l=t.nodes.getID(u);if(l===void 0)return;c.attributeName==="src"&&s(l,u),c.attributeName==="srcset"&&n(l,u)}}),t.options.forceNgOff);t.attachStopCallback(()=>{o.disconnect()}),t.nodes.attachNodeCallback(a=>{ve(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>r(a)),r(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))})}const Kh=["text","password","email","search","number","range","date","tel","time"];function Xh(t){return ve(t,"textarea")?!0:ve(t,"input")?Kh.includes(t.type):!1}function Yh(t){if(!ve(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const Jh=ot&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function Na(t){let e=Li(t);if(e===null){const n=Jh(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return jo(e).slice(0,100)}const Rn={Plain:0,Obscured:1,Hidden:2};function Qh(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:Rn.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,f=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?f=Rn.Hidden:(t.sanitizer.isObscured(l)||f===Rn.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(f=Rn.Obscured);let p=0;switch(f){case Rn.Hidden:p=-1,d="";break;case Rn.Obscured:p=d.length,d="";break}return{value:d,mask:p}}function i(l,h){const{value:d,mask:f}=s(l,h);t.send(uu(l,d,f))}const r=new Map,o=new Map;t.attachStopCallback(()=>{r.clear(),o.clear()});function a(l,h){r.get(l)!==h.value&&(r.set(l,h.value),i(l,h))}function c(l,h){o.get(l)!==h&&(o.set(l,h),t.send(hu(l,h)))}t.ticker.attach(()=>{r.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return r.delete(h);a(h,d)}),o.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return o.delete(h);c(h,d.checked)})},3);function u(l,h,d,f){const{value:p,mask:m}=s(l,h),E=Na(h);t.send(Cu(l,p,m!==0,E,d,f))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(ve(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),Xh(l)){a(h,l);let d=0,f=0,p=0;const m=()=>{d=Ze()},E=()=>{f===0&&d!==0&&(f=Ze()-d)},_=()=>{d!==0&&(p=Ze()-d),u(h,l,f,p),f=0,p=0,d=0};t.nodes.attachNodeListener(l,"focus",m),t.nodes.attachNodeListener(l,"input",E),t.nodes.attachNodeListener(l,"change",_);return}if(Yh(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let Ve,nr,Da;function Zh(t,e){if(Da=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Ve={...n,...e},nr=$h(Ve.root,n);let s=zs(t,"all",()=>zs(t,"two",()=>zs(t,"one",()=>zs(t,"none"))));if(s){const i=La(Fa(s,t));return i.length>0&&(s=i[0]),Us(s)}else throw new Error("Selector was not found.")}function $h(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function zs(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-Da.getTime();if(Ve.timeoutMs!==void 0&&a>Ve.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=qs(ed(r))||qs(...td(r))||qs(...nd(r))||qs(sd(r))||[Ma()];const u=id(r);if(e=="all")u&&(c=c.concat(c.filter(sr).map(l=>Hs(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(sr).map(l=>Hs(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&sr(l)&&(c=[Hs(l,u)])}else e=="none"&&(c=[Ma()],u&&(c=[Hs(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=Ve.seedMinLength&&(s=Ra(i,n),s))break;r=r.parentElement,o++}return s||(s=Ra(i,n)),!s&&n?n():s}function Ra(t,e){const n=La(Pa(t));if(n.length>Ve.threshold)return e?e():null;for(let s of n)if(Aa(s))return s;return null}function Us(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function Oa(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Aa(t){const e=Us(t);switch(nr.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function ed(t){const e=t.getAttribute("id");return e&&Ve.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function td(t){return Array.from(t.attributes).filter(n=>Ve.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function nd(t){return Array.from(t.classList).filter(Ve.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function sd(t){const e=t.tagName.toLowerCase();return Ve.tagName(e)?{name:e,penalty:2}:null}function Ma(){return{name:"*",penalty:3}}function id(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function Hs(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function sr(t){return t.name!=="html"&&!t.name.startsWith("#")}function qs(...t){const e=t.filter(rd);return e.length>0?e:null}function rd(t){return t!=null}function*Pa(t,e=[]){if(t.length>0)for(let n of t[0])yield*Pa(t.slice(1,t.length),e.concat(n));else yield e}function La(t){return[...t].sort((e,n)=>Oa(e)-Oa(n))}function*Fa(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Ve.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Ve.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Us(i);if(n.visited.has(r))return;Aa(i)&&od(i,e)&&(yield i,n.visited.set(r,!0),yield*Fa(i,e,n))}}function od(t,e){return nr.querySelector(Us(t))===e}function ad(t,e,n){return Zh(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function ir(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function Ba(t,e){return t instanceof Element?ld(t,e):null}function ld(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(Zt(n,"masked"))return null;n=n.parentElement}if(Ki(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||ir(n)||Li(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function cd(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const w=Li(g);if(w!==null)return w;if(ve(g,"input"))return Na(g);if(ir(g)){let k="";return g instanceof HTMLElement&&(k=t.sanitizer.getInnerTextSecure(g)),k=k||g.id||g.className,jo(k).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,f=0,p;const m=.008,E=225;function _(){const g=f/E;if(!l){l=g;return}const w=(g-l)/E;d>4&&w>m&&t.send(Nu(Ze())),f=0,d=0,l=g}t.attachStartCallback(()=>{p=setInterval(()=>_(),E)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},p&&clearInterval(p)});const x=()=>{o&&(t.send(du(i,r)),o=!1)},T=(g,w=!1)=>{function k(y,S,A){return u[y]=u[y]||ad(S,g,A)}const I=w?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);I(g.documentElement,"mouseover",y=>{const S=Ba(y.target,g);S!==a&&(a=S,c=performance.now())}),I(g,"mousemove",y=>{const[S,A]=t.observer.getDocumentOffset(g);i=y.clientX+S,r=y.clientY+A,o=!0;const W=Math.sign(y.movementX);f+=Math.abs(y.movementX)+Math.abs(y.movementY),W!==h&&(h=W,d++)},!1),I(g,"click",y=>{const S=Ba(y.target,g);if(!y.clientX&&!y.clientY||S===null)return;const A=t.nodes.getID(S);if(A!==void 0){const W=y.pageX,B=y.pageY,V=g.documentElement.scrollWidth,z=g.documentElement.scrollHeight,j=Wa(W/V),C=Wa(B/z);x(),t.send(xu(A,a===S?Math.round(performance.now()-c):0,s(S),ir(S)&&!n?k(A,S,e):"",j,C),!0)}a=null})};t.nodes.attachNodeCallback(g=>{Ls(g)&&T(g)}),T(document,!0),t.ticker.attach(x,(e==null?void 0:e.trackingOffset)||7)}function Wa(t){return Math.round(t*1e4)}function ud(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(ve(r,"img")&&(o=r.currentSrc||r.src),!o){const p=getComputedStyle(r).getPropertyValue("background-image");if(p){const m=s.exec(p);m!==null&&(o=m[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const c=r.getBoundingClientRect(),u=Math.max(c.top,0),l=Math.max(c.left,0),h=Math.min(c.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),d=Math.min(c.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||d<=l)continue;const f=(h-u)*(d-l);e.push({time:a,area:f})}return e}function hd(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:o}=e[i];n+=o,s+=o*(r>t?r:t)}return n===0?0:s/n}function dd(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!zo(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let l=!1;(h=n.excludedResourceUrls)==null||h.forEach(d=>{if(u.name.startsWith(d)){l=!0;return}}),!l&&t.send(ra(u.startTime+In(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let o;t.attachStartCallback(function({sessionID:u}){u!==o&&(performance.getEntriesByType("resource").forEach(i),o=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let a=0,c=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((a===0||c===0)&&performance.getEntriesByType("paint").forEach(l=>{const{name:h,startTime:d}=l;switch(h){case"first-paint":a=d;break;case"first-contentful-paint":c=d;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:l,requestStart:h,responseStart:d,responseEnd:f,domContentLoadedEventStart:p,domContentLoadedEventEnd:m,loadEventStart:E,loadEventEnd:_}=performance.timing;t.send(pu(h-l||0,d-l||0,f-l||0,p-l||0,m-l||0,E-l||0,_-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,f=!1;t.ticker.attach(()=>{if(f)return;const p=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(m=>s[m])),p-u>1e3&&(d=ud(s),s=null)),h!==null&&(p-h>50&&(l=p),h=p-l>5e3?null:p),d!==null&&h===null||p>3e4){f=!0,s=null;const m=d===null?0:hd(c||a,d),{domContentLoadedEventEnd:E,navigationStart:_}=performance.timing,x=h===null?Math.max(l,c,E-_||0):0;t.send(gu(m,c>u?c:u,x))}})}}function rr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function fd(t,e){let n=!1;const s=new Map;function i(a){ma(a)&&(_t(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),Ls(a)&&s.set(a,rr(a)))}const r=t.safe(()=>{e||t.send(nu(...rr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(cu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(_t(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):Ls(a)&&s.set(a,rr(a))),Fs(a)&&t.nodes.attachNodeListener(a,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",a=>{const c=a.target;if(c===document){n=!0;return}i(c)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(o),s.clear()},5,!1)}function pd(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Ou(e,r,i,document.title)),i=0,r=e)}),a=t.safe(()=>{const{innerWidth:u,innerHeight:l}=window;(u!==n||l!==s)&&(n=u,s=l,t.send(tu(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Su(document.hidden)));t.attachStartCallback(()=>{e=null,i=In(),n=s=-1,o(),a(),c()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",c,!1,!1),t.ticker.attach(o,1,!1),t.ticker.attach(a,5,!1)}function ja(t){return Fs(t)&&!!t.adoptedStyleSheets}let gd=15;function za(){return gd++}const Vs=new Map;function md(t){if(t===null||!ja(document))return;const e=new Map,n=new Map,s=o=>setTimeout(()=>{let a=t.nodes.getID(o);if(o===document&&(a=0),a===void 0)return;let c=n.get(a);c||(c=[]);const u=[],l=o.adoptedStyleSheets;if(l&&Symbol.iterator in l)for(const h of l){let d=e.get(h);const f=!d;if(d||(d=za(),e.set(h,d)),c.includes(d)||t.send(na(d,a)),f){const p=h.cssRules;for(let m=0;m<p.length;m++)t.send(ji(d,p[m].cssText,m,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(Eu(h,a));n.set(a,u)},20);function i(o){const a=Object.getOwnPropertyDescriptor(o,"adoptedStyleSheets");a&&Object.defineProperty(o,"adoptedStyleSheets",{...a,set:function(c){const u=a.set.call(this,c);return s(this),u}})}const r=o=>{if(o.__openreplay_adpss_patched__)return;o.__openreplay_adpss_patched__=!0,i(o.Document.prototype),i(o.ShadowRoot.prototype);const{replace:a,replaceSync:c}=o.CSSStyleSheet.prototype;o.CSSStyleSheet.prototype.replace=function(u){return a.call(this,u).then(l=>{const h=e.get(this);return h&&t.send(ea(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(ea(l,u,t.getBaseHref())),c.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(o=>{ja(o)&&s(o)})}function vd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(ku("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=Vs.get(i);a&&(typeof o=="string"?t.send(ji(a,o,r,t.getBaseHref())):t.send(ta(a,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const o=r.parentStyleSheet;if(!o){t.debug.warn("No parent StyleSheet found for",r,i);return}const a=Vs.get(o);if(!a){t.debug.warn("No sheedID found for",o,Vs);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(ji(a,c,l,t.getBaseHref())),t.send(ta(a,l+1))):t.debug.warn("Rule index not found in",o,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:o}=i.CSSStyleSheet.prototype,{insertRule:a,deleteRule:c}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,l=0){return e(this,l,u),r.call(this,u,l)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),o.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,l=0){const h=a.call(this,u,l);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const l=c.call(this,u);return n(this),l}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!ve(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const o=i.sheet,a=za();Vs.set(o,a),t.send(na(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function bd(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send($o(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ve(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{ma(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send($o(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ve(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function wd(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...o){if(typeof o[1]=="string"){let a="";o[2]&&t.safe(()=>{a=JSON.stringify(o[2])});const c=[o[0],o[1],a],u=e.get(s.document)||[];u.push(c),e.set(s.document,u);const l=s===window?0:t.nodes.getID(s.document);if(l===void 0)return;t.active()&&t.send(Zo(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!Ls(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(o=>{t.send(Zo(r,...o))})}))}function yd(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(d){t.debug.log("Openreplay: capturing axios response data",d);const{headers:f,data:p,method:m,url:E,baseURL:_}=d.config,{data:x,headers:T,status:g,response:w}=d,{data:k,headers:I,status:y}=w||{},S=n.ignoreHeaders,A=Array.isArray(S)?N=>S.includes(N):()=>S;function W(N,M){A(M[0])||(N[M[0]]=M[1])}let B={},V={};f.toJSON?B=f.toJSON():f instanceof Headers?f.forEach((N,M)=>W(B,[M,N])):Array.isArray(f)?f.forEach(N=>W(B,N)):typeof f=="object"&&Object.entries(f).forEach(N=>W(B,N));const z=I||T;z.toJSON?V=z.toJSON():z instanceof Headers?z.forEach((N,M)=>W(V,[M,N])):Array.isArray(z)?z.forEach(N=>W(V,N)):typeof z=="object"&&Object.entries(z).forEach(([N,M])=>{A(N)||(V[N]=M)});const j=s({url:E,method:m||"",status:g||y||0,request:{headers:B,body:p},response:{headers:V,body:k||x}});if(!j){t.debug.log("Openreplay: empty request/response info, skipping");return}const C=d.config.__openreplay_timing,R=performance.now()-C;t.debug.log("Openreplay: final req object",j),t.send(Os("xhr",String(m),String(j.url),i(j.request),i(j.response),j.status,C+In(),R,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const f=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&d.headers.set(f,p)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),Sd(d)&&d.response?r(d.response):d instanceof Error&&t.send(js(d,[])),Promise.reject(d)}function u(d){t.debug.log("Openreplay: failed API request, skipping",d)}const l=e.interceptors.request.use(o,u,{synchronous:!0}),h=e.interceptors.response.use(a,c,{synchronous:!0});t.attachStopCallback(()=>{var d,f,p,m;(f=(d=e.interceptors.request).eject)==null||f.call(d,l),(m=(p=e.interceptors.response).eject)==null||m.call(p,h)})}function Sd(t){return _d(t)&&t.isAxiosError===!0}function _d(t){return t!==null&&typeof t=="object"}class or{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(!r)return null;if(r.url.includes("/graphql")&&r.response.body&&typeof r.response.body=="string"){const a=r.response.body.includes("errors");r.status=a?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:r.method,url:r.url,request:JSON.stringify(r.request),response:JSON.stringify(r.response),status:r.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const ts=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:lr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},ar=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(Td(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":lr(t)?e=t:e=`can't parse body ${typeof t}`;return e},kd=(t,e={})=>{lr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function lr(t){return t!==null&&typeof t=="object"}function Td(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function Gs(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const cr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),xd=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class Ed{constructor(e,n,s,i,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r}apply(e,n,s){const i=s[0],r=s[1],o=new or(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=cr(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":xd(r)},o.status=0,o.statusText="Pending",a.search&&a.searchParams){o.getData={};for(const[l,h]of a.searchParams)o.getData[l]=h}o.requestData=ar(r),o.startTime||(o.startTime=performance.now());const c=e.apply(n,s);c?(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Sent",o.readyState=4):(o.status=500,o.statusText="Unknown");const u=o.getMessage();return u&&this.sendMessage(u),c}}class Id{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new Ed(n,s,i,r,o))}}var lt;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(lt||(lt={}));class Cd{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=ts(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===lt.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(o=>{if(!e)e=new Uint8Array(o.value);else{const a=new Uint8Array(e.length+o.value.length);a.set(e),a.set(o.value,e.length),e=a}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=o.done?4:3,this.item.statusText=o.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Gs(this.item.responseSize),o.done&&(this.item.response=ts(this.item.responseType,e)),o}),s.cancel=(...o)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=ts(this.item.responseType,e),r.apply(s,o)),s}}}class Nd{constructor(e,n,s,i,r,o){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=o}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const a=new or(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(a,i,r),this.setSessionTokenHeader((c,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(a.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(c,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]=Object.assign(Object.assign({},s[1]),{headers:{}})),s[1].headers instanceof Headers?s[1].headers.append(c,u):Array.isArray(s[1].headers)?s[1].headers.push([c,u]):s[1].headers[c]=u}}),e.apply(window,s).then(this.afterFetch(a)).catch(c=>{throw a.endTime=performance.now(),a.duration=a.endTime-(a.startTime||a.endTime),c})}beforeFetch(e,n,s){let i,r="GET",o={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=cr(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=cr(n.url),o=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=o,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(o)==="[object Headers]"){e.requestHeader={};for(const[a,c]of o)e.requestHeader[a]=c}else e.requestHeader=o;if(i.search&&i.searchParams){e.getData={};for(const[a,c]of i.searchParams)e.getData[a]=c}s!=null&&s.body&&(e.requestData=ar(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Gs(e.responseSize),e.response=ts(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Cd(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Dd{static create(e,n,s,i,r,o){return new Proxy(fetch,new Nd(e,n,s,i,r,o))}}class Rd{constructor(e,n,s,i,r,o,a){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=o,this.tokenUrlMatcher=a,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new or(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=ts(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===lt.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var i,r,o;const a=s[0],c=s[1];return this.item.method=a?a.toUpperCase():"GET",this.item.url=((i=c.toString)===null||i===void 0?void 0:i.call(c))||"",this.item.name=(o=(r=this.item.url)===null||r===void 0?void 0:r.replace(new RegExp("/*$"),"").split("/").pop())!==null&&o!==void 0?o:"",this.item.getData=kd(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=ar(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case lt.UNSENT:case lt.OPENED:this.item.status=lt.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case lt.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
19
- `);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),o=r[0];this.item.header[o]=r.slice(1).join(": ")}break;case lt.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Gs(this.item.responseSize));break;case lt.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Gs(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Od{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new Rd(c,e,n,s,i,r,o))}})}}const Ua=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function Ad(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=Od.create(e,n,s,i,r,a):Ua("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=Dd.create(e,n,s,i,r,a):Ua("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=Id.create(u,e,n,s,i,r)}}function ur(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function Ha(t){return typeof t=="string"?t.toUpperCase():"GET"}function Md(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?l=>s.includes(l):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(l){if(r){const h=t.getSessionToken();h&&t.safe(l)(r,h)}}function a(l){if(n.capturePayload||(delete l.request.body,delete l.response.body),n.sanitizer){const h=l.response.body;if(typeof h=="string")try{l.response.body=JSON.parse(h)}catch{}return n.sanitizer(l)}return l}function c(l){if(l&&typeof l.body!="string")try{l.body=JSON.stringify(l.body)}catch{l.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",l.body)}return JSON.stringify(l)}const u=l=>{if(n.useProxy)return Ad(l,n.ignoreHeaders,o,a,T=>{t.send(Os(T.requestType,T.method,T.url,T.request,T.response,T.status,T.startTime+In(),T.duration,T.responseSize))},T=>t.isServiceURL(T),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=l.fetch.bind(l),d=(T,g={})=>{if(!(typeof T=="string"||T instanceof URL)||t.isServiceURL(String(T)))return h(T,g);o(function(k,I){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(k,I):Array.isArray(g.headers)?g.headers.push([k,I]):g.headers[k]=I});const w=performance.now();return h(T,g).then(k=>{const I=performance.now()-w;if(n.failuresOnly&&k.status<400)return k;const y=k.clone();return y.text().then(S=>{const A={},W={};if(s!==!0){const z=([j,C])=>{i(j)||(A[j]=C)};g.headers instanceof Headers?g.headers.forEach((j,C)=>z([C,j])):Array.isArray(g.headers)?g.headers.forEach(z):typeof g.headers=="object"&&Object.entries(g.headers).forEach(z),y.headers.forEach((j,C)=>{i(C)||(W[C]=j)})}const B=Ha(g.method),V=a({url:String(T),method:B,status:y.status,request:{headers:A,body:g.body||null},response:{headers:W,body:S}});V&&t.send(Os("fetch",B,String(V.url),c(V.request),c(V.response),y.status,w+In(),I,0))}).catch(S=>t.debug.error("Could not process Fetch response:",S)),k})};l.fetch=d;const f=l.XMLHttpRequest.prototype.open,p=l.XMLHttpRequest.prototype.setRequestHeader,m=l.XMLHttpRequest.prototype.send;function E(T,g){const w=this;o((I,y)=>w.setRequestHeader(I,y));let k=0;return w.addEventListener("loadstart",I=>{k=I.timeStamp}),w.addEventListener("load",t.safe(I=>{const{headers:y,body:S}=ur(w),A=k>0?I.timeStamp-k:0,B=(w.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),V={};B.forEach(function(C){const R=C.split(": "),N=R.shift();i(N)||(V[N]=R.join(": "))});const z=Ha(T),j=a({url:String(g),method:z,status:w.status,request:{headers:y,body:S||null},response:{headers:V,body:w.response}});j&&t.send(Os("xhr",z,String(j.url),c(j.request),c(j.response),w.status,k+In(),A,0))})),f.apply(this,arguments)}function _(T){const g=ur(this);return g.body=T,m.apply(this,arguments)}function x(T,g){if(!i(T)){const w=ur(this);w.headers[T]=g}return p.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=E,l.XMLHttpRequest.prototype.send=_,l.XMLHttpRequest.prototype.setRequestHeader=x)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{yd(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function Pd(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(sa(n,s,i))}else t.send(sa(-1,-1,""))})}function Ld(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(As(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const Ks="/installation/javascript-sdk";function Fd(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Rs}${Ks}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Rs}${Ks} for more information.`),!1;t.projectKey=t.projectID.toString(),Pt("`projectID` option","`projectKey` option",Ks)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Pt("`sessionToken` option","`sessionHash` start() option","/"),!0}const Bd=()=>{try{return!!window.top}catch{return!1}};class Wd{constructor(e){var a,c;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(u,l)=>{const h=this.checkDoNotTrack(),d=new XMLHttpRequest,f=this.options.ingestPoint||Sa;d.open("POST",f+"/v1/web/not-started"),d.send(JSON.stringify({trackerVersion:"14.0.14",projectKey:this.options.projectKey,doNotTrack:h,reason:l.length?`missing api: ${l.join(",")}`:u}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(u,l={})=>{if(this.app!==null){if(u instanceof Error){const h=js(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=Ia(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(Vo()&&((a=e.crossdomain)!=null&&a.enabled)),!ot||!Fd(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&Vo()&&Bd()&&((c=window.top)!=null&&c.__OPENREPLAY__)){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const u of i)if(u==="timing"){if("performance"in window&&!(u in performance)){s.push(u);break}}else if(u==="startsWith"){if(!(u in String.prototype)){s.push(u);break}}else if(!(u in window)){s.push(u);break}if(s.length>0){const u=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${u}`),this.signalStartIssue("missing_api",s);return}const r=new Th(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(pd(r),xh(r),Au(r,e),Ld(r)),cd(r,e.mouse),fd(r,this.crossdomainMode),vd(r),md(r),Nh(r,e),Hh(r,e),Gh(r),Qh(r,e),dd(r,e),bd(r),wd(r),Md(r,e.network),Pd(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const o=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const u=r.getTabId(),l=r.sessionStorage??window.sessionStorage;window.open=function(...h){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&l.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),l.setItem(e.session_tabid_key||"__openreplay_tabid",u),o.call(window,...h)}}),r.attachStopCallback(()=>{window.open=o}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return ot?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Rs}${Ks}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return Pt("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){Pt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(bu(e))}userAnonymousID(e){Pt("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){Pt("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(mu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Tu(e,n))}}}function jd(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function zd(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class Ud{constructor(e){X(this,Ln,"https://wineater-backend.vercel.app/");X(this,ln);F(this,ln,e)}async getInstantRecommendations(){try{const e=await fetch(`${v(this,Ln)}dish/recommendations/instant`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,ln)}`}}),n=await e.json();if(!e.ok)throw new Error(`API call failed with status ${e.status}: ${n.message||"No additional error information"}`);return n.map(jd)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=await fetch(`${v(this,Ln)}dish/recommendations/search`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,ln)}`},body:JSON.stringify({text:e})}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.map(zd)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${v(this,Ln)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,ln)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}Ln=new WeakMap,ln=new WeakMap;const Hd=((Ka=window==null?void 0:window.wineaterData)==null?void 0:Ka.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",hr=new Ud(Hd),ct={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},qd={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"}};function Vd(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const Gd={0:{logoUrl:null,brandColor:"#7B2BEB"},25:{logoUrl:null,brandColor:"#000000",wineaterColor:"#000000",buttonUppercase:!0,customCss:`
20
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
15
+ `).length?nd(t):t.stack?id(t):sd(t)}function nd(t,e){const n=/Line (\d+).*script (?:in )?(\S+)/i,s=t.message.split(`
16
+ `),i=[];for(let r=2,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({file:a[2],line:+a[1],raw:s[r]})}return rs(i)}function sd(t,e){const n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,s=t.stacktrace.split(`
17
+ `),i=[];for(let r=0,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:s[r]})}return rs(i)}function id(t,e){return rs(t.stack.split(`
18
+ `).filter(s=>!!s.match(Xh)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=lr(i.pop()),o=i.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let c;o.match(/\(([^)]*)\)/)&&(c=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const u=c===void 0||c==="[arguments not available]"?void 0:c.split(",");return{function:a,args:u,file:r[0],line:r[1]?+r[1]:void 0,col:r[2]?+r[2]:void 0,raw:s}})}function rd(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function od(t,e){return rd(Jh(t))}function ja(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function qs(t,e,n={}){let s=e;try{s=od(t)}catch{}return Xi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function za(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return qs(t.error,ja(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Xi(s,i,JSON.stringify(ja(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return qs(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Xi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function ad(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=za(o,i);a!=null&&t.send(a)}try{t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}catch(o){console.error("Error while attaching to error proto contexts",o)}}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Ua(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function ld(t){return du&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const cd="https://static.openreplay.com/tracker/placeholder.jpeg";function ud(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",cd);const{width:u,height:l}=c.getBoundingClientRect();c.hasAttribute("width")||t.attributeSender.sendSetAttribute(a,"width",String(u)),c.hasAttribute("height")||t.attributeSender.sendSetAttribute(a,"height",String(l))}const n=function(a,c){const{srcset:u}=c;if(!u)return;const l=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Ua(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>fu&&e(a,c),t.send(Vi(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=Ua(a.src||"");ta(c)&&t.send(ba(t.timestamp(),0,0,0,0,0,c,"img",0,!1))}),r=t.safe(function(a){const c=t.nodes.getID(a);c!==void 0&&a.complete&&(a.naturalHeight===0&&a.naturalWidth===0&&!ld(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=oa(t.safe(a=>{for(const c of a)if(c.type==="attributes"){const u=c.target,l=t.nodes.getID(u);if(l===void 0)return;c.attributeName==="src"&&s(l,u),c.attributeName==="srcset"&&n(l,u)}}),t.options.forceNgOff);t.attachStopCallback(()=>{o.disconnect()}),t.nodes.attachNodeCallback(a=>{ve(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>r(a)),r(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))})}const hd=["text","password","email","search","number","range","date","tel","time"];function dd(t){return ve(t,"textarea")?!0:ve(t,"input")?hd.includes(t.type):!1}function fd(t){if(!ve(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const pd=ht&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function Ha(t){let e=Hi(t);if(e===null){const n=pd(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return ea(e).slice(0,100)}const An={Plain:0,Obscured:1,Hidden:2};function gd(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:An.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,p=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?p=An.Hidden:(t.sanitizer.isObscured(l)||p===An.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(p=An.Obscured);let f=0;switch(p){case An.Hidden:f=-1,d="";break;case An.Obscured:f=d.length,d="";break}return{value:d,mask:f}}function i(l,h){const{value:d,mask:p}=s(l,h);t.send(Cu(l,d,p))}const r=new Map,o=new Map;t.attachStopCallback(()=>{r.clear(),o.clear()});function a(l,h){r.get(l)!==h.value&&(r.set(l,h.value),i(l,h))}function c(l,h){o.get(l)!==h&&(o.set(l,h),t.send(Nu(l,h)))}t.ticker.attach(()=>{r.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return r.delete(h);a(h,d)}),o.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return o.delete(h);c(h,d.checked)})},3);function u(l,h,d,p){const{value:f,mask:m}=s(l,h),y=Ha(h);t.send(Gu(l,f,m!==0,y,d,p))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(ve(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),dd(l)){a(h,l);let d=0,p=0,f=0;const m=()=>{d=it()},y=()=>{p===0&&d!==0&&(p=it()-d)},S=()=>{d!==0&&(f=it()-d),u(h,l,p,f),p=0,f=0,d=0};t.nodes.attachNodeListener(l,"focus",m),t.nodes.attachNodeListener(l,"input",y),t.nodes.attachNodeListener(l,"change",S);return}if(fd(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let Je,cr,qa;function md(t,e){if(qa=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Je={...n,...e},cr=vd(Je.root,n);let s=Vs(t,"all",()=>Vs(t,"two",()=>Vs(t,"one",()=>Vs(t,"none"))));if(s){const i=Ja(Qa(s,t));return i.length>0&&(s=i[0]),Gs(s)}else throw new Error("Selector was not found.")}function vd(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Vs(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-qa.getTime();if(Je.timeoutMs!==void 0&&a>Je.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=Xs(wd(r))||Xs(...bd(r))||Xs(...yd(r))||Xs(Sd(r))||[Xa()];const u=_d(r);if(e=="all")u&&(c=c.concat(c.filter(ur).map(l=>Ks(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(ur).map(l=>Ks(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&ur(l)&&(c=[Ks(l,u)])}else e=="none"&&(c=[Xa()],u&&(c=[Ks(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=Je.seedMinLength&&(s=Va(i,n),s))break;r=r.parentElement,o++}return s||(s=Va(i,n)),!s&&n?n():s}function Va(t,e){const n=Ja(Ya(t));if(n.length>Je.threshold)return e?e():null;for(let s of n)if(Ka(s))return s;return null}function Gs(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function Ga(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Ka(t){const e=Gs(t);switch(cr.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function wd(t){const e=t.getAttribute("id");return e&&Je.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function bd(t){return Array.from(t.attributes).filter(n=>Je.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function yd(t){return Array.from(t.classList).filter(Je.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function Sd(t){const e=t.tagName.toLowerCase();return Je.tagName(e)?{name:e,penalty:2}:null}function Xa(){return{name:"*",penalty:3}}function _d(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function Ks(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function ur(t){return t.name!=="html"&&!t.name.startsWith("#")}function Xs(...t){const e=t.filter(kd);return e.length>0?e:null}function kd(t){return t!=null}function*Ya(t,e=[]){if(t.length>0)for(let n of t[0])yield*Ya(t.slice(1,t.length),e.concat(n));else yield e}function Ja(t){return[...t].sort((e,n)=>Ga(e)-Ga(n))}function*Qa(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Je.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Je.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Gs(i);if(n.visited.has(r))return;Ka(i)&&Td(i,e)&&(yield i,n.visited.set(r,!0),yield*Qa(i,e,n))}}function Td(t,e){return cr.querySelector(Gs(t))===e}function xd(t,e,n){return md(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function hr(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function Za(t,e){return t instanceof Element?Ed(t,e):null}function Ed(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(on(n,"masked"))return null;n=n.parentElement}if(er(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||hr(n)||Hi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function Id(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const b=Hi(g);if(b!==null)return b;if(ve(g,"input"))return Ha(g);if(hr(g)){let E="";return g instanceof HTMLElement&&(E=t.sanitizer.getInnerTextSecure(g)),E=E||g.id||g.className,ea(E).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,p=0,f;const m=.008,y=225;function S(){const g=p/y;if(!l){l=g;return}const b=(g-l)/y;d>4&&b>m&&t.send(Ku(it())),p=0,d=0,l=g}t.attachStartCallback(()=>{f=setInterval(()=>S(),y)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},f&&clearInterval(f)});const _=()=>{o&&(t.send(Ru(i,r)),o=!1)},x=(g,b=!1)=>{function E(k,T,M){return u[k]=u[k]||xd(T,g,M)}const I=b?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);I(g.documentElement,"mouseover",k=>{const T=Za(k.target,g);T!==a&&(a=T,c=performance.now())}),I(g,"mousemove",k=>{const[T,M]=t.observer.getDocumentOffset(g);i=k.clientX+T,r=k.clientY+M,o=!0;const G=Math.sign(k.movementX);p+=Math.abs(k.movementX)+Math.abs(k.movementY),G!==h&&(h=G,d++)},!1),I(g,"click",k=>{const T=Za(k.target,g);if(!k.clientX&&!k.clientY||T===null)return;const M=t.nodes.getID(T);if(M!==void 0){const G=k.pageX,z=k.pageY,Z=g.documentElement.scrollWidth,W=g.documentElement.scrollHeight,L=$a(G/Z),Y=$a(z/W);_(),t.send(Hu(M,a===T?Math.round(performance.now()-c):0,s(T),hr(T)&&!n?E(M,T,e):"",L,Y),!0)}a=null})};t.nodes.attachNodeCallback(g=>{js(g)&&x(g)}),x(document,!0),t.ticker.attach(_,(e==null?void 0:e.trackingOffset)||7)}function $a(t){return Math.round(t*1e4)}function Cd(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(ve(r,"img")&&(o=r.currentSrc||r.src),!o){const f=getComputedStyle(r).getPropertyValue("background-image");if(f){const m=s.exec(f);m!==null&&(o=m[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const c=r.getBoundingClientRect(),u=Math.max(c.top,0),l=Math.max(c.left,0),h=Math.min(c.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),d=Math.min(c.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||d<=l)continue;const p=(h-u)*(d-l);e.push({time:a,area:p})}return e}function Nd(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:o}=e[i];n+=o,s+=o*(r>t?r:t)}return n===0?0:s/n}function Rd(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!ta(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let l=!1;(h=n.excludedResourceUrls)==null||h.forEach(d=>{if(u.name.startsWith(d)){l=!0;return}}),!l&&t.send(ba(u.startTime+Nn(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let o;t.attachStartCallback(function({sessionID:u}){u!==o&&(performance.getEntriesByType("resource").forEach(i),o=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let a=0,c=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((a===0||c===0)&&performance.getEntriesByType("paint").forEach(l=>{const{name:h,startTime:d}=l;switch(h){case"first-paint":a=d;break;case"first-contentful-paint":c=d;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:l,requestStart:h,responseStart:d,responseEnd:p,domContentLoadedEventStart:f,domContentLoadedEventEnd:m,loadEventStart:y,loadEventEnd:S}=performance.timing;t.send(Ou(h-l||0,d-l||0,p-l||0,f-l||0,m-l||0,y-l||0,S-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,p=!1;t.ticker.attach(()=>{if(p)return;const f=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(m=>s[m])),f-u>1e3&&(d=Cd(s),s=null)),h!==null&&(f-h>50&&(l=f),h=f-l>5e3?null:f),d!==null&&h===null||f>3e4){p=!0,s=null;const m=d===null?0:Nd(c||a,d),{domContentLoadedEventEnd:y,navigationStart:S}=performance.timing,_=h===null?Math.max(l,c,y-S||0):0;t.send(Au(m,c>u?c:u,_))}})}}function dr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function Dd(t,e){let n=!1;const s=new Map;function i(a){Ra(a)&&(Tt(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),js(a)&&s.set(a,dr(a)))}const r=t.safe(()=>{e||t.send(yu(...dr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(Iu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(Tt(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):js(a)&&s.set(a,dr(a))),zs(a)&&t.nodes.attachNodeListener(a,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",a=>{const c=a.target;if(c===document){n=!0;return}i(c)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(o),s.clear()},5,!1)}function Od(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Ju(e,r,i,document.title)),i=0,r=e)}),a=t.safe(()=>{const{innerWidth:u,innerHeight:l}=window;(u!==n||l!==s)&&(n=u,s=l,t.send(bu(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Wu(document.hidden)));t.attachStartCallback(()=>{e=null,i=Nn(),n=s=-1,o(),a(),c()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",c,!1,!1),t.ticker.attach(o,1,!1),t.ticker.attach(a,5,!1)}function el(t){return zs(t)&&!!t.adoptedStyleSheets}let Ad=15;function tl(){return Ad++}const Ys=new Map;function Md(t){if(t===null||!el(document))return;const e=new Map,n=new Map,s=o=>setTimeout(()=>{let a=t.nodes.getID(o);if(o===document&&(a=0),a===void 0)return;let c=n.get(a);c||(c=[]);const u=[],l=o.adoptedStyleSheets;if(l&&Symbol.iterator in l)for(const h of l){let d=e.get(h);const p=!d;if(d||(d=tl(),e.set(h,d)),c.includes(d)||t.send(ma(d,a)),p){const f=h.cssRules;for(let m=0;m<f.length;m++)t.send(Ki(d,f[m].cssText,m,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(qu(h,a));n.set(a,u)},20);function i(o){const a=Object.getOwnPropertyDescriptor(o,"adoptedStyleSheets");a&&Object.defineProperty(o,"adoptedStyleSheets",{...a,set:function(c){const u=a.set.call(this,c);return s(this),u}})}const r=o=>{if(o.__openreplay_adpss_patched__)return;o.__openreplay_adpss_patched__=!0,i(o.Document.prototype),i(o.ShadowRoot.prototype);const{replace:a,replaceSync:c}=o.CSSStyleSheet.prototype;o.CSSStyleSheet.prototype.replace=function(u){return a.call(this,u).then(l=>{const h=e.get(this);return h&&t.send(pa(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(pa(l,u,t.getBaseHref())),c.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(o=>{el(o)&&s(o)})}function Pd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(zu("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=Ys.get(i);a&&(typeof o=="string"?t.send(Ki(a,o,r,t.getBaseHref())):t.send(ga(a,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const o=r.parentStyleSheet;if(!o){t.debug.warn("No parent StyleSheet found for",r,i);return}const a=Ys.get(o);if(!a){t.debug.warn("No sheedID found for",o,Ys);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(Ki(a,c,l,t.getBaseHref())),t.send(ga(a,l+1))):t.debug.warn("Rule index not found in",o,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:o}=i.CSSStyleSheet.prototype,{insertRule:a,deleteRule:c}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,l=0){return e(this,l,u),r.call(this,u,l)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),o.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,l=0){const h=a.call(this,u,l);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const l=c.call(this,u);return n(this),l}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!ve(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const o=i.sheet,a=tl();Ys.set(o,a),t.send(ma(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function Ld(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(fa(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ve(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Ra(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(fa(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ve(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function Bd(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...o){if(typeof o[1]=="string"){let a="";o[2]&&t.safe(()=>{a=JSON.stringify(o[2])});const c=[o[0],o[1],a],u=e.get(s.document)||[];u.push(c),e.set(s.document,u);const l=s===window?0:t.nodes.getID(s.document);if(l===void 0)return;t.active()&&t.send(da(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!js(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(o=>{t.send(da(r,...o))})}))}function Fd(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(d){t.debug.log("Openreplay: capturing axios response data",d);const{headers:p,data:f,method:m,url:y,baseURL:S}=d.config,{data:_,headers:x,status:g,response:b}=d,{data:E,headers:I,status:k}=b||{},T=n.ignoreHeaders,M=Array.isArray(T)?R=>T.includes(R):()=>T;function G(R,J){M(J[0])||(R[J[0]]=J[1])}let z={},Z={};p.toJSON?z=p.toJSON():p instanceof Headers?p.forEach((R,J)=>G(z,[J,R])):Array.isArray(p)?p.forEach(R=>G(z,R)):typeof p=="object"&&Object.entries(p).forEach(R=>G(z,R));const W=I||x;W.toJSON?Z=W.toJSON():W instanceof Headers?W.forEach((R,J)=>G(Z,[J,R])):Array.isArray(W)?W.forEach(R=>G(Z,R)):typeof W=="object"&&Object.entries(W).forEach(([R,J])=>{M(R)||(Z[R]=J)});const L=s({url:y,method:m||"",status:g||k||0,request:{headers:z,body:f},response:{headers:Z,body:E||_}});if(!L){t.debug.log("Openreplay: empty request/response info, skipping");return}const Y=d.config.__openreplay_timing,$=performance.now()-Y;t.debug.log("Openreplay: final req object",L),t.send(Ls("xhr",String(m),String(L.url),i(L.request),i(L.response),L.status,Y+Nn(),$,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const p=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",f=t.getSessionToken();f&&d.headers.set(p,f)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),Wd(d)&&d.response?r(d.response):d instanceof Error&&t.send(qs(d,[])),Promise.reject(d)}function u(d){t.debug.log("Openreplay: failed API request, skipping",d)}const l=e.interceptors.request.use(o,u,{synchronous:!0}),h=e.interceptors.response.use(a,c,{synchronous:!0});t.attachStopCallback(()=>{var d,p,f,m;(p=(d=e.interceptors.request).eject)==null||p.call(d,l),(m=(f=e.interceptors.response).eject)==null||m.call(f,h)})}function Wd(t){return jd(t)&&t.isAxiosError===!0}function jd(t){return t!==null&&typeof t=="object"}class fr{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(!r)return null;if(r.url.includes("/graphql")&&r.response.body&&typeof r.response.body=="string"){const a=r.response.body.includes("errors");r.status=a?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:r.method,url:r.url,request:JSON.stringify(r.request),response:JSON.stringify(r.response),status:r.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const os=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:gr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},pr=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(Ud(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":gr(t)?e=t:e=`can't parse body ${typeof t}`;return e},zd=(t,e={})=>{gr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function gr(t){return t!==null&&typeof t=="object"}function Ud(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function Js(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const mr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),Hd=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class qd{constructor(e,n,s,i,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r}apply(e,n,s){const i=s[0],r=s[1],o=new fr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=mr(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":Hd(r)},o.status=0,o.statusText="Pending",a.search&&a.searchParams){o.getData={};for(const[l,h]of a.searchParams)o.getData[l]=h}o.requestData=pr(r),o.startTime||(o.startTime=performance.now());const c=e.apply(n,s);c?(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Sent",o.readyState=4):(o.status=500,o.statusText="Unknown");const u=o.getMessage();return u&&this.sendMessage(u),c}}class Vd{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new qd(n,s,i,r,o))}}var ft;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(ft||(ft={}));class Gd{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=os(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===ft.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(o=>{if(!e)e=new Uint8Array(o.value);else{const a=new Uint8Array(e.length+o.value.length);a.set(e),a.set(o.value,e.length),e=a}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=o.done?4:3,this.item.statusText=o.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Js(this.item.responseSize),o.done&&(this.item.response=os(this.item.responseType,e)),o}),s.cancel=(...o)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=os(this.item.responseType,e),r.apply(s,o)),s}}}class Kd{constructor(e,n,s,i,r,o){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=o}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const a=new fr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(a,i,r),this.setSessionTokenHeader((c,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(a.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(c,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]=Object.assign(Object.assign({},s[1]),{headers:{}})),s[1].headers instanceof Headers?s[1].headers.append(c,u):Array.isArray(s[1].headers)?s[1].headers.push([c,u]):s[1].headers[c]=u}}),e.apply(window,s).then(this.afterFetch(a)).catch(c=>{throw a.endTime=performance.now(),a.duration=a.endTime-(a.startTime||a.endTime),c})}beforeFetch(e,n,s){let i,r="GET",o={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=mr(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=mr(n.url),o=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=o,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(o)==="[object Headers]"){e.requestHeader={};for(const[a,c]of o)e.requestHeader[a]=c}else e.requestHeader=o;if(i.search&&i.searchParams){e.getData={};for(const[a,c]of i.searchParams)e.getData[a]=c}s!=null&&s.body&&(e.requestData=pr(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Js(e.responseSize),e.response=os(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Gd(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Xd{static create(e,n,s,i,r,o){return new Proxy(fetch,new Kd(e,n,s,i,r,o))}}class Yd{constructor(e,n,s,i,r,o,a){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=o,this.tokenUrlMatcher=a,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new fr(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=os(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===ft.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var i,r,o;const a=s[0],c=s[1];return this.item.method=a?a.toUpperCase():"GET",this.item.url=((i=c.toString)===null||i===void 0?void 0:i.call(c))||"",this.item.name=(o=(r=this.item.url)===null||r===void 0?void 0:r.replace(new RegExp("/*$"),"").split("/").pop())!==null&&o!==void 0?o:"",this.item.getData=zd(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=pr(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case ft.UNSENT:case ft.OPENED:this.item.status=ft.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case ft.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
19
+ `);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),o=r[0];this.item.header[o]=r.slice(1).join(": ")}break;case ft.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Js(this.item.responseSize));break;case ft.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Js(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Jd{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new Yd(c,e,n,s,i,r,o))}})}}const nl=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function Qd(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=Jd.create(e,n,s,i,r,a):nl("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=Xd.create(e,n,s,i,r,a):nl("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=Vd.create(u,e,n,s,i,r)}}function vr(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function sl(t){return typeof t=="string"?t.toUpperCase():"GET"}function Zd(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?l=>s.includes(l):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(l){if(r){const h=t.getSessionToken();h&&t.safe(l)(r,h)}}function a(l){if(n.capturePayload||(delete l.request.body,delete l.response.body),n.sanitizer){const h=l.response.body;if(typeof h=="string")try{l.response.body=JSON.parse(h)}catch{}return n.sanitizer(l)}return l}function c(l){if(l&&typeof l.body!="string")try{l.body=JSON.stringify(l.body)}catch{l.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",l.body)}return JSON.stringify(l)}const u=l=>{if(n.useProxy)return Qd(l,n.ignoreHeaders,o,a,x=>{t.send(Ls(x.requestType,x.method,x.url,x.request,x.response,x.status,x.startTime+Nn(),x.duration,x.responseSize))},x=>t.isServiceURL(x),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=l.fetch.bind(l),d=(x,g={})=>{if(!(typeof x=="string"||x instanceof URL)||t.isServiceURL(String(x)))return h(x,g);o(function(E,I){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(E,I):Array.isArray(g.headers)?g.headers.push([E,I]):g.headers[E]=I});const b=performance.now();return h(x,g).then(E=>{const I=performance.now()-b;if(n.failuresOnly&&E.status<400)return E;const k=E.clone();return k.text().then(T=>{const M={},G={};if(s!==!0){const W=([L,Y])=>{i(L)||(M[L]=Y)};g.headers instanceof Headers?g.headers.forEach((L,Y)=>W([Y,L])):Array.isArray(g.headers)?g.headers.forEach(W):typeof g.headers=="object"&&Object.entries(g.headers).forEach(W),k.headers.forEach((L,Y)=>{i(Y)||(G[Y]=L)})}const z=sl(g.method),Z=a({url:String(x),method:z,status:k.status,request:{headers:M,body:g.body||null},response:{headers:G,body:T}});Z&&t.send(Ls("fetch",z,String(Z.url),c(Z.request),c(Z.response),k.status,b+Nn(),I,0))}).catch(T=>t.debug.error("Could not process Fetch response:",T)),E})};l.fetch=d;const p=l.XMLHttpRequest.prototype.open,f=l.XMLHttpRequest.prototype.setRequestHeader,m=l.XMLHttpRequest.prototype.send;function y(x,g){const b=this;o((I,k)=>b.setRequestHeader(I,k));let E=0;return b.addEventListener("loadstart",I=>{E=I.timeStamp}),b.addEventListener("load",t.safe(I=>{const{headers:k,body:T}=vr(b),M=E>0?I.timeStamp-E:0,z=(b.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),Z={};z.forEach(function(Y){const $=Y.split(": "),R=$.shift();i(R)||(Z[R]=$.join(": "))});const W=sl(x),L=a({url:String(g),method:W,status:b.status,request:{headers:k,body:T||null},response:{headers:Z,body:b.response}});L&&t.send(Ls("xhr",W,String(L.url),c(L.request),c(L.response),b.status,E+Nn(),M,0))})),p.apply(this,arguments)}function S(x){const g=vr(this);return g.body=x,m.apply(this,arguments)}function _(x,g){if(!i(x)){const b=vr(this);b.headers[x]=g}return f.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=y,l.XMLHttpRequest.prototype.send=S,l.XMLHttpRequest.prototype.setRequestHeader=_)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{Fd(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function $d(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(va(n,s,i))}else t.send(va(-1,-1,""))})}function ef(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Bs(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const Qs="/installation/javascript-sdk";function tf(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Ps}${Qs}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Ps}${Qs} for more information.`),!1;t.projectKey=t.projectID.toString(),Ut("`projectID` option","`projectKey` option",Qs)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Ut("`sessionToken` option","`sessionHash` start() option","/"),!0}const nf=()=>{try{return!!window.top}catch{return!1}};class sf{constructor(e){var a,c;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(u,l)=>{const h=this.checkDoNotTrack(),d=new XMLHttpRequest,p=this.options.ingestPoint||Pa;d.open("POST",p+"/v1/web/not-started"),d.send(JSON.stringify({trackerVersion:"14.0.14",projectKey:this.options.projectKey,doNotTrack:h,reason:l.length?`missing api: ${l.join(",")}`:u}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(u,l={})=>{if(this.app!==null){if(u instanceof Error){const h=qs(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=za(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(ra()&&((a=e.crossdomain)!=null&&a.enabled)),!ht||!tf(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&ra()&&nf()&&((c=window.top)!=null&&c.__OPENREPLAY__)){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const u of i)if(u==="timing"){if("performance"in window&&!(u in performance)){s.push(u);break}}else if(u==="startsWith"){if(!(u in String.prototype)){s.push(u);break}}else if(!(u in window)){s.push(u);break}if(s.length>0){const u=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${u}`),this.signalStartIssue("missing_api",s);return}const r=new Uh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Od(r),Hh(r),Qu(r,e),ef(r)),Id(r,e.mouse),Dd(r,this.crossdomainMode),Pd(r),Md(r),Kh(r,e),ad(r,e),ud(r),gd(r,e),Rd(r,e),Ld(r),Bd(r),Zd(r,e.network),$d(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const o=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const u=r.getTabId(),l=r.sessionStorage??window.sessionStorage;window.open=function(...h){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&l.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),l.setItem(e.session_tabid_key||"__openreplay_tabid",u),o.call(window,...h)}}),r.attachStopCallback(()=>{window.open=o}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return ht?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Ps}${Qs}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return Ut("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){Ut("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(Lu(e))}userAnonymousID(e){Ut("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){Ut("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(Mu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Uu(e,n))}}}function rf(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function of(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class af{constructor(e){U(this,Un,"https://wineater-backend.vercel.app/");U(this,fn);j(this,fn,e)}async getInstantRecommendations(){try{const e=await fetch(`${v(this,Un)}dish/recommendations/instant`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`}}),n=await e.json();if(!e.ok)throw new Error(`API call failed with status ${e.status}: ${n.message||"No additional error information"}`);return n.map(rf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=await fetch(`${v(this,Un)}dish/recommendations/search`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`},body:JSON.stringify({text:e})}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.map(of)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${v(this,Un)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}Un=new WeakMap,fn=new WeakMap;const lf=((ll=window==null?void 0:window.wineaterData)==null?void 0:ll.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",wr=new af(lf),pt={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},cf={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"}};function uf(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const hf={0:{logoUrl:null,brandColor:"#7B2BEB"},29:{logoUrl:"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/plou_logo.jpg",brandColor:"#e6c6bb"},25:{logoUrl:null,brandColor:"#000000",wineaterColor:"#000000",buttonUppercase:!0,customCss:`
20
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;600;700&display=swap');
21
21
  :root { --wineater-font-primary: 'Roboto', sans-serif; }
22
22
  #wr-Custom {
23
+ .wr-Header-title {
24
+ font-family: 'Roboto', sans-serif;
25
+ }
26
+
23
27
  .wr-Search-input {
24
28
  border-color: #7c7c7c;
25
29
  color: #7c7c7c;
26
- }
30
+ }
31
+
32
+ .wr-Search-icon {
33
+ filter: brightness(0) saturate(100%);
34
+ }
35
+
27
36
  .wr-Search-button:hover {
28
37
  background: #E3BE8D;
29
38
  opacity: 1;
@@ -36,14 +45,18 @@ We appreciate your time and valuable input.`),r=q("div","end_button_or",ca,"Subm
36
45
  .wr-WineTilePopup-reason {
37
46
  color: #000000;
38
47
  }
48
+
39
49
  .wr-WineTilePopup-tag {
40
50
  color: #000000;
41
51
  background: rgba(239,239,239,0.7);
42
52
  border-color: transparent;
53
+ text-transform: uppercase;
54
+ font-weight: 600;
43
55
  }
44
56
 
45
57
  .wr-WineTile-action {
46
58
  background: transparent;
59
+ font-weight: 700;
47
60
  }
48
61
 
49
62
  .wr-WineTile-action:hover {
@@ -52,10 +65,10 @@ We appreciate your time and valuable input.`),r=q("div","end_button_or",ca,"Subm
52
65
  box-shadow: none;
53
66
  }
54
67
  }
55
- `,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",brandColor:"#B81242",wineaterColor:"#7B2BEB",buttonUppercase:!0,customCss:"",translations:{}}};function Kd(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
68
+ `,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",brandColor:"#B81242",wineaterColor:"#7B2BEB",buttonUppercase:!0,customCss:"",translations:{}},26:{logoUrl:"https://paladarlondon.com/wp-content/uploads/2021/05/cropped-cropped-Paladar-Logo-1473x464-min-768x219.png",brandColor:"#B81242",wineaterColor:"#7B2BEB",buttonUppercase:!0,customCss:"",translations:{}}};function df(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
56
69
  @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
57
70
  :root { --wineater-font-primary: 'Bricolage Grotesque', serif; }
58
- `},n=Gd[t]||{};return{...e,...n}}let ce=tt({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const be={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(ce==null?void 0:ce.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=ce.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=ce.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=ce.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(ce.storeConfig&&ce.storeConfig.available_languages.includes(t)){ce.currentLanguage=t;const e=new URLSearchParams(window.location.search);e.set("lang",t);const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${t} is not available in store configuration.`)},getSupportedLanguages(){var t;return((t=ce.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=ce.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await hr.getStoreConfig();ce.storeConfig=Vd(t),ce.currentLanguage=ce.storeConfig.lang;const e=this.getLanguageFromURL();e&&ce.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(ce.storeConfig.lang),this.setUiConfig(Kd(ce.storeConfig.id)),ce.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),ce.isConfigLoaded=!1}},isInitialized(){return ce.isConfigLoaded},getUiConfig(){return ce.uiConfig},setUiConfig(t){ce.uiConfig=t}},Xd={en:"en-US",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",ja:"ja-JP",zh:"zh-CN",ru:"ru-RU",kk:"kk-KZ",pt:"pt-PT"};function Yd(t,e,n="en"){try{return new Intl.NumberFormat(Xd[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function Ie({key:t,lang:e}){const n=qd,s=be.getUiConfig(),i=(s==null?void 0:s.translations)||{};if(i[e]&&i[e][t])return i[e][t];if(n[e]&&n[e][t])return n[e][t];throw new Error(`Translation for key "${t}" not found in language "${e}".`)}async function Jd({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,l,h,d;if(!s||!t||!e||t===e)return n;const i="https://api.openai.com/v1/chat/completions",r={"Content-Type":"application/json",Authorization:`Bearer ${s}`},o=Object.entries(n).map(([f,p])=>({key:f,text:p})),a=`
71
+ `},n=hf[t]||{};return{...e,...n}}let de=at({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const we={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(de==null?void 0:de.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=de.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=de.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=de.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(de.storeConfig&&de.storeConfig.available_languages.includes(t)){de.currentLanguage=t;const e=new URLSearchParams(window.location.search);e.set("lang",t);const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${t} is not available in store configuration.`)},getSupportedLanguages(){var t;return((t=de.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=de.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await wr.getStoreConfig();de.storeConfig=uf(t),de.currentLanguage=de.storeConfig.lang;const e=this.getLanguageFromURL();e&&de.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(de.storeConfig.lang),this.setUiConfig(df(de.storeConfig.id)),de.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),de.isConfigLoaded=!1}},isInitialized(){return de.isConfigLoaded},getUiConfig(){return de.uiConfig},setUiConfig(t){de.uiConfig=t}},ff={en:"en-US",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",ja:"ja-JP",zh:"zh-CN",ru:"ru-RU",kk:"kk-KZ",pt:"pt-PT"};function pf(t,e,n="en"){try{return new Intl.NumberFormat(ff[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function Ne({key:t,lang:e}){const n=cf,s=we.getUiConfig(),i=(s==null?void 0:s.translations)||{};if(i[e]&&i[e][t])return i[e][t];if(n[e]&&n[e][t])return n[e][t];throw new Error(`Translation for key "${t}" not found in language "${e}".`)}async function gf({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,l,h,d;if(!s||!t||!e||t===e)return n;const i="https://api.openai.com/v1/chat/completions",r={"Content-Type":"application/json",Authorization:`Bearer ${s}`},o=Object.entries(n).map(([p,f])=>({key:p,text:f})),a=`
59
72
  You are a professional translator.
60
73
 
61
74
  The input texts are written in language with code "${t}". Your task is to translate them strictly to the target language with code "${e}".
@@ -80,18 +93,18 @@ Output:
80
93
 
81
94
  Now translate the following input:
82
95
  ${JSON.stringify(o,null,2)}
83
- `,c=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:a}],temperature:.2,max_tokens:1e3});try{const p=await(await fetch(i,{method:"POST",headers:r,body:c})).json(),m=(d=(h=(l=(u=p==null?void 0:p.choices)==null?void 0:u[0])==null?void 0:l.message)==null?void 0:h.content)==null?void 0:d.trim();if(!m)throw new Error("No response from OpenAI");const E=JSON.parse(m),_={};return E.forEach(x=>{x.key&&x.text!==void 0&&(_[x.key]=x.text)}),{...n,..._}}catch(f){return console.error("Error translating texts:",f),n}}Ol();var Qd=ys('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M10.036 4.96326H28.2826L34.3648 14.0865L19.1593 33.8537L3.95381 14.0865L10.036 4.96326Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.6388 4.96326L13.0771 14.0865L19.1593 33.8537L25.2415 14.0865L20.6799 4.96326" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.95381 14.0867H34.3648" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Zd(t,e){let n=Be(e,"className",8,""),s=Be(e,"size",8,20);var i=Qd();J(()=>{Ot(i,0,_n(n())),ke(i,"width",s()),ke(i,"height",s())}),L(t,i)}var $d=ys('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M29.533 21.4034C31.7986 19.1834 34.0946 16.5224 34.0946 13.0404C34.0946 10.8224 33.2135 8.69521 31.6451 7.12684C30.0768 5.55847 27.9496 4.67737 25.7316 4.67737C23.0554 4.67737 21.1699 5.43764 18.8891 7.71847C16.6083 5.43764 14.7228 4.67737 12.0467 4.67737C9.82865 4.67737 7.70148 5.55847 6.13311 7.12684C4.56474 8.69521 3.68364 10.8224 3.68364 13.0404C3.68364 16.5376 5.96446 19.1986 8.24528 21.4034L18.8891 32.0472L29.533 21.4034Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.8891 19.8829L17.3686 18.3623L20.4097 15.3212L15.848 10.7596L18.8891 7.71851" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function ef(t,e){let n=Be(e,"className",8,""),s=Be(e,"size",8,20);var i=$d();J(()=>{Ot(i,0,_n(n())),ke(i,"width",s()),ke(i,"height",s())}),L(t,i)}var tf=ys('<svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 17.655a3.801 3.801 0 1 0 0-7.602 3.801 3.801 0 0 0 0 7.602Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 3.97a9.884 9.884 0 0 0-9.458 6.995c-1.673 4.76-1.186 5.93-4.835 9.245a4.562 4.562 0 0 0 2.889 8.09c6.082 0 12.772-2.738 17.334-6.54a9.885 9.885 0 0 0-5.93-17.79Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="m28.693 10.053 3.33 6.842c.316.983.475 2.009.471 3.041a9.867 9.867 0 0 1-3.953 7.907c-4.562 3.801-11.252 6.538-17.334 6.538a4.562 4.562 0 0 1-4.075-2.524l-2.92-5.839"></path></svg>');function qa(t,e){let n=Be(e,"className",8,""),s=Be(e,"size",8,20);var i=tf();J(()=>{Ot(i,0,_n(n())),ke(i,"width",s()),ke(i,"height",s())}),L(t,i)}var nf=ys('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" fill="none"><path d="M9.03846 17.0001C10.3456 12.1888 15.9077 8.65686 20.858 8.65686C25.8083 8.65686 29.2846 12.1888 30.5917 17.0001C29.2846 21.8252 25.8083 25.3432 20.858 25.3432C15.9077 25.3432 10.3456 21.8252 9.03846 17.0001Z" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M25.0296 17V17.6953" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2485 25.2457C20.4397 22.8774 19.4599 19.98 19.4599 16.9999C19.4599 14.0198 20.4397 11.1224 22.2485 8.75403" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.73372 15.1506C9.73372 11.4379 7.75916 8.6151 3.79615 7.96155C2.40562 10.0473 2.40562 14.9142 4.11597 17C2.39171 19.0858 2.39171 23.9527 3.79615 26.0385C7.75916 25.3849 9.73372 22.5621 9.73372 18.8494" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.545 10.4089C14.1834 8.48998 12.7512 6.20951 11.1243 4.48525H19.1893C19.8491 4.4828 20.4883 4.71502 20.9927 5.14042C21.497 5.56582 21.8337 6.15668 21.9426 6.80744L22.2624 8.75418" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2624 25.2459L21.9426 27.1926C21.8337 27.8434 21.497 28.4342 20.9927 28.8596C20.4883 29.285 19.8491 29.5172 19.1893 29.5148H13.2101C14.5573 27.9873 15.2948 26.0172 15.2819 23.9805" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function sf(t,e){let n=Be(e,"className",8,""),s=Be(e,"size",8,20);var i=nf();J(()=>{Ot(i,0,_n(n())),ke(i,"width",s()),ke(i,"height",s())}),L(t,i)}var rf=Y('<h1 class="wr-Header-title svelte-oiwvqb"> </h1>'),of=Y('<h1 class="wr-Header-title svelte-oiwvqb"> <span><!></span> <span class="wr-Header-label svelte-oiwvqb"> </span>, <!> <span class="wr-Header-label svelte-oiwvqb"> </span> <br/> <!> <span class="wr-Header-label svelte-oiwvqb"> </span> </h1>'),af=Y('<div class="wr-Header"><!></div>');const lf={hash:"svelte-oiwvqb",code:`.wr-Header-title.svelte-oiwvqb {font-weight:600;font-size:24px;margin:0 auto;line-height:1.3;color:#333;text-align:center;
96
+ `,c=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:a}],temperature:.2,max_tokens:1e3});try{const f=await(await fetch(i,{method:"POST",headers:r,body:c})).json(),m=(d=(h=(l=(u=f==null?void 0:f.choices)==null?void 0:u[0])==null?void 0:l.message)==null?void 0:h.content)==null?void 0:d.trim();if(!m)throw new Error("No response from OpenAI");const y=JSON.parse(m),S={};return y.forEach(_=>{_.key&&_.text!==void 0&&(S[_.key]=_.text)}),{...n,...S}}catch(p){return console.error("Error translating texts:",p),n}}Gl();var mf=ks('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M10.036 4.96326H28.2826L34.3648 14.0865L19.1593 33.8537L3.95381 14.0865L10.036 4.96326Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.6388 4.96326L13.0771 14.0865L19.1593 33.8537L25.2415 14.0865L20.6799 4.96326" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.95381 14.0867H34.3648" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function vf(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=mf();X(()=>{Wt(i,0,Tn(n())),Ce(i,"width",s()),Ce(i,"height",s())}),P(t,i)}var wf=ks('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M29.533 21.4034C31.7986 19.1834 34.0946 16.5224 34.0946 13.0404C34.0946 10.8224 33.2135 8.69521 31.6451 7.12684C30.0768 5.55847 27.9496 4.67737 25.7316 4.67737C23.0554 4.67737 21.1699 5.43764 18.8891 7.71847C16.6083 5.43764 14.7228 4.67737 12.0467 4.67737C9.82865 4.67737 7.70148 5.55847 6.13311 7.12684C4.56474 8.69521 3.68364 10.8224 3.68364 13.0404C3.68364 16.5376 5.96446 19.1986 8.24528 21.4034L18.8891 32.0472L29.533 21.4034Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.8891 19.8829L17.3686 18.3623L20.4097 15.3212L15.848 10.7596L18.8891 7.71851" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function bf(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=wf();X(()=>{Wt(i,0,Tn(n())),Ce(i,"width",s()),Ce(i,"height",s())}),P(t,i)}var yf=ks('<svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 17.655a3.801 3.801 0 1 0 0-7.602 3.801 3.801 0 0 0 0 7.602Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 3.97a9.884 9.884 0 0 0-9.458 6.995c-1.673 4.76-1.186 5.93-4.835 9.245a4.562 4.562 0 0 0 2.889 8.09c6.082 0 12.772-2.738 17.334-6.54a9.885 9.885 0 0 0-5.93-17.79Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="m28.693 10.053 3.33 6.842c.316.983.475 2.009.471 3.041a9.867 9.867 0 0 1-3.953 7.907c-4.562 3.801-11.252 6.538-17.334 6.538a4.562 4.562 0 0 1-4.075-2.524l-2.92-5.839"></path></svg>');function il(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=yf();X(()=>{Wt(i,0,Tn(n())),Ce(i,"width",s()),Ce(i,"height",s())}),P(t,i)}var Sf=ks('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" fill="none"><path d="M9.03846 17.0001C10.3456 12.1888 15.9077 8.65686 20.858 8.65686C25.8083 8.65686 29.2846 12.1888 30.5917 17.0001C29.2846 21.8252 25.8083 25.3432 20.858 25.3432C15.9077 25.3432 10.3456 21.8252 9.03846 17.0001Z" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M25.0296 17V17.6953" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2485 25.2457C20.4397 22.8774 19.4599 19.98 19.4599 16.9999C19.4599 14.0198 20.4397 11.1224 22.2485 8.75403" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.73372 15.1506C9.73372 11.4379 7.75916 8.6151 3.79615 7.96155C2.40562 10.0473 2.40562 14.9142 4.11597 17C2.39171 19.0858 2.39171 23.9527 3.79615 26.0385C7.75916 25.3849 9.73372 22.5621 9.73372 18.8494" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.545 10.4089C14.1834 8.48998 12.7512 6.20951 11.1243 4.48525H19.1893C19.8491 4.4828 20.4883 4.71502 20.9927 5.14042C21.497 5.56582 21.8337 6.15668 21.9426 6.80744L22.2624 8.75418" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2624 25.2459L21.9426 27.1926C21.8337 27.8434 21.497 28.4342 20.9927 28.8596C20.4883 29.285 19.8491 29.5172 19.1893 29.5148H13.2101C14.5573 27.9873 15.2948 26.0172 15.2819 23.9805" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function _f(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=Sf();X(()=>{Wt(i,0,Tn(n())),Ce(i,"width",s()),Ce(i,"height",s())}),P(t,i)}var kf=K('<h1 class="wr-Header-title svelte-oiwvqb"> </h1>'),Tf=K('<h1 class="wr-Header-title svelte-oiwvqb"> <span><!></span> <span class="wr-Header-label svelte-oiwvqb"> </span>, <!> <span class="wr-Header-label svelte-oiwvqb"> </span> <br/> <!> <span class="wr-Header-label svelte-oiwvqb"> </span> </h1>'),xf=K('<div class="wr-Header"><!></div>');const Ef={hash:"svelte-oiwvqb",code:`.wr-Header-title.svelte-oiwvqb {font-weight:600;font-size:24px;margin:0 auto;line-height:1.3;color:#333;text-align:center;
84
97
 
85
98
  /* TODO: add wineater-color to svg */}.wr-Header-icon {display:inline-block;vertical-align:middle;color:var(--wr-wineater-color);}.wr-Header-label.svelte-oiwvqb {color:var(--wr-wineater-color);font-weight:500;}
86
99
 
87
100
  @media screen and (max-width: 768px) {.wr-Header-title.svelte-oiwvqb {display:none;}
88
- }`};function cf(t,e){var u;It(e,!0),Rt(t,lf);let n=me(()=>be.getAppLanguage());const s=((u=window==null?void 0:window.wineaterData)==null?void 0:u.TITLE_TEXT)||null;let i=ie(tt(qa));var r=af(),o=P(r);{var a=l=>{var h=rf(),d=P(h);J(()=>ee(d,s)),L(l,h)},c=l=>{var h=of(),d=P(h),f=G(d),p=P(f);bc(p,()=>b(i),(S,A)=>{A(S,{className:"wr-Header-icon",size:"28"})});var m=G(f,2),E=P(m),_=G(m,2);ef(_,{className:"wr-Header-icon",size:"28"});var x=G(_,2),T=P(x),g=G(x,3),w=G(g);Zd(w,{className:"wr-Header-icon",size:"28"});var k=G(w,2),I=P(k),y=G(k);J((S,A,W,B,V,z)=>{ee(d,`${S??""} `),ee(E,A),ee(T,W),ee(g,` ${B??""} `),ee(I,V),ee(y,` ${z??""}`)},[()=>Ie({key:"headerLine1",lang:b(n)}),()=>Ie({key:"headerMeal",lang:b(n)}),()=>Ie({key:"headerMood",lang:b(n)}),()=>Ie({key:"headerOr",lang:b(n)}),()=>Ie({key:"headerOccasion",lang:b(n)}),()=>Ie({key:"headerLine2",lang:b(n)})]),Qt("mouseenter",f,()=>O(i,sf,!0)),Qt("mouseleave",f,()=>O(i,qa,!0)),L(l,h)};ne(o,l=>{s?l(a):l(c,!1)})}L(t,r),Ct()}var uf=Y('<option class="wr-Footer-lang"> </option>'),hf=Y('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),df=Y('<footer class="wr-Footer svelte-1sr6y3t"><div class="wr-Footer-center svelte-1sr6y3t"><a href="https://wineater.com" class="wr-Footer-link svelte-1sr6y3t" target="_blank"><span class="wr-Footer-text"> </span> <img class="wr-Footer-logo svelte-1sr6y3t" alt="Wineater Logo"/> <span class="wr-Footer-text wr-Footer-text--sommelier svelte-1sr6y3t"> </span></a></div> <!></footer>');const ff={hash:"svelte-1sr6y3t",code:`.wr-Footer.svelte-1sr6y3t {position:relative;border-top:2px solid #f6f7fd;font-weight:200;padding:12px 24px;min-height:40px;}.wr-Footer-center.svelte-1sr6y3t {position:absolute;left:50%;transform:translateX(-50%);text-align:center;}.wr-Footer-dropdown.svelte-1sr6y3t {position:absolute;right:0px;top:50%;transform:translateY(-50%);padding:4px;border-radius:6px;border:2px solid var(--wr-brand-color);background-color:white;color:var(--wr-brand-color);font-weight:500;font-size:12px;cursor:pointer;transition:all 0.2s ease;}.wr-Footer-dropdown.svelte-1sr6y3t:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.2);}.wr-Footer-link.svelte-1sr6y3t {text-decoration:none;display:flex;align-items:center;white-space:nowrap;gap:8px;color:#a8a8a8;font-size:12px;line-height:16px;transition:opacity 0.2s ease;}.wr-Footer-link.svelte-1sr6y3t:hover {opacity:0.8;}.wr-Footer-logo.svelte-1sr6y3t {height:16px;width:auto;color:#a8a8a8;}
101
+ }`};function If(t,e){var u;Rt(e,!0),Ft(t,Ef);let n=ae(()=>we.getAppLanguage());const s=((u=window==null?void 0:window.wineaterData)==null?void 0:u.TITLE_TEXT)||null;let i=le(at(il));var r=xf(),o=A(r);{var a=l=>{var h=kf(),d=A(h);X(()=>se(d,s)),P(l,h)},c=l=>{var h=Tf(),d=A(h),p=V(d),f=A(p);Lc(f,()=>w(i),(T,M)=>{M(T,{className:"wr-Header-icon",size:"28"})});var m=V(p,2),y=A(m),S=V(m,2);bf(S,{className:"wr-Header-icon",size:"28"});var _=V(S,2),x=A(_),g=V(_,3),b=V(g);vf(b,{className:"wr-Header-icon",size:"28"});var E=V(b,2),I=A(E),k=V(E);X((T,M,G,z,Z,W)=>{se(d,`${T??""} `),se(y,M),se(x,G),se(g,` ${z??""} `),se(I,Z),se(k,` ${W??""}`)},[()=>Ne({key:"headerLine1",lang:w(n)}),()=>Ne({key:"headerMeal",lang:w(n)}),()=>Ne({key:"headerMood",lang:w(n)}),()=>Ne({key:"headerOr",lang:w(n)}),()=>Ne({key:"headerOccasion",lang:w(n)}),()=>Ne({key:"headerLine2",lang:w(n)})]),rn("mouseenter",p,()=>D(i,_f,!0)),rn("mouseleave",p,()=>D(i,il,!0)),P(l,h)};ce(o,l=>{s?l(a):l(c,!1)})}P(t,r),Dt()}var Cf=K('<option class="wr-Footer-lang"> </option>'),Nf=K('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),Rf=K('<footer class="wr-Footer svelte-1sr6y3t"><div class="wr-Footer-center svelte-1sr6y3t"><a href="https://wineater.com" class="wr-Footer-link svelte-1sr6y3t" target="_blank"><span class="wr-Footer-text"> </span> <img class="wr-Footer-logo svelte-1sr6y3t" alt="Wineater Logo"/> <span class="wr-Footer-text wr-Footer-text--sommelier svelte-1sr6y3t"> </span></a></div> <!></footer>');const Df={hash:"svelte-1sr6y3t",code:`.wr-Footer.svelte-1sr6y3t {position:relative;border-top:2px solid #f6f7fd;font-weight:200;padding:12px 24px;min-height:40px;}.wr-Footer-center.svelte-1sr6y3t {position:absolute;left:50%;transform:translateX(-50%);text-align:center;}.wr-Footer-dropdown.svelte-1sr6y3t {position:absolute;right:0px;top:50%;transform:translateY(-50%);padding:4px;border-radius:6px;border:2px solid var(--wr-brand-color);background-color:white;color:var(--wr-brand-color);font-weight:500;font-size:12px;cursor:pointer;transition:all 0.2s ease;}.wr-Footer-dropdown.svelte-1sr6y3t:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.2);}.wr-Footer-link.svelte-1sr6y3t {text-decoration:none;display:flex;align-items:center;white-space:nowrap;gap:8px;color:#a8a8a8;font-size:12px;line-height:16px;transition:opacity 0.2s ease;}.wr-Footer-link.svelte-1sr6y3t:hover {opacity:0.8;}.wr-Footer-logo.svelte-1sr6y3t {height:16px;width:auto;color:#a8a8a8;}
89
102
 
90
103
  @media screen and (max-width: 768px) {.wr-Footer-text--sommelier.svelte-1sr6y3t {display:none;}
91
- }`};function pf(t,e){It(e,!0),Rt(t,ff);let n=Be(e,"countryCode",3,null),s=me(()=>be.getAppLanguage()),i=me(()=>be.getSupportedLanguages()),r=me(()=>be.getStoreId());function o(_){const T=_.target.value;it(ct.LANGUAGE_CHANGED,b(r),{from_language:b(s),to_language:T}),be.setStoreLanguage(T)}var a=df(),c=P(a),u=P(c),l=P(u),h=P(l),d=G(l,2),f=G(d,2),p=P(f),m=G(c,2);{var E=_=>{var x=hf();x.__change=o,zn(x,21,()=>b(i),jn,(g,w)=>{var k=uf(),I=P(k),y={};J(S=>{Tc(k,b(w)===b(s)),ee(I,S),y!==(y=b(w))&&(k.value=(k.__value=b(w))??"")},[()=>b(w).toUpperCase()]),L(g,k)});var T;Sc(x),J(()=>{T!==(T=b(s))&&(x.value=(x.__value=b(s))??"",mo(x,b(s)))}),L(_,x)};ne(m,_=>{b(i).length>1&&_(E)})}J((_,x)=>{ee(h,_),ke(d,"src",n()==="ru"?"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5":"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"),ee(p,x)},[()=>Ie({key:"poweredBy",lang:b(s)}),()=>Ie({key:"ai_sommelier",lang:b(s)})]),L(t,a),Ct()}ws(["change"]);var gf=Y('<a rel="noopener noreferrer"><!></a>'),mf=Y("<button><!></button>");const vf={hash:"svelte-8cxv3l",code:`.wr-Action.svelte-8cxv3l {background:transparent;border:none;font-family:inherit;cursor:pointer;display:block;text-decoration:none;transition:background 0.2s,
104
+ }`};function Of(t,e){Rt(e,!0),Ft(t,Df);let n=We(e,"countryCode",3,null),s=ae(()=>we.getAppLanguage()),i=ae(()=>we.getSupportedLanguages()),r=ae(()=>we.getStoreId());function o(S){const x=S.target.value;ct(pt.LANGUAGE_CHANGED,w(r),{from_language:w(s),to_language:x}),we.setStoreLanguage(x)}var a=Rf(),c=A(a),u=A(c),l=A(u),h=A(l),d=V(l,2),p=V(d,2),f=A(p),m=V(c,2);{var y=S=>{var _=Nf();es(_,21,()=>w(i),$n,(g,b)=>{var E=Cf(),I=A(E),k={};X(T=>{Uc(E,w(b)===w(s)),se(I,T),k!==(k=w(b))&&(E.value=(E.__value=w(b))??"")},[()=>w(b).toUpperCase()]),P(g,E)});var x;Wc(_),X(()=>{x!==(x=w(s))&&(_.value=(_.__value=w(s))??"",Ro(_,w(s)))}),kn("change",_,o),P(S,_)};ce(m,S=>{w(i).length>1&&S(y)})}X((S,_)=>{se(h,S),Ce(d,"src",n()==="ru"?"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5":"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"),se(f,_)},[()=>Ne({key:"poweredBy",lang:w(s)}),()=>Ne({key:"ai_sommelier",lang:w(s)})]),P(t,a),Dt()}_s(["change"]);var Af=K('<a rel="noopener noreferrer"><!></a>'),Mf=K("<button><!></button>");const Pf={hash:"svelte-8cxv3l",code:`.wr-Action.svelte-8cxv3l {background:transparent;border:none;font-family:inherit;cursor:pointer;display:block;text-decoration:none;transition:background 0.2s,
92
105
  color 0.2s,
93
- box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--wr-brand-color);color:#fff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {opacity:0.8;}}.wr-Action.outlined.svelte-8cxv3l {background:transparent;color:var(--wr-brand-color);border:2px solid var(--wr-brand-color);border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.25);background-color:var(--wr-brand-color);color:#fff;}}.wr-Action--uppercase.svelte-8cxv3l {text-transform:uppercase;}`};function dr(t,e){It(e,!0),Rt(t,vf);let n=Be(e,"type",3,"button"),s=Be(e,"variant",3,"primary"),i=Be(e,"target",3,"_self"),r=be.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=yn(),c=Xt(a);{var u=h=>{var d=gf(),f=P(d);po(f,e,"default",{}),J(()=>{Ot(d,1,_n(o),"svelte-8cxv3l"),ke(d,"href",e.href),ke(d,"id",e.id),ke(d,"target",i())}),L(h,d)},l=h=>{var d=mf();d.__click=function(...p){var m;(m=e.handleClick)==null||m.apply(this,p)};var f=P(d);po(f,e,"default",{}),J(()=>{Ot(d,1,_n(o),"svelte-8cxv3l"),ke(d,"type",n()),ke(d,"id",e.id)}),L(h,d)};ne(c,h=>{e.href?h(u):h(l,!1)})}L(t,a),Ct()}ws(["click"]);var bf=Y('<form class="wr-Search svelte-1wah7ro"><span class="wr-Search-icon svelte-1wah7ro"></span> <input class="wr-Search-input svelte-1wah7ro" type="text"/> <!></form>');const wf={hash:"svelte-1wah7ro",code:`.wr-Search.svelte-1wah7ro {position:relative;margin:12px auto;padding:0 6px;display:flex;align-items:center;border:2px solid #d5d9ee;border-radius:10px;}.wr-Search-icon.svelte-1wah7ro {left:12px;width:24px;height:24px;flex:0 0 auto;background-image:url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//search.svg?x=1');background-repeat:no-repeat;background-size:contain;z-index:2;}.wr-Search-input.svelte-1wah7ro {flex:1 1 0%;min-width:0;padding:12px;font-size:16px;border:none;border-radius:10px;outline:none;transition:border 0.2s ease;}.wr-Search-input.svelte-1wah7ro::placeholder {color:var(--wr-wineater-color);opacity:1;transition:color 0.3s ease,
94
- opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--wr-brand-color);}.wr-Search-input.svelte-1wah7ro:focus::placeholder {opacity:0.5;}`};function yf(t,e){It(e,!0),Rt(t,wf);let n=Be(e,"searchQuery",15),s,i=ie(!1),r=ie(0),o=ie(0),a=ie(!0),c=ie(!1),u=me(()=>be.getAppLanguage()),l=0;function h(){return s}function d(){const g=++l,w=Ie({key:"placeholderSuggestions",lang:b(u)});if(!s||!w.length)return;O(c,!0);const k=()=>{if(g!==l||!s||!b(c)||b(i)||n().length)return;const I=w[b(r)];if(b(a)){if(s.placeholder=I.substring(0,Fr(o)),b(o)>I.length){O(a,!1),setTimeout(k,1600);return}setTimeout(k,90)}else{if(s.placeholder=I.substring(0,Fr(o,-1)),b(o)<0){O(a,!0),O(r,(b(r)+1)%w.length),setTimeout(k,450);return}setTimeout(k,45)}};k()}function f(){O(c,!1)}function p(){O(i,!0),f(),s&&(s.placeholder="")}function m(){O(i,!1),O(o,0),O(a,!0),O(c,!1)}Vn(()=>{if(!s||n().length>0)return;l++,O(c,!1),O(r,0),O(o,0),O(a,!0);const g=Ie({key:"placeholderSuggestions",lang:b(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=Ie({key:"searchPlaceholder",lang:b(u)})}),Vn(()=>{s&&e.initialized&&!b(i)&&!n().length&&!b(c)&&d(),n().length>0&&b(c)&&(O(c,!1),l++)}),yi(()=>{});var E={getSearchElement:h},_=bf(),x=G(P(_),2);Cc(x,g=>s=g,()=>s);var T=G(x,2);return dr(T,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,w)=>{var k=wi();J(I=>ee(k,I),[()=>Ie({key:"searchButton",lang:b(u)})]),L(g,k)},$$slots:{default:!0}}),Qt("submit",_,function(...g){var w;(w=e.onSubmit)==null||w.apply(this,g)}),Qt("focus",x,p),Qt("blur",x,m),Ic(x,n),L(t,_),Ct(E)}var Sf=Y('<div class="wr-Loader svelte-li6gfl"><div class="wr-Loader-indicator svelte-li6gfl"><span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span></div></div>');const _f={hash:"svelte-li6gfl",code:`.wr-Loader.svelte-li6gfl {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:10000;text-align:center;}.wr-Loader-indicator.svelte-li6gfl {display:flex;justify-content:center;align-items:center;height:40px;visibility:visible;background-color:white;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl) {display:block;width:8px;height:8px;margin:0 3px;border-radius:50%;background:linear-gradient(90deg, var(--wr-brand-color), var(--wineater-corp-color));opacity:0.7;
106
+ box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--wr-brand-color);color:#fff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {opacity:0.8;}}.wr-Action.outlined.svelte-8cxv3l {background:transparent;color:var(--wr-brand-color);border:2px solid var(--wr-brand-color);border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.25);background-color:var(--wr-brand-color);color:#fff;}}.wr-Action--uppercase.svelte-8cxv3l {text-transform:uppercase;}`};function br(t,e){Rt(e,!0),Ft(t,Pf);let n=We(e,"type",3,"button"),s=We(e,"variant",3,"primary"),i=We(e,"target",3,"_self"),r=we.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=xi(),c=ws(a);{var u=h=>{var d=Af(),p=A(d);Co(p,e,"default",{}),X(()=>{Wt(d,1,Tn(o),"svelte-8cxv3l"),Ce(d,"href",e.href),Ce(d,"id",e.id),Ce(d,"target",i())}),P(h,d)},l=h=>{var d=Mf(),p=A(d);Co(p,e,"default",{}),X(()=>{Wt(d,1,Tn(o),"svelte-8cxv3l"),Ce(d,"type",n()),Ce(d,"id",e.id)}),kn("click",d,function(...f){var m;(m=e.handleClick)==null||m.apply(this,f)}),P(h,d)};ce(c,h=>{e.href?h(u):h(l,!1)})}P(t,a),Dt()}_s(["click"]);var Lf=K('<form class="wr-Search svelte-1wah7ro"><span class="wr-Search-icon svelte-1wah7ro"></span> <input class="wr-Search-input svelte-1wah7ro" type="text"/> <!></form>');const Bf={hash:"svelte-1wah7ro",code:`.wr-Search.svelte-1wah7ro {position:relative;margin:12px auto;padding:0 6px;display:flex;align-items:center;border:2px solid #d5d9ee;border-radius:10px;}.wr-Search-icon.svelte-1wah7ro {left:12px;width:24px;height:24px;flex:0 0 auto;background-image:url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//search.svg?x=1');background-repeat:no-repeat;background-size:contain;z-index:2;}.wr-Search-input.svelte-1wah7ro {flex:1 1 0%;min-width:0;padding:12px;font-size:16px;border:none;border-radius:10px;outline:none;transition:border 0.2s ease;}.wr-Search-input.svelte-1wah7ro::placeholder {color:var(--wr-wineater-color);opacity:1;transition:color 0.3s ease,
107
+ opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--wr-brand-color);}.wr-Search-input.svelte-1wah7ro:focus::placeholder {opacity:0.5;}`};function Ff(t,e){Rt(e,!0),Ft(t,Bf);let n=We(e,"searchQuery",15),s,i=le(!1),r=le(0),o=le(0),a=le(!0),c=le(!1),u=ae(()=>we.getAppLanguage()),l=0;function h(){return s}function d(){const g=++l,b=Ne({key:"placeholderSuggestions",lang:w(u)});if(!s||!b.length)return;D(c,!0);const E=()=>{if(g!==l||!s||!w(c)||w(i)||n().length)return;const I=b[w(r)];if(w(a)){if(s.placeholder=I.substring(0,Jr(o)),w(o)>I.length){D(a,!1),setTimeout(E,1600);return}setTimeout(E,90)}else{if(s.placeholder=I.substring(0,Jr(o,-1)),w(o)<0){D(a,!0),D(r,(w(r)+1)%b.length),setTimeout(E,450);return}setTimeout(E,45)}};E()}function p(){D(c,!1)}function f(){D(i,!0),p(),s&&(s.placeholder="")}function m(){D(i,!1),D(o,0),D(a,!0),D(c,!1)}Xn(()=>{if(!s||n().length>0)return;l++,D(c,!1),D(r,0),D(o,0),D(a,!0);const g=Ne({key:"placeholderSuggestions",lang:w(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=Ne({key:"searchPlaceholder",lang:w(u)})}),Xn(()=>{s&&e.initialized&&!w(i)&&!n().length&&!w(c)&&d(),n().length>0&&w(c)&&(D(c,!1),l++)}),Ei(()=>{});var y={getSearchElement:h},S=Lf(),_=V(A(S),2);Gc(_,g=>s=g,()=>s);var x=V(_,2);return br(x,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,b)=>{var E=Ti();X(I=>se(E,I),[()=>Ne({key:"searchButton",lang:w(u)})]),P(g,E)},$$slots:{default:!0}}),rn("submit",S,function(...g){var b;(b=e.onSubmit)==null||b.apply(this,g)}),rn("focus",_,f),rn("blur",_,m),Vc(_,n),P(t,S),Dt(y)}var Wf=K('<div class="wr-Loader svelte-li6gfl"><div class="wr-Loader-indicator svelte-li6gfl"><span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span></div></div>');const jf={hash:"svelte-li6gfl",code:`.wr-Loader.svelte-li6gfl {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:10000;text-align:center;}.wr-Loader-indicator.svelte-li6gfl {display:flex;justify-content:center;align-items:center;height:40px;visibility:visible;background-color:white;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl) {display:block;width:8px;height:8px;margin:0 3px;border-radius:50%;background:linear-gradient(90deg, var(--wr-brand-color), var(--wineater-corp-color));opacity:0.7;
95
108
  animation: svelte-li6gfl-typing 1s infinite;}
96
109
 
97
110
  @keyframes svelte-li6gfl-typing {
@@ -104,7 +117,7 @@ ${JSON.stringify(o,null,2)}
104
117
  transform: translateY(-8px);
105
118
  opacity: 1;
106
119
  }
107
- }.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function kf(t){Rt(t,_f);var e=Sf();L(t,e)}var Tf=Y('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),xf=Y('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Ef=Y('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),If=Y('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Cf=Y('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Nf=Y('<div class="wr-WinePopupMobile svelte-17gehox"><div class="wr-WinePopupMobile-overlay svelte-17gehox"></div> <div class="wr-WinePopupMobile-wrapper svelte-17gehox"><div class="wr-WinePopup js-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close js-WinePopupClose svelte-17gehox">&times;</button></div> <!> <!> <!></div></div></div>'),Df=Y('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Rf=Y('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Of=Y('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Af=Y('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Mf=Y('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Pf=Y('<div class="wr-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close svelte-17gehox">&times;</button></div> <!> <!> <!></div>');const Lf={hash:"svelte-17gehox",code:".wr-WinePopup.svelte-17gehox {position:absolute;width:100%;background-color:white;padding:16px;border-radius:16px;box-shadow:0 6px 30px rgba(0, 0, 0, 0.2);text-align:left;font-size:14px;box-sizing:border-box;display:flex;flex-direction:column;}.wr-WinePopup-text.svelte-17gehox {margin:5px 0;}.wr-WinePopup-header.svelte-17gehox {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}.wr-WinePopup-title.svelte-17gehox {font-size:16px;font-weight:600;margin:0;flex:1;line-height:1.3;}.wr-WinePopup-close.svelte-17gehox {font-size:20px;font-weight:bold;cursor:pointer;color:#999;border:none;background:transparent;line-height:1;}.wr-WinePopup-close.svelte-17gehox:hover {color:#000;}.wr-WinePopup-desc.svelte-17gehox {margin-top:8px;}.wr-WinePopup-reason.svelte-17gehox {font-size:14px;font-weight:400;color:#333;margin-top:8px;}.wr-WinePopup-pairing.svelte-17gehox {margin-top:8px;}.wr-WinePopup-tags.svelte-17gehox {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WinePopup-tag.svelte-17gehox {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}.wr-WinePopupMobile.svelte-17gehox {position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;}.wr-WinePopupMobile-overlay.svelte-17gehox {position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);}.wr-WinePopupMobile-wrapper.svelte-17gehox {position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%, -50%);max-width:90%;max-height:80%;overflow-y:auto;background:transparent;}"};function Va(t,e){It(e,!0),Rt(t,Lf);const n=!!e.isMobile;var s=yn(),i=Xt(s);{var r=a=>{var c=Nf(),u=P(c);u.__click=function(...I){var y;(y=e.onClose)==null||y.apply(this,I)};var l=G(u,2),h=P(l),d=P(h),f=P(d),p=P(f),m=G(f,2);m.__click=function(...I){var y;(y=e.onClose)==null||y.apply(this,I)};var E=G(d,2);{var _=I=>{var y=Tf(),S=P(y);J(()=>ee(S,e.shortDescription)),L(I,y)};ne(E,I=>{e.shortDescription&&I(_)})}var x=G(E,2);{var T=I=>{var y=xf(),S=P(y);J(()=>ee(S,e.reason)),L(I,y)},g=I=>{var y=yn(),S=Xt(y);{var A=W=>{var B=Ef(),V=P(B);J(()=>ee(V,e.pairing)),L(W,B)};ne(S,W=>{e.pairing&&W(A)},!0)}L(I,y)};ne(x,I=>{e.reason?I(T):I(g,!1)})}var w=G(x,2);{var k=I=>{var y=Cf();zn(y,21,()=>e.tags,jn,(S,A)=>{var W=If(),B=P(W);J(()=>ee(B,b(A))),L(S,W)}),L(I,y)};ne(w,I=>{e.tags&&e.tags.length&&I(k)})}J(()=>ee(p,e.title)),L(a,c)},o=a=>{var c=Pf(),u=P(c),l=P(u),h=P(l),d=G(l,2);d.__click=function(...g){var w;(w=e.onClose)==null||w.apply(this,g)};var f=G(u,2);{var p=g=>{var w=Df(),k=P(w);J(()=>ee(k,e.shortDescription)),L(g,w)};ne(f,g=>{e.shortDescription&&g(p)})}var m=G(f,2);{var E=g=>{var w=Rf(),k=P(w);J(()=>ee(k,e.reason)),L(g,w)},_=g=>{var w=yn(),k=Xt(w);{var I=y=>{var S=Of(),A=P(S);J(()=>ee(A,e.pairing)),L(y,S)};ne(k,y=>{e.pairing&&y(I)},!0)}L(g,w)};ne(m,g=>{e.reason?g(E):g(_,!1)})}var x=G(m,2);{var T=g=>{var w=Mf();zn(w,21,()=>e.tags,jn,(k,I)=>{var y=Af(),S=P(y);J(()=>ee(S,b(I))),L(k,y)}),L(g,w)};ne(x,g=>{e.tags&&e.tags.length&&g(T)})}J(()=>ee(h,e.title)),L(a,c)};ne(i,a=>{n?a(r):a(o,!1)})}L(t,s),Ct()}ws(["click"]);var Ff=Y('<img class="wr-WineTile-image svelte-yk3emv"/>'),Bf=Y('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),Wf=Y('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),jf=Y('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),zf=Y('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),Uf=Y('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),Hf=Y("<div><!> <!></div>"),qf=Y('<article><header class="wr-WineTile-header svelte-yk3emv"><!> <!> <h3 class="wr-WineTile-title svelte-yk3emv"> </h3></header> <!> <footer class="wr-WineTile-footer svelte-yk3emv"><div class="wr-WineTile-actions svelte-yk3emv"><!></div></footer> <!> <!></article> <!>',1);const Vf={hash:"svelte-yk3emv",code:`.wr-WineTile.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;text-align:center;box-sizing:border-box;padding:16px 8px;border-right:2px solid #f6f7fd;position:relative;transform:translateY(0);opacity:1;transition:transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
120
+ }.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function zf(t){Ft(t,jf);var e=Wf();P(t,e)}var Uf=K('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Hf=K('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),qf=K('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Vf=K('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Gf=K('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Kf=K('<div class="wr-WinePopupMobile svelte-17gehox"><div class="wr-WinePopupMobile-overlay svelte-17gehox"></div> <div class="wr-WinePopupMobile-wrapper svelte-17gehox"><div class="wr-WinePopup js-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close js-WinePopupClose svelte-17gehox">&times;</button></div> <!> <!> <!></div></div></div>'),Xf=K('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Yf=K('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Jf=K('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Qf=K('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Zf=K('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),$f=K('<div class="wr-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close svelte-17gehox">&times;</button></div> <!> <!> <!></div>');const ep={hash:"svelte-17gehox",code:".wr-WinePopup.svelte-17gehox {position:absolute;width:100%;background-color:white;padding:16px;border-radius:16px;box-shadow:0 6px 30px rgba(0, 0, 0, 0.2);text-align:left;font-size:14px;box-sizing:border-box;display:flex;flex-direction:column;}.wr-WinePopup-text.svelte-17gehox {margin:5px 0;}.wr-WinePopup-header.svelte-17gehox {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}.wr-WinePopup-title.svelte-17gehox {font-size:16px;font-weight:600;margin:0;flex:1;line-height:1.3;}.wr-WinePopup-close.svelte-17gehox {font-size:20px;font-weight:bold;cursor:pointer;color:#999;border:none;background:transparent;line-height:1;}.wr-WinePopup-close.svelte-17gehox:hover {color:#000;}.wr-WinePopup-desc.svelte-17gehox {margin-top:8px;}.wr-WinePopup-reason.svelte-17gehox {font-size:14px;font-weight:400;color:#333;margin-top:8px;}.wr-WinePopup-pairing.svelte-17gehox {margin-top:8px;}.wr-WinePopup-tags.svelte-17gehox {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WinePopup-tag.svelte-17gehox {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}.wr-WinePopupMobile.svelte-17gehox {position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;}.wr-WinePopupMobile-overlay.svelte-17gehox {position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);}.wr-WinePopupMobile-wrapper.svelte-17gehox {position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%, -50%);max-width:90%;max-height:80%;overflow-y:auto;background:transparent;}"};function rl(t,e){Rt(e,!0),Ft(t,ep);const n=!!e.isMobile;var s=xi(),i=ws(s);{var r=a=>{var c=Kf(),u=A(c),l=V(u,2),h=A(l),d=A(h),p=A(d),f=A(p),m=V(p,2),y=V(d,2);{var S=I=>{var k=Uf(),T=A(k);X(()=>se(T,e.shortDescription)),P(I,k)};ce(y,I=>{e.shortDescription&&I(S)})}var _=V(y,2);{var x=I=>{var k=Hf(),T=A(k);X(()=>se(T,e.reason)),P(I,k)},g=I=>{var k=qf(),T=A(k);X(()=>se(T,e.pairing)),P(I,k)};ce(_,I=>{e.reason?I(x):e.pairing&&I(g,1)})}var b=V(_,2);{var E=I=>{var k=Gf();es(k,21,()=>e.tags,$n,(T,M)=>{var G=Vf(),z=A(G);X(()=>se(z,w(M))),P(T,G)}),P(I,k)};ce(b,I=>{e.tags&&e.tags.length&&I(E)})}X(()=>se(f,e.title)),kn("click",u,function(...I){var k;(k=e.onClose)==null||k.apply(this,I)}),kn("click",m,function(...I){var k;(k=e.onClose)==null||k.apply(this,I)}),P(a,c)},o=a=>{var c=$f(),u=A(c),l=A(u),h=A(l),d=V(l,2),p=V(u,2);{var f=g=>{var b=Xf(),E=A(b);X(()=>se(E,e.shortDescription)),P(g,b)};ce(p,g=>{e.shortDescription&&g(f)})}var m=V(p,2);{var y=g=>{var b=Yf(),E=A(b);X(()=>se(E,e.reason)),P(g,b)},S=g=>{var b=Jf(),E=A(b);X(()=>se(E,e.pairing)),P(g,b)};ce(m,g=>{e.reason?g(y):e.pairing&&g(S,1)})}var _=V(m,2);{var x=g=>{var b=Zf();es(b,21,()=>e.tags,$n,(E,I)=>{var k=Qf(),T=A(k);X(()=>se(T,w(I))),P(E,k)}),P(g,b)};ce(_,g=>{e.tags&&e.tags.length&&g(x)})}X(()=>se(h,e.title)),kn("click",d,function(...g){var b;(b=e.onClose)==null||b.apply(this,g)}),P(a,c)};ce(i,a=>{n?a(r):a(o,!1)})}P(t,s),Dt()}_s(["click"]);var tp=K('<img class="wr-WineTile-image svelte-yk3emv"/>'),np=K('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),sp=K('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),ip=K('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),rp=K('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),op=K('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),ap=K("<div><!> <!></div>"),lp=K('<article><header class="wr-WineTile-header svelte-yk3emv"><!> <!> <h3 class="wr-WineTile-title svelte-yk3emv"> </h3></header> <!> <footer class="wr-WineTile-footer svelte-yk3emv"><div class="wr-WineTile-actions svelte-yk3emv"><!></div></footer> <!> <!></article> <!>',1);const cp={hash:"svelte-yk3emv",code:`.wr-WineTile.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;text-align:center;box-sizing:border-box;padding:16px 8px;border-right:2px solid #f6f7fd;position:relative;transform:translateY(0);opacity:1;transition:transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
108
121
  opacity 180ms cubic-bezier(0.22, 0.61, 0.36, 1);will-change:transform, opacity;}.wr-WineTile.svelte-yk3emv:last-child {border-right:none;}.wr-WineTile.ww-slide-up.svelte-yk3emv {transform:translateY(-28px);opacity:0;}.wr-WineTile-header.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;}.wr-WineTile-image.svelte-yk3emv {height:200px;object-fit:contain;margin:0 auto 16px;display:block;}.wr-WineTile-title.svelte-yk3emv {font-size:15px;font-weight:500;margin:0 0 8px;min-height:3rem;line-height:1.2;text-align:center;color:#000;}.wr-WineTile-params.svelte-yk3emv {font-size:14px;color:#666;white-space:normal;text-align:center;}.wr-WineTile-footer.svelte-yk3emv {margin-top:auto;display:flex;align-items:center;gap:12px;justify-content:center;}.wr-WineTile-price.svelte-yk3emv {font-size:16px;font-weight:400;margin-bottom:8px;color:#333;}.wr-WineTile-actions.svelte-yk3emv {margin:16px auto 0;}
109
122
 
110
123
  /* Hover popup inside tile */.wr-WineTilePopup.svelte-yk3emv {display:none;position:absolute;top:0;left:0;width:100%;padding:12px;background-color:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);transition:transform 0.3s ease;z-index:999;}.wr-WineTilePopup.visible.svelte-yk3emv {display:block;}.wr-WineTilePopup.slide-in.svelte-yk3emv {
@@ -122,7 +135,7 @@ ${JSON.stringify(o,null,2)}
122
135
  }
123
136
 
124
137
  @media screen and (max-width: 768px) {.wr-WineTile.svelte-yk3emv {flex:0 0 auto;scroll-snap-align:center;width:240px;text-align:center;}
125
- }`};function Gf(t,e){It(e,!0),Rt(t,Vf);let n=me(()=>be.getAppLanguage());const s=(C,R)=>C[R]||C[R.charAt(0).toUpperCase()+R.slice(1)],i=(C,R)=>R.map(N=>s(C,N)).filter(Boolean).join(" • ");function r(C){var R;return Yd(C,((R=be.getCurrency)==null?void 0:R.call(be))||"USD",b(n))}function o(C){return e.selectedWineId===C}function a(C){return!!(C.reason||C.shortDescription||C.tags)}function c(C,R){let N=(C==null?void 0:C.tags)||R.tags;return N?(Array.isArray(N)&&(N=N.join(",")),typeof N!="string"?[]:N.split(",").map(M=>M.trim()).filter(Boolean)):[]}let u=ie(!1);yi(()=>{const C=()=>{O(u,window.innerWidth<=768)};return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}});var l=qf(),h=Xt(l);h.__click=C=>e.onTileClick(C,e.wine);var d=P(h),f=P(d);{var p=C=>{var R=Ff();J(()=>{ke(R,"src",e.wine.image),ke(R,"alt",e.wine.title)}),L(C,R)};ne(f,C=>{e.wine.image&&C(p)})}var m=G(f,2);{var E=C=>{var R=Bf(),N=P(R);J(M=>ee(N,M),[()=>r(e.wine.total)]),L(C,R)};ne(m,C=>{e.wine.total&&C(E)})}var _=G(m,2),x=P(_),T=G(d,2);{var g=C=>{var R=Wf(),N=P(R);J(M=>ee(N,M),[()=>i(e.wine,["type","country","region","grape"])]),L(C,R)};ne(T,C=>{i(e.wine,["type","country","region","grape"])&&C(g)})}var w=G(T,2),k=P(w),I=P(k);{var y=C=>{dr(C,{get href(){return e.wine.url},className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(R,N)=>{var M=wi();J(re=>ee(M,re),[()=>Ie({key:"wineDetails.buy",lang:b(n)})]),L(R,M)},$$slots:{default:!0}})},S=C=>{dr(C,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(R,N)=>{var M=wi();J(re=>ee(M,re),[()=>Ie({key:"moreInfo",lang:b(n)})]),L(R,M)},$$slots:{default:!0}})};ne(I,C=>{e.wine.url?C(y):C(S,!1)})}var A=G(w,2);{var W=C=>{{let R=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.shortDescription)||e.wine.shortDescription}),N=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.reason)||e.wine.reason}),M=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.pairingRecommendation)||e.wine.pairingRecommendation}),re=me(()=>c(e.translatedPopup,e.wine));Va(C,{get title(){return e.wine.title},get shortDescription(){return b(R)},get reason(){return b(N)},get pairing(){return b(M)},get tags(){return b(re)},get onClose(){return e.onPopupClose},isMobile:!1})}};ne(A,C=>{o(e.wine.id)&&!b(u)&&C(W)})}var B=G(A,2);{var V=C=>{var R=Hf(),N=P(R);{var M=Ce=>{var de=jf(),oe=P(de);J(()=>{var D,U;return ee(oe,((D=e.translatedPopup)==null?void 0:D.reason)||((U=e.translatedPopup)==null?void 0:U.shortDescription)||e.wine.reason||e.wine.shortDescription)}),L(Ce,de)};ne(N,Ce=>{var de,oe;((de=e.translatedPopup)!=null&&de.reason||(oe=e.translatedPopup)!=null&&oe.shortDescription||e.wine.reason||e.wine.shortDescription)&&Ce(M)})}var re=G(N,2);{var H=Ce=>{var de=Uf();zn(de,21,()=>c(e.translatedPopup,e.wine),jn,(oe,D)=>{var U=zf(),fe=P(U);J(()=>ee(fe,b(D))),L(oe,U)}),L(Ce,de)};ne(re,Ce=>{var de,oe;((de=e.translatedPopup)!=null&&de.tags||(oe=e.translatedPopup)!=null&&oe.Tags||e.wine.tags)&&Ce(H)})}J(()=>Ot(R,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),L(C,R)};ne(B,C=>{a(e.wine)&&C(V)})}var z=G(h,2);{var j=C=>{{let R=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.shortDescription)||e.wine.shortDescription}),N=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.reason)||e.wine.reason}),M=me(()=>{var H;return((H=e.translatedPopup)==null?void 0:H.pairingRecommendation)||e.wine.pairingRecommendation}),re=me(()=>c(e.translatedPopup,e.wine));Va(C,{get title(){return e.wine.title},get shortDescription(){return b(R)},get reason(){return b(N)},get pairing(){return b(M)},get tags(){return b(re)},get onClose(){return e.onPopupClose},isMobile:!0})}};ne(z,C=>{o(e.wine.id)&&b(u)&&C(j)})}J(()=>{Ot(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),ee(x,e.wine.title)}),Qt("mouseenter",h,()=>e.onTileEnter(e.wine)),Qt("mouseleave",h,()=>e.onTileLeave(e.wine)),L(t,l),Ct()}ws(["click"]);function Kf(t){if(!t)return"";const e="custom-ui-config-style";if(document.getElementById(e))return;const n=document.createElement("style");return n.id=e,n.innerHTML=t,document.head.appendChild(n),e}var Xf=Y('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),Yf=Y('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),Jf=Y('<div class="wr-App-placeholder svelte-1n46o8q"></div>'),Qf=Y('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const Zf={hash:"svelte-1n46o8q",code:`
138
+ }`};function up(t,e){Rt(e,!0),Ft(t,cp);let n=ae(()=>we.getAppLanguage());const s=(N,O)=>N[O]||N[O.charAt(0).toUpperCase()+O.slice(1)],i=(N,O)=>O.map(te=>s(N,te)).filter(Boolean).join(" • ");function r(N){var O;return pf(N,((O=we.getCurrency)==null?void 0:O.call(we))||"USD",w(n))}function o(N){return e.selectedWineId===N}function a(N){return!!(N.reason||N.shortDescription||N.tags)}function c(N,O){let te=(N==null?void 0:N.tags)||O.tags;return te?(Array.isArray(te)&&(te=te.join(",")),typeof te!="string"?[]:te.split(",").map(re=>re.trim()).filter(Boolean)):[]}let u=le(!1);Ei(()=>{const N=()=>{D(u,window.innerWidth<=768)};return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}});var l=lp(),h=ws(l),d=A(h),p=A(d);{var f=N=>{var O=tp();X(()=>{Ce(O,"src",e.wine.image),Ce(O,"alt",e.wine.title)}),P(N,O)};ce(p,N=>{e.wine.image&&N(f)})}var m=V(p,2);{var y=N=>{var O=np(),te=A(O);X(re=>se(te,re),[()=>r(e.wine.total)]),P(N,O)};ce(m,N=>{e.wine.total&&N(y)})}var S=V(m,2),_=A(S),x=V(d,2);{var g=N=>{var O=sp(),te=A(O);X(re=>se(te,re),[()=>i(e.wine,["type","country","region","grape"])]),P(N,O)},b=ae(()=>i(e.wine,["type","country","region","grape"]));ce(x,N=>{w(b)&&N(g)})}var E=V(x,2),I=A(E),k=A(I);{var T=N=>{br(N,{get href(){return e.wine.url},className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(O,te)=>{var re=Ti();X(ue=>se(re,ue),[()=>Ne({key:"wineDetails.buy",lang:w(n)})]),P(O,re)},$$slots:{default:!0}})},M=N=>{br(N,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(O,te)=>{var re=Ti();X(ue=>se(re,ue),[()=>Ne({key:"moreInfo",lang:w(n)})]),P(O,re)},$$slots:{default:!0}})};ce(k,N=>{e.wine.url?N(T):N(M,!1)})}var G=V(E,2);{var z=N=>{{let O=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.shortDescription)||e.wine.shortDescription}),te=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.reason)||e.wine.reason}),re=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.pairingRecommendation)||e.wine.pairingRecommendation}),ue=ae(()=>c(e.translatedPopup,e.wine));rl(N,{get title(){return e.wine.title},get shortDescription(){return w(O)},get reason(){return w(te)},get pairing(){return w(re)},get tags(){return w(ue)},get onClose(){return e.onPopupClose},isMobile:!1})}},Z=ae(()=>o(e.wine.id)&&!w(u));ce(G,N=>{w(Z)&&N(z)})}var W=V(G,2);{var L=N=>{var O=ap(),te=A(O);{var re=B=>{var ee=ip(),Se=A(ee);X(()=>{var Ze,Pe;return se(Se,((Ze=e.translatedPopup)==null?void 0:Ze.reason)||((Pe=e.translatedPopup)==null?void 0:Pe.shortDescription)||e.wine.reason||e.wine.shortDescription)}),P(B,ee)};ce(te,B=>{var ee,Se;((ee=e.translatedPopup)!=null&&ee.reason||(Se=e.translatedPopup)!=null&&Se.shortDescription||e.wine.reason||e.wine.shortDescription)&&B(re)})}var ue=V(te,2);{var C=B=>{var ee=op();es(ee,21,()=>c(e.translatedPopup,e.wine),$n,(Se,Ze)=>{var Pe=rp(),Le=A(Pe);X(()=>se(Le,w(Ze))),P(Se,Pe)}),P(B,ee)};ce(ue,B=>{var ee,Se;((ee=e.translatedPopup)!=null&&ee.tags||(Se=e.translatedPopup)!=null&&Se.Tags||e.wine.tags)&&B(C)})}X(()=>Wt(O,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),P(N,O)},Y=ae(()=>a(e.wine));ce(W,N=>{w(Y)&&N(L)})}var $=V(h,2);{var R=N=>{{let O=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.shortDescription)||e.wine.shortDescription}),te=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.reason)||e.wine.reason}),re=ae(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.pairingRecommendation)||e.wine.pairingRecommendation}),ue=ae(()=>c(e.translatedPopup,e.wine));rl(N,{get title(){return e.wine.title},get shortDescription(){return w(O)},get reason(){return w(te)},get pairing(){return w(re)},get tags(){return w(ue)},get onClose(){return e.onPopupClose},isMobile:!0})}},J=ae(()=>o(e.wine.id)&&w(u));ce($,N=>{w(J)&&N(R)})}X(()=>{Wt(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),se(_,`${(e.wine.producer?e.wine.producer:"")??""} ${e.wine.title??""}`)}),rn("mouseenter",h,()=>e.onTileEnter(e.wine)),rn("mouseleave",h,()=>e.onTileLeave(e.wine)),kn("click",h,N=>e.onTileClick(N,e.wine)),P(t,l),Dt()}_s(["click"]);function hp(t){if(!t)return"";const e="custom-ui-config-style";if(document.getElementById(e))return;const n=document.createElement("style");return n.id=e,n.innerHTML=t,document.head.appendChild(n),e}var dp=K('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),fp=K('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),pp=K('<div class="wr-App-placeholder svelte-1n46o8q"></div>'),gp=K('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const mp={hash:"svelte-1n46o8q",code:`
126
139
  /* ===================== 1) CSS Variables ===================== */:root {--wineater-corp-color: #0044ff;
127
140
  /* --wr-brand-color is set dynamically from uiConfig.brandColor */--wr-brand-color: #7b2beb; /* fallback value */}
128
141
 
@@ -134,4 +147,4 @@ ${JSON.stringify(o,null,2)}
134
147
 
135
148
  /* ===================== 13) Mobile Styles ===================== */
136
149
  @media screen and (max-width: 768px) {.wr-App.svelte-1n46o8q {flex-direction:column;padding:0px 16px;min-width:100vw;}.wr-App-placeholder.svelte-1n46o8q {display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding:8px 0;width:calc(100vw - 32px);min-width:calc(100vw - 32px);}
137
- }`};function $f(t,e){var Ce,de,oe;It(e,!0),Rt(t,Zf);function n(){var D;ki("chatbotToken",((D=window.wineaterData)==null?void 0:D.CLIENT_TOKEN)||s,365),So()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new Wd({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((Ce=window==null?void 0:window.wineaterData)==null?void 0:Ce.WIDGET_TYPE)||"store",o=((de=window==null?void 0:window.wineaterData)==null?void 0:de.COUNTRY_CODE)||null;(oe=window==null?void 0:window.wineaterData)!=null&&oe.WIDGET_WRAPPER;let a=ie(!1),c=ie(!1),u=ie(tt([])),l=ie(null),h=ie(""),d=ie(null),f=ie(!1),p=ie(null),m=ie(tt([])),E=me(()=>be.getAppLanguage()),_=me(()=>be.getStoreLanguage()),x=me(()=>be.getApiKey()),T=me(()=>be.getStoreId()),g=me(()=>be.isInitialized()),w=me(()=>be.getUiConfig());function k(){O(d,Ie({key:"errorMessage",lang:b(E)}),!0)}const I=()=>O(d,null);async function y(D){if(b(E)===b(_)||r!=="bar")return D.map(()=>({}));const U=["shortDescription","reason","pairingRecommendation","tags"],fe=D[0];if(!fe)return D.map(()=>({}));const xt=U.filter(Ye=>Ye in fe),cn=4,Wt=[];for(let Ye=0;Ye<D.length;Ye+=cn){const jt=D.slice(Ye,Ye+cn).map(async Qs=>{const Zs=xt.map(ae=>{const je=Qs[ae]||Qs[ae.toLowerCase()];return je?{key:ae,text:Array.isArray(je)?je.join(", "):je}:null}).filter(Boolean);return Zs.length===0?{}:await Jd({sourceLang:b(_),targetLang:b(E),texts:Object.fromEntries(Zs.map(ae=>[ae.key,ae.text])),apiKey:b(x)})}),un=await Promise.all(jt);Wt.push(...un)}return Wt}async function S(){O(c,!0);try{O(u,await hr.getInstantRecommendations(),!0)}catch{k()}finally{O(c,!1)}}function A(D=220){return!b(u)||b(u).length===0?Promise.resolve():(O(f,!0),new Promise(U=>{setTimeout(()=>{U()},D)}))}async function W(D){D.preventDefault();let U="";try{O(c,!0),I(),await A(220),O(u,[],!0),O(f,!1),U=b(h).trim()+";";try{it(ct.SEARCH_PERFORMED,b(T),{query:U})}catch(xt){console.error("Error tracking search event:",xt)}const fe=await hr.getWineRecommendationsSearch(U);!fe||fe.length===0?(O(u,[],!0),O(m,[],!0),O(d,Ie({key:"noResultsMessage",lang:b(E)}),!0),it(ct.NO_RESULTS_FOUND,b(T),{query:U})):(O(u,fe,!0),it(ct.SEARCH_RESULTS_DISPLAYED,b(T),{results_count:fe.length,results:fe,query:U}))}catch(fe){O(u,[],!0),it(ct.ERROR_OCCURRED,b(T),{error_message:fe==null?void 0:fe.message,query:U}),k()}finally{O(c,!1)}}Vn(async()=>{if(!b(u)||b(u).length===0){O(m,[],!0);return}try{const D=await y(b(u));b(u)&&b(u).length>0&&O(m,D,!0)}catch(D){console.error("translatePopupContent failed",D)}});function B(D,U){b(l)&&b(l)!==D.id&&O(l,null),O(l,D.id,!0),it(ct.WINE_DETAILS_VIEWED,b(T),{wine_id:D.id,wine_title:D.title,is_mobile:window.innerWidth<=768})}function V(){const D=b(u).find(U=>U.id===b(l));it(ct.WINE_DETAILS_CLOSED,b(T),{wine_id:b(l),wine_title:D.title}),O(l,null)}function z(D){return!!(D.reason||D.shortDescription||D.tags)}function j(D){r==="store"&&z(D)&&(O(p,D.id,!0),it(ct.WINE_CARD_HOVER,b(T),{wine_id:D.id,wine_title:D.title}))}function C(D){r==="store"&&b(p)===D.id&&O(p,null)}function R(D,U){D.target.closest(".js-WineTileAction")||D.target.closest(".js-WinePopupClose")||it(ct.WINE_CARD_CLICK,b(T),{wine_id:U.id,wine_title:U.title})}function N(D){const U=D.target;U.closest(".js-WinePopup")||U.closest(".js-WineTileAction")||O(l,null)}Vn(()=>{var D,U;(D=b(w))!=null&&D.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",b(w).brandColor),(U=b(w))!=null&&U.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",b(w).wineaterColor)}),yi(async()=>{if(await be.initializeStore(),!!b(g))return O(w,be.getUiConfig()),b(w).customCss&&Kf(b(w).customCss),await S(),it(ct.WIDGET_INITIALIZED,b(T)),O(a,!0),document.addEventListener("click",N),()=>{document.removeEventListener("click",N)}});var M=yn(),re=Xt(M);{var H=D=>{var U=Qf(),fe=P(U);{var xt=ae=>{var je=Xf(),os=P(je);J(()=>ke(os,"src",b(w).logoUrl)),L(ae,je)};ne(fe,ae=>{b(w).logoUrl&&ae(xt)})}var cn=G(fe,2);cf(cn,{});var Wt=G(cn,2);yf(Wt,{onSubmit:W,get initialized(){return b(a)},get searchQuery(){return b(h)},set searchQuery(ae){O(h,ae,!0)}});var Ye=G(Wt,2);{var rs=ae=>{kf(ae)};ne(Ye,ae=>{b(c)&&ae(rs)})}var jt=G(Ye,2),un=P(jt);{var Qs=ae=>{var je=Yf(),os=P(je),pr=P(os);J(()=>ee(pr,b(d))),L(ae,je)},Zs=ae=>{var je=yn(),os=Xt(je);{var pr=gr=>{var Ya=Jf();zn(Ya,21,()=>b(u),jn,(ep,tp,Ja)=>{Gf(ep,{get wine(){return b(tp)},index:Ja,get hoveredWineId(){return b(p)},get selectedWineId(){return b(l)},get isAnimating(){return b(f)},get translatedPopup(){return b(m)[Ja]},onBuyClick:B,onPopupClose:V,onTileEnter:j,onTileLeave:C,onTileClick:R})}),L(gr,Ya)};ne(os,gr=>{b(u)&&b(u).length>0&&gr(pr)},!0)}L(ae,je)};ne(un,ae=>{b(d)?ae(Qs):ae(Zs,!1)})}var Xa=G(jt,2);pf(Xa,{get countryCode(){return o}}),L(D,U)};ne(re,D=>{b(g)&&D(H)})}L(t,M),Ct()}return pc($f,{target:document.getElementById("wineater-widget-conteiner")})});
150
+ }`};function vp(t,e){var te,re,ue;Rt(e,!0),Ft(t,mp);function n(){var C;Ri("chatbotToken",((C=window.wineaterData)==null?void 0:C.CLIENT_TOKEN)||s,365),Po()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new sf({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((te=window==null?void 0:window.wineaterData)==null?void 0:te.WIDGET_TYPE)||"store",o=((re=window==null?void 0:window.wineaterData)==null?void 0:re.COUNTRY_CODE)||null;(ue=window==null?void 0:window.wineaterData)!=null&&ue.WIDGET_WRAPPER;let a=le(!1),c=le(!1),u=le(at([])),l=le(null),h=le(""),d=le(null),p=le(!1),f=le(null),m=le(at([])),y=ae(()=>we.getAppLanguage()),S=ae(()=>we.getStoreLanguage()),_=ae(()=>we.getApiKey()),x=ae(()=>we.getStoreId()),g=ae(()=>we.isInitialized()),b=ae(()=>we.getUiConfig());function E(){D(d,Ne({key:"errorMessage",lang:w(y)}),!0)}const I=()=>D(d,null);async function k(C){if(w(y)===w(S)||r!=="bar")return C.map(()=>({}));const B=["shortDescription","reason","pairingRecommendation","tags"],ee=C[0];if(!ee)return C.map(()=>({}));const Se=B.filter(Le=>Le in ee),Ze=4,Pe=[];for(let Le=0;Le<C.length;Le+=Ze){const Vt=C.slice(Le,Le+Ze).map(async ei=>{const ti=Se.map(he=>{const He=ei[he]||ei[he.toLowerCase()];return He?{key:he,text:Array.isArray(He)?He.join(", "):He}:null}).filter(Boolean);return ti.length===0?{}:await gf({sourceLang:w(S),targetLang:w(y),texts:Object.fromEntries(ti.map(he=>[he.key,he.text])),apiKey:w(_)})}),pn=await Promise.all(Vt);Pe.push(...pn)}return Pe}async function T(){D(c,!0);try{D(u,await wr.getInstantRecommendations(),!0)}catch{E()}finally{D(c,!1)}}function M(C=220){return!w(u)||w(u).length===0?Promise.resolve():(D(p,!0),new Promise(B=>{setTimeout(()=>{B()},C)}))}async function G(C){C.preventDefault();let B="";try{D(c,!0),I(),await M(220),D(u,[],!0),D(p,!1),B=w(h).trim()+";";try{ct(pt.SEARCH_PERFORMED,w(x),{query:B})}catch(Se){console.error("Error tracking search event:",Se)}const ee=await wr.getWineRecommendationsSearch(B);!ee||ee.length===0?(D(u,[],!0),D(m,[],!0),D(d,Ne({key:"noResultsMessage",lang:w(y)}),!0),ct(pt.NO_RESULTS_FOUND,w(x),{query:B})):(D(u,ee,!0),ct(pt.SEARCH_RESULTS_DISPLAYED,w(x),{results_count:ee.length,results:ee,query:B}))}catch(ee){D(u,[],!0),ct(pt.ERROR_OCCURRED,w(x),{error_message:ee==null?void 0:ee.message,query:B}),E()}finally{D(c,!1)}}Xn(async()=>{if(!w(u)||w(u).length===0){D(m,[],!0);return}try{const C=await k(w(u));w(u)&&w(u).length>0&&D(m,C,!0)}catch(C){console.error("translatePopupContent failed",C)}});function z(C,B){w(l)&&w(l)!==C.id&&D(l,null),D(l,C.id,!0),ct(pt.WINE_DETAILS_VIEWED,w(x),{wine_id:C.id,wine_title:C.title,is_mobile:window.innerWidth<=768})}function Z(){const C=w(u).find(B=>B.id===w(l));ct(pt.WINE_DETAILS_CLOSED,w(x),{wine_id:w(l),wine_title:C.title}),D(l,null)}function W(C){return!!(C.reason||C.shortDescription||C.tags)}function L(C){r==="store"&&W(C)&&(D(f,C.id,!0),ct(pt.WINE_CARD_HOVER,w(x),{wine_id:C.id,wine_title:C.title}))}function Y(C){r==="store"&&w(f)===C.id&&D(f,null)}function $(C,B){C.target.closest(".js-WineTileAction")||C.target.closest(".js-WinePopupClose")||ct(pt.WINE_CARD_CLICK,w(x),{wine_id:B.id,wine_title:B.title})}function R(C){const B=C.target;B.closest(".js-WinePopup")||B.closest(".js-WineTileAction")||D(l,null)}Xn(()=>{var C,B;(C=w(b))!=null&&C.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",w(b).brandColor),(B=w(b))!=null&&B.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",w(b).wineaterColor)}),Ei(async()=>{if(await we.initializeStore(),!!w(g))return D(b,we.getUiConfig()),w(b).customCss&&hp(w(b).customCss),await T(),ct(pt.WIDGET_INITIALIZED,w(x)),D(a,!0),document.addEventListener("click",R),()=>{document.removeEventListener("click",R)}});var J=xi(),N=ws(J);{var O=C=>{var B=gp(),ee=A(B);{var Se=he=>{var He=dp(),hs=A(He);X(()=>Ce(hs,"src",w(b).logoUrl)),P(he,He)};ce(ee,he=>{w(b).logoUrl&&he(Se)})}var Ze=V(ee,2);If(Ze,{});var Pe=V(Ze,2);Ff(Pe,{onSubmit:G,get initialized(){return w(a)},get searchQuery(){return w(h)},set searchQuery(he){D(h,he,!0)}});var Le=V(Pe,2);{var us=he=>{zf(he)};ce(Le,he=>{w(c)&&he(us)})}var Vt=V(Le,2),pn=A(Vt);{var ei=he=>{var He=fp(),hs=A(He),_r=A(hs);X(()=>se(_r,w(d))),P(he,He)},ti=he=>{var He=pp();es(He,21,()=>w(u),$n,(hs,_r,ul)=>{up(hs,{get wine(){return w(_r)},index:ul,get hoveredWineId(){return w(f)},get selectedWineId(){return w(l)},get isAnimating(){return w(p)},get translatedPopup(){return w(m)[ul]},onBuyClick:z,onPopupClose:Z,onTileEnter:L,onTileLeave:Y,onTileClick:$})}),P(he,He)};ce(pn,he=>{w(d)?he(ei):w(u)&&w(u).length>0&&he(ti,1)})}var cl=V(Vt,2);Of(cl,{get countryCode(){return o}}),P(C,B)};ce(N,C=>{w(g)&&C(O)})}P(t,J),Dt()}return Nc(vp,{target:document.getElementById("wineater-widget-conteiner")})});