@release0/js 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/web.js +37 -66
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
// Release0 v1.1.
|
|
2
|
-
var ow=Object.create;var Ii=Object.defineProperty;var aw=Object.getOwnPropertyDescriptor;var iw=Object.getOwnPropertyNames;var sw=Object.getPrototypeOf,lw=Object.prototype.hasOwnProperty;var cw=(e,t)=>()=>(e&&(t=e(e=0)),t);var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uw=(e,t)=>{for(var n in t)Ii(e,n,{get:t[n],enumerable:!0})},$d=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of iw(t))!lw.call(e,o)&&o!==n&&Ii(e,o,{get:()=>t[o],enumerable:!(r=aw(t,o))||r.enumerable});return e};var Sr=(e,t,n)=>(n=e!=null?ow(sw(e)):{},$d(t||!e||!e.__esModule?Ii(n,"default",{value:e,enumerable:!0}):n,e)),_i=e=>$d(Ii({},"__esModule",{value:!0}),e);var qf=Be(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.toBig=pe.shrSL=pe.shrSH=pe.rotrSL=pe.rotrSH=pe.rotrBL=pe.rotrBH=pe.rotr32L=pe.rotr32H=pe.rotlSL=pe.rotlSH=pe.rotlBL=pe.rotlBH=pe.add5L=pe.add5H=pe.add4L=pe.add4H=pe.add3L=pe.add3H=void 0;pe.add=Kf;pe.fromBig=ic;pe.split=If;var Hi=BigInt(2**32-1),ac=BigInt(32);function ic(e,t=!1){return t?{h:Number(e&Hi),l:Number(e>>ac&Hi)}:{h:Number(e>>ac&Hi)|0,l:Number(e&Hi)|0}}function If(e,t=!1){let n=e.length,r=new Uint32Array(n),o=new Uint32Array(n);for(let a=0;a<n;a++){let{h:i,l:s}=ic(e[a],t);[r[a],o[a]]=[i,s]}return[r,o]}var _f=(e,t)=>BigInt(e>>>0)<<ac|BigInt(t>>>0);pe.toBig=_f;var Mf=(e,t,n)=>e>>>n;pe.shrSH=Mf;var Rf=(e,t,n)=>e<<32-n|t>>>n;pe.shrSL=Rf;var Nf=(e,t,n)=>e>>>n|t<<32-n;pe.rotrSH=Nf;var Of=(e,t,n)=>e<<32-n|t>>>n;pe.rotrSL=Of;var Lf=(e,t,n)=>e<<64-n|t>>>n-32;pe.rotrBH=Lf;var Df=(e,t,n)=>e>>>n-32|t<<64-n;pe.rotrBL=Df;var Bf=(e,t)=>t;pe.rotr32H=Bf;var Uf=(e,t)=>e;pe.rotr32L=Uf;var Ff=(e,t,n)=>e<<n|t>>>32-n;pe.rotlSH=Ff;var $f=(e,t,n)=>t<<n|e>>>32-n;pe.rotlSL=$f;var Gf=(e,t,n)=>t<<n-32|e>>>64-n;pe.rotlBH=Gf;var Hf=(e,t,n)=>e<<n-32|t>>>64-n;pe.rotlBL=Hf;function Kf(e,t,n,r){let o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}var Vf=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);pe.add3L=Vf;var jf=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;pe.add3H=jf;var zf=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);pe.add4L=zf;var Wf=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;pe.add4H=Wf;var Zf=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);pe.add5L=Zf;var Yf=(e,t,n,r,o,a)=>t+n+r+o+a+(e/2**32|0)|0;pe.add5H=Yf;var RS={fromBig:ic,split:If,toBig:_f,shrSH:Mf,shrSL:Rf,rotrSH:Nf,rotrSL:Of,rotrBH:Lf,rotrBL:Df,rotr32H:Bf,rotr32L:Uf,rotlSH:Ff,rotlSL:$f,rotlBH:Gf,rotlBL:Hf,add:Kf,add3L:Vf,add3H:jf,add4L:zf,add4H:Wf,add5H:Yf,add5L:Zf};pe.default=RS});var Jf=Be(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.crypto=void 0;Ki.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var ap=Be(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.wrapXOFConstructorWithOpts=le.wrapConstructorWithOpts=le.wrapConstructor=le.Hash=le.nextTick=le.swap32IfBE=le.byteSwapIfBE=le.swap8IfBE=le.isLE=void 0;le.isBytes=Qf;le.anumber=sc;le.abytes=bo;le.ahash=NS;le.aexists=OS;le.aoutput=LS;le.u8=DS;le.u32=BS;le.clean=US;le.createView=FS;le.rotr=$S;le.rotl=GS;le.byteSwap=cc;le.byteSwap32=ep;le.bytesToHex=KS;le.hexToBytes=VS;le.asyncLoop=zS;le.utf8ToBytes=uc;le.bytesToUtf8=WS;le.toBytes=Vi;le.kdfInputToBytes=ZS;le.concatBytes=YS;le.checkOpts=qS;le.createHasher=np;le.createOptHasher=rp;le.createXOFer=op;le.randomBytes=JS;var ho=Jf();function Qf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function sc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function bo(e,...t){if(!Qf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function NS(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");sc(e.outputLen),sc(e.blockLen)}function OS(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function LS(e,t){bo(e);let n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function DS(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function BS(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function US(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function FS(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function $S(e,t){return e<<32-t|e>>>t}function GS(e,t){return e<<t|e>>>32-t>>>0}le.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function cc(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}le.swap8IfBE=le.isLE?e=>e:e=>cc(e);le.byteSwapIfBE=le.swap8IfBE;function ep(e){for(let t=0;t<e.length;t++)e[t]=cc(e[t]);return e}le.swap32IfBE=le.isLE?e=>e:ep;var tp=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",HS=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function KS(e){if(bo(e),tp)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=HS[e[n]];return t}var Rn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Xf(e){if(e>=Rn._0&&e<=Rn._9)return e-Rn._0;if(e>=Rn.A&&e<=Rn.F)return e-(Rn.A-10);if(e>=Rn.a&&e<=Rn.f)return e-(Rn.a-10)}function VS(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(tp)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let o=0,a=0;o<n;o++,a+=2){let i=Xf(e.charCodeAt(a)),s=Xf(e.charCodeAt(a+1));if(i===void 0||s===void 0){let c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[o]=i*16+s}return r}var jS=async()=>{};le.nextTick=jS;async function zS(e,t,n){let r=Date.now();for(let o=0;o<e;o++){n(o);let a=Date.now()-r;a>=0&&a<t||(await(0,le.nextTick)(),r+=a)}}function uc(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function WS(e){return new TextDecoder().decode(e)}function Vi(e){return typeof e=="string"&&(e=uc(e)),bo(e),e}function ZS(e){return typeof e=="string"&&(e=uc(e)),bo(e),e}function YS(...e){let t=0;for(let r=0;r<e.length;r++){let o=e[r];bo(o),t+=o.length}let n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){let a=e[r];n.set(a,o),o+=a.length}return n}function qS(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}var lc=class{};le.Hash=lc;function np(e){let t=r=>e().update(Vi(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function rp(e){let t=(r,o)=>e(o).update(Vi(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function op(e){let t=(r,o)=>e(o).update(Vi(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}le.wrapConstructor=np;le.wrapConstructorWithOpts=rp;le.wrapXOFConstructorWithOpts=op;function JS(e=32){if(ho.crypto&&typeof ho.crypto.getRandomValues=="function")return ho.crypto.getRandomValues(new Uint8Array(e));if(ho.crypto&&typeof ho.crypto.randomBytes=="function")return Uint8Array.from(ho.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var mp=Be(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.shake256=Ve.shake128=Ve.keccak_512=Ve.keccak_384=Ve.keccak_256=Ve.keccak_224=Ve.sha3_512=Ve.sha3_384=Ve.sha3_256=Ve.sha3_224=Ve.Keccak=void 0;Ve.keccakP=fp;var ga=qf(),ht=ap(),XS=BigInt(0),ma=BigInt(1),QS=BigInt(2),eT=BigInt(7),tT=BigInt(256),nT=BigInt(113),lp=[],cp=[],up=[];for(let e=0,t=ma,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],lp.push(2*(5*r+n)),cp.push((e+1)*(e+2)/2%64);let o=XS;for(let a=0;a<7;a++)t=(t<<ma^(t>>eT)*nT)%tT,t&QS&&(o^=ma<<(ma<<BigInt(a))-ma);up.push(o)}var dp=(0,ga.split)(up,!0),rT=dp[0],oT=dp[1],ip=(e,t,n)=>n>32?(0,ga.rotlBH)(e,t,n):(0,ga.rotlSH)(e,t,n),sp=(e,t,n)=>n>32?(0,ga.rotlBL)(e,t,n):(0,ga.rotlSL)(e,t,n);function fp(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let s=(i+8)%10,c=(i+2)%10,l=n[c],u=n[c+1],f=ip(l,u,1)^n[s],d=sp(l,u,1)^n[s+1];for(let p=0;p<50;p+=10)e[i+p]^=f,e[i+p+1]^=d}let o=e[2],a=e[3];for(let i=0;i<24;i++){let s=cp[i],c=ip(o,a,s),l=sp(o,a,s),u=lp[i];o=e[u],a=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let s=0;s<10;s++)n[s]=e[i+s];for(let s=0;s<10;s++)e[i+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=rT[r],e[1]^=oT[r]}(0,ht.clean)(n)}var ha=class e extends ht.Hash{constructor(t,n,r,o=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=a,(0,ht.anumber)(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,ht.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,ht.swap32IfBE)(this.state32),fp(this.state32,this.rounds),(0,ht.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,ht.aexists)(this),t=(0,ht.toBytes)(t),(0,ht.abytes)(t);let{blockLen:n,state:r}=this,o=t.length;for(let a=0;a<o;){let i=Math.min(n-this.pos,o-a);for(let s=0;s<i;s++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){(0,ht.aexists)(this,!1),(0,ht.abytes)(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,a=t.length;o<a;){this.posOut>=r&&this.keccak();let i=Math.min(r-this.posOut,a-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,ht.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,ht.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,ht.clean)(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:a,enableXOF:i}=this;return t||(t=new e(n,r,o,i,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}};Ve.Keccak=ha;var Xn=(e,t,n)=>(0,ht.createHasher)(()=>new ha(t,e,n));Ve.sha3_224=Xn(6,144,224/8);Ve.sha3_256=Xn(6,136,256/8);Ve.sha3_384=Xn(6,104,384/8);Ve.sha3_512=Xn(6,72,512/8);Ve.keccak_224=Xn(1,144,224/8);Ve.keccak_256=Xn(1,136,256/8);Ve.keccak_384=Xn(1,104,384/8);Ve.keccak_512=Xn(1,72,512/8);var pp=(e,t,n)=>(0,ht.createXOFer)((r={})=>new ha(t,e,r.dkLen===void 0?n:r.dkLen,!0));Ve.shake128=pp(31,168,128/8);Ve.shake256=pp(31,136,256/8)});var Sp=Be((LR,Qn)=>{"use strict";var{sha3_512:aT}=mp(),hp=24,ba=32,dc=(e=4,t=Math.random)=>{let n="";for(;n.length<e;)n=n+Math.floor(t()*36).toString(36);return n};function bp(e){let t=8n,n=0n;for(let r of e.values()){let o=BigInt(r);n=(n<<t)+o}return n}var yp=(e="")=>bp(aT(e)).toString(36).slice(1),gp=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),iT=e=>gp[Math.floor(e()*gp.length)],vp=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let n=Object.keys(e).toString(),r=n.length?n+dc(ba,t):dc(ba,t);return yp(r).substring(0,ba)},xp=e=>()=>e++,sT=476782367,wp=({random:e=Math.random,counter:t=xp(Math.floor(e()*sT)),length:n=hp,fingerprint:r=vp({random:e})}={})=>function(){let a=iT(e),i=Date.now().toString(36),s=t().toString(36),c=dc(n,e),l=`${i+c+s+r}`;return`${a+yp(l).substring(1,n)}`},lT=wp(),cT=(e,{minLength:t=2,maxLength:n=ba}={})=>{let r=e.length,o=/^[0-9a-z]+$/;try{if(typeof e=="string"&&r>=t&&r<=n&&o.test(e))return!0}finally{}return!1};Qn.exports.getConstants=()=>({defaultLength:hp,bigLength:ba});Qn.exports.init=wp;Qn.exports.createId=lT;Qn.exports.bufToBigInt=bp;Qn.exports.createCounter=xp;Qn.exports.createFingerprint=vp;Qn.exports.isCuid=cT});var Tp=Be((DR,ya)=>{"use strict";var{createId:uT,init:dT,getConstants:fT,isCuid:pT}=Sp();ya.exports.createId=uT;ya.exports.init=dT;ya.exports.getConstants=fT;ya.exports.isCuid=pT});var Ep=Be((BR,Cp)=>{"use strict";var yo=1e3,vo=yo*60,xo=vo*60,Er=xo*24,mT=Er*7,gT=Er*365.25;Cp.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return hT(e);if(n==="number"&&isFinite(e))return t.long?yT(e):bT(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hT(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*gT;case"weeks":case"week":case"w":return n*mT;case"days":case"day":case"d":return n*Er;case"hours":case"hour":case"hrs":case"hr":case"h":return n*xo;case"minutes":case"minute":case"mins":case"min":case"m":return n*vo;case"seconds":case"second":case"secs":case"sec":case"s":return n*yo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function bT(e){var t=Math.abs(e);return t>=Er?Math.round(e/Er)+"d":t>=xo?Math.round(e/xo)+"h":t>=vo?Math.round(e/vo)+"m":t>=yo?Math.round(e/yo)+"s":e+"ms"}function yT(e){var t=Math.abs(e);return t>=Er?ji(e,t,Er,"day"):t>=xo?ji(e,t,xo,"hour"):t>=vo?ji(e,t,vo,"minute"):t>=yo?ji(e,t,yo,"second"):e+" ms"}function ji(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var Vp=Be((JR,Kp)=>{"use strict";var wc=Object.defineProperty,wT=Object.getOwnPropertyDescriptor,ST=Object.getOwnPropertyNames,TT=Object.prototype.hasOwnProperty,Ip=(e,t)=>{for(var n in t)wc(e,n,{get:t[n],enumerable:!0})},CT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ST(t))!TT.call(e,o)&&o!==n&&wc(e,o,{get:()=>t[o],enumerable:!(r=wT(t,o))||r.enumerable});return e},ET=e=>CT(wc({},"__esModule",{value:!0}),e),_p={};Ip(_p,{Decimal:()=>IC,Public:()=>Mp,getRuntime:()=>LT,makeStrictEnum:()=>_T,objectEnumValues:()=>PT});Kp.exports=ET(_p);var Mp={};Ip(Mp,{validator:()=>kT});function kT(...e){return t=>t}var zi=Symbol(),fc=new WeakMap,AT=class{constructor(e){e===zi?fc.set(this,"Prisma.".concat(this._getName())):fc.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return fc.get(this)}},Sc=class extends AT{_getNamespace(){return"NullTypes"}},pc=class extends Sc{};Tc(pc,"DbNull");var mc=class extends Sc{};Tc(mc,"JsonNull");var gc=class extends Sc{};Tc(gc,"AnyNull");var PT={classes:{DbNull:pc,JsonNull:mc,AnyNull:gc},instances:{DbNull:new pc(zi),JsonNull:new mc(zi),AnyNull:new gc(zi)}};function Tc(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var IT=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function _T(e){return new Proxy(e,{get(t,n){if(n in t)return t[n];if(!IT.has(n))throw new TypeError("Invalid enum value: ".concat(String(n)))}})}var MT="Cloudflare-Workers",RT="node";function NT(){var e,t,n;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===MT?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((n=(t=globalThis.process)==null?void 0:t.release)==null?void 0:n.name)===RT?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var OT={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function LT(){let e=NT();return{id:e,prettyName:OT[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var wo=9e15,rr=1e9,hc="0123456789abcdef",Zi="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yi="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bc={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-wo,maxE:wo,crypto:!1},Rp,Nn,fe=!0,Ji="[DecimalError] ",nr=Ji+"Invalid argument: ",Np=Ji+"Precision limit exceeded",Op=Ji+"crypto unavailable",Lp="[object Decimal]",bt=Math.floor,nt=Math.pow,DT=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,BT=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,UT=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Dp=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qt=1e7,ce=7,FT=9007199254740991,$T=Zi.length-1,yc=Yi.length-1,D={toStringTag:Lp};D.absoluteValue=D.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ne(e)};D.ceil=function(){return ne(new this.constructor(this),this.e+1,2)};D.clampedTo=D.clamp=function(e,t){var n,r=this,o=r.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(nr+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new o(r)};D.comparedTo=D.cmp=function(e){var t,n,r,o,a=this,i=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!i||!s)return!c||!l?NaN:c!==l?c:i===s?0:!i^c<0?1:-1;if(!i[0]||!s[0])return i[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=i.length,o=s.length,t=0,n=r<o?r:o;t<n;++t)if(i[t]!==s[t])return i[t]>s[t]^c<0?1:-1;return r===o?0:r>o^c<0?1:-1};D.cosine=D.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+ce,r.rounding=1,n=GT(r,Gp(r,n)),r.precision=e,r.rounding=t,ne(Nn==2||Nn==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)};D.cubeRoot=D.cbrt=function(){var e,t,n,r,o,a,i,s,c,l,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(fe=!1,a=u.s*nt(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=ct(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?"0":"00"),a=nt(n,1/3),e=bt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n="5e"+e:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=u.s):r=new f(a.toString()),i=(e=f.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=Ue(l.plus(u).times(s),l.plus(c),i+2,1),ct(s.d).slice(0,i)===(n=ct(r.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!o&&n=="4999"){if(!o&&(ne(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}i+=4,o=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(ne(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return fe=!0,ne(r,e,f.rounding,t)};D.decimalPlaces=D.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-bt(this.e/ce))*ce,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n};D.dividedBy=D.div=function(e){return Ue(this,new this.constructor(e))};D.dividedToIntegerBy=D.divToInt=function(e){var t=this,n=t.constructor;return ne(Ue(t,new n(e),0,1,1),n.precision,n.rounding)};D.equals=D.eq=function(e){return this.cmp(e)===0};D.floor=function(){return ne(new this.constructor(this),this.e+1,3)};D.greaterThan=D.gt=function(e){return this.cmp(e)>0};D.greaterThanOrEqualTo=D.gte=function(e){var t=this.cmp(e);return t==1||t===0};D.hyperbolicCosine=D.cosh=function(){var e,t,n,r,o,a=this,i=a.constructor,s=new i(1);if(!a.isFinite())return new i(a.s?1/0:NaN);if(a.isZero())return s;n=i.precision,r=i.rounding,i.precision=n+Math.max(a.e,a.sd())+4,i.rounding=1,o=a.d.length,o<32?(e=Math.ceil(o/3),t=(1/Qi(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=So(i,1,a.times(t),new i(1),!0);for(var c,l=e,u=new i(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return ne(a,i.precision=n,i.rounding=r,!0)};D.hyperbolicSine=D.sinh=function(){var e,t,n,r,o=this,a=o.constructor;if(!o.isFinite()||o.isZero())return new a(o);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(o.e,o.sd())+4,a.rounding=1,r=o.d.length,r<3)o=So(a,2,o,o,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,o=o.times(1/Qi(5,e)),o=So(a,2,o,o,!0);for(var i,s=new a(5),c=new a(16),l=new a(20);e--;)i=o.times(o),o=o.times(s.plus(i.times(c.times(i).plus(l))))}return a.precision=t,a.rounding=n,ne(o,t,n,!0)};D.hyperbolicTangent=D.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,Ue(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)};D.inverseCosine=D.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),o=n.precision,a=n.rounding;return r!==-1?r===0?t.isNeg()?Xt(n,o,a):new n(0):new n(NaN):t.isZero()?Xt(n,o+4,a).times(.5):(n.precision=o+6,n.rounding=1,t=t.asin(),e=Xt(n,o+4,a).times(.5),n.precision=o,n.rounding=a,e.minus(t))};D.inverseHyperbolicCosine=D.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,fe=!1,n=n.times(n).minus(1).sqrt().plus(n),fe=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)};D.inverseHyperbolicSine=D.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,fe=!1,n=n.times(n).plus(1).sqrt().plus(n),fe=!0,r.precision=e,r.rounding=t,n.ln())};D.inverseHyperbolicTangent=D.atanh=function(){var e,t,n,r,o=this,a=o.constructor;return o.isFinite()?o.e>=0?new a(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=a.precision,t=a.rounding,r=o.sd(),Math.max(r,e)<2*-o.e-1?ne(new a(o),e,t,!0):(a.precision=n=r-o.e,o=Ue(o.plus(1),new a(1).minus(o),n+e,1),a.precision=e+4,a.rounding=1,o=o.ln(),a.precision=e,a.rounding=t,o.times(.5))):new a(NaN)};D.inverseSine=D.asin=function(){var e,t,n,r,o=this,a=o.constructor;return o.isZero()?new a(o):(t=o.abs().cmp(1),n=a.precision,r=a.rounding,t!==-1?t===0?(e=Xt(a,n+4,r).times(.5),e.s=o.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,o=o.div(new a(1).minus(o.times(o)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,o.times(2)))};D.inverseTangent=D.atan=function(){var e,t,n,r,o,a,i,s,c,l=this,u=l.constructor,f=u.precision,d=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&f+4<=yc)return i=Xt(u,f+4,d).times(.25),i.s=l.s,i}else{if(!l.s)return new u(NaN);if(f+4<=yc)return i=Xt(u,f+4,d).times(.5),i.s=l.s,i}for(u.precision=s=f+10,u.rounding=1,n=Math.min(28,s/ce+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(fe=!1,t=Math.ceil(s/ce),r=1,c=l.times(l),i=new u(l),o=l;e!==-1;)if(o=o.times(c),a=i.minus(o.div(r+=2)),o=o.times(c),i=a.plus(o.div(r+=2)),i.d[t]!==void 0)for(e=t;i.d[e]===a.d[e]&&e--;);return n&&(i=i.times(2<<n-1)),fe=!0,ne(i,u.precision=f,u.rounding=d,!0)};D.isFinite=function(){return!!this.d};D.isInteger=D.isInt=function(){return!!this.d&&bt(this.e/ce)>this.d.length-2};D.isNaN=function(){return!this.s};D.isNegative=D.isNeg=function(){return this.s<0};D.isPositive=D.isPos=function(){return this.s>0};D.isZero=function(){return!!this.d&&this.d[0]===0};D.lessThan=D.lt=function(e){return this.cmp(e)<0};D.lessThanOrEqualTo=D.lte=function(e){return this.cmp(e)<1};D.logarithm=D.log=function(e){var t,n,r,o,a,i,s,c,l=this,u=l.constructor,f=u.precision,d=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(o=n[0];o%10===0;)o/=10;a=o!==1}if(fe=!1,s=f+p,i=tr(l,s),r=t?qi(u,s+10):tr(e,s),c=Ue(i,r,s,1),va(c.d,o=f,d))do if(s+=10,i=tr(l,s),r=t?qi(u,s+10):tr(e,s),c=Ue(i,r,s,1),!a){+ct(c.d).slice(o+1,o+15)+1==1e14&&(c=ne(c,f+1,0));break}while(va(c.d,o+=10,d));return fe=!0,ne(c,f,d)};D.minus=D.sub=function(e){var t,n,r,o,a,i,s,c,l,u,f,d,p=this,h=p.constructor;if(e=new h(e),!p.d||!e.d)return!p.s||!e.s?e=new h(NaN):p.d?e.s=-e.s:e=new h(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,d=e.d,s=h.precision,c=h.rounding,!l[0]||!d[0]){if(d[0])e.s=-e.s;else if(l[0])e=new h(p);else return new h(c===3?-0:0);return fe?ne(e,s,c):e}if(n=bt(e.e/ce),u=bt(p.e/ce),l=l.slice(),a=u-n,a){for(f=a<0,f?(t=l,a=-a,i=d.length):(t=d,n=u,i=l.length),r=Math.max(Math.ceil(s/ce),i)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,i=d.length,f=r<i,f&&(i=r),r=0;r<i;r++)if(l[r]!=d[r]){f=l[r]<d[r];break}a=0}for(f&&(t=l,l=d,d=t,e.s=-e.s),i=l.length,r=d.length-i;r>0;--r)l[i++]=0;for(r=d.length;r>a;){if(l[--r]<d[r]){for(o=r;o&&l[--o]===0;)l[o]=Qt-1;--l[o],l[r]+=Qt}l[r]-=d[r]}for(;l[--i]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=Xi(l,n),fe?ne(e,s,c):e):new h(c===3?-0:0)};D.modulo=D.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?ne(new r(n),r.precision,r.rounding):(fe=!1,r.modulo==9?(t=Ue(n,e.abs(),0,3,1),t.s*=e.s):t=Ue(n,e,0,r.modulo,1),t=t.times(e),fe=!0,n.minus(t))};D.naturalExponential=D.exp=function(){return vc(this)};D.naturalLogarithm=D.ln=function(){return tr(this)};D.negated=D.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ne(e)};D.plus=D.add=function(e){var t,n,r,o,a,i,s,c,l,u,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,u=e.d,s=d.precision,c=d.rounding,!l[0]||!u[0])return u[0]||(e=new d(f)),fe?ne(e,s,c):e;if(a=bt(f.e/ce),r=bt(e.e/ce),l=l.slice(),o=a-r,o){for(o<0?(n=l,o=-o,i=u.length):(n=u,r=a,i=l.length),a=Math.ceil(s/ce),i=a>i?a+1:i+1,o>i&&(o=i,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(i=l.length,o=u.length,i-o<0&&(o=i,n=u,u=l,l=n),t=0;o;)t=(l[--o]=l[o]+u[o]+t)/Qt|0,l[o]%=Qt;for(t&&(l.unshift(t),++r),i=l.length;l[--i]==0;)l.pop();return e.d=l,e.e=Xi(l,r),fe?ne(e,s,c):e};D.precision=D.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(nr+e);return n.d?(t=Bp(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t};D.round=function(){var e=this,t=e.constructor;return ne(new t(e),e.e+1,t.rounding)};D.sine=D.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+ce,r.rounding=1,n=KT(r,Gp(r,n)),r.precision=e,r.rounding=t,ne(Nn>2?n.neg():n,e,t,!0)):new r(NaN)};D.squareRoot=D.sqrt=function(){var e,t,n,r,o,a,i=this,s=i.d,c=i.e,l=i.s,u=i.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?i:1/0);for(fe=!1,l=Math.sqrt(+i),l==0||l==1/0?(t=ct(s),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=bt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(Ue(i,a,n+2,1)).times(.5),ct(a.d).slice(0,n)===(t=ct(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!o&&t=="4999"){if(!o&&(ne(a,c+1,0),a.times(a).eq(i))){r=a;break}n+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(ne(r,c+1,1),e=!r.times(r).eq(i));break}return fe=!0,ne(r,c,u.rounding,e)};D.tangent=D.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=Ue(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,ne(Nn==2||Nn==4?n.neg():n,e,t,!0)):new r(NaN)};D.times=D.mul=function(e){var t,n,r,o,a,i,s,c,l,u=this,f=u.constructor,d=u.d,p=(e=new f(e)).d;if(e.s*=u.s,!d||!d[0]||!p||!p[0])return new f(!e.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?e.s/0:e.s*0);for(n=bt(u.e/ce)+bt(e.e/ce),c=d.length,l=p.length,c<l&&(a=d,d=p,p=a,i=c,c=l,l=i),a=[],i=c+l,r=i;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,o=c+r;o>r;)s=a[o]+p[r]*d[o-r-1]+t,a[o--]=s%Qt|0,t=s/Qt|0;a[o]=(a[o]+t)%Qt|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=Xi(a,n),fe?ne(e,f.precision,f.rounding):e};D.toBinary=function(e,t){return Cc(this,2,e,t)};D.toDecimalPlaces=D.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(It(e,0,rr),t===void 0?t=r.rounding:It(t,0,8),ne(n,e+n.e+1,t))};D.toExponential=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=hn(r,!0):(It(e,0,rr),t===void 0?t=o.rounding:It(t,0,8),r=ne(new o(r),e+1,t),n=hn(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};D.toFixed=function(e,t){var n,r,o=this,a=o.constructor;return e===void 0?n=hn(o):(It(e,0,rr),t===void 0?t=a.rounding:It(t,0,8),r=ne(new a(o),e+o.e+1,t),n=hn(r,!1,e+r.e+1)),o.isNeg()&&!o.isZero()?"-"+n:n};D.toFraction=function(e){var t,n,r,o,a,i,s,c,l,u,f,d,p=this,h=p.d,g=p.constructor;if(!h)return new g(p);if(l=n=new g(1),r=c=new g(0),t=new g(r),a=t.e=Bp(h)-p.e-1,i=a%ce,t.d[0]=nt(10,i<0?ce+i:i),e==null)e=a>0?t:l;else{if(s=new g(e),!s.isInt()||s.lt(l))throw Error(nr+s);e=s.gt(t)?a>0?t:l:s}for(fe=!1,s=new g(ct(h)),u=g.precision,g.precision=a=h.length*ce*2;f=Ue(s,t,0,1,1),o=n.plus(f.times(r)),o.cmp(e)!=1;)n=r,r=o,o=l,l=c.plus(f.times(o)),c=o,o=t,t=s.minus(f.times(o)),s=o;return o=Ue(e.minus(n),r,0,1,1),c=c.plus(o.times(l)),n=n.plus(o.times(r)),c.s=l.s=p.s,d=Ue(l,r,a,1).minus(p).abs().cmp(Ue(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],g.precision=u,fe=!0,d};D.toHexadecimal=D.toHex=function(e,t){return Cc(this,16,e,t)};D.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:It(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(fe=!1,n=Ue(n,e,0,t,1).times(e),fe=!0,ne(n)):(e.s=n.s,n=e),n};D.toNumber=function(){return+this};D.toOctal=function(e,t){return Cc(this,8,e,t)};D.toPower=D.pow=function(e){var t,n,r,o,a,i,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(nt(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return ne(s,r,a);if(t=bt(e.e/ce),t>=e.d.length-1&&(n=l<0?-l:l)<=FT)return o=Up(c,s,n,r),e.s<0?new c(1).div(o):ne(o,r,a);if(i=s.s,i<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(i=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=i,s}return n=nt(+s,l),t=n==0||!isFinite(n)?bt(l*(Math.log("0."+ct(s.d))/Math.LN10+s.e+1)):new c(n+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?i/0:0):(fe=!1,c.rounding=s.s=1,n=Math.min(12,(t+"").length),o=vc(e.times(tr(s,r+n)),r),o.d&&(o=ne(o,r+5,1),va(o.d,r,a)&&(t=r+10,o=ne(vc(e.times(tr(s,t+n)),t),t+5,1),+ct(o.d).slice(r+1,r+15)+1==1e14&&(o=ne(o,r+1,0)))),o.s=i,fe=!0,c.rounding=a,ne(o,r,a))};D.toPrecision=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=hn(r,r.e<=o.toExpNeg||r.e>=o.toExpPos):(It(e,1,rr),t===void 0?t=o.rounding:It(t,0,8),r=ne(new o(r),e,t),n=hn(r,e<=r.e||r.e<=o.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n};D.toSignificantDigits=D.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(It(e,1,rr),t===void 0?t=r.rounding:It(t,0,8)),ne(new r(n),e,t)};D.toString=function(){var e=this,t=e.constructor,n=hn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n};D.truncated=D.trunc=function(){return ne(new this.constructor(this),this.e+1,1)};D.valueOf=D.toJSON=function(){var e=this,t=e.constructor,n=hn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function ct(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)r=e[t]+"",n=ce-r.length,n&&(a+=er(n)),a+=r;i=e[t],r=i+"",n=ce-r.length,n&&(a+=er(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}function It(e,t,n){if(e!==~~e||e<t||e>n)throw Error(nr+e)}function va(e,t,n,r){var o,a,i,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=ce,o=0):(o=Math.ceil((t+1)/ce),t%=ce),a=nt(10,ce-t),s=e[o]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),i=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):i=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[o+1]/a/100|0)==nt(10,t-2)-1||(s==a/2||s==0)&&(e[o+1]/a/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),i=(r||n<4)&&s==9999||!r&&n>3&&s==4999):i=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[o+1]/a/1e3|0)==nt(10,t-3)-1,i}function Wi(e,t,n){for(var r,o=[0],a,i=0,s=e.length;i<s;){for(a=o.length;a--;)o[a]*=t;for(o[0]+=hc.indexOf(e.charAt(i++)),r=0;r<o.length;r++)o[r]>n-1&&(o[r+1]===void 0&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function GT(e,t){var n,r,o;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),o=(1/Qi(4,n)).toString()):(n=16,o="2.3283064365386962890625e-10"),e.precision+=n,t=So(e,1,t.times(o),new e(1));for(var a=n;a--;){var i=t.times(t);t=i.times(i).minus(i).times(8).plus(1)}return e.precision-=n,t}var Ue=function(){function e(r,o,a){var i,s=0,c=r.length;for(r=r.slice();c--;)i=r[c]*o+s,r[c]=i%a|0,s=i/a|0;return s&&r.unshift(s),r}function t(r,o,a,i){var s,c;if(a!=i)c=a>i?1:-1;else for(s=c=0;s<a;s++)if(r[s]!=o[s]){c=r[s]>o[s]?1:-1;break}return c}function n(r,o,a,i){for(var s=0;a--;)r[a]-=s,s=r[a]<o[a]?1:0,r[a]=s*i+r[a]-o[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,o,a,i,s,c){var l,u,f,d,p,h,g,y,b,T,S,k,I,$,O,Q,H,j,L,P,E=r.constructor,w=r.s==o.s?1:-1,N=r.d,_=o.d;if(!N||!N[0]||!_||!_[0])return new E(!r.s||!o.s||(N?_&&N[0]==_[0]:!_)?NaN:N&&N[0]==0||!_?w*0:w/0);for(c?(p=1,u=r.e-o.e):(c=Qt,p=ce,u=bt(r.e/p)-bt(o.e/p)),L=_.length,H=N.length,b=new E(w),T=b.d=[],f=0;_[f]==(N[f]||0);f++);if(_[f]>(N[f]||0)&&u--,a==null?($=a=E.precision,i=E.rounding):s?$=a+(r.e-o.e)+1:$=a,$<0)T.push(1),h=!0;else{if($=$/p+2|0,f=0,L==1){for(d=0,_=_[0],$++;(f<H||d)&&$--;f++)O=d*c+(N[f]||0),T[f]=O/_|0,d=O%_|0;h=d||f<H}else{for(d=c/(_[0]+1)|0,d>1&&(_=e(_,d,c),N=e(N,d,c),L=_.length,H=N.length),Q=L,S=N.slice(0,L),k=S.length;k<L;)S[k++]=0;P=_.slice(),P.unshift(0),j=_[0],_[1]>=c/2&&++j;do d=0,l=t(_,S,L,k),l<0?(I=S[0],L!=k&&(I=I*c+(S[1]||0)),d=I/j|0,d>1?(d>=c&&(d=c-1),g=e(_,d,c),y=g.length,k=S.length,l=t(g,S,y,k),l==1&&(d--,n(g,L<y?P:_,y,c))):(d==0&&(l=d=1),g=_.slice()),y=g.length,y<k&&g.unshift(0),n(S,g,k,c),l==-1&&(k=S.length,l=t(_,S,L,k),l<1&&(d++,n(S,L<k?P:_,k,c))),k=S.length):l===0&&(d++,S=[0]),T[f++]=d,l&&S[0]?S[k++]=N[Q]||0:(S=[N[Q]],k=1);while((Q++<H||S[0]!==void 0)&&$--);h=S[0]!==void 0}T[0]||T.shift()}if(p==1)b.e=u,Rp=h;else{for(f=1,d=T[0];d>=10;d/=10)f++;b.e=f+u*p-1,ne(b,s?a+b.e+1:a,i,h)}return b}}();function ne(e,t,n,r){var o,a,i,s,c,l,u,f,d,p=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(o=1,s=f[0];s>=10;s/=10)o++;if(a=t-o,a<0)a+=ce,i=t,u=f[d=0],c=u/nt(10,o-i-1)%10|0;else if(d=Math.ceil((a+1)/ce),s=f.length,d>=s)if(r){for(;s++<=d;)f.push(0);u=c=0,o=1,a%=ce,i=a-ce+1}else break e;else{for(u=s=f[d],o=1;s>=10;s/=10)o++;a%=ce,i=a-ce+o,c=i<0?0:u/nt(10,o-i-1)%10|0}if(r=r||t<0||f[d+1]!==void 0||(i<0?u:u%nt(10,o-i-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?i>0?u/nt(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=nt(10,(ce-t%ce)%ce),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=d,s=1,d--):(f.length=d+1,s=nt(10,ce-a),f[d]=i>0?(u/nt(10,o-i)%nt(10,i)|0)*s:0),l)for(;;)if(d==0){for(a=1,i=f[0];i>=10;i/=10)a++;for(i=f[0]+=s,s=1;i>=10;i/=10)s++;a!=s&&(e.e++,f[0]==Qt&&(f[0]=1));break}else{if(f[d]+=s,f[d]!=Qt)break;f[d--]=0,s=1}for(a=f.length;f[--a]===0;)f.pop()}return fe&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function hn(e,t,n){if(!e.isFinite())return $p(e);var r,o=e.e,a=ct(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+er(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):o<0?(a="0."+er(-o-1)+a,n&&(r=n-i)>0&&(a+=er(r))):o>=i?(a+=er(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+er(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=er(r))),a}function Xi(e,t){var n=e[0];for(t*=ce;n>=10;n/=10)t++;return t}function qi(e,t,n){if(t>$T)throw fe=!0,n&&(e.precision=n),Error(Np);return ne(new e(Zi),t,1,!0)}function Xt(e,t,n){if(t>yc)throw Error(Np);return ne(new e(Yi),t,n,!0)}function Bp(e){var t=e.length-1,n=t*ce+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function er(e){for(var t="";e--;)t+="0";return t}function Up(e,t,n,r){var o,a=new e(1),i=Math.ceil(r/ce+4);for(fe=!1;;){if(n%2&&(a=a.times(t),Ap(a.d,i)&&(o=!0)),n=bt(n/2),n===0){n=a.d.length-1,o&&a.d[n]===0&&++a.d[n];break}t=t.times(t),Ap(t.d,i)}return fe=!0,a}function kp(e){return e.d[e.d.length-1]&1}function Fp(e,t,n){for(var r,o=new e(t[0]),a=0;++a<t.length;)if(r=new e(t[a]),r.s)o[n](r)&&(o=r);else{o=r;break}return o}function vc(e,t){var n,r,o,a,i,s,c,l=0,u=0,f=0,d=e.constructor,p=d.rounding,h=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(fe=!1,c=h):c=t,s=new d(.03125);e.e>-2;)e=e.times(s),f+=5;for(r=Math.log(nt(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new d(1),d.precision=c;;){if(a=ne(a.times(e),c,1),n=n.times(++u),s=i.plus(Ue(a,n,c,1)),ct(s.d).slice(0,c)===ct(i.d).slice(0,c)){for(o=f;o--;)i=ne(i.times(i),c,1);if(t==null)if(l<3&&va(i.d,c-r,p,l))d.precision=c+=10,n=a=s=new d(1),u=0,l++;else return ne(i,d.precision=h,p,fe=!0);else return d.precision=h,i}i=s}}function tr(e,t){var n,r,o,a,i,s,c,l,u,f,d,p=1,h=10,g=e,y=g.d,b=g.constructor,T=b.rounding,S=b.precision;if(g.s<0||!y||!y[0]||!g.e&&y[0]==1&&y.length==1)return new b(y&&!y[0]?-1/0:g.s!=1?NaN:y?0:g);if(t==null?(fe=!1,u=S):u=t,b.precision=u+=h,n=ct(y),r=n.charAt(0),Math.abs(a=g.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ct(g.d),r=n.charAt(0),p++;a=g.e,r>1?(g=new b("0."+n),a++):g=new b(r+"."+n.slice(1))}else return l=qi(b,u+2,S).times(a+""),g=tr(new b(r+"."+n.slice(1)),u-h).plus(l),b.precision=S,t==null?ne(g,S,T,fe=!0):g;for(f=g,c=i=g=Ue(g.minus(1),g.plus(1),u,1),d=ne(g.times(g),u,1),o=3;;){if(i=ne(i.times(d),u,1),l=c.plus(Ue(i,new b(o),u,1)),ct(l.d).slice(0,u)===ct(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(qi(b,u+2,S).times(a+""))),c=Ue(c,new b(p),u,1),t==null)if(va(c.d,u-h,T,s))b.precision=u+=h,l=i=g=Ue(f.minus(1),f.plus(1),u,1),d=ne(g.times(g),u,1),o=s=1;else return ne(c,b.precision=S,T,fe=!0);else return b.precision=S,c;c=l,o+=2}}function $p(e){return String(e.s*e.s/0)}function xc(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(r,o),t){if(o-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%ce,n<0&&(r+=ce),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=ce;r<o;)e.d.push(+t.slice(r,r+=ce));t=t.slice(r),r=ce-t.length}else r-=o;for(;r--;)t+="0";e.d.push(+t),fe&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function HT(e,t){var n,r,o,a,i,s,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Dp.test(t))return xc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(BT.test(t))n=16,t=t.toLowerCase();else if(DT.test(t))n=2;else if(UT.test(t))n=8;else throw Error(nr+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),i=a>=0,r=e.constructor,i&&(t=t.replace(".",""),s=t.length,a=s-a,o=Up(r,new r(n),a,a*2)),l=Wi(t,n,Qt),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=Xi(l,u),e.d=l,fe=!1,i&&(e=Ue(e,o,s*4)),c&&(e=e.times(Math.abs(c)<54?nt(2,c):xa.pow(2,c))),fe=!0,e)}function KT(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:So(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/Qi(5,n)),t=So(e,2,t,t);for(var o,a=new e(5),i=new e(16),s=new e(20);n--;)o=t.times(t),t=t.times(a.plus(o.times(i.times(o).minus(s))));return t}function So(e,t,n,r,o){var a,i,s,c,l=1,u=e.precision,f=Math.ceil(u/ce);for(fe=!1,c=n.times(n),s=new e(r);;){if(i=Ue(s.times(c),new e(t++*t++),u,1),s=o?r.plus(i):r.minus(i),r=Ue(i.times(c),new e(t++*t++),u,1),i=s.plus(r),i.d[f]!==void 0){for(a=f;i.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=i,i=a,l++}return fe=!0,i.d.length=f+1,i}function Qi(e,t){for(var n=e;--t;)n*=e;return n}function Gp(e,t){var n,r=t.s<0,o=Xt(e,e.precision,1),a=o.times(.5);if(t=t.abs(),t.lte(a))return Nn=r?4:1,t;if(n=t.divToInt(o),n.isZero())Nn=r?3:2;else{if(t=t.minus(n.times(o)),t.lte(a))return Nn=kp(n)?r?2:3:r?4:1,t;Nn=kp(n)?r?1:4:r?3:2}return t.minus(o).abs()}function Cc(e,t,n,r){var o,a,i,s,c,l,u,f,d,p=e.constructor,h=n!==void 0;if(h?(It(n,1,rr),r===void 0?r=p.rounding:It(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=$p(e);else{for(u=hn(e),i=u.indexOf("."),h?(o=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):o=t,i>=0&&(u=u.replace(".",""),d=new p(1),d.e=u.length-i,d.d=Wi(hn(d),10,o),d.e=d.d.length),f=Wi(u,10,o),a=c=f.length;f[--c]==0;)f.pop();if(!f[0])u=h?"0p+0":"0";else{if(i<0?a--:(e=new p(e),e.d=f,e.e=a,e=Ue(e,d,n,r,0,o),f=e.d,a=e.e,l=Rp),i=f[n],s=o/2,l=l||f[n+1]!==void 0,l=r<4?(i!==void 0||l)&&(r===0||r===(e.s<0?3:2)):i>s||i===s&&(r===4||l||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,l)for(;++f[--n]>o-1;)f[n]=0,n||(++a,f.unshift(1));for(c=f.length;!f[c-1];--c);for(i=0,u="";i<c;i++)u+=hc.charAt(f[i]);if(h){if(c>1)if(t==16||t==8){for(i=t==16?4:3,--c;c%i;c++)u+="0";for(f=Wi(u,o,t),c=f.length;!f[c-1];--c);for(i=1,u="1.";i<c;i++)u+=hc.charAt(f[i])}else u=u.charAt(0)+"."+u.slice(1);u=u+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)u="0"+u;u="0."+u}else if(++a>c)for(a-=c;a--;)u+="0";else a<c&&(u=u.slice(0,a)+"."+u.slice(a))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Ap(e,t){if(e.length>t)return e.length=t,!0}function VT(e){return new this(e).abs()}function jT(e){return new this(e).acos()}function zT(e){return new this(e).acosh()}function WT(e,t){return new this(e).plus(t)}function ZT(e){return new this(e).asin()}function YT(e){return new this(e).asinh()}function qT(e){return new this(e).atan()}function JT(e){return new this(e).atanh()}function XT(e,t){e=new this(e),t=new this(t);var n,r=this.precision,o=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Xt(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Xt(this,r,o):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Xt(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(Ue(e,t,a,1)),t=Xt(this,a,1),this.precision=r,this.rounding=o,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Ue(e,t,a,1)),n}function QT(e){return new this(e).cbrt()}function eC(e){return ne(e=new this(e),e.e+1,2)}function tC(e,t,n){return new this(e).clamp(t,n)}function nC(e){if(!e||typeof e!="object")throw Error(Ji+"Object expected");var t,n,r,o=e.defaults===!0,a=["precision",1,rr,"rounding",0,8,"toExpNeg",-wo,0,"toExpPos",0,wo,"maxE",0,wo,"minE",-wo,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],o&&(this[n]=bc[n]),(r=e[n])!==void 0)if(bt(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(nr+n+": "+r);if(n="crypto",o&&(this[n]=bc[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Op);else this[n]=!1;else throw Error(nr+n+": "+r);return this}function rC(e){return new this(e).cos()}function oC(e){return new this(e).cosh()}function Hp(e){var t,n,r;function o(a){var i,s,c,l=this;if(!(l instanceof o))return new o(a);if(l.constructor=o,Pp(a)){l.s=a.s,fe?!a.d||a.e>o.maxE?(l.e=NaN,l.d=null):a.e<o.minE?(l.e=0,l.d=[0]):(l.e=a.e,l.d=a.d.slice()):(l.e=a.e,l.d=a.d?a.d.slice():a.d);return}if(c=typeof a,c==="number"){if(a===0){l.s=1/a<0?-1:1,l.e=0,l.d=[0];return}if(a<0?(a=-a,l.s=-1):l.s=1,a===~~a&&a<1e7){for(i=0,s=a;s>=10;s/=10)i++;fe?i>o.maxE?(l.e=NaN,l.d=null):i<o.minE?(l.e=0,l.d=[0]):(l.e=i,l.d=[a]):(l.e=i,l.d=[a]);return}else if(a*0!==0){a||(l.s=NaN),l.e=NaN,l.d=null;return}return xc(l,a.toString())}else if(c!=="string")throw Error(nr+a);return(s=a.charCodeAt(0))===45?(a=a.slice(1),l.s=-1):(s===43&&(a=a.slice(1)),l.s=1),Dp.test(a)?xc(l,a):HT(l,a)}if(o.prototype=D,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=nC,o.clone=Hp,o.isDecimal=Pp,o.abs=VT,o.acos=jT,o.acosh=zT,o.add=WT,o.asin=ZT,o.asinh=YT,o.atan=qT,o.atanh=JT,o.atan2=XT,o.cbrt=QT,o.ceil=eC,o.clamp=tC,o.cos=rC,o.cosh=oC,o.div=aC,o.exp=iC,o.floor=sC,o.hypot=lC,o.ln=cC,o.log=uC,o.log10=fC,o.log2=dC,o.max=pC,o.min=mC,o.mod=gC,o.mul=hC,o.pow=bC,o.random=yC,o.round=vC,o.sign=xC,o.sin=wC,o.sinh=SC,o.sqrt=TC,o.sub=CC,o.sum=EC,o.tan=kC,o.tanh=AC,o.trunc=PC,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return o.config(e),o}function aC(e,t){return new this(e).div(t)}function iC(e){return new this(e).exp()}function sC(e){return ne(e=new this(e),e.e+1,3)}function lC(){var e,t,n=new this(0);for(fe=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return fe=!0,new this(1/0);n=t}return fe=!0,n.sqrt()}function Pp(e){return e instanceof xa||e&&e.toStringTag===Lp||!1}function cC(e){return new this(e).ln()}function uC(e,t){return new this(e).log(t)}function dC(e){return new this(e).log(2)}function fC(e){return new this(e).log(10)}function pC(){return Fp(this,arguments,"lt")}function mC(){return Fp(this,arguments,"gt")}function gC(e,t){return new this(e).mod(t)}function hC(e,t){return new this(e).mul(t)}function bC(e,t){return new this(e).pow(t)}function yC(e){var t,n,r,o,a=0,i=new this(1),s=[];if(e===void 0?e=this.precision:It(e,1,rr),r=Math.ceil(e/ce),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)o=t[a],o>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)o=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(o%1e7),a+=4);a=r/4}else throw Error(Op);else for(;a<r;)s[a++]=Math.random()*1e7|0;for(r=s[--a],e%=ce,r&&e&&(o=nt(10,ce-e),s[a]=(r/o|0)*o);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=ce)s.shift();for(r=1,o=s[0];o>=10;o/=10)r++;r<ce&&(n-=ce-r)}return i.e=n,i.d=s,i}function vC(e){return ne(e=new this(e),e.e+1,this.rounding)}function xC(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function wC(e){return new this(e).sin()}function SC(e){return new this(e).sinh()}function TC(e){return new this(e).sqrt()}function CC(e,t){return new this(e).sub(t)}function EC(){var e=0,t=arguments,n=new this(t[e]);for(fe=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return fe=!0,ne(n,this.precision,this.rounding)}function kC(e){return new this(e).tan()}function AC(e){return new this(e).tanh()}function PC(e){return ne(e=new this(e),e.e+1,1)}D[Symbol.for("nodejs.util.inspect.custom")]=D.toString;D[Symbol.toStringTag]="Decimal";var xa=D.constructor=Hp(bc);Zi=new xa(Zi);Yi=new xa(Yi);var IC=xa;});var jp=Be(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});var{Decimal:_C,objectEnumValues:To,makeStrictEnum:MC,Public:RC,getRuntime:Dt}=Vp(),Fe={};se.Prisma=Fe;se.$Enums={};Fe.prismaVersion={client:"5.12.1",engine:"473ed3124229e22d881cb7addf559799debae1ab"};Fe.PrismaClientKnownRequestError=()=>{let e=Dt().prettyName;throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
3
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.PrismaClientUnknownRequestError=()=>{let e=Dt().prettyName;throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
4
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.PrismaClientRustPanicError=()=>{let e=Dt().prettyName;throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
5
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.PrismaClientInitializationError=()=>{let e=Dt().prettyName;throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
6
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.PrismaClientValidationError=()=>{let e=Dt().prettyName;throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
7
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.NotFoundError=()=>{let e=Dt().prettyName;throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
8
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.Decimal=_C;Fe.sql=()=>{let e=Dt().prettyName;throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
9
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.empty=()=>{let e=Dt().prettyName;throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
10
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.join=()=>{let e=Dt().prettyName;throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
11
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.raw=()=>{let e=Dt().prettyName;throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
12
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.validator=RC.validator;Fe.getExtensionContext=()=>{let e=Dt().prettyName;throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
13
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.defineExtension=()=>{let e=Dt().prettyName;throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
|
|
14
|
-
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)};Fe.DbNull=To.instances.DbNull;Fe.JsonNull=To.instances.JsonNull;Fe.AnyNull=To.instances.AnyNull;Fe.NullTypes={DbNull:To.classes.DbNull,JsonNull:To.classes.JsonNull,AnyNull:To.classes.AnyNull};se.Prisma.TransactionIsolationLevel=MC({ReadUncommitted:"ReadUncommitted",ReadCommitted:"ReadCommitted",RepeatableRead:"RepeatableRead",Serializable:"Serializable"});se.Prisma.AccountScalarFieldEnum={id:"id",userId:"userId",type:"type",provider:"provider",providerAccountId:"providerAccountId",refresh_token:"refresh_token",access_token:"access_token",expires_at:"expires_at",token_type:"token_type",scope:"scope",id_token:"id_token",session_state:"session_state",oauth_token_secret:"oauth_token_secret",oauth_token:"oauth_token",refresh_token_expires_in:"refresh_token_expires_in"};se.Prisma.SessionScalarFieldEnum={id:"id",sessionToken:"sessionToken",userId:"userId",expires:"expires"};se.Prisma.UserScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",lastActivityAt:"lastActivityAt",name:"name",email:"email",emailVerified:"emailVerified",defaultWorkspace:"defaultWorkspace",image:"image",company:"company",onboardingCategories:"onboardingCategories",referral:"referral",graphNavigation:"graphNavigation",preferredAppAppearance:"preferredAppAppearance",displayedInAppNotifications:"displayedInAppNotifications",notificationAgentUsageSummary:"notificationAgentUsageSummary",notificationDomainConfigurationUpdates:"notificationDomainConfigurationUpdates",notificationAgentUsageLimit:"notificationAgentUsageLimit",notificationSubscribed:"notificationSubscribed"};se.Prisma.ApiTokenScalarFieldEnum={id:"id",createdAt:"createdAt",token:"token",name:"name",ownerId:"ownerId"};se.Prisma.WorkspaceScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",lastActivityAt:"lastActivityAt",name:"name",icon:"icon",slug:"slug",plan:"plan",stripeId:"stripeId",chatsLimitFirstEmailSentAt:"chatsLimitFirstEmailSentAt",storageLimitFirstEmailSentAt:"storageLimitFirstEmailSentAt",chatsLimitSecondEmailSentAt:"chatsLimitSecondEmailSentAt",storageLimitSecondEmailSentAt:"storageLimitSecondEmailSentAt",isQuarantined:"isQuarantined",isSuspended:"isSuspended",isPastDue:"isPastDue",isVerified:"isVerified",chatUsage:"chatUsage",billingCycleStart:"billingCycleStart",paymentFailedAt:"paymentFailedAt",stripeConnectId:"stripeConnectId",redeemedCoupons:"redeemedCoupons"};se.Prisma.MemberInWorkspaceScalarFieldEnum={createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId",workspaceId:"workspaceId",role:"role"};se.Prisma.WorkspaceInvitationScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",email:"email",workspaceId:"workspaceId",type:"type"};se.Prisma.CustomDomainScalarFieldEnum={name:"name",createdAt:"createdAt",workspaceId:"workspaceId"};se.Prisma.CredentialsScalarFieldEnum={id:"id",createdAt:"createdAt",workspaceId:"workspaceId",data:"data",name:"name",type:"type",iv:"iv"};se.Prisma.VerificationTokenScalarFieldEnum={identifier:"identifier",token:"token",expires:"expires"};se.Prisma.AgentScalarFieldEnum={id:"id",version:"version",createdAt:"createdAt",updatedAt:"updatedAt",icon:"icon",name:"name",groups:"groups",events:"events",variables:"variables",edges:"edges",theme:"theme",selectedThemeTemplateId:"selectedThemeTemplateId",settings:"settings",publicId:"publicId",customDomain:"customDomain",workspaceId:"workspaceId",resultsTablePreferences:"resultsTablePreferences",isPublished:"isPublished",isArchived:"isArchived",isClosed:"isClosed",whatsAppCredentialsId:"whatsAppCredentialsId",riskLevel:"riskLevel",domainId:"domainId",url:"url",description:"description"};se.Prisma.PublicAgentScalarFieldEnum={id:"id",version:"version",name:"name",createdAt:"createdAt",updatedAt:"updatedAt",agentId:"agentId",domainId:"domainId",publicId:"publicId",workspaceId:"workspaceId",domain:"domain",url:"url",groups:"groups",events:"events",variables:"variables",edges:"edges",theme:"theme",settings:"settings"};se.Prisma.TagScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",name:"name",color:"color",workspaceId:"workspaceId"};se.Prisma.AgentTagScalarFieldEnum={agentId:"agentId",tagId:"tagId"};se.Prisma.InvitationScalarFieldEnum={createdAt:"createdAt",updatedAt:"updatedAt",email:"email",agentId:"agentId",type:"type"};se.Prisma.CollaboratorsOnAgentsScalarFieldEnum={createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId",agentId:"agentId",type:"type"};se.Prisma.ResultScalarFieldEnum={id:"id",createdAt:"createdAt",agentId:"agentId",variables:"variables",isCompleted:"isCompleted",hasStarted:"hasStarted",isArchived:"isArchived",lastChatSessionId:"lastChatSessionId"};se.Prisma.SetVariableHistoryItemScalarFieldEnum={resultId:"resultId",index:"index",variableId:"variableId",blockId:"blockId",value:"value"};se.Prisma.VisitedEdgeScalarFieldEnum={resultId:"resultId",edgeId:"edgeId",index:"index"};se.Prisma.LogScalarFieldEnum={id:"id",createdAt:"createdAt",resultId:"resultId",status:"status",description:"description",details:"details"};se.Prisma.AnswerScalarFieldEnum={createdAt:"createdAt",resultId:"resultId",blockId:"blockId",groupId:"groupId",variableId:"variableId",content:"content"};se.Prisma.AnswerV2ScalarFieldEnum={id:"id",createdAt:"createdAt",resultId:"resultId",blockId:"blockId",content:"content",attachedFileUrls:"attachedFileUrls"};se.Prisma.CouponScalarFieldEnum={userPropertiesToUpdate:"userPropertiesToUpdate",code:"code",dateRedeemed:"dateRedeemed"};se.Prisma.WebhookScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",url:"url",method:"method",queryParams:"queryParams",headers:"headers",body:"body",agentId:"agentId"};se.Prisma.ClaimableCustomPlanScalarFieldEnum={id:"id",createdAt:"createdAt",claimedAt:"claimedAt",name:"name",description:"description",price:"price",currency:"currency",workspaceId:"workspaceId",chatsLimit:"chatsLimit",storageLimit:"storageLimit",seatsLimit:"seatsLimit",isYearly:"isYearly",companyName:"companyName",vatType:"vatType",vatValue:"vatValue"};se.Prisma.ChatSessionScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",state:"state",isReplying:"isReplying"};se.Prisma.ThemeTemplateScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",name:"name",theme:"theme",workspaceId:"workspaceId"};se.Prisma.BannedIpScalarFieldEnum={id:"id",createdAt:"createdAt",ip:"ip",responsibleAgentId:"responsibleAgentId",userId:"userId"};se.Prisma.DomainScalarFieldEnum={id:"id",slug:"slug",verified:"verified",placeholder:"placeholder",expiredUrl:"expiredUrl",notFoundUrl:"notFoundUrl",primary:"primary",archived:"archived",lastChecked:"lastChecked",logo:"logo",workspaceId:"workspaceId",createdAt:"createdAt",updatedAt:"updatedAt"};se.Prisma.RegisteredDomainScalarFieldEnum={id:"id",slug:"slug",createdAt:"createdAt",updatedAt:"updatedAt",expiresAt:"expiresAt",workspaceId:"workspaceId",domainId:"domainId"};se.Prisma.SortOrder={asc:"asc",desc:"desc"};se.Prisma.JsonNullValueInput={JsonNull:Fe.JsonNull};se.Prisma.NullableJsonNullValueInput={DbNull:Fe.DbNull,JsonNull:Fe.JsonNull};se.Prisma.QueryMode={default:"default",insensitive:"insensitive"};se.Prisma.NullsOrder={first:"first",last:"last"};se.Prisma.JsonNullValueFilter={DbNull:Fe.DbNull,JsonNull:Fe.JsonNull,AnyNull:Fe.AnyNull};se.GraphNavigation=se.$Enums.GraphNavigation={MOUSE:"MOUSE",TRACKPAD:"TRACKPAD"};se.Plan=se.$Enums.Plan={HOBBY:"HOBBY",PRO:"PRO",BUSINESS:"BUSINESS",ADVANCED:"ADVANCED",ENTERPRISE:"ENTERPRISE",CUSTOM_APPSUMO_TIER1:"CUSTOM_APPSUMO_TIER1",CUSTOM_APPSUMO_TIER2:"CUSTOM_APPSUMO_TIER2",CUSTOM_APPSUMO_TIER3:"CUSTOM_APPSUMO_TIER3",CUSTOM_APPSUMO_TIER4:"CUSTOM_APPSUMO_TIER4",CUSTOM_APPSUMO_TIER5:"CUSTOM_APPSUMO_TIER5"};se.WorkspaceRole=se.$Enums.WorkspaceRole={ADMIN:"ADMIN",MEMBER:"MEMBER",GUEST:"GUEST"};se.CollaborationType=se.$Enums.CollaborationType={READ:"READ",WRITE:"WRITE",FULL_ACCESS:"FULL_ACCESS"};se.Prisma.ModelName={Account:"Account",Session:"Session",User:"User",ApiToken:"ApiToken",Workspace:"Workspace",MemberInWorkspace:"MemberInWorkspace",WorkspaceInvitation:"WorkspaceInvitation",CustomDomain:"CustomDomain",Credentials:"Credentials",VerificationToken:"VerificationToken",Agent:"Agent",PublicAgent:"PublicAgent",Tag:"Tag",AgentTag:"AgentTag",Invitation:"Invitation",CollaboratorsOnAgents:"CollaboratorsOnAgents",Result:"Result",SetVariableHistoryItem:"SetVariableHistoryItem",VisitedEdge:"VisitedEdge",Log:"Log",Answer:"Answer",AnswerV2:"AnswerV2",Coupon:"Coupon",Webhook:"Webhook",ClaimableCustomPlan:"ClaimableCustomPlan",ChatSession:"ChatSession",ThemeTemplate:"ThemeTemplate",BannedIp:"BannedIp",Domain:"Domain",RegisteredDomain:"RegisteredDomain"};var Ec=class{constructor(){return new Proxy(this,{get(t,n){let r,o=Dt();throw o.isEdge?r=`PrismaClient is not configured to run in ${o.prettyName}. In order to run Prisma Client on edge runtime, either:
|
|
15
|
-
- Use Prisma Accelerate: https://pris.ly/d/accelerate
|
|
16
|
-
- Use Driver Adapters: https://pris.ly/d/driver-adapters
|
|
17
|
-
`:r="PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `"+o.prettyName+"`).",r+=`
|
|
18
|
-
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`,new Error(r)}})}};se.PrismaClient=Ec;Object.assign(se,Fe)});var Wp=Be((oN,zp)=>{"use strict";var NC=jp();zp.exports=NC});var Fy=Be((jB,zo)=>{"use strict";var HA=typeof Buffer<"u",Ly=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Dy=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function By(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),HA&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;let o=n&&n.protoAction||"error",a=n&&n.constructorAction||"error";if(o==="ignore"&&a==="ignore")return r;if(o!=="ignore"&&a!=="ignore"){if(Ly.test(e)===!1&&Dy.test(e)===!1)return r}else if(o!=="ignore"&&a==="ignore"){if(Ly.test(e)===!1)return r}else if(Dy.test(e)===!1)return r;return Uy(r,{protoAction:o,constructorAction:a,safe:n&&n.safe})}function Uy(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){let a=o;o=[];for(let i of a){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(let s in i){let c=i[s];c&&typeof c=="object"&&o.push(c)}}}return e}function yu(e,t,n){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return By(e,t,n)}finally{Error.stackTraceLimit=r}}function KA(e,t){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return By(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}zo.exports=yu;zo.exports.default=yu;zo.exports.parse=yu;zo.exports.safeParse=KA;zo.exports.scan=Uy});var x0=Be(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});function nl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nl=function(t){return typeof t}:nl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}var y0="https://js.stripe.com/v3",YP=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,h0="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",qP=function(){for(var t=document.querySelectorAll('script[src^="'.concat(y0,'"]')),n=0;n<t.length;n++){var r=t[n];if(YP.test(r.src))return r}return null},JP=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(y0).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(r),r},XP=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:n})},tl=null,QP=function(t){return tl!==null||(tl=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(h0),window.Stripe){n(window.Stripe);return}try{var o=qP();o&&t?console.warn(h0):o||(o=JP(t)),o.addEventListener("load",function(){window.Stripe?n(window.Stripe):r(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){r(new Error("Failed to load Stripe.js"))})}catch(a){r(a);return}})),tl},eI=function(t,n,r){if(t===null)return null;var o=t.apply(void 0,n);return XP(o,r),o},b0=function(t){var n=`invalid load parameters; expected object of shape
|
|
1
|
+
// Release0 v1.1.4
|
|
2
|
+
var Fv=Object.create;var na=Object.defineProperty;var Uv=Object.getOwnPropertyDescriptor;var jv=Object.getOwnPropertyNames;var Vv=Object.getPrototypeOf,Hv=Object.prototype.hasOwnProperty;var zv=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gv=(e,t)=>{for(var n in t)na(e,n,{get:t[n],enumerable:!0})},Gu=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jv(t))!Hv.call(e,o)&&o!==n&&na(e,o,{get:()=>t[o],enumerable:!(r=Uv(t,o))||r.enumerable});return e};var Fr=(e,t,n)=>(n=e!=null?Fv(Vv(e)):{},Gu(t||!e||!e.__esModule?na(n,"default",{value:e,enumerable:!0}):n,e)),ra=e=>Gu(na({},"__esModule",{value:!0}),e);var ef=Ne(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.toBig=ce.shrSL=ce.shrSH=ce.rotrSL=ce.rotrSH=ce.rotrBL=ce.rotrBH=ce.rotr32L=ce.rotr32H=ce.rotlSL=ce.rotlSH=ce.rotlBL=ce.rotlBH=ce.add5L=ce.add5H=ce.add4L=ce.add4H=ce.add3L=ce.add3H=void 0;ce.add=qd;ce.fromBig=_l;ce.split=Md;var ga=BigInt(2**32-1),Cl=BigInt(32);function _l(e,t=!1){return t?{h:Number(e&ga),l:Number(e>>Cl&ga)}:{h:Number(e>>Cl&ga)|0,l:Number(e&ga)|0}}function Md(e,t=!1){let n=e.length,r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){let{h:a,l:s}=_l(e[i],t);[r[i],o[i]]=[a,s]}return[r,o]}var Dd=(e,t)=>BigInt(e>>>0)<<Cl|BigInt(t>>>0);ce.toBig=Dd;var Ld=(e,t,n)=>e>>>n;ce.shrSH=Ld;var Nd=(e,t,n)=>e<<32-n|t>>>n;ce.shrSL=Nd;var $d=(e,t,n)=>e>>>n|t<<32-n;ce.rotrSH=$d;var Bd=(e,t,n)=>e<<32-n|t>>>n;ce.rotrSL=Bd;var Fd=(e,t,n)=>e<<64-n|t>>>n-32;ce.rotrBH=Fd;var Ud=(e,t,n)=>e>>>n-32|t<<64-n;ce.rotrBL=Ud;var jd=(e,t)=>t;ce.rotr32H=jd;var Vd=(e,t)=>e;ce.rotr32L=Vd;var Hd=(e,t,n)=>e<<n|t>>>32-n;ce.rotlSH=Hd;var zd=(e,t,n)=>t<<n|e>>>32-n;ce.rotlSL=zd;var Gd=(e,t,n)=>t<<n-32|e>>>64-n;ce.rotlBH=Gd;var Wd=(e,t,n)=>e<<n-32|t>>>64-n;ce.rotlBL=Wd;function qd(e,t,n,r){let o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}var Kd=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);ce.add3L=Kd;var Yd=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;ce.add3H=Yd;var Xd=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);ce.add4L=Xd;var Zd=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;ce.add4H=Zd;var Jd=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);ce.add5L=Jd;var Qd=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0;ce.add5H=Qd;var p0={fromBig:_l,split:Md,toBig:Dd,shrSH:Ld,shrSL:Nd,rotrSH:$d,rotrSL:Bd,rotrBH:Fd,rotrBL:Ud,rotr32H:jd,rotr32L:Vd,rotlSH:Hd,rotlSL:zd,rotlBH:Gd,rotlBL:Wd,add:qd,add3L:Kd,add3H:Yd,add4L:Xd,add4H:Zd,add5H:Qd,add5L:Jd};ce.default=p0});var tf=Ne(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.crypto=void 0;ha.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var uf=Ne(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.wrapXOFConstructorWithOpts=ie.wrapConstructorWithOpts=ie.wrapConstructor=ie.Hash=ie.nextTick=ie.swap32IfBE=ie.byteSwapIfBE=ie.swap8IfBE=ie.isLE=void 0;ie.isBytes=rf;ie.anumber=kl;ie.abytes=Yr;ie.ahash=m0;ie.aexists=g0;ie.aoutput=h0;ie.u8=b0;ie.u32=y0;ie.clean=x0;ie.createView=v0;ie.rotr=w0;ie.rotl=S0;ie.byteSwap=Pl;ie.byteSwap32=of;ie.bytesToHex=C0;ie.hexToBytes=_0;ie.asyncLoop=E0;ie.utf8ToBytes=Il;ie.bytesToUtf8=P0;ie.toBytes=ba;ie.kdfInputToBytes=I0;ie.concatBytes=A0;ie.checkOpts=O0;ie.createHasher=sf;ie.createOptHasher=lf;ie.createXOFer=cf;ie.randomBytes=R0;var Kr=tf();function rf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function kl(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Yr(e,...t){if(!rf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function m0(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");kl(e.outputLen),kl(e.blockLen)}function g0(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function h0(e,t){Yr(e);let n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function b0(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function y0(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function x0(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function v0(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function w0(e,t){return e<<32-t|e>>>t}function S0(e,t){return e<<t|e>>>32-t>>>0}ie.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Pl(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}ie.swap8IfBE=ie.isLE?e=>e:e=>Pl(e);ie.byteSwapIfBE=ie.swap8IfBE;function of(e){for(let t=0;t<e.length;t++)e[t]=Pl(e[t]);return e}ie.swap32IfBE=ie.isLE?e=>e:of;var af=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",T0=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function C0(e){if(Yr(e),af)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=T0[e[n]];return t}var bn={_0:48,_9:57,A:65,F:70,a:97,f:102};function nf(e){if(e>=bn._0&&e<=bn._9)return e-bn._0;if(e>=bn.A&&e<=bn.F)return e-(bn.A-10);if(e>=bn.a&&e<=bn.f)return e-(bn.a-10)}function _0(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(af)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let o=0,i=0;o<n;o++,i+=2){let a=nf(e.charCodeAt(i)),s=nf(e.charCodeAt(i+1));if(a===void 0||s===void 0){let c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[o]=a*16+s}return r}var k0=async()=>{};ie.nextTick=k0;async function E0(e,t,n){let r=Date.now();for(let o=0;o<e;o++){n(o);let i=Date.now()-r;i>=0&&i<t||(await(0,ie.nextTick)(),r+=i)}}function Il(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function P0(e){return new TextDecoder().decode(e)}function ba(e){return typeof e=="string"&&(e=Il(e)),Yr(e),e}function I0(e){return typeof e=="string"&&(e=Il(e)),Yr(e),e}function A0(...e){let t=0;for(let r=0;r<e.length;r++){let o=e[r];Yr(o),t+=o.length}let n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){let i=e[r];n.set(i,o),o+=i.length}return n}function O0(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}var El=class{};ie.Hash=El;function sf(e){let t=r=>e().update(ba(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function lf(e){let t=(r,o)=>e(o).update(ba(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function cf(e){let t=(r,o)=>e(o).update(ba(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}ie.wrapConstructor=sf;ie.wrapConstructorWithOpts=lf;ie.wrapXOFConstructorWithOpts=cf;function R0(e=32){if(Kr.crypto&&typeof Kr.crypto.getRandomValues=="function")return Kr.crypto.getRandomValues(new Uint8Array(e));if(Kr.crypto&&typeof Kr.crypto.randomBytes=="function")return Uint8Array.from(Kr.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var xf=Ne(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.shake256=Le.shake128=Le.keccak_512=Le.keccak_384=Le.keccak_256=Le.keccak_224=Le.sha3_512=Le.sha3_384=Le.sha3_256=Le.sha3_224=Le.Keccak=void 0;Le.keccakP=bf;var zo=ef(),at=uf(),M0=BigInt(0),Ho=BigInt(1),D0=BigInt(2),L0=BigInt(7),N0=BigInt(256),$0=BigInt(113),pf=[],mf=[],gf=[];for(let e=0,t=Ho,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],pf.push(2*(5*r+n)),mf.push((e+1)*(e+2)/2%64);let o=M0;for(let i=0;i<7;i++)t=(t<<Ho^(t>>L0)*$0)%N0,t&D0&&(o^=Ho<<(Ho<<BigInt(i))-Ho);gf.push(o)}var hf=(0,zo.split)(gf,!0),B0=hf[0],F0=hf[1],df=(e,t,n)=>n>32?(0,zo.rotlBH)(e,t,n):(0,zo.rotlSH)(e,t,n),ff=(e,t,n)=>n>32?(0,zo.rotlBL)(e,t,n):(0,zo.rotlSL)(e,t,n);function bf(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let a=0;a<10;a++)n[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,c=(a+2)%10,l=n[c],u=n[c+1],f=df(l,u,1)^n[s],d=ff(l,u,1)^n[s+1];for(let p=0;p<50;p+=10)e[a+p]^=f,e[a+p+1]^=d}let o=e[2],i=e[3];for(let a=0;a<24;a++){let s=mf[a],c=df(o,i,s),l=ff(o,i,s),u=pf[a];o=e[u],i=e[u+1],e[u]=c,e[u+1]=l}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)n[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=B0[r],e[1]^=F0[r]}(0,at.clean)(n)}var Go=class e extends at.Hash{constructor(t,n,r,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,(0,at.anumber)(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,at.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,at.swap32IfBE)(this.state32),bf(this.state32,this.rounds),(0,at.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,at.aexists)(this),t=(0,at.toBytes)(t),(0,at.abytes)(t);let{blockLen:n,state:r}=this,o=t.length;for(let i=0;i<o;){let a=Math.min(n-this.pos,o-i);for(let s=0;s<a;s++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){(0,at.aexists)(this,!1),(0,at.abytes)(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,at.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,at.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,at.clean)(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,o,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}};Le.Keccak=Go;var Ln=(e,t,n)=>(0,at.createHasher)(()=>new Go(t,e,n));Le.sha3_224=Ln(6,144,224/8);Le.sha3_256=Ln(6,136,256/8);Le.sha3_384=Ln(6,104,384/8);Le.sha3_512=Ln(6,72,512/8);Le.keccak_224=Ln(1,144,224/8);Le.keccak_256=Ln(1,136,256/8);Le.keccak_384=Ln(1,104,384/8);Le.keccak_512=Ln(1,72,512/8);var yf=(e,t,n)=>(0,at.createXOFer)((r={})=>new Go(t,e,r.dkLen===void 0?n:r.dkLen,!0));Le.shake128=yf(31,168,128/8);Le.shake256=yf(31,136,256/8)});var Ef=Ne((J1,Nn)=>{"use strict";var{sha3_512:U0}=xf(),wf=24,Wo=32,Al=(e=4,t=Math.random)=>{let n="";for(;n.length<e;)n=n+Math.floor(t()*36).toString(36);return n};function Sf(e){let t=8n,n=0n;for(let r of e.values()){let o=BigInt(r);n=(n<<t)+o}return n}var Tf=(e="")=>Sf(U0(e)).toString(36).slice(1),vf=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),j0=e=>vf[Math.floor(e()*vf.length)],Cf=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let n=Object.keys(e).toString(),r=n.length?n+Al(Wo,t):Al(Wo,t);return Tf(r).substring(0,Wo)},_f=e=>()=>e++,V0=476782367,kf=({random:e=Math.random,counter:t=_f(Math.floor(e()*V0)),length:n=wf,fingerprint:r=Cf({random:e})}={})=>function(){let i=j0(e),a=Date.now().toString(36),s=t().toString(36),c=Al(n,e),l=`${a+c+s+r}`;return`${i+Tf(l).substring(1,n)}`},H0=kf(),z0=(e,{minLength:t=2,maxLength:n=Wo}={})=>{let r=e.length,o=/^[0-9a-z]+$/;try{if(typeof e=="string"&&r>=t&&r<=n&&o.test(e))return!0}finally{}return!1};Nn.exports.getConstants=()=>({defaultLength:wf,bigLength:Wo});Nn.exports.init=kf;Nn.exports.createId=H0;Nn.exports.bufToBigInt=Sf;Nn.exports.createCounter=_f;Nn.exports.createFingerprint=Cf;Nn.exports.isCuid=z0});var Pf=Ne((Q1,qo)=>{"use strict";var{createId:G0,init:W0,getConstants:q0,isCuid:K0}=Ef();qo.exports.createId=G0;qo.exports.init=W0;qo.exports.getConstants=q0;qo.exports.isCuid=K0});var Af=Ne((eA,If)=>{"use strict";var Xr=1e3,Zr=Xr*60,Jr=Zr*60,rr=Jr*24,Y0=rr*7,X0=rr*365.25;If.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Z0(e);if(n==="number"&&isFinite(e))return t.long?Q0(e):J0(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Z0(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*X0;case"weeks":case"week":case"w":return n*Y0;case"days":case"day":case"d":return n*rr;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Jr;case"minutes":case"minute":case"mins":case"min":case"m":return n*Zr;case"seconds":case"second":case"secs":case"sec":case"s":return n*Xr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function J0(e){var t=Math.abs(e);return t>=rr?Math.round(e/rr)+"d":t>=Jr?Math.round(e/Jr)+"h":t>=Zr?Math.round(e/Zr)+"m":t>=Xr?Math.round(e/Xr)+"s":e+"ms"}function Q0(e){var t=Math.abs(e);return t>=rr?ya(e,t,rr,"day"):t>=Jr?ya(e,t,Jr,"hour"):t>=Zr?ya(e,t,Zr,"minute"):t>=Xr?ya(e,t,Xr,"second"):e+" ms"}function ya(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var vb=Ne((rD,wo)=>{"use strict";var ik=typeof Buffer<"u",hb=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,bb=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function yb(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),ik&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;let o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(hb.test(e)===!1&&bb.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(hb.test(e)===!1)return r}else if(bb.test(e)===!1)return r;return xb(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function xb(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){let i=o;o=[];for(let a of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"constructor")&&Object.prototype.hasOwnProperty.call(a.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.constructor}for(let s in a){let c=a[s];c&&typeof c=="object"&&o.push(c)}}}return e}function Tc(e,t,n){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return yb(e,t,n)}finally{Error.stackTraceLimit=r}}function ak(e,t){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return yb(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}wo.exports=Tc;wo.exports.default=Tc;wo.exports.parse=Tc;wo.exports.safeParse=ak;wo.exports.scan=xb});var ty=Ne(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});function ws(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ws=function(t){return typeof t}:ws=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(e)}var Qb="https://js.stripe.com/v3",fE=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Zb="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",pE=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Qb,'"]')),n=0;n<t.length;n++){var r=t[n];if(fE.test(r.src))return r}return null},mE=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Qb).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(r),r},gE=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:n})},vs=null,hE=function(t){return vs!==null||(vs=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(Zb),window.Stripe){n(window.Stripe);return}try{var o=pE();o&&t?console.warn(Zb):o||(o=mE(t)),o.addEventListener("load",function(){window.Stripe?n(window.Stripe):r(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){r(new Error("Failed to load Stripe.js"))})}catch(i){r(i);return}})),vs},bE=function(t,n,r){if(t===null)return null;var o=t.apply(void 0,n);return gE(o,r),o},Jb=function(t){var n=`invalid load parameters; expected object of shape
|
|
19
3
|
|
|
20
4
|
{advancedFraudSignals: boolean}
|
|
21
5
|
|
|
22
6
|
but received
|
|
23
7
|
|
|
24
8
|
`.concat(JSON.stringify(t),`
|
|
25
|
-
`);if(t===null||nl(t)!=="object")throw new Error(n);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(n)},rl,Pu=!1,v0=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];Pu=!0;var o=Date.now();return QP(rl).then(function(a){return eI(a,n,o)})};v0.setLoadParameters=function(e){if(Pu&&rl){var t=b0(e),n=Object.keys(t),r=n.reduce(function(o,a){var i;return o&&e[a]===((i=rl)===null||i===void 0?void 0:i[a])},!0);if(r)return}if(Pu)throw new Error("You cannot change load parameters after calling loadStripe");rl=b0(e)};Iu.loadStripe=v0});var S0=Be((fG,w0)=>{"use strict";w0.exports=x0()});var yi={};uw(yi,{__addDisposableResource:()=>cv,__assign:()=>il,__asyncDelegator:()=>tv,__asyncGenerator:()=>ev,__asyncValues:()=>nv,__await:()=>Yo,__awaiter:()=>Z0,__classPrivateFieldGet:()=>iv,__classPrivateFieldIn:()=>lv,__classPrivateFieldSet:()=>sv,__createBinding:()=>ll,__decorate:()=>G0,__disposeResources:()=>uv,__esDecorate:()=>K0,__exportStar:()=>q0,__extends:()=>F0,__generator:()=>Y0,__importDefault:()=>av,__importStar:()=>ov,__makeTemplateObject:()=>rv,__metadata:()=>W0,__param:()=>H0,__propKey:()=>j0,__read:()=>Lu,__rest:()=>$0,__rewriteRelativeImportExtension:()=>dv,__runInitializers:()=>V0,__setFunctionName:()=>z0,__spread:()=>J0,__spreadArray:()=>Q0,__spreadArrays:()=>X0,__values:()=>sl,default:()=>NI});function F0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Nu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function $0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function G0(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function H0(e,t){return function(n,r){t(n,r,e)}}function K0(e,t,n,r,o,a){function i(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var s=r.kind,c=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,d=!1,p=n.length-1;p>=0;p--){var h={};for(var g in r)h[g]=g==="access"?{}:r[g];for(var g in r.access)h.access[g]=r.access[g];h.addInitializer=function(b){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(b||null))};var y=(0,n[p])(s==="accessor"?{get:u.get,set:u.set}:u[c],h);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=i(y.get))&&(u.get=f),(f=i(y.set))&&(u.set=f),(f=i(y.init))&&o.unshift(f)}else(f=i(y))&&(s==="field"?o.unshift(f):u[c]=f)}l&&Object.defineProperty(l,r.name,u),d=!0}function V0(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function j0(e){return typeof e=="symbol"?e:"".concat(e)}function z0(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function W0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Z0(e,t,n,r){function o(a){return a instanceof n?a:new n(function(i){i(a)})}return new(n||(n=Promise))(function(a,i){function s(u){try{l(r.next(u))}catch(f){i(f)}}function c(u){try{l(r.throw(u))}catch(f){i(f)}}function l(u){u.done?a(u.value):o(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function Y0(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function q0(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ll(t,e,n)}function sl(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lu(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function J0(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Lu(arguments[t]));return e}function X0(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)r[o]=a[i];return r}function Q0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Yo(e){return this instanceof Yo?(this.v=e,this):new Yo(e)}function ev(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(p){return function(h){return Promise.resolve(h).then(p,f)}}function s(p,h){r[p]&&(o[p]=function(g){return new Promise(function(y,b){a.push([p,g,y,b])>1||c(p,g)})},h&&(o[p]=h(o[p])))}function c(p,h){try{l(r[p](h))}catch(g){d(a[0][3],g)}}function l(p){p.value instanceof Yo?Promise.resolve(p.value.v).then(u,f):d(a[0][2],p)}function u(p){c("next",p)}function f(p){c("throw",p)}function d(p,h){p(h),a.shift(),a.length&&c(a[0][0],a[0][1])}}function tv(e){var t,n;return t={},r("next"),r("throw",function(o){throw o}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(o,a){t[o]=e[o]?function(i){return(n=!n)?{value:Yo(e[o](i)),done:!1}:a?a(i):i}:a}}function nv(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof sl=="function"?sl(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(i){return new Promise(function(s,c){i=e[a](i),o(s,c,i.done,i.value)})}}function o(a,i,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},i)}}function rv(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ov(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Ou(e),r=0;r<n.length;r++)n[r]!=="default"&&ll(t,e,n[r]);return MI(t,e),t}function av(e){return e&&e.__esModule?e:{default:e}}function iv(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function sv(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function lv(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function cv(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function uv(e){function t(a){e.error=e.hasError?new RI(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var n,r=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(o,function(i){return t(i),o()})}else r|=1}catch(i){t(i)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function dv(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,o,a,i){return r?t?".jsx":".js":o&&(!a||!i)?n:o+a+"."+i.toLowerCase()+"js"}):e}var Nu,il,ll,MI,Ou,RI,NI,vi=cw(()=>{"use strict";Nu=function(e,t){return Nu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Nu(e,t)};il=function(){return il=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},il.apply(this,arguments)};ll=Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};MI=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Ou=function(e){return Ou=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},Ou(e)};RI=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};NI={__extends:F0,__assign:il,__rest:$0,__decorate:G0,__param:H0,__esDecorate:K0,__runInitializers:V0,__propKey:j0,__setFunctionName:z0,__metadata:W0,__awaiter:Z0,__generator:Y0,__createBinding:ll,__exportStar:q0,__values:sl,__read:Lu,__spread:J0,__spreadArrays:X0,__spreadArray:Q0,__await:Yo,__asyncGenerator:ev,__asyncDelegator:tv,__asyncValues:nv,__makeTemplateObject:rv,__importStar:ov,__importDefault:av,__classPrivateFieldGet:iv,__classPrivateFieldSet:sv,__classPrivateFieldIn:lv,__addDisposableResource:cv,__disposeResources:uv,__rewriteRelativeImportExtension:dv}});var qo=Be(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.WebmBase=void 0;var Du=class{constructor(t="Unknown",n=0){this.name=t,this.start=n}getType(){return"Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource()}updateByData(){}setData(t){this.data=t,this.updateByData()}getValue(){return this.data}setValue(t){this.setData(t)}};cl.WebmBase=Du});var dl=Be(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.SectionType=void 0;var fv;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"})(fv||(ul.SectionType=fv={}))});var Bu=Be(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.sections=void 0;var v=dl();fl.sections={172351395:{name:"EBML",type:v.SectionType.Container},646:{name:"EBMLVersion",type:v.SectionType.Uint},759:{name:"EBMLReadVersion",type:v.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:v.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:v.SectionType.Uint},642:{name:"DocType",type:v.SectionType.String},647:{name:"DocTypeVersion",type:v.SectionType.Uint},645:{name:"DocTypeReadVersion",type:v.SectionType.Uint},108:{name:"Void",type:v.SectionType.Binary},63:{name:"CRC-32",type:v.SectionType.Binary},190023271:{name:"SignatureSlot",type:v.SectionType.Container},16010:{name:"SignatureAlgo",type:v.SectionType.Uint},16026:{name:"SignatureHash",type:v.SectionType.Uint},16037:{name:"SignaturePublicKey",type:v.SectionType.Binary},16053:{name:"Signature",type:v.SectionType.Binary},15963:{name:"SignatureElements",type:v.SectionType.Container},15995:{name:"SignatureElementList",type:v.SectionType.Container},9522:{name:"SignedElement",type:v.SectionType.Binary},139690087:{name:"Segment",type:v.SectionType.Container},21863284:{name:"SeekHead",type:v.SectionType.Container},3515:{name:"Seek",type:v.SectionType.Container},5035:{name:"SeekID",type:v.SectionType.Binary},5036:{name:"SeekPosition",type:v.SectionType.Uint},88713574:{name:"Info",type:v.SectionType.Container},13220:{name:"SegmentUID",type:v.SectionType.Binary},13188:{name:"SegmentFilename",type:v.SectionType.String},1882403:{name:"PrevUID",type:v.SectionType.Binary},1868715:{name:"PrevFilename",type:v.SectionType.String},2013475:{name:"NextUID",type:v.SectionType.Binary},1999803:{name:"NextFilename",type:v.SectionType.String},1092:{name:"SegmentFamily",type:v.SectionType.Binary},10532:{name:"ChapterTranslate",type:v.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:v.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:v.SectionType.Uint},10661:{name:"ChapterTranslateID",type:v.SectionType.Binary},710577:{name:"TimecodeScale",type:v.SectionType.Uint},1161:{name:"Duration",type:v.SectionType.Float},1121:{name:"DateUTC",type:v.SectionType.Date},15273:{name:"Title",type:v.SectionType.String},3456:{name:"MuxingApp",type:v.SectionType.String},5953:{name:"WritingApp",type:v.SectionType.String},103:{name:"Timecode",type:v.SectionType.Uint},6228:{name:"SilentTracks",type:v.SectionType.Container},6359:{name:"SilentTrackNumber",type:v.SectionType.Uint},39:{name:"Position",type:v.SectionType.Uint},43:{name:"PrevSize",type:v.SectionType.Uint},35:{name:"SimpleBlock",type:v.SectionType.Binary},32:{name:"BlockGroup",type:v.SectionType.Container},33:{name:"Block",type:v.SectionType.Binary},34:{name:"BlockVirtual",type:v.SectionType.Binary},13729:{name:"BlockAdditions",type:v.SectionType.Container},38:{name:"BlockMore",type:v.SectionType.Container},110:{name:"BlockAddID",type:v.SectionType.Uint},37:{name:"BlockAdditional",type:v.SectionType.Binary},27:{name:"BlockDuration",type:v.SectionType.Uint},122:{name:"ReferencePriority",type:v.SectionType.Uint},123:{name:"ReferenceBlock",type:v.SectionType.Int},125:{name:"ReferenceVirtual",type:v.SectionType.Int},36:{name:"CodecState",type:v.SectionType.Binary},13730:{name:"DiscardPadding",type:v.SectionType.Int},14:{name:"Slices",type:v.SectionType.Container},104:{name:"TimeSlice",type:v.SectionType.Container},76:{name:"LaceNumber",type:v.SectionType.Uint},77:{name:"FrameNumber",type:v.SectionType.Uint},75:{name:"BlockAdditionID",type:v.SectionType.Uint},78:{name:"Delay",type:v.SectionType.Uint},79:{name:"SliceDuration",type:v.SectionType.Uint},72:{name:"ReferenceFrame",type:v.SectionType.Container},73:{name:"ReferenceOffset",type:v.SectionType.Uint},74:{name:"ReferenceTimeCode",type:v.SectionType.Uint},47:{name:"EncryptedBlock",type:v.SectionType.Binary},106212971:{name:"Tracks",type:v.SectionType.Container},46:{name:"TrackEntry",type:v.SectionType.Container},87:{name:"TrackNumber",type:v.SectionType.Uint},13253:{name:"TrackUID",type:v.SectionType.Uint},3:{name:"TrackType",type:v.SectionType.Uint},57:{name:"FlagEnabled",type:v.SectionType.Uint},8:{name:"FlagDefault",type:v.SectionType.Uint},5546:{name:"FlagForced",type:v.SectionType.Uint},28:{name:"FlagLacing",type:v.SectionType.Uint},11751:{name:"MinCache",type:v.SectionType.Uint},11768:{name:"MaxCache",type:v.SectionType.Uint},254851:{name:"DefaultDuration",type:v.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:v.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:v.SectionType.Float},4991:{name:"TrackOffset",type:v.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:v.SectionType.Uint},4974:{name:"Name",type:v.SectionType.String},177564:{name:"Language",type:v.SectionType.String},6:{name:"CodecID",type:v.SectionType.String},9122:{name:"CodecPrivate",type:v.SectionType.Binary},362120:{name:"CodecName",type:v.SectionType.String},13382:{name:"AttachmentLink",type:v.SectionType.Uint},1742487:{name:"CodecSettings",type:v.SectionType.String},1785920:{name:"CodecInfoURL",type:v.SectionType.String},438848:{name:"CodecDownloadURL",type:v.SectionType.String},42:{name:"CodecDecodeAll",type:v.SectionType.Uint},12203:{name:"TrackOverlay",type:v.SectionType.Uint},5802:{name:"CodecDelay",type:v.SectionType.Uint},5819:{name:"SeekPreRoll",type:v.SectionType.Uint},9764:{name:"TrackTranslate",type:v.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:v.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:v.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:v.SectionType.Binary},96:{name:"Video",type:v.SectionType.Container},26:{name:"FlagInterlaced",type:v.SectionType.Uint},5048:{name:"StereoMode",type:v.SectionType.Uint},5056:{name:"AlphaMode",type:v.SectionType.Uint},5049:{name:"OldStereoMode",type:v.SectionType.Uint},48:{name:"PixelWidth",type:v.SectionType.Uint},58:{name:"PixelHeight",type:v.SectionType.Uint},5290:{name:"PixelCropBottom",type:v.SectionType.Uint},5307:{name:"PixelCropTop",type:v.SectionType.Uint},5324:{name:"PixelCropLeft",type:v.SectionType.Uint},5341:{name:"PixelCropRight",type:v.SectionType.Uint},5296:{name:"DisplayWidth",type:v.SectionType.Uint},5306:{name:"DisplayHeight",type:v.SectionType.Uint},5298:{name:"DisplayUnit",type:v.SectionType.Uint},5299:{name:"AspectRatioType",type:v.SectionType.Uint},963876:{name:"ColourSpace",type:v.SectionType.Binary},1029411:{name:"GammaValue",type:v.SectionType.Float},230371:{name:"FrameRate",type:v.SectionType.Float},97:{name:"Audio",type:v.SectionType.Container},53:{name:"SamplingFrequency",type:v.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:v.SectionType.Float},31:{name:"Channels",type:v.SectionType.Uint},15739:{name:"ChannelPositions",type:v.SectionType.Binary},8804:{name:"BitDepth",type:v.SectionType.Uint},98:{name:"TrackOperation",type:v.SectionType.Container},99:{name:"TrackCombinePlanes",type:v.SectionType.Container},100:{name:"TrackPlane",type:v.SectionType.Container},101:{name:"TrackPlaneUID",type:v.SectionType.Uint},102:{name:"TrackPlaneType",type:v.SectionType.Uint},105:{name:"TrackJoinBlocks",type:v.SectionType.Container},109:{name:"TrackJoinUID",type:v.SectionType.Uint},64:{name:"TrickTrackUID",type:v.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:v.SectionType.Binary},70:{name:"TrickTrackFlag",type:v.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:v.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:v.SectionType.Binary},11648:{name:"ContentEncodings",type:v.SectionType.Container},8768:{name:"ContentEncoding",type:v.SectionType.Container},4145:{name:"ContentEncodingOrder",type:v.SectionType.Uint},4146:{name:"ContentEncodingScope",type:v.SectionType.Uint},4147:{name:"ContentEncodingType",type:v.SectionType.Uint},4148:{name:"ContentCompression",type:v.SectionType.Container},596:{name:"ContentCompAlgo",type:v.SectionType.Uint},597:{name:"ContentCompSettings",type:v.SectionType.Binary},4149:{name:"ContentEncryption",type:v.SectionType.Container},2017:{name:"ContentEncAlgo",type:v.SectionType.Uint},2018:{name:"ContentEncKeyID",type:v.SectionType.Binary},2019:{name:"ContentSignature",type:v.SectionType.Binary},2020:{name:"ContentSigKeyID",type:v.SectionType.Binary},2021:{name:"ContentSigAlgo",type:v.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:v.SectionType.Uint},206814059:{name:"Cues",type:v.SectionType.Container},59:{name:"CuePoint",type:v.SectionType.Container},51:{name:"CueTime",type:v.SectionType.Uint},55:{name:"CueTrackPositions",type:v.SectionType.Container},119:{name:"CueTrack",type:v.SectionType.Uint},113:{name:"CueClusterPosition",type:v.SectionType.Uint},112:{name:"CueRelativePosition",type:v.SectionType.Uint},50:{name:"CueDuration",type:v.SectionType.Uint},4984:{name:"CueBlockNumber",type:v.SectionType.Uint},106:{name:"CueCodecState",type:v.SectionType.Uint},91:{name:"CueReference",type:v.SectionType.Container},22:{name:"CueRefTime",type:v.SectionType.Uint},23:{name:"CueRefCluster",type:v.SectionType.Uint},4959:{name:"CueRefNumber",type:v.SectionType.Uint},107:{name:"CueRefCodecState",type:v.SectionType.Uint},155296873:{name:"Attachments",type:v.SectionType.Container},8615:{name:"AttachedFile",type:v.SectionType.Container},1662:{name:"FileDescription",type:v.SectionType.String},1646:{name:"FileName",type:v.SectionType.String},1632:{name:"FileMimeType",type:v.SectionType.String},1628:{name:"FileData",type:v.SectionType.Binary},1710:{name:"FileUID",type:v.SectionType.Uint},1653:{name:"FileReferral",type:v.SectionType.Binary},1633:{name:"FileUsedStartTime",type:v.SectionType.Uint},1634:{name:"FileUsedEndTime",type:v.SectionType.Uint},4433776:{name:"Chapters",type:v.SectionType.Container},1465:{name:"EditionEntry",type:v.SectionType.Container},1468:{name:"EditionUID",type:v.SectionType.Uint},1469:{name:"EditionFlagHidden",type:v.SectionType.Uint},1499:{name:"EditionFlagDefault",type:v.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:v.SectionType.Uint},54:{name:"ChapterAtom",type:v.SectionType.Container},13252:{name:"ChapterUID",type:v.SectionType.Uint},5716:{name:"ChapterStringUID",type:v.SectionType.String},17:{name:"ChapterTimeStart",type:v.SectionType.Uint},18:{name:"ChapterTimeEnd",type:v.SectionType.Uint},24:{name:"ChapterFlagHidden",type:v.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:v.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:v.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:v.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:v.SectionType.Uint},15:{name:"ChapterTrack",type:v.SectionType.Container},9:{name:"ChapterTrackNumber",type:v.SectionType.Uint},0:{name:"ChapterDisplay",type:v.SectionType.Container},5:{name:"ChapString",type:v.SectionType.String},892:{name:"ChapLanguage",type:v.SectionType.String},894:{name:"ChapCountry",type:v.SectionType.String},10564:{name:"ChapProcess",type:v.SectionType.Container},10581:{name:"ChapProcessCodecID",type:v.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:v.SectionType.Binary},10513:{name:"ChapProcessCommand",type:v.SectionType.Container},10530:{name:"ChapProcessTime",type:v.SectionType.Uint},10547:{name:"ChapProcessData",type:v.SectionType.Binary},39109479:{name:"Tags",type:v.SectionType.Container},13171:{name:"Tag",type:v.SectionType.Container},9152:{name:"Targets",type:v.SectionType.Container},10442:{name:"TargetTypeValue",type:v.SectionType.Uint},9162:{name:"TargetType",type:v.SectionType.String},9157:{name:"TagTrackUID",type:v.SectionType.Uint},9161:{name:"TagEditionUID",type:v.SectionType.Uint},9156:{name:"TagChapterUID",type:v.SectionType.Uint},9158:{name:"TagAttachmentUID",type:v.SectionType.Uint},10184:{name:"SimpleTag",type:v.SectionType.Container},1443:{name:"TagName",type:v.SectionType.String},1146:{name:"TagLanguage",type:v.SectionType.String},1156:{name:"TagDefault",type:v.SectionType.Uint},1159:{name:"TagString",type:v.SectionType.String},1157:{name:"TagBinary",type:v.SectionType.Binary},5552:{name:"Colour",type:v.SectionType.Container},5553:{name:"MatrixCoefficients",type:v.SectionType.Uint},5554:{name:"BitsPerChannel",type:v.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:v.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:v.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:v.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:v.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:v.SectionType.Uint},5560:{name:"ChromaSitingVert",type:v.SectionType.Uint},5561:{name:"Range",type:v.SectionType.Uint},5562:{name:"TransferCharacteristics",type:v.SectionType.Uint},5563:{name:"Primaries",type:v.SectionType.Uint},5564:{name:"MaxCLL",type:v.SectionType.Uint},5565:{name:"MaxFALL",type:v.SectionType.Uint}}});var Fu=Be(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.WebmUint=void 0;var OI=qo();function pv(e){return e.length%2===1?"0"+e:e}var Uu=class extends OI.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let n=this.source[t].toString(16);this.data+=pv(n)}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let n=0;n<t;n++){let r=this.data.substring(n*2,n*2+2);this.source[n]=parseInt(r,16)}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(pv(t.toString(16)))}};pl.WebmUint=Uu});var Gu=Be(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.WebmFloat=void 0;var LI=qo(),$u=class extends LI.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),n=this.getFloatArrayType(),r=new n(t.buffer);this.data=r[0]}updateByData(){let t=this.getFloatArrayType(),n=new t([this.data]),r=new Uint8Array(n.buffer);this.source=r.reverse()}};ml.WebmFloat=$u});var Ku=Be(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.WebmString=void 0;var DI=qo(),Hu=class extends DI.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let t="";return this.source.forEach(n=>{t+=String.fromCharCode(n)}),t}};gl.WebmString=Hu});var ju=Be(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.WebmContainer=void 0;var mv=qo(),BI=Bu(),hl=dl(),UI=Fu(),FI=Gu(),$I=Ku(),Vu=class e extends mv.WebmBase{constructor(t,n=!1,r=0){super(t,r),this.isInfinite=n,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),n=8-t.toString(2).length,r=t-(1<<7-n);for(let o=0;o<n;o++)r<<=8,r|=this.readByte();return r}updateBySource(){var t;this.data=[];let n;for(this.offset=0;this.offset<this.source.length;this.offset=n){let r=this.offset,o=this.readUint(),{name:a,type:i}=(t=BI.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();n=this.source.length,s>=0&&(n=Math.min(this.offset+s,n));let c=this.source.slice(this.offset,n),l;switch(i){case hl.SectionType.Container:l=new e(a,s<0,r);break;case hl.SectionType.Uint:l=new UI.WebmUint(a,r);break;case hl.SectionType.Float:l=new FI.WebmFloat(a,r);break;case hl.SectionType.String:l=new $I.WebmString(a,r);break;default:l=new mv.WebmBase(a,r);break}l.setSource(c),this.data.push({id:o,idHex:o.toString(16),data:l})}}writeUint(t,n=!1){let r;for(r=1;(t<0||t>=1<<7*r)&&r<8;r++);if(!n){for(let o=0;o<r;o++)this.source[this.offset+o]=t>>8*(r-1-o)&255;this.source[this.offset]&=(1<<8-r)-1,this.source[this.offset]|=1<<8-r}this.offset+=r}writeSections(t=!1){this.offset=0;for(let n=0;n<this.data.length;n++){let r=this.data[n],o=r.data.source,a=o.length;this.writeUint(r.id,t),this.writeUint(r.data instanceof e&&r.data.isInfinite?-1:a,t),t||this.source.set(o,this.offset),this.offset+=a}return this.offset}updateByData(){let t=this.writeSections(!0);this.source=new Uint8Array(t),this.writeSections()}getSectionById(t){for(let n=0;n<this.data.length;n++){let r=this.data[n];if(r.id===t)return r.data}return null}};bl.WebmContainer=Vu});var gv=Be(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.WebmFile=void 0;var GI=(vi(),_i(yi)),HI=ju(),zu=class e extends HI.WebmContainer{constructor(t){super("File"),this.setSource(t)}getType(){return"File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((n,r)=>{try{let o=new FileReader;o.onloadend=()=>{try{n(new Uint8Array(o.result))}catch(a){r(a)}},o.readAsArrayBuffer(t)}catch(o){r(o)}})}static fromBlob(t){return GI.__awaiter(this,void 0,void 0,function*(){let n=yield e.blobToArray(t);return new e(n)})}};yl.WebmFile=zu});var bv=Be(hv=>{"use strict";Object.defineProperty(hv,"__esModule",{value:!0})});var Wu=Be(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});var zn=(vi(),_i(yi));zn.__exportStar(qo(),dn);zn.__exportStar(ju(),dn);zn.__exportStar(gv(),dn);zn.__exportStar(Gu(),dn);zn.__exportStar(Ku(),dn);zn.__exportStar(Fu(),dn);zn.__exportStar(dl(),dn);zn.__exportStar(bv(),dn);zn.__exportStar(Bu(),dn)});var Zu=Be(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.fixParsedWebmDuration=void 0;var KI=Wu(),VI=(e,t,n={})=>{let r=n.logger;r===void 0?r=c=>console.debug(c):r||(r=()=>{});let o=e.getSectionById(139690087);if(!o)return r("[fix-webm-duration] Segment section is missing"),!1;let a=o.getSectionById(88713574);if(!a)return r("[fix-webm-duration] Info section is missing"),!1;let i=a.getSectionById(710577);if(!i)return r("[fix-webm-duration] TimecodeScale section is missing"),!1;let s=a.getSectionById(1161);if(s)if(s.getValue()<=0)r(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return r(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),!1;else r("[fix-webm-duration] Duration section is missing"),s=new KI.WebmFloat("Duration"),s.setValue(t),a.data.push({id:1161,data:s});return i.setValue(1e6),a.updateByData(),o.updateByData(),e.updateByData(),!0};vl.fixParsedWebmDuration=VI});var yv=Be(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.fixWebmDuration=void 0;var jI=(vi(),_i(yi)),zI=Wu(),WI=Zu(),ZI=(e,t,n)=>jI.__awaiter(void 0,void 0,void 0,function*(){try{let r=yield zI.WebmFile.fromBlob(e);if((0,WI.fixParsedWebmDuration)(r,t,n))return r.toBlob(e.type)}catch{}return e});xl.fixWebmDuration=ZI});var xv=Be(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var vv=(vi(),_i(yi));vv.__exportStar(yv(),wl);vv.__exportStar(Zu(),wl)});var zv=Be((nd,rd)=>{"use strict";(function(e,t){typeof nd=="object"&&typeof rd<"u"?rd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(nd,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object,{freeze:a,seal:i,create:s}=Object,{apply:c,construct:l}=typeof Reflect<"u"&&Reflect;a||(a=function(ue){return ue}),i||(i=function(ue){return ue}),c||(c=function(ue,Le,_e){return ue.apply(Le,_e)}),l||(l=function(ue,Le){return new ue(...Le)});let u=I(Array.prototype.forEach),f=I(Array.prototype.pop),d=I(Array.prototype.push),p=I(String.prototype.toLowerCase),h=I(String.prototype.toString),g=I(String.prototype.match),y=I(String.prototype.replace),b=I(String.prototype.indexOf),T=I(String.prototype.trim),S=I(RegExp.prototype.test),k=$(TypeError);function I(Oe){return function(ue){for(var Le=arguments.length,_e=new Array(Le>1?Le-1:0),xt=1;xt<Le;xt++)_e[xt-1]=arguments[xt];return c(Oe,ue,_e)}}function $(Oe){return function(){for(var ue=arguments.length,Le=new Array(ue),_e=0;_e<ue;_e++)Le[_e]=arguments[_e];return l(Oe,Le)}}function O(Oe,ue){let Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p;t&&t(Oe,null);let _e=ue.length;for(;_e--;){let xt=ue[_e];if(typeof xt=="string"){let Pn=Le(xt);Pn!==xt&&(n(ue)||(ue[_e]=Pn),xt=Pn)}Oe[xt]=!0}return Oe}function Q(Oe){let ue=s(null);for(let[Le,_e]of e(Oe))o(Oe,Le)!==void 0&&(ue[Le]=_e);return ue}function H(Oe,ue){for(;Oe!==null;){let _e=o(Oe,ue);if(_e){if(_e.get)return I(_e.get);if(typeof _e.value=="function")return I(_e.value)}Oe=r(Oe)}function Le(_e){return console.warn("fallback value for",_e),null}return Le}let j=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),L=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),E=a(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),w=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),N=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_=a(["#text"]),ee=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),me=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ge=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ne=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ae=i(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ot=i(/<%[\w\W]*|[\w\W]*%>/gm),qt=i(/\${[\w\W]*}/gm),Et=i(/^data-[\-\w.\u00B7-\uFFFF]/),fn=i(/^aria-[\-\w]+$/),ta=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),na=i(/^(?:\w+script|data):/i),ra=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dd=i(/^html$/i);var fd=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ae,ERB_EXPR:Ot,TMPLIT_EXPR:qt,DATA_ATTR:Et,ARIA_ATTR:fn,IS_ALLOWED_URI:ta,IS_SCRIPT_OR_DATA:na,ATTR_WHITESPACE:ra,DOCTYPE_NAME:dd});let Nx=function(){return typeof window>"u"?null:window},Ox=function(ue,Le){if(typeof ue!="object"||typeof ue.createPolicy!="function")return null;let _e=null,xt="data-tt-policy-suffix";Le&&Le.hasAttribute(xt)&&(_e=Le.getAttribute(xt));let Pn="dompurify"+(_e?"#"+_e:"");try{return ue.createPolicy(Pn,{createHTML(eo){return eo},createScriptURL(eo){return eo}})}catch{return console.warn("TrustedTypes policy "+Pn+" could not be created."),null}};function pd(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nx(),ue=te=>pd(te);if(ue.version="3.0.6",ue.removed=[],!Oe||!Oe.document||Oe.document.nodeType!==9)return ue.isSupported=!1,ue;let{document:Le}=Oe,_e=Le,xt=_e.currentScript,{DocumentFragment:Pn,HTMLTemplateElement:eo,Node:Pl,Element:md,NodeFilter:Il,NamedNodeMap:Dx=Oe.NamedNodeMap||Oe.MozNamedAttrMap,HTMLFormElement:Bx,DOMParser:Ux,trustedTypes:Si}=Oe,Ti=md.prototype,Fx=H(Ti,"cloneNode"),$x=H(Ti,"nextSibling"),Gx=H(Ti,"childNodes"),_l=H(Ti,"parentNode");if(typeof eo=="function"){let te=Le.createElement("template");te.content&&te.content.ownerDocument&&(Le=te.content.ownerDocument)}let wt,oa="",{implementation:Ml,createNodeIterator:Hx,createDocumentFragment:Kx,getElementsByTagName:Vx}=Le,{importNode:jx}=_e,pn={};ue.isSupported=typeof e=="function"&&typeof _l=="function"&&Ml&&Ml.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Rl,ERB_EXPR:Nl,TMPLIT_EXPR:Ol,DATA_ATTR:zx,ARIA_ATTR:Wx,IS_SCRIPT_OR_DATA:Zx,ATTR_WHITESPACE:gd}=fd,{IS_ALLOWED_URI:hd}=fd,ot=null,bd=O({},[...j,...L,...P,...w,..._]),at=null,yd=O({},[...ee,...me,...ge,...Ne]),Ye=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),aa=null,Ll=null,vd=!0,Dl=!0,xd=!1,wd=!0,to=!1,yr=!1,Bl=!1,Ul=!1,no=!1,Ci=!1,Ei=!1,Sd=!0,Td=!1,Yx="user-content-",Fl=!0,ia=!1,ro={},oo=null,Cd=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ed=null,kd=O({},["audio","video","img","source","image","track"]),$l=null,Ad=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ki="http://www.w3.org/1998/Math/MathML",Ai="http://www.w3.org/2000/svg",In="http://www.w3.org/1999/xhtml",ao=In,Gl=!1,Hl=null,qx=O({},[ki,Ai,In],h),vr=null,Jx=["application/xhtml+xml","text/html"],Xx="text/html",it=null,io=null,Qx=Le.createElement("form"),Pd=function(A){return A instanceof RegExp||A instanceof Function},Kl=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(io&&io===A)){if((!A||typeof A!="object")&&(A={}),A=Q(A),vr=Jx.indexOf(A.PARSER_MEDIA_TYPE)===-1?vr=Xx:vr=A.PARSER_MEDIA_TYPE,it=vr==="application/xhtml+xml"?h:p,ot="ALLOWED_TAGS"in A?O({},A.ALLOWED_TAGS,it):bd,at="ALLOWED_ATTR"in A?O({},A.ALLOWED_ATTR,it):yd,Hl="ALLOWED_NAMESPACES"in A?O({},A.ALLOWED_NAMESPACES,h):qx,$l="ADD_URI_SAFE_ATTR"in A?O(Q(Ad),A.ADD_URI_SAFE_ATTR,it):Ad,Ed="ADD_DATA_URI_TAGS"in A?O(Q(kd),A.ADD_DATA_URI_TAGS,it):kd,oo="FORBID_CONTENTS"in A?O({},A.FORBID_CONTENTS,it):Cd,aa="FORBID_TAGS"in A?O({},A.FORBID_TAGS,it):{},Ll="FORBID_ATTR"in A?O({},A.FORBID_ATTR,it):{},ro="USE_PROFILES"in A?A.USE_PROFILES:!1,vd=A.ALLOW_ARIA_ATTR!==!1,Dl=A.ALLOW_DATA_ATTR!==!1,xd=A.ALLOW_UNKNOWN_PROTOCOLS||!1,wd=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,to=A.SAFE_FOR_TEMPLATES||!1,yr=A.WHOLE_DOCUMENT||!1,no=A.RETURN_DOM||!1,Ci=A.RETURN_DOM_FRAGMENT||!1,Ei=A.RETURN_TRUSTED_TYPE||!1,Ul=A.FORCE_BODY||!1,Sd=A.SANITIZE_DOM!==!1,Td=A.SANITIZE_NAMED_PROPS||!1,Fl=A.KEEP_CONTENT!==!1,ia=A.IN_PLACE||!1,hd=A.ALLOWED_URI_REGEXP||ta,ao=A.NAMESPACE||In,Ye=A.CUSTOM_ELEMENT_HANDLING||{},A.CUSTOM_ELEMENT_HANDLING&&Pd(A.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ye.tagNameCheck=A.CUSTOM_ELEMENT_HANDLING.tagNameCheck),A.CUSTOM_ELEMENT_HANDLING&&Pd(A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ye.attributeNameCheck=A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ye.allowCustomizedBuiltInElements=A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),to&&(Dl=!1),Ci&&(no=!0),ro&&(ot=O({},[..._]),at=[],ro.html===!0&&(O(ot,j),O(at,ee)),ro.svg===!0&&(O(ot,L),O(at,me),O(at,Ne)),ro.svgFilters===!0&&(O(ot,P),O(at,me),O(at,Ne)),ro.mathMl===!0&&(O(ot,w),O(at,ge),O(at,Ne))),A.ADD_TAGS&&(ot===bd&&(ot=Q(ot)),O(ot,A.ADD_TAGS,it)),A.ADD_ATTR&&(at===yd&&(at=Q(at)),O(at,A.ADD_ATTR,it)),A.ADD_URI_SAFE_ATTR&&O($l,A.ADD_URI_SAFE_ATTR,it),A.FORBID_CONTENTS&&(oo===Cd&&(oo=Q(oo)),O(oo,A.FORBID_CONTENTS,it)),Fl&&(ot["#text"]=!0),yr&&O(ot,["html","head","body"]),ot.table&&(O(ot,["tbody"]),delete aa.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');wt=A.TRUSTED_TYPES_POLICY,oa=wt.createHTML("")}else wt===void 0&&(wt=Ox(Si,xt)),wt!==null&&typeof oa=="string"&&(oa=wt.createHTML(""));a&&a(A),io=A}},Id=O({},["mi","mo","mn","ms","mtext"]),_d=O({},["foreignobject","desc","title","annotation-xml"]),ew=O({},["title","style","font","a","script"]),Pi=O({},L);O(Pi,P),O(Pi,E);let Vl=O({},w);O(Vl,N);let tw=function(A){let G=_l(A);(!G||!G.tagName)&&(G={namespaceURI:ao,tagName:"template"});let q=p(A.tagName),Ge=p(G.tagName);return Hl[A.namespaceURI]?A.namespaceURI===Ai?G.namespaceURI===In?q==="svg":G.namespaceURI===ki?q==="svg"&&(Ge==="annotation-xml"||Id[Ge]):!!Pi[q]:A.namespaceURI===ki?G.namespaceURI===In?q==="math":G.namespaceURI===Ai?q==="math"&&_d[Ge]:!!Vl[q]:A.namespaceURI===In?G.namespaceURI===Ai&&!_d[Ge]||G.namespaceURI===ki&&!Id[Ge]?!1:!Vl[q]&&(ew[q]||!Pi[q]):!!(vr==="application/xhtml+xml"&&Hl[A.namespaceURI]):!1},xr=function(A){d(ue.removed,{element:A});try{A.parentNode.removeChild(A)}catch{A.remove()}},jl=function(A,G){try{d(ue.removed,{attribute:G.getAttributeNode(A),from:G})}catch{d(ue.removed,{attribute:null,from:G})}if(G.removeAttribute(A),A==="is"&&!at[A])if(no||Ci)try{xr(G)}catch{}else try{G.setAttribute(A,"")}catch{}},Md=function(A){let G=null,q=null;if(Ul)A="<remove></remove>"+A;else{let mt=g(A,/^[\r\n\t ]+/);q=mt&&mt[0]}vr==="application/xhtml+xml"&&ao===In&&(A='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+A+"</body></html>");let Ge=wt?wt.createHTML(A):A;if(ao===In)try{G=new Ux().parseFromString(Ge,vr)}catch{}if(!G||!G.documentElement){G=Ml.createDocument(ao,"template",null);try{G.documentElement.innerHTML=Gl?oa:Ge}catch{}}let pt=G.body||G.documentElement;return A&&q&&pt.insertBefore(Le.createTextNode(q),pt.childNodes[0]||null),ao===In?Vx.call(G,yr?"html":"body")[0]:yr?G.documentElement:pt},Rd=function(A){return Hx.call(A.ownerDocument||A,A,Il.SHOW_ELEMENT|Il.SHOW_COMMENT|Il.SHOW_TEXT,null)},nw=function(A){return A instanceof Bx&&(typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||!(A.attributes instanceof Dx)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function")},Nd=function(A){return typeof Pl=="function"&&A instanceof Pl},_n=function(A,G,q){pn[A]&&u(pn[A],Ge=>{Ge.call(ue,G,q,io)})},Od=function(A){let G=null;if(_n("beforeSanitizeElements",A,null),nw(A))return xr(A),!0;let q=it(A.nodeName);if(_n("uponSanitizeElement",A,{tagName:q,allowedTags:ot}),A.hasChildNodes()&&!Nd(A.firstElementChild)&&S(/<[/\w]/g,A.innerHTML)&&S(/<[/\w]/g,A.textContent))return xr(A),!0;if(!ot[q]||aa[q]){if(!aa[q]&&Dd(q)&&(Ye.tagNameCheck instanceof RegExp&&S(Ye.tagNameCheck,q)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(q)))return!1;if(Fl&&!oo[q]){let Ge=_l(A)||A.parentNode,pt=Gx(A)||A.childNodes;if(pt&&Ge){let mt=pt.length;for(let kt=mt-1;kt>=0;--kt)Ge.insertBefore(Fx(pt[kt],!0),$x(A))}}return xr(A),!0}return A instanceof md&&!tw(A)||(q==="noscript"||q==="noembed"||q==="noframes")&&S(/<\/no(script|embed|frames)/i,A.innerHTML)?(xr(A),!0):(to&&A.nodeType===3&&(G=A.textContent,u([Rl,Nl,Ol],Ge=>{G=y(G,Ge," ")}),A.textContent!==G&&(d(ue.removed,{element:A.cloneNode()}),A.textContent=G)),_n("afterSanitizeElements",A,null),!1)},Ld=function(A,G,q){if(Sd&&(G==="id"||G==="name")&&(q in Le||q in Qx))return!1;if(!(Dl&&!Ll[G]&&S(zx,G))){if(!(vd&&S(Wx,G))){if(!at[G]||Ll[G]){if(!(Dd(A)&&(Ye.tagNameCheck instanceof RegExp&&S(Ye.tagNameCheck,A)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(A))&&(Ye.attributeNameCheck instanceof RegExp&&S(Ye.attributeNameCheck,G)||Ye.attributeNameCheck instanceof Function&&Ye.attributeNameCheck(G))||G==="is"&&Ye.allowCustomizedBuiltInElements&&(Ye.tagNameCheck instanceof RegExp&&S(Ye.tagNameCheck,q)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(q))))return!1}else if(!$l[G]){if(!S(hd,y(q,gd,""))){if(!((G==="src"||G==="xlink:href"||G==="href")&&A!=="script"&&b(q,"data:")===0&&Ed[A])){if(!(xd&&!S(Zx,y(q,gd,"")))){if(q)return!1}}}}}}return!0},Dd=function(A){return A.indexOf("-")>0},Bd=function(A){_n("beforeSanitizeAttributes",A,null);let{attributes:G}=A;if(!G)return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:at},Ge=G.length;for(;Ge--;){let pt=G[Ge],{name:mt,namespaceURI:kt,value:wr}=pt,sa=it(mt),At=mt==="value"?wr:T(wr);if(q.attrName=sa,q.attrValue=At,q.keepAttr=!0,q.forceKeepAttr=void 0,_n("uponSanitizeAttribute",A,q),At=q.attrValue,q.forceKeepAttr||(jl(mt,A),!q.keepAttr))continue;if(!wd&&S(/\/>/i,At)){jl(mt,A);continue}to&&u([Rl,Nl,Ol],Fd=>{At=y(At,Fd," ")});let Ud=it(A.nodeName);if(Ld(Ud,sa,At)){if(Td&&(sa==="id"||sa==="name")&&(jl(mt,A),At=Yx+At),wt&&typeof Si=="object"&&typeof Si.getAttributeType=="function"&&!kt)switch(Si.getAttributeType(Ud,sa)){case"TrustedHTML":{At=wt.createHTML(At);break}case"TrustedScriptURL":{At=wt.createScriptURL(At);break}}try{kt?A.setAttributeNS(kt,mt,At):A.setAttribute(mt,At),f(ue.removed)}catch{}}}_n("afterSanitizeAttributes",A,null)},rw=function te(A){let G=null,q=Rd(A);for(_n("beforeSanitizeShadowDOM",A,null);G=q.nextNode();)_n("uponSanitizeShadowNode",G,null),!Od(G)&&(G.content instanceof Pn&&te(G.content),Bd(G));_n("afterSanitizeShadowDOM",A,null)};return ue.sanitize=function(te){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=null,q=null,Ge=null,pt=null;if(Gl=!te,Gl&&(te="<!-->"),typeof te!="string"&&!Nd(te))if(typeof te.toString=="function"){if(te=te.toString(),typeof te!="string")throw k("dirty is not a string, aborting")}else throw k("toString is not a function");if(!ue.isSupported)return te;if(Bl||Kl(A),ue.removed=[],typeof te=="string"&&(ia=!1),ia){if(te.nodeName){let wr=it(te.nodeName);if(!ot[wr]||aa[wr])throw k("root node is forbidden and cannot be sanitized in-place")}}else if(te instanceof Pl)G=Md("<!---->"),q=G.ownerDocument.importNode(te,!0),q.nodeType===1&&q.nodeName==="BODY"||q.nodeName==="HTML"?G=q:G.appendChild(q);else{if(!no&&!to&&!yr&&te.indexOf("<")===-1)return wt&&Ei?wt.createHTML(te):te;if(G=Md(te),!G)return no?null:Ei?oa:""}G&&Ul&&xr(G.firstChild);let mt=Rd(ia?te:G);for(;Ge=mt.nextNode();)Od(Ge)||(Ge.content instanceof Pn&&rw(Ge.content),Bd(Ge));if(ia)return te;if(no){if(Ci)for(pt=Kx.call(G.ownerDocument);G.firstChild;)pt.appendChild(G.firstChild);else pt=G;return(at.shadowroot||at.shadowrootmode)&&(pt=jx.call(_e,pt,!0)),pt}let kt=yr?G.outerHTML:G.innerHTML;return yr&&ot["!doctype"]&&G.ownerDocument&&G.ownerDocument.doctype&&G.ownerDocument.doctype.name&&S(dd,G.ownerDocument.doctype.name)&&(kt="<!DOCTYPE "+G.ownerDocument.doctype.name+`>
|
|
26
|
-
`+kt),to&&u([Rl,Nl,Ol],wr=>{kt=y(kt,wr," ")}),wt&&Ei?wt.createHTML(kt):kt},ue.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kl(te),Bl=!0},ue.clearConfig=function(){io=null,Bl=!1},ue.isValidAttribute=function(te,A,G){io||Kl({});let q=it(te),Ge=it(A);return Ld(q,Ge,G)},ue.addHook=function(te,A){typeof A=="function"&&(pn[te]=pn[te]||[],d(pn[te],A))},ue.removeHook=function(te){if(pn[te])return f(pn[te])},ue.removeHooks=function(te){pn[te]&&(pn[te]=[])},ue.removeAllHooks=function(){pn={}},ue}var Lx=pd();return Lx})});function dw(e){return Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Object.assign({},o),Kd(o.value)&&!hw(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function fw(e){return e?Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Kd(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=gw(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function pw(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function mw(e,t){let n=dw(t);return Object.keys(t).forEach(o=>{let a=n[o],i=e.getAttribute(a.attribute),s=e[o];i!=null&&(a.value=a.parse?Hd(i):i),s!=null&&(a.value=Array.isArray(s)?s.slice(0):s),a.reflect&&Gd(e,a.attribute,a.value,!!a.parse),Object.defineProperty(e,o,{get(){return a.value},set(c){let l=a.value;a.value=c,a.reflect&&Gd(this,a.attribute,a.value,!!a.parse);for(let u=0,f=this.__propertyChangedCallbacks.length;u<f;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function Hd(e){if(e)try{return JSON.parse(e)}catch{return e}}function Gd(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function gw(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Kd(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function hw(e){return Object.prototype.toString.call(e)==="[object Function]"}function bw(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var zl;function yw(e,t){let n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=mw(this,t);let o=pw(this.props),a=this.Component,i=zl;try{zl=this,this.__initialized=!0,bw(a)?new a(o,{element:this}):a(o,{element:this})}finally{zl=i}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,a,i){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(i==null&&!this[o])return;this[o]=t[o].parse?Hd(i):i}}lookupProp(o){if(t)return n.find(a=>o===a||o===t[a].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}var aR=Symbol("element-context");function Vd(e,t={},n={}){let{BaseElement:r=HTMLElement,extension:o,customElements:a=window.customElements}=n;return i=>{if(!e)throw new Error("tag is required to register a Component");let s=a.get(e);return s?(s.prototype.Component=i,s):(s=yw(r,fw(t)),s.prototype.Component=i,s.prototype.registeredTag=e,a.define(e,s,o),s)}}var Ce={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return jd(this.context.count)},getNextContextId(){return jd(this.context.count++)}};function jd(e){let t=String(e),n=t.length-1;return Ce.context.id+(n?String.fromCharCode(96+n):"")+t}function Zl(e){Ce.context=e}function vw(){return{...Ce.context,id:Ce.getNextContextId(),count:0}}var xw=(e,t)=>e===t,$t=Symbol("solid-proxy"),Jd=typeof Proxy=="function",Oi=Symbol("solid-track"),sR=Symbol("solid-dev-component"),Ri={equals:xw},zd=null,Xd=af,Gt=1,la=2,Qd={owned:null,cleanups:null,context:null,owner:null};var Se=null,V=null,ua=null,so=null,De=null,tt=null,gt=null,Li=0;function Tr(e,t){let n=De,r=Se,o=e.length===0,a=t===void 0?r:t,i=o?Qd:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=o?e:()=>e(()=>Xe(()=>Yn(i)));Se=i,De=null;try{return Jt(s,!0)}finally{De=n,Se=r}}function R(e,t){t=t?Object.assign({},Ri,t):Ri;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(V&&V.running&&V.sources.has(n)?o=o(n.tValue):o=o(n.value)),of(n,o));return[rf.bind(n),r]}function M(e,t,n){let r=Ql(e,t,!1,Gt);ua&&V&&V.running?tt.push(r):da(r)}function xe(e,t,n){Xd=Cw;let r=Ql(e,t,!1,Gt),o=Yl&&Xl(Yl);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),gt?gt.push(r):da(r)}function F(e,t,n){n=n?Object.assign({},Ri,n):Ri;let r=Ql(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ua&&V&&V.running?(r.tState=Gt,tt.push(r)):da(r),rf.bind(r)}function ef(e){return Jt(e,!1)}function Xe(e){if(!so&&De===null)return e();let t=De;De=null;try{return so?so.untrack(e):e()}finally{De=t}}function ie(e){xe(()=>Xe(e))}function de(e){return Se===null||(Se.cleanups===null?Se.cleanups=[e]:Se.cleanups.push(e)),e}function Di(){return De}function lo(){return Se}function tf(e,t){let n=Se,r=De;Se=e,De=null;try{return Jt(t,!0)}catch(o){Ui(o)}finally{Se=n,De=r}}function ww(e){if(V&&V.running)return e(),V.done;let t=De,n=Se;return Promise.resolve().then(()=>{De=t,Se=n;let r;return(ua||Yl)&&(r=V||(V={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),Jt(e,!1),De=Se=null,r?r.done:void 0})}var[lR,Wd]=R(!1);function nf(e,t){let n=Symbol("context");return{id:n,Provider:kw(n),defaultValue:e}}function Xl(e){let t;return Se&&Se.context&&(t=Se.context[e.id])!==void 0?t:e.defaultValue}function Bi(e){let t=F(e),n=F(()=>ql(t()));return n.toArray=()=>{let r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var Yl;function rf(){let e=V&&V.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Gt)da(this);else{let t=tt;tt=null,Jt(()=>Ni(this),!1),tt=t}if(De){let t=this.observers?this.observers.length:0;De.sources?(De.sources.push(this),De.sourceSlots.push(t)):(De.sources=[this],De.sourceSlots=[t]),this.observers?(this.observers.push(De),this.observerSlots.push(De.sources.length-1)):(this.observers=[De],this.observerSlots=[De.sources.length-1])}return e&&V.sources.has(this)?this.tValue:this.value}function of(e,t,n){let r=V&&V.running&&V.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(V){let o=V.running;(o||!n&&V.sources.has(e))&&(V.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Jt(()=>{for(let o=0;o<e.observers.length;o+=1){let a=e.observers[o],i=V&&V.running;i&&V.disposed.has(a)||((i?!a.tState:!a.state)&&(a.pure?tt.push(a):gt.push(a),a.observers&&sf(a)),i?a.tState=Gt:a.state=Gt)}if(tt.length>1e6)throw tt=[],new Error},!1)}return t}function da(e){if(!e.fn)return;Yn(e);let t=Li;Zd(e,V&&V.running&&V.sources.has(e)?e.tValue:e.value,t),V&&!V.running&&V.sources.has(e)&&queueMicrotask(()=>{Jt(()=>{V&&(V.running=!0),De=Se=e,Zd(e,e.tValue,t),De=Se=null},!1)})}function Zd(e,t,n){let r,o=Se,a=De;De=Se=e;try{r=e.fn(t)}catch(i){return e.pure&&(V&&V.running?(e.tState=Gt,e.tOwned&&e.tOwned.forEach(Yn),e.tOwned=void 0):(e.state=Gt,e.owned&&e.owned.forEach(Yn),e.owned=null)),e.updatedAt=n+1,Ui(i)}finally{De=a,Se=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?of(e,r,!0):V&&V.running&&e.pure?(V.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function Ql(e,t,n,r=Gt,o){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Se,context:Se?Se.context:null,pure:n};if(V&&V.running&&(a.state=0,a.tState=r),Se===null||Se!==Qd&&(V&&V.running&&Se.pure?Se.tOwned?Se.tOwned.push(a):Se.tOwned=[a]:Se.owned?Se.owned.push(a):Se.owned=[a]),so&&a.fn){let[i,s]=R(void 0,{equals:!1}),c=so.factory(a.fn,s);de(()=>c.dispose());let l=()=>ww(s).then(()=>u.dispose()),u=so.factory(a.fn,l);a.fn=f=>(i(),V&&V.running?u.track(f):c.track(f))}return a}function ca(e){let t=V&&V.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===la)return Ni(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Li);){if(t&&V.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,a=n[r+1];for(;(o=o.owner)&&o!==a;)if(V.disposed.has(o))return}if((t?e.tState:e.state)===Gt)da(e);else if((t?e.tState:e.state)===la){let o=tt;tt=null,Jt(()=>Ni(e,n[0]),!1),tt=o}}}function Jt(e,t){if(tt)return e();let n=!1;t||(tt=[]),gt?n=!0:gt=[],Li++;try{let r=e();return Sw(n),r}catch(r){n||(gt=null),tt=null,Ui(r)}}function Sw(e){if(tt&&(ua&&V&&V.running?Tw(tt):af(tt),tt=null),e)return;let t;if(V){if(!V.promises.size&&!V.queue.size){let r=V.sources,o=V.disposed;gt.push.apply(gt,V.effects),t=V.resolve;for(let a of gt)"tState"in a&&(a.state=a.tState),delete a.tState;V=null,Jt(()=>{for(let a of o)Yn(a);for(let a of r){if(a.value=a.tValue,a.owned)for(let i=0,s=a.owned.length;i<s;i++)Yn(a.owned[i]);a.tOwned&&(a.owned=a.tOwned),delete a.tValue,delete a.tOwned,a.tState=0}Wd(!1)},!1)}else if(V.running){V.running=!1,V.effects.push.apply(V.effects,gt),gt=null,Wd(!0);return}}let n=gt;gt=null,n.length&&Jt(()=>Xd(n),!1),t&&t()}function af(e){for(let t=0;t<e.length;t++)ca(e[t])}function Tw(e){for(let t=0;t<e.length;t++){let n=e[t],r=V.queue;r.has(n)||(r.add(n),ua(()=>{r.delete(n),Jt(()=>{V.running=!0,ca(n)},!1),V&&(V.running=!1)}))}}function Cw(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:ca(r)}if(Ce.context){if(Ce.count){Ce.effects||(Ce.effects=[]),Ce.effects.push(...e.slice(0,n));return}Zl()}for(Ce.effects&&(Ce.done||!Ce.count)&&(e=[...Ce.effects,...e],n+=Ce.effects.length,delete Ce.effects),t=0;t<n;t++)ca(e[t])}function Ni(e,t){let n=V&&V.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let a=n?o.tState:o.state;a===Gt?o!==t&&(!o.updatedAt||o.updatedAt<Li)&&ca(o):a===la&&Ni(o,t)}}}function sf(e){let t=V&&V.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=la:r.state=la,r.pure?tt.push(r):gt.push(r),r.observers&&sf(r))}}function Yn(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let a=o.pop(),i=n.observerSlots.pop();r<o.length&&(a.sourceSlots[i]=r,o[r]=a,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Yn(e.tOwned[t]);delete e.tOwned}if(V&&V.running&&e.pure)lf(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Yn(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}V&&V.running?e.tState=0:e.state=0}function lf(e,t){if(t||(e.tState=0,V.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)lf(e.owned[n])}function Ew(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Yd(e,t,n){try{for(let r of t)r(e)}catch(r){Ui(r,n&&n.owner||null)}}function Ui(e,t=Se){let n=zd&&t&&t.context&&t.context[zd],r=Ew(e);if(!n)throw r;gt?gt.push({fn(){Yd(r,n,t)},state:Gt}):Yd(r,n,t)}function ql(e){if(typeof e=="function"&&!e.length)return ql(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=ql(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function kw(e,t){return function(r){let o;return M(()=>o=Xe(()=>(Se.context={...Se.context,[e]:r.value},Bi(()=>r.children))),void 0),o}}var Aw=Symbol("fallback");function qd(e){for(let t=0;t<e.length;t++)e[t]()}function Pw(e,t,n={}){let r=[],o=[],a=[],i=0,s=t.length>1?[]:null;return de(()=>qd(a)),()=>{let c=e()||[],l=c.length,u,f;return c[Oi],Xe(()=>{let p,h,g,y,b,T,S,k,I;if(l===0)i!==0&&(qd(a),a=[],r=[],o=[],i=0,s&&(s=[])),n.fallback&&(r=[Aw],o[0]=Tr($=>(a[0]=$,n.fallback())),i=1);else if(i===0){for(o=new Array(l),f=0;f<l;f++)r[f]=c[f],o[f]=Tr(d);i=l}else{for(g=new Array(l),y=new Array(l),s&&(b=new Array(l)),T=0,S=Math.min(i,l);T<S&&r[T]===c[T];T++);for(S=i-1,k=l-1;S>=T&&k>=T&&r[S]===c[k];S--,k--)g[k]=o[S],y[k]=a[S],s&&(b[k]=s[S]);for(p=new Map,h=new Array(k+1),f=k;f>=T;f--)I=c[f],u=p.get(I),h[f]=u===void 0?-1:u,p.set(I,f);for(u=T;u<=S;u++)I=r[u],f=p.get(I),f!==void 0&&f!==-1?(g[f]=o[u],y[f]=a[u],s&&(b[f]=s[u]),f=h[f],p.set(I,f)):a[u]();for(f=T;f<l;f++)f in g?(o[f]=g[f],a[f]=y[f],s&&(s[f]=b[f],s[f](f))):o[f]=Tr(d);o=o.slice(0,i=l),r=c.slice(0)}return o});function d(p){if(a[f]=p,s){let[h,g]=R(f);return s[f]=g,t(c[f],h)}return t(c[f])}}}var Iw=!1;function m(e,t){if(Iw&&Ce.context){let n=Ce.context;Zl(vw());let r=Xe(()=>e(t||{}));return Zl(n),r}return Xe(()=>e(t||{}))}function Mi(){return!0}var Jl={get(e,t,n){return t===$t?n:e.get(t)},has(e,t){return t===$t?!0:e.has(t)},set:Mi,deleteProperty:Mi,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Mi,deleteProperty:Mi}},ownKeys(e){return e.keys()}};function Wl(e){return(e=typeof e=="function"?e():e)?e:{}}function _w(){for(let e=0,t=this.length;e<t;++e){let n=this[e]();if(n!==void 0)return n}}function Ee(...e){let t=!1;for(let i=0;i<e.length;i++){let s=e[i];t=t||!!s&&$t in s,e[i]=typeof s=="function"?(t=!0,F(s)):s}if(Jd&&t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){let c=Wl(e[s])[i];if(c!==void 0)return c}},has(i){for(let s=e.length-1;s>=0;s--)if(i in Wl(e[s]))return!0;return!1},keys(){let i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(Wl(e[s])));return[...new Set(i)]}},Jl);let n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){let s=e[i];if(!s)continue;let c=Object.getOwnPropertyNames(s);for(let l=c.length-1;l>=0;l--){let u=c[l];if(u==="__proto__"||u==="constructor")continue;let f=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=f.get?{enumerable:!0,configurable:!0,get:_w.bind(n[u]=[f.get.bind(s)])}:f.value!==void 0?f:void 0;else{let d=n[u];d&&(f.get?d.push(f.get.bind(s)):f.value!==void 0&&d.push(()=>f.value))}}}let o={},a=Object.keys(r);for(let i=a.length-1;i>=0;i--){let s=a[i],c=r[s];c&&c.get?Object.defineProperty(o,s,c):o[s]=c?c.value:void 0}return o}function ze(e,...t){if(Jd&&$t in e){let o=new Set(t.length>1?t.flat():t[0]),a=t.map(i=>new Proxy({get(s){return i.includes(s)?e[s]:void 0},has(s){return i.includes(s)&&s in e},keys(){return i.filter(s=>s in e)}},Jl));return a.push(new Proxy({get(i){return o.has(i)?void 0:e[i]},has(i){return o.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!o.has(i))}},Jl)),a}let n={},r=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let a=Object.getOwnPropertyDescriptor(e,o),i=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable,s=!1,c=0;for(let l of t)l.includes(o)&&(s=!0,i?r[c][o]=a.value:Object.defineProperty(r[c],o,a)),++c;s||(i?n[o]=a.value:Object.defineProperty(n,o,a))}return[...r,n]}var Mw=0;function mn(){return Ce.context?Ce.getNextContextId():`cl-${Mw++}`}var cf=e=>`Stale read from <${e}>.`;function we(e){let t="fallback"in e&&{fallback:()=>e.fallback};return F(Pw(()=>e.each,e.children,t||void 0))}function B(e){let t=e.keyed,n=F(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return F(()=>{let r=n();if(r){let o=e.children;return typeof o=="function"&&o.length>0?Xe(()=>o(t?r:()=>{if(!Xe(n))throw cf("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Me(e){let t=!1,n=(a,i)=>(t?a[1]===i[1]:!a[1]==!i[1])&&a[2]===i[2],r=Bi(()=>e.children),o=F(()=>{let a=r();Array.isArray(a)||(a=[a]);for(let i=0;i<a.length;i++){let s=a[i].when;if(s)return t=!!a[i].keyed,[i,s,a[i]]}return[-1]},void 0,{equals:n});return F(()=>{let[a,i,s]=o();if(a<0)return e.fallback;let c=s.children;return typeof c=="function"&&c.length>0?Xe(()=>c(t?i:()=>{if(Xe(o)[0]!==a)throw cf("Match");return s.when})):c},void 0,void 0)}function Z(e){return e}var Rw=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Nw=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Rw]),Ow=new Set(["innerHTML","textContent","innerText","children"]),Lw=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Dw=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Bw(e,t){let n=Dw[e];return typeof n=="object"?n[t]?n.$:void 0:n}var Uw=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Fw=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),$w={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Gw(e,t,n){let r=n.length,o=t.length,a=r,i=0,s=0,c=t[o-1].nextSibling,l=null;for(;i<o||s<a;){if(t[i]===n[s]){i++,s++;continue}for(;t[o-1]===n[a-1];)o--,a--;if(o===i){let u=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],u)}else if(a===s)for(;i<o;)(!l||!l.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[a-1]&&n[s]===t[o-1]){let u=t[--o].nextSibling;e.insertBefore(n[s++],t[i++].nextSibling),e.insertBefore(n[--a],u),t[o]=n[a]}else{if(!l){l=new Map;let f=s;for(;f<a;)l.set(n[f],f++)}let u=l.get(t[i]);if(u!=null)if(s<u&&u<a){let f=i,d=1,p;for(;++f<o&&f<a&&!((p=l.get(t[f]))==null||p!==u+d);)d++;if(d>u-s){let h=t[i];for(;s<u;)e.insertBefore(n[s++],h)}else e.replaceChild(n[s++],t[i++])}else i++;else t[i++].remove()}}}var uf="_$DX_DELEGATE";function C(e,t,n){let r,o=()=>{let i=document.createElement("template");return i.innerHTML=e,n?i.content.firstChild.firstChild:i.content.firstChild},a=t?()=>Xe(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return a.cloneNode=a,a}function He(e,t=window.document){let n=t[uf]||(t[uf]=new Set);for(let r=0,o=e.length;r<o;r++){let a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,Zw))}}function K(e,t,n){Cr(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Hw(e,t,n,r){Cr(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Kw(e,t,n){Cr(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function U(e,t){Cr(e)||(t==null?e.removeAttribute("class"):e.className=t)}function We(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let o=n[0];e.addEventListener(t,n[0]=a=>o.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Vw(e,t,n={}){let r=Object.keys(t||{}),o=Object.keys(n),a,i;for(a=0,i=o.length;a<i;a++){let s=o[a];!s||s==="undefined"||t[s]||(df(e,s,!1),delete n[s])}for(a=0,i=r.length;a<i;a++){let s=r[a],c=!!t[s];!s||s==="undefined"||n[s]===c||!c||(df(e,s,!0),n[s]=c)}return n}function tc(e,t,n){if(!t)return n?K(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)o=t[a],o!==n[a]&&(r.setProperty(a,o),n[a]=o);return n}function ke(e,t={},n,r){let o={};return r||M(()=>o.children=uo(e,t.children,o.children)),M(()=>typeof t.ref=="function"&&he(t.ref,e)),M(()=>jw(e,t,n,!0,o,!0)),o}function he(e,t,n){return Xe(()=>e(t,n))}function x(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return uo(e,t,r,n);M(o=>uo(e,t(),o,n),r)}function jw(e,t,n,r,o={},a=!1){t||(t={});for(let i in o)if(!(i in t)){if(i==="children")continue;o[i]=ff(e,i,null,o[i],n,a,t)}for(let i in t){if(i==="children"){r||uo(e,t.children);continue}let s=t[i];o[i]=ff(e,i,s,o[i],n,a,t)}}function zw(e){let t,n;return!Cr()||!(t=Ce.registry.get(n=Yw()))?e():(Ce.completed&&Ce.completed.add(t),Ce.registry.delete(n),t)}function Cr(e){return!!Ce.context&&!Ce.done&&(!e||e.isConnected)}function Ww(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function df(e,t,n){let r=t.trim().split(/\s+/);for(let o=0,a=r.length;o<a;o++)e.classList.toggle(r[o],n)}function ff(e,t,n,r,o,a,i){let s,c,l,u,f;if(t==="style")return tc(e,n,r);if(t==="classList")return Vw(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){let d=t.slice(3);r&&e.removeEventListener(d,r,typeof r!="function"&&r),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){let d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){let d=t.slice(2).toLowerCase(),p=Uw.has(d);if(!p&&r){let h=Array.isArray(r)?r[0]:r;e.removeEventListener(d,h)}(p||n)&&(We(e,d,n,p),p&&He([d]))}else if(t.slice(0,5)==="attr:")K(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Kw(e,t.slice(5),n);else if((f=t.slice(0,5)==="prop:")||(l=Ow.has(t))||!o&&((u=Bw(t,e.tagName))||(c=Nw.has(t)))||(s=e.nodeName.includes("-")||"is"in i)){if(f)t=t.slice(5),c=!0;else if(Cr(e))return n;t==="class"||t==="className"?U(e,n):s&&!c&&!l?e[Ww(t)]=n:e[u||t]=n}else{let d=o&&t.indexOf(":")>-1&&$w[t.split(":")[0]];d?Hw(e,d,t,n):K(e,Lw[t]||t,n)}return n}function Zw(e){if(Ce.registry&&Ce.events&&Ce.events.find(([c,l])=>l===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,a=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),i=()=>{let c=t[n];if(c&&!t.disabled){let l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ce.registry&&!Ce.done&&(Ce.done=_$HY.done=!0),e.composedPath){let c=e.composedPath();a(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!i());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();a(r)}function uo(e,t,n,r,o){let a=Cr(e);if(a){!n&&(n=[...e.childNodes]);let c=[];for(let l=0;l<n.length;l++){let u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():c.push(u)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;let i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(a||i==="number"&&(t=t.toString(),t===n))return n;if(s){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=co(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(a)return n;n=co(e,n,r)}else{if(i==="function")return M(()=>{let c=t();for(;typeof c=="function";)c=c();n=uo(e,c,n,r)}),()=>n;if(Array.isArray(t)){let c=[],l=n&&Array.isArray(n);if(ec(c,t,n,o))return M(()=>n=uo(e,c,n,r,!0)),()=>n;if(a){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let u=c[0];if(u.parentNode!==e)return n;let f=[u];for(;(u=u.nextSibling)!==r;)f.push(u);return n=f}if(c.length===0){if(n=co(e,n,r),s)return n}else l?n.length===0?pf(e,c,r):Gw(e,n,c):(n&&co(e),pf(e,c));n=c}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=co(e,n,r,t);co(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ec(e,t,n,r){let o=!1;for(let a=0,i=t.length;a<i;a++){let s=t[a],c=n&&n[e.length],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=ec(e,s,c)||o;else if(l==="function")if(r){for(;typeof s=="function";)s=s();o=ec(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||o}else e.push(s),o=!0;else{let u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function pf(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function co(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let a=!1;for(let i=t.length-1;i>=0;i--){let s=t[i];if(o!==s){let c=s.parentNode===e;!a&&!i?c?e.replaceChild(o,s):e.insertBefore(o,n):c&&s.remove()}else a=!0}}else e.insertBefore(o,n);return[o]}function Yw(){return Ce.getNextContextId()}var hR=Symbol();var qw="http://www.w3.org/2000/svg";function mf(e,t=!1){return t?document.createElementNS(qw,e):document.createElement(e)}function gf(e){let{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=lo(),a,i=!!Ce.context;return xe(()=>{i&&(lo().user=i=!1),a||(a=tf(o,()=>F(()=>e.children)));let s=r();if(s instanceof HTMLHeadElement){let[c,l]=R(!1),u=()=>l(!0);Tr(f=>x(s,()=>c()?f():a(),null)),de(u)}else{let c=mf(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),x(l,a),s.appendChild(c),e.ref&&e.ref(c),de(()=>s.removeChild(c))}},void 0,{render:!i}),n}function hf(e){let[t,n]=ze(e,["component"]),r=F(()=>t.component);return F(()=>{let o=r();switch(typeof o){case"function":return Xe(()=>o(n));case"string":let a=Fw.has(o),i=Ce.context?zw():mf(o,a);return ke(i,n,a),i}})}function Jw(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let[o,a]=R(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(i){a(()=>i)}})}return n}function Xw(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Qw(e){return(t,n)=>{let{element:r}=n;return Tr(o=>{let a=Jw(t);r.addPropertyChangedCallback((s,c)=>a[s]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});let i=e(a,n);return x(r.renderRoot,i)},Xw(r))}}function Fi(e,t,n){return arguments.length===2&&(n=t,t={}),Vd(e,t)(Qw(n))}var $i={id:void 0,agent:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},bf={...$i,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},yf={...$i,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0};var vf=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e))},fo=()=>sessionStorage.getItem("agentPaymentInProgress"),Gi=()=>{sessionStorage.removeItem("agentPaymentInProgress")};var po=class extends Error{constructor(t){super("This agent can only be executed on "+t)}};var gn=(e,t)=>{if(typeof window<"u")return window.__ENV?window.__ENV[e]??t:void 0;if(!(typeof process>"u"))return process.env[e]??t};var eS="https://r0.ar",Pt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{let t=gn("NEXT_PUBLIC_CHAT_API_URL"),n=gn("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some(a=>a===window.location.href)))return t;let r=gn("NEXT_PUBLIC_VIEWER_URL")?.split(",");return r?.find(a=>window.location.href.startsWith(a))??r?.[0]??eS};function xf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=xf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=xf(e))&&(r&&(r+=" "),r+=t);return r}var ve=Lt;var oc="-",tS=e=>{let t=rS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{let s=i.split(oc);return s[0]===""&&s.length!==1&&s.shift(),Tf(s,t)||nS(i)},getConflictingClassGroupIds:(i,s)=>{let c=n[i]||[];return s&&r[i]?[...c,...r[i]]:c}}},Tf=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?Tf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let a=e.join(oc);return t.validators.find(({validator:i})=>i(a))?.classGroupId},wf=/^\[(.+)\]$/,nS=e=>{if(wf.test(e)){let t=wf.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rS=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return aS(Object.entries(e.classGroups),n).forEach(([a,i])=>{rc(i,r,a,t)}),r},rc=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let a=o===""?t:Sf(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(oS(o)){rc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,i])=>{rc(i,Sf(t,a),n,r)})})},Sf=(e,t)=>{let n=e;return t.split(oc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},oS=e=>e.isThemeGetter,aS=(e,t)=>t?e.map(([n,r])=>{let o=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[n,o]}):e,iS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(a,i)=>{n.set(a,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let i=n.get(a);if(i!==void 0)return i;if((i=r.get(a))!==void 0)return o(a,i),i},set(a,i){n.has(a)?n.set(a,i):o(a,i)}}},Cf="!",sS=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],a=t.length,i=s=>{let c=[],l=0,u=0,f;for(let y=0;y<s.length;y++){let b=s[y];if(l===0){if(b===o&&(r||s.slice(y,y+a)===t)){c.push(s.slice(u,y)),u=y+a;continue}if(b==="/"){f=y;continue}}b==="["?l++:b==="]"&&l--}let d=c.length===0?s:s.substring(u),p=d.startsWith(Cf),h=p?d.substring(1):d,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}};return n?s=>n({className:s,parseClassName:i}):i},lS=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},cS=e=>({cache:iS(e.cacheSize),parseClassName:sS(e),...tS(e)}),uS=/\s+/,dS=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(uS),s="";for(let c=i.length-1;c>=0;c-=1){let l=i[c],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}=n(l),h=!!p,g=r(h?d.substring(0,p):d);if(!g){if(!h){s=l+(s.length>0?" "+s:s);continue}if(g=r(d),!g){s=l+(s.length>0?" "+s:s);continue}h=!1}let y=lS(u).join(":"),b=f?y+Cf:y,T=b+g;if(a.includes(T))continue;a.push(T);let S=o(g,h);for(let k=0;k<S.length;++k){let I=S[k];a.push(b+I)}s=l+(s.length>0?" "+s:s)}return s};function fS(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ef(t))&&(r&&(r+=" "),r+=n);return r}var Ef=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ef(e[r]))&&(n&&(n+=" "),n+=t);return n};function pS(e,...t){let n,r,o,a=i;function i(c){let l=t.reduce((u,f)=>f(u),e());return n=cS(l),r=n.cache.get,o=n.cache.set,a=s,s(c)}function s(c){let l=r(c);if(l)return l;let u=dS(c,n);return o(c,u),u}return function(){return a(fS.apply(null,arguments))}}var Ke=e=>{let t=n=>n[e]||[];return t.isThemeGetter=!0,t},kf=/^\[(?:([a-z-]+):)?(.+)\]$/i,mS=/^\d+\/\d+$/,gS=new Set(["px","full","screen"]),hS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mn=e=>mo(e)||gS.has(e)||mS.test(e),qn=e=>go(e,"length",PS),mo=e=>!!e&&!Number.isNaN(Number(e)),nc=e=>go(e,"number",mo),fa=e=>!!e&&Number.isInteger(Number(e)),wS=e=>e.endsWith("%")&&mo(e.slice(0,-1)),ye=e=>kf.test(e),Jn=e=>hS.test(e),SS=new Set(["length","size","percentage"]),TS=e=>go(e,SS,Af),CS=e=>go(e,"position",Af),ES=new Set(["image","url"]),kS=e=>go(e,ES,_S),AS=e=>go(e,"",IS),pa=()=>!0,go=(e,t,n)=>{let r=kf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},PS=e=>bS.test(e)&&!yS.test(e),Af=()=>!1,IS=e=>vS.test(e),_S=e=>xS.test(e);var MS=()=>{let e=Ke("colors"),t=Ke("spacing"),n=Ke("blur"),r=Ke("brightness"),o=Ke("borderColor"),a=Ke("borderRadius"),i=Ke("borderSpacing"),s=Ke("borderWidth"),c=Ke("contrast"),l=Ke("grayscale"),u=Ke("hueRotate"),f=Ke("invert"),d=Ke("gap"),p=Ke("gradientColorStops"),h=Ke("gradientColorStopPositions"),g=Ke("inset"),y=Ke("margin"),b=Ke("opacity"),T=Ke("padding"),S=Ke("saturate"),k=Ke("scale"),I=Ke("sepia"),$=Ke("skew"),O=Ke("space"),Q=Ke("translate"),H=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",ye,t],P=()=>[ye,t],E=()=>["",Mn,qn],w=()=>["auto",mo,ye],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",ye],Ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[mo,ye];return{cacheSize:500,separator:":",theme:{colors:[pa],spacing:[Mn,qn],blur:["none","",Jn,ye],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",Jn,ye],borderSpacing:P(),borderWidth:E(),contrast:Ae(),grayscale:ge(),hueRotate:Ae(),invert:ge(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[wS,qn],inset:L(),margin:L(),opacity:Ae(),padding:P(),saturate:Ae(),scale:Ae(),sepia:ge(),skew:Ae(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[Jn]}],"break-after":[{"break-after":Ne()}],"break-before":[{"break-before":Ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),ye]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fa,ye]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",fa,ye]}],"grid-cols":[{"grid-cols":[pa]}],"col-start-end":[{col:["auto",{span:["full",fa,ye]},ye]}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":[pa]}],"row-start-end":[{row:["auto",{span:[fa,ye]},ye]}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[Jn]},Jn]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jn,qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",nc]}],"font-family":[{font:[pa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",mo,nc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mn,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mn,qn]}],"underline-offset":[{"underline-offset":["auto",Mn,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),CS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",TS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kS]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:_()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[Mn,ye]}],"outline-w":[{outline:[Mn,qn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Mn,qn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jn,AS]}],"shadow-color":[{shadow:[pa]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Jn,ye]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:Ae()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:Ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[fa,ye]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mn,qn,nc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Pf=pS(MS);var BC=Sr(Tp(),1),UC=Sr(Ep(),1);var UR=String.fromCharCode;var vT={AF:"Africa",AN:"Antarctica",AS:"Asia",EU:"Europe",NA:"North America",OC:"Oceania",SA:"South America"},jR=Object.keys(vT);var xT={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo (Republic)",CD:"Congo (Democratic Republic)",CK:"Cook Islands",CR:"Costa Rica",CI:"Ivory Coast",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Vatican City",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Laos",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia",MD:"Moldova",MC:"Monaco",MN:"Mongolia",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MK:"Macedonia",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Eswatini",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Vietnam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe",AX:"\xC5land Islands",BQ:"Bonaire, Sint Eustatius and Saba",CW:"Cura\xE7ao",GG:"Guernsey",IM:"Isle of Man",JE:"Jersey",ME:"Montenegro",BL:"Saint Barth\xE9lemy",MF:"Saint Martin (French part)",RS:"Serbia",SX:"Sint Maarten (Dutch part)",SS:"South Sudan",XK:"Kosovo"},WR=Object.keys(xT);var $e=Sr(Wp()),aN=$e.Prisma.JsonNull,iN=$e.Prisma.DbNull;var cN=process.env.NEXT_PUBLIC_APP_NAME||"Release0.com",Zp={id:"release0_workspace",createdAt:new Date,updatedAt:new Date,name:"release0",slug:"release0",plan:$e.Plan.ENTERPRISE,isQuarantined:!1,isSuspended:!1,isPastDue:!1};var uN=`https://${process.env.NEXT_PUBLIC_APP_DOMAIN}`,dN=process.env.NEXT_PUBLIC_VERCEL_ENV==="production"?`https://app.${process.env.NEXT_PUBLIC_APP_DOMAIN}`:process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"?`https://preview.${process.env.NEXT_PUBLIC_APP_DOMAIN}`:"http://localhost:7777";var fN=`${process.env.NEXT_PUBLIC_APP_URL}/images/logo512.png`;var OC=process.env.NEXT_PUBLIC_SHORT_DOMAINS||"r0.ar",LC=OC.split(";").map(e=>e.trim()).filter(Boolean),gN=LC.map((e,t)=>({id:`release0_${e.replace(/\./g,"_")}`,slug:e,verified:!0,primary:t===0,archived:!1,workspaceId:Zp.id}));var wN=60*60*24*14;var Yp=1e9,Co=[{type:$e.Plan.HOBBY,name:"Hobby",tagline:"For hobby & side projects",price:{monthly:0,yearly:0},limits:{agents:20,chats:250,seats:2,tags:2,domains:0,analyticsRetentionMonths:3,agentVersioning:1,publishedAgentVersioning:1},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!1,customizeBrand:!1,restrictedBlocks:["payment input"],support:"Online support"}},{type:$e.Plan.PRO,name:"Pro",tagline:"For startups & small businesses",price:{monthly:39,yearly:31},limits:{agents:100,chats:2500,seats:5,tags:10,domains:1,analyticsRetentionMonths:12,agentVersioning:10,publishedAgentVersioning:10},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!0,customizeBrand:!1,restrictedBlocks:[],support:"Online support"}},{type:$e.Plan.BUSINESS,name:"Business",tagline:"For growing teams & established companies",price:{monthly:89,yearly:69},limits:{agents:500,chats:1e4,seats:20,tags:50,domains:10,analyticsRetentionMonths:24,agentVersioning:20,publishedAgentVersioning:20},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!0,customizeBrand:!0,restrictedBlocks:[],support:"Priority support"}},{type:$e.Plan.ADVANCED,name:"Advanced",tagline:"For high-scale operations & enterprise needs",price:{monthly:149,yearly:110},limits:{agents:Yp,chats:25e3,seats:50,tags:500,domains:50,analyticsRetentionMonths:60,agentVersioning:40,publishedAgentVersioning:40},feature:{agentPassword:!0,agentExpiration:!0,removeBrand:!0,customizeBrand:!0,restrictedBlocks:[],support:"Priority support"}},{type:$e.Plan.ENTERPRISE,name:"Enterprise",tagline:"Custom solutions for scale. Whether you're launching AI agents across enterprise workflows or running high-volume campaigns with millions of interactions, Release0 is built to handle it\u2014securely, reliably, and at scale.",price:{monthly:null,yearly:null},feature:{support:"Dedicated success manager"}},{type:$e.Plan.CUSTOM_APPSUMO_TIER1,name:"Appsumo - Tier 1",shortName:"Tier 1",tagline:"For hobby & side projects",price:{monthly:0,yearly:0},limits:{agents:50,chats:1500,seats:2,tags:10,domains:1,analyticsRetentionMonths:12,agentVersioning:10,publishedAgentVersioning:10},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!1,customizeBrand:!1,restrictedBlocks:[]}},{type:$e.Plan.CUSTOM_APPSUMO_TIER2,name:"Appsumo - Tier 2",shortName:"Tier 2",tagline:"For growing teams & established companies",price:{monthly:0,yearly:0},limits:{agents:100,chats:3e3,seats:4,tags:20,domains:2,analyticsRetentionMonths:24,agentVersioning:20,publishedAgentVersioning:20},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!0,customizeBrand:!1,restrictedBlocks:[]}},{type:$e.Plan.CUSTOM_APPSUMO_TIER3,name:"Appsumo - Tier 3",shortName:"Tier 3",tagline:"For growing teams & established companies",price:{monthly:0,yearly:0},limits:{agents:150,chats:4500,seats:6,tags:30,domains:3,analyticsRetentionMonths:36,agentVersioning:30,publishedAgentVersioning:30},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!0,customizeBrand:!1,restrictedBlocks:[]}},{type:$e.Plan.CUSTOM_APPSUMO_TIER4,name:"Appsumo - Tier 4",shortName:"Tier 4",tagline:"For growing teams & established companies",price:{monthly:0,yearly:0},limits:{agents:200,chats:6e3,seats:8,tags:40,domains:4,analyticsRetentionMonths:48,agentVersioning:20,publishedAgentVersioning:20},feature:{agentPassword:!1,agentExpiration:!1,removeBrand:!1,customizeBrand:!1,restrictedBlocks:[]}},{type:$e.Plan.CUSTOM_APPSUMO_TIER5,name:"Appsumo - Tier 5",shortName:"Tier 3",tagline:"For growing teams & established companies",price:{monthly:0,yearly:0},limits:{agents:250,chats:7500,seats:10,tags:50,domains:5,analyticsRetentionMonths:60,agentVersioning:20,publishedAgentVersioning:20},feature:{agentPassword:!0,agentExpiration:!0,removeBrand:!0,customizeBrand:!0,restrictedBlocks:[]}}],CN=Co.find(e=>e.type===$e.Plan.HOBBY),EN=Co.find(e=>e.type===$e.Plan.PRO),kN=Co.find(e=>e.type===$e.Plan.BUSINESS),AN=Co.find(e=>e.type===$e.Plan.ADVANCED),PN=Co.find(e=>e.type===$e.Plan.ADVANCED);var IN=Co.filter(e=>e.type!==$e.Plan.HOBBY&&e.type!==$e.Plan.ENTERPRISE&&!e.type.startsWith("CUSTOM"));var DC={"AF-BDS":"Badakhsh\u0101n","AF-BDG":"B\u0101dgh\u012Bs","AF-BGL":"Baghl\u0101n","AF-BAL":"Balkh","AF-BAM":"B\u0101my\u0101n","AF-DAY":"D\u0101ykund\u012B","AF-FRA":"Far\u0101h","AF-FYB":"F\u0101ry\u0101b","AF-GHA":"Ghazn\u012B","AF-GHO":"Gh\u014Dr","AF-HEL":"Helmand","AF-HER":"Her\u0101t","AF-JOW":"Jowzj\u0101n","AF-KAB":"K\u0101bul","AF-KAN":"Kandah\u0101r","AF-KAP":"K\u0101p\u012Bs\u0101","AF-KHO":"Kh\u014Dst","AF-KNR":"Kuna\u1E5F","AF-KDZ":"Kunduz","AF-LAG":"Laghm\u0101n","AF-LOG":"L\u014Dgar","AF-NAN":"Nangarh\u0101r","AF-NIM":"N\u012Bmr\u014Dz","AF-NUR":"N\u016Brist\u0101n","AF-PKA":"Pakt\u012Bk\u0101","AF-PIA":"Paktiy\u0101","AF-PAN":"Panjshayr","AF-PAR":"Parw\u0101n","AF-SAM":"Samang\u0101n","AF-SAR":"Sar-e Pul","AF-TAK":"Takh\u0101r","AF-URU":"Uruzg\u0101n","AF-WAR":"Wardak","AF-ZAB":"Z\u0101bul","AL-01":"Berat","AL-09":"Dib\xEBr","AL-02":"Durr\xEBs","AL-03":"Elbasan","AL-04":"Fier","AL-05":"Gjirokast\xEBr","AL-06":"Kor\xE7\xEB","AL-07":"Kuk\xEBs","AL-08":"Lezh\xEB","AL-10":"Shkod\xEBr","AL-11":"Tiran\xEB","AL-12":"Vlor\xEB","DZ-01":"Adrar","DZ-44":"A\xEFn Defla","DZ-46":"A\xEFn T\xE9mouchent","DZ-16":"Alger","DZ-23":"Annaba","DZ-05":"Batna","DZ-08":"B\xE9char","DZ-06":"B\xE9ja\xEFa","DZ-52":"B\xE9ni Abb\xE8s","DZ-07":"Biskra","DZ-09":"Blida","DZ-50":"Bordj Badji Mokhtar","DZ-34":"Bordj Bou Arr\xE9ridj","DZ-10":"Bouira","DZ-35":"Boumerd\xE8s","DZ-02":"Chlef","DZ-25":"Constantine","DZ-56":"Djanet","DZ-17":"Djelfa","DZ-32":"El Bayadh","DZ-57":"El Meghaier","DZ-58":"El Meniaa","DZ-39":"El Oued","DZ-36":"El Tarf","DZ-47":"Gharda\xEFa","DZ-24":"Guelma","DZ-33":"Illizi","DZ-54":"In Guezzam","DZ-53":"In Salah","DZ-18":"Jijel","DZ-40":"Khenchela","DZ-03":"Laghouat","DZ-28":"M'sila","DZ-29":"Mascara","DZ-26":"M\xE9d\xE9a","DZ-43":"Mila","DZ-27":"Mostaganem","DZ-45":"Naama","DZ-31":"Oran","DZ-30":"Ouargla","DZ-51":"Ouled Djellal","DZ-04":"Oum el Bouaghi","DZ-48":"Relizane","DZ-20":"Sa\xEFda","DZ-19":"S\xE9tif","DZ-22":"Sidi Bel Abb\xE8s","DZ-21":"Skikda","DZ-41":"Souk Ahras","DZ-11":"Tamanrasset","DZ-12":"T\xE9bessa","DZ-14":"Tiaret","DZ-49":"Timimoun","DZ-37":"Tindouf","DZ-42":"Tipaza","DZ-38":"Tissemsilt","DZ-15":"Tizi Ouzou","DZ-13":"Tlemcen","DZ-55":"Touggourt","AD-07":"Andorra la Vella","AD-02":"Canillo","AD-03":"Encamp","AD-08":"Escaldes-Engordany","AD-04":"La Massana","AD-05":"Ordino","AD-06":"Sant Juli\xE0 de L\xF2ria","AO-BGO":"Bengo","AO-BGU":"Benguela","AO-BIE":"Bi\xE9","AO-CAB":"Cabinda","AO-CCU":"Cuando Cubango","AO-CNO":"Cuanza-Norte","AO-CUS":"Cuanza-Sul","AO-CNN":"Cunene","AO-HUA":"Huambo","AO-HUI":"Hu\xEDla","AO-LUA":"Luanda","AO-LNO":"Lunda-Norte","AO-LSU":"Lunda-Sul","AO-MAL":"Malange","AO-MOX":"Moxico","AO-NAM":"Namibe","AO-UIG":"U\xEDge","AO-ZAI":"Zaire","AG-03":"Saint George","AG-04":"Saint John","AG-05":"Saint Mary","AG-06":"Saint Paul","AG-07":"Saint Peter","AG-08":"Saint Philip","AG-10":"Barbuda","AG-11":"Redonda","AR-B":"Buenos Aires","AR-K":"Catamarca","AR-H":"Chaco","AR-U":"Chubut","AR-C":"Ciudad Aut\xF3noma de Buenos Aires","AR-X":"C\xF3rdoba","AR-W":"Corrientes","AR-E":"Entre R\xEDos","AR-P":"Formosa","AR-Y":"Jujuy","AR-L":"La Pampa","AR-F":"La Rioja","AR-M":"Mendoza","AR-N":"Misiones","AR-Q":"Neuqu\xE9n","AR-R":"R\xEDo Negro","AR-A":"Salta","AR-J":"San Juan","AR-D":"San Luis","AR-Z":"Santa Cruz","AR-S":"Santa Fe","AR-G":"Santiago del Estero","AR-V":"Tierra del Fuego","AR-T":"Tucum\xE1n","AM-AG":"Aragac\u0323otn","AM-AR":"Ararat","AM-AV":"Armavir","AM-ER":"Erevan","AM-GR":"Ge\u0121ark'unik'","AM-KT":"Kotayk'","AM-LO":"Lo\u1E59i","AM-SH":"\u0160irak","AM-SU":"Syunik'","AM-TV":"Tavu\u0161","AM-VD":"Vayo\u0107 Jor","AU-NSW":"New South Wales","AU-QLD":"Queensland","AU-SA":"South Australia","AU-TAS":"Tasmania","AU-VIC":"Victoria","AU-WA":"Western Australia","AU-ACT":"Australian Capital Territory","AU-NT":"Northern Territory","AT-1":"Burgenland","AT-2":"K\xE4rnten","AT-3":"Nieder\xF6sterreich","AT-4":"Ober\xF6sterreich","AT-5":"Salzburg","AT-6":"Steiermark","AT-7":"Tirol","AT-8":"Vorarlberg","AT-9":"Wien","AZ-NX":"Nax\xE7\u0131van","BS-AK":"Acklins","BS-BY":"Berry Islands","BS-BI":"Bimini","BS-BP":"Black Point","BS-CI":"Cat Island","BS-CO":"Central Abaco","BS-CS":"Central Andros","BS-CE":"Central Eleuthera","BS-FP":"City of Freeport","BS-CK":"Crooked Island and Long Cay","BS-EG":"East Grand Bahama","BS-EX":"Exuma","BS-GC":"Grand Cay","BS-HI":"Harbour Island","BS-HT":"Hope Town","BS-IN":"Inagua","BS-LI":"Long Island","BS-MC":"Mangrove Cay","BS-MG":"Mayaguana","BS-MI":"Moore's Island","BS-NP":"New Providence","BS-NO":"North Abaco","BS-NS":"North Andros","BS-NE":"North Eleuthera","BS-RI":"Ragged Island","BS-RC":"Rum Cay","BS-SS":"San Salvador","BS-SO":"South Abaco","BS-SA":"South Andros","BS-SE":"South Eleuthera","BS-SW":"Spanish Wells","BS-WG":"West Grand Bahama","BH-13":"Al \u2018\u0100\u015Fimah","BH-14":"Al Jan\u016Bb\u012Byah","BH-15":"Al Mu\u1E29arraq","BH-17":"Ash Sham\u0101l\u012Byah","BD-A":"Barishal","BD-B":"Chattogram","BD-C":"Dhaka","BD-D":"Khulna","BD-H":"Mymensingh","BD-E":"Rajshahi","BD-F":"Rangpur","BD-G":"Sylhet","BB-01":"Christ Church","BB-02":"Saint Andrew","BB-03":"Saint George","BB-04":"Saint James","BB-05":"Saint John","BB-06":"Saint Joseph","BB-07":"Saint Lucy","BB-08":"Saint Michael","BB-09":"Saint Peter","BB-10":"Saint Philip","BB-11":"Saint Thomas","BY-BR":"Brestskaya voblasts'","BY-HO":"Homyel'skaya voblasts'","BY-HM":"Horad Minsk","BY-HR":"Hrodzyenskaya voblasts'","BY-MA":"Mahilyowskaya voblasts'","BY-MI":"Minskaya voblasts'","BY-VI":"Vitsyebskaya voblasts'","BE-BRU":"Brussels Hoofdstedelijk Gewest","BE-VLG":"Vlaams Gewest","BE-WAL":"Waals Gewest[note 2]","BZ-BZ":"Belize","BZ-CY":"Cayo","BZ-CZL":"Corozal","BZ-OW":"Orange Walk","BZ-SC":"Stann Creek","BZ-TOL":"Toledo","BJ-AL":"Alibori","BJ-AK":"Atacora","BJ-AQ":"Atlantique","BJ-BO":"Borgou","BJ-CO":"Collines","BJ-KO":"Couffo","BJ-DO":"Donga","BJ-LI":"Littoral","BJ-MO":"Mono","BJ-OU":"Ou\xE9m\xE9","BJ-PL":"Plateau","BJ-ZO":"Zou","BT-33":"Bumthang","BT-12":"Chhukha","BT-22":"Dagana","BT-GA":"Gasa","BT-13":"Haa","BT-44":"Lhuentse","BT-42":"Monggar","BT-11":"Paro","BT-43":"Pema Gatshel","BT-23":"Punakha","BT-45":"Samdrup Jongkhar","BT-14":"Samtse","BT-31":"Sarpang","BT-15":"Thimphu","BT-41":"Trashigang","BT-TY":"Trashi Yangtse","BT-32":"Trongsa","BT-21":"Tsirang","BT-24":"Wangdue Phodrang","BT-34":"Zhemgang","BO-C":"Cochabamba","BO-H":"Chuquisaca","BO-B":"El Beni","BO-L":"La Paz","BO-O":"Oruro","BO-N":"Pando","BO-P":"Potos\xED","BO-S":"Santa Cruz","BO-T":"Tarija","BA-BIH":"Federacija Bosne i Hercegovine","BA-SRP":"Republika Srpska","BA-BRC":"Br\u010Dko distrikt","BW-CE":"Central","BW-CH":"Chobe","BW-FR":"Francistown","BW-GA":"Gaborone","BW-GH":"Ghanzi","BW-JW":"Jwaneng","BW-KG":"Kgalagadi","BW-KL":"Kgatleng","BW-KW":"Kweneng","BW-LO":"Lobatse","BW-NE":"North East","BW-NW":"North West","BW-SP":"Selibe Phikwe","BW-SE":"South East","BW-SO":"Southern","BW-ST":"Sowa Town","BR-AC":"Acre","BR-AL":"Alagoas","BR-AP":"Amap\xE1","BR-AM":"Amazonas","BR-BA":"Bahia","BR-CE":"Cear\xE1","BR-DF":"Distrito Federal","BR-ES":"Esp\xEDrito Santo","BR-GO":"Goi\xE1s","BR-MA":"Maranh\xE3o","BR-MT":"Mato Grosso","BR-MS":"Mato Grosso do Sul","BR-MG":"Minas Gerais","BR-PA":"Par\xE1","BR-PB":"Para\xEDba","BR-PR":"Paran\xE1","BR-PE":"Pernambuco","BR-PI":"Piau\xED","BR-RJ":"Rio de Janeiro","BR-RN":"Rio Grande do Norte","BR-RS":"Rio Grande do Sul","BR-RO":"Rond\xF4nia","BR-RR":"Roraima","BR-SC":"Santa Catarina","BR-SP":"S\xE3o Paulo","BR-SE":"Sergipe","BR-TO":"Tocantins","BN-BE":"Belait","BN-BM":"Brunei-Muara","BN-TE":"Temburong","BN-TU":"Tutong","BG-01":"Blagoevgrad","BG-02":"Burgas","BG-08":"Dobrich","BG-07":"Gabrovo","BG-26":"Haskovo","BG-09":"Kardzhali","BG-10":"Kyustendil","BG-11":"Lovech","BG-12":"Montana","BG-13":"Pazardzhik","BG-14":"Pernik","BG-15":"Pleven","BG-16":"Plovdiv","BG-17":"Razgrad","BG-18":"Ruse","BG-27":"Shumen","BG-19":"Silistra","BG-20":"Sliven","BG-21":"Smolyan","BG-23":"Sofia","BG-22":"Sofia (stolitsa)","BG-24":"Stara Zagora","BG-25":"Targovishte","BG-03":"Varna","BG-04":"Veliko Tarnovo","BG-05":"Vidin","BG-06":"Vratsa","BG-28":"Yambol","BF-01":"Boucle du Mouhoun","BF-02":"Cascades","BF-03":"Centre","BF-04":"Centre-Est","BF-05":"Centre-Nord","BF-06":"Centre-Ouest","BF-07":"Centre-Sud","BF-08":"Est","BF-09":"Hauts-Bassins","BF-10":"Nord","BF-11":"Plateau-Central","BF-12":"Sahel","BF-13":"Sud-Ouest","BI-BB":"Bubanza","BI-BM":"Bujumbura Mairie","BI-BL":"Bujumbura Rural","BI-BR":"Bururi","BI-CA":"Cankuzo","BI-CI":"Cibitoke","BI-GI":"Gitega","BI-KR":"Karuzi","BI-KY":"Kayanza","BI-KI":"Kirundo","BI-MA":"Makamba","BI-MU":"Muramvya","BI-MY":"Muyinga","BI-MW":"Mwaro","BI-NG":"Ngozi","BI-RM":"Rumonge","BI-RT":"Rutana","BI-RY":"Ruyigi","KH-2":"Baat Dambang","KH-1":"Banteay Mean Cho\u0103y","KH-23":"Kaeb","KH-3":"Kampong Chaam","KH-4":"Kampong Chhnang","KH-5":"Kampong Spueu","KH-6":"Kampong Thum","KH-7":"Kampot","KH-8":"Kandaal","KH-9":"Kaoh Kong","KH-10":"Kracheh","KH-11":"Mondol Kiri","KH-22":"Otdar Mean Chey","KH-24":"Pailin","KH-12":"Phnom Penh","KH-15":"Pousaat","KH-18":"Preah Sihanouk","KH-13":"Preah Vihear","KH-14":"Prey Veaeng","KH-16":"Rotanak Kiri","KH-17":"Siem Reab","KH-19":"Stueng Traeng","KH-20":"Svaay Rieng","KH-21":"Taakaev","KH-25":"Tbong Khmum","CM-AD":"Adamaoua","CM-CE":"Centre","CM-ES":"East","CM-EN":"Far North","CM-LT":"Littoral","CM-NO":"North","CM-NW":"North-West","CM-SU":"South","CM-SW":"South-West","CM-OU":"West","CA-AB":"Alberta","CA-BC":"British Columbia","CA-MB":"Manitoba","CA-NB":"New Brunswick","CA-NL":"Newfoundland and Labrador","CA-NT":"Northwest Territories","CA-NS":"Nova Scotia","CA-NU":"Nunavut","CA-ON":"Ontario","CA-PE":"Prince Edward Island","CA-QC":"Quebec","CA-SK":"Saskatchewan","CA-YT":"Yukon","CV-B":"Ilhas de Barlavento","CV-S":"Ilhas de Sotavento","CF-BB":"Bamingui-Bangoran","CF-BGF":"Bangui","CF-BK":"Basse-Kotto","CF-KB":"Gribingui","CF-HM":"Haut-Mbomou","CF-HK":"Haute-Kotto","CF-HS":"Haute-Sangha / Mamb\xE9r\xE9-Kad\xE9\xEF","CF-KG":"K\xE9mo-Gribingui","CF-LB":"Lobaye","CF-MB":"Mbomou","CF-NM":"Nana-Mamb\xE9r\xE9","CF-MP":"Ombella-Mpoko","CF-UK":"Ouaka","CF-AC":"Ouham","CF-OP":"Ouham-Pend\xE9","CF-SE":"Sangha","CF-VK":"Vakaga","TD-BG":"Ba\u1E29r al Ghaz\u0101l","TD-BA":"Al Ba\u0163\u1E29\u0101\u2019","TD-BO":"B\u016Brk\u016B","TD-CB":"Sh\u0101r\u012B B\u0101qirm\u012B","TD-EE":"In\u012Bd\u012B ash Sharq\u012B","TD-EO":"In\u012Bd\u012B al Gharb\u012B","TD-GR":"Q\u012Br\u0101","TD-HL":"\u1E28ajjar Lam\u012Bs","TD-KA":"K\u0101nim","TD-LC":"Al Bu\u1E29ayrah","TD-LO":"L\u016Bgh\u016Bn al Gharb\u012B","TD-LR":"L\u016Bgh\u016Bn ash Sharq\u012B","TD-MA":"M\u0101nd\u016Bl","TD-ME":"M\u0101y\u016B K\u012Bbb\u012B ash Sharq\u012B","TD-MO":"M\u0101y\u016B K\u012Bbb\u012B al Gharb\u012B","TD-MC":"Sh\u0101r\u012B al Awsa\u0163","TD-OD":"Wadd\u0101y","TD-SA":"Sal\u0101m\u0101t","TD-SI":"S\u012Bl\u0101","TD-TA":"T\u0101nj\u012Bl\u012B","TD-TI":"Tibast\u012B","TD-ND":"Mad\u012Bnat Injam\u012Bn\u0101","TD-WF":"W\u0101d\u012B F\u012Br\u0101\u2019","CL-AI":"Ais\xE9n del General Carlos Iba\xF1ez del Campo","CL-AN":"Antofagasta","CL-AP":"Arica y Parinacota","CL-AT":"Atacama","CL-BI":"Biob\xEDo","CL-CO":"Coquimbo","CL-AR":"La Araucan\xEDa","CL-LI":"Libertador General Bernardo O'Higgins","CL-LL":"Los Lagos","CL-LR":"Los R\xEDos","CL-MA":"Magallanes","CL-ML":"Maule","CL-NB":"\xD1uble","CL-RM":"Regi\xF3n Metropolitana de Santiago","CL-TA":"Tarapac\xE1","CL-VS":"Valpara\xEDso","CN-AH":"Anhui Sheng","CN-BJ":"Beijing Shi","CN-CQ":"Chongqing Shi","CN-FJ":"Fujian Sheng","CN-GS":"Gansu Sheng","CN-GD":"Guangdong Sheng","CN-GX":"Guangxi Zhuangzu Zizhiqu","CN-GZ":"Guizhou Sheng","CN-HI":"Hainan Sheng","CN-HE":"Hebei Sheng","CN-HL":"Heilongjiang Sheng","CN-HA":"Henan Sheng","CN-HK":"Hong Kong SARen","CN-HB":"Hubei Sheng","CN-HN":"Hunan Sheng","CN-JS":"Jiangsu Sheng","CN-JX":"Jiangxi Sheng","CN-JL":"Jilin Sheng","CN-LN":"Liaoning Sheng","CN-MO":"Macao SARpt","CN-NM":"Nei Mongol Zizhiqu","CN-NX":"Ningxia Huizu Zizhiqu","CN-QH":"Qinghai Sheng","CN-SN":"Shaanxi Sheng","CN-SD":"Shandong Sheng","CN-SH":"Shanghai Shi","CN-SX":"Shanxi Sheng","CN-SC":"Sichuan Sheng","CN-TW":"Taiwan Sheng","CN-TJ":"Tianjin Shi","CN-XJ":"Xinjiang Uygur Zizhiqu","CN-XZ":"Xizang Zizhiqu","CN-YN":"Yunnan Sheng","CN-ZJ":"Zhejiang Sheng","CO-AMA":"Amazonas","CO-ANT":"Antioquia","CO-ARA":"Arauca","CO-ATL":"Atl\xE1ntico","CO-BOL":"Bol\xEDvar","CO-BOY":"Boyac\xE1","CO-CAL":"Caldas","CO-CAQ":"Caquet\xE1","CO-CAS":"Casanare","CO-CAU":"Cauca","CO-CES":"Cesar","CO-COR":"C\xF3rdoba","CO-CUN":"Cundinamarca","CO-CHO":"Choc\xF3","CO-DC":"Distrito Capital de Bogot\xE1","CO-GUA":"Guain\xEDa","CO-GUV":"Guaviare","CO-HUI":"Huila","CO-LAG":"La Guajira","CO-MAG":"Magdalena","CO-MET":"Meta","CO-NAR":"Nari\xF1o","CO-NSA":"Norte de Santander","CO-PUT":"Putumayo","CO-QUI":"Quind\xEDo","CO-RIS":"Risaralda","CO-SAP":"San Andr\xE9s","CO-SAN":"Santander","CO-SUC":"Sucre","CO-TOL":"Tolima","CO-VAC":"Valle del Cauca","CO-VAU":"Vaup\xE9s","CO-VID":"Vichada","KM-G":"Grande Comore","KM-A":"Anjouan","KM-M":"Moh\xE9li","CG-11":"Bouenza","CG-BZV":"Brazzaville","CG-8":"Cuvette","CG-15":"Cuvette-Ouest","CG-5":"Kouilou","CG-2":"L\xE9koumou","CG-7":"Likouala","CG-9":"Niari","CG-14":"Plateaux","CG-16":"Pointe-Noire","CG-12":"Pool","CG-13":"Sangha","CD-BU":"Bas-U\xE9l\xE9","CD-EQ":"\xC9quateur","CD-HK":"Haut-Katanga","CD-HL":"Haut-Lomami","CD-HU":"Haut-U\xE9l\xE9","CD-IT":"Ituri","CD-KS":"Kasa\xEF","CD-KC":"Kasa\xEF Central","CD-KE":"Kasa\xEF Oriental","CD-KN":"Kinshasa","CD-BC":"Kongo Central","CD-KG":"Kwango","CD-KL":"Kwilu","CD-LO":"Lomami","CD-LU":"Lualaba","CD-MN":"Mai-Ndombe","CD-MA":"Maniema","CD-MO":"Mongala","CD-NK":"Nord-Kivu","CD-NU":"Nord-Ubangi","CD-SA":"Sankuru","CD-SK":"Sud-Kivu","CD-SU":"Sud-Ubangi","CD-TA":"Tanganyika","CD-TO":"Tshopo","CD-TU":"Tshuapa","CR-A":"Alajuela","CR-C":"Cartago","CR-G":"Guanacaste","CR-H":"Heredia","CR-L":"Lim\xF3n","CR-P":"Puntarenas","CR-SJ":"San Jos\xE9","CI-AB":"Abidjan","CI-BS":"Bas-Sassandra","CI-CM":"Como\xE9","CI-DN":"Dengu\xE9l\xE9","CI-GD":"G\xF4h-Djiboua","CI-LC":"Lacs","CI-LG":"Lagunes","CI-MG":"Montagnes","CI-SM":"Sassandra-Marahou\xE9","CI-SV":"Savanes","CI-VB":"Vall\xE9e du Bandama","CI-WR":"Woroba","CI-YM":"Yamoussoukro","CI-ZZ":"Zanzan","HR-07":"Bjelovarsko-bilogorska \u017Eupanija","HR-12":"Brodsko-posavska \u017Eupanija","HR-19":"Dubrova\u010Dko-neretvanska \u017Eupanija","HR-21":"Grad Zagreb","HR-18":"Istarska \u017Eupanija","HR-04":"Karlova\u010Dka \u017Eupanija","HR-06":"Koprivni\u010Dko-kri\u017Eeva\u010Dka \u017Eupanija","HR-02":"Krapinsko-zagorska \u017Eupanija","HR-09":"Li\u010Dko-senjska \u017Eupanija","HR-20":"Me\u0111imurska \u017Eupanija","HR-14":"Osje\u010Dko-baranjska \u017Eupanija","HR-11":"Po\u017Ee\u0161ko-slavonska \u017Eupanija","HR-08":"Primorsko-goranska \u017Eupanija","HR-03":"Sisa\u010Dko-moslava\u010Dka \u017Eupanija","HR-17":"Splitsko-dalmatinska \u017Eupanija","HR-15":"\u0160ibensko-kninska \u017Eupanija","HR-05":"Vara\u017Edinska \u017Eupanija","HR-10":"Viroviti\u010Dko-podravska \u017Eupanija","HR-16":"Vukovarsko-srijemska \u017Eupanija","HR-13":"Zadarska \u017Eupanija","HR-01":"Zagreba\u010Dka \u017Eupanija","CU-15":"Artemisa","CU-09":"Camag\xFCey","CU-08":"Ciego de \xC1vila","CU-06":"Cienfuegos","CU-12":"Granma","CU-14":"Guant\xE1namo","CU-11":"Holgu\xEDn","CU-03":"La Habana","CU-10":"Las Tunas","CU-04":"Matanzas","CU-16":"Mayabeque","CU-01":"Pinar del R\xEDo","CU-07":"Sancti Sp\xEDritus","CU-13":"Santiago de Cuba","CU-05":"Villa Clara","CU-99":"Isla de la Juventud","CY-04":"Ammochostos","CY-06":"Keryneia","CY-03":"Larnaka","CY-01":"Lefkosia","CY-02":"Lemesos","CY-05":"Pafos","CZ-31":"Jiho\u010Desk\xFD kraj","CZ-64":"Jihomoravsk\xFD kraj","CZ-41":"Karlovarsk\xFD kraj","CZ-52":"Kr\xE1lov\xE9hradeck\xFD kraj","CZ-51":"Libereck\xFD kraj","CZ-80":"Moravskoslezsk\xFD kraj","CZ-71":"Olomouck\xFD kraj","CZ-53":"Pardubick\xFD kraj","CZ-32":"Plze\u0148sk\xFD kraj","CZ-10":"Praha","CZ-20":"St\u0159edo\u010Desk\xFD kraj","CZ-42":"\xDAsteck\xFD kraj","CZ-63":"Kraj Vyso\u010Dina","CZ-72":"Zl\xEDnsk\xFD kraj","DK-84":"Region Hovedstaden","DK-82":"Region Midjylland","DK-81":"Region Nordjylland","DK-85":"Region Sj\xE6lland","DK-83":"Region Syddanmark","DJ-AS":"Ali Sabieh","DJ-AR":"Arta","DJ-DI":"Dikhil","DJ-DJ":"Djibouti","DJ-OB":"Obock","DJ-TA":"Tadjourah","DM-02":"Saint Andrew","DM-03":"Saint David","DM-04":"Saint George","DM-05":"Saint John","DM-06":"Saint Joseph","DM-07":"Saint Luke","DM-08":"Saint Mark","DM-09":"Saint Patrick","DM-10":"Saint Paul","DM-11":"Saint Peter","DO-33":"Cibao Nordeste","DO-34":"Cibao Noroeste","DO-35":"Cibao Norte","DO-36":"Cibao Sur","DO-37":"El Valle","DO-38":"Enriquillo","DO-39":"Higuamo","DO-40":"Ozama","DO-41":"Valdesia","DO-42":"Yuma","EC-A":"Azuay","EC-B":"Bol\xEDvar","EC-F":"Ca\xF1ar","EC-C":"Carchi","EC-H":"Chimborazo","EC-X":"Cotopaxi","EC-O":"El Oro","EC-E":"Esmeraldas","EC-W":"Gal\xE1pagos","EC-G":"Guayas","EC-I":"Imbabura","EC-L":"Loja","EC-R":"Los R\xEDos","EC-M":"Manab\xED","EC-S":"Morona Santiago","EC-N":"Napo","EC-D":"Orellana","EC-Y":"Pastaza","EC-P":"Pichincha","EC-SE":"Santa Elena","EC-SD":"Santo Domingo de los Ts\xE1chilas","EC-U":"Sucumb\xEDos","EC-T":"Tungurahua","EC-Z":"Zamora Chinchipe","EG-DK":"Ad Daqahl\u012Byah","EG-BA":"Al Ba\u1E29r al A\u1E29mar","EG-BH":"Al Bu\u1E29ayrah","EG-FYM":"Al Fayy\u016Bm","EG-GH":"Al Gharb\u012Byah","EG-ALX":"Al Iskandar\u012Byah","EG-IS":"Al Ism\u0101'\u012Bl\u012Byah","EG-GZ":"Al J\u012Bzah","EG-MNF":"Al Min\u016Bf\u012Byah","EG-MN":"Al Miny\u0101","EG-C":"Al Q\u0101hirah","EG-KB":"Al Qaly\u016Bb\u012Byah","EG-LX":"Al Uq\u015Fur","EG-WAD":"Al W\u0101d\u012B al Jad\u012Bd","EG-SUZ":"As Suways","EG-SHR":"Ash Sharq\u012Byah","EG-ASN":"Asw\u0101n","EG-AST":"Asy\u016B\u0163","EG-BNS":"Ban\u012B Suwayf","EG-PTS":"B\u016Br Sa\u2018\u012Bd","EG-DT":"Dumy\u0101\u0163","EG-JS":"Jan\u016Bb S\u012Bn\u0101'","EG-KFS":"Kafr ash Shaykh","EG-MT":"Ma\u0163r\u016B\u1E29","EG-KN":"Qin\u0101","EG-SIN":"Sham\u0101l S\u012Bn\u0101'","EG-SHG":"S\u016Bh\u0101j","SV-AH":"Ahuachap\xE1n","SV-CA":"Caba\xF1as","SV-CH":"Chalatenango","SV-CU":"Cuscatl\xE1n","SV-LI":"La Libertad","SV-PA":"La Paz","SV-UN":"La Uni\xF3n","SV-MO":"Moraz\xE1n","SV-SM":"San Miguel","SV-SS":"San Salvador","SV-SV":"San Vicente","SV-SA":"Santa Ana","SV-SO":"Sonsonate","SV-US":"Usulut\xE1n","GQ-C":"Regi\xF3n Continental","GQ-I":"Regi\xF3n Insular","ER-MA":"Al Awsa\u0163","ER-DU":"Al Jan\u016Bb\u012B","ER-AN":"Ansab\u0101","ER-DK":"Jan\u016Bb\u012B al Ba\u1E29r\u012B al A\u1E29mar","ER-GB":"Q\u0101sh-Barkah","ER-SK":"Shim\u0101l\u012B al Ba\u1E29r\u012B al A\u1E29mar","EE-37":"Harjumaa","EE-39":"Hiiumaa","EE-45":"Ida-Virumaa","EE-50":"J\xF5gevamaa","EE-52":"J\xE4rvamaa","EE-60":"L\xE4\xE4ne-Virumaa","EE-56":"L\xE4\xE4nemaa","EE-64":"P\xF5lvamaa","EE-68":"P\xE4rnumaa","EE-71":"Raplamaa","EE-74":"Saaremaa","EE-79":"Tartumaa","EE-81":"Valgamaa","EE-84":"Viljandimaa","EE-87":"V\xF5rumaa","ET-AA":"\u0100d\u012Bs \u0100beba","ET-AF":"\u0100far","ET-AM":"\u0100mara","ET-BE":"B\u012Bnshangul Gumuz","ET-DD":"Dir\u0113 Dawa","ET-GA":"Gamb\u0113la Hizboch","ET-HA":"H\u0101rer\u012B Hizb","ET-OR":"Orom\u012Bya","ET-SI":"S\u012Bdama","ET-SO":"Sumal\u0113","ET-TI":"Tigray","ET-SN":"YeDebub Bih\u0113roch Bih\u0113reseboch na Hizboch","ET-SW":"YeDebub M\u2018irab \u012Atyop\u2019iya Hizboch","FJ-C":"Central","FJ-E":"Eastern","FJ-N":"Northern","FJ-W":"Western","FJ-R":"Rotuma","FI-01":"Ahvenanmaan maakunta","FI-02":"Etel\xE4-Karjala","FI-03":"Etel\xE4-Pohjanmaa","FI-04":"Etel\xE4-Savo","FI-05":"Kainuu","FI-06":"Kanta-H\xE4me","FI-07":"Keski-Pohjanmaa","FI-08":"Keski-Suomi","FI-09":"Kymenlaakso","FI-10":"Lappi","FI-11":"Pirkanmaa","FI-12":"Pohjanmaa","FI-13":"Pohjois-Karjala","FI-14":"Pohjois-Pohjanmaa","FI-15":"Pohjois-Savo","FI-16":"P\xE4ij\xE4t-H\xE4me","FI-17":"Satakunta","FI-18":"Uusimaa","FI-19":"Varsinais-Suomi","FR-ARA":"Auvergne-Rh\xF4ne-Alpes","FR-BFC":"Bourgogne-Franche-Comt\xE9","FR-BRE":"Bretagne","FR-CVL":"Centre-Val de Loire","FR-20R":"Corse","FR-GES":"Grand Est","FR-HDF":"Hauts-de-France","FR-IDF":"\xCEle-de-France","FR-NOR":"Normandie","FR-NAQ":"Nouvelle-Aquitaine","FR-OCC":"Occitanie","FR-PDL":"Pays-de-la-Loire","FR-PAC":"Provence-Alpes-C\xF4te-d\u2019Azur","GA-1":"Estuaire","GA-2":"Haut-Ogoou\xE9","GA-3":"Moyen-Ogoou\xE9","GA-4":"Ngouni\xE9","GA-5":"Nyanga","GA-6":"Ogoou\xE9-Ivindo","GA-7":"Ogoou\xE9-Lolo","GA-8":"Ogoou\xE9-Maritime","GA-9":"Woleu-Ntem","GM-B":"Banjul","GM-M":"Central River","GM-L":"Lower River","GM-N":"North Bank","GM-U":"Upper River","GM-W":"Western","GE-AB":"Abkhazia","GE-AJ":"Ajaria","GE-GU":"Guria","GE-IM":"Imereti","GE-KA":"K'akheti","GE-KK":"Kvemo Kartli","GE-MM":"Mtskheta-Mtianeti","GE-RL":"Rach'a-Lechkhumi-Kvemo Svaneti","GE-SZ":"Samegrelo-Zemo Svaneti","GE-SJ":"Samtskhe-Javakheti","GE-SK":"Shida Kartli","GE-TB":"Tbilisi","DE-BW":"Baden-W\xFCrttemberg","DE-BY":"Bayern","DE-BE":"Berlin","DE-BB":"Brandenburg","DE-HB":"Bremen","DE-HH":"Hamburg","DE-HE":"Hessen","DE-MV":"Mecklenburg-Vorpommern","DE-NI":"Niedersachsen","DE-NW":"Nordrhein-Westfalen","DE-RP":"Rheinland-Pfalz","DE-SL":"Saarland","DE-SN":"Sachsen","DE-ST":"Sachsen-Anhalt","DE-SH":"Schleswig-Holstein","DE-TH":"Th\xFCringen","GH-AF":"Ahafo","GH-AH":"Ashanti","GH-BO":"Bono","GH-BE":"Bono East","GH-CP":"Central","GH-EP":"Eastern","GH-AA":"Greater Accra","GH-NE":"North East","GH-NP":"Northern","GH-OT":"Oti","GH-SV":"Savannah","GH-UE":"Upper East","GH-UW":"Upper West","GH-TV":"Volta","GH-WP":"Western","GH-WN":"Western North","GR-69":"\xC1gion \xD3ros","GR-A":"Anatolik\xED Makedon\xEDa kaiThr\xE1ki","GR-I":"Attik\xED","GR-G":"Dytik\xED Ell\xE1da","GR-C":"Dytik\xED Makedon\xEDa","GR-F":"Ion\xEDa N\xEDsia","GR-D":"\xCDpeiros","GR-B":"Kentrik\xED Makedon\xEDa","GR-M":"Kr\xEDti","GR-L":"N\xF3tio Aiga\xEDo","GR-J":"Pelop\xF3nnisos","GR-H":"Stere\xE1 Ell\xE1da","GR-E":"Thessal\xEDa","GR-K":"V\xF3reio Aiga\xEDo","GL-AV":"Avannaata Kommunia","GL-KU":"Kommune Kujalleq","GL-QT":"Kommune Qeqertalik","GL-SM":"Kommuneqarfik Sermersooq","GL-QE":"Qeqqata Kommunia","GD-01":"Saint Andrew","GD-02":"Saint David","GD-03":"Saint George","GD-04":"Saint John","GD-05":"Saint Mark","GD-06":"Saint Patrick","GD-10":"Southern Grenadine Islands","GT-16":"Alta Verapaz","GT-15":"Baja Verapaz","GT-04":"Chimaltenango","GT-20":"Chiquimula","GT-02":"El Progreso","GT-05":"Escuintla","GT-01":"Guatemala","GT-13":"Huehuetenango","GT-18":"Izabal","GT-21":"Jalapa","GT-22":"Jutiapa","GT-17":"Pet\xE9n","GT-09":"Quetzaltenango","GT-14":"Quich\xE9","GT-11":"Retalhuleu","GT-03":"Sacatep\xE9quez","GT-12":"San Marcos","GT-06":"Santa Rosa","GT-07":"Solol\xE1","GT-10":"Suchitep\xE9quez","GT-08":"Totonicap\xE1n","GT-19":"Zacapa","GN-B":"Bok\xE9","GN-F":"Faranah","GN-K":"Kankan","GN-D":"Kindia","GN-L":"Lab\xE9","GN-M":"Mamou","GN-N":"Nz\xE9r\xE9kor\xE9","GN-C":"Conakry","GW-L":"Leste","GW-N":"Norte","GW-S":"Sul","GY-BA":"Barima-Waini","GY-CU":"Cuyuni-Mazaruni","GY-DE":"Demerara-Mahaica","GY-EB":"East Berbice-Corentyne","GY-ES":"Essequibo Islands-West Demerara","GY-MA":"Mahaica-Berbice","GY-PM":"Pomeroon-Supenaam","GY-PT":"Potaro-Siparuni","GY-UD":"Upper Demerara-Berbice","GY-UT":"Upper Takutu-Upper Essequibo","HT-AR":"Artibonite","HT-CE":"Centre","HT-GA":"Grande\u2019Anse","HT-NI":"Nippes","HT-ND":"Nord","HT-NE":"Nord-Est","HT-NO":"Nord-Ouest","HT-OU":"Ouest","HT-SD":"Sud","HT-SE":"Sud-Est","HN-AT":"Atl\xE1ntida","HN-CH":"Choluteca","HN-CL":"Col\xF3n","HN-CM":"Comayagua","HN-CP":"Cop\xE1n","HN-CR":"Cort\xE9s","HN-EP":"El Para\xEDso","HN-FM":"Francisco Moraz\xE1n","HN-GD":"Gracias a Dios","HN-IN":"Intibuc\xE1","HN-IB":"Islas de la Bah\xEDa","HN-LP":"La Paz","HN-LE":"Lempira","HN-OC":"Ocotepeque","HN-OL":"Olancho","HN-SB":"Santa B\xE1rbara","HN-VA":"Valle","HN-YO":"Yoro","HU-BK":"B\xE1cs-Kiskun","HU-BA":"Baranya","HU-BE":"B\xE9k\xE9s","HU-BC":"B\xE9k\xE9scsaba","HU-BZ":"Borsod-Aba\xFAj-Zempl\xE9n","HU-BU":"Budapest","HU-CS":"Csongr\xE1d-Csan\xE1d","HU-DE":"Debrecen","HU-DU":"Duna\xFAjv\xE1ros","HU-EG":"Eger","HU-ER":"\xC9rd","HU-FE":"Fej\xE9r","HU-GY":"Gy\u0151r","HU-GS":"Gy\u0151r-Moson-Sopron","HU-HB":"Hajd\xFA-Bihar","HU-HE":"Heves","HU-HV":"H\xF3dmez\u0151v\xE1s\xE1rhely","HU-JN":"J\xE1sz-Nagykun-Szolnok","HU-KV":"Kaposv\xE1r","HU-KM":"Kecskem\xE9t","HU-KE":"Kom\xE1rom-Esztergom","HU-MI":"Miskolc","HU-NK":"Nagykanizsa","HU-NO":"N\xF3gr\xE1d","HU-NY":"Ny\xEDregyh\xE1za","HU-PS":"P\xE9cs","HU-PE":"Pest","HU-ST":"Salg\xF3tarj\xE1n","HU-SO":"Somogy","HU-SN":"Sopron","HU-SZ":"Szabolcs-Szatm\xE1r-Bereg","HU-SD":"Szeged","HU-SF":"Sz\xE9kesfeh\xE9rv\xE1r","HU-SS":"Szeksz\xE1rd","HU-SK":"Szolnok","HU-SH":"Szombathely","HU-TB":"Tatab\xE1nya","HU-TO":"Tolna","HU-VA":"Vas","HU-VM":"Veszpr\xE9m","HU-VE":"Veszpr\xE9m","HU-ZA":"Zala","HU-ZE":"Zalaegerszeg","IS-7":"Austurland","IS-1":"H\xF6fu\xF0borgarsv\xE6\xF0i","IS-6":"Nor\xF0urland eystra","IS-5":"Nor\xF0urland vestra","IS-8":"Su\xF0urland","IS-2":"Su\xF0urnes","IS-4":"Vestfir\xF0ir","IS-3":"Vesturland","IN-AN":"Andaman and Nicobar Islands","IN-AP":"Andhra Pradesh","IN-AR":"Arun\u0101chal Pradesh","IN-AS":"Assam","IN-BR":"Bih\u0101r","IN-CH":"Chand\u012Bgarh","IN-CG":"Chhatt\u012Bsgarh","IN-DH":"D\u0101dra and Nagar Haveli and Dam\u0101n and Diu[1]","IN-DL":"Delhi","IN-GA":"Goa","IN-GJ":"Gujar\u0101t","IN-HR":"Hary\u0101na","IN-HP":"Him\u0101chal Pradesh","IN-JK":"Jammu and Kashm\u012Br","IN-JH":"Jh\u0101rkhand","IN-KA":"Karn\u0101taka","IN-KL":"Kerala","IN-LA":"Lad\u0101kh","IN-LD":"Lakshadweep","IN-MP":"Madhya Pradesh","IN-MH":"Mah\u0101r\u0101shtra","IN-MN":"Manipur","IN-ML":"Megh\u0101laya","IN-MZ":"Mizoram","IN-NL":"N\u0101g\u0101land","IN-OD":"Odisha","IN-PY":"Puducherry","IN-PB":"Punjab","IN-RJ":"R\u0101jasth\u0101n","IN-SK":"Sikkim","IN-TN":"Tamil N\u0101du","IN-TS":"Telang\u0101na[2]","IN-TR":"Tripura","IN-UP":"Uttar Pradesh","IN-UK":"Uttar\u0101khand","IN-WB":"West Bengal","ID-JW":"Jawa","ID-KA":"Kalimantan","ID-ML":"Maluku","ID-NU":"Nusa Tenggara","ID-PP":"Papua","ID-SL":"Sulawesi","ID-SM":"Sumatera","IR-30":"Alborz","IR-24":"Ardab\u012Bl","IR-04":"\u0100z\u0304\u0101rb\u0101yj\u0101n-e Gh\u0101rb\u012B","IR-03":"\u0100z\u0304\u0101rb\u0101yj\u0101n-e Sh\u0101rq\u012B","IR-18":"B\u016Bshehr","IR-14":"Chah\u0101r Ma\u1E29\u0101l va Bakht\u012B\u0101r\u012B","IR-10":"E\u015Ffah\u0101n","IR-07":"F\u0101rs","IR-01":"G\u012Bl\u0101n","IR-27":"Golest\u0101n","IR-13":"Hamad\u0101n","IR-22":"Hormozg\u0101n","IR-16":"\u012Al\u0101m","IR-08":"Kerm\u0101n","IR-05":"Kerm\u0101nsh\u0101h","IR-29":"Khor\u0101s\u0101n-e Jon\u016Bb\u012B","IR-09":"Khor\u0101s\u0101n-e Ra\u1E95av\u012B","IR-28":"Khor\u0101s\u0101n-e Shom\u0101l\u012B","IR-06":"Kh\u016Bzest\u0101n","IR-17":"Kohg\u012Bl\u016Byeh va Bowyer A\u1E29mad","IR-12":"Kordest\u0101n","IR-15":"Lorest\u0101n","IR-00":"Markaz\u012B","IR-02":"M\u0101zandar\u0101n","IR-26":"Qazv\u012Bn","IR-25":"Qom","IR-20":"Semn\u0101n","IR-11":"S\u012Bst\u0101n va Bal\u016Bchest\u0101n","IR-23":"Tehr\u0101n","IR-21":"Yazd","IR-19":"Zanj\u0101n","IQ-AN":"Al Anb\u0101r","IQ-BA":"Al Ba\u015Frah","IQ-MU":"Al Muthann\xE1","IQ-QA":"Al Q\u0101dis\u012Byah","IQ-NA":"An Najaf","IQ-AR":"Arb\u012Bl","IQ-SU":"As Sulaym\u0101n\u012Byah","IQ-BB":"B\u0101bil","IQ-BG":"Baghd\u0101d","IQ-DA":"Dah\u016Bk","IQ-DQ":"Dh\u012B Q\u0101r","IQ-DI":"Diy\u0101l\xE1","IQ-KR":"Iql\u012Bm K\u016Brdist\u0101n","IQ-KA":"Karbal\u0101\u2019","IQ-KI":"Kirk\u016Bk","IQ-MA":"Mays\u0101n","IQ-NI":"N\u012Bnaw\xE1","IQ-SD":"\u015Eal\u0101\u1E29 ad D\u012Bn","IQ-WA":"W\u0101si\u0163","IE-C":"Connaught","IE-L":"Leinster","IE-M":"Munster","IE-U":"Ulster[a]","IL-D":"HaDarom","IL-M":"HaMerkaz","IL-Z":"HaTsafon","IL-HA":"H\u0331efa","IL-TA":"Tel Aviv","IL-JM":"Yerushalayim","IT-65":"Abruzzo","IT-77":"Basilicata","IT-78":"Calabria","IT-72":"Campania","IT-45":"Emilia-Romagna","IT-36":"Friuli Venezia Giulia","IT-62":"Lazio","IT-42":"Liguria","IT-25":"Lombardia","IT-57":"Marche","IT-67":"Molise","IT-21":"Piemonte","IT-75":"Puglia","IT-88":"Sardegna","IT-82":"Sicilia","IT-52":"Toscana","IT-32":"Trentino-Alto Adigede","IT-55":"Umbria","IT-23":"Valle d'Aostafr","IT-34":"Veneto","JM-13":"Clarendon","JM-09":"Hanover","JM-01":"Kingston","JM-12":"Manchester","JM-04":"Portland","JM-02":"Saint Andrew","JM-06":"Saint Ann","JM-14":"Saint Catherine","JM-11":"Saint Elizabeth","JM-08":"Saint James","JM-05":"Saint Mary","JM-03":"Saint Thomas","JM-07":"Trelawny","JM-10":"Westmoreland","JP-23":"Aiti","JP-05":"Akita","JP-02":"Aomori","JP-38":"Ehime","JP-21":"Gihu","JP-10":"Gunma","JP-34":"Hirosima","JP-01":"Hokkaid\xF4","JP-18":"Hukui","JP-40":"Hukuoka","JP-07":"Hukusima","JP-28":"Hy\xF4go","JP-08":"Ibaraki","JP-17":"Isikawa","JP-03":"Iwate","JP-37":"Kagawa","JP-46":"Kagosima","JP-14":"Kanagawa","JP-39":"K\xF4ti","JP-43":"Kumamoto","JP-26":"Ky\xF4to","JP-24":"Mie","JP-04":"Miyagi","JP-45":"Miyazaki","JP-20":"Nagano","JP-42":"Nagasaki","JP-29":"Nara","JP-15":"Niigata","JP-44":"\xD4ita","JP-33":"Okayama","JP-47":"Okinawa","JP-27":"\xD4saka","JP-41":"Saga","JP-11":"Saitama","JP-25":"Siga","JP-32":"Simane","JP-22":"Sizuoka","JP-12":"Tiba","JP-36":"Tokusima","JP-13":"T\xF4ky\xF4","JP-09":"Totigi","JP-31":"Tottori","JP-16":"Toyama","JP-30":"Wakayama","JP-06":"Yamagata","JP-35":"Yamaguti","JP-19":"Yamanasi","JO-AJ":"\u2018Ajl\u016Bn","JO-AQ":"Al \u2018Aqabah","JO-AM":"Al \u2018A\u0305\u015Fimah","JO-BA":"Al Balq\u0101\u2019","JO-KA":"Al Karak","JO-MA":"Al Mafraq","JO-AT":"A\u0163 \u0162af\u012Blah","JO-AZ":"Az Zarq\u0101\u2019","JO-IR":"Irbid","JO-JA":"Jarash","JO-MN":"Ma\u2018\u0101n","JO-MD":"M\u0101dab\u0101","KZ-10":"Abayoblysy","KZ-75":"Almaty","KZ-19":"Almatyoblysy","KZ-11":"Aqmola oblysy","KZ-15":"Aqt\xF6be oblysy","KZ-71":"Astana","KZ-23":"Atyra\u016Boblysy","KZ-27":"Batys Qazaqstan oblysy","KZ-47":"Mangghysta\u016B oblysy","KZ-55":"Pavlodar oblysy","KZ-35":"Qaraghandy oblysy","KZ-39":"Qostanay oblysy","KZ-43":"Qyzylorda oblysy","KZ-63":"Shyghys Qazaqstan oblysy","KZ-79":"Shymkent","KZ-59":"Solt\xFCstik Qazaqstan oblysy","KZ-61":"T\xFCrkistan oblysy","KZ-62":"Ulyta\u016Boblysy","KZ-31":"Zhambyl oblysy","KZ-33":"Zhetis\u016B oblysy","KE-01":"Baringo","KE-02":"Bomet","KE-03":"Bungoma","KE-04":"Busia","KE-05":"Elgeyo/Marakwet","KE-06":"Embu","KE-07":"Garissa","KE-08":"Homa Bay","KE-09":"Isiolo","KE-10":"Kajiado","KE-11":"Kakamega","KE-12":"Kericho","KE-13":"Kiambu","KE-14":"Kilifi","KE-15":"Kirinyaga","KE-16":"Kisii","KE-17":"Kisumu","KE-18":"Kitui","KE-19":"Kwale","KE-20":"Laikipia","KE-21":"Lamu","KE-22":"Machakos","KE-23":"Makueni","KE-24":"Mandera","KE-25":"Marsabit","KE-26":"Meru","KE-27":"Migori","KE-28":"Mombasa","KE-29":"Murang'a","KE-30":"Nairobi City","KE-31":"Nakuru","KE-32":"Nandi","KE-33":"Narok","KE-34":"Nyamira","KE-35":"Nyandarua","KE-36":"Nyeri","KE-37":"Samburu","KE-38":"Siaya","KE-39":"Taita/Taveta","KE-40":"Tana River","KE-41":"Tharaka-Nithi","KE-42":"Trans Nzoia","KE-43":"Turkana","KE-44":"Uasin Gishu","KE-45":"Vihiga","KE-46":"Wajir","KE-47":"West Pokot","KI-G":"Gilbert Islands","KI-L":"Line Islands","KI-P":"Phoenix Islands","KP-04":"Chagang-do","KP-09":"Hamgy\u01D2ng-bukto","KP-08":"Hamgy\u01D2ng-namdo","KP-06":"Hwanghae-bukto","KP-05":"Hwanghae-namdo","KP-15":"Kaes\u014Fng","KP-07":"Kangw\u01D2n-do","KP-14":"Namp\u2019o","KP-03":"P'y\u01D2ngan-bukto","KP-02":"P'y\u01D2ngan-namdo","KP-01":"P'y\u01D2ngyang","KP-13":"Ras\u01D2n","KP-10":"Ryanggang-do","KR-26":"Busan-gwangyeoksi","KR-43":"Chungcheongbuk-do","KR-44":"Chungcheongnam-do","KR-27":"Daegu-gwangyeoksi","KR-30":"Daejeon-gwangyeoksi","KR-42":"Gangwon-teukbyeoljachido","KR-29":"Gwangju-gwangyeoksi","KR-41":"Gyeonggi-do","KR-47":"Gyeongsangbuk-do","KR-48":"Gyeongsangnam-do","KR-28":"Incheon-gwangyeoksi","KR-49":"Jeju-teukbyeoljachido","KR-45":"Jeollabuk-do","KR-46":"Jeollanam-do","KR-50":"Sejong","KR-11":"Seoul-teukbyeolsi","KR-31":"Ulsan-gwangyeoksi","KW-AH":"Al A\u1E29mad\u012B","KW-FA":"Al Farw\u0101n\u012Byah","KW-JA":"Al Jahr\u0101\u2019","KW-KU":"Al \u2018\u0100\u015Fimah","KW-HA":"\u1E28awall\u012B","KW-MU":"Mub\u0101rak al Kab\u012Br","KG-B":"Batken","KG-GB":"Bishkek Shaary","KG-C":"Ch\xFCy","KG-J":"Jalal-Abad","KG-N":"Naryn","KG-O":"Osh","KG-GO":"Osh Shaary","KG-T":"Talas","KG-Y":"Ysyk-K\xF6l","LA-AT":"Attapu","LA-BK":"Bok\xE8o","LA-BL":"Bolikhamxai","LA-CH":"Champasak","LA-HO":"Houaphan","LA-KH":"Khammouan","LA-LM":"Louang Namtha","LA-LP":"Louangphabang","LA-OU":"Oud\xF4mxai","LA-PH":"Ph\xF4ngsali","LA-SL":"Salavan","LA-SV":"Savannakh\xE9t","LA-VI":"Viangchan","LA-VT":"Viangchan","LA-XA":"Xaignabouli","LA-XS":"Xais\xF4mboun","LA-XE":"X\xE9kong","LA-XI":"Xiangkhouang","LV-002":"Aizkraukles novads","LV-007":"Al\u016Bksnes novads","LV-111":"Aug\u0161daugavas novads","LV-011":"\u0100da\u017Eu novads","LV-015":"Balvu novads","LV-016":"Bauskas novads","LV-022":"C\u0113su novads","LV-DGV":"Daugavpils","LV-112":"Dienvidkurzemes Novads","LV-026":"Dobeles novads","LV-033":"Gulbenes novads","LV-JEL":"Jelgava","LV-041":"Jelgavas novads","LV-042":"J\u0113kabpils novads","LV-JUR":"J\u016Brmala","LV-047":"Kr\u0101slavas novads","LV-050":"Kuld\u012Bgas novads","LV-052":"\u0136ekavas novads","LV-LPX":"Liep\u0101ja","LV-054":"Limba\u017Eu novads","LV-056":"L\u012Bv\u0101nu novads","LV-058":"Ludzas novads","LV-059":"Madonas novads","LV-062":"M\u0101rupes novads","LV-067":"Ogres novads","LV-068":"Olaines novads","LV-073":"Prei\u013Cu novads","LV-REZ":"R\u0113zekne","LV-077":"R\u0113zeknes novads","LV-RIX":"R\u012Bga","LV-080":"Ropa\u017Eu novads","LV-087":"Salaspils novads","LV-088":"Saldus novads","LV-089":"Saulkrastu novads","LV-091":"Siguldas novads","LV-094":"Smiltenes novads","LV-097":"Talsu novads","LV-099":"Tukuma novads","LV-101":"Valkas novads","LV-113":"Valmieras Novads","LV-102":"Varak\u013C\u0101nu novads","LV-VEN":"Ventspils","LV-106":"Ventspils novads","LB-AK":"Aakk\xE2r","LB-BH":"Baalbek-Hermel","LB-BI":"B\xE9qaa","LB-BA":"Beyrouth","LB-AS":"Liban-Nord","LB-JA":"Liban-Sud","LB-JL":"Mont-Liban","LB-NA":"Nabat\xEEy\xE9","LS-D":"Berea","LS-B":"Botha-Bothe","LS-C":"Leribe","LS-E":"Mafeteng","LS-A":"Maseru","LS-F":"Mohale's Hoek","LS-J":"Mokhotlong","LS-H":"Qacha's Nek","LS-G":"Quthing","LS-K":"Thaba-Tseka","LR-BM":"Bomi","LR-BG":"Bong","LR-GP":"Gbarpolu","LR-GB":"Grand Bassa","LR-CM":"Grand Cape Mount","LR-GG":"Grand Gedeh","LR-GK":"Grand Kru","LR-LO":"Lofa","LR-MG":"Margibi","LR-MY":"Maryland","LR-MO":"Montserrado","LR-NI":"Nimba","LR-RI":"River Cess","LR-RG":"River Gee","LR-SI":"Sinoe","LY-BU":"Al Bu\u0163n\u0101n","LY-JA":"Al Jabal al Akh\u1E11ar","LY-JG":"Al Jabal al Gharb\u012B","LY-JI":"Al Jaf\u0101rah","LY-JU":"Al Jufrah","LY-KF":"Al Kufrah","LY-MJ":"Al Marj","LY-MB":"Al Marqab","LY-WA":"Al W\u0101\u1E29\u0101t","LY-NQ":"An Nuq\u0101\u0163 al Khams","LY-ZA":"Az Z\u0101wiyah","LY-BA":"Bangh\u0101z\u012B","LY-DR":"Darnah","LY-GT":"Gh\u0101t","LY-MI":"Mi\u015Fr\u0101tah","LY-MQ":"Murzuq","LY-NL":"N\u0101l\u016Bt","LY-SB":"Sabh\u0101","LY-SR":"Surt","LY-TB":"\u0162ar\u0101bulus","LY-WD":"W\u0101d\u012B al \u1E28ay\u0101t","LY-WS":"W\u0101d\u012B ash Sh\u0101\u0163i\u2019","LI-01":"Balzers","LI-02":"Eschen","LI-03":"Gamprin","LI-04":"Mauren","LI-05":"Planken","LI-06":"Ruggell","LI-07":"Schaan","LI-08":"Schellenberg","LI-09":"Triesen","LI-10":"Triesenberg","LI-11":"Vaduz","LT-AL":"Alytaus apskritis","LT-KU":"Kauno apskritis","LT-KL":"Klaip\u0117dos apskritis","LT-MR":"Marijampol\u0117s apskritis","LT-PN":"Panev\u0117\u017Eio apskritis","LT-SA":"\u0160iauli\u0173 apskritis","LT-TA":"Taurag\u0117s apskritis","LT-TE":"Tel\u0161i\u0173 apskritis","LT-UT":"Utenos apskritis","LT-VL":"Vilniaus apskritis","LU-CA":"Capellen","LU-CL":"Clervaux","LU-DI":"Diekirch","LU-EC":"Echternach","LU-ES":"Esch-sur-Alzette","LU-GR":"Grevenmacher","LU-LU":"Luxembourg","LU-ME":"Mersch","LU-RD":"Redange","LU-RM":"Remich","LU-VD":"Vianden","LU-WI":"Wiltz","MG-T":"Antananarivo","MG-D":"Antsiranana","MG-F":"Fianarantsoa","MG-M":"Mahajanga","MG-A":"Toamasina","MG-U":"Toliara","MW-N":"Chakumpoto","MW-S":"Chakumwera","MW-C":"Chapakati","MY-01":"Johor","MY-02":"Kedah","MY-03":"Kelantan","MY-04":"Melaka","MY-05":"Negeri Sembilan","MY-06":"Pahang","MY-08":"Perak","MY-09":"Perlis","MY-07":"Pulau Pinang","MY-12":"Sabah","MY-13":"Sarawak","MY-10":"Selangor","MY-11":"Terengganu","MY-14":"Wilayah Persekutuan Kuala Lumpur","MY-15":"Wilayah Persekutuan Labuan","MY-16":"Wilayah Persekutuan Putrajaya","MV-01":"Addu","MV-00":"Ariatholhu Dhekunuburi","MV-02":"Ariatholhu Uthuruburi","MV-03":"Faadhippolhu","MV-04":"Felidheatholhu","MV-29":"Fuvammulah","MV-05":"Hahdhunmathi","MV-28":"Huvadhuatholhu Dhekunuburi","MV-27":"Huvadhuatholhu Uthuruburi","MV-08":"Kolhumadulu","MV-MLE":"Maale","MV-26":"Maaleatholhu","MV-20":"Maalhosmadulu Dhekunuburi","MV-13":"Maalhosmadulu Uthuruburi","MV-25":"Miladhunmadulu Dhekunuburi","MV-24":"Miladhunmadulu Uthuruburi","MV-12":"Mulakatholhu","MV-17":"Nilandheatholhu Dhekunuburi","MV-14":"Nilandheatholhu Uthuruburi","MV-23":"Thiladhunmathee Dhekunuburi","MV-07":"Thiladhunmathee Uthuruburi","ML-BKO":"Bamako","ML-7":"Gao","ML-1":"Kayes","ML-8":"Kidal","ML-2":"Koulikoro","ML-9":"M\xE9naka","ML-5":"Mopti","ML-4":"S\xE9gou","ML-3":"Sikasso","ML-10":"Taoud\xE9nit","ML-6":"Tombouctou","MT-01":"Attard","MT-02":"Balzan","MT-03":"Birgu","MT-04":"Birkirkara","MT-05":"Bir\u017Cebbu\u0121a","MT-06":"Bormla","MT-07":"Dingli","MT-08":"Fgura","MT-09":"Floriana","MT-10":"Fontana","MT-11":"Gudja","MT-12":"G\u017Cira","MT-13":"G\u0127ajnsielem","MT-14":"G\u0127arb","MT-15":"G\u0127arg\u0127ur","MT-16":"G\u0127asri","MT-17":"G\u0127axaq","MT-18":"\u0126amrun","MT-19":"Iklin","MT-20":"Isla","MT-21":"Kalkara","MT-22":"Ker\u010Bem","MT-23":"Kirkop","MT-24":"Lija","MT-25":"Luqa","MT-26":"Marsa","MT-27":"Marsaskala","MT-28":"Marsaxlokk","MT-29":"Mdina","MT-30":"Mellie\u0127a","MT-31":"M\u0121arr","MT-32":"Mosta","MT-33":"Mqabba","MT-34":"Msida","MT-35":"Mtarfa","MT-36":"Munxar","MT-37":"Nadur","MT-38":"Naxxar","MT-39":"Paola","MT-40":"Pembroke","MT-41":"Piet\xE0","MT-42":"Qala","MT-43":"Qormi","MT-44":"Qrendi","MT-45":"Rabat G\u0127awdex","MT-46":"Rabat Malta","MT-47":"Safi","MT-48":"San \u0120iljan","MT-49":"San \u0120wann","MT-50":"San Lawrenz","MT-51":"San Pawl il-Ba\u0127ar","MT-52":"Sannat","MT-53":"Santa Lu\u010Bija","MT-54":"Santa Venera","MT-55":"Si\u0121\u0121iewi","MT-56":"Sliema","MT-57":"Swieqi","MT-58":"Ta' Xbiex","MT-59":"Tarxien","MT-60":"Valletta","MT-61":"Xag\u0127ra","MT-62":"Xewkija","MT-63":"Xg\u0127ajra","MT-64":"\u017Babbar","MT-65":"\u017Bebbu\u0121 G\u0127awdex","MT-66":"\u017Bebbu\u0121 Malta","MT-67":"\u017Bejtun","MT-68":"\u017Burrieq","MH-L":"Ralik chain","MH-T":"Ratak chain","MR-07":"Adrar","MR-03":"Assaba","MR-05":"Brakna","MR-08":"Dakhlet Nou\xE2dhibou","MR-04":"Gorgol","MR-10":"Guidimaka","MR-01":"Hodh ech Chargui","MR-02":"Hodh el Gharbi","MR-12":"Inchiri","MR-09":"Tagant","MR-11":"Tiris Zemmour","MR-06":"Trarza","MU-AG":"Agalega Islands","MU-BL":"Black River","MU-CC":"Cargados Carajos Shoals","MU-FL":"Flacq","MU-GP":"Grand Port","MU-MO":"Moka","MU-PA":"Pamplemousses","MU-PW":"Plaines Wilhems","MU-PL":"Port Louis","MU-RR":"Rivi\xE8re du Rempart","MU-RO":"Rodrigues Island","MU-SA":"Savanne","MX-AGU":"Aguascalientes","MX-BCN":"Baja California","MX-BCS":"Baja California Sur","MX-CAM":"Campeche","MX-CMX":"Ciudad de M\xE9xico","MX-COA":"Coahuila de Zaragoza","MX-COL":"Colima","MX-CHP":"Chiapas","MX-CHH":"Chihuahua","MX-DUR":"Durango","MX-GUA":"Guanajuato","MX-GRO":"Guerrero","MX-HID":"Hidalgo","MX-JAL":"Jalisco","MX-MEX":"M\xE9xico","MX-MIC":"Michoac\xE1n de Ocampo","MX-MOR":"Morelos","MX-NAY":"Nayarit","MX-NLE":"Nuevo Le\xF3n","MX-OAX":"Oaxaca","MX-PUE":"Puebla","MX-QUE":"Quer\xE9taro","MX-ROO":"Quintana Roo","MX-SLP":"San Luis Potos\xED","MX-SIN":"Sinaloa","MX-SON":"Sonora","MX-TAB":"Tabasco","MX-TAM":"Tamaulipas","MX-TLA":"Tlaxcala","MX-VER":"Veracruz de Ignacio de la Llave","MX-YUC":"Yucat\xE1n","MX-ZAC":"Zacatecas","FM-TRK":"Chuuk","FM-KSA":"Kosrae","FM-PNI":"Pohnpei","FM-YAP":"Yap","MD-AN":"Anenii Noi","MD-BS":"Basarabeasca","MD-BA":"B\u0103l\u021Bi","MD-BD":"Bender","MD-BR":"Briceni","MD-CA":"Cahul","MD-CT":"Cantemir","MD-CL":"C\u0103l\u0103ra\u0219i","MD-CS":"C\u0103u\u0219eni","MD-CU":"Chi\u0219in\u0103u","MD-CM":"Cimi\u0219lia","MD-CR":"Criuleni","MD-DO":"Dondu\u0219eni","MD-DR":"Drochia","MD-DU":"Dub\u0103sari","MD-ED":"Edine\u021B","MD-FA":"F\u0103le\u0219ti","MD-FL":"Flore\u0219ti","MD-GA":"G\u0103g\u0103uzia","MD-GL":"Glodeni","MD-HI":"H\xEEnce\u0219ti","MD-IA":"Ialoveni","MD-LE":"Leova","MD-NI":"Nisporeni","MD-OC":"Ocni\u021Ba","MD-OR":"Orhei","MD-RE":"Rezina","MD-RI":"R\xEE\u0219cani","MD-SI":"S\xEEngerei","MD-SO":"Soroca","MD-SN":"St\xEEnga Nistrului","MD-ST":"Str\u0103\u0219eni","MD-SD":"\u0218old\u0103ne\u0219ti","MD-SV":"\u0218tefan Vod\u0103","MD-TA":"Taraclia","MD-TE":"Telene\u0219ti","MD-UN":"Ungheni","MC-FO":"Fontvieille","MC-JE":"Jardin Exotique","MC-CL":"La Colle","MC-CO":"La Condamine","MC-GA":"La Gare","MC-SO":"La Source","MC-LA":"Larvotto","MC-MA":"Malbousquet","MC-MO":"Monaco-Ville","MC-MG":"Moneghetti","MC-MC":"Monte-Carlo","MC-MU":"Moulins","MC-PH":"Port-Hercule","MC-SR":"Saint-Roman","MC-SD":"Sainte-D\xE9vote","MC-SP":"Sp\xE9lugues","MC-VR":"Vallon de la Rousse","MN-073":"Arhangay","MN-069":"Bayanhongor","MN-071":"Bayan-\xD6lgiy","MN-067":"Bulgan","MN-037":"Darhan uul","MN-061":"Dornod","MN-063":"Dornogov\u012D","MN-059":"Dundgov\u012D","MN-057":"Dzavhan","MN-065":"Gov\u012D-Altay","MN-064":"Gov\u012D-S\xFCmber","MN-039":"Hentiy","MN-043":"Hovd","MN-041":"H\xF6vsg\xF6l","MN-053":"\xD6mn\xF6gov\u012D","MN-035":"Orhon","MN-055":"\xD6v\xF6rhangay","MN-049":"Selenge","MN-051":"S\xFChbaatar","MN-047":"T\xF6v","MN-1":"Ulaanbaatar","MN-046":"Uvs","MA-05":"B\xE9ni Mellal-Kh\xE9nifra","MA-06":"Casablanca-Settat","MA-12":"Dakhla-Oued Ed-Dahab","MA-08":"Dr\xE2a-Tafilalet","MA-03":"F\xE8s-Mekn\xE8s","MA-10":"Guelmim-Oued Noun","MA-02":"L'Oriental","MA-11":"La\xE2youne-Sakia El Hamra","MA-07":"Marrakech-Safi","MA-04":"Rabat-Sal\xE9-K\xE9nitra","MA-09":"Souss-Massa","MA-01":"Tanger-T\xE9touan-Al Hoce\xEFma","MZ-P":"Cabo Delgado","MZ-G":"Gaza","MZ-I":"Inhambane","MZ-B":"Manica","MZ-MPM":"Maputo","MZ-L":"Maputo","MZ-N":"Nampula","MZ-A":"Niassa","MZ-S":"Sofala","MZ-T":"Tete","MZ-Q":"Zamb\xE9zia","MM-07":"Ayeyarwady","MM-02":"Bago","MM-14":"Chin","MM-11":"Kachin","MM-12":"Kayah","MM-13":"Kayin","MM-03":"Magway","MM-04":"Mandalay","MM-15":"Mon","MM-18":"Nay Pyi Taw","MM-16":"Rakhine","MM-01":"Sagaing","MM-17":"Shan","MM-05":"Tanintharyi","MM-06":"Yangon","NA-ER":"Erongo","NA-HA":"Hardap","NA-KA":"//Karas","NA-KE":"Kavango East","NA-KW":"Kavango West","NA-KH":"Khomas","NA-KU":"Kunene","NA-OW":"Ohangwena","NA-OH":"Omaheke","NA-OS":"Omusati","NA-ON":"Oshana","NA-OT":"Oshikoto","NA-OD":"Otjozondjupa","NA-CA":"Zambezi","NR-01":"Aiwo","NR-02":"Anabar","NR-03":"Anetan","NR-04":"Anibare","NR-05":"Baitsi","NR-06":"Boe","NR-07":"Buada","NR-08":"Denigomodu","NR-09":"Ewa","NR-10":"Ijuw","NR-11":"Meneng","NR-12":"Nibok","NR-13":"Uaboe","NR-14":"Yaren","NP-P3":"B\u0101gmat\u012B","NP-P4":"Ga\u1E47\u1E0Dak\u012B","NP-P6":"Kar\u1E47\u0101l\u012B","NP-P1":"Kosh\u012B","NP-P5":"Lumbin\u012B","NP-P2":"Madhesh","NP-P7":"Sud\u016Brpashchim","NL-DR":"Drenthe","NL-FL":"Flevoland","NL-FR":"Frysl\xE2nfy","NL-GE":"Gelderland","NL-GR":"Groningen","NL-LI":"Limburg","NL-NB":"Noord-Brabant","NL-NH":"Noord-Holland","NL-OV":"Overijssel","NL-UT":"Utrecht","NL-ZE":"Zeeland","NL-ZH":"Zuid-Holland","NZ-AUK":"Auckland","NZ-BOP":"Bay of Plenty","NZ-CAN":"Canterbury","NZ-CIT":"Chatham Islands Territory","NZ-GIS":"Gisborne","NZ-WGN":"Greater Wellington","NZ-HKB":"Hawke's Bay","NZ-MWT":"Manawat\u016B-Whanganui","NZ-MBH":"Marlborough","NZ-NSN":"Nelson","NZ-NTL":"Northland","NZ-OTA":"Otago","NZ-STL":"Southland","NZ-TKI":"Taranaki","NZ-TAS":"Tasman","NZ-WKO":"Waikato","NZ-WTC":"West Coast","NI-BO":"Boaco","NI-CA":"Carazo","NI-CI":"Chinandega","NI-CO":"Chontales","NI-AN":"Costa Caribe Norte","NI-AS":"Costa Caribe Sur","NI-ES":"Estel\xED","NI-GR":"Granada","NI-JI":"Jinotega","NI-LE":"Le\xF3n","NI-MD":"Madriz","NI-MN":"Managua","NI-MS":"Masaya","NI-MT":"Matagalpa","NI-NS":"Nueva Segovia","NI-SJ":"R\xEDo San Juan","NI-RI":"Rivas","NE-1":"Agadez","NE-2":"Diffa","NE-3":"Dosso","NE-4":"Maradi","NE-8":"Niamey","NE-5":"Tahoua","NE-6":"Tillab\xE9ri","NE-7":"Zinder","NG-AB":"Abia","NG-FC":"Abuja Federal Capital Territory","NG-AD":"Adamawa","NG-AK":"Akwa Ibom","NG-AN":"Anambra","NG-BA":"Bauchi","NG-BY":"Bayelsa","NG-BE":"Benue","NG-BO":"Borno","NG-CR":"Cross River","NG-DE":"Delta","NG-EB":"Ebonyi","NG-ED":"Edo","NG-EK":"Ekiti","NG-EN":"Enugu","NG-GO":"Gombe","NG-IM":"Imo","NG-JI":"Jigawa","NG-KD":"Kaduna","NG-KN":"Kano","NG-KT":"Katsina","NG-KE":"Kebbi","NG-KO":"Kogi","NG-KW":"Kwara","NG-LA":"Lagos","NG-NA":"Nasarawa","NG-NI":"Niger","NG-OG":"Ogun","NG-ON":"Ondo","NG-OS":"Osun","NG-OY":"Oyo","NG-PL":"Plateau","NG-RI":"Rivers","NG-SO":"Sokoto","NG-TA":"Taraba","NG-YO":"Yobe","NG-ZA":"Zamfara","MK-801":"Aerodrom","MK-802":"Ara\u010Dinovo","MK-201":"Berovo","MK-501":"Bitola","MK-401":"Bogdanci","MK-601":"Bogovinje","MK-402":"Bosilovo","MK-602":"Brvenica","MK-803":"Butel","MK-814":"Centar","MK-313":"Centar \u017Dupa","MK-815":"\u010Cair","MK-109":"\u010Ca\u0161ka","MK-210":"\u010Ce\u0161inovo-Oble\u0161evo","MK-816":"\u010Cu\u010Der-Sandevo","MK-303":"Debar","MK-304":"Debrca","MK-203":"Del\u010Devo","MK-502":"Demir Hisar","MK-103":"Demir Kapija","MK-406":"Dojran","MK-503":"Dolneni","MK-804":"Gazi Baba","MK-405":"Gevgelija","MK-805":"Gjor\u010De Petrov","MK-604":"Gostivar","MK-102":"Gradsko","MK-807":"Ilinden","MK-606":"Jegunovce","MK-205":"Karbinci","MK-808":"Karpo\u0161","MK-104":"Kavadarci","MK-307":"Ki\u010Devo","MK-809":"Kisela Voda","MK-206":"Ko\u010Dani","MK-407":"Kon\u010De","MK-701":"Kratovo","MK-702":"Kriva Palanka","MK-504":"Krivoga\u0161tani","MK-505":"Kru\u0161evo","MK-703":"Kumanovo","MK-704":"Lipkovo","MK-105":"Lozovo","MK-207":"Makedonska Kamenica","MK-308":"Makedonski Brod","MK-607":"Mavrovo i Rostu\u0161e","MK-506":"Mogila","MK-106":"Negotino","MK-507":"Novaci","MK-408":"Novo Selo","MK-310":"Ohrid","MK-208":"Peh\u010Devo","MK-810":"Petrovec","MK-311":"Plasnica","MK-508":"Prilep","MK-209":"Probi\u0161tip","MK-409":"Radovi\u0161","MK-705":"Rankovce","MK-509":"Resen","MK-107":"Rosoman","MK-811":"Saraj","MK-812":"Sopi\u0161te","MK-706":"Staro Nagori\u010Dane","MK-312":"Struga","MK-410":"Strumica","MK-813":"Studeni\u010Dani","MK-108":"Sveti Nikole","MK-211":"\u0160tip","MK-817":"\u0160uto Orizari","MK-608":"Tearce","MK-609":"Tetovo","MK-403":"Valandovo","MK-404":"Vasilevo","MK-101":"Veles","MK-301":"Vev\u010Dani","MK-202":"Vinica","MK-603":"Vrap\u010Di\u0161te","MK-806":"Zelenikovo","MK-204":"Zrnovci","MK-605":"\u017Delino","NO-42":"Agder","NO-34":"Innlandet","NO-22":"Jan Mayen","NO-15":"M\xF8re og Romsdal","NO-18":"Nordland","NO-03":"Oslo","NO-11":"Rogaland","NO-21":"Svalbard","NO-54":"Troms og Finnmarksefkv","NO-50":"Tr\xF8ndelagsma","NO-38":"Vestfold og Telemark","NO-46":"Vestland","NO-30":"Viken","OM-DA":"Ad D\u0101khil\u012Byah","OM-BU":"Al Buraym\u012B","OM-WU":"Al Wus\u0163\xE1","OM-ZA":"Az\u0327 Z\u0327\u0101hirah","OM-BJ":"Jan\u016Bb al B\u0101\u0163inah","OM-SJ":"Jan\u016Bb ash Sharq\u012Byah","OM-MA":"Masqa\u0163","OM-MU":"Musandam","OM-BS":"Sham\u0101l al B\u0101\u0163inah","OM-SS":"Sham\u0101l ash Sharq\u012Byah","OM-ZU":"Z\u0327uf\u0101r","PK-JK":"\u0100z\u0101d Jamm\u016B\xF1 o Kashm\u012Br","PK-BA":"Bal\u014Dchist\u0101n","PK-GB":"Gilgit-Baltist\u0101n","PK-IS":"Isl\u0101m\u0101b\u0101d","PK-KP":"Kha\u012Bbar Pakht\u016Bnkhw\u0101","PK-PB":"Panj\u0101b","PK-SD":"Sindh","PW-002":"Aimeliik","PW-004":"Airai","PW-010":"Angaur","PW-050":"Hatohobei","PW-100":"Kayangel","PW-150":"Koror","PW-212":"Melekeok","PW-214":"Ngaraard","PW-218":"Ngarchelong","PW-222":"Ngardmau","PW-224":"Ngatpang","PW-226":"Ngchesar","PW-227":"Ngeremlengui","PW-228":"Ngiwal","PW-350":"Peleliu","PW-370":"Sonsorol","PS-BTH":"Bayt La\u1E29m","PS-DEB":"Dayr al Bala\u1E29","PS-GZA":"Ghazzah","PS-HBN":"Al Khal\u012Bl","PS-JEN":"Jan\u012Bn","PS-JRH":"Ar\u012B\u1E29\u0101 wal Aghw\u0101r","PS-JEM":"Al Quds","PS-KYS":"Kh\u0101n Y\u016Bnis","PS-NBS":"N\u0101blus","PS-NGZ":"Sham\u0101l Ghazzah","PS-QQA":"Qalq\u012Blyah","PS-RFH":"Rafa\u1E29","PS-RBH":"R\u0101m All\u0101h wal B\u012Brah","PS-SLT":"Salf\u012Bt","PS-TBS":"\u0162\u016Bb\u0101s","PS-TKM":"\u0162\u016Blkarm","PA-1":"Bocas del Toro","PA-4":"Chiriqu\xED","PA-2":"Cocl\xE9","PA-3":"Col\xF3n","PA-5":"Dari\xE9n","PA-EM":"Ember\xE1","PA-KY":"Guna Yala","PA-6":"Herrera","PA-7":"Los Santos","PA-NT":"Naso Tj\xEBr Di","PA-NB":"Ng\xE4be-Bugl\xE9","PA-8":"Panam\xE1","PA-10":"Panam\xE1 Oeste","PA-9":"Veraguas","PG-NSB":"Bougainville","PG-CPM":"Central","PG-CPK":"Chimbu","PG-EBR":"East New Britain","PG-ESW":"East Sepik","PG-EHG":"Eastern Highlands","PG-EPW":"Enga","PG-GPK":"Gulf","PG-HLA":"Hela","PG-JWK":"Jiwaka","PG-MPM":"Madang","PG-MRL":"Manus","PG-MBA":"Milne Bay","PG-MPL":"Morobe","PG-NCD":"National Capital District","PG-NIK":"New Ireland","PG-NPP":"Northern","PG-SHM":"Southern Highlands","PG-WBK":"West New Britain","PG-SAN":"West Sepik","PG-WPD":"Western","PG-WHM":"Western Highlands","PY-16":"Alto Paraguay","PY-10":"Alto Paran\xE1","PY-13":"Amambay","PY-ASU":"Asunci\xF3n","PY-19":"Boquer\xF3n","PY-5":"Caaguaz\xFA","PY-6":"Caazap\xE1","PY-14":"Canindey\xFA","PY-11":"Central","PY-1":"Concepci\xF3n","PY-3":"Cordillera","PY-4":"Guair\xE1","PY-7":"Itap\xFAa","PY-8":"Misiones","PY-12":"\xD1eembuc\xFA","PY-9":"Paraguar\xED","PY-15":"Presidente Hayes","PY-2":"San Pedro","PE-AMA":"Amazonas","PE-ANC":"Ancash","PE-APU":"Apur\xEDmac","PE-ARE":"Arequipa","PE-AYA":"Ayacucho","PE-CAJ":"Cajamarca","PE-CUS":"Cusco","PE-CAL":"El Callao","PE-HUV":"Huancavelica","PE-HUC":"Hu\xE1nuco","PE-ICA":"Ica","PE-JUN":"Jun\xEDn","PE-LAL":"La Libertad","PE-LAM":"Lambayeque","PE-LIM":"Lima","PE-LOR":"Loreto","PE-MDD":"Madre de Dios","PE-MOQ":"Moquegua","PE-LMA":"Municipalidad Metropolitana de Lima","PE-PAS":"Pasco","PE-PIU":"Piura","PE-PUN":"Puno","PE-SAM":"San Mart\xEDn","PE-TAC":"Tacna","PE-TUM":"Tumbes","PE-UCA":"Ucayali","PH-14":"Autonomous Region in Muslim Mindanao[b]","PH-05":"Bicol","PH-02":"Cagayan Valley","PH-40":"Calabarzon","PH-13":"Caraga","PH-03":"Central Luzon","PH-07":"Central Visayas","PH-15":"Cordillera Administrative Region","PH-11":"Davao","PH-08":"Eastern Visayas","PH-01":"Ilocos","PH-41":"Mimaropa","PH-00":"National Capital Region","PH-10":"Northern Mindanao","PH-12":"Soccsksargen","PH-06":"Western Visayas","PH-09":"Zamboanga Peninsula","PL-02":"Dolno\u015Bl\u0105skie","PL-04":"Kujawsko-Pomorskie","PL-06":"Lubelskie","PL-08":"Lubuskie","PL-10":"\u0141\xF3dzkie","PL-12":"Ma\u0142opolskie","PL-14":"Mazowieckie","PL-16":"Opolskie","PL-18":"Podkarpackie","PL-20":"Podlaskie","PL-22":"Pomorskie","PL-24":"\u015Al\u0105skie","PL-26":"\u015Awi\u0119tokrzyskie","PL-28":"Warmi\u0144sko-Mazurskie","PL-30":"Wielkopolskie","PL-32":"Zachodniopomorskie","PT-01":"Aveiro","PT-02":"Beja","PT-03":"Braga","PT-04":"Bragan\xE7a","PT-05":"Castelo Branco","PT-06":"Coimbra","PT-07":"\xC9vora","PT-08":"Faro","PT-09":"Guarda","PT-10":"Leiria","PT-11":"Lisboa","PT-12":"Portalegre","PT-13":"Porto","PT-30":"Regi\xE3o Aut\xF3noma da Madeira","PT-20":"Regi\xE3o Aut\xF3noma dos A\xE7ores","PT-14":"Santar\xE9m","PT-15":"Set\xFAbal","PT-16":"Viana do Castelo","PT-17":"Vila Real","PT-18":"Viseu","QA-DA":"Ad Daw\u1E29ah","QA-KH":"Al Khawr wa adh Dhakh\u012Brah","QA-WA":"Al Wakrah","QA-RA":"Ar Rayy\u0101n","QA-MS":"Ash Sham\u0101l","QA-SH":"Ash Sh\u012B\u1E29\u0101n\u012Byah","QA-ZA":"Az\u0327 Z\u0327a\u2018\u0101yin","QA-US":"Umm \u015Eal\u0101l","RO-AB":"Alba","RO-AR":"Arad","RO-AG":"Arge\u0219","RO-BC":"Bac\u0103u","RO-BH":"Bihor","RO-BN":"Bistri\u021Ba-N\u0103s\u0103ud","RO-BT":"Boto\u0219ani","RO-BV":"Bra\u0219ov","RO-BR":"Br\u0103ila","RO-B":"Bucure\u0219ti","RO-BZ":"Buz\u0103u","RO-CS":"Cara\u0219-Severin","RO-CL":"C\u0103l\u0103ra\u0219i","RO-CJ":"Cluj","RO-CT":"Constan\u021Ba","RO-CV":"Covasna","RO-DB":"D\xE2mbovi\u021Ba","RO-DJ":"Dolj","RO-GL":"Gala\u021Bi","RO-GR":"Giurgiu","RO-GJ":"Gorj","RO-HR":"Harghita","RO-HD":"Hunedoara","RO-IL":"Ialomi\u021Ba","RO-IS":"Ia\u0219i","RO-IF":"Ilfov","RO-MM":"Maramure\u0219","RO-MH":"Mehedin\u021Bi","RO-MS":"Mure\u0219","RO-NT":"Neam\u021B","RO-OT":"Olt","RO-PH":"Prahova","RO-SM":"Satu Mare","RO-SJ":"S\u0103laj","RO-SB":"Sibiu","RO-SV":"Suceava","RO-TR":"Teleorman","RO-TM":"Timi\u0219","RO-TL":"Tulcea","RO-VS":"Vaslui","RO-VL":"V\xE2lcea","RO-VN":"Vrancea","RU-AD":"Adygeya","RU-AL":"Altay","RU-ALT":"Altayskiy kray","RU-AMU":"Amurskaya oblast'","RU-ARK":"Arkhangel'skaya oblast'","RU-AST":"Astrakhanskaya oblast'","RU-BA":"Bashkortostan","RU-BEL":"Belgorodskaya oblast'","RU-BRY":"Bryanskaya oblast'","RU-BU":"Buryatiya","RU-CE":"Chechenskaya Respublika","RU-CHE":"Chelyabinskaya oblast'","RU-CHU":"Chukotskiy avtonomnyy okrug","RU-CU":"Chuvashskaya Respublika","RU-DA":"Dagestan","RU-IN":"Ingushetiya","RU-IRK":"Irkutskaya oblast'","RU-IVA":"Ivanovskaya oblast'","RU-KB":"Kabardino-BalkarskayaRespublika","RU-KGD":"Kaliningradskaya oblast'","RU-KL":"Kalmykiya","RU-KLU":"Kaluzhskaya oblast'","RU-KAM":"Kamchatskiy kray","RU-KC":"Karachayevo-CherkesskayaRespublika","RU-KR":"Kareliya","RU-KEM":"Kemerovskaya oblast'","RU-KHA":"Khabarovskiy kray","RU-KK":"Khakasiya","RU-KHM":"Khanty-Mansiyskiyavtonomnyy okrug","RU-KIR":"Kirovskaya oblast'","RU-KO":"Komi","RU-KOS":"Kostromskaya oblast'","RU-KDA":"Krasnodarskiy kray","RU-KYA":"Krasnoyarskiy kray","RU-KGN":"Kurganskaya oblast'","RU-KRS":"Kurskaya oblast'","RU-LEN":"Leningradskayaoblast'","RU-LIP":"Lipetskaya oblast'","RU-MAG":"Magadanskaya oblast'","RU-ME":"Mariy El","RU-MO":"Mordoviya","RU-MOS":"Moskovskaya oblast'","RU-MOW":"Moskva","RU-MUR":"Murmanskaya oblast'","RU-NEN":"Nenetskiyavtonomnyy okrug","RU-NIZ":"Nizhegorodskaya oblast'","RU-NGR":"Novgorodskaya oblast'","RU-NVS":"Novosibirskayaoblast'","RU-OMS":"Omskaya oblast'","RU-ORE":"Orenburgskaya oblast'","RU-ORL":"Orlovskaya oblast'","RU-PNZ":"Penzenskaya oblast'","RU-PER":"Permskiy kray","RU-PRI":"Primorskiy kray","RU-PSK":"Pskovskaya oblast'","RU-ROS":"Rostovskaya oblast'","RU-RYA":"Ryazanskaya oblast'","RU-SA":"Saha","RU-SAK":"Sakhalinskaya oblast'","RU-SAM":"Samarskaya oblast'","RU-SPE":"Sankt-Peterburg","RU-SAR":"Saratovskaya oblast'","RU-SE":"Severnaya Osetiya","RU-SMO":"Smolenskaya oblast'","RU-STA":"Stavropol'skiy kray","RU-SVE":"Sverdlovskaya oblast'","RU-TAM":"Tambovskaya oblast'","RU-TA":"Tatarstan","RU-TOM":"Tomskaya oblast'","RU-TUL":"Tul'skaya oblast'","RU-TVE":"Tverskaya oblast'","RU-TYU":"Tyumenskaya oblast'","RU-TY":"Tyva","RU-UD":"Udmurtskaya Respublika","RU-ULY":"Ul'yanovskaya oblast'","RU-VLA":"Vladimirskayaoblast'","RU-VGG":"Volgogradskayaoblast'","RU-VLG":"Vologodskaya oblast'","RU-VOR":"Voronezhskaya oblast'","RU-YAN":"Yamalo-Nenetskiyavtonomnyy okrug","RU-YAR":"Yaroslavskaya oblast'","RU-YEV":"Yevreyskaya avtonomnaya oblast'","RU-ZAB":"Zabaykal'skiy kray","RW-01":"City of Kigali","RW-02":"Eastern","RW-03":"Northern","RW-05":"Southern","RW-04":"Western","SH-AC":"Ascension","SH-HL":"Saint Helena","SH-TA":"Tristan da Cunha","KN-K":"Saint Kitts","KN-N":"Nevis","LC-01":"Anse la Raye","LC-12":"Canaries","LC-02":"Castries","LC-03":"Choiseul","LC-05":"Dennery","LC-06":"Gros Islet","LC-07":"Laborie","LC-08":"Micoud","LC-10":"Soufri\xE8re","LC-11":"Vieux Fort","VC-01":"Charlotte","VC-06":"Grenadines","VC-02":"Saint Andrew","VC-03":"Saint David","VC-04":"Saint George","VC-05":"Saint Patrick","WS-AA":"A'ana","WS-AL":"Aiga-i-le-Tai","WS-AT":"Atua","WS-FA":"Fa'asaleleaga","WS-GE":"Gaga'emauga","WS-GI":"Gagaifomauga","WS-PA":"Palauli","WS-SA":"Satupa'itea","WS-TU":"Tuamasaga","WS-VF":"Va'a-o-Fonoti","WS-VS":"Vaisigano","SM-01":"Acquaviva","SM-06":"Borgo Maggiore","SM-02":"Chiesanuova","SM-07":"Citt\xE0 di San Marino","SM-03":"Domagnano","SM-04":"Faetano","SM-05":"Fiorentino","SM-08":"Montegiardino","SM-09":"Serravalle","ST-01":"\xC1gua Grande","ST-02":"Cantagalo","ST-03":"Cau\xE9","ST-04":"Lemb\xE1","ST-05":"Lobata","ST-06":"M\xE9-Z\xF3chi","ST-P":"Pr\xEDncipe","SA-14":"'As\u012Br","SA-11":"Al B\u0101\u1E29ah","SA-08":"Al \u1E28ud\u016Bd ash Sham\u0101l\u012Byah","SA-12":"Al Jawf","SA-03":"Al Mad\u012Bnah al Munawwarah","SA-05":"Al Qa\u015F\u012Bm","SA-01":"Ar Riy\u0101\u1E11","SA-04":"Ash Sharq\u012Byah","SA-06":"\u1E28\u0101'il","SA-09":"J\u0101z\u0101n","SA-02":"Makkah al Mukarramah","SA-10":"Najr\u0101n","SA-07":"Tab\u016Bk","SN-DK":"Dakar","SN-DB":"Diourbel","SN-FK":"Fatick","SN-KA":"Kaffrine","SN-KL":"Kaolack","SN-KE":"K\xE9dougou","SN-KD":"Kolda","SN-LG":"Louga","SN-MT":"Matam","SN-SL":"Saint-Louis","SN-SE":"S\xE9dhiou","SN-TC":"Tambacounda","SN-TH":"Thi\xE8s","SN-ZG":"Ziguinchor","SC-01":"Anse aux Pins","SC-02":"Anse Boileau","SC-03":"Anse Etoile","SC-05":"Anse Royale","SC-04":"Au Cap","SC-06":"Baie Lazare","SC-07":"Baie Sainte Anne","SC-08":"Beau Vallon","SC-09":"Bel Air","SC-10":"Bel Ombre","SC-11":"Cascade","SC-16":"English River","SC-12":"Glacis","SC-13":"Grand Anse Mahe","SC-14":"Grand Anse Praslin","SC-26":"Ile Perseverance I","SC-27":"Ile Perseverance II","SC-15":"La Digue","SC-24":"Les Mamelles","SC-17":"Mont Buxton","SC-18":"Mont Fleuri","SC-19":"Plaisance","SC-20":"Pointe Larue","SC-21":"Port Glaud","SC-25":"Roche Caiman","SC-22":"Saint Louis","SC-23":"Takamaka","SL-E":"Eastern","SL-NW":"North Western","SL-N":"Northern","SL-S":"Southern","SL-W":"Western Area","SG-01":"Central Singapore","SG-02":"North East","SG-03":"North West","SG-04":"South East","SG-05":"South West","SK-BC":"Banskobystrick\xFD kraj","SK-BL":"Bratislavsk\xFD kraj","SK-KI":"Ko\u0161ick\xFD kraj","SK-NI":"Nitriansky kraj","SK-PV":"Pre\u0161ovsk\xFD kraj","SK-TC":"Tren\u010Diansky kraj","SK-TA":"Trnavsk\xFD kraj","SK-ZI":"\u017Dilinsk\xFD kraj","SI-001":"Ajdov\u0161\u010Dina","SI-213":"Ankaran","SI-195":"Apa\u010De","SI-002":"Beltinci","SI-148":"Benedikt","SI-149":"Bistrica ob Sotli","SI-003":"Bled","SI-150":"Bloke","SI-004":"Bohinj","SI-005":"Borovnica","SI-006":"Bovec","SI-151":"Braslov\u010De","SI-007":"Brda","SI-008":"Brezovica","SI-009":"Bre\u017Eice","SI-152":"Cankova","SI-011":"Celje","SI-012":"Cerklje na Gorenjskem","SI-013":"Cerknica","SI-014":"Cerkno","SI-153":"Cerkvenjak","SI-196":"Cirkulane","SI-015":"\u010Cren\u0161ovci","SI-016":"\u010Crna na Koro\u0161kem","SI-017":"\u010Crnomelj","SI-018":"Destrnik","SI-019":"Diva\u010Da","SI-154":"Dobje","SI-020":"Dobrepolje","SI-155":"Dobrna","SI-021":"Dobrova-Polhov Gradec","SI-156":"Dobrovnik","SI-022":"Dol pri Ljubljani","SI-157":"Dolenjske Toplice","SI-023":"Dom\u017Eale","SI-024":"Dornava","SI-025":"Dravograd","SI-026":"Duplek","SI-027":"Gorenja vas-Poljane","SI-028":"Gori\u0161nica","SI-207":"Gorje","SI-029":"Gornja Radgona","SI-030":"Gornji Grad","SI-031":"Gornji Petrovci","SI-158":"Grad","SI-032":"Grosuplje","SI-159":"Hajdina","SI-160":"Ho\u010De-Slivnica","SI-161":"Hodo\u0161","SI-162":"Horjul","SI-034":"Hrastnik","SI-035":"Hrpelje-Kozina","SI-036":"Idrija","SI-037":"Ig","SI-038":"Ilirska Bistrica","SI-039":"Ivan\u010Dna Gorica","SI-040":"Izola","SI-041":"Jesenice","SI-163":"Jezersko","SI-042":"Jur\u0161inci","SI-043":"Kamnik","SI-044":"Kanal ob So\u010Di","SI-045":"Kidri\u010Devo","SI-046":"Kobarid","SI-047":"Kobilje","SI-048":"Ko\u010Devje","SI-049":"Komen","SI-164":"Komenda","SI-050":"Koper","SI-197":"Kostanjevica na Krki","SI-165":"Kostel","SI-051":"Kozje","SI-052":"Kranj","SI-053":"Kranjska Gora","SI-166":"Kri\u017Eevci","SI-054":"Kr\u0161ko","SI-055":"Kungota","SI-056":"Kuzma","SI-057":"La\u0161ko","SI-058":"Lenart","SI-059":"Lendava","SI-060":"Litija","SI-061":"Ljubljana","SI-062":"Ljubno","SI-063":"Ljutomer","SI-208":"Log-Dragomer","SI-064":"Logatec","SI-065":"Lo\u0161ka dolina","SI-066":"Lo\u0161ki Potok","SI-167":"Lovrenc na Pohorju","SI-067":"Lu\u010De","SI-068":"Lukovica","SI-069":"Maj\u0161perk","SI-198":"Makole","SI-070":"Maribor","SI-168":"Markovci","SI-071":"Medvode","SI-072":"Menge\u0161","SI-073":"Metlika","SI-074":"Me\u017Eica","SI-169":"Miklav\u017E na Dravskem polju","SI-075":"Miren-Kostanjevica","SI-212":"Mirna","SI-170":"Mirna Pe\u010D","SI-076":"Mislinja","SI-199":"Mokronog-Trebelno","SI-077":"Morav\u010De","SI-078":"Moravske Toplice","SI-079":"Mozirje","SI-080":"Murska Sobota","SI-081":"Muta","SI-082":"Naklo","SI-083":"Nazarje","SI-084":"Nova Gorica","SI-085":"Novo Mesto","SI-086":"Odranci","SI-171":"Oplotnica","SI-087":"Ormo\u017E","SI-088":"Osilnica","SI-089":"Pesnica","SI-090":"Piran","SI-091":"Pivka","SI-092":"Pod\u010Detrtek","SI-172":"Podlehnik","SI-093":"Podvelka","SI-200":"Polj\u010Dane","SI-173":"Polzela","SI-094":"Postojna","SI-174":"Prebold","SI-095":"Preddvor","SI-175":"Prevalje","SI-096":"Ptuj","SI-097":"Puconci","SI-098":"Ra\u010De-Fram","SI-099":"Rade\u010De","SI-100":"Radenci","SI-101":"Radlje ob Dravi","SI-102":"Radovljica","SI-103":"Ravne na Koro\u0161kem","SI-176":"Razkri\u017Eje","SI-209":"Re\u010Dica ob Savinji","SI-201":"Ren\u010De-Vogrsko","SI-104":"Ribnica","SI-177":"Ribnica na Pohorju","SI-106":"Roga\u0161ka Slatina","SI-105":"Roga\u0161ovci","SI-107":"Rogatec","SI-108":"Ru\u0161e","SI-178":"Selnica ob Dravi","SI-109":"Semi\u010D","SI-110":"Sevnica","SI-111":"Se\u017Eana","SI-112":"Slovenj Gradec","SI-113":"Slovenska Bistrica","SI-114":"Slovenske Konjice","SI-179":"Sodra\u017Eica","SI-180":"Sol\u010Dava","SI-202":"Sredi\u0161\u010De ob Dravi","SI-115":"Star\u0161e","SI-203":"Stra\u017Ea","SI-181":"Sveta Ana","SI-204":"Sveta Trojica v Slovenskih goricah","SI-182":"Sveti Andra\u017E v Slovenskih goricah","SI-116":"Sveti Jurij ob \u0160\u010Davnici","SI-210":"Sveti Jurij v Slovenskih goricah","SI-205":"Sveti Toma\u017E","SI-033":"\u0160alovci","SI-183":"\u0160empeter-Vrtojba","SI-117":"\u0160en\u010Dur","SI-118":"\u0160entilj","SI-119":"\u0160entjernej","SI-120":"\u0160entjur","SI-211":"\u0160entrupert","SI-121":"\u0160kocjan","SI-122":"\u0160kofja Loka","SI-123":"\u0160kofljica","SI-124":"\u0160marje pri Jel\u0161ah","SI-206":"\u0160marje\u0161ke Toplice","SI-125":"\u0160martno ob Paki","SI-194":"\u0160martno pri Litiji","SI-126":"\u0160o\u0161tanj","SI-127":"\u0160tore","SI-184":"Tabor","SI-010":"Ti\u0161ina","SI-128":"Tolmin","SI-129":"Trbovlje","SI-130":"Trebnje","SI-185":"Trnovska Vas","SI-186":"Trzin","SI-131":"Tr\u017Ei\u010D","SI-132":"Turni\u0161\u010De","SI-133":"Velenje","SI-187":"Velika Polana","SI-134":"Velike La\u0161\u010De","SI-188":"Ver\u017Eej","SI-135":"Videm","SI-136":"Vipava","SI-137":"Vitanje","SI-138":"Vodice","SI-139":"Vojnik","SI-189":"Vransko","SI-140":"Vrhnika","SI-141":"Vuzenica","SI-142":"Zagorje ob Savi","SI-143":"Zavr\u010D","SI-144":"Zre\u010De","SI-190":"\u017Dalec","SI-146":"\u017Delezniki","SI-191":"\u017Detale","SI-147":"\u017Diri","SI-192":"\u017Dirovnica","SI-193":"\u017Du\u017Eemberk","SB-CT":"Capital Territory","SB-CE":"Central","SB-CH":"Choiseul","SB-GU":"Guadalcanal","SB-IS":"Isabel","SB-MK":"Makira-Ulawa","SB-ML":"Malaita","SB-RB":"Rennell and Bellona","SB-TE":"Temotu","SB-WE":"Western","SO-AW":"Awdal","SO-BK":"Bakool","SO-BN":"Banaadir","SO-BR":"Bari","SO-BY":"Bay","SO-GA":"Galguduud","SO-GE":"Gedo","SO-HI":"Hiiraan","SO-JD":"Jubbada Dhexe","SO-JH":"Jubbada Hoose","SO-MU":"Mudug","SO-NU":"Nugaal","SO-SA":"Sanaag","SO-SD":"Shabeellaha Dhexe","SO-SH":"Shabeellaha Hoose","SO-SO":"Sool","SO-TO":"Togdheer","SO-WO":"Woqooyi Galbeed","ZA-EC":"Eastern Cape","ZA-FS":"Free State","ZA-GP":"Gauteng","ZA-KZN":"Kwazulu-Natal","ZA-LP":"Limpopo","ZA-MP":"Mpumalanga","ZA-NW":"North-West","ZA-NC":"Northern Cape","ZA-WC":"Western Cape","ES-AN":"Andaluc\xEDa","ES-AR":"Arag\xF3n","ES-AS":"Asturias","ES-CN":"Canarias","ES-CB":"Cantabria","ES-CL":"Castilla y Le\xF3n","ES-CM":"Castilla-La Mancha","ES-CT":"Catalunya","ES-CE":"Ceuta","ES-EX":"Extremadura","ES-GA":"Galicia","ES-IB":"Illes Balears","ES-RI":"La Rioja","ES-MD":"Madrid","ES-ML":"Melilla","ES-MC":"Murcia","ES-NC":"Navarra","ES-PV":"Pa\xEDs Vasco","ES-VC":"Valenciana","LK-1":"Basn\u0101hira pa\u1E37\u0101ta","LK-3":"Daku\u1E47u pa\u1E37\u0101ta","LK-2":"Madhyama pa\u1E37\u0101ta","LK-5":"N\xE6\u0306g\u0115nahira pa\u1E37\u0101ta","LK-9":"Sabaragamuva pa\u1E37\u0101ta","LK-4":"Uturu pa\u1E37\u0101ta","LK-7":"Uturum\xE6\u0306da pa\u1E37\u0101ta","LK-8":"\u016Ava pa\u1E37\u0101ta","LK-6":"Vayamba pa\u1E37\u0101ta","SD-RS":"Al Ba\u1E29r al A\u1E29mar","SD-GZ":"Al Jaz\u012Brah","SD-KH":"Al Khar\u0163\u016Bm","SD-GD":"Al Qa\u1E11\u0101rif","SD-NW":"An N\u012Bl al Abya\u1E11","SD-NB":"An N\u012Bl al Azraq","SD-NO":"Ash Sham\u0101l\u012Byah","SD-DW":"Gharb D\u0101rf\u016Br","SD-GK":"Gharb Kurduf\u0101n","SD-DS":"Jan\u016Bb D\u0101rf\u016Br","SD-KS":"Jan\u016Bb Kurduf\u0101n","SD-KA":"Kassal\u0101","SD-NR":"Nahr an N\u012Bl","SD-DN":"Sham\u0101l D\u0101rf\u016Br","SD-KN":"Sham\u0101l Kurduf\u0101n","SD-DE":"Sharq D\u0101rf\u016Br","SD-SI":"Sinn\u0101r","SD-DC":"Wasa\u0163 D\u0101rf\u016Br","SR-BR":"Brokopondo","SR-CM":"Commewijne","SR-CR":"Coronie","SR-MA":"Marowijne","SR-NI":"Nickerie","SR-PR":"Para","SR-PM":"Paramaribo","SR-SA":"Saramacca","SR-SI":"Sipaliwini","SR-WA":"Wanica","SZ-HH":"Hhohho","SZ-LU":"Lubombo","SZ-MA":"Manzini","SZ-SH":"Shiselweni","SE-K":"Blekinge l\xE4n","SE-W":"Dalarnas l\xE4n","SE-I":"Gotlands l\xE4n","SE-X":"G\xE4vleborgs l\xE4n","SE-N":"Hallands l\xE4n","SE-Z":"J\xE4mtlands l\xE4n","SE-F":"J\xF6nk\xF6pings l\xE4n","SE-H":"Kalmar l\xE4n","SE-G":"Kronobergs l\xE4n","SE-BD":"Norrbottens l\xE4n","SE-M":"Sk\xE5ne l\xE4n","SE-AB":"Stockholms l\xE4n","SE-D":"S\xF6dermanlands l\xE4n","SE-C":"Uppsala l\xE4n","SE-S":"V\xE4rmlands l\xE4n","SE-AC":"V\xE4sterbottens l\xE4n","SE-Y":"V\xE4sternorrlands l\xE4n","SE-U":"V\xE4stmanlands l\xE4n","SE-O":"V\xE4stra G\xF6talands l\xE4n","SE-T":"\xD6rebro l\xE4n","SE-E":"\xD6sterg\xF6tlands l\xE4n","CH-AG":"Aargau","CH-AR":"Appenzell Ausserrhoden","CH-AI":"Appenzell Innerrhoden","CH-BL":"Basel-Landschaft","CH-BS":"Basel-Stadt","CH-BE":"Bern","CH-FR":"Fribourg","CH-GE":"Gen\xE8ve","CH-GL":"Glarus","CH-GR":"Graub\xFCnden","CH-JU":"Jura","CH-LU":"Luzern","CH-NE":"Neuch\xE2tel","CH-NW":"Nidwalden","CH-OW":"Obwalden","CH-SG":"Sankt Gallen","CH-SH":"Schaffhausen","CH-SZ":"Schwyz","CH-SO":"Solothurn","CH-TG":"Thurgau","CH-TI":"Ticino","CH-UR":"Uri","CH-VS":"Valais","CH-VD":"Vaud","CH-ZG":"Zug","CH-ZH":"Z\xFCrich","SY-HA":"Al \u1E28asakah","SY-LA":"Al L\u0101dhiq\u012Byah","SY-QU":"Al Qunay\u0163irah","SY-RA":"Ar Raqqah","SY-SU":"As Suwayd\u0101'","SY-DR":"Dar'\u0101","SY-DY":"Dayr az Zawr","SY-DI":"Dimashq","SY-HL":"\u1E28alab","SY-HM":"\u1E28am\u0101h","SY-HI":"\u1E28im\u015F","SY-ID":"Idlib","SY-RD":"R\u012Bf Dimashq","SY-TA":"\u0162ar\u0163\u016Bs","TW-CHA":"Changhua","TW-CYI":"Chiayi","TW-CYQ":"Chiayi","TW-HSZ":"Hsinchu","TW-HSQ":"Hsinchu","TW-HUA":"Hualien","TW-KHH":"Kaohsiung","TW-KEE":"Keelung","TW-KIN":"Kinmen","TW-LIE":"Lienchiang","TW-MIA":"Miaoli","TW-NAN":"Nantou","TW-NWT":"New Taipei","TW-PEN":"Penghu","TW-PIF":"Pingtung","TW-TXG":"Taichung","TW-TNN":"Tainan","TW-TPE":"Taipei","TW-TTT":"Taitung","TW-TAO":"Taoyuan","TW-ILA":"Yilan","TW-YUN":"Yunlin","TJ-DU":"Dushanbe","TJ-KT":"Khatlon","TJ-GB":"K\u016Dhistoni Badakhshon","TJ-RA":"nohiyahoi tobei jumhur\xED","TJ-SU":"Sughd","TZ-01":"Arusha","TZ-02":"Dar es Salaam","TZ-03":"Dodoma","TZ-27":"Geita","TZ-04":"Iringa","TZ-05":"Kagera","TZ-06":"Kaskazini Pemba","TZ-07":"Kaskazini Unguja","TZ-28":"Katavi","TZ-08":"Kigoma","TZ-09":"Kilimanjaro","TZ-10":"Kusini Pemba","TZ-11":"Kusini Unguja","TZ-12":"Lindi","TZ-26":"Manyara","TZ-13":"Mara","TZ-14":"Mbeya","TZ-15":"Mjini Magharibi","TZ-16":"Morogoro","TZ-17":"Mtwara","TZ-18":"Mwanza","TZ-29":"Njombe","TZ-19":"Pwani","TZ-20":"Rukwa","TZ-21":"Ruvuma","TZ-22":"Shinyanga","TZ-30":"Simiyu","TZ-23":"Singida","TZ-31":"Songwe","TZ-24":"Tabora","TZ-25":"Tanga","TH-37":"Amnat Charoen","TH-15":"Ang Thong","TH-38":"Bueng Kan","TH-31":"Buri Ram","TH-24":"Chachoengsao","TH-18":"Chai Nat","TH-36":"Chaiyaphum","TH-22":"Chanthaburi","TH-50":"Chiang Mai","TH-57":"Chiang Rai","TH-20":"Chon Buri","TH-86":"Chumphon","TH-46":"Kalasin","TH-62":"Kamphaeng Phet","TH-71":"Kanchanaburi","TH-40":"Khon Kaen","TH-81":"Krabi","TH-10":"Bangkok","TH-52":"Lampang","TH-51":"Lamphun","TH-42":"Loei","TH-16":"Lop Buri","TH-58":"Mae Hong Son","TH-44":"Maha Sarakham","TH-49":"Mukdahan","TH-26":"Nakhon Nayok","TH-73":"Nakhon Pathom","TH-48":"Nakhon Phanom","TH-30":"Nakhon Ratchasima","TH-60":"Nakhon Sawan","TH-80":"Nakhon Si Thammarat","TH-55":"Nan","TH-96":"Narathiwat","TH-39":"Nong Bua Lam Phu","TH-43":"Nong Khai","TH-12":"Nonthaburi","TH-13":"Pathum Thani","TH-94":"Pattani","TH-82":"Phangnga","TH-93":"Phatthalung","TH-S":"Phatthaya","TH-56":"Phayao","TH-67":"Phetchabun","TH-76":"Phetchaburi","TH-66":"Phichit","TH-65":"Phitsanulok","TH-14":"Phra Nakhon Si Ayutthaya","TH-54":"Phrae","TH-83":"Phuket","TH-25":"Prachin Buri","TH-77":"Prachuap Khiri Khan","TH-85":"Ranong","TH-70":"Ratchaburi","TH-21":"Rayong","TH-45":"Roi Et","TH-27":"Sa Kaeo","TH-47":"Sakon Nakhon","TH-11":"Samut Prakan","TH-74":"Samut Sakhon","TH-75":"Samut Songkhram","TH-19":"Saraburi","TH-91":"Satun","TH-33":"Si Sa Ket","TH-17":"Sing Buri","TH-90":"Songkhla","TH-64":"Sukhothai","TH-72":"Suphan Buri","TH-84":"Surat Thani","TH-32":"Surin","TH-63":"Tak","TH-92":"Trang","TH-23":"Trat","TH-34":"Ubon Ratchathani","TH-41":"Udon Thani","TH-61":"Uthai Thani","TH-53":"Uttaradit","TH-95":"Yala","TH-35":"Yasothon","TL-AL":"Aileu","TL-AN":"Ainaro","TL-BA":"Baucau","TL-BO":"Bobonaro","TL-CO":"Cova Lima","TL-DI":"D\xEDli","TL-ER":"Ermera","TL-LA":"Laut\xE9m","TL-LI":"Liqui\xE7a","TL-MT":"Manatuto","TL-MF":"Manufahi","TL-OE":"O\xE9-Cusse Ambeno","TL-VI":"Viqueque","TG-C":"Centrale","TG-K":"Kara","TG-M":"Maritime","TG-P":"Plateaux","TG-S":"Savanes","TO-01":"'Eua","TO-02":"Ha'apai","TO-03":"Niuas","TO-04":"Tongatapu","TO-05":"Vava'u","TT-ARI":"Arima","TT-CHA":"Chaguanas","TT-CTT":"Couva-Tabaquite-Talparo","TT-DMN":"Diego Martin","TT-MRC":"Mayaro-Rio Claro","TT-PED":"Penal-Debe","TT-POS":"Port of Spain","TT-PRT":"Princes Town","TT-PTF":"Point Fortin","TT-SFO":"San Fernando","TT-SGE":"Sangre Grande","TT-SIP":"Siparia","TT-SJL":"San Juan-Laventille","TT-TOB":"Tobago","TT-TUP":"Tunapuna-Piarco","TN-31":"B\xE9ja","TN-13":"Ben Arous","TN-23":"Bizerte","TN-81":"Gab\xE8s","TN-71":"Gafsa","TN-32":"Jendouba","TN-41":"Kairouan","TN-42":"Kasserine","TN-73":"K\xE9bili","TN-12":"L'Ariana","TN-14":"La Manouba","TN-33":"Le Kef","TN-53":"Mahdia","TN-82":"M\xE9denine","TN-52":"Monastir","TN-21":"Nabeul","TN-61":"Sfax","TN-43":"Sidi Bouzid","TN-34":"Siliana","TN-51":"Sousse","TN-83":"Tataouine","TN-72":"Tozeur","TN-11":"Tunis","TN-22":"Zaghouan","TR-01":"Adana","TR-02":"Ad\u0131yaman","TR-03":"Afyonkarahisar","TR-04":"A\u011Fr\u0131","TR-68":"Aksaray","TR-05":"Amasya","TR-06":"Ankara","TR-07":"Antalya","TR-75":"Ardahan","TR-08":"Artvin","TR-09":"Ayd\u0131n","TR-10":"Bal\u0131kesir","TR-74":"Bart\u0131n","TR-72":"Batman","TR-69":"Bayburt","TR-11":"Bilecik","TR-12":"Bing\xF6l","TR-13":"Bitlis","TR-14":"Bolu","TR-15":"Burdur","TR-16":"Bursa","TR-17":"\xC7anakkale","TR-18":"\xC7ank\u0131r\u0131","TR-19":"\xC7orum","TR-20":"Denizli","TR-21":"Diyarbak\u0131r","TR-81":"D\xFCzce","TR-22":"Edirne","TR-23":"Elaz\u0131\u011F","TR-24":"Erzincan","TR-25":"Erzurum","TR-26":"Eski\u015Fehir","TR-27":"Gaziantep","TR-28":"Giresun","TR-29":"G\xFCm\xFC\u015Fhane","TR-30":"Hakk\xE2ri","TR-31":"Hatay","TR-76":"I\u011Fd\u0131r","TR-32":"Isparta","TR-34":"\u0130stanbul","TR-35":"\u0130zmir","TR-46":"Kahramanmara\u015F","TR-78":"Karab\xFCk","TR-70":"Karaman","TR-36":"Kars","TR-37":"Kastamonu","TR-38":"Kayseri","TR-71":"K\u0131r\u0131kkale","TR-39":"K\u0131rklareli","TR-40":"K\u0131r\u015Fehir","TR-79":"Kilis","TR-41":"Kocaeli","TR-42":"Konya","TR-43":"K\xFCtahya","TR-44":"Malatya","TR-45":"Manisa","TR-47":"Mardin","TR-33":"Mersin","TR-48":"Mu\u011Fla","TR-49":"Mu\u015F","TR-50":"Nev\u015Fehir","TR-51":"Ni\u011Fde","TR-52":"Ordu","TR-80":"Osmaniye","TR-53":"Rize","TR-54":"Sakarya","TR-55":"Samsun","TR-56":"Siirt","TR-57":"Sinop","TR-58":"Sivas","TR-63":"\u015Eanl\u0131urfa","TR-73":"\u015E\u0131rnak","TR-59":"Tekirda\u011F","TR-60":"Tokat","TR-61":"Trabzon","TR-62":"Tunceli","TR-64":"U\u015Fak","TR-65":"Van","TR-77":"Yalova","TR-66":"Yozgat","TR-67":"Zonguldak","TM-A":"Ahal","TM-S":"A\u015Fgabat","TM-B":"Balkan","TM-D":"Da\u015Foguz","TM-L":"Lebap","TM-M":"Mary","TV-FUN":"Funafuti","TV-NMG":"Nanumaga","TV-NMA":"Nanumea","TV-NIT":"Niutao","TV-NUI":"Nui","TV-NKF":"Nukufetau","TV-NKL":"Nukulaelae","TV-VAI":"Vaitupu","UG-C":"Central","UG-E":"Eastern","UG-N":"Northern","UG-W":"Western","UA-43":"Avtonomna Respublika Krym","UA-71":"Cherkaska oblast","UA-74":"Chernihivska oblast","UA-77":"Chernivetska oblast","UA-12":"Dnipropetrovska oblast","UA-14":"Donetska oblast","UA-26":"Ivano-Frankivska oblast","UA-63":"Kharkivska oblast","UA-65":"Khersonska oblast","UA-68":"Khmelnytska oblast","UA-35":"Kirovohradska oblast","UA-30":"Kyiv","UA-32":"Kyivska oblast","UA-09":"Luhanska oblast","UA-46":"Lvivska oblast","UA-48":"Mykolaivska oblast","UA-51":"Odeska oblast","UA-53":"Poltavska oblast","UA-56":"Rivnenska oblast","UA-40":"Sevastopol","UA-59":"Sumska oblast","UA-61":"Ternopilska oblast","UA-05":"Vinnytska oblast","UA-07":"Volynska oblast","UA-21":"Zakarpatska oblast","UA-23":"Zaporizka oblast","UA-18":"Zhytomyrska oblast","AE-AJ":"\u2018Ajm\u0101n","AE-AZ":"Ab\u016B Z\u0327aby","AE-FU":"Al Fujayrah","AE-SH":"Ash Sh\u0101riqah","AE-DU":"Dubayy","AE-RK":"Ra\u2019s al Khaymah","AE-UQ":"Umm al Qaywayn","GB-ENG":"England","GB-NIR":"Northern Ireland","GB-SCT":"Scotland","GB-WLS":"Wales","US-AL":"Alabama","US-AK":"Alaska","US-AZ":"Arizona","US-AR":"Arkansas","US-CA":"California","US-CO":"Colorado","US-CT":"Connecticut","US-DE":"Delaware","US-FL":"Florida","US-GA":"Georgia","US-HI":"Hawaii","US-ID":"Idaho","US-IL":"Illinois","US-IN":"Indiana","US-IA":"Iowa","US-KS":"Kansas","US-KY":"Kentucky","US-LA":"Louisiana","US-ME":"Maine","US-MD":"Maryland","US-MA":"Massachusetts","US-MI":"Michigan","US-MN":"Minnesota","US-MS":"Mississippi","US-MO":"Missouri","US-MT":"Montana","US-NE":"Nebraska","US-NV":"Nevada","US-NH":"New Hampshire","US-NJ":"New Jersey","US-NM":"New Mexico","US-NY":"New York","US-NC":"North Carolina","US-ND":"North Dakota","US-OH":"Ohio","US-OK":"Oklahoma","US-OR":"Oregon","US-PA":"Pennsylvania","US-RI":"Rhode Island","US-SC":"South Carolina","US-SD":"South Dakota","US-TN":"Tennessee","US-TX":"Texas","US-UT":"Utah","US-VT":"Vermont","US-VA":"Virginia","US-WA":"Washington","US-WV":"West Virginia","US-WI":"Wisconsin","US-WY":"Wyoming","US-DC":"District of Columbia","US-AS":"American Samoa","US-GU":"Guam","US-MP":"Northern Mariana Islands","US-PR":"Puerto Rico","US-UM":"United States Minor Outlying Islands","US-VI":"Virgin Islands","UM-81":"Baker Island","UM-84":"Howland Island","UM-86":"Jarvis Island","UM-67":"Johnston Atoll","UM-89":"Kingman Reef","UM-71":"Midway Islands","UM-76":"Navassa Island","UM-95":"Palmyra Atoll","UM-79":"Wake Island","UY-AR":"Artigas","UY-CA":"Canelones","UY-CL":"Cerro Largo","UY-CO":"Colonia","UY-DU":"Durazno","UY-FS":"Flores","UY-FD":"Florida","UY-LA":"Lavalleja","UY-MA":"Maldonado","UY-MO":"Montevideo","UY-PA":"Paysand\xFA","UY-RN":"R\xEDo Negro","UY-RV":"Rivera","UY-RO":"Rocha","UY-SA":"Salto","UY-SJ":"San Jos\xE9","UY-SO":"Soriano","UY-TA":"Tacuaremb\xF3","UY-TT":"Treinta y Tres","UZ-AN":"Andijon","UZ-BU":"Buxoro","UZ-FA":"Farg\u2018ona","UZ-JI":"Jizzax","UZ-NG":"Namangan","UZ-NW":"Navoiy","UZ-QA":"Qashqadaryo","UZ-QR":"Qoraqalpog\u2018iston Respublikasi","UZ-SA":"Samarqand","UZ-SI":"Sirdaryo","UZ-SU":"Surxondaryo","UZ-TK":"Toshkent","UZ-TO":"Toshkent","UZ-XO":"Xorazm","VU-MAP":"Malampa","VU-PAM":"P\xE9nama","VU-SAM":"Sanma","VU-SEE":"Sh\xE9fa","VU-TAE":"Taf\xE9a","VU-TOB":"Torba","VE-Z":"Amazonas","VE-B":"Anzo\xE1tegui","VE-C":"Apure","VE-D":"Aragua","VE-E":"Barinas","VE-F":"Bol\xEDvar","VE-G":"Carabobo","VE-H":"Cojedes","VE-Y":"Delta Amacuro","VE-W":"Dependencias Federales","VE-A":"Distrito Capital","VE-I":"Falc\xF3n","VE-J":"Gu\xE1rico","VE-X":"La Guaira","VE-K":"Lara","VE-L":"M\xE9rida","VE-M":"Miranda","VE-N":"Monagas","VE-O":"Nueva Esparta","VE-P":"Portuguesa","VE-R":"Sucre","VE-S":"T\xE1chira","VE-T":"Trujillo","VE-U":"Yaracuy","VE-V":"Zulia","VN-44":"An Giang","VN-43":"B\xE0 R\u1ECBa - V\u0169ng T\xE0u","VN-54":"B\u1EAFc Giang","VN-53":"B\u1EAFc K\u1EA1n","VN-55":"B\u1EA1c Li\xEAu","VN-56":"B\u1EAFc Ninh","VN-50":"B\u1EBFn Tre","VN-31":"B\xECnh \u0110\u1ECBnh","VN-57":"B\xECnh D\u01B0\u01A1ng","VN-58":"B\xECnh Ph\u01B0\u1EDBc","VN-40":"B\xECnh Thu\u1EADn","VN-59":"C\xE0 Mau","VN-CT":"C\u1EA7n Th\u01A1","VN-04":"Cao B\u1EB1ng","VN-DN":"\u0110\xE0 N\u1EB5ng","VN-33":"\u0110\u1EAFk L\u1EAFk","VN-72":"\u0110\u1EAFk N\xF4ng","VN-71":"\u0110i\u1EC7n Bi\xEAn","VN-39":"\u0110\u1ED3ng Nai","VN-45":"\u0110\u1ED3ng Th\xE1p","VN-30":"Gia Lai","VN-03":"H\xE0 Giang","VN-63":"H\xE0 Nam","VN-HN":"H\xE0 N\u1ED9i","VN-23":"H\xE0 T\u0129nh","VN-61":"H\u1EA3i D\u01B0\u01A1ng","VN-HP":"H\u1EA3i Ph\xF2ng","VN-73":"H\u1EADu Giang","VN-SG":"H\u1ED3 Ch\xED Minh","VN-14":"H\xF2a B\xECnh","VN-66":"H\u01B0ng Y\xEAn","VN-34":"Kh\xE1nh H\xF2a","VN-47":"Ki\u1EBFn Giang","VN-28":"Kon Tum","VN-01":"Lai Ch\xE2u","VN-35":"L\xE2m \u0110\u1ED3ng","VN-09":"L\u1EA1ng S\u01A1n","VN-02":"L\xE0o Cai","VN-41":"Long An","VN-67":"Nam \u0110\u1ECBnh","VN-22":"Ngh\u1EC7 An","VN-18":"Ninh B\xECnh","VN-36":"Ninh Thu\u1EADn","VN-68":"Ph\xFA Th\u1ECD","VN-32":"Ph\xFA Y\xEAn","VN-24":"Qu\u1EA3ng B\xECnh","VN-27":"Qu\u1EA3ng Nam","VN-29":"Qu\u1EA3ng Ng\xE3i","VN-13":"Qu\u1EA3ng Ninh","VN-25":"Qu\u1EA3ng Tr\u1ECB","VN-52":"S\xF3c Tr\u0103ng","VN-05":"S\u01A1n La","VN-37":"T\xE2y Ninh","VN-20":"Th\xE1i B\xECnh","VN-69":"Th\xE1i Nguy\xEAn","VN-21":"Thanh H\xF3a","VN-26":"Th\u1EEBa Thi\xEAn-Hu\u1EBF","VN-46":"Ti\u1EC1n Giang","VN-51":"Tr\xE0 Vinh","VN-07":"Tuy\xEAn Quang","VN-49":"V\u0129nh Long","VN-70":"V\u0129nh Ph\xFAc","VN-06":"Y\xEAn B\xE1i","WF-AL":"Alo","WF-SG":"Sigave","WF-UV":"Uvea","YE-AD":"\u2018Adan","YE-AM":"\u2018Amr\u0101n","YE-AB":"Abyan","YE-DA":"A\u1E11 \u1E10\u0101li\u2018","YE-BA":"Al Bay\u1E11\u0101\u2019","YE-HU":"Al \u1E28udaydah","YE-JA":"Al Jawf","YE-MR":"Al Mahrah","YE-MW":"Al Ma\u1E29w\u012Bt","YE-SA":"Am\u0101nat al \u2018\u0100\u015Fimah","YE-SU":"Arkhab\u012Bl Suqu\u0163r\xE1","YE-DH":"Dham\u0101r","YE-HD":"\u1E28a\u1E11ramawt","YE-HJ":"\u1E28ajjah","YE-IB":"Ibb","YE-LA":"La\u1E29ij","YE-MA":"Ma\u2019rib","YE-RA":"Raymah","YE-SD":"\u015E\u0101\u02BBdah","YE-SN":"\u015Ean\u02BB\u0101\u2019","YE-SH":"Shabwah","YE-TA":"T\u0101\u02BBizz","ZM-02":"Central","ZM-08":"Copperbelt","ZM-03":"Eastern","ZM-04":"Luapula","ZM-09":"Lusaka","ZM-10":"Muchinga","ZM-06":"North-Western","ZM-05":"Northern","ZM-07":"Southern","ZM-01":"Western","ZW-BU":"Bulawayo","ZW-HA":"Harare","ZW-MA":"Manicaland","ZW-MC":"Mashonaland Central","ZW-ME":"Mashonaland East","ZW-MW":"Mashonaland West","ZW-MV":"Masvingo","ZW-MN":"Matabeleland North","ZW-MS":"Matabeleland South","ZW-MI":"Midlands","BQ-BO":"Bonaire","BQ-SA":"Saba","BQ-SE":"Sint Eustatius","ME-01":"Andrijevica","ME-02":"Bar","ME-03":"Berane","ME-04":"Bijelo Polje","ME-05":"Budva","ME-06":"Cetinje","ME-07":"Danilovgrad","ME-22":"Gusinje","ME-08":"Herceg-Novi","ME-09":"Kola\u0161in","ME-10":"Kotor","ME-11":"Mojkovac","ME-12":"Nik\u0161i\u0107","ME-23":"Petnjica","ME-13":"Plav","ME-14":"Pljevlja","ME-15":"Plu\u017Eine","ME-16":"Podgorica","ME-17":"Ro\u017Eaje","ME-18":"\u0160avnik","ME-19":"Tivat","ME-24":"Tuzi","ME-20":"Ulcinj","ME-21":"\u017Dabljak","ME-25":"Zeta","RS-KM":"Kosovo-Metohija[1]","RS-VO":"Vojvodina","SS-EC":"Central Equatoria","SS-EE":"Eastern Equatoria","SS-JG":"Jonglei","SS-LK":"Lakes","SS-BN":"Northern Bahr el Ghazal","SS-UY":"Unity","SS-NU":"Upper Nile","SS-WR":"Warrap","SS-BW":"Western Bahr el Ghazal","SS-EW":"Western Equatoria"},MN=Object.keys(DC);var qp=async e=>{let t;try{let n=typeof e=="string"?e:e.url;t=await fetch(n,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&re(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&re(e.body)?JSON.stringify(e.body):void 0});let r=await t.json();if(!t.ok)throw typeof r=="object"&&r!==null&&"error"in r?r.error:r;return{data:r,response:t}}catch(n){return console.error(n),{error:n,response:t}}},re=e=>e!=null,Qe=e=>e==null,je=e=>e==null||e==="",Pe=e=>e!=null&&e!=="";var Jp=e=>{e.split("</noscript>").forEach(n=>{let[r,o]=n.split("<noscript>"),a=document.createRange().createContextualFragment(r??"");if(document.head.append(a),Qe(o))return;let i=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);i.append(s),document.head.append(i)})};var en=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");function kr(...e){return Pf(Lt(e))}var bn=class extends Error{constructor(t,n,r){let o=t.status||t.status===0?t.status:"",a=t.statusText||"",i=`${o} ${a}`.trim(),s=i?`status code ${i}`:"an unknown error";super(`Request failed with ${s}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=n,this.options=r}};var Eo=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}};var wa=e=>e!==null&&typeof e=="object";var Sa=(...e)=>{for(let t of e)if((!wa(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return es({},...e)},kc=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[a,i]of o.entries())r&&i==="undefined"||i===void 0?n.delete(a):n.set(a,i);return n},es=(...e)=>{let t={},n={};for(let r of e)if(Array.isArray(r))Array.isArray(t)||(t=[]),t=[...t,...r];else if(wa(r)){for(let[o,a]of Object.entries(r))wa(a)&&o in t&&(a=es(t[o],a)),t={...t,[o]:a};wa(r.headers)&&(n=kc(n,r.headers),t.headers=n)}return t};var Xp=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";return n&&r&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),Qp=typeof globalThis.AbortController=="function",em=typeof globalThis.ReadableStream=="function",tm=typeof globalThis.FormData=="function",ts=["get","post","put","patch","head","delete"],FC=()=>{};FC();var nm={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ns=2147483647,rs=Symbol("stop"),rm={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},om={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var im=e=>ts.includes(e)?e.toUpperCase():e,$C=["get","put","head","delete","options","trace"],GC=[408,413,429,500,502,503,504],sm=[413,429,503],am={limit:2,methods:$C,statusCodes:GC,afterStatusCodes:sm,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},lm=(e={})=>{if(typeof e=="number")return{...am,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...am,...e,afterStatusCodes:sm}};async function Ac(e,t,n,r){return new Promise((o,a)=>{let i=setTimeout(()=>{n&&n.abort(),a(new Eo(e))},r.timeout);r.fetch(e,t).then(o).catch(a).then(()=>{clearTimeout(i)})})}async function Pc(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(a),r(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var cm=(e,t)=>{let n={};for(let r in t)!(r in om)&&!(r in rm)&&!(r in e)&&(n[r]=t[r]);return n};var Ta=class e{static create(t,n){let r=new e(t,n),o=async()=>{if(typeof r._options.timeout=="number"&&r._options.timeout>ns)throw new RangeError(`The \`timeout\` option cannot be greater than ${ns}`);await Promise.resolve();let s=await r._fetch();for(let c of r._options.hooks.afterResponse){let l=await c(r.request,r._options,r._decorateResponse(s.clone()));l instanceof globalThis.Response&&(s=l)}if(r._decorateResponse(s),!s.ok&&r._options.throwHttpErrors){let c=new bn(s,r.request,r._options);for(let l of r._options.hooks.beforeError)c=await l(c);throw c}if(r._options.onDownloadProgress){if(typeof r._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!em)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(s.clone(),r._options.onDownloadProgress)}return s},i=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(let[s,c]of Object.entries(nm))i[s]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||c);let u=(await i).clone();if(s==="json"){if(u.status===204||(await u.clone().arrayBuffer()).byteLength===0)return"";if(n.parseJson)return n.parseJson(await u.text())}return u[s]()};return i}constructor(t,n={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t;let r=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...r&&{credentials:r},...n,headers:kc(this._input.headers,n.headers),hooks:es({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:im(n.method??this._input.method),prefixUrl:String(n.prefixUrl||""),retry:lm(n.retry),throwHttpErrors:n.throwHttpErrors!==!1,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Qp){if(this.abortController=new globalThis.AbortController,this._options.signal){let o=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(o.reason)})}this._options.signal=this.abortController.signal}if(Xp&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let a="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);(tm&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(i,{...this.request}),this._options)}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof Eo)){if(t instanceof bn){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let r=t.response.headers.get("Retry-After");if(r&&this._options.retry.afterStatusCodes.includes(t.response.status)){let o=Number(r);return Number.isNaN(o)?o=Date.parse(r)-Date.now():o*=1e3,this._options.retry.maxRetryAfter!==void 0&&o>this._options.retry.maxRetryAfter?0:o}if(t.response.status===413)return 0}let n=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,n)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(n){let r=Math.min(this._calculateRetryDelay(n),ns);if(r!==0&&this._retryCount>0){await Pc(r,{signal:this._options.signal});for(let o of this._options.hooks.beforeRetry)if(await o({request:this.request,options:this._options,error:n,retryCount:this._retryCount})===rs)return;return this._retry(t)}throw n}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let r=await n(this.request,this._options);if(r instanceof Request){this.request=r;break}if(r instanceof Response)return r}let t=cm(this.request,this._options);return this._options.timeout===!1?this._options.fetch(this.request.clone(),t):Ac(this.request.clone(),t,this.abortController,this._options)}_stream(t,n){let r=Number(t.headers.get("content-length"))||0,o=0;return t.status===204?(n&&n({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(a){let i=t.body.getReader();n&&n({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function s(){let{done:c,value:l}=await i.read();if(c){a.close();return}if(n){o+=l.byteLength;let u=r===0?0:o/r;n({percent:u,transferredBytes:o,totalBytes:r},l)}a.enqueue(l),await s()}await s()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Ic=e=>{let t=(n,r)=>Ta.create(n,Sa(e,r));for(let n of ts)t[n]=(r,o)=>Ta.create(r,Sa(e,o,{method:n}));return t.create=n=>Ic(Sa(n)),t.extend=n=>Ic(Sa(e,n)),t.stop=rs,t},HC=Ic(),or=HC;async function um({agent:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:a,startFrom:i,sessionId:s}){if(Qe(e))throw new Error("Agent is required to start the chat");let c=fo()??void 0,l=c?JSON.parse(c):void 0;if(l)return KC({apiHost:n,stripeRedirectStatus:a,paymentInProgressState:l});let u=typeof e=="string"?e:e.id;if(t)return VC({apiHost:n,agentId:u,startFrom:i,agent:e,prefilledVariables:r,sessionId:s});try{let f=parent!==window&&Pe(document.referrer)?new URL(document.referrer).origin:void 0,d=await or.post(`${_c(n)}/api/v1/agents/${u}/startChat`,{headers:{"x-agent-iframe-referrer-origin":f},json:{isStreamEnabled:!0,prefilledVariables:r,resultId:o,isOnlyRegistering:!1},timeout:!1}),p=d.headers.get("access-control-allow-origin");if(f&&p&&p!=="*"&&!f.includes(p))throw new po(p);return{data:await d.json()}}catch(f){return{error:f}}}var KC=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:n})=>{Gi();try{return{data:{...await or.post(`${_c(e)}/api/v1/sessions/${n.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...n}}}catch(r){return{error:r}}},VC=async({apiHost:e,agentId:t,startFrom:n,agent:r,prefilledVariables:o,sessionId:a})=>{try{return{data:await or.post(`${_c(e)}/api/v1/agents/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:n,agent:r,prefilledVariables:o,sessionId:a},timeout:!1}).json()}}catch(i){return{error:i}}},_c=e=>Pe(e)?e:Pt();var[dm,fm]=R("100%");var[BO,pm]=R();var os="#303235",as="#FFFFFF",mm="Google",ko="Open Sans",Ao="Color",Ca="#ffffff";var gm="#000",hm="#000",bm=2,is="absolute",ym="Top",Ar="medium",St=1,vm=0,xm="800px",wm="100%",Ea="transparent";var Po="#F7F8FF",Sm=os,Tm="#FF8E21",Cm=as,ka="#0042DA",Em=as,km=1;var Am="#FFFFFF",Aa=os,Pm="#9095A0",Im="md";var Io=!0,Pa=!1;var jC="https://fonts.bunny.net/css2",ss="agent-font",Mc=e=>{let t=document.getElementById(ss);if(typeof e=="string"||e.type==="Google"){let n=(typeof e=="string"?e:e.family)??ko;if(t?.getAttribute("href")?.includes(n))return;t?.remove();let r=document.createElement("link");r.href=`${jC}?family=${n}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,r.rel="stylesheet",r.id=ss,document.head.appendChild(r);return}if(e.type==="Custom"){if(Pe(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let n=document.createElement("style");n.innerHTML=e.css,n.id=ss,document.head.appendChild(n)}if(Pe(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=ss,document.head.appendChild(n)}}};var[Y,_m]=R();var st={general:{isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},typingEmulation:{enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},metadata:{description:"Automate customer interactions with Release0. Build AI agents that respond, collect data, and integrate seamlessly\u2014without writing code.",favIconUrl:e=>e+"/favicon.png",imageUrl:e=>e+"/site-preview.png"}};var Rc=Symbol("store-raw"),Mo=Symbol("store-node"),On=Symbol("store-has"),Mm=Symbol("store-self");function Rm(e){let t=e[$t];if(!t&&(Object.defineProperty(e,$t,{value:t=new Proxy(e,ZC)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,a=n.length;o<a;o++){let i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function ar(e){let t;return e!=null&&typeof e=="object"&&(e[$t]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ro(e,t=new Set){let n,r,o,a;if(n=e!=null&&e[Rc])return n;if(!ar(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,s=e.length;i<s;i++)o=e[i],(r=Ro(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let i=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let c=0,l=i.length;c<l;c++)a=i[c],!s[a].get&&(o=e[a],(r=Ro(o,t))!==o&&(e[a]=r))}return e}function ls(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function _a(e,t,n){if(e[t])return e[t];let[r,o]=R(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function zC(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===$t||t===Mo||(delete n.value,delete n.writable,n.get=()=>e[$t][t]),n}function Nm(e){Di()&&_a(ls(e,Mo),Mm)()}function WC(e){return Nm(e),Reflect.ownKeys(e)}var ZC={get(e,t,n){if(t===Rc)return e;if(t===$t)return n;if(t===Oi)return Nm(e),n;let r=ls(e,Mo),o=r[t],a=o?o():e[t];if(t===Mo||t===On||t==="__proto__")return a;if(!o){let i=Object.getOwnPropertyDescriptor(e,t);Di()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(a=_a(r,t,a)())}return ar(a)?Rm(a):a},has(e,t){return t===Rc||t===$t||t===Oi||t===Mo||t===On||t==="__proto__"?!0:(Di()&&_a(ls(e,On),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:WC,getOwnPropertyDescriptor:zC};function Ht(e,t,n,r=!1){if(!r&&e[t]===n)return;let o=e[t],a=e.length;n===void 0?(delete e[t],e[On]&&e[On][t]&&o!==void 0&&e[On][t].$()):(e[t]=n,e[On]&&e[On][t]&&o===void 0&&e[On][t].$());let i=ls(e,Mo),s;if((s=_a(i,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let c=e.length;c<a;c++)(s=i[c])&&s.$();(s=_a(i,"length",a))&&s.$(e.length)}(s=i[Mm])&&s.$()}function Om(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];Ht(e,o,t[o])}}function YC(e,t){if(typeof t=="function"&&(t=t(e)),t=Ro(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let o=t[n];e[n]!==o&&Ht(e,n,o)}Ht(e,"length",r)}else Om(e,t)}function Ia(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();let i=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c<r.length;c++)Ia(e,[r[c]].concat(t),n);return}else if(s&&i==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&Ia(e,[c].concat(t),n);return}else if(s&&i==="object"){let{from:c=0,to:l=e.length-1,by:u=1}=r;for(let f=c;f<=l;f+=u)Ia(e,[f].concat(t),n);return}else if(t.length>1){Ia(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(o,n),a===o)||r===void 0&&a==null||(a=Ro(a),r===void 0||ar(o)&&ar(a)&&!Array.isArray(a)?Om(o,a):Ht(e,r,a))}function Lm(...[e,t]){let n=Ro(e||{}),r=Array.isArray(n),o=Rm(n);function a(...i){ef(()=>{r&&i.length===1?YC(n,i[0]):Ia(n,i)})}return[o,a]}var Nc=Symbol("store-root");function _o(e,t,n,r,o){let a=t[n];if(e===a)return;let i=Array.isArray(e);if(n!==Nc&&(!ar(e)||!ar(a)||i!==Array.isArray(a)||o&&e[o]!==a[o])){Ht(t,n,e);return}if(i){if(e.length&&a.length&&(!r||o&&e[0]&&e[0][o]!=null)){let l,u,f,d,p,h,g,y;for(f=0,d=Math.min(a.length,e.length);f<d&&(a[f]===e[f]||o&&a[f]&&e[f]&&a[f][o]===e[f][o]);f++)_o(e[f],a,f,r,o);let b=new Array(e.length),T=new Map;for(d=a.length-1,p=e.length-1;d>=f&&p>=f&&(a[d]===e[p]||o&&a[f]&&e[f]&&a[d][o]===e[p][o]);d--,p--)b[p]=a[d];if(f>p||f>d){for(u=f;u<=p;u++)Ht(a,u,e[u]);for(;u<e.length;u++)Ht(a,u,b[u]),_o(e[u],a,u,r,o);a.length>e.length&&Ht(a,"length",e.length);return}for(g=new Array(p+1),u=p;u>=f;u--)h=e[u],y=o&&h?h[o]:h,l=T.get(y),g[u]=l===void 0?-1:l,T.set(y,u);for(l=f;l<=d;l++)h=a[l],y=o&&h?h[o]:h,u=T.get(y),u!==void 0&&u!==-1&&(b[u]=a[l],u=g[u],T.set(y,u));for(u=f;u<e.length;u++)u in b?(Ht(a,u,b[u]),_o(e[u],a,u,r,o)):Ht(a,u,e[u])}else for(let l=0,u=e.length;l<u;l++)_o(e[l],a,l,r,o);a.length>e.length&&Ht(a,"length",e.length);return}let s=Object.keys(e);for(let l=0,u=s.length;l<u;l++)_o(e[s[l]],a,s[l],r,o);let c=Object.keys(a);for(let l=0,u=c.length;l<u;l++)e[c[l]]===void 0&&Ht(a,c[l],void 0)}function cs(e,t={}){let{merge:n,key:r="id"}=t,o=Ro(e);return a=>{if(!ar(a)||!ar(o))return o;let i=_o(o,{[Nc]:a},Nc,n,r);return i===void 0?a:i}}function yn(e,t){if(!t.storage)return[...e];let n=qC(t.storage||st.general.rememberUser.storage),r=s=>{let c=JSON.parse(JSON.stringify(s));return typeof c!="object"||("blobUrl"in c&&(c.blobUrl=void 0),"attachments"in c&&Array.isArray(c.attachments)&&c.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0)})),JSON.stringify(c)},o=JSON.parse.bind(JSON),a=n.getItem(t.key),i=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](cs(o(s)));return a&&(i(a),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let c=e[1](s);return s?n.setItem(t.key,r(c)):n.removeItem(t.key),c}:(...s)=>{e[1](...s);let c=r(Xe(()=>e[0]));n.setItem(t.key,c)}]}var qC=e=>(e??st.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var rt=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(r,o,a,i)=>o+o+a+a+i+i);let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?[Number.parseInt(n[1]??"",16),Number.parseInt(n[2]??"",16),Number.parseInt(n[3]??"",16)]:[0,0,0]},Ln=e=>(([t,n,r])=>(t*299+n*587+r*114)/1e3>155)(rt(e));var Dm=({chatContainer:e,generalBackground:t})=>{let n=e?.backgroundColor??Ea;if((e?.opacity??St)<=.3||n==="transparent"||je(n)){let o=t?.type??Ao,a=o==="Image"?"#000000":o==="Color"&&Pe(t?.content)?t.content:"#ffffff";return Ln(a)}return Ln(e?.backgroundColor??Ca)};var W={general:{bgImage:"--agent-container-bg-image",bgColor:"--agent-container-bg-color",fontFamily:"--agent-container-font-family",progressBar:{position:"--agent-progress-bar-position",color:"--agent-progress-bar-color",colorRgb:"--agent-progress-bar-bg-rgb",height:"--agent-progress-bar-height",top:"--agent-progress-bar-top",bottom:"--agent-progress-bar-bottom"}},chat:{container:{maxWidth:"--agent-chat-container-max-width",maxHeight:"--agent-chat-container-max-height",bgColor:"--agent-chat-container-bg-rgb",color:"--agent-chat-container-color",borderRadius:"--agent-chat-container-border-radius",borderWidth:"--agent-chat-container-border-width",borderColor:"--agent-chat-container-border-rgb",borderOpacity:"--agent-chat-container-border-opacity",opacity:"--agent-chat-container-opacity",blur:"--agent-chat-container-blur",boxShadow:"--agent-chat-container-box-shadow"},hostBubbles:{bgColor:"--agent-host-bubble-bg-rgb",color:"--agent-host-bubble-color",borderRadius:"--agent-host-bubble-border-radius",borderWidth:"--agent-host-bubble-border-width",borderColor:"--agent-host-bubble-border-rgb",borderOpacity:"--agent-host-bubble-border-opacity",opacity:"--agent-host-bubble-opacity",blur:"--agent-host-bubble-blur",boxShadow:"--agent-host-bubble-box-shadow"},guestBubbles:{bgColor:"--agent-guest-bubble-bg-rgb",color:"--agent-guest-bubble-color",borderRadius:"--agent-guest-bubble-border-radius",borderWidth:"--agent-guest-bubble-border-width",borderColor:"--agent-guest-bubble-border-rgb",borderOpacity:"--agent-guest-bubble-border-opacity",opacity:"--agent-guest-bubble-opacity",blur:"--agent-guest-bubble-blur",boxShadow:"--agent-guest-bubble-box-shadow"},inputs:{bgColor:"--agent-input-bg-rgb",color:"--agent-input-color",placeholderColor:"--agent-input-placeholder-color",borderRadius:"--agent-input-border-radius",borderWidth:"--agent-input-border-width",borderColor:"--agent-input-border-rgb",borderOpacity:"--agent-input-border-opacity",opacity:"--agent-input-opacity",blur:"--agent-input-blur",boxShadow:"--agent-input-box-shadow"},buttons:{bgRgb:"--agent-button-bg-rgb",color:"--agent-button-color",borderRadius:"--agent-button-border-radius",borderWidth:"--agent-button-border-width",borderColor:"--agent-button-border-rgb",borderOpacity:"--agent-button-border-opacity",opacity:"--agent-button-opacity",blur:"--agent-button-blur",boxShadow:"--agent-button-box-shadow"},checkbox:{bgRgb:"--agent-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},Bm=(e,t,n)=>{if(!e)return;let r=t?.style;r&&(XC(e.general,r,n),eE(e.chat,e.general?.background,r))},XC=(e,t,n)=>{sE(e?.background,t),t.setProperty(W.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??ko),QC(e?.progressBar,t,n)},QC=(e,t,n)=>{let r=e?.position??is;t.setProperty(W.general.progressBar.position,r==="fixed"?n?"absolute":"fixed":r),t.setProperty(W.general.progressBar.color,e?.color??gm),t.setProperty(W.general.progressBar.colorRgb,rt(e?.backgroundColor??hm).join(", ")),t.setProperty(W.general.progressBar.height,`${e?.thickness??bm}px`);let o=e?.placement??ym;t.setProperty(W.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(W.general.progressBar.bottom,o==="Bottom"?"0":"auto")},eE=(e,t,n)=>{tE(e?.container,t,n,e?.roundness),nE(e?.hostBubbles,n,e?.roundness),rE(e?.guestBubbles,n,e?.roundness),oE(e?.buttons,n,e?.roundness),aE(e?.inputs,n,e?.roundness),iE(e?.container,t,n)},tE=(e,t,n,r)=>{let o=e?.backgroundColor??Ea,a=o==="transparent"||je(o);n.setProperty(W.chat.container.bgColor,a?"0, 0, 0":rt(o).join(", ")),n.setProperty(W.chat.container.color,rt(e?.color??(Dm({chatContainer:e,generalBackground:t})?os:as)).join(", ")),n.setProperty(W.chat.container.maxWidth,e?.maxWidth??xm),n.setProperty(W.chat.container.maxHeight,e?.maxHeight??wm);let i=a?"1":(e?.opacity??St).toString();n.setProperty(W.chat.container.opacity,a?"0":(e?.opacity??St).toString()),n.setProperty(W.chat.container.blur,i==="1"||a?"0xp":`${e?.blur??vm}px`),Ra(e?.shadow,n,W.chat.container.boxShadow),Ma(e?.border??{roundeness:r??Ar},n,W.chat.container.borderRadius),n.setProperty(W.chat.container.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),n.setProperty(W.chat.container.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():St.toString()),n.setProperty(W.chat.container.borderColor,rt(e?.border?.color??"").join(", "))},nE=(e,t,n)=>{t.setProperty(W.chat.hostBubbles.bgColor,rt(e?.backgroundColor??Po).join(", ")),t.setProperty(W.chat.hostBubbles.color,e?.color??Sm),Ma(e?.border??{roundeness:n??Ar},t,W.chat.hostBubbles.borderRadius),t.setProperty(W.chat.hostBubbles.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.hostBubbles.borderColor,rt(e?.border?.color??"").join(", ")),t.setProperty(W.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():St.toString()),t.setProperty(W.chat.hostBubbles.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():St.toString()),t.setProperty(W.chat.hostBubbles.blur,re(e?.blur)?`${e.blur??0}px`:"none"),Ra(e?.shadow,t,W.chat.hostBubbles.boxShadow)},rE=(e,t,n)=>{t.setProperty(W.chat.guestBubbles.bgColor,rt(e?.backgroundColor??Tm).join(", ")),t.setProperty(W.chat.guestBubbles.color,e?.color??Cm),Ma(e?.border??{roundeness:n??Ar},t,W.chat.guestBubbles.borderRadius),t.setProperty(W.chat.guestBubbles.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.guestBubbles.borderColor,rt(e?.border?.color??"").join(", ")),t.setProperty(W.chat.guestBubbles.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():St.toString()),t.setProperty(W.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():St.toString()),t.setProperty(W.chat.guestBubbles.blur,re(e?.blur)?`${e.blur??0}px`:"none"),Ra(e?.shadow,t,W.chat.guestBubbles.boxShadow)},oE=(e,t,n)=>{let r=e?.backgroundColor??ka;t.setProperty(W.chat.buttons.bgRgb,rt(r).join(", ")),t.setProperty(W.chat.buttons.bgRgb,rt(r).join(", ")),t.setProperty(W.chat.buttons.color,e?.color??Em),Ma(e?.border??{roundeness:n??Ar},t,W.chat.buttons.borderRadius),t.setProperty(W.chat.buttons.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:`${km}px`),t.setProperty(W.chat.buttons.borderColor,rt(e?.border?.color??e?.backgroundColor??ka).join(", ")),t.setProperty(W.chat.buttons.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():St.toString()),t.setProperty(W.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():St.toString()),t.setProperty(W.chat.buttons.blur,re(e?.blur)?`${e.blur??0}px`:"none"),Ra(e?.shadow,t,W.chat.buttons.boxShadow)},aE=(e,t,n)=>{t.setProperty(W.chat.inputs.bgColor,rt(e?.backgroundColor??Am).join(", ")),t.setProperty(W.chat.inputs.color,e?.color??Aa),t.setProperty(W.chat.inputs.placeholderColor,e?.placeholderColor??Pm),Ma(e?.border??{roundeness:n??Ar},t,W.chat.inputs.borderRadius),t.setProperty(W.chat.inputs.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.inputs.borderColor,rt(e?.border?.color??"").join(", ")),t.setProperty(W.chat.inputs.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():St.toString()),t.setProperty(W.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():St.toString()),t.setProperty(W.chat.inputs.blur,re(e?.blur)?`${e.blur??0}px`:"none"),Ra(e?.shadow??Im,t,W.chat.inputs.boxShadow)},iE=(e,t,n)=>{let r=e?.backgroundColor??Ea;if(r==="transparent"||je(r)||(e?.opacity??St)<=.2){let a=t?.type??Ao;n.setProperty(W.chat.checkbox.bgRgb,a==="Image"?"rgba(255, 255, 255, 0.75)":rt((a==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),a==="Image"?n.setProperty(W.chat.checkbox.alphaRatio,"3"):n.setProperty(W.chat.checkbox.alphaRatio,t?.content&&Ln(t?.content)?"1":"2")}else n.setProperty(W.chat.checkbox.bgRgb,rt(r).concat(e?.opacity??1).join(", ")),n.setProperty(W.chat.checkbox.alphaRatio,Ln(r)?"1":"2")},sE=(e,t)=>{t.setProperty(W.general.bgImage,null),t.setProperty(W.general.bgColor,null),t.setProperty((e?.type??Ao)==="Image"?W.general.bgImage:W.general.bgColor,lE({type:e?.type??Ao,content:e?.content??Ca}))},lE=({type:e,content:t}={})=>{switch(e){case"None":return"transparent";case void 0:case"Color":return t??Ca;case"Image":return`url(${t})`}},Ma=(e,t,n)=>{switch(e?.roundeness??Ar){case"none":{t.setProperty(n,"0");break}case"medium":{t.setProperty(n,"6px");break}case"large":{t.setProperty(n,"20px");break}case"custom":{t.setProperty(n,`${e.customRoundeness??6}px`);break}}},Ra=(e,t,n)=>{if(e===void 0){t.setProperty(n,"0 0 #0000");return}switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var Oc="resultId",Um=e=>{if(e)try{return sessionStorage.getItem(`${Oc}-${e}`)??localStorage.getItem(`${Oc}-${e}`)??void 0}catch{}},Fm=(e="session")=>(t,n)=>{try{Gm(e).setItem(`${Oc}-${t}`,n)}catch{}},$m=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Lc=(e,{agentId:t,storage:n})=>{try{let r=JSON.stringify(e);Gm(n).setItem(`agent-${t}-initialChatReply`,r)}catch{}},us=()=>{try{sessionStorage.setItem("agent-typeOpened","true")}catch{}},ds=()=>{try{sessionStorage.removeItem("agent-typeOpened")}catch{}},fs=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return!1}},Gm=e=>(e??st.general.rememberUser.storage)==="session"?sessionStorage:localStorage,ps=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&sessionStorage.removeItem(t)})};var ut=()=>(e,t)=>ze(e,t);function cE(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function qe(e={}){let{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:a}=e,i=nf(a);function s(){let c=Xl(i);if(!c&&t){let l=new Error(o??cE(n,r));throw l.name="ContextError",Error.captureStackTrace?.(l,s),l}return c}return[i.Provider,s,i]}var[Dc,Hm]=qe({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Na=e=>ut()(e,["lazyMount","unmountOnExit"]);var b2=Symbol(),uE=Symbol();var Km=Object.getPrototypeOf,Bc=new WeakMap,dE=e=>e&&(Bc.has(e)?Bc.get(e):Km(e)===Object.prototype||Km(e)===Array.prototype);var Vm=e=>dE(e)&&e[uE]||null,Uc=(e,t=!0)=>{Bc.set(e,t)};function fE(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function jm(e,t){let n=fE();return n?(n[e]||(n[e]=t()),n[e]):t()}var ms=()=>!1,Fc=e=>typeof e=="object"&&e!==null,Pr=jm("__zag__proxyStateMap",()=>new WeakMap),Oa=jm("__zag__refSet",()=>new WeakSet),pE=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,mE=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,gE=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",hE=e=>pE(e)||mE(e)||gE(e),bE=(e=Object.is,t=(l,u)=>new Proxy(l,u),n=l=>Fc(l)&&!Oa.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!hE(l)&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),r=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},o=new WeakMap,a=(l,u,f=r)=>{let d=o.get(l);if(d?.[0]===u)return d[1];let p=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Uc(p,!0),o.set(l,[u,p]),Reflect.ownKeys(l).forEach(h=>{let g=Reflect.get(l,h);Oa.has(g)?(Uc(g,!1),p[h]=g):g instanceof Promise?Object.defineProperty(p,h,{get(){return f(g)}}):Pr.has(g)?p[h]=ir(g,f):p[h]=g}),Object.freeze(p)},i=new WeakMap,s=[1,1],c=l=>{if(!Fc(l))throw new Error("object required");let u=i.get(l);if(u)return u;let f=s[0],d=new Set,p=(H,j=++s[0])=>{f!==j&&(f=j,d.forEach(L=>L(H,j)))},h=s[1],g=(H=++s[1])=>(h!==H&&!d.size&&(h=H,b.forEach(([j])=>{let L=j[1](H);L>f&&(f=L)})),f),y=H=>(j,L)=>{let P=[...j];P[1]=[H,...P[1]],p(P,L)},b=new Map,T=(H,j)=>{if(ms()&&b.has(H))throw new Error("prop listener already exists");if(d.size){let L=j[3](y(H));b.set(H,[j,L])}else b.set(H,[j])},S=H=>{let j=b.get(H);j&&(b.delete(H),j[1]?.())},k=H=>(d.add(H),d.size===1&&b.forEach(([L,P],E)=>{if(ms()&&P)throw new Error("remove already exists");let w=L[3](y(E));b.set(E,[L,w])}),()=>{d.delete(H),d.size===0&&b.forEach(([L,P],E)=>{P&&(P(),b.set(E,[L]))})}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),O=t(I,{deleteProperty(H,j){let L=Reflect.get(H,j);S(j);let P=Reflect.deleteProperty(H,j);return P&&p(["delete",[j],L]),P},set(H,j,L,P){let E=Reflect.has(H,j),w=Reflect.get(H,j,P);if(E&&(e(w,L)||i.has(L)&&e(w,i.get(L))))return!0;S(j),Fc(L)&&(L=Vm(L)||L);let N=L;if(!Object.getOwnPropertyDescriptor(H,j)?.set)if(L instanceof Promise)L.then(_=>{Object.assign(L,{status:"fulfilled",value:_}),p(["resolve",[j],_])}).catch(_=>{Object.assign(L,{status:"rejected",reason:_}),p(["reject",[j],_])});else{!Pr.has(L)&&n(L)&&(N=La(L));let _=!Oa.has(N)&&Pr.get(N);_&&T(j,_)}return Reflect.set(H,j,N,P),p(["set",[j],L,w]),!0}});i.set(l,O);let Q=[I,g,a,k];return Pr.set(O,Q),Reflect.ownKeys(l).forEach(H=>{let j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(I,H,j):O[H]=l[H]}),O})=>[c,Pr,Oa,e,t,n,r,o,a,i,s],[yE]=bE();function La(e={}){return yE(e)}function No(e,t,n){let r=Pr.get(e);ms()&&!r&&console.warn("Please use proxy object");let o,a=[],i=r[3],s=!1,l=i(u=>{if(a.push(u),n){t(a.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,s&&t(a.splice(0))}))});return s=!0,()=>{s=!1,l()}}function ir(e,t){let n=Pr.get(e);ms()&&!n&&console.warn("Please use proxy object");let[r,o,a]=n;return a(r,o(),t)}function Bt(e){return Oa.add(e),e}function zm(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");let a=t[o],{get:i,set:s}=typeof a=="function"?{get:a}:a,c={};c.get=()=>i(ir(r)),s&&(c.set=l=>s(r,l)),Object.defineProperty(e,o,c)});let r=La(e);return r}var Zm=e=>e[0],Ym=e=>e[e.length-1];function qm(e){for(;e.length>0;)e.pop();return e}var Wm=e=>e?.constructor.name==="Array",vE=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!gs(e[n],t[n]))return!1;return!0},gs=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Wm(e)&&Wm(t))return vE(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){let a=n[o];if(!gs(e[a],t[a]))return!1}return!0},Dn=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,Kt=e=>e,hs=()=>{},Da=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},Ba=(()=>{let e=0;return()=>(e++,e.toString(36))})();var Jm=()=>!1,Ua=e=>Array.isArray(e);var Xm=e=>e!=null&&typeof e=="object",Fa=e=>Xm(e)&&!Ua(e),$a=e=>typeof e=="number"&&!Number.isNaN(e),_t=e=>typeof e=="string",sr=e=>typeof e=="function",Qm=e=>e==null,$c=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),xE=e=>Object.prototype.toString.call(e),eg=Function.prototype.toString,wE=eg.call(Object),tg=e=>{if(!Xm(e)||xE(e)!="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=$c(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&eg.call(n)==wE};function SE(e,t){let n={},r={},o=new Set(t);for(let a in e)o.has(a)?r[a]=e[a]:n[a]=e[a];return[r,n]}var vn=e=>function(n){return SE(n,e)};function yt(e){if(!TE(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=yt(o))}return n}var TE=e=>e&&typeof e=="object"&&e.constructor===Object;function Bn(...e){let t=e.length===1?e[0]:e[1],n=e.length===2?e[0]:!0}function Ga(...e){let t=e.length===1?e[0]:e[1],n=e.length===2?e[0]:!0}function ng(e,t,n){typeof n.value=="object"&&(n.value=Ir(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Ir(e){if(typeof e!="object")return e;var t=0,n,r,o,a=Object.prototype.toString.call(e);if(a==="[object Object]"?o=Object.create(e.__proto__||null):a==="[object Array]"?o=Array(e.length):a==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(Ir(i))})):a==="[object Map]"?(o=new Map,e.forEach(function(i,s){o.set(Ir(s),Ir(i))})):a==="[object Date]"?o=new Date(+e):a==="[object RegExp]"?o=new RegExp(e.source,e.flags):a==="[object DataView]"?o=new e.constructor(Ir(e.buffer)):a==="[object ArrayBuffer]"?o=e.slice(0):a.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)ng(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||ng(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}var CE=Object.defineProperty,EE=(e,t,n)=>t in e?CE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>EE(e,typeof t!="symbol"?t+"":t,n);function ag(e,...t){for(let n of t){let r=yt(n);for(let o in r)tg(n[o])?(e[o]||(e[o]={}),ag(e[o],n[o])):e[o]=n[o]}return e}function rg(e){return Ir(e)}function tn(e){return _t(e)?{type:e}:e}function lr(e){return e?Ua(e)?e.slice():[e]:[]}function ig(e){return Fa(e)&&e.predicate!=null}var kE=()=>!0;function Hc(e,t,n,r){return o=>_t(o)?!!e[o]?.(t,n,r):sr(o)?o(t,n,r):o.predicate(e)(t,n,r)}function AE(...e){return{predicate:t=>(n,r,o)=>e.map(Hc(t,n,r,o)).some(Boolean)}}function PE(...e){return{predicate:t=>(n,r,o)=>e.map(Hc(t,n,r,o)).every(Boolean)}}function IE(e){return{predicate:t=>(n,r,o)=>!Hc(t,n,r,o)(e)}}function _E(...e){return(t,n,r)=>r.state.matches(...e)}var bs={or:AE,and:PE,not:IE,stateIn:_E};function sg(e,t){return e=e??kE,(n,r,o)=>{if(_t(e)){let a=t[e];return sr(a)?a(n,r,o):a}return ig(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function Gc(e,t){return(n,r,o)=>ig(e)?e.predicate(t)(n,r,o):e}function ME(e){let t=e.computed??Kt({}),n=e.context??Kt({}),r=e.initial?e.states?.[e.initial]?.tags:[],o=La({value:e.initial??"",previousValue:"",event:Kt({}),previousEvent:Kt({}),context:zm(n,t),done:!1,tags:r??[],hasTag(a){return this.tags.includes(a)},matches(...a){return a.includes(this.value)},can(a){return Kt(this).nextEvents.includes(a)},get nextEvents(){let a=e.states?.[this.value]?.on??{},i=e?.on??{};return Object.keys({...a,...i})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Kt(o)}function Ha(e,t){return(n,r)=>{if($a(e))return e;if(sr(e))return e(n,r);if(_t(e)){let o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){let a=t?.[e];return Ga(a==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),sr(a)?a(n,r):a}}}}function RE(e){return _t(e)?{target:e}:e}function NE(e,t){return(n,r,o)=>lr(e).map(RE).find(a=>sg(a.guard,t)(n,r,o)??a.target??a.actions)}var lg=class{constructor(e,t){J(this,"status","Not Started"),J(this,"state"),J(this,"initialState"),J(this,"initialContext"),J(this,"id"),J(this,"type","machine"),J(this,"activityEvents",new Map),J(this,"delayedEvents",new Map),J(this,"stateListeners",new Set),J(this,"doneListeners",new Set),J(this,"contextWatchers",new Set),J(this,"removeStateListener",hs),J(this,"parent"),J(this,"children",new Map),J(this,"guardMap"),J(this,"actionMap"),J(this,"delayMap"),J(this,"activityMap"),J(this,"sync"),J(this,"options"),J(this,"config"),J(this,"_created",()=>{let n=tn("machine.created");this.executeActions(this.config?.created,n)}),J(this,"start",n=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=No(this.state,()=>{this.stateListeners.forEach(c=>{c(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(tn("machine.start"),lr(this.config.activities),"machine.start"),this.executeActions(this.config.entry,tn("machine.start"));let r=tn("machine.init"),o=Fa(n)?n.value:n,a=Fa(n)?n.context:void 0;a&&this.setContext(a);let i={target:o??this.config.initial},s=this.getNextStateInfo(i,r);return this.initialState=s,this.performStateChangeEffects(this.state.value,s,r),this}),J(this,"setupContextWatchers",()=>{let{watch:n}=this.config;if(!n)return;let r=ir(this.state.context),o=No(this.state.context,()=>{let a=ir(this.state.context);for(let[i,s]of Object.entries(n))(this.options.compareFns?.[i]??Object.is)(r[i],a[i])||this.executeActions(s,this.state.event);r=a});this.contextWatchers.add(o)}),J(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,tn("machine.stop")),this.executeActions(this.config.exit,tn("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),J(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),J(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(n=>n()),this.contextWatchers.clear()}),J(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(n=>{n.forEach(r=>r())}),this.delayedEvents.clear()}),J(this,"stopActivities",n=>{n?(this.activityEvents.get(n)?.forEach(r=>r()),this.activityEvents.get(n)?.clear(),this.activityEvents.delete(n)):(this.activityEvents.forEach(r=>{r.forEach(o=>o()),r.clear()}),this.activityEvents.clear())}),J(this,"sendChild",(n,r)=>{let o=tn(n),a=Dn(r,this.contextSnapshot),i=this.children.get(a);i||Ga(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),i.send(o)}),J(this,"stopChild",n=>{this.children.has(n)||Ga(`[@zag-js/core > stop-child] Cannot stop unknown child ${n}`),this.children.get(n).stop(),this.children.delete(n)}),J(this,"removeChild",n=>{this.children.delete(n)}),J(this,"stopChildren",()=>{this.children.forEach(n=>n.stop()),this.children.clear()}),J(this,"setParent",n=>{this.parent=n}),J(this,"spawn",(n,r)=>{let o=Dn(n);return r&&(o.id=r),o.type="machine.actor",o.setParent(this),this.children.set(o.id,Kt(o)),o.onDone(()=>{this.removeChild(o.id)}).start(),Kt(Bt(o))}),J(this,"stopActivity",n=>{if(!this.state.value)return;let r=this.activityEvents.get(this.state.value);r?.get(n)?.(),r?.delete(n)}),J(this,"addActivityCleanup",(n,r,o)=>{n&&(this.activityEvents.has(n)?this.activityEvents.get(n)?.set(r,o):this.activityEvents.set(n,new Map([[r,o]])))}),J(this,"setState",n=>{this.state.previousValue=this.state.value,this.state.value=n;let r=this.getStateNode(n);n==null?qm(this.state.tags):this.state.tags=lr(r?.tags)}),J(this,"setContext",n=>{n&&ag(this.state.context,yt(n))}),J(this,"setOptions",n=>{let r=yt(n);this.actionMap={...this.actionMap,...r.actions},this.delayMap={...this.delayMap,...r.delays},this.activityMap={...this.activityMap,...r.activities},this.guardMap={...this.guardMap,...r.guards}}),J(this,"getStateNode",n=>{if(n)return this.config.states?.[n]}),J(this,"getNextStateInfo",(n,r)=>{let o=this.determineTransition(n,r),a=!o?.target,i=o?.target??this.state.value,s=this.state.value!==i,c=this.getStateNode(i),u={reenter:!a&&!s&&!o?.internal,transition:o,stateNode:c,target:i,changed:s};return this.log("NextState:",`[${r.type}]`,this.state.value,"---->",u.target),u}),J(this,"getAfterActions",(n,r)=>{let o,a=this.state.value;return{entry:()=>{o=globalThis.setTimeout(()=>{let i=this.getNextStateInfo(n,this.state.event);this.performStateChangeEffects(a,i,this.state.event)},r)},exit:()=>{globalThis.clearTimeout(o)}}}),J(this,"getDelayedEventActions",n=>{let r=this.getStateNode(n),o=this.state.event;if(!r||!r.after)return;let a=[],i=[];if(Ua(r.after)){let s=this.determineTransition(r.after,o);if(!s)return;if(!$c(s,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(s)}`);let l=Ha(s.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(s,l);return a.push(u.entry),i.push(u.exit),{entries:a,exits:i}}if(Fa(r.after))for(let s in r.after){let c=r.after[s],u=Ha(s,this.delayMap)(this.contextSnapshot,o),f=this.getAfterActions(c,u);a.push(f.entry),i.push(f.exit)}return{entries:a,exits:i}}),J(this,"executeActions",(n,r)=>{let o=Gc(n,this.guardMap)(this.contextSnapshot,r,this.guardMeta);for(let a of lr(o)){let i=_t(a)?this.actionMap?.[a]:a;Bn(_t(a)&&!i,`[@zag-js/core > execute-actions] No implementation found for action: \`${a}\``),i?.(this.state.context,r,this.meta)}}),J(this,"executeActivities",(n,r,o)=>{for(let a of r){let i=_t(a)?this.activityMap?.[a]:a;if(!i){Bn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${a}\``);continue}let s=i(this.state.context,n,this.meta);if(s){let c=_t(a)?a:a.name||Ba();this.addActivityCleanup(o??this.state.value,c,s)}}}),J(this,"createEveryActivities",(n,r)=>{if(n)if(Ua(n)){let o=lr(n).find(c=>{let l=c.delay,f=Ha(l,this.delayMap)(this.contextSnapshot,this.state.event);return sg(c.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??f!=null});if(!o)return;let i=Ha(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{let c=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event)},i);return()=>{globalThis.clearInterval(c)}})}else for(let o in n){let a=n?.[o],s=Ha(o,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{let l=globalThis.setInterval(()=>{this.executeActions(a,this.state.event)},s);return()=>{globalThis.clearInterval(l)}})}}),J(this,"setEvent",n=>{this.state.previousEvent=this.state.event,this.state.event=Bt(tn(n))}),J(this,"performExitEffects",(n,r)=>{let o=this.state.value;if(o==="")return;let a=n?this.getStateNode(n):void 0;this.stopActivities(o);let i=Gc(a?.exit,this.guardMap)(this.contextSnapshot,r,this.guardMeta),s=lr(i),c=this.delayedEvents.get(o);c&&s.push(...c),this.executeActions(s,r),this.delayedEvents.delete(o)}),J(this,"performEntryEffects",(n,r)=>{let o=this.getStateNode(n),a=lr(o?.activities);this.createEveryActivities(o?.every,l=>{a.unshift(l)}),a.length>0&&this.executeActivities(r,a);let i=Gc(o?.entry,this.guardMap)(this.contextSnapshot,r,this.guardMeta),s=lr(i),c=this.getDelayedEventActions(n);o?.after&&c&&(this.delayedEvents.set(n,c?.exits),s.push(...c.entries)),this.executeActions(s,r),o?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(l=>{l(this.stateSnapshot)}),this.stop())}),J(this,"performTransitionEffects",(n,r)=>{let o=this.determineTransition(n,r);this.executeActions(o?.actions,r)}),J(this,"performStateChangeEffects",(n,r,o)=>{this.setEvent(o);let a=r.changed||r.reenter;a&&this.performExitEffects(n,o),this.performTransitionEffects(r.transition,o),this.setState(r.target),a&&this.performEntryEffects(r.target,o)}),J(this,"determineTransition",(n,r)=>NE(n,this.guardMap)?.(this.contextSnapshot,r,this.guardMeta)),J(this,"sendParent",n=>{this.parent||Ga("[@zag-js/core > send-parent] Cannot send event to an unknown parent");let r=tn(n);this.parent?.send(r)}),J(this,"log",(...n)=>{Jm()&&this.options.debug&&console.log(...n)}),J(this,"send",n=>{let r=tn(n);this.transition(this.state.value,r)}),J(this,"transition",(n,r)=>{let o=_t(n)?this.getStateNode(n):n?.stateNode,a=tn(r);if(!o&&!this.config.on){let c=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${n}, \`event\`: ${a.type}`;Bn(c);return}let i=o?.on?.[a.type]??this.config.on?.[a.type],s=this.getNextStateInfo(i,a);return this.performStateChangeEffects(this.state.value,s,a),s.stateNode}),J(this,"subscribe",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),()=>{this.stateListeners.delete(n)})),J(this,"onDone",n=>(this.doneListeners.add(n),this)),J(this,"onTransition",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),this)),this.config=rg(e),this.options=rg(t??{}),this.id=this.config.id??`machine-${Ba()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=ME(this.config),this.initialContext=ir(this.state.context)}get stateSnapshot(){return Kt(ir(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){let e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){let e=this.getState();return{value:e.value,tags:e.tags}}},nn=(e,t)=>new lg(e,t),cg=e=>e instanceof lg||e?.type==="machine",OE=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),LE=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,og=e=>{let t={},n;for(;n=LE.exec(e);)t[n[1]]=n[2];return t},DE=(e,t)=>{if(_t(e)){if(_t(t))return`${e};${t}`;e=og(e)}else _t(t)&&(t=og(t));return Object.assign({},e??{},t??{})};function ys(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=Da(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=OE(t[r],n[r]);continue}if(r==="style"){t[r]=DE(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function ug(e){return new Proxy({},{get(){return e}})}var Vt=()=>e=>Array.from(new Set(e));function oe(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){let o=Object.getOwnPropertyDescriptors(r);for(let a in o)a in t||Object.defineProperty(t,a,{enumerable:!0,get(){let i={};if(a==="style"||a==="class"||a==="className"||a.startsWith("on")){for(let s=0;s<e.length;s++){let c=e[s];typeof c=="function"&&(c=c()),i=ys(i,{[a]:(c||{})[a]})}return i[a]}for(let s=e.length-1;s>=0;s--){let c,l=e[s];if(typeof l=="function"&&(l=l()),c=(l||{})[a],c!==void 0)return c}}})}}return t}var BE=e=>Array.isArray(e),UE=e=>e!=null&&typeof e=="object",FE=e=>UE(e)&&!BE(e),$E=e=>typeof e=="number"&&!Number.isNaN(e),fg=e=>typeof e=="string",GE=Function.prototype.toString;GE.call(Object);var dg={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},HE=e=>e.startsWith("--")?e:ZE(e);function KE(e){return e in dg?dg[e]:e}var jt=ug(e=>{let t={};for(let n in e){let r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&FE(r)){t.style=VE(r);continue}if(n==="children"){fg(r)&&(t.textContent=r);continue}t[KE(n)]=r}}return t});function VE(e){let t={};for(let n in e){let r=e[n];!fg(r)&&!$E(r)||(t[HE(n)]=r)}return t}var jE=/[A-Z]/g,zE=/^ms-/;function WE(e){return"-"+e.toLowerCase()}var Kc={};function ZE(e){if(Kc.hasOwnProperty(e))return Kc[e];var t=e.replace(jE,WE);return Kc[e]=zE.test(t)?"-"+t:t}function pg(e,t){let{actions:n,context:r}=t??{},[o,a]=Lm(e.getState());return ie(()=>{let i=e.subscribe(s=>{a(cs(s))});de(()=>{i()})}),xe(()=>{let i=typeof r=="function"?r():r;e.setContext(i)}),xe(()=>{e.setOptions({actions:n})}),o}function mg(e){return[pg(e),e.send]}function YE(e,t){let{state:n,context:r}=t??{},o=(()=>{let a=typeof e=="function"?e():e,i=typeof r=="function"?r():r;return i&&a.setContext(i),a._created(),a})();return ie(()=>{o.start(n),de(()=>{o.stop()})}),o}function xn(e,t){let n=YE(e,t);return[pg(n,t),n.send,n]}var Vc=e=>n=>{let[r,o]=ze(n,["asChild"]);if(r.asChild){let a=i=>{let[,s]=ze(o,["ref"]);return oe(s,i)};return r.asChild(a)}return m(hf,Ee({component:e},o))};function qE(){let e=new Map;return new Proxy(Vc,{apply(t,n,r){return Vc(r[0])},get(t,n){let r=n;return e.has(r)||e.set(r,Vc(r)),e.get(r)}})}var be=qE();function gg(e,t,n){let r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(o){o&&t({type:"NODE.SET",node:o})},unmount(){t({type:"UNMOUNT"})}}}function vs(e){return e?.animationName||"none"}function hg(e){return nn({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},invokeOnExitComplete(t){t.onExitComplete?.()},setNode(t,n){t.node=Bt(n.node)},setStyles(t,n){let r=n.node.ownerDocument.defaultView||window;t.styles=Bt(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){if(t.present){r({type:"MOUNT",src:"presence.changed"});return}let o=vs(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=vs(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){let o=t.node;if(!o)return;let a=s=>{(s.composedPath?.()?.[0]??s.target)===o&&(t.prevAnimationName=vs(t.styles))},i=s=>{let c=vs(t.styles);(s.composedPath?.()?.[0]??s.target)===o&&c===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",a),o.addEventListener("animationcancel",i),o.addEventListener("animationend",i),()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",i),o.removeEventListener("animationend",i)}}}})}var G2=Vt()(["onExitComplete","present","immediate"]);var Oo=e=>ut()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),_r=e=>{let[t,n]=Na(e),[r,o]=R(!1),[a,i]=xn(hg(n),{context:n}),s=F(()=>gg(a,i,jt));return xe(()=>{s().present&&o(!0)}),F(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,presenceProps:{ref:s().setNode,hidden:!s().present,"data-state":n.present?"open":"closed"}}))};var[Lo,cr]=qe({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var Mt=e=>e?"":void 0;var yg=2147483647,XE=1,QE=9,ek=11,xs=e=>typeof e=="object"&&e!==null,dt=e=>xs(e)&&e.nodeType===XE&&typeof e.nodeName=="string",vg=e=>xs(e)&&e.nodeType===QE,tk=e=>xs(e)&&e===e.window;var xg=e=>dt(e)?e.localName||"":"#document";function nk(e){return["html","body","#document"].includes(xg(e))}var rk=e=>xs(e)&&e.nodeType!==void 0,zc=e=>rk(e)&&e.nodeType===ek&&"host"in e;function zt(e,t){return!e||!t||!dt(e)||!dt(t)?!1:e===t||e.contains(t)}function rn(e){return vg(e)?e:tk(e)?e.document:e?.ownerDocument??document}function ok(e){return rn(e).documentElement}function wn(e){return zc(e)?wn(e.host):vg(e)?e.defaultView??window:dt(e)?e.ownerDocument?.defaultView??window:window}function ak(e){let t=e.activeElement;for(;t?.shadowRoot;){let n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}var wg=()=>typeof document<"u";function ik(){return navigator.userAgentData?.platform??navigator.platform}var Wc=e=>wg()&&e.test(ik()),sk=e=>wg()&&e.test(navigator.userAgent);var Sg=()=>Wc(/^Mac/);var Tg=()=>sk(/firefox\//i),lk=()=>Wc(/mac|iphone|ipad|ipod/i),Cg=()=>Wc(/iP(hone|ad|od)|iOS/);function ck(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Sn(e){return ck(e)?.[0]??e.target}var Eg=e=>zt(e.currentTarget,Sn(e));function Zc(e){let t=e.currentTarget;if(!t)return!1;let n=lk();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.localName;return r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit"}function Yc(e){let t=e.currentTarget;if(!t)return!1;let n=t.localName;return e.altKey?n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit":!1}var qc=e=>e.id;function uk(e,t,n=qc){return e.find(r=>n(r)===t)}function Jc(e,t,n=qc){let r=uk(e,t,n);return r?e.indexOf(r):-1}function kg(e,t,n=!0){let r=Jc(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function Ag(e,t,n=!0){let r=Jc(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}var dk=e=>e.split("").map(t=>{let n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),fk=e=>dk(e.dataset.valuetext??e.textContent??""),pk=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase()),mk=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]);function gk(e,t,n,r=qc){let o=n?Jc(e,n,r):-1,a=n?mk(e,o):e;return t.length===1&&(a=a.filter(s=>r(s)!==n)),a.find(s=>pk(fk(s),t))}function hk(e,t){let{state:n,activeId:r,key:o,timeout:a=350,itemToId:i}=t,s=n.keysSoFar+o,l=s.length>1&&Array.from(s).every(h=>h===s[0])?s[0]:s,u=e.slice(),f=gk(u,l,r,i);function d(){clearTimeout(n.timer),n.timer=-1}function p(h){n.keysSoFar=h,d(),h!==""&&(n.timer=+setTimeout(()=>{p(""),d()},a))}return p(s),f}var Xc=Object.assign(hk,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:bk});function bk(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function yk(e){if(xg(e)==="html")return e;let t=e.assignedSlot||e.parentNode||zc(e)&&e.host||ok(e);return zc(t)?t.host:t}var Pg=e=>typeof e=="object"&&e!==null&&e.nodeType===1,vk=e=>Pg(e)&&e.tagName==="IFRAME";function xk(e){return Pg(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}function wk(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}var Ig="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function ws(e){return!e||e.closest("[inert]")?!1:e.matches(Ig)&&xk(e)}function Qc(e,t){if(!e)return[];let n=Array.from(e.querySelectorAll(Ig)),r=n.filter(bg);return t&&bg(e)&&r.unshift(e),r.forEach((o,a)=>{if(vk(o)&&o.contentDocument){let i=o.contentDocument.body,s=Qc(i);r.splice(a,1,...s)}}),!r.length&&t?n:r}function bg(e){return e!=null&&e.tabIndex>0?!0:ws(e)&&!wk(e)}function Sk(e,t){let n=Qc(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function _g(e){let{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t?.querySelector("[data-autofocus],[autofocus]")),!a){let i=Qc(t);a=r?i.filter(r)[0]:i[0]}return a||t||void 0}function Mg(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=Sk(t),o=t.ownerDocument||document;return!(o.activeElement===n&&e.shiftKey||o.activeElement===r&&!e.shiftKey||!n&&!r)}function eu(e){if(e==null||!dt(e))return!1;try{let t=wn(e);return e instanceof t.HTMLInputElement&&e.selectionStart!=null||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return!1}}var Tk=/auto|scroll|overlay|hidden|clip/;function Rg(e){let t=wn(e),{overflow:n,overflowX:r,overflowY:o,display:a}=t.getComputedStyle(e);return Tk.test(n+o+r)&&!["inline","contents"].includes(a)}function Ng(e){let t=new Set;function n(r){let o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function Je(e){let t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function Ck(e,t){if(!e)return;let{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,a=new o.MutationObserver(i=>{for(let s of i)s.type==="attributes"&&s.attributeName&&n.includes(s.attributeName)&&r(s)});return a.observe(e,{attributes:!0,attributeFilter:n}),()=>a.disconnect()}function Og(e,t){let{defer:n}=t,r=n?Je:a=>a(),o=[];return o.push(r(()=>{let a=typeof e=="function"?e():e;o.push(Ck(a,t))})),()=>{o.forEach(a=>a?.())}}function tu(e){let t=yk(e);return nk(t)?rn(t).body:dt(t)&&Rg(t)?t:tu(t)}function Ss(e,t){return Array.from(e?.querySelectorAll(t)??[])}function ur(e){let t={getRootNode:n=>n.getRootNode?.()??document,getDoc:n=>rn(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>ak(t.getRootNode(n)),isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;let o=r.toString();n.value!==o&&(n.value=r.toString())}};return{...t,...e}}function Ek(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Lg(e,t){let{rootEl:n,...r}=t||{};!e||!n||!Rg(n)||!Ek(n)||e.scrollIntoView(r)}var jc=new WeakMap;function kk(e,t,n){jc.has(e)||jc.set(e,new Map);let r=jc.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};let a=n(),i=()=>{a(),o(),r.delete(t)};return r.set(t,i),()=>{r.get(t)===i&&(a(),r.set(t,o))}}function Dg(e,t){return e?kk(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var Ak=1e3/60;function Pk(e,t){let n=e();if(dt(n)&&n.isConnected)return t(n),()=>{};{let r=setInterval(()=>{let o=e();dt(o)&&o.isConnected&&(t(o),clearInterval(r))},Ak);return()=>clearInterval(r)}}function Bg(e,t){let n=[];return e?.forEach(r=>{let o=Pk(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var[q2,Do]=qe({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var Ik=e=>typeof e=="function",Ug=(e,...t)=>Ik(e)?e(...t):e;var[_k,Mr]=qe({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),Mk=C("<span hidden>"),Rr=e=>{let[t,n]=R(),r=()=>Ug(e.value)??t()?.ownerDocument??document,o=F(()=>({getRootNode:r,getDocument:()=>rn(r()),getWindow:()=>wn(r())}));return m(_k,{value:o,get children(){return[F(()=>e.children),m(B,{get when(){return!e.value},get children(){var a=Mk();return he(n,a),a}})]}})};var Rk=Object.defineProperty,dr=(e,t)=>{for(var n in t)Rk(e,n,{get:t[n],enumerable:!0})};var on=(e,t=[])=>({parts:(...n)=>{if(Nk(t))return on(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>on(e,[...t,...n]),rename:n=>on(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Bo(e)}"][data-part="${Bo(r)}"]`,`& [data-scope="${Bo(e)}"][data-part="${Bo(r)}"]`].join(", "),attrs:{"data-scope":Bo(e),"data-part":Bo(r)}}}),{})}),Bo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Nk=e=>e.length===0;var Fg=["top","right","bottom","left"];var Tn=Math.min,Tt=Math.max,Va=Math.round,ja=Math.floor,Un=e=>({x:e,y:e}),Ok={left:"right",right:"left",bottom:"top",top:"bottom"},Lk={start:"end",end:"start"};function Cs(e,t,n){return Tt(e,Tn(t,n))}function Cn(e,t){return typeof e=="function"?e(t):e}function En(e){return e.split("-")[0]}function Nr(e){return e.split("-")[1]}function Es(e){return e==="x"?"y":"x"}function ks(e){return e==="y"?"height":"width"}function Fn(e){return["top","bottom"].includes(En(e))?"y":"x"}function As(e){return Es(Fn(e))}function $g(e,t,n){n===void 0&&(n=!1);let r=Nr(e),o=As(e),a=ks(o),i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ka(i)),[i,Ka(i)]}function Gg(e){let t=Ka(e);return[Ts(e),t,Ts(t)]}function Ts(e){return e.replace(/start|end/g,t=>Lk[t])}function Dk(e,t,n){let r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}function Hg(e,t,n,r){let o=Nr(e),a=Dk(En(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Ts)))),a}function Ka(e){return e.replace(/left|right|bottom|top/g,t=>Ok[t])}function Bk(e){return{top:0,right:0,bottom:0,left:0,...e}}function nu(e){return typeof e!="number"?Bk(e):{top:e,right:e,bottom:e,left:e}}function Or(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Kg(e,t,n){let{reference:r,floating:o}=e,a=Fn(t),i=As(t),s=ks(i),c=En(t),l=a==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2,p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Nr(t)){case"start":p[i]-=d*(n&&l?-1:1);break;case"end":p[i]+=d*(n&&l?-1:1);break}return p}var zg=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t)),l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Kg(l,r,c),d=r,p={},h=0;for(let g=0;g<s.length;g++){let{name:y,fn:b}=s[g],{x:T,y:S,data:k,reset:I}=await b({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:l,platform:i,elements:{reference:e,floating:t}});u=T??u,f=S??f,p={...p,[y]:{...p[y],...k}},I&&h<=50&&(h++,typeof I=="object"&&(I.placement&&(d=I.placement),I.rects&&(l=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:u,y:f}=Kg(l,d,c)),g=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:p}};async function Uo(e,t){var n;t===void 0&&(t={});let{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Cn(t,e),h=nu(p),y=s[d?f==="floating"?"reference":"floating":f],b=Or(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),T=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),k=await(a.isElement==null?void 0:a.isElement(S))?await(a.getScale==null?void 0:a.getScale(S))||{x:1,y:1}:{x:1,y:1},I=Or(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:T,offsetParent:S,strategy:c}):T);return{top:(b.top-I.top+h.top)/k.y,bottom:(I.bottom-b.bottom+h.bottom)/k.y,left:(b.left-I.left+h.left)/k.x,right:(I.right-b.right+h.right)/k.x}}var Wg=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Cn(e,t)||{};if(l==null)return{};let f=nu(u),d={x:n,y:r},p=As(o),h=ks(p),g=await i.getDimensions(l),y=p==="y",b=y?"top":"left",T=y?"bottom":"right",S=y?"clientHeight":"clientWidth",k=a.reference[h]+a.reference[p]-d[p]-a.floating[h],I=d[p]-a.reference[p],$=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l)),O=$?$[S]:0;(!O||!await(i.isElement==null?void 0:i.isElement($)))&&(O=s.floating[S]||a.floating[h]);let Q=k/2-I/2,H=O/2-g[h]/2-1,j=Tn(f[b],H),L=Tn(f[T],H),P=j,E=O-g[h]-L,w=O/2-g[h]/2+Q,N=Cs(P,w,E),_=!c.arrow&&Nr(o)!=null&&w!==N&&a.reference[h]/2-(w<P?j:L)-g[h]/2<0,ee=_?w<P?w-P:w-E:0;return{[p]:d[p]+ee,data:{[p]:N,centerOffset:w-N-ee,..._&&{alignmentOffset:ee}},reset:_}}});var Zg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;let{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...y}=Cn(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let b=En(o),T=Fn(s),S=En(s)===s,k=await(c.isRTL==null?void 0:c.isRTL(l.floating)),I=d||(S||!g?[Ka(s)]:Gg(s)),$=h!=="none";!d&&$&&I.push(...Hg(s,g,h,k));let O=[s,...I],Q=await Uo(t,y),H=[],j=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&H.push(Q[b]),f){let w=$g(o,i,k);H.push(Q[w[0]],Q[w[1]])}if(j=[...j,{placement:o,overflows:H}],!H.every(w=>w<=0)){var L,P;let w=(((L=a.flip)==null?void 0:L.index)||0)+1,N=O[w];if(N)return{data:{index:w,overflows:j},reset:{placement:N}};let _=(P=j.filter(ee=>ee.overflows[0]<=0).sort((ee,me)=>ee.overflows[1]-me.overflows[1])[0])==null?void 0:P.placement;if(!_)switch(p){case"bestFit":{var E;let ee=(E=j.filter(me=>{if($){let ge=Fn(me.placement);return ge===T||ge==="y"}return!0}).map(me=>[me.placement,me.overflows.filter(ge=>ge>0).reduce((ge,Ne)=>ge+Ne,0)]).sort((me,ge)=>me[1]-ge[1])[0])==null?void 0:E[0];ee&&(_=ee);break}case"initialPlacement":_=s;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Vg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jg(e){return Fg.some(t=>e[t]>=0)}var Yg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n}=t,{strategy:r="referenceHidden",...o}=Cn(e,t);switch(r){case"referenceHidden":{let a=await Uo(t,{...o,elementContext:"reference"}),i=Vg(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:jg(i)}}}case"escaped":{let a=await Uo(t,{...o,altBoundary:!0}),i=Vg(a,n.floating);return{data:{escapedOffsets:i,escaped:jg(i)}}}default:return{}}}}};async function Uk(e,t){let{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=En(n),s=Nr(n),c=Fn(n)==="y",l=["left","top"].includes(i)?-1:1,u=a&&c?-1:1,f=Cn(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}var qg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:a,placement:i,middlewareData:s}=t,c=await Uk(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Jg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:y=>{let{x:b,y:T}=y;return{x:b,y:T}}},...c}=Cn(e,t),l={x:n,y:r},u=await Uo(t,c),f=Fn(En(o)),d=Es(f),p=l[d],h=l[f];if(a){let y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",T=p+u[y],S=p-u[b];p=Cs(T,p,S)}if(i){let y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",T=h+u[y],S=h-u[b];h=Cs(T,h,S)}let g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[d]:a,[f]:i}}}}}},Xg=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Cn(e,t),u={x:n,y:r},f=Fn(o),d=Es(f),p=u[d],h=u[f],g=Cn(s,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let S=d==="y"?"height":"width",k=a.reference[d]-a.floating[S]+y.mainAxis,I=a.reference[d]+a.reference[S]-y.mainAxis;p<k?p=k:p>I&&(p=I)}if(l){var b,T;let S=d==="y"?"width":"height",k=["top","left"].includes(En(o)),I=a.reference[f]-a.floating[S]+(k&&((b=i.offset)==null?void 0:b[f])||0)+(k?0:y.crossAxis),$=a.reference[f]+a.reference[S]+(k?0:((T=i.offset)==null?void 0:T[f])||0)-(k?y.crossAxis:0);h<I?h=I:h>$&&(h=$)}return{[d]:p,[f]:h}}}},Qg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;let{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=Cn(e,t),u=await Uo(t,l),f=En(o),d=Nr(o),p=Fn(o)==="y",{width:h,height:g}=a.floating,y,b;f==="top"||f==="bottom"?(y=f,b=d===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=f,y=d==="end"?"top":"bottom");let T=g-u.top-u.bottom,S=h-u.left-u.right,k=Tn(g-u[y],T),I=Tn(h-u[b],S),$=!t.middlewareData.shift,O=k,Q=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(Q=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=T),$&&!d){let j=Tt(u.left,0),L=Tt(u.right,0),P=Tt(u.top,0),E=Tt(u.bottom,0);p?Q=h-2*(j!==0||L!==0?j+L:Tt(u.left,u.right)):O=g-2*(P!==0||E!==0?P+E:Tt(u.top,u.bottom))}await c({...t,availableWidth:Q,availableHeight:O});let H=await i.getDimensions(s.floating);return h!==H.width||g!==H.height?{reset:{rects:!0}}:{}}}};function Ps(){return typeof window<"u"}function Lr(e){return th(e)?(e.nodeName||"").toLowerCase():"#document"}function Rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function an(e){var t;return(t=(th(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function th(e){return Ps()?e instanceof Node||e instanceof Rt(e).Node:!1}function Wt(e){return Ps()?e instanceof Element||e instanceof Rt(e).Element:!1}function sn(e){return Ps()?e instanceof HTMLElement||e instanceof Rt(e).HTMLElement:!1}function eh(e){return!Ps()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rt(e).ShadowRoot}function $o(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function nh(e){return["table","td","th"].includes(Lr(e))}function za(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Is(e){let t=_s(),n=Wt(e)?Zt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function rh(e){let t=$n(e);for(;sn(t)&&!Dr(t);){if(Is(t))return t;if(za(t))return null;t=$n(t)}return null}function _s(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dr(e){return["html","body","#document"].includes(Lr(e))}function Zt(e){return Rt(e).getComputedStyle(e)}function Wa(e){return Wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $n(e){if(Lr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||eh(e)&&e.host||an(e);return eh(t)?t.host:t}function oh(e){let t=$n(e);return Dr(t)?e.ownerDocument?e.ownerDocument.body:e.body:sn(t)&&$o(t)?t:oh(t)}function Fo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let o=oh(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=Rt(o);if(a){let s=Ms(i);return t.concat(i,i.visualViewport||[],$o(o)?o:[],s&&n?Fo(s):[])}return t.concat(o,Fo(o,[],n))}function Ms(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sh(e){let t=Zt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=sn(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Va(n)!==a||Va(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function au(e){return Wt(e)?e:e.contextElement}function Go(e){let t=au(e);if(!sn(t))return Un(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:a}=sh(t),i=(a?Va(n.width):n.width)/r,s=(a?Va(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var Fk=Un(0);function lh(e){let t=Rt(e);return!_s()||!t.visualViewport?Fk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $k(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rt(e)?!1:t}function Br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),a=au(e),i=Un(1);t&&(r?Wt(r)&&(i=Go(r)):i=Go(e));let s=$k(a,n,r)?lh(a):Un(0),c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(a){let d=Rt(a),p=r&&Wt(r)?Rt(r):r,h=d,g=Ms(h);for(;g&&r&&p!==h;){let y=Go(g),b=g.getBoundingClientRect(),T=Zt(g),S=b.left+(g.clientLeft+parseFloat(T.paddingLeft))*y.x,k=b.top+(g.clientTop+parseFloat(T.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,f*=y.y,c+=S,l+=k,h=Rt(g),g=Ms(h)}}return Or({width:u,height:f,x:c,y:l})}function Gk(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,a=o==="fixed",i=an(r),s=t?za(t.floating):!1;if(r===i||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Un(1),u=Un(0),f=sn(r);if((f||!f&&!a)&&((Lr(r)!=="body"||$o(i))&&(c=Wa(r)),sn(r))){let d=Br(r);l=Go(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function Hk(e){return Array.from(e.getClientRects())}function ou(e,t){let n=Wa(e).scrollLeft;return t?t.left+n:Br(an(e)).left+n}function Kk(e){let t=an(e),n=Wa(e),r=e.ownerDocument.body,o=Tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),i=-n.scrollLeft+ou(e),s=-n.scrollTop;return Zt(r).direction==="rtl"&&(i+=Tt(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Vk(e,t){let n=Rt(e),r=an(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;let l=_s();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s,y:c}}function jk(e,t){let n=Br(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=sn(e)?Go(e):Un(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,c=o*a.x,l=r*a.y;return{width:i,height:s,x:c,y:l}}function ah(e,t,n){let r;if(t==="viewport")r=Vk(e,n);else if(t==="document")r=Kk(an(e));else if(Wt(t))r=jk(t,n);else{let o=lh(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Or(r)}function ch(e,t){let n=$n(e);return n===t||!Wt(n)||Dr(n)?!1:Zt(n).position==="fixed"||ch(n,t)}function zk(e,t){let n=t.get(e);if(n)return n;let r=Fo(e,[],!1).filter(s=>Wt(s)&&Lr(s)!=="body"),o=null,a=Zt(e).position==="fixed",i=a?$n(e):e;for(;Wt(i)&&!Dr(i);){let s=Zt(i),c=Is(i);!c&&s.position==="fixed"&&(o=null),(a?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||$o(i)&&!c&&ch(e,i))?r=r.filter(u=>u!==i):o=s,i=$n(i)}return t.set(e,r),r}function Wk(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[...n==="clippingAncestors"?za(t)?[]:zk(t,this._c):[].concat(n),r],s=i[0],c=i.reduce((l,u)=>{let f=ah(t,u,o);return l.top=Tt(f.top,l.top),l.right=Tn(f.right,l.right),l.bottom=Tn(f.bottom,l.bottom),l.left=Tt(f.left,l.left),l},ah(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zk(e){let{width:t,height:n}=sh(e);return{width:t,height:n}}function Yk(e,t,n){let r=sn(t),o=an(t),a=n==="fixed",i=Br(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Un(0);if(r||!r&&!a)if((Lr(t)!=="body"||$o(o))&&(s=Wa(t)),r){let p=Br(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&(c.x=ou(o));let l=0,u=0;if(o&&!r&&!a){let p=o.getBoundingClientRect();u=p.top+s.scrollTop,l=p.left+s.scrollLeft-ou(o,p)}let f=i.left+s.scrollLeft-c.x-l,d=i.top+s.scrollTop-c.y-u;return{x:f,y:d,width:i.width,height:i.height}}function ru(e){return Zt(e).position==="static"}function ih(e,t){if(!sn(e)||Zt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return an(e)===n&&(n=n.ownerDocument.body),n}function uh(e,t){let n=Rt(e);if(za(e))return n;if(!sn(e)){let o=$n(e);for(;o&&!Dr(o);){if(Wt(o)&&!ru(o))return o;o=$n(o)}return n}let r=ih(e,t);for(;r&&nh(r)&&ru(r);)r=ih(r,t);return r&&Dr(r)&&ru(r)&&!Is(r)?n:r||rh(e)||n}var qk=async function(e){let t=this.getOffsetParent||uh,n=this.getDimensions,r=await n(e.floating);return{reference:Yk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jk(e){return Zt(e).direction==="rtl"}var Xk={convertOffsetParentRelativeRectToViewportRelativeRect:Gk,getDocumentElement:an,getClippingRect:Wk,getOffsetParent:uh,getElementRects:qk,getClientRects:Hk,getDimensions:Zk,getScale:Go,isElement:Wt,isRTL:Jk};function Qk(e,t){let n=null,r,o=an(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let{left:l,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;let p=ja(u),h=ja(o.clientWidth-(l+f)),g=ja(o.clientHeight-(u+d)),y=ja(l),T={rootMargin:-p+"px "+-h+"px "+-g+"px "+-y+"px",threshold:Tt(0,Tn(1,c))||1},S=!0;function k(I){let $=I[0].intersectionRatio;if($!==c){if(!S)return i();$?i(!1,$):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(k,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,T)}n.observe(e)}return i(!0),a}function dh(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=au(e),u=o||a?[...l?Fo(l):[],...Fo(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});let f=l&&s?Qk(l,n):null,d=-1,p=null;i&&(p=new ResizeObserver(b=>{let[T]=b;T&&T.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let h,g=c?Br(e):null;c&&y();function y(){let b=Br(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&n(),g=b,h=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(T=>{o&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(h)}}var fh=qg;var ph=Jg,mh=Zg,gh=Qg,hh=Yg,bh=Wg;var yh=Xg,vh=(e,t,n)=>{let r=new Map,o={platform:Xk,...n},a={...o.platform,_c:r};return zg(e,t,{...o,platform:a})};function xh(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);let o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function e1(e){if(!e)return xh();let{x:t,y:n,width:r,height:o}=e;return xh(t,n,r,o)}function t1(e,t){return{contextElement:dt(e)?e:void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?e1(r):n.getBoundingClientRect()}}}var Za=e=>({variable:e,reference:`var(${e})`}),Gn={arrowSize:Za("--arrow-size"),arrowSizeHalf:Za("--arrow-size-half"),arrowBg:Za("--arrow-background"),transformOrigin:Za("--transform-origin"),arrowOffset:Za("--arrow-offset")},n1=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),r1={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){let{arrow:r}=n,o=n1(r)[e],{floating:a}=t;return a.style.setProperty(Gn.transformOrigin.variable,o),{data:{transformOrigin:o}}}},o1={name:"rects",fn({rects:e}){return{data:e}}},a1=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:o}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[a]:`calc(100% + ${Gn.arrowOffset.reference})`}),{}}}};function i1(e){let[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function Sh(e){return e.split("-")[0]}var s1={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function wh(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Th(e){return Dn(e.boundary)}function l1(e,t){if(e)return bh({element:e,padding:t.arrowPadding})}function c1(e,t){if(!Qm(t.offset??t.gutter))return fh(({placement:n})=>{let r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,a=typeof o=="number"?o+r:o??r,{hasAlign:i}=i1(n),s=i?void 0:t.shift,c=t.offset?.crossAxis??s;return yt({crossAxis:c,mainAxis:a,alignmentAxis:t.shift})})}function u1(e){if(e.flip)return mh({boundary:Th(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function d1(e){if(!(!e.slide&&!e.overlap))return ph({boundary:Th(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:yh()})}function f1(e){return gh({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){let a=t.floating,i=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),a.style.setProperty("--reference-width",`${i}px`),a.style.setProperty("--available-width",`${o}px`),a.style.setProperty("--available-height",`${r}px`)}})}function p1(e){if(e.hideWhenDetached)return hh({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function m1(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function g1(e,t,n={}){let r=t1(e,n.getAnchorRect);if(!t||!r)return;let o=Object.assign({},s1,n),a=t.querySelector("[data-part=arrow]"),i=[c1(a,o),u1(o),d1(o),l1(a,o),a1(a),r1,f1(o),p1(o),o1],{placement:s,strategy:c,onComplete:l,onPositioned:u}=o,f=async()=>{if(!r||!t)return;let g=await vh(r,t,{placement:s,middleware:i,strategy:c});l?.(g),u?.({placed:!0});let y=wn(t),b=wh(y,g.x),T=wh(y,g.y);t.style.setProperty("--x",`${b}px`),t.style.setProperty("--y",`${T}px`),o.hideWhenDetached&&g.middlewareData.hide?.referenceHidden&&t.style.setProperty("visibility","hidden");let S=t.firstElementChild;if(S){let k=y.getComputedStyle(S).zIndex;t.style.setProperty("--z-index",k)}},d=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:f}),u?.({placed:!0})):await f()},p=m1(o.listeners),h=o.listeners?dh(r,t,d,p):hs;return d(),()=>{h?.(),u?.({placed:!1})}}function iu(e,t,n={}){let{defer:r,...o}=n,a=r?Je:s=>s(),i=[];return i.push(a(()=>{let s=typeof e=="function"?e():e,c=typeof t=="function"?t():t;i.push(g1(s,c,o))})),()=>{i.forEach(s=>s?.())}}var h1={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Ch(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Gn.arrowSize.reference,height:Gn.arrowSize.reference,[Gn.arrowSizeHalf.variable]:`calc(${Gn.arrowSize.reference} / 2)`,[Gn.arrowOffset.variable]:`calc(${Gn.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?h1[t.split("-")[0]]:void 0,background:Gn.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var ln=(e,t,n,r)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function kh(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Rs=e=>e.button===2||Sg()&&e.ctrlKey&&e.button===0,Ah=e=>e.ctrlKey||e.altKey||e.metaKey;function b1(e,t,n){let o=(i=>{let s=requestAnimationFrame(i);return()=>cancelAnimationFrame(s)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{o(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),o}function y1(e){return e?.matches("a[href]")??!1}function Ph(e){if(!y1(e))return;let t=()=>e.click();Tg()?b1(e,"keyup",t):queueMicrotask(t)}function su(e,t,n){if(!e)return;let r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}var v1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Eh={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function lu(e,t={}){let{dir:n="ltr",orientation:r="horizontal"}=t,{key:o}=e;return o=v1[o]??o,n==="rtl"&&r==="horizontal"&&o in Eh&&(o=Eh[o]),o}function x1(e,t="client"){let n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function w1(e,t="client"){return{x:e[`${t}X`],y:e[`${t}Y`]}}var S1=e=>"touches"in e&&e.touches.length>0;function Ns(e,t="client"){return S1(e)?x1(e,t):w1(e,t)}function T1(e){let t={each(n){for(let r=0;r<e.frames?.length;r+=1){let o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(a=>{try{a.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(a=>{try{a.document.removeEventListener(n,r,o)}catch{}})}};return t}function C1(e){let t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var Ih="pointerdown.outside",_h="focus.outside";function E1(e){for(let t of e)if(dt(t)&&ws(t))return!0;return!1}var Rh=e=>"clientY"in e;function k1(e,t){if(!Rh(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function Mh(e,t){if(!t||!Rh(e))return!1;let r=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,a=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return r||a}function A1(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:a,defer:i}=t;if(!e)return;let s=rn(e),c=wn(e),l=T1(c),u=C1(c);function f(b){let T=Sn(b);if(!dt(T)||zt(e,T)||k1(e,b)||Mh(b,T))return!1;let S=tu(e);return Mh(b,S)?!1:!n?.(T)}let d=new Set;function p(b){function T(){let S=i?Je:I=>I(),k=b.composedPath?.()??[b.target];S(()=>{if(!(!e||!f(b))){if(o||a){let I=Da(o,a);e.addEventListener(Ih,I,{once:!0})}su(e,Ih,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:Rs(b),focusable:E1(k)}})}})}b.pointerType==="touch"?(d.forEach(S=>S()),d.add(ln(s,"click",T,{once:!0})),d.add(u.addEventListener("click",T,{once:!0})),d.add(l.addEventListener("click",T,{once:!0}))):T()}let h=new Set,g=setTimeout(()=>{h.add(ln(s,"pointerdown",p,!0)),h.add(u.addEventListener("pointerdown",p,!0)),h.add(l.addEventListener("pointerdown",p,!0))},0);function y(b){(i?Je:S=>S())(()=>{if(!(!e||!f(b))){if(r||a){let S=Da(r,a);e.addEventListener(_h,S,{once:!0})}su(e,_h,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:ws(Sn(b))}})}})}return h.add(ln(s,"focusin",y,!0)),h.add(u.addEventListener("focusin",y,!0)),h.add(l.addEventListener("focusin",y,!0)),()=>{clearTimeout(g),d.forEach(b=>b()),h.forEach(b=>b())}}function Nh(e,t){let{defer:n}=t,r=n?Je:a=>a(),o=[];return o.push(r(()=>{let a=typeof e=="function"?e():e;o.push(A1(a,t))})),()=>{o.forEach(a=>a?.())}}function P1(e,t){let n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return ln(rn(e),"keydown",n,{capture:!0})}var Ut={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>zt(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>zt(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},Oh;function Lh(){Ut.layers.forEach(({node:e})=>{e.style.pointerEvents=Ut.isBelowPointerBlockingLayer(e)?"none":"auto"})}function I1(e){e.style.pointerEvents=""}function _1(e,t){let n=rn(e),r=[];if(Ut.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Oh=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){let o=Bg(t,a=>{r.push(Dg(a,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ut.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Oh,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function M1(e,t){if(!e){Bn("[@zag-js/dismissable] node is `null` or `undefined`");return}let{onDismiss:n,pointerBlocking:r,exclude:o,debug:a}=t,i={dismiss:n,node:e,pointerBlocking:r};Ut.add(i),Lh();function s(d){let p=Sn(d.detail.originalEvent);Ut.isBelowPointerBlockingLayer(e)||Ut.isInBranch(p)||(t.onPointerDownOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(a&&console.log("onPointerDownOutside:",d.detail.originalEvent),n?.()))}function c(d){let p=Sn(d.detail.originalEvent);Ut.isInBranch(p)||(t.onFocusOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(a&&console.log("onFocusOutside:",d.detail.originalEvent),n?.()))}function l(d){Ut.isTopMost(e)&&(t.onEscapeKeyDown?.(d),!d.defaultPrevented&&n&&(d.preventDefault(),n()))}function u(d){if(!e)return!1;let p=typeof o=="function"?o():o,h=Array.isArray(p)?p:[p],g=t.persistentElements?.map(y=>y()).filter(dt);return g&&h.push(...g),h.some(y=>zt(y,d))||Ut.isInNestedLayer(e,d)}let f=[r?_1(e,t.persistentElements):void 0,P1(e,l),Nh(e,{exclude:u,onFocusOutside:c,onPointerDownOutside:s,defer:t.defer})];return()=>{Ut.remove(e),Lh(),I1(e),f.forEach(d=>d?.())}}function Os(e,t){let{defer:n}=t,r=n?Je:a=>a(),o=[];return o.push(r(()=>{let a=sr(e)?e():e;o.push(M1(a,t))})),()=>{o.forEach(a=>a?.())}}function Dh(e,t={}){let{defer:n}=t,r=n?Je:a=>a(),o=[];return o.push(r(()=>{let a=sr(e)?e():e;if(!a){Bn("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Ut.addBranch(a),o.push(()=>{Ut.removeBranch(a)})})),()=>{o.forEach(a=>a?.())}}var Fh=on("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),Ho=Fh.build(),vt=ur({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>vt.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>vt.getById(e,vt.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function cu(e,t){return e.filter(n=>n.state.context.placement===t)}var Bh={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Uh(e,t){return e??Bh[t]??Bh.DEFAULT}function R1(e,t){let n=e.offsets,r=typeof n=="string"?{left:n,right:n,bottom:n,top:n}:n,o=e.dir==="rtl",a=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),i=a.includes("right"),s=a.includes("left"),c={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:yg},l="center";if(i&&(l="flex-end"),s&&(l="flex-start"),c.alignItems=l,a.includes("top")){let u=r.top;c.top=`max(env(safe-area-inset-top, 0px), ${u})`}if(a.includes("bottom")){let u=r.bottom;c.bottom=`max(env(safe-area-inset-bottom, 0px), ${u})`}if(!a.includes("left")){let u=r.right;c.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${u})`}if(!a.includes("right")){let u=r.left;c.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${u})`}return c}function N1(e,t){let[n]=e.placement.split("-"),r=!e.frontmost,o=!e.stacked,a={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${e.type==="loading"?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},i=s=>Object.assign(a,s);return n==="top"?i({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):n==="bottom"&&i({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(i({"--y":"0","--opacity":"1"}),e.stacked&&i({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||i({"--opacity":"0",pointerEvents:"none"}),r&&o&&(i({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||i({"--y":"calc(var(--sign) * 40%)"})),r&&e.stacked&&!t&&i({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&i({"--y":"calc(var(--lift) * -100%)"}),a}function O1(e,t){let n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},r=o=>Object.assign(n,o);return e.frontmost&&!t&&r({height:"calc(var(--initial-height) + 80%)"}),n}function L1(e,t){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function D1(e,t,n){function r(){return cg(e)?e.getState():e}function o(u){return cu(r().context.toasts,u)}function a(u){let f=r().context.toasts;return f.length?!!f.find(d=>d.id==u):!1}function i(u){let f=`toast:${Ba()}`,d=u.id?u.id:f;return a(d)||t({type:"ADD_TOAST",toast:{...u,id:d}}),d}function s(u,f){return a(u)&&t({type:"UPDATE_TOAST",id:u,toast:f}),u}function c(u){let{id:f}=u;return(f?a(f):!1)&&f!=null?s(f,u):i(u)}function l(u){u==null?t("DISMISS_ALL"):a(u)&&t({type:"DISMISS_TOAST",id:u})}return{getCount(){return r().context.count},getPlacements(){let f=r().context.toasts.map(d=>d.state.context.placement);return Array.from(new Set(f))},getToastsByPlacement:o,isVisible:a,create:i,update:s,upsert:c,dismiss:l,remove(u){u==null?t("REMOVE_ALL"):a(u)&&t({type:"REMOVE_TOAST",id:u})},dismissByPlacement(u){o(u).forEach(d=>l(d.id))},loading(u){return c({...u,type:"loading"})},success(u){return c({...u,type:"success"})},error(u){return c({...u,type:"error"})},promise(u,f,d={}){let p=c({...d,...f.loading,type:"loading"});return Dn(u).then(h=>{let g=Dn(f.success,h);c({...d,...g,id:p,type:"success"})}).catch(h=>{let g=Dn(f.error,h);c({...d,...g,id:p,type:"error"})}).finally(()=>{f.finally?.()}),p},pause(u){u==null?t("PAUSE_ALL"):a(u)&&t({type:"PAUSE_TOAST",id:u})},resume(u){u==null?t("RESUME_ALL"):a(u)&&t({type:"RESUME_TOAST",id:u})},getGroupProps(u){let{placement:f,label:d="Notifications"}=u,p=r(),h=p.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[g,y="center"]=f.split("-");return n.element({...Ho.group.attrs,dir:p.context.dir,tabIndex:-1,"aria-label":`${f} ${d} ${h}`,id:vt.getRegionId(f),"data-placement":f,"data-side":g,"data-align":y,"aria-live":"polite",role:"region",style:R1(p.context,f),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:f})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:f})},onFocus(b){t({type:"REGION.FOCUS",target:b.relatedTarget})},onBlur(b){p.context.isFocusWithin&&!zt(b.currentTarget,b.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(u){let f=r();return No(f.context.toasts,()=>{let p=o(f.context.placement).map(h=>h.getState().context);u(p)})}}}var{not:B1,and:U1,or:F1}=bs;function $1(e){let{type:t="info",duration:n,id:r="1",placement:o="bottom",removeDelay:a=200,...i}=e,s=yt(i),c=Uh(n,t);return nn({id:r,context:{id:r,type:t,remaining:c,duration:c,removeDelay:a,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:t==="loading"?"visible:persist":"visible",on:{UPDATE:[{guard:U1("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:F1("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:B1("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(l,u,{self:f}){let d;return Je(()=>{let p=vt.getRootEl(l);if(!p)return;l.mounted=!0;let h=Ss(p,"[data-ghost]");Bn(h.length!==2,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");let g=()=>{let T=p.style.height;p.style.height="auto";let S=p.getBoundingClientRect().height;p.style.height=T,l.height=S,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:S,placement:l.placement})};g();let y=vt.getWin(l),b=new y.MutationObserver(g);b.observe(p,{childList:!0,subtree:!0,characterData:!0}),d=()=>b.disconnect()}),()=>d?.()}},guards:{isChangingToLoading:(l,u)=>u.toast?.type==="loading",isLoadingType:l=>l.type==="loading",hasTypeChanged:(l,u)=>u.toast?.type!=null&&u.toast.type!==l.type,hasDurationChanged:(l,u)=>u.toast?.duration!=null&&u.toast.duration!==l.duration},delays:{VISIBLE_DURATION:l=>l.remaining,REMOVE_DELAY:l=>l.removeDelay},actions:{measureHeight(l,u,{self:f}){Je(()=>{let d=vt.getRootEl(l);if(!d)return;l.mounted=!0;let p=d.style.height;d.style.height="auto";let h=d.getBoundingClientRect().height;d.style.height=p,l.height=h,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:h,placement:l.placement})})},setRemainingDuration(l){l.remaining-=Date.now()-l.createdAt},setCreatedAt(l){l.createdAt=Date.now()},notifyParentToRemove(l,u,{self:f}){f.sendParent({type:"REMOVE_TOAST",id:f.id})},invokeOnDismiss(l){l.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(l){l.onStatusChange?.({status:"unmounted"})},invokeOnVisible(l){l.onStatusChange?.({status:"visible"})},setContext(l,u){let f=u.toast?.duration,d=u.toast?.type??l.type,p=Uh(f,d);Object.assign(l,{...u.toast,duration:p,remaining:p})}}})}function G1(e){let t=yt(e);return nn({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:n=>n.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:n=>n.toasts.length<n.max,isOverlapping:n=>!!n.overlap},activities:{trackHotKeyPress(n,r,{send:o}){return ln(document,"keydown",i=>{n.hotkey.every(c=>i[c]||i.code===c)&&o({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility(n,r,{send:o}){if(!n.pauseOnPageIdle)return;let a=vt.getDoc(n);return ln(a,"visibilitychange",()=>{o(a.visibilityState==="hidden"?"PAUSE_ALL":"RESUME_ALL")})}},actions:{setDismissableBranch(n){let o=cu(n.toasts,n.placement).length>0;if(!o){n._cleanup?.();return}if(o&&n._cleanup)return;let a=()=>vt.getRegionEl(n,n.placement);n._cleanup=Dh(a,{defer:!0})},clearDismissableBranch(n){n._cleanup?.()},focusRegionEl(n){queueMicrotask(()=>{vt.getRegionEl(n,n.placement)?.focus()})},expandToasts(n){Ls(n,r=>{r.state.context.stacked=!0})},collapseToasts(n){Ls(n,r=>{r.state.context.stacked=!1})},collapsedIfEmpty(n,r,{send:o}){!n.overlap||n.toasts.length>1||o("REGION.OVERLAP")},pauseToast(n,r,{self:o}){o.sendChild("PAUSE",r.id)},pauseToasts(n){n.toasts.forEach(r=>r.send("PAUSE"))},resumeToast(n,r,{self:o}){o.sendChild("RESUME",r.id)},resumeToasts(n){n.toasts.forEach(r=>r.send("RESUME"))},measureToasts(n){n.toasts.forEach(r=>r.send("MEASURE"))},createToast(n,r,{self:o,getState:a}){let i={placement:n.placement,duration:n.duration,removeDelay:n.removeDelay,...r.toast,dir:n.dir,getRootNode:n.getRootNode,stacked:a().matches("stack")},s=$1(i),c=o.spawn(s);n.toasts=[c,...n.toasts]},updateToast(n,r,{self:o}){o.sendChild({type:"UPDATE",toast:r.toast},r.id)},dismissToast(n,r,{self:o}){o.sendChild("DISMISS",r.id)},dismissToasts(n){n.toasts.forEach(r=>r.send("DISMISS"))},removeToast(n,r,{self:o}){o.stopChild(r.id),n.toasts=n.toasts.filter(a=>a.id!==r.id),n.heights=n.heights.filter(a=>a.id!==r.id)},removeToasts(n,r,{self:o}){n.toasts.forEach(a=>o.stopChild(a.id)),n.toasts=[],n.heights=[]},syncHeights(n,r){let o=n.heights.find(a=>a.id===r.id);if(o)o.height=r.height,o.placement=r.placement;else{let a={id:r.id,height:r.height,placement:r.placement};n.heights=[a,...n.heights]}},syncToastIndex(n){Ls(n,(r,o,a)=>{r.state.context.index=o,r.state.context.frontmost=o===0,r.state.context.zIndex=a.length-o})},syncToastOffset(n,r){let o=r.placement??n.placement;Ls({...n,placement:o},a=>{let i=Math.max(n.heights.findIndex(c=>c.id===a.id),0),s=n.heights.reduce((c,l,u)=>u>=i?c:c+l.height,0);a.state.context.offset=i*n.gap+s})},setLastFocusedEl(n,r){n.isFocusWithin||!r.target||(n.isFocusWithin=!0,n.lastFocusedEl=Bt(r.target))},restoreLastFocusedEl(n){n.isFocusWithin=!1,n.lastFocusedEl&&(n.lastFocusedEl.focus({preventScroll:!0}),n.lastFocusedEl=null)},clearLastFocusedEl(n){n.lastFocusedEl&&(n.lastFocusedEl.focus({preventScroll:!0}),n.lastFocusedEl=null,n.isFocusWithin=!1)}}})}function Ls(e,t){cu(e.toasts,e.placement).forEach(t)}function $h(e,t,n){let r=e.hasTag("visible"),o=e.hasTag("paused"),a=e.context.placement,i=e.context.type,[s,c="center"]=a.split("-");return{type:i,title:e.context.title,description:e.context.description,placement:a,visible:r,paused:o,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps(){return n.element({...Ho.root.attrs,dir:e.context.dir,id:vt.getRootId(e.context),"data-state":r?"open":"closed","data-type":i,"data-placement":a,"data-align":c,"data-side":s,"data-mounted":Mt(e.context.mounted),"data-paused":Mt(o),"data-first":Mt(e.context.frontmost),"data-sibling":Mt(!e.context.frontmost),"data-stack":Mt(e.context.stacked),"data-overlap":Mt(!e.context.stacked),role:"status","aria-atomic":"true","aria-describedby":e.context.description?vt.getDescriptionId(e.context):void 0,"aria-labelledby":e.context.title?vt.getTitleId(e.context):void 0,tabIndex:0,style:N1(e.context,r),onKeyDown(l){l.defaultPrevented||l.key=="Escape"&&(t("DISMISS"),l.preventDefault())}})},getGhostBeforeProps(){return n.element({"data-ghost":"before",style:O1(e.context,r)})},getGhostAfterProps(){return n.element({"data-ghost":"after",style:L1()})},getTitleProps(){return n.element({...Ho.title.attrs,id:vt.getTitleId(e.context)})},getDescriptionProps(){return n.element({...Ho.description.attrs,id:vt.getDescriptionId(e.context)})},getActionTriggerProps(){return n.button({...Ho.actionTrigger.attrs,type:"button",onClick(l){l.defaultPrevented||(e.context.action?.onClick?.(),t("DISMISS"))}})},getCloseTriggerProps(){return n.button({id:vt.getCloseTriggerId(e.context),...Ho.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(l){l.defaultPrevented||t("DISMISS")}})}}}var Ds={connect:D1,machine:G1};var uu=e=>{let t=Ds.machine({id:"1",...e});return{...Ds.connect(t,t.send,jt),machine:t}},[K1,Ur]=qe({hookName:"useToastContext",providerName:"<ToastProvider />"}),Gh=e=>{let t=Ur(),n=oe(()=>t().getActionTriggerProps(),e);return m(be.button,n)},Hh=e=>{let t=Ur(),n=oe(()=>t().getCloseTriggerProps(),e);return m(be.button,n)},Kh=e=>e.children(Ur()),Vh=e=>{let t=Ur(),n=oe(()=>t().getDescriptionProps(),e);return m(be.div,n)},V1=C("<div><div></div><div>"),jh=e=>{let t=Ur(),n=oe(()=>t().getRootProps(),e);return(()=>{var r=V1(),o=r.firstChild,a=o.nextSibling;return ke(r,n,!1,!0),ke(o,Ee(()=>t().getGhostBeforeProps()),!1,!1),x(r,()=>e.children,a),ke(a,Ee(()=>t().getGhostAfterProps()),!1,!1),r})()},zh=e=>{let t=Ur(),n=oe(()=>t().getTitleProps(),e);return m(be.div,n)},du=e=>{let[t,n]=ze(e,["toaster","children"]),[r,o]=xn(t.toaster.machine),a=r.context.placement,i=F(()=>Ds.connect(r,o,jt)),s=F(()=>i().getToastsByPlacement(a)),c=oe(i().getGroupProps({placement:a}),n);return m(be.div,Ee(c,{get children(){return m(we,{get each(){return s()},children:l=>m(j1,{value:l,children:u=>t.children(u)})})}}))},j1=e=>{let[t,n]=mg(e.value),r=F(()=>$h(t,n,jt)),o=F(()=>t.context);return m(K1,{value:r,get children(){return e.children(o)}})},Fr={};dr(Fr,{ActionTrigger:()=>Gh,CloseTrigger:()=>Hh,Context:()=>Kh,Description:()=>Vh,Root:()=>jh,Title:()=>zh});var Ya=(e,t)=>({x:e,y:t});function z1(e){let{x:t,y:n,width:r,height:o}=e,a=t+r/2,i=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:a,midY:i,center:Ya(a,i)}}function W1(e){let t=Ya(e.minX,e.minY),n=Ya(e.maxX,e.minY),r=Ya(e.maxX,e.maxY),o=Ya(e.minX,e.maxY);return{top:t,right:n,bottom:r,left:o}}var{min:WL,max:ZL}=Math;function Wh(e,t){let n=z1(e),{top:r,right:o,left:a,bottom:i}=W1(n),[s]=t.split("-");return{top:[a,r,o,i],right:[r,o,i,a],bottom:[r,a,i,o],left:[o,r,a,i]}[s]}function Zh(e,t){let{x:n,y:r}=t,o=!1;for(let a=0,i=e.length-1;a<e.length;i=a++){let s=e[a].x,c=e[a].y,l=e[i].x,u=e[i].y;c>r!=u>r&&n<(l-s)*(r-c)/(u-c)+s&&(o=!o)}return o}var{sign:YL,abs:qL,min:JL}=Math;var qh=on("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Ct=qh.build(),X=ur({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,getContentEl:e=>X.getById(e,X.getContentId(e)),getPositionerEl:e=>X.getById(e,X.getPositionerId(e)),getTriggerEl:e=>X.getById(e,X.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?X.getById(e,e.highlightedValue):null,getArrowEl:e=>X.getById(e,X.getArrowId(e)),getElements:e=>{let n=`[role^="menuitem"][data-ownedby=${CSS.escape(X.getContentId(e))}]:not([data-disabled])`;return Ss(X.getContentEl(e),n)},getFirstEl:e=>Zm(X.getElements(e)),getLastEl:e=>Ym(X.getElements(e)),getNextEl:(e,t)=>kg(X.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>Ag(X.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>Xc(X.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>dt(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl(e){return{id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type}}});function Jh(e,t,n){let r=e.context.isSubmenu,o=e.context.isTypingAhead,a=e.context.composite,i=e.hasTag("open"),s=Ch({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function c(d){return{disabled:!!d.disabled,highlighted:e.context.highlightedValue===d.value}}function l(d){let p=d.valueText??d.value;return{...d,id:d.value,valueText:p}}function u(d){return{...c(l(d)),checked:!!d.checked}}function f(d){let{value:p,closeOnSelect:h,valueText:g}=d,y=c(d);return n.element({...Ct.item.attrs,id:p,role:"menuitem","aria-disabled":y.disabled,"data-disabled":Mt(y.disabled),"data-ownedby":X.getContentId(e.context),"data-highlighted":Mt(y.highlighted),"data-valuetext":g,onDragStart(b){b.currentTarget.matches("a[href]")&&b.preventDefault()},onPointerMove(b){if(y.disabled||b.pointerType!=="mouse")return;let T=b.currentTarget;y.highlighted||t({type:"ITEM_POINTERMOVE",id:p,target:T,closeOnSelect:h})},onPointerLeave(b){if(y.disabled||b.pointerType!=="mouse"||!e.previousEvent.type.includes("POINTER"))return;let S=b.currentTarget;t({type:"ITEM_POINTERLEAVE",id:p,target:S,closeOnSelect:h})},onPointerDown(b){if(y.disabled)return;let T=b.currentTarget;t({type:"ITEM_POINTERDOWN",target:T,id:p,closeOnSelect:h})},onClick(b){if(Yc(b)||Zc(b)||y.disabled)return;let T=b.currentTarget;t({type:"ITEM_CLICK",target:T,id:p,closeOnSelect:h})}})}return{highlightedValue:e.context.highlightedValue,open:i,setOpen(d){d!==i&&t(d?"OPEN":"CLOSE")},setHighlightedValue(d){t({type:"HIGHLIGHTED.SET",id:d})},setParent(d){t({type:"PARENT.SET",value:d,id:d.state.context.id})},setChild(d){t({type:"CHILD.SET",value:d,id:d.state.context.id})},reposition(d={}){t({type:"POSITIONING.SET",options:d})},getContextTriggerProps(){return n.element({...Ct.contextTrigger.attrs,dir:e.context.dir,id:X.getContextTriggerId(e.context),onPointerDown(d){if(d.pointerType==="mouse")return;let p=Ns(d);t({type:"CONTEXT_MENU_START",point:p})},onPointerCancel(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onPointerMove(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onPointerUp(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onContextMenu(d){let p=Ns(d);t({type:"CONTEXT_MENU",point:p}),d.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(d){return ys(f({value:d.getTriggerProps().id}),d.getTriggerProps())},getTriggerProps(){return n.button({...r?Ct.triggerItem.attrs:Ct.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:X.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":a?"menu":"dialog","aria-controls":X.getContentId(e.context),"aria-expanded":i||void 0,"data-state":i?"open":"closed",onPointerMove(d){d.pointerType!=="mouse"||X.isTargetDisabled(d.currentTarget)||!r||t({type:"TRIGGER_POINTERMOVE",target:d.currentTarget})},onPointerLeave(d){if(X.isTargetDisabled(d.currentTarget)||d.pointerType!=="mouse"||!r)return;let p=Ns(d);t({type:"TRIGGER_POINTERLEAVE",target:d.currentTarget,point:p})},onPointerDown(d){X.isTargetDisabled(d.currentTarget)||Rs(d)||d.preventDefault()},onClick(d){d.defaultPrevented||X.isTargetDisabled(d.currentTarget)||t({type:"TRIGGER_CLICK",target:d.currentTarget})},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(d){if(d.defaultPrevented)return;let p={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}},h=lu(d,e.context),g=p[h];g&&(d.preventDefault(),g(d))}})},getIndicatorProps(){return n.element({...Ct.indicator.attrs,dir:e.context.dir,"data-state":i?"open":"closed"})},getPositionerProps(){return n.element({...Ct.positioner.attrs,dir:e.context.dir,id:X.getPositionerId(e.context),style:s.floating})},getArrowProps(){return n.element({id:X.getArrowId(e.context),...Ct.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return n.element({...Ct.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getContentProps(){return n.element({...Ct.content.attrs,id:X.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!i,"data-state":i?"open":"closed",role:a?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":X.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(d){d.pointerType==="mouse"&&t("MENU_POINTERENTER")},onKeyDown(d){if(d.defaultPrevented||!Eg(d))return;let p=Sn(d);if(!(p?.closest("[role=menu]")===d.currentTarget||p===d.currentTarget))return;if(d.key==="Tab"&&!Mg(d)){d.preventDefault();return}let g=X.getHighlightedItemEl(e.context),y={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),Ph(g)},Space(S){o?t({type:"TYPEAHEAD",key:S.key}):y.Enter?.(S)},Home(){t("HOME")},End(){t("END")}},b=lu(d,{dir:e.context.dir}),T=y[b];if(T){T(d),d.stopPropagation(),d.preventDefault();return}e.context.typeahead&&kh(d)&&(Ah(d)||eu(p)||(t({type:"TYPEAHEAD",key:d.key}),d.preventDefault()))}})},getSeparatorProps(){return n.element({...Ct.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"})},getItemState:c,getItemProps:f,getOptionItemState:u,getOptionItemProps(d){let{type:p,disabled:h,onCheckedChange:g,closeOnSelect:y}=d,b=l(d),T=u(d);return{...f(b),...n.element({"data-type":p,...Ct.item.attrs,dir:e.context.dir,"data-value":b.value,role:`menuitem${p}`,"aria-checked":!!T.checked,"data-state":T.checked?"checked":"unchecked",onClick(S){if(h||Yc(S)||Zc(S))return;let k=S.currentTarget;t({type:"ITEM_CLICK",target:k,option:b,closeOnSelect:y}),g?.(!T.checked)}})}},getItemIndicatorProps(d){let p=u(d);return n.element({...Ct.itemIndicator.attrs,dir:e.context.dir,"data-disabled":Mt(p.disabled),"data-highlighted":Mt(p.highlighted),"data-state":p.checked?"checked":"unchecked",hidden:!p.checked})},getItemTextProps(d){let p=u(d);return n.element({...Ct.itemText.attrs,dir:e.context.dir,"data-disabled":Mt(p.disabled),"data-highlighted":Mt(p.highlighted),"data-state":p.checked?"checked":"unchecked"})},getItemGroupLabelProps(d){return n.element({id:X.getGroupLabelId(e.context,d.htmlFor),dir:e.context.dir,...Ct.itemGroupLabel.attrs})},getItemGroupProps(d){return n.element({id:X.getGroupId(e.context,d.id),...Ct.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":X.getGroupLabelId(e.context,d.id),role:"group"})}}}var{not:Yt,and:Ko,or:Z1}=bs;function Xh(e){let t=yt(e);return nn({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:Kt(Bt({})),suspendPointer:!1,restoreFocus:!0,typeaheadState:Xc.defaultOptions},computed:{isSubmenu:n=>n.parent!==null,isRtl:n=>n.dir==="rtl",isTypingAhead:n=>n.typeaheadState.keysSoFar!==""},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:Yt("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:Z1("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Ko(Yt("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:Yt("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Ko("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:Yt("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:Ko(Yt("suspendPointer"),Yt("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:Ko(Yt("isTriggerItemHighlighted"),Yt("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Ko(Yt("isTriggerItemHighlighted"),Yt("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Ko(Yt("isTriggerItemHighlighted"),Yt("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(n,r)=>!!(r?.closeOnSelect??n.closeOnSelect),isTriggerItem:(n,r)=>X.isTriggerItem(r.target),isTriggerItemHighlighted:(n,r)=>!!(r.target??X.getHighlightedItemEl(n))?.hasAttribute("aria-controls"),isSubmenu:n=>n.isSubmenu,suspendPointer:n=>n.suspendPointer,isHighlightedItemEditable:n=>eu(X.getHighlightedItemEl(n)),isWithinPolygon:(n,r)=>n.intentPolygon?Zh(n.intentPolygon,r.point):!1,isOpenControlled:n=>!!n["open.controlled"],isArrowLeftEvent:(n,r)=>r.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:(n,r)=>r.previousEvent?.type==="ARROW_UP",isArrowDownEvent:(n,r)=>r.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:(n,r)=>r.previousEvent?.type==="OPEN_AUTOFOCUS"},activities:{trackPositioning(n){if(n.anchorPoint)return;n.currentPlacement=n.positioning.placement;let r=()=>X.getPositionerEl(n);return iu(X.getTriggerEl(n),r,{...n.positioning,defer:!0,onComplete(o){n.currentPlacement=o.placement}})},trackInteractOutside(n,r,{send:o}){return Os(()=>X.getContentEl(n),{defer:!0,exclude:[X.getTriggerEl(n)],onInteractOutside:n.onInteractOutside,onFocusOutside:n.onFocusOutside,onEscapeKeyDown(i){n.onEscapeKeyDown?.(i),n.isSubmenu&&i.preventDefault(),Yh(n)},onPointerDownOutside(i){n.restoreFocus=!i.detail.focusable,n.onPointerDownOutside?.(i)},onDismiss(){o({type:"CLOSE",src:"interact-outside"})}})},trackPointerMove(n,r,{guards:o,send:a}){let{isWithinPolygon:i}=o;n.parent.state.context.suspendPointer=!0;let s=X.getDoc(n);return ln(s,"pointermove",c=>{let l={x:c.clientX,y:c.clientY};i(n,{point:l})||(a("POINTER_MOVED_AWAY_FROM_SUBMENU"),n.parent.state.context.suspendPointer=!1)})},scrollToHighlightedItem(n,r,{getState:o}){let a=()=>{if(o().event.type.startsWith("ITEM_POINTER"))return;let c=X.getHighlightedItemEl(n),l=X.getContentEl(n);Lg(c,{rootEl:l,block:"nearest"})};return Je(()=>a()),Og(()=>X.getContentEl(n),{defer:!0,attributes:["aria-activedescendant"],callback:a})}},actions:{setAnchorPoint(n,r){n.anchorPoint=r.point},setSubmenuPlacement(n){n.isSubmenu&&(n.positioning.placement=n.isRtl?"left-start":"right-start",n.positioning.gutter=0)},reposition(n,r){let o=()=>X.getPositionerEl(n),a=n.anchorPoint?()=>({width:0,height:0,...n.anchorPoint}):void 0;iu(X.getTriggerEl(n),o,{...n.positioning,defer:!0,getAnchorRect:a,...r.options??{},listeners:!1,onComplete(i){n.currentPlacement=i.placement}})},setOptionState(n,r){if(!r.option)return;let{checked:o,onCheckedChange:a,type:i}=r.option;i==="radio"?a?.(!0):i==="checkbox"&&a?.(!o)},clickHighlightedItem(n,r){let o=X.getHighlightedItemEl(n);!o||o.dataset.disabled||queueMicrotask(()=>o.click())},setIntentPolygon(n,r){let o=X.getContentEl(n),a=n.currentPlacement;if(!o||!a)return;let i=o.getBoundingClientRect(),s=Wh(i,a);if(!s)return;let l=Sh(a)==="right"?-5:5;n.intentPolygon=[{...r.point,x:r.point.x+l},...s]},clearIntentPolygon(n){n.intentPolygon=null},resumePointer(n){n.parent&&(n.parent.state.context.suspendPointer=!1)},setHighlightedItem(n,r){fr.highlighted(n,r.id)},clearHighlightedItem(n){fr.highlighted(n,null)},focusMenu(n){Je(()=>{let r=X.getContentEl(n);_g({root:r,enabled:!zt(r,X.getActiveElement(n)),filter(a){return!a.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem(n){(X.getContentEl(n)?queueMicrotask:Je)(()=>{let o=X.getFirstEl(n);o&&fr.highlighted(n,o.id)})},highlightLastItem(n){(X.getContentEl(n)?queueMicrotask:Je)(()=>{let o=X.getLastEl(n);o&&fr.highlighted(n,o.id)})},highlightNextItem(n,r){let o=X.getNextEl(n,r.loop);fr.highlighted(n,o?.id??null)},highlightPrevItem(n,r){let o=X.getPrevEl(n,r.loop);fr.highlighted(n,o?.id??null)},invokeOnSelect(n){n.highlightedValue&&n.onSelect?.({value:n.highlightedValue})},focusTrigger(n){n.isSubmenu||n.anchorPoint||!n.restoreFocus||queueMicrotask(()=>X.getTriggerEl(n)?.focus({preventScroll:!0}))},highlightMatchedItem(n,r){let o=X.getElemByKey(n,r.key);o&&fr.highlighted(n,o.id)},setParentMenu(n,r){n.parent=Bt(r.value)},setChildMenu(n,r){n.children[r.id]=Bt(r.value)},closeRootMenu(n){Yh(n)},openSubmenu(n){let o=X.getHighlightedItemEl(n)?.getAttribute("data-uid");(o?n.children[o]:null)?.send("OPEN_AUTOFOCUS")},focusParentMenu(n){n.parent?.send("FOCUS_MENU")},setLastHighlightedItem(n,r){n.lastHighlightedValue=r.id},restoreHighlightedItem(n){n.lastHighlightedValue&&(fr.highlighted(n,n.lastHighlightedValue),n.lastHighlightedValue=null)},restoreParentHiglightedItem(n){n.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(n){n.onOpenChange?.({open:!0})},invokeOnClose(n){n.onOpenChange?.({open:!1})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}function Yh(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var fr={highlighted(e,t){gs(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}},Y1=Vt()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),lD=vn(Y1),q1=Vt()(["closeOnSelect","disabled","value","valueText"]),cD=vn(q1),J1=Vt()(["htmlFor"]),uD=vn(J1),X1=Vt()(["id"]),dD=vn(X1),Q1=Vt()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]),fD=vn(Q1);var[Qh,et]=qe({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),eb=e=>{let t=et(),n=oe(()=>t().getArrowProps(),e);return m(be.div,n)},tb=e=>{let t=et(),n=oe(()=>t().getArrowTipProps(),e);return m(be.div,n)},[fu,nb]=qe({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[rb,ob]=qe({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),ab=e=>{let[t,n]=ut()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=oe(t,{type:"checkbox"}),o=et(),a=oe(()=>o().getOptionItemProps(r),n),i=F(()=>o().getItemState(r));return m(rb,{value:r,get children(){return m(fu,{value:i,get children(){return m(be.div,a)}})}})},ib=e=>{let t=et(),n=cr(),r=oe(()=>t().getContentProps(),()=>n().presenceProps,e);return m(B,{get when(){return!n().unmounted},get children(){return m(be.div,r)}})},sb=e=>e.children(et()),lb=e=>{let t=et(),n=oe(()=>t().getContextTriggerProps(),e);return m(be.button,n)},cb=e=>{let t=et(),n=oe(()=>t().getIndicatorProps(),e);return m(be.div,n)},ub=e=>{let[t,n]=ut()(e,["closeOnSelect","disabled","value","valueText"]),r=et(),o=oe(()=>r().getItemProps(t),n),a=F(()=>r().getItemState(t));return m(fu,{value:a,get children(){return m(be.div,o)}})},db=e=>e.children(nb()),[fb,pb]=qe({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),mb=e=>{let[t,n]=ut()(e,["id"]),r=oe({id:mn()},t),o=et(),a=oe(()=>o().getItemGroupProps(r),n);return m(fb,{value:r,get children(){return m(be.div,a)}})},gb=e=>{let t=et(),n=pb(),r=oe(t().getItemGroupLabelProps({htmlFor:n.id}),e);return m(be.div,r)},hb=e=>{let t=et(),n=ob(),r=oe(()=>t().getItemIndicatorProps(n),e);return m(be.div,r)},bb=e=>{let t=et(),n=ob(),r=oe(()=>t().getItemTextProps(n),e);return m(be.div,r)},yb=e=>{let t=et(),n=cr(),r=oe(()=>t().getPositionerProps(),e);return m(B,{get when(){return!n().unmounted},get children(){return m(be.div,r)}})},vb=e=>{let[t,n]=ut()(e,["closeOnSelect","disabled","value","valueText"]),r=et(),o=pb(),a=oe(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),i=oe(()=>r().getOptionItemProps(a),n),s=F(()=>r().getOptionItemState(a));return m(rb,{value:a,get children(){return m(fu,{value:s,get children(){return m(be.div,i)}})}})},xb=e=>{let[t,n]=ut()(e,["id","onValueChange","value"]),r=et(),o=oe({id:mn()},t),a=oe(()=>r().getItemGroupProps(o),n);return m(fb,{value:o,get children(){return m(be.div,a)}})},wb=e=>{let t=Do(),n=Mr(),r=mn(),o=F(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[a,i,s]=xn(Xh(o()),{context:o});return{api:F(()=>Jh(a,i,jt)),machine:s}},[Sb,Tb]=qe({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[Cb,tA]=qe({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),Eb=e=>{let[t,n]=Oo(e),[r,o]=ut()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),a=et(),i=Tb(),s=wb(r),c=_r(oe(t,()=>({present:s.api().open})));return xe(()=>{i&&(a?.().setChild(s.machine),s.api().setParent(i))}),m(Cb,{value:()=>a?.().getTriggerItemProps(s.api()),get children(){return m(Sb,{get value(){return s.machine},get children(){return m(Qh,{get value(){return s.api},get children(){return m(Lo,{value:c,get children(){return o.children}})}})}})}})},kb=e=>{let t=et(),n=Tb(),[r,o]=Oo(e),a=_r(oe(r,()=>({present:o.value.api().open})));return xe(()=>{n&&(t?.().setChild(o.value.machine),o.value.api().setParent(n))}),m(Cb,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(Sb,{get value(){return o.value.machine},get children(){return m(Qh,{get value(){return o.value.api},get children(){return m(Lo,{value:a,get children(){return o.children}})}})}})}})},Ab=e=>{let t=et(),n=oe(()=>t().getSeparatorProps(),e);return m(be.hr,n)},Pb=e=>{let t=et(),n=cr(),r=oe(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(be.button,r)},Ib=e=>{let t=tA(),n=oe(()=>t?.(),e);return m(be.div,n)},Hn={};dr(Hn,{Arrow:()=>eb,ArrowTip:()=>tb,CheckboxItem:()=>ab,Content:()=>ib,Context:()=>sb,ContextTrigger:()=>lb,Indicator:()=>cb,Item:()=>ub,ItemContext:()=>db,ItemGroup:()=>mb,ItemGroupLabel:()=>gb,ItemIndicator:()=>hb,ItemText:()=>bb,Positioner:()=>yb,RadioItem:()=>vb,RadioItemGroup:()=>xb,Root:()=>Eb,RootProvider:()=>kb,Separator:()=>Ab,Trigger:()=>Pb,TriggerItem:()=>Ib});var _b=on("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Kn=_b.build(),Bs=ur({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function Mb(e,t,n){let r=e.context.percent,o=e.context.isIndeterminate?"":`${r}%`,a=e.context.max,i=e.context.min,s=e.context.orientation,c=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,f=c.value({value:u,max:a,percent:r,min:i}),d=nA(u,a),p={role:"progressbar","aria-label":f,"data-max":a,"aria-valuemin":i,"aria-valuemax":a,"aria-valuenow":u??void 0,"data-orientation":s,"data-state":d},h=rA(e.context);return{value:u,valueAsString:f,min:i,max:a,percent:r,percentAsString:o,indeterminate:l,setValue(g){t({type:"VALUE.SET",value:g})},setToMax(){t({type:"VALUE.SET",value:a})},setToMin(){t({type:"VALUE.SET",value:i})},getRootProps(){return n.element({dir:e.context.dir,...Kn.root.attrs,id:Bs.getRootId(e.context),"data-max":a,"data-value":u??void 0,"data-state":d,"data-orientation":s,style:{"--percent":l?void 0:r}})},getLabelProps(){return n.element({dir:e.context.dir,id:Bs.getLabelId(e.context),...Kn.label.attrs,"data-orientation":s})},getValueTextProps(){return n.element({dir:e.context.dir,"aria-live":"polite",...Kn.valueText.attrs})},getTrackProps(){return n.element({dir:e.context.dir,id:Bs.getTrackId(e.context),...Kn.track.attrs,...p})},getRangeProps(){return n.element({dir:e.context.dir,...Kn.range.attrs,"data-orientation":s,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${r}%`}})},getCircleProps(){return n.element({dir:e.context.dir,id:Bs.getCircleId(e.context),...Kn.circle.attrs,...p,...h.root})},getCircleTrackProps(){return n.element({dir:e.context.dir,"data-orientation":s,...Kn.circleTrack.attrs,...h.track})},getCircleRangeProps(){return n.element({dir:e.context.dir,...Kn.circleRange.attrs,...h.range,"data-state":d})},getViewProps(g){return n.element({dir:e.context.dir,...Kn.view.attrs,"data-state":g.state,hidden:g.state!==d})}}}function nA(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function rA(e){let t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:e.value===0?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}function oA(e,t){return e+(t-e)/2}function Rb(e){let t=yt(e);return nn({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:oA(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:n=>n.value===null,percent(n){return $a(n.value)?Math.round((n.value-n.min)/(n.max-n.min)*100):-1},isAtMax:n=>n.value===n.max,isHorizontal:n=>n.orientation==="horizontal",isRtl:n=>n.dir==="rtl"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(n,r)=>{n.value=r.value===null?null:Math.max(0,Math.min(r.value,n.max))},validateContext:n=>{if(n.value!=null){if(!pu(n.max))throw new Error(`[progress] The max value passed \`${n.max}\` is not a valid number`);if(!aA(n.value,n.max))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the max value \`${n.max}\``);if(!iA(n.value,n.min))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the min value \`${n.min}\``)}}}})}function pu(e){return $a(e)&&!isNaN(e)}function aA(e,t){return pu(e)&&e<=t}function iA(e,t){return pu(e)&&e>=t}var sA=Vt()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]),ID=vn(sA);var[Nb,kn]=qe({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),Ob=e=>{let t=kn(),n=oe(()=>t().getCircleProps(),e);return m(be.svg,n)},Lb=e=>{let t=kn(),n=oe(()=>t().getCircleRangeProps(),e);return m(be.circle,n)},Db=e=>{let t=kn(),n=oe(()=>t().getCircleTrackProps(),e);return m(be.circle,n)},Bb=e=>e.children(kn()),Ub=e=>{let t=kn(),n=oe(()=>t().getLabelProps(),e);return m(be.label,n)},Fb=e=>{let t=kn(),n=oe(()=>t().getRangeProps(),e);return m(be.div,n)},$b=e=>{let t=Do(),n=Mr(),r=mn(),o=F(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,...e})),[a,i]=xn(Rb(o()),{context:o});return F(()=>Mb(a,i,jt))},Gb=e=>{let[t,n]=ut()(e,["id","ids","max","min","orientation","translations","value"]),r=$b(t),o=oe(()=>r().getRootProps(),n);return m(Nb,{value:r,get children(){return m(be.div,o)}})},Hb=e=>{let[{value:t},n]=ut()(e,["value"]),r=oe(()=>t().getRootProps(),n);return m(Nb,{value:t,get children(){return m(be.div,r)}})},Kb=e=>{let t=kn(),n=oe(()=>t().getTrackProps(),e);return m(be.div,n)},Vb=e=>{let t=kn(),n=oe(()=>t().getValueTextProps(),e);return m(be.span,Ee(n,{get children(){return e.children||t().percentAsString}}))},jb=e=>{let[t,n]=ut()(e,["state"]),r=kn(),o=oe(()=>r().getViewProps(t),n);return m(be.span,o)},$r={};dr($r,{Circle:()=>Ob,CircleRange:()=>Lb,CircleTrack:()=>Db,Context:()=>Bb,Label:()=>Ub,Range:()=>Fb,Root:()=>Gb,RootProvider:()=>Hb,Track:()=>Kb,ValueText:()=>Vb,View:()=>jb});var cA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vo=new WeakMap,Us=new WeakMap,Fs={},mu=0,zb=function(e){return e&&(e.host||zb(e.parentNode))},uA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=zb(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dA=function(e,t,n,r){var o=uA(t,Array.isArray(e)?e:[e]);Fs[n]||(Fs[n]=new WeakMap);var a=Fs[n],i=[],s=new Set,c=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};o.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))u(d);else try{var p=d.getAttribute(r),h=p!==null&&p!=="false",g=(Vo.get(d)||0)+1,y=(a.get(d)||0)+1;Vo.set(d,g),a.set(d,y),i.push(d),g===1&&h&&Us.set(d,!0),y===1&&d.setAttribute(n,"true"),h||d.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",d,b)}})};return u(t),s.clear(),mu++,function(){i.forEach(function(f){var d=Vo.get(f)-1,p=a.get(f)-1;Vo.set(f,d),a.set(f,p),d||(Us.has(f)||f.removeAttribute(r),Us.delete(f)),p||f.removeAttribute(n)}),mu--,mu||(Vo=new WeakMap,Vo=new WeakMap,Us=new WeakMap,Fs={})}},Wb=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||cA(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),dA(r,o,n,"aria-hidden")):function(){return null}};var fA=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function Zb(e,t={}){let{defer:n=!0}=t,r=n?fA:a=>a(),o=[];return o.push(r(()=>{let i=(typeof e=="function"?e():e).filter(Boolean);o.push(Wb(i))})),()=>{o.forEach(a=>a?.())}}var gu="data-scroll-lock";function Yb(e,t){if(!e)return;let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function pA(e,t,n){if(!e)return;let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}function mA(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function qb(e){let t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(gu))return;o.setAttribute(gu,"");let i=n.innerWidth-r.clientWidth,s=()=>pA(r,"--scrollbar-width",`${i}px`),c=mA(r),l=()=>Yb(o,{overflow:"hidden",[c]:`${i}px`}),u=()=>{let{scrollX:d,scrollY:p,visualViewport:h}=n,g=h?.offsetLeft??0,y=h?.offsetTop??0,b=Yb(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(y))}px`,left:`${-(d-Math.floor(g))}px`,right:"0",[c]:`${i}px`});return()=>{b?.(),n.scrollTo({left:d,top:p,behavior:"instant"})}},f=[s(),Cg()?u():l()];return()=>{f.forEach(d=>d?.()),o.removeAttribute(gu)}}var Xb=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],$s=Xb.join(","),Qb=typeof Element>"u",Gr=Qb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gs=!Qb&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Hs=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=o===""||o==="true",i=a||n&&t&&e(t.parentNode);return i},gA=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},ey=function(t,n,r){if(Hs(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll($s));return n&&Gr.call(t,$s)&&o.unshift(t),o=o.filter(r),o},ty=function e(t,n,r){for(var o=[],a=Array.from(t);a.length;){var i=a.shift();if(!Hs(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),c=s.length?s:i.children,l=e(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=Gr.call(i,$s);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),d=!Hs(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&d){var p=e(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else a.unshift.apply(a,i.children)}}return o},ny=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gA(t))&&!ny(t)?0:t.tabIndex},hA=function(t,n){var r=pr(t);return r<0&&n&&!ny(t)?0:r},bA=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ry=function(t){return t.tagName==="INPUT"},yA=function(t){return ry(t)&&t.type==="hidden"},vA=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},xA=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},wA=function(t){if(!t.name)return!0;var n=t.form||Gs(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var a=xA(o,t.form);return!a||a===t},SA=function(t){return ry(t)&&t.type==="radio"},TA=function(t){return SA(t)&&!wA(t)},CA=function(t){var n,r=t&&Gs(t),o=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var i,s,c;for(a=!!((i=o)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!a&&o;){var l,u,f;r=Gs(o),o=(l=r)===null||l===void 0?void 0:l.host,a=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return a},Jb=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},EA=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=Gr.call(t,"details>summary:first-of-type"),i=a?t.parentElement:t;if(Gr.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var c=t.parentElement,l=Gs(t);if(c&&!c.shadowRoot&&o(c)===!0)return Jb(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=s}if(CA(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Jb(t);return!1},kA=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Gr.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ks=function(t,n){return!(n.disabled||Hs(n)||yA(n)||EA(n,t)||vA(n)||kA(n))},hu=function(t,n){return!(TA(n)||pr(n)<0||!Ks(t,n))},AA=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},PA=function e(t){var n=[],r=[];return t.forEach(function(o,a){var i=!!o.scopeParent,s=i?o.scopeParent:o,c=hA(s,i),l=i?e(o.candidates):s;c===0?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:a,tabIndex:c,item:o,isScope:i,content:l})}),r.sort(bA).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(n)},oy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ty([t],n.includeContainer,{filter:hu.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:AA}):r=ey(t,n.includeContainer,hu.bind(null,n)),PA(r)},ay=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ty([t],n.includeContainer,{filter:Ks.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ey(t,n.includeContainer,Ks.bind(null,n)),r},Hr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Gr.call(t,$s)===!1?!1:hu(n,t)},IA=Xb.concat("iframe").join(","),Vs=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Gr.call(t,IA)===!1?!1:Ks(n,t)};function _A(e,t,n){return(t=RA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iy(Object(n),!0).forEach(function(r){_A(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MA(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RA(e){var t=MA(e,"string");return typeof t=="symbol"?t:t+""}var ly={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},NA=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},OA=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Ja=function(t){return t?.key==="Tab"||t?.keyCode===9},LA=function(t){return Ja(t)&&!t.shiftKey},DA=function(t){return Ja(t)&&t.shiftKey},cy=function(t){return setTimeout(t,0)},uy=function(t,n){var r=-1;return t.every(function(o,a){return n(o)?(r=a,!1):!0}),r},qa=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},js=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},BA=[],dy=function(t,n){var r=n?.document||document,o=n?.trapStack||BA,a=sy({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:LA,isKeyBackward:DA},n),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,c=function(E,w,N){return E&&E[w]!==void 0?E[w]:a[N||w]},l=function(E,w){var N=typeof w?.composedPath=="function"?w.composedPath():void 0;return i.containerGroups.findIndex(function(_){var ee=_.container,me=_.tabbableNodes;return ee.contains(E)||N?.includes(ee)||me.find(function(ge){return ge===E})})},u=function(E){var w=a[E];if(typeof w=="function"){for(var N=arguments.length,_=new Array(N>1?N-1:0),ee=1;ee<N;ee++)_[ee-1]=arguments[ee];w=w.apply(void 0,_)}if(w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var me=w;if(typeof w=="string"&&(me=r.querySelector(w),!me))throw new Error("`".concat(E,"` as selector refers to no known node"));return me},f=function(){var E=u("initialFocus");if(E===!1)return!1;if(E===void 0||!Vs(E,a.tabbableOptions))if(l(r.activeElement)>=0)E=r.activeElement;else{var w=i.tabbableGroups[0],N=w&&w.firstTabbableNode;E=N||u("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},d=function(){if(i.containerGroups=i.containers.map(function(E){var w=oy(E,a.tabbableOptions),N=ay(E,a.tabbableOptions),_=w.length>0?w[0]:void 0,ee=w.length>0?w[w.length-1]:void 0,me=N.find(function(Ae){return Hr(Ae)}),ge=N.slice().reverse().find(function(Ae){return Hr(Ae)}),Ne=!!w.find(function(Ae){return pr(Ae)>0});return{container:E,tabbableNodes:w,focusableNodes:N,posTabIndexesFound:Ne,firstTabbableNode:_,lastTabbableNode:ee,firstDomTabbableNode:me,lastDomTabbableNode:ge,nextTabbableNode:function(Ot){var qt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Et=w.indexOf(Ot);return Et<0?qt?N.slice(N.indexOf(Ot)+1).find(function(fn){return Hr(fn)}):N.slice(0,N.indexOf(Ot)).reverse().find(function(fn){return Hr(fn)}):w[Et+(qt?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(E){return E.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(E){var w=E.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?p(w.shadowRoot):w},h=function(E){if(E!==!1&&E!==p(document)){if(!E||!E.focus){h(f());return}E.focus({preventScroll:!!a.preventScroll}),i.mostRecentlyFocusedNode=E,NA(E)&&E.select()}},g=function(E){var w=u("setReturnFocus",E);return w||(w===!1?!1:E)},y=function(E){var w=E.target,N=E.event,_=E.isBackward,ee=_===void 0?!1:_;w=w||js(N),d();var me=null;if(i.tabbableGroups.length>0){var ge=l(w,N),Ne=ge>=0?i.containerGroups[ge]:void 0;if(ge<0)ee?me=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:me=i.tabbableGroups[0].firstTabbableNode;else if(ee){var Ae=uy(i.tabbableGroups,function(na){var ra=na.firstTabbableNode;return w===ra});if(Ae<0&&(Ne.container===w||Vs(w,a.tabbableOptions)&&!Hr(w,a.tabbableOptions)&&!Ne.nextTabbableNode(w,!1))&&(Ae=ge),Ae>=0){var Ot=Ae===0?i.tabbableGroups.length-1:Ae-1,qt=i.tabbableGroups[Ot];me=pr(w)>=0?qt.lastTabbableNode:qt.lastDomTabbableNode}else Ja(N)||(me=Ne.nextTabbableNode(w,!1))}else{var Et=uy(i.tabbableGroups,function(na){var ra=na.lastTabbableNode;return w===ra});if(Et<0&&(Ne.container===w||Vs(w,a.tabbableOptions)&&!Hr(w,a.tabbableOptions)&&!Ne.nextTabbableNode(w))&&(Et=ge),Et>=0){var fn=Et===i.tabbableGroups.length-1?0:Et+1,ta=i.tabbableGroups[fn];me=pr(w)>=0?ta.firstTabbableNode:ta.firstDomTabbableNode}else Ja(N)||(me=Ne.nextTabbableNode(w))}}else me=u("fallbackFocus");return me},b=function(E){var w=js(E);if(!(l(w,E)>=0)){if(qa(a.clickOutsideDeactivates,E)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}qa(a.allowOutsideClick,E)||E.preventDefault()}},T=function(E){var w=js(E),N=l(w,E)>=0;if(N||w instanceof Document)N&&(i.mostRecentlyFocusedNode=w);else{E.stopImmediatePropagation();var _,ee=!0;if(i.mostRecentlyFocusedNode)if(pr(i.mostRecentlyFocusedNode)>0){var me=l(i.mostRecentlyFocusedNode),ge=i.containerGroups[me].tabbableNodes;if(ge.length>0){var Ne=ge.findIndex(function(Ae){return Ae===i.mostRecentlyFocusedNode});Ne>=0&&(a.isKeyForward(i.recentNavEvent)?Ne+1<ge.length&&(_=ge[Ne+1],ee=!1):Ne-1>=0&&(_=ge[Ne-1],ee=!1))}}else i.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(Ot){return pr(Ot)>0})})||(ee=!1);else ee=!1;ee&&(_=y({target:i.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(i.recentNavEvent)})),h(_||i.mostRecentlyFocusedNode||f())}i.recentNavEvent=void 0},S=function(E){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=E;var N=y({event:E,isBackward:w});N&&(Ja(E)&&E.preventDefault(),h(N))},k=function(E){(a.isKeyForward(E)||a.isKeyBackward(E))&&S(E,a.isKeyBackward(E))},I=function(E){OA(E)&&qa(a.escapeDeactivates,E)!==!1&&(E.preventDefault(),s.deactivate())},$=function(E){var w=js(E);l(w,E)>=0||qa(a.clickOutsideDeactivates,E)||qa(a.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},O=function(){if(i.active)return ly.activateTrap(o,s),i.delayInitialFocusTimer=a.delayInitialFocus?cy(function(){h(f())}):h(f()),r.addEventListener("focusin",T,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",$,{capture:!0,passive:!1}),r.addEventListener("keydown",k,{capture:!0,passive:!1}),r.addEventListener("keydown",I),s},Q=function(){if(i.active)return r.removeEventListener("focusin",T,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",$,!0),r.removeEventListener("keydown",k,!0),r.removeEventListener("keydown",I),s},H=function(E){var w=E.some(function(N){var _=Array.from(N.removedNodes);return _.some(function(ee){return ee===i.mostRecentlyFocusedNode})});w&&h(f())},j=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(H):void 0,L=function(){j&&(j.disconnect(),i.active&&!i.paused&&i.containers.map(function(E){j.observe(E,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(E){if(i.active)return this;var w=c(E,"onActivate"),N=c(E,"onPostActivate"),_=c(E,"checkCanFocusTrap");_||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,w?.();var ee=function(){_&&d(),O(),L(),N?.()};return _?(_(i.containers.concat()).then(ee,ee),this):(ee(),this)},deactivate:function(E){if(!i.active)return this;var w=sy({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},E);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,Q(),i.active=!1,i.paused=!1,L(),ly.deactivateTrap(o,s);var N=c(w,"onDeactivate"),_=c(w,"onPostDeactivate"),ee=c(w,"checkCanReturnFocus"),me=c(w,"returnFocus","returnFocusOnDeactivate");N?.();var ge=function(){cy(function(){me&&h(g(i.nodeFocusedBeforeActivation)),_?.()})};return me&&ee?(ee(g(i.nodeFocusedBeforeActivation)).then(ge,ge),this):(ge(),this)},pause:function(E){if(i.paused||!i.active)return this;var w=c(E,"onPause"),N=c(E,"onPostPause");return i.paused=!0,w?.(),Q(),L(),N?.(),this},unpause:function(E){if(!i.paused||!i.active)return this;var w=c(E,"onUnpause"),N=c(E,"onPostUnpause");return i.paused=!1,w?.(),d(),O(),L(),N?.(),this},updateContainerElements:function(E){var w=[].concat(E).filter(Boolean);return i.containers=w.map(function(N){return typeof N=="string"?r.querySelector(N):N}),i.active&&d(),L(),this}},s.updateContainerElements(t),s};var fy=on("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Kr=fy.build(),Te=ur({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>Te.getById(e,Te.getContentId(e)),getPositionerEl:e=>Te.getById(e,Te.getPositionerId(e)),getBackdropEl:e=>Te.getById(e,Te.getBackdropId(e)),getTriggerEl:e=>Te.getById(e,Te.getTriggerId(e)),getTitleEl:e=>Te.getById(e,Te.getTitleId(e)),getDescriptionEl:e=>Te.getById(e,Te.getDescriptionId(e)),getCloseTriggerEl:e=>Te.getById(e,Te.getCloseTriggerId(e))});function py(e,t,n){let r=e.context["aria-label"],o=e.matches("open"),a=e.context.renderedElements;return{open:o,setOpen(i){i!==o&&t(i?"OPEN":"CLOSE")},getTriggerProps(){return n.button({...Kr.trigger.attrs,dir:e.context.dir,id:Te.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":Te.getContentId(e.context),onClick(i){i.defaultPrevented||t("TOGGLE")}})},getBackdropProps(){return n.element({...Kr.backdrop.attrs,dir:e.context.dir,hidden:!o,id:Te.getBackdropId(e.context),"data-state":o?"open":"closed"})},getPositionerProps(){return n.element({...Kr.positioner.attrs,dir:e.context.dir,id:Te.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}})},getContentProps(){return n.element({...Kr.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:Te.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!a.title?void 0:Te.getTitleId(e.context),"aria-describedby":a.description?Te.getDescriptionId(e.context):void 0})},getTitleProps(){return n.element({...Kr.title.attrs,dir:e.context.dir,id:Te.getTitleId(e.context)})},getDescriptionProps(){return n.element({...Kr.description.attrs,dir:e.context.dir,id:Te.getDescriptionId(e.context)})},getCloseTriggerProps(){return n.button({...Kr.closeTrigger.attrs,dir:e.context.dir,id:Te.getCloseTriggerId(e.context),type:"button",onClick(i){i.defaultPrevented||(i.stopPropagation(),t("CLOSE"))}})}}}function my(e){let t=yt(e);return nn({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:n=>!!n["open.controlled"]},activities:{trackDismissableElement(n,r,{send:o}){return Os(()=>Te.getContentEl(n),{defer:!0,pointerBlocking:n.modal,exclude:[Te.getTriggerEl(n)],onInteractOutside(i){n.onInteractOutside?.(i),n.closeOnInteractOutside||i.preventDefault()},persistentElements:n.persistentElements,onFocusOutside:n.onFocusOutside,onPointerDownOutside:n.onPointerDownOutside,onEscapeKeyDown(i){n.onEscapeKeyDown?.(i),n.closeOnEscape||i.preventDefault()},onDismiss(){o({type:"CLOSE",src:"interact-outside"})}})},preventScroll(n){if(n.preventScroll)return qb(Te.getDoc(n))},trapFocus(n){if(!n.trapFocus||!n.modal)return;let r,o=Ng(()=>{let a=Te.getContentEl(n);if(a){r=dy(a,{document:Te.getDoc(n),escapeDeactivates:!1,preventScroll:!0,fallbackFocus:a,returnFocusOnDeactivate:n.restoreFocus,allowOutsideClick:!0,initialFocus:n.initialFocusEl?.()??void 0,setReturnFocus(i){return n.finalFocusEl?.()??i}});try{r.activate()}catch{}}});return()=>{r?.deactivate(),o()}},hideContentBelow(n){return n.modal?Zb(()=>[Te.getContentEl(n)],{defer:!0}):void 0}},actions:{setAlertDialogProps(n){n.role==="alertdialog"&&(n.initialFocusEl||(n.initialFocusEl=()=>Te.getCloseTriggerEl(n)),n.closeOnInteractOutside=!1)},checkRenderedElements(n){Je(()=>{n.renderedElements.title=!!Te.getTitleEl(n),n.renderedElements.description=!!Te.getDescriptionEl(n)})},syncZIndex(n){Je(()=>{let r=Te.getContentEl(n);if(!r)return;let a=Te.getWin(n).getComputedStyle(r);[Te.getPositionerEl(n),Te.getBackdropEl(n)].forEach(s=>{s?.style.setProperty("--z-index",a.zIndex)})})},invokeOnClose(n){n.onOpenChange?.({open:!1})},invokeOnOpen(n){n.onOpenChange?.({open:!0})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}var UA=Vt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),rB=vn(UA);var[gy,Vn]=qe({hookName:"useDialogContext",providerName:"<DialogProvider />"}),hy=e=>{let t=Vn(),n=Hm(),r=_r(oe(n,()=>({present:t().open}))),o=oe(()=>t().getBackdropProps(),()=>r().presenceProps,e);return m(B,{get when(){return!r().unmounted},get children(){return m(be.div,o)}})},by=e=>{let t=Vn(),n=oe(()=>t().getCloseTriggerProps(),e);return m(be.button,n)},yy=e=>{let t=Vn(),n=cr(),r=oe(()=>t().getContentProps(),()=>n().presenceProps,e);return m(B,{get when(){return!n().unmounted},get children(){return m(be.div,r)}})},vy=e=>e.children(Vn()),xy=e=>{let t=Vn(),n=oe(()=>t().getDescriptionProps(),e);return m(be.div,n)},wy=e=>{let t=Vn(),n=cr(),r=oe(()=>t().getPositionerProps(),e);return m(B,{get when(){return!n().unmounted},get children(){return m(be.div,r)}})},Sy=e=>{let t=Do(),n=Mr(),r=mn(),o=F(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[a,i]=xn(my(o()),{context:o});return F(()=>py(a,i,jt))},Ty=e=>{let[t,n]=Oo(e),[r]=Na(t),[o,a]=ut()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),i=Sy(o),s=_r(oe(t,()=>({present:i().open})));return m(gy,{value:i,get children(){return m(Dc,{value:r,get children(){return m(Lo,{value:s,get children(){return a.children}})}})}})},Cy=e=>{let[t,n]=Oo(e),[r]=Na(t),o=_r(oe(t,()=>({present:n.value().open})));return m(gy,{get value(){return n.value},get children(){return m(Dc,{value:r,get children(){return m(Lo,{value:o,get children(){return n.children}})}})}})},Ey=e=>{let t=Vn(),n=oe(()=>t().getTitleProps(),e);return m(be.h2,n)},ky=e=>{let t=Vn(),n=cr(),r=oe(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(be.button,r)},mr={};dr(mr,{Backdrop:()=>hy,CloseTrigger:()=>by,Content:()=>yy,Context:()=>vy,Description:()=>xy,Positioner:()=>wy,Root:()=>Ty,RootProvider:()=>Cy,Title:()=>Ey,Trigger:()=>ky});var gr=uu({placement:"bottom-end",gap:24});var Ay=`#brand-mark {
|
|
9
|
+
`);if(t===null||ws(t)!=="object")throw new Error(n);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(n)},Ss,Mc=!1,ey=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];Mc=!0;var o=Date.now();return hE(Ss).then(function(i){return bE(i,n,o)})};ey.setLoadParameters=function(e){if(Mc&&Ss){var t=Jb(e),n=Object.keys(t),r=n.reduce(function(o,i){var a;return o&&e[i]===((a=Ss)===null||a===void 0?void 0:a[i])},!0);if(r)return}if(Mc)throw new Error("You cannot change load parameters after calling loadStripe");Ss=Jb(e)};Dc.loadStripe=ey});var ry=Ne((C4,ny)=>{"use strict";ny.exports=ty()});var Gi={};Gv(Gi,{__addDisposableResource:()=>zy,__assign:()=>_s,__asyncDelegator:()=>Ny,__asyncGenerator:()=>Ly,__asyncValues:()=>$y,__await:()=>Co,__awaiter:()=>Iy,__classPrivateFieldGet:()=>jy,__classPrivateFieldIn:()=>Hy,__classPrivateFieldSet:()=>Vy,__createBinding:()=>Es,__decorate:()=>Sy,__disposeResources:()=>Gy,__esDecorate:()=>Cy,__exportStar:()=>Oy,__extends:()=>vy,__generator:()=>Ay,__importDefault:()=>Uy,__importStar:()=>Fy,__makeTemplateObject:()=>By,__metadata:()=>Py,__param:()=>Ty,__propKey:()=>ky,__read:()=>Uc,__rest:()=>wy,__rewriteRelativeImportExtension:()=>Wy,__runInitializers:()=>_y,__setFunctionName:()=>Ey,__spread:()=>Ry,__spreadArray:()=>Dy,__spreadArrays:()=>My,__values:()=>ks,default:()=>XE});function vy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Bc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function wy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Sy(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function Ty(e,t){return function(n,r){t(n,r,e)}}function Cy(e,t,n,r,o,i){function a(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=r.kind,c=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,d=!1,p=n.length-1;p>=0;p--){var h={};for(var g in r)h[g]=g==="access"?{}:r[g];for(var g in r.access)h.access[g]=r.access[g];h.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(y||null))};var v=(0,n[p])(s==="accessor"?{get:u.get,set:u.set}:u[c],h);if(s==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(f=a(v.get))&&(u.get=f),(f=a(v.set))&&(u.set=f),(f=a(v.init))&&o.unshift(f)}else(f=a(v))&&(s==="field"?o.unshift(f):u[c]=f)}l&&Object.defineProperty(l,r.name,u),d=!0}function _y(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function ky(e){return typeof e=="symbol"?e:"".concat(e)}function Ey(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Py(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Iy(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{l(r.next(u))}catch(f){a(f)}}function c(u){try{l(r.throw(u))}catch(f){a(f)}}function l(u){u.done?i(u.value):o(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function Ay(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],o=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Oy(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Es(t,e,n)}function ks(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Uc(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function Ry(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Uc(arguments[t]));return e}function My(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function Dy(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Co(e){return this instanceof Co?(this.v=e,this):new Co(e)}function Ly(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(p){return function(h){return Promise.resolve(h).then(p,f)}}function s(p,h){r[p]&&(o[p]=function(g){return new Promise(function(v,y){i.push([p,g,v,y])>1||c(p,g)})},h&&(o[p]=h(o[p])))}function c(p,h){try{l(r[p](h))}catch(g){d(i[0][3],g)}}function l(p){p.value instanceof Co?Promise.resolve(p.value.v).then(u,f):d(i[0][2],p)}function u(p){c("next",p)}function f(p){c("throw",p)}function d(p,h){p(h),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ny(e){var t,n;return t={},r("next"),r("throw",function(o){throw o}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(o,i){t[o]=e[o]?function(a){return(n=!n)?{value:Co(e[o](a)),done:!1}:i?i(a):a}:i}}function $y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ks=="function"?ks(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s})},a)}}function By(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Fy(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Fc(e),r=0;r<n.length;r++)n[r]!=="default"&&Es(t,e,n[r]);return KE(t,e),t}function Uy(e){return e&&e.__esModule?e:{default:e}}function jy(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function Vy(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function Hy(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function zy(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function Gy(e){function t(i){e.error=e.hasError?new YE(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var n,r=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(a){return t(a),o()})}else r|=1}catch(a){t(a)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function Wy(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,o,i,a){return r?t?".jsx":".js":o&&(!i||!a)?n:o+i+"."+a.toLowerCase()+"js"}):e}var Bc,_s,Es,KE,Fc,YE,XE,Wi=zv(()=>{"use strict";Bc=function(e,t){return Bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Bc(e,t)};_s=function(){return _s=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},_s.apply(this,arguments)};Es=Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};KE=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Fc=function(e){return Fc=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},Fc(e)};YE=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};XE={__extends:vy,__assign:_s,__rest:wy,__decorate:Sy,__param:Ty,__esDecorate:Cy,__runInitializers:_y,__propKey:ky,__setFunctionName:Ey,__metadata:Py,__awaiter:Iy,__generator:Ay,__createBinding:Es,__exportStar:Oy,__values:ks,__read:Uc,__spread:Ry,__spreadArrays:My,__spreadArray:Dy,__await:Co,__asyncGenerator:Ly,__asyncDelegator:Ny,__asyncValues:$y,__makeTemplateObject:By,__importStar:Fy,__importDefault:Uy,__classPrivateFieldGet:jy,__classPrivateFieldSet:Vy,__classPrivateFieldIn:Hy,__addDisposableResource:zy,__disposeResources:Gy,__rewriteRelativeImportExtension:Wy}});var _o=Ne(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.WebmBase=void 0;var jc=class{constructor(t="Unknown",n=0){this.name=t,this.start=n}getType(){return"Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource()}updateByData(){}setData(t){this.data=t,this.updateByData()}getValue(){return this.data}setValue(t){this.setData(t)}};Ps.WebmBase=jc});var As=Ne(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.SectionType=void 0;var qy;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"})(qy||(Is.SectionType=qy={}))});var Vc=Ne(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.sections=void 0;var b=As();Os.sections={172351395:{name:"EBML",type:b.SectionType.Container},646:{name:"EBMLVersion",type:b.SectionType.Uint},759:{name:"EBMLReadVersion",type:b.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:b.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:b.SectionType.Uint},642:{name:"DocType",type:b.SectionType.String},647:{name:"DocTypeVersion",type:b.SectionType.Uint},645:{name:"DocTypeReadVersion",type:b.SectionType.Uint},108:{name:"Void",type:b.SectionType.Binary},63:{name:"CRC-32",type:b.SectionType.Binary},190023271:{name:"SignatureSlot",type:b.SectionType.Container},16010:{name:"SignatureAlgo",type:b.SectionType.Uint},16026:{name:"SignatureHash",type:b.SectionType.Uint},16037:{name:"SignaturePublicKey",type:b.SectionType.Binary},16053:{name:"Signature",type:b.SectionType.Binary},15963:{name:"SignatureElements",type:b.SectionType.Container},15995:{name:"SignatureElementList",type:b.SectionType.Container},9522:{name:"SignedElement",type:b.SectionType.Binary},139690087:{name:"Segment",type:b.SectionType.Container},21863284:{name:"SeekHead",type:b.SectionType.Container},3515:{name:"Seek",type:b.SectionType.Container},5035:{name:"SeekID",type:b.SectionType.Binary},5036:{name:"SeekPosition",type:b.SectionType.Uint},88713574:{name:"Info",type:b.SectionType.Container},13220:{name:"SegmentUID",type:b.SectionType.Binary},13188:{name:"SegmentFilename",type:b.SectionType.String},1882403:{name:"PrevUID",type:b.SectionType.Binary},1868715:{name:"PrevFilename",type:b.SectionType.String},2013475:{name:"NextUID",type:b.SectionType.Binary},1999803:{name:"NextFilename",type:b.SectionType.String},1092:{name:"SegmentFamily",type:b.SectionType.Binary},10532:{name:"ChapterTranslate",type:b.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:b.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:b.SectionType.Uint},10661:{name:"ChapterTranslateID",type:b.SectionType.Binary},710577:{name:"TimecodeScale",type:b.SectionType.Uint},1161:{name:"Duration",type:b.SectionType.Float},1121:{name:"DateUTC",type:b.SectionType.Date},15273:{name:"Title",type:b.SectionType.String},3456:{name:"MuxingApp",type:b.SectionType.String},5953:{name:"WritingApp",type:b.SectionType.String},103:{name:"Timecode",type:b.SectionType.Uint},6228:{name:"SilentTracks",type:b.SectionType.Container},6359:{name:"SilentTrackNumber",type:b.SectionType.Uint},39:{name:"Position",type:b.SectionType.Uint},43:{name:"PrevSize",type:b.SectionType.Uint},35:{name:"SimpleBlock",type:b.SectionType.Binary},32:{name:"BlockGroup",type:b.SectionType.Container},33:{name:"Block",type:b.SectionType.Binary},34:{name:"BlockVirtual",type:b.SectionType.Binary},13729:{name:"BlockAdditions",type:b.SectionType.Container},38:{name:"BlockMore",type:b.SectionType.Container},110:{name:"BlockAddID",type:b.SectionType.Uint},37:{name:"BlockAdditional",type:b.SectionType.Binary},27:{name:"BlockDuration",type:b.SectionType.Uint},122:{name:"ReferencePriority",type:b.SectionType.Uint},123:{name:"ReferenceBlock",type:b.SectionType.Int},125:{name:"ReferenceVirtual",type:b.SectionType.Int},36:{name:"CodecState",type:b.SectionType.Binary},13730:{name:"DiscardPadding",type:b.SectionType.Int},14:{name:"Slices",type:b.SectionType.Container},104:{name:"TimeSlice",type:b.SectionType.Container},76:{name:"LaceNumber",type:b.SectionType.Uint},77:{name:"FrameNumber",type:b.SectionType.Uint},75:{name:"BlockAdditionID",type:b.SectionType.Uint},78:{name:"Delay",type:b.SectionType.Uint},79:{name:"SliceDuration",type:b.SectionType.Uint},72:{name:"ReferenceFrame",type:b.SectionType.Container},73:{name:"ReferenceOffset",type:b.SectionType.Uint},74:{name:"ReferenceTimeCode",type:b.SectionType.Uint},47:{name:"EncryptedBlock",type:b.SectionType.Binary},106212971:{name:"Tracks",type:b.SectionType.Container},46:{name:"TrackEntry",type:b.SectionType.Container},87:{name:"TrackNumber",type:b.SectionType.Uint},13253:{name:"TrackUID",type:b.SectionType.Uint},3:{name:"TrackType",type:b.SectionType.Uint},57:{name:"FlagEnabled",type:b.SectionType.Uint},8:{name:"FlagDefault",type:b.SectionType.Uint},5546:{name:"FlagForced",type:b.SectionType.Uint},28:{name:"FlagLacing",type:b.SectionType.Uint},11751:{name:"MinCache",type:b.SectionType.Uint},11768:{name:"MaxCache",type:b.SectionType.Uint},254851:{name:"DefaultDuration",type:b.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:b.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:b.SectionType.Float},4991:{name:"TrackOffset",type:b.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:b.SectionType.Uint},4974:{name:"Name",type:b.SectionType.String},177564:{name:"Language",type:b.SectionType.String},6:{name:"CodecID",type:b.SectionType.String},9122:{name:"CodecPrivate",type:b.SectionType.Binary},362120:{name:"CodecName",type:b.SectionType.String},13382:{name:"AttachmentLink",type:b.SectionType.Uint},1742487:{name:"CodecSettings",type:b.SectionType.String},1785920:{name:"CodecInfoURL",type:b.SectionType.String},438848:{name:"CodecDownloadURL",type:b.SectionType.String},42:{name:"CodecDecodeAll",type:b.SectionType.Uint},12203:{name:"TrackOverlay",type:b.SectionType.Uint},5802:{name:"CodecDelay",type:b.SectionType.Uint},5819:{name:"SeekPreRoll",type:b.SectionType.Uint},9764:{name:"TrackTranslate",type:b.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:b.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:b.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:b.SectionType.Binary},96:{name:"Video",type:b.SectionType.Container},26:{name:"FlagInterlaced",type:b.SectionType.Uint},5048:{name:"StereoMode",type:b.SectionType.Uint},5056:{name:"AlphaMode",type:b.SectionType.Uint},5049:{name:"OldStereoMode",type:b.SectionType.Uint},48:{name:"PixelWidth",type:b.SectionType.Uint},58:{name:"PixelHeight",type:b.SectionType.Uint},5290:{name:"PixelCropBottom",type:b.SectionType.Uint},5307:{name:"PixelCropTop",type:b.SectionType.Uint},5324:{name:"PixelCropLeft",type:b.SectionType.Uint},5341:{name:"PixelCropRight",type:b.SectionType.Uint},5296:{name:"DisplayWidth",type:b.SectionType.Uint},5306:{name:"DisplayHeight",type:b.SectionType.Uint},5298:{name:"DisplayUnit",type:b.SectionType.Uint},5299:{name:"AspectRatioType",type:b.SectionType.Uint},963876:{name:"ColourSpace",type:b.SectionType.Binary},1029411:{name:"GammaValue",type:b.SectionType.Float},230371:{name:"FrameRate",type:b.SectionType.Float},97:{name:"Audio",type:b.SectionType.Container},53:{name:"SamplingFrequency",type:b.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:b.SectionType.Float},31:{name:"Channels",type:b.SectionType.Uint},15739:{name:"ChannelPositions",type:b.SectionType.Binary},8804:{name:"BitDepth",type:b.SectionType.Uint},98:{name:"TrackOperation",type:b.SectionType.Container},99:{name:"TrackCombinePlanes",type:b.SectionType.Container},100:{name:"TrackPlane",type:b.SectionType.Container},101:{name:"TrackPlaneUID",type:b.SectionType.Uint},102:{name:"TrackPlaneType",type:b.SectionType.Uint},105:{name:"TrackJoinBlocks",type:b.SectionType.Container},109:{name:"TrackJoinUID",type:b.SectionType.Uint},64:{name:"TrickTrackUID",type:b.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:b.SectionType.Binary},70:{name:"TrickTrackFlag",type:b.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:b.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:b.SectionType.Binary},11648:{name:"ContentEncodings",type:b.SectionType.Container},8768:{name:"ContentEncoding",type:b.SectionType.Container},4145:{name:"ContentEncodingOrder",type:b.SectionType.Uint},4146:{name:"ContentEncodingScope",type:b.SectionType.Uint},4147:{name:"ContentEncodingType",type:b.SectionType.Uint},4148:{name:"ContentCompression",type:b.SectionType.Container},596:{name:"ContentCompAlgo",type:b.SectionType.Uint},597:{name:"ContentCompSettings",type:b.SectionType.Binary},4149:{name:"ContentEncryption",type:b.SectionType.Container},2017:{name:"ContentEncAlgo",type:b.SectionType.Uint},2018:{name:"ContentEncKeyID",type:b.SectionType.Binary},2019:{name:"ContentSignature",type:b.SectionType.Binary},2020:{name:"ContentSigKeyID",type:b.SectionType.Binary},2021:{name:"ContentSigAlgo",type:b.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:b.SectionType.Uint},206814059:{name:"Cues",type:b.SectionType.Container},59:{name:"CuePoint",type:b.SectionType.Container},51:{name:"CueTime",type:b.SectionType.Uint},55:{name:"CueTrackPositions",type:b.SectionType.Container},119:{name:"CueTrack",type:b.SectionType.Uint},113:{name:"CueClusterPosition",type:b.SectionType.Uint},112:{name:"CueRelativePosition",type:b.SectionType.Uint},50:{name:"CueDuration",type:b.SectionType.Uint},4984:{name:"CueBlockNumber",type:b.SectionType.Uint},106:{name:"CueCodecState",type:b.SectionType.Uint},91:{name:"CueReference",type:b.SectionType.Container},22:{name:"CueRefTime",type:b.SectionType.Uint},23:{name:"CueRefCluster",type:b.SectionType.Uint},4959:{name:"CueRefNumber",type:b.SectionType.Uint},107:{name:"CueRefCodecState",type:b.SectionType.Uint},155296873:{name:"Attachments",type:b.SectionType.Container},8615:{name:"AttachedFile",type:b.SectionType.Container},1662:{name:"FileDescription",type:b.SectionType.String},1646:{name:"FileName",type:b.SectionType.String},1632:{name:"FileMimeType",type:b.SectionType.String},1628:{name:"FileData",type:b.SectionType.Binary},1710:{name:"FileUID",type:b.SectionType.Uint},1653:{name:"FileReferral",type:b.SectionType.Binary},1633:{name:"FileUsedStartTime",type:b.SectionType.Uint},1634:{name:"FileUsedEndTime",type:b.SectionType.Uint},4433776:{name:"Chapters",type:b.SectionType.Container},1465:{name:"EditionEntry",type:b.SectionType.Container},1468:{name:"EditionUID",type:b.SectionType.Uint},1469:{name:"EditionFlagHidden",type:b.SectionType.Uint},1499:{name:"EditionFlagDefault",type:b.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:b.SectionType.Uint},54:{name:"ChapterAtom",type:b.SectionType.Container},13252:{name:"ChapterUID",type:b.SectionType.Uint},5716:{name:"ChapterStringUID",type:b.SectionType.String},17:{name:"ChapterTimeStart",type:b.SectionType.Uint},18:{name:"ChapterTimeEnd",type:b.SectionType.Uint},24:{name:"ChapterFlagHidden",type:b.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:b.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:b.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:b.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:b.SectionType.Uint},15:{name:"ChapterTrack",type:b.SectionType.Container},9:{name:"ChapterTrackNumber",type:b.SectionType.Uint},0:{name:"ChapterDisplay",type:b.SectionType.Container},5:{name:"ChapString",type:b.SectionType.String},892:{name:"ChapLanguage",type:b.SectionType.String},894:{name:"ChapCountry",type:b.SectionType.String},10564:{name:"ChapProcess",type:b.SectionType.Container},10581:{name:"ChapProcessCodecID",type:b.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:b.SectionType.Binary},10513:{name:"ChapProcessCommand",type:b.SectionType.Container},10530:{name:"ChapProcessTime",type:b.SectionType.Uint},10547:{name:"ChapProcessData",type:b.SectionType.Binary},39109479:{name:"Tags",type:b.SectionType.Container},13171:{name:"Tag",type:b.SectionType.Container},9152:{name:"Targets",type:b.SectionType.Container},10442:{name:"TargetTypeValue",type:b.SectionType.Uint},9162:{name:"TargetType",type:b.SectionType.String},9157:{name:"TagTrackUID",type:b.SectionType.Uint},9161:{name:"TagEditionUID",type:b.SectionType.Uint},9156:{name:"TagChapterUID",type:b.SectionType.Uint},9158:{name:"TagAttachmentUID",type:b.SectionType.Uint},10184:{name:"SimpleTag",type:b.SectionType.Container},1443:{name:"TagName",type:b.SectionType.String},1146:{name:"TagLanguage",type:b.SectionType.String},1156:{name:"TagDefault",type:b.SectionType.Uint},1159:{name:"TagString",type:b.SectionType.String},1157:{name:"TagBinary",type:b.SectionType.Binary},5552:{name:"Colour",type:b.SectionType.Container},5553:{name:"MatrixCoefficients",type:b.SectionType.Uint},5554:{name:"BitsPerChannel",type:b.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:b.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:b.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:b.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:b.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:b.SectionType.Uint},5560:{name:"ChromaSitingVert",type:b.SectionType.Uint},5561:{name:"Range",type:b.SectionType.Uint},5562:{name:"TransferCharacteristics",type:b.SectionType.Uint},5563:{name:"Primaries",type:b.SectionType.Uint},5564:{name:"MaxCLL",type:b.SectionType.Uint},5565:{name:"MaxFALL",type:b.SectionType.Uint}}});var zc=Ne(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.WebmUint=void 0;var ZE=_o();function Ky(e){return e.length%2===1?"0"+e:e}var Hc=class extends ZE.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let n=this.source[t].toString(16);this.data+=Ky(n)}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let n=0;n<t;n++){let r=this.data.substring(n*2,n*2+2);this.source[n]=parseInt(r,16)}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(Ky(t.toString(16)))}};Rs.WebmUint=Hc});var Wc=Ne(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.WebmFloat=void 0;var JE=_o(),Gc=class extends JE.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),n=this.getFloatArrayType(),r=new n(t.buffer);this.data=r[0]}updateByData(){let t=this.getFloatArrayType(),n=new t([this.data]),r=new Uint8Array(n.buffer);this.source=r.reverse()}};Ms.WebmFloat=Gc});var Kc=Ne(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.WebmString=void 0;var QE=_o(),qc=class extends QE.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let t="";return this.source.forEach(n=>{t+=String.fromCharCode(n)}),t}};Ds.WebmString=qc});var Xc=Ne(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.WebmContainer=void 0;var Yy=_o(),eP=Vc(),Ls=As(),tP=zc(),nP=Wc(),rP=Kc(),Yc=class e extends Yy.WebmBase{constructor(t,n=!1,r=0){super(t,r),this.isInfinite=n,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),n=8-t.toString(2).length,r=t-(1<<7-n);for(let o=0;o<n;o++)r<<=8,r|=this.readByte();return r}updateBySource(){var t;this.data=[];let n;for(this.offset=0;this.offset<this.source.length;this.offset=n){let r=this.offset,o=this.readUint(),{name:i,type:a}=(t=eP.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();n=this.source.length,s>=0&&(n=Math.min(this.offset+s,n));let c=this.source.slice(this.offset,n),l;switch(a){case Ls.SectionType.Container:l=new e(i,s<0,r);break;case Ls.SectionType.Uint:l=new tP.WebmUint(i,r);break;case Ls.SectionType.Float:l=new nP.WebmFloat(i,r);break;case Ls.SectionType.String:l=new rP.WebmString(i,r);break;default:l=new Yy.WebmBase(i,r);break}l.setSource(c),this.data.push({id:o,idHex:o.toString(16),data:l})}}writeUint(t,n=!1){let r;for(r=1;(t<0||t>=1<<7*r)&&r<8;r++);if(!n){for(let o=0;o<r;o++)this.source[this.offset+o]=t>>8*(r-1-o)&255;this.source[this.offset]&=(1<<8-r)-1,this.source[this.offset]|=1<<8-r}this.offset+=r}writeSections(t=!1){this.offset=0;for(let n=0;n<this.data.length;n++){let r=this.data[n],o=r.data.source,i=o.length;this.writeUint(r.id,t),this.writeUint(r.data instanceof e&&r.data.isInfinite?-1:i,t),t||this.source.set(o,this.offset),this.offset+=i}return this.offset}updateByData(){let t=this.writeSections(!0);this.source=new Uint8Array(t),this.writeSections()}getSectionById(t){for(let n=0;n<this.data.length;n++){let r=this.data[n];if(r.id===t)return r.data}return null}};Ns.WebmContainer=Yc});var Xy=Ne($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.WebmFile=void 0;var oP=(Wi(),ra(Gi)),iP=Xc(),Zc=class e extends iP.WebmContainer{constructor(t){super("File"),this.setSource(t)}getType(){return"File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((n,r)=>{try{let o=new FileReader;o.onloadend=()=>{try{n(new Uint8Array(o.result))}catch(i){r(i)}},o.readAsArrayBuffer(t)}catch(o){r(o)}})}static fromBlob(t){return oP.__awaiter(this,void 0,void 0,function*(){let n=yield e.blobToArray(t);return new e(n)})}};$s.WebmFile=Zc});var Jy=Ne(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0})});var Jc=Ne(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});var In=(Wi(),ra(Gi));In.__exportStar(_o(),Yt);In.__exportStar(Xc(),Yt);In.__exportStar(Xy(),Yt);In.__exportStar(Wc(),Yt);In.__exportStar(Kc(),Yt);In.__exportStar(zc(),Yt);In.__exportStar(As(),Yt);In.__exportStar(Jy(),Yt);In.__exportStar(Vc(),Yt)});var Qc=Ne(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.fixParsedWebmDuration=void 0;var aP=Jc(),sP=(e,t,n={})=>{let r=n.logger;r===void 0?r=c=>console.debug(c):r||(r=()=>{});let o=e.getSectionById(139690087);if(!o)return r("[fix-webm-duration] Segment section is missing"),!1;let i=o.getSectionById(88713574);if(!i)return r("[fix-webm-duration] Info section is missing"),!1;let a=i.getSectionById(710577);if(!a)return r("[fix-webm-duration] TimecodeScale section is missing"),!1;let s=i.getSectionById(1161);if(s)if(s.getValue()<=0)r(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return r(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),!1;else r("[fix-webm-duration] Duration section is missing"),s=new aP.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),!0};Bs.fixParsedWebmDuration=sP});var Qy=Ne(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.fixWebmDuration=void 0;var lP=(Wi(),ra(Gi)),cP=Jc(),uP=Qc(),dP=(e,t,n)=>lP.__awaiter(void 0,void 0,void 0,function*(){try{let r=yield cP.WebmFile.fromBlob(e);if((0,uP.fixParsedWebmDuration)(r,t,n))return r.toBlob(e.type)}catch{}return e});Fs.fixWebmDuration=dP});var tx=Ne(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var ex=(Wi(),ra(Gi));ex.__exportStar(Qy(),Us);ex.__exportStar(Qc(),Us)});var Ex=Ne((su,lu)=>{"use strict";(function(e,t){typeof su=="object"&&typeof lu<"u"?lu.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(su,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object,{freeze:i,seal:a,create:s}=Object,{apply:c,construct:l}=typeof Reflect<"u"&&Reflect;i||(i=function(ae){return ae}),a||(a=function(ae){return ae}),c||(c=function(ae,Ae,ke){return ae.apply(Ae,ke)}),l||(l=function(ae,Ae){return new ae(...Ae)});let u=I(Array.prototype.forEach),f=I(Array.prototype.pop),d=I(Array.prototype.push),p=I(String.prototype.toLowerCase),h=I(String.prototype.toString),g=I(String.prototype.match),v=I(String.prototype.replace),y=I(String.prototype.indexOf),T=I(String.prototype.trim),C=I(RegExp.prototype.test),E=U(TypeError);function I(Ie){return function(ae){for(var Ae=arguments.length,ke=new Array(Ae>1?Ae-1:0),ct=1;ct<Ae;ct++)ke[ct-1]=arguments[ct];return c(Ie,ae,ke)}}function U(Ie){return function(){for(var ae=arguments.length,Ae=new Array(ae),ke=0;ke<ae;ke++)Ae[ke]=arguments[ke];return l(Ie,Ae)}}function R(Ie,ae){let Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p;t&&t(Ie,null);let ke=ae.length;for(;ke--;){let ct=ae[ke];if(typeof ct=="string"){let pn=Ae(ct);pn!==ct&&(n(ae)||(ae[ke]=pn),ct=pn)}Ie[ct]=!0}return Ie}function oe(Ie){let ae=s(null);for(let[Ae,ke]of e(Ie))o(Ie,Ae)!==void 0&&(ae[Ae]=ke);return ae}function H(Ie,ae){for(;Ie!==null;){let ke=o(Ie,ae);if(ke){if(ke.get)return I(ke.get);if(typeof ke.value=="function")return I(ke.value)}Ie=r(Ie)}function Ae(ke){return console.warn("fallback value for",ke),null}return Ae}let G=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),L=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),w=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=i(["#text"]),J=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ue=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),le=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xe=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),we=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),St=a(/<%[\w\W]*|[\w\W]*%>/gm),$t=a(/\${[\w\W]*}/gm),mt=a(/^data-[\-\w.\u00B7-\uFFFF]/),Xt=a(/^aria-[\-\w]+$/),Ao=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Oo=a(/^(?:\w+script|data):/i),Ro=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hu=a(/^html$/i);var bu=Object.freeze({__proto__:null,MUSTACHE_EXPR:we,ERB_EXPR:St,TMPLIT_EXPR:$t,DATA_ATTR:mt,ARIA_ATTR:Xt,IS_ALLOWED_URI:Ao,IS_SCRIPT_OR_DATA:Oo,ATTR_WHITESPACE:Ro,DOCTYPE_NAME:hu});let mv=function(){return typeof window>"u"?null:window},gv=function(ae,Ae){if(typeof ae!="object"||typeof ae.createPolicy!="function")return null;let ke=null,ct="data-tt-policy-suffix";Ae&&Ae.hasAttribute(ct)&&(ke=Ae.getAttribute(ct));let pn="dompurify"+(ke?"#"+ke:"");try{return ae.createPolicy(pn,{createHTML(Rr){return Rr},createScriptURL(Rr){return Rr}})}catch{return console.warn("TrustedTypes policy "+pn+" could not be created."),null}};function yu(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mv(),ae=Q=>yu(Q);if(ae.version="3.0.6",ae.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==9)return ae.isSupported=!1,ae;let{document:Ae}=Ie,ke=Ae,ct=ke.currentScript,{DocumentFragment:pn,HTMLTemplateElement:Rr,Node:qs,Element:xu,NodeFilter:Ks,NamedNodeMap:bv=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:yv,DOMParser:xv,trustedTypes:Yi}=Ie,Xi=xu.prototype,vv=H(Xi,"cloneNode"),wv=H(Xi,"nextSibling"),Sv=H(Xi,"childNodes"),Ys=H(Xi,"parentNode");if(typeof Rr=="function"){let Q=Ae.createElement("template");Q.content&&Q.content.ownerDocument&&(Ae=Q.content.ownerDocument)}let ut,Mo="",{implementation:Xs,createNodeIterator:Tv,createDocumentFragment:Cv,getElementsByTagName:_v}=Ae,{importNode:kv}=ke,Zt={};ae.isSupported=typeof e=="function"&&typeof Ys=="function"&&Xs&&Xs.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Zs,ERB_EXPR:Js,TMPLIT_EXPR:Qs,DATA_ATTR:Ev,ARIA_ATTR:Pv,IS_SCRIPT_OR_DATA:Iv,ATTR_WHITESPACE:vu}=bu,{IS_ALLOWED_URI:wu}=bu,Ye=null,Su=R({},[...G,...L,...P,...w,...D]),Xe=null,Tu=R({},[...J,...ue,...le,...xe]),je=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Do=null,el=null,Cu=!0,tl=!0,_u=!1,ku=!0,Mr=!1,Zn=!1,nl=!1,rl=!1,Dr=!1,Zi=!1,Ji=!1,Eu=!0,Pu=!1,Av="user-content-",ol=!0,Lo=!1,Lr={},Nr=null,Iu=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Au=null,Ou=R({},["audio","video","img","source","image","track"]),il=null,Ru=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qi="http://www.w3.org/1998/Math/MathML",ea="http://www.w3.org/2000/svg",mn="http://www.w3.org/1999/xhtml",$r=mn,al=!1,sl=null,Ov=R({},[Qi,ea,mn],h),Jn=null,Rv=["application/xhtml+xml","text/html"],Mv="text/html",Ze=null,Br=null,Dv=Ae.createElement("form"),Mu=function(k){return k instanceof RegExp||k instanceof Function},ll=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Br&&Br===k)){if((!k||typeof k!="object")&&(k={}),k=oe(k),Jn=Rv.indexOf(k.PARSER_MEDIA_TYPE)===-1?Jn=Mv:Jn=k.PARSER_MEDIA_TYPE,Ze=Jn==="application/xhtml+xml"?h:p,Ye="ALLOWED_TAGS"in k?R({},k.ALLOWED_TAGS,Ze):Su,Xe="ALLOWED_ATTR"in k?R({},k.ALLOWED_ATTR,Ze):Tu,sl="ALLOWED_NAMESPACES"in k?R({},k.ALLOWED_NAMESPACES,h):Ov,il="ADD_URI_SAFE_ATTR"in k?R(oe(Ru),k.ADD_URI_SAFE_ATTR,Ze):Ru,Au="ADD_DATA_URI_TAGS"in k?R(oe(Ou),k.ADD_DATA_URI_TAGS,Ze):Ou,Nr="FORBID_CONTENTS"in k?R({},k.FORBID_CONTENTS,Ze):Iu,Do="FORBID_TAGS"in k?R({},k.FORBID_TAGS,Ze):{},el="FORBID_ATTR"in k?R({},k.FORBID_ATTR,Ze):{},Lr="USE_PROFILES"in k?k.USE_PROFILES:!1,Cu=k.ALLOW_ARIA_ATTR!==!1,tl=k.ALLOW_DATA_ATTR!==!1,_u=k.ALLOW_UNKNOWN_PROTOCOLS||!1,ku=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Mr=k.SAFE_FOR_TEMPLATES||!1,Zn=k.WHOLE_DOCUMENT||!1,Dr=k.RETURN_DOM||!1,Zi=k.RETURN_DOM_FRAGMENT||!1,Ji=k.RETURN_TRUSTED_TYPE||!1,rl=k.FORCE_BODY||!1,Eu=k.SANITIZE_DOM!==!1,Pu=k.SANITIZE_NAMED_PROPS||!1,ol=k.KEEP_CONTENT!==!1,Lo=k.IN_PLACE||!1,wu=k.ALLOWED_URI_REGEXP||Ao,$r=k.NAMESPACE||mn,je=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&Mu(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(je.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&Mu(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(je.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(je.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Mr&&(tl=!1),Zi&&(Dr=!0),Lr&&(Ye=R({},[...D]),Xe=[],Lr.html===!0&&(R(Ye,G),R(Xe,J)),Lr.svg===!0&&(R(Ye,L),R(Xe,ue),R(Xe,xe)),Lr.svgFilters===!0&&(R(Ye,P),R(Xe,ue),R(Xe,xe)),Lr.mathMl===!0&&(R(Ye,w),R(Xe,le),R(Xe,xe))),k.ADD_TAGS&&(Ye===Su&&(Ye=oe(Ye)),R(Ye,k.ADD_TAGS,Ze)),k.ADD_ATTR&&(Xe===Tu&&(Xe=oe(Xe)),R(Xe,k.ADD_ATTR,Ze)),k.ADD_URI_SAFE_ATTR&&R(il,k.ADD_URI_SAFE_ATTR,Ze),k.FORBID_CONTENTS&&(Nr===Iu&&(Nr=oe(Nr)),R(Nr,k.FORBID_CONTENTS,Ze)),ol&&(Ye["#text"]=!0),Zn&&R(Ye,["html","head","body"]),Ye.table&&(R(Ye,["tbody"]),delete Do.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ut=k.TRUSTED_TYPES_POLICY,Mo=ut.createHTML("")}else ut===void 0&&(ut=gv(Yi,ct)),ut!==null&&typeof Mo=="string"&&(Mo=ut.createHTML(""));i&&i(k),Br=k}},Du=R({},["mi","mo","mn","ms","mtext"]),Lu=R({},["foreignobject","desc","title","annotation-xml"]),Lv=R({},["title","style","font","a","script"]),ta=R({},L);R(ta,P),R(ta,_);let cl=R({},w);R(cl,M);let Nv=function(k){let F=Ys(k);(!F||!F.tagName)&&(F={namespaceURI:$r,tagName:"template"});let Y=p(k.tagName),Re=p(F.tagName);return sl[k.namespaceURI]?k.namespaceURI===ea?F.namespaceURI===mn?Y==="svg":F.namespaceURI===Qi?Y==="svg"&&(Re==="annotation-xml"||Du[Re]):!!ta[Y]:k.namespaceURI===Qi?F.namespaceURI===mn?Y==="math":F.namespaceURI===ea?Y==="math"&&Lu[Re]:!!cl[Y]:k.namespaceURI===mn?F.namespaceURI===ea&&!Lu[Re]||F.namespaceURI===Qi&&!Du[Re]?!1:!cl[Y]&&(Lv[Y]||!ta[Y]):!!(Jn==="application/xhtml+xml"&&sl[k.namespaceURI]):!1},Qn=function(k){d(ae.removed,{element:k});try{k.parentNode.removeChild(k)}catch{k.remove()}},ul=function(k,F){try{d(ae.removed,{attribute:F.getAttributeNode(k),from:F})}catch{d(ae.removed,{attribute:null,from:F})}if(F.removeAttribute(k),k==="is"&&!Xe[k])if(Dr||Zi)try{Qn(F)}catch{}else try{F.setAttribute(k,"")}catch{}},Nu=function(k){let F=null,Y=null;if(rl)k="<remove></remove>"+k;else{let ot=g(k,/^[\r\n\t ]+/);Y=ot&&ot[0]}Jn==="application/xhtml+xml"&&$r===mn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");let Re=ut?ut.createHTML(k):k;if($r===mn)try{F=new xv().parseFromString(Re,Jn)}catch{}if(!F||!F.documentElement){F=Xs.createDocument($r,"template",null);try{F.documentElement.innerHTML=al?Mo:Re}catch{}}let rt=F.body||F.documentElement;return k&&Y&&rt.insertBefore(Ae.createTextNode(Y),rt.childNodes[0]||null),$r===mn?_v.call(F,Zn?"html":"body")[0]:Zn?F.documentElement:rt},$u=function(k){return Tv.call(k.ownerDocument||k,k,Ks.SHOW_ELEMENT|Ks.SHOW_COMMENT|Ks.SHOW_TEXT,null)},$v=function(k){return k instanceof yv&&(typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||!(k.attributes instanceof bv)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function")},Bu=function(k){return typeof qs=="function"&&k instanceof qs},gn=function(k,F,Y){Zt[k]&&u(Zt[k],Re=>{Re.call(ae,F,Y,Br)})},Fu=function(k){let F=null;if(gn("beforeSanitizeElements",k,null),$v(k))return Qn(k),!0;let Y=Ze(k.nodeName);if(gn("uponSanitizeElement",k,{tagName:Y,allowedTags:Ye}),k.hasChildNodes()&&!Bu(k.firstElementChild)&&C(/<[/\w]/g,k.innerHTML)&&C(/<[/\w]/g,k.textContent))return Qn(k),!0;if(!Ye[Y]||Do[Y]){if(!Do[Y]&&ju(Y)&&(je.tagNameCheck instanceof RegExp&&C(je.tagNameCheck,Y)||je.tagNameCheck instanceof Function&&je.tagNameCheck(Y)))return!1;if(ol&&!Nr[Y]){let Re=Ys(k)||k.parentNode,rt=Sv(k)||k.childNodes;if(rt&&Re){let ot=rt.length;for(let gt=ot-1;gt>=0;--gt)Re.insertBefore(vv(rt[gt],!0),wv(k))}}return Qn(k),!0}return k instanceof xu&&!Nv(k)||(Y==="noscript"||Y==="noembed"||Y==="noframes")&&C(/<\/no(script|embed|frames)/i,k.innerHTML)?(Qn(k),!0):(Mr&&k.nodeType===3&&(F=k.textContent,u([Zs,Js,Qs],Re=>{F=v(F,Re," ")}),k.textContent!==F&&(d(ae.removed,{element:k.cloneNode()}),k.textContent=F)),gn("afterSanitizeElements",k,null),!1)},Uu=function(k,F,Y){if(Eu&&(F==="id"||F==="name")&&(Y in Ae||Y in Dv))return!1;if(!(tl&&!el[F]&&C(Ev,F))){if(!(Cu&&C(Pv,F))){if(!Xe[F]||el[F]){if(!(ju(k)&&(je.tagNameCheck instanceof RegExp&&C(je.tagNameCheck,k)||je.tagNameCheck instanceof Function&&je.tagNameCheck(k))&&(je.attributeNameCheck instanceof RegExp&&C(je.attributeNameCheck,F)||je.attributeNameCheck instanceof Function&&je.attributeNameCheck(F))||F==="is"&&je.allowCustomizedBuiltInElements&&(je.tagNameCheck instanceof RegExp&&C(je.tagNameCheck,Y)||je.tagNameCheck instanceof Function&&je.tagNameCheck(Y))))return!1}else if(!il[F]){if(!C(wu,v(Y,vu,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&k!=="script"&&y(Y,"data:")===0&&Au[k])){if(!(_u&&!C(Iv,v(Y,vu,"")))){if(Y)return!1}}}}}}return!0},ju=function(k){return k.indexOf("-")>0},Vu=function(k){gn("beforeSanitizeAttributes",k,null);let{attributes:F}=k;if(!F)return;let Y={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Xe},Re=F.length;for(;Re--;){let rt=F[Re],{name:ot,namespaceURI:gt,value:er}=rt,No=Ze(ot),ht=ot==="value"?er:T(er);if(Y.attrName=No,Y.attrValue=ht,Y.keepAttr=!0,Y.forceKeepAttr=void 0,gn("uponSanitizeAttribute",k,Y),ht=Y.attrValue,Y.forceKeepAttr||(ul(ot,k),!Y.keepAttr))continue;if(!ku&&C(/\/>/i,ht)){ul(ot,k);continue}Mr&&u([Zs,Js,Qs],zu=>{ht=v(ht,zu," ")});let Hu=Ze(k.nodeName);if(Uu(Hu,No,ht)){if(Pu&&(No==="id"||No==="name")&&(ul(ot,k),ht=Av+ht),ut&&typeof Yi=="object"&&typeof Yi.getAttributeType=="function"&&!gt)switch(Yi.getAttributeType(Hu,No)){case"TrustedHTML":{ht=ut.createHTML(ht);break}case"TrustedScriptURL":{ht=ut.createScriptURL(ht);break}}try{gt?k.setAttributeNS(gt,ot,ht):k.setAttribute(ot,ht),f(ae.removed)}catch{}}}gn("afterSanitizeAttributes",k,null)},Bv=function Q(k){let F=null,Y=$u(k);for(gn("beforeSanitizeShadowDOM",k,null);F=Y.nextNode();)gn("uponSanitizeShadowNode",F,null),!Fu(F)&&(F.content instanceof pn&&Q(F.content),Vu(F));gn("afterSanitizeShadowDOM",k,null)};return ae.sanitize=function(Q){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,Y=null,Re=null,rt=null;if(al=!Q,al&&(Q="<!-->"),typeof Q!="string"&&!Bu(Q))if(typeof Q.toString=="function"){if(Q=Q.toString(),typeof Q!="string")throw E("dirty is not a string, aborting")}else throw E("toString is not a function");if(!ae.isSupported)return Q;if(nl||ll(k),ae.removed=[],typeof Q=="string"&&(Lo=!1),Lo){if(Q.nodeName){let er=Ze(Q.nodeName);if(!Ye[er]||Do[er])throw E("root node is forbidden and cannot be sanitized in-place")}}else if(Q instanceof qs)F=Nu("<!---->"),Y=F.ownerDocument.importNode(Q,!0),Y.nodeType===1&&Y.nodeName==="BODY"||Y.nodeName==="HTML"?F=Y:F.appendChild(Y);else{if(!Dr&&!Mr&&!Zn&&Q.indexOf("<")===-1)return ut&&Ji?ut.createHTML(Q):Q;if(F=Nu(Q),!F)return Dr?null:Ji?Mo:""}F&&rl&&Qn(F.firstChild);let ot=$u(Lo?Q:F);for(;Re=ot.nextNode();)Fu(Re)||(Re.content instanceof pn&&Bv(Re.content),Vu(Re));if(Lo)return Q;if(Dr){if(Zi)for(rt=Cv.call(F.ownerDocument);F.firstChild;)rt.appendChild(F.firstChild);else rt=F;return(Xe.shadowroot||Xe.shadowrootmode)&&(rt=kv.call(ke,rt,!0)),rt}let gt=Zn?F.outerHTML:F.innerHTML;return Zn&&Ye["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&C(hu,F.ownerDocument.doctype.name)&&(gt="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
|
|
10
|
+
`+gt),Mr&&u([Zs,Js,Qs],er=>{gt=v(gt,er," ")}),ut&&Ji?ut.createHTML(gt):gt},ae.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ll(Q),nl=!0},ae.clearConfig=function(){Br=null,nl=!1},ae.isValidAttribute=function(Q,k,F){Br||ll({});let Y=Ze(Q),Re=Ze(k);return Uu(Y,Re,F)},ae.addHook=function(Q,k){typeof k=="function"&&(Zt[Q]=Zt[Q]||[],d(Zt[Q],k))},ae.removeHook=function(Q){if(Zt[Q])return f(Zt[Q])},ae.removeHooks=function(Q){Zt[Q]&&(Zt[Q]=[])},ae.removeAllHooks=function(){Zt={}},ae}var hv=yu();return hv})});function Wv(e){return Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Object.assign({},o),Ku(o.value)&&!Zv(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function qv(e){return e?Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Ku(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Xv(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Kv(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Yv(e,t){let n=Wv(t);return Object.keys(t).forEach(o=>{let i=n[o],a=e.getAttribute(i.attribute),s=e[o];a!=null&&(i.value=i.parse?qu(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&Wu(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){let l=i.value;i.value=c,i.reflect&&Wu(this,i.attribute,i.value,!!i.parse);for(let u=0,f=this.__propertyChangedCallbacks.length;u<f;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function qu(e){if(e)try{return JSON.parse(e)}catch{return e}}function Wu(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Xv(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Ku(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Zv(e){return Object.prototype.toString.call(e)==="[object Function]"}function Jv(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var dl;function Qv(e,t){let n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Yv(this,t);let o=Kv(this.props),i=this.Component,a=dl;try{dl=this,this.__initialized=!0,Jv(i)?new i(o,{element:this}):i(o,{element:this})}finally{dl=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?qu(a):a}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}var S1=Symbol("element-context");function Yu(e,t={},n={}){let{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return a=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=a,s):(s=Qv(r,qv(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var ve={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Xu(this.context.count)},getNextContextId(){return Xu(this.context.count++)}};function Xu(e){let t=String(e),n=t.length-1;return ve.context.id+(n?String.fromCharCode(96+n):"")+t}function pl(e){ve.context=e}function ew(){return{...ve.context,id:ve.getNextContextId(),count:0}}var tw=(e,t)=>e===t,kt=Symbol("solid-proxy"),nd=typeof Proxy=="function",sa=Symbol("solid-track"),C1=Symbol("solid-dev-component"),ia={equals:tw},Zu=null,rd=ud,Et=1,$o=2,od={owned:null,cleanups:null,context:null,owner:null};var be=null,V=null,Fo=null,Ur=null,Oe=null,qe=null,it=null,la=0;function tr(e,t){let n=Oe,r=be,o=e.length===0,i=t===void 0?r:t,a=o?od:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>ze(()=>Rn(a)));be=a,Oe=null;try{return Bt(s,!0)}finally{Oe=n,be=r}}function O(e,t){t=t?Object.assign({},ia,t):ia;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(V&&V.running&&V.sources.has(n)?o=o(n.tValue):o=o(n.value)),cd(n,o));return[ld.bind(n),r]}function A(e,t,n){let r=yl(e,t,!1,Et);Fo&&V&&V.running?qe.push(r):Uo(r)}function ge(e,t,n){rd=iw;let r=yl(e,t,!1,Et),o=ml&&bl(ml);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),it?it.push(r):Uo(r)}function B(e,t,n){n=n?Object.assign({},ia,n):ia;let r=yl(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Fo&&V&&V.running?(r.tState=Et,qe.push(r)):Uo(r),ld.bind(r)}function id(e){return Bt(e,!1)}function ze(e){if(!Ur&&Oe===null)return e();let t=Oe;Oe=null;try{return Ur?Ur.untrack(e):e()}finally{Oe=t}}function ne(e){ge(()=>ze(e))}function se(e){return be===null||(be.cleanups===null?be.cleanups=[e]:be.cleanups.push(e)),e}function ca(){return Oe}function jr(){return be}function ad(e,t){let n=be,r=Oe;be=e,Oe=null;try{return Bt(t,!0)}catch(o){da(o)}finally{be=n,Oe=r}}function nw(e){if(V&&V.running)return e(),V.done;let t=Oe,n=be;return Promise.resolve().then(()=>{Oe=t,be=n;let r;return(Fo||ml)&&(r=V||(V={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),Bt(e,!1),Oe=be=null,r?r.done:void 0})}var[_1,Ju]=O(!1);function sd(e,t){let n=Symbol("context");return{id:n,Provider:sw(n),defaultValue:e}}function bl(e){let t;return be&&be.context&&(t=be.context[e.id])!==void 0?t:e.defaultValue}function ua(e){let t=B(e),n=B(()=>gl(t()));return n.toArray=()=>{let r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var ml;function ld(){let e=V&&V.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Et)Uo(this);else{let t=qe;qe=null,Bt(()=>aa(this),!1),qe=t}if(Oe){let t=this.observers?this.observers.length:0;Oe.sources?(Oe.sources.push(this),Oe.sourceSlots.push(t)):(Oe.sources=[this],Oe.sourceSlots=[t]),this.observers?(this.observers.push(Oe),this.observerSlots.push(Oe.sources.length-1)):(this.observers=[Oe],this.observerSlots=[Oe.sources.length-1])}return e&&V.sources.has(this)?this.tValue:this.value}function cd(e,t,n){let r=V&&V.running&&V.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(V){let o=V.running;(o||!n&&V.sources.has(e))&&(V.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Bt(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=V&&V.running;a&&V.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?qe.push(i):it.push(i),i.observers&&dd(i)),a?i.tState=Et:i.state=Et)}if(qe.length>1e6)throw qe=[],new Error},!1)}return t}function Uo(e){if(!e.fn)return;Rn(e);let t=la;Qu(e,V&&V.running&&V.sources.has(e)?e.tValue:e.value,t),V&&!V.running&&V.sources.has(e)&&queueMicrotask(()=>{Bt(()=>{V&&(V.running=!0),Oe=be=e,Qu(e,e.tValue,t),Oe=be=null},!1)})}function Qu(e,t,n){let r,o=be,i=Oe;Oe=be=e;try{r=e.fn(t)}catch(a){return e.pure&&(V&&V.running?(e.tState=Et,e.tOwned&&e.tOwned.forEach(Rn),e.tOwned=void 0):(e.state=Et,e.owned&&e.owned.forEach(Rn),e.owned=null)),e.updatedAt=n+1,da(a)}finally{Oe=i,be=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?cd(e,r,!0):V&&V.running&&e.pure?(V.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function yl(e,t,n,r=Et,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:be,context:be?be.context:null,pure:n};if(V&&V.running&&(i.state=0,i.tState=r),be===null||be!==od&&(V&&V.running&&be.pure?be.tOwned?be.tOwned.push(i):be.tOwned=[i]:be.owned?be.owned.push(i):be.owned=[i]),Ur&&i.fn){let[a,s]=O(void 0,{equals:!1}),c=Ur.factory(i.fn,s);se(()=>c.dispose());let l=()=>nw(s).then(()=>u.dispose()),u=Ur.factory(i.fn,l);i.fn=f=>(a(),V&&V.running?u.track(f):c.track(f))}return i}function Bo(e){let t=V&&V.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===$o)return aa(e);if(e.suspense&&ze(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<la);){if(t&&V.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(V.disposed.has(o))return}if((t?e.tState:e.state)===Et)Uo(e);else if((t?e.tState:e.state)===$o){let o=qe;qe=null,Bt(()=>aa(e,n[0]),!1),qe=o}}}function Bt(e,t){if(qe)return e();let n=!1;t||(qe=[]),it?n=!0:it=[],la++;try{let r=e();return rw(n),r}catch(r){n||(it=null),qe=null,da(r)}}function rw(e){if(qe&&(Fo&&V&&V.running?ow(qe):ud(qe),qe=null),e)return;let t;if(V){if(!V.promises.size&&!V.queue.size){let r=V.sources,o=V.disposed;it.push.apply(it,V.effects),t=V.resolve;for(let i of it)"tState"in i&&(i.state=i.tState),delete i.tState;V=null,Bt(()=>{for(let i of o)Rn(i);for(let i of r){if(i.value=i.tValue,i.owned)for(let a=0,s=i.owned.length;a<s;a++)Rn(i.owned[a]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}Ju(!1)},!1)}else if(V.running){V.running=!1,V.effects.push.apply(V.effects,it),it=null,Ju(!0);return}}let n=it;it=null,n.length&&Bt(()=>rd(n),!1),t&&t()}function ud(e){for(let t=0;t<e.length;t++)Bo(e[t])}function ow(e){for(let t=0;t<e.length;t++){let n=e[t],r=V.queue;r.has(n)||(r.add(n),Fo(()=>{r.delete(n),Bt(()=>{V.running=!0,Bo(n)},!1),V&&(V.running=!1)}))}}function iw(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Bo(r)}if(ve.context){if(ve.count){ve.effects||(ve.effects=[]),ve.effects.push(...e.slice(0,n));return}pl()}for(ve.effects&&(ve.done||!ve.count)&&(e=[...ve.effects,...e],n+=ve.effects.length,delete ve.effects),t=0;t<n;t++)Bo(e[t])}function aa(e,t){let n=V&&V.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=n?o.tState:o.state;i===Et?o!==t&&(!o.updatedAt||o.updatedAt<la)&&Bo(o):i===$o&&aa(o,t)}}}function dd(e){let t=V&&V.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=$o:r.state=$o,r.pure?qe.push(r):it.push(r),r.observers&&dd(r))}}function Rn(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),a=n.observerSlots.pop();r<o.length&&(i.sourceSlots[a]=r,o[r]=i,n.observerSlots[r]=a)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Rn(e.tOwned[t]);delete e.tOwned}if(V&&V.running&&e.pure)fd(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Rn(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}V&&V.running?e.tState=0:e.state=0}function fd(e,t){if(t||(e.tState=0,V.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)fd(e.owned[n])}function aw(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ed(e,t,n){try{for(let r of t)r(e)}catch(r){da(r,n&&n.owner||null)}}function da(e,t=be){let n=Zu&&t&&t.context&&t.context[Zu],r=aw(e);if(!n)throw r;it?it.push({fn(){ed(r,n,t)},state:Et}):ed(r,n,t)}function gl(e){if(typeof e=="function"&&!e.length)return gl(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=gl(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function sw(e,t){return function(r){let o;return A(()=>o=ze(()=>(be.context={...be.context,[e]:r.value},ua(()=>r.children))),void 0),o}}var lw=Symbol("fallback");function td(e){for(let t=0;t<e.length;t++)e[t]()}function cw(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return se(()=>td(i)),()=>{let c=e()||[],l=c.length,u,f;return c[sa],ze(()=>{let p,h,g,v,y,T,C,E,I;if(l===0)a!==0&&(td(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[lw],o[0]=tr(U=>(i[0]=U,n.fallback())),a=1);else if(a===0){for(o=new Array(l),f=0;f<l;f++)r[f]=c[f],o[f]=tr(d);a=l}else{for(g=new Array(l),v=new Array(l),s&&(y=new Array(l)),T=0,C=Math.min(a,l);T<C&&r[T]===c[T];T++);for(C=a-1,E=l-1;C>=T&&E>=T&&r[C]===c[E];C--,E--)g[E]=o[C],v[E]=i[C],s&&(y[E]=s[C]);for(p=new Map,h=new Array(E+1),f=E;f>=T;f--)I=c[f],u=p.get(I),h[f]=u===void 0?-1:u,p.set(I,f);for(u=T;u<=C;u++)I=r[u],f=p.get(I),f!==void 0&&f!==-1?(g[f]=o[u],v[f]=i[u],s&&(y[f]=s[u]),f=h[f],p.set(I,f)):i[u]();for(f=T;f<l;f++)f in g?(o[f]=g[f],i[f]=v[f],s&&(s[f]=y[f],s[f](f))):o[f]=tr(d);o=o.slice(0,a=l),r=c.slice(0)}return o});function d(p){if(i[f]=p,s){let[h,g]=O(f);return s[f]=g,t(c[f],h)}return t(c[f])}}}var uw=!1;function m(e,t){if(uw&&ve.context){let n=ve.context;pl(ew());let r=ze(()=>e(t||{}));return pl(n),r}return ze(()=>e(t||{}))}function oa(){return!0}var hl={get(e,t,n){return t===kt?n:e.get(t)},has(e,t){return t===kt?!0:e.has(t)},set:oa,deleteProperty:oa,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:oa,deleteProperty:oa}},ownKeys(e){return e.keys()}};function fl(e){return(e=typeof e=="function"?e():e)?e:{}}function dw(){for(let e=0,t=this.length;e<t;++e){let n=this[e]();if(n!==void 0)return n}}function Se(...e){let t=!1;for(let a=0;a<e.length;a++){let s=e[a];t=t||!!s&&kt in s,e[a]=typeof s=="function"?(t=!0,B(s)):s}if(nd&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let c=fl(e[s])[a];if(c!==void 0)return c}},has(a){for(let s=e.length-1;s>=0;s--)if(a in fl(e[s]))return!0;return!1},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(fl(e[s])));return[...new Set(a)]}},hl);let n={},r=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let c=Object.getOwnPropertyNames(s);for(let l=c.length-1;l>=0;l--){let u=c[l];if(u==="__proto__"||u==="constructor")continue;let f=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=f.get?{enumerable:!0,configurable:!0,get:dw.bind(n[u]=[f.get.bind(s)])}:f.value!==void 0?f:void 0;else{let d=n[u];d&&(f.get?d.push(f.get.bind(s)):f.value!==void 0&&d.push(()=>f.value))}}}let o={},i=Object.keys(r);for(let a=i.length-1;a>=0;a--){let s=i[a],c=r[s];c&&c.get?Object.defineProperty(o,s,c):o[s]=c?c.value:void 0}return o}function Be(e,...t){if(nd&&kt in e){let o=new Set(t.length>1?t.flat():t[0]),i=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},hl));return i.push(new Proxy({get(a){return o.has(a)?void 0:e[a]},has(a){return o.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!o.has(a))}},hl)),i}let n={},r=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=!1,c=0;for(let l of t)l.includes(o)&&(s=!0,a?r[c][o]=i.value:Object.defineProperty(r[c],o,i)),++c;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}var fw=0;function Jt(){return ve.context?ve.getNextContextId():`cl-${fw++}`}var pd=e=>`Stale read from <${e}>.`;function he(e){let t="fallback"in e&&{fallback:()=>e.fallback};return B(cw(()=>e.each,e.children,t||void 0))}function N(e){let t=e.keyed,n=B(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return B(()=>{let r=n();if(r){let o=e.children;return typeof o=="function"&&o.length>0?ze(()=>o(t?r:()=>{if(!ze(n))throw pd("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Ee(e){let t=!1,n=(i,a)=>(t?i[1]===a[1]:!i[1]==!a[1])&&i[2]===a[2],r=ua(()=>e.children),o=B(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let a=0;a<i.length;a++){let s=i[a].when;if(s)return t=!!i[a].keyed,[a,s,i[a]]}return[-1]},void 0,{equals:n});return B(()=>{let[i,a,s]=o();if(i<0)return e.fallback;let c=s.children;return typeof c=="function"&&c.length>0?ze(()=>c(t?a:()=>{if(ze(o)[0]!==i)throw pd("Match");return s.when})):c},void 0,void 0)}function q(e){return e}var pw=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],mw=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...pw]),gw=new Set(["innerHTML","textContent","innerText","children"]),hw=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bw=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function yw(e,t){let n=bw[e];return typeof n=="object"?n[t]?n.$:void 0:n}var xw=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),vw=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ww={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Sw(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,c=t[o-1].nextSibling,l=null;for(;a<o||s<i;){if(t[a]===n[s]){a++,s++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===a){let u=i<r?s?n[s-1].nextSibling:n[i-s]:c;for(;s<i;)e.insertBefore(n[s++],u)}else if(i===s)for(;a<o;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){let u=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!l){l=new Map;let f=s;for(;f<i;)l.set(n[f],f++)}let u=l.get(t[a]);if(u!=null)if(s<u&&u<i){let f=a,d=1,p;for(;++f<o&&f<i&&!((p=l.get(t[f]))==null||p!==u+d);)d++;if(d>u-s){let h=t[a];for(;s<u;)e.insertBefore(n[s++],h)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}}var md="_$DX_DELEGATE";function S(e,t,n){let r,o=()=>{let a=document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:a.content.firstChild},i=t?()=>ze(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Me(e,t=window.document){let n=t[md]||(t[md]=new Set);for(let r=0,o=e.length;r<o;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Iw))}}function j(e,t,n){nr(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Tw(e,t,n,r){nr(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Cw(e,t,n){nr(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function $(e,t){nr(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Fe(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function _w(e,t,n={}){let r=Object.keys(t||{}),o=Object.keys(n),i,a;for(i=0,a=o.length;i<a;i++){let s=o[i];!s||s==="undefined"||t[s]||(gd(e,s,!1),delete n[s])}for(i=0,a=r.length;i<a;i++){let s=r[i],c=!!t[s];!s||s==="undefined"||n[s]===c||!c||(gd(e,s,!0),n[s]=c)}return n}function vl(e,t,n){if(!t)return n?j(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Te(e,t={},n,r){let o={};return r||A(()=>o.children=Hr(e,t.children,o.children)),A(()=>typeof t.ref=="function"&&de(t.ref,e)),A(()=>kw(e,t,n,!0,o,!0)),o}function de(e,t,n){return ze(()=>e(t,n))}function x(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Hr(e,t,r,n);A(o=>Hr(e,t(),o,n),r)}function kw(e,t,n,r,o={},i=!1){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=hd(e,a,null,o[a],n,i,t)}for(let a in t){if(a==="children"){r||Hr(e,t.children);continue}let s=t[a];o[a]=hd(e,a,s,o[a],n,i,t)}}function Ew(e){let t,n;return!nr()||!(t=ve.registry.get(n=Aw()))?e():(ve.completed&&ve.completed.add(t),ve.registry.delete(n),t)}function nr(e){return!!ve.context&&!ve.done&&(!e||e.isConnected)}function Pw(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function gd(e,t,n){let r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function hd(e,t,n,r,o,i,a){let s,c,l,u,f;if(t==="style")return vl(e,n,r);if(t==="classList")return _w(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){let d=t.slice(3);r&&e.removeEventListener(d,r,typeof r!="function"&&r),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){let d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){let d=t.slice(2).toLowerCase(),p=xw.has(d);if(!p&&r){let h=Array.isArray(r)?r[0]:r;e.removeEventListener(d,h)}(p||n)&&(Fe(e,d,n,p),p&&Me([d]))}else if(t.slice(0,5)==="attr:")j(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Cw(e,t.slice(5),n);else if((f=t.slice(0,5)==="prop:")||(l=gw.has(t))||!o&&((u=yw(t,e.tagName))||(c=mw.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(f)t=t.slice(5),c=!0;else if(nr(e))return n;t==="class"||t==="className"?$(e,n):s&&!c&&!l?e[Pw(t)]=n:e[u||t]=n}else{let d=o&&t.indexOf(":")>-1&&ww[t.split(":")[0]];d?Tw(e,d,t,n):j(e,hw[t]||t,n)}return n}function Iw(e){if(ve.registry&&ve.events&&ve.events.find(([c,l])=>l===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),a=()=>{let c=t[n];if(c&&!t.disabled){let l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),ve.registry&&!ve.done&&(ve.done=_$HY.done=!0),e.composedPath){let c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!a());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function Hr(e,t,n,r,o){let i=nr(e);if(i){!n&&(n=[...e.childNodes]);let c=[];for(let l=0;l<n.length;l++){let u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():c.push(u)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;let a=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(i||a==="number"&&(t=t.toString(),t===n))return n;if(s){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=Vr(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean"){if(i)return n;n=Vr(e,n,r)}else{if(a==="function")return A(()=>{let c=t();for(;typeof c=="function";)c=c();n=Hr(e,c,n,r)}),()=>n;if(Array.isArray(t)){let c=[],l=n&&Array.isArray(n);if(xl(c,t,n,o))return A(()=>n=Hr(e,c,n,r,!0)),()=>n;if(i){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let u=c[0];if(u.parentNode!==e)return n;let f=[u];for(;(u=u.nextSibling)!==r;)f.push(u);return n=f}if(c.length===0){if(n=Vr(e,n,r),s)return n}else l?n.length===0?bd(e,c,r):Sw(e,n,c):(n&&Vr(e),bd(e,c));n=c}else if(t.nodeType){if(i&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Vr(e,n,r,t);Vr(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function xl(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let s=t[i],c=n&&n[e.length],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=xl(e,s,c)||o;else if(l==="function")if(r){for(;typeof s=="function";)s=s();o=xl(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||o}else e.push(s),o=!0;else{let u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function bd(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Vr(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let s=t[a];if(o!==s){let c=s.parentNode===e;!i&&!a?c?e.replaceChild(o,s):e.insertBefore(o,n):c&&s.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Aw(){return ve.getNextContextId()}var M1=Symbol();var Ow="http://www.w3.org/2000/svg";function yd(e,t=!1){return t?document.createElementNS(Ow,e):document.createElement(e)}function xd(e){let{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=jr(),i,a=!!ve.context;return ge(()=>{a&&(jr().user=a=!1),i||(i=ad(o,()=>B(()=>e.children)));let s=r();if(s instanceof HTMLHeadElement){let[c,l]=O(!1),u=()=>l(!0);tr(f=>x(s,()=>c()?f():i(),null)),se(u)}else{let c=yd(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),x(l,i),s.appendChild(c),e.ref&&e.ref(c),se(()=>s.removeChild(c))}},void 0,{render:!a}),n}function vd(e){let[t,n]=Be(e,["component"]),r=B(()=>t.component);return B(()=>{let o=r();switch(typeof o){case"function":return ze(()=>o(n));case"string":let i=vw.has(o),a=ve.context?Ew():yd(o,i);return Te(a,n,i),a}})}function Rw(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(a){i(()=>a)}})}return n}function Mw(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Dw(e){return(t,n)=>{let{element:r}=n;return tr(o=>{let i=Rw(t);r.addPropertyChangedCallback((s,c)=>i[s]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});let a=e(i,n);return x(r.renderRoot,a)},Mw(r))}}function fa(e,t,n){return arguments.length===2&&(n=t,t={}),Yu(e,t)(Dw(n))}var pa={id:void 0,agent:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},wd={...pa,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Sd={...pa,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0};var Td=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e))},zr=()=>sessionStorage.getItem("agentPaymentInProgress"),ma=()=>{sessionStorage.removeItem("agentPaymentInProgress")};var Gr=class extends Error{constructor(t){super("This agent can only be executed on "+t)}};var Qt=(e,t)=>{if(typeof window<"u")return window.__ENV?window.__ENV[e]??t:void 0;if(!(typeof process>"u"))return process.env[e]??t};var Lw="https://r0.ar",bt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{let t=Qt("NEXT_PUBLIC_CHAT_API_URL"),n=Qt("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some(i=>i===window.location.href)))return t;let r=Qt("NEXT_PUBLIC_VIEWER_URL")?.split(",");return r?.find(i=>window.location.href.startsWith(i))??r?.[0]??Lw};function Cd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Cd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Pt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Cd(e))&&(r&&(r+=" "),r+=t);return r}var pe=Pt;var Tl="-",Nw=e=>{let t=Bw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let s=a.split(Tl);return s[0]===""&&s.length!==1&&s.shift(),Ed(s,t)||$w(a)},getConflictingClassGroupIds:(a,s)=>{let c=n[a]||[];return s&&r[a]?[...c,...r[a]]:c}}},Ed=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?Ed(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join(Tl);return t.validators.find(({validator:a})=>a(i))?.classGroupId},_d=/^\[(.+)\]$/,$w=e=>{if(_d.test(e)){let t=_d.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bw=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Uw(Object.entries(e.classGroups),n).forEach(([i,a])=>{Sl(a,r,i,t)}),r},Sl=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:kd(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Fw(o)){Sl(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Sl(a,kd(t,i),n,r)})})},kd=(e,t)=>{let n=e;return t.split(Tl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fw=e=>e.isThemeGetter,Uw=(e,t)=>t?e.map(([n,r])=>{let o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,jw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Pd="!",Vw=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=s=>{let c=[],l=0,u=0,f;for(let v=0;v<s.length;v++){let y=s[v];if(l===0){if(y===o&&(r||s.slice(v,v+i)===t)){c.push(s.slice(u,v)),u=v+i;continue}if(y==="/"){f=v;continue}}y==="["?l++:y==="]"&&l--}let d=c.length===0?s:s.substring(u),p=d.startsWith(Pd),h=p?d.substring(1):d,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}};return n?s=>n({className:s,parseClassName:a}):a},Hw=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},zw=e=>({cache:jw(e.cacheSize),parseClassName:Vw(e),...Nw(e)}),Gw=/\s+/,Ww=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Gw),s="";for(let c=a.length-1;c>=0;c-=1){let l=a[c],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}=n(l),h=!!p,g=r(h?d.substring(0,p):d);if(!g){if(!h){s=l+(s.length>0?" "+s:s);continue}if(g=r(d),!g){s=l+(s.length>0?" "+s:s);continue}h=!1}let v=Hw(u).join(":"),y=f?v+Pd:v,T=y+g;if(i.includes(T))continue;i.push(T);let C=o(g,h);for(let E=0;E<C.length;++E){let I=C[E];i.push(y+I)}s=l+(s.length>0?" "+s:s)}return s};function qw(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Id(t))&&(r&&(r+=" "),r+=n);return r}var Id=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Id(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kw(e,...t){let n,r,o,i=a;function a(c){let l=t.reduce((u,f)=>f(u),e());return n=zw(l),r=n.cache.get,o=n.cache.set,i=s,s(c)}function s(c){let l=r(c);if(l)return l;let u=Ww(c,n);return o(c,u),u}return function(){return i(qw.apply(null,arguments))}}var De=e=>{let t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ad=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yw=/^\d+\/\d+$/,Xw=new Set(["px","full","screen"]),Zw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,e0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,t0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=e=>Wr(e)||Xw.has(e)||Yw.test(e),Mn=e=>qr(e,"length",c0),Wr=e=>!!e&&!Number.isNaN(Number(e)),wl=e=>qr(e,"number",Wr),jo=e=>!!e&&Number.isInteger(Number(e)),n0=e=>e.endsWith("%")&&Wr(e.slice(0,-1)),me=e=>Ad.test(e),Dn=e=>Zw.test(e),r0=new Set(["length","size","percentage"]),o0=e=>qr(e,r0,Od),i0=e=>qr(e,"position",Od),a0=new Set(["image","url"]),s0=e=>qr(e,a0,d0),l0=e=>qr(e,"",u0),Vo=()=>!0,qr=(e,t,n)=>{let r=Ad.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},c0=e=>Jw.test(e)&&!Qw.test(e),Od=()=>!1,u0=e=>e0.test(e),d0=e=>t0.test(e);var f0=()=>{let e=De("colors"),t=De("spacing"),n=De("blur"),r=De("brightness"),o=De("borderColor"),i=De("borderRadius"),a=De("borderSpacing"),s=De("borderWidth"),c=De("contrast"),l=De("grayscale"),u=De("hueRotate"),f=De("invert"),d=De("gap"),p=De("gradientColorStops"),h=De("gradientColorStopPositions"),g=De("inset"),v=De("margin"),y=De("opacity"),T=De("padding"),C=De("saturate"),E=De("scale"),I=De("sepia"),U=De("skew"),R=De("space"),oe=De("translate"),H=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",me,t],P=()=>[me,t],_=()=>["",hn,Mn],w=()=>["auto",Wr,me],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",me],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],we=()=>[Wr,me];return{cacheSize:500,separator:":",theme:{colors:[Vo],spacing:[hn,Mn],blur:["none","",Dn,me],brightness:we(),borderColor:[e],borderRadius:["none","","full",Dn,me],borderSpacing:P(),borderWidth:_(),contrast:we(),grayscale:le(),hueRotate:we(),invert:le(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[n0,Mn],inset:L(),margin:L(),opacity:we(),padding:P(),saturate:we(),scale:we(),sepia:le(),skew:we(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[Dn]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),me]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jo,me]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",jo,me]}],"grid-cols":[{"grid-cols":[Vo]}],"col-start-end":[{col:["auto",{span:["full",jo,me]},me]}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":[Vo]}],"row-start-end":[{row:["auto",{span:[jo,me]},me]}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...ue()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ue(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ue(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[Dn]},Dn]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Dn,Mn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wl]}],"font-family":[{font:[Vo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",Wr,wl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hn,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hn,Mn]}],"underline-offset":[{"underline-offset":["auto",hn,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),i0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},s0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:D()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[hn,me]}],"outline-w":[{outline:[hn,Mn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[hn,Mn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Dn,l0]}],"shadow-color":[{shadow:[Vo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Dn,me]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:we()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:we()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[jo,me]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hn,Mn,wl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Rd=Kw(f0);var eS=Fr(Pf(),1),tS=Fr(Af(),1);var tA=String.fromCharCode;var Of=async e=>{let t;try{let n=typeof e=="string"?e:e.url;t=await fetch(n,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&re(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&re(e.body)?JSON.stringify(e.body):void 0});let r=await t.json();if(!t.ok)throw typeof r=="object"&&r!==null&&"error"in r?r.error:r;return{data:r,response:t}}catch(n){return console.error(n),{error:n,response:t}}},re=e=>e!=null,Ge=e=>e==null,$e=e=>e==null||e==="",Ce=e=>e!=null&&e!=="";var Rf=e=>{e.split("</noscript>").forEach(n=>{let[r,o]=n.split("<noscript>"),i=document.createRange().createContextualFragment(r??"");if(document.head.append(i),Ge(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a)})};var Ft=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var en=class extends Error{constructor(t,n,r){let o=t.status||t.status===0?t.status:"",i=t.statusText||"",a=`${o} ${i}`.trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=n,this.options=r}};var Qr=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}};var Ko=e=>e!==null&&typeof e=="object";var Yo=(...e)=>{for(let t of e)if((!Ko(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return xa({},...e)},Ol=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[i,a]of o.entries())r&&a==="undefined"||a===void 0?n.delete(i):n.set(i,a);return n},xa=(...e)=>{let t={},n={};for(let r of e)if(Array.isArray(r))Array.isArray(t)||(t=[]),t=[...t,...r];else if(Ko(r)){for(let[o,i]of Object.entries(r))Ko(i)&&o in t&&(i=xa(t[o],i)),t={...t,[o]:i};Ko(r.headers)&&(n=Ol(n,r.headers),t.headers=n)}return t};var Mf=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";return n&&r&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),Df=typeof globalThis.AbortController=="function",Lf=typeof globalThis.ReadableStream=="function",Nf=typeof globalThis.FormData=="function",va=["get","post","put","patch","head","delete"],nS=()=>{};nS();var $f={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},wa=2147483647,Sa=Symbol("stop"),Bf={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},Ff={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var jf=e=>va.includes(e)?e.toUpperCase():e,rS=["get","put","head","delete","options","trace"],oS=[408,413,429,500,502,503,504],Vf=[413,429,503],Uf={limit:2,methods:rS,statusCodes:oS,afterStatusCodes:Vf,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Hf=(e={})=>{if(typeof e=="number")return{...Uf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Uf,...e,afterStatusCodes:Vf}};async function Rl(e,t,n,r){return new Promise((o,i)=>{let a=setTimeout(()=>{n&&n.abort(),i(new Qr(e))},r.timeout);r.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a)})})}async function Ml(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(i),r(t.reason)}let i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var zf=(e,t)=>{let n={};for(let r in t)!(r in Ff)&&!(r in Bf)&&!(r in e)&&(n[r]=t[r]);return n};var Xo=class e{static create(t,n){let r=new e(t,n),o=async()=>{if(typeof r._options.timeout=="number"&&r._options.timeout>wa)throw new RangeError(`The \`timeout\` option cannot be greater than ${wa}`);await Promise.resolve();let s=await r._fetch();for(let c of r._options.hooks.afterResponse){let l=await c(r.request,r._options,r._decorateResponse(s.clone()));l instanceof globalThis.Response&&(s=l)}if(r._decorateResponse(s),!s.ok&&r._options.throwHttpErrors){let c=new en(s,r.request,r._options);for(let l of r._options.hooks.beforeError)c=await l(c);throw c}if(r._options.onDownloadProgress){if(typeof r._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Lf)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(s.clone(),r._options.onDownloadProgress)}return s},a=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(let[s,c]of Object.entries($f))a[s]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||c);let u=(await a).clone();if(s==="json"){if(u.status===204||(await u.clone().arrayBuffer()).byteLength===0)return"";if(n.parseJson)return n.parseJson(await u.text())}return u[s]()};return a}constructor(t,n={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t;let r=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...r&&{credentials:r},...n,headers:Ol(this._input.headers,n.headers),hooks:xa({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:jf(n.method??this._input.method),prefixUrl:String(n.prefixUrl||""),retry:Hf(n.retry),throwHttpErrors:n.throwHttpErrors!==!1,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Df){if(this.abortController=new globalThis.AbortController,this._options.signal){let o=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(o.reason)})}this._options.signal=this.abortController.signal}if(Mf&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Nf&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof Qr)){if(t instanceof en){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let r=t.response.headers.get("Retry-After");if(r&&this._options.retry.afterStatusCodes.includes(t.response.status)){let o=Number(r);return Number.isNaN(o)?o=Date.parse(r)-Date.now():o*=1e3,this._options.retry.maxRetryAfter!==void 0&&o>this._options.retry.maxRetryAfter?0:o}if(t.response.status===413)return 0}let n=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,n)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(n){let r=Math.min(this._calculateRetryDelay(n),wa);if(r!==0&&this._retryCount>0){await Ml(r,{signal:this._options.signal});for(let o of this._options.hooks.beforeRetry)if(await o({request:this.request,options:this._options,error:n,retryCount:this._retryCount})===Sa)return;return this._retry(t)}throw n}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let r=await n(this.request,this._options);if(r instanceof Request){this.request=r;break}if(r instanceof Response)return r}let t=zf(this.request,this._options);return this._options.timeout===!1?this._options.fetch(this.request.clone(),t):Rl(this.request.clone(),t,this.abortController,this._options)}_stream(t,n){let r=Number(t.headers.get("content-length"))||0,o=0;return t.status===204?(n&&n({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(i){let a=t.body.getReader();n&&n({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function s(){let{done:c,value:l}=await a.read();if(c){i.close();return}if(n){o+=l.byteLength;let u=r===0?0:o/r;n({percent:u,transferredBytes:o,totalBytes:r},l)}i.enqueue(l),await s()}await s()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Dl=e=>{let t=(n,r)=>Xo.create(n,Yo(e,r));for(let n of va)t[n]=(r,o)=>Xo.create(r,Yo(e,o,{method:n}));return t.create=n=>Dl(Yo(n)),t.extend=n=>Dl(Yo(e,n)),t.stop=Sa,t},iS=Dl(),$n=iS;async function Gf({agent:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(Ge(e))throw new Error("Agent is required to start the chat");let c=zr()??void 0,l=c?JSON.parse(c):void 0;if(l)return aS({apiHost:n,stripeRedirectStatus:i,paymentInProgressState:l});let u=typeof e=="string"?e:e.id;if(t)return sS({apiHost:n,agentId:u,startFrom:a,agent:e,prefilledVariables:r,sessionId:s});try{let f=parent!==window&&Ce(document.referrer)?new URL(document.referrer).origin:void 0,d=await $n.post(`${Ll(n)}/api/v1/agents/${u}/startChat`,{headers:{"x-agent-iframe-referrer-origin":f},json:{isStreamEnabled:!0,prefilledVariables:r,resultId:o,isOnlyRegistering:!1},timeout:!1}),p=d.headers.get("access-control-allow-origin");if(f&&p&&p!=="*"&&!f.includes(p))throw new Gr(p);return{data:await d.json()}}catch(f){return{error:f}}}var aS=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:n})=>{ma();try{return{data:{...await $n.post(`${Ll(e)}/api/v1/sessions/${n.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...n}}}catch(r){return{error:r}}},sS=async({apiHost:e,agentId:t,startFrom:n,agent:r,prefilledVariables:o,sessionId:i})=>{try{return{data:await $n.post(`${Ll(e)}/api/v1/agents/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:n,agent:r,prefilledVariables:o,sessionId:i},timeout:!1}).json()}}catch(a){return{error:a}}},Ll=e=>Ce(e)?e:bt();var[Wf,qf]=O("100%");var[YA,Kf]=O();var Ta="#303235",Ca="#FFFFFF",Yf="Google",eo="Open Sans",to="Color",Zo="#ffffff";var Xf="#000",Zf="#000",Jf=2,_a="absolute",Qf="Top",or="medium",dt=1,ep=0,tp="800px",np="100%",Jo="transparent";var no="#F7F8FF",rp=Ta,op="#FF8E21",ip=Ca,Qo="#0042DA",ap=Ca,sp=1;var lp="#FFFFFF",ei=Ta,cp="#9095A0",up="md";var ro=!0,ti=!1;var lS="https://fonts.bunny.net/css2",ka="agent-font",Nl=e=>{let t=document.getElementById(ka);if(typeof e=="string"||e.type==="Google"){let n=(typeof e=="string"?e:e.family)??eo;if(t?.getAttribute("href")?.includes(n))return;t?.remove();let r=document.createElement("link");r.href=`${lS}?family=${n}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,r.rel="stylesheet",r.id=ka,document.head.appendChild(r);return}if(e.type==="Custom"){if(Ce(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let n=document.createElement("style");n.innerHTML=e.css,n.id=ka,document.head.appendChild(n)}if(Ce(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=ka,document.head.appendChild(n)}}};var[K,dp]=O();var Je={general:{isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},typingEmulation:{enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},metadata:{description:"Automate customer interactions with Release0. Build AI agents that respond, collect data, and integrate seamlessly\u2014without writing code.",favIconUrl:e=>e+"/favicon.png",imageUrl:e=>e+"/site-preview.png"}};var $l=Symbol("store-raw"),io=Symbol("store-node"),yn=Symbol("store-has"),fp=Symbol("store-self");function pp(e){let t=e[kt];if(!t&&(Object.defineProperty(e,kt,{value:t=new Proxy(e,dS)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){let a=n[o];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function Bn(e){let t;return e!=null&&typeof e=="object"&&(e[kt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function ao(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[$l])return n;if(!Bn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)o=e[a],(r=ao(o,t))!==o&&(e[a]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let c=0,l=a.length;c<l;c++)i=a[c],!s[i].get&&(o=e[i],(r=ao(o,t))!==o&&(e[i]=r))}return e}function Ea(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function ri(e,t,n){if(e[t])return e[t];let[r,o]=O(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function cS(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===kt||t===io||(delete n.value,delete n.writable,n.get=()=>e[kt][t]),n}function mp(e){ca()&&ri(Ea(e,io),fp)()}function uS(e){return mp(e),Reflect.ownKeys(e)}var dS={get(e,t,n){if(t===$l)return e;if(t===kt)return n;if(t===sa)return mp(e),n;let r=Ea(e,io),o=r[t],i=o?o():e[t];if(t===io||t===yn||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t);ca()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=ri(r,t,i)())}return Bn(i)?pp(i):i},has(e,t){return t===$l||t===kt||t===sa||t===io||t===yn||t==="__proto__"?!0:(ca()&&ri(Ea(e,yn),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:uS,getOwnPropertyDescriptor:cS};function It(e,t,n,r=!1){if(!r&&e[t]===n)return;let o=e[t],i=e.length;n===void 0?(delete e[t],e[yn]&&e[yn][t]&&o!==void 0&&e[yn][t].$()):(e[t]=n,e[yn]&&e[yn][t]&&o===void 0&&e[yn][t].$());let a=Ea(e,io),s;if((s=ri(a,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(s=a[c])&&s.$();(s=ri(a,"length",i))&&s.$(e.length)}(s=a[fp])&&s.$()}function gp(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];It(e,o,t[o])}}function fS(e,t){if(typeof t=="function"&&(t=t(e)),t=ao(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let o=t[n];e[n]!==o&&It(e,n,o)}It(e,"length",r)}else gp(e,t)}function ni(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();let a=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c<r.length;c++)ni(e,[r[c]].concat(t),n);return}else if(s&&a==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&ni(e,[c].concat(t),n);return}else if(s&&a==="object"){let{from:c=0,to:l=e.length-1,by:u=1}=r;for(let f=c;f<=l;f+=u)ni(e,[f].concat(t),n);return}else if(t.length>1){ni(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=ao(i),r===void 0||Bn(o)&&Bn(i)&&!Array.isArray(i)?gp(o,i):It(e,r,i))}function hp(...[e,t]){let n=ao(e||{}),r=Array.isArray(n),o=pp(n);function i(...a){id(()=>{r&&a.length===1?fS(n,a[0]):ni(n,a)})}return[o,i]}var Bl=Symbol("store-root");function oo(e,t,n,r,o){let i=t[n];if(e===i)return;let a=Array.isArray(e);if(n!==Bl&&(!Bn(e)||!Bn(i)||a!==Array.isArray(i)||o&&e[o]!==i[o])){It(t,n,e);return}if(a){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let l,u,f,d,p,h,g,v;for(f=0,d=Math.min(i.length,e.length);f<d&&(i[f]===e[f]||o&&i[f]&&e[f]&&i[f][o]===e[f][o]);f++)oo(e[f],i,f,r,o);let y=new Array(e.length),T=new Map;for(d=i.length-1,p=e.length-1;d>=f&&p>=f&&(i[d]===e[p]||o&&i[f]&&e[f]&&i[d][o]===e[p][o]);d--,p--)y[p]=i[d];if(f>p||f>d){for(u=f;u<=p;u++)It(i,u,e[u]);for(;u<e.length;u++)It(i,u,y[u]),oo(e[u],i,u,r,o);i.length>e.length&&It(i,"length",e.length);return}for(g=new Array(p+1),u=p;u>=f;u--)h=e[u],v=o&&h?h[o]:h,l=T.get(v),g[u]=l===void 0?-1:l,T.set(v,u);for(l=f;l<=d;l++)h=i[l],v=o&&h?h[o]:h,u=T.get(v),u!==void 0&&u!==-1&&(y[u]=i[l],u=g[u],T.set(v,u));for(u=f;u<e.length;u++)u in y?(It(i,u,y[u]),oo(e[u],i,u,r,o)):It(i,u,e[u])}else for(let l=0,u=e.length;l<u;l++)oo(e[l],i,l,r,o);i.length>e.length&&It(i,"length",e.length);return}let s=Object.keys(e);for(let l=0,u=s.length;l<u;l++)oo(e[s[l]],i,s[l],r,o);let c=Object.keys(i);for(let l=0,u=c.length;l<u;l++)e[c[l]]===void 0&&It(i,c[l],void 0)}function Pa(e,t={}){let{merge:n,key:r="id"}=t,o=ao(e);return i=>{if(!Bn(i)||!Bn(o))return o;let a=oo(o,{[Bl]:i},Bl,n,r);return a===void 0?i:a}}function tn(e,t){if(!t.storage)return[...e];let n=pS(t.storage||Je.general.rememberUser.storage),r=s=>{let c=JSON.parse(JSON.stringify(s));return typeof c!="object"||("blobUrl"in c&&(c.blobUrl=void 0),"attachments"in c&&Array.isArray(c.attachments)&&c.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0)})),JSON.stringify(c)},o=JSON.parse.bind(JSON),i=n.getItem(t.key),a=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](Pa(o(s)));return i&&(a(i),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let c=e[1](s);return s?n.setItem(t.key,r(c)):n.removeItem(t.key),c}:(...s)=>{e[1](...s);let c=r(ze(()=>e[0]));n.setItem(t.key,c)}]}var pS=e=>(e??Je.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var Ke=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(r,o,i,a)=>o+o+i+i+a+a);let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?[Number.parseInt(n[1]??"",16),Number.parseInt(n[2]??"",16),Number.parseInt(n[3]??"",16)]:[0,0,0]},xn=e=>(([t,n,r])=>(t*299+n*587+r*114)/1e3>155)(Ke(e));var bp=({chatContainer:e,generalBackground:t})=>{let n=e?.backgroundColor??Jo;if((e?.opacity??dt)<=.3||n==="transparent"||$e(n)){let o=t?.type??to,i=o==="Image"?"#000000":o==="Color"&&Ce(t?.content)?t.content:"#ffffff";return xn(i)}return xn(e?.backgroundColor??Zo)};var W={general:{bgImage:"--agent-container-bg-image",bgColor:"--agent-container-bg-color",fontFamily:"--agent-container-font-family",progressBar:{position:"--agent-progress-bar-position",color:"--agent-progress-bar-color",colorRgb:"--agent-progress-bar-bg-rgb",height:"--agent-progress-bar-height",top:"--agent-progress-bar-top",bottom:"--agent-progress-bar-bottom"}},chat:{container:{maxWidth:"--agent-chat-container-max-width",maxHeight:"--agent-chat-container-max-height",bgColor:"--agent-chat-container-bg-rgb",color:"--agent-chat-container-color",borderRadius:"--agent-chat-container-border-radius",borderWidth:"--agent-chat-container-border-width",borderColor:"--agent-chat-container-border-rgb",borderOpacity:"--agent-chat-container-border-opacity",opacity:"--agent-chat-container-opacity",blur:"--agent-chat-container-blur",boxShadow:"--agent-chat-container-box-shadow"},hostBubbles:{bgColor:"--agent-host-bubble-bg-rgb",color:"--agent-host-bubble-color",borderRadius:"--agent-host-bubble-border-radius",borderWidth:"--agent-host-bubble-border-width",borderColor:"--agent-host-bubble-border-rgb",borderOpacity:"--agent-host-bubble-border-opacity",opacity:"--agent-host-bubble-opacity",blur:"--agent-host-bubble-blur",boxShadow:"--agent-host-bubble-box-shadow"},guestBubbles:{bgColor:"--agent-guest-bubble-bg-rgb",color:"--agent-guest-bubble-color",borderRadius:"--agent-guest-bubble-border-radius",borderWidth:"--agent-guest-bubble-border-width",borderColor:"--agent-guest-bubble-border-rgb",borderOpacity:"--agent-guest-bubble-border-opacity",opacity:"--agent-guest-bubble-opacity",blur:"--agent-guest-bubble-blur",boxShadow:"--agent-guest-bubble-box-shadow"},inputs:{bgColor:"--agent-input-bg-rgb",color:"--agent-input-color",placeholderColor:"--agent-input-placeholder-color",borderRadius:"--agent-input-border-radius",borderWidth:"--agent-input-border-width",borderColor:"--agent-input-border-rgb",borderOpacity:"--agent-input-border-opacity",opacity:"--agent-input-opacity",blur:"--agent-input-blur",boxShadow:"--agent-input-box-shadow"},buttons:{bgRgb:"--agent-button-bg-rgb",color:"--agent-button-color",borderRadius:"--agent-button-border-radius",borderWidth:"--agent-button-border-width",borderColor:"--agent-button-border-rgb",borderOpacity:"--agent-button-border-opacity",opacity:"--agent-button-opacity",blur:"--agent-button-blur",boxShadow:"--agent-button-box-shadow"},checkbox:{bgRgb:"--agent-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},yp=(e,t,n)=>{if(!e)return;let r=t?.style;r&&(gS(e.general,r,n),bS(e.chat,e.general?.background,r))},gS=(e,t,n)=>{CS(e?.background,t),t.setProperty(W.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??eo),hS(e?.progressBar,t,n)},hS=(e,t,n)=>{let r=e?.position??_a;t.setProperty(W.general.progressBar.position,r==="fixed"?n?"absolute":"fixed":r),t.setProperty(W.general.progressBar.color,e?.color??Xf),t.setProperty(W.general.progressBar.colorRgb,Ke(e?.backgroundColor??Zf).join(", ")),t.setProperty(W.general.progressBar.height,`${e?.thickness??Jf}px`);let o=e?.placement??Qf;t.setProperty(W.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(W.general.progressBar.bottom,o==="Bottom"?"0":"auto")},bS=(e,t,n)=>{yS(e?.container,t,n,e?.roundness),xS(e?.hostBubbles,n,e?.roundness),vS(e?.guestBubbles,n,e?.roundness),wS(e?.buttons,n,e?.roundness),SS(e?.inputs,n,e?.roundness),TS(e?.container,t,n)},yS=(e,t,n,r)=>{let o=e?.backgroundColor??Jo,i=o==="transparent"||$e(o);n.setProperty(W.chat.container.bgColor,i?"0, 0, 0":Ke(o).join(", ")),n.setProperty(W.chat.container.color,Ke(e?.color??(bp({chatContainer:e,generalBackground:t})?Ta:Ca)).join(", ")),n.setProperty(W.chat.container.maxWidth,e?.maxWidth??tp),n.setProperty(W.chat.container.maxHeight,e?.maxHeight??np);let a=i?"1":(e?.opacity??dt).toString();n.setProperty(W.chat.container.opacity,i?"0":(e?.opacity??dt).toString()),n.setProperty(W.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??ep}px`),ii(e?.shadow,n,W.chat.container.boxShadow),oi(e?.border??{roundeness:r??or},n,W.chat.container.borderRadius),n.setProperty(W.chat.container.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),n.setProperty(W.chat.container.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():dt.toString()),n.setProperty(W.chat.container.borderColor,Ke(e?.border?.color??"").join(", "))},xS=(e,t,n)=>{t.setProperty(W.chat.hostBubbles.bgColor,Ke(e?.backgroundColor??no).join(", ")),t.setProperty(W.chat.hostBubbles.color,e?.color??rp),oi(e?.border??{roundeness:n??or},t,W.chat.hostBubbles.borderRadius),t.setProperty(W.chat.hostBubbles.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.hostBubbles.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(W.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():dt.toString()),t.setProperty(W.chat.hostBubbles.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():dt.toString()),t.setProperty(W.chat.hostBubbles.blur,re(e?.blur)?`${e.blur??0}px`:"none"),ii(e?.shadow,t,W.chat.hostBubbles.boxShadow)},vS=(e,t,n)=>{t.setProperty(W.chat.guestBubbles.bgColor,Ke(e?.backgroundColor??op).join(", ")),t.setProperty(W.chat.guestBubbles.color,e?.color??ip),oi(e?.border??{roundeness:n??or},t,W.chat.guestBubbles.borderRadius),t.setProperty(W.chat.guestBubbles.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.guestBubbles.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(W.chat.guestBubbles.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():dt.toString()),t.setProperty(W.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():dt.toString()),t.setProperty(W.chat.guestBubbles.blur,re(e?.blur)?`${e.blur??0}px`:"none"),ii(e?.shadow,t,W.chat.guestBubbles.boxShadow)},wS=(e,t,n)=>{let r=e?.backgroundColor??Qo;t.setProperty(W.chat.buttons.bgRgb,Ke(r).join(", ")),t.setProperty(W.chat.buttons.bgRgb,Ke(r).join(", ")),t.setProperty(W.chat.buttons.color,e?.color??ap),oi(e?.border??{roundeness:n??or},t,W.chat.buttons.borderRadius),t.setProperty(W.chat.buttons.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:`${sp}px`),t.setProperty(W.chat.buttons.borderColor,Ke(e?.border?.color??e?.backgroundColor??Qo).join(", ")),t.setProperty(W.chat.buttons.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():dt.toString()),t.setProperty(W.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():dt.toString()),t.setProperty(W.chat.buttons.blur,re(e?.blur)?`${e.blur??0}px`:"none"),ii(e?.shadow,t,W.chat.buttons.boxShadow)},SS=(e,t,n)=>{t.setProperty(W.chat.inputs.bgColor,Ke(e?.backgroundColor??lp).join(", ")),t.setProperty(W.chat.inputs.color,e?.color??ei),t.setProperty(W.chat.inputs.placeholderColor,e?.placeholderColor??cp),oi(e?.border??{roundeness:n??or},t,W.chat.inputs.borderRadius),t.setProperty(W.chat.inputs.borderWidth,re(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(W.chat.inputs.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(W.chat.inputs.borderOpacity,re(e?.border?.opacity)?e.border.opacity.toString():dt.toString()),t.setProperty(W.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":re(e?.opacity)?e.opacity.toString():dt.toString()),t.setProperty(W.chat.inputs.blur,re(e?.blur)?`${e.blur??0}px`:"none"),ii(e?.shadow??up,t,W.chat.inputs.boxShadow)},TS=(e,t,n)=>{let r=e?.backgroundColor??Jo;if(r==="transparent"||$e(r)||(e?.opacity??dt)<=.2){let i=t?.type??to;n.setProperty(W.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":Ke((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?n.setProperty(W.chat.checkbox.alphaRatio,"3"):n.setProperty(W.chat.checkbox.alphaRatio,t?.content&&xn(t?.content)?"1":"2")}else n.setProperty(W.chat.checkbox.bgRgb,Ke(r).concat(e?.opacity??1).join(", ")),n.setProperty(W.chat.checkbox.alphaRatio,xn(r)?"1":"2")},CS=(e,t)=>{t.setProperty(W.general.bgImage,null),t.setProperty(W.general.bgColor,null),t.setProperty((e?.type??to)==="Image"?W.general.bgImage:W.general.bgColor,_S({type:e?.type??to,content:e?.content??Zo}))},_S=({type:e,content:t}={})=>{switch(e){case"None":return"transparent";case void 0:case"Color":return t??Zo;case"Image":return`url(${t})`}},oi=(e,t,n)=>{switch(e?.roundeness??or){case"none":{t.setProperty(n,"0");break}case"medium":{t.setProperty(n,"6px");break}case"large":{t.setProperty(n,"20px");break}case"custom":{t.setProperty(n,`${e.customRoundeness??6}px`);break}}},ii=(e,t,n)=>{if(e===void 0){t.setProperty(n,"0 0 #0000");return}switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var Fl="resultId",xp=e=>{if(e)try{return sessionStorage.getItem(`${Fl}-${e}`)??localStorage.getItem(`${Fl}-${e}`)??void 0}catch{}},vp=(e="session")=>(t,n)=>{try{Sp(e).setItem(`${Fl}-${t}`,n)}catch{}},wp=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Ul=(e,{agentId:t,storage:n})=>{try{let r=JSON.stringify(e);Sp(n).setItem(`agent-${t}-initialChatReply`,r)}catch{}},Ia=()=>{try{sessionStorage.setItem("agent-typeOpened","true")}catch{}},Aa=()=>{try{sessionStorage.removeItem("agent-typeOpened")}catch{}},Oa=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return!1}},Sp=e=>(e??Je.general.rememberUser.storage)==="session"?sessionStorage:localStorage,Ra=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&sessionStorage.removeItem(t)})};var et=()=>(e,t)=>Be(e,t);function kS(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Ve(e={}){let{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,a=sd(i);function s(){let c=bl(a);if(!c&&t){let l=new Error(o??kS(n,r));throw l.name="ContextError",Error.captureStackTrace?.(l,s),l}return c}return[a.Provider,s,a]}var[jl,Tp]=Ve({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),ai=e=>et()(e,["lazyMount","unmountOnExit"]);var IO=Symbol(),ES=Symbol();var Cp=Object.getPrototypeOf,Vl=new WeakMap,PS=e=>e&&(Vl.has(e)?Vl.get(e):Cp(e)===Object.prototype||Cp(e)===Array.prototype);var _p=e=>PS(e)&&e[ES]||null,Hl=(e,t=!0)=>{Vl.set(e,t)};function IS(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function kp(e,t){let n=IS();return n?(n[e]||(n[e]=t()),n[e]):t()}var Ma=()=>!1,zl=e=>typeof e=="object"&&e!==null,ir=kp("__zag__proxyStateMap",()=>new WeakMap),si=kp("__zag__refSet",()=>new WeakSet),AS=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,OS=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,RS=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",MS=e=>AS(e)||OS(e)||RS(e),DS=(e=Object.is,t=(l,u)=>new Proxy(l,u),n=l=>zl(l)&&!si.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!MS(l)&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),r=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},o=new WeakMap,i=(l,u,f=r)=>{let d=o.get(l);if(d?.[0]===u)return d[1];let p=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Hl(p,!0),o.set(l,[u,p]),Reflect.ownKeys(l).forEach(h=>{let g=Reflect.get(l,h);si.has(g)?(Hl(g,!1),p[h]=g):g instanceof Promise?Object.defineProperty(p,h,{get(){return f(g)}}):ir.has(g)?p[h]=Fn(g,f):p[h]=g}),Object.freeze(p)},a=new WeakMap,s=[1,1],c=l=>{if(!zl(l))throw new Error("object required");let u=a.get(l);if(u)return u;let f=s[0],d=new Set,p=(H,G=++s[0])=>{f!==G&&(f=G,d.forEach(L=>L(H,G)))},h=s[1],g=(H=++s[1])=>(h!==H&&!d.size&&(h=H,y.forEach(([G])=>{let L=G[1](H);L>f&&(f=L)})),f),v=H=>(G,L)=>{let P=[...G];P[1]=[H,...P[1]],p(P,L)},y=new Map,T=(H,G)=>{if(Ma()&&y.has(H))throw new Error("prop listener already exists");if(d.size){let L=G[3](v(H));y.set(H,[G,L])}else y.set(H,[G])},C=H=>{let G=y.get(H);G&&(y.delete(H),G[1]?.())},E=H=>(d.add(H),d.size===1&&y.forEach(([L,P],_)=>{if(Ma()&&P)throw new Error("remove already exists");let w=L[3](v(_));y.set(_,[L,w])}),()=>{d.delete(H),d.size===0&&y.forEach(([L,P],_)=>{P&&(P(),y.set(_,[L]))})}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),R=t(I,{deleteProperty(H,G){let L=Reflect.get(H,G);C(G);let P=Reflect.deleteProperty(H,G);return P&&p(["delete",[G],L]),P},set(H,G,L,P){let _=Reflect.has(H,G),w=Reflect.get(H,G,P);if(_&&(e(w,L)||a.has(L)&&e(w,a.get(L))))return!0;C(G),zl(L)&&(L=_p(L)||L);let M=L;if(!Object.getOwnPropertyDescriptor(H,G)?.set)if(L instanceof Promise)L.then(D=>{Object.assign(L,{status:"fulfilled",value:D}),p(["resolve",[G],D])}).catch(D=>{Object.assign(L,{status:"rejected",reason:D}),p(["reject",[G],D])});else{!ir.has(L)&&n(L)&&(M=li(L));let D=!si.has(M)&&ir.get(M);D&&T(G,D)}return Reflect.set(H,G,M,P),p(["set",[G],L,w]),!0}});a.set(l,R);let oe=[I,g,i,E];return ir.set(R,oe),Reflect.ownKeys(l).forEach(H=>{let G=Object.getOwnPropertyDescriptor(l,H);G.get||G.set?Object.defineProperty(I,H,G):R[H]=l[H]}),R})=>[c,ir,si,e,t,n,r,o,i,a,s],[LS]=DS();function li(e={}){return LS(e)}function so(e,t,n){let r=ir.get(e);Ma()&&!r&&console.warn("Please use proxy object");let o,i=[],a=r[3],s=!1,l=a(u=>{if(i.push(u),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,s&&t(i.splice(0))}))});return s=!0,()=>{s=!1,l()}}function Fn(e,t){let n=ir.get(e);Ma()&&!n&&console.warn("Please use proxy object");let[r,o,i]=n;return i(r,o(),t)}function Tt(e){return si.add(e),e}function Ep(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");let i=t[o],{get:a,set:s}=typeof i=="function"?{get:i}:i,c={};c.get=()=>a(Fn(r)),s&&(c.set=l=>s(r,l)),Object.defineProperty(e,o,c)});let r=li(e);return r}var Ip=e=>e[0],Ap=e=>e[e.length-1];function Op(e){for(;e.length>0;)e.pop();return e}var Pp=e=>e?.constructor.name==="Array",NS=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Da(e[n],t[n]))return!1;return!0},Da=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Pp(e)&&Pp(t))return NS(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){let i=n[o];if(!Da(e[i],t[i]))return!1}return!0},vn=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,At=e=>e,La=()=>{},ci=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},ui=(()=>{let e=0;return()=>(e++,e.toString(36))})();var Rp=()=>!1,di=e=>Array.isArray(e);var Mp=e=>e!=null&&typeof e=="object",fi=e=>Mp(e)&&!di(e),pi=e=>typeof e=="number"&&!Number.isNaN(e),yt=e=>typeof e=="string",Un=e=>typeof e=="function",Dp=e=>e==null,Gl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$S=e=>Object.prototype.toString.call(e),Lp=Function.prototype.toString,BS=Lp.call(Object),Np=e=>{if(!Mp(e)||$S(e)!="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Gl(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Lp.call(n)==BS};function FS(e,t){let n={},r={},o=new Set(t);for(let i in e)o.has(i)?r[i]=e[i]:n[i]=e[i];return[r,n]}var nn=e=>function(n){return FS(n,e)};function st(e){if(!US(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=st(o))}return n}var US=e=>e&&typeof e=="object"&&e.constructor===Object;function wn(...e){let t=e.length===1?e[0]:e[1],n=e.length===2?e[0]:!0}function mi(...e){let t=e.length===1?e[0]:e[1],n=e.length===2?e[0]:!0}function $p(e,t,n){typeof n.value=="object"&&(n.value=ar(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function ar(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(a){o.add(ar(a))})):i==="[object Map]"?(o=new Map,e.forEach(function(a,s){o.set(ar(s),ar(a))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(ar(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)$p(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||$p(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}var jS=Object.defineProperty,VS=(e,t,n)=>t in e?jS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t,n)=>VS(e,typeof t!="symbol"?t+"":t,n);function Up(e,...t){for(let n of t){let r=st(n);for(let o in r)Np(n[o])?(e[o]||(e[o]={}),Up(e[o],n[o])):e[o]=n[o]}return e}function Bp(e){return ar(e)}function Ut(e){return yt(e)?{type:e}:e}function jn(e){return e?di(e)?e.slice():[e]:[]}function jp(e){return fi(e)&&e.predicate!=null}var HS=()=>!0;function ql(e,t,n,r){return o=>yt(o)?!!e[o]?.(t,n,r):Un(o)?o(t,n,r):o.predicate(e)(t,n,r)}function zS(...e){return{predicate:t=>(n,r,o)=>e.map(ql(t,n,r,o)).some(Boolean)}}function GS(...e){return{predicate:t=>(n,r,o)=>e.map(ql(t,n,r,o)).every(Boolean)}}function WS(e){return{predicate:t=>(n,r,o)=>!ql(t,n,r,o)(e)}}function qS(...e){return(t,n,r)=>r.state.matches(...e)}var Na={or:zS,and:GS,not:WS,stateIn:qS};function Vp(e,t){return e=e??HS,(n,r,o)=>{if(yt(e)){let i=t[e];return Un(i)?i(n,r,o):i}return jp(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function Wl(e,t){return(n,r,o)=>jp(e)?e.predicate(t)(n,r,o):e}function KS(e){let t=e.computed??At({}),n=e.context??At({}),r=e.initial?e.states?.[e.initial]?.tags:[],o=li({value:e.initial??"",previousValue:"",event:At({}),previousEvent:At({}),context:Ep(n,t),done:!1,tags:r??[],hasTag(i){return this.tags.includes(i)},matches(...i){return i.includes(this.value)},can(i){return At(this).nextEvents.includes(i)},get nextEvents(){let i=e.states?.[this.value]?.on??{},a=e?.on??{};return Object.keys({...i,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return At(o)}function gi(e,t){return(n,r)=>{if(pi(e))return e;if(Un(e))return e(n,r);if(yt(e)){let o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){let i=t?.[e];return mi(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Un(i)?i(n,r):i}}}}function YS(e){return yt(e)?{target:e}:e}function XS(e,t){return(n,r,o)=>jn(e).map(YS).find(i=>Vp(i.guard,t)(n,r,o)??i.target??i.actions)}var Hp=class{constructor(e,t){X(this,"status","Not Started"),X(this,"state"),X(this,"initialState"),X(this,"initialContext"),X(this,"id"),X(this,"type","machine"),X(this,"activityEvents",new Map),X(this,"delayedEvents",new Map),X(this,"stateListeners",new Set),X(this,"doneListeners",new Set),X(this,"contextWatchers",new Set),X(this,"removeStateListener",La),X(this,"parent"),X(this,"children",new Map),X(this,"guardMap"),X(this,"actionMap"),X(this,"delayMap"),X(this,"activityMap"),X(this,"sync"),X(this,"options"),X(this,"config"),X(this,"_created",()=>{let n=Ut("machine.created");this.executeActions(this.config?.created,n)}),X(this,"start",n=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=so(this.state,()=>{this.stateListeners.forEach(c=>{c(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Ut("machine.start"),jn(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Ut("machine.start"));let r=Ut("machine.init"),o=fi(n)?n.value:n,i=fi(n)?n.context:void 0;i&&this.setContext(i);let a={target:o??this.config.initial},s=this.getNextStateInfo(a,r);return this.initialState=s,this.performStateChangeEffects(this.state.value,s,r),this}),X(this,"setupContextWatchers",()=>{let{watch:n}=this.config;if(!n)return;let r=Fn(this.state.context),o=so(this.state.context,()=>{let i=Fn(this.state.context);for(let[a,s]of Object.entries(n))(this.options.compareFns?.[a]??Object.is)(r[a],i[a])||this.executeActions(s,this.state.event);r=i});this.contextWatchers.add(o)}),X(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Ut("machine.stop")),this.executeActions(this.config.exit,Ut("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),X(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),X(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(n=>n()),this.contextWatchers.clear()}),X(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(n=>{n.forEach(r=>r())}),this.delayedEvents.clear()}),X(this,"stopActivities",n=>{n?(this.activityEvents.get(n)?.forEach(r=>r()),this.activityEvents.get(n)?.clear(),this.activityEvents.delete(n)):(this.activityEvents.forEach(r=>{r.forEach(o=>o()),r.clear()}),this.activityEvents.clear())}),X(this,"sendChild",(n,r)=>{let o=Ut(n),i=vn(r,this.contextSnapshot),a=this.children.get(i);a||mi(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),a.send(o)}),X(this,"stopChild",n=>{this.children.has(n)||mi(`[@zag-js/core > stop-child] Cannot stop unknown child ${n}`),this.children.get(n).stop(),this.children.delete(n)}),X(this,"removeChild",n=>{this.children.delete(n)}),X(this,"stopChildren",()=>{this.children.forEach(n=>n.stop()),this.children.clear()}),X(this,"setParent",n=>{this.parent=n}),X(this,"spawn",(n,r)=>{let o=vn(n);return r&&(o.id=r),o.type="machine.actor",o.setParent(this),this.children.set(o.id,At(o)),o.onDone(()=>{this.removeChild(o.id)}).start(),At(Tt(o))}),X(this,"stopActivity",n=>{if(!this.state.value)return;let r=this.activityEvents.get(this.state.value);r?.get(n)?.(),r?.delete(n)}),X(this,"addActivityCleanup",(n,r,o)=>{n&&(this.activityEvents.has(n)?this.activityEvents.get(n)?.set(r,o):this.activityEvents.set(n,new Map([[r,o]])))}),X(this,"setState",n=>{this.state.previousValue=this.state.value,this.state.value=n;let r=this.getStateNode(n);n==null?Op(this.state.tags):this.state.tags=jn(r?.tags)}),X(this,"setContext",n=>{n&&Up(this.state.context,st(n))}),X(this,"setOptions",n=>{let r=st(n);this.actionMap={...this.actionMap,...r.actions},this.delayMap={...this.delayMap,...r.delays},this.activityMap={...this.activityMap,...r.activities},this.guardMap={...this.guardMap,...r.guards}}),X(this,"getStateNode",n=>{if(n)return this.config.states?.[n]}),X(this,"getNextStateInfo",(n,r)=>{let o=this.determineTransition(n,r),i=!o?.target,a=o?.target??this.state.value,s=this.state.value!==a,c=this.getStateNode(a),u={reenter:!i&&!s&&!o?.internal,transition:o,stateNode:c,target:a,changed:s};return this.log("NextState:",`[${r.type}]`,this.state.value,"---->",u.target),u}),X(this,"getAfterActions",(n,r)=>{let o,i=this.state.value;return{entry:()=>{o=globalThis.setTimeout(()=>{let a=this.getNextStateInfo(n,this.state.event);this.performStateChangeEffects(i,a,this.state.event)},r)},exit:()=>{globalThis.clearTimeout(o)}}}),X(this,"getDelayedEventActions",n=>{let r=this.getStateNode(n),o=this.state.event;if(!r||!r.after)return;let i=[],a=[];if(di(r.after)){let s=this.determineTransition(r.after,o);if(!s)return;if(!Gl(s,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(s)}`);let l=gi(s.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(s,l);return i.push(u.entry),a.push(u.exit),{entries:i,exits:a}}if(fi(r.after))for(let s in r.after){let c=r.after[s],u=gi(s,this.delayMap)(this.contextSnapshot,o),f=this.getAfterActions(c,u);i.push(f.entry),a.push(f.exit)}return{entries:i,exits:a}}),X(this,"executeActions",(n,r)=>{let o=Wl(n,this.guardMap)(this.contextSnapshot,r,this.guardMeta);for(let i of jn(o)){let a=yt(i)?this.actionMap?.[i]:i;wn(yt(i)&&!a,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),a?.(this.state.context,r,this.meta)}}),X(this,"executeActivities",(n,r,o)=>{for(let i of r){let a=yt(i)?this.activityMap?.[i]:i;if(!a){wn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}let s=a(this.state.context,n,this.meta);if(s){let c=yt(i)?i:i.name||ui();this.addActivityCleanup(o??this.state.value,c,s)}}}),X(this,"createEveryActivities",(n,r)=>{if(n)if(di(n)){let o=jn(n).find(c=>{let l=c.delay,f=gi(l,this.delayMap)(this.contextSnapshot,this.state.event);return Vp(c.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??f!=null});if(!o)return;let a=gi(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{let c=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event)},a);return()=>{globalThis.clearInterval(c)}})}else for(let o in n){let i=n?.[o],s=gi(o,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{let l=globalThis.setInterval(()=>{this.executeActions(i,this.state.event)},s);return()=>{globalThis.clearInterval(l)}})}}),X(this,"setEvent",n=>{this.state.previousEvent=this.state.event,this.state.event=Tt(Ut(n))}),X(this,"performExitEffects",(n,r)=>{let o=this.state.value;if(o==="")return;let i=n?this.getStateNode(n):void 0;this.stopActivities(o);let a=Wl(i?.exit,this.guardMap)(this.contextSnapshot,r,this.guardMeta),s=jn(a),c=this.delayedEvents.get(o);c&&s.push(...c),this.executeActions(s,r),this.delayedEvents.delete(o)}),X(this,"performEntryEffects",(n,r)=>{let o=this.getStateNode(n),i=jn(o?.activities);this.createEveryActivities(o?.every,l=>{i.unshift(l)}),i.length>0&&this.executeActivities(r,i);let a=Wl(o?.entry,this.guardMap)(this.contextSnapshot,r,this.guardMeta),s=jn(a),c=this.getDelayedEventActions(n);o?.after&&c&&(this.delayedEvents.set(n,c?.exits),s.push(...c.entries)),this.executeActions(s,r),o?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(l=>{l(this.stateSnapshot)}),this.stop())}),X(this,"performTransitionEffects",(n,r)=>{let o=this.determineTransition(n,r);this.executeActions(o?.actions,r)}),X(this,"performStateChangeEffects",(n,r,o)=>{this.setEvent(o);let i=r.changed||r.reenter;i&&this.performExitEffects(n,o),this.performTransitionEffects(r.transition,o),this.setState(r.target),i&&this.performEntryEffects(r.target,o)}),X(this,"determineTransition",(n,r)=>XS(n,this.guardMap)?.(this.contextSnapshot,r,this.guardMeta)),X(this,"sendParent",n=>{this.parent||mi("[@zag-js/core > send-parent] Cannot send event to an unknown parent");let r=Ut(n);this.parent?.send(r)}),X(this,"log",(...n)=>{Rp()&&this.options.debug&&console.log(...n)}),X(this,"send",n=>{let r=Ut(n);this.transition(this.state.value,r)}),X(this,"transition",(n,r)=>{let o=yt(n)?this.getStateNode(n):n?.stateNode,i=Ut(r);if(!o&&!this.config.on){let c=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${n}, \`event\`: ${i.type}`;wn(c);return}let a=o?.on?.[i.type]??this.config.on?.[i.type],s=this.getNextStateInfo(a,i);return this.performStateChangeEffects(this.state.value,s,i),s.stateNode}),X(this,"subscribe",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),()=>{this.stateListeners.delete(n)})),X(this,"onDone",n=>(this.doneListeners.add(n),this)),X(this,"onTransition",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),this)),this.config=Bp(e),this.options=Bp(t??{}),this.id=this.config.id??`machine-${ui()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=KS(this.config),this.initialContext=Fn(this.state.context)}get stateSnapshot(){return At(Fn(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){let e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){let e=this.getState();return{value:e.value,tags:e.tags}}},jt=(e,t)=>new Hp(e,t),zp=e=>e instanceof Hp||e?.type==="machine",ZS=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),JS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Fp=e=>{let t={},n;for(;n=JS.exec(e);)t[n[1]]=n[2];return t},QS=(e,t)=>{if(yt(e)){if(yt(t))return`${e};${t}`;e=Fp(e)}else yt(t)&&(t=Fp(t));return Object.assign({},e??{},t??{})};function $a(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=ci(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=ZS(t[r],n[r]);continue}if(r==="style"){t[r]=QS(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Gp(e){return new Proxy({},{get(){return e}})}var Ot=()=>e=>Array.from(new Set(e));function ee(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){let o=Object.getOwnPropertyDescriptors(r);for(let i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let a={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let c=e[s];typeof c=="function"&&(c=c()),a=$a(a,{[i]:(c||{})[i]})}return a[i]}for(let s=e.length-1;s>=0;s--){let c,l=e[s];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var eT=e=>Array.isArray(e),tT=e=>e!=null&&typeof e=="object",nT=e=>tT(e)&&!eT(e),rT=e=>typeof e=="number"&&!Number.isNaN(e),qp=e=>typeof e=="string",oT=Function.prototype.toString;oT.call(Object);var Wp={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},iT=e=>e.startsWith("--")?e:dT(e);function aT(e){return e in Wp?Wp[e]:e}var Rt=Gp(e=>{let t={};for(let n in e){let r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&nT(r)){t.style=sT(r);continue}if(n==="children"){qp(r)&&(t.textContent=r);continue}t[aT(n)]=r}}return t});function sT(e){let t={};for(let n in e){let r=e[n];!qp(r)&&!rT(r)||(t[iT(n)]=r)}return t}var lT=/[A-Z]/g,cT=/^ms-/;function uT(e){return"-"+e.toLowerCase()}var Kl={};function dT(e){if(Kl.hasOwnProperty(e))return Kl[e];var t=e.replace(lT,uT);return Kl[e]=cT.test(t)?"-"+t:t}function Kp(e,t){let{actions:n,context:r}=t??{},[o,i]=hp(e.getState());return ne(()=>{let a=e.subscribe(s=>{i(Pa(s))});se(()=>{a()})}),ge(()=>{let a=typeof r=="function"?r():r;e.setContext(a)}),ge(()=>{e.setOptions({actions:n})}),o}function Yp(e){return[Kp(e),e.send]}function fT(e,t){let{state:n,context:r}=t??{},o=(()=>{let i=typeof e=="function"?e():e,a=typeof r=="function"?r():r;return a&&i.setContext(a),i._created(),i})();return ne(()=>{o.start(n),se(()=>{o.stop()})}),o}function rn(e,t){let n=fT(e,t);return[Kp(n,t),n.send,n]}var Yl=e=>n=>{let[r,o]=Be(n,["asChild"]);if(r.asChild){let i=a=>{let[,s]=Be(o,["ref"]);return ee(s,a)};return r.asChild(i)}return m(vd,Se({component:e},o))};function pT(){let e=new Map;return new Proxy(Yl,{apply(t,n,r){return Yl(r[0])},get(t,n){let r=n;return e.has(r)||e.set(r,Yl(r)),e.get(r)}})}var fe=pT();function Xp(e,t,n){let r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(o){o&&t({type:"NODE.SET",node:o})},unmount(){t({type:"UNMOUNT"})}}}function Ba(e){return e?.animationName||"none"}function Zp(e){return jt({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},invokeOnExitComplete(t){t.onExitComplete?.()},setNode(t,n){t.node=Tt(n.node)},setStyles(t,n){let r=n.node.ownerDocument.defaultView||window;t.styles=Tt(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){if(t.present){r({type:"MOUNT",src:"presence.changed"});return}let o=Ba(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=Ba(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){let o=t.node;if(!o)return;let i=s=>{(s.composedPath?.()?.[0]??s.target)===o&&(t.prevAnimationName=Ba(t.styles))},a=s=>{let c=Ba(t.styles);(s.composedPath?.()?.[0]??s.target)===o&&c===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",a),()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",a)}}}})}var QO=Ot()(["onExitComplete","present","immediate"]);var lo=e=>et()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),sr=e=>{let[t,n]=ai(e),[r,o]=O(!1),[i,a]=rn(Zp(n),{context:n}),s=B(()=>Xp(i,a,Rt));return ge(()=>{s().present&&o(!0)}),B(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,presenceProps:{ref:s().setNode,hidden:!s().present,"data-state":n.present?"open":"closed"}}))};var[co,Vn]=Ve({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var xt=e=>e?"":void 0;var Qp=2147483647,gT=1,hT=9,bT=11,Fa=e=>typeof e=="object"&&e!==null,tt=e=>Fa(e)&&e.nodeType===gT&&typeof e.nodeName=="string",em=e=>Fa(e)&&e.nodeType===hT,yT=e=>Fa(e)&&e===e.window;var tm=e=>tt(e)?e.localName||"":"#document";function xT(e){return["html","body","#document"].includes(tm(e))}var vT=e=>Fa(e)&&e.nodeType!==void 0,Zl=e=>vT(e)&&e.nodeType===bT&&"host"in e;function Mt(e,t){return!e||!t||!tt(e)||!tt(t)?!1:e===t||e.contains(t)}function Vt(e){return em(e)?e:yT(e)?e.document:e?.ownerDocument??document}function wT(e){return Vt(e).documentElement}function on(e){return Zl(e)?on(e.host):em(e)?e.defaultView??window:tt(e)?e.ownerDocument?.defaultView??window:window}function ST(e){let t=e.activeElement;for(;t?.shadowRoot;){let n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}var nm=()=>typeof document<"u";function TT(){return navigator.userAgentData?.platform??navigator.platform}var Jl=e=>nm()&&e.test(TT()),CT=e=>nm()&&e.test(navigator.userAgent);var rm=()=>Jl(/^Mac/);var om=()=>CT(/firefox\//i),_T=()=>Jl(/mac|iphone|ipad|ipod/i),im=()=>Jl(/iP(hone|ad|od)|iOS/);function kT(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function an(e){return kT(e)?.[0]??e.target}var am=e=>Mt(e.currentTarget,an(e));function Ql(e){let t=e.currentTarget;if(!t)return!1;let n=_T();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.localName;return r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit"}function ec(e){let t=e.currentTarget;if(!t)return!1;let n=t.localName;return e.altKey?n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit":!1}var tc=e=>e.id;function ET(e,t,n=tc){return e.find(r=>n(r)===t)}function nc(e,t,n=tc){let r=ET(e,t,n);return r?e.indexOf(r):-1}function sm(e,t,n=!0){let r=nc(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function lm(e,t,n=!0){let r=nc(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}var PT=e=>e.split("").map(t=>{let n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),IT=e=>PT(e.dataset.valuetext??e.textContent??""),AT=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase()),OT=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]);function RT(e,t,n,r=tc){let o=n?nc(e,n,r):-1,i=n?OT(e,o):e;return t.length===1&&(i=i.filter(s=>r(s)!==n)),i.find(s=>AT(IT(s),t))}function MT(e,t){let{state:n,activeId:r,key:o,timeout:i=350,itemToId:a}=t,s=n.keysSoFar+o,l=s.length>1&&Array.from(s).every(h=>h===s[0])?s[0]:s,u=e.slice(),f=RT(u,l,r,a);function d(){clearTimeout(n.timer),n.timer=-1}function p(h){n.keysSoFar=h,d(),h!==""&&(n.timer=+setTimeout(()=>{p(""),d()},i))}return p(s),f}var rc=Object.assign(MT,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:DT});function DT(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function LT(e){if(tm(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Zl(e)&&e.host||wT(e);return Zl(t)?t.host:t}var cm=e=>typeof e=="object"&&e!==null&&e.nodeType===1,NT=e=>cm(e)&&e.tagName==="IFRAME";function $T(e){return cm(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}function BT(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}var um="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Ua(e){return!e||e.closest("[inert]")?!1:e.matches(um)&&$T(e)}function oc(e,t){if(!e)return[];let n=Array.from(e.querySelectorAll(um)),r=n.filter(Jp);return t&&Jp(e)&&r.unshift(e),r.forEach((o,i)=>{if(NT(o)&&o.contentDocument){let a=o.contentDocument.body,s=oc(a);r.splice(i,1,...s)}}),!r.length&&t?n:r}function Jp(e){return e!=null&&e.tabIndex>0?!0:Ua(e)&&!BT(e)}function FT(e,t){let n=oc(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function dm(e){let{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof n=="function"?n():n),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let a=oc(t);i=r?a.filter(r)[0]:a[0]}return i||t||void 0}function fm(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=FT(t),o=t.ownerDocument||document;return!(o.activeElement===n&&e.shiftKey||o.activeElement===r&&!e.shiftKey||!n&&!r)}function ic(e){if(e==null||!tt(e))return!1;try{let t=on(e);return e instanceof t.HTMLInputElement&&e.selectionStart!=null||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return!1}}var UT=/auto|scroll|overlay|hidden|clip/;function pm(e){let t=on(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return UT.test(n+o+r)&&!["inline","contents"].includes(i)}function mm(e){let t=new Set;function n(r){let o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function He(e){let t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function jT(e,t){if(!e)return;let{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(a=>{for(let s of a)s.type==="attributes"&&s.attributeName&&n.includes(s.attributeName)&&r(s)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function gm(e,t){let{defer:n}=t,r=n?He:i=>i(),o=[];return o.push(r(()=>{let i=typeof e=="function"?e():e;o.push(jT(i,t))})),()=>{o.forEach(i=>i?.())}}function ac(e){let t=LT(e);return xT(t)?Vt(t).body:tt(t)&&pm(t)?t:ac(t)}function ja(e,t){return Array.from(e?.querySelectorAll(t)??[])}function Hn(e){let t={getRootNode:n=>n.getRootNode?.()??document,getDoc:n=>Vt(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>ST(t.getRootNode(n)),isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;let o=r.toString();n.value!==o&&(n.value=r.toString())}};return{...t,...e}}function VT(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function hm(e,t){let{rootEl:n,...r}=t||{};!e||!n||!pm(n)||!VT(n)||e.scrollIntoView(r)}var Xl=new WeakMap;function HT(e,t,n){Xl.has(e)||Xl.set(e,new Map);let r=Xl.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};let i=n(),a=()=>{i(),o(),r.delete(t)};return r.set(t,a),()=>{r.get(t)===a&&(i(),r.set(t,o))}}function bm(e,t){return e?HT(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var zT=1e3/60;function GT(e,t){let n=e();if(tt(n)&&n.isConnected)return t(n),()=>{};{let r=setInterval(()=>{let o=e();tt(o)&&o.isConnected&&(t(o),clearInterval(r))},zT);return()=>clearInterval(r)}}function ym(e,t){let n=[];return e?.forEach(r=>{let o=GT(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var[lR,uo]=Ve({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var WT=e=>typeof e=="function",xm=(e,...t)=>WT(e)?e(...t):e;var[qT,lr]=Ve({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),KT=S("<span hidden>"),cr=e=>{let[t,n]=O(),r=()=>xm(e.value)??t()?.ownerDocument??document,o=B(()=>({getRootNode:r,getDocument:()=>Vt(r()),getWindow:()=>on(r())}));return m(qT,{value:o,get children(){return[B(()=>e.children),m(N,{get when(){return!e.value},get children(){var i=KT();return de(n,i),i}})]}})};var YT=Object.defineProperty,zn=(e,t)=>{for(var n in t)YT(e,n,{get:t[n],enumerable:!0})};var Ht=(e,t=[])=>({parts:(...n)=>{if(XT(t))return Ht(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Ht(e,[...t,...n]),rename:n=>Ht(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${fo(e)}"][data-part="${fo(r)}"]`,`& [data-scope="${fo(e)}"][data-part="${fo(r)}"]`].join(", "),attrs:{"data-scope":fo(e),"data-part":fo(r)}}}),{})}),fo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),XT=e=>e.length===0;var vm=["top","right","bottom","left"];var sn=Math.min,ft=Math.max,bi=Math.round,yi=Math.floor,Sn=e=>({x:e,y:e}),ZT={left:"right",right:"left",bottom:"top",top:"bottom"},JT={start:"end",end:"start"};function Ha(e,t,n){return ft(e,sn(t,n))}function ln(e,t){return typeof e=="function"?e(t):e}function cn(e){return e.split("-")[0]}function ur(e){return e.split("-")[1]}function za(e){return e==="x"?"y":"x"}function Ga(e){return e==="y"?"height":"width"}function un(e){return["top","bottom"].includes(cn(e))?"y":"x"}function Wa(e){return za(un(e))}function wm(e,t,n){n===void 0&&(n=!1);let r=ur(e),o=Wa(e),i=Ga(o),a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=hi(a)),[a,hi(a)]}function Sm(e){let t=hi(e);return[Va(e),t,Va(t)]}function Va(e){return e.replace(/start|end/g,t=>JT[t])}function QT(e,t,n){let r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function Tm(e,t,n,r){let o=ur(e),i=QT(cn(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Va)))),i}function hi(e){return e.replace(/left|right|bottom|top/g,t=>ZT[t])}function eC(e){return{top:0,right:0,bottom:0,left:0,...e}}function sc(e){return typeof e!="number"?eC(e):{top:e,right:e,bottom:e,left:e}}function dr(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Cm(e,t,n){let{reference:r,floating:o}=e,i=un(t),a=Wa(t),s=Ga(a),c=cn(t),l=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2,p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ur(t)){case"start":p[a]-=d*(n&&l?-1:1);break;case"end":p[a]+=d*(n&&l?-1:1);break}return p}var Em=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Cm(l,r,c),d=r,p={},h=0;for(let g=0;g<s.length;g++){let{name:v,fn:y}=s[g],{x:T,y:C,data:E,reset:I}=await y({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=T??u,f=C??f,p={...p,[v]:{...p[v],...E}},I&&h<=50&&(h++,typeof I=="object"&&(I.placement&&(d=I.placement),I.rects&&(l=I.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:u,y:f}=Cm(l,d,c)),g=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:p}};async function po(e,t){var n;t===void 0&&(t={});let{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ln(t,e),h=sc(p),v=s[d?f==="floating"?"reference":"floating":f],y=dr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),T=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),E=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},I=dr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:T,offsetParent:C,strategy:c}):T);return{top:(y.top-I.top+h.top)/E.y,bottom:(I.bottom-y.bottom+h.bottom)/E.y,left:(y.left-I.left+h.left)/E.x,right:(I.right-y.right+h.right)/E.x}}var Pm=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ln(e,t)||{};if(l==null)return{};let f=sc(u),d={x:n,y:r},p=Wa(o),h=Ga(p),g=await a.getDimensions(l),v=p==="y",y=v?"top":"left",T=v?"bottom":"right",C=v?"clientHeight":"clientWidth",E=i.reference[h]+i.reference[p]-d[p]-i.floating[h],I=d[p]-i.reference[p],U=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l)),R=U?U[C]:0;(!R||!await(a.isElement==null?void 0:a.isElement(U)))&&(R=s.floating[C]||i.floating[h]);let oe=E/2-I/2,H=R/2-g[h]/2-1,G=sn(f[y],H),L=sn(f[T],H),P=G,_=R-g[h]-L,w=R/2-g[h]/2+oe,M=Ha(P,w,_),D=!c.arrow&&ur(o)!=null&&w!==M&&i.reference[h]/2-(w<P?G:L)-g[h]/2<0,J=D?w<P?w-P:w-_:0;return{[p]:d[p]+J,data:{[p]:M,centerOffset:w-M-J,...D&&{alignmentOffset:J}},reset:D}}});var Im=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;let{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=ln(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let y=cn(o),T=un(s),C=cn(s)===s,E=await(c.isRTL==null?void 0:c.isRTL(l.floating)),I=d||(C||!g?[hi(s)]:Sm(s)),U=h!=="none";!d&&U&&I.push(...Tm(s,g,h,E));let R=[s,...I],oe=await po(t,v),H=[],G=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&H.push(oe[y]),f){let M=wm(o,a,E);H.push(oe[M[0]],oe[M[1]])}if(G=[...G,{placement:o,overflows:H}],!H.every(M=>M<=0)){var L,P;let M=(((L=i.flip)==null?void 0:L.index)||0)+1,D=R[M];if(D){var _;let ue=f==="alignment"?T!==un(D):!1,le=((_=G[0])==null?void 0:_.overflows[0])>0;if(!ue||le)return{data:{index:M,overflows:G},reset:{placement:D}}}let J=(P=G.filter(ue=>ue.overflows[0]<=0).sort((ue,le)=>ue.overflows[1]-le.overflows[1])[0])==null?void 0:P.placement;if(!J)switch(p){case"bestFit":{var w;let ue=(w=G.filter(le=>{if(U){let xe=un(le.placement);return xe===T||xe==="y"}return!0}).map(le=>[le.placement,le.overflows.filter(xe=>xe>0).reduce((xe,we)=>xe+we,0)]).sort((le,xe)=>le[1]-xe[1])[0])==null?void 0:w[0];ue&&(J=ue);break}case"initialPlacement":J=s;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function _m(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function km(e){return vm.some(t=>e[t]>=0)}var Am=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n}=t,{strategy:r="referenceHidden",...o}=ln(e,t);switch(r){case"referenceHidden":{let i=await po(t,{...o,elementContext:"reference"}),a=_m(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:km(a)}}}case"escaped":{let i=await po(t,{...o,altBoundary:!0}),a=_m(i,n.floating);return{data:{escapedOffsets:a,escaped:km(a)}}}default:return{}}}}};async function tC(e,t){let{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=cn(n),s=ur(n),c=un(n)==="y",l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,f=ln(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}var Om=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:a,middlewareData:s}=t,c=await tC(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},Rm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:y,y:T}=v;return{x:y,y:T}}},...c}=ln(e,t),l={x:n,y:r},u=await po(t,c),f=un(cn(o)),d=za(f),p=l[d],h=l[f];if(i){let v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",T=p+u[v],C=p-u[y];p=Ha(T,p,C)}if(a){let v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",T=h+u[v],C=h-u[y];h=Ha(T,h,C)}let g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[d]:i,[f]:a}}}}}},Mm=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ln(e,t),u={x:n,y:r},f=un(o),d=za(f),p=u[d],h=u[f],g=ln(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let C=d==="y"?"height":"width",E=i.reference[d]-i.floating[C]+v.mainAxis,I=i.reference[d]+i.reference[C]-v.mainAxis;p<E?p=E:p>I&&(p=I)}if(l){var y,T;let C=d==="y"?"width":"height",E=["top","left"].includes(cn(o)),I=i.reference[f]-i.floating[C]+(E&&((y=a.offset)==null?void 0:y[f])||0)+(E?0:v.crossAxis),U=i.reference[f]+i.reference[C]+(E?0:((T=a.offset)==null?void 0:T[f])||0)-(E?v.crossAxis:0);h<I?h=I:h>U&&(h=U)}return{[d]:p,[f]:h}}}},Dm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;let{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=ln(e,t),u=await po(t,l),f=cn(o),d=ur(o),p=un(o)==="y",{width:h,height:g}=i.floating,v,y;f==="top"||f==="bottom"?(v=f,y=d===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,v=d==="end"?"top":"bottom");let T=g-u.top-u.bottom,C=h-u.left-u.right,E=sn(g-u[v],T),I=sn(h-u[y],C),U=!t.middlewareData.shift,R=E,oe=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(oe=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=T),U&&!d){let G=ft(u.left,0),L=ft(u.right,0),P=ft(u.top,0),_=ft(u.bottom,0);p?oe=h-2*(G!==0||L!==0?G+L:ft(u.left,u.right)):R=g-2*(P!==0||_!==0?P+_:ft(u.top,u.bottom))}await c({...t,availableWidth:oe,availableHeight:R});let H=await a.getDimensions(s.floating);return h!==H.width||g!==H.height?{reset:{rects:!0}}:{}}}};function qa(){return typeof window<"u"}function fr(e){return Nm(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zt(e){var t;return(t=(Nm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nm(e){return qa()?e instanceof Node||e instanceof vt(e).Node:!1}function Dt(e){return qa()?e instanceof Element||e instanceof vt(e).Element:!1}function Gt(e){return qa()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function Lm(e){return!qa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}function go(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=Lt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function $m(e){return["table","td","th"].includes(fr(e))}function xi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ka(e){let t=Ya(),n=Dt(e)?Lt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Bm(e){let t=Tn(e);for(;Gt(t)&&!pr(t);){if(Ka(t))return t;if(xi(t))return null;t=Tn(t)}return null}function Ya(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pr(e){return["html","body","#document"].includes(fr(e))}function Lt(e){return vt(e).getComputedStyle(e)}function vi(e){return Dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tn(e){if(fr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Lm(e)&&e.host||zt(e);return Lm(t)?t.host:t}function Fm(e){let t=Tn(e);return pr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gt(t)&&go(t)?t:Fm(t)}function mo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let o=Fm(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=vt(o);if(i){let s=Xa(a);return t.concat(a,a.visualViewport||[],go(o)?o:[],s&&n?mo(s):[])}return t.concat(o,mo(o,[],n))}function Xa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vm(e){let t=Lt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=Gt(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=bi(n)!==i||bi(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function uc(e){return Dt(e)?e:e.contextElement}function ho(e){let t=uc(e);if(!Gt(t))return Sn(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Vm(t),a=(i?bi(n.width):n.width)/r,s=(i?bi(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var nC=Sn(0);function Hm(e){let t=vt(e);return!Ya()||!t.visualViewport?nC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function mr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),i=uc(e),a=Sn(1);t&&(r?Dt(r)&&(a=ho(r)):a=ho(e));let s=rC(i,n,r)?Hm(i):Sn(0),c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){let d=vt(i),p=r&&Dt(r)?vt(r):r,h=d,g=Xa(h);for(;g&&r&&p!==h;){let v=ho(g),y=g.getBoundingClientRect(),T=Lt(g),C=y.left+(g.clientLeft+parseFloat(T.paddingLeft))*v.x,E=y.top+(g.clientTop+parseFloat(T.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=C,l+=E,h=vt(g),g=Xa(h)}}return dr({width:u,height:f,x:c,y:l})}function oC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i=o==="fixed",a=zt(r),s=t?xi(t.floating):!1;if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Sn(1),u=Sn(0),f=Gt(r);if((f||!f&&!i)&&((fr(r)!=="body"||go(a))&&(c=vi(r)),Gt(r))){let d=mr(r);l=ho(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function iC(e){return Array.from(e.getClientRects())}function cc(e,t){let n=vi(e).scrollLeft;return t?t.left+n:mr(zt(e)).left+n}function aC(e){let t=zt(e),n=vi(e),r=e.ownerDocument.body,o=ft(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ft(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+cc(e),s=-n.scrollTop;return Lt(r).direction==="rtl"&&(a+=ft(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function sC(e,t){let n=vt(e),r=zt(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;let l=Ya();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}function lC(e,t){let n=mr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Gt(e)?ho(e):Sn(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:a,height:s,x:c,y:l}}function Um(e,t,n){let r;if(t==="viewport")r=sC(e,n);else if(t==="document")r=aC(zt(e));else if(Dt(t))r=lC(t,n);else{let o=Hm(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return dr(r)}function zm(e,t){let n=Tn(e);return n===t||!Dt(n)||pr(n)?!1:Lt(n).position==="fixed"||zm(n,t)}function cC(e,t){let n=t.get(e);if(n)return n;let r=mo(e,[],!1).filter(s=>Dt(s)&&fr(s)!=="body"),o=null,i=Lt(e).position==="fixed",a=i?Tn(e):e;for(;Dt(a)&&!pr(a);){let s=Lt(a),c=Ka(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||go(a)&&!c&&zm(e,a))?r=r.filter(u=>u!==a):o=s,a=Tn(a)}return t.set(e,r),r}function uC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,a=[...n==="clippingAncestors"?xi(t)?[]:cC(t,this._c):[].concat(n),r],s=a[0],c=a.reduce((l,u)=>{let f=Um(t,u,o);return l.top=ft(f.top,l.top),l.right=sn(f.right,l.right),l.bottom=sn(f.bottom,l.bottom),l.left=ft(f.left,l.left),l},Um(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dC(e){let{width:t,height:n}=Vm(e);return{width:t,height:n}}function fC(e,t,n){let r=Gt(t),o=zt(t),i=n==="fixed",a=mr(e,!0,i,t),s={scrollLeft:0,scrollTop:0},c=Sn(0);if(r||!r&&!i)if((fr(t)!=="body"||go(o))&&(s=vi(t)),r){let p=mr(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&(c.x=cc(o));let l=0,u=0;if(o&&!r&&!i){let p=o.getBoundingClientRect();u=p.top+s.scrollTop,l=p.left+s.scrollLeft-cc(o,p)}let f=a.left+s.scrollLeft-c.x-l,d=a.top+s.scrollTop-c.y-u;return{x:f,y:d,width:a.width,height:a.height}}function lc(e){return Lt(e).position==="static"}function jm(e,t){if(!Gt(e)||Lt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function Gm(e,t){let n=vt(e);if(xi(e))return n;if(!Gt(e)){let o=Tn(e);for(;o&&!pr(o);){if(Dt(o)&&!lc(o))return o;o=Tn(o)}return n}let r=jm(e,t);for(;r&&$m(r)&&lc(r);)r=jm(r,t);return r&&pr(r)&&lc(r)&&!Ka(r)?n:r||Bm(e)||n}var pC=async function(e){let t=this.getOffsetParent||Gm,n=this.getDimensions,r=await n(e.floating);return{reference:fC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mC(e){return Lt(e).direction==="rtl"}var gC={convertOffsetParentRelativeRectToViewportRelativeRect:oC,getDocumentElement:zt,getClippingRect:uC,getOffsetParent:Gm,getElementRects:pC,getClientRects:iC,getDimensions:dC,getScale:ho,isElement:Dt,isRTL:mC};function hC(e,t){let n=null,r,o=zt(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();let{left:l,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;let p=yi(u),h=yi(o.clientWidth-(l+f)),g=yi(o.clientHeight-(u+d)),v=yi(l),T={rootMargin:-p+"px "+-h+"px "+-g+"px "+-v+"px",threshold:ft(0,sn(1,c))||1},C=!0;function E(I){let U=I[0].intersectionRatio;if(U!==c){if(!C)return a();U?a(!1,U):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(E,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,T)}n.observe(e)}return a(!0),i}function Wm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=uc(e),u=o||i?[...l?mo(l):[],...mo(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});let f=l&&s?hC(l,n):null,d=-1,p=null;a&&(p=new ResizeObserver(y=>{let[T]=y;T&&T.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let h,g=c?mr(e):null;c&&v();function v(){let y=mr(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,h=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(T=>{o&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),f?.(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(h)}}var qm=Om;var Km=Rm,Ym=Im,Xm=Dm,Zm=Am,Jm=Pm;var Qm=Mm,eg=(e,t,n)=>{let r=new Map,o={platform:gC,...n},i={...o.platform,_c:r};return Em(e,t,{...o,platform:i})};function tg(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);let o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function bC(e){if(!e)return tg();let{x:t,y:n,width:r,height:o}=e;return tg(t,n,r,o)}function yC(e,t){return{contextElement:tt(e)?e:void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?bC(r):n.getBoundingClientRect()}}}var wi=e=>({variable:e,reference:`var(${e})`}),Cn={arrowSize:wi("--arrow-size"),arrowSizeHalf:wi("--arrow-size-half"),arrowBg:wi("--arrow-background"),transformOrigin:wi("--transform-origin"),arrowOffset:wi("--arrow-offset")},xC=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),vC={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){let{arrow:r}=n,o=xC(r)[e],{floating:i}=t;return i.style.setProperty(Cn.transformOrigin.variable,o),{data:{transformOrigin:o}}}},wC={name:"rects",fn({rects:e}){return{data:e}}},SC=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Cn.arrowOffset.reference})`}),{}}}};function TC(e){let[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function rg(e){return e.split("-")[0]}var CC={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function ng(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function og(e){return vn(e.boundary)}function _C(e,t){if(e)return Jm({element:e,padding:t.arrowPadding})}function kC(e,t){if(!Dp(t.offset??t.gutter))return qm(({placement:n})=>{let r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:a}=TC(n),s=a?void 0:t.shift,c=t.offset?.crossAxis??s;return st({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function EC(e){if(e.flip)return Ym({boundary:og(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function PC(e){if(!(!e.slide&&!e.overlap))return Km({boundary:og(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Qm()})}function IC(e){return Xm({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){let i=t.floating,a=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function AC(e){if(e.hideWhenDetached)return Zm({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function OC(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function RC(e,t,n={}){let r=yC(e,n.getAnchorRect);if(!t||!r)return;let o=Object.assign({},CC,n),i=t.querySelector("[data-part=arrow]"),a=[kC(i,o),EC(o),PC(o),_C(i,o),SC(i),vC,IC(o),AC(o),wC],{placement:s,strategy:c,onComplete:l,onPositioned:u}=o,f=async()=>{if(!r||!t)return;let g=await eg(r,t,{placement:s,middleware:a,strategy:c});l?.(g),u?.({placed:!0});let v=on(t),y=ng(v,g.x),T=ng(v,g.y);t.style.setProperty("--x",`${y}px`),t.style.setProperty("--y",`${T}px`),o.hideWhenDetached&&g.middlewareData.hide?.referenceHidden&&t.style.setProperty("visibility","hidden");let C=t.firstElementChild;if(C){let E=v.getComputedStyle(C).zIndex;t.style.setProperty("--z-index",E)}},d=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:f}),u?.({placed:!0})):await f()},p=OC(o.listeners),h=o.listeners?Wm(r,t,d,p):La;return d(),()=>{h?.(),u?.({placed:!1})}}function dc(e,t,n={}){let{defer:r,...o}=n,i=r?He:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,c=typeof t=="function"?t():t;a.push(RC(s,c,o))})),()=>{a.forEach(s=>s?.())}}var MC={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function ig(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Cn.arrowSize.reference,height:Cn.arrowSize.reference,[Cn.arrowSizeHalf.variable]:`calc(${Cn.arrowSize.reference} / 2)`,[Cn.arrowOffset.variable]:`calc(${Cn.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?MC[t.split("-")[0]]:void 0,background:Cn.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var Wt=(e,t,n,r)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function sg(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Za=e=>e.button===2||rm()&&e.ctrlKey&&e.button===0,lg=e=>e.ctrlKey||e.altKey||e.metaKey;function DC(e,t,n){let o=(a=>{let s=requestAnimationFrame(a);return()=>cancelAnimationFrame(s)})(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function LC(e){return e?.matches("a[href]")??!1}function cg(e){if(!LC(e))return;let t=()=>e.click();om()?DC(e,"keyup",t):queueMicrotask(t)}function fc(e,t,n){if(!e)return;let r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}var NC={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},ag={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function pc(e,t={}){let{dir:n="ltr",orientation:r="horizontal"}=t,{key:o}=e;return o=NC[o]??o,n==="rtl"&&r==="horizontal"&&o in ag&&(o=ag[o]),o}function $C(e,t="client"){let n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function BC(e,t="client"){return{x:e[`${t}X`],y:e[`${t}Y`]}}var FC=e=>"touches"in e&&e.touches.length>0;function Ja(e,t="client"){return FC(e)?$C(e,t):BC(e,t)}function UC(e){let t={each(n){for(let r=0;r<e.frames?.length;r+=1){let o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function jC(e){let t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var ug="pointerdown.outside",dg="focus.outside";function VC(e){for(let t of e)if(tt(t)&&Ua(t))return!0;return!1}var pg=e=>"clientY"in e;function HC(e,t){if(!pg(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function fg(e,t){if(!t||!pg(e))return!1;let r=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return r||i}function zC(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=Vt(e),c=on(e),l=UC(c),u=jC(c);function f(y){let T=an(y);if(!tt(T)||Mt(e,T)||HC(e,y)||fg(y,T))return!1;let C=ac(e);return fg(y,C)?!1:!n?.(T)}let d=new Set;function p(y){function T(){let C=a?He:I=>I(),E=y.composedPath?.()??[y.target];C(()=>{if(!(!e||!f(y))){if(o||i){let I=ci(o,i);e.addEventListener(ug,I,{once:!0})}fc(e,ug,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:Za(y),focusable:VC(E)}})}})}y.pointerType==="touch"?(d.forEach(C=>C()),d.add(Wt(s,"click",T,{once:!0})),d.add(u.addEventListener("click",T,{once:!0})),d.add(l.addEventListener("click",T,{once:!0}))):T()}let h=new Set,g=setTimeout(()=>{h.add(Wt(s,"pointerdown",p,!0)),h.add(u.addEventListener("pointerdown",p,!0)),h.add(l.addEventListener("pointerdown",p,!0))},0);function v(y){(a?He:C=>C())(()=>{if(!(!e||!f(y))){if(r||i){let C=ci(r,i);e.addEventListener(dg,C,{once:!0})}fc(e,dg,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:Ua(an(y))}})}})}return h.add(Wt(s,"focusin",v,!0)),h.add(u.addEventListener("focusin",v,!0)),h.add(l.addEventListener("focusin",v,!0)),()=>{clearTimeout(g),d.forEach(y=>y()),h.forEach(y=>y())}}function mg(e,t){let{defer:n}=t,r=n?He:i=>i(),o=[];return o.push(r(()=>{let i=typeof e=="function"?e():e;o.push(zC(i,t))})),()=>{o.forEach(i=>i?.())}}function GC(e,t){let n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Wt(Vt(e),"keydown",n,{capture:!0})}var Ct={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Mt(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Mt(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},gg;function hg(){Ct.layers.forEach(({node:e})=>{e.style.pointerEvents=Ct.isBelowPointerBlockingLayer(e)?"none":"auto"})}function WC(e){e.style.pointerEvents=""}function qC(e,t){let n=Vt(e),r=[];if(Ct.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(gg=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){let o=ym(t,i=>{r.push(bm(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ct.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=gg,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function KC(e,t){if(!e){wn("[@zag-js/dismissable] node is `null` or `undefined`");return}let{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,a={dismiss:n,node:e,pointerBlocking:r};Ct.add(a),hg();function s(d){let p=an(d.detail.originalEvent);Ct.isBelowPointerBlockingLayer(e)||Ct.isInBranch(p)||(t.onPointerDownOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(i&&console.log("onPointerDownOutside:",d.detail.originalEvent),n?.()))}function c(d){let p=an(d.detail.originalEvent);Ct.isInBranch(p)||(t.onFocusOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(i&&console.log("onFocusOutside:",d.detail.originalEvent),n?.()))}function l(d){Ct.isTopMost(e)&&(t.onEscapeKeyDown?.(d),!d.defaultPrevented&&n&&(d.preventDefault(),n()))}function u(d){if(!e)return!1;let p=typeof o=="function"?o():o,h=Array.isArray(p)?p:[p],g=t.persistentElements?.map(v=>v()).filter(tt);return g&&h.push(...g),h.some(v=>Mt(v,d))||Ct.isInNestedLayer(e,d)}let f=[r?qC(e,t.persistentElements):void 0,GC(e,l),mg(e,{exclude:u,onFocusOutside:c,onPointerDownOutside:s,defer:t.defer})];return()=>{Ct.remove(e),hg(),WC(e),f.forEach(d=>d?.())}}function Qa(e,t){let{defer:n}=t,r=n?He:i=>i(),o=[];return o.push(r(()=>{let i=Un(e)?e():e;o.push(KC(i,t))})),()=>{o.forEach(i=>i?.())}}function bg(e,t={}){let{defer:n}=t,r=n?He:i=>i(),o=[];return o.push(r(()=>{let i=Un(e)?e():e;if(!i){wn("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Ct.addBranch(i),o.push(()=>{Ct.removeBranch(i)})})),()=>{o.forEach(i=>i?.())}}var vg=Ht("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),bo=vg.build(),lt=Hn({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>lt.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>lt.getById(e,lt.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function mc(e,t){return e.filter(n=>n.state.context.placement===t)}var yg={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function xg(e,t){return e??yg[t]??yg.DEFAULT}function YC(e,t){let n=e.offsets,r=typeof n=="string"?{left:n,right:n,bottom:n,top:n}:n,o=e.dir==="rtl",i=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),c={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:Qp},l="center";if(a&&(l="flex-end"),s&&(l="flex-start"),c.alignItems=l,i.includes("top")){let u=r.top;c.top=`max(env(safe-area-inset-top, 0px), ${u})`}if(i.includes("bottom")){let u=r.bottom;c.bottom=`max(env(safe-area-inset-bottom, 0px), ${u})`}if(!i.includes("left")){let u=r.right;c.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${u})`}if(!i.includes("right")){let u=r.left;c.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${u})`}return c}function XC(e,t){let[n]=e.placement.split("-"),r=!e.frontmost,o=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${e.type==="loading"?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=s=>Object.assign(i,s);return n==="top"?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):n==="bottom"&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),r&&o&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),r&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function ZC(e,t){let n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},r=o=>Object.assign(n,o);return e.frontmost&&!t&&r({height:"calc(var(--initial-height) + 80%)"}),n}function JC(e,t){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function QC(e,t,n){function r(){return zp(e)?e.getState():e}function o(u){return mc(r().context.toasts,u)}function i(u){let f=r().context.toasts;return f.length?!!f.find(d=>d.id==u):!1}function a(u){let f=`toast:${ui()}`,d=u.id?u.id:f;return i(d)||t({type:"ADD_TOAST",toast:{...u,id:d}}),d}function s(u,f){return i(u)&&t({type:"UPDATE_TOAST",id:u,toast:f}),u}function c(u){let{id:f}=u;return(f?i(f):!1)&&f!=null?s(f,u):a(u)}function l(u){u==null?t("DISMISS_ALL"):i(u)&&t({type:"DISMISS_TOAST",id:u})}return{getCount(){return r().context.count},getPlacements(){let f=r().context.toasts.map(d=>d.state.context.placement);return Array.from(new Set(f))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:c,dismiss:l,remove(u){u==null?t("REMOVE_ALL"):i(u)&&t({type:"REMOVE_TOAST",id:u})},dismissByPlacement(u){o(u).forEach(d=>l(d.id))},loading(u){return c({...u,type:"loading"})},success(u){return c({...u,type:"success"})},error(u){return c({...u,type:"error"})},promise(u,f,d={}){let p=c({...d,...f.loading,type:"loading"});return vn(u).then(h=>{let g=vn(f.success,h);c({...d,...g,id:p,type:"success"})}).catch(h=>{let g=vn(f.error,h);c({...d,...g,id:p,type:"error"})}).finally(()=>{f.finally?.()}),p},pause(u){u==null?t("PAUSE_ALL"):i(u)&&t({type:"PAUSE_TOAST",id:u})},resume(u){u==null?t("RESUME_ALL"):i(u)&&t({type:"RESUME_TOAST",id:u})},getGroupProps(u){let{placement:f,label:d="Notifications"}=u,p=r(),h=p.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[g,v="center"]=f.split("-");return n.element({...bo.group.attrs,dir:p.context.dir,tabIndex:-1,"aria-label":`${f} ${d} ${h}`,id:lt.getRegionId(f),"data-placement":f,"data-side":g,"data-align":v,"aria-live":"polite",role:"region",style:YC(p.context,f),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:f})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:f})},onFocus(y){t({type:"REGION.FOCUS",target:y.relatedTarget})},onBlur(y){p.context.isFocusWithin&&!Mt(y.currentTarget,y.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(u){let f=r();return so(f.context.toasts,()=>{let p=o(f.context.placement).map(h=>h.getState().context);u(p)})}}}var{not:e_,and:t_,or:n_}=Na;function r_(e){let{type:t="info",duration:n,id:r="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=st(a),c=xg(n,t);return jt({id:r,context:{id:r,type:t,remaining:c,duration:c,removeDelay:i,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:t==="loading"?"visible:persist":"visible",on:{UPDATE:[{guard:t_("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:n_("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:e_("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(l,u,{self:f}){let d;return He(()=>{let p=lt.getRootEl(l);if(!p)return;l.mounted=!0;let h=ja(p,"[data-ghost]");wn(h.length!==2,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");let g=()=>{let T=p.style.height;p.style.height="auto";let C=p.getBoundingClientRect().height;p.style.height=T,l.height=C,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:C,placement:l.placement})};g();let v=lt.getWin(l),y=new v.MutationObserver(g);y.observe(p,{childList:!0,subtree:!0,characterData:!0}),d=()=>y.disconnect()}),()=>d?.()}},guards:{isChangingToLoading:(l,u)=>u.toast?.type==="loading",isLoadingType:l=>l.type==="loading",hasTypeChanged:(l,u)=>u.toast?.type!=null&&u.toast.type!==l.type,hasDurationChanged:(l,u)=>u.toast?.duration!=null&&u.toast.duration!==l.duration},delays:{VISIBLE_DURATION:l=>l.remaining,REMOVE_DELAY:l=>l.removeDelay},actions:{measureHeight(l,u,{self:f}){He(()=>{let d=lt.getRootEl(l);if(!d)return;l.mounted=!0;let p=d.style.height;d.style.height="auto";let h=d.getBoundingClientRect().height;d.style.height=p,l.height=h,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:h,placement:l.placement})})},setRemainingDuration(l){l.remaining-=Date.now()-l.createdAt},setCreatedAt(l){l.createdAt=Date.now()},notifyParentToRemove(l,u,{self:f}){f.sendParent({type:"REMOVE_TOAST",id:f.id})},invokeOnDismiss(l){l.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(l){l.onStatusChange?.({status:"unmounted"})},invokeOnVisible(l){l.onStatusChange?.({status:"visible"})},setContext(l,u){let f=u.toast?.duration,d=u.toast?.type??l.type,p=xg(f,d);Object.assign(l,{...u.toast,duration:p,remaining:p})}}})}function o_(e){let t=st(e);return jt({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:n=>n.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:n=>n.toasts.length<n.max,isOverlapping:n=>!!n.overlap},activities:{trackHotKeyPress(n,r,{send:o}){return Wt(document,"keydown",a=>{n.hotkey.every(c=>a[c]||a.code===c)&&o({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility(n,r,{send:o}){if(!n.pauseOnPageIdle)return;let i=lt.getDoc(n);return Wt(i,"visibilitychange",()=>{o(i.visibilityState==="hidden"?"PAUSE_ALL":"RESUME_ALL")})}},actions:{setDismissableBranch(n){let o=mc(n.toasts,n.placement).length>0;if(!o){n._cleanup?.();return}if(o&&n._cleanup)return;let i=()=>lt.getRegionEl(n,n.placement);n._cleanup=bg(i,{defer:!0})},clearDismissableBranch(n){n._cleanup?.()},focusRegionEl(n){queueMicrotask(()=>{lt.getRegionEl(n,n.placement)?.focus()})},expandToasts(n){es(n,r=>{r.state.context.stacked=!0})},collapseToasts(n){es(n,r=>{r.state.context.stacked=!1})},collapsedIfEmpty(n,r,{send:o}){!n.overlap||n.toasts.length>1||o("REGION.OVERLAP")},pauseToast(n,r,{self:o}){o.sendChild("PAUSE",r.id)},pauseToasts(n){n.toasts.forEach(r=>r.send("PAUSE"))},resumeToast(n,r,{self:o}){o.sendChild("RESUME",r.id)},resumeToasts(n){n.toasts.forEach(r=>r.send("RESUME"))},measureToasts(n){n.toasts.forEach(r=>r.send("MEASURE"))},createToast(n,r,{self:o,getState:i}){let a={placement:n.placement,duration:n.duration,removeDelay:n.removeDelay,...r.toast,dir:n.dir,getRootNode:n.getRootNode,stacked:i().matches("stack")},s=r_(a),c=o.spawn(s);n.toasts=[c,...n.toasts]},updateToast(n,r,{self:o}){o.sendChild({type:"UPDATE",toast:r.toast},r.id)},dismissToast(n,r,{self:o}){o.sendChild("DISMISS",r.id)},dismissToasts(n){n.toasts.forEach(r=>r.send("DISMISS"))},removeToast(n,r,{self:o}){o.stopChild(r.id),n.toasts=n.toasts.filter(i=>i.id!==r.id),n.heights=n.heights.filter(i=>i.id!==r.id)},removeToasts(n,r,{self:o}){n.toasts.forEach(i=>o.stopChild(i.id)),n.toasts=[],n.heights=[]},syncHeights(n,r){let o=n.heights.find(i=>i.id===r.id);if(o)o.height=r.height,o.placement=r.placement;else{let i={id:r.id,height:r.height,placement:r.placement};n.heights=[i,...n.heights]}},syncToastIndex(n){es(n,(r,o,i)=>{r.state.context.index=o,r.state.context.frontmost=o===0,r.state.context.zIndex=i.length-o})},syncToastOffset(n,r){let o=r.placement??n.placement;es({...n,placement:o},i=>{let a=Math.max(n.heights.findIndex(c=>c.id===i.id),0),s=n.heights.reduce((c,l,u)=>u>=a?c:c+l.height,0);i.state.context.offset=a*n.gap+s})},setLastFocusedEl(n,r){n.isFocusWithin||!r.target||(n.isFocusWithin=!0,n.lastFocusedEl=Tt(r.target))},restoreLastFocusedEl(n){n.isFocusWithin=!1,n.lastFocusedEl&&(n.lastFocusedEl.focus({preventScroll:!0}),n.lastFocusedEl=null)},clearLastFocusedEl(n){n.lastFocusedEl&&(n.lastFocusedEl.focus({preventScroll:!0}),n.lastFocusedEl=null,n.isFocusWithin=!1)}}})}function es(e,t){mc(e.toasts,e.placement).forEach(t)}function wg(e,t,n){let r=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,c="center"]=i.split("-");return{type:a,title:e.context.title,description:e.context.description,placement:i,visible:r,paused:o,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps(){return n.element({...bo.root.attrs,dir:e.context.dir,id:lt.getRootId(e.context),"data-state":r?"open":"closed","data-type":a,"data-placement":i,"data-align":c,"data-side":s,"data-mounted":xt(e.context.mounted),"data-paused":xt(o),"data-first":xt(e.context.frontmost),"data-sibling":xt(!e.context.frontmost),"data-stack":xt(e.context.stacked),"data-overlap":xt(!e.context.stacked),role:"status","aria-atomic":"true","aria-describedby":e.context.description?lt.getDescriptionId(e.context):void 0,"aria-labelledby":e.context.title?lt.getTitleId(e.context):void 0,tabIndex:0,style:XC(e.context,r),onKeyDown(l){l.defaultPrevented||l.key=="Escape"&&(t("DISMISS"),l.preventDefault())}})},getGhostBeforeProps(){return n.element({"data-ghost":"before",style:ZC(e.context,r)})},getGhostAfterProps(){return n.element({"data-ghost":"after",style:JC()})},getTitleProps(){return n.element({...bo.title.attrs,id:lt.getTitleId(e.context)})},getDescriptionProps(){return n.element({...bo.description.attrs,id:lt.getDescriptionId(e.context)})},getActionTriggerProps(){return n.button({...bo.actionTrigger.attrs,type:"button",onClick(l){l.defaultPrevented||(e.context.action?.onClick?.(),t("DISMISS"))}})},getCloseTriggerProps(){return n.button({id:lt.getCloseTriggerId(e.context),...bo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(l){l.defaultPrevented||t("DISMISS")}})}}}var ts={connect:QC,machine:o_};var gc=e=>{let t=ts.machine({id:"1",...e});return{...ts.connect(t,t.send,Rt),machine:t}},[a_,gr]=Ve({hookName:"useToastContext",providerName:"<ToastProvider />"}),Sg=e=>{let t=gr(),n=ee(()=>t().getActionTriggerProps(),e);return m(fe.button,n)},Tg=e=>{let t=gr(),n=ee(()=>t().getCloseTriggerProps(),e);return m(fe.button,n)},Cg=e=>e.children(gr()),_g=e=>{let t=gr(),n=ee(()=>t().getDescriptionProps(),e);return m(fe.div,n)},s_=S("<div><div></div><div>"),kg=e=>{let t=gr(),n=ee(()=>t().getRootProps(),e);return(()=>{var r=s_(),o=r.firstChild,i=o.nextSibling;return Te(r,n,!1,!0),Te(o,Se(()=>t().getGhostBeforeProps()),!1,!1),x(r,()=>e.children,i),Te(i,Se(()=>t().getGhostAfterProps()),!1,!1),r})()},Eg=e=>{let t=gr(),n=ee(()=>t().getTitleProps(),e);return m(fe.div,n)},hc=e=>{let[t,n]=Be(e,["toaster","children"]),[r,o]=rn(t.toaster.machine),i=r.context.placement,a=B(()=>ts.connect(r,o,Rt)),s=B(()=>a().getToastsByPlacement(i)),c=ee(a().getGroupProps({placement:i}),n);return m(fe.div,Se(c,{get children(){return m(he,{get each(){return s()},children:l=>m(l_,{value:l,children:u=>t.children(u)})})}}))},l_=e=>{let[t,n]=Yp(e.value),r=B(()=>wg(t,n,Rt)),o=B(()=>t.context);return m(a_,{value:r,get children(){return e.children(o)}})},hr={};zn(hr,{ActionTrigger:()=>Sg,CloseTrigger:()=>Tg,Context:()=>Cg,Description:()=>_g,Root:()=>kg,Title:()=>Eg});var Si=(e,t)=>({x:e,y:t});function c_(e){let{x:t,y:n,width:r,height:o}=e,i=t+r/2,a=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:i,midY:a,center:Si(i,a)}}function u_(e){let t=Si(e.minX,e.minY),n=Si(e.maxX,e.minY),r=Si(e.maxX,e.maxY),o=Si(e.minX,e.maxY);return{top:t,right:n,bottom:r,left:o}}var{min:iM,max:aM}=Math;function Pg(e,t){let n=c_(e),{top:r,right:o,left:i,bottom:a}=u_(n),[s]=t.split("-");return{top:[i,r,o,a],right:[r,o,a,i],bottom:[r,i,a,o],left:[o,r,i,a]}[s]}function Ig(e,t){let{x:n,y:r}=t,o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let s=e[i].x,c=e[i].y,l=e[a].x,u=e[a].y;c>r!=u>r&&n<(l-s)*(r-c)/(u-c)+s&&(o=!o)}return o}var{sign:sM,abs:lM,min:cM}=Math;var Og=Ht("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),pt=Og.build(),Z=Hn({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,getContentEl:e=>Z.getById(e,Z.getContentId(e)),getPositionerEl:e=>Z.getById(e,Z.getPositionerId(e)),getTriggerEl:e=>Z.getById(e,Z.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?Z.getById(e,e.highlightedValue):null,getArrowEl:e=>Z.getById(e,Z.getArrowId(e)),getElements:e=>{let n=`[role^="menuitem"][data-ownedby=${CSS.escape(Z.getContentId(e))}]:not([data-disabled])`;return ja(Z.getContentEl(e),n)},getFirstEl:e=>Ip(Z.getElements(e)),getLastEl:e=>Ap(Z.getElements(e)),getNextEl:(e,t)=>sm(Z.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>lm(Z.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>rc(Z.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>tt(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl(e){return{id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type}}});function Rg(e,t,n){let r=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=ig({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function c(d){return{disabled:!!d.disabled,highlighted:e.context.highlightedValue===d.value}}function l(d){let p=d.valueText??d.value;return{...d,id:d.value,valueText:p}}function u(d){return{...c(l(d)),checked:!!d.checked}}function f(d){let{value:p,closeOnSelect:h,valueText:g}=d,v=c(d);return n.element({...pt.item.attrs,id:p,role:"menuitem","aria-disabled":v.disabled,"data-disabled":xt(v.disabled),"data-ownedby":Z.getContentId(e.context),"data-highlighted":xt(v.highlighted),"data-valuetext":g,onDragStart(y){y.currentTarget.matches("a[href]")&&y.preventDefault()},onPointerMove(y){if(v.disabled||y.pointerType!=="mouse")return;let T=y.currentTarget;v.highlighted||t({type:"ITEM_POINTERMOVE",id:p,target:T,closeOnSelect:h})},onPointerLeave(y){if(v.disabled||y.pointerType!=="mouse"||!e.previousEvent.type.includes("POINTER"))return;let C=y.currentTarget;t({type:"ITEM_POINTERLEAVE",id:p,target:C,closeOnSelect:h})},onPointerDown(y){if(v.disabled)return;let T=y.currentTarget;t({type:"ITEM_POINTERDOWN",target:T,id:p,closeOnSelect:h})},onClick(y){if(ec(y)||Ql(y)||v.disabled)return;let T=y.currentTarget;t({type:"ITEM_CLICK",target:T,id:p,closeOnSelect:h})}})}return{highlightedValue:e.context.highlightedValue,open:a,setOpen(d){d!==a&&t(d?"OPEN":"CLOSE")},setHighlightedValue(d){t({type:"HIGHLIGHTED.SET",id:d})},setParent(d){t({type:"PARENT.SET",value:d,id:d.state.context.id})},setChild(d){t({type:"CHILD.SET",value:d,id:d.state.context.id})},reposition(d={}){t({type:"POSITIONING.SET",options:d})},getContextTriggerProps(){return n.element({...pt.contextTrigger.attrs,dir:e.context.dir,id:Z.getContextTriggerId(e.context),onPointerDown(d){if(d.pointerType==="mouse")return;let p=Ja(d);t({type:"CONTEXT_MENU_START",point:p})},onPointerCancel(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onPointerMove(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onPointerUp(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL")},onContextMenu(d){let p=Ja(d);t({type:"CONTEXT_MENU",point:p}),d.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(d){return $a(f({value:d.getTriggerProps().id}),d.getTriggerProps())},getTriggerProps(){return n.button({...r?pt.triggerItem.attrs:pt.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:Z.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":Z.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(d){d.pointerType!=="mouse"||Z.isTargetDisabled(d.currentTarget)||!r||t({type:"TRIGGER_POINTERMOVE",target:d.currentTarget})},onPointerLeave(d){if(Z.isTargetDisabled(d.currentTarget)||d.pointerType!=="mouse"||!r)return;let p=Ja(d);t({type:"TRIGGER_POINTERLEAVE",target:d.currentTarget,point:p})},onPointerDown(d){Z.isTargetDisabled(d.currentTarget)||Za(d)||d.preventDefault()},onClick(d){d.defaultPrevented||Z.isTargetDisabled(d.currentTarget)||t({type:"TRIGGER_CLICK",target:d.currentTarget})},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(d){if(d.defaultPrevented)return;let p={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}},h=pc(d,e.context),g=p[h];g&&(d.preventDefault(),g(d))}})},getIndicatorProps(){return n.element({...pt.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"})},getPositionerProps(){return n.element({...pt.positioner.attrs,dir:e.context.dir,id:Z.getPositionerId(e.context),style:s.floating})},getArrowProps(){return n.element({id:Z.getArrowId(e.context),...pt.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return n.element({...pt.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getContentProps(){return n.element({...pt.content.attrs,id:Z.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":Z.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(d){d.pointerType==="mouse"&&t("MENU_POINTERENTER")},onKeyDown(d){if(d.defaultPrevented||!am(d))return;let p=an(d);if(!(p?.closest("[role=menu]")===d.currentTarget||p===d.currentTarget))return;if(d.key==="Tab"&&!fm(d)){d.preventDefault();return}let g=Z.getHighlightedItemEl(e.context),v={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),cg(g)},Space(C){o?t({type:"TYPEAHEAD",key:C.key}):v.Enter?.(C)},Home(){t("HOME")},End(){t("END")}},y=pc(d,{dir:e.context.dir}),T=v[y];if(T){T(d),d.stopPropagation(),d.preventDefault();return}e.context.typeahead&&sg(d)&&(lg(d)||ic(p)||(t({type:"TYPEAHEAD",key:d.key}),d.preventDefault()))}})},getSeparatorProps(){return n.element({...pt.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"})},getItemState:c,getItemProps:f,getOptionItemState:u,getOptionItemProps(d){let{type:p,disabled:h,onCheckedChange:g,closeOnSelect:v}=d,y=l(d),T=u(d);return{...f(y),...n.element({"data-type":p,...pt.item.attrs,dir:e.context.dir,"data-value":y.value,role:`menuitem${p}`,"aria-checked":!!T.checked,"data-state":T.checked?"checked":"unchecked",onClick(C){if(h||ec(C)||Ql(C))return;let E=C.currentTarget;t({type:"ITEM_CLICK",target:E,option:y,closeOnSelect:v}),g?.(!T.checked)}})}},getItemIndicatorProps(d){let p=u(d);return n.element({...pt.itemIndicator.attrs,dir:e.context.dir,"data-disabled":xt(p.disabled),"data-highlighted":xt(p.highlighted),"data-state":p.checked?"checked":"unchecked",hidden:!p.checked})},getItemTextProps(d){let p=u(d);return n.element({...pt.itemText.attrs,dir:e.context.dir,"data-disabled":xt(p.disabled),"data-highlighted":xt(p.highlighted),"data-state":p.checked?"checked":"unchecked"})},getItemGroupLabelProps(d){return n.element({id:Z.getGroupLabelId(e.context,d.htmlFor),dir:e.context.dir,...pt.itemGroupLabel.attrs})},getItemGroupProps(d){return n.element({id:Z.getGroupId(e.context,d.id),...pt.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":Z.getGroupLabelId(e.context,d.id),role:"group"})}}}var{not:Nt,and:yo,or:d_}=Na;function Mg(e){let t=st(e);return jt({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:At(Tt({})),suspendPointer:!1,restoreFocus:!0,typeaheadState:rc.defaultOptions},computed:{isSubmenu:n=>n.parent!==null,isRtl:n=>n.dir==="rtl",isTypingAhead:n=>n.typeaheadState.keysSoFar!==""},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:Nt("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:d_("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:yo(Nt("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:Nt("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:yo("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:Nt("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:yo(Nt("suspendPointer"),Nt("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:yo(Nt("isTriggerItemHighlighted"),Nt("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:yo(Nt("isTriggerItemHighlighted"),Nt("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:yo(Nt("isTriggerItemHighlighted"),Nt("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(n,r)=>!!(r?.closeOnSelect??n.closeOnSelect),isTriggerItem:(n,r)=>Z.isTriggerItem(r.target),isTriggerItemHighlighted:(n,r)=>!!(r.target??Z.getHighlightedItemEl(n))?.hasAttribute("aria-controls"),isSubmenu:n=>n.isSubmenu,suspendPointer:n=>n.suspendPointer,isHighlightedItemEditable:n=>ic(Z.getHighlightedItemEl(n)),isWithinPolygon:(n,r)=>n.intentPolygon?Ig(n.intentPolygon,r.point):!1,isOpenControlled:n=>!!n["open.controlled"],isArrowLeftEvent:(n,r)=>r.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:(n,r)=>r.previousEvent?.type==="ARROW_UP",isArrowDownEvent:(n,r)=>r.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:(n,r)=>r.previousEvent?.type==="OPEN_AUTOFOCUS"},activities:{trackPositioning(n){if(n.anchorPoint)return;n.currentPlacement=n.positioning.placement;let r=()=>Z.getPositionerEl(n);return dc(Z.getTriggerEl(n),r,{...n.positioning,defer:!0,onComplete(o){n.currentPlacement=o.placement}})},trackInteractOutside(n,r,{send:o}){return Qa(()=>Z.getContentEl(n),{defer:!0,exclude:[Z.getTriggerEl(n)],onInteractOutside:n.onInteractOutside,onFocusOutside:n.onFocusOutside,onEscapeKeyDown(a){n.onEscapeKeyDown?.(a),n.isSubmenu&&a.preventDefault(),Ag(n)},onPointerDownOutside(a){n.restoreFocus=!a.detail.focusable,n.onPointerDownOutside?.(a)},onDismiss(){o({type:"CLOSE",src:"interact-outside"})}})},trackPointerMove(n,r,{guards:o,send:i}){let{isWithinPolygon:a}=o;n.parent.state.context.suspendPointer=!0;let s=Z.getDoc(n);return Wt(s,"pointermove",c=>{let l={x:c.clientX,y:c.clientY};a(n,{point:l})||(i("POINTER_MOVED_AWAY_FROM_SUBMENU"),n.parent.state.context.suspendPointer=!1)})},scrollToHighlightedItem(n,r,{getState:o}){let i=()=>{if(o().event.type.startsWith("ITEM_POINTER"))return;let c=Z.getHighlightedItemEl(n),l=Z.getContentEl(n);hm(c,{rootEl:l,block:"nearest"})};return He(()=>i()),gm(()=>Z.getContentEl(n),{defer:!0,attributes:["aria-activedescendant"],callback:i})}},actions:{setAnchorPoint(n,r){n.anchorPoint=r.point},setSubmenuPlacement(n){n.isSubmenu&&(n.positioning.placement=n.isRtl?"left-start":"right-start",n.positioning.gutter=0)},reposition(n,r){let o=()=>Z.getPositionerEl(n),i=n.anchorPoint?()=>({width:0,height:0,...n.anchorPoint}):void 0;dc(Z.getTriggerEl(n),o,{...n.positioning,defer:!0,getAnchorRect:i,...r.options??{},listeners:!1,onComplete(a){n.currentPlacement=a.placement}})},setOptionState(n,r){if(!r.option)return;let{checked:o,onCheckedChange:i,type:a}=r.option;a==="radio"?i?.(!0):a==="checkbox"&&i?.(!o)},clickHighlightedItem(n,r){let o=Z.getHighlightedItemEl(n);!o||o.dataset.disabled||queueMicrotask(()=>o.click())},setIntentPolygon(n,r){let o=Z.getContentEl(n),i=n.currentPlacement;if(!o||!i)return;let a=o.getBoundingClientRect(),s=Pg(a,i);if(!s)return;let l=rg(i)==="right"?-5:5;n.intentPolygon=[{...r.point,x:r.point.x+l},...s]},clearIntentPolygon(n){n.intentPolygon=null},resumePointer(n){n.parent&&(n.parent.state.context.suspendPointer=!1)},setHighlightedItem(n,r){Gn.highlighted(n,r.id)},clearHighlightedItem(n){Gn.highlighted(n,null)},focusMenu(n){He(()=>{let r=Z.getContentEl(n);dm({root:r,enabled:!Mt(r,Z.getActiveElement(n)),filter(i){return!i.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem(n){(Z.getContentEl(n)?queueMicrotask:He)(()=>{let o=Z.getFirstEl(n);o&&Gn.highlighted(n,o.id)})},highlightLastItem(n){(Z.getContentEl(n)?queueMicrotask:He)(()=>{let o=Z.getLastEl(n);o&&Gn.highlighted(n,o.id)})},highlightNextItem(n,r){let o=Z.getNextEl(n,r.loop);Gn.highlighted(n,o?.id??null)},highlightPrevItem(n,r){let o=Z.getPrevEl(n,r.loop);Gn.highlighted(n,o?.id??null)},invokeOnSelect(n){n.highlightedValue&&n.onSelect?.({value:n.highlightedValue})},focusTrigger(n){n.isSubmenu||n.anchorPoint||!n.restoreFocus||queueMicrotask(()=>Z.getTriggerEl(n)?.focus({preventScroll:!0}))},highlightMatchedItem(n,r){let o=Z.getElemByKey(n,r.key);o&&Gn.highlighted(n,o.id)},setParentMenu(n,r){n.parent=Tt(r.value)},setChildMenu(n,r){n.children[r.id]=Tt(r.value)},closeRootMenu(n){Ag(n)},openSubmenu(n){let o=Z.getHighlightedItemEl(n)?.getAttribute("data-uid");(o?n.children[o]:null)?.send("OPEN_AUTOFOCUS")},focusParentMenu(n){n.parent?.send("FOCUS_MENU")},setLastHighlightedItem(n,r){n.lastHighlightedValue=r.id},restoreHighlightedItem(n){n.lastHighlightedValue&&(Gn.highlighted(n,n.lastHighlightedValue),n.lastHighlightedValue=null)},restoreParentHiglightedItem(n){n.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(n){n.onOpenChange?.({open:!0})},invokeOnClose(n){n.onOpenChange?.({open:!1})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}function Ag(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var Gn={highlighted(e,t){Da(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}},f_=Ot()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),vM=nn(f_),p_=Ot()(["closeOnSelect","disabled","value","valueText"]),wM=nn(p_),m_=Ot()(["htmlFor"]),SM=nn(m_),g_=Ot()(["id"]),TM=nn(g_),h_=Ot()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]),CM=nn(h_);var[Dg,We]=Ve({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),Lg=e=>{let t=We(),n=ee(()=>t().getArrowProps(),e);return m(fe.div,n)},Ng=e=>{let t=We(),n=ee(()=>t().getArrowTipProps(),e);return m(fe.div,n)},[bc,$g]=Ve({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Bg,Fg]=Ve({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),Ug=e=>{let[t,n]=et()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=ee(t,{type:"checkbox"}),o=We(),i=ee(()=>o().getOptionItemProps(r),n),a=B(()=>o().getItemState(r));return m(Bg,{value:r,get children(){return m(bc,{value:a,get children(){return m(fe.div,i)}})}})},jg=e=>{let t=We(),n=Vn(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return m(N,{get when(){return!n().unmounted},get children(){return m(fe.div,r)}})},Vg=e=>e.children(We()),Hg=e=>{let t=We(),n=ee(()=>t().getContextTriggerProps(),e);return m(fe.button,n)},zg=e=>{let t=We(),n=ee(()=>t().getIndicatorProps(),e);return m(fe.div,n)},Gg=e=>{let[t,n]=et()(e,["closeOnSelect","disabled","value","valueText"]),r=We(),o=ee(()=>r().getItemProps(t),n),i=B(()=>r().getItemState(t));return m(bc,{value:i,get children(){return m(fe.div,o)}})},Wg=e=>e.children($g()),[qg,Kg]=Ve({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),Yg=e=>{let[t,n]=et()(e,["id"]),r=ee({id:Jt()},t),o=We(),i=ee(()=>o().getItemGroupProps(r),n);return m(qg,{value:r,get children(){return m(fe.div,i)}})},Xg=e=>{let t=We(),n=Kg(),r=ee(t().getItemGroupLabelProps({htmlFor:n.id}),e);return m(fe.div,r)},Zg=e=>{let t=We(),n=Fg(),r=ee(()=>t().getItemIndicatorProps(n),e);return m(fe.div,r)},Jg=e=>{let t=We(),n=Fg(),r=ee(()=>t().getItemTextProps(n),e);return m(fe.div,r)},Qg=e=>{let t=We(),n=Vn(),r=ee(()=>t().getPositionerProps(),e);return m(N,{get when(){return!n().unmounted},get children(){return m(fe.div,r)}})},eh=e=>{let[t,n]=et()(e,["closeOnSelect","disabled","value","valueText"]),r=We(),o=Kg(),i=ee(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=ee(()=>r().getOptionItemProps(i),n),s=B(()=>r().getOptionItemState(i));return m(Bg,{value:i,get children(){return m(bc,{value:s,get children(){return m(fe.div,a)}})}})},th=e=>{let[t,n]=et()(e,["id","onValueChange","value"]),r=We(),o=ee({id:Jt()},t),i=ee(()=>r().getItemGroupProps(o),n);return m(qg,{value:o,get children(){return m(fe.div,i)}})},nh=e=>{let t=uo(),n=lr(),r=Jt(),o=B(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a,s]=rn(Mg(o()),{context:o});return{api:B(()=>Rg(i,a,Rt)),machine:s}},[rh,oh]=Ve({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[ih,y_]=Ve({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),ah=e=>{let[t,n]=lo(e),[r,o]=et()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=We(),a=oh(),s=nh(r),c=sr(ee(t,()=>({present:s.api().open})));return ge(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a))}),m(ih,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(rh,{get value(){return s.machine},get children(){return m(Dg,{get value(){return s.api},get children(){return m(co,{value:c,get children(){return o.children}})}})}})}})},sh=e=>{let t=We(),n=oh(),[r,o]=lo(e),i=sr(ee(r,()=>({present:o.value.api().open})));return ge(()=>{n&&(t?.().setChild(o.value.machine),o.value.api().setParent(n))}),m(ih,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(rh,{get value(){return o.value.machine},get children(){return m(Dg,{get value(){return o.value.api},get children(){return m(co,{value:i,get children(){return o.children}})}})}})}})},lh=e=>{let t=We(),n=ee(()=>t().getSeparatorProps(),e);return m(fe.hr,n)},ch=e=>{let t=We(),n=Vn(),r=ee(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(fe.button,r)},uh=e=>{let t=y_(),n=ee(()=>t?.(),e);return m(fe.div,n)},_n={};zn(_n,{Arrow:()=>Lg,ArrowTip:()=>Ng,CheckboxItem:()=>Ug,Content:()=>jg,Context:()=>Vg,ContextTrigger:()=>Hg,Indicator:()=>zg,Item:()=>Gg,ItemContext:()=>Wg,ItemGroup:()=>Yg,ItemGroupLabel:()=>Xg,ItemIndicator:()=>Zg,ItemText:()=>Jg,Positioner:()=>Qg,RadioItem:()=>eh,RadioItemGroup:()=>th,Root:()=>ah,RootProvider:()=>sh,Separator:()=>lh,Trigger:()=>ch,TriggerItem:()=>uh});var dh=Ht("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),kn=dh.build(),ns=Hn({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function fh(e,t,n){let r=e.context.percent,o=e.context.isIndeterminate?"":`${r}%`,i=e.context.max,a=e.context.min,s=e.context.orientation,c=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,f=c.value({value:u,max:i,percent:r,min:a}),d=x_(u,i),p={role:"progressbar","aria-label":f,"data-max":i,"aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":u??void 0,"data-orientation":s,"data-state":d},h=v_(e.context);return{value:u,valueAsString:f,min:a,max:i,percent:r,percentAsString:o,indeterminate:l,setValue(g){t({type:"VALUE.SET",value:g})},setToMax(){t({type:"VALUE.SET",value:i})},setToMin(){t({type:"VALUE.SET",value:a})},getRootProps(){return n.element({dir:e.context.dir,...kn.root.attrs,id:ns.getRootId(e.context),"data-max":i,"data-value":u??void 0,"data-state":d,"data-orientation":s,style:{"--percent":l?void 0:r}})},getLabelProps(){return n.element({dir:e.context.dir,id:ns.getLabelId(e.context),...kn.label.attrs,"data-orientation":s})},getValueTextProps(){return n.element({dir:e.context.dir,"aria-live":"polite",...kn.valueText.attrs})},getTrackProps(){return n.element({dir:e.context.dir,id:ns.getTrackId(e.context),...kn.track.attrs,...p})},getRangeProps(){return n.element({dir:e.context.dir,...kn.range.attrs,"data-orientation":s,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${r}%`}})},getCircleProps(){return n.element({dir:e.context.dir,id:ns.getCircleId(e.context),...kn.circle.attrs,...p,...h.root})},getCircleTrackProps(){return n.element({dir:e.context.dir,"data-orientation":s,...kn.circleTrack.attrs,...h.track})},getCircleRangeProps(){return n.element({dir:e.context.dir,...kn.circleRange.attrs,...h.range,"data-state":d})},getViewProps(g){return n.element({dir:e.context.dir,...kn.view.attrs,"data-state":g.state,hidden:g.state!==d})}}}function x_(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function v_(e){let t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:e.value===0?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}function w_(e,t){return e+(t-e)/2}function ph(e){let t=st(e);return jt({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:w_(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:n=>n.value===null,percent(n){return pi(n.value)?Math.round((n.value-n.min)/(n.max-n.min)*100):-1},isAtMax:n=>n.value===n.max,isHorizontal:n=>n.orientation==="horizontal",isRtl:n=>n.dir==="rtl"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(n,r)=>{n.value=r.value===null?null:Math.max(0,Math.min(r.value,n.max))},validateContext:n=>{if(n.value!=null){if(!yc(n.max))throw new Error(`[progress] The max value passed \`${n.max}\` is not a valid number`);if(!S_(n.value,n.max))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the max value \`${n.max}\``);if(!T_(n.value,n.min))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the min value \`${n.min}\``)}}}})}function yc(e){return pi(e)&&!isNaN(e)}function S_(e,t){return yc(e)&&e<=t}function T_(e,t){return yc(e)&&e>=t}var C_=Ot()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]),jM=nn(C_);var[mh,dn]=Ve({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),gh=e=>{let t=dn(),n=ee(()=>t().getCircleProps(),e);return m(fe.svg,n)},hh=e=>{let t=dn(),n=ee(()=>t().getCircleRangeProps(),e);return m(fe.circle,n)},bh=e=>{let t=dn(),n=ee(()=>t().getCircleTrackProps(),e);return m(fe.circle,n)},yh=e=>e.children(dn()),xh=e=>{let t=dn(),n=ee(()=>t().getLabelProps(),e);return m(fe.label,n)},vh=e=>{let t=dn(),n=ee(()=>t().getRangeProps(),e);return m(fe.div,n)},wh=e=>{let t=uo(),n=lr(),r=Jt(),o=B(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,...e})),[i,a]=rn(ph(o()),{context:o});return B(()=>fh(i,a,Rt))},Sh=e=>{let[t,n]=et()(e,["id","ids","max","min","orientation","translations","value"]),r=wh(t),o=ee(()=>r().getRootProps(),n);return m(mh,{value:r,get children(){return m(fe.div,o)}})},Th=e=>{let[{value:t},n]=et()(e,["value"]),r=ee(()=>t().getRootProps(),n);return m(mh,{value:t,get children(){return m(fe.div,r)}})},Ch=e=>{let t=dn(),n=ee(()=>t().getTrackProps(),e);return m(fe.div,n)},_h=e=>{let t=dn(),n=ee(()=>t().getValueTextProps(),e);return m(fe.span,Se(n,{get children(){return e.children||t().percentAsString}}))},kh=e=>{let[t,n]=et()(e,["state"]),r=dn(),o=ee(()=>r().getViewProps(t),n);return m(fe.span,o)},br={};zn(br,{Circle:()=>gh,CircleRange:()=>hh,CircleTrack:()=>bh,Context:()=>yh,Label:()=>xh,Range:()=>vh,Root:()=>Sh,RootProvider:()=>Th,Track:()=>Ch,ValueText:()=>_h,View:()=>kh});var k_=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xo=new WeakMap,rs=new WeakMap,os={},xc=0,Eh=function(e){return e&&(e.host||Eh(e.parentNode))},E_=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Eh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},P_=function(e,t,n,r){var o=E_(t,Array.isArray(e)?e:[e]);os[n]||(os[n]=new WeakMap);var i=os[n],a=[],s=new Set,c=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};o.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))u(d);else try{var p=d.getAttribute(r),h=p!==null&&p!=="false",g=(xo.get(d)||0)+1,v=(i.get(d)||0)+1;xo.set(d,g),i.set(d,v),a.push(d),g===1&&h&&rs.set(d,!0),v===1&&d.setAttribute(n,"true"),h||d.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return u(t),s.clear(),xc++,function(){a.forEach(function(f){var d=xo.get(f)-1,p=i.get(f)-1;xo.set(f,d),i.set(f,p),d||(rs.has(f)||f.removeAttribute(r),rs.delete(f)),p||f.removeAttribute(n)}),xc--,xc||(xo=new WeakMap,xo=new WeakMap,rs=new WeakMap,os={})}},Ph=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||k_(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),P_(r,o,n,"aria-hidden")):function(){return null}};var I_=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function Ih(e,t={}){let{defer:n=!0}=t,r=n?I_:i=>i(),o=[];return o.push(r(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);o.push(Ph(a))})),()=>{o.forEach(i=>i?.())}}var vc="data-scroll-lock";function Ah(e,t){if(!e)return;let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function A_(e,t,n){if(!e)return;let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}function O_(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function Oh(e){let t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(vc))return;o.setAttribute(vc,"");let a=n.innerWidth-r.clientWidth,s=()=>A_(r,"--scrollbar-width",`${a}px`),c=O_(r),l=()=>Ah(o,{overflow:"hidden",[c]:`${a}px`}),u=()=>{let{scrollX:d,scrollY:p,visualViewport:h}=n,g=h?.offsetLeft??0,v=h?.offsetTop??0,y=Ah(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(v))}px`,left:`${-(d-Math.floor(g))}px`,right:"0",[c]:`${a}px`});return()=>{y?.(),n.scrollTo({left:d,top:p,behavior:"instant"})}},f=[s(),im()?u():l()];return()=>{f.forEach(d=>d?.()),o.removeAttribute(vc)}}var Mh=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],is=Mh.join(","),Dh=typeof Element>"u",yr=Dh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,as=!Dh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},ss=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",a=i||n&&t&&e(t.parentNode);return a},R_=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Lh=function(t,n,r){if(ss(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(is));return n&&yr.call(t,is)&&o.unshift(t),o=o.filter(r),o},Nh=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!ss(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),c=s.length?s:a.children,l=e(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{var u=yr.call(a,is);u&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!ss(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var p=e(f===!0?a.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:a,candidates:p})}else i.unshift.apply(i,a.children)}}return o},$h=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Wn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||R_(t))&&!$h(t)?0:t.tabIndex},M_=function(t,n){var r=Wn(t);return r<0&&n&&!$h(t)?0:r},D_=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Bh=function(t){return t.tagName==="INPUT"},L_=function(t){return Bh(t)&&t.type==="hidden"},N_=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},$_=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},B_=function(t){if(!t.name)return!0;var n=t.form||as(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=$_(o,t.form);return!i||i===t},F_=function(t){return Bh(t)&&t.type==="radio"},U_=function(t){return F_(t)&&!B_(t)},j_=function(t){var n,r=t&&as(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var a,s,c;for(i=!!((a=o)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var l,u,f;r=as(o),o=(l=r)===null||l===void 0?void 0:l.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Rh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},V_=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=yr.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(yr.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var c=t.parentElement,l=as(t);if(c&&!c.shadowRoot&&o(c)===!0)return Rh(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=s}if(j_(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Rh(t);return!1},H_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return yr.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ls=function(t,n){return!(n.disabled||ss(n)||L_(n)||V_(n,t)||N_(n)||H_(n))},wc=function(t,n){return!(U_(n)||Wn(n)<0||!ls(t,n))},z_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},G_=function e(t){var n=[],r=[];return t.forEach(function(o,i){var a=!!o.scopeParent,s=a?o.scopeParent:o,c=M_(s,a),l=a?e(o.candidates):s;c===0?a?n.push.apply(n,l):n.push(s):r.push({documentOrder:i,tabIndex:c,item:o,isScope:a,content:l})}),r.sort(D_).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Fh=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Nh([t],n.includeContainer,{filter:wc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:z_}):r=Lh(t,n.includeContainer,wc.bind(null,n)),G_(r)},Uh=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Nh([t],n.includeContainer,{filter:ls.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Lh(t,n.includeContainer,ls.bind(null,n)),r},xr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yr.call(t,is)===!1?!1:wc(n,t)},W_=Mh.concat("iframe").join(","),cs=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yr.call(t,W_)===!1?!1:ls(n,t)};function q_(e,t,n){return(t=Y_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jh(Object(n),!0).forEach(function(r){q_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K_(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y_(e){var t=K_(e,"string");return typeof t=="symbol"?t:t+""}var Hh={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},X_=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Z_=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Ci=function(t){return t?.key==="Tab"||t?.keyCode===9},J_=function(t){return Ci(t)&&!t.shiftKey},Q_=function(t){return Ci(t)&&t.shiftKey},zh=function(t){return setTimeout(t,0)},Gh=function(t,n){var r=-1;return t.every(function(o,i){return n(o)?(r=i,!1):!0}),r},Ti=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},us=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},ek=[],Wh=function(t,n){var r=n?.document||document,o=n?.trapStack||ek,i=Vh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:J_,isKeyBackward:Q_},n),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,c=function(_,w,M){return _&&_[w]!==void 0?_[w]:i[M||w]},l=function(_,w){var M=typeof w?.composedPath=="function"?w.composedPath():void 0;return a.containerGroups.findIndex(function(D){var J=D.container,ue=D.tabbableNodes;return J.contains(_)||M?.includes(J)||ue.find(function(le){return le===_})})},u=function(_){var w=i[_];if(typeof w=="function"){for(var M=arguments.length,D=new Array(M>1?M-1:0),J=1;J<M;J++)D[J-1]=arguments[J];w=w.apply(void 0,D)}if(w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var ue=w;if(typeof w=="string"&&(ue=r.querySelector(w),!ue))throw new Error("`".concat(_,"` as selector refers to no known node"));return ue},f=function(){var _=u("initialFocus");if(_===!1)return!1;if(_===void 0||!cs(_,i.tabbableOptions))if(l(r.activeElement)>=0)_=r.activeElement;else{var w=a.tabbableGroups[0],M=w&&w.firstTabbableNode;_=M||u("fallbackFocus")}if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},d=function(){if(a.containerGroups=a.containers.map(function(_){var w=Fh(_,i.tabbableOptions),M=Uh(_,i.tabbableOptions),D=w.length>0?w[0]:void 0,J=w.length>0?w[w.length-1]:void 0,ue=M.find(function(we){return xr(we)}),le=M.slice().reverse().find(function(we){return xr(we)}),xe=!!w.find(function(we){return Wn(we)>0});return{container:_,tabbableNodes:w,focusableNodes:M,posTabIndexesFound:xe,firstTabbableNode:D,lastTabbableNode:J,firstDomTabbableNode:ue,lastDomTabbableNode:le,nextTabbableNode:function(St){var $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,mt=w.indexOf(St);return mt<0?$t?M.slice(M.indexOf(St)+1).find(function(Xt){return xr(Xt)}):M.slice(0,M.indexOf(St)).reverse().find(function(Xt){return xr(Xt)}):w[mt+($t?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(_){return _.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(_){var w=_.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?p(w.shadowRoot):w},h=function(_){if(_!==!1&&_!==p(document)){if(!_||!_.focus){h(f());return}_.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=_,X_(_)&&_.select()}},g=function(_){var w=u("setReturnFocus",_);return w||(w===!1?!1:_)},v=function(_){var w=_.target,M=_.event,D=_.isBackward,J=D===void 0?!1:D;w=w||us(M),d();var ue=null;if(a.tabbableGroups.length>0){var le=l(w,M),xe=le>=0?a.containerGroups[le]:void 0;if(le<0)J?ue=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:ue=a.tabbableGroups[0].firstTabbableNode;else if(J){var we=Gh(a.tabbableGroups,function(Oo){var Ro=Oo.firstTabbableNode;return w===Ro});if(we<0&&(xe.container===w||cs(w,i.tabbableOptions)&&!xr(w,i.tabbableOptions)&&!xe.nextTabbableNode(w,!1))&&(we=le),we>=0){var St=we===0?a.tabbableGroups.length-1:we-1,$t=a.tabbableGroups[St];ue=Wn(w)>=0?$t.lastTabbableNode:$t.lastDomTabbableNode}else Ci(M)||(ue=xe.nextTabbableNode(w,!1))}else{var mt=Gh(a.tabbableGroups,function(Oo){var Ro=Oo.lastTabbableNode;return w===Ro});if(mt<0&&(xe.container===w||cs(w,i.tabbableOptions)&&!xr(w,i.tabbableOptions)&&!xe.nextTabbableNode(w))&&(mt=le),mt>=0){var Xt=mt===a.tabbableGroups.length-1?0:mt+1,Ao=a.tabbableGroups[Xt];ue=Wn(w)>=0?Ao.firstTabbableNode:Ao.firstDomTabbableNode}else Ci(M)||(ue=xe.nextTabbableNode(w))}}else ue=u("fallbackFocus");return ue},y=function(_){var w=us(_);if(!(l(w,_)>=0)){if(Ti(i.clickOutsideDeactivates,_)){s.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Ti(i.allowOutsideClick,_)||_.preventDefault()}},T=function(_){var w=us(_),M=l(w,_)>=0;if(M||w instanceof Document)M&&(a.mostRecentlyFocusedNode=w);else{_.stopImmediatePropagation();var D,J=!0;if(a.mostRecentlyFocusedNode)if(Wn(a.mostRecentlyFocusedNode)>0){var ue=l(a.mostRecentlyFocusedNode),le=a.containerGroups[ue].tabbableNodes;if(le.length>0){var xe=le.findIndex(function(we){return we===a.mostRecentlyFocusedNode});xe>=0&&(i.isKeyForward(a.recentNavEvent)?xe+1<le.length&&(D=le[xe+1],J=!1):xe-1>=0&&(D=le[xe-1],J=!1))}}else a.containerGroups.some(function(we){return we.tabbableNodes.some(function(St){return Wn(St)>0})})||(J=!1);else J=!1;J&&(D=v({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),h(D||a.mostRecentlyFocusedNode||f())}a.recentNavEvent=void 0},C=function(_){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=_;var M=v({event:_,isBackward:w});M&&(Ci(_)&&_.preventDefault(),h(M))},E=function(_){(i.isKeyForward(_)||i.isKeyBackward(_))&&C(_,i.isKeyBackward(_))},I=function(_){Z_(_)&&Ti(i.escapeDeactivates,_)!==!1&&(_.preventDefault(),s.deactivate())},U=function(_){var w=us(_);l(w,_)>=0||Ti(i.clickOutsideDeactivates,_)||Ti(i.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},R=function(){if(a.active)return Hh.activateTrap(o,s),a.delayInitialFocusTimer=i.delayInitialFocus?zh(function(){h(f())}):h(f()),r.addEventListener("focusin",T,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",U,{capture:!0,passive:!1}),r.addEventListener("keydown",E,{capture:!0,passive:!1}),r.addEventListener("keydown",I),s},oe=function(){if(a.active)return r.removeEventListener("focusin",T,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",U,!0),r.removeEventListener("keydown",E,!0),r.removeEventListener("keydown",I),s},H=function(_){var w=_.some(function(M){var D=Array.from(M.removedNodes);return D.some(function(J){return J===a.mostRecentlyFocusedNode})});w&&h(f())},G=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(H):void 0,L=function(){G&&(G.disconnect(),a.active&&!a.paused&&a.containers.map(function(_){G.observe(_,{subtree:!0,childList:!0})}))};return s={get active(){return a.active},get paused(){return a.paused},activate:function(_){if(a.active)return this;var w=c(_,"onActivate"),M=c(_,"onPostActivate"),D=c(_,"checkCanFocusTrap");D||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,w?.();var J=function(){D&&d(),R(),L(),M?.()};return D?(D(a.containers.concat()).then(J,J),this):(J(),this)},deactivate:function(_){if(!a.active)return this;var w=Vh({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},_);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,oe(),a.active=!1,a.paused=!1,L(),Hh.deactivateTrap(o,s);var M=c(w,"onDeactivate"),D=c(w,"onPostDeactivate"),J=c(w,"checkCanReturnFocus"),ue=c(w,"returnFocus","returnFocusOnDeactivate");M?.();var le=function(){zh(function(){ue&&h(g(a.nodeFocusedBeforeActivation)),D?.()})};return ue&&J?(J(g(a.nodeFocusedBeforeActivation)).then(le,le),this):(le(),this)},pause:function(_){if(a.paused||!a.active)return this;var w=c(_,"onPause"),M=c(_,"onPostPause");return a.paused=!0,w?.(),oe(),L(),M?.(),this},unpause:function(_){if(!a.paused||!a.active)return this;var w=c(_,"onUnpause"),M=c(_,"onPostUnpause");return a.paused=!1,w?.(),d(),R(),L(),M?.(),this},updateContainerElements:function(_){var w=[].concat(_).filter(Boolean);return a.containers=w.map(function(M){return typeof M=="string"?r.querySelector(M):M}),a.active&&d(),L(),this}},s.updateContainerElements(t),s};var qh=Ht("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),vr=qh.build(),ye=Hn({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>ye.getById(e,ye.getContentId(e)),getPositionerEl:e=>ye.getById(e,ye.getPositionerId(e)),getBackdropEl:e=>ye.getById(e,ye.getBackdropId(e)),getTriggerEl:e=>ye.getById(e,ye.getTriggerId(e)),getTitleEl:e=>ye.getById(e,ye.getTitleId(e)),getDescriptionEl:e=>ye.getById(e,ye.getDescriptionId(e)),getCloseTriggerEl:e=>ye.getById(e,ye.getCloseTriggerId(e))});function Kh(e,t,n){let r=e.context["aria-label"],o=e.matches("open"),i=e.context.renderedElements;return{open:o,setOpen(a){a!==o&&t(a?"OPEN":"CLOSE")},getTriggerProps(){return n.button({...vr.trigger.attrs,dir:e.context.dir,id:ye.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":ye.getContentId(e.context),onClick(a){a.defaultPrevented||t("TOGGLE")}})},getBackdropProps(){return n.element({...vr.backdrop.attrs,dir:e.context.dir,hidden:!o,id:ye.getBackdropId(e.context),"data-state":o?"open":"closed"})},getPositionerProps(){return n.element({...vr.positioner.attrs,dir:e.context.dir,id:ye.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}})},getContentProps(){return n.element({...vr.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:ye.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!i.title?void 0:ye.getTitleId(e.context),"aria-describedby":i.description?ye.getDescriptionId(e.context):void 0})},getTitleProps(){return n.element({...vr.title.attrs,dir:e.context.dir,id:ye.getTitleId(e.context)})},getDescriptionProps(){return n.element({...vr.description.attrs,dir:e.context.dir,id:ye.getDescriptionId(e.context)})},getCloseTriggerProps(){return n.button({...vr.closeTrigger.attrs,dir:e.context.dir,id:ye.getCloseTriggerId(e.context),type:"button",onClick(a){a.defaultPrevented||(a.stopPropagation(),t("CLOSE"))}})}}}function Yh(e){let t=st(e);return jt({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:n=>!!n["open.controlled"]},activities:{trackDismissableElement(n,r,{send:o}){return Qa(()=>ye.getContentEl(n),{defer:!0,pointerBlocking:n.modal,exclude:[ye.getTriggerEl(n)],onInteractOutside(a){n.onInteractOutside?.(a),n.closeOnInteractOutside||a.preventDefault()},persistentElements:n.persistentElements,onFocusOutside:n.onFocusOutside,onPointerDownOutside:n.onPointerDownOutside,onEscapeKeyDown(a){n.onEscapeKeyDown?.(a),n.closeOnEscape||a.preventDefault()},onDismiss(){o({type:"CLOSE",src:"interact-outside"})}})},preventScroll(n){if(n.preventScroll)return Oh(ye.getDoc(n))},trapFocus(n){if(!n.trapFocus||!n.modal)return;let r,o=mm(()=>{let i=ye.getContentEl(n);if(i){r=Wh(i,{document:ye.getDoc(n),escapeDeactivates:!1,preventScroll:!0,fallbackFocus:i,returnFocusOnDeactivate:n.restoreFocus,allowOutsideClick:!0,initialFocus:n.initialFocusEl?.()??void 0,setReturnFocus(a){return n.finalFocusEl?.()??a}});try{r.activate()}catch{}}});return()=>{r?.deactivate(),o()}},hideContentBelow(n){return n.modal?Ih(()=>[ye.getContentEl(n)],{defer:!0}):void 0}},actions:{setAlertDialogProps(n){n.role==="alertdialog"&&(n.initialFocusEl||(n.initialFocusEl=()=>ye.getCloseTriggerEl(n)),n.closeOnInteractOutside=!1)},checkRenderedElements(n){He(()=>{n.renderedElements.title=!!ye.getTitleEl(n),n.renderedElements.description=!!ye.getDescriptionEl(n)})},syncZIndex(n){He(()=>{let r=ye.getContentEl(n);if(!r)return;let i=ye.getWin(n).getComputedStyle(r);[ye.getPositionerEl(n),ye.getBackdropEl(n)].forEach(s=>{s?.style.setProperty("--z-index",i.zIndex)})})},invokeOnClose(n){n.onOpenChange?.({open:!1})},invokeOnOpen(n){n.onOpenChange?.({open:!0})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}var tk=Ot()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),g2=nn(tk);var[Xh,En]=Ve({hookName:"useDialogContext",providerName:"<DialogProvider />"}),Zh=e=>{let t=En(),n=Tp(),r=sr(ee(n,()=>({present:t().open}))),o=ee(()=>t().getBackdropProps(),()=>r().presenceProps,e);return m(N,{get when(){return!r().unmounted},get children(){return m(fe.div,o)}})},Jh=e=>{let t=En(),n=ee(()=>t().getCloseTriggerProps(),e);return m(fe.button,n)},Qh=e=>{let t=En(),n=Vn(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return m(N,{get when(){return!n().unmounted},get children(){return m(fe.div,r)}})},eb=e=>e.children(En()),tb=e=>{let t=En(),n=ee(()=>t().getDescriptionProps(),e);return m(fe.div,n)},nb=e=>{let t=En(),n=Vn(),r=ee(()=>t().getPositionerProps(),e);return m(N,{get when(){return!n().unmounted},get children(){return m(fe.div,r)}})},rb=e=>{let t=uo(),n=lr(),r=Jt(),o=B(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a]=rn(Yh(o()),{context:o});return B(()=>Kh(i,a,Rt))},ob=e=>{let[t,n]=lo(e),[r]=ai(t),[o,i]=et()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=rb(o),s=sr(ee(t,()=>({present:a().open})));return m(Xh,{value:a,get children(){return m(jl,{value:r,get children(){return m(co,{value:s,get children(){return i.children}})}})}})},ib=e=>{let[t,n]=lo(e),[r]=ai(t),o=sr(ee(t,()=>({present:n.value().open})));return m(Xh,{get value(){return n.value},get children(){return m(jl,{value:r,get children(){return m(co,{value:o,get children(){return n.children}})}})}})},ab=e=>{let t=En(),n=ee(()=>t().getTitleProps(),e);return m(fe.h2,n)},sb=e=>{let t=En(),n=Vn(),r=ee(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(fe.button,r)},qn={};zn(qn,{Backdrop:()=>Zh,CloseTrigger:()=>Jh,Content:()=>Qh,Context:()=>eb,Description:()=>tb,Positioner:()=>nb,Root:()=>ob,RootProvider:()=>ib,Title:()=>ab,Trigger:()=>sb});var Kn=gc({placement:"bottom-end",gap:24});var lb=`#brand-mark {
|
|
27
11
|
position: absolute !important;
|
|
28
12
|
padding: 5px 10px !important;
|
|
29
13
|
background-color: rgb(194, 194, 198) !important;
|
|
@@ -54,13 +38,13 @@ but received
|
|
|
54
38
|
color: white !important;
|
|
55
39
|
border-color: rgb(40, 40, 40) !important;
|
|
56
40
|
}
|
|
57
|
-
`;var
|
|
41
|
+
`;var cb=async({apiHost:e,message:t,sessionId:n})=>{try{return{data:await $n.post(`${Ce(e)?e:bt()}/api/v1/sessions/${n}/continueChat`,{json:{message:t},timeout:!1}).json()}}catch(r){return{error:r}}};var Sc=async({apiHost:e,sessionId:t,clientLogs:n})=>{try{await $n.post(`${Ce(e)?e:bt()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:n}})}catch(r){console.log(r)}};var ds=e=>typeof e=="string"?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e);var ub=Object.getPrototypeOf(async()=>{}).constructor,fs=async({content:e,args:t})=>{try{let r=await ub(...t.map(o=>o.id),ok(e))(...t.map(o=>o.value));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(n){return console.log(n),{logs:[{status:"error",description:"Script block failed to execute",details:ds(n)}]}}},ok=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),_i=async({args:e,content:t})=>{try{let r=await ub(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(n){console.warn("Script threw an error:",n)}};var vo="Chatwoot Web Widget Opened";var db=e=>(fs(e.scriptToExecute),{scriptCallbackMessage:vo});var fb=e=>re(window.gtag)?Promise.resolve():new Promise(t=>{let n=document.getElementById("gtag");if(!n){let r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,r.id="gtag";let o=document.createElement("script");o.innerHTML=`window.dataLayer = window.dataLayer || [];
|
|
58
42
|
function gtag(){dataLayer.push(arguments);}
|
|
59
43
|
gtag('js', new Date());
|
|
60
44
|
|
|
61
45
|
gtag('config', '${e}');
|
|
62
|
-
`,document.body.appendChild(r),document.body.appendChild(o),r.onload=()=>{t()}}n&&t()}),
|
|
63
|
-
`).filter(c=>c!=="").map(
|
|
46
|
+
`,document.body.appendChild(r),document.body.appendChild(o),r.onload=()=>{t()}}n&&t()}),pb=e=>{if(e){if(!window.gtag){console.error("Google Analytics was not properly initialized");return}window.gtag("event",e.action,{event_category:$e(e.category)?void 0:e.category,event_label:$e(e.label)?void 0:e.label,value:e.value,send_to:$e(e.sendTo)?void 0:e.sendTo})}};var mb=async e=>{e?.trackingId&&pb(e)};var gb=async e=>{let{url:t,method:n,body:r,headers:o}=e;try{let i=await fetch(t,{method:n,body:n!=="GET"&&r?JSON.stringify(r):void 0,headers:o}),a=i.status,s=await i.json();return JSON.stringify({statusCode:a,data:s})}catch(i){return console.error(i),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}};var uk=Fr(vb(),1);var sk=Symbol("Let zodToJsonSchema decide on which parser to use");var Ei={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Pi={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},Ii={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Ai={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Oi={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Ri={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Mi={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},Di={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},Li={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Ni={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},$i={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},Bi={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},Fi={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},Ui={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},ji={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},dk=[Ei,Pi,Ii,Ai,Oi,Ri,Mi,Di,Li,Ni,$i,Bi,Fi,Ui,ji],fk={[Ei.code]:Ei,[Pi.code]:Pi,[Ii.code]:Ii,[Ai.code]:Ai,[Oi.code]:Oi,[Ri.code]:Ri,[Mi.code]:Mi,[Di.code]:Di,[Li.code]:Li,[Ni.code]:Ni,[$i.code]:$i,[Bi.code]:Bi,[Fi.code]:Fi,[Ui.code]:Ui,[ji.code]:ji},l$={[Ei.name]:Ei.code,[Pi.name]:Pi.code,[Ii.name]:Ii.code,[Ai.name]:Ai.code,[Oi.name]:Oi.code,[Ri.name]:Ri.code,[Mi.name]:Mi.code,[Di.name]:Di.code,[Li.name]:Li.code,[Ni.name]:Ni.code,[$i.name]:$i.code,[Bi.name]:Bi.code,[Fi.name]:Fi.code,[Ui.name]:Ui.code,[ji.name]:ji.code},pk=dk.map(e=>e.code),mk=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let n=e.slice(0,t);if(!pk.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);let r=n,o=e.slice(t+1),i=JSON.parse(o);return fk[r].parse(i)};var gk=10;function hk(e,t){let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*wb(e,{isAborted:t}={}){let n=new TextDecoder,r=[],o=0;for(;;){let{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==gk))continue;if(r.length===0)break;let a=hk(r,o);o=0;let s=n.decode(a,{stream:!0}).split(`
|
|
47
|
+
`).filter(c=>c!=="").map(mk);for(let c of s)yield c;if(t?.()){e.cancel();break}}}var u$=Symbol.for("vercel.ai.schema");var Vi=null,bk=3,yk=1,Cc=e=>async({messages:t,onMessageStream:n})=>{try{Vi=new AbortController;let r=e.apiHost,o=await fetch((Ce(r)?r:bt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Vi.signal});if(!o.ok)return(e.retryAttempt??0)<yk&&(o.status===403||o.status===500||o.status===503)?(await new Promise(c=>setTimeout(c,bk*1e3)),Cc({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:n})):{error:await o.json()||"Failed to fetch the chat response."};if(!o.body)throw new Error("The response body is empty.");let i="",a=o.body.getReader(),s=Jt();for await(let{type:c,value:l}of wb(a,{isAborted:()=>Vi===null}))c==="text"&&(i+=l,n&&n({id:s,message:i}));return Vi=null,{message:i}}catch(r){return console.error(r),r.name==="AbortError"?(Vi=null,{error:{message:"Request aborted"}}):r instanceof Error?{error:{message:r.message}}:{error:{message:"Failed to fetch the chat response."}}}};var Sb=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
|
|
64
48
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
|
65
49
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
|
66
50
|
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
|
@@ -70,7 +54,7 @@ but received
|
|
|
70
54
|
'https://connect.facebook.net/en_US/fbevents.js');
|
|
71
55
|
${e.map(n=>`fbq('init', '${n}');`).join(`
|
|
72
56
|
`)}
|
|
73
|
-
fbq('track', 'PageView');`,document.head.appendChild(t)},
|
|
57
|
+
fbq('track', 'PageView');`,document.head.appendChild(t)},Tb=e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq){console.error("Facebook Pixel was not properly initialized");return}let t=e.params?.length?e.params.reduce((n,r)=>!r.key||!r.value?n:{...n,[r.key]:r.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)};var Cb=async e=>{$e(e?.pixelId)||Tb(e)};var _b=({url:e,isNewTab:t}={})=>{if(!e)return;if(!window.open(e,t?"_blank":"_top"))return{blockedPopupUrl:e}};var _c=e=>{if(Ge(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return console.warn("Failed to safely stringify variable value",e),null}};var xk=Object.getPrototypeOf(async()=>{}).constructor,kb=async({content:e,args:t,isCode:n})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};let o=await xk(...t.map(i=>i.id),e.includes("return ")?e:`return ${e}`)(...t.map(i=>i.value));return{replyToSend:_c(o)??void 0}}catch(r){return console.error(r),{replyToSend:_c(e)??void 0,logs:n?[{status:"error",description:"Failed to execute Set Variable code",details:ds(r)}]:void 0}}};var Eb=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3))};(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
|
|
74
58
|
PartySocket requires a global 'EventTarget' class to be available!
|
|
75
59
|
You can polyfill this global by adding this to your code before any partysocket imports:
|
|
76
60
|
|
|
@@ -78,7 +62,7 @@ but received
|
|
|
78
62
|
import 'partysocket/event-target-polyfill';
|
|
79
63
|
\`\`\`
|
|
80
64
|
Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
|
|
81
|
-
`);var
|
|
65
|
+
`);var Ib=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e}},Ab=class extends Event{code;reason;wasClean=!0;constructor(e=1e3,t="",n){super("close",n),this.code=e,this.reason=t}},kc={Event,ErrorEvent:Ib,CloseEvent:Ab};function vk(e,t){if(!e)throw new Error(t)}function wk(e){return new e.constructor(e.type,e)}function Sk(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new Ab(e.code||1999,e.reason||"unknown reason",e):"error"in e?new Ib(e.error,e):new Event(e.type,e)}var Tk=typeof process<"u"&&typeof process.versions?.node<"u"&&typeof document>"u",ps=Tk?Sk:wk,wr={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},Pb=!1,Ec=class Sr extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType="blob";_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,n,r={}){super(),this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Sr.CONNECTING}get OPEN(){return Sr.OPEN}get CLOSING(){return Sr.CLOSING}get CLOSED(){return Sr.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Sr.CLOSED:Sr.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{let{maxEnqueuedMessages:n=wr.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){let{reconnectionDelayGrowFactor:t=wr.reconnectionDelayGrowFactor,minReconnectionDelay:n=wr.minReconnectionDelay,maxReconnectionDelay:r=wr.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let n=t();if(!n)return Promise.resolve(null);if(typeof n=="string"||Array.isArray(n))return Promise.resolve(n);if(n.then)return n}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let n=t();if(typeof n=="string")return Promise.resolve(n);if(n.then)return n}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:t=wr.maxRetries,connectionTimeout:n=wr.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([r,o])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Pb&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
|
|
82
66
|
|
|
83
67
|
For example, if you're using node.js, run \`npm install ws\`, and then in your code:
|
|
84
68
|
|
|
@@ -91,10 +75,10 @@ const partysocket = new PartySocket({
|
|
|
91
75
|
WebSocket: WS
|
|
92
76
|
});
|
|
93
77
|
|
|
94
|
-
`),Wy=!0);let a=this._options.WebSocket||WebSocket;this._debug("connect",{url:r,protocols:o}),this._ws=o?new a(r,o):new a(r),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new wu.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new wu.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new wu.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");let{minUptime:n=Vr.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),rP(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>this._ws?.send(r)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Zs(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Zs(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Zs(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Zs(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};var sP=e=>e[1]!==null&&e[1]!==void 0;function lP(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function Jy(e,t,n={}){let{host:r,path:o,protocol:a,room:i,party:s,prefix:c,query:l}=e,u=r.replace(/^(http|https|ws|wss):\/\//,"");if(u.endsWith("/")&&(u=u.slice(0,-1)),o&&o.startsWith("/"))throw new Error("path must not start with a slash");let f=s??"main",d=o?`/${o}`:"",p=a||(u.startsWith("localhost:")||u.startsWith("127.0.0.1:")||u.startsWith("192.168.")||u.startsWith("10.")||u.startsWith("172.")&&u.split(".")[1]>="16"&&u.split(".")[1]<="31"||u.startsWith("[::ffff:7f00:1]:")?t:t+"s"),h=`${p}://${u}/${c||`parties/${f}/${i}`}${d}`,g=(b={})=>`${h}?${new URLSearchParams([...Object.entries(n),...Object.entries(b).filter(sP)])}`,y=typeof l=="function"?async()=>g(await l()):g(l);return{host:u,path:d,room:i,name:f,protocol:p,partyUrl:h,urlProvider:y}}var Tu=class extends Su{constructor(e){let t=qy(e);super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t)}_pk;_pkurl;name;room;host;path;updateProperties(e){let t=qy({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:n,name:r,room:o,host:a,path:i}=e;this._pk=t,this._pkurl=n,this.name=r,this.room=o,this.host=a,this.path=i}reconnect(e,t){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let n=Jy(e,"http"),r=typeof n.urlProvider=="string"?n.urlProvider:await n.urlProvider();return(e.fetch??fetch)(r,t)}};function qy(e){let{id:t,host:n,path:r,party:o,room:a,protocol:i,query:s,protocols:c,...l}=e,u=t||lP(),f=Jy(e,"ws",{_pk:u});return{_pk:u,_pkurl:f.partyUrl,name:f.name,room:f.room,host:f.host,path:f.path,protocols:c,socketOptions:l,urlProvider:f.urlProvider}}var Xy=({sessionId:e,resultId:t})=>{let n=gn("NEXT_PUBLIC_PARTYKIT_HOST");if(!n)return;let r=new Tu({host:n,room:cP({sessionId:e,resultId:t})});return new Promise(o=>{r.addEventListener("message",a=>{r.close(),o({replyToSend:a.data})}),r.addEventListener("error",a=>{o({logs:[{status:"error",description:"Websocket returned an error",details:JSON.stringify(a,null,2)}],replyToSend:void 0})})})},cP=({sessionId:e,resultId:t})=>{if(t)return`${t}/webhooks`;let[n,r]=e.split("-");return`${r}/${n}/webhooks`};var Qy=e=>{if(document.getElementById("gtm-noscript"))return"";let t=document.createElement("noscript");t.id="gtm-noscript";let n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t};var e0=async e=>{let t=e.customHeadCode;Pe(t)&&Jp(t);let n=e.gtmId;Pe(n)&&document.body.prepend(Qy(n));let r=e.googleAnalyticsId;Pe(r)&&await My(r);let o=e.pixelIds;re(o)&&Gy(o)};var t0=async({clientSideAction:e,context:t,onMessageStream:n})=>{if("chatwoot"in e)return _y(e.chatwoot);if("googleAnalytics"in e)return Ny(e.googleAnalytics);if("scriptToExecute"in e)return Ws(e.scriptToExecute);if("redirect"in e)return Vy(e.redirect);if("wait"in e)return await zy(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return jy(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:r,message:o}=await vu(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n});return r?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(r,null,2)}]}:{replyToSend:o}}if("httpRequestToExecute"in e)return{replyToSend:await Oy(e.httpRequestToExecute)};if("startPropsToInject"in e)return e0(e.startPropsToInject);if("pixel"in e)return Ky(e.pixel);if("codeToExecute"in e)return Xa(e.codeToExecute);if(e.type==="listenForWebhook")return Xy({sessionId:t.sessionId,resultId:t.resultId})};var[Ys,Cu]=R([]);var n0=e=>e.type==="text"?e.label??e.value:e.url;var[Eu,ku]=R();var uP=C('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),qs=e=>(()=>{var t=uP();return ke(t,Ee(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})();var dP=C("<button>"),cn=e=>{let t=Bi(()=>e.children),[n,r]=ze(e,["variant","isDisabled","isLoading"]);return(()=>{var o=dP();return ke(o,Ee(r,{get disabled(){return n.isDisabled||n.isLoading},get class(){return ve("py-2 px-4 font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0",n.variant==="secondary"?" secondary-button":" agent-button",r.class)}}),!1,!0),x(o,m(B,{get when(){return!n.isLoading},get fallback(){return m(qs,{})},get children(){return t()}})),o})()};var fP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),An=e=>(()=>{var t=fP();return ke(t,e,!0,!0),t})();var pP=C('<button class="w-5 h-5">'),mP=C('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),hr=e=>{let[t,n]=R(""),[r,o]=ze(e,["onInput","ref"]),a=s=>{n(s),r.onInput(s)},i=()=>{n(""),e.onClear()};return(()=>{var s=mP(),c=s.firstChild;c.$$input=u=>a(u.currentTarget.value);var l=e.ref;return typeof l=="function"?he(l,c):e.ref=c,ke(c,Ee({get value(){return t()}},o),!1,!1),x(s,m(B,{get when(){return t().length>0},get children(){var u=pP();return We(u,"click",i),x(u,m(An,{})),u}}),null),s})()};He(["input"]);var lt="Send";var hi={buttonLabel:lt,searchInputPlaceholder:"Filter the options...",isMultipleChoice:!1,isSearchable:!1,areInitialSearchButtonsVisible:!0};var gP=C('<div class="flex items-end agent-input w-full">'),hP=C('<div class="flex flex-col gap-2 w-full"><div>'),bP=C("<span>"),yP=C('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),r0=e=>{let t,[n,r]=R(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems);ie(()=>{!Y()&&t&&t.focus({preventScroll:!0})});let o=i=>e.onSubmit({type:"text",value:n()[i]?.content??""}),a=i=>{if(i===""||i.trim().length===0){r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}r(e.defaultItems.filter(s=>s.content?.toLowerCase().includes(i.toLowerCase())))};return(()=>{var i=hP(),s=i.firstChild;return x(i,m(B,{get when(){return e.options?.isSearchable},get children(){var c=gP();return x(c,m(hr,{ref(l){var u=t;typeof u=="function"?u(l):t=l},onInput:a,get placeholder(){return e.options?.searchInputPlaceholder??hi.searchInputPlaceholder},onClear:()=>r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),c}}),s),x(s,m(we,{get each(){return n()},children:(c,l)=>(()=>{var u=bP();return x(u,m(cn,{"on:click":()=>o(l()),get"data-itemid"(){return c.id},class:"w-full",get children(){return c.content}}),null),x(u,(()=>{var f=F(()=>e.chunkIndex===0&&e.defaultItems.length===1);return()=>f()&&yP()})(),null),M(()=>U(u,"relative"+(Y()?" w-full":""))),u})()})),M(()=>U(s,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),i})()};var vP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512"width=19px color=white><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),o0=e=>(()=>{var t=vP();return ke(t,e,!0,!0),t})();var Ze=e=>{let[t,n]=ze(e,["isDisabled","isLoading","disableIcon"]),r=Y()&&!t.disableIcon||!n.children||typeof n.children=="string"&&je(n.children);return m(cn,Ee(n,{type:"submit",get class(){return ve(n.class,"flex items-center")},"aria-label":r?"Send":void 0,get children(){return m(Me,{get children(){return[m(Z,{when:r,get children(){return m(o0,{get class(){return"send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),m(Z,{when:!r,get children(){return e.children}})]}})}}))};var xP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),a0=e=>(()=>{var t=xP();return ke(t,e,!0,!0),t})();var wP=C("<div>"),Wo=e=>(()=>{var t=wP();return x(t,m(B,{get when(){return e.isChecked},get children(){return m(a0,{})}})),M(()=>U(t,"w-4 h-4 agent-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var SP=C('<div class="flex items-end agent-input w-full">'),TP=C('<form class="flex flex-col items-end gap-2 w-full"><div>'),CP=C('<span><div role=checkbox><div class="flex items-center gap-2"><span>'),EP=C('<span><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable selected"><div class="flex items-center gap-2"><span>'),i0=e=>{let t,[n,r]=R(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems),[o,a]=R([]);ie(()=>{!Y()&&t&&t.focus({preventScroll:!0})});let i=u=>{s(u)},s=u=>{let f=o().indexOf(u);a(f!==-1?d=>d.filter(p=>p!==u):d=>[...d,u])},c=()=>e.onSubmit({type:"text",value:o().map(u=>e.defaultItems.find(f=>f.id===u)?.content).join(", ")}),l=u=>{if(u===""||u.trim().length===0){r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}r(e.defaultItems.filter(f=>f.content?.toLowerCase().includes(u.toLowerCase())))};return(()=>{var u=TP(),f=u.firstChild;return u.addEventListener("submit",c),x(u,m(B,{get when(){return e.options?.isSearchable},get children(){var d=SP();return x(d,m(hr,{ref(p){var h=t;typeof h=="function"?h(p):t=p},onInput:l,get placeholder(){return e.options?.searchInputPlaceholder??hi.searchInputPlaceholder},onClear:()=>r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),d}}),f),x(f,m(we,{get each(){return n()},children:d=>(()=>{var p=CP(),h=p.firstChild,g=h.firstChild,y=g.firstChild;return We(h,"click",()=>i(d.id)),x(g,m(Wo,{get isChecked(){return o().some(b=>b===d.id)},class:"flex-shrink-0"}),y),x(y,()=>d.content),M(b=>{var T="relative"+(Y()?" w-full":""),S=o().some($=>$===d.id),k="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(o().some($=>$===d.id)?" selected":""),I=d.id;return T!==b.e&&U(p,b.e=T),S!==b.t&&K(h,"aria-checked",b.t=S),k!==b.a&&U(h,b.a=k),I!==b.o&&K(h,"data-itemid",b.o=I),b},{e:void 0,t:void 0,a:void 0,o:void 0}),p})()}),null),x(f,m(we,{get each(){return o().filter(d=>n().every(p=>p.id!==d))},children:d=>(()=>{var p=EP(),h=p.firstChild,g=h.firstChild,y=g.firstChild;return We(h,"click",()=>i(d)),K(h,"data-itemid",d),x(g,m(Wo,{isChecked:!0}),y),x(y,()=>e.defaultItems.find(b=>b.id===d)?.content),M(()=>U(p,"relative"+(Y()?" w-full":""))),p})()}),null),x(u,(()=>{var d=F(()=>o().length>0);return()=>d()&&m(Ze,{disableIcon:!0,get children(){return e.options?.buttonLabel??hi.buttonLabel}})})(),null),M(()=>U(f,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),u})()};var Au={hasTime:!1,isRange:!1,labels:{button:lt,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};var kP=C('<div class="agent-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input agent-date-input"data-testid=from-date>'),s0=C("<p class=font-semibold>"),AP=C('<div class="flex items-center p-4"><input class="focus:outline-none flex-1 w-full text-input ml-2 agent-date-input"data-testid=to-date>'),l0=e=>{let[t,n]=R(PP(e.defaultValue??"")),r=()=>{t().from===""&&t().to===""||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})};return(()=>{var o=kP(),a=o.firstChild,i=a.firstChild,s=i.firstChild,c=s.firstChild;return a.addEventListener("submit",l=>{l.preventDefault(),r()}),x(s,(()=>{var l=F(()=>!!e.options?.isRange);return()=>l()&&(()=>{var u=s0();return x(u,()=>e.options.labels?.from??Au.labels.from),u})()})(),c),c.addEventListener("change",l=>n({...t(),from:l.currentTarget.value})),c.style.setProperty("min-height","32px"),c.style.setProperty("min-width","100px"),c.style.setProperty("font-size","16px"),x(i,(()=>{var l=F(()=>!!e.options?.isRange);return()=>l()&&(()=>{var u=AP(),f=u.firstChild;return x(u,(()=>{var d=F(()=>!!e.options.isRange);return()=>d()&&(()=>{var p=s0();return x(p,()=>e.options.labels?.to??Au.labels.to),p})()})(),f),f.addEventListener("change",d=>n({...t(),to:d.currentTarget.value})),f.style.setProperty("min-height","32px"),f.style.setProperty("min-width","100px"),f.style.setProperty("font-size","16px"),M(d=>{var p=e.options.hasTime?"datetime-local":"date",h=e.options?.min,g=e.options?.max;return p!==d.e&&K(f,"type",d.e=p),h!==d.t&&K(f,"min",d.t=h),g!==d.a&&K(f,"max",d.a=g),d},{e:void 0,t:void 0,a:void 0}),M(()=>f.value=t().to),u})()})(),null),x(o,m(Ze,{class:"h-[56px]","on:click":r,get children(){return e.options?.labels?.button}}),null),M(l=>{var u=ve("flex agent-input",e.options?.isRange?"items-end":"items-center"),f="flex items-center p-4 "+(e.options?.isRange?"pb-0 gap-2":""),d=e.options?.hasTime?"datetime-local":"date",p=e.options?.min,h=e.options?.max;return u!==l.e&&U(a,l.e=u),f!==l.t&&U(s,l.t=f),d!==l.a&&K(c,"type",l.a=d),p!==l.o&&K(c,"min",l.o=p),h!==l.i&&K(c,"max",l.i=h),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),M(()=>c.value=t().from),o})()},PP=e=>{if(!e.includes("to"))return{from:e,to:""};let[t,n]=e.split(" to ");return{from:t,to:n}};var IP=C('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),br=e=>{let[t,n]=ze(e,["ref","onInput"]);return(()=>{var r=IP();r.$$input=a=>t.onInput(a.currentTarget.value);var o=e.ref;return typeof o=="function"?he(o,r):e.ref=r,ke(r,n,!1,!1),r})()};He(["input"]);var c0={labels:{button:lt,placeholder:"Type your email..."},retryMessageContent:"This email doesn't seem to be valid. Can you type it again?"};var _P=C('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full">'),u0=e=>{let[t,n]=R(e.defaultValue??""),r,o=l=>n(l),a=()=>r?.value!==""&&r?.reportValidity(),i=()=>{a()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=l=>{l.key==="Enter"&&i()};ie(()=>{!Y()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",c)}),de(()=>{window.removeEventListener("message",c)});let c=l=>{let{data:u}=l;u.isFromAgent&&u.command==="setInputValue"&&n(u.value)};return(()=>{var l=_P(),u=l.firstChild;return l.$$keydown=s,x(u,m(br,{ref(f){var d=r;typeof d=="function"?d(f):r=f},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??c0.labels.placeholder},onInput:o,type:"email",autocomplete:"email"})),x(l,m(Ze,{type:"button",class:"h-[56px]","on:click":i,get children(){return e.block.options?.labels?.button}}),null),l})()};He(["keydown"]);var un={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:`<strong>
|
|
78
|
+
`),Pb=!0);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:r,protocols:o}),this._ws=o?new i(r,o):new i(r),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new kc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new kc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new kc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");let{minUptime:n=wr.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),vk(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>this._ws?.send(r)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(ps(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(ps(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(ps(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(ps(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};var Ck=e=>e[1]!==null&&e[1]!==void 0;function _k(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function Rb(e,t,n={}){let{host:r,path:o,protocol:i,room:a,party:s,prefix:c,query:l}=e,u=r.replace(/^(http|https|ws|wss):\/\//,"");if(u.endsWith("/")&&(u=u.slice(0,-1)),o&&o.startsWith("/"))throw new Error("path must not start with a slash");let f=s??"main",d=o?`/${o}`:"",p=i||(u.startsWith("localhost:")||u.startsWith("127.0.0.1:")||u.startsWith("192.168.")||u.startsWith("10.")||u.startsWith("172.")&&u.split(".")[1]>="16"&&u.split(".")[1]<="31"||u.startsWith("[::ffff:7f00:1]:")?t:t+"s"),h=`${p}://${u}/${c||`parties/${f}/${a}`}${d}`,g=(y={})=>`${h}?${new URLSearchParams([...Object.entries(n),...Object.entries(y).filter(Ck)])}`,v=typeof l=="function"?async()=>g(await l()):g(l);return{host:u,path:d,room:a,name:f,protocol:p,partyUrl:h,urlProvider:v}}var Pc=class extends Ec{constructor(e){let t=Ob(e);super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t)}_pk;_pkurl;name;room;host;path;updateProperties(e){let t=Ob({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:n,name:r,room:o,host:i,path:a}=e;this._pk=t,this._pkurl=n,this.name=r,this.room=o,this.host=i,this.path=a}reconnect(e,t){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let n=Rb(e,"http"),r=typeof n.urlProvider=="string"?n.urlProvider:await n.urlProvider();return(e.fetch??fetch)(r,t)}};function Ob(e){let{id:t,host:n,path:r,party:o,room:i,protocol:a,query:s,protocols:c,...l}=e,u=t||_k(),f=Rb(e,"ws",{_pk:u});return{_pk:u,_pkurl:f.partyUrl,name:f.name,room:f.room,host:f.host,path:f.path,protocols:c,socketOptions:l,urlProvider:f.urlProvider}}var Mb=({sessionId:e,resultId:t})=>{let n=Qt("NEXT_PUBLIC_PARTYKIT_HOST");if(!n)return;let r=new Pc({host:n,room:kk({sessionId:e,resultId:t})});return new Promise(o=>{r.addEventListener("message",i=>{r.close(),o({replyToSend:i.data})}),r.addEventListener("error",i=>{o({logs:[{status:"error",description:"Websocket returned an error",details:JSON.stringify(i,null,2)}],replyToSend:void 0})})})},kk=({sessionId:e,resultId:t})=>{if(t)return`${t}/webhooks`;let[n,r]=e.split("-");return`${r}/${n}/webhooks`};var Db=e=>{if(document.getElementById("gtm-noscript"))return"";let t=document.createElement("noscript");t.id="gtm-noscript";let n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t};var Lb=async e=>{let t=e.customHeadCode;Ce(t)&&Rf(t);let n=e.gtmId;Ce(n)&&document.body.prepend(Db(n));let r=e.googleAnalyticsId;Ce(r)&&await fb(r);let o=e.pixelIds;re(o)&&Sb(o)};var Nb=async({clientSideAction:e,context:t,onMessageStream:n})=>{if("chatwoot"in e)return db(e.chatwoot);if("googleAnalytics"in e)return mb(e.googleAnalytics);if("scriptToExecute"in e)return fs(e.scriptToExecute);if("redirect"in e)return _b(e.redirect);if("wait"in e)return await Eb(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return kb(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:r,message:o}=await Cc(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n});return r?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(r,null,2)}]}:{replyToSend:o}}if("httpRequestToExecute"in e)return{replyToSend:await gb(e.httpRequestToExecute)};if("startPropsToInject"in e)return Lb(e.startPropsToInject);if("pixel"in e)return Cb(e.pixel);if("codeToExecute"in e)return _i(e.codeToExecute);if(e.type==="listenForWebhook")return Mb({sessionId:t.sessionId,resultId:t.resultId})};var[ms,Ic]=O([]);var $b=e=>e.type==="text"?e.label??e.value:e.url;var[Ac,Oc]=O();var Ek=S('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),gs=e=>(()=>{var t=Ek();return Te(t,Se(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})();var Pk=S("<button>"),qt=e=>{let t=ua(()=>e.children),[n,r]=Be(e,["variant","isDisabled","isLoading"]);return(()=>{var o=Pk();return Te(o,Se(r,{get disabled(){return n.isDisabled||n.isLoading},get class(){return pe("py-2 px-4 font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0",n.variant==="secondary"?" secondary-button":" agent-button",r.class)}}),!1,!0),x(o,m(N,{get when(){return!n.isLoading},get fallback(){return m(gs,{})},get children(){return t()}})),o})()};var Ik=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),fn=e=>(()=>{var t=Ik();return Te(t,e,!0,!0),t})();var Ak=S('<button class="w-5 h-5">'),Ok=S('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),Yn=e=>{let[t,n]=O(""),[r,o]=Be(e,["onInput","ref"]),i=s=>{n(s),r.onInput(s)},a=()=>{n(""),e.onClear()};return(()=>{var s=Ok(),c=s.firstChild;c.$$input=u=>i(u.currentTarget.value);var l=e.ref;return typeof l=="function"?de(l,c):e.ref=c,Te(c,Se({get value(){return t()}},o),!1,!1),x(s,m(N,{get when(){return t().length>0},get children(){var u=Ak();return Fe(u,"click",a),x(u,m(fn,{})),u}}),null),s})()};Me(["input"]);var Qe="Send";var Hi={buttonLabel:Qe,searchInputPlaceholder:"Filter the options...",isMultipleChoice:!1,isSearchable:!1,areInitialSearchButtonsVisible:!0};var Rk=S('<div class="flex items-end agent-input w-full">'),Mk=S('<div class="flex flex-col gap-2 w-full"><div>'),Dk=S("<span>"),Lk=S('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),Bb=e=>{let t,[n,r]=O(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems);ne(()=>{!K()&&t&&t.focus({preventScroll:!0})});let o=a=>e.onSubmit({type:"text",value:n()[a]?.content??""}),i=a=>{if(a===""||a.trim().length===0){r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}r(e.defaultItems.filter(s=>s.content?.toLowerCase().includes(a.toLowerCase())))};return(()=>{var a=Mk(),s=a.firstChild;return x(a,m(N,{get when(){return e.options?.isSearchable},get children(){var c=Rk();return x(c,m(Yn,{ref(l){var u=t;typeof u=="function"?u(l):t=l},onInput:i,get placeholder(){return e.options?.searchInputPlaceholder??Hi.searchInputPlaceholder},onClear:()=>r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),c}}),s),x(s,m(he,{get each(){return n()},children:(c,l)=>(()=>{var u=Dk();return x(u,m(qt,{"on:click":()=>o(l()),get"data-itemid"(){return c.id},class:"w-full",get children(){return c.content}}),null),x(u,(()=>{var f=B(()=>e.chunkIndex===0&&e.defaultItems.length===1);return()=>f()&&Lk()})(),null),A(()=>$(u,"relative"+(K()?" w-full":""))),u})()})),A(()=>$(s,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),a})()};var Nk=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512"width=19px color=white><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),Fb=e=>(()=>{var t=Nk();return Te(t,e,!0,!0),t})();var Ue=e=>{let[t,n]=Be(e,["isDisabled","isLoading","disableIcon"]),r=K()&&!t.disableIcon||!n.children||typeof n.children=="string"&&$e(n.children);return m(qt,Se(n,{type:"submit",get class(){return pe(n.class,"flex items-center")},"aria-label":r?"Send":void 0,get children(){return m(Ee,{get children(){return[m(q,{when:r,get children(){return m(Fb,{get class(){return"send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),m(q,{when:!r,get children(){return e.children}})]}})}}))};var $k=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),Ub=e=>(()=>{var t=$k();return Te(t,e,!0,!0),t})();var Bk=S("<div>"),So=e=>(()=>{var t=Bk();return x(t,m(N,{get when(){return e.isChecked},get children(){return m(Ub,{})}})),A(()=>$(t,"w-4 h-4 agent-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var Fk=S('<div class="flex items-end agent-input w-full">'),Uk=S('<form class="flex flex-col items-end gap-2 w-full"><div>'),jk=S('<span><div role=checkbox><div class="flex items-center gap-2"><span>'),Vk=S('<span><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable selected"><div class="flex items-center gap-2"><span>'),jb=e=>{let t,[n,r]=O(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems),[o,i]=O([]);ne(()=>{!K()&&t&&t.focus({preventScroll:!0})});let a=u=>{s(u)},s=u=>{let f=o().indexOf(u);i(f!==-1?d=>d.filter(p=>p!==u):d=>[...d,u])},c=()=>e.onSubmit({type:"text",value:o().map(u=>e.defaultItems.find(f=>f.id===u)?.content).join(", ")}),l=u=>{if(u===""||u.trim().length===0){r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}r(e.defaultItems.filter(f=>f.content?.toLowerCase().includes(u.toLowerCase())))};return(()=>{var u=Uk(),f=u.firstChild;return u.addEventListener("submit",c),x(u,m(N,{get when(){return e.options?.isSearchable},get children(){var d=Fk();return x(d,m(Yn,{ref(p){var h=t;typeof h=="function"?h(p):t=p},onInput:l,get placeholder(){return e.options?.searchInputPlaceholder??Hi.searchInputPlaceholder},onClear:()=>r(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),d}}),f),x(f,m(he,{get each(){return n()},children:d=>(()=>{var p=jk(),h=p.firstChild,g=h.firstChild,v=g.firstChild;return Fe(h,"click",()=>a(d.id)),x(g,m(So,{get isChecked(){return o().some(y=>y===d.id)},class:"flex-shrink-0"}),v),x(v,()=>d.content),A(y=>{var T="relative"+(K()?" w-full":""),C=o().some(U=>U===d.id),E="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(o().some(U=>U===d.id)?" selected":""),I=d.id;return T!==y.e&&$(p,y.e=T),C!==y.t&&j(h,"aria-checked",y.t=C),E!==y.a&&$(h,y.a=E),I!==y.o&&j(h,"data-itemid",y.o=I),y},{e:void 0,t:void 0,a:void 0,o:void 0}),p})()}),null),x(f,m(he,{get each(){return o().filter(d=>n().every(p=>p.id!==d))},children:d=>(()=>{var p=Vk(),h=p.firstChild,g=h.firstChild,v=g.firstChild;return Fe(h,"click",()=>a(d)),j(h,"data-itemid",d),x(g,m(So,{isChecked:!0}),v),x(v,()=>e.defaultItems.find(y=>y.id===d)?.content),A(()=>$(p,"relative"+(K()?" w-full":""))),p})()}),null),x(u,(()=>{var d=B(()=>o().length>0);return()=>d()&&m(Ue,{disableIcon:!0,get children(){return e.options?.buttonLabel??Hi.buttonLabel}})})(),null),A(()=>$(f,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),u})()};var Rc={hasTime:!1,isRange:!1,labels:{button:Qe,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};var Hk=S('<div class="agent-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input agent-date-input"data-testid=from-date>'),Vb=S("<p class=font-semibold>"),zk=S('<div class="flex items-center p-4"><input class="focus:outline-none flex-1 w-full text-input ml-2 agent-date-input"data-testid=to-date>'),Hb=e=>{let[t,n]=O(Gk(e.defaultValue??"")),r=()=>{t().from===""&&t().to===""||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})};return(()=>{var o=Hk(),i=o.firstChild,a=i.firstChild,s=a.firstChild,c=s.firstChild;return i.addEventListener("submit",l=>{l.preventDefault(),r()}),x(s,(()=>{var l=B(()=>!!e.options?.isRange);return()=>l()&&(()=>{var u=Vb();return x(u,()=>e.options.labels?.from??Rc.labels.from),u})()})(),c),c.addEventListener("change",l=>n({...t(),from:l.currentTarget.value})),c.style.setProperty("min-height","32px"),c.style.setProperty("min-width","100px"),c.style.setProperty("font-size","16px"),x(a,(()=>{var l=B(()=>!!e.options?.isRange);return()=>l()&&(()=>{var u=zk(),f=u.firstChild;return x(u,(()=>{var d=B(()=>!!e.options.isRange);return()=>d()&&(()=>{var p=Vb();return x(p,()=>e.options.labels?.to??Rc.labels.to),p})()})(),f),f.addEventListener("change",d=>n({...t(),to:d.currentTarget.value})),f.style.setProperty("min-height","32px"),f.style.setProperty("min-width","100px"),f.style.setProperty("font-size","16px"),A(d=>{var p=e.options.hasTime?"datetime-local":"date",h=e.options?.min,g=e.options?.max;return p!==d.e&&j(f,"type",d.e=p),h!==d.t&&j(f,"min",d.t=h),g!==d.a&&j(f,"max",d.a=g),d},{e:void 0,t:void 0,a:void 0}),A(()=>f.value=t().to),u})()})(),null),x(o,m(Ue,{class:"h-[56px]","on:click":r,get children(){return e.options?.labels?.button}}),null),A(l=>{var u=pe("flex agent-input",e.options?.isRange?"items-end":"items-center"),f="flex items-center p-4 "+(e.options?.isRange?"pb-0 gap-2":""),d=e.options?.hasTime?"datetime-local":"date",p=e.options?.min,h=e.options?.max;return u!==l.e&&$(i,l.e=u),f!==l.t&&$(s,l.t=f),d!==l.a&&j(c,"type",l.a=d),p!==l.o&&j(c,"min",l.o=p),h!==l.i&&j(c,"max",l.i=h),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),A(()=>c.value=t().from),o})()},Gk=e=>{if(!e.includes("to"))return{from:e,to:""};let[t,n]=e.split(" to ");return{from:t,to:n}};var Wk=S('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),Xn=e=>{let[t,n]=Be(e,["ref","onInput"]);return(()=>{var r=Wk();r.$$input=i=>t.onInput(i.currentTarget.value);var o=e.ref;return typeof o=="function"?de(o,r):e.ref=r,Te(r,n,!1,!1),r})()};Me(["input"]);var zb={labels:{button:Qe,placeholder:"Type your email..."},retryMessageContent:"This email doesn't seem to be valid. Can you type it again?"};var qk=S('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full">'),Gb=e=>{let[t,n]=O(e.defaultValue??""),r,o=l=>n(l),i=()=>r?.value!==""&&r?.reportValidity(),a=()=>{i()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=l=>{l.key==="Enter"&&a()};ne(()=>{!K()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",c)}),se(()=>{window.removeEventListener("message",c)});let c=l=>{let{data:u}=l;u.isFromAgent&&u.command==="setInputValue"&&n(u.value)};return(()=>{var l=qk(),u=l.firstChild;return l.$$keydown=s,x(u,m(Xn,{ref(f){var d=r;typeof d=="function"?d(f):r=f},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??zb.labels.placeholder},onInput:o,type:"email",autocomplete:"email"})),x(l,m(Ue,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),l})()};Me(["keydown"]);var Kt={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:`<strong>
|
|
95
79
|
Click to upload
|
|
96
80
|
</strong> or drag and drop here<br>
|
|
97
|
-
(max 10MB)`,button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}};var Js=({newFile:e,existingFiles:t,params:n,onError:r})=>{let o=n.sizeLimit??gn("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE");if(o&&e.size>o*1024*1024){r({title:"File too large",description:`${e.name} is larger than ${o}MB`});return}if(t.length===0)return e;let a=e.name,i=1;for(;t.some(s=>s.name===a);){let s=e.name.lastIndexOf("."),c=s!==-1?e.name.slice(s):"";a=`${e.name.slice(0,s)}(${i})${c}`,i++}return new File([e],a,{type:e.type})};var Zo=async({apiHost:e,files:t,onUploadProgress:n})=>{let r=[],o=0;for(let{input:a,file:i}of t){n&&n({progress:o/t.length*100,fileIndex:o}),o+=1;let{data:s}=await qp({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:a.fileName,sessionId:a.sessionId,fileType:i.type,blockId:a.blockId}});if(s?.presignedUrl){console.log("iniciando puuuttt",i),console.log(s.presignedUrl);let c=new FormData;if(Object.entries(s.formData).forEach(([u,f])=>{c.append(u,f)}),c.append("file",i),!(await fetch(s.presignedUrl,{method:"PUT",body:i,headers:{"Content-Type":i.type}})).ok)continue;r.push({url:s.fileUrl,type:i.type})}else continue}return r};var MP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),Xs=e=>(()=>{var t=MP();return ke(t,e,!0,!0),t})();var RP=C('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),Qs=e=>{let t=OP(e.file);return(()=>{var n=RP(),r=n.firstChild,o=r.nextSibling,a=o.firstChild,i=a.nextSibling;return x(r,m(Xs,{class:"w-6 h-6"})),x(a,()=>e.file.name),x(i,()=>NP(e.file)),M(()=>U(r,ve("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),n})()},NP=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},OP=e=>{let t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}};var LP=C('<img class="rounded-md object-cover w-[58px] h-[58px]">'),DP=C('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remove attachment">'),BP=C('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),el=e=>(()=>{var t=DP(),n=t.firstChild;return x(t,m(Me,{get children(){return[m(Z,{get when(){return e.file.type.startsWith("image")},get children(){var r=LP();return M(o=>{var a=URL.createObjectURL(e.file),i=e.file.name;return a!==o.e&&K(r,"src",o.e=a),i!==o.t&&K(r,"alt",o.t=i),o},{e:void 0,t:void 0}),r}}),m(Z,{when:!0,get children(){return m(Qs,{get file(){return e.file}})}})]}}),n),We(n,"click",e.onRemoveClick),x(n,m(An,{class:"w-4"})),x(t,m(B,{get when(){return re(e.uploadProgressPercent)&&e.uploadProgressPercent!==100},get children(){return m(UP,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),UP=e=>{let[t,n]=R(e.progressPercent??0),r;return xe(()=>{e.progressPercent===20&&(r=setInterval(()=>{t()<100&&n(a=>a+(Math.floor(Math.random()*10)+1))},1e3))}),de(()=>{clearInterval(r)}),(()=>{var o=BP();return x(o,m($r.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m($r.Circle,{get children(){return[m($r.CircleTrack,{}),m($r.CircleRange,{})]}})}})),o})()};var FP=C('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full">'),$P=C('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),GP=C('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-center">'),HP=C("<input id=dropzone-file type=file class=hidden>"),KP=C('<div class="flex justify-end">'),VP=C('<div class="flex justify-end"><div class="flex gap-2">'),jP=C('<form class="flex flex-col relative w-full gap-2 rounded-md agent-host-bubble upload"><span class="flex h-5 w-5 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-5 w-5 brightness-150"></span></span><label for=dropzone-file>'),zP=C('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),f0=e=>{let[t,n]=R([]),[r,o]=R(!1),[a,i]=R(0),[s,c]=R(!1),l=S=>{let k=Array.from(S).map(I=>Js({existingFiles:t(),newFile:I,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},onError:({description:$,title:O})=>gr.create({title:O,description:$})})).filter(re);if(k.length!==0){if(!e.block.options?.isMultipleAllowed)return f(k[0]);n([...t(),...k])}},u=async S=>{S.preventDefault(),t().length!==0&&d(t())},f=async S=>{o(!0);let k=await Zo({apiHost:e.context.apiHost??Pt({ignoreChatApiUrl:!0}),files:[{file:S,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:S.name}}]});if(o(!1),k.length&&k[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??un.labels.success.single,value:k[0]?d0(k[0].url):"",attachments:[{type:S.type,url:k[0].url,blobUrl:URL.createObjectURL(S)}]});gr.create({description:"An error occured while uploading the file"})},d=async S=>{o(!0);let k=await Zo({apiHost:e.context.apiHost??Pt({ignoreChatApiUrl:!0}),files:S.map(I=>({file:I,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:I.name}})),onUploadProgress:i});if(o(!1),i(0),k.length!==S.length)return gr.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:k.length>1?(e.block.options?.labels?.success?.multiple??un.labels.success.multiple).replaceAll("{total}",k.length.toString()):e.block.options?.labels?.success?.single??un.labels.success.single,value:k.filter(re).map(({url:I})=>d0(I)).join(", "),attachments:k.map((I,$)=>I?{...I,blobUrl:URL.createObjectURL(t()[$])}:null).filter(re)})},p=S=>{S.preventDefault(),c(!0)},h=()=>c(!1),g=S=>{S.preventDefault(),S.stopPropagation(),S.dataTransfer?.files&&l(S.dataTransfer.files)},y=()=>n([]),b=()=>e.onSkip(e.block.options?.labels?.skip??un.labels.skip),T=S=>{n(k=>k.filter((I,$)=>$!==S))};return(()=>{var S=jP(),k=S.firstChild,I=k.nextSibling;return S.addEventListener("submit",u),I.addEventListener("drop",g),I.addEventListener("dragleave",h),I.addEventListener("dragover",p),x(I,m(Me,{get children(){return[m(Z,{get when(){return r()},get children(){return m(B,{get when(){return t().length>1},get fallback(){return m(qs,{})},get children(){var $=FP(),O=$.firstChild;return O.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),M(Q=>(Q=`${a()>0?a:10}%`)!=null?O.style.setProperty("width",Q):O.style.removeProperty("width")),$}})}}),m(Z,{get when(){return!r()},get children(){return[(()=>{var $=GP(),O=$.firstChild;return x($,m(B,{get when(){return t().length},get fallback(){return m(WP,{})},get children(){var Q=$P();return We(Q,"click",H=>{H.preventDefault(),H.stopPropagation()}),x(Q,m(we,{get each(){return t()},children:(H,j)=>m(el,{file:H,onRemoveClick:()=>T(j())})})),Q}}),O),M(()=>O.innerHTML=e.block.options?.labels?.placeholder??un.labels.placeholder),$})(),(()=>{var $=HP();return $.addEventListener("change",O=>{O.currentTarget.files&&l(O.currentTarget.files)}),M(()=>$.multiple=e.block.options?.isMultipleAllowed??un.isMultipleAllowed),$})()]}})]}})),x(S,m(B,{get when(){return t().length===0&&e.block.options?.isRequired===!1},get children(){var $=KP();return x($,m(cn,{"on:click":b,get children(){return e.block.options?.labels?.skip??un.labels.skip}})),$}}),null),x(S,m(B,{get when(){return F(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){var $=VP(),O=$.firstChild;return x(O,m(B,{get when(){return t().length},get children(){return m(cn,{variant:"secondary","on:click":y,get children(){return e.block.options?.labels?.clear??un.labels.clear}})}}),null),x(O,m(Ze,{type:"submit",disableIcon:!0,get children(){return F(()=>(e.block.options?.labels?.button??un.labels.button)===un.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),$}}),null),M(()=>U(I,"agent-upload-input py-6 flex flex-col justify-center items-center w-full bubble-typing cursor-pointer px-8 "+(s()?"dragging-over":""))),S})()},WP=()=>zP(),d0=e=>{let t=e.split("/").pop();if(!t)return e;let n=encodeURIComponent(t);return e.replace(t,n)};var p0={labels:{button:lt,placeholder:"Type a number..."}};var m0=e=>{let t=r=>{xe(()=>{let o=e();if(o==null){r.value=o;return}let a=r.value;(o===0&&a===""||o!==a)&&(r.value=o+"")})},n=r=>{if(r.validity.badInput)return e();if(r.value!=="")return r.valueAsNumber};return[Xe(e),t,n]};var ZP=C('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=number>'),g0=e=>{let[t,n]=R(e.defaultValue??""),[r,o,a]=m0(()=>t()),i,s=()=>i?.value!==""&&i?.reportValidity(),c=()=>{s()?e.onSubmit({type:"text",value:i?.value??t().toString()}):i?.focus()},l=f=>{f.key==="Enter"&&c()};ie(()=>{!Y()&&i&&i.focus({preventScroll:!0}),window.addEventListener("message",u)}),de(()=>{window.removeEventListener("message",u)});let u=f=>{let{data:d}=f;d.isFromAgent&&d.command==="setInputValue"&&n(d.value)};return(()=>{var f=ZP(),d=f.firstChild,p=d.firstChild;f.$$keydown=l,p.$$input=g=>{n(a(g.currentTarget))},he(o,p,()=>!0);var h=i;return typeof h=="function"?he(h,p):i=p,p.style.setProperty("font-size","16px"),p.style.setProperty("appearance","auto"),p.value=r,x(f,m(Ze,{type:"button",class:"h-[56px]","on:click":c,get children(){return e.block.options?.labels?.button}}),null),M(g=>{var y=e.block.options?.labels?.placeholder??p0.labels.placeholder,b=e.block.options?.min,T=e.block.options?.max,S=e.block.options?.step??"any";return y!==g.e&&K(p,"placeholder",g.e=y),b!==g.t&&K(p,"min",g.t=b),T!==g.a&&K(p,"max",g.a=T),S!==g.o&&K(p,"step",g.o=S),g},{e:void 0,t:void 0,a:void 0,o:void 0}),f})()};He(["keydown","input"]);var T0=Sr(S0(),1);var ol={provider:"Stripe",labels:{button:"Pay",success:"Success"},retryMessageContent:"Payment failed. Please, try again.",currency:"USD"};var tI=C('<div class="agent-input-error-message mt-4 text-center animate-fade-in">'),nI=C('<form id=payment-form class="flex flex-col p-4 agent-input w-full items-center"><slot name=stripe-payment-form>'),rI="stripe-payment-form",_u,bi=null,al=null,C0=e=>{let[t,n]=R(),[r,o]=R(!1),[a,i]=R(!1);ie(async()=>{if(oI(_u),!e.options?.publicKey)return n("Missing Stripe public key");if(bi=await(0,T0.loadStripe)(e.options?.publicKey),!bi)return;al=bi.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(_u).getPropertyValue("--agent-button-bg-color")}},clientSecret:e.options.paymentIntentSecret}),al.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(!0),e.onTransitionEnd()},1e3)});let s=async c=>{if(c.preventDefault(),!bi||!al)return;i(!0),vf({sessionId:e.context.sessionId,resultId:e.context.resultId,agent:e.context.agent});let{postalCode:l,...u}=e.options?.additionalInformation?.address??{},{error:f,paymentIntent:d}=await bi.confirmPayment({elements:al,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:l}}}},redirect:"if_required"});if(Gi(),i(!1),f?.type!=="validation_error"){if(f?.type==="card_error")return n(f.message);if(!f&&d.status==="succeeded")return e.onSuccess()}};return(()=>{var c=nI(),l=c.firstChild;return c.addEventListener("submit",s),he(u=>_u=u,l),l._$owner=lo(),x(c,m(B,{get when(){return r()},get children(){return m(Ze,{get isLoading(){return a()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[F(()=>e.options?.labels?.button??ol.labels.button)," ",F(()=>e.options?.amountLabel)]}})}}),null),x(c,m(B,{get when(){return t()},get children(){var u=tI();return x(u,t),u}}),null),c})()},oI=e=>{let n=e.getRootNode().host,r=document.createElement("div");r.style.width="100%",r.slot=rI,n.appendChild(r);let o=document.createElement("div");o.id="payment-element",r.appendChild(o)};var E0=e=>m(C0,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var aI=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),k0=e=>(()=>{var t=aI();return ke(t,e,!0,!0),t})();var A0={labels:{button:lt,placeholder:"Type your phone number..."},retryMessageContent:"This phone number doesn't seem to be valid. Can you type it again?"};var zr=[{name:"International",flag:"\u{1F310}",code:"INT",dial_code:""},{name:"Afghanistan",flag:"\u{1F1E6}\u{1F1EB}",code:"AF",dial_code:"+93"},{name:"\xC5land Islands",flag:"\u{1F1E6}\u{1F1FD}",code:"AX",dial_code:"+358"},{name:"Albania",flag:"\u{1F1E6}\u{1F1F1}",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"\u{1F1E9}\u{1F1FF}",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"\u{1F1E6}\u{1F1F8}",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"\u{1F1E6}\u{1F1E9}",code:"AD",dial_code:"+376"},{name:"Angola",flag:"\u{1F1E6}\u{1F1F4}",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"\u{1F1E6}\u{1F1EE}",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"\u{1F1E6}\u{1F1F6}",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"\u{1F1E6}\u{1F1EC}",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"\u{1F1E6}\u{1F1F7}",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"\u{1F1E6}\u{1F1F2}",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"\u{1F1E6}\u{1F1FC}",code:"AW",dial_code:"+297"},{name:"Australia",flag:"\u{1F1E6}\u{1F1FA}",code:"AU",dial_code:"+61"},{name:"Austria",flag:"\u{1F1E6}\u{1F1F9}",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"\u{1F1E6}\u{1F1FF}",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"\u{1F1E7}\u{1F1F8}",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"\u{1F1E7}\u{1F1ED}",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"\u{1F1E7}\u{1F1E9}",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"\u{1F1E7}\u{1F1E7}",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"\u{1F1E7}\u{1F1FE}",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"\u{1F1E7}\u{1F1EA}",code:"BE",dial_code:"+32"},{name:"Belize",flag:"\u{1F1E7}\u{1F1FF}",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"\u{1F1E7}\u{1F1EF}",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"\u{1F1E7}\u{1F1F2}",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"\u{1F1E7}\u{1F1F9}",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"\u{1F1E7}\u{1F1F4}",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"\u{1F1E7}\u{1F1E6}",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"\u{1F1E7}\u{1F1FC}",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"\u{1F1E7}\u{1F1FB}",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"\u{1F1E7}\u{1F1F7}",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"\u{1F1EE}\u{1F1F4}",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"\u{1F1E7}\u{1F1F3}",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"\u{1F1E7}\u{1F1EC}",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"\u{1F1E7}\u{1F1EB}",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"\u{1F1E7}\u{1F1EE}",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"\u{1F1F0}\u{1F1ED}",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"\u{1F1E8}\u{1F1F2}",code:"CM",dial_code:"+237"},{name:"Canada",flag:"\u{1F1E8}\u{1F1E6}",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"\u{1F1E8}\u{1F1FB}",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"\u{1F1F0}\u{1F1FE}",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"\u{1F1E8}\u{1F1EB}",code:"CF",dial_code:"+236"},{name:"Chad",flag:"\u{1F1F9}\u{1F1E9}",code:"TD",dial_code:"+235"},{name:"Chile",flag:"\u{1F1E8}\u{1F1F1}",code:"CL",dial_code:"+56"},{name:"China",flag:"\u{1F1E8}\u{1F1F3}",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"\u{1F1E8}\u{1F1FD}",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"\u{1F1E8}\u{1F1E8}",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"\u{1F1E8}\u{1F1F4}",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"\u{1F1F0}\u{1F1F2}",code:"KM",dial_code:"+269"},{name:"Congo",flag:"\u{1F1E8}\u{1F1EC}",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"\u{1F1E8}\u{1F1E9}",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"\u{1F1E8}\u{1F1F0}",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"\u{1F1E8}\u{1F1F7}",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"\u{1F1E8}\u{1F1EE}",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"\u{1F1ED}\u{1F1F7}",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"\u{1F1E8}\u{1F1FA}",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"\u{1F1E8}\u{1F1FE}",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"\u{1F1E8}\u{1F1FF}",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"\u{1F1E9}\u{1F1F0}",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"\u{1F1E9}\u{1F1EF}",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"\u{1F1E9}\u{1F1F2}",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"\u{1F1EA}\u{1F1E8}",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"\u{1F1EA}\u{1F1EC}",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"\u{1F1F8}\u{1F1FB}",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"\u{1F1EC}\u{1F1F6}",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"\u{1F1EA}\u{1F1F7}",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"\u{1F1EA}\u{1F1EA}",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"\u{1F1EA}\u{1F1F9}",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"\u{1F1EB}\u{1F1F0}",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"\u{1F1EB}\u{1F1F4}",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"\u{1F1EB}\u{1F1EF}",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"\u{1F1EB}\u{1F1EE}",code:"FI",dial_code:"+358"},{name:"France",flag:"\u{1F1EB}\u{1F1F7}",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"\u{1F1EC}\u{1F1EB}",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"\u{1F1F5}\u{1F1EB}",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"\u{1F1F9}\u{1F1EB}",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"\u{1F1EC}\u{1F1E6}",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"\u{1F1EC}\u{1F1F2}",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"\u{1F1EC}\u{1F1EA}",code:"GE",dial_code:"+995"},{name:"Germany",flag:"\u{1F1E9}\u{1F1EA}",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"\u{1F1EC}\u{1F1ED}",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"\u{1F1EC}\u{1F1EE}",code:"GI",dial_code:"+350"},{name:"Greece",flag:"\u{1F1EC}\u{1F1F7}",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"\u{1F1EC}\u{1F1F1}",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"\u{1F1EC}\u{1F1E9}",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"\u{1F1EC}\u{1F1F5}",code:"GP",dial_code:"+590"},{name:"Guam",flag:"\u{1F1EC}\u{1F1FA}",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"\u{1F1EC}\u{1F1F9}",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"\u{1F1EC}\u{1F1EC}",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"\u{1F1EC}\u{1F1F3}",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"\u{1F1EC}\u{1F1FC}",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"\u{1F1EC}\u{1F1FE}",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"\u{1F1ED}\u{1F1F9}",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"\u{1F1ED}\u{1F1F2}",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"\u{1F1FB}\u{1F1E6}",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"\u{1F1ED}\u{1F1F3}",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"\u{1F1ED}\u{1F1F0}",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"\u{1F1ED}\u{1F1FA}",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"\u{1F1EE}\u{1F1F8}",code:"IS",dial_code:"+354"},{name:"India",flag:"\u{1F1EE}\u{1F1F3}",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"\u{1F1EE}\u{1F1E9}",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"\u{1F1EE}\u{1F1F7}",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"\u{1F1EE}\u{1F1F6}",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"\u{1F1EE}\u{1F1EA}",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"\u{1F1EE}\u{1F1F2}",code:"IM",dial_code:"+44"},{name:"Israel",flag:"\u{1F1EE}\u{1F1F1}",code:"IL",dial_code:"+972"},{name:"Italy",flag:"\u{1F1EE}\u{1F1F9}",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"\u{1F1EF}\u{1F1F2}",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"\u{1F1EF}\u{1F1F5}",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"\u{1F1EF}\u{1F1EA}",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"\u{1F1EF}\u{1F1F4}",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"\u{1F1F0}\u{1F1FF}",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"\u{1F1F0}\u{1F1EA}",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"\u{1F1F0}\u{1F1EE}",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"\u{1F1F0}\u{1F1F5}",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"\u{1F1F0}\u{1F1F7}",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"\u{1F1FD}\u{1F1F0}",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"\u{1F1F0}\u{1F1FC}",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"\u{1F1F0}\u{1F1EC}",code:"KG",dial_code:"+996"},{name:"Laos",flag:"\u{1F1F1}\u{1F1E6}",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"\u{1F1F1}\u{1F1FB}",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"\u{1F1F1}\u{1F1E7}",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"\u{1F1F1}\u{1F1F8}",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"\u{1F1F1}\u{1F1F7}",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"\u{1F1F1}\u{1F1FE}",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"\u{1F1F1}\u{1F1EE}",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"\u{1F1F1}\u{1F1F9}",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"\u{1F1F1}\u{1F1FA}",code:"LU",dial_code:"+352"},{name:"Macao",flag:"\u{1F1F2}\u{1F1F4}",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"\u{1F1F2}\u{1F1F0}",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"\u{1F1F2}\u{1F1EC}",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"\u{1F1F2}\u{1F1FC}",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"\u{1F1F2}\u{1F1FE}",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"\u{1F1F2}\u{1F1FB}",code:"MV",dial_code:"+960"},{name:"Mali",flag:"\u{1F1F2}\u{1F1F1}",code:"ML",dial_code:"+223"},{name:"Malta",flag:"\u{1F1F2}\u{1F1F9}",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"\u{1F1F2}\u{1F1ED}",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"\u{1F1F2}\u{1F1F6}",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"\u{1F1F2}\u{1F1F7}",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"\u{1F1F2}\u{1F1FA}",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"\u{1F1FE}\u{1F1F9}",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"\u{1F1F2}\u{1F1FD}",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"\u{1F1EB}\u{1F1F2}",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"\u{1F1F2}\u{1F1E9}",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"\u{1F1F2}\u{1F1E8}",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"\u{1F1F2}\u{1F1F3}",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"\u{1F1F2}\u{1F1EA}",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"\u{1F1F2}\u{1F1F8}",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"\u{1F1F2}\u{1F1E6}",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"\u{1F1F2}\u{1F1FF}",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"\u{1F1F2}\u{1F1F2}",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"\u{1F1F3}\u{1F1E6}",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"\u{1F1F3}\u{1F1F7}",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"\u{1F1F3}\u{1F1F5}",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"\u{1F1F3}\u{1F1F1}",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"\u{1F1F3}\u{1F1E8}",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"\u{1F1F3}\u{1F1FF}",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"\u{1F1F3}\u{1F1EE}",code:"NI",dial_code:"+505"},{name:"Niger",flag:"\u{1F1F3}\u{1F1EA}",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"\u{1F1F3}\u{1F1EC}",code:"NG",dial_code:"+234"},{name:"Niue",flag:"\u{1F1F3}\u{1F1FA}",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"\u{1F1F3}\u{1F1EB}",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"\u{1F1F2}\u{1F1F5}",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"\u{1F1F3}\u{1F1F4}",code:"NO",dial_code:"+47"},{name:"Oman",flag:"\u{1F1F4}\u{1F1F2}",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"\u{1F1F5}\u{1F1F0}",code:"PK",dial_code:"+92"},{name:"Palau",flag:"\u{1F1F5}\u{1F1FC}",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"\u{1F1F5}\u{1F1F8}",code:"PS",dial_code:"+970"},{name:"Panama",flag:"\u{1F1F5}\u{1F1E6}",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"\u{1F1F5}\u{1F1EC}",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"\u{1F1F5}\u{1F1FE}",code:"PY",dial_code:"+595"},{name:"Peru",flag:"\u{1F1F5}\u{1F1EA}",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"\u{1F1F5}\u{1F1ED}",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"\u{1F1F5}\u{1F1F3}",code:"PN",dial_code:"+64"},{name:"Poland",flag:"\u{1F1F5}\u{1F1F1}",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"\u{1F1F5}\u{1F1F9}",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"\u{1F1F5}\u{1F1F7}",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"\u{1F1F6}\u{1F1E6}",code:"QA",dial_code:"+974"},{name:"Romania",flag:"\u{1F1F7}\u{1F1F4}",code:"RO",dial_code:"+40"},{name:"Russia",flag:"\u{1F1F7}\u{1F1FA}",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"\u{1F1F7}\u{1F1FC}",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"\u{1F1F7}\u{1F1EA}",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"\u{1F1E7}\u{1F1F1}",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"\u{1F1F8}\u{1F1ED}",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"\u{1F1F0}\u{1F1F3}",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"\u{1F1F1}\u{1F1E8}",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"\u{1F1F2}\u{1F1EB}",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"\u{1F1F5}\u{1F1F2}",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"\u{1F1FB}\u{1F1E8}",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"\u{1F1FC}\u{1F1F8}",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"\u{1F1F8}\u{1F1F2}",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"\u{1F1F8}\u{1F1F9}",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"\u{1F1F8}\u{1F1E6}",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"\u{1F1F8}\u{1F1F3}",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"\u{1F1F7}\u{1F1F8}",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"\u{1F1F8}\u{1F1E8}",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"\u{1F1F8}\u{1F1F1}",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"\u{1F1F8}\u{1F1EC}",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"\u{1F1F8}\u{1F1F0}",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"\u{1F1F8}\u{1F1EE}",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"\u{1F1F8}\u{1F1E7}",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"\u{1F1F8}\u{1F1F4}",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"\u{1F1FF}\u{1F1E6}",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"\u{1F1F8}\u{1F1F8}",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"\u{1F1EC}\u{1F1F8}",code:"GS",dial_code:"+500"},{name:"Spain",flag:"\u{1F1EA}\u{1F1F8}",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"\u{1F1F1}\u{1F1F0}",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"\u{1F1F8}\u{1F1E9}",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"\u{1F1F8}\u{1F1F7}",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"\u{1F1F8}\u{1F1EF}",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"\u{1F1F8}\u{1F1FF}",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"\u{1F1F8}\u{1F1EA}",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"\u{1F1E8}\u{1F1ED}",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"\u{1F1F8}\u{1F1FE}",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"\u{1F1F9}\u{1F1FC}",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"\u{1F1F9}\u{1F1EF}",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"\u{1F1F9}\u{1F1FF}",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"\u{1F1F9}\u{1F1ED}",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"\u{1F1F9}\u{1F1F1}",code:"TL",dial_code:"+670"},{name:"Togo",flag:"\u{1F1F9}\u{1F1EC}",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"\u{1F1F9}\u{1F1F0}",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"\u{1F1F9}\u{1F1F4}",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"\u{1F1F9}\u{1F1F9}",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"\u{1F1F9}\u{1F1F3}",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"\u{1F1F9}\u{1F1F7}",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"\u{1F1F9}\u{1F1F2}",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"\u{1F1F9}\u{1F1E8}",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"\u{1F1F9}\u{1F1FB}",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"\u{1F1FA}\u{1F1EC}",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"\u{1F1FA}\u{1F1E6}",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"\u{1F1E6}\u{1F1EA}",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"\u{1F1EC}\u{1F1E7}",code:"GB",dial_code:"+44"},{name:"United States",flag:"\u{1F1FA}\u{1F1F8}",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"\u{1F1FA}\u{1F1FE}",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"\u{1F1FA}\u{1F1FF}",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"\u{1F1FB}\u{1F1FA}",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"\u{1F1FB}\u{1F1EA}",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"\u{1F1FB}\u{1F1F3}",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"\u{1F1FB}\u{1F1EC}",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"\u{1F1FB}\u{1F1EE}",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"\u{1F1FC}\u{1F1EB}",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"\u{1F1FE}\u{1F1EA}",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"\u{1F1FF}\u{1F1F2}",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"\u{1F1FF}\u{1F1FC}",code:"ZW",dial_code:"+263"}];var iI=C('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full"><div class="relative agent-country-select flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),sI=C("<option> "),P0=e=>{let[t,n]=R(je(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=R(e.defaultValue??""),a,i=d=>{o(d),(d===""||d==="+")&&t()!=="INT"&&n("INT");let p=d?.startsWith("+")&&d.length>2&&zr.reduce((h,g)=>!g?.dial_code||h!==null&&!h.dial_code?h:d?.startsWith(g.dial_code)&&g.dial_code.length>(h?.dial_code.length??0)?g:h,null);p&&n(p.code)},s=()=>a?.value!==""&&a?.reportValidity(),c=()=>{let d=zr.find(p=>p.code===t())?.dial_code;if(s()){let p=a?.value??r();e.onSubmit({type:"text",value:p.startsWith("+")?p:`${d??""}${p}`})}else a?.focus()},l=d=>{d.key==="Enter"&&c()},u=d=>{let p=zr.find(g=>g.code===d.currentTarget.value);if(!p)return;let h=zr.find(g=>g.code===t());(r()===""||h&&r()===h.dial_code)&&o(p.dial_code),n(p.code),a?.focus()};ie(()=>{!Y()&&a&&a.focus({preventScroll:!0}),window.addEventListener("message",f)}),de(()=>{window.removeEventListener("message",f)});let f=d=>{let{data:p}=d;p.isFromAgent&&p.command==="setInputValue"&&o(p.value)};return(()=>{var d=iI(),p=d.firstChild,h=p.firstChild,g=h.firstChild,y=g.firstChild,b=g.nextSibling;return d.$$keydown=l,x(y,()=>zr.find(T=>t()===T.code)?.flag),x(g,m(k0,{class:"w-3"}),null),b.addEventListener("change",u),x(b,m(we,{each:zr,children:T=>(()=>{var S=sI(),k=S.firstChild;return x(S,()=>T.name,k),x(S,()=>T.dial_code?`(${T.dial_code})`:"",null),M(()=>S.selected=T.code===t()),M(()=>S.value=T.code),S})()})),x(p,m(br,{type:"tel",ref(T){var S=a;typeof S=="function"?S(T):a=T},get value(){return r()},onInput:i,get placeholder(){return e.labels?.placeholder??A0.labels.placeholder},get autofocus(){return!Y()}}),null),x(d,m(Ze,{type:"button",class:"h-[56px]","on:click":c,get children(){return e.labels?.button}}),null),d})()};He(["keydown"]);var Mu={buttonLabel:lt,searchInputPlaceholder:"Filter the options...",isMultipleChoice:!1,isSearchable:!1,dynamicItems:{isEnabled:!1}};var lI=C('<div class="flex items-end agent-input w-full">'),cI=C('<form class="flex flex-col gap-2 w-full items-end"><div>'),I0=C("<span class=font-semibold>"),_0=C('<span class="text-sm whitespace-pre-wrap text-left">'),M0=C('<div class="flex flex-col gap-1 ">'),uI=C("<div role=checkbox><img fetchpriority=high class=m-auto><div>"),dI=C('<div role=checkbox aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture selected"><img fetchpriority=high><div>'),R0=e=>{let t,[n,r]=R(e.defaultItems),[o,a]=R([]),[i,s]=R(0);ie(()=>{!Y()&&t&&t.focus({preventScroll:!0})});let c=p=>{l(p)},l=p=>{let h=o().indexOf(p);a(h!==-1?g=>g.filter(y=>y!==p):g=>[...g,p])},u=()=>e.onSubmit({type:"text",value:o().map(p=>{let h=e.defaultItems.find(g=>g.id===p);return Pe(h?.title)?h.title:h?.pictureSrc}).join(", ")}),f=p=>{r(e.defaultItems.filter(h=>h.title?.toLowerCase().includes((p??"").toLowerCase())||h.description?.toLowerCase().includes((p??"").toLowerCase())))};xe(()=>{i()===e.defaultItems.filter(p=>re(p.pictureSrc)).length&&e.onTransitionEnd()});let d=()=>{s(p=>p+1)};return(()=>{var p=cI(),h=p.firstChild;return p.addEventListener("submit",u),x(p,m(B,{get when(){return e.options?.isSearchable},get children(){var g=lI();return x(g,m(hr,{ref(y){var b=t;typeof b=="function"?b(y):t=y},onInput:f,get placeholder(){return e.options?.searchInputPlaceholder??Mu.searchInputPlaceholder},onClear:()=>r(e.defaultItems)})),g}}),h),x(h,m(we,{get each(){return n()},children:(g,y)=>(()=>{var b=uI(),T=b.firstChild,S=T.nextSibling;return We(b,"click",()=>c(g.id)),T.addEventListener("load",d),x(S,m(Wo,{get isChecked(){return o().some(k=>k===g.id)},get class(){return"flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(S,m(B,{get when(){return g.title||g.description},get children(){var k=M0();return x(k,m(B,{get when(){return g.title},get children(){var I=I0();return x(I,()=>g.title),I}}),null),x(k,m(B,{get when(){return g.description},get children(){var I=_0();return x(I,()=>g.description),I}}),null),k}}),null),M(k=>{var I=o().some(P=>P===g.id),$="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture"+(o().some(P=>P===g.id)?" selected":"")+(en(g.pictureSrc)?" has-svg":""),O=g.id,Q=g.pictureSrc,H=g.title??`Picture ${y()+1}`,j=`Picture choice ${y()+1}`,L="flex gap-3 py-2 flex-shrink-0"+(je(g.title)&&je(g.description)?" justify-center":" px-3");return I!==k.e&&K(b,"aria-checked",k.e=I),$!==k.t&&U(b,k.t=$),O!==k.a&&K(b,"data-itemid",k.a=O),Q!==k.o&&K(T,"src",k.o=Q),H!==k.i&&K(T,"alt",k.i=H),j!==k.n&&K(T,"elementtiming",k.n=j),L!==k.s&&U(S,k.s=L),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()}),null),x(h,m(we,{get each(){return o().filter(g=>n().every(y=>y.id!==g)).map(g=>e.defaultItems.find(y=>y.id===g)).filter(re)},children:(g,y)=>(()=>{var b=dI(),T=b.firstChild,S=T.nextSibling;return We(b,"click",()=>c(g.id)),x(S,m(Wo,{get isChecked(){return o().some(k=>k===g.id)},get class(){return"flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(S,m(B,{get when(){return g.title||g.description},get children(){var k=M0();return x(k,m(B,{get when(){return g.title},get children(){var I=I0();return x(I,()=>g.title),I}}),null),x(k,m(B,{get when(){return g.description},get children(){var I=_0();return x(I,()=>g.description),I}}),null),k}}),null),M(k=>{var I=g.id,$=e.defaultItems.find(j=>j.id===g.id)?.pictureSrc,O=g.title??`Selected picture ${y()+1}`,Q=`Selected picture choice ${y()+1}`,H="flex gap-3 py-2 flex-shrink-0"+(je(g.title)&&je(g.description)?" justify-center":" pl-4");return I!==k.e&&K(b,"data-itemid",k.e=I),$!==k.t&&K(T,"src",k.t=$),O!==k.a&&K(T,"alt",k.a=O),Q!==k.o&&K(T,"elementtiming",k.o=Q),H!==k.i&&U(S,k.i=H),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),b})()}),null),x(p,(()=>{var g=F(()=>o().length>0);return()=>g()&&m(Ze,{disableIcon:!0,get children(){return e.options?.buttonLabel??Mu.buttonLabel}})})(),null),M(()=>U(h,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),p})()};var fI=C('<div class="flex items-end agent-input w-full">'),pI=C('<div class="flex flex-col gap-2 w-full"><div>'),mI=C('<button><img fetchpriority=high class=m-auto><div><span class=font-semibold></span><span class="text-sm whitespace-pre-wrap text-left">'),N0=e=>{let t,[n,r]=R(e.defaultItems),[o,a]=R(0);ie(()=>{!Y()&&t&&t.focus({preventScroll:!0})});let i=l=>{let u=n()[l];if(u)return e.onSubmit({type:"text",label:Pe(u.title)?u.title:u.pictureSrc??u.id,value:u.id})},s=l=>{r(e.defaultItems.filter(u=>u.title?.toLowerCase().includes((l??"").toLowerCase())||u.description?.toLowerCase().includes((l??"").toLowerCase())))};xe(()=>{o()===e.defaultItems.filter(l=>re(l.pictureSrc)).length&&e.onTransitionEnd()});let c=()=>{a(l=>l+1)};return(()=>{var l=pI(),u=l.firstChild;return x(l,m(B,{get when(){return e.options?.isSearchable},get children(){var f=fI();return x(f,m(hr,{ref(d){var p=t;typeof p=="function"?p(d):t=d},onInput:s,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>r(e.defaultItems)})),f}}),u),x(u,m(we,{get each(){return n()},children:(f,d)=>(()=>{var p=mI(),h=p.firstChild,g=h.nextSibling,y=g.firstChild,b=y.nextSibling;return We(p,"click",()=>i(d())),h.addEventListener("load",c),x(y,()=>f.title),x(b,()=>f.description),M(T=>{var S=f.id,k="flex flex-col agent-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(en(f.pictureSrc)?"has-svg":""),I=f.pictureSrc,$=f.title??`Picture ${d()+1}`,O=`Picture choice ${d()+1}`,Q="flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(f.description?" items-start":"");return S!==T.e&&K(p,"data-itemid",T.e=S),k!==T.t&&U(p,T.t=k),I!==T.a&&K(h,"src",T.a=I),$!==T.o&&K(h,"alt",T.o=$),O!==T.i&&K(h,"elementtiming",T.i=O),Q!==T.n&&U(g,T.n=Q),T},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),p})()})),M(()=>U(u,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),l})()};var jn={buttonType:"Numbers",length:10,labels:{button:lt},startsAt:0,customIcon:{isEnabled:!1},isOneClickSubmitEnabled:!1};var gI=C('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),hI=C('<span class="text-sm w-full rating-label">'),bI=C('<span class="text-sm w-full text-right pr-2 rating-label">'),yI=C("<div role=checkbox>"),vI=C("<div>"),O0=e=>{let[t,n]=R(e.defaultValue?Number(e.defaultValue):void 0),r=a=>{a.preventDefault();let i=t();Qe(i)||e.onSubmit({type:"text",value:i.toString()})},o=a=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:a.toString()}),n(a)};return(()=>{var a=gI(),i=a.firstChild,s=i.nextSibling;return a.addEventListener("submit",r),x(a,(()=>{var c=F(()=>!!e.block.options?.labels?.left);return()=>c()&&(()=>{var l=hI();return x(l,()=>e.block.options.labels.left),l})()})(),i),x(i,m(we,{get each(){return Array.from(Array((e.block.options?.length??jn.length)+((e.block.options?.buttonType??jn.buttonType)==="Numbers"?-((e.block.options?.startsAt??jn.startsAt)-1):0)))},children:(c,l)=>m(xI,Ee(()=>e.block.options,{get rating(){return t()},get idx(){return l()+((e.block.options?.buttonType??jn.buttonType)==="Numbers"?e.block.options?.startsAt??jn.startsAt:1)},onClick:o}))})),x(a,(()=>{var c=F(()=>!!e.block.options?.labels?.right);return()=>c()&&(()=>{var l=bI();return x(l,()=>e.block.options.labels.right),l})()})(),s),x(s,(()=>{var c=F(()=>!!re(t()));return()=>c()&&m(Ze,{disableIcon:!0,get children(){return e.block.options?.labels?.button??jn.labels.button}})})()),a})()},xI=e=>{let t=n=>{n.preventDefault(),e.onClick(e.idx)};return m(Me,{get children(){return[m(Z,{get when(){return(e.buttonType??jn.buttonType)==="Numbers"},get children(){return[m(B,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(cn,{"on:click":t,get children(){return e.idx}})}}),m(B,{get when(){return!e.isOneClickSubmitEnabled},get children(){var n=yI();return We(n,"click",t),x(n,()=>e.idx),M(r=>{var o=re(e.rating)&&e.idx<=e.rating,a="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(re(e.rating)&&e.idx<=e.rating?" selected":"");return o!==r.e&&K(n,"aria-checked",r.e=o),a!==r.t&&U(n,r.t=a),r},{e:void 0,t:void 0}),n}})]}}),m(Z,{get when(){return(e.buttonType??jn.buttonType)!=="Numbers"},get children(){var n=vI();return We(n,"click",()=>e.onClick(e.idx)),M(r=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(re(e.rating)&&e.idx<=e.rating?"selected":""),a=e.customIcon?.isEnabled&&!je(e.customIcon.svg)?e.customIcon.svg:wI;return o!==r.e&&U(n,r.e=o),a!==r.t&&(n.innerHTML=r.t=a),r},{e:void 0,t:void 0}),n}})]}})},wI='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var SI=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),Ru=e=>(()=>{var t=SI();return ke(t,e,!0,!0),t})();var TI=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),L0=e=>(()=>{var t=TI();return ke(t,e,!0,!0),t})();var CI=C("<input type=file id=document-upload multiple class=hidden>"),EI=C('<input type=file id=photos-upload accept="image/*, video/*"multiple class=hidden>'),kI=C('<label aria-label="Add attachments"for=document-upload>'),AI=C("<label> Document"),PI=C("<label> Photos & videos"),D0=e=>[(()=>{var t=CI();return t.addEventListener("change",n=>{n.currentTarget.files&&e.onNewFiles(n.currentTarget.files)}),t})(),(()=>{var t=EI();return t.addEventListener("change",n=>{n.currentTarget.files&&e.onNewFiles(n.currentTarget.files)}),t})(),m(Me,{get children(){return[m(Z,{get when(){return Y()},get children(){var t=kI();return x(t,m(Ru,{class:"w-5"})),M(()=>U(t,ve("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),m(Z,{when:!0,get children(){return m(Hn.Root,{get children(){return[m(Hn.Trigger,{get class(){return ve("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return m(Ru,{class:"w-5"})}}),m(Hn.Positioner,{get children(){return m(Hn.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[m(Hn.Item,{value:"document",asChild:t=>(()=>{var n=AI(),r=n.firstChild;return ke(n,Ee(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),x(n,m(Xs,{class:"w-4"}),r),n})()}),m(Hn.Item,{value:"photos",asChild:t=>(()=>{var n=PI(),r=n.firstChild;return ke(n,Ee(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),x(n,m(L0,{class:"w-4"}),r),n})()})]}})}})]}})}})]}})];var II=C('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),B0=e=>(()=>{var t=II();return ke(t,e,!0,!0),t})();var _I=C('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),U0=e=>{let[t,n]=ze(e,["ref","onInput"]);return(()=>{var r=_I();r.$$input=a=>t.onInput(a.currentTarget.value);var o=t.ref;return typeof o=="function"?he(o,r):t.ref=r,ke(r,Ee({get autofocus(){return!Y()}},n),!1,!1),r})()};He(["input"]);var Tv=Sr(xv(),1);var Sl={isLong:!1,labels:{button:lt,placeholder:"Type your answer..."},audioClip:{isEnabled:!1,visibility:"Auto"},attachments:{isEnabled:!1,visibility:"Auto"}};var wv=`
|
|
81
|
+
(max 10MB)`,button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}};var hs=({newFile:e,existingFiles:t,params:n,onError:r})=>{let o=n.sizeLimit??Qt("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE");if(o&&e.size>o*1024*1024){r({title:"File too large",description:`${e.name} is larger than ${o}MB`});return}if(t.length===0)return e;let i=e.name,a=1;for(;t.some(s=>s.name===i);){let s=e.name.lastIndexOf("."),c=s!==-1?e.name.slice(s):"";i=`${e.name.slice(0,s)}(${a})${c}`,a++}return new File([e],i,{type:e.type})};var To=async({apiHost:e,files:t,onUploadProgress:n})=>{let r=[],o=0;for(let{input:i,file:a}of t){n&&n({progress:o/t.length*100,fileIndex:o}),o+=1;let{data:s}=await Of({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type,blockId:i.blockId}});if(s?.presignedUrl){console.log("iniciando puuuttt",a),console.log(s.presignedUrl);let c=new FormData;if(Object.entries(s.formData).forEach(([u,f])=>{c.append(u,f)}),c.append("file",a),!(await fetch(s.presignedUrl,{method:"PUT",body:a,headers:{"Content-Type":a.type}})).ok)continue;r.push({url:s.fileUrl,type:a.type})}else continue}return r};var Kk=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),bs=e=>(()=>{var t=Kk();return Te(t,e,!0,!0),t})();var Yk=S('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),ys=e=>{let t=Zk(e.file);return(()=>{var n=Yk(),r=n.firstChild,o=r.nextSibling,i=o.firstChild,a=i.nextSibling;return x(r,m(bs,{class:"w-6 h-6"})),x(i,()=>e.file.name),x(a,()=>Xk(e.file)),A(()=>$(r,pe("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),n})()},Xk=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},Zk=e=>{let t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}};var Jk=S('<img class="rounded-md object-cover w-[58px] h-[58px]">'),Qk=S('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remove attachment">'),eE=S('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),xs=e=>(()=>{var t=Qk(),n=t.firstChild;return x(t,m(Ee,{get children(){return[m(q,{get when(){return e.file.type.startsWith("image")},get children(){var r=Jk();return A(o=>{var i=URL.createObjectURL(e.file),a=e.file.name;return i!==o.e&&j(r,"src",o.e=i),a!==o.t&&j(r,"alt",o.t=a),o},{e:void 0,t:void 0}),r}}),m(q,{when:!0,get children(){return m(ys,{get file(){return e.file}})}})]}}),n),Fe(n,"click",e.onRemoveClick),x(n,m(fn,{class:"w-4"})),x(t,m(N,{get when(){return re(e.uploadProgressPercent)&&e.uploadProgressPercent!==100},get children(){return m(tE,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),tE=e=>{let[t,n]=O(e.progressPercent??0),r;return ge(()=>{e.progressPercent===20&&(r=setInterval(()=>{t()<100&&n(i=>i+(Math.floor(Math.random()*10)+1))},1e3))}),se(()=>{clearInterval(r)}),(()=>{var o=eE();return x(o,m(br.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m(br.Circle,{get children(){return[m(br.CircleTrack,{}),m(br.CircleRange,{})]}})}})),o})()};var nE=S('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full">'),rE=S('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),oE=S('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-center">'),iE=S("<input id=dropzone-file type=file class=hidden>"),aE=S('<div class="flex justify-end">'),sE=S('<div class="flex justify-end"><div class="flex gap-2">'),lE=S('<form class="flex flex-col relative w-full gap-2 rounded-md agent-host-bubble upload"><span class="flex h-5 w-5 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-5 w-5 brightness-150"></span></span><label for=dropzone-file>'),cE=S('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),qb=e=>{let[t,n]=O([]),[r,o]=O(!1),[i,a]=O(0),[s,c]=O(!1),l=C=>{let E=Array.from(C).map(I=>hs({existingFiles:t(),newFile:I,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},onError:({description:U,title:R})=>Kn.create({title:R,description:U})})).filter(re);if(E.length!==0){if(!e.block.options?.isMultipleAllowed)return f(E[0]);n([...t(),...E])}},u=async C=>{C.preventDefault(),t().length!==0&&d(t())},f=async C=>{o(!0);let E=await To({apiHost:e.context.apiHost??bt({ignoreChatApiUrl:!0}),files:[{file:C,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:C.name}}]});if(o(!1),E.length&&E[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??Kt.labels.success.single,value:E[0]?Wb(E[0].url):"",attachments:[{type:C.type,url:E[0].url,blobUrl:URL.createObjectURL(C)}]});Kn.create({description:"An error occured while uploading the file"})},d=async C=>{o(!0);let E=await To({apiHost:e.context.apiHost??bt({ignoreChatApiUrl:!0}),files:C.map(I=>({file:I,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:I.name}})),onUploadProgress:a});if(o(!1),a(0),E.length!==C.length)return Kn.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:E.length>1?(e.block.options?.labels?.success?.multiple??Kt.labels.success.multiple).replaceAll("{total}",E.length.toString()):e.block.options?.labels?.success?.single??Kt.labels.success.single,value:E.filter(re).map(({url:I})=>Wb(I)).join(", "),attachments:E.map((I,U)=>I?{...I,blobUrl:URL.createObjectURL(t()[U])}:null).filter(re)})},p=C=>{C.preventDefault(),c(!0)},h=()=>c(!1),g=C=>{C.preventDefault(),C.stopPropagation(),C.dataTransfer?.files&&l(C.dataTransfer.files)},v=()=>n([]),y=()=>e.onSkip(e.block.options?.labels?.skip??Kt.labels.skip),T=C=>{n(E=>E.filter((I,U)=>U!==C))};return(()=>{var C=lE(),E=C.firstChild,I=E.nextSibling;return C.addEventListener("submit",u),I.addEventListener("drop",g),I.addEventListener("dragleave",h),I.addEventListener("dragover",p),x(I,m(Ee,{get children(){return[m(q,{get when(){return r()},get children(){return m(N,{get when(){return t().length>1},get fallback(){return m(gs,{})},get children(){var U=nE(),R=U.firstChild;return R.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),A(oe=>(oe=`${i()>0?i:10}%`)!=null?R.style.setProperty("width",oe):R.style.removeProperty("width")),U}})}}),m(q,{get when(){return!r()},get children(){return[(()=>{var U=oE(),R=U.firstChild;return x(U,m(N,{get when(){return t().length},get fallback(){return m(uE,{})},get children(){var oe=rE();return Fe(oe,"click",H=>{H.preventDefault(),H.stopPropagation()}),x(oe,m(he,{get each(){return t()},children:(H,G)=>m(xs,{file:H,onRemoveClick:()=>T(G())})})),oe}}),R),A(()=>R.innerHTML=e.block.options?.labels?.placeholder??Kt.labels.placeholder),U})(),(()=>{var U=iE();return U.addEventListener("change",R=>{R.currentTarget.files&&l(R.currentTarget.files)}),A(()=>U.multiple=e.block.options?.isMultipleAllowed??Kt.isMultipleAllowed),U})()]}})]}})),x(C,m(N,{get when(){return t().length===0&&e.block.options?.isRequired===!1},get children(){var U=aE();return x(U,m(qt,{"on:click":y,get children(){return e.block.options?.labels?.skip??Kt.labels.skip}})),U}}),null),x(C,m(N,{get when(){return B(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){var U=sE(),R=U.firstChild;return x(R,m(N,{get when(){return t().length},get children(){return m(qt,{variant:"secondary","on:click":v,get children(){return e.block.options?.labels?.clear??Kt.labels.clear}})}}),null),x(R,m(Ue,{type:"submit",disableIcon:!0,get children(){return B(()=>(e.block.options?.labels?.button??Kt.labels.button)===Kt.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),U}}),null),A(()=>$(I,"agent-upload-input py-6 flex flex-col justify-center items-center w-full bubble-typing cursor-pointer px-8 "+(s()?"dragging-over":""))),C})()},uE=()=>cE(),Wb=e=>{let t=e.split("/").pop();if(!t)return e;let n=encodeURIComponent(t);return e.replace(t,n)};var Kb={labels:{button:Qe,placeholder:"Type a number..."}};var Yb=e=>{let t=r=>{ge(()=>{let o=e();if(o==null){r.value=o;return}let i=r.value;(o===0&&i===""||o!==i)&&(r.value=o+"")})},n=r=>{if(r.validity.badInput)return e();if(r.value!=="")return r.valueAsNumber};return[ze(e),t,n]};var dE=S('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=number>'),Xb=e=>{let[t,n]=O(e.defaultValue??""),[r,o,i]=Yb(()=>t()),a,s=()=>a?.value!==""&&a?.reportValidity(),c=()=>{s()?e.onSubmit({type:"text",value:a?.value??t().toString()}):a?.focus()},l=f=>{f.key==="Enter"&&c()};ne(()=>{!K()&&a&&a.focus({preventScroll:!0}),window.addEventListener("message",u)}),se(()=>{window.removeEventListener("message",u)});let u=f=>{let{data:d}=f;d.isFromAgent&&d.command==="setInputValue"&&n(d.value)};return(()=>{var f=dE(),d=f.firstChild,p=d.firstChild;f.$$keydown=l,p.$$input=g=>{n(i(g.currentTarget))},de(o,p,()=>!0);var h=a;return typeof h=="function"?de(h,p):a=p,p.style.setProperty("font-size","16px"),p.style.setProperty("appearance","auto"),p.value=r,x(f,m(Ue,{type:"button",class:"h-[56px]","on:click":c,get children(){return e.block.options?.labels?.button}}),null),A(g=>{var v=e.block.options?.labels?.placeholder??Kb.labels.placeholder,y=e.block.options?.min,T=e.block.options?.max,C=e.block.options?.step??"any";return v!==g.e&&j(p,"placeholder",g.e=v),y!==g.t&&j(p,"min",g.t=y),T!==g.a&&j(p,"max",g.a=T),C!==g.o&&j(p,"step",g.o=C),g},{e:void 0,t:void 0,a:void 0,o:void 0}),f})()};Me(["keydown","input"]);var oy=Fr(ry(),1);var Ts={provider:"Stripe",labels:{button:"Pay",success:"Success"},retryMessageContent:"Payment failed. Please, try again.",currency:"USD"};var yE=S('<div class="agent-input-error-message mt-4 text-center animate-fade-in">'),xE=S('<form id=payment-form class="flex flex-col p-4 agent-input w-full items-center"><slot name=stripe-payment-form>'),vE="stripe-payment-form",Lc,zi=null,Cs=null,iy=e=>{let[t,n]=O(),[r,o]=O(!1),[i,a]=O(!1);ne(async()=>{if(wE(Lc),!e.options?.publicKey)return n("Missing Stripe public key");if(zi=await(0,oy.loadStripe)(e.options?.publicKey),!zi)return;Cs=zi.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(Lc).getPropertyValue("--agent-button-bg-color")}},clientSecret:e.options.paymentIntentSecret}),Cs.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(!0),e.onTransitionEnd()},1e3)});let s=async c=>{if(c.preventDefault(),!zi||!Cs)return;a(!0),Td({sessionId:e.context.sessionId,resultId:e.context.resultId,agent:e.context.agent});let{postalCode:l,...u}=e.options?.additionalInformation?.address??{},{error:f,paymentIntent:d}=await zi.confirmPayment({elements:Cs,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:l}}}},redirect:"if_required"});if(ma(),a(!1),f?.type!=="validation_error"){if(f?.type==="card_error")return n(f.message);if(!f&&d.status==="succeeded")return e.onSuccess()}};return(()=>{var c=xE(),l=c.firstChild;return c.addEventListener("submit",s),de(u=>Lc=u,l),l._$owner=jr(),x(c,m(N,{get when(){return r()},get children(){return m(Ue,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[B(()=>e.options?.labels?.button??Ts.labels.button)," ",B(()=>e.options?.amountLabel)]}})}}),null),x(c,m(N,{get when(){return t()},get children(){var u=yE();return x(u,t),u}}),null),c})()},wE=e=>{let n=e.getRootNode().host,r=document.createElement("div");r.style.width="100%",r.slot=vE,n.appendChild(r);let o=document.createElement("div");o.id="payment-element",r.appendChild(o)};var ay=e=>m(iy,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var SE=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),sy=e=>(()=>{var t=SE();return Te(t,e,!0,!0),t})();var ly={labels:{button:Qe,placeholder:"Type your phone number..."},retryMessageContent:"This phone number doesn't seem to be valid. Can you type it again?"};var Tr=[{name:"International",flag:"\u{1F310}",code:"INT",dial_code:""},{name:"Afghanistan",flag:"\u{1F1E6}\u{1F1EB}",code:"AF",dial_code:"+93"},{name:"\xC5land Islands",flag:"\u{1F1E6}\u{1F1FD}",code:"AX",dial_code:"+358"},{name:"Albania",flag:"\u{1F1E6}\u{1F1F1}",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"\u{1F1E9}\u{1F1FF}",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"\u{1F1E6}\u{1F1F8}",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"\u{1F1E6}\u{1F1E9}",code:"AD",dial_code:"+376"},{name:"Angola",flag:"\u{1F1E6}\u{1F1F4}",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"\u{1F1E6}\u{1F1EE}",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"\u{1F1E6}\u{1F1F6}",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"\u{1F1E6}\u{1F1EC}",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"\u{1F1E6}\u{1F1F7}",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"\u{1F1E6}\u{1F1F2}",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"\u{1F1E6}\u{1F1FC}",code:"AW",dial_code:"+297"},{name:"Australia",flag:"\u{1F1E6}\u{1F1FA}",code:"AU",dial_code:"+61"},{name:"Austria",flag:"\u{1F1E6}\u{1F1F9}",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"\u{1F1E6}\u{1F1FF}",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"\u{1F1E7}\u{1F1F8}",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"\u{1F1E7}\u{1F1ED}",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"\u{1F1E7}\u{1F1E9}",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"\u{1F1E7}\u{1F1E7}",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"\u{1F1E7}\u{1F1FE}",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"\u{1F1E7}\u{1F1EA}",code:"BE",dial_code:"+32"},{name:"Belize",flag:"\u{1F1E7}\u{1F1FF}",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"\u{1F1E7}\u{1F1EF}",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"\u{1F1E7}\u{1F1F2}",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"\u{1F1E7}\u{1F1F9}",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"\u{1F1E7}\u{1F1F4}",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"\u{1F1E7}\u{1F1E6}",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"\u{1F1E7}\u{1F1FC}",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"\u{1F1E7}\u{1F1FB}",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"\u{1F1E7}\u{1F1F7}",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"\u{1F1EE}\u{1F1F4}",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"\u{1F1E7}\u{1F1F3}",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"\u{1F1E7}\u{1F1EC}",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"\u{1F1E7}\u{1F1EB}",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"\u{1F1E7}\u{1F1EE}",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"\u{1F1F0}\u{1F1ED}",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"\u{1F1E8}\u{1F1F2}",code:"CM",dial_code:"+237"},{name:"Canada",flag:"\u{1F1E8}\u{1F1E6}",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"\u{1F1E8}\u{1F1FB}",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"\u{1F1F0}\u{1F1FE}",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"\u{1F1E8}\u{1F1EB}",code:"CF",dial_code:"+236"},{name:"Chad",flag:"\u{1F1F9}\u{1F1E9}",code:"TD",dial_code:"+235"},{name:"Chile",flag:"\u{1F1E8}\u{1F1F1}",code:"CL",dial_code:"+56"},{name:"China",flag:"\u{1F1E8}\u{1F1F3}",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"\u{1F1E8}\u{1F1FD}",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"\u{1F1E8}\u{1F1E8}",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"\u{1F1E8}\u{1F1F4}",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"\u{1F1F0}\u{1F1F2}",code:"KM",dial_code:"+269"},{name:"Congo",flag:"\u{1F1E8}\u{1F1EC}",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"\u{1F1E8}\u{1F1E9}",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"\u{1F1E8}\u{1F1F0}",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"\u{1F1E8}\u{1F1F7}",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"\u{1F1E8}\u{1F1EE}",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"\u{1F1ED}\u{1F1F7}",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"\u{1F1E8}\u{1F1FA}",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"\u{1F1E8}\u{1F1FE}",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"\u{1F1E8}\u{1F1FF}",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"\u{1F1E9}\u{1F1F0}",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"\u{1F1E9}\u{1F1EF}",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"\u{1F1E9}\u{1F1F2}",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"\u{1F1EA}\u{1F1E8}",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"\u{1F1EA}\u{1F1EC}",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"\u{1F1F8}\u{1F1FB}",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"\u{1F1EC}\u{1F1F6}",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"\u{1F1EA}\u{1F1F7}",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"\u{1F1EA}\u{1F1EA}",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"\u{1F1EA}\u{1F1F9}",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"\u{1F1EB}\u{1F1F0}",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"\u{1F1EB}\u{1F1F4}",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"\u{1F1EB}\u{1F1EF}",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"\u{1F1EB}\u{1F1EE}",code:"FI",dial_code:"+358"},{name:"France",flag:"\u{1F1EB}\u{1F1F7}",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"\u{1F1EC}\u{1F1EB}",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"\u{1F1F5}\u{1F1EB}",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"\u{1F1F9}\u{1F1EB}",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"\u{1F1EC}\u{1F1E6}",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"\u{1F1EC}\u{1F1F2}",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"\u{1F1EC}\u{1F1EA}",code:"GE",dial_code:"+995"},{name:"Germany",flag:"\u{1F1E9}\u{1F1EA}",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"\u{1F1EC}\u{1F1ED}",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"\u{1F1EC}\u{1F1EE}",code:"GI",dial_code:"+350"},{name:"Greece",flag:"\u{1F1EC}\u{1F1F7}",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"\u{1F1EC}\u{1F1F1}",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"\u{1F1EC}\u{1F1E9}",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"\u{1F1EC}\u{1F1F5}",code:"GP",dial_code:"+590"},{name:"Guam",flag:"\u{1F1EC}\u{1F1FA}",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"\u{1F1EC}\u{1F1F9}",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"\u{1F1EC}\u{1F1EC}",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"\u{1F1EC}\u{1F1F3}",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"\u{1F1EC}\u{1F1FC}",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"\u{1F1EC}\u{1F1FE}",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"\u{1F1ED}\u{1F1F9}",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"\u{1F1ED}\u{1F1F2}",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"\u{1F1FB}\u{1F1E6}",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"\u{1F1ED}\u{1F1F3}",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"\u{1F1ED}\u{1F1F0}",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"\u{1F1ED}\u{1F1FA}",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"\u{1F1EE}\u{1F1F8}",code:"IS",dial_code:"+354"},{name:"India",flag:"\u{1F1EE}\u{1F1F3}",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"\u{1F1EE}\u{1F1E9}",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"\u{1F1EE}\u{1F1F7}",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"\u{1F1EE}\u{1F1F6}",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"\u{1F1EE}\u{1F1EA}",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"\u{1F1EE}\u{1F1F2}",code:"IM",dial_code:"+44"},{name:"Israel",flag:"\u{1F1EE}\u{1F1F1}",code:"IL",dial_code:"+972"},{name:"Italy",flag:"\u{1F1EE}\u{1F1F9}",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"\u{1F1EF}\u{1F1F2}",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"\u{1F1EF}\u{1F1F5}",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"\u{1F1EF}\u{1F1EA}",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"\u{1F1EF}\u{1F1F4}",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"\u{1F1F0}\u{1F1FF}",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"\u{1F1F0}\u{1F1EA}",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"\u{1F1F0}\u{1F1EE}",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"\u{1F1F0}\u{1F1F5}",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"\u{1F1F0}\u{1F1F7}",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"\u{1F1FD}\u{1F1F0}",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"\u{1F1F0}\u{1F1FC}",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"\u{1F1F0}\u{1F1EC}",code:"KG",dial_code:"+996"},{name:"Laos",flag:"\u{1F1F1}\u{1F1E6}",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"\u{1F1F1}\u{1F1FB}",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"\u{1F1F1}\u{1F1E7}",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"\u{1F1F1}\u{1F1F8}",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"\u{1F1F1}\u{1F1F7}",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"\u{1F1F1}\u{1F1FE}",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"\u{1F1F1}\u{1F1EE}",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"\u{1F1F1}\u{1F1F9}",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"\u{1F1F1}\u{1F1FA}",code:"LU",dial_code:"+352"},{name:"Macao",flag:"\u{1F1F2}\u{1F1F4}",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"\u{1F1F2}\u{1F1F0}",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"\u{1F1F2}\u{1F1EC}",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"\u{1F1F2}\u{1F1FC}",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"\u{1F1F2}\u{1F1FE}",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"\u{1F1F2}\u{1F1FB}",code:"MV",dial_code:"+960"},{name:"Mali",flag:"\u{1F1F2}\u{1F1F1}",code:"ML",dial_code:"+223"},{name:"Malta",flag:"\u{1F1F2}\u{1F1F9}",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"\u{1F1F2}\u{1F1ED}",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"\u{1F1F2}\u{1F1F6}",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"\u{1F1F2}\u{1F1F7}",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"\u{1F1F2}\u{1F1FA}",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"\u{1F1FE}\u{1F1F9}",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"\u{1F1F2}\u{1F1FD}",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"\u{1F1EB}\u{1F1F2}",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"\u{1F1F2}\u{1F1E9}",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"\u{1F1F2}\u{1F1E8}",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"\u{1F1F2}\u{1F1F3}",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"\u{1F1F2}\u{1F1EA}",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"\u{1F1F2}\u{1F1F8}",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"\u{1F1F2}\u{1F1E6}",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"\u{1F1F2}\u{1F1FF}",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"\u{1F1F2}\u{1F1F2}",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"\u{1F1F3}\u{1F1E6}",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"\u{1F1F3}\u{1F1F7}",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"\u{1F1F3}\u{1F1F5}",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"\u{1F1F3}\u{1F1F1}",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"\u{1F1F3}\u{1F1E8}",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"\u{1F1F3}\u{1F1FF}",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"\u{1F1F3}\u{1F1EE}",code:"NI",dial_code:"+505"},{name:"Niger",flag:"\u{1F1F3}\u{1F1EA}",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"\u{1F1F3}\u{1F1EC}",code:"NG",dial_code:"+234"},{name:"Niue",flag:"\u{1F1F3}\u{1F1FA}",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"\u{1F1F3}\u{1F1EB}",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"\u{1F1F2}\u{1F1F5}",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"\u{1F1F3}\u{1F1F4}",code:"NO",dial_code:"+47"},{name:"Oman",flag:"\u{1F1F4}\u{1F1F2}",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"\u{1F1F5}\u{1F1F0}",code:"PK",dial_code:"+92"},{name:"Palau",flag:"\u{1F1F5}\u{1F1FC}",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"\u{1F1F5}\u{1F1F8}",code:"PS",dial_code:"+970"},{name:"Panama",flag:"\u{1F1F5}\u{1F1E6}",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"\u{1F1F5}\u{1F1EC}",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"\u{1F1F5}\u{1F1FE}",code:"PY",dial_code:"+595"},{name:"Peru",flag:"\u{1F1F5}\u{1F1EA}",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"\u{1F1F5}\u{1F1ED}",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"\u{1F1F5}\u{1F1F3}",code:"PN",dial_code:"+64"},{name:"Poland",flag:"\u{1F1F5}\u{1F1F1}",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"\u{1F1F5}\u{1F1F9}",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"\u{1F1F5}\u{1F1F7}",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"\u{1F1F6}\u{1F1E6}",code:"QA",dial_code:"+974"},{name:"Romania",flag:"\u{1F1F7}\u{1F1F4}",code:"RO",dial_code:"+40"},{name:"Russia",flag:"\u{1F1F7}\u{1F1FA}",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"\u{1F1F7}\u{1F1FC}",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"\u{1F1F7}\u{1F1EA}",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"\u{1F1E7}\u{1F1F1}",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"\u{1F1F8}\u{1F1ED}",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"\u{1F1F0}\u{1F1F3}",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"\u{1F1F1}\u{1F1E8}",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"\u{1F1F2}\u{1F1EB}",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"\u{1F1F5}\u{1F1F2}",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"\u{1F1FB}\u{1F1E8}",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"\u{1F1FC}\u{1F1F8}",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"\u{1F1F8}\u{1F1F2}",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"\u{1F1F8}\u{1F1F9}",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"\u{1F1F8}\u{1F1E6}",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"\u{1F1F8}\u{1F1F3}",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"\u{1F1F7}\u{1F1F8}",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"\u{1F1F8}\u{1F1E8}",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"\u{1F1F8}\u{1F1F1}",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"\u{1F1F8}\u{1F1EC}",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"\u{1F1F8}\u{1F1F0}",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"\u{1F1F8}\u{1F1EE}",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"\u{1F1F8}\u{1F1E7}",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"\u{1F1F8}\u{1F1F4}",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"\u{1F1FF}\u{1F1E6}",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"\u{1F1F8}\u{1F1F8}",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"\u{1F1EC}\u{1F1F8}",code:"GS",dial_code:"+500"},{name:"Spain",flag:"\u{1F1EA}\u{1F1F8}",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"\u{1F1F1}\u{1F1F0}",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"\u{1F1F8}\u{1F1E9}",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"\u{1F1F8}\u{1F1F7}",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"\u{1F1F8}\u{1F1EF}",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"\u{1F1F8}\u{1F1FF}",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"\u{1F1F8}\u{1F1EA}",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"\u{1F1E8}\u{1F1ED}",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"\u{1F1F8}\u{1F1FE}",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"\u{1F1F9}\u{1F1FC}",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"\u{1F1F9}\u{1F1EF}",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"\u{1F1F9}\u{1F1FF}",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"\u{1F1F9}\u{1F1ED}",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"\u{1F1F9}\u{1F1F1}",code:"TL",dial_code:"+670"},{name:"Togo",flag:"\u{1F1F9}\u{1F1EC}",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"\u{1F1F9}\u{1F1F0}",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"\u{1F1F9}\u{1F1F4}",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"\u{1F1F9}\u{1F1F9}",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"\u{1F1F9}\u{1F1F3}",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"\u{1F1F9}\u{1F1F7}",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"\u{1F1F9}\u{1F1F2}",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"\u{1F1F9}\u{1F1E8}",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"\u{1F1F9}\u{1F1FB}",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"\u{1F1FA}\u{1F1EC}",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"\u{1F1FA}\u{1F1E6}",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"\u{1F1E6}\u{1F1EA}",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"\u{1F1EC}\u{1F1E7}",code:"GB",dial_code:"+44"},{name:"United States",flag:"\u{1F1FA}\u{1F1F8}",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"\u{1F1FA}\u{1F1FE}",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"\u{1F1FA}\u{1F1FF}",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"\u{1F1FB}\u{1F1FA}",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"\u{1F1FB}\u{1F1EA}",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"\u{1F1FB}\u{1F1F3}",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"\u{1F1FB}\u{1F1EC}",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"\u{1F1FB}\u{1F1EE}",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"\u{1F1FC}\u{1F1EB}",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"\u{1F1FE}\u{1F1EA}",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"\u{1F1FF}\u{1F1F2}",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"\u{1F1FF}\u{1F1FC}",code:"ZW",dial_code:"+263"}];var TE=S('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full"><div class="relative agent-country-select flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),CE=S("<option> "),cy=e=>{let[t,n]=O($e(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=O(e.defaultValue??""),i,a=d=>{o(d),(d===""||d==="+")&&t()!=="INT"&&n("INT");let p=d?.startsWith("+")&&d.length>2&&Tr.reduce((h,g)=>!g?.dial_code||h!==null&&!h.dial_code?h:d?.startsWith(g.dial_code)&&g.dial_code.length>(h?.dial_code.length??0)?g:h,null);p&&n(p.code)},s=()=>i?.value!==""&&i?.reportValidity(),c=()=>{let d=Tr.find(p=>p.code===t())?.dial_code;if(s()){let p=i?.value??r();e.onSubmit({type:"text",value:p.startsWith("+")?p:`${d??""}${p}`})}else i?.focus()},l=d=>{d.key==="Enter"&&c()},u=d=>{let p=Tr.find(g=>g.code===d.currentTarget.value);if(!p)return;let h=Tr.find(g=>g.code===t());(r()===""||h&&r()===h.dial_code)&&o(p.dial_code),n(p.code),i?.focus()};ne(()=>{!K()&&i&&i.focus({preventScroll:!0}),window.addEventListener("message",f)}),se(()=>{window.removeEventListener("message",f)});let f=d=>{let{data:p}=d;p.isFromAgent&&p.command==="setInputValue"&&o(p.value)};return(()=>{var d=TE(),p=d.firstChild,h=p.firstChild,g=h.firstChild,v=g.firstChild,y=g.nextSibling;return d.$$keydown=l,x(v,()=>Tr.find(T=>t()===T.code)?.flag),x(g,m(sy,{class:"w-3"}),null),y.addEventListener("change",u),x(y,m(he,{each:Tr,children:T=>(()=>{var C=CE(),E=C.firstChild;return x(C,()=>T.name,E),x(C,()=>T.dial_code?`(${T.dial_code})`:"",null),A(()=>C.selected=T.code===t()),A(()=>C.value=T.code),C})()})),x(p,m(Xn,{type:"tel",ref(T){var C=i;typeof C=="function"?C(T):i=T},get value(){return r()},onInput:a,get placeholder(){return e.labels?.placeholder??ly.labels.placeholder},get autofocus(){return!K()}}),null),x(d,m(Ue,{type:"button",class:"h-[56px]","on:click":c,get children(){return e.labels?.button}}),null),d})()};Me(["keydown"]);var Nc={buttonLabel:Qe,searchInputPlaceholder:"Filter the options...",isMultipleChoice:!1,isSearchable:!1,dynamicItems:{isEnabled:!1}};var _E=S('<div class="flex items-end agent-input w-full">'),kE=S('<form class="flex flex-col gap-2 w-full items-end"><div>'),uy=S("<span class=font-semibold>"),dy=S('<span class="text-sm whitespace-pre-wrap text-left">'),fy=S('<div class="flex flex-col gap-1 ">'),EE=S("<div role=checkbox><img fetchpriority=high class=m-auto><div>"),PE=S('<div role=checkbox aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture selected"><img fetchpriority=high><div>'),py=e=>{let t,[n,r]=O(e.defaultItems),[o,i]=O([]),[a,s]=O(0);ne(()=>{!K()&&t&&t.focus({preventScroll:!0})});let c=p=>{l(p)},l=p=>{let h=o().indexOf(p);i(h!==-1?g=>g.filter(v=>v!==p):g=>[...g,p])},u=()=>e.onSubmit({type:"text",value:o().map(p=>{let h=e.defaultItems.find(g=>g.id===p);return Ce(h?.title)?h.title:h?.pictureSrc}).join(", ")}),f=p=>{r(e.defaultItems.filter(h=>h.title?.toLowerCase().includes((p??"").toLowerCase())||h.description?.toLowerCase().includes((p??"").toLowerCase())))};ge(()=>{a()===e.defaultItems.filter(p=>re(p.pictureSrc)).length&&e.onTransitionEnd()});let d=()=>{s(p=>p+1)};return(()=>{var p=kE(),h=p.firstChild;return p.addEventListener("submit",u),x(p,m(N,{get when(){return e.options?.isSearchable},get children(){var g=_E();return x(g,m(Yn,{ref(v){var y=t;typeof y=="function"?y(v):t=v},onInput:f,get placeholder(){return e.options?.searchInputPlaceholder??Nc.searchInputPlaceholder},onClear:()=>r(e.defaultItems)})),g}}),h),x(h,m(he,{get each(){return n()},children:(g,v)=>(()=>{var y=EE(),T=y.firstChild,C=T.nextSibling;return Fe(y,"click",()=>c(g.id)),T.addEventListener("load",d),x(C,m(So,{get isChecked(){return o().some(E=>E===g.id)},get class(){return"flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(C,m(N,{get when(){return g.title||g.description},get children(){var E=fy();return x(E,m(N,{get when(){return g.title},get children(){var I=uy();return x(I,()=>g.title),I}}),null),x(E,m(N,{get when(){return g.description},get children(){var I=dy();return x(I,()=>g.description),I}}),null),E}}),null),A(E=>{var I=o().some(P=>P===g.id),U="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture"+(o().some(P=>P===g.id)?" selected":"")+(Ft(g.pictureSrc)?" has-svg":""),R=g.id,oe=g.pictureSrc,H=g.title??`Picture ${v()+1}`,G=`Picture choice ${v()+1}`,L="flex gap-3 py-2 flex-shrink-0"+($e(g.title)&&$e(g.description)?" justify-center":" px-3");return I!==E.e&&j(y,"aria-checked",E.e=I),U!==E.t&&$(y,E.t=U),R!==E.a&&j(y,"data-itemid",E.a=R),oe!==E.o&&j(T,"src",E.o=oe),H!==E.i&&j(T,"alt",E.i=H),G!==E.n&&j(T,"elementtiming",E.n=G),L!==E.s&&$(C,E.s=L),E},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),y})()}),null),x(h,m(he,{get each(){return o().filter(g=>n().every(v=>v.id!==g)).map(g=>e.defaultItems.find(v=>v.id===g)).filter(re)},children:(g,v)=>(()=>{var y=PE(),T=y.firstChild,C=T.nextSibling;return Fe(y,"click",()=>c(g.id)),x(C,m(So,{get isChecked(){return o().some(E=>E===g.id)},get class(){return"flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(C,m(N,{get when(){return g.title||g.description},get children(){var E=fy();return x(E,m(N,{get when(){return g.title},get children(){var I=uy();return x(I,()=>g.title),I}}),null),x(E,m(N,{get when(){return g.description},get children(){var I=dy();return x(I,()=>g.description),I}}),null),E}}),null),A(E=>{var I=g.id,U=e.defaultItems.find(G=>G.id===g.id)?.pictureSrc,R=g.title??`Selected picture ${v()+1}`,oe=`Selected picture choice ${v()+1}`,H="flex gap-3 py-2 flex-shrink-0"+($e(g.title)&&$e(g.description)?" justify-center":" pl-4");return I!==E.e&&j(y,"data-itemid",E.e=I),U!==E.t&&j(T,"src",E.t=U),R!==E.a&&j(T,"alt",E.a=R),oe!==E.o&&j(T,"elementtiming",E.o=oe),H!==E.i&&$(C,E.i=H),E},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),y})()}),null),x(p,(()=>{var g=B(()=>o().length>0);return()=>g()&&m(Ue,{disableIcon:!0,get children(){return e.options?.buttonLabel??Nc.buttonLabel}})})(),null),A(()=>$(h,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),p})()};var IE=S('<div class="flex items-end agent-input w-full">'),AE=S('<div class="flex flex-col gap-2 w-full"><div>'),OE=S('<button><img fetchpriority=high class=m-auto><div><span class=font-semibold></span><span class="text-sm whitespace-pre-wrap text-left">'),my=e=>{let t,[n,r]=O(e.defaultItems),[o,i]=O(0);ne(()=>{!K()&&t&&t.focus({preventScroll:!0})});let a=l=>{let u=n()[l];if(u)return e.onSubmit({type:"text",label:Ce(u.title)?u.title:u.pictureSrc??u.id,value:u.id})},s=l=>{r(e.defaultItems.filter(u=>u.title?.toLowerCase().includes((l??"").toLowerCase())||u.description?.toLowerCase().includes((l??"").toLowerCase())))};ge(()=>{o()===e.defaultItems.filter(l=>re(l.pictureSrc)).length&&e.onTransitionEnd()});let c=()=>{i(l=>l+1)};return(()=>{var l=AE(),u=l.firstChild;return x(l,m(N,{get when(){return e.options?.isSearchable},get children(){var f=IE();return x(f,m(Yn,{ref(d){var p=t;typeof p=="function"?p(d):t=d},onInput:s,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>r(e.defaultItems)})),f}}),u),x(u,m(he,{get each(){return n()},children:(f,d)=>(()=>{var p=OE(),h=p.firstChild,g=h.nextSibling,v=g.firstChild,y=v.nextSibling;return Fe(p,"click",()=>a(d())),h.addEventListener("load",c),x(v,()=>f.title),x(y,()=>f.description),A(T=>{var C=f.id,E="flex flex-col agent-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(Ft(f.pictureSrc)?"has-svg":""),I=f.pictureSrc,U=f.title??`Picture ${d()+1}`,R=`Picture choice ${d()+1}`,oe="flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(f.description?" items-start":"");return C!==T.e&&j(p,"data-itemid",T.e=C),E!==T.t&&$(p,T.t=E),I!==T.a&&j(h,"src",T.a=I),U!==T.o&&j(h,"alt",T.o=U),R!==T.i&&j(h,"elementtiming",T.i=R),oe!==T.n&&$(g,T.n=oe),T},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),p})()})),A(()=>$(u,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),l})()};var Pn={buttonType:"Numbers",length:10,labels:{button:Qe},startsAt:0,customIcon:{isEnabled:!1},isOneClickSubmitEnabled:!1};var RE=S('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),ME=S('<span class="text-sm w-full rating-label">'),DE=S('<span class="text-sm w-full text-right pr-2 rating-label">'),LE=S("<div role=checkbox>"),NE=S("<div>"),gy=e=>{let[t,n]=O(e.defaultValue?Number(e.defaultValue):void 0),r=i=>{i.preventDefault();let a=t();Ge(a)||e.onSubmit({type:"text",value:a.toString()})},o=i=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:i.toString()}),n(i)};return(()=>{var i=RE(),a=i.firstChild,s=a.nextSibling;return i.addEventListener("submit",r),x(i,(()=>{var c=B(()=>!!e.block.options?.labels?.left);return()=>c()&&(()=>{var l=ME();return x(l,()=>e.block.options.labels.left),l})()})(),a),x(a,m(he,{get each(){return Array.from(Array((e.block.options?.length??Pn.length)+((e.block.options?.buttonType??Pn.buttonType)==="Numbers"?-((e.block.options?.startsAt??Pn.startsAt)-1):0)))},children:(c,l)=>m($E,Se(()=>e.block.options,{get rating(){return t()},get idx(){return l()+((e.block.options?.buttonType??Pn.buttonType)==="Numbers"?e.block.options?.startsAt??Pn.startsAt:1)},onClick:o}))})),x(i,(()=>{var c=B(()=>!!e.block.options?.labels?.right);return()=>c()&&(()=>{var l=DE();return x(l,()=>e.block.options.labels.right),l})()})(),s),x(s,(()=>{var c=B(()=>!!re(t()));return()=>c()&&m(Ue,{disableIcon:!0,get children(){return e.block.options?.labels?.button??Pn.labels.button}})})()),i})()},$E=e=>{let t=n=>{n.preventDefault(),e.onClick(e.idx)};return m(Ee,{get children(){return[m(q,{get when(){return(e.buttonType??Pn.buttonType)==="Numbers"},get children(){return[m(N,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(qt,{"on:click":t,get children(){return e.idx}})}}),m(N,{get when(){return!e.isOneClickSubmitEnabled},get children(){var n=LE();return Fe(n,"click",t),x(n,()=>e.idx),A(r=>{var o=re(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(re(e.rating)&&e.idx<=e.rating?" selected":"");return o!==r.e&&j(n,"aria-checked",r.e=o),i!==r.t&&$(n,r.t=i),r},{e:void 0,t:void 0}),n}})]}}),m(q,{get when(){return(e.buttonType??Pn.buttonType)!=="Numbers"},get children(){var n=NE();return Fe(n,"click",()=>e.onClick(e.idx)),A(r=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(re(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&!$e(e.customIcon.svg)?e.customIcon.svg:BE;return o!==r.e&&$(n,r.e=o),i!==r.t&&(n.innerHTML=r.t=i),r},{e:void 0,t:void 0}),n}})]}})},BE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var FE=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),$c=e=>(()=>{var t=FE();return Te(t,e,!0,!0),t})();var UE=S('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),hy=e=>(()=>{var t=UE();return Te(t,e,!0,!0),t})();var jE=S("<input type=file id=document-upload multiple class=hidden>"),VE=S('<input type=file id=photos-upload accept="image/*, video/*"multiple class=hidden>'),HE=S('<label aria-label="Add attachments"for=document-upload>'),zE=S("<label> Document"),GE=S("<label> Photos & videos"),by=e=>[(()=>{var t=jE();return t.addEventListener("change",n=>{n.currentTarget.files&&e.onNewFiles(n.currentTarget.files)}),t})(),(()=>{var t=VE();return t.addEventListener("change",n=>{n.currentTarget.files&&e.onNewFiles(n.currentTarget.files)}),t})(),m(Ee,{get children(){return[m(q,{get when(){return K()},get children(){var t=HE();return x(t,m($c,{class:"w-5"})),A(()=>$(t,pe("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),m(q,{when:!0,get children(){return m(_n.Root,{get children(){return[m(_n.Trigger,{get class(){return pe("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return m($c,{class:"w-5"})}}),m(_n.Positioner,{get children(){return m(_n.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[m(_n.Item,{value:"document",asChild:t=>(()=>{var n=zE(),r=n.firstChild;return Te(n,Se(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),x(n,m(bs,{class:"w-4"}),r),n})()}),m(_n.Item,{value:"photos",asChild:t=>(()=>{var n=GE(),r=n.firstChild;return Te(n,Se(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),x(n,m(hy,{class:"w-4"}),r),n})()})]}})}})]}})}})]}})];var WE=S('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),yy=e=>(()=>{var t=WE();return Te(t,e,!0,!0),t})();var qE=S('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),xy=e=>{let[t,n]=Be(e,["ref","onInput"]);return(()=>{var r=qE();r.$$input=i=>t.onInput(i.currentTarget.value);var o=t.ref;return typeof o=="function"?de(o,r):t.ref=r,Te(r,Se({get autofocus(){return!K()}},n),!1,!1),r})()};Me(["input"]);var ox=Fr(tx(),1);var js={isLong:!1,labels:{button:Qe,placeholder:"Type your answer..."},audioClip:{isEnabled:!1,visibility:"Auto"},attachments:{isEnabled:!1,visibility:"Auto"}};var nx=`
|
|
98
82
|
const gainFactor = 3;
|
|
99
83
|
|
|
100
84
|
class VolumeProcessor extends AudioWorkletProcessor {
|
|
@@ -119,38 +103,38 @@ class VolumeProcessor extends AudioWorkletProcessor {
|
|
|
119
103
|
|
|
120
104
|
registerProcessor("volume-processor", VolumeProcessor);
|
|
121
105
|
|
|
122
|
-
`;var YI=C('<div><button class="p-0.5 rounded-full"aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[56px]"></div><div class="absolute right-gradient w-3 right-0 h-[56px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),Wr=3,Zr=3,qI=60,JI=10,XI=5,QI=90,Sv=e=>{let[t,n]=R(0),r,o,a,i,s,c,l,u=[],f,d,p=0,h=rt(e.buttonsTheme?.backgroundColor??ka).join(", "),g=()=>{if(!a||!r||!d)return;let T=performance.now(),S=T-d;d=T,a.clearRect(0,0,r.width,r.height),a.fillStyle=`rgba(${h}, 0.2)`;for(let k=0;k<(r.width+Zr)/(Wr+Zr);k++){let I=k*(Wr+Zr)-p,$=r.height*(JI/100),O=(r.height-$)/2;a.beginPath(),a.roundRect(I,O,Wr,$,5),a.fill()}a.fillStyle=`rgba(${h}, 1)`;for(let k=0;k<u.length;k++){let I=r.width+(k+1)*(Wr+Zr)-p,$=r.height*((u[k]??0)/100),O=(r.height-$)/2;a.beginPath(),a.roundRect(I,O,Wr,$,5),a.fill()}p+=qI*(S/1e3),o=requestAnimationFrame(g)},y=async()=>{r&&(l=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(l),a||(a=r.getContext("2d")??void 0),f=setInterval(()=>{n(T=>T+=1)},1e3),i=new AudioContext,s=await e_(i),c=i.createMediaStreamSource(l),c.connect(s),s.connect(i.destination),s.port.onmessage=T=>{((r.width+Zr)/(Wr+Zr)+u.length)*(Wr+Zr)<r.width+p&&u.push(Math.min(Math.max(T.data,XI),QI))},d=performance.now(),o=requestAnimationFrame(g))},b=()=>{a&&r&&a.clearRect(0,0,r.width,r.height),p=0,s?.disconnect(),s=void 0,c?.disconnect(),c=void 0,i?.close(),i=void 0,l?.getTracks().forEach(T=>T.stop()),l=void 0,u=[],clearTimeout(f),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return xe(()=>{e.recordingStatus==="asking"?y():e.recordingStatus==="stopped"&&b()}),de(()=>{b()}),(()=>{var T=YI(),S=T.firstChild,k=S.nextSibling,I=k.firstChild,$=k.nextSibling;We(S,"click",b),x(S,m(An,{class:"w-4"}));var O=r;return typeof O=="function"?he(O,I):r=I,x($,()=>t_(t())),M(()=>U(T,ve("w-full gap-2 items-center transition-opacity px-2 agent-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),T})()},e_=async e=>{let t=new Blob([wv],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},t_=e=>{let t=Math.floor(e/60),r=(e%60).toString().padStart(2,"0");return`${t}:${r}`};var n_=C('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),r_=C("<div>"),o_=C("<div><div>"),Cv=e=>{let[t,n]=R(e.defaultValue??""),[r,o]=R([]),[a,i]=R(void 0),[s,c]=R(!1),[l,u]=R("stopped"),f,d,p=[],h=P=>n(P),g=()=>f?.value!==""&&f?.reportValidity(),y=async()=>{if(l()==="started"&&d){d.stop();return}if(g()){let P;r().length>0&&(i(void 0),P=(await Zo({apiHost:e.context.apiHost??Pt({ignoreChatApiUrl:!0}),files:r().map(w=>({file:w,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:w.name}})),onUploadProgress:i}))?.map((w,N)=>w?{...w,blobUrl:URL.createObjectURL(r()[N])}:null).filter(re)),e.onSubmit({type:"text",value:f?.value??t(),attachments:P})}else f?.focus()},b=P=>{e.block.options?.isLong||P.key==="Enter"&&y()},T=P=>{e.block.options?.isLong&&P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&y()};ie(()=>{!Y()&&f&&f.focus({preventScroll:!0}),window.addEventListener("message",S)}),de(()=>{window.removeEventListener("message",S)});let S=P=>{let{data:E}=P;E.isFromAgent&&E.command==="setInputValue"&&n(E.value)},k=P=>{P.preventDefault(),c(!0)},I=()=>c(!1),$=P=>{P.preventDefault(),P.stopPropagation(),P.dataTransfer?.files&&O(P.dataTransfer.files)},O=P=>{let E=Array.from(P).map(w=>Js({existingFiles:r(),newFile:w,params:{sizeLimit:gn("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE")},onError:({description:N,title:_})=>{gr.create({description:N,title:_})}})).filter(re);E.length!==0&&o(w=>[...E,...w])},Q=P=>{o(E=>E.filter((w,N)=>N!==P))},H=()=>{u("asking")},j=P=>{let E,w=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";d=new MediaRecorder(P,{mimeType:w}),d.ondataavailable=N=>{N.data.size!==0&&p.push(N.data)},d.onstart=()=>{E=Date.now()},d.onstop=async()=>{if(l()!=="started"||p.length===0)return;let N=Date.now()-E,_=await(0,Tv.fixWebmDuration)(new Blob(p,{type:w}),N),ee=new File([_],`rec-${e.block.id}-${Date.now()}.${w==="audio/webm"?"webm":"mp4"}`,{type:w});i(void 0);let me=(await Zo({apiHost:e.context.apiHost??Pt({ignoreChatApiUrl:!0}),files:[{file:ee,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:ee.name}}],onUploadProgress:i})).filter(re).map(ge=>ge.url);e.onSubmit({type:"recording",url:me[0],blobUrl:URL.createObjectURL(ee)})},d.start(),u("started")},L=()=>{d?.stop(),u("stopped"),d=void 0,p=[]};return(()=>{var P=o_(),E=P.firstChild;return P.addEventListener("dragleave",I),P.addEventListener("dragover",k),P.addEventListener("drop",$),P.$$keydown=b,x(E,m(Sv,{get recordingStatus(){return l()},get buttonsTheme(){return e.context.agent.theme.chat?.buttons},onRecordingConfirmed:j,onAbortRecording:L}),null),x(E,m(B,{get when(){return l()!=="started"},get children(){return[m(B,{get when(){return r().length},get children(){var w=n_();return w.style.setProperty("border-bottom-width","1px"),x(w,m(we,{get each(){return r()},children:(N,_)=>m(el,{file:N,get uploadProgressPercent(){return F(()=>!!a())()?F(()=>a()?.fileIndex===_())()?20:_()<(a()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>Q(_())})})),w}}),(()=>{var w=r_();return x(w,(()=>{var N=F(()=>!!e.block.options?.isLong);return()=>N()?m(U0,{ref(_){var ee=f;typeof ee=="function"?ee(_):f=_},onInput:h,onKeyDown:T,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Sl.labels.placeholder}}):m(br,{ref(_){var ee=f;typeof ee=="function"?ee(_):f=_},onInput:h,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Sl.labels.placeholder}})})(),null),x(w,m(B,{get when(){return(e.block.options?.attachments?.isEnabled??Sl.attachments.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return m(D0,{onNewFiles:O,get class(){return ve(e.block.options?.isLong?"ml-2":void 0)}})}}),null),M(()=>U(w,ve("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),w})()]}}),null),x(P,m(Me,{get children(){return[m(Z,{get when(){return!t()&&l()!=="started"&&e.block.options?.audioClip?.isEnabled},get children(){return m(cn,{class:"h-[56px] flex items-center","on:click":H,"aria-label":"Record voice",get children(){return m(B0,{class:"flex w-6 h-6"})}})}}),m(Z,{when:!0,get children(){return m(Ze,{type:"button","on:click":y,get isDisabled(){return!!a()},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),M(w=>{var N=ve("agent-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&l()!=="started"?"max-w-full":"max-w-[350px]"),_=ve("relative agent-input flex-col w-full",s()&&"filter brightness-95");return N!==w.e&&U(P,w.e=N),_!==w.t&&U(E,w.t=_),w},{e:void 0,t:void 0}),P})()};He(["keydown"]);var Ev={labels:{button:lt,placeholder:"Type a URL..."},retryMessageContent:"This URL doesn't seem to be valid. Can you type it again?"};var a_=C('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full">'),kv=e=>{let[t,n]=R(e.defaultValue??""),r,o=l=>{n(l)},a=()=>r?.value!==""&&r?.reportValidity(),i=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),a()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=l=>{l.key==="Enter"&&i()};ie(()=>{!Y()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",c)}),de(()=>{window.removeEventListener("message",c)});let c=l=>{let{data:u}=l;u.isFromAgent&&u.command==="setInputValue"&&n(u.value)};return(()=>{var l=a_(),u=l.firstChild;return l.$$keydown=s,x(u,m(br,{ref(f){var d=r;typeof d=="function"?d(f):r=f},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Ev.labels.placeholder},onInput:o,type:"url",autocomplete:"url"})),x(l,m(Ze,{type:"button",class:"h-[56px]","on:click":i,get children(){return e.block.options?.labels?.button}}),null),l})()};He(["keydown"]);var Av=e=>m(mr.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[m(mr.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),m(mr.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[m(mr.Content,{get children(){return e.children}}),m(mr.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return m(An,{class:"w-6 h-6"})}})]}})]}});var i_=C('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"stroke=currentColor stroke-width=2><path d="M23,5.0109 L23,2.5 C23,1.1193 24.1193,0 25.5,0 C26.8807,0 28,1.1193 28,2.5 L28,5"stroke-linecap=round stroke-linejoin=round></path><path d="M36.4505,45 L13.5495,45 C8.8473,45 5,41.1527 5,36.4505 L5,13.5495 C5,8.8473 8.8473,5 13.5495,5 L36.4505,5 C41.1527,5 45,8.8473 45,13.5495 L45,36.4505 C45,41.1527 41.1527,45 36.4505,45 Z"stroke-linecap=round stroke-linejoin=round></path><circle stroke-linecap=round stroke-linejoin=round cx=33.8346 cy=18.0022 r=2.8338></circle><circle stroke-linecap=round stroke-linejoin=round cx=16.3342 cy=18.0017 r=2.8338></circle><path d="M33.5,36.5 L16.5,36.5 C14.3,36.5 12.5,34.7 12.5,32.5 C12.5,30.3 14.3,28.5 16.5,28.5 L33.5,28.5 C35.7,28.5 37.5,30.3 37.5,32.5 C37.5,34.7 35.7,36.5 33.5,36.5 Z"></path><g stroke-linecap=round stroke-linejoin=round transform="translate(0.000000, 17.000000)"><path d="M2.5,13 C1.1193,13 0,11.8807 0,10.5 L0,2.5 C0,1.1193 1.1193,0 2.5,0 C3.8807,0 5,1.1193 5,2.5 L5,10.5 C5,11.8807 3.8807,13 2.5,13 Z"></path><path d="M47.5,13 C48.8807,13 50,11.8807 50,10.5 L50,2.5 C50,1.1193 48.8807,0 47.5,0 C46.1193,0 45,1.1193 45,2.5 L45,10.5 C45,11.8807 46.1193,13 47.5,13 Z"></path><line x1=17 y1=12 x2=17 y2=19></line><line x1=22 y1=12 x2=22 y2=19></line><line x1=27 y1=12 x2=27 y2=19></line><line x1=32 y1=12 x2=32 y2=19>'),Pv=({strokeColor:e})=>(()=>{var t=i_();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),M(()=>K(t,"class",Y()?"size-6":"size-10")),t})();var s_=C('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"><circle id=Oval stroke=currentColor stroke-width=2 cx=25 cy=25 r=25></circle><path d="M14.9350649,32.4675325 C16.9120779,35.9554545 20.6786364,38.3116883 25,38.3116883 C29.3213636,38.3116883 33.0879221,35.9554545 35.0649351,32.4675325"id=Path stroke=currentColor stroke-width=3 stroke-linecap=round></path><circle fill=currentColor fill-rule=nonzero cx=15.2597403 cy=16.5584416 r=2.92207792></circle><circle fill=currentColor fill-rule=nonzero cx=34.0909091 cy=16.5584416 r=2.92207792>'),Iv=({strokeColor:e})=>(()=>{var t=s_();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),M(()=>K(t,"class",Y()?"size-6":"size-10")),t})();var l_=C('<span class="text-4xl text-[40px]">'),c_=C('<img alt="Bot avatar"elementtiming="Bot avatar">'),u_=C('<figure><img alt="Bot avatar"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),d_=C('<div class="absolute left-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),f_=C('<div class="absolute right-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),p_=C("<div>"),Tl=e=>m(B,{get when(){return Pe(e.src)},keyed:!0,get fallback(){return(()=>{var t=p_();return x(t,m(B,{get when(){return e.isGuest},get children(){return[m(Iv,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Aa}}),(()=>{var n=d_();return n.style.setProperty("border-top","5px solid transparent"),n.style.setProperty("border-bottom","5px solid transparent"),M(r=>(r=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??Po}`)!=null?n.style.setProperty("border-right",r):n.style.removeProperty("border-right")),n})()]}}),null),x(t,m(B,{get when(){return!e.isGuest},get children(){return[m(Pv,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Aa}}),(()=>{var n=f_();return n.style.setProperty("border-top","5px solid transparent"),n.style.setProperty("border-bottom","5px solid transparent"),M(r=>(r=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??Po}`)!=null?n.style.setProperty("border-left",r):n.style.removeProperty("border-left")),n})()]}}),null),M(n=>{var r=`relative flex justify-center items-center rounded-full ${Y()?"w-6 h-6":"w-10 h-10"}
|
|
123
|
-
`,o=e.theme.chat?.hostBubbles?.backgroundColor??Po;return r!==n.e&&U(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background",o):t.style.removeProperty("background")),n},{e:void 0,t:void 0}),t})()},get children(){return m(Me,{get children(){return[m(Z,{get when(){return m_(e.src??"")},get children(){var t=l_();return x(t,()=>e.src),t}}),m(Z,{get when(){return en(e.src)},get children(){var t=c_();return M(n=>{var r=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(Y()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return r!==n.e&&K(t,"src",n.e=r),o!==n.t&&U(t,n.t=o),n},{e:void 0,t:void 0}),t}}),m(Z,{when:!0,get children(){var t=u_(),n=t.firstChild;return M(r=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(Y()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),a=e.src;return o!==r.e&&U(t,r.e=o),a!==r.t&&K(n,"src",r.t=a),r},{e:void 0,t:void 0}),t}})]}})}}),m_=e=>/^\p{Emoji}$/u.test(e);var g_=C('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),_v=C("<div>"),h_=C('<span class="px-[15px] py-[7px]">'),b_=C("<img alt=Attachment>"),y_=C('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col"data-testid=guest-bubble>'),v_=C("<img>"),x_=C('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap agent-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),Mv=e=>(()=>{var t=g_();return x(t,m(Me,{get children(){return[m(Z,{get when(){return e.answer?.type==="text"},get children(){return m(w_,{get answer(){return e.answer}})}}),m(Z,{get when(){return e.answer?.type==="recording"},get children(){return m(S_,{get answer(){return e.answer}})}})]}}),null),x(t,m(B,{get when(){return e.showAvatar},get children(){return m(Tl,{isGuest:!0,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),M(n=>(n=e.hasHostAvatar?Y()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",n):t.style.removeProperty("margin-left")),t})(),w_=e=>{let[t,n]=R();return(()=>{var r=y_(),o=r.firstChild;return x(r,m(B,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{var a=_v();return x(a,m(we,{get each(){return e.answer.attachments?.filter(i=>i.type.startsWith("image"))},children:(i,s)=>(()=>{var c=v_();return c.$$click=()=>n(i.blobUrl??i.url),M(l=>{var u=i.blobUrl??i.url,f=`Attached image ${s()+1}`,d=ve("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==l.e&&K(c,"src",l.e=u),f!==l.t&&K(c,"alt",l.t=f),d!==l.a&&U(c,l.a=d),l},{e:void 0,t:void 0,a:void 0}),c})()})),M(()=>U(a,ve("flex gap-1 overflow-auto max-w-[350px]",Y()?"flex-wrap justify-end":"items-center"))),a})(),(()=>{var a=_v();return x(a,m(we,{get each(){return e.answer.attachments?.filter(i=>!i.type.startsWith("image"))},children:i=>m(Qs,{get file(){return{name:i.url.split("/").at(-1)}}})})),M(()=>U(a,ve("flex gap-1 overflow-auto max-w-[350px]",Y()?"flex-wrap justify-end":"items-center"))),a})()]}}),o),x(o,m(B,{get when(){return Pe(e.answer.label??e.answer.value)},get children(){var a=h_();return x(a,()=>e.answer.label??e.answer.value),a}})),x(r,m(Av,{get isOpen(){return t()!==void 0},onClose:()=>n(void 0),get children(){var a=b_();return a.style.setProperty("border-radius","6px"),M(()=>K(a,"src",t())),a}}),null),r})()},S_=e=>(()=>{var t=x_(),n=t.firstChild,r=n.firstChild;return M(()=>K(r,"src",e.answer.blobUrl??e.answer.url)),t})();He(["click"]);var T_=C("<div>"),C_=C('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),Rv=e=>{let[t,n]=yn(R(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});ie(()=>{e.isOngoingLastChunk&&re(t())&&e.onSubmit(t())});let r=async a=>{n(a),e.onSubmit(a)},o=a=>{n({type:"text",value:a}),e.onSkip()};return xe(()=>{let a=Ys().findLast(i=>e.chunkIndex===i.inputIndex)?.formattedMessage;a&&e.block.type!=="file input"&&n(i=>i?.type==="text"?{...i,label:a}:i)}),m(Me,{get children(){return[m(Z,{get when(){return t()&&!e.hasError},get children(){return m(Mv,{get theme(){return e.theme},get answer(){return t()},get showAvatar(){return e.guestAvatar?.isEnabled??Pa},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(Z,{get when(){return Qe(t())||e.hasError},get children(){var a=C_(),i=e.ref;return typeof i=="function"?he(i,a):e.ref=a,x(a,m(B,{get when(){return e.hasHostAvatar},get children(){var s=T_();return M(()=>U(s,"flex flex-shrink-0 items-center "+(Y()?"w-6 h-6":"w-10 h-10"))),s}}),null),x(a,m(k_,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return F(()=>!!e.hasError)()?E_(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:r,onSkip:o}),null),M(()=>K(a,"data-blockid",e.block.id)),a}})]}})},E_=e=>{if(e)return e.type==="text"?e.value:e.url},k_=e=>{let t=o=>e.onSubmit(o),n=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),r=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??ol.labels.success});return m(Me,{get children(){return[m(Z,{get when(){return e.block.type==="text input"},get children(){return m(Cv,{get block(){return e.block},get defaultValue(){return n()},get context(){return e.context},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="number input"},get children(){return m(g0,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="email input"},get children(){return m(u0,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="url input"},get children(){return m(kv,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="phone number input"},get children(){return m(P0,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="date input"},get children(){return m(l0,{get options(){return e.block.options},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return A_(e.block)},keyed:!0,children:o=>m(Me,{get children(){return[m(Z,{get when(){return!o.options?.isMultipleChoice},get children(){return m(r0,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(Z,{get when(){return o.options?.isMultipleChoice},get children(){return m(i0,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(Z,{get when(){return P_(e.block)},keyed:!0,children:o=>m(Me,{get children(){return[m(Z,{get when(){return!o.options?.isMultipleChoice},get children(){return m(N0,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return o.options?.isMultipleChoice},get children(){return m(R0,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(Z,{get when(){return e.block.type==="rating input"},get children(){return m(O0,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(Z,{get when(){return e.block.type==="file input"},get children(){return m(f0,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(Z,{get when(){return e.block.type==="payment input"},get children(){return m(E0,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:r,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})},A_=e=>e?.type==="choice input"?e:void 0,P_=e=>e?.type==="image choice"?e:void 0;var I_=C('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),Nt=()=>I_();var Nv={isAutoplayEnabled:!0};var __=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),M_=400,R_=100,Yu,Ov=e=>{let t=!1,n,r,[o,a]=R(!!e.onTransitionEnd);return ie(()=>{Yu=setTimeout(()=>{t||(t=!0,a(!1),setTimeout(()=>e.onTransitionEnd?.(n),M_))},R_)}),de(()=>{Yu&&clearTimeout(Yu)}),(()=>{var i=__(),s=i.firstChild,c=s.firstChild,l=c.firstChild,u=l.nextSibling,f=n;typeof f=="function"?he(f,i):n=i,x(l,(()=>{var p=F(()=>!!o());return()=>p()&&m(Nt,{})})());var d=r;return typeof d=="function"?he(d,u):r=u,M(p=>{var h=ve("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=o()?"64px":"100%",y=o()?"32px":"100%",b=e.content?.url,T=e.onTransitionEnd?e.content?.isAutoplayEnabled??Nv.isAutoplayEnabled:!1,S="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),k=o()?Y()?"32px":"36px":"revert";return h!==p.e&&U(i,p.e=h),g!==p.t&&((p.t=g)!=null?l.style.setProperty("width",g):l.style.removeProperty("width")),y!==p.a&&((p.a=y)!=null?l.style.setProperty("height",y):l.style.removeProperty("height")),b!==p.o&&K(u,"src",p.o=b),T!==p.i&&(u.autoplay=p.i=T),S!==p.n&&U(u,p.n=S),k!==p.s&&((p.s=k)!=null?u.style.setProperty("height",k):u.style.removeProperty("height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i})()};var N_=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto">'),qu,O_=400,Lv=e=>{let t,[n,r]=R(!!e.onTransitionEnd),o;return ie(()=>{Xa({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&Xa({args:{...e.content.waitForEventFunction.args,continueFlow:a=>e.onCompleted(a?{type:"text",value:a}:void 0)},content:e.content.waitForEventFunction.content}),qu=setTimeout(()=>{r(!1),setTimeout(()=>e.onTransitionEnd?.(t),O_)},2e3)}),de(()=>{qu&&clearTimeout(qu)}),(()=>{var a=N_(),i=a.firstChild,s=i.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;typeof f=="function"?he(f,a):t=a,x(c,(()=>{var p=F(()=>!!n());return()=>p()&&m(Nt,{})})());var d=o;return typeof d=="function"?he(d,u):o=u,M(p=>{var h=ve("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=n()?"64px":"100%",y=n()?"32px":"100%",b=ve("p-2 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100"),T=n()?Y()?"32px":"36px":void 0,S=`calc(${dm()} - 100px)`;return h!==p.e&&U(a,p.e=h),g!==p.t&&((p.t=g)!=null?c.style.setProperty("width",g):c.style.removeProperty("width")),y!==p.a&&((p.a=y)!=null?c.style.setProperty("height",y):c.style.removeProperty("height")),b!==p.o&&U(l,p.o=b),T!==p.i&&((p.i=T)!=null?l.style.setProperty("height",T):l.style.removeProperty("height")),S!==p.n&&((p.n=S)!=null?u.style.setProperty("max-height",S):u.style.removeProperty("max-height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),a})()};var Dv={height:400};var L_=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full ">'),Ju,D_=400,Bv=e=>{let t,[n,r]=R(!!e.onTransitionEnd),o=a=>{e.content?.waitForEvent?.isEnabled&&Pe(a.data.name)&&a.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&a.data.data?{type:"text",value:a.data.data}:void 0),window.removeEventListener("message",o))};return ie(()=>{Ju=setTimeout(()=>{r(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t)},D_)},2e3)}),de(()=>{Ju&&clearTimeout(Ju),window.removeEventListener("message",o)}),(()=>{var a=L_(),i=a.firstChild,s=i.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;return typeof f=="function"?he(f,a):t=a,x(c,(()=>{var d=F(()=>!!n());return()=>d()&&m(Nt,{})})()),M(d=>{var p=ve("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=n()?"64px":"100%",g=n()?"32px":"100%",y=ve("p-4 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),b=n()?Y()?"32px":"36px":`${e.content?.height??Dv.height}px`,T=e.content?.url;return p!==d.e&&U(a,d.e=p),h!==d.t&&((d.t=h)!=null?c.style.setProperty("width",h):c.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),y!==d.o&&U(l,d.o=y),b!==d.i&&((d.i=b)!=null?l.style.setProperty("height",b):l.style.removeProperty("height")),T!==d.n&&K(u,"src",d.n=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),a})()};var Uv={clickLink:{alt:"Bubble image"}};var B_=C('<img elementtiming="Bubble image"fetchpriority=high>'),U_=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),F_=C("<a target=_blank rel=noreferrer>"),$_=C("<figure>"),G_=400,H_=5e3,Cl,Fv=e=>{let t,n,[r,o]=R(!!e.onTransitionEnd),a=()=>{r()&&(o(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},G_))};ie(()=>{n&&(Cl=setTimeout(a,H_),n.onload=()=>{clearTimeout(Cl),a()})}),de(()=>{Cl&&clearTimeout(Cl)});let i=(()=>{var s=B_(),c=n;return typeof c=="function"?he(c,s):n=s,s.style.setProperty("max-height","512px"),M(l=>{var u=e.content?.url,f=e.content?.clickLink?.alt??Uv.clickLink.alt,d=ve(r()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0),p=r()?"32px":"auto";return u!==l.e&&K(s,"src",l.e=u),f!==l.t&&K(s,"alt",l.t=f),d!==l.a&&U(s,l.a=d),p!==l.o&&((l.o=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return(()=>{var s=U_(),c=s.firstChild,l=c.firstChild,u=l.firstChild,f=t;return typeof f=="function"?he(f,s):t=s,x(u,(()=>{var d=F(()=>!!r());return()=>d()?m(Nt,{}):null})()),x(l,(()=>{var d=F(()=>!!e.content?.clickLink);return()=>d()?(()=>{var p=F_();return x(p,i),M(h=>{var g=e.content.clickLink.url,y=ve("z-10",r()?"h-8":"p-4");return g!==h.e&&K(p,"href",h.e=g),y!==h.t&&U(p,h.t=y),h},{e:void 0,t:void 0}),p})():(()=>{var p=$_();return x(p,i),M(()=>U(p,ve("z-10",!r()&&"p-4",r()?Y()?"h-8":"h-9":""))),p})()})(),null),M(d=>{var p=ve("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",g=r()?"32px":"100%";return p!==d.e&&U(s,d.e=p),h!==d.t&&((d.t=h)!=null?u.style.setProperty("width",h):u.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0}),s})()};var $v=({bubbleContent:e,typingSettings:t})=>{let n=e.match(/(\w+)/g)?.length??0;n===0&&(n=e.length);let{enabled:r,speed:o,maxDelay:a}={enabled:t?.enabled??st.typingEmulation.enabled,speed:t?.speed??st.typingEmulation.speed,maxDelay:t?.maxDelay??st.typingEmulation.maxDelay},s=r?n/o*6e4:0;return s>a*1e3&&(s=a*1e3),s};var Xu=e=>e.map(t=>t.text??Xu(t.children)).join("");var K_=C("<br>"),V_=C("<span>"),j_=(e,t,n)=>{let r="";return e&&(r+="slate-bold"),t&&(r+=" slate-italic"),n&&(r+=" slate-underline"),r},Gv=e=>(()=>{var t=V_();return x(t,()=>e.text,null),x(t,m(B,{get when(){return F(()=>!!e.isUniqueChild)()&&je(e.text)},get children(){return K_()}}),null),M(()=>U(t,j_(e.bold,e.italic,e.underline))),t})();var z_=C('<a target=_blank rel="noopener noreferrer">'),W_=C("<ol>"),Z_=C("<ul>"),Y_=C("<li>"),q_=C("<span>"),J_=C("<div>"),Yr=e=>m(Me,{get children(){return[m(Z,{get when(){return re(e.element.text)},get children(){return m(Gv,Ee(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),m(Z,{when:!0,get children(){return m(Me,{get children(){return[m(Z,{get when(){return e.element.type==="a"},get children(){var t=z_();return x(t,m(we,{get each(){return e.element.children},children:n=>m(Yr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),M(()=>K(t,"href",e.element.url)),t}}),m(Z,{get when(){return e.element.type==="ol"},get children(){var t=W_();return x(t,m(we,{get each(){return e.element.children},children:n=>m(Yr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{get when(){return e.element.type==="ul"},get children(){var t=Z_();return x(t,m(we,{get each(){return e.element.children},children:n=>m(Yr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{get when(){return e.element.type==="li"},get children(){var t=Y_();return x(t,m(we,{get each(){return e.element.children},children:n=>m(Yr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{when:!0,get children(){return m(X_,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return m(we,{get each(){return e.element.children},children:t=>m(Yr,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),X_=e=>m(Me,{get children(){return[m(Z,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=q_();return x(t,()=>e.children),M(()=>K(t,"data-element-type",e.element.type)),t}}),m(Z,{when:!0,get children(){var t=J_();return x(t,()=>e.children),M(()=>K(t,"data-element-type",e.element.type)),t}})]}});var Q_=C('<div><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),eM=400,Qu,Hv=e=>{let t,[n,r]=R(!!e.onTransitionEnd),o=()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},eM))};return ie(()=>{if(!n)return;let a=e.content?.richText?Xu(e.content.richText):"",i=e.typingEmulation?.enabled===!1||e.isTypingSkipped?0:$v({bubbleContent:a,typingSettings:e.typingEmulation});Qu=setTimeout(o,i)}),de(()=>{Qu&&clearTimeout(Qu)}),(()=>{var a=Q_(),i=a.firstChild,s=i.firstChild,c=s.firstChild,l=c.nextSibling,u=t;return typeof u=="function"?he(u,a):t=a,x(c,(()=>{var f=F(()=>!!n());return()=>f()&&m(Nt,{})})()),x(l,m(we,{get each(){return e.content?.richText},children:f=>m(Yr,{element:f})})),M(f=>{var d=ve("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=n()?"64px":"100%",h=n()?"32px":"100%",g=ve("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",n()?"opacity-0":"opacity-100"),y=n()?Y()?"16px":"20px":"100%";return d!==f.e&&U(a,f.e=d),p!==f.t&&((f.t=p)!=null?c.style.setProperty("width",p):c.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),g!==f.o&&U(l,f.o=g),y!==f.i&&((f.i=y)!=null?l.style.setProperty("height",y):l.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()};var ed=["youtube","vimeo","tiktok","gumlet"],qr={height:400,aspectRatio:"16/9",maxWidth:"100%",areControlsDisplayed:!0,isAutoplayEnabled:!0};var tM="https://www.youtube.com/embed";var nM="https://player.vimeo.com/video";var rM="https://www.tiktok.com/embed/v2";var oM="https://play.gumlet.io/embed";var Kv={vimeo:nM,youtube:tM,tiktok:rM,gumlet:oM};var aM=C("<video>"),iM=C('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),sM=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),lM=400,td,Vv=e=>{let t,[n,r]=R(!!e.onTransitionEnd);return ie(()=>{let o=e.content?.type&&ed.includes(e.content?.type)?2e3:100;td=setTimeout(()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},lM))},o)}),de(()=>{td&&clearTimeout(td)}),(()=>{var o=sM(),a=o.firstChild,i=a.firstChild,s=i.firstChild,c=t;return typeof c=="function"?he(c,o):t=o,x(s,(()=>{var l=F(()=>!!n());return()=>l()&&m(Nt,{})})()),x(i,m(Me,{get children(){return[m(Z,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var l=aM();return M(u=>{var f=e.onTransitionEnd?e.content?.isAutoplayEnabled??qr.isAutoplayEnabled:!1,d=e.content?.url,p=e.content?.areControlsDisplayed??qr.areControlsDisplayed,h="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(n()?"opacity-0":"opacity-100"),g=n()?Y()?"32px":"36px":"auto",y=e.content?.aspectRatio,b=e.content?.maxWidth??qr.maxWidth;return f!==u.e&&(l.autoplay=u.e=f),d!==u.t&&K(l,"src",u.t=d),p!==u.a&&(l.controls=u.a=p),h!==u.o&&U(l,u.o=h),g!==u.i&&((u.i=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),y!==u.n&&((u.n=y)!=null?l.style.setProperty("aspect-ratio",y):l.style.removeProperty("aspect-ratio")),b!==u.s&&((u.s=b)!=null?l.style.setProperty("max-width",b):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),l}}),m(Z,{get when(){return F(()=>!!e.content?.type)()&&ed.includes(e.content.type)},get children(){var l=iM(),u=l.firstChild;return M(f=>{var d=Lt("p-4 z-10 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),p=n()?Y()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??qr.height}px`,h=e.content?.aspectRatio,g=e.content?.maxWidth??qr.maxWidth,y=`${Kv[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?l.style.setProperty("height",p):l.style.removeProperty("height")),h!==f.a&&((f.a=h)!=null?l.style.setProperty("aspect-ratio",h):l.style.removeProperty("aspect-ratio")),g!==f.o&&((f.o=g)!=null?l.style.setProperty("max-width",g):l.style.removeProperty("max-width")),y!==f.i&&K(u,"src",f.i=y),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l}})]}}),null),M(l=>{var u=Lt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),f=n()?"64px":"100%",d=n()?"32px":"100%",p=e.content?.maxWidth??qr.maxWidth;return u!==l.e&&U(o,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("width",f):s.style.removeProperty("width")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("height",d):s.style.removeProperty("height")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("max-width",p):s.style.removeProperty("max-width")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var jv=e=>m(Me,{get children(){return[m(Z,{get when(){return e.message.type==="text"},get children(){return m(Hv,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="image"},get children(){return m(Fv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="video"},get children(){return m(Vv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="embed"},get children(){return m(Bv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="custom-embed"},get children(){return m(Lv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="audio"},get children(){return m(Ov,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var sd=Sr(zv(),1);function id(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Xr=id();function Jv(e){Xr=e}var Xv=/[&<>"']/,cM=new RegExp(Xv.source,"g"),Qv=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,uM=new RegExp(Qv.source,"g"),dM={"&":"&","<":"<",">":">",'"':""","'":"'"},Wv=e=>dM[e];function Ft(e,t){if(t){if(Xv.test(e))return e.replace(cM,Wv)}else if(Qv.test(e))return e.replace(uM,Wv);return e}var fM=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function pM(e){return e.replace(fM,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var mM=/(^|[^\[])\^/g;function Re(e,t){e=typeof e=="string"?e:e.source,t=t||"";let n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(mM,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function Zv(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var El={exec:()=>null};function Yv(e,t){let n=e.replace(/\|/g,(a,i,s)=>{let c=!1,l=i;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),r=n.split(/ \|/),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function od(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let a=e.charAt(r-o-1);if(a===t&&!n)o++;else if(a!==t&&n)o++;else break}return e.slice(0,r-o)}function gM(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function qv(e,t,n,r){let o=t.href,a=t.title?Ft(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;let s={type:"link",raw:n,href:o,title:a,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:o,title:a,text:Ft(i)}}function hM(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
|
|
124
|
-
`).map(o=>{let
|
|
125
|
-
`)}var
|
|
126
|
-
`)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let r=n[0],o=
|
|
127
|
-
`,1)[0].replace(/^\t+/,
|
|
106
|
+
`;var fP=S('<div><button class="p-0.5 rounded-full"aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[56px]"></div><div class="absolute right-gradient w-3 right-0 h-[56px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),Cr=3,_r=3,pP=60,mP=10,gP=5,hP=90,rx=e=>{let[t,n]=O(0),r,o,i,a,s,c,l,u=[],f,d,p=0,h=Ke(e.buttonsTheme?.backgroundColor??Qo).join(", "),g=()=>{if(!i||!r||!d)return;let T=performance.now(),C=T-d;d=T,i.clearRect(0,0,r.width,r.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let E=0;E<(r.width+_r)/(Cr+_r);E++){let I=E*(Cr+_r)-p,U=r.height*(mP/100),R=(r.height-U)/2;i.beginPath(),i.roundRect(I,R,Cr,U,5),i.fill()}i.fillStyle=`rgba(${h}, 1)`;for(let E=0;E<u.length;E++){let I=r.width+(E+1)*(Cr+_r)-p,U=r.height*((u[E]??0)/100),R=(r.height-U)/2;i.beginPath(),i.roundRect(I,R,Cr,U,5),i.fill()}p+=pP*(C/1e3),o=requestAnimationFrame(g)},v=async()=>{r&&(l=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(l),i||(i=r.getContext("2d")??void 0),f=setInterval(()=>{n(T=>T+=1)},1e3),a=new AudioContext,s=await bP(a),c=a.createMediaStreamSource(l),c.connect(s),s.connect(a.destination),s.port.onmessage=T=>{((r.width+_r)/(Cr+_r)+u.length)*(Cr+_r)<r.width+p&&u.push(Math.min(Math.max(T.data,gP),hP))},d=performance.now(),o=requestAnimationFrame(g))},y=()=>{i&&r&&i.clearRect(0,0,r.width,r.height),p=0,s?.disconnect(),s=void 0,c?.disconnect(),c=void 0,a?.close(),a=void 0,l?.getTracks().forEach(T=>T.stop()),l=void 0,u=[],clearTimeout(f),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return ge(()=>{e.recordingStatus==="asking"?v():e.recordingStatus==="stopped"&&y()}),se(()=>{y()}),(()=>{var T=fP(),C=T.firstChild,E=C.nextSibling,I=E.firstChild,U=E.nextSibling;Fe(C,"click",y),x(C,m(fn,{class:"w-4"}));var R=r;return typeof R=="function"?de(R,I):r=I,x(U,()=>yP(t())),A(()=>$(T,pe("w-full gap-2 items-center transition-opacity px-2 agent-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),T})()},bP=async e=>{let t=new Blob([nx],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},yP=e=>{let t=Math.floor(e/60),r=(e%60).toString().padStart(2,"0");return`${t}:${r}`};var xP=S('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),vP=S("<div>"),wP=S("<div><div>"),ix=e=>{let[t,n]=O(e.defaultValue??""),[r,o]=O([]),[i,a]=O(void 0),[s,c]=O(!1),[l,u]=O("stopped"),f,d,p=[],h=P=>n(P),g=()=>f?.value!==""&&f?.reportValidity(),v=async()=>{if(l()==="started"&&d){d.stop();return}if(g()){let P;r().length>0&&(a(void 0),P=(await To({apiHost:e.context.apiHost??bt({ignoreChatApiUrl:!0}),files:r().map(w=>({file:w,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:w.name}})),onUploadProgress:a}))?.map((w,M)=>w?{...w,blobUrl:URL.createObjectURL(r()[M])}:null).filter(re)),e.onSubmit({type:"text",value:f?.value??t(),attachments:P})}else f?.focus()},y=P=>{e.block.options?.isLong||P.key==="Enter"&&v()},T=P=>{e.block.options?.isLong&&P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&v()};ne(()=>{!K()&&f&&f.focus({preventScroll:!0}),window.addEventListener("message",C)}),se(()=>{window.removeEventListener("message",C)});let C=P=>{let{data:_}=P;_.isFromAgent&&_.command==="setInputValue"&&n(_.value)},E=P=>{P.preventDefault(),c(!0)},I=()=>c(!1),U=P=>{P.preventDefault(),P.stopPropagation(),P.dataTransfer?.files&&R(P.dataTransfer.files)},R=P=>{let _=Array.from(P).map(w=>hs({existingFiles:r(),newFile:w,params:{sizeLimit:Qt("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE")},onError:({description:M,title:D})=>{Kn.create({description:M,title:D})}})).filter(re);_.length!==0&&o(w=>[..._,...w])},oe=P=>{o(_=>_.filter((w,M)=>M!==P))},H=()=>{u("asking")},G=P=>{let _,w=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";d=new MediaRecorder(P,{mimeType:w}),d.ondataavailable=M=>{M.data.size!==0&&p.push(M.data)},d.onstart=()=>{_=Date.now()},d.onstop=async()=>{if(l()!=="started"||p.length===0)return;let M=Date.now()-_,D=await(0,ox.fixWebmDuration)(new Blob(p,{type:w}),M),J=new File([D],`rec-${e.block.id}-${Date.now()}.${w==="audio/webm"?"webm":"mp4"}`,{type:w});a(void 0);let ue=(await To({apiHost:e.context.apiHost??bt({ignoreChatApiUrl:!0}),files:[{file:J,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:J.name}}],onUploadProgress:a})).filter(re).map(le=>le.url);e.onSubmit({type:"recording",url:ue[0],blobUrl:URL.createObjectURL(J)})},d.start(),u("started")},L=()=>{d?.stop(),u("stopped"),d=void 0,p=[]};return(()=>{var P=wP(),_=P.firstChild;return P.addEventListener("dragleave",I),P.addEventListener("dragover",E),P.addEventListener("drop",U),P.$$keydown=y,x(_,m(rx,{get recordingStatus(){return l()},get buttonsTheme(){return e.context.agent.theme.chat?.buttons},onRecordingConfirmed:G,onAbortRecording:L}),null),x(_,m(N,{get when(){return l()!=="started"},get children(){return[m(N,{get when(){return r().length},get children(){var w=xP();return w.style.setProperty("border-bottom-width","1px"),x(w,m(he,{get each(){return r()},children:(M,D)=>m(xs,{file:M,get uploadProgressPercent(){return B(()=>!!i())()?B(()=>i()?.fileIndex===D())()?20:D()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>oe(D())})})),w}}),(()=>{var w=vP();return x(w,(()=>{var M=B(()=>!!e.block.options?.isLong);return()=>M()?m(xy,{ref(D){var J=f;typeof J=="function"?J(D):f=D},onInput:h,onKeyDown:T,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??js.labels.placeholder}}):m(Xn,{ref(D){var J=f;typeof J=="function"?J(D):f=D},onInput:h,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??js.labels.placeholder}})})(),null),x(w,m(N,{get when(){return(e.block.options?.attachments?.isEnabled??js.attachments.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return m(by,{onNewFiles:R,get class(){return pe(e.block.options?.isLong?"ml-2":void 0)}})}}),null),A(()=>$(w,pe("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),w})()]}}),null),x(P,m(Ee,{get children(){return[m(q,{get when(){return!t()&&l()!=="started"&&e.block.options?.audioClip?.isEnabled},get children(){return m(qt,{class:"h-[56px] flex items-center","on:click":H,"aria-label":"Record voice",get children(){return m(yy,{class:"flex w-6 h-6"})}})}}),m(q,{when:!0,get children(){return m(Ue,{type:"button","on:click":v,get isDisabled(){return!!i()},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),A(w=>{var M=pe("agent-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&l()!=="started"?"max-w-full":"max-w-[350px]"),D=pe("relative agent-input flex-col w-full",s()&&"filter brightness-95");return M!==w.e&&$(P,w.e=M),D!==w.t&&$(_,w.t=D),w},{e:void 0,t:void 0}),P})()};Me(["keydown"]);var ax={labels:{button:Qe,placeholder:"Type a URL..."},retryMessageContent:"This URL doesn't seem to be valid. Can you type it again?"};var SP=S('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full">'),sx=e=>{let[t,n]=O(e.defaultValue??""),r,o=l=>{n(l)},i=()=>r?.value!==""&&r?.reportValidity(),a=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),i()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=l=>{l.key==="Enter"&&a()};ne(()=>{!K()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",c)}),se(()=>{window.removeEventListener("message",c)});let c=l=>{let{data:u}=l;u.isFromAgent&&u.command==="setInputValue"&&n(u.value)};return(()=>{var l=SP(),u=l.firstChild;return l.$$keydown=s,x(u,m(Xn,{ref(f){var d=r;typeof d=="function"?d(f):r=f},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??ax.labels.placeholder},onInput:o,type:"url",autocomplete:"url"})),x(l,m(Ue,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),l})()};Me(["keydown"]);var lx=e=>m(qn.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[m(qn.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),m(qn.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[m(qn.Content,{get children(){return e.children}}),m(qn.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return m(fn,{class:"w-6 h-6"})}})]}})]}});var TP=S('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"stroke=currentColor stroke-width=2><path d="M23,5.0109 L23,2.5 C23,1.1193 24.1193,0 25.5,0 C26.8807,0 28,1.1193 28,2.5 L28,5"stroke-linecap=round stroke-linejoin=round></path><path d="M36.4505,45 L13.5495,45 C8.8473,45 5,41.1527 5,36.4505 L5,13.5495 C5,8.8473 8.8473,5 13.5495,5 L36.4505,5 C41.1527,5 45,8.8473 45,13.5495 L45,36.4505 C45,41.1527 41.1527,45 36.4505,45 Z"stroke-linecap=round stroke-linejoin=round></path><circle stroke-linecap=round stroke-linejoin=round cx=33.8346 cy=18.0022 r=2.8338></circle><circle stroke-linecap=round stroke-linejoin=round cx=16.3342 cy=18.0017 r=2.8338></circle><path d="M33.5,36.5 L16.5,36.5 C14.3,36.5 12.5,34.7 12.5,32.5 C12.5,30.3 14.3,28.5 16.5,28.5 L33.5,28.5 C35.7,28.5 37.5,30.3 37.5,32.5 C37.5,34.7 35.7,36.5 33.5,36.5 Z"></path><g stroke-linecap=round stroke-linejoin=round transform="translate(0.000000, 17.000000)"><path d="M2.5,13 C1.1193,13 0,11.8807 0,10.5 L0,2.5 C0,1.1193 1.1193,0 2.5,0 C3.8807,0 5,1.1193 5,2.5 L5,10.5 C5,11.8807 3.8807,13 2.5,13 Z"></path><path d="M47.5,13 C48.8807,13 50,11.8807 50,10.5 L50,2.5 C50,1.1193 48.8807,0 47.5,0 C46.1193,0 45,1.1193 45,2.5 L45,10.5 C45,11.8807 46.1193,13 47.5,13 Z"></path><line x1=17 y1=12 x2=17 y2=19></line><line x1=22 y1=12 x2=22 y2=19></line><line x1=27 y1=12 x2=27 y2=19></line><line x1=32 y1=12 x2=32 y2=19>'),cx=({strokeColor:e})=>(()=>{var t=TP();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),A(()=>j(t,"class",K()?"size-6":"size-10")),t})();var CP=S('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"><circle id=Oval stroke=currentColor stroke-width=2 cx=25 cy=25 r=25></circle><path d="M14.9350649,32.4675325 C16.9120779,35.9554545 20.6786364,38.3116883 25,38.3116883 C29.3213636,38.3116883 33.0879221,35.9554545 35.0649351,32.4675325"id=Path stroke=currentColor stroke-width=3 stroke-linecap=round></path><circle fill=currentColor fill-rule=nonzero cx=15.2597403 cy=16.5584416 r=2.92207792></circle><circle fill=currentColor fill-rule=nonzero cx=34.0909091 cy=16.5584416 r=2.92207792>'),ux=({strokeColor:e})=>(()=>{var t=CP();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),A(()=>j(t,"class",K()?"size-6":"size-10")),t})();var _P=S('<span class="text-4xl text-[40px]">'),kP=S('<img alt="Bot avatar"elementtiming="Bot avatar">'),EP=S('<figure><img alt="Bot avatar"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),PP=S('<div class="absolute left-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),IP=S('<div class="absolute right-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),AP=S("<div>"),Vs=e=>m(N,{get when(){return Ce(e.src)},keyed:!0,get fallback(){return(()=>{var t=AP();return x(t,m(N,{get when(){return e.isGuest},get children(){return[m(ux,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??ei}}),(()=>{var n=PP();return n.style.setProperty("border-top","5px solid transparent"),n.style.setProperty("border-bottom","5px solid transparent"),A(r=>(r=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??no}`)!=null?n.style.setProperty("border-right",r):n.style.removeProperty("border-right")),n})()]}}),null),x(t,m(N,{get when(){return!e.isGuest},get children(){return[m(cx,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??ei}}),(()=>{var n=IP();return n.style.setProperty("border-top","5px solid transparent"),n.style.setProperty("border-bottom","5px solid transparent"),A(r=>(r=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??no}`)!=null?n.style.setProperty("border-left",r):n.style.removeProperty("border-left")),n})()]}}),null),A(n=>{var r=`relative flex justify-center items-center rounded-full ${K()?"w-6 h-6":"w-10 h-10"}
|
|
107
|
+
`,o=e.theme.chat?.hostBubbles?.backgroundColor??no;return r!==n.e&&$(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background",o):t.style.removeProperty("background")),n},{e:void 0,t:void 0}),t})()},get children(){return m(Ee,{get children(){return[m(q,{get when(){return OP(e.src??"")},get children(){var t=_P();return x(t,()=>e.src),t}}),m(q,{get when(){return Ft(e.src)},get children(){var t=kP();return A(n=>{var r=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(K()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return r!==n.e&&j(t,"src",n.e=r),o!==n.t&&$(t,n.t=o),n},{e:void 0,t:void 0}),t}}),m(q,{when:!0,get children(){var t=EP(),n=t.firstChild;return A(r=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(K()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),i=e.src;return o!==r.e&&$(t,r.e=o),i!==r.t&&j(n,"src",r.t=i),r},{e:void 0,t:void 0}),t}})]}})}}),OP=e=>/^\p{Emoji}$/u.test(e);var RP=S('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),dx=S("<div>"),MP=S('<span class="px-[15px] py-[7px]">'),DP=S("<img alt=Attachment>"),LP=S('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col"data-testid=guest-bubble>'),NP=S("<img>"),$P=S('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap agent-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),fx=e=>(()=>{var t=RP();return x(t,m(Ee,{get children(){return[m(q,{get when(){return e.answer?.type==="text"},get children(){return m(BP,{get answer(){return e.answer}})}}),m(q,{get when(){return e.answer?.type==="recording"},get children(){return m(FP,{get answer(){return e.answer}})}})]}}),null),x(t,m(N,{get when(){return e.showAvatar},get children(){return m(Vs,{isGuest:!0,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),A(n=>(n=e.hasHostAvatar?K()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",n):t.style.removeProperty("margin-left")),t})(),BP=e=>{let[t,n]=O();return(()=>{var r=LP(),o=r.firstChild;return x(r,m(N,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{var i=dx();return x(i,m(he,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var c=NP();return c.$$click=()=>n(a.blobUrl??a.url),A(l=>{var u=a.blobUrl??a.url,f=`Attached image ${s()+1}`,d=pe("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==l.e&&j(c,"src",l.e=u),f!==l.t&&j(c,"alt",l.t=f),d!==l.a&&$(c,l.a=d),l},{e:void 0,t:void 0,a:void 0}),c})()})),A(()=>$(i,pe("flex gap-1 overflow-auto max-w-[350px]",K()?"flex-wrap justify-end":"items-center"))),i})(),(()=>{var i=dx();return x(i,m(he,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(ys,{get file(){return{name:a.url.split("/").at(-1)}}})})),A(()=>$(i,pe("flex gap-1 overflow-auto max-w-[350px]",K()?"flex-wrap justify-end":"items-center"))),i})()]}}),o),x(o,m(N,{get when(){return Ce(e.answer.label??e.answer.value)},get children(){var i=MP();return x(i,()=>e.answer.label??e.answer.value),i}})),x(r,m(lx,{get isOpen(){return t()!==void 0},onClose:()=>n(void 0),get children(){var i=DP();return i.style.setProperty("border-radius","6px"),A(()=>j(i,"src",t())),i}}),null),r})()},FP=e=>(()=>{var t=$P(),n=t.firstChild,r=n.firstChild;return A(()=>j(r,"src",e.answer.blobUrl??e.answer.url)),t})();Me(["click"]);var UP=S("<div>"),jP=S('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),px=e=>{let[t,n]=tn(O(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});ne(()=>{e.isOngoingLastChunk&&re(t())&&e.onSubmit(t())});let r=async i=>{n(i),e.onSubmit(i)},o=i=>{n({type:"text",value:i}),e.onSkip()};return ge(()=>{let i=ms().findLast(a=>e.chunkIndex===a.inputIndex)?.formattedMessage;i&&e.block.type!=="file input"&&n(a=>a?.type==="text"?{...a,label:i}:a)}),m(Ee,{get children(){return[m(q,{get when(){return t()&&!e.hasError},get children(){return m(fx,{get theme(){return e.theme},get answer(){return t()},get showAvatar(){return e.guestAvatar?.isEnabled??ti},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(q,{get when(){return Ge(t())||e.hasError},get children(){var i=jP(),a=e.ref;return typeof a=="function"?de(a,i):e.ref=i,x(i,m(N,{get when(){return e.hasHostAvatar},get children(){var s=UP();return A(()=>$(s,"flex flex-shrink-0 items-center "+(K()?"w-6 h-6":"w-10 h-10"))),s}}),null),x(i,m(HP,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return B(()=>!!e.hasError)()?VP(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:r,onSkip:o}),null),A(()=>j(i,"data-blockid",e.block.id)),i}})]}})},VP=e=>{if(e)return e.type==="text"?e.value:e.url},HP=e=>{let t=o=>e.onSubmit(o),n=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),r=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??Ts.labels.success});return m(Ee,{get children(){return[m(q,{get when(){return e.block.type==="text input"},get children(){return m(ix,{get block(){return e.block},get defaultValue(){return n()},get context(){return e.context},onSubmit:t})}}),m(q,{get when(){return e.block.type==="number input"},get children(){return m(Xb,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return e.block.type==="email input"},get children(){return m(Gb,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return e.block.type==="url input"},get children(){return m(sx,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return e.block.type==="phone number input"},get children(){return m(cy,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return e.block.type==="date input"},get children(){return m(Hb,{get options(){return e.block.options},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return zP(e.block)},keyed:!0,children:o=>m(Ee,{get children(){return[m(q,{get when(){return!o.options?.isMultipleChoice},get children(){return m(Bb,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(q,{get when(){return o.options?.isMultipleChoice},get children(){return m(jb,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(q,{get when(){return GP(e.block)},keyed:!0,children:o=>m(Ee,{get children(){return[m(q,{get when(){return!o.options?.isMultipleChoice},get children(){return m(my,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(q,{get when(){return o.options?.isMultipleChoice},get children(){return m(py,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(q,{get when(){return e.block.type==="rating input"},get children(){return m(gy,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),m(q,{get when(){return e.block.type==="file input"},get children(){return m(qb,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(q,{get when(){return e.block.type==="payment input"},get children(){return m(ay,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:r,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})},zP=e=>e?.type==="choice input"?e:void 0,GP=e=>e?.type==="image choice"?e:void 0;var WP=S('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),wt=()=>WP();var mx={isAutoplayEnabled:!0};var qP=S('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),KP=400,YP=100,eu,gx=e=>{let t=!1,n,r,[o,i]=O(!!e.onTransitionEnd);return ne(()=>{eu=setTimeout(()=>{t||(t=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(n),KP))},YP)}),se(()=>{eu&&clearTimeout(eu)}),(()=>{var a=qP(),s=a.firstChild,c=s.firstChild,l=c.firstChild,u=l.nextSibling,f=n;typeof f=="function"?de(f,a):n=a,x(l,(()=>{var p=B(()=>!!o());return()=>p()&&m(wt,{})})());var d=r;return typeof d=="function"?de(d,u):r=u,A(p=>{var h=pe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=o()?"64px":"100%",v=o()?"32px":"100%",y=e.content?.url,T=e.onTransitionEnd?e.content?.isAutoplayEnabled??mx.isAutoplayEnabled:!1,C="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),E=o()?K()?"32px":"36px":"revert";return h!==p.e&&$(a,p.e=h),g!==p.t&&((p.t=g)!=null?l.style.setProperty("width",g):l.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),y!==p.o&&j(u,"src",p.o=y),T!==p.i&&(u.autoplay=p.i=T),C!==p.n&&$(u,p.n=C),E!==p.s&&((p.s=E)!=null?u.style.setProperty("height",E):u.style.removeProperty("height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),a})()};var XP=S('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto">'),tu,ZP=400,hx=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o;return ne(()=>{_i({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&_i({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),tu=setTimeout(()=>{r(!1),setTimeout(()=>e.onTransitionEnd?.(t),ZP)},2e3)}),se(()=>{tu&&clearTimeout(tu)}),(()=>{var i=XP(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;typeof f=="function"?de(f,i):t=i,x(c,(()=>{var p=B(()=>!!n());return()=>p()&&m(wt,{})})());var d=o;return typeof d=="function"?de(d,u):o=u,A(p=>{var h=pe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=n()?"64px":"100%",v=n()?"32px":"100%",y=pe("p-2 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100"),T=n()?K()?"32px":"36px":void 0,C=`calc(${Wf()} - 100px)`;return h!==p.e&&$(i,p.e=h),g!==p.t&&((p.t=g)!=null?c.style.setProperty("width",g):c.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?c.style.setProperty("height",v):c.style.removeProperty("height")),y!==p.o&&$(l,p.o=y),T!==p.i&&((p.i=T)!=null?l.style.setProperty("height",T):l.style.removeProperty("height")),C!==p.n&&((p.n=C)!=null?u.style.setProperty("max-height",C):u.style.removeProperty("max-height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var bx={height:400};var JP=S('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full ">'),nu,QP=400,yx=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Ce(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",o))};return ne(()=>{nu=setTimeout(()=>{r(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t)},QP)},2e3)}),se(()=>{nu&&clearTimeout(nu),window.removeEventListener("message",o)}),(()=>{var i=JP(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;return typeof f=="function"?de(f,i):t=i,x(c,(()=>{var d=B(()=>!!n());return()=>d()&&m(wt,{})})()),A(d=>{var p=pe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=n()?"64px":"100%",g=n()?"32px":"100%",v=pe("p-4 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),y=n()?K()?"32px":"36px":`${e.content?.height??bx.height}px`,T=e.content?.url;return p!==d.e&&$(i,d.e=p),h!==d.t&&((d.t=h)!=null?c.style.setProperty("width",h):c.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),v!==d.o&&$(l,d.o=v),y!==d.i&&((d.i=y)!=null?l.style.setProperty("height",y):l.style.removeProperty("height")),T!==d.n&&j(u,"src",d.n=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var xx={clickLink:{alt:"Bubble image"}};var eI=S('<img elementtiming="Bubble image"fetchpriority=high>'),tI=S('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),nI=S("<a target=_blank rel=noreferrer>"),rI=S("<figure>"),oI=400,iI=5e3,Hs,vx=e=>{let t,n,[r,o]=O(!!e.onTransitionEnd),i=()=>{r()&&(o(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},oI))};ne(()=>{n&&(Hs=setTimeout(i,iI),n.onload=()=>{clearTimeout(Hs),i()})}),se(()=>{Hs&&clearTimeout(Hs)});let a=(()=>{var s=eI(),c=n;return typeof c=="function"?de(c,s):n=s,s.style.setProperty("max-height","512px"),A(l=>{var u=e.content?.url,f=e.content?.clickLink?.alt??xx.clickLink.alt,d=pe(r()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0),p=r()?"32px":"auto";return u!==l.e&&j(s,"src",l.e=u),f!==l.t&&j(s,"alt",l.t=f),d!==l.a&&$(s,l.a=d),p!==l.o&&((l.o=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return(()=>{var s=tI(),c=s.firstChild,l=c.firstChild,u=l.firstChild,f=t;return typeof f=="function"?de(f,s):t=s,x(u,(()=>{var d=B(()=>!!r());return()=>d()?m(wt,{}):null})()),x(l,(()=>{var d=B(()=>!!e.content?.clickLink);return()=>d()?(()=>{var p=nI();return x(p,a),A(h=>{var g=e.content.clickLink.url,v=pe("z-10",r()?"h-8":"p-4");return g!==h.e&&j(p,"href",h.e=g),v!==h.t&&$(p,h.t=v),h},{e:void 0,t:void 0}),p})():(()=>{var p=rI();return x(p,a),A(()=>$(p,pe("z-10",!r()&&"p-4",r()?K()?"h-8":"h-9":""))),p})()})(),null),A(d=>{var p=pe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",g=r()?"32px":"100%";return p!==d.e&&$(s,d.e=p),h!==d.t&&((d.t=h)!=null?u.style.setProperty("width",h):u.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0}),s})()};var wx=({bubbleContent:e,typingSettings:t})=>{let n=e.match(/(\w+)/g)?.length??0;n===0&&(n=e.length);let{enabled:r,speed:o,maxDelay:i}={enabled:t?.enabled??Je.typingEmulation.enabled,speed:t?.speed??Je.typingEmulation.speed,maxDelay:t?.maxDelay??Je.typingEmulation.maxDelay},s=r?n/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var ru=e=>e.map(t=>t.text??ru(t.children)).join("");var aI=S("<br>"),sI=S("<span>"),lI=(e,t,n)=>{let r="";return e&&(r+="slate-bold"),t&&(r+=" slate-italic"),n&&(r+=" slate-underline"),r},Sx=e=>(()=>{var t=sI();return x(t,()=>e.text,null),x(t,m(N,{get when(){return B(()=>!!e.isUniqueChild)()&&$e(e.text)},get children(){return aI()}}),null),A(()=>$(t,lI(e.bold,e.italic,e.underline))),t})();var cI=S('<a target=_blank rel="noopener noreferrer">'),uI=S("<ol>"),dI=S("<ul>"),fI=S("<li>"),pI=S("<span>"),mI=S("<div>"),kr=e=>m(Ee,{get children(){return[m(q,{get when(){return re(e.element.text)},get children(){return m(Sx,Se(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),m(q,{when:!0,get children(){return m(Ee,{get children(){return[m(q,{get when(){return e.element.type==="a"},get children(){var t=cI();return x(t,m(he,{get each(){return e.element.children},children:n=>m(kr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),A(()=>j(t,"href",e.element.url)),t}}),m(q,{get when(){return e.element.type==="ol"},get children(){var t=uI();return x(t,m(he,{get each(){return e.element.children},children:n=>m(kr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(q,{get when(){return e.element.type==="ul"},get children(){var t=dI();return x(t,m(he,{get each(){return e.element.children},children:n=>m(kr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(q,{get when(){return e.element.type==="li"},get children(){var t=fI();return x(t,m(he,{get each(){return e.element.children},children:n=>m(kr,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(q,{when:!0,get children(){return m(gI,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return m(he,{get each(){return e.element.children},children:t=>m(kr,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),gI=e=>m(Ee,{get children(){return[m(q,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=pI();return x(t,()=>e.children),A(()=>j(t,"data-element-type",e.element.type)),t}}),m(q,{when:!0,get children(){var t=mI();return x(t,()=>e.children),A(()=>j(t,"data-element-type",e.element.type)),t}})]}});var hI=S('<div><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),bI=400,ou,Tx=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o=()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},bI))};return ne(()=>{if(!n)return;let i=e.content?.richText?ru(e.content.richText):"",a=e.typingEmulation?.enabled===!1||e.isTypingSkipped?0:wx({bubbleContent:i,typingSettings:e.typingEmulation});ou=setTimeout(o,a)}),se(()=>{ou&&clearTimeout(ou)}),(()=>{var i=hI(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=t;return typeof u=="function"?de(u,i):t=i,x(c,(()=>{var f=B(()=>!!n());return()=>f()&&m(wt,{})})()),x(l,m(he,{get each(){return e.content?.richText},children:f=>m(kr,{element:f})})),A(f=>{var d=pe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=n()?"64px":"100%",h=n()?"32px":"100%",g=pe("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",n()?"opacity-0":"opacity-100"),v=n()?K()?"16px":"20px":"100%";return d!==f.e&&$(i,f.e=d),p!==f.t&&((f.t=p)!=null?c.style.setProperty("width",p):c.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),g!==f.o&&$(l,f.o=g),v!==f.i&&((f.i=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var iu=["youtube","vimeo","tiktok","gumlet"],Er={height:400,aspectRatio:"16/9",maxWidth:"100%",areControlsDisplayed:!0,isAutoplayEnabled:!0};var yI="https://www.youtube.com/embed";var xI="https://player.vimeo.com/video";var vI="https://www.tiktok.com/embed/v2";var wI="https://play.gumlet.io/embed";var Cx={vimeo:xI,youtube:yI,tiktok:vI,gumlet:wI};var SI=S("<video>"),TI=S('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),CI=S('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),_I=400,au,_x=e=>{let t,[n,r]=O(!!e.onTransitionEnd);return ne(()=>{let o=e.content?.type&&iu.includes(e.content?.type)?2e3:100;au=setTimeout(()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},_I))},o)}),se(()=>{au&&clearTimeout(au)}),(()=>{var o=CI(),i=o.firstChild,a=i.firstChild,s=a.firstChild,c=t;return typeof c=="function"?de(c,o):t=o,x(s,(()=>{var l=B(()=>!!n());return()=>l()&&m(wt,{})})()),x(a,m(Ee,{get children(){return[m(q,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var l=SI();return A(u=>{var f=e.onTransitionEnd?e.content?.isAutoplayEnabled??Er.isAutoplayEnabled:!1,d=e.content?.url,p=e.content?.areControlsDisplayed??Er.areControlsDisplayed,h="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(n()?"opacity-0":"opacity-100"),g=n()?K()?"32px":"36px":"auto",v=e.content?.aspectRatio,y=e.content?.maxWidth??Er.maxWidth;return f!==u.e&&(l.autoplay=u.e=f),d!==u.t&&j(l,"src",u.t=d),p!==u.a&&(l.controls=u.a=p),h!==u.o&&$(l,u.o=h),g!==u.i&&((u.i=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),v!==u.n&&((u.n=v)!=null?l.style.setProperty("aspect-ratio",v):l.style.removeProperty("aspect-ratio")),y!==u.s&&((u.s=y)!=null?l.style.setProperty("max-width",y):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),l}}),m(q,{get when(){return B(()=>!!e.content?.type)()&&iu.includes(e.content.type)},get children(){var l=TI(),u=l.firstChild;return A(f=>{var d=Pt("p-4 z-10 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),p=n()?K()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??Er.height}px`,h=e.content?.aspectRatio,g=e.content?.maxWidth??Er.maxWidth,v=`${Cx[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return d!==f.e&&$(l,f.e=d),p!==f.t&&((f.t=p)!=null?l.style.setProperty("height",p):l.style.removeProperty("height")),h!==f.a&&((f.a=h)!=null?l.style.setProperty("aspect-ratio",h):l.style.removeProperty("aspect-ratio")),g!==f.o&&((f.o=g)!=null?l.style.setProperty("max-width",g):l.style.removeProperty("max-width")),v!==f.i&&j(u,"src",f.i=v),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l}})]}}),null),A(l=>{var u=Pt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),f=n()?"64px":"100%",d=n()?"32px":"100%",p=e.content?.maxWidth??Er.maxWidth;return u!==l.e&&$(o,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("width",f):s.style.removeProperty("width")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("height",d):s.style.removeProperty("height")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("max-width",p):s.style.removeProperty("max-width")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var kx=e=>m(Ee,{get children(){return[m(q,{get when(){return e.message.type==="text"},get children(){return m(Tx,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(q,{get when(){return e.message.type==="image"},get children(){return m(vx,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(q,{get when(){return e.message.type==="video"},get children(){return m(_x,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(q,{get when(){return e.message.type==="embed"},get children(){return m(yx,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(q,{get when(){return e.message.type==="custom-embed"},get children(){return m(hx,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(q,{get when(){return e.message.type==="audio"},get children(){return m(gx,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var fu=Fr(Ex(),1);function du(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ir=du();function Rx(e){Ir=e}var Mx=/[&<>"']/,kI=new RegExp(Mx.source,"g"),Dx=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,EI=new RegExp(Dx.source,"g"),PI={"&":"&","<":"<",">":">",'"':""","'":"'"},Px=e=>PI[e];function _t(e,t){if(t){if(Mx.test(e))return e.replace(kI,Px)}else if(Dx.test(e))return e.replace(EI,Px);return e}var II=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function AI(e){return e.replace(II,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var OI=/(^|[^\[])\^/g;function Pe(e,t){e=typeof e=="string"?e:e.source,t=t||"";let n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(OI,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function Ix(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var zs={exec:()=>null};function Ax(e,t){let n=e.replace(/\|/g,(i,a,s)=>{let c=!1,l=a;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),r=n.split(/ \|/),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function cu(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function RI(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function Ox(e,t,n,r){let o=t.href,i=t.title?_t(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;let s={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:o,title:i,text:_t(a)}}function MI(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
|
|
108
|
+
`).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
|
|
109
|
+
`)}var Eo=class{options;rules;lexer;constructor(t){this.options=t||Ir}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:cu(r,`
|
|
110
|
+
`)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let r=n[0],o=MI(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){let o=cu(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let r=n[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;let i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim(),o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");let a=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),s="",c="",l=!1;for(;t;){let u=!1;if(!(n=a.exec(t))||this.rules.block.hr.test(t))break;s=n[0],t=t.substring(s.length);let f=n[2].split(`
|
|
111
|
+
`,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),d=t.split(`
|
|
128
112
|
`,1)[0],p=0;this.options.pedantic?(p=2,c=f.trimStart()):(p=n[2].search(/[^ ]/),p=p>4?1:p,c=f.slice(p),p+=n[1].length);let h=!1;if(!f&&/^ *$/.test(d)&&(s+=d+`
|
|
129
|
-
`,t=t.substring(d.length+1),u=!0),!u){let
|
|
130
|
-
`,1)[0];if(d=I,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),
|
|
131
|
-
`+d.slice(p);else{if(h||f.search(/[^ ]/)>=4||
|
|
113
|
+
`,t=t.substring(d.length+1),u=!0),!u){let y=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),T=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),C=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){let I=t.split(`
|
|
114
|
+
`,1)[0];if(d=I,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),C.test(d)||E.test(d)||y.test(d)||T.test(t))break;if(d.search(/[^ ]/)>=p||!d.trim())c+=`
|
|
115
|
+
`+d.slice(p);else{if(h||f.search(/[^ ]/)>=4||C.test(f)||E.test(f)||T.test(f))break;c+=`
|
|
132
116
|
`+d}!h&&!d.trim()&&(h=!0),s+=I+`
|
|
133
|
-
`,t=t.substring(I.length+1),f=d.slice(p)}}
|
|
134
|
-
`):[]};if(r.header.length===r.align.length){let o=r.align.length,a,
|
|
135
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:
|
|
136
|
-
]`).replace("lheading",
|
|
137
|
-
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,c,l)=>c+" ".repeat(l.length));let r,o,a
|
|
117
|
+
`,t=t.substring(I.length+1),f=d.slice(p)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let g=null,v;this.options.gfm&&(g=/^\[[ xX]\] /.exec(c),g&&(v=g[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!g,checked:v,loose:!1,text:c,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){let f=i.items[u].tokens.filter(p=>p.type==="space"),d=f.length>0&&f.some(p=>/\n.*\n/.test(p.raw));i.loose=d}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);if(n){let r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){let n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;let r={type:"table",raw:n[0],header:Ax(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
118
|
+
`):[]};if(r.header.length===r.align.length){let o=r.align.length,i,a,s,c;for(i=0;i<o;i++){let l=r.align[i];l&&(/^ *-+: *$/.test(l)?r.align[i]="right":/^ *:-+: *$/.test(l)?r.align[i]="center":/^ *:-+ *$/.test(l)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=Ax(r.rows[i],r.header.length).map(l=>({text:l,tokens:[]}));for(o=r.header.length,a=0;a<o;a++)r.header[a].tokens=this.lexer.inline(r.header[a].text);for(o=r.rows.length,a=0;a<o;a++)for(c=r.rows[a],s=0;s<c.length;s++)c[s].tokens=this.lexer.inline(c[s].text);return r}}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
119
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:_t(n[1])}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let a=cu(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=RI(n[2],"()");if(a>-1){let c=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,c).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),Ox(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Ox(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let a=[...o[0]].length-1,s,c,l=a,u=0,f=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o[0].length-1);(o=f.exec(n))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(c=[...s].length,o[3]||o[4]){l+=c;continue}else if((o[5]||o[6])&&a%3&&!((a+c)%3)){u+=c;continue}if(l-=c,l>0)continue;c=Math.min(c,c+l+u);let d=[...t].slice(0,a+o.index+c+1).join("");if(Math.min(a,c)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," "),o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=_t(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){let n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=_t(n[1]),o="mailto:"+r):(r=_t(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=_t(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=_t(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=_t(n[0]),{type:"text",raw:n[0],text:r}}}},te={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:zs,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;te.def=Pe(te.def).replace("label",te._label).replace("title",te._title).getRegex();te.bullet=/(?:[*+-]|\d{1,9}[.)])/;te.listItemStart=Pe(/^( *)(bull) */).replace("bull",te.bullet).getRegex();te.list=Pe(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex();te._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";te._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;te.html=Pe(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();te.lheading=Pe(te.lheading).replace(/bull/g,te.bullet).getRegex();te.paragraph=Pe(te._paragraph).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",te._tag).getRegex();te.blockquote=Pe(te.blockquote).replace("paragraph",te.paragraph).getRegex();te.normal={...te};te.gfm={...te.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};te.gfm.table=Pe(te.gfm.table).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",te._tag).getRegex();te.gfm.paragraph=Pe(te._paragraph).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",te.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",te._tag).getRegex();te.pedantic={...te.normal,html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pe(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
|
|
120
|
+
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:zs,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:zs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};z._punctuation="\\p{P}$+<=>`^|~";z.punctuation=Pe(z.punctuation,"u").replace(/punctuation/g,z._punctuation).getRegex();z.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;z.anyPunctuation=/\\[punct]/g;z._escapes=/\\([punct])/g;z._comment=Pe(te._comment).replace("(?:-->|$)","-->").getRegex();z.emStrong.lDelim=Pe(z.emStrong.lDelim,"u").replace(/punct/g,z._punctuation).getRegex();z.emStrong.rDelimAst=Pe(z.emStrong.rDelimAst,"gu").replace(/punct/g,z._punctuation).getRegex();z.emStrong.rDelimUnd=Pe(z.emStrong.rDelimUnd,"gu").replace(/punct/g,z._punctuation).getRegex();z.anyPunctuation=Pe(z.anyPunctuation,"gu").replace(/punct/g,z._punctuation).getRegex();z._escapes=Pe(z._escapes,"gu").replace(/punct/g,z._punctuation).getRegex();z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;z.autolink=Pe(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex();z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;z.tag=Pe(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex();z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;z.link=Pe(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex();z.reflink=Pe(z.reflink).replace("label",z._label).replace("ref",te._label).getRegex();z.nolink=Pe(z.nolink).replace("ref",te._label).getRegex();z.reflinkSearch=Pe(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex();z.normal={...z};z.pedantic={...z.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()};z.gfm={...z.normal,escape:Pe(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};z.gfm.url=Pe(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex();z.breaks={...z.gfm,br:Pe(z.br).replace("{2,}","*").getRegex(),text:Pe(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var An=class e{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ir,this.options.tokenizer=this.options.tokenizer||new Eo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:te.normal,inline:z.normal};this.options.pedantic?(n.block=te.pedantic,n.inline=z.pedantic):this.options.gfm&&(n.block=te.gfm,this.options.breaks?n.inline=z.breaks:n.inline=z.gfm),this.tokenizer.rules=n}static get rules(){return{block:te,inline:z}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
121
|
+
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,c,l)=>c+" ".repeat(l.length));let r,o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
138
122
|
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
139
123
|
`+r.raw,o.text+=`
|
|
140
124
|
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
141
125
|
`+r.raw,o.text+=`
|
|
142
|
-
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(
|
|
126
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,c=t.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},c),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],a&&o.type==="paragraph"?(o.raw+=`
|
|
143
127
|
`+r.raw,o.text+=`
|
|
144
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),i
|
|
128
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),a=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
|
|
145
129
|
`+r.raw,o.text+=`
|
|
146
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,a
|
|
147
|
-
`,o?'<pre><code class="language-'+
|
|
148
|
-
`:"<pre><code>"+(r?t:
|
|
130
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,a=t,s,c,l;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,a,l)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,f=t.slice(1),d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(l=r.raw.slice(-1)),c=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},Po=class{options;constructor(t){this.options=t||Ir}code(t,n,r){let o=(n||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
|
|
131
|
+
`,o?'<pre><code class="language-'+_t(o)+'">'+(r?t:_t(t,!0))+`</code></pre>
|
|
132
|
+
`:"<pre><code>"+(r?t:_t(t,!0))+`</code></pre>
|
|
149
133
|
`}blockquote(t){return`<blockquote>
|
|
150
134
|
${t}</blockquote>
|
|
151
135
|
`}html(t,n){return t}heading(t,n,r){return`<h${n}>${t}</h${n}>
|
|
152
136
|
`}hr(){return`<hr>
|
|
153
|
-
`}list(t,n,r){let o=n?"ol":"ul",
|
|
137
|
+
`}list(t,n,r){let o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
|
|
154
138
|
`+t+"</"+o+`>
|
|
155
139
|
`}listitem(t,n,r){return`<li>${t}</li>
|
|
156
140
|
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
|
|
@@ -161,11 +145,11 @@ ${t}</blockquote>
|
|
|
161
145
|
`}tablerow(t){return`<tr>
|
|
162
146
|
${t}</tr>
|
|
163
147
|
`}tablecell(t,n){let r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
|
|
164
|
-
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){let o=
|
|
165
|
-
`+(
|
|
166
|
-
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+
|
|
148
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){let o=Ix(t);if(o===null)return r;t=o;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){let o=Ix(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return t}},qi=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}},On=class e{options;renderer;textRenderer;constructor(t){this.options=t||Ir,this.options.renderer=this.options.renderer||new Po,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qi}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=s||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{let a=i;r+=this.renderer.heading(this.parseInline(a.tokens),a.depth,AI(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{let a=i;r+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{let a=i,s="",c="";for(let u=0;u<a.header.length;u++)c+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:!0,align:a.align[u]});s+=this.renderer.tablerow(c);let l="";for(let u=0;u<a.rows.length;u++){let f=a.rows[u];c="";for(let d=0;d<f.length;d++)c+=this.renderer.tablecell(this.parseInline(f[d].tokens),{header:!1,align:a.align[d]});l+=this.renderer.tablerow(c)}r+=this.renderer.table(s,l);continue}case"blockquote":{let a=i,s=this.parse(a.tokens);r+=this.renderer.blockquote(s);continue}case"list":{let a=i,s=a.ordered,c=a.start,l=a.loose,u="";for(let f=0;f<a.items.length;f++){let d=a.items[f],p=d.checked,h=d.task,g="";if(d.task){let v=this.renderer.checkbox(!!p);l?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=v+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=v+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:v+" "}):g+=v+" "}g+=this.parse(d.tokens,l),u+=this.renderer.listitem(g,h,!!p)}r+=this.renderer.list(u,s,c);continue}case"html":{let a=i;r+=this.renderer.html(a.text,a.block);continue}case"paragraph":{let a=i;r+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=i,s=a.tokens?this.parseInline(a.tokens):a.text;for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],s+=`
|
|
149
|
+
`+(a.tokens?this.parseInline(a.tokens):a.text);r+=n?this.renderer.paragraph(s):s;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=a||"";continue}}switch(i.type){case"escape":{let a=i;r+=n.text(a.text);break}case"html":{let a=i;r+=n.html(a.text);break}case"link":{let a=i;r+=n.link(a.href,a.title,this.parseInline(a.tokens,n));break}case"image":{let a=i;r+=n.image(a.href,a.title,a.text);break}case"strong":{let a=i;r+=n.strong(this.parseInline(a.tokens,n));break}case"em":{let a=i;r+=n.em(this.parseInline(a.tokens,n));break}case"codespan":{let a=i;r+=n.codespan(a.text);break}case"br":{r+=n.br();break}case"del":{let a=i;r+=n.del(this.parseInline(a.tokens,n));break}case"text":{let a=i;r+=n.text(a.text);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ko=class{options;constructor(t){this.options=t||Ir}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},uu=class{defaults=du();options=this.setOptions;parse=this.#e(An.lex,On.parse);parseInline=this.#e(An.lexInline,On.parseInline);Parser=On;parser=On.parse;Renderer=Po;TextRenderer=qi;Lexer=An;lexer=An.lex;Tokenizer=Eo;Hooks=ko;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let i=o;for(let a of i.header)r=r.concat(this.walkTokens(a.tokens,n));for(let a of i.rows)for(let s of a)r=r.concat(this.walkTokens(s.tokens,n));break}case"list":{let i=o;r=r.concat(this.walkTokens(i.items,n));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{r=r.concat(this.walkTokens(i[a],n))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=n.renderers[i.name];a?n.renderers[i.name]=function(...s){let c=i.renderer.apply(this,s);return c===!1&&(c=a.apply(this,s)),c}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=n[i.level];a?a.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){let i=this.defaults.renderer||new Po(this.defaults);for(let a in r.renderer){let s=r.renderer[a],c=a,l=i[c];i[c]=(...u)=>{let f=s.apply(i,u);return f===!1&&(f=l.apply(i,u)),f||""}}o.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Eo(this.defaults);for(let a in r.tokenizer){let s=r.tokenizer[a],c=a,l=i[c];i[c]=(...u)=>{let f=s.apply(i,u);return f===!1&&(f=l.apply(i,u)),f}}o.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new ko;for(let a in r.hooks){let s=r.hooks[a],c=a,l=i[c];ko.passThroughHooks.has(a)?i[c]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(d=>l.call(i,d));let f=s.call(i,u);return l.call(i,f)}:i[c]=(...u)=>{let f=s.apply(i,u);return f===!1&&(f=l.apply(i,u)),f}}o.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;o.walkTokens=function(s){let c=[];return c.push(a.call(this,s)),i&&(c=c.concat(i.call(this,s))),c}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}#e(t,n){return(r,o)=>{let i={...o},a={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);let s=this.#t(!!a.silent,!!a.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(c=>t(c,a)).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>n(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let c=t(r,a);a.walkTokens&&this.walkTokens(c,a.walkTokens);let l=n(c,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(c){return s(c)}}}#t(t,n){return r=>{if(r.message+=`
|
|
150
|
+
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+_t(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}},Pr=new uu;function _e(e,t){return Pr.parse(e,t)}_e.options=_e.setOptions=function(e){return Pr.setOptions(e),_e.defaults=Pr.defaults,Rx(_e.defaults),_e};_e.getDefaults=du;_e.defaults=Ir;_e.use=function(...e){return Pr.use(...e),_e.defaults=Pr.defaults,Rx(_e.defaults),_e};_e.walkTokens=function(e,t){return Pr.walkTokens(e,t)};_e.parseInline=Pr.parseInline;_e.Parser=On;_e.parser=On.parse;_e.Renderer=Po;_e.TextRenderer=qi;_e.Lexer=An;_e.lexer=An.lex;_e.Tokenizer=Eo;_e.Hooks=ko;_e.parse=_e;var A9=_e.options,O9=_e.setOptions,R9=_e.use,M9=_e.walkTokens,D9=_e.parseInline;var L9=On.parse,N9=An.lex;var DI=S('<div class="flex flex-col animate-fade-in agent-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),LI=S("<span>"),Lx=e=>{let[t,n]=tn(O([]),{key:`agent-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return _e.use({renderer:{link:(r,o,i)=>`<a href="${r}" target="_blank" rel="noopener noreferrer">${i}</a>`}}),ge(()=>{if(Ac()?.id!==e.streamingMessageId)return[];n(Ac()?.content.split("```").flatMap((r,o)=>o%2===0?r.split(`
|
|
167
151
|
|
|
168
|
-
`).map(a=>sd.default.sanitize(Ie.parse(a.replace(/【.+】/g,"").replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})):[sd.default.sanitize(Ie.parse("```"+r+"```".replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})]).filter(Pe)??[])}),(()=>{var r=bM(),o=r.firstChild,a=o.firstChild,i=a.firstChild,s=i.nextSibling;return i.style.setProperty("width","100%"),i.style.setProperty("height","100%"),x(s,m(we,{get each(){return t()},children:c=>(()=>{var l=yM();return l.innerHTML=c,l})()})),r})()};var vM=C("<div><div>"),wi=e=>{let t,[n,r]=R(0),o=new ResizeObserver(a=>r(a[0].target.clientHeight-(Y()?24:40)));return ie(()=>{t&&o.observe(t)}),de(()=>{t&&o.unobserve(t)}),(()=>{var a=vM(),i=a.firstChild,s=t;return typeof s=="function"?he(s,a):t=a,x(i,m(Tl,{get theme(){return e.theme},get src(){return e.avatarSrc}})),M(c=>{var l="flex flex-shrink-0 items-center relative agent-avatar-container "+(Y()?"w-6":"w-10"),u="absolute flex items-center top-0"+(Y()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),f=`${n()}px`,d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return l!==c.e&&U(a,c.e=l),u!==c.t&&U(i,c.t=u),f!==c.a&&((c.a=f)!=null?i.style.setProperty("top",f):i.style.removeProperty("top")),d!==c.o&&((c.o=d)!=null?i.style.setProperty("transition",d):i.style.removeProperty("transition")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()};var tx=C('<div><div class="flex flex-col flex-1 gap-2">'),xM=C('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),nx=e=>{let t,[n,r]=R(e.isTransitionDisabled?e.messages.length:0),[o,a]=R();ie(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))});let i=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??st.typingEmulation.delayBetweenBubbles)>0&&n()<e.messages.length-1&&await new Promise(l=>setTimeout(l,(e.settings.typingEmulation?.delayBetweenBubbles??st.typingEmulation.delayBetweenBubbles)*1e3));let c=e.messages[n()].id;await e.onNewBubbleDisplayed(c),r(n()===e.messages.length?n():n()+1),e.onScrollToBottom(s),n()===e.messages.length&&(a(s),e.onAllBubblesDisplayed())};return(()=>{var s=xM();return x(s,m(B,{get when(){return e.messages.length>0},get children(){var c=tx(),l=c.firstChild;return x(c,m(B,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??Io)&&e.messages.length>0},get children(){return m(wi,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),l),x(l,m(we,{get each(){return e.messages.slice(0,n()+1)},children:(u,f)=>m(jv,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return F(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??st.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&f()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:i},get onCompleted(){return e.onSubmit}})})),M(u=>{var f="flex"+(Y()?" gap-1":" gap-2"),d=e.theme.chat?.guestAvatar?.isEnabled??Pa?Y()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return f!==u.e&&U(c,u.e=f),d!==u.t&&((u.t=d)!=null?l.style.setProperty("max-width",d):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0}),c}}),null),x(s,(()=>{var c=F(()=>!!(e.input&&n()===e.messages.length));return()=>c()&&m(Rv,{get theme(){return e.theme},ref(l){var u=t;typeof u=="function"?u(l):t=l},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??Io},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??st.general.isInputPrefillEnabled},get isOngoingLastChunk(){return e.isOngoingLastChunk},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})})(),null),x(s,m(B,{get when(){return e.streamingMessageId},keyed:!0,children:c=>(()=>{var l=tx(),u=l.firstChild;return x(l,m(B,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Io},get children(){return m(wi,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),u),x(u,m(ex,{streamingMessageId:c,get context(){return e.context}})),M(f=>{var d="flex"+(Y()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??Pa?Y()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),f},{e:void 0,t:void 0}),l})()}),null),s})()};var wM=C('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),rx=()=>(()=>{var e=wM(),t=e.firstChild,n=t.firstChild,r=n.firstChild;return r.style.setProperty("width","64px"),r.style.setProperty("height","32px"),x(r,m(Nt,{})),e})();var SM=C('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),ox=e=>(()=>{var t=SM(),n=t.firstChild,r=n.firstChild;return x(r,m(B,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Io},get children(){return m(wi,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),x(r,m(rx,{}),null),t})();var TM=C('<div class="w-full max-w-xs p-4 text-gray-500 bg-white shadow flex flex-col gap-2 agent-popup-blocked-toast"role=alert><div class="flex flex-col gap-1"><span class=" text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal">The agent wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div><a target=_blank class="py-1 px-4 justify-center text-sm font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 filter hover:brightness-90 active:brightness-75 agent-button"rel=noreferrer>Continue in new tab'),ax=e=>(()=>{var t=TM(),n=t.firstChild,r=n.nextSibling;return r.$$click=()=>e.onLinkClick(),M(()=>K(r,"href",e.url)),t})();He(["click"]);var CM=C('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),EM=C('<div class="flex justify-end">'),kM=C('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),AM=.6,PM=50,IM=(e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}),ix=e=>{let t,[n,r]=yn(R([{input:e.initialChatReply.input,messages:e.initialChatReply.messages}]),{key:`agent-${e.context.agent.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{setTimeout(()=>{t?.scrollTo(0,t.scrollHeight)},200)}}),[o,a]=yn(R(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[i,s]=yn(R(!1),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[c,l]=R(e.initialChatReply.dynamicTheme),[u,f]=R(e.initialChatReply.agent.theme),[d,p]=R(!1),[h,g]=R(),[y,b]=R(!1);ie(()=>{(async()=>{if(n().length>1)T();else{let P=o()?.filter(E=>Qe(E.lastBubbleBlockId));await H(P)}})()});let T=()=>{[...n()].pop()?.streamingMessageId&&r(P=>P.slice(0,-1));let L=ld({clientSideActions:o(),lastBubbleBlockId:void 0});a(P=>P.slice(L.length))},S=({id:L,message:P})=>{p(!1);let E=[...n()].pop();E&&(E.streamingMessageId!==L&&r(w=>[...w,{messages:[],streamingMessageId:L}]),ku({id:L,content:P}))};xe(()=>{f(IM(e.initialChatReply.agent.theme,c()))});let k=async L=>{L&&(e.onNewLogs?.(L),!e.context.isPreview&&await bu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:L}))},I=async L=>{b(!1);let P=[...n()].pop()?.input;P?.id&&e.onAnswer&&L&&e.onAnswer({message:n0(L),blockId:P.id});let E=setTimeout(()=>{p(!0)},1e3);$();let{data:w,error:N}=await Py({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:MM(L)});if(clearTimeout(E),p(!1),N){b(!0);let _=[{description:"Failed to send the reply",details:N instanceof bn?{status:N.response.status,body:await N.response.json()}:N,status:"error"}];await bu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:_}),e.onNewLogs?.(_);return}if(w){if(w.progress&&e.onProgressUpdate?.(w.progress),w.lastMessageNewFormat&&Cu([...Ys(),{inputIndex:[...n()].length-1,formattedMessage:w.lastMessageNewFormat}]),w.logs&&e.onNewLogs?.(w.logs),w.dynamicTheme&&l(w.dynamicTheme),w.input&&e.onNewInputBlock&&e.onNewInputBlock(w.input),w.clientSideActions){a(w.clientSideActions);let _=ld({clientSideActions:w.clientSideActions,lastBubbleBlockId:void 0});if(await H(_),w.clientSideActions.length===1&&w.clientSideActions[0].type==="stream"&&w.messages.length===0&&w.input===void 0)return}r(_=>[..._,{input:w.input,messages:w.messages}])}},$=(L,P=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*AM||setTimeout(()=>{t?.scrollTo({top:L?L.offsetTop-P:t.scrollHeight,behavior:"smooth"})},PM)},O=async()=>{let L=[...n()].pop();L&&Qe(L.input)&&(s(!0),e.onEnd?.())},Q=async L=>{let P=ld({clientSideActions:o(),lastBubbleBlockId:L});await H(P)},H=async L=>{for(let P of L){("streamOpenAiChatCompletion"in P||"webhookToExecute"in P||"stream"in P)&&p(!0);let E=await t0({clientSideAction:P,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:S});if(a(w=>w.slice(1)),E&&"logs"in E&&k(E.logs),E&&"replyToSend"in E){p(!1),I(E.replyToSend?{type:"text",value:E.replyToSend}:void 0);return}E&&"blockedPopupUrl"in E&&g(E.blockedPopupUrl),E&&"scriptCallbackMessage"in E&&e.onScriptExecutionSuccess?.(E.scriptCallbackMessage)}};de(()=>{ku(void 0),Cu([])});let j=()=>I(void 0);return(()=>{var L=CM(),P=t;return typeof P=="function"?he(P,L):t=L,x(L,m(we,{get each(){return n()},children:(E,w)=>m(nx,{get index(){return w()},get messages(){return E.messages},get input(){return E.input},get theme(){return u()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return E.streamingMessageId},get context(){return e.context},get hideAvatar(){return F(()=>!E.input)()&&((n()[w()+1]?.messages??[]).length>0||n()[w()+1]?.streamingMessageId!==void 0||E.messages.length>0&&d())},get hasError(){return F(()=>!!y())()&&w()===n().length-1},get isTransitionDisabled(){return w()!==n().length-1},get isOngoingLastChunk(){return F(()=>!i())()&&w()===n().length-1},onNewBubbleDisplayed:Q,onAllBubblesDisplayed:O,onSubmit:I,onScrollToBottom:$,onSkip:j})}),null),x(L,m(B,{get when(){return d()},get children(){return m(ox,{get theme(){return u()}})}}),null),x(L,m(B,{get when(){return h()},keyed:!0,children:E=>(()=>{var w=EM();return x(w,m(ax,{url:E,onLinkClick:()=>g(void 0)})),w})()}),null),x(L,m(_M,{}),null),L})()},_M=()=>kM(),MM=e=>{if(e){if(e.type==="text")return{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return{type:"audio",url:e.url}}},ld=({clientSideActions:e,lastBubbleBlockId:t})=>{let n=[],r=t;for(let o of e){if(r!==o.lastBubbleBlockId)break;r=o.lastBubbleBlockId,t===o.lastBubbleBlockId&&n.push(o)}return n};var RM=C('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),sx=e=>(()=>{var t=RM(),n=t.firstChild,r=n.nextSibling;return x(n,()=>e.error.message),x(r,()=>JSON.stringify(e.error.cause,null,2)),t})();var NM=C('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),lx=e=>{let t,n,r=o=>{o.forEach(a=>{a.removedNodes.forEach(i=>{"id"in i&&t&&i.id==="brand-mark"&&e.agentContainer?.append(t)})})};return ie(()=>{!document||!e.agentContainer||(n=new MutationObserver(r),n.observe(e.agentContainer,{subtree:!1,childList:!0}))}),de(()=>{n&&n.disconnect()}),(()=>{var o=NM(),a=o.firstChild,i=t;return typeof i=="function"?he(i,o):t=o,x(a,()=>e.text),M(()=>K(o,"href",e.url)),o})()};var OM=C("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),cd=e=>(()=>{var t=OM(),n=t.firstChild;return M(r=>(r=`${e.value}%`)!=null?n.style.setProperty("width",r):n.style.removeProperty("width")),t})();var cx=C("<style>"),LM=C("<div>"),ea=e=>{let[t,n]=R(),[r,o]=R(""),[a,i]=R(!1),[s,c]=R();console.log({props:e});let l=async()=>{e.font&&Mc(e.font),i(!0);let u=new URLSearchParams(location.search);e.onInit?.();let f={};u.forEach((b,T)=>{f[T]=b});let d=typeof e.agent=="string"?e.agent:void 0,p=typeof e.agent!="string"||(e.isPreview??!1),h=Um(d),{data:g,error:y}=await um({stripeRedirectStatus:u.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:p,resultId:Pe(e.resultId)?e.resultId:h,prefilledVariables:{...f,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(y instanceof bn)return p?c(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):y.response.status===400||y.response.status===403?c(new Error("This agent is now closed.")):y.response.status===404?c(new Error("The agent you're looking for doesn't exist.")):c(new Error(`Something went wrong while starting the chat! (${y.response.statusText}) Please try again.`));if(y instanceof po)return c(new Error(y.message));if(!g)return y&&(console.error(y),p)?c(new Error("Error! Could not reach server. Check your connection.",{cause:y})):c(new Error("Error! Could not reach server. Check your connection."));if(g.resultId&&d&&(g.agent.settings.general?.rememberUser?.isEnabled??st.general.rememberUser.isEnabled)){h&&h!==g.resultId&&ps(g.agent.id);let b=g.agent.settings.general?.rememberUser?.storage??st.general.rememberUser.storage;Fm(b)(d,g.resultId);let T=$m(g.agent.id);T&&T.agent.publishedAt&&g.agent.publishedAt?new Date(T.agent.publishedAt).getTime()===new Date(g.agent.publishedAt).getTime()?n(T):(ps(g.agent.id),n(g),Lc(g,{agentId:g.agent.id,storage:b})):(n(g),Lc(g,{agentId:g.agent.id,storage:b})),e.onChatStatePersisted?.(!0)}else{if(ps(g.agent.id),n(g),g.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(g.input),g.logs){let b=g.logs.map(T=>({status:T.status??"",description:T.description??"",details:T.details}));e.onNewLogs?.(b)}e.onChatStatePersisted?.(!1)}o(g.agent.theme.customCss??"")};return xe(()=>{Qe(e.agent)||a()||l().then()}),xe(()=>{Qe(e.agent)||typeof e.agent=="string"||(o(e.agent.theme.customCss??""),e.agent.theme.general?.progressBar?.isEnabled&&t()&&!t()?.agent.theme.general?.progressBar?.isEnabled&&(i(!1),l().then()))}),de(()=>{i(!1)}),[(()=>{var u=cx();return x(u,r),u})(),(()=>{var u=cx();return x(u,Ay),u})(),m(B,{get when(){return s()},keyed:!0,children:u=>m(sx,{error:u})}),m(B,{get when(){return t()},keyed:!0,children:u=>m(DM,{get class(){return e.class},get initialChatReply(){return{...u,agent:{...u.agent,settings:typeof e.agent=="string"?u.agent?.settings:e.agent?.settings,theme:typeof e.agent=="string"?u.agent?.theme:e.agent?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:typeof e.agent!="string"||(e.isPreview??!1),resultId:u.resultId,sessionId:u.sessionId,agent:u.agent,storage:u.agent.settings.general?.rememberUser?.isEnabled&&!(typeof e.agent!="string"||(e.isPreview??!1))?u.agent.settings.general?.rememberUser?.storage??st.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},DM=e=>{let[t,n]=yn(R(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),r,o=new ResizeObserver(a=>_m((a[0]?.target.clientWidth??0)<432));return ie(()=>{r&&(pm(r),o.observe(r),fm(`${r.clientHeight}px`))}),xe(()=>{Mc(e.initialChatReply.agent.theme.general?.font??{type:mm,family:ko}),r&&Bm(e.initialChatReply.agent.theme,r,e.context.isPreview)}),de(()=>{r&&o.unobserve(r)}),(()=>{var a=LM(),i=r;return typeof i=="function"?he(i,a):r=a,x(a,m(B,{get when(){return re(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(B,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??is)==="fixed"},get fallback(){return m(cd,{get value(){return t()}})},get children(){return m(gf,{get mount(){return e.progressBarRef},get children(){return m(cd,{get value(){return t()}})}})}})}}),null),x(a,m(ix,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),x(a,m(B,{get when(){return e.initialChatReply.agent.settings.general?.isBrandingEnabled},get children(){return m(lx,{agentContainer:r,get url(){return e.initialChatReply.agent.settings.general?.brandingUrl??"https://release0.com/?utm_source=brand-mark"},get text(){return e.initialChatReply.agent.settings.general?.brandingText??"Powered by Release0"}})}}),null),x(a,m(du,{toaster:gr,children:s=>m(Fr.Root,{get children(){return[m(Fr.Title,{get children(){return s().title}}),m(Fr.Description,{get children(){return s().description}}),m(Fr.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m(An,{class:"w-4 h-4"})}})]}})}),null),M(()=>U(a,ve("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),a})()};var kl="Zendesk Web Widget Opened";var Qr=`*, ::before, ::after {
|
|
152
|
+
`).map(i=>fu.default.sanitize(_e.parse(i.replace(/【.+】/g,"").replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})):[fu.default.sanitize(_e.parse("```"+r+"```".replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})]).filter(Ce)??[])}),(()=>{var r=DI(),o=r.firstChild,i=o.firstChild,a=i.firstChild,s=a.nextSibling;return a.style.setProperty("width","100%"),a.style.setProperty("height","100%"),x(s,m(he,{get each(){return t()},children:c=>(()=>{var l=LI();return l.innerHTML=c,l})()})),r})()};var NI=S("<div><div>"),Ki=e=>{let t,[n,r]=O(0),o=new ResizeObserver(i=>r(i[0].target.clientHeight-(K()?24:40)));return ne(()=>{t&&o.observe(t)}),se(()=>{t&&o.unobserve(t)}),(()=>{var i=NI(),a=i.firstChild,s=t;return typeof s=="function"?de(s,i):t=i,x(a,m(Vs,{get theme(){return e.theme},get src(){return e.avatarSrc}})),A(c=>{var l="flex flex-shrink-0 items-center relative agent-avatar-container "+(K()?"w-6":"w-10"),u="absolute flex items-center top-0"+(K()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),f=`${n()}px`,d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return l!==c.e&&$(i,c.e=l),u!==c.t&&$(a,c.t=u),f!==c.a&&((c.a=f)!=null?a.style.setProperty("top",f):a.style.removeProperty("top")),d!==c.o&&((c.o=d)!=null?a.style.setProperty("transition",d):a.style.removeProperty("transition")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Nx=S('<div><div class="flex flex-col flex-1 gap-2">'),$I=S('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),$x=e=>{let t,[n,r]=O(e.isTransitionDisabled?e.messages.length:0),[o,i]=O();ne(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??Je.typingEmulation.delayBetweenBubbles)>0&&n()<e.messages.length-1&&await new Promise(l=>setTimeout(l,(e.settings.typingEmulation?.delayBetweenBubbles??Je.typingEmulation.delayBetweenBubbles)*1e3));let c=e.messages[n()].id;await e.onNewBubbleDisplayed(c),r(n()===e.messages.length?n():n()+1),e.onScrollToBottom(s),n()===e.messages.length&&(i(s),e.onAllBubblesDisplayed())};return(()=>{var s=$I();return x(s,m(N,{get when(){return e.messages.length>0},get children(){var c=Nx(),l=c.firstChild;return x(c,m(N,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??ro)&&e.messages.length>0},get children(){return m(Ki,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),l),x(l,m(he,{get each(){return e.messages.slice(0,n()+1)},children:(u,f)=>m(kx,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return B(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??Je.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&f()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),A(u=>{var f="flex"+(K()?" gap-1":" gap-2"),d=e.theme.chat?.guestAvatar?.isEnabled??ti?K()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return f!==u.e&&$(c,u.e=f),d!==u.t&&((u.t=d)!=null?l.style.setProperty("max-width",d):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0}),c}}),null),x(s,(()=>{var c=B(()=>!!(e.input&&n()===e.messages.length));return()=>c()&&m(px,{get theme(){return e.theme},ref(l){var u=t;typeof u=="function"?u(l):t=l},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??ro},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??Je.general.isInputPrefillEnabled},get isOngoingLastChunk(){return e.isOngoingLastChunk},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})})(),null),x(s,m(N,{get when(){return e.streamingMessageId},keyed:!0,children:c=>(()=>{var l=Nx(),u=l.firstChild;return x(l,m(N,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??ro},get children(){return m(Ki,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),u),x(u,m(Lx,{streamingMessageId:c,get context(){return e.context}})),A(f=>{var d="flex"+(K()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??ti?K()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==f.e&&$(l,f.e=d),p!==f.t&&((f.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),f},{e:void 0,t:void 0}),l})()}),null),s})()};var BI=S('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),Bx=()=>(()=>{var e=BI(),t=e.firstChild,n=t.firstChild,r=n.firstChild;return r.style.setProperty("width","64px"),r.style.setProperty("height","32px"),x(r,m(wt,{})),e})();var FI=S('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),Fx=e=>(()=>{var t=FI(),n=t.firstChild,r=n.firstChild;return x(r,m(N,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??ro},get children(){return m(Ki,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),x(r,m(Bx,{}),null),t})();var UI=S('<div class="w-full max-w-xs p-4 text-gray-500 bg-white shadow flex flex-col gap-2 agent-popup-blocked-toast"role=alert><div class="flex flex-col gap-1"><span class=" text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal">The agent wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div><a target=_blank class="py-1 px-4 justify-center text-sm font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 filter hover:brightness-90 active:brightness-75 agent-button"rel=noreferrer>Continue in new tab'),Ux=e=>(()=>{var t=UI(),n=t.firstChild,r=n.nextSibling;return r.$$click=()=>e.onLinkClick(),A(()=>j(r,"href",e.url)),t})();Me(["click"]);var jI=S('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),VI=S('<div class="flex justify-end">'),HI=S('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),zI=.6,GI=50,WI=(e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}),jx=e=>{let t,[n,r]=tn(O([{input:e.initialChatReply.input,messages:e.initialChatReply.messages}]),{key:`agent-${e.context.agent.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{setTimeout(()=>{t?.scrollTo(0,t.scrollHeight)},200)}}),[o,i]=tn(O(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[a,s]=tn(O(!1),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[c,l]=O(e.initialChatReply.dynamicTheme),[u,f]=O(e.initialChatReply.agent.theme),[d,p]=O(!1),[h,g]=O(),[v,y]=O(!1);ne(()=>{(async()=>{if(n().length>1)T();else{let P=o()?.filter(_=>Ge(_.lastBubbleBlockId));await H(P)}})()});let T=()=>{[...n()].pop()?.streamingMessageId&&r(P=>P.slice(0,-1));let L=pu({clientSideActions:o(),lastBubbleBlockId:void 0});i(P=>P.slice(L.length))},C=({id:L,message:P})=>{p(!1);let _=[...n()].pop();_&&(_.streamingMessageId!==L&&r(w=>[...w,{messages:[],streamingMessageId:L}]),Oc({id:L,content:P}))};ge(()=>{f(WI(e.initialChatReply.agent.theme,c()))});let E=async L=>{L&&(e.onNewLogs?.(L),!e.context.isPreview&&await Sc({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:L}))},I=async L=>{y(!1);let P=[...n()].pop()?.input;P?.id&&e.onAnswer&&L&&e.onAnswer({message:$b(L),blockId:P.id});let _=setTimeout(()=>{p(!0)},1e3);U();let{data:w,error:M}=await cb({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:KI(L)});if(clearTimeout(_),p(!1),M){y(!0);let D=[{description:"Failed to send the reply",details:M instanceof en?{status:M.response.status,body:await M.response.json()}:M,status:"error"}];await Sc({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:D}),e.onNewLogs?.(D);return}if(w){if(w.progress&&e.onProgressUpdate?.(w.progress),w.lastMessageNewFormat&&Ic([...ms(),{inputIndex:[...n()].length-1,formattedMessage:w.lastMessageNewFormat}]),w.logs&&e.onNewLogs?.(w.logs),w.dynamicTheme&&l(w.dynamicTheme),w.input&&e.onNewInputBlock&&e.onNewInputBlock(w.input),w.clientSideActions){i(w.clientSideActions);let D=pu({clientSideActions:w.clientSideActions,lastBubbleBlockId:void 0});if(await H(D),w.clientSideActions.length===1&&w.clientSideActions[0].type==="stream"&&w.messages.length===0&&w.input===void 0)return}r(D=>[...D,{input:w.input,messages:w.messages}])}},U=(L,P=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*zI||setTimeout(()=>{t?.scrollTo({top:L?L.offsetTop-P:t.scrollHeight,behavior:"smooth"})},GI)},R=async()=>{let L=[...n()].pop();L&&Ge(L.input)&&(s(!0),e.onEnd?.())},oe=async L=>{let P=pu({clientSideActions:o(),lastBubbleBlockId:L});await H(P)},H=async L=>{for(let P of L){("streamOpenAiChatCompletion"in P||"webhookToExecute"in P||"stream"in P)&&p(!0);let _=await Nb({clientSideAction:P,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:C});if(i(w=>w.slice(1)),_&&"logs"in _&&E(_.logs),_&&"replyToSend"in _){p(!1),I(_.replyToSend?{type:"text",value:_.replyToSend}:void 0);return}_&&"blockedPopupUrl"in _&&g(_.blockedPopupUrl),_&&"scriptCallbackMessage"in _&&e.onScriptExecutionSuccess?.(_.scriptCallbackMessage)}};se(()=>{Oc(void 0),Ic([])});let G=()=>I(void 0);return(()=>{var L=jI(),P=t;return typeof P=="function"?de(P,L):t=L,x(L,m(he,{get each(){return n()},children:(_,w)=>m($x,{get index(){return w()},get messages(){return _.messages},get input(){return _.input},get theme(){return u()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return _.streamingMessageId},get context(){return e.context},get hideAvatar(){return B(()=>!_.input)()&&((n()[w()+1]?.messages??[]).length>0||n()[w()+1]?.streamingMessageId!==void 0||_.messages.length>0&&d())},get hasError(){return B(()=>!!v())()&&w()===n().length-1},get isTransitionDisabled(){return w()!==n().length-1},get isOngoingLastChunk(){return B(()=>!a())()&&w()===n().length-1},onNewBubbleDisplayed:oe,onAllBubblesDisplayed:R,onSubmit:I,onScrollToBottom:U,onSkip:G})}),null),x(L,m(N,{get when(){return d()},get children(){return m(Fx,{get theme(){return u()}})}}),null),x(L,m(N,{get when(){return h()},keyed:!0,children:_=>(()=>{var w=VI();return x(w,m(Ux,{url:_,onLinkClick:()=>g(void 0)})),w})()}),null),x(L,m(qI,{}),null),L})()},qI=()=>HI(),KI=e=>{if(e){if(e.type==="text")return{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return{type:"audio",url:e.url}}},pu=({clientSideActions:e,lastBubbleBlockId:t})=>{let n=[],r=t;for(let o of e){if(r!==o.lastBubbleBlockId)break;r=o.lastBubbleBlockId,t===o.lastBubbleBlockId&&n.push(o)}return n};var YI=S('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Vx=e=>(()=>{var t=YI(),n=t.firstChild,r=n.nextSibling;return x(n,()=>e.error.message),x(r,()=>JSON.stringify(e.error.cause,null,2)),t})();var XI=S('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),Hx=e=>{let t,n,r=o=>{o.forEach(i=>{i.removedNodes.forEach(a=>{"id"in a&&t&&a.id==="brand-mark"&&e.agentContainer?.append(t)})})};return ne(()=>{!document||!e.agentContainer||(n=new MutationObserver(r),n.observe(e.agentContainer,{subtree:!1,childList:!0}))}),se(()=>{n&&n.disconnect()}),(()=>{var o=XI(),i=o.firstChild,a=t;return typeof a=="function"?de(a,o):t=o,x(i,()=>e.text),A(()=>j(o,"href",e.url)),o})()};var ZI=S("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),mu=e=>(()=>{var t=ZI(),n=t.firstChild;return A(r=>(r=`${e.value}%`)!=null?n.style.setProperty("width",r):n.style.removeProperty("width")),t})();var zx=S("<style>"),JI=S("<div>"),Io=e=>{let[t,n]=O(),[r,o]=O(""),[i,a]=O(!1),[s,c]=O(),l=async()=>{e.font&&Nl(e.font),a(!0);let u=new URLSearchParams(location.search);e.onInit?.();let f={};u.forEach((y,T)=>{f[T]=y});let d=typeof e.agent=="string"?e.agent:void 0,p=typeof e.agent!="string"||(e.isPreview??!1),h=xp(d),{data:g,error:v}=await Gf({stripeRedirectStatus:u.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:p,resultId:Ce(e.resultId)?e.resultId:h,prefilledVariables:{...f,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(v instanceof en)return p?c(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):v.response.status===400||v.response.status===403?c(new Error("This agent is now closed.")):v.response.status===404?c(new Error("The agent you're looking for doesn't exist.")):c(new Error(`Something went wrong while starting the chat! (${v.response.statusText}) Please try again.`));if(v instanceof Gr)return c(new Error(v.message));if(!g)return v&&(console.error(v),p)?c(new Error("Error! Could not reach server. Check your connection.",{cause:v})):c(new Error("Error! Could not reach server. Check your connection."));if(g.resultId&&d&&(g.agent.settings.general?.rememberUser?.isEnabled??Je.general.rememberUser.isEnabled)){h&&h!==g.resultId&&Ra(g.agent.id);let y=g.agent.settings.general?.rememberUser?.storage??Je.general.rememberUser.storage;vp(y)(d,g.resultId);let T=wp(g.agent.id);T&&T.agent.publishedAt&&g.agent.publishedAt?new Date(T.agent.publishedAt).getTime()===new Date(g.agent.publishedAt).getTime()?n(T):(Ra(g.agent.id),n(g),Ul(g,{agentId:g.agent.id,storage:y})):(n(g),Ul(g,{agentId:g.agent.id,storage:y})),e.onChatStatePersisted?.(!0)}else{if(Ra(g.agent.id),n(g),g.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(g.input),g.logs){let y=g.logs.map(T=>({status:T.status??"",description:T.description??"",details:T.details}));e.onNewLogs?.(y)}e.onChatStatePersisted?.(!1)}o(g.agent.theme.customCss??"")};return ge(()=>{Ge(e.agent)||i()||l().then()}),ge(()=>{Ge(e.agent)||typeof e.agent=="string"||(o(e.agent.theme.customCss??""),e.agent.theme.general?.progressBar?.isEnabled&&t()&&!t()?.agent.theme.general?.progressBar?.isEnabled&&(a(!1),l().then()))}),se(()=>{a(!1)}),[(()=>{var u=zx();return x(u,r),u})(),(()=>{var u=zx();return x(u,lb),u})(),m(N,{get when(){return s()},keyed:!0,children:u=>m(Vx,{error:u})}),m(N,{get when(){return t()},keyed:!0,children:u=>m(QI,{get class(){return e.class},get initialChatReply(){return{...u,agent:{...u.agent,settings:typeof e.agent=="string"?u.agent?.settings:e.agent?.settings,theme:typeof e.agent=="string"?u.agent?.theme:e.agent?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:typeof e.agent!="string"||(e.isPreview??!1),resultId:u.resultId,sessionId:u.sessionId,agent:u.agent,storage:u.agent.settings.general?.rememberUser?.isEnabled&&!(typeof e.agent!="string"||(e.isPreview??!1))?u.agent.settings.general?.rememberUser?.storage??Je.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},QI=e=>{let[t,n]=tn(O(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),r,o=new ResizeObserver(i=>dp((i[0]?.target.clientWidth??0)<432));return ne(()=>{r&&(Kf(r),o.observe(r),qf(`${r.clientHeight}px`))}),ge(()=>{Nl(e.initialChatReply.agent.theme.general?.font??{type:Yf,family:eo}),r&&yp(e.initialChatReply.agent.theme,r,e.context.isPreview)}),se(()=>{r&&o.unobserve(r)}),(()=>{var i=JI(),a=r;return typeof a=="function"?de(a,i):r=i,x(i,m(N,{get when(){return re(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(N,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??_a)==="fixed"},get fallback(){return m(mu,{get value(){return t()}})},get children(){return m(xd,{get mount(){return e.progressBarRef},get children(){return m(mu,{get value(){return t()}})}})}})}}),null),x(i,m(jx,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),x(i,m(N,{get when(){return e.initialChatReply.agent.settings.general?.isBrandingEnabled},get children(){return m(Hx,{agentContainer:r,get url(){return e.initialChatReply.agent.settings.general?.brandingUrl??"https://release0.com/?utm_source=brand-mark"},get text(){return e.initialChatReply.agent.settings.general?.brandingText??"Powered by Release0"}})}}),null),x(i,m(hc,{toaster:Kn,children:s=>m(hr.Root,{get children(){return[m(hr.Title,{get children(){return s().title}}),m(hr.Description,{get children(){return s().description}}),m(hr.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m(fn,{class:"w-4 h-4"})}})]}})}),null),A(()=>$(i,pe("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),i})()};var Gs="Zendesk Web Widget Opened";var Ar=`*, ::before, ::after {
|
|
169
153
|
--tw-border-spacing-x: 0;
|
|
170
154
|
--tw-border-spacing-y: 0;
|
|
171
155
|
--tw-translate-x: 0;
|
|
@@ -2104,32 +2088,19 @@ select option {
|
|
|
2104
2088
|
opacity: 0;
|
|
2105
2089
|
}
|
|
2106
2090
|
}
|
|
2107
|
-
`;var UM=C('<svg part=button-icon viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),FM=C('<img part=button-icon alt="Bubble button icon">'),ux=C("<span part=button-icon>"),$M=C('<svg part=button-icon viewBox="0 0 24 24"><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),GM=C('<img part=button-icon alt="Bubble button close icon">'),HM=C('<button part=button aria-label="Open agent">'),ud="#0042DA",dx="#27272A",fx="#fff",Al=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),px=e=>(()=>{var t=HM();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),x(t,m(B,{get when(){return Qe(e.customIconSrc)},keyed:!0,get children(){var n=UM();return M(r=>{var o=e.iconColor??(Ln(e.backgroundColor??ud)?dx:fx),a=Lt("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100");return o!==r.e&&((r.e=o)!=null?n.style.setProperty("stroke",o):n.style.removeProperty("stroke")),a!==r.t&&K(n,"class",r.t=a),r},{e:void 0,t:void 0}),n}}),null),x(t,m(B,{get when(){return F(()=>!!e.customIconSrc)()&&Al(e.customIconSrc)},get children(){var n=FM();return M(r=>{var o=e.customIconSrc,a=Lt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",en(e.customIconSrc)?"w-[60%]":"w-full h-full",en(e.customIconSrc)?"":"object-cover rounded-full");return o!==r.e&&K(n,"src",r.e=o),a!==r.t&&U(n,r.t=a),r},{e:void 0,t:void 0}),n}}),null),x(t,m(B,{get when(){return F(()=>!!e.customIconSrc)()&&!Al(e.customIconSrc)},get children(){var n=ux();return n.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(n,()=>e.customIconSrc),M(()=>U(n,Lt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),n}}),null),x(t,m(B,{get when(){return Qe(e.customCloseIconSrc)},get children(){var n=$M();return M(r=>{var o=e.iconColor??(Ln(e.backgroundColor??ud)?dx:fx),a=Lt("absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return o!==r.e&&((r.e=o)!=null?n.style.setProperty("fill",o):n.style.removeProperty("fill")),a!==r.t&&K(n,"class",r.t=a),r},{e:void 0,t:void 0}),n}}),null),x(t,m(B,{get when(){return F(()=>!!e.customCloseIconSrc)()&&Al(e.customCloseIconSrc)},get children(){var n=GM();return M(r=>{var o=e.customCloseIconSrc,a=Lt("absolute duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",en(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",en(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==r.e&&K(n,"src",r.e=o),a!==r.t&&U(n,r.t=a),r},{e:void 0,t:void 0}),n}}),null),x(t,m(B,{get when(){return F(()=>!!e.customCloseIconSrc)()&&!Al(e.customCloseIconSrc)},get children(){var n=ux();return n.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(n,()=>e.customCloseIconSrc),M(()=>U(n,Lt("absolute text-4xl duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),n}}),null),M(n=>{var r=kr("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in"),o=e.backgroundColor??ud,a=e.buttonSize,i=e.buttonSize;return r!==n.e&&U(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),a!==n.a&&((n.a=a)!=null?t.style.setProperty("width",a):t.style.removeProperty("width")),i!==n.o&&((n.o=i)!=null?t.style.setProperty("height",i):t.style.removeProperty("height")),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})();He(["click"]);var KM=C("<div part=preview-message><p>"),VM=C('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),jM=C('<button part=preview-message-close-button aria-label=Close><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),mx="#F7F8FF",gx="#303235",hx=e=>{let[t,n]=R(!1),[r,o]=R({x:0,y:0}),a=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0})},i=s=>{let c=s.changedTouches[0]?.clientX??0,l=s.changedTouches[0]?.clientY??0;(Math.abs(c-r().x)>10||l-r().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{var s=KM(),c=s.firstChild;return s.$$touchend=i,s.$$touchstart=a,s.addEventListener("mouseleave",()=>n(!1)),s.addEventListener("mouseenter",()=>n(!0)),s.$$click=()=>e.onClick(),s.style.setProperty("z-index","99999999"),x(s,m(zM,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),c),x(s,m(B,{get when(){return e.avatarUrl},keyed:!0,children:l=>(()=>{var u=VM();return K(u,"src",l),u})()}),c),x(c,()=>e.message),M(l=>{var u=kr("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),f=e.previewMessageTheme?.backgroundColor??mx,d=e.previewMessageTheme?.textColor??gx,p=`calc(${e.buttonSize} + 32px)`;return u!==l.e&&U(s,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("background-color",f):s.style.removeProperty("background-color")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("color",d):s.style.removeProperty("color")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("bottom",p):s.style.removeProperty("bottom")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},zM=e=>(()=>{var t=jM();return t.$$click=n=>(n.stopPropagation(),e.onClick()),M(n=>{var r="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??mx,a=e.previewMessageTheme?.closeButtonIconColor??gx;return r!==n.e&&U(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),a!==n.a&&((n.a=a)!=null?t.style.setProperty("color",a):t.style.removeProperty("color")),n},{e:void 0,t:void 0,a:void 0}),t})();He(["click","touchstart","touchend"]);var WM=C("<style>"),ZM=C("<div><div></div><div part=agent>"),YM="20px",qM="12px",yx=e=>{let[t,n]=ze(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[r,o]=R(!0),[a,i]=R(n.prefilledVariables),[s,c]=R(!1),[l,u]=R({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[f,d]=R(!1),[p,h]=R(!1),[g,y]=R(bx(t.theme?.button?.size??"medium"));xe(()=>{y(bx(t.theme?.button?.size??"medium"))});let b;ie(()=>{window.addEventListener("message",T);let P=t.autoShowDelay,E=t.previewMessage?.autoShowDelay;(fs()||fo())&&S(),re(P)&&setTimeout(()=>{S()},P),re(E)&&setTimeout(()=>{O()},E)}),de(()=>{window.removeEventListener("message",T)}),xe(()=>{e.prefilledVariables&&i(P=>({...P,...e.prefilledVariables}))});let T=P=>{let{data:E}=P;!E.isFromAgent||E.id&&n.id!==E.id||(E.command==="open"&&S(),E.command==="close"&&k(),E.command==="toggle"&&I(),E.command==="showPreviewMessage"&&O(E.message),E.command==="hidePreviewMessage"&&Q(),E.command==="setPrefilledVariables"&&i(w=>({...w,...E.variables})),E.command==="unmount"&&H())},S=()=>{p()||h(!0),Q(),d(!0),f()&&t.onOpen?.()},k=()=>{d(!1),ds(),f()&&t.onClose?.()},I=()=>{f()?k():S()},$=()=>{t.onPreviewMessageClick?.(),S()},O=P=>{P&&u(P),!f()&&c(!0)},Q=()=>{t.onPreviewMessageDismissed?.(),c(!1)},H=()=>{f()?(k(),setTimeout(()=>{o(!1)},200)):o(!1)},j=P=>{n.onChatStatePersisted?.(P),P&&us()},L=P=>{(P===kl||P===jo)&&H(),e.onScriptExecutionSuccess?.(P)};return console.log("bubbleProps.theme?",t.theme),m(B,{get when(){return r()},get children(){return m(Rr,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return[(()=>{var P=WM();return x(P,Qr),P})(),(()=>{var P=ZM(),E=P.firstChild,w=E.nextSibling;x(P,m(B,{get when(){return s()},get children(){return m(hx,Ee(l,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return g()},onClick:$,onCloseClick:Q}))}}),E),x(P,m(px,Ee(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:I,get isAgentOpened(){return f()},get buttonSize(){return g()}})),E);var N=b;return typeof N=="function"?he(N,E):b=E,w.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),w.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),x(w,m(B,{get when(){return p()},get children(){return m(ea,Ee(n,{onScriptExecutionSuccess:L,onChatStatePersisted:j,get prefilledVariables(){return a()},class:"rounded-lg",progressBarRef:b}))}})),M(_=>{var ee=kr(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),me=t.inlineStyle,ge=`calc(100vh - ${YM} - ${g()} - ${qM})`,Ne=t.theme?.chatWindow?.maxHeight??"704px",Ae=t.theme?.chatWindow?.maxWidth??"400px",Ot=t.theme?.placement==="left"?"bottom left":"bottom right",qt=f()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",Et=t.theme?.chatWindow?.backgroundColor,fn=kr("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",f()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5");return ee!==_.e&&U(P,_.e=ee),_.t=tc(P,me,_.t),ge!==_.a&&((_.a=ge)!=null?w.style.setProperty("max-height",ge):w.style.removeProperty("max-height")),Ne!==_.o&&((_.o=Ne)!=null?w.style.setProperty("height",Ne):w.style.removeProperty("height")),Ae!==_.i&&((_.i=Ae)!=null?w.style.setProperty("max-width",Ae):w.style.removeProperty("max-width")),Ot!==_.n&&((_.n=Ot)!=null?w.style.setProperty("transform-origin",Ot):w.style.removeProperty("transform-origin")),qt!==_.s&&((_.s=qt)!=null?w.style.setProperty("transform",qt):w.style.removeProperty("transform")),Et!==_.h&&((_.h=Et)!=null?w.style.setProperty("background-color",Et):w.style.removeProperty("background-color")),fn!==_.r&&U(w,_.r=fn),_},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),P})()]}})}})},bx=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var JM=C("<style>"),XM=C('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),vx=e=>{let[t,n]=ze(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[r,o]=R(n.prefilledVariables),[a,i]=R(t.isOpen??!1);ie(()=>{(t.defaultOpen||fo()||fs())&&l(),window.addEventListener("message",c);let h=t.autoShowDelay;re(h)&&setTimeout(()=>{l()},h)}),de(()=>{window.removeEventListener("message",c)}),xe(()=>{Qe(e.isOpen)||e.isOpen===a()||f()}),xe(()=>{e.prefilledVariables&&o(h=>({...h,...e.prefilledVariables}))});let s=h=>{h.stopPropagation()},c=h=>{let{data:g}=h;!g.isFromAgent||g.id&&n.id!==g.id||(g.command==="open"&&l(),g.command==="close"&&u(),g.command==="toggle"&&f(),g.command==="setPrefilledVariables"&&o(y=>({...y,...g.variables})))},l=()=>{i(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u)},u=()=>{i(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),ds()},f=()=>{a()?u():l()},d=h=>{n.onChatStatePersisted?.(h),h&&us()},p=h=>{(h===kl||h===jo)&&u(),e.onScriptExecutionSuccess?.(h)};return m(B,{get when(){return a()},get children(){return m(Rr,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return[(()=>{var h=JM();return x(h,Qr),h})(),(()=>{var h=XM(),g=h.firstChild,y=g.nextSibling,b=y.nextSibling,T=b.firstChild,S=T.firstChild;return x(g,Qr),We(S,"pointerdown",s),x(S,m(ea,Ee(n,{onScriptExecutionSuccess:p,get prefilledVariables(){return r()},onChatStatePersisted:d}))),M(k=>{var I=e.theme?.zIndex??99999999,$="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),O=e.theme?.backgroundColor??"transparent",Q=e.theme?.width??"512px";return I!==k.e&&((k.e=I)!=null?h.style.setProperty("z-index",I):h.style.removeProperty("z-index")),$!==k.t&&U(S,k.t=$),O!==k.a&&((k.a=O)!=null?S.style.setProperty("background-color",O):S.style.removeProperty("background-color")),Q!==k.o&&((k.o=Q)!=null?S.style.setProperty("max-width",Q):S.style.removeProperty("max-width")),k},{e:void 0,t:void 0,a:void 0,o:void 0}),h})()]}})}})};var QM=C(`<style>
|
|
2091
|
+
`;function Or(...e){return Rd(pe(e))}var t1=S('<svg part=button-icon viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),n1=S('<img part=button-icon alt="Bubble button icon">'),Gx=S("<span part=button-icon>"),r1=S('<svg part=button-icon viewBox="0 0 24 24"><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),o1=S('<img part=button-icon alt="Bubble button close icon">'),i1=S('<button part=button aria-label="Open agent">'),gu="#0042DA",Wx="#27272A",qx="#fff",Ws=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),Kx=e=>(()=>{var t=i1();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),x(t,m(N,{get when(){return Ge(e.customIconSrc)},keyed:!0,get children(){var n=t1();return A(r=>{var o=e.iconColor??(xn(e.backgroundColor??gu)?Wx:qx),i=Pt("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100");return o!==r.e&&((r.e=o)!=null?n.style.setProperty("stroke",o):n.style.removeProperty("stroke")),i!==r.t&&j(n,"class",r.t=i),r},{e:void 0,t:void 0}),n}}),null),x(t,m(N,{get when(){return B(()=>!!e.customIconSrc)()&&Ws(e.customIconSrc)},get children(){var n=n1();return A(r=>{var o=e.customIconSrc,i=Pt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",Ft(e.customIconSrc)?"w-[60%]":"w-full h-full",Ft(e.customIconSrc)?"":"object-cover rounded-full");return o!==r.e&&j(n,"src",r.e=o),i!==r.t&&$(n,r.t=i),r},{e:void 0,t:void 0}),n}}),null),x(t,m(N,{get when(){return B(()=>!!e.customIconSrc)()&&!Ws(e.customIconSrc)},get children(){var n=Gx();return n.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(n,()=>e.customIconSrc),A(()=>$(n,Pt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),n}}),null),x(t,m(N,{get when(){return Ge(e.customCloseIconSrc)},get children(){var n=r1();return A(r=>{var o=e.iconColor??(xn(e.backgroundColor??gu)?Wx:qx),i=Pt("absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return o!==r.e&&((r.e=o)!=null?n.style.setProperty("fill",o):n.style.removeProperty("fill")),i!==r.t&&j(n,"class",r.t=i),r},{e:void 0,t:void 0}),n}}),null),x(t,m(N,{get when(){return B(()=>!!e.customCloseIconSrc)()&&Ws(e.customCloseIconSrc)},get children(){var n=o1();return A(r=>{var o=e.customCloseIconSrc,i=Pt("absolute duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",Ft(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",Ft(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==r.e&&j(n,"src",r.e=o),i!==r.t&&$(n,r.t=i),r},{e:void 0,t:void 0}),n}}),null),x(t,m(N,{get when(){return B(()=>!!e.customCloseIconSrc)()&&!Ws(e.customCloseIconSrc)},get children(){var n=Gx();return n.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(n,()=>e.customCloseIconSrc),A(()=>$(n,Pt("absolute text-4xl duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),n}}),null),A(n=>{var r=Or("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in"),o=e.backgroundColor??gu,i=e.buttonSize,a=e.buttonSize;return r!==n.e&&$(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n.a&&((n.a=i)!=null?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==n.o&&((n.o=a)!=null?t.style.setProperty("height",a):t.style.removeProperty("height")),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})();Me(["click"]);var a1=S("<div part=preview-message><p>"),s1=S('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),l1=S('<button part=preview-message-close-button aria-label=Close><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),Yx="#F7F8FF",Xx="#303235",Zx=e=>{let[t,n]=O(!1),[r,o]=O({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0})},a=s=>{let c=s.changedTouches[0]?.clientX??0,l=s.changedTouches[0]?.clientY??0;(Math.abs(c-r().x)>10||l-r().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{var s=a1(),c=s.firstChild;return s.$$touchend=a,s.$$touchstart=i,s.addEventListener("mouseleave",()=>n(!1)),s.addEventListener("mouseenter",()=>n(!0)),s.$$click=()=>e.onClick(),s.style.setProperty("z-index","99999999"),x(s,m(c1,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),c),x(s,m(N,{get when(){return e.avatarUrl},keyed:!0,children:l=>(()=>{var u=s1();return j(u,"src",l),u})()}),c),x(c,()=>e.message),A(l=>{var u=Or("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),f=e.previewMessageTheme?.backgroundColor??Yx,d=e.previewMessageTheme?.textColor??Xx,p=`calc(${e.buttonSize} + 32px)`;return u!==l.e&&$(s,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("background-color",f):s.style.removeProperty("background-color")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("color",d):s.style.removeProperty("color")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("bottom",p):s.style.removeProperty("bottom")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},c1=e=>(()=>{var t=l1();return t.$$click=n=>(n.stopPropagation(),e.onClick()),A(n=>{var r="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??Yx,i=e.previewMessageTheme?.closeButtonIconColor??Xx;return r!==n.e&&$(t,n.e=r),o!==n.t&&((n.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n.a&&((n.a=i)!=null?t.style.setProperty("color",i):t.style.removeProperty("color")),n},{e:void 0,t:void 0,a:void 0}),t})();Me(["click","touchstart","touchend"]);var u1=S("<style>"),d1=S("<div><div></div><div part=agent>"),f1="20px",p1="12px",Qx=e=>{let[t,n]=Be(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[r,o]=O(!0),[i,a]=O(n.prefilledVariables),[s,c]=O(!1),[l,u]=O({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[f,d]=O(!1),[p,h]=O(!1),[g,v]=O(Jx(t.theme?.button?.size??"medium"));ge(()=>{v(Jx(t.theme?.button?.size??"medium"))});let y;ne(()=>{window.addEventListener("message",T);let P=t.autoShowDelay,_=t.previewMessage?.autoShowDelay;(Oa()||zr())&&C(),P&&setTimeout(()=>{C()},P),_&&setTimeout(()=>{R()},_)}),se(()=>{window.removeEventListener("message",T)}),ge(()=>{e.prefilledVariables&&a(P=>({...P,...e.prefilledVariables}))});let T=P=>{let{data:_}=P;!_.isFromAgent||_.id&&n.id!==_.id||(_.command==="open"&&C(),_.command==="close"&&E(),_.command==="toggle"&&I(),_.command==="showPreviewMessage"&&R(_.message),_.command==="hidePreviewMessage"&&oe(),_.command==="setPrefilledVariables"&&a(w=>({...w,..._.variables})),_.command==="unmount"&&H())},C=()=>{p()||h(!0),oe(),d(!0),f()&&t.onOpen?.()},E=()=>{d(!1),Aa(),f()&&t.onClose?.()},I=()=>{f()?E():C()},U=()=>{t.onPreviewMessageClick?.(),C()},R=P=>{P&&u(P),!f()&&c(!0)},oe=()=>{t.onPreviewMessageDismissed?.(),c(!1)},H=()=>{f()?(E(),setTimeout(()=>{o(!1)},200)):o(!1)},G=P=>{n.onChatStatePersisted?.(P),P&&Ia()},L=P=>{(P===Gs||P===vo)&&H(),e.onScriptExecutionSuccess?.(P)};return console.log("bubbleProps.theme?",t.theme),m(N,{get when(){return r()},get children(){return m(cr,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return[(()=>{var P=u1();return x(P,Ar),P})(),(()=>{var P=d1(),_=P.firstChild,w=_.nextSibling;x(P,m(N,{get when(){return s()},get children(){return m(Zx,Se(l,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return g()},onClick:U,onCloseClick:oe}))}}),_),x(P,m(Kx,Se(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:I,get isAgentOpened(){return f()},get buttonSize(){return g()}})),_);var M=y;return typeof M=="function"?de(M,_):y=_,w.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),w.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),x(w,m(N,{get when(){return p()},get children(){return m(Io,Se(n,{onScriptExecutionSuccess:L,onChatStatePersisted:G,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:y}))}})),A(D=>{var J=Or(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),ue=t.inlineStyle,le=`calc(100vh - ${f1} - ${g()} - ${p1})`,xe=t.theme?.chatWindow?.maxHeight??"704px",we=t.theme?.chatWindow?.maxWidth??"400px",St=t.theme?.placement==="left"?"bottom left":"bottom right",$t=f()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",mt=t.theme?.chatWindow?.backgroundColor,Xt=Or("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",f()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5");return J!==D.e&&$(P,D.e=J),D.t=vl(P,ue,D.t),le!==D.a&&((D.a=le)!=null?w.style.setProperty("max-height",le):w.style.removeProperty("max-height")),xe!==D.o&&((D.o=xe)!=null?w.style.setProperty("height",xe):w.style.removeProperty("height")),we!==D.i&&((D.i=we)!=null?w.style.setProperty("max-width",we):w.style.removeProperty("max-width")),St!==D.n&&((D.n=St)!=null?w.style.setProperty("transform-origin",St):w.style.removeProperty("transform-origin")),$t!==D.s&&((D.s=$t)!=null?w.style.setProperty("transform",$t):w.style.removeProperty("transform")),mt!==D.h&&((D.h=mt)!=null?w.style.setProperty("background-color",mt):w.style.removeProperty("background-color")),Xt!==D.r&&$(w,D.r=Xt),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),P})()]}})}})},Jx=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var m1=S("<style>"),g1=S('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),ev=e=>{let[t,n]=Be(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[r,o]=O(n.prefilledVariables),[i,a]=O(t.isOpen??!1);ne(()=>{(t.defaultOpen||zr()||Oa())&&l(),window.addEventListener("message",c);let h=t.autoShowDelay;re(h)&&setTimeout(()=>{l()},h)}),se(()=>{window.removeEventListener("message",c)}),ge(()=>{Ge(e.isOpen)||e.isOpen===i()||f()}),ge(()=>{e.prefilledVariables&&o(h=>({...h,...e.prefilledVariables}))});let s=h=>{h.stopPropagation()},c=h=>{let{data:g}=h;!g.isFromAgent||g.id&&n.id!==g.id||(g.command==="open"&&l(),g.command==="close"&&u(),g.command==="toggle"&&f(),g.command==="setPrefilledVariables"&&o(v=>({...v,...g.variables})))},l=()=>{a(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u)},u=()=>{a(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),Aa()},f=()=>{i()?u():l()},d=h=>{n.onChatStatePersisted?.(h),h&&Ia()},p=h=>{(h===Gs||h===vo)&&u(),e.onScriptExecutionSuccess?.(h)};return m(N,{get when(){return i()},get children(){return m(cr,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return[(()=>{var h=m1();return x(h,Ar),h})(),(()=>{var h=g1(),g=h.firstChild,v=g.nextSibling,y=v.nextSibling,T=y.firstChild,C=T.firstChild;return x(g,Ar),Fe(C,"pointerdown",s),x(C,m(Io,Se(n,{onScriptExecutionSuccess:p,get prefilledVariables(){return r()},onChatStatePersisted:d}))),A(E=>{var I=e.theme?.zIndex??99999999,U="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),R=e.theme?.backgroundColor??"transparent",oe=e.theme?.width??"512px";return I!==E.e&&((E.e=I)!=null?h.style.setProperty("z-index",I):h.style.removeProperty("z-index")),U!==E.t&&$(C,E.t=U),R!==E.a&&((E.a=R)!=null?C.style.setProperty("background-color",R):C.style.removeProperty("background-color")),oe!==E.o&&((E.o=oe)!=null?C.style.setProperty("max-width",oe):C.style.removeProperty("max-width")),E},{e:void 0,t:void 0,a:void 0,o:void 0}),h})()]}})}})};var h1=S(`<style>
|
|
2108
2092
|
:host {
|
|
2109
2093
|
display: block;
|
|
2110
2094
|
width: 100%;
|
|
2111
2095
|
height: 100%;
|
|
2112
2096
|
overflow-y: hidden;
|
|
2113
2097
|
}
|
|
2114
|
-
`);var
|
|
2098
|
+
`);var tv=(e,{element:t})=>{let[n,r]=O(!1),[o,i]=O(e.prefilledVariables),a=()=>{r(!0)},s=new IntersectionObserver(l=>{l.some(u=>u.isIntersecting)&&a()});ne(()=>{window.addEventListener("message",c),s.observe(t)}),ge(()=>{e.prefilledVariables&&i(l=>({...l,...e.prefilledVariables}))});let c=l=>{let{data:u}=l;!u.isFromAgent||u.id&&e.id!==u.id||u.command==="setPrefilledVariables"&&i(f=>({...f,...u.variables}))};return se(()=>{s.disconnect()}),m(cr,{get value(){return document.querySelector("agent-standard")?.shadowRoot},get children(){return[(()=>{var l=h1(),u=l.firstChild;return x(l,Ar,u),l})(),m(N,{get when(){return n()},get children(){return m(Io,Se(e,{get prefilledVariables(){return o()}}))}})]}})};var nv=()=>{typeof window>"u"||(fa("agent-standard",pa,tv),fa("agent-bubble",Sd,Qx),fa("agent-popup",wd,ev))};var rv=({id:e}={})=>{let t={isFromAgent:!0,command:"close",id:e};window.postMessage(t)};var ov=({id:e}={})=>{let t={isFromAgent:!0,command:"hidePreviewMessage",id:e};window.postMessage(t)};var iv=({id:e}={})=>{let t={isFromAgent:!0,command:"open",id:e};window.postMessage(t)};var av=(e,{id:t}={})=>{let n={isFromAgent:!0,command:"setInputValue",value:e,id:t};window.postMessage(n)};var sv=(e,{id:t}={})=>{let n={isFromAgent:!0,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(n)};var lv=(e,{id:t}={})=>{let n={isFromAgent:!0,command:"showPreviewMessage",message:e,id:t};window.postMessage(n)};var cv=({id:e}={})=>{let t={isFromAgent:!0,command:"toggle",id:e};window.postMessage(t)};var uv=({id:e}={})=>{let t={isFromAgent:!0,command:"unmount",id:e};window.postMessage(t)};var b1=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("agent-standard");if(!t)throw new Error("<agent-standard> element not found.");Object.assign(t,e)},y1=e=>{let t=document.createElement("agent-popup");Object.assign(t,e),document.body.prepend(t)},x1=e=>{let t=document.createElement("agent-bubble");Object.assign(t,e),document.body.prepend(t)},dv=()=>({initStandard:b1,initPopup:y1,initBubble:x1,close:rv,hidePreviewMessage:ov,open:iv,setPrefilledVariables:sv,showPreviewMessage:lv,toggle:cv,setInputValue:av,unmount:uv}),fv=e=>{typeof window>"u"||(window.Agent={...e})};nv();var pv=dv();fv(pv);var BW=pv;export{BW as default};
|
|
2115
2099
|
/*! Bundled license information:
|
|
2116
2100
|
|
|
2117
2101
|
@noble/hashes/utils.js:
|
|
2118
2102
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2119
2103
|
|
|
2120
|
-
@prisma/client/runtime/index-browser.js:
|
|
2121
|
-
(*! Bundled license information:
|
|
2122
|
-
|
|
2123
|
-
decimal.js/decimal.mjs:
|
|
2124
|
-
(*!
|
|
2125
|
-
* decimal.js v10.4.3
|
|
2126
|
-
* An arbitrary-precision Decimal type for JavaScript.
|
|
2127
|
-
* https://github.com/MikeMcl/decimal.js
|
|
2128
|
-
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
2129
|
-
* MIT Licence
|
|
2130
|
-
*)
|
|
2131
|
-
*)
|
|
2132
|
-
|
|
2133
2104
|
dompurify/dist/purify.js:
|
|
2134
2105
|
(*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE *)
|
|
2135
2106
|
|