@opencx/widget 4.0.28 → 4.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed/script.js +4 -4
- package/dist-embed/script.js.map +1 -1
- package/package.json +5 -5
package/dist-embed/script.js
CHANGED
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
`)},qv=function(){var e=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(e)?e:0},WR=function(){T.useEffect(function(){return document.body.setAttribute(Ls,(qv()+1).toString()),function(){var e=qv()-1;e<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,e.toString())}},[])},ZR=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;WR();var a=T.useMemo(function(){return $R(r)},[r]);return T.createElement(KR,{styles:QR(a,!t,r,n?"":"!important")})},_p=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return _p=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{_p=!1}var Is=_p?{passive:!1}:!1,JR=function(e){return e.tagName==="TEXTAREA"},Gv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!JR(e)&&n[t]==="visible")},eD=function(e){return Gv(e,"overflowY")},tD=function(e){return Gv(e,"overflowX")},Xv=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=$v(e,i);if(r){var a=Kv(e,i),s=a[1],o=a[2];if(s>o)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},nD=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},iD=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},$v=function(e,t){return e==="v"?eD(t):tD(t)},Kv=function(e,t){return e==="v"?nD(t):iD(t)},rD=function(e,t){return e==="h"&&t==="rtl"?-1:1},aD=function(e,t,n,i,r){var a=rD(e,window.getComputedStyle(t).direction),s=a*i,o=n.target,l=t.contains(o),u=!1,c=s>0,d=0,f=0;do{if(!o)break;var h=Kv(e,o),g=h[0],b=h[1],E=h[2],m=b-E-a*g;(g||m)&&$v(e,o)&&(d+=m,f+=g);var y=o.parentNode;o=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(c&&Math.abs(d)<1||!c&&Math.abs(f)<1)&&(u=!0),u},Qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qv=function(e){return[e.deltaX,e.deltaY]},Wv=function(e){return e&&"current"in e?e.current:e},sD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oD=function(e){return`
|
|
63
63
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
64
64
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
65
|
-
`)},lD=0,Ps=[];function uD(e){var t=T.useRef([]),n=T.useRef([0,0]),i=T.useRef(),r=T.useState(lD++)[0],a=T.useState(Yv)[0],s=T.useRef(e);T.useEffect(function(){s.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=yp([e.lockRef.current],(e.shards||[]).map(Wv),!0).filter(Boolean);return b.forEach(function(E){return E.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=T.useCallback(function(b,E){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var m=Qc(b),y=n.current,x="deltaX"in b?b.deltaX:y[0]-m[0],_="deltaY"in b?b.deltaY:y[1]-m[1],S,k=b.target,D=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in b&&D==="h"&&k.type==="range")return!1;var L=Xv(D,k);if(!L)return!0;if(L?S=D:(S=D==="v"?"h":"v",L=Xv(D,k)),!L)return!1;if(!i.current&&"changedTouches"in b&&(x||_)&&(i.current=S),!S)return!0;var B=i.current||S;return aD(B,E,b,B==="h"?x:_)},[]),l=T.useCallback(function(b){var E=b;if(!(!Ps.length||Ps[Ps.length-1]!==a)){var m="deltaY"in E?Qv(E):Qc(E),y=t.current.filter(function(S){return S.name===E.type&&(S.target===E.target||E.target===S.shadowParent)&&sD(S.delta,m)})[0];if(y&&y.should){E.cancelable&&E.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(Wv).filter(Boolean).filter(function(S){return S.contains(E.target)}),_=x.length>0?o(E,x[0]):!s.current.noIsolation;_&&E.cancelable&&E.preventDefault()}}},[]),u=T.useCallback(function(b,E,m,y){var x={name:b,delta:E,target:m,should:y,shadowParent:cD(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),c=T.useCallback(function(b){n.current=Qc(b),i.current=void 0},[]),d=T.useCallback(function(b){u(b.type,Qv(b),b.target,o(b,e.lockRef.current))},[]),f=T.useCallback(function(b){u(b.type,Qc(b),b.target,o(b,e.lockRef.current))},[]);T.useEffect(function(){return Ps.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Is),document.addEventListener("touchmove",l,Is),document.addEventListener("touchstart",c,Is),function(){Ps=Ps.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Is),document.removeEventListener("touchmove",l,Is),document.removeEventListener("touchstart",c,Is)}},[]);var h=e.removeScrollBar,g=e.inert;return T.createElement(T.Fragment,null,g?T.createElement(a,{styles:oD(r)}):null,h?T.createElement(ZR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dD=zR(Vv,uD);var Zv=T.forwardRef(function(e,t){return T.createElement($c,ni({},e,{ref:t,sideCar:dD}))});Zv.classNames=$c.classNames;var Wc="Popover",[Jv,pZ]=kc(Wc,[zc]),yl=zc(),[fD,Ba]=Jv(Wc),ex=e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:a,modal:s=!1}=e,o=yl(t),l=T.useRef(null),[u,c]=T.useState(!1),[d,f]=mv({prop:i,defaultProp:r??!1,onChange:a,caller:Wc});return v.jsx(fv,{...o,children:v.jsx(fD,{scope:t,contentId:Ly(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:u,onCustomAnchorAdd:T.useCallback(()=>c(!0),[]),onCustomAnchorRemove:T.useCallback(()=>c(!1),[]),modal:s,children:n})})};ex.displayName=Wc;var tx="PopoverAnchor",nx=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(tx,n),a=yl(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=r;return T.useEffect(()=>(s(),()=>o()),[s,o]),v.jsx(hp,{...a,...i,ref:t})});nx.displayName=tx;var ix="PopoverTrigger",rx=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(ix,n),a=yl(n),s=Pi(t,r.triggerRef),o=v.jsx(Mn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":lx(r.open),...i,ref:s,onClick:xn(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?o:v.jsx(hp,{asChild:!0,...a,children:o})});rx.displayName=ix;var hD="PopoverPortal",[mZ,pD]=Jv(hD,{forceMount:void 0}),Bs="PopoverContent",ax=T.forwardRef((e,t)=>{const n=pD(Bs,e.__scopePopover),{forceMount:i=n.forceMount,...r}=e,a=Ba(Bs,e.__scopePopover);return v.jsx(pp,{present:i||a.open,children:a.modal?v.jsx(gD,{...r,ref:t}):v.jsx(bD,{...r,ref:t})})});ax.displayName=Bs;var mD=Xh("PopoverContent.RemoveScroll"),gD=T.forwardRef((e,t)=>{const n=Ba(Bs,e.__scopePopover),i=T.useRef(null),r=Pi(t,i),a=T.useRef(!1);return T.useEffect(()=>{const s=i.current;if(s)return CR(s)},[]),v.jsx(Zv,{as:mD,allowPinchZoom:!0,children:v.jsx(sx,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xn(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),a.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:xn(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:xn(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),bD=T.forwardRef((e,t)=>{const n=Ba(Bs,e.__scopePopover),i=T.useRef(!1),r=T.useRef(!1);return v.jsx(sx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(i.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),sx=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=e,f=Ba(Bs,n),h=yl(n);return V4(),v.jsx(Oy,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:a,children:v.jsx(Kh,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:c,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:v.jsx(hv,{"data-state":lx(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ox="PopoverClose",yD=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(ox,n);return v.jsx(Mn.button,{type:"button",...i,ref:t,onClick:xn(e.onClick,()=>r.onOpenChange(!1))})});yD.displayName=ox;var vD="PopoverArrow",xD=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=yl(n);return v.jsx(pv,{...r,...i,ref:t})});xD.displayName=vD;function lx(e){return e?"open":"closed"}var ED=ex,TD=nx,_D=ax;const wD=/\{[^{}]+\}/g,SD=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function AD(){return Math.random().toString(36).slice(2,11)}function CD(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:i=globalThis.fetch,querySerializer:r,bodySerializer:a,headers:s,requestInitExt:o=void 0,...l}={...e};o=SD()?o:void 0,t=hx(t);const u=[];async function c(d,f){const{baseUrl:h,fetch:g=i,Request:b=n,headers:E,params:m={},parseAs:y="json",querySerializer:x,bodySerializer:_=a??OD,body:S,...k}=f||{};let D=t;h&&(D=hx(h)??t);let L=typeof r=="function"?r:dx(r);x&&(L=typeof x=="function"?x:dx({...typeof r=="object"?r:{},...x}));const B=S===void 0?void 0:_(S,fx(s,E,m.header)),R=fx(B===void 0||B instanceof FormData?{}:{"Content-Type":"application/json"},s,E,m.header),Y={redirect:"follow",...l,...k,body:B,headers:R};let H,re,ee=new n(ND(d,{baseUrl:D,params:m,querySerializer:L}),Y),Q;for(const V in k)V in ee||(ee[V]=k[V]);if(u.length){H=AD(),re=Object.freeze({baseUrl:D,fetch:g,parseAs:y,querySerializer:L,bodySerializer:_});for(const V of u)if(V&&typeof V=="object"&&typeof V.onRequest=="function"){const j=await V.onRequest({request:ee,schemaPath:d,params:m,options:re,id:H});if(j)if(j instanceof n)ee=j;else if(j instanceof Response){Q=j;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!Q){try{Q=await g(ee,o)}catch(V){let j=V;if(u.length)for(let te=u.length-1;te>=0;te--){const O=u[te];if(O&&typeof O=="object"&&typeof O.onError=="function"){const be=await O.onError({request:ee,error:j,schemaPath:d,params:m,options:re,id:H});if(be){if(be instanceof Response){j=void 0,Q=be;break}if(be instanceof Error){j=be;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(j)throw j}if(u.length)for(let V=u.length-1;V>=0;V--){const j=u[V];if(j&&typeof j=="object"&&typeof j.onResponse=="function"){const te=await j.onResponse({request:ee,response:Q,schemaPath:d,params:m,options:re,id:H});if(te){if(!(te instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Q=te}}}}if(Q.status===204||ee.method==="HEAD"||Q.headers.get("Content-Length")==="0")return Q.ok?{data:void 0,response:Q}:{error:void 0,response:Q};if(Q.ok)return y==="stream"?{data:Q.body,response:Q}:{data:await Q[y](),response:Q};let F=await Q.text();try{F=JSON.parse(F)}catch{}return{error:F,response:Q}}return{request(d,f,h){return c(f,{...h,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(f)}},eject(...d){for(const f of d){const h=u.indexOf(f);h!==-1&&u.splice(h,1)}}}}function Zc(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function ux(e,t,n){if(!t||typeof t!="object")return"";const i=[],r={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const o in t)i.push(o,n.allowReserved===!0?t[o]:encodeURIComponent(t[o]));const s=i.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(const s in t){const o=n.style==="deepObject"?`${e}[${s}]`:s;i.push(Zc(o,t[s],n))}const a=i.join(r);return n.style==="label"||n.style==="matrix"?`${r}${a}`:a}function cx(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(a);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}const i={simple:",",label:".",matrix:";"}[n.style]||"&",r=[];for(const a of t)n.style==="simple"||n.style==="label"?r.push(n.allowReserved===!0?a:encodeURIComponent(a)):r.push(Zc(e,a,n));return n.style==="label"||n.style==="matrix"?`${i}${r.join(i)}`:r.join(i)}function dx(e){return function(n){const i=[];if(n&&typeof n=="object")for(const r in n){const a=n[r];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;i.push(cx(r,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){i.push(ux(r,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}i.push(Zc(r,a,e))}}return i.join("&")}}function kD(e,t){let n=e;for(const i of e.match(wD)??[]){let r=i.substring(1,i.length-1),a=!1,s="simple";if(r.endsWith("*")&&(a=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(s="label",r=r.substring(1)):r.startsWith(";")&&(s="matrix",r=r.substring(1)),!t||t[r]===void 0||t[r]===null)continue;const o=t[r];if(Array.isArray(o)){n=n.replace(i,cx(r,o,{style:s,explode:a}));continue}if(typeof o=="object"){n=n.replace(i,ux(r,o,{style:s,explode:a}));continue}if(s==="matrix"){n=n.replace(i,`;${Zc(r,o)}`);continue}n=n.replace(i,s==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function OD(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function ND(e,t){var r;let n=`${t.baseUrl}${e}`;(r=t.params)!=null&&r.path&&(n=kD(n,t.params.path));let i=t.querySerializer(t.params.query??{});return i.startsWith("?")&&(i=i.substring(1)),i&&(n+=`?${i}`),n}function fx(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const i=n instanceof Headers?n.entries():Object.entries(n);for(const[r,a]of i)if(a===null)t.delete(r);else if(Array.isArray(a))for(const s of a)t.append(r,s);else a!==void 0&&t.set(r,a)}return t}function hx(e){return e.endsWith("/")?e.substring(0,e.length-1):e}var Jc={exports:{}};Jc.exports,function(e,t){var n=200,i="__lodash_hash_undefined__",r=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",g="[object GeneratorFunction]",b="[object Map]",E="[object Number]",m="[object Null]",y="[object Object]",x="[object Promise]",_="[object Proxy]",S="[object RegExp]",k="[object Set]",D="[object String]",L="[object Symbol]",B="[object Undefined]",R="[object WeakMap]",Y="[object ArrayBuffer]",H="[object DataView]",re="[object Float32Array]",ee="[object Float64Array]",Q="[object Int8Array]",F="[object Int16Array]",V="[object Int32Array]",j="[object Uint8Array]",te="[object Uint8ClampedArray]",O="[object Uint16Array]",be="[object Uint32Array]",tt=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[re]=ge[ee]=ge[Q]=ge[F]=ge[V]=ge[j]=ge[te]=ge[O]=ge[be]=!0,ge[o]=ge[l]=ge[Y]=ge[c]=ge[H]=ge[d]=ge[f]=ge[h]=ge[b]=ge[E]=ge[y]=ge[S]=ge[k]=ge[D]=ge[R]=!1;var Be=typeof zr=="object"&&zr&&zr.Object===Object&&zr,dn=typeof self=="object"&&self&&self.Object===Object&&self,Qe=Be||dn||Function("return this")(),Xt=t&&!t.nodeType&&t,Dt=Xt&&!0&&e&&!e.nodeType&&e,jt=Dt&&Dt.exports===Xt,Mt=jt&&Be.process,ae=function(){try{return Mt&&Mt.binding&&Mt.binding("util")}catch{}}(),vi=ae&&ae.isTypedArray;function Mi(A,I){for(var G=-1,se=A==null?0:A.length,ot=0,Se=[];++G<se;){var xt=A[G];I(xt,G,A)&&(Se[ot++]=xt)}return Se}function Li(A,I){for(var G=-1,se=I.length,ot=A.length;++G<se;)A[ot+G]=I[G];return A}function nt(A,I){for(var G=-1,se=A==null?0:A.length;++G<se;)if(I(A[G],G,A))return!0;return!1}function fn(A,I){for(var G=-1,se=Array(A);++G<A;)se[G]=I(G);return se}function tn(A){return function(I){return A(I)}}function At(A,I){return A.has(I)}function Es(A,I){return A==null?void 0:A[I]}function On(A){var I=-1,G=Array(A.size);return A.forEach(function(se,ot){G[++I]=[ot,se]}),G}function Ir(A,I){return function(G){return A(I(G))}}function ne(A){var I=-1,G=Array(A.size);return A.forEach(function(se){G[++I]=se}),G}var he=Array.prototype,U=Function.prototype,X=Object.prototype,le=Qe["__core-js_shared__"],Ee=U.toString,ye=X.hasOwnProperty,$t=function(){var A=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Nn=X.toString,yn=RegExp("^"+Ee.call(ye).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jn=jt?Qe.Buffer:void 0,Rn=Qe.Symbol,Lt=Qe.Uint8Array,ei=X.propertyIsEnumerable,vn=he.splice,Pr=Rn?Rn.toStringTag:void 0,GO=Object.getOwnPropertySymbols,bW=Jn?Jn.isBuffer:void 0,yW=Ir(Object.keys,Object),Q1=dl(Qe,"DataView"),Tc=dl(Qe,"Map"),W1=dl(Qe,"Promise"),Z1=dl(Qe,"Set"),J1=dl(Qe,"WeakMap"),_c=dl(Object,"create"),vW=ws(Q1),xW=ws(Tc),EW=ws(W1),TW=ws(Z1),_W=ws(J1),XO=Rn?Rn.prototype:void 0,ey=XO?XO.valueOf:void 0;function Ts(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function wW(){this.__data__=_c?_c(null):{},this.size=0}function SW(A){var I=this.has(A)&&delete this.__data__[A];return this.size-=I?1:0,I}function AW(A){var I=this.__data__;if(_c){var G=I[A];return G===i?void 0:G}return ye.call(I,A)?I[A]:void 0}function CW(A){var I=this.__data__;return _c?I[A]!==void 0:ye.call(I,A)}function kW(A,I){var G=this.__data__;return this.size+=this.has(A)?0:1,G[A]=_c&&I===void 0?i:I,this}Ts.prototype.clear=wW,Ts.prototype.delete=SW,Ts.prototype.get=AW,Ts.prototype.has=CW,Ts.prototype.set=kW;function Br(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function OW(){this.__data__=[],this.size=0}function NW(A){var I=this.__data__,G=Ih(I,A);if(G<0)return!1;var se=I.length-1;return G==se?I.pop():vn.call(I,G,1),--this.size,!0}function RW(A){var I=this.__data__,G=Ih(I,A);return G<0?void 0:I[G][1]}function DW(A){return Ih(this.__data__,A)>-1}function MW(A,I){var G=this.__data__,se=Ih(G,A);return se<0?(++this.size,G.push([A,I])):G[se][1]=I,this}Br.prototype.clear=OW,Br.prototype.delete=NW,Br.prototype.get=RW,Br.prototype.has=DW,Br.prototype.set=MW;function _s(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function LW(){this.size=0,this.__data__={hash:new Ts,map:new(Tc||Br),string:new Ts}}function IW(A){var I=Ph(this,A).delete(A);return this.size-=I?1:0,I}function PW(A){return Ph(this,A).get(A)}function BW(A){return Ph(this,A).has(A)}function UW(A,I){var G=Ph(this,A),se=G.size;return G.set(A,I),this.size+=G.size==se?0:1,this}_s.prototype.clear=LW,_s.prototype.delete=IW,_s.prototype.get=PW,_s.prototype.has=BW,_s.prototype.set=UW;function Lh(A){var I=-1,G=A==null?0:A.length;for(this.__data__=new _s;++I<G;)this.add(A[I])}function zW(A){return this.__data__.set(A,i),this}function jW(A){return this.__data__.has(A)}Lh.prototype.add=Lh.prototype.push=zW,Lh.prototype.has=jW;function Da(A){var I=this.__data__=new Br(A);this.size=I.size}function HW(){this.__data__=new Br,this.size=0}function FW(A){var I=this.__data__,G=I.delete(A);return this.size=I.size,G}function VW(A){return this.__data__.get(A)}function YW(A){return this.__data__.has(A)}function qW(A,I){var G=this.__data__;if(G instanceof Br){var se=G.__data__;if(!Tc||se.length<n-1)return se.push([A,I]),this.size=++G.size,this;G=this.__data__=new _s(se)}return G.set(A,I),this.size=G.size,this}Da.prototype.clear=HW,Da.prototype.delete=FW,Da.prototype.get=VW,Da.prototype.has=YW,Da.prototype.set=qW;function GW(A,I){var G=Bh(A),se=!G&&oZ(A),ot=!G&&!se&&ty(A),Se=!G&&!se&&!ot&&n4(A),xt=G||se||ot||Se,Kt=xt?fn(A.length,String):[],nn=Kt.length;for(var gt in A)ye.call(A,gt)&&!(xt&&(gt=="length"||ot&&(gt=="offset"||gt=="parent")||Se&&(gt=="buffer"||gt=="byteLength"||gt=="byteOffset")||nZ(gt,nn)))&&Kt.push(gt);return Kt}function Ih(A,I){for(var G=A.length;G--;)if(ZO(A[G][0],I))return G;return-1}function XW(A,I,G){var se=I(A);return Bh(A)?se:Li(se,G(A))}function wc(A){return A==null?A===void 0?B:m:Pr&&Pr in Object(A)?eZ(A):sZ(A)}function $O(A){return Sc(A)&&wc(A)==o}function KO(A,I,G,se,ot){return A===I?!0:A==null||I==null||!Sc(A)&&!Sc(I)?A!==A&&I!==I:$W(A,I,G,se,KO,ot)}function $W(A,I,G,se,ot,Se){var xt=Bh(A),Kt=Bh(I),nn=xt?l:Ma(A),gt=Kt?l:Ma(I);nn=nn==o?y:nn,gt=gt==o?y:gt;var ti=nn==y,Ii=gt==y,hn=nn==gt;if(hn&&ty(A)){if(!ty(I))return!1;xt=!0,ti=!1}if(hn&&!ti)return Se||(Se=new Da),xt||n4(A)?QO(A,I,G,se,ot,Se):ZW(A,I,nn,G,se,ot,Se);if(!(G&r)){var xi=ti&&ye.call(A,"__wrapped__"),Ei=Ii&&ye.call(I,"__wrapped__");if(xi||Ei){var La=xi?A.value():A,Ur=Ei?I.value():I;return Se||(Se=new Da),ot(La,Ur,G,se,Se)}}return hn?(Se||(Se=new Da),JW(A,I,G,se,ot,Se)):!1}function KW(A){if(!t4(A)||rZ(A))return!1;var I=JO(A)?yn:M;return I.test(ws(A))}function QW(A){return Sc(A)&&e4(A.length)&&!!ge[wc(A)]}function WW(A){if(!aZ(A))return yW(A);var I=[];for(var G in Object(A))ye.call(A,G)&&G!="constructor"&&I.push(G);return I}function QO(A,I,G,se,ot,Se){var xt=G&r,Kt=A.length,nn=I.length;if(Kt!=nn&&!(xt&&nn>Kt))return!1;var gt=Se.get(A);if(gt&&Se.get(I))return gt==I;var ti=-1,Ii=!0,hn=G&a?new Lh:void 0;for(Se.set(A,I),Se.set(I,A);++ti<Kt;){var xi=A[ti],Ei=I[ti];if(se)var La=xt?se(Ei,xi,ti,I,A,Se):se(xi,Ei,ti,A,I,Se);if(La!==void 0){if(La)continue;Ii=!1;break}if(hn){if(!nt(I,function(Ur,Ss){if(!At(hn,Ss)&&(xi===Ur||ot(xi,Ur,G,se,Se)))return hn.push(Ss)})){Ii=!1;break}}else if(!(xi===Ei||ot(xi,Ei,G,se,Se))){Ii=!1;break}}return Se.delete(A),Se.delete(I),Ii}function ZW(A,I,G,se,ot,Se,xt){switch(G){case H:if(A.byteLength!=I.byteLength||A.byteOffset!=I.byteOffset)return!1;A=A.buffer,I=I.buffer;case Y:return!(A.byteLength!=I.byteLength||!Se(new Lt(A),new Lt(I)));case c:case d:case E:return ZO(+A,+I);case f:return A.name==I.name&&A.message==I.message;case S:case D:return A==I+"";case b:var Kt=On;case k:var nn=se&r;if(Kt||(Kt=ne),A.size!=I.size&&!nn)return!1;var gt=xt.get(A);if(gt)return gt==I;se|=a,xt.set(A,I);var ti=QO(Kt(A),Kt(I),se,ot,Se,xt);return xt.delete(A),ti;case L:if(ey)return ey.call(A)==ey.call(I)}return!1}function JW(A,I,G,se,ot,Se){var xt=G&r,Kt=WO(A),nn=Kt.length,gt=WO(I),ti=gt.length;if(nn!=ti&&!xt)return!1;for(var Ii=nn;Ii--;){var hn=Kt[Ii];if(!(xt?hn in I:ye.call(I,hn)))return!1}var xi=Se.get(A);if(xi&&Se.get(I))return xi==I;var Ei=!0;Se.set(A,I),Se.set(I,A);for(var La=xt;++Ii<nn;){hn=Kt[Ii];var Ur=A[hn],Ss=I[hn];if(se)var i4=xt?se(Ss,Ur,hn,I,A,Se):se(Ur,Ss,hn,A,I,Se);if(!(i4===void 0?Ur===Ss||ot(Ur,Ss,G,se,Se):i4)){Ei=!1;break}La||(La=hn=="constructor")}if(Ei&&!La){var Uh=A.constructor,zh=I.constructor;Uh!=zh&&"constructor"in A&&"constructor"in I&&!(typeof Uh=="function"&&Uh instanceof Uh&&typeof zh=="function"&&zh instanceof zh)&&(Ei=!1)}return Se.delete(A),Se.delete(I),Ei}function WO(A){return XW(A,cZ,tZ)}function Ph(A,I){var G=A.__data__;return iZ(I)?G[typeof I=="string"?"string":"hash"]:G.map}function dl(A,I){var G=Es(A,I);return KW(G)?G:void 0}function eZ(A){var I=ye.call(A,Pr),G=A[Pr];try{A[Pr]=void 0;var se=!0}catch{}var ot=Nn.call(A);return se&&(I?A[Pr]=G:delete A[Pr]),ot}var tZ=GO?function(A){return A==null?[]:(A=Object(A),Mi(GO(A),function(I){return ei.call(A,I)}))}:dZ,Ma=wc;(Q1&&Ma(new Q1(new ArrayBuffer(1)))!=H||Tc&&Ma(new Tc)!=b||W1&&Ma(W1.resolve())!=x||Z1&&Ma(new Z1)!=k||J1&&Ma(new J1)!=R)&&(Ma=function(A){var I=wc(A),G=I==y?A.constructor:void 0,se=G?ws(G):"";if(se)switch(se){case vW:return H;case xW:return b;case EW:return x;case TW:return k;case _W:return R}return I});function nZ(A,I){return I=I??s,!!I&&(typeof A=="number"||Pe.test(A))&&A>-1&&A%1==0&&A<I}function iZ(A){var I=typeof A;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?A!=="__proto__":A===null}function rZ(A){return!!$t&&$t in A}function aZ(A){var I=A&&A.constructor,G=typeof I=="function"&&I.prototype||X;return A===G}function sZ(A){return Nn.call(A)}function ws(A){if(A!=null){try{return Ee.call(A)}catch{}try{return A+""}catch{}}return""}function ZO(A,I){return A===I||A!==A&&I!==I}var oZ=$O(function(){return arguments}())?$O:function(A){return Sc(A)&&ye.call(A,"callee")&&!ei.call(A,"callee")},Bh=Array.isArray;function lZ(A){return A!=null&&e4(A.length)&&!JO(A)}var ty=bW||fZ;function uZ(A,I){return KO(A,I)}function JO(A){if(!t4(A))return!1;var I=wc(A);return I==h||I==g||I==u||I==_}function e4(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function t4(A){var I=typeof A;return A!=null&&(I=="object"||I=="function")}function Sc(A){return A!=null&&typeof A=="object"}var n4=vi?tn(vi):QW;function cZ(A){return lZ(A)?GW(A):WW(A)}function dZ(){return[]}function fZ(){return!1}e.exports=uZ}(Jc,Jc.exports);var RD=Jc.exports;const DD=fl(RD),Qt=[];for(let e=0;e<256;++e)Qt.push((e+256).toString(16).slice(1));function MD(e,t=0){return(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase()}let wp;const LD=new Uint8Array(16);function ID(){if(!wp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wp=crypto.getRandomValues.bind(crypto)}return wp(LD)}const px={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Sp(e,t,n){var r;if(px.randomUUID&&!e)return px.randomUUID();e=e||{};const i=e.random??((r=e.rng)==null?void 0:r.call(e))??ID();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,MD(i)}const PD=e=>{console.log(e.error)},BD=e=>{const t=CD({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||PD};return t.use(n),t};let mx=class{constructor({config:t}){var n,i;this.userToken=null,this.constructClientOptions=s=>{const o=this.config.apiUrl||"https://api.open.cx",l={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:s?`Bearer ${s}`:void 0};return{baseUrl:o,headers:l}},this.createOpenAPIClient=({baseUrl:s,headers:o})=>BD({baseUrl:s,onRequest:({request:l})=>{Object.entries(o).forEach(([u,c])=>{c&&l.headers.set(u,c)})}}),this.setAuthToken=s=>{this.userToken=s;const{baseUrl:o,headers:l}=this.constructClientOptions(s);this.client=this.createOpenAPIClient({baseUrl:o,headers:l})},this.getExternalWidgetConfig=async()=>await this.client.GET("/backend/widget/v2/config",{params:{header:{"X-Bot-Token":this.config.token}}}),this.sendMessage=async(s,o)=>await this.client.POST("/backend/widget/v2/chat/send",{body:s,signal:o}),this.createUnverifiedContact=async s=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:s}),this.createSession=async s=>await this.client.POST("/backend/widget/v2/create-session",{body:s}),this.pollSessionAndHistory=async({sessionId:s,lastMessageTimestamp:o,abortSignal:l})=>{const u=o?{lastMessageTimestamp:o}:void 0;return await this.client.GET("/backend/widget/v2/poll/{sessionId}",{params:{path:{sessionId:s},query:u},signal:l})},this.getSessions=async({cursor:s,filters:o,abortSignal:l})=>await this.client.GET("/backend/widget/v2/sessions",{params:{query:{cursor:s,filters:JSON.stringify(o)}},signal:l}),this.uploadFile=async({file:s,abortSignal:o,onProgress:l})=>new Promise((u,c)=>{var d;const f=new FormData;f.append("file",s);const h=new XMLHttpRequest;if(o&&(o.addEventListener("abort",()=>{h.abort(),c(new DOMException("Aborted","AbortError"))}),o.aborted)){c(new DOMException("Aborted","AbortError"));return}h.upload.addEventListener("progress",E=>{if(E.lengthComputable&&l){const m=Math.round(E.loaded/E.total*100);l(m)}}),h.addEventListener("load",()=>{if(h.status>=200&&h.status<300)try{const E=JSON.parse(h.responseText);u(E)}catch(E){c(new Error(`Failed to parse response: ${E}`))}else c(new Error(`Upload failed with status: ${h.status}`))}),h.addEventListener("error",()=>{c(new Error("Network error occurred"))}),h.addEventListener("timeout",()=>{c(new Error("Upload timed out"))});const{baseUrl:g}=this.constructClientOptions(this.userToken),b=`${g}/backend/widget/v2/upload`;h.open("POST",b),h.setRequestHeader("X-Bot-Token",this.config.token),this.userToken??((d=this.config.user)==null?void 0:d.token)?h.setRequestHeader("Authorization",`Bearer ${this.userToken}`):console.error("User token not set"),h.send(f)}),this.vote=async s=>await this.client.POST("/backend/widget/v2/chat/vote",{body:s}),this.resolveSession=async(s,o)=>await this.client.POST("/backend/widget/v2/session/resolve",{body:s,signal:o}),this.createStateCheckpoint=async s=>await this.client.POST("/backend/widget/v2/checkpoint",{body:s}),this.submitCsat=async s=>await this.client.POST("/backend/widget/v2/submit-csat",{body:s}),this.config=t,this.userToken=((n=t.user)==null?void 0:n.token)||null;const{baseUrl:r,headers:a}=this.constructClientOptions((i=t.user)==null?void 0:i.token);this.client=this.createOpenAPIClient({baseUrl:r,headers:a})}};function ii(e,t){console.error(`Missing case for ${e} in ${t}`)}class Us{constructor(t){this.subscribers=new Set,this.get=()=>this.state,this.set=n=>{DD(this.state,n)||(this.state=n,this.notifySubscribers(n))},this.setPartial=n=>{if(n==null)return;const i={...this.state,...n};this.set(i)},this.reset=()=>{this.set(this.initialState)},this.notifySubscribers=n=>{Array.from(this.subscribers).forEach(i=>{try{i(n)}catch(r){console.error(r)}})},this.subscribe=n=>(this.subscribers.add(n),()=>{this.subscribers.delete(n)}),this.state=t,this.initialState=t}}let gx=class{constructor(){this.state=new Us({isPolling:!1,isError:!1}),this.abortController=new AbortController,this.reset=()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null},this.stopPolling=null,this.startPolling=(t,n)=>{if(this.stopPolling)return;const i=[],r=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):i.push(setTimeout(r,n))};r(),this.stopPolling=()=>{i.forEach(clearTimeout),this.state.reset()}}}};function bx(e){try{const t=e();return t instanceof Promise?t.then(n=>({data:n})).catch(n=>({error:n})):{data:t}}catch(t){return{error:t}}}class UD{constructor({api:t,config:n,sessionCtx:i,messageCtx:r,sessionPollingIntervalSeconds:a}){this.poller=new gx,this.fetchSessionAndFullHistoryAbortController=new AbortController,this.registerPolling=()=>{this.sessionCtx.sessionState.subscribe(({session:s})=>{s!=null&&s.id?this.poller.startPolling(async o=>{this.fetchSessionAndHistory({sessionId:s.id,abortSignal:o})},this.sessionPollingIntervalSeconds*1e3):this.poller.reset()}),this.sessionCtx.sessionState.subscribe(({session:s})=>{if(s!=null&&s.id&&!s.isOpened)try{this.fetchSessionAndFullHistoryAbortController=new AbortController,this.fetchSessionAndHistory({sessionId:s.id,abortSignal:this.fetchSessionAndFullHistoryAbortController.signal,fetchFullHistory:!0})}catch(o){this.fetchSessionAndFullHistoryAbortController.signal.aborted||console.error("Failed to fetch session and full history:",o)}else this.fetchSessionAndFullHistoryAbortController.abort()})},this.fetchSessionAndHistory=async({sessionId:s,abortSignal:o,fetchFullHistory:l=!1})=>{var u;this.messageCtx.state.get().messages.length===0&&this.messageCtx.state.setPartial({isInitialFetchLoading:!0});const c=this.messageCtx.state.get().messages,d=c.length>0?((u=c[c.length-1])==null?void 0:u.timestamp)??void 0:void 0,{data:f}=await this.api.pollSessionAndHistory({sessionId:s,abortSignal:o,lastMessageTimestamp:l?void 0:d});if(f!=null&&f.session&&(this.sessionCtx.sessionState.setPartial({session:f.session}),this.sessionCtx.setSessions([f.session])),f!=null&&f.history&&f.history.length>0){const h=this.messageCtx.state.get().messages,g=f.history.map(this.mapHistoryToMessage).filter(b=>b!==null).filter(b=>!h.some(E=>E.id===b.id));this.messageCtx.state.setPartial({messages:[...h,...g]})}this.messageCtx.state.get().isInitialFetchLoading&&this.messageCtx.state.setPartial({isInitialFetchLoading:!1})},this.mapHistoryToMessage=s=>{var o,l;const u={id:s.publicId,timestamp:s.sentAt||"",attachments:s.attachments||void 0};if(s.sender.kind==="user")return{...u,type:"USER",content:s.content.text||"",deliveredAt:s.sentAt||""};if(s.sender.kind==="agent")return{...u,type:"AGENT",component:"agent_message",data:{message:s.content.text||""},agent:{name:s.sender.name||"",avatar:s.sender.avatar||"",id:null,isAi:!1}};if(s.sender.kind==="ai"){const c=s.actionCalls&&s.actionCalls.length>0?s.actionCalls[s.actionCalls.length-1]:void 0;return{...u,type:"AI",component:"bot_message",agent:{id:null,name:((o=this.config.bot)==null?void 0:o.name)||"",isAi:!0,avatar:((l=this.config.bot)==null?void 0:l.avatar)||""},data:{message:s.content.text||"",action:c?{name:c.actionName,data:this.extractActionResult(c)}:void 0}}}if(s.sender.kind==="system"){const c=this.constructSystemMessage(s);return c===null?null:{...c}}return null},this.constructSystemMessage=s=>{if(!s||!s.systemMessagePayload)return null;switch(s.systemMessagePayload.type){case"state_checkpoint":return{id:s.publicId,type:"SYSTEM",subtype:"state_checkpoint",data:{payload:s.systemMessagePayload.payload},timestamp:s.sentAt||"",attachments:void 0};case"csat_requested":return{id:s.publicId,type:"SYSTEM",subtype:"csat_requested",data:{payload:void 0},timestamp:s.sentAt||"",attachments:void 0};case"csat_submitted":return{id:s.publicId,type:"SYSTEM",subtype:"csat_submitted",data:{payload:{score:s.systemMessagePayload.payload.score??void 0,feedback:s.systemMessagePayload.payload.feedback??void 0}},timestamp:s.sentAt||"",attachments:void 0};case"none":return null;default:return ii(s.systemMessagePayload,this.constructSystemMessage.name),null}},this.extractActionResult=s=>{const o=s.result;if(o===null||typeof o!="object")return o;if("responseBodyText"in o&&typeof o.responseBodyText=="string"){const l=o.responseBodyText,u=bx(()=>JSON.parse(l)).data;if(u)return u}return s.result},this.api=t,this.config=n,this.sessionCtx=i,this.messageCtx=r,this.sessionPollingIntervalSeconds=a,this.registerPolling()}}let zD=class{constructor({config:t,api:n,storageCtx:i}){var r;this.shouldCollectData=()=>{var a;return!!(!((a=this.state.get().contact)!=null&&a.token)&&this.config.collectUserData)},this.autoCreateUnverifiedUserIfNotExists=async()=>{var a,s,o,l,u,c,d,f,h,g,b,E,m,y;if(!((a=this.config.user)!=null&&a.token)){if(this.config.collectUserData&&!((o=(s=this.config.user)==null?void 0:s.data)!=null&&o.email)){if((l=this.config.extraDataCollectionFields)!=null&&l.length)return;const x=await((u=this.storageCtx)==null?void 0:u.getContactToken());x&&await this.setUnverifiedContact(x);return}if(!((d=(c=this.config.user)==null?void 0:c.data)!=null&&d.email)){const x=await((f=this.storageCtx)==null?void 0:f.getContactToken());if(x){await this.setUnverifiedContact(x);return}}await this.createUnverifiedContact({email:(g=(h=this.config.user)==null?void 0:h.data)==null?void 0:g.email,non_verified_name:(E=(b=this.config.user)==null?void 0:b.data)==null?void 0:E.name,non_verified_custom_data:(y=(m=this.config.user)==null?void 0:m.data)==null?void 0:y.customData})}},this.createUnverifiedContact=async(a,s)=>{this.state.setPartial({extraCollectedData:s});try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:o}=await this.api.createUnverifiedContact(a);o!=null&&o.token?await this.setUnverifiedContact(o.token):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}},this.setUnverifiedContact=async a=>{var s,o,l,u;const c=await((s=this.storageCtx)==null?void 0:s.getExternalContactId()),d=((o=this.config.user)==null?void 0:o.externalId)||c||Sp();this.api.setAuthToken(a),await((l=this.storageCtx)==null?void 0:l.setContactToken(a)),await((u=this.storageCtx)==null?void 0:u.setExternalContactId(d)),this.state.setPartial({contact:{token:a,externalId:d}})},this.config=t,this.storageCtx=i,this.api=n,this.state=new Us({contact:(r=t.user)!=null&&r.token?{token:t.user.token,externalId:t.user.externalId}:null,extraCollectedData:void 0,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),this.autoCreateUnverifiedUserIfNotExists()}};function vl(){return Sp()}let jD=class{constructor({config:t,api:n,sessionCtx:i,messageCtx:r}){this.submitCsat=async a=>{var s;const o=(s=this.sessionCtx.sessionState.get().session)==null?void 0:s.id;if(!o)return{data:null,error:"No session id found"};const l=vl();this.messageCtx.state.setPartial({messages:[...this.messageCtx.state.get().messages,{id:l,type:"SYSTEM",subtype:"csat_submitted",timestamp:new Date().toISOString(),data:{payload:{score:a.score,feedback:a.feedback}}}]});const{data:u,error:c}=await this.api.submitCsat({...a,system_message_uuid:l,session_id:o});return{data:u,error:c}},this.config=t,this.api=n,this.sessionCtx=i,this.messageCtx=r}},HD=class{constructor({config:t,api:n,contactCtx:i,sessionsPollingIntervalSeconds:r}){this.sessionsRefresher=new gx,this.sessionState=new Us({session:null,isCreatingSession:!1,isResolvingSession:!1}),this.sessionsState=new Us({data:[],cursor:void 0,isLastPage:!1,didStartInitialFetch:!1,isInitialFetchLoading:!0}),this.reset=async()=>{this.sessionState.reset()},this.registerSessionsRefresherWrapper=()=>{var a;(a=this.contactCtx.state.get().contact)!=null&&a.token&&!this.sessionsState.get().didStartInitialFetch?this.registerSessionsRefresher():this.contactCtx.state.subscribe(({contact:s})=>{s!=null&&s.token&&!this.sessionsState.get().didStartInitialFetch&&this.registerSessionsRefresher()})},this.registerSessionsRefresher=()=>{this.sessionsRefresher.startPolling(async()=>{this.sessionsState.get().didStartInitialFetch===!1&&this.sessionsState.setPartial({didStartInitialFetch:!0}),await this.refreshSessions(),this.sessionsState.get().isInitialFetchLoading===!0&&this.sessionsState.setPartial({isInitialFetchLoading:!1})},this.sessionsPollingIntervalSeconds*1e3)},this.getParsedCustomData=()=>Object.fromEntries(Object.entries(this.config.sessionCustomData||{}).map(([a,s])=>{var o;return typeof s=="string"?[a,s]:typeof s=="boolean"?[a,s]:typeof s=="number"?[a,s]:[a,((o=bx(()=>JSON.stringify(s)))==null?void 0:o.data)||""]})),this.createSession=async()=>{var a;this.sessionState.setPartial({session:null,isCreatingSession:!0});const s=(a=this.contactCtx.state.get().contact)==null?void 0:a.externalId,o={...this.getParsedCustomData(),...s?{external_id:s}:{}},{data:l,error:u}=await this.api.createSession({customData:Object.keys(o).length>0?o:void 0});return l?(this.sessionState.setPartial({session:l,isCreatingSession:!1}),l):(this.sessionState.setPartial({isCreatingSession:!1}),console.error("Failed to create session:",u),null)},this.loadMoreSessions=async()=>{if(this.sessionsState.get().isLastPage)return;const{data:a}=await this.getSessions({cursor:this.sessionsState.get().cursor});if(a){const s=[...this.sessionsState.get().data,...a.items].filter((o,l,u)=>l===u.findIndex(c=>o.id===c.id));this.sessionsState.setPartial({data:s,cursor:a.next||void 0,isLastPage:a.next===null})}},this.getSessions=async({cursor:a})=>{var s,o;if(!((s=this.contactCtx.state.get().contact)!=null&&s.token))return{data:null};const l=(o=this.contactCtx.state.get().contact)==null?void 0:o.externalId;return await this.api.getSessions({cursor:a,filters:l?{external_id:l}:{}})},this.setSessions=a=>{const s=[...a,...this.sessionsState.get().data].filter((o,l,u)=>l===u.findIndex(c=>o.id===c.id));this.sessionsState.setPartial({data:s})},this.refreshSessions=async()=>{const{data:a}=await this.getSessions({cursor:void 0});a&&this.setSessions(a.items)},this.resolveSession=async()=>{const a=this.sessionState.get().session;if(!a||!a.isOpened)return{success:!1,error:"Session is not opened"};this.sessionState.setPartial({isResolvingSession:!0});const{data:s,error:o}=await this.api.resolveSession({session_id:a.id});return s?(this.sessionState.setPartial({session:s,isResolvingSession:!1}),{success:!0,data:s}):(this.sessionState.setPartial({isResolvingSession:!1}),{success:!1,error:o})},this.createStateCheckpoint=async a=>{var s;const o=(s=this.sessionState.get().session)==null?void 0:s.id;if(!o)return;const{data:l,error:u}=await this.api.createStateCheckpoint({session_id:o,payload:a});return l!=null&&l.success?{success:!0}:{success:!1}},this.config=t,this.api=n,this.contactCtx=i,this.sessionsPollingIntervalSeconds=r,this.registerSessionsRefresherWrapper()}};class FD{constructor({config:t,api:n,sessionCtx:i,contactCtx:r}){this.state=new Us({messages:[],isSendingMessage:!1,isSendingMessageToAI:!1,lastAIResMightSolveUserIssue:!1,isInitialFetchLoading:!1}),this.sendMessageAbortController=new AbortController,this.reset=()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset()},this.sendMessage=async a=>{var s,o,l,u,c,d,f,h,g;try{if(!a.content.trim()&&(!a.attachments||a.attachments.length===0)){console.warn("Cannot send an empty message of no content or attachments");return}const b=this.sessionCtx.sessionState.get().session,E=(b==null?void 0:b.assignee.kind)==="ai",m=this.state.get().isSendingMessageToAI,y=this.state.get().messages.at(-1);if(m||E&&(y==null?void 0:y.type)==="USER"){console.warn("Cannot send messages while awaiting AI response");return}this.sendMessageAbortController=new AbortController,this.state.setPartial({lastAIResMightSolveUserIssue:!1,isSendingMessage:!0,isSendingMessageToAI:!!E||!b});const x=this.state.get().messages,_=!((s=this.sessionCtx.sessionState.get().session)!=null&&s.id)&&x.length===0&&((o=this.config.advancedInitialMessages)==null?void 0:o.some(B=>B.persistent)),S=_?(this.config.advancedInitialMessages||[]).filter(B=>B.persistent).map(B=>({id:vl(),component:"bot_message",type:"AI",timestamp:new Date().toISOString(),data:{message:B.message}})):[],k=this.toUserMessage(a.content.trim(),a.attachments||void 0);if(this.state.setPartial({messages:[...S,...x,k]}),!((l=this.sessionCtx.sessionState.get().session)!=null&&l.id)){if(!await this.sessionCtx.createSession()){console.error("Failed to create session");return}this.sessionCtx.refreshSessions()}const D=(u=this.sessionCtx.sessionState.get().session)==null?void 0:u.id;if(!D)return;const{data:L}=await this.api.sendMessage({uuid:k.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,body_properties:this.config.bodyProperties,session_id:D,content:k.content,attachments:a.attachments,clientContext:this.config.context,custom_data:{...this.config.messageCustomData||{},...a.customData||{}},language:this.config.language,exit_mode_prompt:a.exitModePrompt,initial_messages:_?S.map(B=>({uuid:B.id,content:B.data.message})):void 0},this.sendMessageAbortController.signal);if(L!=null&&L.success){const B=this.toBotMessage(L);if(B){const R=this.state.get().messages;if(R.some(Y=>Y.id===B.id)){this.state.setPartial({lastAIResMightSolveUserIssue:((c=L.autopilotResponse)==null?void 0:c.mightSolveUserIssue)||((d=L.uiResponse)==null?void 0:d.mightSolveUserIssue)});return}this.state.setPartial({messages:[...R,B],lastAIResMightSolveUserIssue:((f=L.autopilotResponse)==null?void 0:f.mightSolveUserIssue)||((h=L.uiResponse)==null?void 0:h.mightSolveUserIssue)})}L.session&&this.sessionCtx.sessionState.setPartial({session:L.session})}else{const B=this.toBotErrorMessage(((g=L==null?void 0:L.error)==null?void 0:g.message)||"Something went wrong. Please refresh the page or try again."),R=this.state.get().messages;this.state.setPartial({messages:[...R,B]})}}catch(b){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",b)}finally{this.state.setPartial({isSendingMessage:!1,isSendingMessageToAI:!1})}},this.toUserMessage=(a,s)=>{const o=(()=>{const l=this.contactCtx.state.get().extraCollectedData;return this.state.get().messages.length===0&&l&&Object.keys(l).length>0?`${Object.entries(l).filter(([u,c])=>!!c).map(([u,c])=>`${u}: ${c}`).join(`
|
|
65
|
+
`)},lD=0,Ps=[];function uD(e){var t=T.useRef([]),n=T.useRef([0,0]),i=T.useRef(),r=T.useState(lD++)[0],a=T.useState(Yv)[0],s=T.useRef(e);T.useEffect(function(){s.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=yp([e.lockRef.current],(e.shards||[]).map(Wv),!0).filter(Boolean);return b.forEach(function(E){return E.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=T.useCallback(function(b,E){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var m=Qc(b),y=n.current,x="deltaX"in b?b.deltaX:y[0]-m[0],_="deltaY"in b?b.deltaY:y[1]-m[1],S,k=b.target,D=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in b&&D==="h"&&k.type==="range")return!1;var L=Xv(D,k);if(!L)return!0;if(L?S=D:(S=D==="v"?"h":"v",L=Xv(D,k)),!L)return!1;if(!i.current&&"changedTouches"in b&&(x||_)&&(i.current=S),!S)return!0;var B=i.current||S;return aD(B,E,b,B==="h"?x:_)},[]),l=T.useCallback(function(b){var E=b;if(!(!Ps.length||Ps[Ps.length-1]!==a)){var m="deltaY"in E?Qv(E):Qc(E),y=t.current.filter(function(S){return S.name===E.type&&(S.target===E.target||E.target===S.shadowParent)&&sD(S.delta,m)})[0];if(y&&y.should){E.cancelable&&E.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(Wv).filter(Boolean).filter(function(S){return S.contains(E.target)}),_=x.length>0?o(E,x[0]):!s.current.noIsolation;_&&E.cancelable&&E.preventDefault()}}},[]),u=T.useCallback(function(b,E,m,y){var x={name:b,delta:E,target:m,should:y,shadowParent:cD(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),c=T.useCallback(function(b){n.current=Qc(b),i.current=void 0},[]),d=T.useCallback(function(b){u(b.type,Qv(b),b.target,o(b,e.lockRef.current))},[]),f=T.useCallback(function(b){u(b.type,Qc(b),b.target,o(b,e.lockRef.current))},[]);T.useEffect(function(){return Ps.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Is),document.addEventListener("touchmove",l,Is),document.addEventListener("touchstart",c,Is),function(){Ps=Ps.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Is),document.removeEventListener("touchmove",l,Is),document.removeEventListener("touchstart",c,Is)}},[]);var h=e.removeScrollBar,g=e.inert;return T.createElement(T.Fragment,null,g?T.createElement(a,{styles:oD(r)}):null,h?T.createElement(ZR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dD=zR(Vv,uD);var Zv=T.forwardRef(function(e,t){return T.createElement($c,ni({},e,{ref:t,sideCar:dD}))});Zv.classNames=$c.classNames;var Wc="Popover",[Jv,pZ]=kc(Wc,[zc]),yl=zc(),[fD,Ba]=Jv(Wc),ex=e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:a,modal:s=!1}=e,o=yl(t),l=T.useRef(null),[u,c]=T.useState(!1),[d,f]=mv({prop:i,defaultProp:r??!1,onChange:a,caller:Wc});return v.jsx(fv,{...o,children:v.jsx(fD,{scope:t,contentId:Ly(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:u,onCustomAnchorAdd:T.useCallback(()=>c(!0),[]),onCustomAnchorRemove:T.useCallback(()=>c(!1),[]),modal:s,children:n})})};ex.displayName=Wc;var tx="PopoverAnchor",nx=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(tx,n),a=yl(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=r;return T.useEffect(()=>(s(),()=>o()),[s,o]),v.jsx(hp,{...a,...i,ref:t})});nx.displayName=tx;var ix="PopoverTrigger",rx=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(ix,n),a=yl(n),s=Pi(t,r.triggerRef),o=v.jsx(Mn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":lx(r.open),...i,ref:s,onClick:xn(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?o:v.jsx(hp,{asChild:!0,...a,children:o})});rx.displayName=ix;var hD="PopoverPortal",[mZ,pD]=Jv(hD,{forceMount:void 0}),Bs="PopoverContent",ax=T.forwardRef((e,t)=>{const n=pD(Bs,e.__scopePopover),{forceMount:i=n.forceMount,...r}=e,a=Ba(Bs,e.__scopePopover);return v.jsx(pp,{present:i||a.open,children:a.modal?v.jsx(gD,{...r,ref:t}):v.jsx(bD,{...r,ref:t})})});ax.displayName=Bs;var mD=Xh("PopoverContent.RemoveScroll"),gD=T.forwardRef((e,t)=>{const n=Ba(Bs,e.__scopePopover),i=T.useRef(null),r=Pi(t,i),a=T.useRef(!1);return T.useEffect(()=>{const s=i.current;if(s)return CR(s)},[]),v.jsx(Zv,{as:mD,allowPinchZoom:!0,children:v.jsx(sx,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xn(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),a.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:xn(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:xn(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),bD=T.forwardRef((e,t)=>{const n=Ba(Bs,e.__scopePopover),i=T.useRef(!1),r=T.useRef(!1);return v.jsx(sx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(i.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),sx=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=e,f=Ba(Bs,n),h=yl(n);return V4(),v.jsx(Oy,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:a,children:v.jsx(Kh,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:c,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:v.jsx(hv,{"data-state":lx(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ox="PopoverClose",yD=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=Ba(ox,n);return v.jsx(Mn.button,{type:"button",...i,ref:t,onClick:xn(e.onClick,()=>r.onOpenChange(!1))})});yD.displayName=ox;var vD="PopoverArrow",xD=T.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,r=yl(n);return v.jsx(pv,{...r,...i,ref:t})});xD.displayName=vD;function lx(e){return e?"open":"closed"}var ED=ex,TD=nx,_D=ax;const wD=/\{[^{}]+\}/g,SD=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function AD(){return Math.random().toString(36).slice(2,11)}function CD(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:i=globalThis.fetch,querySerializer:r,bodySerializer:a,headers:s,requestInitExt:o=void 0,...l}={...e};o=SD()?o:void 0,t=hx(t);const u=[];async function c(d,f){const{baseUrl:h,fetch:g=i,Request:b=n,headers:E,params:m={},parseAs:y="json",querySerializer:x,bodySerializer:_=a??OD,body:S,...k}=f||{};let D=t;h&&(D=hx(h)??t);let L=typeof r=="function"?r:dx(r);x&&(L=typeof x=="function"?x:dx({...typeof r=="object"?r:{},...x}));const B=S===void 0?void 0:_(S,fx(s,E,m.header)),R=fx(B===void 0||B instanceof FormData?{}:{"Content-Type":"application/json"},s,E,m.header),Y={redirect:"follow",...l,...k,body:B,headers:R};let H,re,ee=new n(ND(d,{baseUrl:D,params:m,querySerializer:L}),Y),Q;for(const V in k)V in ee||(ee[V]=k[V]);if(u.length){H=AD(),re=Object.freeze({baseUrl:D,fetch:g,parseAs:y,querySerializer:L,bodySerializer:_});for(const V of u)if(V&&typeof V=="object"&&typeof V.onRequest=="function"){const j=await V.onRequest({request:ee,schemaPath:d,params:m,options:re,id:H});if(j)if(j instanceof n)ee=j;else if(j instanceof Response){Q=j;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!Q){try{Q=await g(ee,o)}catch(V){let j=V;if(u.length)for(let te=u.length-1;te>=0;te--){const O=u[te];if(O&&typeof O=="object"&&typeof O.onError=="function"){const be=await O.onError({request:ee,error:j,schemaPath:d,params:m,options:re,id:H});if(be){if(be instanceof Response){j=void 0,Q=be;break}if(be instanceof Error){j=be;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(j)throw j}if(u.length)for(let V=u.length-1;V>=0;V--){const j=u[V];if(j&&typeof j=="object"&&typeof j.onResponse=="function"){const te=await j.onResponse({request:ee,response:Q,schemaPath:d,params:m,options:re,id:H});if(te){if(!(te instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Q=te}}}}if(Q.status===204||ee.method==="HEAD"||Q.headers.get("Content-Length")==="0")return Q.ok?{data:void 0,response:Q}:{error:void 0,response:Q};if(Q.ok)return y==="stream"?{data:Q.body,response:Q}:{data:await Q[y](),response:Q};let F=await Q.text();try{F=JSON.parse(F)}catch{}return{error:F,response:Q}}return{request(d,f,h){return c(f,{...h,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(f)}},eject(...d){for(const f of d){const h=u.indexOf(f);h!==-1&&u.splice(h,1)}}}}function Zc(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function ux(e,t,n){if(!t||typeof t!="object")return"";const i=[],r={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const o in t)i.push(o,n.allowReserved===!0?t[o]:encodeURIComponent(t[o]));const s=i.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(const s in t){const o=n.style==="deepObject"?`${e}[${s}]`:s;i.push(Zc(o,t[s],n))}const a=i.join(r);return n.style==="label"||n.style==="matrix"?`${r}${a}`:a}function cx(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(a);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}const i={simple:",",label:".",matrix:";"}[n.style]||"&",r=[];for(const a of t)n.style==="simple"||n.style==="label"?r.push(n.allowReserved===!0?a:encodeURIComponent(a)):r.push(Zc(e,a,n));return n.style==="label"||n.style==="matrix"?`${i}${r.join(i)}`:r.join(i)}function dx(e){return function(n){const i=[];if(n&&typeof n=="object")for(const r in n){const a=n[r];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;i.push(cx(r,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){i.push(ux(r,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}i.push(Zc(r,a,e))}}return i.join("&")}}function kD(e,t){let n=e;for(const i of e.match(wD)??[]){let r=i.substring(1,i.length-1),a=!1,s="simple";if(r.endsWith("*")&&(a=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(s="label",r=r.substring(1)):r.startsWith(";")&&(s="matrix",r=r.substring(1)),!t||t[r]===void 0||t[r]===null)continue;const o=t[r];if(Array.isArray(o)){n=n.replace(i,cx(r,o,{style:s,explode:a}));continue}if(typeof o=="object"){n=n.replace(i,ux(r,o,{style:s,explode:a}));continue}if(s==="matrix"){n=n.replace(i,`;${Zc(r,o)}`);continue}n=n.replace(i,s==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function OD(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function ND(e,t){var r;let n=`${t.baseUrl}${e}`;(r=t.params)!=null&&r.path&&(n=kD(n,t.params.path));let i=t.querySerializer(t.params.query??{});return i.startsWith("?")&&(i=i.substring(1)),i&&(n+=`?${i}`),n}function fx(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const i=n instanceof Headers?n.entries():Object.entries(n);for(const[r,a]of i)if(a===null)t.delete(r);else if(Array.isArray(a))for(const s of a)t.append(r,s);else a!==void 0&&t.set(r,a)}return t}function hx(e){return e.endsWith("/")?e.substring(0,e.length-1):e}var Jc={exports:{}};Jc.exports,function(e,t){var n=200,i="__lodash_hash_undefined__",r=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",g="[object GeneratorFunction]",b="[object Map]",E="[object Number]",m="[object Null]",y="[object Object]",x="[object Promise]",_="[object Proxy]",S="[object RegExp]",k="[object Set]",D="[object String]",L="[object Symbol]",B="[object Undefined]",R="[object WeakMap]",Y="[object ArrayBuffer]",H="[object DataView]",re="[object Float32Array]",ee="[object Float64Array]",Q="[object Int8Array]",F="[object Int16Array]",V="[object Int32Array]",j="[object Uint8Array]",te="[object Uint8ClampedArray]",O="[object Uint16Array]",be="[object Uint32Array]",tt=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[re]=ge[ee]=ge[Q]=ge[F]=ge[V]=ge[j]=ge[te]=ge[O]=ge[be]=!0,ge[o]=ge[l]=ge[Y]=ge[c]=ge[H]=ge[d]=ge[f]=ge[h]=ge[b]=ge[E]=ge[y]=ge[S]=ge[k]=ge[D]=ge[R]=!1;var Be=typeof zr=="object"&&zr&&zr.Object===Object&&zr,dn=typeof self=="object"&&self&&self.Object===Object&&self,Qe=Be||dn||Function("return this")(),Xt=t&&!t.nodeType&&t,Dt=Xt&&!0&&e&&!e.nodeType&&e,jt=Dt&&Dt.exports===Xt,Mt=jt&&Be.process,ae=function(){try{return Mt&&Mt.binding&&Mt.binding("util")}catch{}}(),vi=ae&&ae.isTypedArray;function Mi(A,I){for(var G=-1,se=A==null?0:A.length,ot=0,Se=[];++G<se;){var xt=A[G];I(xt,G,A)&&(Se[ot++]=xt)}return Se}function Li(A,I){for(var G=-1,se=I.length,ot=A.length;++G<se;)A[ot+G]=I[G];return A}function nt(A,I){for(var G=-1,se=A==null?0:A.length;++G<se;)if(I(A[G],G,A))return!0;return!1}function fn(A,I){for(var G=-1,se=Array(A);++G<A;)se[G]=I(G);return se}function tn(A){return function(I){return A(I)}}function At(A,I){return A.has(I)}function Es(A,I){return A==null?void 0:A[I]}function On(A){var I=-1,G=Array(A.size);return A.forEach(function(se,ot){G[++I]=[ot,se]}),G}function Ir(A,I){return function(G){return A(I(G))}}function ne(A){var I=-1,G=Array(A.size);return A.forEach(function(se){G[++I]=se}),G}var he=Array.prototype,U=Function.prototype,X=Object.prototype,le=Qe["__core-js_shared__"],Ee=U.toString,ye=X.hasOwnProperty,$t=function(){var A=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),Nn=X.toString,yn=RegExp("^"+Ee.call(ye).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jn=jt?Qe.Buffer:void 0,Rn=Qe.Symbol,Lt=Qe.Uint8Array,ei=X.propertyIsEnumerable,vn=he.splice,Pr=Rn?Rn.toStringTag:void 0,GO=Object.getOwnPropertySymbols,bW=Jn?Jn.isBuffer:void 0,yW=Ir(Object.keys,Object),Q1=dl(Qe,"DataView"),Tc=dl(Qe,"Map"),W1=dl(Qe,"Promise"),Z1=dl(Qe,"Set"),J1=dl(Qe,"WeakMap"),_c=dl(Object,"create"),vW=ws(Q1),xW=ws(Tc),EW=ws(W1),TW=ws(Z1),_W=ws(J1),XO=Rn?Rn.prototype:void 0,ey=XO?XO.valueOf:void 0;function Ts(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function wW(){this.__data__=_c?_c(null):{},this.size=0}function SW(A){var I=this.has(A)&&delete this.__data__[A];return this.size-=I?1:0,I}function AW(A){var I=this.__data__;if(_c){var G=I[A];return G===i?void 0:G}return ye.call(I,A)?I[A]:void 0}function CW(A){var I=this.__data__;return _c?I[A]!==void 0:ye.call(I,A)}function kW(A,I){var G=this.__data__;return this.size+=this.has(A)?0:1,G[A]=_c&&I===void 0?i:I,this}Ts.prototype.clear=wW,Ts.prototype.delete=SW,Ts.prototype.get=AW,Ts.prototype.has=CW,Ts.prototype.set=kW;function Br(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function OW(){this.__data__=[],this.size=0}function NW(A){var I=this.__data__,G=Ih(I,A);if(G<0)return!1;var se=I.length-1;return G==se?I.pop():vn.call(I,G,1),--this.size,!0}function RW(A){var I=this.__data__,G=Ih(I,A);return G<0?void 0:I[G][1]}function DW(A){return Ih(this.__data__,A)>-1}function MW(A,I){var G=this.__data__,se=Ih(G,A);return se<0?(++this.size,G.push([A,I])):G[se][1]=I,this}Br.prototype.clear=OW,Br.prototype.delete=NW,Br.prototype.get=RW,Br.prototype.has=DW,Br.prototype.set=MW;function _s(A){var I=-1,G=A==null?0:A.length;for(this.clear();++I<G;){var se=A[I];this.set(se[0],se[1])}}function LW(){this.size=0,this.__data__={hash:new Ts,map:new(Tc||Br),string:new Ts}}function IW(A){var I=Ph(this,A).delete(A);return this.size-=I?1:0,I}function PW(A){return Ph(this,A).get(A)}function BW(A){return Ph(this,A).has(A)}function UW(A,I){var G=Ph(this,A),se=G.size;return G.set(A,I),this.size+=G.size==se?0:1,this}_s.prototype.clear=LW,_s.prototype.delete=IW,_s.prototype.get=PW,_s.prototype.has=BW,_s.prototype.set=UW;function Lh(A){var I=-1,G=A==null?0:A.length;for(this.__data__=new _s;++I<G;)this.add(A[I])}function zW(A){return this.__data__.set(A,i),this}function jW(A){return this.__data__.has(A)}Lh.prototype.add=Lh.prototype.push=zW,Lh.prototype.has=jW;function Da(A){var I=this.__data__=new Br(A);this.size=I.size}function HW(){this.__data__=new Br,this.size=0}function FW(A){var I=this.__data__,G=I.delete(A);return this.size=I.size,G}function VW(A){return this.__data__.get(A)}function YW(A){return this.__data__.has(A)}function qW(A,I){var G=this.__data__;if(G instanceof Br){var se=G.__data__;if(!Tc||se.length<n-1)return se.push([A,I]),this.size=++G.size,this;G=this.__data__=new _s(se)}return G.set(A,I),this.size=G.size,this}Da.prototype.clear=HW,Da.prototype.delete=FW,Da.prototype.get=VW,Da.prototype.has=YW,Da.prototype.set=qW;function GW(A,I){var G=Bh(A),se=!G&&oZ(A),ot=!G&&!se&&ty(A),Se=!G&&!se&&!ot&&n4(A),xt=G||se||ot||Se,Kt=xt?fn(A.length,String):[],nn=Kt.length;for(var gt in A)ye.call(A,gt)&&!(xt&&(gt=="length"||ot&&(gt=="offset"||gt=="parent")||Se&&(gt=="buffer"||gt=="byteLength"||gt=="byteOffset")||nZ(gt,nn)))&&Kt.push(gt);return Kt}function Ih(A,I){for(var G=A.length;G--;)if(ZO(A[G][0],I))return G;return-1}function XW(A,I,G){var se=I(A);return Bh(A)?se:Li(se,G(A))}function wc(A){return A==null?A===void 0?B:m:Pr&&Pr in Object(A)?eZ(A):sZ(A)}function $O(A){return Sc(A)&&wc(A)==o}function KO(A,I,G,se,ot){return A===I?!0:A==null||I==null||!Sc(A)&&!Sc(I)?A!==A&&I!==I:$W(A,I,G,se,KO,ot)}function $W(A,I,G,se,ot,Se){var xt=Bh(A),Kt=Bh(I),nn=xt?l:Ma(A),gt=Kt?l:Ma(I);nn=nn==o?y:nn,gt=gt==o?y:gt;var ti=nn==y,Ii=gt==y,hn=nn==gt;if(hn&&ty(A)){if(!ty(I))return!1;xt=!0,ti=!1}if(hn&&!ti)return Se||(Se=new Da),xt||n4(A)?QO(A,I,G,se,ot,Se):ZW(A,I,nn,G,se,ot,Se);if(!(G&r)){var xi=ti&&ye.call(A,"__wrapped__"),Ei=Ii&&ye.call(I,"__wrapped__");if(xi||Ei){var La=xi?A.value():A,Ur=Ei?I.value():I;return Se||(Se=new Da),ot(La,Ur,G,se,Se)}}return hn?(Se||(Se=new Da),JW(A,I,G,se,ot,Se)):!1}function KW(A){if(!t4(A)||rZ(A))return!1;var I=JO(A)?yn:M;return I.test(ws(A))}function QW(A){return Sc(A)&&e4(A.length)&&!!ge[wc(A)]}function WW(A){if(!aZ(A))return yW(A);var I=[];for(var G in Object(A))ye.call(A,G)&&G!="constructor"&&I.push(G);return I}function QO(A,I,G,se,ot,Se){var xt=G&r,Kt=A.length,nn=I.length;if(Kt!=nn&&!(xt&&nn>Kt))return!1;var gt=Se.get(A);if(gt&&Se.get(I))return gt==I;var ti=-1,Ii=!0,hn=G&a?new Lh:void 0;for(Se.set(A,I),Se.set(I,A);++ti<Kt;){var xi=A[ti],Ei=I[ti];if(se)var La=xt?se(Ei,xi,ti,I,A,Se):se(xi,Ei,ti,A,I,Se);if(La!==void 0){if(La)continue;Ii=!1;break}if(hn){if(!nt(I,function(Ur,Ss){if(!At(hn,Ss)&&(xi===Ur||ot(xi,Ur,G,se,Se)))return hn.push(Ss)})){Ii=!1;break}}else if(!(xi===Ei||ot(xi,Ei,G,se,Se))){Ii=!1;break}}return Se.delete(A),Se.delete(I),Ii}function ZW(A,I,G,se,ot,Se,xt){switch(G){case H:if(A.byteLength!=I.byteLength||A.byteOffset!=I.byteOffset)return!1;A=A.buffer,I=I.buffer;case Y:return!(A.byteLength!=I.byteLength||!Se(new Lt(A),new Lt(I)));case c:case d:case E:return ZO(+A,+I);case f:return A.name==I.name&&A.message==I.message;case S:case D:return A==I+"";case b:var Kt=On;case k:var nn=se&r;if(Kt||(Kt=ne),A.size!=I.size&&!nn)return!1;var gt=xt.get(A);if(gt)return gt==I;se|=a,xt.set(A,I);var ti=QO(Kt(A),Kt(I),se,ot,Se,xt);return xt.delete(A),ti;case L:if(ey)return ey.call(A)==ey.call(I)}return!1}function JW(A,I,G,se,ot,Se){var xt=G&r,Kt=WO(A),nn=Kt.length,gt=WO(I),ti=gt.length;if(nn!=ti&&!xt)return!1;for(var Ii=nn;Ii--;){var hn=Kt[Ii];if(!(xt?hn in I:ye.call(I,hn)))return!1}var xi=Se.get(A);if(xi&&Se.get(I))return xi==I;var Ei=!0;Se.set(A,I),Se.set(I,A);for(var La=xt;++Ii<nn;){hn=Kt[Ii];var Ur=A[hn],Ss=I[hn];if(se)var i4=xt?se(Ss,Ur,hn,I,A,Se):se(Ur,Ss,hn,A,I,Se);if(!(i4===void 0?Ur===Ss||ot(Ur,Ss,G,se,Se):i4)){Ei=!1;break}La||(La=hn=="constructor")}if(Ei&&!La){var Uh=A.constructor,zh=I.constructor;Uh!=zh&&"constructor"in A&&"constructor"in I&&!(typeof Uh=="function"&&Uh instanceof Uh&&typeof zh=="function"&&zh instanceof zh)&&(Ei=!1)}return Se.delete(A),Se.delete(I),Ei}function WO(A){return XW(A,cZ,tZ)}function Ph(A,I){var G=A.__data__;return iZ(I)?G[typeof I=="string"?"string":"hash"]:G.map}function dl(A,I){var G=Es(A,I);return KW(G)?G:void 0}function eZ(A){var I=ye.call(A,Pr),G=A[Pr];try{A[Pr]=void 0;var se=!0}catch{}var ot=Nn.call(A);return se&&(I?A[Pr]=G:delete A[Pr]),ot}var tZ=GO?function(A){return A==null?[]:(A=Object(A),Mi(GO(A),function(I){return ei.call(A,I)}))}:dZ,Ma=wc;(Q1&&Ma(new Q1(new ArrayBuffer(1)))!=H||Tc&&Ma(new Tc)!=b||W1&&Ma(W1.resolve())!=x||Z1&&Ma(new Z1)!=k||J1&&Ma(new J1)!=R)&&(Ma=function(A){var I=wc(A),G=I==y?A.constructor:void 0,se=G?ws(G):"";if(se)switch(se){case vW:return H;case xW:return b;case EW:return x;case TW:return k;case _W:return R}return I});function nZ(A,I){return I=I??s,!!I&&(typeof A=="number"||Pe.test(A))&&A>-1&&A%1==0&&A<I}function iZ(A){var I=typeof A;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?A!=="__proto__":A===null}function rZ(A){return!!$t&&$t in A}function aZ(A){var I=A&&A.constructor,G=typeof I=="function"&&I.prototype||X;return A===G}function sZ(A){return Nn.call(A)}function ws(A){if(A!=null){try{return Ee.call(A)}catch{}try{return A+""}catch{}}return""}function ZO(A,I){return A===I||A!==A&&I!==I}var oZ=$O(function(){return arguments}())?$O:function(A){return Sc(A)&&ye.call(A,"callee")&&!ei.call(A,"callee")},Bh=Array.isArray;function lZ(A){return A!=null&&e4(A.length)&&!JO(A)}var ty=bW||fZ;function uZ(A,I){return KO(A,I)}function JO(A){if(!t4(A))return!1;var I=wc(A);return I==h||I==g||I==u||I==_}function e4(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function t4(A){var I=typeof A;return A!=null&&(I=="object"||I=="function")}function Sc(A){return A!=null&&typeof A=="object"}var n4=vi?tn(vi):QW;function cZ(A){return lZ(A)?GW(A):WW(A)}function dZ(){return[]}function fZ(){return!1}e.exports=uZ}(Jc,Jc.exports);var RD=Jc.exports;const DD=fl(RD),Qt=[];for(let e=0;e<256;++e)Qt.push((e+256).toString(16).slice(1));function MD(e,t=0){return(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase()}let wp;const LD=new Uint8Array(16);function ID(){if(!wp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wp=crypto.getRandomValues.bind(crypto)}return wp(LD)}const px={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Sp(e,t,n){var r;if(px.randomUUID&&!e)return px.randomUUID();e=e||{};const i=e.random??((r=e.rng)==null?void 0:r.call(e))??ID();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,MD(i)}const PD=e=>{console.log(e.error)},BD=e=>{const t=CD({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||PD};return t.use(n),t};let mx=class{constructor({config:t}){var n,i;this.userToken=null,this.constructClientOptions=s=>{const o=this.config.apiUrl||"https://api.open.cx",l={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:s?`Bearer ${s}`:void 0};return{baseUrl:o,headers:l}},this.createOpenAPIClient=({baseUrl:s,headers:o})=>BD({baseUrl:s,onRequest:({request:l})=>{Object.entries(o).forEach(([u,c])=>{c&&l.headers.set(u,c)})}}),this.setAuthToken=s=>{this.userToken=s;const{baseUrl:o,headers:l}=this.constructClientOptions(s);this.client=this.createOpenAPIClient({baseUrl:o,headers:l})},this.getExternalWidgetConfig=async()=>await this.client.GET("/backend/widget/v2/config",{params:{header:{"X-Bot-Token":this.config.token}}}),this.sendMessage=async(s,o)=>await this.client.POST("/backend/widget/v2/chat/send",{body:s,signal:o}),this.createUnverifiedContact=async s=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:s}),this.createSession=async s=>await this.client.POST("/backend/widget/v2/create-session",{body:s}),this.pollSessionAndHistory=async({sessionId:s,lastMessageTimestamp:o,abortSignal:l})=>{const u=o?{lastMessageTimestamp:o}:void 0;return await this.client.GET("/backend/widget/v2/poll/{sessionId}",{params:{path:{sessionId:s},query:u},signal:l})},this.getSessions=async({cursor:s,filters:o,abortSignal:l})=>await this.client.GET("/backend/widget/v2/sessions",{params:{query:{cursor:s,filters:JSON.stringify(o)}},signal:l}),this.uploadFile=async({file:s,abortSignal:o,onProgress:l})=>new Promise((u,c)=>{var d;const f=new FormData;f.append("file",s);const h=new XMLHttpRequest;if(o&&(o.addEventListener("abort",()=>{h.abort(),c(new DOMException("Aborted","AbortError"))}),o.aborted)){c(new DOMException("Aborted","AbortError"));return}h.upload.addEventListener("progress",E=>{if(E.lengthComputable&&l){const m=Math.round(E.loaded/E.total*100);l(m)}}),h.addEventListener("load",()=>{if(h.status>=200&&h.status<300)try{const E=JSON.parse(h.responseText);u(E)}catch(E){c(new Error(`Failed to parse response: ${E}`))}else c(new Error(`Upload failed with status: ${h.status}`))}),h.addEventListener("error",()=>{c(new Error("Network error occurred"))}),h.addEventListener("timeout",()=>{c(new Error("Upload timed out"))});const{baseUrl:g}=this.constructClientOptions(this.userToken),b=`${g}/backend/widget/v2/upload`;h.open("POST",b),h.setRequestHeader("X-Bot-Token",this.config.token),this.userToken??((d=this.config.user)==null?void 0:d.token)?h.setRequestHeader("Authorization",`Bearer ${this.userToken}`):console.error("User token not set"),h.send(f)}),this.vote=async s=>await this.client.POST("/backend/widget/v2/chat/vote",{body:s}),this.resolveSession=async(s,o)=>await this.client.POST("/backend/widget/v2/session/resolve",{body:s,signal:o}),this.createStateCheckpoint=async s=>await this.client.POST("/backend/widget/v2/checkpoint",{body:s}),this.submitCsat=async s=>await this.client.POST("/backend/widget/v2/submit-csat",{body:s}),this.config=t,this.userToken=((n=t.user)==null?void 0:n.token)||null;const{baseUrl:r,headers:a}=this.constructClientOptions((i=t.user)==null?void 0:i.token);this.client=this.createOpenAPIClient({baseUrl:r,headers:a})}};function ii(e,t){console.error(`Missing case for ${e} in ${t}`)}class Us{constructor(t){this.subscribers=new Set,this.get=()=>this.state,this.set=n=>{DD(this.state,n)||(this.state=n,this.notifySubscribers(n))},this.setPartial=n=>{if(n==null)return;const i={...this.state,...n};this.set(i)},this.reset=()=>{this.set(this.initialState)},this.notifySubscribers=n=>{Array.from(this.subscribers).forEach(i=>{try{i(n)}catch(r){console.error(r)}})},this.subscribe=n=>(this.subscribers.add(n),()=>{this.subscribers.delete(n)}),this.state=t,this.initialState=t}}let gx=class{constructor(){this.state=new Us({isPolling:!1,isError:!1}),this.abortController=new AbortController,this.reset=()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null},this.stopPolling=null,this.startPolling=(t,n)=>{if(this.stopPolling)return;const i=[],r=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):i.push(setTimeout(r,n))};r(),this.stopPolling=()=>{i.forEach(clearTimeout),this.state.reset()}}}};function bx(e){try{const t=e();return t instanceof Promise?t.then(n=>({data:n})).catch(n=>({error:n})):{data:t}}catch(t){return{error:t}}}class UD{constructor({api:t,config:n,sessionCtx:i,messageCtx:r,sessionPollingIntervalSeconds:a}){this.poller=new gx,this.fetchSessionAndFullHistoryAbortController=new AbortController,this.registerPolling=()=>{this.sessionCtx.sessionState.subscribe(({session:s})=>{s!=null&&s.id?this.poller.startPolling(async o=>{this.fetchSessionAndHistory({sessionId:s.id,abortSignal:o})},this.sessionPollingIntervalSeconds*1e3):this.poller.reset()}),this.sessionCtx.sessionState.subscribe(({session:s})=>{if(s!=null&&s.id&&!s.isOpened)try{this.fetchSessionAndFullHistoryAbortController=new AbortController,this.fetchSessionAndHistory({sessionId:s.id,abortSignal:this.fetchSessionAndFullHistoryAbortController.signal,fetchFullHistory:!0})}catch(o){this.fetchSessionAndFullHistoryAbortController.signal.aborted||console.error("Failed to fetch session and full history:",o)}else this.fetchSessionAndFullHistoryAbortController.abort()})},this.fetchSessionAndHistory=async({sessionId:s,abortSignal:o,fetchFullHistory:l=!1})=>{var u;this.messageCtx.state.get().messages.length===0&&this.messageCtx.state.setPartial({isInitialFetchLoading:!0});const c=this.messageCtx.state.get().messages,d=c.length>0?((u=c[c.length-1])==null?void 0:u.timestamp)??void 0:void 0,{data:f}=await this.api.pollSessionAndHistory({sessionId:s,abortSignal:o,lastMessageTimestamp:l?void 0:d});if(f!=null&&f.session&&(this.sessionCtx.sessionState.setPartial({session:f.session}),this.sessionCtx.setSessions([f.session])),f!=null&&f.history&&f.history.length>0){const h=this.messageCtx.state.get().messages,g=f.history.map(this.mapHistoryToMessage).filter(b=>b!==null).filter(b=>!h.some(E=>E.id===b.id));this.messageCtx.state.setPartial({messages:[...h,...g]})}this.messageCtx.state.get().isInitialFetchLoading&&this.messageCtx.state.setPartial({isInitialFetchLoading:!1})},this.mapHistoryToMessage=s=>{var o,l;const u={id:s.publicId,timestamp:s.sentAt||"",attachments:s.attachments||void 0};if(s.sender.kind==="user")return{...u,type:"USER",content:s.content.text||"",deliveredAt:s.sentAt||""};if(s.sender.kind==="agent")return{...u,type:"AGENT",component:"agent_message",data:{message:s.content.text||""},agent:{name:s.sender.name||"",avatar:s.sender.avatar||"",id:null,isAi:!1}};if(s.sender.kind==="ai"){const c=s.actionCalls&&s.actionCalls.length>0?s.actionCalls[s.actionCalls.length-1]:void 0;return{...u,type:"AI",component:"bot_message",agent:{id:null,name:((o=this.config.bot)==null?void 0:o.name)||"",isAi:!0,avatar:((l=this.config.bot)==null?void 0:l.avatar)||""},data:{message:s.content.text||"",action:c?{name:c.actionName,data:this.extractActionResult(c)}:void 0}}}if(s.sender.kind==="system"){const c=this.constructSystemMessage(s);return c===null?null:{...c}}return null},this.constructSystemMessage=s=>{if(!s||!s.systemMessagePayload)return null;switch(s.systemMessagePayload.type){case"state_checkpoint":return{id:s.publicId,type:"SYSTEM",subtype:"state_checkpoint",data:{payload:s.systemMessagePayload.payload},timestamp:s.sentAt||"",attachments:void 0};case"csat_requested":return{id:s.publicId,type:"SYSTEM",subtype:"csat_requested",data:{payload:void 0},timestamp:s.sentAt||"",attachments:void 0};case"csat_submitted":return{id:s.publicId,type:"SYSTEM",subtype:"csat_submitted",data:{payload:{score:s.systemMessagePayload.payload.score??void 0,feedback:s.systemMessagePayload.payload.feedback??void 0}},timestamp:s.sentAt||"",attachments:void 0};case"none":return null;default:return ii(s.systemMessagePayload,this.constructSystemMessage.name),null}},this.extractActionResult=s=>{const o=s.result;if(o===null||typeof o!="object")return o;if("responseBodyText"in o&&typeof o.responseBodyText=="string"){const l=o.responseBodyText,u=bx(()=>JSON.parse(l)).data;if(u)return u}return s.result},this.api=t,this.config=n,this.sessionCtx=i,this.messageCtx=r,this.sessionPollingIntervalSeconds=a,this.registerPolling()}}let zD=class{constructor({config:t,api:n,storageCtx:i}){var r;this.shouldCollectData=()=>{var a;return!!(!((a=this.state.get().contact)!=null&&a.token)&&this.config.collectUserData)},this.autoCreateUnverifiedUserIfNotExists=async()=>{var a,s,o,l,u,c,d,f,h,g,b,E,m,y;if(!((a=this.config.user)!=null&&a.token)){if(this.config.collectUserData&&!((o=(s=this.config.user)==null?void 0:s.data)!=null&&o.email)){if((l=this.config.extraDataCollectionFields)!=null&&l.length)return;const x=await((u=this.storageCtx)==null?void 0:u.getContactToken());x&&await this.setUnverifiedContact(x);return}if(!((d=(c=this.config.user)==null?void 0:c.data)!=null&&d.email)){const x=await((f=this.storageCtx)==null?void 0:f.getContactToken());if(x){await this.setUnverifiedContact(x);return}}await this.createUnverifiedContact({email:(g=(h=this.config.user)==null?void 0:h.data)==null?void 0:g.email,non_verified_name:(E=(b=this.config.user)==null?void 0:b.data)==null?void 0:E.name,non_verified_custom_data:(y=(m=this.config.user)==null?void 0:m.data)==null?void 0:y.customData})}},this.createUnverifiedContact=async(a,s)=>{this.state.setPartial({extraCollectedData:s});try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:o}=await this.api.createUnverifiedContact(a);o!=null&&o.token?await this.setUnverifiedContact(o.token):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}},this.setUnverifiedContact=async a=>{var s,o,l,u;const c=await((s=this.storageCtx)==null?void 0:s.getExternalContactId()),d=((o=this.config.user)==null?void 0:o.externalId)||c||Sp();this.api.setAuthToken(a),await((l=this.storageCtx)==null?void 0:l.setContactToken(a)),await((u=this.storageCtx)==null?void 0:u.setExternalContactId(d)),this.state.setPartial({contact:{token:a,externalId:d}})},this.config=t,this.storageCtx=i,this.api=n,this.state=new Us({contact:(r=t.user)!=null&&r.token?{token:t.user.token,externalId:t.user.externalId}:null,extraCollectedData:void 0,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),this.autoCreateUnverifiedUserIfNotExists()}};function vl(){return Sp()}let jD=class{constructor({config:t,api:n,sessionCtx:i,messageCtx:r}){this.submitCsat=async a=>{var s;const o=(s=this.sessionCtx.sessionState.get().session)==null?void 0:s.id;if(!o)return{data:null,error:"No session id found"};const l=vl();this.messageCtx.state.setPartial({messages:[...this.messageCtx.state.get().messages,{id:l,type:"SYSTEM",subtype:"csat_submitted",timestamp:new Date().toISOString(),data:{payload:{score:a.score,feedback:a.feedback}}}]});const{data:u,error:c}=await this.api.submitCsat({...a,system_message_uuid:l,session_id:o});return{data:u,error:c}},this.config=t,this.api=n,this.sessionCtx=i,this.messageCtx=r}},HD=class{constructor({config:t,api:n,contactCtx:i,sessionsPollingIntervalSeconds:r}){this.sessionsRefresher=new gx,this.sessionState=new Us({session:null,isCreatingSession:!1,isResolvingSession:!1}),this.sessionsState=new Us({data:[],cursor:void 0,isLastPage:!1,didStartInitialFetch:!1,isInitialFetchLoading:!0}),this.reset=async()=>{this.sessionState.reset()},this.registerSessionsRefresherWrapper=()=>{var a;(a=this.contactCtx.state.get().contact)!=null&&a.token&&!this.sessionsState.get().didStartInitialFetch?this.registerSessionsRefresher():this.contactCtx.state.subscribe(({contact:s})=>{s!=null&&s.token&&!this.sessionsState.get().didStartInitialFetch&&this.registerSessionsRefresher()})},this.registerSessionsRefresher=()=>{this.sessionsRefresher.startPolling(async()=>{this.sessionsState.get().didStartInitialFetch===!1&&this.sessionsState.setPartial({didStartInitialFetch:!0}),await this.refreshSessions(),this.sessionsState.get().isInitialFetchLoading===!0&&this.sessionsState.setPartial({isInitialFetchLoading:!1})},this.sessionsPollingIntervalSeconds*1e3)},this.getParsedCustomData=()=>Object.fromEntries(Object.entries(this.config.sessionCustomData||{}).map(([a,s])=>{var o;return typeof s=="string"?[a,s]:typeof s=="boolean"?[a,s]:typeof s=="number"?[a,s]:[a,((o=bx(()=>JSON.stringify(s)))==null?void 0:o.data)||""]})),this.createSession=async()=>{var a;this.sessionState.setPartial({session:null,isCreatingSession:!0});const s=(a=this.contactCtx.state.get().contact)==null?void 0:a.externalId,o={...this.getParsedCustomData(),...s?{external_id:s}:{}},{data:l,error:u}=await this.api.createSession({customData:Object.keys(o).length>0?o:void 0});return l?(this.sessionState.setPartial({session:l,isCreatingSession:!1}),l):(this.sessionState.setPartial({isCreatingSession:!1}),console.error("Failed to create session:",u),null)},this.loadMoreSessions=async()=>{if(this.sessionsState.get().isLastPage)return;const{data:a}=await this.getSessions({cursor:this.sessionsState.get().cursor});if(a){const s=[...this.sessionsState.get().data,...a.items].filter((o,l,u)=>l===u.findIndex(c=>o.id===c.id));this.sessionsState.setPartial({data:s,cursor:a.next||void 0,isLastPage:a.next===null})}},this.getSessions=async({cursor:a})=>{var s,o;if(!((s=this.contactCtx.state.get().contact)!=null&&s.token))return{data:null};const l=(o=this.contactCtx.state.get().contact)==null?void 0:o.externalId;return await this.api.getSessions({cursor:a,filters:l?{external_id:l}:{}})},this.setSessions=a=>{const s=[...a,...this.sessionsState.get().data].filter((o,l,u)=>l===u.findIndex(c=>o.id===c.id));this.sessionsState.setPartial({data:s})},this.refreshSessions=async()=>{const{data:a}=await this.getSessions({cursor:void 0});a&&this.setSessions(a.items)},this.resolveSession=async()=>{const a=this.sessionState.get().session;if(!a||!a.isOpened)return{success:!1,error:"Session is not opened"};this.sessionState.setPartial({isResolvingSession:!0});const{data:s,error:o}=await this.api.resolveSession({session_id:a.id});return s?(this.sessionState.setPartial({session:s,isResolvingSession:!1}),{success:!0,data:s}):(this.sessionState.setPartial({isResolvingSession:!1}),{success:!1,error:o})},this.createStateCheckpoint=async a=>{var s;const o=(s=this.sessionState.get().session)==null?void 0:s.id;if(!o)return;const{data:l,error:u}=await this.api.createStateCheckpoint({session_id:o,payload:a});return l!=null&&l.success?{success:!0}:{success:!1}},this.config=t,this.api=n,this.contactCtx=i,this.sessionsPollingIntervalSeconds=r,this.registerSessionsRefresherWrapper()}};class FD{constructor({config:t,api:n,sessionCtx:i,contactCtx:r}){this.state=new Us({messages:[],isSendingMessage:!1,isSendingMessageToAI:!1,lastAIResMightSolveUserIssue:!1,isInitialFetchLoading:!1}),this.sendMessageAbortController=new AbortController,this.reset=()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset()},this.sendMessage=async a=>{var s,o,l,u,c,d,f,h,g;try{if(!a.content.trim()&&(!a.attachments||a.attachments.length===0)){console.warn("Cannot send an empty message of no content or attachments");return}const b=this.sessionCtx.sessionState.get().session,E=(b==null?void 0:b.assignee.kind)==="ai",m=this.state.get().isSendingMessageToAI,y=this.state.get().messages.at(-1);if(m||E&&(y==null?void 0:y.type)==="USER"){console.warn("Cannot send messages while awaiting AI response");return}this.sendMessageAbortController=new AbortController,this.state.setPartial({lastAIResMightSolveUserIssue:!1,isSendingMessage:!0,isSendingMessageToAI:!!E||!b});const x=this.state.get().messages,_=!((s=this.sessionCtx.sessionState.get().session)!=null&&s.id)&&x.length===0&&((o=this.config.advancedInitialMessages)==null?void 0:o.some(B=>B.persistent)),S=_?(this.config.advancedInitialMessages||[]).filter(B=>B.persistent).map(B=>({id:vl(),component:"bot_message",type:"AI",timestamp:new Date().toISOString(),data:{message:B.message},agent:this.config.bot?{...this.config.bot,isAi:!0,id:null}:void 0})):[],k=this.toUserMessage(a.content.trim(),a.attachments||void 0);if(this.state.setPartial({messages:[...S,...x,k]}),!((l=this.sessionCtx.sessionState.get().session)!=null&&l.id)){if(!await this.sessionCtx.createSession()){console.error("Failed to create session");return}this.sessionCtx.refreshSessions()}const D=(u=this.sessionCtx.sessionState.get().session)==null?void 0:u.id;if(!D)return;const{data:L}=await this.api.sendMessage({uuid:k.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,body_properties:this.config.bodyProperties,session_id:D,content:k.content,attachments:a.attachments,clientContext:this.config.context,custom_data:{...this.config.messageCustomData||{},...a.customData||{}},language:this.config.language,exit_mode_prompt:a.exitModePrompt,initial_messages:_?S.map(B=>({uuid:B.id,content:B.data.message})):void 0},this.sendMessageAbortController.signal);if(L!=null&&L.success){const B=this.toBotMessage(L);if(B){const R=this.state.get().messages;if(R.some(Y=>Y.id===B.id)){this.state.setPartial({lastAIResMightSolveUserIssue:((c=L.autopilotResponse)==null?void 0:c.mightSolveUserIssue)||((d=L.uiResponse)==null?void 0:d.mightSolveUserIssue)});return}this.state.setPartial({messages:[...R,B],lastAIResMightSolveUserIssue:((f=L.autopilotResponse)==null?void 0:f.mightSolveUserIssue)||((h=L.uiResponse)==null?void 0:h.mightSolveUserIssue)})}L.session&&this.sessionCtx.sessionState.setPartial({session:L.session})}else{const B=this.toBotErrorMessage(((g=L==null?void 0:L.error)==null?void 0:g.message)||"Something went wrong. Please refresh the page or try again."),R=this.state.get().messages;this.state.setPartial({messages:[...R,B]})}}catch(b){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",b)}finally{this.state.setPartial({isSendingMessage:!1,isSendingMessageToAI:!1})}},this.toUserMessage=(a,s)=>{const o=(()=>{const l=this.contactCtx.state.get().extraCollectedData;return this.state.get().messages.length===0&&l&&Object.keys(l).length>0?`${Object.entries(l).filter(([u,c])=>!!c).map(([u,c])=>`${u}: ${c}`).join(`
|
|
66
66
|
`)}
|
|
67
67
|
|
|
68
|
-
${a}`:a})();return{id:vl(),type:"USER",content:o,deliveredAt:new Date().toISOString(),attachments:s,timestamp:new Date().toISOString()}},this.toBotMessage=a=>{var s;return a.success&&a.autopilotResponse?{type:"AI",id:a.autopilotResponse.id||vl(),timestamp:new Date().toISOString(),component:"bot_message",agent:this.config.bot?{name:this.config.bot.name||"",isAi:!0,avatar:this.config.bot.avatar||"",id:null}:void 0,data:{message:a.autopilotResponse.value.content,action:(s=a.uiResponse)!=null&&s.value.name?{name:a.uiResponse.value.name,data:a.uiResponse.value.request_response}:void 0}}:null},this.toBotErrorMessage=a=>({type:"AI",id:vl(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:a,variant:"error",action:void 0}}),this.config=t,this.api=n,this.sessionCtx=i,this.contactCtx=r}}let VD=class{constructor({config:t,contactCtx:n,sessionCtx:i,resetChat:r}){var a;this.registerRoutingListener=()=>{this.contactCtx.state.subscribe(({contact:s})=>{var o;s!=null&&s.token&&this.state.get().screen==="welcome"&&this.state.setPartial({screen:(o=this.config.router)!=null&&o.chatScreenOnly?"chat":"sessions"})}),this.sessionCtx.sessionsState.subscribe(({isInitialFetchLoading:s,data:o})=>{var l,u,c,d;if((l=this.config.router)!=null&&l.chatScreenOnly&&!((u=this.sessionCtx.sessionState.get().session)!=null&&u.id)){const f=(c=o.find(h=>h.isOpened))==null?void 0:c.id;return f?this.toChatScreen(f):void 0}o.length||((d=this.config.router)==null?void 0:d.goToChatIfNoSessions)!==!1&&!s&&this.state.get().screen!=="chat"&&this.toChatScreen()})},this.toSessionsScreen=()=>{this.resetChat(),this.state.setPartial({screen:"sessions"})},this.toChatScreen=s=>{if(this.resetChat(),s){const o=this.sessionCtx.sessionsState.get().data.find(l=>l.id===s);if(!o)return;this.sessionCtx.sessionState.setPartial({session:o})}this.state.setPartial({screen:"chat"})},this.config=t,this.contactCtx=n,this.sessionCtx=i,this.resetChat=r,this.state=new Us({screen:this.contactCtx.shouldCollectData()?"welcome":(a=this.config.router)!=null&&a.chatScreenOnly?"chat":"sessions"}),this.registerRoutingListener()}},YD=class{constructor({storage:t,config:n}){this.KEYS={contactToken:i=>`opencx-widget:org-token-${i}:contact-token`,externalContactId:i=>`opencx-widget:org-token-${i}:external-contact-id`},this.setContactToken=async i=>{await this.storage.set(this.KEYS.contactToken(this.config.token),i)},this.getContactToken=async()=>this.storage.get(this.KEYS.contactToken(this.config.token)),this.setExternalContactId=async i=>{await this.storage.set(this.KEYS.externalContactId(this.config.token),i)},this.getExternalContactId=async()=>this.storage.get(this.KEYS.externalContactId(this.config.token)),this.storage=t,this.config=n}};const xl=class jh{constructor({config:t,storage:n,modes:i,org:r}){if(this.modes=[],this.resetChat=()=>{this.sessionCtx.reset(),this.messageCtx.reset()},!jh.pollingIntervalsSeconds)throw Error("Widget polling values are not defined, did you call WidgetCtx.initialize()");this.config=t,this.org=r,this.api=new mx({config:t}),this.storageCtx=n?new YD({storage:n,config:t}):void 0,this.modes=i,this.contactCtx=new zD({api:this.api,config:this.config,storageCtx:this.storageCtx}),this.sessionCtx=new HD({config:this.config,api:this.api,contactCtx:this.contactCtx,sessionsPollingIntervalSeconds:jh.pollingIntervalsSeconds.sessions}),this.messageCtx=new FD({config:this.config,api:this.api,sessionCtx:this.sessionCtx,contactCtx:this.contactCtx}),this.csatCtx=new jD({config:this.config,api:this.api,sessionCtx:this.sessionCtx,messageCtx:this.messageCtx}),this.activeSessionPollingCtx=new UD({api:this.api,config:this.config,sessionCtx:this.sessionCtx,messageCtx:this.messageCtx,sessionPollingIntervalSeconds:jh.pollingIntervalsSeconds.session}),this.routerCtx=new VD({config:this.config,contactCtx:this.contactCtx,sessionCtx:this.sessionCtx,resetChat:this.resetChat})}};xl.pollingIntervalsSeconds=null,xl.initialize=async({config:e,storage:t})=>{var n,i,r;const a=await new mx({config:e}).getExternalWidgetConfig();if(!a.data)throw new Error("Failed to fetch widget config");return xl.pollingIntervalsSeconds={session:((n=a.data)==null?void 0:n.sessionPollingIntervalSeconds)||10,sessions:((i=a.data)==null?void 0:i.sessionsPollingIntervalSeconds)||60},new xl({config:e,storage:t,modes:((r=a.data)==null?void 0:r.modes)||[],org:{id:a.data.org.id,name:a.data.org.name}})};let qD=xl;const GD={write_a_message_placeholder:"اكتب رسالة...",your_issue_has_been_resolved:"تم حل مشكلتك!",new_conversation:"محادثة جديدة",welcome_screen_title:"مرحبًا بك في دردشة الدعم الخاصة بنا",welcome_screen_description:"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.",your_name_placeholder:"اسمك",your_email_placeholder:"عنوان بريدك الإلكتروني",start_chat_button:"تحدث إلى الدعم",start_chat_button_loading:"جاري الاتصال...",i_need_more_help:"أحتاج المزيد من المساعدة",this_was_helpful:"كان هذا مفيدًا",optional:"اختياري",no_conversations_yet:"لا يوجد محادثات",back_to_conversations:"العودة إلى المحادثات",closed_conversations:"المحادثات المغلقة"},XD={write_a_message_placeholder:"Skriv en besked...",your_issue_has_been_resolved:"Dit problem er løst!",new_conversation:"Ny samtale",welcome_screen_title:"Velkommen til vores support chat",welcome_screen_description:"Vi er her for at hjælpe! Start en samtale, og vi vender tilbage til dig så hurtigt som muligt.",your_name_placeholder:"Dit navn",your_email_placeholder:"Din e-mailadresse",start_chat_button:"Tal med support",start_chat_button_loading:"Forbinder...",i_need_more_help:"Jeg har brug for mere hjælp",this_was_helpful:"Dette var nyttigt",optional:"Valgfrit",no_conversations_yet:"Ingen samtaler endnu",back_to_conversations:"Tilbage til samtaler",closed_conversations:"Lukkede samtaler"},$D={write_a_message_placeholder:"Nachricht schreiben...",your_issue_has_been_resolved:"Ihr Problem wurde gelöst!",new_conversation:"Neue Konversation",welcome_screen_title:"Willkommen in unserem Support-Chat",welcome_screen_description:"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.",your_name_placeholder:"Ihr Name",your_email_placeholder:"Ihre E-Mail-Adresse",start_chat_button:"Mit dem Support sprechen",start_chat_button_loading:"Verbindung wird hergestellt...",i_need_more_help:"Ich brauche weitere Hilfe",this_was_helpful:"Dies war hilfreich",optional:"Optional",no_conversations_yet:"noch keine Gespräche",back_to_conversations:"Zurück zur Konversationen",closed_conversations:"Geschlossene Konversationen"},KD={write_a_message_placeholder:"Write a message...",your_issue_has_been_resolved:"Your issue has been resolved!",new_conversation:"New conversation",welcome_screen_title:"Welcome to our support chat",welcome_screen_description:"We're here to help! Start a conversation and we'll get back to you as soon as possible.",your_name_placeholder:"Your name",your_email_placeholder:"Your email address",start_chat_button:"Talk to support",start_chat_button_loading:"Connecting...",i_need_more_help:"I need more help",this_was_helpful:"This was helpful",optional:"Optional",no_conversations_yet:"No conversations yet",back_to_conversations:"Back to conversations",closed_conversations:"Closed conversations"},QD={write_a_message_placeholder:"Escribe un mensaje...",your_issue_has_been_resolved:"¡Tu problema fue resuelto!",new_conversation:"Nueva conversación",welcome_screen_title:"Bienvenido a nuestro chat de soporte",welcome_screen_description:"¡Estamos aquí para ayudarte! Inicia una conversación y responderemos lo antes posible.",your_name_placeholder:"Tu nombre",your_email_placeholder:"Tu correo electrónico",start_chat_button:"Hablar con soporte",start_chat_button_loading:"Conectando...",i_need_more_help:"Necesito más ayuda",this_was_helpful:"Esto fue útil",optional:"Opcional",no_conversations_yet:"Sin conversaciones aún",back_to_conversations:"Volver a conversaciones",closed_conversations:"Conversaciones cerradas"},WD={write_a_message_placeholder:"Kirjoita viesti...",your_issue_has_been_resolved:"Ongelmasi on ratkaistu!",new_conversation:"Uusi keskustelu",welcome_screen_title:"Tervetuloa tukichattiin",welcome_screen_description:"Olemme täällä auttamassa! Aloita keskustelu ja palaamme sinulle mahdollisimman pian.",your_name_placeholder:"Nimesi",your_email_placeholder:"Sähköpostiosoitteesi",start_chat_button:"Keskustele tuen kanssa",start_chat_button_loading:"Yhdistetään...",i_need_more_help:"Tarvitsen lisää apua",this_was_helpful:"Tämä oli hyödyllistä",optional:"Valinnainen",no_conversations_yet:"Ei vielä keskusteluja",back_to_conversations:"Takaisin keskusteluihin",closed_conversations:"Suljetut keskustelut"},ZD={write_a_message_placeholder:"Écrivez un message...",your_issue_has_been_resolved:"Votre problème a été résolu !",new_conversation:"Nouvelle conversation",welcome_screen_title:"Bienvenue dans notre chat de support",welcome_screen_description:"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.",your_name_placeholder:"Votre nom",your_email_placeholder:"Votre adresse e-mail",start_chat_button:"Parler au support",start_chat_button_loading:"Connexion...",i_need_more_help:"Je besoin d'aide plus",this_was_helpful:"C'était utile",optional:"Optionnel",no_conversations_yet:"Aucune conversation pour le moment",back_to_conversations:"Retour aux conversations",closed_conversations:"Conversations fermées"},JD={write_a_message_placeholder:"Scrivi un messaggio...",your_issue_has_been_resolved:"Il tuo problema è stato risolto!",new_conversation:"Nuova conversazione",welcome_screen_title:"Benvenuto nella nostra chat di supporto",welcome_screen_description:"Siamo qui per aiutarti! Inizia una conversazione e ti risponderemo il prima possibile.",your_name_placeholder:"Il tuo nome",your_email_placeholder:"Il tuo indirizzo email",start_chat_button:"Parla con il supporto",start_chat_button_loading:"Connessione in corso...",i_need_more_help:"Ho bisogno di ulteriore aiuto",this_was_helpful:"Questo è stato utile",optional:"Opzionale",no_conversations_yet:"Nessuna conversazione ancora",back_to_conversations:"Torna alle conversazioni",closed_conversations:"Conversazioni chiuse"},e5={write_a_message_placeholder:"Schrijf een bericht...",your_issue_has_been_resolved:"Uw probleem is opgelost!",new_conversation:"Nieuw gesprek",welcome_screen_title:"Welkom bij onze supportchat",welcome_screen_description:"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.",your_name_placeholder:"Uw naam",your_email_placeholder:"Uw e-mailadres",start_chat_button:"Praat met ondersteuning",start_chat_button_loading:"Verbinding maken...",i_need_more_help:"Ik heb nog meer hulp nodig",this_was_helpful:"Mijn vraag is opgelost",optional:"Optioneel",no_conversations_yet:"Nog geen gesprekken",back_to_conversations:"Terug naar gesprekken",closed_conversations:"Afgesloten gesprekken"},t5={write_a_message_placeholder:"Skriv en melding...",your_issue_has_been_resolved:"Problemet ditt er løst!",new_conversation:"Ny samtale",welcome_screen_title:"Velkommen til vår kundestøtte-chat",welcome_screen_description:"Vi er her for å hjelpe! Start en samtale så kommer vi tilbake til deg så snart som mulig.",your_name_placeholder:"Ditt navn",your_email_placeholder:"Din e-postadresse",start_chat_button:"Snakk med kundestøtte",start_chat_button_loading:"Kobler til...",i_need_more_help:"Jeg trenger mer hjelp",this_was_helpful:"Dette var nyttig",optional:"Valgfritt",no_conversations_yet:"Ingen samtaler ennå",back_to_conversations:"Tilbake til samtaler",closed_conversations:"Lukkede samtaler"},n5={write_a_message_placeholder:"Napisz wiadomość...",your_issue_has_been_resolved:"Twój problem został rozwiązany!",new_conversation:"Nowa rozmowa",welcome_screen_title:"Witamy w naszym czacie wsparcia",welcome_screen_description:"Jesteśmy tutaj, aby pomóc! Rozpocznij rozmowę, a odpowiemy jak najszybciej.",your_name_placeholder:"Twoje imię",your_email_placeholder:"Twój adres email",start_chat_button:"Porozmawiaj ze wsparciem",start_chat_button_loading:"Łączenie...",i_need_more_help:"Potrzebuję więcej pomocy",this_was_helpful:"To było pomocne",optional:"Opcjonalne",no_conversations_yet:"Jeszcze brak rozmów",back_to_conversations:"Powrót do rozmów",closed_conversations:"Zamknięte rozmowy"},i5={write_a_message_placeholder:"Escreva uma mensagem...",your_issue_has_been_resolved:"Seu problema foi resolvido!",new_conversation:"Nova conversa",welcome_screen_title:"Bem-vindo ao nosso chat de suporte",welcome_screen_description:"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.",your_name_placeholder:"Seu nome",your_email_placeholder:"Seu endereço de email",start_chat_button:"Falar com o suporte",start_chat_button_loading:"Conectando...",i_need_more_help:"preciso de mais ajuda",this_was_helpful:"Isso foi útil",optional:"Opcional",no_conversations_yet:"Nenhuma conversa ainda",back_to_conversations:"Voltar para conversas",closed_conversations:"Conversas fechadas"},r5={write_a_message_placeholder:"Scrie un mesaj...",your_issue_has_been_resolved:"Problema ta a fost rezolvată!",new_conversation:"Conversație nouă",welcome_screen_title:"Bine ai venit la chat-ul nostru de suport",welcome_screen_description:"Suntem aici să te ajutăm! Începe o conversație și îți vom răspunde cât mai curând posibil.",your_name_placeholder:"Numele tău",your_email_placeholder:"Adresa ta de email",start_chat_button:"Vorbește cu suportul",start_chat_button_loading:"Se conectează...",i_need_more_help:"Am nevoie de mai mult ajutor",this_was_helpful:"Acest lucru a fost util",optional:"Opțional",no_conversations_yet:"Încă nu există conversații",back_to_conversations:"Înapoi la conversații",closed_conversations:"Conversații închise"},a5={write_a_message_placeholder:"Skriv ett meddelande...",your_issue_has_been_resolved:"Ditt problem har lösts!",new_conversation:"Ny konversation",welcome_screen_title:"Välkommen till vår supportchatt",welcome_screen_description:"Vi är här för att hjälpa! Starta en konversation så återkommer vi till dig så snart som möjligt.",your_name_placeholder:"Ditt namn",your_email_placeholder:"Din e-postadress",start_chat_button:"Prata med support",start_chat_button_loading:"Ansluter...",i_need_more_help:"Jag behöver mer hjälp",this_was_helpful:"Detta var användbart",optional:"Frivilligt",no_conversations_yet:"Inga konversationer ännu",back_to_conversations:"Tillbaka till konversationer",closed_conversations:"Stängda konversationer"},s5={write_a_message_placeholder:"Bir mesaj yazın...",your_issue_has_been_resolved:"Sorununuz çözüldü!",new_conversation:"Yeni konuşma",welcome_screen_title:"Destek sohbetimize hoş geldiniz",welcome_screen_description:"Yardım etmek için buradayız! Bir konuşma başlatın, en kısa sürede size geri döneceğiz.",your_name_placeholder:"Adınız",your_email_placeholder:"E-posta adresiniz",start_chat_button:"Destekle konuş",start_chat_button_loading:"Bağlanıyor...",i_need_more_help:"Daha fazla yardıma ihtiyacım var",this_was_helpful:"Bu yardımcı oldu",optional:"İsteğe bağlı",no_conversations_yet:"Henüz konuşma yok",back_to_conversations:"Konuşmalara geri dön",closed_conversations:"Kapatılan konuşmalar"},yx={en:KD,ar:GD,nl:e5,fr:ZD,de:$D,pt:i5,es:QD,tr:s5,pl:n5,fi:WD,it:JD,no:t5,ro:r5,da:XD,sv:a5},o5=Object.keys(yx);function l5(e){return o5.includes(e)}function u5(e,t,n){var i;return((i=n==null?void 0:n[t])==null?void 0:i[e])||yx[t][e]||""}const c5="4.0.28";let d5=class{constructor(t){this.components=[];const{components:n}=t;if(n&&n.forEach(i=>this.register(i)),this.components.length===0)throw new Error("No components registered");if(!this.get("fallback"))throw new Error("No fallback component registered")}register(t){const n=this.components.findIndex(i=>i.key===t.key);return n!==-1?this.components[n]=t:this.components.push(t),this}get(t){return this.components.find(i=>i.key.toUpperCase()===t.toUpperCase())||null}getComponent(t){var n;return(n=this.get(t))==null?void 0:n.component}};const vx=T.createContext(null);function f5({options:e,children:t,components:n,storage:i,loadingComponent:r}){const a=T.useRef(null),s=T.useRef(!1),[o,l]=T.useState(null),u=T.useMemo(()=>new d5({components:n}),[n]);return T.useEffect(()=>{s.current||(s.current=!0,qD.initialize({config:e,storage:i}).then(l).catch(console.error))},[]),o?Dn.createElement(vx.Provider,{value:{widgetCtx:o,config:e,components:n,componentStore:u,version:c5,contentIframeRef:a}},t):r||null}function It(){const e=T.useContext(vx);if(!e)throw new Error("useWidget must be used within a WidgetProvider");return e}function We(){const{config:e}=It();return e}function El(e){return T.useSyncExternalStore(e.subscribe,e.get,e.get)}function h5(){const{widgetCtx:e}=It();return{contactState:El(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function Ap(){const[e,t]=T.useState("ltr");return T.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle((window.top||window).document.body).direction)};n();const i=new MutationObserver(n);return i.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),i.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{i.disconnect(),window.removeEventListener("languagechange",n)}},[]),{dir:e}}function Pn(){const{widgetCtx:e}=It();return{messagesState:El(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function wi(){const{widgetCtx:e}=It(),{oneOpenSessionAllowed:t}=We(),n=El(e.sessionCtx.sessionState),i=El(e.sessionCtx.sessionsState),{openSessions:r,closedSessions:a}=T.useMemo(()=>({openSessions:i.data.filter(o=>o.isOpened===!0),closedSessions:i.data.filter(o=>o.isOpened===!1)}),[i.data]),s=T.useMemo(()=>t?r.length===0:!0,[t,r.length]);return{sessionState:n,sessionsState:i,loadMoreSessions:e.sessionCtx.loadMoreSessions,resolveSession:e.sessionCtx.resolveSession,createStateCheckpoint:e.sessionCtx.createStateCheckpoint,openSessions:r,closedSessions:a,canCreateNewSession:s}}function xx(){var e,t,n;const{sessionState:i}=wi(),{messagesState:r}=Pn(),a=((e=i.session)==null?void 0:e.assignee.kind)==="ai",s=((n=(t=r.messages)==null?void 0:t.at(-1))==null?void 0:n.type)==="USER";return{isAwaitingBotReply:!!(r.isSendingMessageToAI||(a||i.isCreatingSession)&&(r.isSendingMessage||s))}}function ur(){const{widgetCtx:e}=It();return{routerState:El(e.routerCtx.state),toSessionsScreen:e.routerCtx.toSessionsScreen,toChatScreen:e.routerCtx.toChatScreen}}const Yr=new Map;function p5(){const[e,t]=T.useState([]),{widgetCtx:{api:n}}=It();function i(c){const d=c.map(f=>({file:f,id:Sp(),status:"pending",progress:0}));t(f=>[...f,...d]),d.forEach(s)}function r(c,d){t(f=>f.map(h=>h.id===c?{...h,...d}:h))}function a(c){t(d=>d.filter(f=>f.id!==c))}const s=async c=>{const d=new AbortController;Yr.set(c.id,d);try{t(h=>h.map(g=>g.id===c.id?{...g,status:"uploading",progress:0}:g));const f=await n.uploadFile({file:c.file,abortSignal:d.signal,onProgress:h=>{r(c.id,{progress:h})}});r(c.id,{status:"success",fileUrl:f.fileUrl,progress:100})}catch(f){d.signal.aborted||r(c.id,{status:"error",error:f instanceof Error?f.message:"Upload failed",progress:0})}finally{Yr.delete(c.id)}},o=c=>{const d=Yr.get(c);d&&(d.abort(),Yr.delete(c)),a(c)},l=T.useMemo(()=>e.filter(c=>c.status==="success"&&c.fileUrl),[e]);function u(){Yr.forEach(c=>c.abort()),Yr.clear(),t([])}return T.useEffect(()=>()=>{Yr.forEach(c=>c.abort()),Yr.clear()},[]),{allFiles:e,appendFiles:i,handleCancelUpload:o,successFiles:l,emptyTheFiles:u,getFileById:c=>e.find(d=>d.id===c),getUploadProgress:c=>{var d;return((d=e.find(f=>f.id===c))==null?void 0:d.progress)??0},getUploadStatus:c=>{var d;return(d=e.find(f=>f.id===c))==null?void 0:d.status},hasErrors:e.some(c=>c.status==="error"),isUploading:e.some(c=>c.status==="uploading")}}const Ex=T.createContext(null);function m5({children:e}){const t=We(),[n,i]=T.useState(()=>t.inline?!0:t.isOpen??!1);return T.useEffect(()=>{i(r=>t.isOpen??r)},[t.isOpen]),T.useEffect(()=>{const r=t.openAfterNSeconds;if(typeof r!="number"||isNaN(r))return;const a=setTimeout(()=>i(!0),r*1e3);return()=>clearTimeout(a)},[t.openAfterNSeconds]),Dn.createElement(Ex.Provider,{value:{isOpen:n,setIsOpen:i}},e)}function zs(){const e=T.useContext(Ex);if(!e)throw new Error("useWidgetTrigger must be used within a WidgetTriggerProvider");return e}function Tx(){var e,t;const{widgetCtx:n}=It(),{modesComponents:i}=We(),{sessionState:r}=wi(),a=n.modes,s=(e=r.session)==null?void 0:e.modeId,o=a.find(u=>u.id===s),l=(t=i==null?void 0:i.find(u=>{var c,d;return[(o==null?void 0:o.id)||"",((c=o==null?void 0:o.name)==null?void 0:c.toLowerCase())||"",((d=o==null?void 0:o.slug)==null?void 0:d.toLowerCase())||""].includes(u.key.toLowerCase())}))==null?void 0:t.component;return{modes:a,modesComponents:i,activeModeId:s,activeMode:o,Component:l}}function _x(){const{widgetCtx:e}=It(),{messagesState:{messages:t}}=Pn(),{csatRequestedMessage:n,isCsatRequested:i,csatSubmittedMessage:r,isCsatSubmitted:a,submittedScore:s,submittedFeedback:o}=T.useMemo(()=>{const l=t.find(c=>c.type==="SYSTEM"&&c.subtype==="csat_requested"),u=t.findLast(c=>c.type==="SYSTEM"&&c.subtype==="csat_submitted");return{csatRequestedMessage:l,isCsatRequested:!!l&&!u,csatSubmittedMessage:u,isCsatSubmitted:!!u,submittedScore:u==null?void 0:u.data.payload.score,submittedFeedback:u==null?void 0:u.data.payload.feedback}},[t]);return{submitCsat:e.csatCtx.submitCsat,csatRequestedMessage:n,isCsatRequested:i,csatSubmittedMessage:r,isCsatSubmitted:a,submittedScore:s,submittedFeedback:o}}function wx(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=wx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Sx(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=wx(e))&&(i&&(i+=" "),i+=t);return i}const Cp="-",g5=e=>{const t=y5(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:s=>{const o=s.split(Cp);return o[0]===""&&o.length!==1&&o.shift(),Ax(o,t)||b5(s)},getConflictingClassGroupIds:(s,o)=>{const l=n[s]||[];return o&&i[s]?[...l,...i[s]]:l}}},Ax=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),r=i?Ax(e.slice(1),i):void 0;if(r)return r;if(t.validators.length===0)return;const a=e.join(Cp);return(s=t.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},Cx=/^\[(.+)\]$/,b5=e=>{if(Cx.test(e)){const t=Cx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},y5=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return x5(Object.entries(e.classGroups),n).forEach(([a,s])=>{kp(s,i,a,t)}),i},kp=(e,t,n,i)=>{e.forEach(r=>{if(typeof r=="string"){const a=r===""?t:kx(t,r);a.classGroupId=n;return}if(typeof r=="function"){if(v5(r)){kp(r(i),t,n,i);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([a,s])=>{kp(s,kx(t,a),n,i)})})},kx=(e,t)=>{let n=e;return t.split(Cp).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},v5=e=>e.isThemeGetter,x5=(e,t)=>t?e.map(([n,i])=>{const r=i.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,o])=>[t+s,o])):a);return[n,r]}):e,E5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const r=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,i=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=i.get(a))!==void 0)return r(a,s),s},set(a,s){n.has(a)?n.set(a,s):r(a,s)}}},Ox="!",T5=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,r=t[0],a=t.length,s=o=>{const l=[];let u=0,c=0,d;for(let E=0;E<o.length;E++){let m=o[E];if(u===0){if(m===r&&(i||o.slice(E,E+a)===t)){l.push(o.slice(c,E)),c=E+a;continue}if(m==="/"){d=E;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?o:o.substring(c),h=f.startsWith(Ox),g=h?f.substring(1):f,b=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}};return n?o=>n({className:o,parseClassName:s}):s},_5=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},w5=e=>({cache:E5(e.cacheSize),parseClassName:T5(e),...g5(e)}),S5=/\s+/,A5=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r}=t,a=[],s=e.trim().split(S5);let o="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let g=!!h,b=i(g?f.substring(0,h):f);if(!b){if(!g){o=u+(o.length>0?" "+o:o);continue}if(b=i(f),!b){o=u+(o.length>0?" "+o:o);continue}g=!1}const E=_5(c).join(":"),m=d?E+Ox:E,y=m+b;if(a.includes(y))continue;a.push(y);const x=r(b,g);for(let _=0;_<x.length;++_){const S=x[_];a.push(m+S)}o=u+(o.length>0?" "+o:o)}return o};function C5(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Nx(t))&&(i&&(i+=" "),i+=n);return i}const Nx=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Nx(e[i]))&&(n&&(n+=" "),n+=t);return n};function k5(e,...t){let n,i,r,a=s;function s(l){const u=t.reduce((c,d)=>d(c),e());return n=w5(u),i=n.cache.get,r=n.cache.set,a=o,o(l)}function o(l){const u=i(l);if(u)return u;const c=A5(l,n);return r(l,c),c}return function(){return a(C5.apply(null,arguments))}}const it=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rx=/^\[(?:([a-z-]+):)?(.+)\]$/i,O5=/^\d+\/\d+$/,N5=new Set(["px","full","screen"]),R5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D5=/\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$/,M5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>js(e)||N5.has(e)||O5.test(e),qr=e=>Hs(e,"length",V5),js=e=>!!e&&!Number.isNaN(Number(e)),Op=e=>Hs(e,"number",js),Tl=e=>!!e&&Number.isInteger(Number(e)),P5=e=>e.endsWith("%")&&js(e.slice(0,-1)),_e=e=>Rx.test(e),Gr=e=>R5.test(e),B5=new Set(["length","size","percentage"]),U5=e=>Hs(e,B5,Dx),z5=e=>Hs(e,"position",Dx),j5=new Set(["image","url"]),H5=e=>Hs(e,j5,q5),F5=e=>Hs(e,"",Y5),_l=()=>!0,Hs=(e,t,n)=>{const i=Rx.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},V5=e=>D5.test(e)&&!M5.test(e),Dx=()=>!1,Y5=e=>L5.test(e),q5=e=>I5.test(e),G5=k5(()=>{const e=it("colors"),t=it("spacing"),n=it("blur"),i=it("brightness"),r=it("borderColor"),a=it("borderRadius"),s=it("borderSpacing"),o=it("borderWidth"),l=it("contrast"),u=it("grayscale"),c=it("hueRotate"),d=it("invert"),f=it("gap"),h=it("gradientColorStops"),g=it("gradientColorStopPositions"),b=it("inset"),E=it("margin"),m=it("opacity"),y=it("padding"),x=it("saturate"),_=it("scale"),S=it("sepia"),k=it("skew"),D=it("space"),L=it("translate"),B=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",_e,t],H=()=>[_e,t],re=()=>["",cr,qr],ee=()=>["auto",js,_e],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",_e],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],be=()=>[js,_e];return{cacheSize:500,separator:":",theme:{colors:[_l],spacing:[cr,qr],blur:["none","",Gr,_e],brightness:be(),borderColor:[e],borderRadius:["none","","full",Gr,_e],borderSpacing:H(),borderWidth:re(),contrast:be(),grayscale:te(),hueRotate:be(),invert:te(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[P5,qr],inset:Y(),margin:Y(),opacity:be(),padding:H(),saturate:be(),scale:be(),sepia:te(),skew:be(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",_e]}],container:["container"],columns:[{columns:[Gr]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...Q(),_e]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tl,_e]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_e]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",Tl,_e]}],"grid-cols":[{"grid-cols":[_l]}],"col-start-end":[{col:["auto",{span:["full",Tl,_e]},_e]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[_l]}],"row-start-end":[{row:["auto",{span:[Tl,_e]},_e]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_e]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_e,t]}],"min-w":[{"min-w":[_e,t,"min","max","fit"]}],"max-w":[{"max-w":[_e,t,"none","full","min","max","fit","prose",{screen:[Gr]},Gr]}],h:[{h:[_e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Gr,qr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Op]}],"font-family":[{font:[_l]}],"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",_e]}],"line-clamp":[{"line-clamp":["none",js,Op]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cr,_e]}],"list-image":[{"list-image":["none",_e]}],"list-style-type":[{list:["none","disc","decimal",_e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cr,qr]}],"underline-offset":[{"underline-offset":["auto",cr,_e]}],"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:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e]}],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",_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),z5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",U5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H5]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:F()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[cr,_e]}],"outline-w":[{outline:[cr,qr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[cr,qr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gr,F5]}],"shadow-color":[{shadow:[_l]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gr,_e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_e]}],duration:[{duration:be()}],ease:[{ease:["linear","in","out","in-out",_e]}],delay:[{delay:be()}],animate:[{animate:["none","spin","ping","pulse","bounce",_e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Tl,_e]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_e]}],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",_e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",_e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cr,qr,Op]}],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"]}}}),Np=T.createContext({});function Rp(e){const t=T.useRef(null);return t.current===null&&(t.current=e()),t.current}const ed=T.createContext(null),Dp=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class X5 extends T.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function $5({children:e,isPresent:t}){const n=T.useId(),i=T.useRef(null),r=T.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=T.useContext(Dp);return T.useInsertionEffect(()=>{const{width:s,height:o,top:l,left:u}=r.current;if(t||!i.current||!s||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
68
|
+
${a}`:a})();return{id:vl(),type:"USER",content:o,deliveredAt:new Date().toISOString(),attachments:s,timestamp:new Date().toISOString()}},this.toBotMessage=a=>{var s;return a.success&&a.autopilotResponse?{type:"AI",id:a.autopilotResponse.id||vl(),timestamp:new Date().toISOString(),component:"bot_message",agent:this.config.bot?{name:this.config.bot.name||"",isAi:!0,avatar:this.config.bot.avatar||"",id:null}:void 0,data:{message:a.autopilotResponse.value.content,action:(s=a.uiResponse)!=null&&s.value.name?{name:a.uiResponse.value.name,data:a.uiResponse.value.request_response}:void 0}}:null},this.toBotErrorMessage=a=>({type:"AI",id:vl(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:a,variant:"error",action:void 0}}),this.config=t,this.api=n,this.sessionCtx=i,this.contactCtx=r}}let VD=class{constructor({config:t,contactCtx:n,sessionCtx:i,resetChat:r}){var a;this.registerRoutingListener=()=>{this.contactCtx.state.subscribe(({contact:s})=>{var o;s!=null&&s.token&&this.state.get().screen==="welcome"&&this.state.setPartial({screen:(o=this.config.router)!=null&&o.chatScreenOnly?"chat":"sessions"})}),this.sessionCtx.sessionsState.subscribe(({isInitialFetchLoading:s,data:o})=>{var l,u,c,d;if((l=this.config.router)!=null&&l.chatScreenOnly&&!((u=this.sessionCtx.sessionState.get().session)!=null&&u.id)){const f=(c=o.find(h=>h.isOpened))==null?void 0:c.id;return f?this.toChatScreen(f):void 0}o.length||((d=this.config.router)==null?void 0:d.goToChatIfNoSessions)!==!1&&!s&&this.state.get().screen!=="chat"&&this.toChatScreen()})},this.toSessionsScreen=()=>{this.resetChat(),this.state.setPartial({screen:"sessions"})},this.toChatScreen=s=>{if(this.resetChat(),s){const o=this.sessionCtx.sessionsState.get().data.find(l=>l.id===s);if(!o)return;this.sessionCtx.sessionState.setPartial({session:o})}this.state.setPartial({screen:"chat"})},this.config=t,this.contactCtx=n,this.sessionCtx=i,this.resetChat=r,this.state=new Us({screen:this.contactCtx.shouldCollectData()?"welcome":(a=this.config.router)!=null&&a.chatScreenOnly?"chat":"sessions"}),this.registerRoutingListener()}},YD=class{constructor({storage:t,config:n}){this.KEYS={contactToken:i=>`opencx-widget:org-token-${i}:contact-token`,externalContactId:i=>`opencx-widget:org-token-${i}:external-contact-id`},this.setContactToken=async i=>{await this.storage.set(this.KEYS.contactToken(this.config.token),i)},this.getContactToken=async()=>this.storage.get(this.KEYS.contactToken(this.config.token)),this.setExternalContactId=async i=>{await this.storage.set(this.KEYS.externalContactId(this.config.token),i)},this.getExternalContactId=async()=>this.storage.get(this.KEYS.externalContactId(this.config.token)),this.storage=t,this.config=n}};const xl=class jh{constructor({config:t,storage:n,modes:i,org:r}){if(this.modes=[],this.resetChat=()=>{this.sessionCtx.reset(),this.messageCtx.reset()},!jh.pollingIntervalsSeconds)throw Error("Widget polling values are not defined, did you call WidgetCtx.initialize()");this.config=t,this.org=r,this.api=new mx({config:t}),this.storageCtx=n?new YD({storage:n,config:t}):void 0,this.modes=i,this.contactCtx=new zD({api:this.api,config:this.config,storageCtx:this.storageCtx}),this.sessionCtx=new HD({config:this.config,api:this.api,contactCtx:this.contactCtx,sessionsPollingIntervalSeconds:jh.pollingIntervalsSeconds.sessions}),this.messageCtx=new FD({config:this.config,api:this.api,sessionCtx:this.sessionCtx,contactCtx:this.contactCtx}),this.csatCtx=new jD({config:this.config,api:this.api,sessionCtx:this.sessionCtx,messageCtx:this.messageCtx}),this.activeSessionPollingCtx=new UD({api:this.api,config:this.config,sessionCtx:this.sessionCtx,messageCtx:this.messageCtx,sessionPollingIntervalSeconds:jh.pollingIntervalsSeconds.session}),this.routerCtx=new VD({config:this.config,contactCtx:this.contactCtx,sessionCtx:this.sessionCtx,resetChat:this.resetChat})}};xl.pollingIntervalsSeconds=null,xl.initialize=async({config:e,storage:t})=>{var n,i,r;const a=await new mx({config:e}).getExternalWidgetConfig();if(!a.data)throw new Error("Failed to fetch widget config");return xl.pollingIntervalsSeconds={session:((n=a.data)==null?void 0:n.sessionPollingIntervalSeconds)||10,sessions:((i=a.data)==null?void 0:i.sessionsPollingIntervalSeconds)||60},new xl({config:e,storage:t,modes:((r=a.data)==null?void 0:r.modes)||[],org:{id:a.data.org.id,name:a.data.org.name}})};let qD=xl;const GD={write_a_message_placeholder:"اكتب رسالة...",your_issue_has_been_resolved:"تم حل مشكلتك!",new_conversation:"محادثة جديدة",welcome_screen_title:"مرحبًا بك في دردشة الدعم الخاصة بنا",welcome_screen_description:"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.",your_name_placeholder:"اسمك",your_email_placeholder:"عنوان بريدك الإلكتروني",start_chat_button:"تحدث إلى الدعم",start_chat_button_loading:"جاري الاتصال...",i_need_more_help:"أحتاج المزيد من المساعدة",this_was_helpful:"كان هذا مفيدًا",optional:"اختياري",no_conversations_yet:"لا يوجد محادثات",back_to_conversations:"العودة إلى المحادثات",closed_conversations:"المحادثات المغلقة"},XD={write_a_message_placeholder:"Skriv en besked...",your_issue_has_been_resolved:"Dit problem er løst!",new_conversation:"Ny samtale",welcome_screen_title:"Velkommen til vores support chat",welcome_screen_description:"Vi er her for at hjælpe! Start en samtale, og vi vender tilbage til dig så hurtigt som muligt.",your_name_placeholder:"Dit navn",your_email_placeholder:"Din e-mailadresse",start_chat_button:"Tal med support",start_chat_button_loading:"Forbinder...",i_need_more_help:"Jeg har brug for mere hjælp",this_was_helpful:"Dette var nyttigt",optional:"Valgfrit",no_conversations_yet:"Ingen samtaler endnu",back_to_conversations:"Tilbage til samtaler",closed_conversations:"Lukkede samtaler"},$D={write_a_message_placeholder:"Nachricht schreiben...",your_issue_has_been_resolved:"Ihr Problem wurde gelöst!",new_conversation:"Neue Konversation",welcome_screen_title:"Willkommen in unserem Support-Chat",welcome_screen_description:"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.",your_name_placeholder:"Ihr Name",your_email_placeholder:"Ihre E-Mail-Adresse",start_chat_button:"Mit dem Support sprechen",start_chat_button_loading:"Verbindung wird hergestellt...",i_need_more_help:"Ich brauche weitere Hilfe",this_was_helpful:"Dies war hilfreich",optional:"Optional",no_conversations_yet:"noch keine Gespräche",back_to_conversations:"Zurück zur Konversationen",closed_conversations:"Geschlossene Konversationen"},KD={write_a_message_placeholder:"Write a message...",your_issue_has_been_resolved:"Your issue has been resolved!",new_conversation:"New conversation",welcome_screen_title:"Welcome to our support chat",welcome_screen_description:"We're here to help! Start a conversation and we'll get back to you as soon as possible.",your_name_placeholder:"Your name",your_email_placeholder:"Your email address",start_chat_button:"Talk to support",start_chat_button_loading:"Connecting...",i_need_more_help:"I need more help",this_was_helpful:"This was helpful",optional:"Optional",no_conversations_yet:"No conversations yet",back_to_conversations:"Back to conversations",closed_conversations:"Closed conversations"},QD={write_a_message_placeholder:"Escribe un mensaje...",your_issue_has_been_resolved:"¡Tu problema fue resuelto!",new_conversation:"Nueva conversación",welcome_screen_title:"Bienvenido a nuestro chat de soporte",welcome_screen_description:"¡Estamos aquí para ayudarte! Inicia una conversación y responderemos lo antes posible.",your_name_placeholder:"Tu nombre",your_email_placeholder:"Tu correo electrónico",start_chat_button:"Hablar con soporte",start_chat_button_loading:"Conectando...",i_need_more_help:"Necesito más ayuda",this_was_helpful:"Esto fue útil",optional:"Opcional",no_conversations_yet:"Sin conversaciones aún",back_to_conversations:"Volver a conversaciones",closed_conversations:"Conversaciones cerradas"},WD={write_a_message_placeholder:"Kirjoita viesti...",your_issue_has_been_resolved:"Ongelmasi on ratkaistu!",new_conversation:"Uusi keskustelu",welcome_screen_title:"Tervetuloa tukichattiin",welcome_screen_description:"Olemme täällä auttamassa! Aloita keskustelu ja palaamme sinulle mahdollisimman pian.",your_name_placeholder:"Nimesi",your_email_placeholder:"Sähköpostiosoitteesi",start_chat_button:"Keskustele tuen kanssa",start_chat_button_loading:"Yhdistetään...",i_need_more_help:"Tarvitsen lisää apua",this_was_helpful:"Tämä oli hyödyllistä",optional:"Valinnainen",no_conversations_yet:"Ei vielä keskusteluja",back_to_conversations:"Takaisin keskusteluihin",closed_conversations:"Suljetut keskustelut"},ZD={write_a_message_placeholder:"Écrivez un message...",your_issue_has_been_resolved:"Votre problème a été résolu !",new_conversation:"Nouvelle conversation",welcome_screen_title:"Bienvenue dans notre chat de support",welcome_screen_description:"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.",your_name_placeholder:"Votre nom",your_email_placeholder:"Votre adresse e-mail",start_chat_button:"Parler au support",start_chat_button_loading:"Connexion...",i_need_more_help:"Je besoin d'aide plus",this_was_helpful:"C'était utile",optional:"Optionnel",no_conversations_yet:"Aucune conversation pour le moment",back_to_conversations:"Retour aux conversations",closed_conversations:"Conversations fermées"},JD={write_a_message_placeholder:"Scrivi un messaggio...",your_issue_has_been_resolved:"Il tuo problema è stato risolto!",new_conversation:"Nuova conversazione",welcome_screen_title:"Benvenuto nella nostra chat di supporto",welcome_screen_description:"Siamo qui per aiutarti! Inizia una conversazione e ti risponderemo il prima possibile.",your_name_placeholder:"Il tuo nome",your_email_placeholder:"Il tuo indirizzo email",start_chat_button:"Parla con il supporto",start_chat_button_loading:"Connessione in corso...",i_need_more_help:"Ho bisogno di ulteriore aiuto",this_was_helpful:"Questo è stato utile",optional:"Opzionale",no_conversations_yet:"Nessuna conversazione ancora",back_to_conversations:"Torna alle conversazioni",closed_conversations:"Conversazioni chiuse"},e5={write_a_message_placeholder:"Schrijf een bericht...",your_issue_has_been_resolved:"Uw probleem is opgelost!",new_conversation:"Nieuw gesprek",welcome_screen_title:"Welkom bij onze supportchat",welcome_screen_description:"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.",your_name_placeholder:"Uw naam",your_email_placeholder:"Uw e-mailadres",start_chat_button:"Praat met ondersteuning",start_chat_button_loading:"Verbinding maken...",i_need_more_help:"Ik heb nog meer hulp nodig",this_was_helpful:"Mijn vraag is opgelost",optional:"Optioneel",no_conversations_yet:"Nog geen gesprekken",back_to_conversations:"Terug naar gesprekken",closed_conversations:"Afgesloten gesprekken"},t5={write_a_message_placeholder:"Skriv en melding...",your_issue_has_been_resolved:"Problemet ditt er løst!",new_conversation:"Ny samtale",welcome_screen_title:"Velkommen til vår kundestøtte-chat",welcome_screen_description:"Vi er her for å hjelpe! Start en samtale så kommer vi tilbake til deg så snart som mulig.",your_name_placeholder:"Ditt navn",your_email_placeholder:"Din e-postadresse",start_chat_button:"Snakk med kundestøtte",start_chat_button_loading:"Kobler til...",i_need_more_help:"Jeg trenger mer hjelp",this_was_helpful:"Dette var nyttig",optional:"Valgfritt",no_conversations_yet:"Ingen samtaler ennå",back_to_conversations:"Tilbake til samtaler",closed_conversations:"Lukkede samtaler"},n5={write_a_message_placeholder:"Napisz wiadomość...",your_issue_has_been_resolved:"Twój problem został rozwiązany!",new_conversation:"Nowa rozmowa",welcome_screen_title:"Witamy w naszym czacie wsparcia",welcome_screen_description:"Jesteśmy tutaj, aby pomóc! Rozpocznij rozmowę, a odpowiemy jak najszybciej.",your_name_placeholder:"Twoje imię",your_email_placeholder:"Twój adres email",start_chat_button:"Porozmawiaj ze wsparciem",start_chat_button_loading:"Łączenie...",i_need_more_help:"Potrzebuję więcej pomocy",this_was_helpful:"To było pomocne",optional:"Opcjonalne",no_conversations_yet:"Jeszcze brak rozmów",back_to_conversations:"Powrót do rozmów",closed_conversations:"Zamknięte rozmowy"},i5={write_a_message_placeholder:"Escreva uma mensagem...",your_issue_has_been_resolved:"Seu problema foi resolvido!",new_conversation:"Nova conversa",welcome_screen_title:"Bem-vindo ao nosso chat de suporte",welcome_screen_description:"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.",your_name_placeholder:"Seu nome",your_email_placeholder:"Seu endereço de email",start_chat_button:"Falar com o suporte",start_chat_button_loading:"Conectando...",i_need_more_help:"preciso de mais ajuda",this_was_helpful:"Isso foi útil",optional:"Opcional",no_conversations_yet:"Nenhuma conversa ainda",back_to_conversations:"Voltar para conversas",closed_conversations:"Conversas fechadas"},r5={write_a_message_placeholder:"Scrie un mesaj...",your_issue_has_been_resolved:"Problema ta a fost rezolvată!",new_conversation:"Conversație nouă",welcome_screen_title:"Bine ai venit la chat-ul nostru de suport",welcome_screen_description:"Suntem aici să te ajutăm! Începe o conversație și îți vom răspunde cât mai curând posibil.",your_name_placeholder:"Numele tău",your_email_placeholder:"Adresa ta de email",start_chat_button:"Vorbește cu suportul",start_chat_button_loading:"Se conectează...",i_need_more_help:"Am nevoie de mai mult ajutor",this_was_helpful:"Acest lucru a fost util",optional:"Opțional",no_conversations_yet:"Încă nu există conversații",back_to_conversations:"Înapoi la conversații",closed_conversations:"Conversații închise"},a5={write_a_message_placeholder:"Skriv ett meddelande...",your_issue_has_been_resolved:"Ditt problem har lösts!",new_conversation:"Ny konversation",welcome_screen_title:"Välkommen till vår supportchatt",welcome_screen_description:"Vi är här för att hjälpa! Starta en konversation så återkommer vi till dig så snart som möjligt.",your_name_placeholder:"Ditt namn",your_email_placeholder:"Din e-postadress",start_chat_button:"Prata med support",start_chat_button_loading:"Ansluter...",i_need_more_help:"Jag behöver mer hjälp",this_was_helpful:"Detta var användbart",optional:"Frivilligt",no_conversations_yet:"Inga konversationer ännu",back_to_conversations:"Tillbaka till konversationer",closed_conversations:"Stängda konversationer"},s5={write_a_message_placeholder:"Bir mesaj yazın...",your_issue_has_been_resolved:"Sorununuz çözüldü!",new_conversation:"Yeni konuşma",welcome_screen_title:"Destek sohbetimize hoş geldiniz",welcome_screen_description:"Yardım etmek için buradayız! Bir konuşma başlatın, en kısa sürede size geri döneceğiz.",your_name_placeholder:"Adınız",your_email_placeholder:"E-posta adresiniz",start_chat_button:"Destekle konuş",start_chat_button_loading:"Bağlanıyor...",i_need_more_help:"Daha fazla yardıma ihtiyacım var",this_was_helpful:"Bu yardımcı oldu",optional:"İsteğe bağlı",no_conversations_yet:"Henüz konuşma yok",back_to_conversations:"Konuşmalara geri dön",closed_conversations:"Kapatılan konuşmalar"},yx={en:KD,ar:GD,nl:e5,fr:ZD,de:$D,pt:i5,es:QD,tr:s5,pl:n5,fi:WD,it:JD,no:t5,ro:r5,da:XD,sv:a5},o5=Object.keys(yx);function l5(e){return o5.includes(e)}function u5(e,t,n){var i;return((i=n==null?void 0:n[t])==null?void 0:i[e])||yx[t][e]||""}const c5="4.0.29";let d5=class{constructor(t){this.components=[];const{components:n}=t;if(n&&n.forEach(i=>this.register(i)),this.components.length===0)throw new Error("No components registered");if(!this.get("fallback"))throw new Error("No fallback component registered")}register(t){const n=this.components.findIndex(i=>i.key===t.key);return n!==-1?this.components[n]=t:this.components.push(t),this}get(t){return this.components.find(i=>i.key.toUpperCase()===t.toUpperCase())||null}getComponent(t){var n;return(n=this.get(t))==null?void 0:n.component}};const vx=T.createContext(null);function f5({options:e,children:t,components:n,storage:i,loadingComponent:r}){const a=T.useRef(null),s=T.useRef(!1),[o,l]=T.useState(null),u=T.useMemo(()=>new d5({components:n}),[n]);return T.useEffect(()=>{s.current||(s.current=!0,qD.initialize({config:e,storage:i}).then(l).catch(console.error))},[]),o?Dn.createElement(vx.Provider,{value:{widgetCtx:o,config:e,components:n,componentStore:u,version:c5,contentIframeRef:a}},t):r||null}function It(){const e=T.useContext(vx);if(!e)throw new Error("useWidget must be used within a WidgetProvider");return e}function We(){const{config:e}=It();return e}function El(e){return T.useSyncExternalStore(e.subscribe,e.get,e.get)}function h5(){const{widgetCtx:e}=It();return{contactState:El(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function Ap(){const[e,t]=T.useState("ltr");return T.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle((window.top||window).document.body).direction)};n();const i=new MutationObserver(n);return i.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),i.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{i.disconnect(),window.removeEventListener("languagechange",n)}},[]),{dir:e}}function Pn(){const{widgetCtx:e}=It();return{messagesState:El(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function wi(){const{widgetCtx:e}=It(),{oneOpenSessionAllowed:t}=We(),n=El(e.sessionCtx.sessionState),i=El(e.sessionCtx.sessionsState),{openSessions:r,closedSessions:a}=T.useMemo(()=>({openSessions:i.data.filter(o=>o.isOpened===!0),closedSessions:i.data.filter(o=>o.isOpened===!1)}),[i.data]),s=T.useMemo(()=>t?r.length===0:!0,[t,r.length]);return{sessionState:n,sessionsState:i,loadMoreSessions:e.sessionCtx.loadMoreSessions,resolveSession:e.sessionCtx.resolveSession,createStateCheckpoint:e.sessionCtx.createStateCheckpoint,openSessions:r,closedSessions:a,canCreateNewSession:s}}function xx(){var e,t,n;const{sessionState:i}=wi(),{messagesState:r}=Pn(),a=((e=i.session)==null?void 0:e.assignee.kind)==="ai",s=((n=(t=r.messages)==null?void 0:t.at(-1))==null?void 0:n.type)==="USER";return{isAwaitingBotReply:!!(r.isSendingMessageToAI||(a||i.isCreatingSession)&&(r.isSendingMessage||s))}}function ur(){const{widgetCtx:e}=It();return{routerState:El(e.routerCtx.state),toSessionsScreen:e.routerCtx.toSessionsScreen,toChatScreen:e.routerCtx.toChatScreen}}const Yr=new Map;function p5(){const[e,t]=T.useState([]),{widgetCtx:{api:n}}=It();function i(c){const d=c.map(f=>({file:f,id:Sp(),status:"pending",progress:0}));t(f=>[...f,...d]),d.forEach(s)}function r(c,d){t(f=>f.map(h=>h.id===c?{...h,...d}:h))}function a(c){t(d=>d.filter(f=>f.id!==c))}const s=async c=>{const d=new AbortController;Yr.set(c.id,d);try{t(h=>h.map(g=>g.id===c.id?{...g,status:"uploading",progress:0}:g));const f=await n.uploadFile({file:c.file,abortSignal:d.signal,onProgress:h=>{r(c.id,{progress:h})}});r(c.id,{status:"success",fileUrl:f.fileUrl,progress:100})}catch(f){d.signal.aborted||r(c.id,{status:"error",error:f instanceof Error?f.message:"Upload failed",progress:0})}finally{Yr.delete(c.id)}},o=c=>{const d=Yr.get(c);d&&(d.abort(),Yr.delete(c)),a(c)},l=T.useMemo(()=>e.filter(c=>c.status==="success"&&c.fileUrl),[e]);function u(){Yr.forEach(c=>c.abort()),Yr.clear(),t([])}return T.useEffect(()=>()=>{Yr.forEach(c=>c.abort()),Yr.clear()},[]),{allFiles:e,appendFiles:i,handleCancelUpload:o,successFiles:l,emptyTheFiles:u,getFileById:c=>e.find(d=>d.id===c),getUploadProgress:c=>{var d;return((d=e.find(f=>f.id===c))==null?void 0:d.progress)??0},getUploadStatus:c=>{var d;return(d=e.find(f=>f.id===c))==null?void 0:d.status},hasErrors:e.some(c=>c.status==="error"),isUploading:e.some(c=>c.status==="uploading")}}const Ex=T.createContext(null);function m5({children:e}){const t=We(),[n,i]=T.useState(()=>t.inline?!0:t.isOpen??!1);return T.useEffect(()=>{i(r=>t.isOpen??r)},[t.isOpen]),T.useEffect(()=>{const r=t.openAfterNSeconds;if(typeof r!="number"||isNaN(r))return;const a=setTimeout(()=>i(!0),r*1e3);return()=>clearTimeout(a)},[t.openAfterNSeconds]),Dn.createElement(Ex.Provider,{value:{isOpen:n,setIsOpen:i}},e)}function zs(){const e=T.useContext(Ex);if(!e)throw new Error("useWidgetTrigger must be used within a WidgetTriggerProvider");return e}function Tx(){var e,t;const{widgetCtx:n}=It(),{modesComponents:i}=We(),{sessionState:r}=wi(),a=n.modes,s=(e=r.session)==null?void 0:e.modeId,o=a.find(u=>u.id===s),l=(t=i==null?void 0:i.find(u=>{var c,d;return[(o==null?void 0:o.id)||"",((c=o==null?void 0:o.name)==null?void 0:c.toLowerCase())||"",((d=o==null?void 0:o.slug)==null?void 0:d.toLowerCase())||""].includes(u.key.toLowerCase())}))==null?void 0:t.component;return{modes:a,modesComponents:i,activeModeId:s,activeMode:o,Component:l}}function _x(){const{widgetCtx:e}=It(),{messagesState:{messages:t}}=Pn(),{csatRequestedMessage:n,isCsatRequested:i,csatSubmittedMessage:r,isCsatSubmitted:a,submittedScore:s,submittedFeedback:o}=T.useMemo(()=>{const l=t.find(c=>c.type==="SYSTEM"&&c.subtype==="csat_requested"),u=t.findLast(c=>c.type==="SYSTEM"&&c.subtype==="csat_submitted");return{csatRequestedMessage:l,isCsatRequested:!!l&&!u,csatSubmittedMessage:u,isCsatSubmitted:!!u,submittedScore:u==null?void 0:u.data.payload.score,submittedFeedback:u==null?void 0:u.data.payload.feedback}},[t]);return{submitCsat:e.csatCtx.submitCsat,csatRequestedMessage:n,isCsatRequested:i,csatSubmittedMessage:r,isCsatSubmitted:a,submittedScore:s,submittedFeedback:o}}function wx(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=wx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Sx(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=wx(e))&&(i&&(i+=" "),i+=t);return i}const Cp="-",g5=e=>{const t=y5(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:s=>{const o=s.split(Cp);return o[0]===""&&o.length!==1&&o.shift(),Ax(o,t)||b5(s)},getConflictingClassGroupIds:(s,o)=>{const l=n[s]||[];return o&&i[s]?[...l,...i[s]]:l}}},Ax=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),r=i?Ax(e.slice(1),i):void 0;if(r)return r;if(t.validators.length===0)return;const a=e.join(Cp);return(s=t.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},Cx=/^\[(.+)\]$/,b5=e=>{if(Cx.test(e)){const t=Cx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},y5=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return x5(Object.entries(e.classGroups),n).forEach(([a,s])=>{kp(s,i,a,t)}),i},kp=(e,t,n,i)=>{e.forEach(r=>{if(typeof r=="string"){const a=r===""?t:kx(t,r);a.classGroupId=n;return}if(typeof r=="function"){if(v5(r)){kp(r(i),t,n,i);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([a,s])=>{kp(s,kx(t,a),n,i)})})},kx=(e,t)=>{let n=e;return t.split(Cp).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},v5=e=>e.isThemeGetter,x5=(e,t)=>t?e.map(([n,i])=>{const r=i.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,o])=>[t+s,o])):a);return[n,r]}):e,E5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const r=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,i=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=i.get(a))!==void 0)return r(a,s),s},set(a,s){n.has(a)?n.set(a,s):r(a,s)}}},Ox="!",T5=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,r=t[0],a=t.length,s=o=>{const l=[];let u=0,c=0,d;for(let E=0;E<o.length;E++){let m=o[E];if(u===0){if(m===r&&(i||o.slice(E,E+a)===t)){l.push(o.slice(c,E)),c=E+a;continue}if(m==="/"){d=E;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?o:o.substring(c),h=f.startsWith(Ox),g=h?f.substring(1):f,b=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}};return n?o=>n({className:o,parseClassName:s}):s},_5=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},w5=e=>({cache:E5(e.cacheSize),parseClassName:T5(e),...g5(e)}),S5=/\s+/,A5=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r}=t,a=[],s=e.trim().split(S5);let o="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let g=!!h,b=i(g?f.substring(0,h):f);if(!b){if(!g){o=u+(o.length>0?" "+o:o);continue}if(b=i(f),!b){o=u+(o.length>0?" "+o:o);continue}g=!1}const E=_5(c).join(":"),m=d?E+Ox:E,y=m+b;if(a.includes(y))continue;a.push(y);const x=r(b,g);for(let _=0;_<x.length;++_){const S=x[_];a.push(m+S)}o=u+(o.length>0?" "+o:o)}return o};function C5(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Nx(t))&&(i&&(i+=" "),i+=n);return i}const Nx=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Nx(e[i]))&&(n&&(n+=" "),n+=t);return n};function k5(e,...t){let n,i,r,a=s;function s(l){const u=t.reduce((c,d)=>d(c),e());return n=w5(u),i=n.cache.get,r=n.cache.set,a=o,o(l)}function o(l){const u=i(l);if(u)return u;const c=A5(l,n);return r(l,c),c}return function(){return a(C5.apply(null,arguments))}}const it=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rx=/^\[(?:([a-z-]+):)?(.+)\]$/i,O5=/^\d+\/\d+$/,N5=new Set(["px","full","screen"]),R5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D5=/\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$/,M5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>js(e)||N5.has(e)||O5.test(e),qr=e=>Hs(e,"length",V5),js=e=>!!e&&!Number.isNaN(Number(e)),Op=e=>Hs(e,"number",js),Tl=e=>!!e&&Number.isInteger(Number(e)),P5=e=>e.endsWith("%")&&js(e.slice(0,-1)),_e=e=>Rx.test(e),Gr=e=>R5.test(e),B5=new Set(["length","size","percentage"]),U5=e=>Hs(e,B5,Dx),z5=e=>Hs(e,"position",Dx),j5=new Set(["image","url"]),H5=e=>Hs(e,j5,q5),F5=e=>Hs(e,"",Y5),_l=()=>!0,Hs=(e,t,n)=>{const i=Rx.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},V5=e=>D5.test(e)&&!M5.test(e),Dx=()=>!1,Y5=e=>L5.test(e),q5=e=>I5.test(e),G5=k5(()=>{const e=it("colors"),t=it("spacing"),n=it("blur"),i=it("brightness"),r=it("borderColor"),a=it("borderRadius"),s=it("borderSpacing"),o=it("borderWidth"),l=it("contrast"),u=it("grayscale"),c=it("hueRotate"),d=it("invert"),f=it("gap"),h=it("gradientColorStops"),g=it("gradientColorStopPositions"),b=it("inset"),E=it("margin"),m=it("opacity"),y=it("padding"),x=it("saturate"),_=it("scale"),S=it("sepia"),k=it("skew"),D=it("space"),L=it("translate"),B=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",_e,t],H=()=>[_e,t],re=()=>["",cr,qr],ee=()=>["auto",js,_e],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",_e],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],be=()=>[js,_e];return{cacheSize:500,separator:":",theme:{colors:[_l],spacing:[cr,qr],blur:["none","",Gr,_e],brightness:be(),borderColor:[e],borderRadius:["none","","full",Gr,_e],borderSpacing:H(),borderWidth:re(),contrast:be(),grayscale:te(),hueRotate:be(),invert:te(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[P5,qr],inset:Y(),margin:Y(),opacity:be(),padding:H(),saturate:be(),scale:be(),sepia:te(),skew:be(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",_e]}],container:["container"],columns:[{columns:[Gr]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...Q(),_e]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tl,_e]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_e]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",Tl,_e]}],"grid-cols":[{"grid-cols":[_l]}],"col-start-end":[{col:["auto",{span:["full",Tl,_e]},_e]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[_l]}],"row-start-end":[{row:["auto",{span:[Tl,_e]},_e]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_e]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_e,t]}],"min-w":[{"min-w":[_e,t,"min","max","fit"]}],"max-w":[{"max-w":[_e,t,"none","full","min","max","fit","prose",{screen:[Gr]},Gr]}],h:[{h:[_e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Gr,qr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Op]}],"font-family":[{font:[_l]}],"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",_e]}],"line-clamp":[{"line-clamp":["none",js,Op]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cr,_e]}],"list-image":[{"list-image":["none",_e]}],"list-style-type":[{list:["none","disc","decimal",_e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cr,qr]}],"underline-offset":[{"underline-offset":["auto",cr,_e]}],"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:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e]}],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",_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),z5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",U5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H5]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:F()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[cr,_e]}],"outline-w":[{outline:[cr,qr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[cr,qr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gr,F5]}],"shadow-color":[{shadow:[_l]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gr,_e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_e]}],duration:[{duration:be()}],ease:[{ease:["linear","in","out","in-out",_e]}],delay:[{delay:be()}],animate:[{animate:["none","spin","ping","pulse","bounce",_e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Tl,_e]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_e]}],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",_e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",_e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cr,qr,Op]}],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"]}}}),Np=T.createContext({});function Rp(e){const t=T.useRef(null);return t.current===null&&(t.current=e()),t.current}const ed=T.createContext(null),Dp=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class X5 extends T.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function $5({children:e,isPresent:t}){const n=T.useId(),i=T.useRef(null),r=T.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=T.useContext(Dp);return T.useInsertionEffect(()=>{const{width:s,height:o,top:l,left:u}=r.current;if(t||!i.current||!s||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
69
69
|
[data-motion-pop-id="${n}"] {
|
|
70
70
|
position: absolute !important;
|
|
71
71
|
width: ${s}px !important;
|
|
@@ -300,7 +300,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
300
300
|
${At.screens.welcome.width},
|
|
301
301
|
${At.screens.sessions.width},
|
|
302
302
|
${At.screens.chat.width}
|
|
303
|
-
)`)};return{theme:At,computed:Es,cssVars:YX({palette:At.palette,primary:At.primaryColor})}}function YX({palette:e,primary:t}){const n=kC(e),i=ce(t).toHsl(),r=ce(t).isLight()?n[950]:n[50];return{"--opencx-primary":`${i.h} ${i.s*100}% ${i.l*100}%`,"--opencx-primary-foreground":r,"--opencx-background":n[100],"--opencx-foreground":n[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":n[50],"--opencx-accent":n[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":n[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":n[200],"--opencx-muted-foreground":n[500],"--opencx-input":n[300],"--opencx-border":n[300],"--opencx-ring":"var(--opencx-foreground)"}}function kC(e){const t={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},n={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},i={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},r={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(e){case"neutral":return t;case"stone":return n;case"zinc":return i;case"slate":return r;default:return ii(e,kC.name),t}}function OC(){const{contentIframeRef:e}=It(),{inline:t}=We();return{setWidth:n=>{var i;(i=e==null?void 0:e.current)==null||i.style.setProperty("--opencx-widget-width",t?"100%":n)},setHeight:n=>{var i;(i=e==null?void 0:e.current)==null||i.style.setProperty("--opencx-widget-height",t?"100%":n)}}}function Tg({width:e,height:t}){const{isSmallScreen:n}=Qi(),{setWidth:i,setHeight:r}=OC();T.useEffect(()=>{e&&i(e),t&&r(t)},[n,t,e,i,r])}const NC=k2;function vu({name:e,className:t}){const n=(()=>{switch(e){case"Check":return TP;case"CheckCheck":return EP;case"CircleCheck":return C2;case"CircleCheckBig":return CP;case"CircleX":return kP;case"Expand":return OP;case"Maximize":return BP;case"Maximize2":return PP;case"Minimize":return zP;case"Minimize2":return UP;case"Shrink":return FP;case"SquareCheck":return YP;case"SquareCheckBig":return VP;case"SquareX":return qP;case"X":return xd;case void 0:return NC;default:return ii(e,vu.name),NC}})();return v.jsx(n,{className:de("size-4",t)})}function _g(){const{widgetCtx:{org:e}}=It(),{routerState:{screen:t}}=ur(),{textContent:n}=We();return(()=>{var i,r;switch(t){case"chat":return(i=n==null?void 0:n.chatScreen)==null?void 0:i.headerTitle;case"sessions":return(r=n==null?void 0:n.sessionsScreen)==null?void 0:r.headerTitle;case"welcome":return;default:ii(t,_g.name);return}})()??e.name??"Chat"}function qX(e){switch(e){case"chat":return ze("chat/header");case"sessions":return ze("sessions/header");case"welcome":return;default:ii(e,_g.name);return}}function GX(){const{router:e}=We(),{routerState:{screen:t},toSessionsScreen:n}=ur();return t!=="chat"||e!=null&&e.chatScreenOnly?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:v.jsx(wP,{className:"size-4 rtl:-scale-100"})})}function XX({button:e}){const{setIsOpen:t}=zs(),{isSmallScreen:n}=Qi();return n&&e.hideOnSmallScreen||!n&&e.hideOnLargeScreen?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:()=>{if(e.handleClick)return e.handleClick();t(!1)},children:v.jsx(vu,{name:e.icon})})}function wg({button:e}){const[t,n]=T.useState(!1),{routerState:{screen:i}}=ur(),{isSmallScreen:r}=Qi(),{theme:a}=es(),{setWidth:s,setHeight:o}=OC();if(i!=="chat"&&i!=="sessions")return null;const l=(()=>{switch(i){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return ii(i,wg.name),a.screens.chat.height}})(),u=(()=>{switch(i){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return ii(i,wg.name),a.screens.chat.width}})(),c=()=>{n(d=>{const f=!d;return o(f?"100vh":l),s(f?`max(40vw, ${u})`:u),f})};return r&&e.hideOnSmallScreen||!r&&e.hideOnLargeScreen?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:c,children:v.jsx(vu,{name:e.icon||(t?e.shrinkIcon:e.expandIcon)})})}function RC({button:e}){var t,n;const{close:i}=df(),{widgetCtx:r}=It(),{setIsOpen:a}=zs(),{resolveSession:s,sessionState:o}=wi(),{isSmallScreen:l}=Qi(),u=!o.session,c=((t=o.session)==null?void 0:t.isOpened)===!1,d=e.onResolved||"stay-in-chat",f=e.behaviorBeforeSessionCreation||"disabled",h=e.behaviorIfSessionIsResolved||"disabled",g=!!(o.isResolvingSession||u&&f==="disabled"||c&&h==="disabled"),b=async()=>{const{success:m,error:y}=await s();if(i(),!m)return console.error(y);switch(d){case"stay-in-chat":return;case"close-widget":a(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":a(!1),r.resetChat();break;default:ii(d,RC.name);break}},E=()=>{if(u)switch(f){case"disabled":return;case"close-widget":a(!1);break;default:ii(f,E.name)}if(c)switch(h){case"disabled":return;case"close-widget":a(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":a(!1),setTimeout(()=>{r.resetChat()},200);break;default:ii(h,E.name)}};return l&&e.hideOnSmallScreen||!l&&e.hideOnLargeScreen?null:((n=e.confirmation)==null?void 0:n.type)==="modal"&&!c&&!u?v.jsx(TC,{trigger:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",disabled:g,children:v.jsx(vu,{name:e.icon})}),children:v.jsxs(gC,{children:[v.jsx(bC,{children:v.jsx(xC,{children:e.confirmation.title||"Close conversation"})}),v.jsx(yC,{children:v.jsx(EC,{children:e.confirmation.description||"Are you sure you want to close this conversation?"})}),v.jsxs(vC,{children:[v.jsx(_t,{variant:"secondary",onClick:i,disabled:o.isResolvingSession,children:e.confirmation.cancelButtonText||"No"}),v.jsx(_t,{variant:"destructive",onClick:b,disabled:o.isResolvingSession,children:e.confirmation.confirmButtonText||"Yes"})]})]})}):v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:c||u?E:b,disabled:g,children:v.jsx(vu,{name:e.icon})})}function Sg({button:e}){switch(e.functionality){case"close-widget":return v.jsx(XX,{button:e});case"expand-shrink":return v.jsx(wg,{button:e});case"resolve-session":return v.jsx(RC,{button:e});default:return ii(e,Sg.name),null}}const $X={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function KX(){const{routerState:{screen:e}}=ur(),{headerButtons:t}=We(),n=e==="chat"?t==null?void 0:t.chatScreen:e==="sessions"?t==null?void 0:t.sessionsScreen:[];return!n||n.length===0?v.jsx(Sg,{button:$X}):v.jsx(v.Fragment,{children:n.map(i=>v.jsx(Sg,{button:i},`${i.functionality}-${i.icon}`))})}function DC(){const{routerState:{screen:e}}=ur(),t=qX(e),n=_g();return v.jsx("header",{...t,className:"py-2 px-4 shrink-0",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(GX,{}),v.jsx("div",{className:de("flex-1 h-8 flex items-center",e==="sessions"&&"ps-2"),children:v.jsx("h2",{className:"font-semibold",children:n})}),v.jsx(KX,{})]})})}function MC({className:e}){return v.jsx(IP,{className:de("size-4 animate-spin",e)})}function QX(){const{messagesState:{isInitialFetchLoading:e}}=Pn(),{isSmallScreen:t}=Qi(),{activeMode:n,Component:i}=Tx();return{isCanvasOpen:!e&&!t&&!!n&&!!i}}function WX(){const{activeMode:e,Component:t}=Tx(),{sendMessage:n}=Pn(),{createStateCheckpoint:i}=wi(),[r,a]=T.useState(!1),s=async o=>{try{a(!0),await n(o)}catch(l){console.error(l)}finally{a(!1)}};return!e||!t?null:v.jsx(t,{react:Dn,mode:e,createStateCheckpoint:i,sendMessage:s,isSendingMessage:r})}const Wi=Dn.forwardRef((e,t)=>{var n,i,r;return v.jsx(at,{...e,ref:t,className:de("overflow-hidden",e.className),overrides:{initial:{height:0,opacity:0,...(n=e.overrides)==null?void 0:n.initial},animate:{height:"auto",opacity:1,...(i=e.overrides)==null?void 0:i.animate},exit:{height:0,opacity:0,...(r=e.overrides)==null?void 0:r.exit}}})});Wi.displayName="MotionDiv__VerticalReveal";const ZX=[{label:"Terrible",value:1,emoji:"😡"},{label:"Poor",value:2,emoji:"😞"},{label:"Okay",value:3,emoji:"😐"},{label:"Good",value:4,emoji:"😊"},{label:"Great",value:5,emoji:"😍"}];function JX(){const{isSmallScreen:e}=Qi(),{submitCsat:t,isCsatRequested:n,isCsatSubmitted:i,submittedScore:r,submittedFeedback:a}=_x(),[s,o]=T.useState(null),[l,u]=T.useState(null),c=f=>{o(h=>h===f?null:f)},d=()=>{s&&t({score:s,feedback:l||void 0})};return!n&&!i?null:v.jsxs("div",{className:"w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden",children:[v.jsx(Pt,{mode:"wait",children:n&&!s?v.jsx(Wi,{children:v.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"How was your conversation?"})},"csat-requested-title"):i?v.jsx(Wi,{children:v.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"You rated the conversation as"})},"csat-submitted-title"):null}),v.jsx("div",{className:de("flex gap-4 justify-between pt-2 px-2 pb-2","transition-all",i&&"gap-0 justify-center"),children:ZX.map(f=>v.jsx(_t,{variant:f.value===s?"secondary":"ghost",size:"selfless",className:de("transition-all overflow-hidden","text-2xl size-8 rounded-full","opacity-35","hover:opacity-100",!s&&"opacity-100",f.value===s&&"opacity-100",i&&f.value!==r&&"opacity-0 size-0",i&&f.value===r&&"opacity-100 size-fit text-4xl"),onClick:n?()=>c(f.value):void 0,children:f.emoji},f.value))}),v.jsx(Pt,{mode:"wait",children:(s||r)&&v.jsx(Wi,{children:v.jsxs("div",{className:"pb-2 px-2 flex items-end",children:[v.jsx("textarea",{rows:3,className:de("transition-all","max-h-40 [field-sizing:content]","w-full resize-none","bg-transparent outline-none","placeholder:text-muted-foreground",e?"text-[16px]":"text-sm",i&&"text-center"),value:i?a||"":l||"",onChange:n?f=>u(f.target.value):void 0,readOnly:i,placeholder:n?"Tell us more... (optional)":void 0}),v.jsx(_t,{size:"fit",onClick:d,disabled:!s,className:de("transition-all overflow-hidden","rounded-full size-8 flex items-center justify-center p-0",i&&"opacity-0 size-0"),children:v.jsx(A2,{className:"size-4"})})]})},"feedback-box")}),v.jsx("div",{className:de("h-0 transition-[height]",i&&"h-4")})]})}function ts(){const{dir:e}=Ap(),t=We();return T.useMemo(()=>{const n=l5(t.language)?t.language:"en";return{t:i=>u5(i,n,t.translationOverrides),language:n,dir:n==="ar"?"rtl":"ltr",hostDocumentDir:e}},[t.language,e])}function Ag({suggestion:e,className:t,...n}){const{sendMessage:i}=Pn(),r=()=>{const a=e.trim();a&&i({content:a})};return v.jsx(_t,{...ze("chat/suggested_reply_btn"),size:"sm",className:de("rounded-xl w-fit",t),...n,onClick:r,children:e})}function e$(){const{t:e}=ts(),t=[e("i_need_more_help"),e("this_was_helpful")];return v.jsx("div",{...ze("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:t.map(n=>v.jsx(Ag,{suggestion:n,className:"flex-1"},n))})}function LC(){const{sessionState:e}=wi(),{chatFooterItems:t}=We(),n=!!e.session&&!e.session.isOpened,i=!n;return v.jsx(Pt,{mode:"wait",children:t==null?void 0:t.map((r,a)=>r.showWhenSessionIsOpen===!1&&i||r.showWhenSessionIsResolved===!1&&n?null:v.jsx(Wi,{children:v.jsx("div",{className:"pb-2 text-center text-xs",children:v.jsx(gg,{children:r.message})})},`${r.message}-${a}`))})}function t$({file:{status:e,file:t,error:n},onCancel:i}){const[r,a]=T.useState(null);T.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>a(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const s=()=>{switch(e){case"uploading":return v.jsx(LP,{className:"size-4 animate-spin"});case"error":return v.jsx(AP,{className:"size-4 text-destructive"});default:return null}},o=()=>{const l=t.type.split("/")[0];return l==="image"&&r?v.jsx("img",{src:typeof r=="string"?r:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?v.jsx(NP,{}):l==="video"?v.jsx(RP,{}):v.jsx(DP,{})};return v.jsx(yu,{side:"bottom",content:e==="error"?v.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:v.jsxs("div",{className:de(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s()}),v.jsx("button",{type:"button",className:de("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:i,children:v.jsx(xd,{className:"size-4 text-primary-foreground"})}),v.jsx(o,{})]})})}function n$(){var e;const{isSmallScreen:t}=Qi(),n=T.useRef(null),{sendMessage:i}=Pn(),{sessionState:r}=wi(),{t:a}=ts(),[s,o]=T.useState(""),{allFiles:l,emptyTheFiles:u,handleCancelUpload:c,appendFiles:d,isUploading:f,successFiles:h}=p5(),g=!!((e=r.session)!=null&&e.isHandedOff),{isAwaitingBotReply:b}=xx(),E=D=>{d(D)},m=!s.trim()&&h.length===0,y=async()=>{if(b||m)return;f&&console.info("please wait for the file(s) to upload");const D=s.trim();i({content:D,attachments:h.flatMap(L=>L.fileUrl?[{url:L.fileUrl,type:L.file.type,name:L.file.name,id:L.id,size:L.file.size}]:[])}),o(""),u()},{getRootProps:x,getInputProps:_,open:S}=qA({onDrop:E,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:g?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"]}}),k=D=>{const L=D.clipboardData;L&&L.files.length>0&&E(Array.from(L.files))};return v.jsxs("div",{...ze("chat/input_box/root"),className:"p-2 relative space-y-1",...x(),children:[v.jsx("input",{..._()}),v.jsxs("div",{...ze("chat/input_box/inner_root"),className:de("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[v.jsxs("div",{...ze("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[l.length>0&&v.jsx("div",{...ze("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:v.jsx(Pt,{mode:"popLayout",children:l.map(D=>v.jsx(at,{snapExit:!0,children:v.jsx(t$,{onCancel:()=>c(D.id),file:D})},D.id))})}),v.jsx("textarea",{...ze("chat/input_box/textarea"),onPaste:k,ref:n,id:"chat-input",value:s,rows:3,className:de("max-h-16 [field-sizing:content]","w-full resize-none px-2",l.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:D=>o(D.target.value),onKeyDown:async D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),y())},placeholder:a("write_a_message_placeholder")})]}),v.jsxs("div",{className:"gap-2 flex justify-between",children:[v.jsx(yu,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:v.jsx(_t,{onClick:S,size:"fit",variant:"ghost",className:de("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:v.jsx(Pt,{mode:"wait",children:g&&!b?v.jsx(at,{children:v.jsx(jP,{className:"size-4"})},"paper-clip"):v.jsx(at,{children:v.jsx(MP,{className:"size-4"})},"image-icon")})})}),v.jsx(yu,{content:"send message",side:"top",align:"end",children:v.jsx(_t,{size:"fit",onClick:y,disabled:b||f||m,className:"rounded-full size-8 flex items-center justify-center p-0",children:v.jsx(Pt,{mode:"wait",children:b||f?v.jsx(at,{snapExit:!0,children:v.jsx(k2,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):v.jsx(at,{snapExit:!0,children:v.jsx(A2,{className:"size-4"})},"send")})})})]})]})]})}function IC(){const{widgetCtx:e}=It(),{router:t}=We(),{canCreateNewSession:n}=wi(),{toSessionsScreen:i}=ur(),{t:r}=ts();return v.jsx(v.Fragment,{children:n||t!=null&&t.chatScreenOnly?v.jsx(_t,{onClick:e.resetChat,className:"rounded-2xl w-full",children:r("new_conversation")}):v.jsx(_t,{onClick:i,className:"rounded-2xl w-full",children:r("back_to_conversations")})})}function i$(){const{t:e}=ts(),{isCsatRequested:t,isCsatSubmitted:n}=_x();return v.jsx("div",{className:"p-2",children:v.jsx("div",{className:"p-2 bg-muted rounded-3xl",children:v.jsx(Pt,{mode:"wait",children:t||n?v.jsxs(Wi,{children:[v.jsx(JX,{}),v.jsx(Pt,{mode:"wait",children:n&&v.jsx(Wi,{children:v.jsx(IC,{})},"new-conv-or-back-to-convs-button")})]},"csat"):v.jsxs(Wi,{children:[v.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[v.jsx(C2,{className:"size-4 text-emerald-600"}),v.jsx("h2",{className:"text-sm font-medium",children:e("your_issue_has_been_resolved")})]}),v.jsx(IC,{})]},"session-closed")})})})}function r$(){var e;const{initialQuestions:t,initialQuestionsPosition:n,thisWasHelpfulOrNot:i}=We(),{sessionState:r}=wi(),{messagesState:a}=Pn(),s=a.messages.length===0;return v.jsx("footer",{children:v.jsx(Pt,{mode:"wait",children:r.session&&!((e=r.session)!=null&&e.isOpened)?v.jsxs(Wi,{children:[v.jsx(i$,{}),v.jsx(LC,{})]},"session-closed"):v.jsxs(Wi,{children:[a.lastAIResMightSolveUserIssue&&(i==null?void 0:i.enabled)!==!1&&v.jsx(e$,{}),s&&t&&n!=="below-initial-messages"&&v.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((o,l)=>v.jsx(Ag,{suggestion:o},`${o}-${l}`))}),v.jsx(n$,{}),v.jsx(LC,{})]},"chat-input")})})}function a$({isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n,...i}){const{componentStore:r}=It();if(i.type!=="AGENT"&&i.type!=="AI")return null;if(i.data.action){const s=r.getComponent(i.data.action.name);if(s)return v.jsx(s,{...i,id:i.id,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n})}const a=r.getComponent(i.component);return a?v.jsx(a,{...i,id:i.id,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n}):v.jsx(bg,{...i,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n})}function PC({messages:e,className:t,containerClassName:n}){var i,r;const{timestamps:a}=We();if(!((i=a==null?void 0:a.perMessageGroup)!=null&&i.enabled))return null;const s=(r=e[e.length-1])==null?void 0:r.timestamp;if(!s)return null;const o=(()=>{try{return new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(l){return console.error(l),null}})();return o?v.jsx("div",{className:n,children:v.jsx("span",{className:de("text-xs text-muted-foreground",t),children:o})}):null}function hf({messages:e,agent:t,suggestedReplies:n}){return v.jsxs("div",{...ze("chat/agent_msg_group/root"),className:de("flex items-end gap-2"),children:[v.jsx(yu,{content:t==null?void 0:t.name,side:"right",align:"end",children:v.jsx(Eg,{...ze("chat/agent_msg_group/root/avatar"),agent:t,className:"hidden"})}),v.jsxs("div",{className:de("flex-1 flex flex-col gap-1"),children:[v.jsxs("div",{...ze("chat/agent_msg_group/avatar_and_msgs/root"),className:de("flex items-end gap-2"),children:[v.jsx(yu,{content:t==null?void 0:t.name,side:"right",align:"end",children:v.jsx(Eg,{...ze("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:t})}),v.jsxs("div",{...ze("chat/agent_msg_group/avatar_and_msgs/msgs"),className:de("flex-1 flex flex-col gap-1"),children:[e.map((i,r,a)=>v.jsx(a$,{isFirstInGroup:r===0,isLastInGroup:r===a.length-1,isAloneInGroup:a.length===1,...i},i.id)),v.jsx(PC,{messages:e})]})]}),n&&n.length>0&&v.jsx("div",{...ze("chat/agent_msg_group/suggestions"),className:de("flex flex-col gap-1 ps-8"),children:n==null?void 0:n.map((i,r)=>v.jsx(Ag,{suggestion:i},`${i}-${r}`))})]})]})}function BC(){const{widgetCtx:{org:e}}=It(),{sessionState:{session:t}}=wi(),n=We(),{messagesState:{messages:i}}=Pn();return{props:{react:Dn,org:e,session:t,config:n,messages:i}}}function s$(){var e,t;const{props:n}=BC();if((e=n.session)!=null&&e.isOpened||!n.session)return null;const i=(t=n.config.specialComponents)==null?void 0:t.onSessionResolved;return i?v.jsx(i,{...n}):null}function o$({message:e,isFirstInGroup:t,isLastInGroup:n,isAloneInGroup:i}){var r;return v.jsxs("div",{...ze("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[e.attachments&&e.attachments.length>0&&v.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(r=e.attachments)==null?void 0:r.map(a=>v.jsx(_C,{attachment:a},a.id))}),e.content.length>0&&v.jsx("div",{...ze("chat/user_msg/msg"),"data-first":t,"data-last":n,"data-alone":i,className:de("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",t&&!i&&"rounded-br-md",n&&!i&&"rounded-tr-md",!t&&!n&&!i&&"rounded-r-md"),children:e.content})]})}function l$({messages:e}){return v.jsxs("div",{...ze("chat/user_msg_group/root"),className:de("group","flex flex-col gap-1 justify-end items-end"),children:[e.map((t,n,i)=>v.jsx(o$,{message:t,isFirstInGroup:n===0,isLastInGroup:n===i.length-1,isAloneInGroup:i.length===1},t.id)),v.jsx(PC,{messages:e,containerClassName:"ms-auto"})]})}function u$(e){const t=[];let n=null;return e.forEach(i=>{var r,a,s,o,l,u;(((r=n==null?void 0:n[0])==null?void 0:r.type)!==i.type||((a=n[0])==null?void 0:a.type)==="AGENT"&&i.type==="AGENT"&&(((s=i.agent)==null?void 0:s.id)!==((o=n[0].agent)==null?void 0:o.id)||((l=i.agent)==null?void 0:l.name)!==((u=n[0].agent)==null?void 0:u.name)))&&(n=[],t.push(n)),n.push(i)}),t}function c$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="USER"}function d$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="AI"}function f$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="AGENT"}function h$(){const{messagesState:{messages:e}}=Pn(),{advancedInitialMessages:t=[],initialQuestionsPosition:n,initialQuestions:i,bot:r}=We();return v.jsx(v.Fragment,{children:e.length===0&&t.length>0&&v.jsx(hf,{messages:t.map(({message:a},s)=>({component:"bot_message",data:{message:a},id:`${s}-${a}`,type:"AI",timestamp:null})),suggestedReplies:e.length===0&&n==="below-initial-messages"?i:void 0,agent:r?{...r,isAi:!0,id:null}:void 0})})}function p$(){const{messagesState:{messages:e}}=Pn(),{chatBannerItems:t}=We();return!(t!=null&&t.length)||e.length>0&&t.every(n=>!n.persistent)?null:v.jsx("div",{className:"w-full text-center text-xs",children:t.map(({message:n,persistent:i},r)=>e.length>0&&!i?null:v.jsx("div",{children:v.jsx(gg,{children:n})},`${n}-${r}`))})}function m$(){const{messagesState:{messages:e}}=Pn(),t=We(),{advancedInitialMessages:n=[],initialQuestions:i,initialQuestionsPosition:r}=t,a=(()=>{var s;return n.length?[]:e.length?[]:(s=t.initialMessages)!=null&&s.length?t.initialMessages:["Hello, how can I help you?"]})();return v.jsx(v.Fragment,{children:e.length===0&&a.length>0&&v.jsx(hf,{messages:a.map((s,o)=>({component:"bot_message",data:{message:s},id:`${o}-${s}`,type:"AI",timestamp:null})),suggestedReplies:r==="below-initial-messages"?i:void 0,agent:t.bot?{...t.bot,isAi:!0,id:null}:void 0})})}function g$(){var e;const{props:t}=BC(),n=(e=t.config.specialComponents)==null?void 0:e.chatBottomComponents;return n?v.jsx("div",{children:n.map(({key:i,component:r})=>v.jsx(r,{...t},i))}):null}function b$(){const{messagesState:{messages:e}}=Pn(),{isAwaitingBotReply:t}=xx(),{componentStore:n}=It(),i=We(),r=T.useMemo(()=>u$(e),[e]),a=n.getComponent("loading"),s=T.useRef(null);function o(){setTimeout(()=>{const l=s.current;l&&(l.scrollTop=l.scrollHeight)},0)}return T.useEffect(()=>{o()},[e]),v.jsxs("div",{...ze("chat/msgs/root"),ref:s,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[v.jsx(p$,{}),v.jsx(h$,{}),v.jsx(m$,{}),r.map((l,u)=>{var c,d,f,h;const g=(c=l==null?void 0:l[0])==null?void 0:c.type,b=(d=l[0])==null?void 0:d.id;if(!g||!b)return null;if(c$(l))return v.jsx(l$,{messages:l},b);if(d$(l)){const E=u===r.length-1;if(t&&E)return null;const m=(f=l[0])==null?void 0:f.agent;return v.jsx(hf,{messages:l,agent:m},b)}if(f$(l)){const E=(h=l[0])==null?void 0:h.agent;return v.jsx(hf,{messages:l,agent:E},b)}return null}),t&&a&&v.jsx(a,{agent:i.bot}),v.jsx(g$,{}),v.jsx(s$,{})]})}function y$(){const{messagesState:{isInitialFetchLoading:e}}=Pn(),{sessionState:{session:t}}=wi(),{isCanvasOpen:n}=QX(),{theme:i}=es();Tg({width:n?i.screens.chat.withCanvas.width:i.screens.chat.width,height:n?i.screens.chat.withCanvas.height:i.screens.chat.height});const r=T.useRef((t==null?void 0:t.id)||"chat").current;return v.jsx("div",{...ze("chat/root"),className:de("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:v.jsxs("div",{className:"size-full justify-between flex flex-col",children:[v.jsx(DC,{}),v.jsx(Pt,{mode:"wait",children:e?v.jsx(at,{className:"flex flex-col items-center justify-center w-full flex-1",children:v.jsx(MC,{})},"loading"):v.jsxs(at,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[v.jsxs("div",{...ze("chat/main/root"),className:de("flex flex-col h-full overflow-auto transition-all",n?"w-2/5":"w-full"),style:{transitionTimingFunction:i.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:i.screens.chat.withCanvas.transitionDuration},children:[v.jsx(b$,{}),v.jsx(r$,{})]}),v.jsx("div",{...ze("chat/canvas/root"),className:de("h-full overflow-auto transition-all",n?"w-3/5":"w-0"),style:{transitionTimingFunction:i.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:i.screens.chat.withCanvas.transitionDuration},children:v.jsx(WX,{})})]},r)})]})})}function v$({className:e,...t}){return v.jsx("div",{className:de("animate-pulse rounded-md bg-secondary",e),...t})}function x$({className:e}){return v.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:de("text-primary-foreground",e),children:v.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function UC({className:e}){const{token:t}=We();return v.jsx("div",{className:de("flex items-center justify-center gap-2 p-2 pt-0",e),children:v.jsx(yr,{children:v.jsxs("a",{href:`https://open.cx/?ref=${t}`,target:"_blank",rel:"noreferrer",className:de("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[v.jsx("span",{children:"Powered by"}),v.jsx("span",{children:" "}),v.jsxs("span",{className:"flex items-center gap-[1px]",children:[v.jsx("span",{children:v.jsx(x$,{className:"size-3 inline-block"})}),v.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function E$({children:e}){return v.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:e})}function zC({session:e,className:t}){const{bot:n}=We(),{toChatScreen:i}=ur(),r=e.assignee.kind==="human"?e.assignee.name||"Support Agent":(n==null?void 0:n.name)||"AI Support Agent",a=e.assignee.kind==="human"?e.assignee.avatarUrl||"":(n==null?void 0:n.avatar)||"";return v.jsxs(_t,{variant:"ghost",size:"lg",className:de("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",t),onClick:()=>i(e.id),children:[v.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[v.jsx(Pt,{mode:"wait",children:v.jsx(at,{snapExit:!0,children:v.jsxs(yg,{className:"size-10",children:[v.jsx(vg,{src:a,alt:"Agent Icon"}),v.jsx(xg,{children:v.jsx(GP,{className:"size-4"})})]})})}),v.jsxs("div",{className:"flex-1",children:[v.jsx(Pt,{mode:"wait",children:v.jsx(at,{snapExit:!0,children:r},r)}),v.jsx(Pt,{mode:"wait",children:e.lastMessage?v.jsx(at,{snapExit:!0,children:v.jsx(wC,{remarkPlugins:[C_],rehypePlugins:[YS],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:e.lastMessage})},e.lastMessage||"content"):v.jsx(at,{className:"w-1/2",snapExit:!0,children:v.jsx(v$,{className:"h-4 w-full"})},"skeleton")})]})]}),v.jsx(SP,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function T$(){const{t:e}=ts(),{toChatScreen:t}=ur(),{sessionsState:{data:n,isInitialFetchLoading:i},openSessions:r,closedSessions:a,canCreateNewSession:s}=wi();return v.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:v.jsx(Pt,{mode:"wait",children:i?v.jsx(at,{className:"flex-1 flex items-center justify-center",children:v.jsx(MC,{})},"loading"):v.jsx(at,{className:"flex-1 flex flex-col gap-2 relative",children:n.length?v.jsxs(v.Fragment,{children:[v.jsxs(Pt,{children:[r.length>0&&v.jsx(at,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:r.map(o=>v.jsx(zC,{session:o},o.id))},"open-sessions"),a.length>0&&v.jsxs(at,{className:"space-y-2",delay:.2,snapExit:!0,children:[v.jsx(E$,{children:e("closed_conversations")}),a.map(o=>v.jsx(zC,{session:o,className:"opacity-50 hover:opacity-100"},o.id))]},"closed-sessions")]}),s&&v.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:T.createElement(_t,{...ze("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>t()},e("new_conversation"))})]}):v.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("p",{className:"text-muted-foreground",children:e("no_conversations_yet")})}),T.createElement(_t,{...ze("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>t()},e("new_conversation"))]})},"sessions")})})}function _$(){const{theme:e}=es();return Tg({width:e.screens.sessions.width,height:e.screens.sessions.height}),v.jsx("div",{...ze("sessions/root"),className:de("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:v.jsxs("div",{className:"size-full flex flex-col",children:[v.jsx(DC,{}),v.jsx(T$,{}),v.jsx(UC,{})]})})}const pf=T.forwardRef(({className:e,type:t,...n},i)=>{const{isSmallScreen:r}=Qi();return v.jsx(yr,{ref:i,children:v.jsx("input",{type:t,className:de(r?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",e),...n})})});pf.displayName="Input";function w$(){const{contentIframeRef:e}=It(),{inline:t}=We(),n=T.useRef(null);return T.useEffect(()=>{const i=e==null?void 0:e.current;if(i&&n.current){const r=n.current;let a;const s=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const o=r.offsetHeight;i.style.setProperty("--opencx-widget-height",t?"100%":`${o.toFixed(1)}px`)})});return s.observe(r),()=>{cancelAnimationFrame(a),s.unobserve(r)}}},[e,t]),{observedElementRef:n}}const S$=OX({name:pC().min(2),email:pC().email()});function A$(){var e,t,n,i,r,a,s,o;const{widgetCtx:{org:l}}=It(),{setIsOpen:u}=zs(),{createUnverifiedContact:c}=h5(),{isSmallScreen:d}=Qi(),f=We(),{theme:h}=es(),{t:g}=ts(),{observedElementRef:b}=w$();Tg({height:void 0,width:h.screens.welcome.width});const[E,m]=T.useState(((e=f.prefillUserData)==null?void 0:e.name)||""),[y,x]=T.useState(((t=f.prefillUserData)==null?void 0:t.email)||""),_=(f.extraDataCollectionFields||[]).filter(B=>B!=="name"&&B!=="email"&&!!B),[S,k]=T.useState({}),[D,L]=nX(async B=>{B.preventDefault();const R=S$.safeParse({name:E,email:y});R.success&&await c({email:R.data.email,non_verified_name:R.data.name},Object.values(S).filter(Boolean).length?S:void 0)},[E,y,S]);return v.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:h.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:v.jsxs("div",{ref:b,className:de("flex flex-col",d&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[v.jsxs("div",{className:de("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[d&&v.jsx(at,{className:"absolute top-6 end-6",children:v.jsx(_t,{size:"selfless",onClick:()=>u(!1),children:v.jsx(xd,{className:"size-4"})})}),v.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(n=f.assets)!=null&&n.organizationLogo?v.jsx("img",{src:(i=f.assets)==null?void 0:i.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):v.jsx("h2",{className:"font-bold text-sm",children:l.name})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((a=(r=f.textContent)==null?void 0:r.welcomeScreen)==null?void 0:a.title)||g("welcome_screen_title")}),v.jsx("p",{className:"text-sm",children:((o=(s=f.textContent)==null?void 0:s.welcomeScreen)==null?void 0:o.description)||g("welcome_screen_description")})]})]}),v.jsxs("div",{className:de("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[v.jsxs("form",{onSubmit:L,className:"space-y-2",children:[v.jsx(pf,{value:E,onChange:B=>m(B.target.value),required:!0,placeholder:g("your_name_placeholder"),name:"name"}),v.jsx(pf,{required:!0,value:y,onChange:B=>x(B.target.value),type:"email",placeholder:g("your_email_placeholder"),name:"email"}),_.map(B=>v.jsx(pf,{value:S[B],onChange:R=>k(Y=>({...Y,[B]:R.target.value})),placeholder:`${B} (${g("optional")})`},B)),v.jsxs(_t,{disabled:D.loading,className:"w-full",size:"lg",children:[D.loading?g("start_chat_button_loading"):g("start_chat_button"),v.jsx(HP,{className:"size-4 rtl:-scale-100"})]})]}),v.jsx(UC,{})]})]})})}function jC(){const{routerState:{screen:e}}=ur();return v.jsx("div",{className:"relative bg-background size-full",children:v.jsx(Pt,{mode:"wait",children:(()=>{switch(e){case"welcome":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(A$,{})},e);case"sessions":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(_$,{})},e);case"chat":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(y$,{})},e);default:return ii(e,jC.name),null}})()})})}const C$="4.0.28",k$=`<!DOCTYPE html>
|
|
303
|
+
)`)};return{theme:At,computed:Es,cssVars:YX({palette:At.palette,primary:At.primaryColor})}}function YX({palette:e,primary:t}){const n=kC(e),i=ce(t).toHsl(),r=ce(t).isLight()?n[950]:n[50];return{"--opencx-primary":`${i.h} ${i.s*100}% ${i.l*100}%`,"--opencx-primary-foreground":r,"--opencx-background":n[100],"--opencx-foreground":n[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":n[50],"--opencx-accent":n[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":n[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":n[200],"--opencx-muted-foreground":n[500],"--opencx-input":n[300],"--opencx-border":n[300],"--opencx-ring":"var(--opencx-foreground)"}}function kC(e){const t={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},n={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},i={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},r={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(e){case"neutral":return t;case"stone":return n;case"zinc":return i;case"slate":return r;default:return ii(e,kC.name),t}}function OC(){const{contentIframeRef:e}=It(),{inline:t}=We();return{setWidth:n=>{var i;(i=e==null?void 0:e.current)==null||i.style.setProperty("--opencx-widget-width",t?"100%":n)},setHeight:n=>{var i;(i=e==null?void 0:e.current)==null||i.style.setProperty("--opencx-widget-height",t?"100%":n)}}}function Tg({width:e,height:t}){const{isSmallScreen:n}=Qi(),{setWidth:i,setHeight:r}=OC();T.useEffect(()=>{e&&i(e),t&&r(t)},[n,t,e,i,r])}const NC=k2;function vu({name:e,className:t}){const n=(()=>{switch(e){case"Check":return TP;case"CheckCheck":return EP;case"CircleCheck":return C2;case"CircleCheckBig":return CP;case"CircleX":return kP;case"Expand":return OP;case"Maximize":return BP;case"Maximize2":return PP;case"Minimize":return zP;case"Minimize2":return UP;case"Shrink":return FP;case"SquareCheck":return YP;case"SquareCheckBig":return VP;case"SquareX":return qP;case"X":return xd;case void 0:return NC;default:return ii(e,vu.name),NC}})();return v.jsx(n,{className:de("size-4",t)})}function _g(){const{widgetCtx:{org:e}}=It(),{routerState:{screen:t}}=ur(),{textContent:n}=We();return(()=>{var i,r;switch(t){case"chat":return(i=n==null?void 0:n.chatScreen)==null?void 0:i.headerTitle;case"sessions":return(r=n==null?void 0:n.sessionsScreen)==null?void 0:r.headerTitle;case"welcome":return;default:ii(t,_g.name);return}})()??e.name??"Chat"}function qX(e){switch(e){case"chat":return ze("chat/header");case"sessions":return ze("sessions/header");case"welcome":return;default:ii(e,_g.name);return}}function GX(){const{router:e}=We(),{routerState:{screen:t},toSessionsScreen:n}=ur();return t!=="chat"||e!=null&&e.chatScreenOnly?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:v.jsx(wP,{className:"size-4 rtl:-scale-100"})})}function XX({button:e}){const{setIsOpen:t}=zs(),{isSmallScreen:n}=Qi();return n&&e.hideOnSmallScreen||!n&&e.hideOnLargeScreen?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:()=>{if(e.handleClick)return e.handleClick();t(!1)},children:v.jsx(vu,{name:e.icon})})}function wg({button:e}){const[t,n]=T.useState(!1),{routerState:{screen:i}}=ur(),{isSmallScreen:r}=Qi(),{theme:a}=es(),{setWidth:s,setHeight:o}=OC();if(i!=="chat"&&i!=="sessions")return null;const l=(()=>{switch(i){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return ii(i,wg.name),a.screens.chat.height}})(),u=(()=>{switch(i){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return ii(i,wg.name),a.screens.chat.width}})(),c=()=>{n(d=>{const f=!d;return o(f?"100vh":l),s(f?`max(40vw, ${u})`:u),f})};return r&&e.hideOnSmallScreen||!r&&e.hideOnLargeScreen?null:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:c,children:v.jsx(vu,{name:e.icon||(t?e.shrinkIcon:e.expandIcon)})})}function RC({button:e}){var t,n;const{close:i}=df(),{widgetCtx:r}=It(),{setIsOpen:a}=zs(),{resolveSession:s,sessionState:o}=wi(),{isSmallScreen:l}=Qi(),u=!o.session,c=((t=o.session)==null?void 0:t.isOpened)===!1,d=e.onResolved||"stay-in-chat",f=e.behaviorBeforeSessionCreation||"disabled",h=e.behaviorIfSessionIsResolved||"disabled",g=!!(o.isResolvingSession||u&&f==="disabled"||c&&h==="disabled"),b=async()=>{const{success:m,error:y}=await s();if(i(),!m)return console.error(y);switch(d){case"stay-in-chat":return;case"close-widget":a(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":a(!1),r.resetChat();break;default:ii(d,RC.name);break}},E=()=>{if(u)switch(f){case"disabled":return;case"close-widget":a(!1);break;default:ii(f,E.name)}if(c)switch(h){case"disabled":return;case"close-widget":a(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":a(!1),setTimeout(()=>{r.resetChat()},200);break;default:ii(h,E.name)}};return l&&e.hideOnSmallScreen||!l&&e.hideOnLargeScreen?null:((n=e.confirmation)==null?void 0:n.type)==="modal"&&!c&&!u?v.jsx(TC,{trigger:v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",disabled:g,children:v.jsx(vu,{name:e.icon})}),children:v.jsxs(gC,{children:[v.jsx(bC,{children:v.jsx(xC,{children:e.confirmation.title||"Close conversation"})}),v.jsx(yC,{children:v.jsx(EC,{children:e.confirmation.description||"Are you sure you want to close this conversation?"})}),v.jsxs(vC,{children:[v.jsx(_t,{variant:"secondary",onClick:i,disabled:o.isResolvingSession,children:e.confirmation.cancelButtonText||"No"}),v.jsx(_t,{variant:"destructive",onClick:b,disabled:o.isResolvingSession,children:e.confirmation.confirmButtonText||"Yes"})]})]})}):v.jsx(_t,{variant:"ghost",size:"fit",className:"rounded-full",onClick:c||u?E:b,disabled:g,children:v.jsx(vu,{name:e.icon})})}function Sg({button:e}){switch(e.functionality){case"close-widget":return v.jsx(XX,{button:e});case"expand-shrink":return v.jsx(wg,{button:e});case"resolve-session":return v.jsx(RC,{button:e});default:return ii(e,Sg.name),null}}const $X={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function KX(){const{routerState:{screen:e}}=ur(),{headerButtons:t}=We(),n=e==="chat"?t==null?void 0:t.chatScreen:e==="sessions"?t==null?void 0:t.sessionsScreen:[];return!n||n.length===0?v.jsx(Sg,{button:$X}):v.jsx(v.Fragment,{children:n.map(i=>v.jsx(Sg,{button:i},`${i.functionality}-${i.icon}`))})}function DC(){const{routerState:{screen:e}}=ur(),t=qX(e),n=_g();return v.jsx("header",{...t,className:"py-2 px-4 shrink-0",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(GX,{}),v.jsx("div",{className:de("flex-1 h-8 flex items-center",e==="sessions"&&"ps-2"),children:v.jsx("h2",{className:"font-semibold",children:n})}),v.jsx(KX,{})]})})}function MC({className:e}){return v.jsx(IP,{className:de("size-4 animate-spin",e)})}function QX(){const{messagesState:{isInitialFetchLoading:e}}=Pn(),{isSmallScreen:t}=Qi(),{activeMode:n,Component:i}=Tx();return{isCanvasOpen:!e&&!t&&!!n&&!!i}}function WX(){const{activeMode:e,Component:t}=Tx(),{sendMessage:n}=Pn(),{createStateCheckpoint:i}=wi(),[r,a]=T.useState(!1),s=async o=>{try{a(!0),await n(o)}catch(l){console.error(l)}finally{a(!1)}};return!e||!t?null:v.jsx(t,{react:Dn,mode:e,createStateCheckpoint:i,sendMessage:s,isSendingMessage:r})}const Wi=Dn.forwardRef((e,t)=>{var n,i,r;return v.jsx(at,{...e,ref:t,className:de("overflow-hidden",e.className),overrides:{initial:{height:0,opacity:0,...(n=e.overrides)==null?void 0:n.initial},animate:{height:"auto",opacity:1,...(i=e.overrides)==null?void 0:i.animate},exit:{height:0,opacity:0,...(r=e.overrides)==null?void 0:r.exit}}})});Wi.displayName="MotionDiv__VerticalReveal";const ZX=[{label:"Terrible",value:1,emoji:"😡"},{label:"Poor",value:2,emoji:"😞"},{label:"Okay",value:3,emoji:"😐"},{label:"Good",value:4,emoji:"😊"},{label:"Great",value:5,emoji:"😍"}];function JX(){const{isSmallScreen:e}=Qi(),{submitCsat:t,isCsatRequested:n,isCsatSubmitted:i,submittedScore:r,submittedFeedback:a}=_x(),[s,o]=T.useState(null),[l,u]=T.useState(null),c=f=>{o(h=>h===f?null:f)},d=()=>{s&&t({score:s,feedback:l||void 0})};return!n&&!i?null:v.jsxs("div",{className:"w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden",children:[v.jsx(Pt,{mode:"wait",children:n&&!s?v.jsx(Wi,{children:v.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"How was your conversation?"})},"csat-requested-title"):i?v.jsx(Wi,{children:v.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"You rated the conversation as"})},"csat-submitted-title"):null}),v.jsx("div",{className:de("flex gap-4 justify-between pt-2 px-2 pb-2","transition-all",i&&"gap-0 justify-center"),children:ZX.map(f=>v.jsx(_t,{variant:f.value===s?"secondary":"ghost",size:"selfless",className:de("transition-all overflow-hidden","text-2xl size-8 rounded-full","opacity-35","hover:opacity-100",!s&&"opacity-100",f.value===s&&"opacity-100",i&&f.value!==r&&"opacity-0 size-0",i&&f.value===r&&"opacity-100 size-fit text-4xl"),onClick:n?()=>c(f.value):void 0,children:f.emoji},f.value))}),v.jsx(Pt,{mode:"wait",children:(s||r)&&v.jsx(Wi,{children:v.jsxs("div",{className:"pb-2 px-2 flex items-end",children:[v.jsx("textarea",{rows:3,className:de("transition-all","max-h-40 [field-sizing:content]","w-full resize-none","bg-transparent outline-none","placeholder:text-muted-foreground",e?"text-[16px]":"text-sm",i&&"text-center"),value:i?a||"":l||"",onChange:n?f=>u(f.target.value):void 0,readOnly:i,placeholder:n?"Tell us more... (optional)":void 0}),v.jsx(_t,{size:"fit",onClick:d,disabled:!s,className:de("transition-all overflow-hidden","rounded-full size-8 flex items-center justify-center p-0",i&&"opacity-0 size-0"),children:v.jsx(A2,{className:"size-4"})})]})},"feedback-box")}),v.jsx("div",{className:de("h-0 transition-[height]",i&&"h-4")})]})}function ts(){const{dir:e}=Ap(),t=We();return T.useMemo(()=>{const n=l5(t.language)?t.language:"en";return{t:i=>u5(i,n,t.translationOverrides),language:n,dir:n==="ar"?"rtl":"ltr",hostDocumentDir:e}},[t.language,e])}function Ag({suggestion:e,className:t,...n}){const{sendMessage:i}=Pn(),r=()=>{const a=e.trim();a&&i({content:a})};return v.jsx(_t,{...ze("chat/suggested_reply_btn"),size:"sm",className:de("rounded-xl w-fit",t),...n,onClick:r,children:e})}function e$(){const{t:e}=ts(),t=[e("i_need_more_help"),e("this_was_helpful")];return v.jsx("div",{...ze("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:t.map(n=>v.jsx(Ag,{suggestion:n,className:"flex-1"},n))})}function LC(){const{sessionState:e}=wi(),{chatFooterItems:t}=We(),n=!!e.session&&!e.session.isOpened,i=!n;return v.jsx(Pt,{mode:"wait",children:t==null?void 0:t.map((r,a)=>r.showWhenSessionIsOpen===!1&&i||r.showWhenSessionIsResolved===!1&&n?null:v.jsx(Wi,{children:v.jsx("div",{className:"pb-2 text-center text-xs",children:v.jsx(gg,{children:r.message})})},`${r.message}-${a}`))})}function t$({file:{status:e,file:t,error:n},onCancel:i}){const[r,a]=T.useState(null);T.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>a(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const s=()=>{switch(e){case"uploading":return v.jsx(LP,{className:"size-4 animate-spin"});case"error":return v.jsx(AP,{className:"size-4 text-destructive"});default:return null}},o=()=>{const l=t.type.split("/")[0];return l==="image"&&r?v.jsx("img",{src:typeof r=="string"?r:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?v.jsx(NP,{}):l==="video"?v.jsx(RP,{}):v.jsx(DP,{})};return v.jsx(yu,{side:"bottom",content:e==="error"?v.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:v.jsxs("div",{className:de(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s()}),v.jsx("button",{type:"button",className:de("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:i,children:v.jsx(xd,{className:"size-4 text-primary-foreground"})}),v.jsx(o,{})]})})}function n$(){var e;const{isSmallScreen:t}=Qi(),n=T.useRef(null),{sendMessage:i}=Pn(),{sessionState:r}=wi(),{t:a}=ts(),[s,o]=T.useState(""),{allFiles:l,emptyTheFiles:u,handleCancelUpload:c,appendFiles:d,isUploading:f,successFiles:h}=p5(),g=!!((e=r.session)!=null&&e.isHandedOff),{isAwaitingBotReply:b}=xx(),E=D=>{d(D)},m=!s.trim()&&h.length===0,y=async()=>{if(b||m)return;f&&console.info("please wait for the file(s) to upload");const D=s.trim();i({content:D,attachments:h.flatMap(L=>L.fileUrl?[{url:L.fileUrl,type:L.file.type,name:L.file.name,id:L.id,size:L.file.size}]:[])}),o(""),u()},{getRootProps:x,getInputProps:_,open:S}=qA({onDrop:E,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:g?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"]}}),k=D=>{const L=D.clipboardData;L&&L.files.length>0&&E(Array.from(L.files))};return v.jsxs("div",{...ze("chat/input_box/root"),className:"p-2 relative space-y-1",...x(),children:[v.jsx("input",{..._()}),v.jsxs("div",{...ze("chat/input_box/inner_root"),className:de("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[v.jsxs("div",{...ze("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[l.length>0&&v.jsx("div",{...ze("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:v.jsx(Pt,{mode:"popLayout",children:l.map(D=>v.jsx(at,{snapExit:!0,children:v.jsx(t$,{onCancel:()=>c(D.id),file:D})},D.id))})}),v.jsx("textarea",{...ze("chat/input_box/textarea"),onPaste:k,ref:n,id:"chat-input",value:s,rows:3,className:de("max-h-16 [field-sizing:content]","w-full resize-none px-2",l.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:D=>o(D.target.value),onKeyDown:async D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),y())},placeholder:a("write_a_message_placeholder")})]}),v.jsxs("div",{className:"gap-2 flex justify-between",children:[v.jsx(yu,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:v.jsx(_t,{onClick:S,size:"fit",variant:"ghost",className:de("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:v.jsx(Pt,{mode:"wait",children:g&&!b?v.jsx(at,{children:v.jsx(jP,{className:"size-4"})},"paper-clip"):v.jsx(at,{children:v.jsx(MP,{className:"size-4"})},"image-icon")})})}),v.jsx(yu,{content:"send message",side:"top",align:"end",children:v.jsx(_t,{size:"fit",onClick:y,disabled:b||f||m,className:"rounded-full size-8 flex items-center justify-center p-0",children:v.jsx(Pt,{mode:"wait",children:b||f?v.jsx(at,{snapExit:!0,children:v.jsx(k2,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):v.jsx(at,{snapExit:!0,children:v.jsx(A2,{className:"size-4"})},"send")})})})]})]})]})}function IC(){const{widgetCtx:e}=It(),{router:t}=We(),{canCreateNewSession:n}=wi(),{toSessionsScreen:i}=ur(),{t:r}=ts();return v.jsx(v.Fragment,{children:n||t!=null&&t.chatScreenOnly?v.jsx(_t,{onClick:e.resetChat,className:"rounded-2xl w-full",children:r("new_conversation")}):v.jsx(_t,{onClick:i,className:"rounded-2xl w-full",children:r("back_to_conversations")})})}function i$(){const{t:e}=ts(),{isCsatRequested:t,isCsatSubmitted:n}=_x();return v.jsx("div",{className:"p-2",children:v.jsx("div",{className:"p-2 bg-muted rounded-3xl",children:v.jsx(Pt,{mode:"wait",children:t||n?v.jsxs(Wi,{children:[v.jsx(JX,{}),v.jsx(Pt,{mode:"wait",children:n&&v.jsx(Wi,{children:v.jsx(IC,{})},"new-conv-or-back-to-convs-button")})]},"csat"):v.jsxs(Wi,{children:[v.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[v.jsx(C2,{className:"size-4 text-emerald-600"}),v.jsx("h2",{className:"text-sm font-medium",children:e("your_issue_has_been_resolved")})]}),v.jsx(IC,{})]},"session-closed")})})})}function r$(){var e;const{initialQuestions:t,initialQuestionsPosition:n,thisWasHelpfulOrNot:i}=We(),{sessionState:r}=wi(),{messagesState:a}=Pn(),s=a.messages.length===0;return v.jsx("footer",{children:v.jsx(Pt,{mode:"wait",children:r.session&&!((e=r.session)!=null&&e.isOpened)?v.jsxs(Wi,{children:[v.jsx(i$,{}),v.jsx(LC,{})]},"session-closed"):v.jsxs(Wi,{children:[a.lastAIResMightSolveUserIssue&&(i==null?void 0:i.enabled)!==!1&&v.jsx(e$,{}),s&&t&&n!=="below-initial-messages"&&v.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((o,l)=>v.jsx(Ag,{suggestion:o},`${o}-${l}`))}),v.jsx(n$,{}),v.jsx(LC,{})]},"chat-input")})})}function a$({isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n,...i}){const{componentStore:r}=It();if(i.type!=="AGENT"&&i.type!=="AI")return null;if(i.data.action){const s=r.getComponent(i.data.action.name);if(s)return v.jsx(s,{...i,id:i.id,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n})}const a=r.getComponent(i.component);return a?v.jsx(a,{...i,id:i.id,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n}):v.jsx(bg,{...i,isFirstInGroup:e,isLastInGroup:t,isAloneInGroup:n})}function PC({messages:e,className:t,containerClassName:n}){var i,r;const{timestamps:a}=We();if(!((i=a==null?void 0:a.perMessageGroup)!=null&&i.enabled))return null;const s=(r=e[e.length-1])==null?void 0:r.timestamp;if(!s)return null;const o=(()=>{try{return new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(l){return console.error(l),null}})();return o?v.jsx("div",{className:n,children:v.jsx("span",{className:de("text-xs text-muted-foreground",t),children:o})}):null}function hf({messages:e,agent:t,suggestedReplies:n}){return v.jsxs("div",{...ze("chat/agent_msg_group/root"),className:de("flex items-end gap-2"),children:[v.jsx(yu,{content:t==null?void 0:t.name,side:"right",align:"end",children:v.jsx(Eg,{...ze("chat/agent_msg_group/root/avatar"),agent:t,className:"hidden"})}),v.jsxs("div",{className:de("flex-1 flex flex-col gap-1"),children:[v.jsxs("div",{...ze("chat/agent_msg_group/avatar_and_msgs/root"),className:de("flex items-end gap-2"),children:[v.jsx(yu,{content:t==null?void 0:t.name,side:"right",align:"end",children:v.jsx(Eg,{...ze("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:t})}),v.jsxs("div",{...ze("chat/agent_msg_group/avatar_and_msgs/msgs"),className:de("flex-1 flex flex-col gap-1"),children:[e.map((i,r,a)=>v.jsx(a$,{isFirstInGroup:r===0,isLastInGroup:r===a.length-1,isAloneInGroup:a.length===1,...i},i.id)),v.jsx(PC,{messages:e})]})]}),n&&n.length>0&&v.jsx("div",{...ze("chat/agent_msg_group/suggestions"),className:de("flex flex-col gap-1 ps-8"),children:n==null?void 0:n.map((i,r)=>v.jsx(Ag,{suggestion:i},`${i}-${r}`))})]})]})}function BC(){const{widgetCtx:{org:e}}=It(),{sessionState:{session:t}}=wi(),n=We(),{messagesState:{messages:i}}=Pn();return{props:{react:Dn,org:e,session:t,config:n,messages:i}}}function s$(){var e,t;const{props:n}=BC();if((e=n.session)!=null&&e.isOpened||!n.session)return null;const i=(t=n.config.specialComponents)==null?void 0:t.onSessionResolved;return i?v.jsx(i,{...n}):null}function o$({message:e,isFirstInGroup:t,isLastInGroup:n,isAloneInGroup:i}){var r;return v.jsxs("div",{...ze("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[e.attachments&&e.attachments.length>0&&v.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(r=e.attachments)==null?void 0:r.map(a=>v.jsx(_C,{attachment:a},a.id))}),e.content.length>0&&v.jsx("div",{...ze("chat/user_msg/msg"),"data-first":t,"data-last":n,"data-alone":i,className:de("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",t&&!i&&"rounded-br-md",n&&!i&&"rounded-tr-md",!t&&!n&&!i&&"rounded-r-md"),children:e.content})]})}function l$({messages:e}){return v.jsxs("div",{...ze("chat/user_msg_group/root"),className:de("group","flex flex-col gap-1 justify-end items-end"),children:[e.map((t,n,i)=>v.jsx(o$,{message:t,isFirstInGroup:n===0,isLastInGroup:n===i.length-1,isAloneInGroup:i.length===1},t.id)),v.jsx(PC,{messages:e,containerClassName:"ms-auto"})]})}function u$(e){const t=[];let n=null;return e.forEach(i=>{var r,a,s,o,l,u;(((r=n==null?void 0:n[0])==null?void 0:r.type)!==i.type||((a=n[0])==null?void 0:a.type)==="AGENT"&&i.type==="AGENT"&&(((s=i.agent)==null?void 0:s.id)!==((o=n[0].agent)==null?void 0:o.id)||((l=i.agent)==null?void 0:l.name)!==((u=n[0].agent)==null?void 0:u.name)))&&(n=[],t.push(n)),n.push(i)}),t}function c$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="USER"}function d$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="AI"}function f$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="AGENT"}function h$(){const{messagesState:{messages:e}}=Pn(),{advancedInitialMessages:t=[],initialQuestionsPosition:n,initialQuestions:i,bot:r}=We();return v.jsx(v.Fragment,{children:e.length===0&&t.length>0&&v.jsx(hf,{messages:t.map(({message:a},s)=>({component:"bot_message",data:{message:a},id:`${s}-${a}`,type:"AI",timestamp:null})),suggestedReplies:e.length===0&&n==="below-initial-messages"?i:void 0,agent:r?{...r,isAi:!0,id:null}:void 0})})}function p$(){const{messagesState:{messages:e}}=Pn(),{chatBannerItems:t}=We();return!(t!=null&&t.length)||e.length>0&&t.every(n=>!n.persistent)?null:v.jsx("div",{className:"w-full text-center text-xs",children:t.map(({message:n,persistent:i},r)=>e.length>0&&!i?null:v.jsx("div",{children:v.jsx(gg,{children:n})},`${n}-${r}`))})}function m$(){const{messagesState:{messages:e}}=Pn(),t=We(),{advancedInitialMessages:n=[],initialQuestions:i,initialQuestionsPosition:r}=t,a=(()=>{var s;return n.length?[]:e.length?[]:(s=t.initialMessages)!=null&&s.length?t.initialMessages:["Hello, how can I help you?"]})();return v.jsx(v.Fragment,{children:e.length===0&&a.length>0&&v.jsx(hf,{messages:a.map((s,o)=>({component:"bot_message",data:{message:s},id:`${o}-${s}`,type:"AI",timestamp:null})),suggestedReplies:r==="below-initial-messages"?i:void 0,agent:t.bot?{...t.bot,isAi:!0,id:null}:void 0})})}function g$(){var e;const{props:t}=BC(),n=(e=t.config.specialComponents)==null?void 0:e.chatBottomComponents;return n?v.jsx("div",{children:n.map(({key:i,component:r})=>v.jsx(r,{...t},i))}):null}function b$(){const{messagesState:{messages:e}}=Pn(),{isAwaitingBotReply:t}=xx(),{componentStore:n}=It(),i=We(),r=T.useMemo(()=>u$(e),[e]),a=n.getComponent("loading"),s=T.useRef(null);function o(){setTimeout(()=>{const l=s.current;l&&(l.scrollTop=l.scrollHeight)},0)}return T.useEffect(()=>{o()},[e]),v.jsxs("div",{...ze("chat/msgs/root"),ref:s,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[v.jsx(p$,{}),v.jsx(h$,{}),v.jsx(m$,{}),r.map((l,u)=>{var c,d,f,h;const g=(c=l==null?void 0:l[0])==null?void 0:c.type,b=(d=l[0])==null?void 0:d.id;if(!g||!b)return null;if(c$(l))return v.jsx(l$,{messages:l},b);if(d$(l)){const E=u===r.length-1;if(t&&E)return null;const m=(f=l[0])==null?void 0:f.agent;return v.jsx(hf,{messages:l,agent:m},b)}if(f$(l)){const E=(h=l[0])==null?void 0:h.agent;return v.jsx(hf,{messages:l,agent:E},b)}return null}),t&&a&&v.jsx(a,{agent:i.bot}),v.jsx(g$,{}),v.jsx(s$,{})]})}function y$(){const{messagesState:{isInitialFetchLoading:e}}=Pn(),{sessionState:{session:t}}=wi(),{isCanvasOpen:n}=QX(),{theme:i}=es();Tg({width:n?i.screens.chat.withCanvas.width:i.screens.chat.width,height:n?i.screens.chat.withCanvas.height:i.screens.chat.height});const r=T.useRef((t==null?void 0:t.id)||"chat").current;return v.jsx("div",{...ze("chat/root"),className:de("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:v.jsxs("div",{className:"size-full justify-between flex flex-col",children:[v.jsx(DC,{}),v.jsx(Pt,{mode:"wait",children:e?v.jsx(at,{className:"flex flex-col items-center justify-center w-full flex-1",children:v.jsx(MC,{})},"loading"):v.jsxs(at,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[v.jsxs("div",{...ze("chat/main/root"),className:de("flex flex-col h-full overflow-auto transition-all",n?"w-2/5":"w-full"),style:{transitionTimingFunction:i.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:i.screens.chat.withCanvas.transitionDuration},children:[v.jsx(b$,{}),v.jsx(r$,{})]}),v.jsx("div",{...ze("chat/canvas/root"),className:de("h-full overflow-auto transition-all",n?"w-3/5":"w-0"),style:{transitionTimingFunction:i.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:i.screens.chat.withCanvas.transitionDuration},children:v.jsx(WX,{})})]},r)})]})})}function v$({className:e,...t}){return v.jsx("div",{className:de("animate-pulse rounded-md bg-secondary",e),...t})}function x$({className:e}){return v.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:de("text-primary-foreground",e),children:v.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function UC({className:e}){const{token:t}=We();return v.jsx("div",{className:de("flex items-center justify-center gap-2 p-2 pt-0",e),children:v.jsx(yr,{children:v.jsxs("a",{href:`https://open.cx/?ref=${t}`,target:"_blank",rel:"noreferrer",className:de("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[v.jsx("span",{children:"Powered by"}),v.jsx("span",{children:" "}),v.jsxs("span",{className:"flex items-center gap-[1px]",children:[v.jsx("span",{children:v.jsx(x$,{className:"size-3 inline-block"})}),v.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function E$({children:e}){return v.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:e})}function zC({session:e,className:t}){const{bot:n}=We(),{toChatScreen:i}=ur(),r=e.assignee.kind==="human"?e.assignee.name||"Support Agent":(n==null?void 0:n.name)||"AI Support Agent",a=e.assignee.kind==="human"?e.assignee.avatarUrl||"":(n==null?void 0:n.avatar)||"";return v.jsxs(_t,{variant:"ghost",size:"lg",className:de("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",t),onClick:()=>i(e.id),children:[v.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[v.jsx(Pt,{mode:"wait",children:v.jsx(at,{snapExit:!0,children:v.jsxs(yg,{className:"size-10",children:[v.jsx(vg,{src:a,alt:"Agent Icon"}),v.jsx(xg,{children:v.jsx(GP,{className:"size-4"})})]})})}),v.jsxs("div",{className:"flex-1",children:[v.jsx(Pt,{mode:"wait",children:v.jsx(at,{snapExit:!0,children:r},r)}),v.jsx(Pt,{mode:"wait",children:e.lastMessage?v.jsx(at,{snapExit:!0,children:v.jsx(wC,{remarkPlugins:[C_],rehypePlugins:[YS],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:e.lastMessage})},e.lastMessage||"content"):v.jsx(at,{className:"w-1/2",snapExit:!0,children:v.jsx(v$,{className:"h-4 w-full"})},"skeleton")})]})]}),v.jsx(SP,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function T$(){const{t:e}=ts(),{toChatScreen:t}=ur(),{sessionsState:{data:n,isInitialFetchLoading:i},openSessions:r,closedSessions:a,canCreateNewSession:s}=wi();return v.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:v.jsx(Pt,{mode:"wait",children:i?v.jsx(at,{className:"flex-1 flex items-center justify-center",children:v.jsx(MC,{})},"loading"):v.jsx(at,{className:"flex-1 flex flex-col gap-2 relative",children:n.length?v.jsxs(v.Fragment,{children:[v.jsxs(Pt,{children:[r.length>0&&v.jsx(at,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:r.map(o=>v.jsx(zC,{session:o},o.id))},"open-sessions"),a.length>0&&v.jsxs(at,{className:"space-y-2",delay:.2,snapExit:!0,children:[v.jsx(E$,{children:e("closed_conversations")}),a.map(o=>v.jsx(zC,{session:o,className:"opacity-50 hover:opacity-100"},o.id))]},"closed-sessions")]}),s&&v.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:T.createElement(_t,{...ze("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>t()},e("new_conversation"))})]}):v.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("p",{className:"text-muted-foreground",children:e("no_conversations_yet")})}),T.createElement(_t,{...ze("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>t()},e("new_conversation"))]})},"sessions")})})}function _$(){const{theme:e}=es();return Tg({width:e.screens.sessions.width,height:e.screens.sessions.height}),v.jsx("div",{...ze("sessions/root"),className:de("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:v.jsxs("div",{className:"size-full flex flex-col",children:[v.jsx(DC,{}),v.jsx(T$,{}),v.jsx(UC,{})]})})}const pf=T.forwardRef(({className:e,type:t,...n},i)=>{const{isSmallScreen:r}=Qi();return v.jsx(yr,{ref:i,children:v.jsx("input",{type:t,className:de(r?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",e),...n})})});pf.displayName="Input";function w$(){const{contentIframeRef:e}=It(),{inline:t}=We(),n=T.useRef(null);return T.useEffect(()=>{const i=e==null?void 0:e.current;if(i&&n.current){const r=n.current;let a;const s=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const o=r.offsetHeight;i.style.setProperty("--opencx-widget-height",t?"100%":`${o.toFixed(1)}px`)})});return s.observe(r),()=>{cancelAnimationFrame(a),s.unobserve(r)}}},[e,t]),{observedElementRef:n}}const S$=OX({name:pC().min(2),email:pC().email()});function A$(){var e,t,n,i,r,a,s,o;const{widgetCtx:{org:l}}=It(),{setIsOpen:u}=zs(),{createUnverifiedContact:c}=h5(),{isSmallScreen:d}=Qi(),f=We(),{theme:h}=es(),{t:g}=ts(),{observedElementRef:b}=w$();Tg({height:void 0,width:h.screens.welcome.width});const[E,m]=T.useState(((e=f.prefillUserData)==null?void 0:e.name)||""),[y,x]=T.useState(((t=f.prefillUserData)==null?void 0:t.email)||""),_=(f.extraDataCollectionFields||[]).filter(B=>B!=="name"&&B!=="email"&&!!B),[S,k]=T.useState({}),[D,L]=nX(async B=>{B.preventDefault();const R=S$.safeParse({name:E,email:y});R.success&&await c({email:R.data.email,non_verified_name:R.data.name},Object.values(S).filter(Boolean).length?S:void 0)},[E,y,S]);return v.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:h.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:v.jsxs("div",{ref:b,className:de("flex flex-col",d&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[v.jsxs("div",{className:de("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[d&&v.jsx(at,{className:"absolute top-6 end-6",children:v.jsx(_t,{size:"selfless",onClick:()=>u(!1),children:v.jsx(xd,{className:"size-4"})})}),v.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(n=f.assets)!=null&&n.organizationLogo?v.jsx("img",{src:(i=f.assets)==null?void 0:i.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):v.jsx("h2",{className:"font-bold text-sm",children:l.name})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((a=(r=f.textContent)==null?void 0:r.welcomeScreen)==null?void 0:a.title)||g("welcome_screen_title")}),v.jsx("p",{className:"text-sm",children:((o=(s=f.textContent)==null?void 0:s.welcomeScreen)==null?void 0:o.description)||g("welcome_screen_description")})]})]}),v.jsxs("div",{className:de("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[v.jsxs("form",{onSubmit:L,className:"space-y-2",children:[v.jsx(pf,{value:E,onChange:B=>m(B.target.value),required:!0,placeholder:g("your_name_placeholder"),name:"name"}),v.jsx(pf,{required:!0,value:y,onChange:B=>x(B.target.value),type:"email",placeholder:g("your_email_placeholder"),name:"email"}),_.map(B=>v.jsx(pf,{value:S[B],onChange:R=>k(Y=>({...Y,[B]:R.target.value})),placeholder:`${B} (${g("optional")})`},B)),v.jsxs(_t,{disabled:D.loading,className:"w-full",size:"lg",children:[D.loading?g("start_chat_button_loading"):g("start_chat_button"),v.jsx(HP,{className:"size-4 rtl:-scale-100"})]})]}),v.jsx(UC,{})]})]})})}function jC(){const{routerState:{screen:e}}=ur();return v.jsx("div",{className:"relative bg-background size-full",children:v.jsx(Pt,{mode:"wait",children:(()=>{switch(e){case"welcome":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(A$,{})},e);case"sessions":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(_$,{})},e);case"chat":return v.jsx(at,{fadeIn:"right",className:"size-full",snapExit:!0,children:v.jsx(y$,{})},e);default:return ii(e,jC.name),null}})()})})}const C$="4.0.29",k$=`<!DOCTYPE html>
|
|
304
304
|
<html>
|
|
305
305
|
<head>
|
|
306
306
|
<style>
|
|
@@ -357,5 +357,5 @@ html, body {
|
|
|
357
357
|
`+l[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=r);break}}}finally{qg=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ro(n):""}function oK(e){switch(e.tag){case 26:case 27:case 5:return Ro(e.type);case 16:return Ro("Lazy");case 13:return Ro("Suspense");case 19:return Ro("SuspenseList");case 0:case 15:return Gg(e.type,!1);case 11:return Gg(e.type.render,!1);case 1:return Gg(e.type,!0);case 31:return Ro("Activity");default:return""}}function h3(e){try{var t="";do t+=oK(e),e=e.return;while(e);return t}catch(n){return`
|
|
358
358
|
Error generating stack: `+n.message+`
|
|
359
359
|
`+n.stack}}function ci(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function p3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lK(e){var t=p3(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Af(e){e._valueTracker||(e._valueTracker=lK(e))}function m3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=p3(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Cf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var uK=/[\n"\\]/g;function di(e){return e.replace(uK,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xg(e,t,n,i,r,a,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ci(t)):e.value!==""+ci(t)&&(e.value=""+ci(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?$g(e,s,ci(t)):n!=null?$g(e,s,ci(n)):i!=null&&e.removeAttribute("value"),r==null&&a!=null&&(e.defaultChecked=!!a),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+ci(o):e.removeAttribute("name")}function g3(e,t,n,i,r,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null))return;n=n!=null?""+ci(n):"",t=t!=null?""+ci(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=o?e.checked:!!i,e.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s)}function $g(e,t,n){t==="number"&&Cf(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Do(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ci(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function b3(e,t,n){if(t!=null&&(t=""+ci(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ci(n):""}function y3(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(q(92));if(_u(i)){if(1<i.length)throw Error(q(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=ci(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i)}function Mo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cK=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function v3(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||cK.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function x3(e,t,n){if(t!=null&&typeof t!="object")throw Error(q(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var r in t)i=t[r],t.hasOwnProperty(r)&&n[r]!==i&&v3(e,r,i)}else for(var a in t)t.hasOwnProperty(a)&&v3(e,a,t[a])}function Kg(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dK=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fK=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function kf(e){return fK.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Qg=null;function Wg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lo=null,Io=null;function E3(e){var t=ko(e);if(t&&(e=t.stateNode)){var n=e[wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xg(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+di(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=i[wn]||null;if(!r)throw Error(q(90));Xg(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&m3(i)}break e;case"textarea":b3(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Do(e,!!n.multiple,t,!1)}}}var Zg=!1;function T3(e,t,n){if(Zg)return e(t,n);Zg=!0;try{var i=e(t);return i}finally{if(Zg=!1,(Lo!==null||Io!==null)&&(hh(),Lo&&(t=Lo,e=Io,Io=Lo=null,E3(t),e)))for(t=0;t<e.length;t++)E3(e[t])}}function Nu(e,t){var n=e.stateNode;if(n===null)return null;var i=n[wn]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var Er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jg=!1;if(Er)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Jg=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Jg=!1}var da=null,eb=null,Of=null;function _3(){if(Of)return Of;var e,t=eb,n=t.length,i,r="value"in da?da.value:da.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(i=1;i<=s&&t[n-i]===r[a-i];i++);return Of=r.slice(e,1<i?1-i:void 0)}function Nf(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rf(){return!0}function w3(){return!1}function Sn(e){function t(n,i,r,a,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Rf:w3,this.isPropagationStopped=w3,this}return st(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Rf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),t}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Df=Sn(as),Du=st({},as,{view:0,detail:0}),hK=Sn(Du),tb,nb,Mu,Mf=st({},Du,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rb,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mu&&(Mu&&e.type==="mousemove"?(tb=e.screenX-Mu.screenX,nb=e.screenY-Mu.screenY):nb=tb=0,Mu=e),tb)},movementY:function(e){return"movementY"in e?e.movementY:nb}}),S3=Sn(Mf),pK=st({},Mf,{dataTransfer:0}),mK=Sn(pK),gK=st({},Du,{relatedTarget:0}),ib=Sn(gK),bK=st({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),yK=Sn(bK),vK=st({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xK=Sn(vK),EK=st({},as,{data:0}),A3=Sn(EK),TK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_K={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SK(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wK[e])?!!t[e]:!1}function rb(){return SK}var AK=st({},Du,{key:function(e){if(e.key){var t=TK[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_K[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rb,charCode:function(e){return e.type==="keypress"?Nf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CK=Sn(AK),kK=st({},Mf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C3=Sn(kK),OK=st({},Du,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rb}),NK=Sn(OK),RK=st({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),DK=Sn(RK),MK=st({},Mf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),LK=Sn(MK),IK=st({},as,{newState:0,oldState:0}),PK=Sn(IK),BK=[9,13,27,32],ab=Er&&"CompositionEvent"in window,Lu=null;Er&&"documentMode"in document&&(Lu=document.documentMode);var UK=Er&&"TextEvent"in window&&!Lu,k3=Er&&(!ab||Lu&&8<Lu&&11>=Lu),O3=" ",N3=!1;function R3(e,t){switch(e){case"keyup":return BK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D3(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Po=!1;function zK(e,t){switch(e){case"compositionend":return D3(t);case"keypress":return t.which!==32?null:(N3=!0,O3);case"textInput":return e=t.data,e===O3&&N3?null:e;default:return null}}function jK(e,t){if(Po)return e==="compositionend"||!ab&&R3(e,t)?(e=_3(),Of=eb=da=null,Po=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return k3&&t.locale!=="ko"?null:t.data;default:return null}}var HK={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function M3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!HK[e.type]:t==="textarea"}function L3(e,t,n,i){Lo?Io?Io.push(i):Io=[i]:Lo=i,t=vh(t,"onChange"),0<t.length&&(n=new Df("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Iu=null,Pu=null;function FK(e){pO(e,0)}function Lf(e){var t=Ou(e);if(m3(t))return e}function I3(e,t){if(e==="change")return t}var P3=!1;if(Er){var sb;if(Er){var ob="oninput"in document;if(!ob){var B3=document.createElement("div");B3.setAttribute("oninput","return;"),ob=typeof B3.oninput=="function"}sb=ob}else sb=!1;P3=sb&&(!document.documentMode||9<document.documentMode)}function U3(){Iu&&(Iu.detachEvent("onpropertychange",z3),Pu=Iu=null)}function z3(e){if(e.propertyName==="value"&&Lf(Pu)){var t=[];L3(t,Pu,e,Wg(e)),T3(FK,t)}}function VK(e,t,n){e==="focusin"?(U3(),Iu=t,Pu=n,Iu.attachEvent("onpropertychange",z3)):e==="focusout"&&U3()}function YK(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lf(Pu)}function qK(e,t){if(e==="click")return Lf(t)}function GK(e,t){if(e==="input"||e==="change")return Lf(t)}function XK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gn=typeof Object.is=="function"?Object.is:XK;function Bu(e,t){if(Gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Pg.call(t,r)||!Gn(e[r],t[r]))return!1}return!0}function j3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function H3(e,t){var n=j3(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=j3(n)}}function F3(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F3(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V3(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Cf(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cf(e.document)}return t}function lb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $K=Er&&"documentMode"in document&&11>=document.documentMode,Bo=null,ub=null,Uu=null,cb=!1;function Y3(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cb||Bo==null||Bo!==Cf(i)||(i=Bo,"selectionStart"in i&&lb(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Uu&&Bu(Uu,i)||(Uu=i,i=vh(ub,"onSelect"),0<i.length&&(t=new Df("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Bo)))}function ss(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Uo={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionrun:ss("Transition","TransitionRun"),transitionstart:ss("Transition","TransitionStart"),transitioncancel:ss("Transition","TransitionCancel"),transitionend:ss("Transition","TransitionEnd")},db={},q3={};Er&&(q3=document.createElement("div").style,"AnimationEvent"in window||(delete Uo.animationend.animation,delete Uo.animationiteration.animation,delete Uo.animationstart.animation),"TransitionEvent"in window||delete Uo.transitionend.transition);function os(e){if(db[e])return db[e];if(!Uo[e])return e;var t=Uo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in q3)return db[e]=t[n];return e}var G3=os("animationend"),X3=os("animationiteration"),$3=os("animationstart"),KK=os("transitionrun"),QK=os("transitionstart"),WK=os("transitioncancel"),K3=os("transitionend"),Q3=new Map,fb="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");fb.push("scrollEnd");function Ni(e,t){Q3.set(e,t),rs(t,[e])}var W3=new WeakMap;function fi(e,t){if(typeof e=="object"&&e!==null){var n=W3.get(e);return n!==void 0?n:(t={value:e,source:t,stack:h3(t)},W3.set(e,t),t)}return{value:e,source:t,stack:h3(t)}}var hi=[],zo=0,hb=0;function If(){for(var e=zo,t=hb=zo=0;t<e;){var n=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var a=hi[t];if(hi[t++]=null,i!==null&&r!==null){var s=i.pending;s===null?r.next=r:(r.next=s.next,s.next=r),i.pending=r}a!==0&&Z3(n,r,a)}}function Pf(e,t,n,i){hi[zo++]=e,hi[zo++]=t,hi[zo++]=n,hi[zo++]=i,hb|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function pb(e,t,n,i){return Pf(e,t,n,i),Bf(e)}function jo(e,t){return Pf(e,null,null,t),Bf(e)}function Z3(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var r=!1,a=e.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(r=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,r&&t!==null&&(r=31-qn(n),e=a.hiddenUpdates,i=e[r],i===null?e[r]=[t]:i.push(t),t.lane=n|536870912),a):null}function Bf(e){if(50<uc)throw uc=0,x1=null,Error(q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ho={};function ZK(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,t,n,i){return new ZK(e,t,n,i)}function mb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tr(e,t){var n=e.alternate;return n===null?(n=Xn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function J3(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Uf(e,t,n,i,r,a){var s=0;if(i=e,typeof e=="function")mb(e)&&(s=1);else if(typeof e=="string")s=eW(e,n,Ji.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Dg:return e=Xn(31,n,t,r),e.elementType=Dg,e.lanes=a,e;case _o:return ls(n.children,r,a,t);case QC:s=8,r|=24;break;case Cg:return e=Xn(12,n,t,r|2),e.elementType=Cg,e.lanes=a,e;case Og:return e=Xn(13,n,t,r),e.elementType=Og,e.lanes=a,e;case Ng:return e=Xn(19,n,t,r),e.elementType=Ng,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case F$:case vr:s=10;break e;case WC:s=9;break e;case kg:s=11;break e;case Rg:s=14;break e;case oa:s=16,i=null;break e}s=29,n=Error(q(130,e===null?"null":typeof e,"")),i=null}return t=Xn(s,n,t,r),t.elementType=e,t.type=i,t.lanes=a,t}function ls(e,t,n,i){return e=Xn(7,e,i,t),e.lanes=n,e}function gb(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function bb(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fo=[],Vo=0,zf=null,jf=0,pi=[],mi=0,us=null,_r=1,wr="";function cs(e,t){Fo[Vo++]=jf,Fo[Vo++]=zf,zf=e,jf=t}function ek(e,t,n){pi[mi++]=_r,pi[mi++]=wr,pi[mi++]=us,us=e;var i=_r;e=wr;var r=32-qn(i)-1;i&=~(1<<r),n+=1;var a=32-qn(t)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,_r=1<<32-qn(t)+r|n<<r|i,wr=a+e}else _r=1<<a|n<<r|i,wr=e}function yb(e){e.return!==null&&(cs(e,1),ek(e,1,0))}function vb(e){for(;e===zf;)zf=Fo[--Vo],Fo[Vo]=null,jf=Fo[--Vo],Fo[Vo]=null;for(;e===us;)us=pi[--mi],pi[mi]=null,wr=pi[--mi],pi[mi]=null,_r=pi[--mi],pi[mi]=null}var bn=null,yt=null,He=!1,ds=null,tr=!1,xb=Error(q(519));function fs(e){var t=Error(q(418,""));throw Hu(fi(t,e)),xb}function tk(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[un]=e,t[wn]=i,n){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(n=0;n<dc.length;n++)De(dc[n],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),g3(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),Af(t);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),y3(t,i.value,i.defaultValue,i.children),Af(t)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||yO(t.textContent,n)?(i.popover!=null&&(De("beforetoggle",t),De("toggle",t)),i.onScroll!=null&&De("scroll",t),i.onScrollEnd!=null&&De("scrollend",t),i.onClick!=null&&(t.onclick=xh),t=!0):t=!1,t||fs(e)}function nk(e){for(bn=e.return;bn;)switch(bn.tag){case 5:case 13:tr=!1;return;case 27:case 3:tr=!0;return;default:bn=bn.return}}function zu(e){if(e!==bn)return!1;if(!He)return nk(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||P1(e.type,e.memoizedProps)),n=!n),n&&yt&&fs(e),nk(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){yt=Di(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}yt=null}}else t===27?(t=yt,Ca(e.type)?(e=j1,j1=null,yt=e):yt=t):yt=bn?Di(e.stateNode.nextSibling):null;return!0}function ju(){yt=bn=null,He=!1}function ik(){var e=ds;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),ds=null),e}function Hu(e){ds===null?ds=[e]:ds.push(e)}var Eb=Zi(null),hs=null,Sr=null;function fa(e,t,n){dt(Eb,t._currentValue),t._currentValue=n}function Ar(e){e._currentValue=Eb.current,Vt(Eb)}function Tb(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function _b(e,t,n,i){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){var s=r.child;a=a.firstContext;e:for(;a!==null;){var o=a;a=r;for(var l=0;l<t.length;l++)if(o.context===t[l]){a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Tb(a.return,n,e),i||(s=null);break e}a=o.next}}else if(r.tag===18){if(s=r.return,s===null)throw Error(q(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Tb(s,n,e),s=null}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===e){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return}r=s}}function Fu(e,t,n,i){e=null;for(var r=t,a=!1;r!==null;){if(!a){if(r.flags&524288)a=!0;else if(r.flags&262144)break}if(r.tag===10){var s=r.alternate;if(s===null)throw Error(q(387));if(s=s.memoizedProps,s!==null){var o=r.type;Gn(r.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(r===bf.current){if(s=r.alternate,s===null)throw Error(q(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(bc):e=[bc])}r=r.return}e!==null&&_b(t,e,n,i),t.flags|=262144}function Hf(e){for(e=e.firstContext;e!==null;){if(!Gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ps(e){hs=e,Sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function cn(e){return rk(hs,e)}function Ff(e,t){return hs===null&&ps(e),rk(e,t)}function rk(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Sr===null){if(e===null)throw Error(q(308));Sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sr=Sr.next=t;return n}var JK=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},eQ=Bt.unstable_scheduleCallback,tQ=Bt.unstable_NormalPriority,Ut={$$typeof:vr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wb(){return{controller:new JK,data:new Map,refCount:0}}function Vu(e){e.refCount--,e.refCount===0&&eQ(tQ,function(){e.controller.abort()})}var Yu=null,Sb=0,Yo=0,qo=null;function nQ(e,t){if(Yu===null){var n=Yu=[];Sb=0,Yo=C1(),qo={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Sb++,t.then(ak,ak),t}function ak(){if(--Sb===0&&Yu!==null){qo!==null&&(qo.status="fulfilled");var e=Yu;Yu=null,Yo=0,qo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function iQ(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var sk=me.S;me.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&nQ(e,t),sk!==null&&sk(e,t)};var ms=Zi(null);function Ab(){var e=ms.current;return e!==null?e:et.pooledCache}function Vf(e,t){t===null?dt(ms,ms.current):dt(ms,t.pool)}function ok(){var e=Ab();return e===null?null:{parent:Ut._currentValue,pool:e}}var qu=Error(q(460)),lk=Error(q(474)),Yf=Error(q(542)),Cb={then:function(){}};function uk(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(){}function ck(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qf,qf),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fk(e),e;default:if(typeof t.status=="string")t.then(qf,qf);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(q(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=i}},function(i){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fk(e),e}throw Gu=t,qu}}var Gu=null;function dk(){if(Gu===null)throw Error(q(459));var e=Gu;return Gu=null,e}function fk(e){if(e===qu||e===Yf)throw Error(q(483))}var ha=!1;function kb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ob(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ma(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Ve&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Bf(e),Z3(e,null,n),t}return Pf(e,i,t,n),Bf(e)}function Xu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,a3(e,n)}}function Nb(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Rb=!1;function $u(){if(Rb){var e=qo;if(e!==null)throw e}}function Ku(e,t,n,i){Rb=!1;var r=e.updateQueue;ha=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?a=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(a!==null){var d=r.baseState;s=0,c=u=l=null,o=a;do{var f=o.lane&-536870913,h=f!==o.lane;if(h?(Le&f)===f:(i&f)===f){f!==0&&f===Yo&&(Rb=!0),c!==null&&(c=c.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=e,b=o;f=t;var E=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){d=g.call(E,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,f=typeof g=="function"?g.call(E,d,f):g,f==null)break e;d=st({},d,f);break e;case 2:ha=!0}}f=o.callback,f!==null&&(e.flags|=64,h&&(e.flags|=8192),h=r.callbacks,h===null?r.callbacks=[f]:h.push(f))}else h={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;h=o,o=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,a===null&&(r.shared.lanes=0),_a|=s,e.lanes=s,e.memoizedState=d}}function hk(e,t){if(typeof e!="function")throw Error(q(191,e));e.call(t)}function pk(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)hk(n[e],t)}var Go=Zi(null),Gf=Zi(0);function mk(e,t){e=Mr,dt(Gf,e),dt(Go,t),Mr=e|t.baseLanes}function Db(){dt(Gf,Mr),dt(Go,Go.current)}function Mb(){Mr=Gf.current,Vt(Go),Vt(Gf)}var ga=0,Ce=null,qe=null,Nt=null,Xf=!1,Xo=!1,gs=!1,$f=0,Qu=0,$o=null,rQ=0;function wt(){throw Error(q(321))}function Lb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gn(e[n],t[n]))return!1;return!0}function Ib(e,t,n,i,r,a){return ga=a,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?Zk:Jk,gs=!1,a=n(i,r),gs=!1,Xo&&(a=bk(t,n,i,r)),gk(e),a}function gk(e){me.H=eh;var t=qe!==null&&qe.next!==null;if(ga=0,Nt=qe=Ce=null,Xf=!1,Qu=0,$o=null,t)throw Error(q(300));e===null||qt||(e=e.dependencies,e!==null&&Hf(e)&&(qt=!0))}function bk(e,t,n,i){Ce=e;var r=0;do{if(Xo&&($o=null),Qu=0,Xo=!1,25<=r)throw Error(q(301));if(r+=1,Nt=qe=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}me.H=dQ,a=t(n,i)}while(Xo);return a}function aQ(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Wu(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Pb(){var e=$f!==0;return $f=0,e}function Bb(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ub(e){if(Xf){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xf=!1}ga=0,Nt=qe=Ce=null,Xo=!1,Qu=$f=0,$o=null}function An(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Ce.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Rt(){if(qe===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=Nt===null?Ce.memoizedState:Nt.next;if(t!==null)Nt=t,qe=e;else{if(e===null)throw Ce.alternate===null?Error(q(467)):Error(q(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},Nt===null?Ce.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function zb(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wu(e){var t=Qu;return Qu+=1,$o===null&&($o=[]),e=ck($o,e,t),t=Ce,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?Zk:Jk),e}function Kf(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wu(e);if(e.$$typeof===vr)return cn(e)}throw Error(q(438,String(e)))}function jb(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=Ce.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=zb(),Ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=V$;return t.index++,n}function Cr(e,t){return typeof t=="function"?t(e):t}function Qf(e){var t=Rt();return Hb(t,qe,e)}function Hb(e,t,n){var i=e.queue;if(i===null)throw Error(q(311));i.lastRenderedReducer=n;var r=e.baseQueue,a=i.pending;if(a!==null){if(r!==null){var s=r.next;r.next=a.next,a.next=s}t.baseQueue=r=a,i.pending=null}if(a=e.baseState,r===null)e.memoizedState=a;else{t=r.next;var o=s=null,l=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Le&d)===d:(ga&d)===d){var f=u.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Yo&&(c=!0);else if((ga&f)===f){u=u.next,f===Yo&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=d,s=a):l=l.next=d,Ce.lanes|=f,_a|=f;d=u.action,gs&&n(a,d),a=u.hasEagerState?u.eagerState:n(a,d)}else f={lane:d,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=f,s=a):l=l.next=f,Ce.lanes|=d,_a|=d;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=o,!Gn(a,e.memoizedState)&&(qt=!0,c&&(n=qo,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,i.lastRenderedState=a}return r===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Fb(e){var t=Rt(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do a=e(a,s.action),s=s.next;while(s!==r);Gn(a,t.memoizedState)||(qt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,i]}function yk(e,t,n){var i=Ce,r=Rt(),a=He;if(a){if(n===void 0)throw Error(q(407));n=n()}else n=t();var s=!Gn((qe||r).memoizedState,n);s&&(r.memoizedState=n,qt=!0),r=r.queue;var o=Ek.bind(null,i,r,e);if(Zu(2048,8,o,[e]),r.getSnapshot!==t||s||Nt!==null&&Nt.memoizedState.tag&1){if(i.flags|=2048,Ko(9,Wf(),xk.bind(null,i,r,n,t),null),et===null)throw Error(q(349));a||ga&124||vk(i,t,n)}return n}function vk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=zb(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xk(e,t,n,i){t.value=n,t.getSnapshot=i,Tk(t)&&_k(e)}function Ek(e,t,n){return n(function(){Tk(t)&&_k(e)})}function Tk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gn(e,n)}catch{return!0}}function _k(e){var t=jo(e,2);t!==null&&Zn(t,e,2)}function Vb(e){var t=An();if(typeof e=="function"){var n=e;if(e=n(),gs){ua(!0);try{n()}finally{ua(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:e},t}function wk(e,t,n,i){return e.baseState=n,Hb(e,qe,typeof i=="function"?i:Cr)}function sQ(e,t,n,i,r){if(Jf(e))throw Error(q(485));if(e=t.action,e!==null){var a={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s)}};me.T!==null?n(!0):a.isTransition=!1,i(a),n=t.pending,n===null?(a.next=t.pending=a,Sk(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Sk(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var a=me.T,s={};me.T=s;try{var o=n(r,i),l=me.S;l!==null&&l(s,o),Ak(e,t,o)}catch(u){Yb(e,t,u)}finally{me.T=a}}else try{a=n(r,i),Ak(e,t,a)}catch(u){Yb(e,t,u)}}function Ak(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Ck(e,t,i)},function(i){return Yb(e,t,i)}):Ck(e,t,n)}function Ck(e,t,n){t.status="fulfilled",t.value=n,kk(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sk(e,n)))}function Yb(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,kk(t),t=t.next;while(t!==i)}e.action=null}function kk(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ok(e,t){return t}function Nk(e,t){if(He){var n=et.formState;if(n!==null){e:{var i=Ce;if(He){if(yt){t:{for(var r=yt,a=tr;r.nodeType!==8;){if(!a){r=null;break t}if(r=Di(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){yt=Di(r.nextSibling),i=r.data==="F!";break e}}fs(i)}i=!1}i&&(t=n[0])}}return n=An(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ok,lastRenderedState:t},n.queue=i,n=Kk.bind(null,Ce,i),i.dispatch=n,i=Vb(!1),a=Kb.bind(null,Ce,!1,i.queue),i=An(),r={state:t,dispatch:null,action:e,pending:null},i.queue=r,n=sQ.bind(null,Ce,r,a,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function Rk(e){var t=Rt();return Dk(t,qe,e)}function Dk(e,t,n){if(t=Hb(e,t,Ok)[0],e=Qf(Cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Wu(t)}catch(s){throw s===qu?Yf:s}else i=t;t=Rt();var r=t.queue,a=r.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,Ko(9,Wf(),oQ.bind(null,r,n),null)),[i,a,e]}function oQ(e,t){e.action=t}function Mk(e){var t=Rt(),n=qe;if(n!==null)return Dk(t,n,e);Rt(),t=t.memoizedState,n=Rt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Ko(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=zb(),Ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Wf(){return{destroy:void 0,resource:void 0}}function Lk(){return Rt().memoizedState}function Zf(e,t,n,i){var r=An();i=i===void 0?null:i,Ce.flags|=e,r.memoizedState=Ko(1|t,Wf(),n,i)}function Zu(e,t,n,i){var r=Rt();i=i===void 0?null:i;var a=r.memoizedState.inst;qe!==null&&i!==null&&Lb(i,qe.memoizedState.deps)?r.memoizedState=Ko(t,a,n,i):(Ce.flags|=e,r.memoizedState=Ko(1|t,a,n,i))}function Ik(e,t){Zf(8390656,8,e,t)}function Pk(e,t){Zu(2048,8,e,t)}function Bk(e,t){return Zu(4,2,e,t)}function Uk(e,t){return Zu(4,4,e,t)}function zk(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jk(e,t,n){n=n!=null?n.concat([e]):null,Zu(4,4,zk.bind(null,t,e),n)}function qb(){}function Hk(e,t){var n=Rt();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Lb(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Fk(e,t){var n=Rt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Lb(t,i[1]))return i[0];if(i=e(),gs){ua(!0);try{e()}finally{ua(!1)}}return n.memoizedState=[i,t],i}function Gb(e,t,n){return n===void 0||ga&1073741824?e.memoizedState=t:(e.memoizedState=n,e=q6(),Ce.lanes|=e,_a|=e,n)}function Vk(e,t,n,i){return Gn(n,t)?n:Go.current!==null?(e=Gb(e,n,i),Gn(e,t)||(qt=!0),e):ga&42?(e=q6(),Ce.lanes|=e,_a|=e,t):(qt=!0,e.memoizedState=n)}function Yk(e,t,n,i,r){var a=je.p;je.p=a!==0&&8>a?a:8;var s=me.T,o={};me.T=o,Kb(e,!1,t,n);try{var l=r(),u=me.S;if(u!==null&&u(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=iQ(l,i);Ju(e,t,c,Wn(e))}else Ju(e,t,i,Wn(e))}catch(d){Ju(e,t,{then:function(){},status:"rejected",reason:d},Wn())}finally{je.p=a,me.T=s}}function lQ(){}function Xb(e,t,n,i){if(e.tag!==5)throw Error(q(476));var r=qk(e).queue;Yk(e,r,t,ns,n===null?lQ:function(){return Gk(e),n(i)})}function qk(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ns,baseState:ns,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:ns},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gk(e){var t=qk(e).next.queue;Ju(e,t,{},Wn())}function $b(){return cn(bc)}function Xk(){return Rt().memoizedState}function $k(){return Rt().memoizedState}function uQ(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Wn();e=pa(n);var i=ma(t,e,n);i!==null&&(Zn(i,t,n),Xu(i,t,n)),t={cache:wb()},e.payload=t;return}t=t.return}}function cQ(e,t,n){var i=Wn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Jf(e)?Qk(t,n):(n=pb(e,t,n,i),n!==null&&(Zn(n,e,i),Wk(n,t,i)))}function Kk(e,t,n){var i=Wn();Ju(e,t,n,i)}function Ju(e,t,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jf(e))Qk(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,o=a(s,n);if(r.hasEagerState=!0,r.eagerState=o,Gn(o,s))return Pf(e,t,r,0),et===null&&If(),!1}catch{}finally{}if(n=pb(e,t,r,i),n!==null)return Zn(n,e,i),Wk(n,t,i),!0}return!1}function Kb(e,t,n,i){if(i={lane:2,revertLane:C1(),action:i,hasEagerState:!1,eagerState:null,next:null},Jf(e)){if(t)throw Error(q(479))}else t=pb(e,n,i,2),t!==null&&Zn(t,e,2)}function Jf(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Qk(e,t){Xo=Xf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Wk(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,a3(e,n)}}var eh={readContext:cn,use:Kf,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt},Zk={readContext:cn,use:Kf,useCallback:function(e,t){return An().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:Ik,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Zf(4194308,4,zk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zf(4194308,4,e,t)},useInsertionEffect:function(e,t){Zf(4,2,e,t)},useMemo:function(e,t){var n=An();t=t===void 0?null:t;var i=e();if(gs){ua(!0);try{e()}finally{ua(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=An();if(n!==void 0){var r=n(t);if(gs){ua(!0);try{n(t)}finally{ua(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=cQ.bind(null,Ce,e),[i.memoizedState,e]},useRef:function(e){var t=An();return e={current:e},t.memoizedState=e},useState:function(e){e=Vb(e);var t=e.queue,n=Kk.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qb,useDeferredValue:function(e,t){var n=An();return Gb(n,e,t)},useTransition:function(){var e=Vb(!1);return e=Yk.bind(null,Ce,e.queue,!0,!1),An().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ce,r=An();if(He){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),et===null)throw Error(q(349));Le&124||vk(i,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,Ik(Ek.bind(null,i,a,e),[e]),i.flags|=2048,Ko(9,Wf(),xk.bind(null,i,a,n,t),null),n},useId:function(){var e=An(),t=et.identifierPrefix;if(He){var n=wr,i=_r;n=(i&~(1<<32-qn(i)-1)).toString(32)+n,t="«"+t+"R"+n,n=$f++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=rQ++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:$b,useFormState:Nk,useActionState:Nk,useOptimistic:function(e){var t=An();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Kb.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:jb,useCacheRefresh:function(){return An().memoizedState=uQ.bind(null,Ce)}},Jk={readContext:cn,use:Kf,useCallback:Hk,useContext:cn,useEffect:Pk,useImperativeHandle:jk,useInsertionEffect:Bk,useLayoutEffect:Uk,useMemo:Fk,useReducer:Qf,useRef:Lk,useState:function(){return Qf(Cr)},useDebugValue:qb,useDeferredValue:function(e,t){var n=Rt();return Vk(n,qe.memoizedState,e,t)},useTransition:function(){var e=Qf(Cr)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:Wu(e),t]},useSyncExternalStore:yk,useId:Xk,useHostTransitionStatus:$b,useFormState:Rk,useActionState:Rk,useOptimistic:function(e,t){var n=Rt();return wk(n,qe,e,t)},useMemoCache:jb,useCacheRefresh:$k},dQ={readContext:cn,use:Kf,useCallback:Hk,useContext:cn,useEffect:Pk,useImperativeHandle:jk,useInsertionEffect:Bk,useLayoutEffect:Uk,useMemo:Fk,useReducer:Fb,useRef:Lk,useState:function(){return Fb(Cr)},useDebugValue:qb,useDeferredValue:function(e,t){var n=Rt();return qe===null?Gb(n,e,t):Vk(n,qe.memoizedState,e,t)},useTransition:function(){var e=Fb(Cr)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:Wu(e),t]},useSyncExternalStore:yk,useId:Xk,useHostTransitionStatus:$b,useFormState:Mk,useActionState:Mk,useOptimistic:function(e,t){var n=Rt();return qe!==null?wk(n,qe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jb,useCacheRefresh:$k},Qo=null,ec=0;function th(e){var t=ec;return ec+=1,Qo===null&&(Qo=[]),ck(Qo,e,t)}function tc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function nh(e,t){throw t.$$typeof===H$?Error(q(525)):(e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function e6(e){var t=e._init;return t(e._payload)}function t6(e){function t(m,y){if(e){var x=m.deletions;x===null?(m.deletions=[y],m.flags|=16):x.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function i(m){for(var y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function r(m,y){return m=Tr(m,y),m.index=0,m.sibling=null,m}function a(m,y,x){return m.index=x,e?(x=m.alternate,x!==null?(x=x.index,x<y?(m.flags|=67108866,y):x):(m.flags|=67108866,y)):(m.flags|=1048576,y)}function s(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function o(m,y,x,_){return y===null||y.tag!==6?(y=gb(x,m.mode,_),y.return=m,y):(y=r(y,x),y.return=m,y)}function l(m,y,x,_){var S=x.type;return S===_o?c(m,y,x.props.children,_,x.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===oa&&e6(S)===y.type)?(y=r(y,x.props),tc(y,x),y.return=m,y):(y=Uf(x.type,x.key,x.props,null,m.mode,_),tc(y,x),y.return=m,y)}function u(m,y,x,_){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=bb(x,m.mode,_),y.return=m,y):(y=r(y,x.children||[]),y.return=m,y)}function c(m,y,x,_,S){return y===null||y.tag!==7?(y=ls(x,m.mode,_,S),y.return=m,y):(y=r(y,x),y.return=m,y)}function d(m,y,x){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=gb(""+y,m.mode,x),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case gf:return x=Uf(y.type,y.key,y.props,null,m.mode,x),tc(x,y),x.return=m,x;case Eu:return y=bb(y,m.mode,x),y.return=m,y;case oa:var _=y._init;return y=_(y._payload),d(m,y,x)}if(_u(y)||Tu(y))return y=ls(y,m.mode,x,null),y.return=m,y;if(typeof y.then=="function")return d(m,th(y),x);if(y.$$typeof===vr)return d(m,Ff(m,y),x);nh(m,y)}return null}function f(m,y,x,_){var S=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return S!==null?null:o(m,y,""+x,_);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case gf:return x.key===S?l(m,y,x,_):null;case Eu:return x.key===S?u(m,y,x,_):null;case oa:return S=x._init,x=S(x._payload),f(m,y,x,_)}if(_u(x)||Tu(x))return S!==null?null:c(m,y,x,_,null);if(typeof x.then=="function")return f(m,y,th(x),_);if(x.$$typeof===vr)return f(m,y,Ff(m,x),_);nh(m,x)}return null}function h(m,y,x,_,S){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return m=m.get(x)||null,o(y,m,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case gf:return m=m.get(_.key===null?x:_.key)||null,l(y,m,_,S);case Eu:return m=m.get(_.key===null?x:_.key)||null,u(y,m,_,S);case oa:var k=_._init;return _=k(_._payload),h(m,y,x,_,S)}if(_u(_)||Tu(_))return m=m.get(x)||null,c(y,m,_,S,null);if(typeof _.then=="function")return h(m,y,x,th(_),S);if(_.$$typeof===vr)return h(m,y,x,Ff(y,_),S);nh(y,_)}return null}function g(m,y,x,_){for(var S=null,k=null,D=y,L=y=0,B=null;D!==null&&L<x.length;L++){D.index>L?(B=D,D=null):B=D.sibling;var R=f(m,D,x[L],_);if(R===null){D===null&&(D=B);break}e&&D&&R.alternate===null&&t(m,D),y=a(R,y,L),k===null?S=R:k.sibling=R,k=R,D=B}if(L===x.length)return n(m,D),He&&cs(m,L),S;if(D===null){for(;L<x.length;L++)D=d(m,x[L],_),D!==null&&(y=a(D,y,L),k===null?S=D:k.sibling=D,k=D);return He&&cs(m,L),S}for(D=i(D);L<x.length;L++)B=h(D,m,L,x[L],_),B!==null&&(e&&B.alternate!==null&&D.delete(B.key===null?L:B.key),y=a(B,y,L),k===null?S=B:k.sibling=B,k=B);return e&&D.forEach(function(Y){return t(m,Y)}),He&&cs(m,L),S}function b(m,y,x,_){if(x==null)throw Error(q(151));for(var S=null,k=null,D=y,L=y=0,B=null,R=x.next();D!==null&&!R.done;L++,R=x.next()){D.index>L?(B=D,D=null):B=D.sibling;var Y=f(m,D,R.value,_);if(Y===null){D===null&&(D=B);break}e&&D&&Y.alternate===null&&t(m,D),y=a(Y,y,L),k===null?S=Y:k.sibling=Y,k=Y,D=B}if(R.done)return n(m,D),He&&cs(m,L),S;if(D===null){for(;!R.done;L++,R=x.next())R=d(m,R.value,_),R!==null&&(y=a(R,y,L),k===null?S=R:k.sibling=R,k=R);return He&&cs(m,L),S}for(D=i(D);!R.done;L++,R=x.next())R=h(D,m,L,R.value,_),R!==null&&(e&&R.alternate!==null&&D.delete(R.key===null?L:R.key),y=a(R,y,L),k===null?S=R:k.sibling=R,k=R);return e&&D.forEach(function(H){return t(m,H)}),He&&cs(m,L),S}function E(m,y,x,_){if(typeof x=="object"&&x!==null&&x.type===_o&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case gf:e:{for(var S=x.key;y!==null;){if(y.key===S){if(S=x.type,S===_o){if(y.tag===7){n(m,y.sibling),_=r(y,x.props.children),_.return=m,m=_;break e}}else if(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===oa&&e6(S)===y.type){n(m,y.sibling),_=r(y,x.props),tc(_,x),_.return=m,m=_;break e}n(m,y);break}else t(m,y);y=y.sibling}x.type===_o?(_=ls(x.props.children,m.mode,_,x.key),_.return=m,m=_):(_=Uf(x.type,x.key,x.props,null,m.mode,_),tc(_,x),_.return=m,m=_)}return s(m);case Eu:e:{for(S=x.key;y!==null;){if(y.key===S)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(m,y.sibling),_=r(y,x.children||[]),_.return=m,m=_;break e}else{n(m,y);break}else t(m,y);y=y.sibling}_=bb(x,m.mode,_),_.return=m,m=_}return s(m);case oa:return S=x._init,x=S(x._payload),E(m,y,x,_)}if(_u(x))return g(m,y,x,_);if(Tu(x)){if(S=Tu(x),typeof S!="function")throw Error(q(150));return x=S.call(x),b(m,y,x,_)}if(typeof x.then=="function")return E(m,y,th(x),_);if(x.$$typeof===vr)return E(m,y,Ff(m,x),_);nh(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,y!==null&&y.tag===6?(n(m,y.sibling),_=r(y,x),_.return=m,m=_):(n(m,y),_=gb(x,m.mode,_),_.return=m,m=_),s(m)):n(m,y)}return function(m,y,x,_){try{ec=0;var S=E(m,y,x,_);return Qo=null,S}catch(D){if(D===qu||D===Yf)throw D;var k=Xn(29,D,null,m.mode);return k.lanes=_,k.return=m,k}finally{}}}var Wo=t6(!0),n6=t6(!1),gi=Zi(null),nr=null;function ba(e){var t=e.alternate;dt(zt,zt.current&1),dt(gi,e),nr===null&&(t===null||Go.current!==null||t.memoizedState!==null)&&(nr=e)}function i6(e){if(e.tag===22){if(dt(zt,zt.current),dt(gi,e),nr===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(nr=e)}}else ya()}function ya(){dt(zt,zt.current),dt(gi,gi.current)}function kr(e){Vt(gi),nr===e&&(nr=null),Vt(zt)}var zt=Zi(0);function ih(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||z1(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Qb(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:st({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Wb={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Wn(),r=pa(i);r.payload=t,n!=null&&(r.callback=n),t=ma(e,r,i),t!==null&&(Zn(t,e,i),Xu(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Wn(),r=pa(i);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=ma(e,r,i),t!==null&&(Zn(t,e,i),Xu(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wn(),i=pa(n);i.tag=2,t!=null&&(i.callback=t),t=ma(e,i,n),t!==null&&(Zn(t,e,n),Xu(t,e,n))}};function r6(e,t,n,i,r,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,a,s):t.prototype&&t.prototype.isPureReactComponent?!Bu(n,i)||!Bu(r,a):!0}function a6(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Wb.enqueueReplaceState(t,t.state,null)}function bs(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=st({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var rh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function s6(e){rh(e)}function o6(e){console.error(e)}function l6(e){rh(e)}function ah(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function u6(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Zb(e,t,n){return n=pa(n),n.tag=3,n.payload={element:null},n.callback=function(){ah(e,t)},n}function c6(e){return e=pa(e),e.tag=3,e}function d6(e,t,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;e.payload=function(){return r(a)},e.callback=function(){u6(t,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){u6(t,n,i),typeof r!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function fQ(e,t,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Fu(t,n,r,!0),n=gi.current,n!==null){switch(n.tag){case 13:return nr===null?T1():n.alternate===null&&vt===0&&(vt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Cb?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),w1(e,i,r)),!1;case 22:return n.flags|=65536,i===Cb?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),w1(e,i,r)),!1}throw Error(q(435,n.tag))}return w1(e,i,r),T1(),!1}if(He)return t=gi.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==xb&&(e=Error(q(422),{cause:i}),Hu(fi(e,n)))):(i!==xb&&(t=Error(q(423),{cause:i}),Hu(fi(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,i=fi(i,n),r=Zb(e.stateNode,i,r),Nb(e,r),vt!==4&&(vt=2)),!1;var a=Error(q(520),{cause:i});if(a=fi(a,n),lc===null?lc=[a]:lc.push(a),vt!==4&&(vt=2),t===null)return!0;i=fi(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Zb(n.stateNode,i,e),Nb(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(wa===null||!wa.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=c6(r),d6(r,e,n,i),Nb(n,r),!1}n=n.return}while(n!==null);return!1}var f6=Error(q(461)),qt=!1;function Zt(e,t,n,i){t.child=e===null?n6(t,null,n,i):Wo(t,e.child,n,i)}function h6(e,t,n,i,r){n=n.render;var a=t.ref;if("ref"in i){var s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}else s=i;return ps(t),i=Ib(e,t,n,s,a,r),o=Pb(),e!==null&&!qt?(Bb(e,t,r),Or(e,t,r)):(He&&o&&yb(t),t.flags|=1,Zt(e,t,i,r),t.child)}function p6(e,t,n,i,r){if(e===null){var a=n.type;return typeof a=="function"&&!mb(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,m6(e,t,a,i,r)):(e=Uf(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!s1(e,r)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Bu,n(s,i)&&e.ref===t.ref)return Or(e,t,r)}return t.flags|=1,e=Tr(a,i),e.ref=t.ref,e.return=t,t.child=e}function m6(e,t,n,i,r){if(e!==null){var a=e.memoizedProps;if(Bu(a,i)&&e.ref===t.ref)if(qt=!1,t.pendingProps=i=a,s1(e,r))e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Or(e,t,r)}return Jb(e,t,n,i,r)}function g6(e,t,n){var i=t.pendingProps,r=i.children,a=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if(t.flags&128){if(i=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;t.childLanes=a&~i}else t.childLanes=0,t.child=null;return b6(e,t,i,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vf(t,a!==null?a.cachePool:null),a!==null?mk(t,a):Db(),i6(t);else return t.lanes=t.childLanes=536870912,b6(e,t,a!==null?a.baseLanes|n:n,n)}else a!==null?(Vf(t,a.cachePool),mk(t,a),ya(),t.memoizedState=null):(e!==null&&Vf(t,null),Db(),ya());return Zt(e,t,r,n),t.child}function b6(e,t,n,i){var r=Ab();return r=r===null?null:{parent:Ut._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Vf(t,null),Db(),i6(t),e!==null&&Fu(e,t,i,!0),null}function sh(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(q(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Jb(e,t,n,i,r){return ps(t),n=Ib(e,t,n,i,void 0,r),i=Pb(),e!==null&&!qt?(Bb(e,t,r),Or(e,t,r)):(He&&i&&yb(t),t.flags|=1,Zt(e,t,n,r),t.child)}function y6(e,t,n,i,r,a){return ps(t),t.updateQueue=null,n=bk(t,i,n,r),gk(e),i=Pb(),e!==null&&!qt?(Bb(e,t,a),Or(e,t,a)):(He&&i&&yb(t),t.flags|=1,Zt(e,t,n,a),t.child)}function v6(e,t,n,i,r){if(ps(t),t.stateNode===null){var a=Ho,s=n.contextType;typeof s=="object"&&s!==null&&(a=cn(s)),a=new n(i,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Wb,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=i,a.state=t.memoizedState,a.refs={},kb(t),s=n.contextType,a.context=typeof s=="object"&&s!==null?cn(s):Ho,a.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Qb(t,n,s,i),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&Wb.enqueueReplaceState(a,a.state,null),Ku(t,i,a,r),$u(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){a=t.stateNode;var o=t.memoizedProps,l=bs(n,o);a.props=l;var u=a.context,c=n.contextType;s=Ho,typeof c=="object"&&c!==null&&(s=cn(c));var d=n.getDerivedStateFromProps;c=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,c||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o||u!==s)&&a6(t,a,i,s),ha=!1;var f=t.memoizedState;a.state=f,Ku(t,i,a,r),$u(),u=t.memoizedState,o||f!==u||ha?(typeof d=="function"&&(Qb(t,n,d,i),u=t.memoizedState),(l=ha||r6(t,n,l,i,f,u,s))?(c||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),a.props=i,a.state=u,a.context=s,i=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{a=t.stateNode,Ob(e,t),s=t.memoizedProps,c=bs(n,s),a.props=c,d=t.pendingProps,f=a.context,u=n.contextType,l=Ho,typeof u=="object"&&u!==null&&(l=cn(u)),o=n.getDerivedStateFromProps,(u=typeof o=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&a6(t,a,i,l),ha=!1,f=t.memoizedState,a.state=f,Ku(t,i,a,r),$u();var h=t.memoizedState;s!==d||f!==h||ha||e!==null&&e.dependencies!==null&&Hf(e.dependencies)?(typeof o=="function"&&(Qb(t,n,o,i),h=t.memoizedState),(c=ha||r6(t,n,c,i,f,h,l)||e!==null&&e.dependencies!==null&&Hf(e.dependencies))?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=h),a.props=i,a.state=h,a.context=l,i=c):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),i=!1)}return a=i,sh(e,t),i=(t.flags&128)!==0,a||i?(a=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&i?(t.child=Wo(t,e.child,null,r),t.child=Wo(t,null,n,r)):Zt(e,t,n,r),t.memoizedState=a.state,e=t.child):e=Or(e,t,r),e}function x6(e,t,n,i){return ju(),t.flags|=256,Zt(e,t,n,i),t.child}var e1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function t1(e){return{baseLanes:e,cachePool:ok()}}function n1(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=bi),e}function E6(e,t,n){var i=t.pendingProps,r=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),s&&(r=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(r?ba(t):ya(),He){var o=yt,l;if(l=o){e:{for(l=o,o=tr;l.nodeType!==8;){if(!o){o=null;break e}if(l=Di(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(t.memoizedState={dehydrated:o,treeContext:us!==null?{id:_r,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},l=Xn(18,null,null,0),l.stateNode=o,l.return=t,t.child=l,bn=t,yt=null,l=!0):l=!1}l||fs(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return z1(o)?t.lanes=32:t.lanes=536870912,null;kr(t)}return o=i.children,i=i.fallback,r?(ya(),r=t.mode,o=oh({mode:"hidden",children:o},r),i=ls(i,r,n,null),o.return=t,i.return=t,o.sibling=i,t.child=o,r=t.child,r.memoizedState=t1(n),r.childLanes=n1(e,s,n),t.memoizedState=e1,i):(ba(t),i1(t,o))}if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(a)t.flags&256?(ba(t),t.flags&=-257,t=r1(e,t,n)):t.memoizedState!==null?(ya(),t.child=e.child,t.flags|=128,t=null):(ya(),r=i.fallback,o=t.mode,i=oh({mode:"visible",children:i.children},o),r=ls(r,o,n,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,Wo(t,e.child,null,n),i=t.child,i.memoizedState=t1(n),i.childLanes=n1(e,s,n),t.memoizedState=e1,t=r);else if(ba(t),z1(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var u=s.dgst;s=u,i=Error(q(419)),i.stack="",i.digest=s,Hu({value:i,source:null,stack:null}),t=r1(e,t,n)}else if(qt||Fu(e,t,n,!1),s=(n&e.childLanes)!==0,qt||s){if(s=et,s!==null&&(i=n&-n,i=i&42?1:jg(i),i=i&(s.suspendedLanes|n)?0:i,i!==0&&i!==l.retryLane))throw l.retryLane=i,jo(e,i),Zn(s,e,i),f6;o.data==="$?"||T1(),t=r1(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,yt=Di(o.nextSibling),bn=t,He=!0,ds=null,tr=!1,e!==null&&(pi[mi++]=_r,pi[mi++]=wr,pi[mi++]=us,_r=e.id,wr=e.overflow,us=t),t=i1(t,i.children),t.flags|=4096);return t}return r?(ya(),r=i.fallback,o=t.mode,l=e.child,u=l.sibling,i=Tr(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,u!==null?r=Tr(u,r):(r=ls(r,o,n,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,i=r,r=t.child,o=e.child.memoizedState,o===null?o=t1(n):(l=o.cachePool,l!==null?(u=Ut._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=ok(),o={baseLanes:o.baseLanes|n,cachePool:l}),r.memoizedState=o,r.childLanes=n1(e,s,n),t.memoizedState=e1,i):(ba(t),n=e.child,e=n.sibling,n=Tr(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function i1(e,t){return t=oh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function oh(e,t){return e=Xn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function r1(e,t,n){return Wo(t,e.child,null,n),e=i1(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function T6(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Tb(e.return,t,n)}function a1(e,t,n,i,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r)}function _6(e,t,n){var i=t.pendingProps,r=i.revealOrder,a=i.tail;if(Zt(e,t,i.children,n),i=zt.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&T6(e,n,t);else if(e.tag===19)T6(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(dt(zt,i),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ih(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),a1(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ih(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}a1(t,!0,n,null,a);break;case"together":a1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Or(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_a|=t.lanes,!(n&t.childLanes))if(e!==null){if(Fu(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=Tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s1(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Hf(e)))}function hQ(e,t,n){switch(t.tag){case 3:yf(t,t.stateNode.containerInfo),fa(t,Ut,e.memoizedState.cache),ju();break;case 27:case 5:Ig(t);break;case 4:yf(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ba(t),t.flags|=128,null):n&t.child.childLanes?E6(e,t,n):(ba(t),e=Or(e,t,n),e!==null?e.sibling:null);ba(t);break;case 19:var r=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Fu(e,t,n,!1),i=(n&t.childLanes)!==0),r){if(i)return _6(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),dt(zt,zt.current),i)break;return null;case 22:case 23:return t.lanes=0,g6(e,t,n);case 24:fa(t,Ut,e.memoizedState.cache)}return Or(e,t,n)}function w6(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qt=!0;else{if(!s1(e,n)&&!(t.flags&128))return qt=!1,hQ(e,t,n);qt=!!(e.flags&131072)}else qt=!1,He&&t.flags&1048576&&ek(t,jf,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,r=i._init;if(i=r(i._payload),t.type=i,typeof i=="function")mb(i)?(e=bs(i,e),t.tag=1,t=v6(null,t,i,e,n)):(t.tag=0,t=Jb(null,t,i,e,n));else{if(i!=null){if(r=i.$$typeof,r===kg){t.tag=11,t=h6(null,t,i,e,n);break e}else if(r===Rg){t.tag=14,t=p6(null,t,i,e,n);break e}}throw t=Mg(i)||i,Error(q(306,t,""))}}return t;case 0:return Jb(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,r=bs(i,t.pendingProps),v6(e,t,i,r,n);case 3:e:{if(yf(t,t.stateNode.containerInfo),e===null)throw Error(q(387));i=t.pendingProps;var a=t.memoizedState;r=a.element,Ob(e,t),Ku(t,i,null,n);var s=t.memoizedState;if(i=s.cache,fa(t,Ut,i),i!==a.cache&&_b(t,[Ut],n,!0),$u(),i=s.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=x6(e,t,i,n);break e}else if(i!==r){r=fi(Error(q(424)),t),Hu(r),t=x6(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(yt=Di(e.firstChild),bn=t,He=!0,ds=null,tr=!0,n=n6(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ju(),i===r){t=Or(e,t,n);break e}Zt(e,t,i,n)}t=t.child}return t;case 26:return sh(e,t),e===null?(n=kO(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(n=t.type,e=t.pendingProps,i=Eh(la.current).createElement(n),i[un]=t,i[wn]=e,en(i,n,e),Yt(i),t.stateNode=i):t.memoizedState=kO(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ig(t),e===null&&He&&(i=t.stateNode=SO(t.type,t.pendingProps,la.current),bn=t,tr=!0,r=yt,Ca(t.type)?(j1=r,yt=Di(i.firstChild)):yt=r),Zt(e,t,t.pendingProps.children,n),sh(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((r=i=yt)&&(i=HQ(i,t.type,t.pendingProps,tr),i!==null?(t.stateNode=i,bn=t,yt=Di(i.firstChild),tr=!1,r=!0):r=!1),r||fs(t)),Ig(t),r=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,i=a.children,P1(r,a)?i=null:s!==null&&P1(r,s)&&(t.flags|=32),t.memoizedState!==null&&(r=Ib(e,t,aQ,null,null,n),bc._currentValue=r),sh(e,t),Zt(e,t,i,n),t.child;case 6:return e===null&&He&&((e=n=yt)&&(n=FQ(n,t.pendingProps,tr),n!==null?(t.stateNode=n,bn=t,yt=null,e=!0):e=!1),e||fs(t)),null;case 13:return E6(e,t,n);case 4:return yf(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wo(t,null,i,n):Zt(e,t,i,n),t.child;case 11:return h6(e,t,t.type,t.pendingProps,n);case 7:return Zt(e,t,t.pendingProps,n),t.child;case 8:return Zt(e,t,t.pendingProps.children,n),t.child;case 12:return Zt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,fa(t,t.type,i.value),Zt(e,t,i.children,n),t.child;case 9:return r=t.type._context,i=t.pendingProps.children,ps(t),r=cn(r),i=i(r),t.flags|=1,Zt(e,t,i,n),t.child;case 14:return p6(e,t,t.type,t.pendingProps,n);case 15:return m6(e,t,t.type,t.pendingProps,n);case 19:return _6(e,t,n);case 31:return i=t.pendingProps,n=t.mode,i={mode:i.mode,children:i.children},e===null?(n=oh(i,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Tr(e.child,i),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return g6(e,t,n);case 24:return ps(t),i=cn(Ut),e===null?(r=Ab(),r===null&&(r=et,a=wb(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),t.memoizedState={parent:i,cache:r},kb(t),fa(t,Ut,r)):(e.lanes&n&&(Ob(e,t),Ku(t,null,null,n),$u()),r=e.memoizedState,a=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),fa(t,Ut,i)):(i=a.cache,fa(t,Ut,i),i!==r.cache&&_b(t,[Ut],n,!0))),Zt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(q(156,t.tag))}function Nr(e){e.flags|=4}function S6(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!MO(t)){if(t=gi.current,t!==null&&((Le&4194048)===Le?nr!==null:(Le&62914560)!==Le&&!(Le&536870912)||t!==nr))throw Gu=Cb,lk;e.flags|=8192}}function lh(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?i3():536870912,e.lanes|=t,tl|=t)}function nc(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function pQ(e,t,n){var i=t.pendingProps;switch(vb(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ar(Ut),So(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zu(t)?Nr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ik())),mt(t),null;case 26:return n=t.memoizedState,e===null?(Nr(t),n!==null?(mt(t),S6(t,n)):(mt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Nr(t),mt(t),S6(t,n)):(mt(t),t.flags&=-16777217):(e.memoizedProps!==i&&Nr(t),mt(t),t.flags&=-16777217),null;case 27:vf(t),n=la.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Nr(t);else{if(!i){if(t.stateNode===null)throw Error(q(166));return mt(t),null}e=Ji.current,zu(t)?tk(t):(e=SO(r,i,n),t.stateNode=e,Nr(t))}return mt(t),null;case 5:if(vf(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Nr(t);else{if(!i){if(t.stateNode===null)throw Error(q(166));return mt(t),null}if(e=Ji.current,zu(t))tk(t);else{switch(r=Eh(la.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}e[un]=t,e[wn]=i;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(en(e,n,i),n){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Nr(t)}}return mt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Nr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(q(166));if(e=la.current,zu(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=bn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[un]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||yO(e.nodeValue,n)),e||fs(t)}else e=Eh(e).createTextNode(i),e[un]=t,t.stateNode=e}return mt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=zu(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(q(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(q(317));r[un]=t}else ju(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;mt(t),r=!1}else r=ik(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(kr(t),t):(kr(t),null)}if(kr(t),t.flags&128)return t.lanes=n,t;if(n=i!==null,e=e!==null&&e.memoizedState!==null,n){i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var a=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),lh(t,t.updateQueue),mt(t),null;case 4:return So(),e===null&&R1(t.stateNode.containerInfo),mt(t),null;case 10:return Ar(t.type),mt(t),null;case 19:if(Vt(zt),r=t.memoizedState,r===null)return mt(t),null;if(i=(t.flags&128)!==0,a=r.rendering,a===null)if(i)nc(r,!1);else{if(vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ih(e),a!==null){for(t.flags|=128,nc(r,!1),e=a.updateQueue,t.updateQueue=e,lh(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)J3(n,e),n=n.sibling;return dt(zt,zt.current&1|2),t.child}e=e.sibling}r.tail!==null&&er()>dh&&(t.flags|=128,i=!0,nc(r,!1),t.lanes=4194304)}else{if(!i)if(e=ih(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,lh(t,e),nc(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!He)return mt(t),null}else 2*er()-r.renderingStartTime>dh&&n!==536870912&&(t.flags|=128,i=!0,nc(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=er(),t.sibling=null,e=zt.current,dt(zt,i?e&1|2:e&1),t):(mt(t),null);case 22:case 23:return kr(t),Mb(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),n=t.updateQueue,n!==null&&lh(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Vt(ms),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ar(Ut),mt(t),null;case 25:return null;case 30:return null}throw Error(q(156,t.tag))}function mQ(e,t){switch(vb(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ar(Ut),So(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return vf(t),null;case 13:if(kr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));ju()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vt(zt),null;case 4:return So(),null;case 10:return Ar(t.type),null;case 22:case 23:return kr(t),Mb(),e!==null&&Vt(ms),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ar(Ut),null;case 25:return null;default:return null}}function A6(e,t){switch(vb(t),t.tag){case 3:Ar(Ut),So();break;case 26:case 27:case 5:vf(t);break;case 4:So();break;case 13:kr(t);break;case 19:Vt(zt);break;case 10:Ar(t.type);break;case 22:case 23:kr(t),Mb(),e!==null&&Vt(ms);break;case 24:Ar(Ut)}}function ic(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i}n=n.next}while(n!==r)}}catch(o){Ke(t,t.return,o)}}function va(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&e)===e){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,r=t;var l=n,u=o;try{u()}catch(c){Ke(r,l,c)}}}i=i.next}while(i!==a)}}catch(c){Ke(t,t.return,c)}}function C6(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{pk(t,n)}catch(i){Ke(e,e.return,i)}}}function k6(e,t,n){n.props=bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Ke(e,t,i)}}function rc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Ke(e,t,r)}}function ir(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Ke(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function O6(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Ke(e,e.return,r)}}function o1(e,t,n){try{var i=e.stateNode;PQ(i,e.type,n,t),i[wn]=t}catch(r){Ke(e,e.return,r)}}function N6(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ca(e.type)||e.tag===4}function l1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N6(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ca(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function u1(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xh));else if(i!==4&&(i===27&&Ca(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(u1(e,t,n),e=e.sibling;e!==null;)u1(e,t,n),e=e.sibling}function uh(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Ca(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(uh(e,t,n),e=e.sibling;e!==null;)uh(e,t,n),e=e.sibling}function R6(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);en(t,i,n),t[un]=e,t[wn]=n}catch(a){Ke(e,e.return,a)}}var Rr=!1,St=!1,c1=!1,D6=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function gQ(e,t){if(e=e.containerInfo,L1=Ch,e=V3(e),lb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||r!==0&&d.nodeType!==3||(o=s+r),d!==a||i!==0&&d.nodeType!==3||(l=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===r&&(o=s),f===a&&++c===i&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(I1={focusedElem:e,selectionRange:n},Ch=!1,Gt=t;Gt!==null;)if(t=Gt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Gt=e;else for(;Gt!==null;){switch(t=Gt,a=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var g=bs(n.type,r,n.elementType===n.type);e=i.getSnapshotBeforeUpdate(g,a),i.__reactInternalSnapshotBeforeUpdate=e}catch(b){Ke(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)U1(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":U1(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(q(163))}if(e=t.sibling,e!==null){e.return=t.return,Gt=e;break}Gt=t.return}}function M6(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:xa(e,n),i&4&&ic(5,n);break;case 1:if(xa(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){Ke(n,n.return,s)}else{var r=bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Ke(n,n.return,s)}}i&64&&C6(n),i&512&&rc(n,n.return);break;case 3:if(xa(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{pk(e,t)}catch(s){Ke(n,n.return,s)}}break;case 27:t===null&&i&4&&R6(n);case 26:case 5:xa(e,n),t===null&&i&4&&O6(n),i&512&&rc(n,n.return);break;case 12:xa(e,n);break;case 13:xa(e,n),i&4&&P6(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=SQ.bind(null,n),VQ(e,n))));break;case 22:if(i=n.memoizedState!==null||Rr,!i){t=t!==null&&t.memoizedState!==null||St,r=Rr;var a=St;Rr=i,(St=t)&&!a?Ea(e,n,(n.subtreeFlags&8772)!==0):xa(e,n),Rr=r,St=a}break;case 30:break;default:xa(e,n)}}function L6(e){var t=e.alternate;t!==null&&(e.alternate=null,L6(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vg(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,Cn=!1;function Dr(e,t,n){for(n=n.child;n!==null;)I6(e,t,n),n=n.sibling}function I6(e,t,n){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(Su,n)}catch{}switch(n.tag){case 26:St||ir(n,t),Dr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:St||ir(n,t);var i=ft,r=Cn;Ca(n.type)&&(ft=n.stateNode,Cn=!1),Dr(e,t,n),hc(n.stateNode),ft=i,Cn=r;break;case 5:St||ir(n,t);case 6:if(i=ft,r=Cn,ft=null,Dr(e,t,n),ft=i,Cn=r,ft!==null)if(Cn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(a){Ke(n,t,a)}else try{ft.removeChild(n.stateNode)}catch(a){Ke(n,t,a)}break;case 18:ft!==null&&(Cn?(e=ft,_O(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ec(e)):_O(ft,n.stateNode));break;case 4:i=ft,r=Cn,ft=n.stateNode.containerInfo,Cn=!0,Dr(e,t,n),ft=i,Cn=r;break;case 0:case 11:case 14:case 15:St||va(2,n,t),St||va(4,n,t),Dr(e,t,n);break;case 1:St||(ir(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&k6(n,t,i)),Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:St=(i=St)||n.memoizedState!==null,Dr(e,t,n),St=i;break;default:Dr(e,t,n)}}function P6(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ec(e)}catch(n){Ke(t,t.return,n)}}function bQ(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new D6),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new D6),t;default:throw Error(q(435,e.tag))}}function d1(e,t){var n=bQ(e);t.forEach(function(i){var r=AQ.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}function $n(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Ca(o.type)){ft=o.stateNode,Cn=!1;break e}break;case 5:ft=o.stateNode,Cn=!1;break e;case 3:case 4:ft=o.stateNode.containerInfo,Cn=!0;break e}o=o.return}if(ft===null)throw Error(q(160));I6(a,s,r),ft=null,Cn=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)B6(t,e),t=t.sibling}var Ri=null;function B6(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$n(t,e),Kn(e),i&4&&(va(3,e,e.return),ic(3,e),va(5,e,e.return));break;case 1:$n(t,e),Kn(e),i&512&&(St||n===null||ir(n,n.return)),i&64&&Rr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Ri;if($n(t,e),Kn(e),i&512&&(St||n===null||ir(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[ku]||a[un]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),en(a,i,n),a[un]=e,Yt(a),i=a;break e;case"link":var s=RO("link","href",r).get(i+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(a=s[o],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}a=r.createElement(i),en(a,i,n),r.head.appendChild(a);break;case"meta":if(s=RO("meta","content",r).get(i+(n.content||""))){for(o=0;o<s.length;o++)if(a=s[o],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}a=r.createElement(i),en(a,i,n),r.head.appendChild(a);break;default:throw Error(q(468,i))}a[un]=e,Yt(a),i=a}e.stateNode=i}else DO(r,e.type,e.stateNode);else e.stateNode=NO(r,i,e.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?DO(r,e.type,e.stateNode):NO(r,i,e.memoizedProps)):i===null&&e.stateNode!==null&&o1(e,e.memoizedProps,n.memoizedProps)}break;case 27:$n(t,e),Kn(e),i&512&&(St||n===null||ir(n,n.return)),n!==null&&i&4&&o1(e,e.memoizedProps,n.memoizedProps);break;case 5:if($n(t,e),Kn(e),i&512&&(St||n===null||ir(n,n.return)),e.flags&32){r=e.stateNode;try{Mo(r,"")}catch(h){Ke(e,e.return,h)}}i&4&&e.stateNode!=null&&(r=e.memoizedProps,o1(e,r,n!==null?n.memoizedProps:r)),i&1024&&(c1=!0);break;case 6:if($n(t,e),Kn(e),i&4){if(e.stateNode===null)throw Error(q(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(h){Ke(e,e.return,h)}}break;case 3:if(wh=null,r=Ri,Ri=Th(t.containerInfo),$n(t,e),Ri=r,Kn(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ec(t.containerInfo)}catch(h){Ke(e,e.return,h)}c1&&(c1=!1,U6(e));break;case 4:i=Ri,Ri=Th(e.stateNode.containerInfo),$n(t,e),Kn(e),Ri=i;break;case 12:$n(t,e),Kn(e);break;case 13:$n(t,e),Kn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(b1=er()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,d1(e,i)));break;case 22:r=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Rr,c=St;if(Rr=u||r,St=c||l,$n(t,e),St=c,Rr=u,Kn(e),i&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||l||Rr||St||ys(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,r)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;o.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(h){Ke(l,l.return,h)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(h){Ke(l,l.return,h)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,d1(e,n))));break;case 19:$n(t,e),Kn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,d1(e,i)));break;case 30:break;case 21:break;default:$n(t,e),Kn(e)}}function Kn(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(N6(i)){n=i;break}i=i.return}if(n==null)throw Error(q(160));switch(n.tag){case 27:var r=n.stateNode,a=l1(e);uh(e,a,r);break;case 5:var s=n.stateNode;n.flags&32&&(Mo(s,""),n.flags&=-33);var o=l1(e);uh(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,u=l1(e);u1(e,u,l);break;default:throw Error(q(161))}}catch(c){Ke(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function U6(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;U6(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)M6(e,t.alternate,t),t=t.sibling}function ys(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:va(4,t,t.return),ys(t);break;case 1:ir(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&k6(t,t.return,n),ys(t);break;case 27:hc(t.stateNode);case 26:case 5:ir(t,t.return),ys(t);break;case 22:t.memoizedState===null&&ys(t);break;case 30:ys(t);break;default:ys(t)}e=e.sibling}}function Ea(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,r=e,a=t,s=a.flags;switch(a.tag){case 0:case 11:case 15:Ea(r,a,n),ic(4,a);break;case 1:if(Ea(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Ke(i,i.return,u)}if(i=a,r=i.updateQueue,r!==null){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)hk(l[r],o)}catch(u){Ke(i,i.return,u)}}n&&s&64&&C6(a),rc(a,a.return);break;case 27:R6(a);case 26:case 5:Ea(r,a,n),n&&i===null&&s&4&&O6(a),rc(a,a.return);break;case 12:Ea(r,a,n);break;case 13:Ea(r,a,n),n&&s&4&&P6(r,a);break;case 22:a.memoizedState===null&&Ea(r,a,n),rc(a,a.return);break;case 30:break;default:Ea(r,a,n)}t=t.sibling}}function f1(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Vu(n))}function h1(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vu(e))}function rr(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)z6(e,t,n,i),t=t.sibling}function z6(e,t,n,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:rr(e,t,n,i),r&2048&&ic(9,t);break;case 1:rr(e,t,n,i);break;case 3:rr(e,t,n,i),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vu(e)));break;case 12:if(r&2048){rr(e,t,n,i),e=t.stateNode;try{var a=t.memoizedProps,s=a.id,o=a.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Ke(t,t.return,l)}}else rr(e,t,n,i);break;case 13:rr(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,t.memoizedState!==null?a._visibility&2?rr(e,t,n,i):ac(e,t):a._visibility&2?rr(e,t,n,i):(a._visibility|=2,Zo(e,t,n,i,(t.subtreeFlags&10256)!==0)),r&2048&&f1(s,t);break;case 24:rr(e,t,n,i),r&2048&&h1(t.alternate,t);break;default:rr(e,t,n,i)}}function Zo(e,t,n,i,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var a=e,s=t,o=n,l=i,u=s.flags;switch(s.tag){case 0:case 11:case 15:Zo(a,s,o,l,r),ic(8,s);break;case 23:break;case 22:var c=s.stateNode;s.memoizedState!==null?c._visibility&2?Zo(a,s,o,l,r):ac(a,s):(c._visibility|=2,Zo(a,s,o,l,r)),r&&u&2048&&f1(s.alternate,s);break;case 24:Zo(a,s,o,l,r),r&&u&2048&&h1(s.alternate,s);break;default:Zo(a,s,o,l,r)}t=t.sibling}}function ac(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:ac(n,i),r&2048&&f1(i.alternate,i);break;case 24:ac(n,i),r&2048&&h1(i.alternate,i);break;default:ac(n,i)}t=t.sibling}}var sc=8192;function Jo(e){if(e.subtreeFlags&sc)for(e=e.child;e!==null;)j6(e),e=e.sibling}function j6(e){switch(e.tag){case 26:Jo(e),e.flags&sc&&e.memoizedState!==null&&nW(Ri,e.memoizedState,e.memoizedProps);break;case 5:Jo(e);break;case 3:case 4:var t=Ri;Ri=Th(e.stateNode.containerInfo),Jo(e),Ri=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=sc,sc=16777216,Jo(e),sc=t):Jo(e));break;default:Jo(e)}}function H6(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function oc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Gt=i,V6(i,e)}H6(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)F6(e),e=e.sibling}function F6(e){switch(e.tag){case 0:case 11:case 15:oc(e),e.flags&2048&&va(9,e,e.return);break;case 3:oc(e);break;case 12:oc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ch(e)):oc(e);break;default:oc(e)}}function ch(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Gt=i,V6(i,e)}H6(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:va(8,t,t.return),ch(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ch(t));break;default:ch(t)}e=e.sibling}}function V6(e,t){for(;Gt!==null;){var n=Gt;switch(n.tag){case 0:case 11:case 15:va(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Vu(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Gt=i;else e:for(n=e;Gt!==null;){i=Gt;var r=i.sibling,a=i.return;if(L6(i),i===n){Gt=null;break e}if(r!==null){r.return=a,Gt=r;break e}Gt=a}}}var yQ={getCacheForType:function(e){var t=cn(Ut),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},vQ=typeof WeakMap=="function"?WeakMap:Map,Ve=0,et=null,Re=null,Le=0,Ye=0,Qn=null,Ta=!1,el=!1,p1=!1,Mr=0,vt=0,_a=0,vs=0,m1=0,bi=0,tl=0,lc=null,kn=null,g1=!1,b1=0,dh=1/0,fh=null,wa=null,Jt=0,Sa=null,nl=null,il=0,y1=0,v1=null,Y6=null,uc=0,x1=null;function Wn(){if(Ve&2&&Le!==0)return Le&-Le;if(me.T!==null){var e=Yo;return e!==0?e:C1()}return s3()}function q6(){bi===0&&(bi=!(Le&536870912)||He?n3():536870912);var e=gi.current;return e!==null&&(e.flags|=32),bi}function Zn(e,t,n){(e===et&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)&&(rl(e,0),Aa(e,Le,bi,!1)),Cu(e,n),(!(Ve&2)||e!==et)&&(e===et&&(!(Ve&2)&&(vs|=n),vt===4&&Aa(e,Le,bi,!1)),ar(e))}function G6(e,t,n){if(Ve&6)throw Error(q(327));var i=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Au(e,t),r=i?TQ(e,t):_1(e,t,!0),a=i;do{if(r===0){el&&!i&&Aa(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!xQ(n)){r=_1(e,t,!1),a=!1;continue}if(r===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;r=lc;var l=o.current.memoizedState.isDehydrated;if(l&&(rl(o,s).flags|=256),s=_1(o,s,!1),s!==2){if(p1&&!l){o.errorRecoveryDisabledLanes|=a,vs|=a,r=4;break e}a=kn,kn=r,a!==null&&(kn===null?kn=a:kn.push.apply(kn,a))}r=s}if(a=!1,r!==2)continue}}if(r===1){rl(e,0),Aa(e,t,0,!0);break}e:{switch(i=e,a=r,a){case 0:case 1:throw Error(q(345));case 4:if((t&4194048)!==t)break;case 6:Aa(i,t,bi,!Ta);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(q(329))}if((t&62914560)===t&&(r=b1+300-er(),10<r)){if(Aa(i,t,bi,!Ta),_f(i,0,!0)!==0)break e;i.timeoutHandle=EO(X6.bind(null,i,n,kn,fh,g1,t,bi,vs,tl,Ta,a,2,-0,0),r);break e}X6(i,n,kn,fh,g1,t,bi,vs,tl,Ta,a,0,-0,0)}}break}while(!0);ar(e)}function X6(e,t,n,i,r,a,s,o,l,u,c,d,f,h){if(e.timeoutHandle=-1,d=t.subtreeFlags,(d&8192||(d&16785408)===16785408)&&(gc={stylesheets:null,count:0,unsuspend:tW},j6(t),d=iW(),d!==null)){e.cancelPendingCommit=d(eO.bind(null,e,t,a,n,i,r,s,o,l,c,1,f,h)),Aa(e,a,s,!u);return}eO(e,t,a,n,i,r,s,o,l)}function xQ(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!Gn(a(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Aa(e,t,n,i){t&=~m1,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var a=31-qn(r),s=1<<a;i[a]=-1,r&=~s}n!==0&&r3(e,n,t)}function hh(){return Ve&6?!0:(cc(0),!1)}function E1(){if(Re!==null){if(Ye===0)var e=Re.return;else e=Re,Sr=hs=null,Ub(e),Qo=null,ec=0,e=Re;for(;e!==null;)A6(e.alternate,e),e=e.return;Re=null}}function rl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,UQ(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),E1(),et=e,Re=n=Tr(e.current,null),Le=t,Ye=0,Qn=null,Ta=!1,el=Au(e,t),p1=!1,tl=bi=m1=vs=_a=vt=0,kn=lc=null,g1=!1,t&8&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var r=31-qn(i),a=1<<r;t|=e[r],i&=~a}return Mr=t,If(),n}function $6(e,t){Ce=null,me.H=eh,t===qu||t===Yf?(t=dk(),Ye=3):t===lk?(t=dk(),Ye=4):Ye=t===f6?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Qn=t,Re===null&&(vt=1,ah(e,fi(t,e.current)))}function K6(){var e=me.H;return me.H=eh,e===null?eh:e}function Q6(){var e=me.A;return me.A=yQ,e}function T1(){vt=4,Ta||(Le&4194048)!==Le&&gi.current!==null||(el=!0),!(_a&134217727)&&!(vs&134217727)||et===null||Aa(et,Le,bi,!1)}function _1(e,t,n){var i=Ve;Ve|=2;var r=K6(),a=Q6();(et!==e||Le!==t)&&(fh=null,rl(e,t)),t=!1;var s=vt;e:do try{if(Ye!==0&&Re!==null){var o=Re,l=Qn;switch(Ye){case 8:E1(),s=6;break e;case 3:case 2:case 9:case 6:gi.current===null&&(t=!0);var u=Ye;if(Ye=0,Qn=null,al(e,o,l,u),n&&el){s=0;break e}break;default:u=Ye,Ye=0,Qn=null,al(e,o,l,u)}}EQ(),s=vt;break}catch(c){$6(e,c)}while(!0);return t&&e.shellSuspendCounter++,Sr=hs=null,Ve=i,me.H=r,me.A=a,Re===null&&(et=null,Le=0,If()),s}function EQ(){for(;Re!==null;)W6(Re)}function TQ(e,t){var n=Ve;Ve|=2;var i=K6(),r=Q6();et!==e||Le!==t?(fh=null,dh=er()+500,rl(e,t)):el=Au(e,t);e:do try{if(Ye!==0&&Re!==null){t=Re;var a=Qn;t:switch(Ye){case 1:Ye=0,Qn=null,al(e,t,a,1);break;case 2:case 9:if(uk(a)){Ye=0,Qn=null,Z6(t);break}t=function(){Ye!==2&&Ye!==9||et!==e||(Ye=7),ar(e)},a.then(t,t);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:uk(a)?(Ye=0,Qn=null,Z6(t)):(Ye=0,Qn=null,al(e,t,a,7));break;case 5:var s=null;switch(Re.tag){case 26:s=Re.memoizedState;case 5:case 27:var o=Re;if(!s||MO(s)){Ye=0,Qn=null;var l=o.sibling;if(l!==null)Re=l;else{var u=o.return;u!==null?(Re=u,ph(u)):Re=null}break t}}Ye=0,Qn=null,al(e,t,a,5);break;case 6:Ye=0,Qn=null,al(e,t,a,6);break;case 8:E1(),vt=6;break e;default:throw Error(q(462))}}_Q();break}catch(c){$6(e,c)}while(!0);return Sr=hs=null,me.H=i,me.A=r,Ve=n,Re!==null?0:(et=null,Le=0,If(),vt)}function _Q(){for(;Re!==null&&!q$();)W6(Re)}function W6(e){var t=w6(e.alternate,e,Mr);e.memoizedProps=e.pendingProps,t===null?ph(e):Re=t}function Z6(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=y6(n,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=y6(n,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:Ub(t);default:A6(n,t),t=Re=J3(t,Mr),t=w6(n,t,Mr)}e.memoizedProps=e.pendingProps,t===null?ph(e):Re=t}function al(e,t,n,i){Sr=hs=null,Ub(t),Qo=null,ec=0;var r=t.return;try{if(fQ(e,r,t,n,Le)){vt=1,ah(e,fi(n,e.current)),Re=null;return}}catch(a){if(r!==null)throw Re=r,a;vt=1,ah(e,fi(n,e.current)),Re=null;return}t.flags&32768?(He||i===1?e=!0:el||Le&536870912?e=!1:(Ta=e=!0,(i===2||i===9||i===3||i===6)&&(i=gi.current,i!==null&&i.tag===13&&(i.flags|=16384))),J6(t,e)):ph(t)}function ph(e){var t=e;do{if(t.flags&32768){J6(t,Ta);return}e=t.return;var n=pQ(t.alternate,t,Mr);if(n!==null){Re=n;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);vt===0&&(vt=5)}function J6(e,t){do{var n=mQ(e.alternate,e);if(n!==null){n.flags&=32767,Re=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=n}while(e!==null);vt=6,Re=null}function eO(e,t,n,i,r,a,s,o,l){e.cancelPendingCommit=null;do mh();while(Jt!==0);if(Ve&6)throw Error(q(327));if(t!==null){if(t===e.current)throw Error(q(177));if(a=t.lanes|t.childLanes,a|=hb,tK(e,n,a,s,o,l),e===et&&(Re=et=null,Le=0),nl=t,Sa=e,il=n,y1=a,v1=r,Y6=i,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,CQ(xf,function(){return aO(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,t.subtreeFlags&13878||i){i=me.T,me.T=null,r=je.p,je.p=2,s=Ve,Ve|=4;try{gQ(e,t,n)}finally{Ve=s,je.p=r,me.T=i}}Jt=1,tO(),nO(),iO()}}function tO(){if(Jt===1){Jt=0;var e=Sa,t=nl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=me.T,me.T=null;var i=je.p;je.p=2;var r=Ve;Ve|=4;try{B6(t,e);var a=I1,s=V3(e.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&F3(o.ownerDocument.documentElement,o)){if(l!==null&&lb(o)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in o)o.selectionStart=u,o.selectionEnd=Math.min(c,o.value.length);else{var d=o.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var h=f.getSelection(),g=o.textContent.length,b=Math.min(l.start,g),E=l.end===void 0?b:Math.min(l.end,g);!h.extend&&b>E&&(s=E,E=b,b=s);var m=H3(o,b),y=H3(o,E);if(m&&y&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==y.node||h.focusOffset!==y.offset)){var x=d.createRange();x.setStart(m.node,m.offset),h.removeAllRanges(),b>E?(h.addRange(x),h.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),h.addRange(x))}}}}for(d=[],h=o;h=h.parentNode;)h.nodeType===1&&d.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<d.length;o++){var _=d[o];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}Ch=!!L1,I1=L1=null}finally{Ve=r,je.p=i,me.T=n}}e.current=t,Jt=2}}function nO(){if(Jt===2){Jt=0;var e=Sa,t=nl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=me.T,me.T=null;var i=je.p;je.p=2;var r=Ve;Ve|=4;try{M6(e,t.alternate,t)}finally{Ve=r,je.p=i,me.T=n}}Jt=3}}function iO(){if(Jt===4||Jt===3){Jt=0,G$();var e=Sa,t=nl,n=il,i=Y6;t.subtreeFlags&10256||t.flags&10256?Jt=5:(Jt=0,nl=Sa=null,rO(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(wa=null),Hg(n),t=t.stateNode,Yn&&typeof Yn.onCommitFiberRoot=="function")try{Yn.onCommitFiberRoot(Su,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=me.T,r=je.p,je.p=2,me.T=null;try{for(var a=e.onRecoverableError,s=0;s<i.length;s++){var o=i[s];a(o.value,{componentStack:o.stack})}}finally{me.T=t,je.p=r}}il&3&&mh(),ar(e),r=e.pendingLanes,n&4194090&&r&42?e===x1?uc++:(uc=0,x1=e):uc=0,cc(0)}}function rO(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Vu(t)))}function mh(e){return tO(),nO(),iO(),aO()}function aO(){if(Jt!==5)return!1;var e=Sa,t=y1;y1=0;var n=Hg(il),i=me.T,r=je.p;try{je.p=32>n?32:n,me.T=null,n=v1,v1=null;var a=Sa,s=il;if(Jt=0,nl=Sa=null,il=0,Ve&6)throw Error(q(331));var o=Ve;if(Ve|=4,F6(a.current),z6(a,a.current,s,n),Ve=o,cc(0,!1),Yn&&typeof Yn.onPostCommitFiberRoot=="function")try{Yn.onPostCommitFiberRoot(Su,a)}catch{}return!0}finally{je.p=r,me.T=i,rO(e,t)}}function sO(e,t,n){t=fi(n,t),t=Zb(e.stateNode,t,2),e=ma(e,t,2),e!==null&&(Cu(e,2),ar(e))}function Ke(e,t,n){if(e.tag===3)sO(e,e,n);else for(;t!==null;){if(t.tag===3){sO(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(wa===null||!wa.has(i))){e=fi(n,e),n=c6(2),i=ma(t,n,2),i!==null&&(d6(n,i,t,e),Cu(i,2),ar(i));break}}t=t.return}}function w1(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new vQ;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(p1=!0,r.add(n),e=wQ.bind(null,e,t,n),t.then(e,e))}function wQ(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Le&n)===n&&(vt===4||vt===3&&(Le&62914560)===Le&&300>er()-b1?!(Ve&2)&&rl(e,0):m1|=n,tl===Le&&(tl=0)),ar(e)}function oO(e,t){t===0&&(t=i3()),e=jo(e,t),e!==null&&(Cu(e,t),ar(e))}function SQ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oO(e,n)}function AQ(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(q(314))}i!==null&&i.delete(t),oO(e,n)}function CQ(e,t){return Bg(e,t)}var gh=null,sl=null,S1=!1,bh=!1,A1=!1,xs=0;function ar(e){e!==sl&&e.next===null&&(sl===null?gh=sl=e:sl=sl.next=e),bh=!0,S1||(S1=!0,OQ())}function cc(e,t){if(!A1&&bh){A1=!0;do for(var n=!1,i=gh;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var s=i.suspendedLanes,o=i.pingedLanes;a=(1<<31-qn(42|e)+1)-1,a&=r&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dO(i,a))}else a=Le,a=_f(i,i===et?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(a&3)||Au(i,a)||(n=!0,dO(i,a));i=i.next}while(n);A1=!1}}function kQ(){lO()}function lO(){bh=S1=!1;var e=0;xs!==0&&(BQ()&&(e=xs),xs=0);for(var t=er(),n=null,i=gh;i!==null;){var r=i.next,a=uO(i,t);a===0?(i.next=null,n===null?gh=r:n.next=r,r===null&&(sl=n)):(n=i,(e!==0||a&3)&&(bh=!0)),i=r}cc(e)}function uO(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var s=31-qn(a),o=1<<s,l=r[s];l===-1?(!(o&n)||o&i)&&(r[s]=eK(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}if(t=et,n=Le,n=_f(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Ye===2||Ye===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ug(i),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Au(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&Ug(i),Hg(n)){case 2:case 8:n=e3;break;case 32:n=xf;break;case 268435456:n=t3;break;default:n=xf}return i=cO.bind(null,e),n=Bg(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&Ug(i),e.callbackPriority=2,e.callbackNode=null,2}function cO(e,t){if(Jt!==0&&Jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mh()&&e.callbackNode!==n)return null;var i=Le;return i=_f(e,e===et?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(G6(e,i,t),uO(e,er()),e.callbackNode!=null&&e.callbackNode===n?cO.bind(null,e):null)}function dO(e,t){if(mh())return null;G6(e,t,!0)}function OQ(){zQ(function(){Ve&6?Bg(JC,kQ):lO()})}function C1(){return xs===0&&(xs=n3()),xs}function fO(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:kf(""+e)}function hO(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function NQ(e,t,n,i,r){if(t==="submit"&&n&&n.stateNode===r){var a=fO((r[wn]||null).action),s=i.submitter;s&&(t=(t=s[wn]||null)?fO(t.formAction):s.getAttribute("formAction"),t!==null&&(a=t,s=null));var o=new Df("action","action",null,i,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(xs!==0){var l=s?hO(r,s):new FormData(r);Xb(n,{pending:!0,data:l,method:r.method,action:a},null,l)}}else typeof a=="function"&&(o.preventDefault(),l=s?hO(r,s):new FormData(r),Xb(n,{pending:!0,data:l,method:r.method,action:a},a,l))},currentTarget:r}]})}}for(var k1=0;k1<fb.length;k1++){var O1=fb[k1],RQ=O1.toLowerCase(),DQ=O1[0].toUpperCase()+O1.slice(1);Ni(RQ,"on"+DQ)}Ni(G3,"onAnimationEnd"),Ni(X3,"onAnimationIteration"),Ni($3,"onAnimationStart"),Ni("dblclick","onDoubleClick"),Ni("focusin","onFocus"),Ni("focusout","onBlur"),Ni(KK,"onTransitionRun"),Ni(QK,"onTransitionStart"),Ni(WK,"onTransitionCancel"),Ni(K3,"onTransitionEnd"),No("onMouseEnter",["mouseout","mouseover"]),No("onMouseLeave",["mouseout","mouseover"]),No("onPointerEnter",["pointerout","pointerover"]),No("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),MQ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dc));function pO(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var a=void 0;if(t)for(var s=i.length-1;0<=s;s--){var o=i[s],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=u;try{a(r)}catch(c){rh(c)}r.currentTarget=null,a=l}else for(s=0;s<i.length;s++){if(o=i[s],l=o.instance,u=o.currentTarget,o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=u;try{a(r)}catch(c){rh(c)}r.currentTarget=null,a=l}}}}function De(e,t){var n=t[Fg];n===void 0&&(n=t[Fg]=new Set);var i=e+"__bubble";n.has(i)||(mO(t,e,2,!1),n.add(i))}function N1(e,t,n){var i=0;t&&(i|=4),mO(n,e,i,t)}var yh="_reactListening"+Math.random().toString(36).slice(2);function R1(e){if(!e[yh]){e[yh]=!0,l3.forEach(function(n){n!=="selectionchange"&&(MQ.has(n)||N1(n,!1,e),N1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yh]||(t[yh]=!0,N1("selectionchange",!1,t))}}function mO(e,t,n,i){switch(zO(t)){case 2:var r=sW;break;case 8:r=oW;break;default:r=q1}n=r.bind(null,t,n,e),r=void 0,!Jg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function D1(e,t,n,i,r){var a=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var o=i.stateNode.containerInfo;if(o===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===r)return;s=s.return}for(;o!==null;){if(s=Co(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){i=a=s;continue e}o=o.parentNode}}i=i.return}T3(function(){var u=a,c=Wg(n),d=[];e:{var f=Q3.get(e);if(f!==void 0){var h=Df,g=e;switch(e){case"keypress":if(Nf(n)===0)break e;case"keydown":case"keyup":h=CK;break;case"focusin":g="focus",h=ib;break;case"focusout":g="blur",h=ib;break;case"beforeblur":case"afterblur":h=ib;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=S3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=mK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=NK;break;case G3:case X3:case $3:h=yK;break;case K3:h=DK;break;case"scroll":case"scrollend":h=hK;break;case"wheel":h=LK;break;case"copy":case"cut":case"paste":h=xK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=C3;break;case"toggle":case"beforetoggle":h=PK}var b=(t&4)!==0,E=!b&&(e==="scroll"||e==="scrollend"),m=b?f!==null?f+"Capture":null:f;b=[];for(var y=u,x;y!==null;){var _=y;if(x=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||x===null||m===null||(_=Nu(y,m),_!=null&&b.push(fc(y,_,x))),E)break;y=y.return}0<b.length&&(f=new h(f,g,null,n,c),d.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Qg&&(g=n.relatedTarget||n.fromElement)&&(Co(g)||g[Ao]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Co(g):null,g!==null&&(E=xu(g),b=g.tag,g!==E||b!==5&&b!==27&&b!==6)&&(g=null)):(h=null,g=u),h!==g)){if(b=S3,_="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(b=C3,_="onPointerLeave",m="onPointerEnter",y="pointer"),E=h==null?f:Ou(h),x=g==null?f:Ou(g),f=new b(_,y+"leave",h,n,c),f.target=E,f.relatedTarget=x,_=null,Co(c)===u&&(b=new b(m,y+"enter",g,n,c),b.target=x,b.relatedTarget=E,_=b),E=_,h&&g)t:{for(b=h,m=g,y=0,x=b;x;x=ol(x))y++;for(x=0,_=m;_;_=ol(_))x++;for(;0<y-x;)b=ol(b),y--;for(;0<x-y;)m=ol(m),x--;for(;y--;){if(b===m||m!==null&&b===m.alternate)break t;b=ol(b),m=ol(m)}b=null}else b=null;h!==null&&gO(d,f,h,b,!1),g!==null&&E!==null&&gO(d,E,g,b,!0)}}e:{if(f=u?Ou(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=I3;else if(M3(f))if(P3)S=GK;else{S=YK;var k=VK}else h=f.nodeName,!h||h.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Kg(u.elementType)&&(S=I3):S=qK;if(S&&(S=S(e,u))){L3(d,S,n,c);break e}k&&k(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&$g(f,"number",f.value)}switch(k=u?Ou(u):window,e){case"focusin":(M3(k)||k.contentEditable==="true")&&(Bo=k,ub=u,Uu=null);break;case"focusout":Uu=ub=Bo=null;break;case"mousedown":cb=!0;break;case"contextmenu":case"mouseup":case"dragend":cb=!1,Y3(d,n,c);break;case"selectionchange":if($K)break;case"keydown":case"keyup":Y3(d,n,c)}var D;if(ab)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Po?R3(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(k3&&n.locale!=="ko"&&(Po||L!=="onCompositionStart"?L==="onCompositionEnd"&&Po&&(D=_3()):(da=c,eb="value"in da?da.value:da.textContent,Po=!0)),k=vh(u,L),0<k.length&&(L=new A3(L,e,null,n,c),d.push({event:L,listeners:k}),D?L.data=D:(D=D3(n),D!==null&&(L.data=D)))),(D=UK?zK(e,n):jK(e,n))&&(L=vh(u,"onBeforeInput"),0<L.length&&(k=new A3("onBeforeInput","beforeinput",null,n,c),d.push({event:k,listeners:L}),k.data=D)),NQ(d,e,u,n,c)}pO(d,t)})}function fc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vh(e,t){for(var n=t+"Capture",i=[];e!==null;){var r=e,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=Nu(e,n),r!=null&&i.unshift(fc(e,r,a)),r=Nu(e,t),r!=null&&i.push(fc(e,r,a))),e.tag===3)return i;e=e.return}return[]}function ol(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gO(e,t,n,i,r){for(var a=t._reactName,s=[];n!==null&&n!==i;){var o=n,l=o.alternate,u=o.stateNode;if(o=o.tag,l!==null&&l===i)break;o!==5&&o!==26&&o!==27||u===null||(l=u,r?(u=Nu(n,a),u!=null&&s.unshift(fc(n,u,l))):r||(u=Nu(n,a),u!=null&&s.push(fc(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var LQ=/\r\n?/g,IQ=/\u0000|\uFFFD/g;function bO(e){return(typeof e=="string"?e:""+e).replace(LQ,`
|
|
360
|
-
`).replace(IQ,"")}function yO(e,t){return t=bO(t),bO(e)===t}function xh(){}function Ge(e,t,n,i,r,a){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Mo(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Mo(e,""+i);break;case"className":Sf(e,"class",i);break;case"tabIndex":Sf(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Sf(e,n,i);break;case"style":x3(e,i,a);break;case"data":if(t!=="object"){Sf(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=kf(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&Ge(e,t,"name",r.name,r,null),Ge(e,t,"formEncType",r.formEncType,r,null),Ge(e,t,"formMethod",r.formMethod,r,null),Ge(e,t,"formTarget",r.formTarget,r,null)):(Ge(e,t,"encType",r.encType,r,null),Ge(e,t,"method",r.method,r,null),Ge(e,t,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=kf(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=xh);break;case"onScroll":i!=null&&De("scroll",e);break;case"onScrollEnd":i!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(q(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=kf(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":De("beforetoggle",e),De("toggle",e),wf(e,"popover",i);break;case"xlinkActuate":xr(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":xr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":xr(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":xr(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":xr(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":xr(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":xr(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":xr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":xr(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":wf(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=dK.get(n)||n,wf(e,n,i))}}function M1(e,t,n,i,r,a){switch(n){case"style":x3(e,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(q(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Mo(e,i):(typeof i=="number"||typeof i=="bigint")&&Mo(e,""+i);break;case"onScroll":i!=null&&De("scroll",e);break;case"onScrollEnd":i!=null&&De("scrollend",e);break;case"onClick":i!=null&&(e.onclick=xh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!u3.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),a=e[wn]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,r);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):wf(e,n,i)}}}function en(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:Ge(e,t,a,s,n,null)}}r&&Ge(e,t,"srcSet",n.srcSet,n,null),i&&Ge(e,t,"src",n.src,n,null);return;case"input":De("invalid",e);var o=a=s=r=null,l=null,u=null;for(i in n)if(n.hasOwnProperty(i)){var c=n[i];if(c!=null)switch(i){case"name":r=c;break;case"type":s=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":a=c;break;case"defaultValue":o=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(q(137,t));break;default:Ge(e,t,i,c,n,null)}}g3(e,a,o,l,u,s,r,!1),Af(e);return;case"select":De("invalid",e),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:Ge(e,t,r,o,n,null)}t=a,n=s,e.multiple=!!i,t!=null?Do(e,!!i,t,!1):n!=null&&Do(e,!!i,n,!0);return;case"textarea":De("invalid",e),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":r=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(q(91));break;default:Ge(e,t,s,o,n,null)}y3(e,i,r,a),Af(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(i=n[l],i!=null))switch(l){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ge(e,t,l,i,n,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(i=0;i<dc.length;i++)De(dc[i],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(i=n[u],i!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:Ge(e,t,u,i,n,null)}return;default:if(Kg(t)){for(c in n)n.hasOwnProperty(c)&&(i=n[c],i!==void 0&&M1(e,t,c,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&Ge(e,t,o,i,n,null))}function PQ(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,s=null,o=null,l=null,u=null,c=null;for(h in n){var d=n[h];if(n.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(h)||Ge(e,t,h,null,i,d)}}for(var f in i){var h=i[f];if(d=n[f],i.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":a=h;break;case"name":r=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(q(137,t));break;default:h!==d&&Ge(e,t,f,h,i,d)}}Xg(e,s,o,l,u,c,a,r);return;case"select":h=s=o=f=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:i.hasOwnProperty(a)||Ge(e,t,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":f=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&Ge(e,t,r,a,i,l)}t=o,n=s,i=h,f!=null?Do(e,!!n,f,!1):!!i!=!!n&&(t!=null?Do(e,!!n,t,!0):Do(e,!!n,n?[]:"",!1));return;case"textarea":h=f=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Ge(e,t,o,null,i,r)}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case"value":f=r;break;case"defaultValue":h=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(q(91));break;default:r!==a&&Ge(e,t,s,r,i,a)}b3(e,f,h);return;case"option":for(var g in n)if(f=n[g],n.hasOwnProperty(g)&&f!=null&&!i.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:Ge(e,t,g,null,i,f)}for(l in i)if(f=i[l],h=n[l],i.hasOwnProperty(l)&&f!==h&&(f!=null||h!=null))switch(l){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Ge(e,t,l,f,i,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)f=n[b],n.hasOwnProperty(b)&&f!=null&&!i.hasOwnProperty(b)&&Ge(e,t,b,null,i,f);for(u in i)if(f=i[u],h=n[u],i.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(q(137,t));break;default:Ge(e,t,u,f,i,h)}return;default:if(Kg(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&f!==void 0&&!i.hasOwnProperty(E)&&M1(e,t,E,void 0,i,f);for(c in i)f=i[c],h=n[c],!i.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||M1(e,t,c,f,i,h);return}}for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!=null&&!i.hasOwnProperty(m)&&Ge(e,t,m,null,i,f);for(d in i)f=i[d],h=n[d],!i.hasOwnProperty(d)||f===h||f==null&&h==null||Ge(e,t,d,f,i,h)}var L1=null,I1=null;function Eh(e){return e.nodeType===9?e:e.ownerDocument}function vO(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xO(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function P1(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var B1=null;function BQ(){var e=window.event;return e&&e.type==="popstate"?e===B1?!1:(B1=e,!0):(B1=null,!1)}var EO=typeof setTimeout=="function"?setTimeout:void 0,UQ=typeof clearTimeout=="function"?clearTimeout:void 0,TO=typeof Promise=="function"?Promise:void 0,zQ=typeof queueMicrotask=="function"?queueMicrotask:typeof TO<"u"?function(e){return TO.resolve(null).then(e).catch(jQ)}:EO;function jQ(e){setTimeout(function(){throw e})}function Ca(e){return e==="head"}function _O(e,t){var n=t,i=0,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<i&&8>i){n=i;var s=e.ownerDocument;if(n&1&&hc(s.documentElement),n&2&&hc(s.body),n&4)for(n=s.head,hc(n),s=n.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[ku]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=o}}if(r===0){e.removeChild(a),Ec(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);Ec(t)}function U1(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":U1(n),Vg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function HQ(e,t,n,i){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ku])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Di(e.nextSibling),e===null)break}return null}function FQ(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Di(e.nextSibling),e===null))return null;return e}function z1(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function VQ(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Di(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var j1=null;function wO(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function SO(e,t,n){switch(t=Eh(n),e){case"html":if(e=t.documentElement,!e)throw Error(q(452));return e;case"head":if(e=t.head,!e)throw Error(q(453));return e;case"body":if(e=t.body,!e)throw Error(q(454));return e;default:throw Error(q(451))}}function hc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vg(e)}var yi=new Map,AO=new Set;function Th(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Lr=je.d;je.d={f:YQ,r:qQ,D:GQ,C:XQ,L:$Q,m:KQ,X:WQ,S:QQ,M:ZQ};function YQ(){var e=Lr.f(),t=hh();return e||t}function qQ(e){var t=ko(e);t!==null&&t.tag===5&&t.type==="form"?Gk(t):Lr.r(e)}var ll=typeof document>"u"?null:document;function CO(e,t,n){var i=ll;if(i&&typeof t=="string"&&t){var r=di(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),AO.has(r)||(AO.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),en(t,"link",e),Yt(t),i.head.appendChild(t)))}}function GQ(e){Lr.D(e),CO("dns-prefetch",e,null)}function XQ(e,t){Lr.C(e,t),CO("preconnect",e,t)}function $Q(e,t,n){Lr.L(e,t,n);var i=ll;if(i&&e&&t){var r='link[rel="preload"][as="'+di(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+di(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+di(n.imageSizes)+'"]')):r+='[href="'+di(e)+'"]';var a=r;switch(t){case"style":a=ul(e);break;case"script":a=cl(e)}yi.has(a)||(e=st({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),yi.set(a,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(pc(a))||t==="script"&&i.querySelector(mc(a))||(t=i.createElement("link"),en(t,"link",e),Yt(t),i.head.appendChild(t)))}}function KQ(e,t){Lr.m(e,t);var n=ll;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+di(i)+'"][href="'+di(e)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=cl(e)}if(!yi.has(a)&&(e=st({rel:"modulepreload",href:e},t),yi.set(a,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(mc(a)))return}i=n.createElement("link"),en(i,"link",e),Yt(i),n.head.appendChild(i)}}}function QQ(e,t,n){Lr.S(e,t,n);var i=ll;if(i&&e){var r=Oo(i).hoistableStyles,a=ul(e);t=t||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(pc(a)))o.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},n),(n=yi.get(a))&&H1(e,n);var l=s=i.createElement("link");Yt(l),en(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,_h(s,t,i)}s={type:"stylesheet",instance:s,count:1,state:o},r.set(a,s)}}}function WQ(e,t){Lr.X(e,t);var n=ll;if(n&&e){var i=Oo(n).hoistableScripts,r=cl(e),a=i.get(r);a||(a=n.querySelector(mc(r)),a||(e=st({src:e,async:!0},t),(t=yi.get(r))&&F1(e,t),a=n.createElement("script"),Yt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function ZQ(e,t){Lr.M(e,t);var n=ll;if(n&&e){var i=Oo(n).hoistableScripts,r=cl(e),a=i.get(r);a||(a=n.querySelector(mc(r)),a||(e=st({src:e,async:!0,type:"module"},t),(t=yi.get(r))&&F1(e,t),a=n.createElement("script"),Yt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function kO(e,t,n,i){var r=(r=la.current)?Th(r):null;if(!r)throw Error(q(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ul(n.href),n=Oo(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ul(n.href);var a=Oo(r).hoistableStyles,s=a.get(e);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=r.querySelector(pc(e)))&&!a._p&&(s.instance=a,s.state.loading=5),yi.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yi.set(e,n),a||JQ(r,e,n,s.state))),t&&i===null)throw Error(q(528,""));return s}if(t&&i!==null)throw Error(q(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=cl(n),n=Oo(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(q(444,e))}}function ul(e){return'href="'+di(e)+'"'}function pc(e){return'link[rel="stylesheet"]['+e+"]"}function OO(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function JQ(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),en(t,"link",n),Yt(t),e.head.appendChild(t))}function cl(e){return'[src="'+di(e)+'"]'}function mc(e){return"script[async]"+e}function NO(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+di(n.href)+'"]');if(i)return t.instance=i,Yt(i),i;var r=st({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Yt(i),en(i,"style",r),_h(i,n.precedence,e),t.instance=i;case"stylesheet":r=ul(n.href);var a=e.querySelector(pc(r));if(a)return t.state.loading|=4,t.instance=a,Yt(a),a;i=OO(n),(r=yi.get(r))&&H1(i,r),a=(e.ownerDocument||e).createElement("link"),Yt(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),en(a,"link",i),t.state.loading|=4,_h(a,n.precedence,e),t.instance=a;case"script":return a=cl(n.src),(r=e.querySelector(mc(a)))?(t.instance=r,Yt(r),r):(i=n,(r=yi.get(a))&&(i=st({},n),F1(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Yt(r),en(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(q(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,_h(i,n.precedence,e));return t.instance}function _h(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var o=i[s];if(o.dataset.precedence===t)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function H1(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function F1(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wh=null;function RO(e,t,n){if(wh===null){var i=new Map,r=wh=new Map;r.set(n,i)}else r=wh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[ku]||a[un]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(t)||"";s=e+s;var o=i.get(s);o?o.push(a):i.set(s,[a])}}return i}function DO(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function eW(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function MO(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var gc=null;function tW(){}function nW(e,t,n){if(gc===null)throw Error(q(475));var i=gc;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=ul(n.href),a=e.querySelector(pc(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Sh.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=a,Yt(a);return}a=e.ownerDocument||e,n=OO(n),(r=yi.get(r))&&H1(n,r),a=a.createElement("link"),Yt(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),en(a,"link",n),t.instance=a}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(i.count++,t=Sh.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function iW(){if(gc===null)throw Error(q(475));var e=gc;return e.stylesheets&&e.count===0&&V1(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&V1(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Sh(){if(this.count--,this.count===0){if(this.stylesheets)V1(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ah=null;function V1(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ah=new Map,t.forEach(rW,e),Ah=null,Sh.call(e))}function rW(e,t){if(!(t.state.loading&4)){var n=Ah.get(e);if(n)var i=n.get(null);else{n=new Map,Ah.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}r=t.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=Sh.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var bc={$$typeof:vr,Provider:null,Consumer:null,_currentValue:ns,_currentValue2:ns,_threadCount:0};function aW(e,t,n,i,r,a,s,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zg(0),this.hiddenUpdates=zg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function LO(e,t,n,i,r,a,s,o,l,u,c,d){return e=new aW(e,t,n,s,o,l,u,d),t=1,a===!0&&(t|=24),a=Xn(3,null,null,t),e.current=a,a.stateNode=e,t=wb(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:t},kb(a),e}function IO(e){return e?(e=Ho,e):Ho}function PO(e,t,n,i,r,a){r=IO(r),i.context===null?i.context=r:i.pendingContext=r,i=pa(t),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=ma(e,i,t),n!==null&&(Zn(n,e,t),Xu(n,e,t))}function BO(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Y1(e,t){BO(e,t),(e=e.alternate)&&BO(e,t)}function UO(e){if(e.tag===13){var t=jo(e,67108864);t!==null&&Zn(t,e,67108864),Y1(e,67108864)}}var Ch=!0;function sW(e,t,n,i){var r=me.T;me.T=null;var a=je.p;try{je.p=2,q1(e,t,n,i)}finally{je.p=a,me.T=r}}function oW(e,t,n,i){var r=me.T;me.T=null;var a=je.p;try{je.p=8,q1(e,t,n,i)}finally{je.p=a,me.T=r}}function q1(e,t,n,i){if(Ch){var r=G1(i);if(r===null)D1(e,t,i,kh,n),jO(e,i);else if(uW(r,e,t,n,i))i.stopPropagation();else if(jO(e,i),t&4&&-1<lW.indexOf(e)){for(;r!==null;){var a=ko(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=is(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-qn(s);o.entanglements[1]|=l,s&=~l}ar(a),!(Ve&6)&&(dh=er()+500,cc(0))}}break;case 13:o=jo(a,2),o!==null&&Zn(o,a,2),hh(),Y1(a,2)}if(a=G1(i),a===null&&D1(e,t,i,kh,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else D1(e,t,i,null,n)}}function G1(e){return e=Wg(e),X1(e)}var kh=null;function X1(e){if(kh=null,e=Co(e),e!==null){var t=xu(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=XC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return kh=e,null}function zO(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(X$()){case JC:return 2;case e3:return 8;case xf:case $$:return 32;case t3:return 268435456;default:return 32}default:return 32}}var $1=!1,ka=null,Oa=null,Na=null,yc=new Map,vc=new Map,Ra=[],lW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function jO(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":yc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(t.pointerId)}}function xc(e,t,n,i,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},t!==null&&(t=ko(t),t!==null&&UO(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function uW(e,t,n,i,r){switch(t){case"focusin":return ka=xc(ka,e,t,n,i,r),!0;case"dragenter":return Oa=xc(Oa,e,t,n,i,r),!0;case"mouseover":return Na=xc(Na,e,t,n,i,r),!0;case"pointerover":var a=r.pointerId;return yc.set(a,xc(yc.get(a)||null,e,t,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,vc.set(a,xc(vc.get(a)||null,e,t,n,i,r)),!0}return!1}function HO(e){var t=Co(e.target);if(t!==null){var n=xu(t);if(n!==null){if(t=n.tag,t===13){if(t=XC(n),t!==null){e.blockedOn=t,nK(e.priority,function(){if(n.tag===13){var i=Wn();i=jg(i);var r=jo(n,i);r!==null&&Zn(r,n,i),Y1(n,i)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=G1(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Qg=i,n.target.dispatchEvent(i),Qg=null}else return t=ko(n),t!==null&&UO(t),e.blockedOn=n,!1;t.shift()}return!0}function FO(e,t,n){Oh(e)&&n.delete(t)}function cW(){$1=!1,ka!==null&&Oh(ka)&&(ka=null),Oa!==null&&Oh(Oa)&&(Oa=null),Na!==null&&Oh(Na)&&(Na=null),yc.forEach(FO),vc.forEach(FO)}function Nh(e,t){e.blockedOn===t&&(e.blockedOn=null,$1||($1=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,cW)))}var Rh=null;function VO(e){Rh!==e&&(Rh=e,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,function(){Rh===e&&(Rh=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if(typeof i!="function"){if(X1(i||n)===null)continue;break}var a=ko(n);a!==null&&(e.splice(t,3),t-=3,Xb(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Ec(e){function t(l){return Nh(l,e)}ka!==null&&Nh(ka,e),Oa!==null&&Nh(Oa,e),Na!==null&&Nh(Na,e),yc.forEach(t),vc.forEach(t);for(var n=0;n<Ra.length;n++){var i=Ra[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ra.length&&(n=Ra[0],n.blockedOn===null);)HO(n),n.blockedOn===null&&Ra.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[wn]||null;if(typeof a=="function")s||VO(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[wn]||null)o=s.formAction;else if(X1(r)!==null)continue}else o=s.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),VO(n)}}}function K1(e){this._internalRoot=e}Dh.prototype.render=K1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));var n=t.current,i=Wn();PO(n,i,e,t,null,null)},Dh.prototype.unmount=K1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;PO(e.current,2,null,e,null,null),hh(),t[Ao]=null}};function Dh(e){this._internalRoot=e}Dh.prototype.unstable_scheduleHydration=function(e){if(e){var t=s3();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ra.length&&t!==0&&t<Ra[n].priority;n++);Ra.splice(n,0,e),n===0&&HO(e)}};var YO=qC.version;if(YO!=="19.1.1")throw Error(q(527,YO,"19.1.1"));je.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=j$(t),e=e!==null?KC(e):null,e=e===null?null:e.stateNode,e};var dW={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mh.isDisabled&&Mh.supportsFiber)try{Su=Mh.inject(dW),Yn=Mh}catch{}}mf.createRoot=function(e,t){if(!GC(e))throw Error(q(299));var n=!1,i="",r=s6,a=o6,s=l6,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=LO(e,1,!1,null,null,n,i,r,a,s,o,null),e[Ao]=t.current,R1(e),new K1(t)},mf.hydrateRoot=function(e,t,n){if(!GC(e))throw Error(q(299));var i=!1,r="",a=s6,s=o6,o=l6,l=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=LO(e,1,!0,t,n??null,i,r,a,s,o,l,u),t.context=IO(null),n=t.current,i=Wn(),i=jg(i),r=pa(i),r.callback=null,ma(n,r,i),n=i,t.current.lanes=n,Cu(t,n),ar(t),e[Ao]=t.current,R1(e),new Dh(t)},mf.version="19.1.1";function qO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qO)}catch(e){console.error(e)}}qO(),FC.exports=mf;var fW=FC.exports;const hW="4.0.28",pW="opencx-root";function mW(e){gW(pW,v.jsx(B$,{options:e}))}window.initOpenScript=mW,window.openCXWidgetVersion=hW;function gW(e,t){let n=document.getElementById(e);return n||(n=document.createElement("div"),n.id=e,document.body.appendChild(n)),fW.createRoot(n).render(t)}})();
|
|
360
|
+
`).replace(IQ,"")}function yO(e,t){return t=bO(t),bO(e)===t}function xh(){}function Ge(e,t,n,i,r,a){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Mo(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Mo(e,""+i);break;case"className":Sf(e,"class",i);break;case"tabIndex":Sf(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Sf(e,n,i);break;case"style":x3(e,i,a);break;case"data":if(t!=="object"){Sf(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=kf(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&Ge(e,t,"name",r.name,r,null),Ge(e,t,"formEncType",r.formEncType,r,null),Ge(e,t,"formMethod",r.formMethod,r,null),Ge(e,t,"formTarget",r.formTarget,r,null)):(Ge(e,t,"encType",r.encType,r,null),Ge(e,t,"method",r.method,r,null),Ge(e,t,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=kf(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=xh);break;case"onScroll":i!=null&&De("scroll",e);break;case"onScrollEnd":i!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(q(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=kf(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":De("beforetoggle",e),De("toggle",e),wf(e,"popover",i);break;case"xlinkActuate":xr(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":xr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":xr(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":xr(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":xr(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":xr(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":xr(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":xr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":xr(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":wf(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=dK.get(n)||n,wf(e,n,i))}}function M1(e,t,n,i,r,a){switch(n){case"style":x3(e,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(q(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Mo(e,i):(typeof i=="number"||typeof i=="bigint")&&Mo(e,""+i);break;case"onScroll":i!=null&&De("scroll",e);break;case"onScrollEnd":i!=null&&De("scrollend",e);break;case"onClick":i!=null&&(e.onclick=xh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!u3.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),a=e[wn]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,r);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):wf(e,n,i)}}}function en(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:Ge(e,t,a,s,n,null)}}r&&Ge(e,t,"srcSet",n.srcSet,n,null),i&&Ge(e,t,"src",n.src,n,null);return;case"input":De("invalid",e);var o=a=s=r=null,l=null,u=null;for(i in n)if(n.hasOwnProperty(i)){var c=n[i];if(c!=null)switch(i){case"name":r=c;break;case"type":s=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":a=c;break;case"defaultValue":o=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(q(137,t));break;default:Ge(e,t,i,c,n,null)}}g3(e,a,o,l,u,s,r,!1),Af(e);return;case"select":De("invalid",e),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:Ge(e,t,r,o,n,null)}t=a,n=s,e.multiple=!!i,t!=null?Do(e,!!i,t,!1):n!=null&&Do(e,!!i,n,!0);return;case"textarea":De("invalid",e),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":r=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(q(91));break;default:Ge(e,t,s,o,n,null)}y3(e,i,r,a),Af(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(i=n[l],i!=null))switch(l){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ge(e,t,l,i,n,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(i=0;i<dc.length;i++)De(dc[i],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(i=n[u],i!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:Ge(e,t,u,i,n,null)}return;default:if(Kg(t)){for(c in n)n.hasOwnProperty(c)&&(i=n[c],i!==void 0&&M1(e,t,c,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&Ge(e,t,o,i,n,null))}function PQ(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,s=null,o=null,l=null,u=null,c=null;for(h in n){var d=n[h];if(n.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(h)||Ge(e,t,h,null,i,d)}}for(var f in i){var h=i[f];if(d=n[f],i.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":a=h;break;case"name":r=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(q(137,t));break;default:h!==d&&Ge(e,t,f,h,i,d)}}Xg(e,s,o,l,u,c,a,r);return;case"select":h=s=o=f=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:i.hasOwnProperty(a)||Ge(e,t,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":f=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&Ge(e,t,r,a,i,l)}t=o,n=s,i=h,f!=null?Do(e,!!n,f,!1):!!i!=!!n&&(t!=null?Do(e,!!n,t,!0):Do(e,!!n,n?[]:"",!1));return;case"textarea":h=f=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Ge(e,t,o,null,i,r)}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case"value":f=r;break;case"defaultValue":h=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(q(91));break;default:r!==a&&Ge(e,t,s,r,i,a)}b3(e,f,h);return;case"option":for(var g in n)if(f=n[g],n.hasOwnProperty(g)&&f!=null&&!i.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:Ge(e,t,g,null,i,f)}for(l in i)if(f=i[l],h=n[l],i.hasOwnProperty(l)&&f!==h&&(f!=null||h!=null))switch(l){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Ge(e,t,l,f,i,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)f=n[b],n.hasOwnProperty(b)&&f!=null&&!i.hasOwnProperty(b)&&Ge(e,t,b,null,i,f);for(u in i)if(f=i[u],h=n[u],i.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(q(137,t));break;default:Ge(e,t,u,f,i,h)}return;default:if(Kg(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&f!==void 0&&!i.hasOwnProperty(E)&&M1(e,t,E,void 0,i,f);for(c in i)f=i[c],h=n[c],!i.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||M1(e,t,c,f,i,h);return}}for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!=null&&!i.hasOwnProperty(m)&&Ge(e,t,m,null,i,f);for(d in i)f=i[d],h=n[d],!i.hasOwnProperty(d)||f===h||f==null&&h==null||Ge(e,t,d,f,i,h)}var L1=null,I1=null;function Eh(e){return e.nodeType===9?e:e.ownerDocument}function vO(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xO(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function P1(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var B1=null;function BQ(){var e=window.event;return e&&e.type==="popstate"?e===B1?!1:(B1=e,!0):(B1=null,!1)}var EO=typeof setTimeout=="function"?setTimeout:void 0,UQ=typeof clearTimeout=="function"?clearTimeout:void 0,TO=typeof Promise=="function"?Promise:void 0,zQ=typeof queueMicrotask=="function"?queueMicrotask:typeof TO<"u"?function(e){return TO.resolve(null).then(e).catch(jQ)}:EO;function jQ(e){setTimeout(function(){throw e})}function Ca(e){return e==="head"}function _O(e,t){var n=t,i=0,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<i&&8>i){n=i;var s=e.ownerDocument;if(n&1&&hc(s.documentElement),n&2&&hc(s.body),n&4)for(n=s.head,hc(n),s=n.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[ku]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=o}}if(r===0){e.removeChild(a),Ec(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);Ec(t)}function U1(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":U1(n),Vg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function HQ(e,t,n,i){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ku])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Di(e.nextSibling),e===null)break}return null}function FQ(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Di(e.nextSibling),e===null))return null;return e}function z1(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function VQ(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Di(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var j1=null;function wO(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function SO(e,t,n){switch(t=Eh(n),e){case"html":if(e=t.documentElement,!e)throw Error(q(452));return e;case"head":if(e=t.head,!e)throw Error(q(453));return e;case"body":if(e=t.body,!e)throw Error(q(454));return e;default:throw Error(q(451))}}function hc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vg(e)}var yi=new Map,AO=new Set;function Th(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Lr=je.d;je.d={f:YQ,r:qQ,D:GQ,C:XQ,L:$Q,m:KQ,X:WQ,S:QQ,M:ZQ};function YQ(){var e=Lr.f(),t=hh();return e||t}function qQ(e){var t=ko(e);t!==null&&t.tag===5&&t.type==="form"?Gk(t):Lr.r(e)}var ll=typeof document>"u"?null:document;function CO(e,t,n){var i=ll;if(i&&typeof t=="string"&&t){var r=di(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),AO.has(r)||(AO.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),en(t,"link",e),Yt(t),i.head.appendChild(t)))}}function GQ(e){Lr.D(e),CO("dns-prefetch",e,null)}function XQ(e,t){Lr.C(e,t),CO("preconnect",e,t)}function $Q(e,t,n){Lr.L(e,t,n);var i=ll;if(i&&e&&t){var r='link[rel="preload"][as="'+di(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+di(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+di(n.imageSizes)+'"]')):r+='[href="'+di(e)+'"]';var a=r;switch(t){case"style":a=ul(e);break;case"script":a=cl(e)}yi.has(a)||(e=st({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),yi.set(a,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(pc(a))||t==="script"&&i.querySelector(mc(a))||(t=i.createElement("link"),en(t,"link",e),Yt(t),i.head.appendChild(t)))}}function KQ(e,t){Lr.m(e,t);var n=ll;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+di(i)+'"][href="'+di(e)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=cl(e)}if(!yi.has(a)&&(e=st({rel:"modulepreload",href:e},t),yi.set(a,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(mc(a)))return}i=n.createElement("link"),en(i,"link",e),Yt(i),n.head.appendChild(i)}}}function QQ(e,t,n){Lr.S(e,t,n);var i=ll;if(i&&e){var r=Oo(i).hoistableStyles,a=ul(e);t=t||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(pc(a)))o.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},n),(n=yi.get(a))&&H1(e,n);var l=s=i.createElement("link");Yt(l),en(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,_h(s,t,i)}s={type:"stylesheet",instance:s,count:1,state:o},r.set(a,s)}}}function WQ(e,t){Lr.X(e,t);var n=ll;if(n&&e){var i=Oo(n).hoistableScripts,r=cl(e),a=i.get(r);a||(a=n.querySelector(mc(r)),a||(e=st({src:e,async:!0},t),(t=yi.get(r))&&F1(e,t),a=n.createElement("script"),Yt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function ZQ(e,t){Lr.M(e,t);var n=ll;if(n&&e){var i=Oo(n).hoistableScripts,r=cl(e),a=i.get(r);a||(a=n.querySelector(mc(r)),a||(e=st({src:e,async:!0,type:"module"},t),(t=yi.get(r))&&F1(e,t),a=n.createElement("script"),Yt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function kO(e,t,n,i){var r=(r=la.current)?Th(r):null;if(!r)throw Error(q(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ul(n.href),n=Oo(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ul(n.href);var a=Oo(r).hoistableStyles,s=a.get(e);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=r.querySelector(pc(e)))&&!a._p&&(s.instance=a,s.state.loading=5),yi.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yi.set(e,n),a||JQ(r,e,n,s.state))),t&&i===null)throw Error(q(528,""));return s}if(t&&i!==null)throw Error(q(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=cl(n),n=Oo(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(q(444,e))}}function ul(e){return'href="'+di(e)+'"'}function pc(e){return'link[rel="stylesheet"]['+e+"]"}function OO(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function JQ(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),en(t,"link",n),Yt(t),e.head.appendChild(t))}function cl(e){return'[src="'+di(e)+'"]'}function mc(e){return"script[async]"+e}function NO(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+di(n.href)+'"]');if(i)return t.instance=i,Yt(i),i;var r=st({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Yt(i),en(i,"style",r),_h(i,n.precedence,e),t.instance=i;case"stylesheet":r=ul(n.href);var a=e.querySelector(pc(r));if(a)return t.state.loading|=4,t.instance=a,Yt(a),a;i=OO(n),(r=yi.get(r))&&H1(i,r),a=(e.ownerDocument||e).createElement("link"),Yt(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),en(a,"link",i),t.state.loading|=4,_h(a,n.precedence,e),t.instance=a;case"script":return a=cl(n.src),(r=e.querySelector(mc(a)))?(t.instance=r,Yt(r),r):(i=n,(r=yi.get(a))&&(i=st({},n),F1(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Yt(r),en(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(q(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,_h(i,n.precedence,e));return t.instance}function _h(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var o=i[s];if(o.dataset.precedence===t)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function H1(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function F1(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wh=null;function RO(e,t,n){if(wh===null){var i=new Map,r=wh=new Map;r.set(n,i)}else r=wh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[ku]||a[un]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(t)||"";s=e+s;var o=i.get(s);o?o.push(a):i.set(s,[a])}}return i}function DO(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function eW(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function MO(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var gc=null;function tW(){}function nW(e,t,n){if(gc===null)throw Error(q(475));var i=gc;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=ul(n.href),a=e.querySelector(pc(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Sh.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=a,Yt(a);return}a=e.ownerDocument||e,n=OO(n),(r=yi.get(r))&&H1(n,r),a=a.createElement("link"),Yt(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),en(a,"link",n),t.instance=a}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(i.count++,t=Sh.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function iW(){if(gc===null)throw Error(q(475));var e=gc;return e.stylesheets&&e.count===0&&V1(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&V1(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Sh(){if(this.count--,this.count===0){if(this.stylesheets)V1(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ah=null;function V1(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ah=new Map,t.forEach(rW,e),Ah=null,Sh.call(e))}function rW(e,t){if(!(t.state.loading&4)){var n=Ah.get(e);if(n)var i=n.get(null);else{n=new Map,Ah.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}r=t.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=Sh.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var bc={$$typeof:vr,Provider:null,Consumer:null,_currentValue:ns,_currentValue2:ns,_threadCount:0};function aW(e,t,n,i,r,a,s,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zg(0),this.hiddenUpdates=zg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function LO(e,t,n,i,r,a,s,o,l,u,c,d){return e=new aW(e,t,n,s,o,l,u,d),t=1,a===!0&&(t|=24),a=Xn(3,null,null,t),e.current=a,a.stateNode=e,t=wb(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:t},kb(a),e}function IO(e){return e?(e=Ho,e):Ho}function PO(e,t,n,i,r,a){r=IO(r),i.context===null?i.context=r:i.pendingContext=r,i=pa(t),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=ma(e,i,t),n!==null&&(Zn(n,e,t),Xu(n,e,t))}function BO(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Y1(e,t){BO(e,t),(e=e.alternate)&&BO(e,t)}function UO(e){if(e.tag===13){var t=jo(e,67108864);t!==null&&Zn(t,e,67108864),Y1(e,67108864)}}var Ch=!0;function sW(e,t,n,i){var r=me.T;me.T=null;var a=je.p;try{je.p=2,q1(e,t,n,i)}finally{je.p=a,me.T=r}}function oW(e,t,n,i){var r=me.T;me.T=null;var a=je.p;try{je.p=8,q1(e,t,n,i)}finally{je.p=a,me.T=r}}function q1(e,t,n,i){if(Ch){var r=G1(i);if(r===null)D1(e,t,i,kh,n),jO(e,i);else if(uW(r,e,t,n,i))i.stopPropagation();else if(jO(e,i),t&4&&-1<lW.indexOf(e)){for(;r!==null;){var a=ko(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=is(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-qn(s);o.entanglements[1]|=l,s&=~l}ar(a),!(Ve&6)&&(dh=er()+500,cc(0))}}break;case 13:o=jo(a,2),o!==null&&Zn(o,a,2),hh(),Y1(a,2)}if(a=G1(i),a===null&&D1(e,t,i,kh,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else D1(e,t,i,null,n)}}function G1(e){return e=Wg(e),X1(e)}var kh=null;function X1(e){if(kh=null,e=Co(e),e!==null){var t=xu(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=XC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return kh=e,null}function zO(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(X$()){case JC:return 2;case e3:return 8;case xf:case $$:return 32;case t3:return 268435456;default:return 32}default:return 32}}var $1=!1,ka=null,Oa=null,Na=null,yc=new Map,vc=new Map,Ra=[],lW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function jO(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":yc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(t.pointerId)}}function xc(e,t,n,i,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},t!==null&&(t=ko(t),t!==null&&UO(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function uW(e,t,n,i,r){switch(t){case"focusin":return ka=xc(ka,e,t,n,i,r),!0;case"dragenter":return Oa=xc(Oa,e,t,n,i,r),!0;case"mouseover":return Na=xc(Na,e,t,n,i,r),!0;case"pointerover":var a=r.pointerId;return yc.set(a,xc(yc.get(a)||null,e,t,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,vc.set(a,xc(vc.get(a)||null,e,t,n,i,r)),!0}return!1}function HO(e){var t=Co(e.target);if(t!==null){var n=xu(t);if(n!==null){if(t=n.tag,t===13){if(t=XC(n),t!==null){e.blockedOn=t,nK(e.priority,function(){if(n.tag===13){var i=Wn();i=jg(i);var r=jo(n,i);r!==null&&Zn(r,n,i),Y1(n,i)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=G1(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Qg=i,n.target.dispatchEvent(i),Qg=null}else return t=ko(n),t!==null&&UO(t),e.blockedOn=n,!1;t.shift()}return!0}function FO(e,t,n){Oh(e)&&n.delete(t)}function cW(){$1=!1,ka!==null&&Oh(ka)&&(ka=null),Oa!==null&&Oh(Oa)&&(Oa=null),Na!==null&&Oh(Na)&&(Na=null),yc.forEach(FO),vc.forEach(FO)}function Nh(e,t){e.blockedOn===t&&(e.blockedOn=null,$1||($1=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,cW)))}var Rh=null;function VO(e){Rh!==e&&(Rh=e,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,function(){Rh===e&&(Rh=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if(typeof i!="function"){if(X1(i||n)===null)continue;break}var a=ko(n);a!==null&&(e.splice(t,3),t-=3,Xb(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Ec(e){function t(l){return Nh(l,e)}ka!==null&&Nh(ka,e),Oa!==null&&Nh(Oa,e),Na!==null&&Nh(Na,e),yc.forEach(t),vc.forEach(t);for(var n=0;n<Ra.length;n++){var i=Ra[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ra.length&&(n=Ra[0],n.blockedOn===null);)HO(n),n.blockedOn===null&&Ra.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[wn]||null;if(typeof a=="function")s||VO(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[wn]||null)o=s.formAction;else if(X1(r)!==null)continue}else o=s.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),VO(n)}}}function K1(e){this._internalRoot=e}Dh.prototype.render=K1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));var n=t.current,i=Wn();PO(n,i,e,t,null,null)},Dh.prototype.unmount=K1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;PO(e.current,2,null,e,null,null),hh(),t[Ao]=null}};function Dh(e){this._internalRoot=e}Dh.prototype.unstable_scheduleHydration=function(e){if(e){var t=s3();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ra.length&&t!==0&&t<Ra[n].priority;n++);Ra.splice(n,0,e),n===0&&HO(e)}};var YO=qC.version;if(YO!=="19.1.1")throw Error(q(527,YO,"19.1.1"));je.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=j$(t),e=e!==null?KC(e):null,e=e===null?null:e.stateNode,e};var dW={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mh.isDisabled&&Mh.supportsFiber)try{Su=Mh.inject(dW),Yn=Mh}catch{}}mf.createRoot=function(e,t){if(!GC(e))throw Error(q(299));var n=!1,i="",r=s6,a=o6,s=l6,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=LO(e,1,!1,null,null,n,i,r,a,s,o,null),e[Ao]=t.current,R1(e),new K1(t)},mf.hydrateRoot=function(e,t,n){if(!GC(e))throw Error(q(299));var i=!1,r="",a=s6,s=o6,o=l6,l=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=LO(e,1,!0,t,n??null,i,r,a,s,o,l,u),t.context=IO(null),n=t.current,i=Wn(),i=jg(i),r=pa(i),r.callback=null,ma(n,r,i),n=i,t.current.lanes=n,Cu(t,n),ar(t),e[Ao]=t.current,R1(e),new Dh(t)},mf.version="19.1.1";function qO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qO)}catch(e){console.error(e)}}qO(),FC.exports=mf;var fW=FC.exports;const hW="4.0.29",pW="opencx-root";function mW(e){gW(pW,v.jsx(B$,{options:e}))}window.initOpenScript=mW,window.openCXWidgetVersion=hW;function gW(e,t){let n=document.getElementById(e);return n||(n=document.createElement("div"),n.id=e,document.body.appendChild(n)),fW.createRoot(n).render(t)}})();
|
|
361
361
|
//# sourceMappingURL=script.js.map
|