(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();function nm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xd={exports:{}},Js={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var sb;function n_(){if(sb)return Js;sb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(a,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:e,type:a,key:c,ref:o!==void 0?o:null,props:u}}return Js.Fragment=t,Js.jsx=i,Js.jsxs=i,Js}var ob;function i_(){return ob||(ob=1,xd.exports=n_()),xd.exports}var S=i_(),wd={exports:{}},Ee={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lb;function r_(){if(lb)return Ee;lb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,R={};function C(k,q,E){this.props=k,this.context=q,this.refs=R,this.updater=E||A}C.prototype.isReactComponent={},C.prototype.setState=function(k,q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,q,"setState")},C.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function B(){}B.prototype=C.prototype;function D(k,q,E){this.props=k,this.context=q,this.refs=R,this.updater=E||A}var H=D.prototype=new B;H.constructor=D,M(H,C.prototype),H.isPureReactComponent=!0;var X=Array.isArray;function j(){}var te={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function ee(k,q,E){var le=E.ref;return{$$typeof:e,type:k,key:q,ref:le!==void 0?le:null,props:E}}function ne(k,q){return ee(k.type,q,k.props)}function J(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function W(k){var q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(E){return q[E]})}var ye=/\/+/g;function ie(k,q){return typeof k=="object"&&k!==null&&k.key!=null?W(""+k.key):q.toString(36)}function K(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(j,j):(k.status="pending",k.then(function(q){k.status==="pending"&&(k.status="fulfilled",k.value=q)},function(q){k.status==="pending"&&(k.status="rejected",k.reason=q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function O(k,q,E,le,fe){var ue=typeof k;(ue==="undefined"||ue==="boolean")&&(k=null);var Ae=!1;if(k===null)Ae=!0;else switch(ue){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(k.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=k._init,O(Ae(k._payload),q,E,le,fe)}}if(Ae)return fe=fe(k),Ae=le===""?"."+ie(k,0):le,X(fe)?(E="",Ae!=null&&(E=Ae.replace(ye,"$&/")+"/"),O(fe,q,E,"",function(At){return At})):fe!=null&&(J(fe)&&(fe=ne(fe,E+(fe.key==null||k&&k.key===fe.key?"":(""+fe.key).replace(ye,"$&/")+"/")+Ae)),q.push(fe)),1;Ae=0;var He=le===""?".":le+":";if(X(k))for(var xe=0;xe>>1,T=O[ce];if(0>>1;ceo(E,ae))leo(fe,E)?(O[ce]=fe,O[le]=ae,ce=le):(O[ce]=E,O[q]=ae,ce=q);else if(leo(fe,ae))O[ce]=fe,O[le]=ae,ce=le;else break e}}return Z}function o(O,Z){var ae=O.sortIndex-Z.sortIndex;return ae!==0?ae:O.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],m=[],g=1,y=null,v=3,x=!1,A=!1,M=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function H(O){for(var Z=i(m);Z!==null;){if(Z.callback===null)a(m);else if(Z.startTime<=O)a(m),Z.sortIndex=Z.expirationTime,t(p,Z);else break;Z=i(m)}}function X(O){if(M=!1,H(O),!A)if(i(p)!==null)A=!0,j||(j=!0,W());else{var Z=i(m);Z!==null&&K(X,Z.startTime-O)}}var j=!1,te=-1,P=5,ee=-1;function ne(){return R?!0:!(e.unstable_now()-eeO&&ne());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,v=y.priorityLevel;var T=ce(y.expirationTime<=O);if(O=e.unstable_now(),typeof T=="function"){y.callback=T,H(O),Z=!0;break t}y===i(p)&&a(p),H(O)}else a(p);y=i(p)}if(y!==null)Z=!0;else{var k=i(m);k!==null&&K(X,k.startTime-O),Z=!1}}break e}finally{y=null,v=ae,x=!1}Z=void 0}}finally{Z?W():j=!1}}}var W;if(typeof D=="function")W=function(){D(J)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,ie=ye.port2;ye.port1.onmessage=J,W=function(){ie.postMessage(null)}}else W=function(){C(J,0)};function K(O,Z){te=C(function(){O(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125ce?(O.sortIndex=ae,t(m,O),i(p)===null&&O===i(m)&&(M?(B(te),te=-1):M=!0,K(X,ae-ce))):(O.sortIndex=T,t(p,O),A||x||(A=!0,j||(j=!0,W()))),O},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(O){var Z=v;return function(){var ae=v;v=Z;try{return O.apply(this,arguments)}finally{v=ae}}}})(Ed)),Ed}var fb;function s_(){return fb||(fb=1,Td.exports=a_()),Td.exports}var Ad={exports:{}},It={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var db;function o_(){if(db)return It;db=1;var e=im();function t(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ad.exports=o_(),Ad.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var mb;function u_(){if(mb)return eo;mb=1;var e=s_(),t=im(),i=l_();function a(n){var r="https://react.dev/errors/"+n;if(1T||(n.current=ce[T],ce[T]=null,T--)}function E(n,r){T++,ce[T]=n.current,n.current=r}var le=k(null),fe=k(null),ue=k(null),Ae=k(null);function He(n,r){switch(E(ue,r),E(fe,n),E(le,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?M0(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=M0(r),n=D0(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(le),E(le,n)}function xe(){q(le),q(fe),q(ue)}function At(n){n.memoizedState!==null&&E(Ae,n);var r=le.current,s=D0(r,n.type);r!==s&&(E(fe,n),E(le,s))}function Ot(n){fe.current===n&&(q(le),q(fe)),Ae.current===n&&(q(Ae),Qs._currentValue=ae)}var St,Un;function zt(n){if(St===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);St=r&&r[1]||"",Un=-1)":-1f||_[l]!==I[f]){var F=` `+_[l].replace(" at new "," at ");return n.displayName&&F.includes("")&&(F=F.replace("",n.displayName)),F}while(1<=l&&0<=f);break}}}finally{Ai=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?zt(s):""}function _i(n,r){switch(n.tag){case 26:case 27:case 5:return zt(n.type);case 16:return zt("Lazy");case 13:return n.child!==r&&r!==null?zt("Suspense Fallback"):zt("Suspense");case 19:return zt("SuspenseList");case 0:case 15:return Bn(n.type,!1);case 11:return Bn(n.type.render,!1);case 1:return Bn(n.type,!0);case 31:return zt("Activity");default:return""}}function se(n){try{var r="",s=null;do r+=_i(n,s),s=n,n=n.return;while(n);return r}catch(l){return` Error generating stack: `+l.message+` `+l.stack}}var De=Object.prototype.hasOwnProperty,Ye=e.unstable_scheduleCallback,jt=e.unstable_cancelCallback,xr=e.unstable_shouldYield,Lt=e.unstable_requestPaint,Bt=e.unstable_now,sc=e.unstable_getCurrentPriorityLevel,G=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ne=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,nn=e.log,ei=e.unstable_setDisableYieldValue,Pt=null,bt=null;function Gt(n){if(typeof nn=="function"&&ei(n),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Pt,n)}catch{}}var We=Math.clz32?Math.clz32:HT,Ci=Math.log,Cn=Math.LN2;function HT(n){return n>>>=0,n===0?32:31-(Ci(n)/Cn|0)|0}var Po=256,Vo=262144,Ho=4194304;function wr(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function qo(n,r,s){var l=n.pendingLanes;if(l===0)return 0;var f=0,h=n.suspendedLanes,b=n.pingedLanes;n=n.warmLanes;var w=l&134217727;return w!==0?(l=w&~h,l!==0?f=wr(l):(b&=w,b!==0?f=wr(b):s||(s=w&~n,s!==0&&(f=wr(s))))):(w=l&~h,w!==0?f=wr(w):b!==0?f=wr(b):s||(s=l&~n,s!==0&&(f=wr(s)))),f===0?0:r!==0&&r!==f&&(r&h)===0&&(h=f&-f,s=r&-r,h>=s||h===32&&(s&4194048)!==0)?r:f}function ls(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function qT(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function cp(){var n=Ho;return Ho<<=1,(Ho&62914560)===0&&(Ho=4194304),n}function oc(n){for(var r=[],s=0;31>s;s++)r.push(n);return r}function us(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function FT(n,r,s,l,f,h){var b=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var w=n.entanglements,_=n.expirationTimes,I=n.hiddenUpdates;for(s=b&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var WT=/[\n"\\]/g;function pn(n){return n.replace(WT,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function hc(n,r,s,l,f,h,b,w){n.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?n.type=b:n.removeAttribute("type"),r!=null?b==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+mn(r)):n.value!==""+mn(r)&&(n.value=""+mn(r)):b!=="submit"&&b!=="reset"||n.removeAttribute("value"),r!=null?mc(n,b,mn(r)):s!=null?mc(n,b,mn(s)):l!=null&&n.removeAttribute("value"),f==null&&h!=null&&(n.defaultChecked=!!h),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.name=""+mn(w):n.removeAttribute("name")}function Tp(n,r,s,l,f,h,b,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(n.type=h),r!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||r!=null)){dc(n);return}s=s!=null?""+mn(s):"",r=r!=null?""+mn(r):s,w||r===n.value||(n.value=r),n.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=w?n.checked:!!l,n.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.name=b),dc(n)}function mc(n,r,s){r==="number"&&Yo(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function ra(n,r,s,l){if(n=n.options,r){r={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=!1;if(ii)try{var hs={};Object.defineProperty(hs,"passive",{get:function(){vc=!0}}),window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{vc=!1}var Mi=null,xc=null,Ko=null;function Dp(){if(Ko)return Ko;var n,r=xc,s=r.length,l,f="value"in Mi?Mi.value:Mi.textContent,h=f.length;for(n=0;n=gs),Lp=" ",Ip=!1;function Up(n,r){switch(n){case"keyup":return EE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var la=!1;function _E(n,r){switch(n){case"compositionend":return Bp(r);case"keypress":return r.which!==32?null:(Ip=!0,Lp);case"textInput":return n=r.data,n===Lp&&Ip?null:n;default:return null}}function CE(n,r){if(la)return n==="compositionend"||!Ac&&Up(n,r)?(n=Dp(),Ko=xc=Mi=null,la=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:s,offset:r-n};n=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Xp(s)}}function Qp(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Qp(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Wp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Yo(n.document);r instanceof n.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)n=r.contentWindow;else break;r=Yo(n.document)}return r}function kc(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var jE=ii&&"documentMode"in document&&11>=document.documentMode,ua=null,Mc=null,xs=null,Dc=!1;function Zp(n,r,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Dc||ua==null||ua!==Yo(l)||(l=ua,"selectionStart"in l&&kc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),xs&&vs(xs,l)||(xs=l,l=Vl(Mc,"onSelect"),0>=b,f-=b,Pn=1<<32-We(r)+f|s<Ce?(je=ge,ge=null):je=ge.sibling;var Ue=U(z,ge,L[Ce],Y);if(Ue===null){ge===null&&(ge=je);break}n&&ge&&Ue.alternate===null&&r(z,ge),N=h(Ue,N,Ce),Ie===null?be=Ue:Ie.sibling=Ue,Ie=Ue,ge=je}if(Ce===L.length)return s(z,ge),Le&&ai(z,Ce),be;if(ge===null){for(;CeCe?(je=ge,ge=null):je=ge.sibling;var Zi=U(z,ge,Ue.value,Y);if(Zi===null){ge===null&&(ge=je);break}n&&ge&&Zi.alternate===null&&r(z,ge),N=h(Zi,N,Ce),Ie===null?be=Zi:Ie.sibling=Zi,Ie=Zi,ge=je}if(Ue.done)return s(z,ge),Le&&ai(z,Ce),be;if(ge===null){for(;!Ue.done;Ce++,Ue=L.next())Ue=Q(z,Ue.value,Y),Ue!==null&&(N=h(Ue,N,Ce),Ie===null?be=Ue:Ie.sibling=Ue,Ie=Ue);return Le&&ai(z,Ce),be}for(ge=l(ge);!Ue.done;Ce++,Ue=L.next())Ue=V(ge,z,Ce,Ue.value,Y),Ue!==null&&(n&&Ue.alternate!==null&&ge.delete(Ue.key===null?Ce:Ue.key),N=h(Ue,N,Ce),Ie===null?be=Ue:Ie.sibling=Ue,Ie=Ue);return n&&ge.forEach(function(t_){return r(z,t_)}),Le&&ai(z,Ce),be}function Qe(z,N,L,Y){if(typeof L=="object"&&L!==null&&L.type===M&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case x:e:{for(var be=L.key;N!==null;){if(N.key===be){if(be=L.type,be===M){if(N.tag===7){s(z,N.sibling),Y=f(N,L.props.children),Y.return=z,z=Y;break e}}else if(N.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===P&&Rr(be)===N.type){s(z,N.sibling),Y=f(N,L.props),_s(Y,L),Y.return=z,z=Y;break e}s(z,N);break}else r(z,N);N=N.sibling}L.type===M?(Y=Cr(L.props.children,z.mode,Y,L.key),Y.return=z,z=Y):(Y=rl(L.type,L.key,L.props,null,z.mode,Y),_s(Y,L),Y.return=z,z=Y)}return b(z);case A:e:{for(be=L.key;N!==null;){if(N.key===be)if(N.tag===4&&N.stateNode.containerInfo===L.containerInfo&&N.stateNode.implementation===L.implementation){s(z,N.sibling),Y=f(N,L.children||[]),Y.return=z,z=Y;break e}else{s(z,N);break}else r(z,N);N=N.sibling}Y=Ic(L,z.mode,Y),Y.return=z,z=Y}return b(z);case P:return L=Rr(L),Qe(z,N,L,Y)}if(K(L))return de(z,N,L,Y);if(W(L)){if(be=W(L),typeof be!="function")throw Error(a(150));return L=be.call(L),ve(z,N,L,Y)}if(typeof L.then=="function")return Qe(z,N,fl(L),Y);if(L.$$typeof===D)return Qe(z,N,ol(z,L),Y);dl(z,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,N!==null&&N.tag===6?(s(z,N.sibling),Y=f(N,L),Y.return=z,z=Y):(s(z,N),Y=Lc(L,z.mode,Y),Y.return=z,z=Y),b(z)):s(z,N)}return function(z,N,L,Y){try{As=0;var be=Qe(z,N,L,Y);return xa=null,be}catch(ge){if(ge===va||ge===ul)throw ge;var Ie=an(29,ge,null,z.mode);return Ie.lanes=Y,Ie.return=z,Ie}finally{}}}var zr=xg(!0),wg=xg(!1),zi=!1;function Qc(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wc(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ji(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Li(n,r,s){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=il(n),rg(n,null,s),r}return nl(n,l,r,s),il(n)}function Cs(n,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var l=r.lanes;l&=n.pendingLanes,s|=l,r.lanes=s,dp(n,s)}}function Zc(n,r){var s=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var b={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?f=h=b:h=h.next=b,s=s.next}while(s!==null);h===null?f=h=r:h=h.next=r}else f=h=r;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=r:n.next=r,s.lastBaseUpdate=r}var $c=!1;function ks(){if($c){var n=ba;if(n!==null)throw n}}function Ms(n,r,s,l){$c=!1;var f=n.updateQueue;zi=!1;var h=f.firstBaseUpdate,b=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var _=w,I=_.next;_.next=null,b===null?h=I:b.next=I,b=_;var F=n.alternate;F!==null&&(F=F.updateQueue,w=F.lastBaseUpdate,w!==b&&(w===null?F.firstBaseUpdate=I:w.next=I,F.lastBaseUpdate=_))}if(h!==null){var Q=f.baseState;b=0,F=I=_=null,w=h;do{var U=w.lane&-536870913,V=U!==w.lane;if(V?(ze&U)===U:(l&U)===U){U!==0&&U===ya&&($c=!0),F!==null&&(F=F.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var de=n,ve=w;U=r;var Qe=s;switch(ve.tag){case 1:if(de=ve.payload,typeof de=="function"){Q=de.call(Qe,Q,U);break e}Q=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ve.payload,U=typeof de=="function"?de.call(Qe,Q,U):de,U==null)break e;Q=y({},Q,U);break e;case 2:zi=!0}}U=w.callback,U!==null&&(n.flags|=64,V&&(n.flags|=8192),V=f.callbacks,V===null?f.callbacks=[U]:V.push(U))}else V={lane:U,tag:w.tag,payload:w.payload,callback:w.callback,next:null},F===null?(I=F=V,_=Q):F=F.next=V,b|=U;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;V=w,w=V.next,V.next=null,f.lastBaseUpdate=V,f.shared.pending=null}}while(!0);F===null&&(_=Q),f.baseState=_,f.firstBaseUpdate=I,f.lastBaseUpdate=F,h===null&&(f.shared.lanes=0),Vi|=b,n.lanes=b,n.memoizedState=Q}}function Sg(n,r){if(typeof n!="function")throw Error(a(191,n));n.call(r)}function Tg(n,r){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;nh?h:8;var b=O.T,w={};O.T=w,bf(n,!1,r,s);try{var _=f(),I=O.S;if(I!==null&&I(w,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var F=FE(_,l);Rs(n,r,F,cn(n))}else Rs(n,r,l,cn(n))}catch(Q){Rs(n,r,{then:function(){},status:"rejected",reason:Q},cn())}finally{Z.p=h,b!==null&&w.types!==null&&(b.types=w.types),O.T=b}}function WE(){}function gf(n,r,s,l){if(n.tag!==5)throw Error(a(476));var f=ty(n).queue;ey(n,f,r,ae,s===null?WE:function(){return ny(n),s(l)})}function ty(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ui,lastRenderedState:ae},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ui,lastRenderedState:s},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function ny(n){var r=ty(n);r.next===null&&(r=n.alternate.memoizedState),Rs(n,r.next.queue,{},cn())}function yf(){return kt(Qs)}function iy(){return ft().memoizedState}function ry(){return ft().memoizedState}function ZE(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var s=cn();n=ji(s);var l=Li(r,n,s);l!==null&&($t(l,r,s),Cs(l,r,s)),r={cache:Gc()},n.payload=r;return}r=r.return}}function $E(n,r,s){var l=cn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Sl(n)?sy(r,s):(s=zc(n,r,s,l),s!==null&&($t(s,n,l),oy(s,r,l)))}function ay(n,r,s){var l=cn();Rs(n,r,s,l)}function Rs(n,r,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Sl(n))sy(r,f);else{var h=n.alternate;if(n.lanes===0&&(h===null||h.lanes===0)&&(h=r.lastRenderedReducer,h!==null))try{var b=r.lastRenderedState,w=h(b,s);if(f.hasEagerState=!0,f.eagerState=w,rn(w,b))return nl(n,r,f,0),Ze===null&&tl(),!1}catch{}finally{}if(s=zc(n,r,f,l),s!==null)return $t(s,n,l),oy(s,r,l),!0}return!1}function bf(n,r,s,l){if(l={lane:2,revertLane:Wf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Sl(n)){if(r)throw Error(a(479))}else r=zc(n,s,l,2),r!==null&&$t(r,n,2)}function Sl(n){var r=n.alternate;return n===_e||r!==null&&r===_e}function sy(n,r){Sa=pl=!0;var s=n.pending;s===null?r.next=r:(r.next=s.next,s.next=r),n.pending=r}function oy(n,r,s){if((s&4194048)!==0){var l=r.lanes;l&=n.pendingLanes,s|=l,r.lanes=s,dp(n,s)}}var Os={readContext:kt,use:bl,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Os.useEffectEvent=ot;var ly={readContext:kt,use:bl,useCallback:function(n,r){return Vt().memoizedState=[n,r===void 0?null:r],n},useContext:kt,useEffect:Gg,useImperativeHandle:function(n,r,s){s=s!=null?s.concat([n]):null,xl(4194308,4,Qg.bind(null,r,n),s)},useLayoutEffect:function(n,r){return xl(4194308,4,n,r)},useInsertionEffect:function(n,r){xl(4,2,n,r)},useMemo:function(n,r){var s=Vt();r=r===void 0?null:r;var l=n();if(jr){Gt(!0);try{n()}finally{Gt(!1)}}return s.memoizedState=[l,r],l},useReducer:function(n,r,s){var l=Vt();if(s!==void 0){var f=s(r);if(jr){Gt(!0);try{s(r)}finally{Gt(!1)}}}else f=r;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=$E.bind(null,_e,n),[l.memoizedState,n]},useRef:function(n){var r=Vt();return n={current:n},r.memoizedState=n},useState:function(n){n=ff(n);var r=n.queue,s=ay.bind(null,_e,r);return r.dispatch=s,[n.memoizedState,s]},useDebugValue:mf,useDeferredValue:function(n,r){var s=Vt();return pf(s,n,r)},useTransition:function(){var n=ff(!1);return n=ey.bind(null,_e,n.queue,!0,!1),Vt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,s){var l=_e,f=Vt();if(Le){if(s===void 0)throw Error(a(407));s=s()}else{if(s=r(),Ze===null)throw Error(a(349));(ze&127)!==0||Mg(l,r,s)}f.memoizedState=s;var h={value:s,getSnapshot:r};return f.queue=h,Gg(Ng.bind(null,l,h,n),[n]),l.flags|=2048,Ea(9,{destroy:void 0},Dg.bind(null,l,h,s,r),null),s},useId:function(){var n=Vt(),r=Ze.identifierPrefix;if(Le){var s=Vn,l=Pn;s=(l&~(1<<32-We(l)-1)).toString(32)+s,r="_"+r+"R_"+s,s=gl++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?b.createElement("select",{is:l.is}):b.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?b.createElement(f,{is:l.is}):b.createElement(f)}}h[_t]=r,h[Yt]=l;e:for(b=r.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===r)break e;for(;b.sibling===null;){if(b.return===null||b.return===r)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}r.stateNode=h;e:switch(Dt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&fi(r)}}return rt(r),Rf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,s),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&fi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(a(166));if(n=ue.current,pa(r)){if(n=r.stateNode,s=r.memoizedProps,l=null,f=Ct,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[_t]=r,n=!!(n.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||C0(n.nodeValue,s)),n||Ri(r,!0)}else n=Hl(n).createTextNode(l),n[_t]=r,r.stateNode=n}return rt(r),null;case 31:if(s=r.memoizedState,n===null||n.memoizedState!==null){if(l=pa(r),s!==null){if(n===null){if(!l)throw Error(a(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[_t]=r}else kr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),n=!1}else s=Vc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return r.flags&256?(on(r),r):(on(r),null);if((r.flags&128)!==0)throw Error(a(558))}return rt(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=pa(r),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(a(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[_t]=r}else kr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),f=!1}else f=Vc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(on(r),r):(on(r),null)}return on(r),(r.flags&128)!==0?(r.lanes=s,r):(s=l!==null,n=n!==null&&n.memoizedState!==null,s&&(l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),s!==n&&s&&(r.child.flags|=8192),Cl(r,r.updateQueue),rt(r),null);case 4:return xe(),n===null&&ed(r.stateNode.containerInfo),rt(r),null;case 10:return oi(r.type),rt(r),null;case 19:if(q(ct),l=r.memoizedState,l===null)return rt(r),null;if(f=(r.flags&128)!==0,h=l.rendering,h===null)if(f)js(l,!1);else{if(lt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(h=ml(n),h!==null){for(r.flags|=128,js(l,!1),n=h.updateQueue,r.updateQueue=n,Cl(r,n),r.subtreeFlags=0,n=s,s=r.child;s!==null;)ag(s,n),s=s.sibling;return E(ct,ct.current&1|2),Le&&ai(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&Bt()>Rl&&(r.flags|=128,f=!0,js(l,!1),r.lanes=4194304)}else{if(!f)if(n=ml(h),n!==null){if(r.flags|=128,f=!0,n=n.updateQueue,r.updateQueue=n,Cl(r,n),js(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Le)return rt(r),null}else 2*Bt()-l.renderingStartTime>Rl&&s!==536870912&&(r.flags|=128,f=!0,js(l,!1),r.lanes=4194304);l.isBackwards?(h.sibling=r.child,r.child=h):(n=l.last,n!==null?n.sibling=h:r.child=h,l.last=h)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Bt(),n.sibling=null,s=ct.current,E(ct,f?s&1|2:s&1),Le&&ai(r,l.treeForkCount),n):(rt(r),null);case 22:case 23:return on(r),ef(),l=r.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(s&536870912)!==0&&(r.flags&128)===0&&(rt(r),r.subtreeFlags&6&&(r.flags|=8192)):rt(r),s=r.updateQueue,s!==null&&Cl(r,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==s&&(r.flags|=2048),n!==null&&q(Nr),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),oi(dt),rt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function iA(n,r){switch(Bc(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return oi(dt),xe(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Ot(r),null;case 31:if(r.memoizedState!==null){if(on(r),r.alternate===null)throw Error(a(340));kr()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(on(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(a(340));kr()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return q(ct),null;case 4:return xe(),null;case 10:return oi(r.type),null;case 22:case 23:return on(r),ef(),n!==null&&q(Nr),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return oi(dt),null;case 25:return null;default:return null}}function Ry(n,r){switch(Bc(r),r.tag){case 3:oi(dt),xe();break;case 26:case 27:case 5:Ot(r);break;case 4:xe();break;case 31:r.memoizedState!==null&&on(r);break;case 13:on(r);break;case 19:q(ct);break;case 10:oi(r.type);break;case 22:case 23:on(r),ef(),n!==null&&q(Nr);break;case 24:oi(dt)}}function Ls(n,r){try{var s=r.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&n)===n){l=void 0;var h=s.create,b=s.inst;l=h(),b.destroy=l}s=s.next}while(s!==f)}}catch(w){Fe(r,r.return,w)}}function Bi(n,r,s){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&n)===n){var b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,f=r;var _=s,I=w;try{I()}catch(F){Fe(f,_,F)}}}l=l.next}while(l!==h)}}catch(F){Fe(r,r.return,F)}}function Oy(n){var r=n.updateQueue;if(r!==null){var s=n.stateNode;try{Tg(r,s)}catch(l){Fe(n,n.return,l)}}}function zy(n,r,s){s.props=Lr(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(l){Fe(n,r,l)}}function Is(n,r){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof s=="function"?n.refCleanup=s(l):s.current=l}}catch(f){Fe(n,r,f)}}function Hn(n,r){var s=n.ref,l=n.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){Fe(n,r,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Fe(n,r,f)}else s.current=null}function jy(n){var r=n.type,s=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){Fe(n,n.return,f)}}function Of(n,r,s){try{var l=n.stateNode;AA(l,n.type,s,r),l[Yt]=r}catch(f){Fe(n,n.return,f)}}function Ly(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Yi(n.type)||n.tag===4}function zf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ly(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Yi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function jf(n,r,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(n),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=ni));else if(l!==4&&(l===27&&Yi(n.type)&&(s=n.stateNode,r=null),n=n.child,n!==null))for(jf(n,r,s),n=n.sibling;n!==null;)jf(n,r,s),n=n.sibling}function kl(n,r,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?s.insertBefore(n,r):s.appendChild(n);else if(l!==4&&(l===27&&Yi(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(kl(n,r,s),n=n.sibling;n!==null;)kl(n,r,s),n=n.sibling}function Iy(n){var r=n.stateNode,s=n.memoizedProps;try{for(var l=n.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);Dt(r,l,s),r[_t]=n,r[Yt]=s}catch(h){Fe(n,n.return,h)}}var di=!1,pt=!1,Lf=!1,Uy=typeof WeakSet=="function"?WeakSet:Set,Et=null;function rA(n,r){if(n=n.containerInfo,id=Ql,n=Wp(n),kc(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var b=0,w=-1,_=-1,I=0,F=0,Q=n,U=null;t:for(;;){for(var V;Q!==s||f!==0&&Q.nodeType!==3||(w=b+f),Q!==h||l!==0&&Q.nodeType!==3||(_=b+l),Q.nodeType===3&&(b+=Q.nodeValue.length),(V=Q.firstChild)!==null;)U=Q,Q=V;for(;;){if(Q===n)break t;if(U===s&&++I===f&&(w=b),U===h&&++F===l&&(_=b),(V=Q.nextSibling)!==null)break;Q=U,U=Q.parentNode}Q=V}s=w===-1||_===-1?null:{start:w,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(rd={focusedElem:n,selectionRange:s},Ql=!1,Et=r;Et!==null;)if(r=Et,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,Et=n;else for(;Et!==null;){switch(r=Et,h=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),Dt(h,l,s),h[_t]=n,Tt(h),l=h;break e;case"link":var b=F0("link","href",f).get(l+(s.href||""));if(b){for(var w=0;wQe&&(b=Qe,Qe=ve,ve=b);var z=Kp(w,ve),N=Kp(w,Qe);if(z&&N&&(V.rangeCount!==1||V.anchorNode!==z.node||V.anchorOffset!==z.offset||V.focusNode!==N.node||V.focusOffset!==N.offset)){var L=Q.createRange();L.setStart(z.node,z.offset),V.removeAllRanges(),ve>Qe?(V.addRange(L),V.extend(N.node,N.offset)):(L.setEnd(N.node,N.offset),V.addRange(L))}}}}for(Q=[],V=w;V=V.parentNode;)V.nodeType===1&&Q.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;ws?32:s,O.T=null,s=qf,qf=null;var h=qi,b=yi;if(vt=0,Ma=qi=null,yi=0,(Be&6)!==0)throw Error(a(331));var w=Be;if(Be|=4,Qy(h.current),Yy(h,h.current,b,s),Be=w,qs(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Pt,h)}catch{}return!0}finally{Z.p=f,O.T=l,h0(n,r)}}function p0(n,r,s){r=yn(s,r),r=Sf(n.stateNode,r,2),n=Li(n,r,2),n!==null&&(us(n,2),qn(n))}function Fe(n,r,s){if(n.tag===3)p0(n,n,s);else for(;r!==null;){if(r.tag===3){p0(r,n,s);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Hi===null||!Hi.has(l))){n=yn(s,n),s=gy(2),l=Li(r,s,2),l!==null&&(yy(s,l,r,n),us(l,2),qn(l));break}}r=r.return}}function Xf(n,r,s){var l=n.pingCache;if(l===null){l=n.pingCache=new oA;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(s)||(Bf=!0,f.add(s),n=dA.bind(null,n,r,s),r.then(n,n))}function dA(n,r,s){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,Ze===n&&(ze&s)===s&&(lt===4||lt===3&&(ze&62914560)===ze&&300>Bt()-Nl?(Be&2)===0&&Da(n,0):Pf|=s,ka===ze&&(ka=0)),qn(n)}function g0(n,r){r===0&&(r=cp()),n=_r(n,r),n!==null&&(us(n,r),qn(n))}function hA(n){var r=n.memoizedState,s=0;r!==null&&(s=r.retryLane),g0(n,s)}function mA(n,r){var s=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(r),g0(n,s)}function pA(n,r){return Ye(n,r)}var Ul=null,Ra=null,Kf=!1,Bl=!1,Qf=!1,Gi=0;function qn(n){n!==Ra&&n.next===null&&(Ra===null?Ul=Ra=n:Ra=Ra.next=n),Bl=!0,Kf||(Kf=!0,yA())}function qs(n,r){if(!Qf&&Bl){Qf=!0;do for(var s=!1,l=Ul;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var b=l.suspendedLanes,w=l.pingedLanes;h=(1<<31-We(42|n)+1)-1,h&=f&~(b&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,x0(l,h))}else h=ze,h=qo(l,l===Ze?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||ls(l,h)||(s=!0,x0(l,h));l=l.next}while(s);Qf=!1}}function gA(){y0()}function y0(){Bl=Kf=!1;var n=0;Gi!==0&&CA()&&(n=Gi);for(var r=Bt(),s=null,l=Ul;l!==null;){var f=l.next,h=b0(l,r);h===0?(l.next=null,s===null?Ul=f:s.next=f,f===null&&(Ra=s)):(s=l,(n!==0||(h&3)!==0)&&(Bl=!0)),l=f}vt!==0&&vt!==5||qs(n),Gi!==0&&(Gi=0)}function b0(n,r){for(var s=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,h=n.pendingLanes&-62914561;0w)break;var F=_.transferSize,Q=_.initiatorType;F&&k0(Q)&&(_=_.responseEnd,b+=F*(_"u"?null:document;function P0(n,r,s){var l=Oa;if(l&&typeof r=="string"&&r){var f=pn(r);f='link[rel="'+n+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),B0.has(f)||(B0.add(f),n={rel:n,crossOrigin:s,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),Dt(r,"link",n),Tt(r),l.head.appendChild(r)))}}function LA(n){bi.D(n),P0("dns-prefetch",n,null)}function IA(n,r){bi.C(n,r),P0("preconnect",n,r)}function UA(n,r,s){bi.L(n,r,s);var l=Oa;if(l&&n&&r){var f='link[rel="preload"][as="'+pn(r)+'"]';r==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+pn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+pn(s.imageSizes)+'"]')):f+='[href="'+pn(n)+'"]';var h=f;switch(r){case"style":h=za(n);break;case"script":h=ja(n)}Tn.has(h)||(n=y({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:n,as:r},s),Tn.set(h,n),l.querySelector(f)!==null||r==="style"&&l.querySelector(Xs(h))||r==="script"&&l.querySelector(Ks(h))||(r=l.createElement("link"),Dt(r,"link",n),Tt(r),l.head.appendChild(r)))}}function BA(n,r){bi.m(n,r);var s=Oa;if(s&&n){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+pn(l)+'"][href="'+pn(n)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=ja(n)}if(!Tn.has(h)&&(n=y({rel:"modulepreload",href:n},r),Tn.set(h,n),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ks(h)))return}l=s.createElement("link"),Dt(l,"link",n),Tt(l),s.head.appendChild(l)}}}function PA(n,r,s){bi.S(n,r,s);var l=Oa;if(l&&n){var f=na(l).hoistableStyles,h=za(n);r=r||"default";var b=f.get(h);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(Xs(h)))w.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":r},s),(s=Tn.get(h))&&fd(n,s);var _=b=l.createElement("link");Tt(_),Dt(_,"link",n),_._p=new Promise(function(I,F){_.onload=I,_.onerror=F}),_.addEventListener("load",function(){w.loading|=1}),_.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Fl(b,r,l)}b={type:"stylesheet",instance:b,count:1,state:w},f.set(h,b)}}}function VA(n,r){bi.X(n,r);var s=Oa;if(s&&n){var l=na(s).hoistableScripts,f=ja(n),h=l.get(f);h||(h=s.querySelector(Ks(f)),h||(n=y({src:n,async:!0},r),(r=Tn.get(f))&&dd(n,r),h=s.createElement("script"),Tt(h),Dt(h,"link",n),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function HA(n,r){bi.M(n,r);var s=Oa;if(s&&n){var l=na(s).hoistableScripts,f=ja(n),h=l.get(f);h||(h=s.querySelector(Ks(f)),h||(n=y({src:n,async:!0,type:"module"},r),(r=Tn.get(f))&&dd(n,r),h=s.createElement("script"),Tt(h),Dt(h,"link",n),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function V0(n,r,s,l){var f=(f=ue.current)?ql(f):null;if(!f)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=za(s.href),s=na(f).hoistableStyles,l=s.get(r),l||(l={type:"style",instance:null,count:0,state:null},s.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=za(s.href);var h=na(f).hoistableStyles,b=h.get(n);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,b),(h=f.querySelector(Xs(n)))&&!h._p&&(b.instance=h,b.state.loading=5),Tn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Tn.set(n,s),h||qA(f,n,s,b.state))),r&&l===null)throw Error(a(528,""));return b}if(r&&l!==null)throw Error(a(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ja(s),s=na(f).hoistableScripts,l=s.get(r),l||(l={type:"script",instance:null,count:0,state:null},s.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function za(n){return'href="'+pn(n)+'"'}function Xs(n){return'link[rel="stylesheet"]['+n+"]"}function H0(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function qA(n,r,s,l){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=n.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Dt(r,"link",s),Tt(r),n.head.appendChild(r))}function ja(n){return'[src="'+pn(n)+'"]'}function Ks(n){return"script[async]"+n}function q0(n,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+pn(s.href)+'"]');if(l)return r.instance=l,Tt(l),l;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Tt(l),Dt(l,"style",f),Fl(l,s.precedence,n),r.instance=l;case"stylesheet":f=za(s.href);var h=n.querySelector(Xs(f));if(h)return r.state.loading|=4,r.instance=h,Tt(h),h;l=H0(s),(f=Tn.get(f))&&fd(l,f),h=(n.ownerDocument||n).createElement("link"),Tt(h);var b=h;return b._p=new Promise(function(w,_){b.onload=w,b.onerror=_}),Dt(h,"link",l),r.state.loading|=4,Fl(h,s.precedence,n),r.instance=h;case"script":return h=ja(s.src),(f=n.querySelector(Ks(h)))?(r.instance=f,Tt(f),f):(l=s,(f=Tn.get(h))&&(l=y({},s),dd(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),Tt(f),Dt(f,"link",l),n.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Fl(l,s.precedence,n));return r.instance}function Fl(n,r,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,b=0;b title"):null)}function FA(n,r,s){if(s===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Y0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function GA(n,r,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=za(l.href),h=r.querySelector(Xs(f));if(h){r=h._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Yl.bind(n),r.then(n,n)),s.state.loading|=4,s.instance=h,Tt(h);return}h=r.ownerDocument||r,l=H0(l),(f=Tn.get(f))&&fd(l,f),h=h.createElement("link"),Tt(h);var b=h;b._p=new Promise(function(w,_){b.onload=w,b.onerror=_}),Dt(h,"link",l),s.instance=h}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Yl.bind(n),r.addEventListener("load",s),r.addEventListener("error",s))}}var hd=0;function YA(n,r){return n.stylesheets&&n.count===0&&Kl(n,n.stylesheets),0hd?50:800)+r);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Yl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Xl=null;function Kl(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Xl=new Map,r.forEach(XA,n),Xl=null,Yl.call(n))}function XA(n,r){if(!(r.state.loading&4)){var s=Xl.get(n);if(s)var l=s.get(null);else{s=new Map,Xl.set(n,s);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sd.exports=u_(),Sd.exports}var f_=c_();const rm=$.createContext({});function am(e){const t=$.useRef(null);return t.current===null&&(t.current=e()),t.current}const d_=typeof window<"u",l1=d_?$.useLayoutEffect:$.useEffect,Ku=$.createContext(null);function sm(e,t){e.indexOf(t)===-1&&e.push(t)}function ku(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const Zn=(e,t,i)=>i>t?t:i{};const dr={},u1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function c1(e){return typeof e=="object"&&e!==null}const f1=e=>/^0[^.\s]+$/u.test(e);function d1(e){let t;return()=>(t===void 0&&(t=e()),t)}const _n=e=>e,h_=(e,t)=>i=>t(e(i)),ko=(...e)=>e.reduce(h_),vo=(e,t,i)=>{const a=t-e;return a===0?1:(i-e)/a};class lm{constructor(){this.subscriptions=[]}add(t){return sm(this.subscriptions,t),()=>ku(this.subscriptions,t)}notify(t,i,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,i,a);else for(let u=0;ue*1e3,An=e=>e/1e3;function h1(e,t){return t?e*(1e3/t):0}const m1=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,m_=1e-7,p_=12;function g_(e,t,i,a,o){let u,c,d=0;do c=t+(i-t)/2,u=m1(c,a,o)-e,u>0?i=c:t=c;while(Math.abs(u)>m_&&++dg_(u,0,1,e,i);return u=>u===0||u===1?u:m1(o(u),t,a)}const p1=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,g1=e=>t=>1-e(1-t),y1=Mo(.33,1.53,.69,.99),um=g1(y1),b1=p1(um),v1=e=>e>=1?1:(e*=2)<1?.5*um(e):.5*(2-Math.pow(2,-10*(e-1))),cm=e=>1-Math.sin(Math.acos(e)),x1=g1(cm),w1=p1(cm),y_=Mo(.42,0,1,1),b_=Mo(0,0,.58,1),S1=Mo(.42,0,.58,1),v_=e=>Array.isArray(e)&&typeof e[0]!="number",T1=e=>Array.isArray(e)&&typeof e[0]=="number",x_={linear:_n,easeIn:y_,easeInOut:S1,easeOut:b_,circIn:cm,circInOut:w1,circOut:x1,backIn:um,backInOut:b1,backOut:y1,anticipate:v1},w_=e=>typeof e=="string",gb=e=>{if(T1(e)){om(e.length===4);const[t,i,a,o]=e;return Mo(t,i,a,o)}else if(w_(e))return x_[e];return e},nu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function S_(e,t){let i=new Set,a=new Set,o=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){c.has(g)&&(m.schedule(g),e()),g(d)}const m={schedule:(g,y=!1,v=!1)=>{const A=v&&o?i:a;return y&&c.add(g),A.add(g),g},cancel:g=>{a.delete(g),c.delete(g)},process:g=>{if(d=g,o){u=!0;return}o=!0;const y=i;i=a,a=y,i.forEach(p),i.clear(),o=!1,u&&(u=!1,m.process(g))}};return m}const T_=40;function E1(e,t){let i=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,c=nu.reduce((D,H)=>(D[H]=S_(u),D),{}),{setup:d,read:p,resolveKeyframes:m,preUpdate:g,update:y,preRender:v,render:x,postRender:A}=c,M=()=>{const D=dr.useManualTiming,H=D?o.timestamp:performance.now();i=!1,D||(o.delta=a?1e3/60:Math.max(Math.min(H-o.timestamp,T_),1)),o.timestamp=H,o.isProcessing=!0,d.process(o),p.process(o),m.process(o),g.process(o),y.process(o),v.process(o),x.process(o),A.process(o),o.isProcessing=!1,i&&t&&(a=!1,e(M))},R=()=>{i=!0,a=!0,o.isProcessing||e(M)};return{schedule:nu.reduce((D,H)=>{const X=c[H];return D[H]=(j,te=!1,P=!1)=>(i||R(),X.schedule(j,te,P)),D},{}),cancel:D=>{for(let H=0;H(pu===void 0&&Ht.set(Nt.isProcessing||dr.useManualTiming?Nt.timestamp:performance.now()),pu),set:e=>{pu=e,queueMicrotask(E_)}},A1=e=>t=>typeof t=="string"&&t.startsWith(e),_1=A1("--"),A_=A1("var(--"),fm=e=>A_(e)?__.test(e.split("/*")[0].trim()):!1,__=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yb(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ns={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},xo={...ns,transform:e=>Zn(0,1,e)},iu={...ns,default:1},co=e=>Math.round(e*1e5)/1e5,dm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function C_(e){return e==null}const k_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hm=(e,t)=>i=>!!(typeof i=="string"&&k_.test(i)&&i.startsWith(e)||t&&!C_(i)&&Object.prototype.hasOwnProperty.call(i,t)),C1=(e,t,i)=>a=>{if(typeof a!="string")return a;const[o,u,c,d]=a.match(dm);return{[e]:parseFloat(o),[t]:parseFloat(u),[i]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},M_=e=>Zn(0,255,e),Cd={...ns,transform:e=>Math.round(M_(e))},Fr={test:hm("rgb","red"),parse:C1("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:a=1})=>"rgba("+Cd.transform(e)+", "+Cd.transform(t)+", "+Cd.transform(i)+", "+co(xo.transform(a))+")"};function D_(e){let t="",i="",a="",o="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,i+=i,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const fh={test:hm("#"),parse:D_,transform:Fr.transform},Do=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),rr=Do("deg"),Qn=Do("%"),me=Do("px"),N_=Do("vh"),R_=Do("vw"),bb={...Qn,parse:e=>Qn.parse(e)/100,transform:e=>Qn.transform(e*100)},Va={test:hm("hsl","hue"),parse:C1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:a=1})=>"hsla("+Math.round(e)+", "+Qn.transform(co(t))+", "+Qn.transform(co(i))+", "+co(xo.transform(a))+")"},yt={test:e=>Fr.test(e)||fh.test(e)||Va.test(e),parse:e=>Fr.test(e)?Fr.parse(e):Va.test(e)?Va.parse(e):fh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Fr.transform(e):Va.transform(e),getAnimatableNone:e=>{const t=yt.parse(e);return t.alpha=0,yt.transform(t)}},O_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z_(e){var t,i;return isNaN(e)&&typeof e=="string"&&(((t=e.match(dm))==null?void 0:t.length)||0)+(((i=e.match(O_))==null?void 0:i.length)||0)>0}const k1="number",M1="color",j_="var",L_="var(",vb="${}",I_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wa(e){const t=e.toString(),i=[],a={color:[],number:[],var:[]},o=[];let u=0;const d=t.replace(I_,p=>(yt.test(p)?(a.color.push(u),o.push(M1),i.push(yt.parse(p))):p.startsWith(L_)?(a.var.push(u),o.push(j_),i.push(p)):(a.number.push(u),o.push(k1),i.push(parseFloat(p))),++u,vb)).split(vb);return{values:i,split:d,indexes:a,types:o}}function U_(e){return Wa(e).values}function D1({split:e,types:t}){const i=e.length;return a=>{let o="";for(let u=0;utypeof e=="number"?0:yt.test(e)?yt.getAnimatableNone(e):e,V_=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:P_(e);function H_(e){const t=Wa(e);return D1(t)(t.values.map((a,o)=>V_(a,t.split[o])))}const jn={test:z_,parse:U_,createTransformer:B_,getAnimatableNone:H_};function kd(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function q_({hue:e,saturation:t,lightness:i,alpha:a}){e/=360,t/=100,i/=100;let o=0,u=0,c=0;if(!t)o=u=c=i;else{const d=i<.5?i*(1+t):i+t-i*t,p=2*i-d;o=kd(p,d,e+1/3),u=kd(p,d,e),c=kd(p,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:a}}function Mu(e,t){return i=>i>0?t:e}const at=(e,t,i)=>e+(t-e)*i,Md=(e,t,i)=>{const a=e*e,o=i*(t*t-a)+a;return o<0?0:Math.sqrt(o)},F_=[fh,Fr,Va],G_=e=>F_.find(t=>t.test(e));function xb(e){const t=G_(e);if(!t)return!1;let i=t.parse(e);return t===Va&&(i=q_(i)),i}const wb=(e,t)=>{const i=xb(e),a=xb(t);if(!i||!a)return Mu(e,t);const o={...i};return u=>(o.red=Md(i.red,a.red,u),o.green=Md(i.green,a.green,u),o.blue=Md(i.blue,a.blue,u),o.alpha=at(i.alpha,a.alpha,u),Fr.transform(o))},dh=new Set(["none","hidden"]);function Y_(e,t){return dh.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function X_(e,t){return i=>at(e,t,i)}function mm(e){return typeof e=="number"?X_:typeof e=="string"?fm(e)?Mu:yt.test(e)?wb:W_:Array.isArray(e)?N1:typeof e=="object"?yt.test(e)?wb:K_:Mu}function N1(e,t){const i=[...e],a=i.length,o=e.map((u,c)=>mm(u)(u,t[c]));return u=>{for(let c=0;c{for(const u in a)i[u]=a[u](o);return i}}function Q_(e,t){const i=[],a={color:0,var:0,number:0};for(let o=0;o{const i=jn.createTransformer(t),a=Wa(e),o=Wa(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?dh.has(e)&&!o.values.length||dh.has(t)&&!a.values.length?Y_(e,t):ko(N1(Q_(a,o),o.values),i):Mu(e,t)};function R1(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?at(e,t,i):mm(e)(e,t)}const Z_=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>Je.update(t,i),stop:()=>hr(t),now:()=>Nt.isProcessing?Nt.timestamp:Ht.now()}},O1=(e,t,i=10)=>{let a="";const o=Math.max(Math.round(t/i),2);for(let u=0;u=Du?1/0:t}function $_(e,t=100,i){const a=i({...e,keyframes:[0,t]}),o=Math.min(pm(a),Du);return{type:"keyframes",ease:u=>a.next(o*u).value/t,duration:An(o)}}const ut={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function hh(e,t){return e*Math.sqrt(1-t*t)}const J_=12;function e2(e,t,i){let a=i;for(let o=1;o{const g=m*c,y=g*e,v=g-i,x=hh(m,c),A=Math.exp(-y);return Dd-v/x*A},u=m=>{const y=m*c*e,v=y*i+i,x=Math.pow(c,2)*Math.pow(m,2)*e,A=Math.exp(-y),M=hh(Math.pow(m,2),c);return(-o(m)+Dd>0?-1:1)*((v-x)*A)/M}):(o=m=>{const g=Math.exp(-m*e),y=(m-i)*e+1;return-Dd+g*y},u=m=>{const g=Math.exp(-m*e),y=(i-m)*(e*e);return g*y});const d=5/e,p=e2(o,u,d);if(e=hn(e),isNaN(p))return{stiffness:ut.stiffness,damping:ut.damping,duration:e};{const m=Math.pow(p,2)*a;return{stiffness:m,damping:c*2*Math.sqrt(a*m),duration:e}}}const n2=["duration","bounce"],i2=["stiffness","damping","mass"];function Sb(e,t){return t.some(i=>e[i]!==void 0)}function r2(e){let t={velocity:ut.velocity,stiffness:ut.stiffness,damping:ut.damping,mass:ut.mass,isResolvedFromDuration:!1,...e};if(!Sb(e,i2)&&Sb(e,n2))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,a=2*Math.PI/(i*1.2),o=a*a,u=2*Zn(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ut.mass,stiffness:o,damping:u}}else{const i=t2({...e,velocity:0});t={...t,...i,mass:ut.mass},t.isResolvedFromDuration=!0}return t}function Nu(e=ut.visualDuration,t=ut.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=i;const u=i.keyframes[0],c=i.keyframes[i.keyframes.length-1],d={done:!1,value:u},{stiffness:p,damping:m,mass:g,duration:y,velocity:v,isResolvedFromDuration:x}=r2({...i,velocity:-An(i.velocity||0)}),A=v||0,M=m/(2*Math.sqrt(p*g)),R=c-u,C=An(Math.sqrt(p/g)),B=Math.abs(R)<5;a||(a=B?ut.restSpeed.granular:ut.restSpeed.default),o||(o=B?ut.restDelta.granular:ut.restDelta.default);let D,H,X,j,te,P;if(M<1)X=hh(C,M),j=(A+M*C*R)/X,D=ne=>{const J=Math.exp(-M*C*ne);return c-J*(j*Math.sin(X*ne)+R*Math.cos(X*ne))},te=M*C*j+R*X,P=M*C*R-j*X,H=ne=>Math.exp(-M*C*ne)*(te*Math.sin(X*ne)+P*Math.cos(X*ne));else if(M===1){D=J=>c-Math.exp(-C*J)*(R+(A+C*R)*J);const ne=A+C*R;H=J=>Math.exp(-C*J)*(C*ne*J-A)}else{const ne=C*Math.sqrt(M*M-1);D=ie=>{const K=Math.exp(-M*C*ie),O=Math.min(ne*ie,300);return c-K*((A+M*C*R)*Math.sinh(O)+ne*R*Math.cosh(O))/ne};const J=(A+M*C*R)/ne,W=M*C*J-R*ne,ye=M*C*R-J*ne;H=ie=>{const K=Math.exp(-M*C*ie),O=Math.min(ne*ie,300);return K*(W*Math.sinh(O)+ye*Math.cosh(O))}}const ee={calculatedDuration:x&&y||null,velocity:ne=>hn(H(ne)),next:ne=>{if(!x&&M<1){const W=Math.exp(-M*C*ne),ye=Math.sin(X*ne),ie=Math.cos(X*ne),K=c-W*(j*ye+R*ie),O=hn(W*(te*ye+P*ie));return d.done=Math.abs(O)<=a&&Math.abs(c-K)<=o,d.value=d.done?c:K,d}const J=D(ne);if(x)d.done=ne>=y;else{const W=hn(H(ne));d.done=Math.abs(W)<=a&&Math.abs(c-J)<=o}return d.value=d.done?c:J,d},toString:()=>{const ne=Math.min(pm(ee),Du),J=O1(W=>ee.next(ne*W).value,ne,30);return ne+"ms "+J},toTransition:()=>{}};return ee}Nu.applyToOptions=e=>{const t=$_(e,100,Nu);return e.ease=t.ease,e.duration=hn(t.duration),e.type="keyframes",e};const a2=5;function z1(e,t,i){const a=Math.max(t-a2,0);return h1(i-e(a),t-a)}function mh({keyframes:e,velocity:t=0,power:i=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:u=500,modifyTarget:c,min:d,max:p,restDelta:m=.5,restSpeed:g}){const y=e[0],v={done:!1,value:y},x=P=>d!==void 0&&Pp,A=P=>d===void 0?p:p===void 0||Math.abs(d-P)-M*Math.exp(-P/a),D=P=>C+B(P),H=P=>{const ee=B(P),ne=D(P);v.done=Math.abs(ee)<=m,v.value=v.done?C:ne};let X,j;const te=P=>{x(v.value)&&(X=P,j=Nu({keyframes:[v.value,A(v.value)],velocity:z1(D,P,v.value),damping:o,stiffness:u,restDelta:m,restSpeed:g}))};return te(0),{calculatedDuration:null,next:P=>{let ee=!1;return!j&&X===void 0&&(ee=!0,H(P),te(P)),X!==void 0&&P>=X?j.next(P-X):(!ee&&H(P),v)}}}function s2(e,t,i){const a=[],o=i||dr.mix||R1,u=e.length-1;for(let c=0;ct[0];if(u===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=s2(t,a,o),p=d.length,m=g=>{if(c&&g1)for(;ym(Zn(e[0],e[u-1],g)):m}function l2(e,t){const i=e[e.length-1];for(let a=1;a<=t;a++){const o=vo(0,t,a);e.push(at(i,1,o))}}function u2(e){const t=[0];return l2(t,e.length-1),t}function c2(e,t){return e.map(i=>i*t)}function f2(e,t){return e.map(()=>t||S1).splice(0,e.length-1)}function fo({duration:e=300,keyframes:t,times:i,ease:a="easeInOut"}){const o=v_(a)?a.map(gb):gb(a),u={done:!1,value:t[0]},c=c2(i&&i.length===t.length?i:u2(t),e),d=o2(c,t,{ease:Array.isArray(o)?o:f2(t,o)});return{calculatedDuration:e,next:p=>(u.value=d(p),u.done=p>=e,u)}}const d2=e=>e!==null;function Qu(e,{repeat:t,repeatType:i="loop"},a,o=1){const u=e.filter(d2),d=o<0||t&&i!=="loop"&&t%2===1?0:u.length-1;return!d||a===void 0?u[d]:a}const h2={decay:mh,inertia:mh,tween:fo,keyframes:fo,spring:Nu};function j1(e){typeof e.type=="string"&&(e.type=h2[e.type])}class gm{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const m2=e=>e/100;class Ru extends gm{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var a,o;const{motionValue:i}=this.options;i&&i.updatedAt!==Ht.now()&&this.tick(Ht.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(a=this.options).onStop)==null||o.call(a))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;j1(t);const{type:i=fo,repeat:a=0,repeatDelay:o=0,repeatType:u,velocity:c=0}=t;let{keyframes:d}=t;const p=i||fo;p!==fo&&typeof d[0]!="number"&&(this.mixKeyframes=ko(m2,R1(d[0],d[1])),d=[0,100]);const m=p({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=p({...t,keyframes:[...d].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=pm(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+o,this.totalDuration=this.resolvedDuration*(a+1)-o,this.generator=m}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:a,totalDuration:o,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:p}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:v,repeatDelay:x,type:A,onUpdate:M,finalKeyframe:R}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const C=this.currentTime-m*(this.playbackSpeed>=0?1:-1),B=this.playbackSpeed>=0?C<0:C>o;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let D=this.currentTime,H=a;if(y){const P=Math.min(this.currentTime,o)/d;let ee=Math.floor(P),ne=P%1;!ne&&P>=1&&(ne=1),ne===1&&ee--,ee=Math.min(ee,y+1),!!(ee%2)&&(v==="reverse"?(ne=1-ne,x&&(ne-=x/d)):v==="mirror"&&(H=c)),D=Zn(0,1,ne)*d}let X;B?(this.delayState.value=g[0],X=this.delayState):X=H.next(D),u&&!B&&(X.value=u(X.value));let{done:j}=X;!B&&p!==null&&(j=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const te=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return te&&A!==mh&&(X.value=Qu(g,this.options,R,this.speed)),M&&M(X.value),te&&this.finish(),X}then(t,i){return this.finished.then(t,i)}get duration(){return An(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+An(t)}get time(){return An(this.currentTime)}set time(t){t=hn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const i=this.generator.next(t).value;return z1(a=>this.generator.next(a).value,t,i)}get speed(){return this.playbackSpeed}set speed(t){const i=this.playbackSpeed!==t;i&&this.driver&&this.updateTime(Ht.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=An(this.currentTime))}play(){var o,u;if(this.isStopped)return;const{driver:t=Z_,startTime:i}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(u=(o=this.options).onPlay)==null||u.call(o);const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=i??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ht.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(t=this.options).onComplete)==null||i.call(t)}cancel(){var t,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(t=this.options).onCancel)==null||i.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),t.observe(this)}}function p2(e){for(let t=1;te*180/Math.PI,ph=e=>{const t=Gr(Math.atan2(e[1],e[0]));return gh(t)},g2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ph,rotateZ:ph,skewX:e=>Gr(Math.atan(e[1])),skewY:e=>Gr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},gh=e=>(e=e%360,e<0&&(e+=360),e),Tb=ph,Eb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ab=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),y2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Eb,scaleY:Ab,scale:e=>(Eb(e)+Ab(e))/2,rotateX:e=>gh(Gr(Math.atan2(e[6],e[5]))),rotateY:e=>gh(Gr(Math.atan2(-e[2],e[0]))),rotateZ:Tb,rotate:Tb,skewX:e=>Gr(Math.atan(e[4])),skewY:e=>Gr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function yh(e){return e.includes("scale")?1:0}function bh(e,t){if(!e||e==="none")return yh(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(i)a=y2,o=i;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=g2,o=d}if(!o)return yh(t);const u=a[t],c=o[1].split(",").map(v2);return typeof u=="function"?u(c):c[u]}const b2=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return bh(i,t)};function v2(e){return parseFloat(e.trim())}const is=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],rs=new Set(is),_b=e=>e===ns||e===me,x2=new Set(["x","y","z"]),w2=is.filter(e=>!x2.has(e));function S2(e){const t=[];return w2.forEach(i=>{const a=e.getValue(i);a!==void 0&&(t.push([i,a.get()]),a.set(i.startsWith("scale")?1:0))}),t}const ur={width:({x:e},{paddingLeft:t="0",paddingRight:i="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(i)},height:({y:e},{paddingTop:t="0",paddingBottom:i="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(i)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bh(t,"x"),y:(e,{transform:t})=>bh(t,"y")};ur.translateX=ur.x;ur.translateY=ur.y;const Xr=new Set;let vh=!1,xh=!1,wh=!1;function L1(){if(xh){const e=Array.from(Xr).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),i=new Map;t.forEach(a=>{const o=S2(a);o.length&&(i.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=i.get(a);o&&o.forEach(([u,c])=>{var d;(d=a.getValue(u))==null||d.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}xh=!1,vh=!1,Xr.forEach(e=>e.complete(wh)),Xr.clear()}function I1(){Xr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xh=!0)})}function T2(){wh=!0,I1(),L1(),wh=!1}class ym{constructor(t,i,a,o,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=a,this.motionValue=o,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(Xr.add(this),vh||(vh=!0,Je.read(I1),Je.resolveKeyframes(L1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:a,motionValue:o}=this;if(t[0]===null){const u=o==null?void 0:o.get(),c=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&i){const d=a.readValue(i,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),o&&u===void 0&&o.set(t[0])}p2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xr.delete(this)}cancel(){this.state==="scheduled"&&(Xr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const E2=e=>e.startsWith("--");function U1(e,t,i){E2(t)?e.style.setProperty(t,i):e.style[t]=i}const A2={};function B1(e,t){const i=d1(e);return()=>A2[t]??i()}const _2=B1(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),P1=B1(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),uo=([e,t,i,a])=>`cubic-bezier(${e}, ${t}, ${i}, ${a})`,Cb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:uo([0,.65,.55,1]),circOut:uo([.55,0,1,.45]),backIn:uo([.31,.01,.66,-.59]),backOut:uo([.33,1.53,.69,.99])};function V1(e,t){if(e)return typeof e=="function"?P1()?O1(e,t):"ease-out":T1(e)?uo(e):Array.isArray(e)?e.map(i=>V1(i,t)||Cb.easeOut):Cb[e]}function C2(e,t,i,{delay:a=0,duration:o=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:p}={},m=void 0){const g={[t]:i};p&&(g.offset=p);const y=V1(d,o);Array.isArray(y)&&(g.easing=y);const v={delay:a,duration:o,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(g,v)}function H1(e){return typeof e=="function"&&"applyToOptions"in e}function k2({type:e,...t}){return H1(e)&&P1()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class q1 extends gm{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:a,keyframes:o,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:p}=t;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=t,om(typeof t.type!="string");const m=k2(t);this.animation=C2(i,a,o,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=Qu(o,this.options,d,this.speed);this.updateMotionValue&&this.updateMotionValue(g),U1(i,a,g),this.animation.cancel()}p==null||p(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,i;(i=(t=this.animation).finish)==null||i.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,a,o;const t=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(a=this.animation).commitStyles)==null||o.call(a))}get duration(){var i,a;const t=((a=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:a.call(i).duration)||0;return An(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+An(t)}get time(){return An(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=hn(t),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:i,rangeEnd:a,observe:o}){var u;return this.allowFlatten&&((u=this.animation.effect)==null||u.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&_2()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),a&&(this.animation.rangeEnd=a),_n):o(this)}}const F1={anticipate:v1,backInOut:b1,circInOut:w1};function M2(e){return e in F1}function D2(e){typeof e.ease=="string"&&M2(e.ease)&&(e.ease=F1[e.ease])}const Nd=10;class N2 extends q1{constructor(t){D2(t),j1(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:a,onComplete:o,element:u,...c}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const d=new Ru({...c,autoplay:!1}),p=Math.max(Nd,Ht.now()-this.startTime),m=Zn(0,Nd,p-Nd),g=d.sample(p).value,{name:y}=this.options;u&&y&&U1(u,y,g),i.setWithVelocity(d.sample(Math.max(0,p-m)).value,g,m),d.stop()}}const kb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(jn.test(e)||e==="0")&&!e.startsWith("url("));function R2(e){const t=e[0];if(e.length===1)return!0;for(let i=0;iObject.hasOwnProperty.call(Element.prototype,"animate"));function U2(e){var y;const{motionValue:t,name:i,repeatDelay:a,repeatType:o,damping:u,type:c,keyframes:d}=e;if(!(((y=t==null?void 0:t.owner)==null?void 0:y.current)instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=t.owner.getProps();return I2()&&i&&(G1.has(i)||L2.has(i)&&j2(d))&&(i!=="transform"||!g)&&!m&&!a&&o!=="mirror"&&u!==0&&c!=="inertia"}const B2=40;class P2 extends gm{constructor({autoplay:t=!0,delay:i=0,type:a="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:c="loop",keyframes:d,name:p,motionValue:m,element:g,...y}){var A;super(),this.stop=()=>{var M,R;this._animation&&(this._animation.stop(),(M=this.stopTimeline)==null||M.call(this)),(R=this.keyframeResolver)==null||R.cancel()},this.createdAt=Ht.now();const v={autoplay:t,delay:i,type:a,repeat:o,repeatDelay:u,repeatType:c,name:p,motionValue:m,element:g,...y},x=(g==null?void 0:g.KeyframeResolver)||ym;this.keyframeResolver=new x(d,(M,R,C)=>this.onKeyframesResolved(M,R,v,!C),p,m,g),(A=this.keyframeResolver)==null||A.scheduleResolve()}onKeyframesResolved(t,i,a,o){var C,B;this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:p,isHandoff:m,onUpdate:g}=a;this.resolvedAt=Ht.now();let y=!0;O2(t,u,c,d)||(y=!1,(dr.instantAnimations||!p)&&(g==null||g(Qu(t,a,i))),t[0]=t[t.length-1],Sh(a),a.repeat=0);const x={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>B2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...a,keyframes:t},A=y&&!m&&U2(x),M=(B=(C=x.motionValue)==null?void 0:C.owner)==null?void 0:B.current;let R;if(A)try{R=new N2({...x,element:M})}catch{R=new Ru(x)}else R=new Ru(x);R.finished.then(()=>{this.notifyFinished()}).catch(_n),this.pendingTimeline&&(this.stopTimeline=R.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=R}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),T2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Y1(e,t,i,a=0,o=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),c=e.size,d=(c-1)*a;return typeof i=="function"?i(u,c):o===1?u*a:d-u*a}const V2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function H2(e){const t=V2.exec(e);if(!t)return[,];const[,i,a,o]=t;return[`--${i??a}`,o]}function X1(e,t,i=1){const[a,o]=H2(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const c=u.trim();return u1(c)?parseFloat(c):c}return fm(o)?X1(o,t,i+1):o}const q2={type:"spring",stiffness:500,damping:25,restSpeed:10},F2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),G2={type:"keyframes",duration:.8},Y2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},X2=(e,{keyframes:t})=>t.length>2?G2:rs.has(e)?e.startsWith("scale")?F2(t[1]):q2:Y2;function K1(e,t){if(e!=null&&e.inherit&&t){const{inherit:i,...a}=e;return{...t,...a}}return e}function bm(e,t){const i=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return i!==e?K1(i,e):i}const K2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Q2(e){for(const t in e)if(!K2.has(t))return!0;return!1}const vm=(e,t,i,a={},o,u)=>c=>{const d=bm(a,e)||{},p=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-hn(p);const g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:o};Q2(d)||Object.assign(g,X2(e,g)),g.duration&&(g.duration=hn(g.duration)),g.repeatDelay&&(g.repeatDelay=hn(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Sh(g),g.delay===0&&(y=!0)),(dr.instantAnimations||dr.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(y=!0,Sh(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,y&&!u&&t.get()!==void 0){const v=Qu(g.keyframes,d);if(v!==void 0){Je.update(()=>{g.onUpdate(v),g.onComplete()});return}}return d.isSync?new Ru(g):new P2(g)};function Mb(e){const t=[{},{}];return e==null||e.values.forEach((i,a)=>{t[0][a]=i.get(),t[1][a]=i.getVelocity()}),t}function xm(e,t,i,a){if(typeof t=="function"){const[o,u]=Mb(a);t=t(i!==void 0?i:e.custom,o,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,u]=Mb(a);t=t(i!==void 0?i:e.custom,o,u)}return t}function Kr(e,t,i){const a=e.getProps();return xm(a,t,i!==void 0?i:a.custom,e)}const Q1=new Set(["width","height","top","left","right","bottom",...is]),Db=30,W2=e=>!isNaN(parseFloat(e));class Z2{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{var u;const o=Ht.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&((u=this.events.change)==null||u.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=Ht.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=W2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new lm);const a=this.events[t].add(i);return t==="change"?()=>{a(),Je.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,a){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ht.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Db)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Db);return h1(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,i;(t=this.dependents)==null||t.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Za(e,t){return new Z2(e,t)}const Th=e=>Array.isArray(e);function $2(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,Za(i))}function J2(e){return Th(e)?e[e.length-1]||0:e}function eC(e,t){const i=Kr(e,t);let{transitionEnd:a={},transition:o={},...u}=i||{};u={...u,...a};for(const c in u){const d=J2(u[c]);$2(e,c,d)}}const Rt=e=>!!(e&&e.getVelocity);function tC(e){return!!(Rt(e)&&e.add)}function Eh(e,t){const i=e.getValue("willChange");if(tC(i))return i.add(t);if(!i&&dr.WillChange){const a=new dr.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function wm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const nC="framerAppearId",W1="data-"+wm(nC);function Z1(e){return e.props[W1]}function iC({protectedKeys:e,needsAnimating:t},i){const a=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,a}function $1(e,t,{delay:i=0,transitionOverride:a,type:o}={}){let{transition:u,transitionEnd:c,...d}=t;const p=e.getDefaultTransition();u=u?K1(u,p):p;const m=u==null?void 0:u.reduceMotion;a&&(u=a);const g=[],y=o&&e.animationState&&e.animationState.getState()[o];for(const v in d){const x=e.getValue(v,e.latestValues[v]??null),A=d[v];if(A===void 0||y&&iC(y,v))continue;const M={delay:i,...bm(u||{},v)},R=x.get();if(R!==void 0&&!x.isAnimating()&&!Array.isArray(A)&&A===R&&!M.velocity){Je.update(()=>x.set(A));continue}let C=!1;if(window.MotionHandoffAnimation){const H=Z1(e);if(H){const X=window.MotionHandoffAnimation(H,v,Je);X!==null&&(M.startTime=X,C=!0)}}Eh(e,v);const B=m??e.shouldReduceMotion;x.start(vm(v,x,A,B&&Q1.has(v)?{type:!1}:M,e,C));const D=x.animation;D&&g.push(D)}if(c){const v=()=>Je.update(()=>{c&&eC(e,c)});g.length?Promise.all(g).then(v):v()}return g}function Ah(e,t,i={}){var p;const a=Kr(e,t,i.type==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};i.transitionOverride&&(o=i.transitionOverride);const u=a?()=>Promise.all($1(e,a,i)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:v}=o;return rC(e,t,m,g,y,v,i)}:()=>Promise.resolve(),{when:d}=o;if(d){const[m,g]=d==="beforeChildren"?[u,c]:[c,u];return m().then(()=>g())}else return Promise.all([u(),c(i.delay)])}function rC(e,t,i=0,a=0,o=0,u=1,c){const d=[];for(const p of e.variantChildren)p.notify("AnimationStart",t),d.push(Ah(p,t,{...c,delay:i+(typeof a=="function"?0:a)+Y1(e.variantChildren,p,a,o,u)}).then(()=>p.notify("AnimationComplete",t)));return Promise.all(d)}function aC(e,t,i={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(u=>Ah(e,u,i));a=Promise.all(o)}else if(typeof t=="string")a=Ah(e,t,i);else{const o=typeof t=="function"?Kr(e,t,i.custom):t;a=Promise.all($1(e,o,i))}return a.then(()=>{e.notify("AnimationComplete",t)})}const sC={test:e=>e==="auto",parse:e=>e},J1=e=>t=>t.test(e),ew=[ns,me,Qn,rr,R_,N_,sC],Nb=e=>ew.find(J1(e));function oC(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||f1(e):!0}const lC=new Set(["brightness","contrast","saturate","opacity"]);function uC(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=i.match(dm)||[];if(!a)return e;const o=i.replace(a,"");let u=lC.has(t)?1:0;return a!==i&&(u*=100),t+"("+u+o+")"}const cC=/\b([a-z-]*)\(.*?\)/gu,_h={...jn,getAnimatableNone:e=>{const t=e.match(cC);return t?t.map(uC).join(" "):e}},Ch={...jn,getAnimatableNone:e=>{const t=jn.parse(e);return jn.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},Rb={...ns,transform:Math.round},fC={rotate:rr,rotateX:rr,rotateY:rr,rotateZ:rr,scale:iu,scaleX:iu,scaleY:iu,scaleZ:iu,skew:rr,skewX:rr,skewY:rr,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:xo,originX:bb,originY:bb,originZ:me},Sm={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,inset:me,insetBlock:me,insetBlockStart:me,insetBlockEnd:me,insetInline:me,insetInlineStart:me,insetInlineEnd:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,paddingBlock:me,paddingBlockStart:me,paddingBlockEnd:me,paddingInline:me,paddingInlineStart:me,paddingInlineEnd:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,marginBlock:me,marginBlockStart:me,marginBlockEnd:me,marginInline:me,marginInlineStart:me,marginInlineEnd:me,fontSize:me,backgroundPositionX:me,backgroundPositionY:me,...fC,zIndex:Rb,fillOpacity:xo,strokeOpacity:xo,numOctaves:Rb},dC={...Sm,color:yt,backgroundColor:yt,outlineColor:yt,fill:yt,stroke:yt,borderColor:yt,borderTopColor:yt,borderRightColor:yt,borderBottomColor:yt,borderLeftColor:yt,filter:_h,WebkitFilter:_h,mask:Ch,WebkitMask:Ch},tw=e=>dC[e],hC=new Set([_h,Ch]);function nw(e,t){let i=tw(e);return hC.has(i)||(i=jn),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const mC=new Set(["auto","none","0"]);function pC(e,t,i){let a=0,o;for(;a{t.getValue(p).set(m)}),this.resolveNoneKeyframes()}}function iw(e,t,i){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=(i==null?void 0:i[e])??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const rw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function gu(e){return c1(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Tm}=E1(queueMicrotask,!1),Rn={x:!1,y:!1};function aw(){return Rn.x||Rn.y}function yC(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function sw(e,t){const i=iw(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[i,o,()=>a.abort()]}function bC(e){return!(e.pointerType==="touch"||aw())}function vC(e,t,i={}){const[a,o,u]=sw(e,i);return a.forEach(c=>{let d=!1,p=!1,m;const g=()=>{c.removeEventListener("pointerleave",A)},y=R=>{m&&(m(R),m=void 0),g()},v=R=>{d=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),p&&(p=!1,y(R))},x=()=>{d=!0,window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",v,o)},A=R=>{if(R.pointerType!=="touch"){if(d){p=!0;return}y(R)}},M=R=>{if(!bC(R))return;p=!1;const C=t(c,R);typeof C=="function"&&(m=C,c.addEventListener("pointerleave",A,o))};c.addEventListener("pointerenter",M,o),c.addEventListener("pointerdown",x,o)}),u}const ow=(e,t)=>t?e===t?!0:ow(e,t.parentElement):!1,Em=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,xC=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wC(e){return xC.has(e.tagName)||e.isContentEditable===!0}const SC=new Set(["INPUT","SELECT","TEXTAREA"]);function TC(e){return SC.has(e.tagName)||e.isContentEditable===!0}const yu=new WeakSet;function Ob(e){return t=>{t.key==="Enter"&&e(t)}}function Rd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const EC=(e,t)=>{const i=e.currentTarget;if(!i)return;const a=Ob(()=>{if(yu.has(i))return;Rd(i,"down");const o=Ob(()=>{Rd(i,"up")}),u=()=>Rd(i,"cancel");i.addEventListener("keyup",o,t),i.addEventListener("blur",u,t)});i.addEventListener("keydown",a,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",a),t)};function zb(e){return Em(e)&&!aw()}const jb=new WeakSet;function AC(e,t,i={}){const[a,o,u]=sw(e,i),c=d=>{const p=d.currentTarget;if(!zb(d)||jb.has(d))return;yu.add(p),i.stopPropagation&&jb.add(d);const m=t(p,d),g=(x,A)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),yu.has(p)&&yu.delete(p),zb(x)&&typeof m=="function"&&m(x,{success:A})},y=x=>{g(x,p===window||p===document||i.useGlobalTarget||ow(p,x.target))},v=x=>{g(x,!1)};window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",v,o)};return a.forEach(d=>{(i.useGlobalTarget?window:d).addEventListener("pointerdown",c,o),gu(d)&&(d.addEventListener("focus",m=>EC(m,o)),!wC(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function Am(e){return c1(e)&&"ownerSVGElement"in e}const bu=new WeakMap;let ar;const lw=(e,t,i)=>(a,o)=>o&&o[0]?o[0][e+"Size"]:Am(a)&&"getBBox"in a?a.getBBox()[t]:a[i],_C=lw("inline","width","offsetWidth"),CC=lw("block","height","offsetHeight");function kC({target:e,borderBoxSize:t}){var i;(i=bu.get(e))==null||i.forEach(a=>{a(e,{get width(){return _C(e,t)},get height(){return CC(e,t)}})})}function MC(e){e.forEach(kC)}function DC(){typeof ResizeObserver>"u"||(ar=new ResizeObserver(MC))}function NC(e,t){ar||DC();const i=iw(e);return i.forEach(a=>{let o=bu.get(a);o||(o=new Set,bu.set(a,o)),o.add(t),ar==null||ar.observe(a)}),()=>{i.forEach(a=>{const o=bu.get(a);o==null||o.delete(t),o!=null&&o.size||ar==null||ar.unobserve(a)})}}const vu=new Set;let Ha;function RC(){Ha=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};vu.forEach(t=>t(e))},window.addEventListener("resize",Ha)}function OC(e){return vu.add(e),Ha||RC(),()=>{vu.delete(e),!vu.size&&typeof Ha=="function"&&(window.removeEventListener("resize",Ha),Ha=void 0)}}function Lb(e,t){return typeof e=="function"?OC(e):NC(e,t)}function zC(e){return Am(e)&&e.tagName==="svg"}const jC=[...ew,yt,jn],LC=e=>jC.find(J1(e)),Ib=()=>({translate:0,scale:1,origin:0,originPoint:0}),qa=()=>({x:Ib(),y:Ib()}),Ub=()=>({min:0,max:0}),wt=()=>({x:Ub(),y:Ub()}),IC=new WeakMap;function Wu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wo(e){return typeof e=="string"||Array.isArray(e)}const _m=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cm=["initial",..._m];function Zu(e){return Wu(e.animate)||Cm.some(t=>wo(e[t]))}function uw(e){return!!(Zu(e)||e.variants)}function UC(e,t,i){for(const a in t){const o=t[a],u=i[a];if(Rt(o))e.addValue(a,o);else if(Rt(u))e.addValue(a,Za(o,{owner:e}));else if(u!==o)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(a);e.addValue(a,Za(c!==void 0?c:o,{owner:e}))}}for(const a in i)t[a]===void 0&&e.removeValue(a);return t}const kh={current:null},cw={current:!1},BC=typeof window<"u";function PC(){if(cw.current=!0,!!BC)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>kh.current=e.matches;e.addEventListener("change",t),t()}else kh.current=!1}const Bb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ou={};function fw(e){Ou=e}function VC(){return Ou}class HC{scrapeMotionValuesFromProps(t,i,a){return{}}constructor({parent:t,props:i,presenceContext:a,reducedMotionConfig:o,skipAnimations:u,blockInitialAnimation:c,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ym,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Ht.now();this.renderScheduledAtthis.bindToMotionValue(u,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(cw.current||PC(),this.shouldReduceMotion=kh.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(a=this.parent)==null||a.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),hr(this.notifyUpdate),hr(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const a=this.features[i];a&&(a.unmount(),a.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,i){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),i.accelerate&&G1.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:d,times:p,ease:m,duration:g}=i.accelerate,y=new q1({element:this.current,name:t,keyframes:d,times:p,ease:m,duration:hn(g)}),v=c(y);this.valueSubscriptions.set(t,()=>{v(),y.cancel()});return}const a=rs.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=i.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&Je.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{o(),u&&u(),i.owner&&i.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ou){const i=Ou[t];if(!i)continue;const{isEnabled:a,Feature:o}=i;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let a=0;ai.variantChildren.delete(t)}addValue(t,i){const a=this.values.get(t);i!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&i!==void 0&&(a=Za(i===null?void 0:i,{owner:this}),this.addValue(t,a)),a}readValue(t,i){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(u1(a)||f1(a))?a=parseFloat(a):!LC(a)&&jn.test(i)&&(a=nw(t,i)),this.setBaseTarget(t,Rt(a)?a.get():a)),Rt(a)?a.get():a}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){var u;const{initial:i}=this.props;let a;if(typeof i=="string"||typeof i=="object"){const c=xm(this.props,i,(u=this.presenceContext)==null?void 0:u.custom);c&&(a=c[t])}if(i&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Rt(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new lm),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){Tm.render(this.render)}}class dw extends HC{constructor(){super(...arguments),this.KeyframeResolver=gC}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){const a=t.style;return a?a[i]:void 0}removeValueFromRenderState(t,{vars:i,style:a}){delete i[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Rt(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class pr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function hw({top:e,left:t,right:i,bottom:a}){return{x:{min:t,max:i},y:{min:e,max:a}}}function qC({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FC(e,t){if(!t)return e;const i=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:a.y,right:a.x}}function Od(e){return e===void 0||e===1}function Mh({scale:e,scaleX:t,scaleY:i}){return!Od(e)||!Od(t)||!Od(i)}function Vr(e){return Mh(e)||mw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mw(e){return Pb(e.x)||Pb(e.y)}function Pb(e){return e&&e!=="0%"}function zu(e,t,i){const a=e-i,o=t*a;return i+o}function Vb(e,t,i,a,o){return o!==void 0&&(e=zu(e,o,a)),zu(e,i,a)+t}function Dh(e,t=0,i=1,a,o){e.min=Vb(e.min,t,i,a,o),e.max=Vb(e.max,t,i,a,o)}function pw(e,{x:t,y:i}){Dh(e.x,t.translate,t.scale,t.originPoint),Dh(e.y,i.translate,i.scale,i.originPoint)}const Hb=.999999999999,qb=1.0000000000001;function GC(e,t,i,a=!1){var d;const o=i.length;if(!o)return;t.x=t.y=1;let u,c;for(let p=0;pHb&&(t.x=1),t.yHb&&(t.y=1)}function Yn(e,t){e.min+=t,e.max+=t}function Fb(e,t,i,a,o=.5){const u=at(e.min,e.max,o);Dh(e,t,i,u,a)}function Gb(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function xu(e,t,i){const a=i??e;Fb(e.x,Gb(t.x,a.x),t.scaleX,t.scale,t.originX),Fb(e.y,Gb(t.y,a.y),t.scaleY,t.scale,t.originY)}function gw(e,t){return hw(FC(e.getBoundingClientRect(),t))}function YC(e,t,i){const a=gw(e,i),{scroll:o}=t;return o&&(Yn(a.x,o.offset.x),Yn(a.y,o.offset.y)),a}const XC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KC=is.length;function QC(e,t,i){let a="",o=!0;for(let u=0;u{if(!t.target)return e;if(typeof e=="string")if(me.test(e))e=parseFloat(e);else return e;const i=Yb(e,t.target.x),a=Yb(e,t.target.y);return`${i}% ${a}%`}},WC={correct:(e,{treeScale:t,projectionDelta:i})=>{const a=e,o=jn.parse(e);if(o.length>5)return a;const u=jn.createTransformer(e),c=typeof o[0]!="number"?1:0,d=i.x.scale*t.x,p=i.y.scale*t.y;o[0+c]/=d,o[1+c]/=p;const m=at(d,p,.5);return typeof o[2+c]=="number"&&(o[2+c]/=m),typeof o[3+c]=="number"&&(o[3+c]/=m),u(o)}},Nh={borderRadius:{...to,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:to,borderTopRightRadius:to,borderBottomLeftRadius:to,borderBottomRightRadius:to,boxShadow:WC};function bw(e,{layout:t,layoutId:i}){return rs.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!Nh[e]||e==="opacity")}function Mm(e,t,i){var c;const a=e.style,o=t==null?void 0:t.style,u={};if(!a)return u;for(const d in a)(Rt(a[d])||o&&Rt(o[d])||bw(d,e)||((c=i==null?void 0:i.getValue(d))==null?void 0:c.liveStyle)!==void 0)&&(u[d]=a[d]);return u}function ZC(e){return window.getComputedStyle(e)}class $C extends dw{constructor(){super(...arguments),this.type="html",this.renderInstance=yw}readValueFromInstance(t,i){var a;if(rs.has(i))return(a=this.projection)!=null&&a.isProjecting?yh(i):b2(t,i);{const o=ZC(t),u=(_1(i)?o.getPropertyValue(i):o[i])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:i}){return gw(t,i)}build(t,i,a){km(t,i,a.transformTemplate)}scrapeMotionValuesFromProps(t,i,a){return Mm(t,i,a)}}const JC={offset:"stroke-dashoffset",array:"stroke-dasharray"},ek={offset:"strokeDashoffset",array:"strokeDasharray"};function tk(e,t,i=1,a=0,o=!0){e.pathLength=1;const u=o?JC:ek;e[u.offset]=`${-a}`,e[u.array]=`${t} ${i}`}const nk=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function vw(e,{attrX:t,attrY:i,attrScale:a,pathLength:o,pathSpacing:u=1,pathOffset:c=0,...d},p,m,g){if(km(e,d,m),p){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:v}=e;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=(g==null?void 0:g.transformBox)??"fill-box",delete y.transformBox);for(const x of nk)y[x]!==void 0&&(v[x]=y[x],delete y[x]);t!==void 0&&(y.x=t),i!==void 0&&(y.y=i),a!==void 0&&(y.scale=a),o!==void 0&&tk(y,o,u,c,!1)}const xw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ww=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ik(e,t,i,a){yw(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(xw.has(o)?o:wm(o),t.attrs[o])}function Sw(e,t,i){const a=Mm(e,t,i);for(const o in e)if(Rt(e[o])||Rt(t[o])){const u=is.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[u]=e[o]}return a}class rk extends dw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wt}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(rs.has(i)){const a=tw(i);return a&&a.default||0}return i=xw.has(i)?i:wm(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,a){return Sw(t,i,a)}build(t,i,a){vw(t,i,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,i,a,o){ik(t,i,a,o)}mount(t){this.isSVGTag=ww(t.tagName),super.mount(t)}}const ak=Cm.length;function Tw(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?Tw(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;iPromise.all(t.map(({animation:i,options:a})=>aC(e,i,a)))}function uk(e){let t=lk(e),i=Xb(),a=!0,o=!1;const u=m=>(g,y)=>{var x;const v=Kr(e,y,m==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(v){const{transition:A,transitionEnd:M,...R}=v;g={...g,...R,...M}}return g};function c(m){t=m(e)}function d(m){const{props:g}=e,y=Tw(e.parent)||{},v=[],x=new Set;let A={},M=1/0;for(let C=0;CM&&X,ne=!1;const J=Array.isArray(H)?H:[H];let W=J.reduce(u(B),{});j===!1&&(W={});const{prevResolvedValues:ye={}}=D,ie={...ye,...W},K=ae=>{ee=!0,x.has(ae)&&(ne=!0,x.delete(ae)),D.needsAnimating[ae]=!0;const ce=e.getValue(ae);ce&&(ce.liveStyle=!1)};for(const ae in ie){const ce=W[ae],T=ye[ae];if(A.hasOwnProperty(ae))continue;let k=!1;Th(ce)&&Th(T)?k=!Ew(ce,T):k=ce!==T,k?ce!=null?K(ae):x.add(ae):ce!==void 0&&x.has(ae)?K(ae):D.protectedKeys[ae]=!0}D.prevProp=H,D.prevResolvedValues=W,D.isActive&&(A={...A,...W}),(a||o)&&e.blockInitialAnimation&&(ee=!1);const O=te&&P;ee&&(!O||ne)&&v.push(...J.map(ae=>{const ce={type:B};if(typeof ae=="string"&&(a||o)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:T}=e,k=Kr(T,ae);if(T.enteringChildren&&k){const{delayChildren:q}=k.transition||{};ce.delay=Y1(T.enteringChildren,e,q)}}return{animation:ae,options:ce}}))}if(x.size){const C={};if(typeof g.initial!="boolean"){const B=Kr(e,Array.isArray(g.initial)?g.initial[0]:g.initial);B&&B.transition&&(C.transition=B.transition)}x.forEach(B=>{const D=e.getBaseTarget(B),H=e.getValue(B);H&&(H.liveStyle=!0),C[B]=D??null}),v.push({animation:C})}let R=!!v.length;return a&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(R=!1),a=!1,o=!1,R?t(v):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=e.variantChildren)==null||v.forEach(x=>{var A;return(A=x.animationState)==null?void 0:A.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const x in i)i[x].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:c,getState:()=>i,reset:()=>{i=Xb(),o=!0}}}function ck(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ew(t,e):!1}function Br(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xb(){return{animate:Br(!0),whileInView:Br(),whileHover:Br(),whileTap:Br(),whileDrag:Br(),whileFocus:Br(),exit:Br()}}function Rh(e,t){e.min=t.min,e.max=t.max}function Nn(e,t){Rh(e.x,t.x),Rh(e.y,t.y)}function Kb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Aw=1e-4,fk=1-Aw,dk=1+Aw,_w=.01,hk=0-_w,mk=0+_w;function qt(e){return e.max-e.min}function pk(e,t,i){return Math.abs(e-t)<=i}function Qb(e,t,i,a=.5){e.origin=a,e.originPoint=at(t.min,t.max,e.origin),e.scale=qt(i)/qt(t),e.translate=at(i.min,i.max,e.origin)-e.originPoint,(e.scale>=fk&&e.scale<=dk||isNaN(e.scale))&&(e.scale=1),(e.translate>=hk&&e.translate<=mk||isNaN(e.translate))&&(e.translate=0)}function ho(e,t,i,a){Qb(e.x,t.x,i.x,a?a.originX:void 0),Qb(e.y,t.y,i.y,a?a.originY:void 0)}function Wb(e,t,i,a=0){const o=a?at(i.min,i.max,a):i.min;e.min=o+t.min,e.max=e.min+qt(t)}function gk(e,t,i,a){Wb(e.x,t.x,i.x,a==null?void 0:a.x),Wb(e.y,t.y,i.y,a==null?void 0:a.y)}function Zb(e,t,i,a=0){const o=a?at(i.min,i.max,a):i.min;e.min=t.min-o,e.max=e.min+qt(t)}function ju(e,t,i,a){Zb(e.x,t.x,i.x,a==null?void 0:a.x),Zb(e.y,t.y,i.y,a==null?void 0:a.y)}function $b(e,t,i,a,o){return e-=t,e=zu(e,1/i,a),o!==void 0&&(e=zu(e,1/o,a)),e}function yk(e,t=0,i=1,a=.5,o,u=e,c=e){if(Qn.test(t)&&(t=parseFloat(t),t=at(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=at(u.min,u.max,a);e===u&&(d-=t),e.min=$b(e.min,t,i,d,o),e.max=$b(e.max,t,i,d,o)}function Jb(e,t,[i,a,o],u,c){yk(e,t[i],t[a],t[o],t.scale,u,c)}const bk=["x","scaleX","originX"],vk=["y","scaleY","originY"];function ev(e,t,i,a){Jb(e.x,t,bk,i?i.x:void 0,a?a.x:void 0),Jb(e.y,t,vk,i?i.y:void 0,a?a.y:void 0)}function tv(e){return e.translate===0&&e.scale===1}function Cw(e){return tv(e.x)&&tv(e.y)}function nv(e,t){return e.min===t.min&&e.max===t.max}function xk(e,t){return nv(e.x,t.x)&&nv(e.y,t.y)}function iv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kw(e,t){return iv(e.x,t.x)&&iv(e.y,t.y)}function rv(e){return qt(e.x)/qt(e.y)}function av(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Fn(e){return[e("x"),e("y")]}function wk(e,t,i){let a="";const o=e.x.translate/t.x,u=e.y.translate/t.y,c=(i==null?void 0:i.z)||0;if((o||u||c)&&(a=`translate3d(${o}px, ${u}px, ${c}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:m,rotate:g,rotateX:y,rotateY:v,skewX:x,skewY:A}=i;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),v&&(a+=`rotateY(${v}deg) `),x&&(a+=`skewX(${x}deg) `),A&&(a+=`skewY(${A}deg) `)}const d=e.x.scale*t.x,p=e.y.scale*t.y;return(d!==1||p!==1)&&(a+=`scale(${d}, ${p})`),a||"none"}const Mw=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Sk=Mw.length,sv=e=>typeof e=="string"?parseFloat(e):e,ov=e=>typeof e=="number"||me.test(e);function Tk(e,t,i,a,o,u){o?(e.opacity=at(0,i.opacity??1,Ek(a)),e.opacityExit=at(t.opacity??1,0,Ak(a))):u&&(e.opacity=at(t.opacity??1,i.opacity??1,a));for(let c=0;cat?1:i(vo(e,t,a))}function _k(e,t,i){const a=Rt(e)?e:Za(e);return a.start(vm("",a,t,i)),a.animation}function So(e,t,i,a={passive:!0}){return e.addEventListener(t,i,a),()=>e.removeEventListener(t,i)}const Ck=(e,t)=>e.depth-t.depth;class kk{constructor(){this.children=[],this.isDirty=!1}add(t){sm(this.children,t),this.isDirty=!0}remove(t){ku(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ck),this.isDirty=!1,this.children.forEach(t)}}function Mk(e,t){const i=Ht.now(),a=({timestamp:o})=>{const u=o-i;u>=t&&(hr(a),e(u-t))};return Je.setup(a,!0),()=>hr(a)}function wu(e){return Rt(e)?e.get():e}class Dk{constructor(){this.members=[]}add(t){sm(this.members,t);for(let i=this.members.length-1;i>=0;i--){const a=this.members[i];if(a===t||a===this.lead||a===this.prevLead)continue;const o=a.instance;(!o||o.isConnected===!1)&&!a.snapshot&&(ku(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(ku(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){var i;for(let a=this.members.indexOf(t)-1;a>=0;a--){const o=this.members[a];if(o.isPresent!==!1&&((i=o.instance)==null?void 0:i.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,i){var o;const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:u}=a.options,{layoutDependency:c}=t.options;(u===void 0||u!==c)&&(t.resumeFrom=a,i&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var i,a,o,u,c;(a=(i=t.options).onExitComplete)==null||a.call(i),(c=(o=t.resumingFrom)==null?void 0:(u=o.options).onExitComplete)==null||c.call(u)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Su={hasAnimatedSinceResize:!0,hasEverUpdated:!1},zd=["","X","Y","Z"],Nk=1e3;let Rk=0;function jd(e,t,i,a){const{latestValues:o}=t;o[e]&&(i[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function Nw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=Z1(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:o,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",Je,!(o||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&Nw(a)}function Rw({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(c={},d=t==null?void 0:t()){this.id=Rk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jk),this.nodes.forEach(Vk),this.nodes.forEach(Hk),this.nodes.forEach(Lk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let p=0;pthis.root.updateBlockedByResize=!1;Je.read(()=>{y=window.innerWidth}),e(c,()=>{const x=window.innerWidth;x!==y&&(y=x,this.root.updateBlockedByResize=!0,g&&g(),g=Mk(v,250),Su.hasAnimatedSinceResize&&(Su.hasAnimatedSinceResize=!1,this.nodes.forEach(fv)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||p)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||m.getDefaultTransition()||Xk,{onLayoutAnimationStart:M,onLayoutAnimationComplete:R}=m.getProps(),C=!this.targetLayout||!kw(this.targetLayout,x),B=!y&&v;if(this.options.layoutRoot||this.resumeFrom||B||y&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const D={...bm(A,"layout"),onPlay:M,onComplete:R};(m.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D),this.setAnimationOrigin(g,B)}else y||fv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),hr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qk),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Nw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!qt(this.snapshot.measuredBox.x)&&!qt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p{const X=H/1e3;dv(y.x,c.x,X),dv(y.y,c.y,X),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ju(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Gk(this.relativeTarget,this.relativeTargetOrigin,v,X),D&&xk(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=wt()),Nn(D,this.relativeTarget)),M&&(this.animationValues=g,Tk(g,m,this.latestValues,X,B,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=X},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,p,m;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(m=(p=this.resumingFrom)==null?void 0:p.currentAnimation)==null||m.stop(),this.pendingAnimation&&(hr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{Su.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Za(0)),this.motionValue.jump(0,!1),this.currentAnimation=_k(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:g=>{this.mixTargetDelta(g),c.onUpdate&&c.onUpdate(g)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Nk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:p,layout:m,latestValues:g}=c;if(!(!d||!p||!m)){if(this!==c&&this.layout&&m&&Ow(this.options.animationType,this.layout.layoutBox,m.layoutBox)){p=this.target||wt();const y=qt(this.layout.layoutBox.x);p.x.min=c.target.x.min,p.x.max=p.x.min+y;const v=qt(this.layout.layoutBox.y);p.y.min=c.target.y.min,p.y.max=p.y.min+v}Nn(d,p),xu(d,g),ho(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new Dk),this.sharedNodes.get(c).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:p}={}){const m=this.getStack();m&&m.promote(this,p),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:p}=c;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(d=!0),!d)return;const m={};p.z&&jd("z",c,m,this.animationValues);for(let g=0;g{var d;return(d=c.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(uv),this.root.sharedNodes.clear()}}}function Ok(e){e.updateLayout()}function zk(e){var i;const t=((i=e.resumeFrom)==null?void 0:i.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:o}=e.layout,{animationType:u}=e.options,c=t.source!==e.layout.source;if(u==="size")Fn(y=>{const v=c?t.measuredBox[y]:t.layoutBox[y],x=qt(v);v.min=a[y].min,v.max=v.min+x});else if(u==="x"||u==="y"){const y=u==="x"?"y":"x";Rh(c?t.measuredBox[y]:t.layoutBox[y],a[y])}else Ow(u,t.layoutBox,a)&&Fn(y=>{const v=c?t.measuredBox[y]:t.layoutBox[y],x=qt(a[y]);v.max=v.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[y].max=e.relativeTarget[y].min+x)});const d=qa();ho(d,a,t.layoutBox);const p=qa();c?ho(p,e.applyTransform(o,!0),t.measuredBox):ho(p,a,t.layoutBox);const m=!Cw(d);let g=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:v,layout:x}=y;if(v&&x){const A=e.options.layoutAnchor||void 0,M=wt();ju(M,t.layoutBox,v.layoutBox,A);const R=wt();ju(R,a,x.layoutBox,A),kw(M,R)||(g=!0),y.options.layoutRoot&&(e.relativeTarget=R,e.relativeTargetOrigin=M,e.relativeParent=y)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:t,delta:p,layoutDelta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:g})}else if(e.isLead()){const{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function jk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Lk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ik(e){e.clearSnapshot()}function uv(e){e.clearMeasurements()}function Uk(e){e.isLayoutDirty=!0,e.updateLayout()}function cv(e){e.isLayoutDirty=!1}function Bk(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Pk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function fv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vk(e){e.resolveTargetDelta()}function Hk(e){e.calcProjection()}function qk(e){e.resetSkewAndRotation()}function Fk(e){e.removeLeadSnapshot()}function dv(e,t,i){e.translate=at(t.translate,0,i),e.scale=at(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function hv(e,t,i,a){e.min=at(t.min,i.min,a),e.max=at(t.max,i.max,a)}function Gk(e,t,i,a){hv(e.x,t.x,i.x,a),hv(e.y,t.y,i.y,a)}function Yk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xk={duration:.45,ease:[.4,0,.1,1]},mv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),pv=mv("applewebkit/")&&!mv("chrome/")?Math.round:_n;function gv(e){e.min=pv(e.min),e.max=pv(e.max)}function Kk(e){gv(e.x),gv(e.y)}function Ow(e,t,i){return e==="position"||e==="preserve-aspect"&&!pk(rv(t),rv(i),.2)}function Qk(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Wk=Rw({attachResizeListener:(e,t)=>So(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ld={current:void 0},zw=Rw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ld.current){const e=new Wk({});e.mount(window),e.setOptions({layoutScroll:!0}),Ld.current=e}return Ld.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Dm=$.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function yv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zk(...e){return t=>{let i=!1;const a=e.map(o=>{const u=yv(o,t);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let o=0;o{const{width:x,height:A,top:M,left:R,right:C,bottom:B}=p.current;if(t||u===!1||!d.current||!x||!A)return;const D=i==="left"?`left: ${R}`:`right: ${C}`,H=a==="bottom"?`bottom: ${B}`:`top: ${M}`;d.current.dataset.motionPopId=c;const X=document.createElement("style");m&&(X.nonce=m);const j=o??document.head;return j.appendChild(X),X.sheet&&X.sheet.insertRule(` [data-motion-pop-id="${c}"] { position: absolute !important; width: ${x}px !important; height: ${A}px !important; ${D}px !important; ${H}px !important; } `),()=>{var te;(te=d.current)==null||te.removeAttribute("data-motion-pop-id"),j.contains(X)&&j.removeChild(X)}},[t]),S.jsx(Jk,{isPresent:t,childRef:d,sizeRef:p,pop:u,children:u===!1?e:$.cloneElement(e,{ref:y})})}const tM=({children:e,initial:t,isPresent:i,onExitComplete:a,custom:o,presenceAffectsLayout:u,mode:c,anchorX:d,anchorY:p,root:m})=>{const g=am(nM),y=$.useId();let v=!0,x=$.useMemo(()=>(v=!1,{id:y,initial:t,isPresent:i,custom:o,onExitComplete:A=>{g.set(A,!0);for(const M of g.values())if(!M)return;a&&a()},register:A=>(g.set(A,!1),()=>g.delete(A))}),[i,g,a]);return u&&v&&(x={...x}),$.useMemo(()=>{g.forEach((A,M)=>g.set(M,!1))},[i]),$.useEffect(()=>{!i&&!g.size&&a&&a()},[i]),e=S.jsx(eM,{pop:c==="popLayout",isPresent:i,anchorX:d,anchorY:p,root:m,children:e}),S.jsx(Ku.Provider,{value:x,children:e})};function nM(){return new Map}function jw(e=!0){const t=$.useContext(Ku);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:a,register:o}=t,u=$.useId();$.useEffect(()=>{if(e)return o(u)},[e]);const c=$.useCallback(()=>e&&a&&a(u),[u,a,e]);return!i&&a?[!1,c]:[!0]}const ru=e=>e.key||"";function bv(e){const t=[];return $.Children.forEach(e,i=>{$.isValidElement(i)&&t.push(i)}),t}const Lw=({children:e,custom:t,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:u="sync",propagate:c=!1,anchorX:d="left",anchorY:p="top",root:m})=>{const[g,y]=jw(c),v=$.useMemo(()=>bv(e),[e]),x=c&&!g?[]:v.map(ru),A=$.useRef(!0),M=$.useRef(v),R=am(()=>new Map),C=$.useRef(new Set),[B,D]=$.useState(v),[H,X]=$.useState(v);l1(()=>{A.current=!1,M.current=v;for(let P=0;P{const ee=ru(P),ne=c&&!g?!1:v===H||x.includes(ee),J=()=>{if(C.current.has(ee))return;if(R.has(ee))C.current.add(ee),R.set(ee,!0);else return;let W=!0;R.forEach(ye=>{ye||(W=!1)}),W&&(te==null||te(),X(M.current),c&&(y==null||y()),a&&a())};return S.jsx(tM,{isPresent:ne,initial:!A.current||i?void 0:!1,custom:t,presenceAffectsLayout:o,mode:u,root:m,onExitComplete:ne?void 0:J,anchorX:d,anchorY:p,children:P},ee)})})},Iw=$.createContext({strict:!1}),vv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let xv=!1;function iM(){if(xv)return;const e={};for(const t in vv)e[t]={isEnabled:i=>vv[t].some(a=>!!i[a])};fw(e),xv=!0}function Uw(){return iM(),VC()}function rM(e){const t=Uw();for(const i in e)t[i]={...t[i],...e[i]};fw(t)}const aM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Lu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||aM.has(e)}let Bw=e=>!Lu(e);function sM(e){typeof e=="function"&&(Bw=t=>t.startsWith("on")?!Lu(t):e(t))}try{sM(require("@emotion/is-prop-valid").default)}catch{}function oM(e,t,i){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Rt(e[o])||(Bw(o)||i===!0&&Lu(o)||!t&&!Lu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const $u=$.createContext({});function lM(e,t){if(Zu(e)){const{initial:i,animate:a}=e;return{initial:i===!1||wo(i)?i:void 0,animate:wo(a)?a:void 0}}return e.inherit!==!1?t:{}}function uM(e){const{initial:t,animate:i}=lM(e,$.useContext($u));return $.useMemo(()=>({initial:t,animate:i}),[wv(t),wv(i)])}function wv(e){return Array.isArray(e)?e.join(" "):e}const Nm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pw(e,t,i){for(const a in t)!Rt(t[a])&&!bw(a,i)&&(e[a]=t[a])}function cM({transformTemplate:e},t){return $.useMemo(()=>{const i=Nm();return km(i,t,e),Object.assign({},i.vars,i.style)},[t])}function fM(e,t){const i=e.style||{},a={};return Pw(a,i,e),Object.assign(a,cM(e,t)),a}function dM(e,t){const i={},a=fM(e,t);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=a,i}const Vw=()=>({...Nm(),attrs:{}});function hM(e,t,i,a){const o=$.useMemo(()=>{const u=Vw();return vw(u,t,ww(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};Pw(u,e.style,e),o.style={...u,...o.style}}return o}const mM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Rm(e){return typeof e!="string"||e.includes("-")?!1:!!(mM.indexOf(e)>-1||/[A-Z]/u.test(e))}function pM(e,t,i,{latestValues:a},o,u=!1,c){const p=(c??Rm(e)?hM:dM)(t,a,o,e),m=oM(t,typeof e=="string",u),g=e!==$.Fragment?{...m,...p,ref:i}:{},{children:y}=t,v=$.useMemo(()=>Rt(y)?y.get():y,[y]);return $.createElement(e,{...g,children:v})}function gM({scrapeMotionValuesFromProps:e,createRenderState:t},i,a,o){return{latestValues:yM(i,a,o,e),renderState:t()}}function yM(e,t,i,a){const o={},u=a(e,{});for(const v in u)o[v]=wu(u[v]);let{initial:c,animate:d}=e;const p=Zu(e),m=uw(e);t&&m&&!p&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let g=i?i.initial===!1:!1;g=g||c===!1;const y=g?d:c;if(y&&typeof y!="boolean"&&!Wu(y)){const v=Array.isArray(y)?y:[y];for(let x=0;x(t,i)=>{const a=$.useContext($u),o=$.useContext(Ku),u=()=>gM(e,t,a,o);return i?u():am(u)},bM=Hw({scrapeMotionValuesFromProps:Mm,createRenderState:Nm}),vM=Hw({scrapeMotionValuesFromProps:Sw,createRenderState:Vw}),xM=Symbol.for("motionComponentSymbol");function wM(e,t,i){const a=$.useRef(i);$.useInsertionEffect(()=>{a.current=i});const o=$.useRef(null);return $.useCallback(u=>{var d;u&&((d=e.onMount)==null||d.call(e,u));const c=a.current;if(typeof c=="function")if(u){const p=c(u);typeof p=="function"&&(o.current=p)}else o.current?(o.current(),o.current=null):c(u);else c&&(c.current=u);t&&(u?t.mount(u):t.unmount())},[t])}const qw=$.createContext({});function Pa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SM(e,t,i,a,o,u){var D,H;const{visualElement:c}=$.useContext($u),d=$.useContext(Iw),p=$.useContext(Ku),m=$.useContext(Dm),g=m.reducedMotion,y=m.skipAnimations,v=$.useRef(null),x=$.useRef(!1);a=a||d.renderer,!v.current&&a&&(v.current=a(e,{visualState:t,parent:c,props:i,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:g,skipAnimations:y,isSVG:u}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const A=v.current,M=$.useContext(qw);A&&!A.projection&&o&&(A.type==="html"||A.type==="svg")&&TM(v.current,i,o,M);const R=$.useRef(!1);$.useInsertionEffect(()=>{A&&R.current&&A.update(i,p)});const C=i[W1],B=$.useRef(!!C&&typeof window<"u"&&!((D=window.MotionHandoffIsComplete)!=null&&D.call(window,C))&&((H=window.MotionHasOptimisedAnimation)==null?void 0:H.call(window,C)));return l1(()=>{x.current=!0,A&&(R.current=!0,window.MotionIsMounted=!0,A.updateFeatures(),A.scheduleRenderMicrotask(),B.current&&A.animationState&&A.animationState.animateChanges())}),$.useEffect(()=>{A&&(!B.current&&A.animationState&&A.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{var X;(X=window.MotionHandoffMarkAsComplete)==null||X.call(window,C)}),B.current=!1),A.enteringChildren=void 0)}),A}function TM(e,t,i,a){const{layoutId:o,layout:u,drag:c,dragConstraints:d,layoutScroll:p,layoutRoot:m,layoutAnchor:g,layoutCrossfade:y}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:Fw(e.parent)),e.projection.setOptions({layoutId:o,layout:u,alwaysMeasureLayout:!!c||d&&Pa(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:p,layoutRoot:m,layoutAnchor:g})}function Fw(e){if(e)return e.options.allowProjection!==!1?e.projection:Fw(e.parent)}function Id(e,{forwardMotionProps:t=!1,type:i}={},a,o){a&&rM(a);const u=i?i==="svg":Rm(e),c=u?vM:bM;function d(m,g){let y;const v={...$.useContext(Dm),...m,layoutId:EM(m)},{isStatic:x}=v,A=uM(m),M=c(m,x);if(!x&&typeof window<"u"){AM();const R=_M(v);y=R.MeasureLayout,A.visualElement=SM(e,M,v,o,R.ProjectionNode,u)}return S.jsxs($u.Provider,{value:A,children:[y&&A.visualElement?S.jsx(y,{visualElement:A.visualElement,...v}):null,pM(e,m,wM(M,A.visualElement,g),M,x,t,u)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const p=$.forwardRef(d);return p[xM]=e,p}function EM({layoutId:e}){const t=$.useContext(rm).id;return t&&e!==void 0?t+"-"+e:e}function AM(e,t){$.useContext(Iw).strict}function _M(e){const t=Uw(),{drag:i,layout:a}=t;if(!i&&!a)return{};const o={...i,...a};return{MeasureLayout:i!=null&&i.isEnabled(e)||a!=null&&a.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function CM(e,t){if(typeof Proxy>"u")return Id;const i=new Map,a=(u,c)=>Id(u,c,e,t),o=(u,c)=>a(u,c);return new Proxy(o,{get:(u,c)=>c==="create"?a:(i.has(c)||i.set(c,Id(c,void 0,e,t)),i.get(c))})}const kM=(e,t)=>t.isSVG??Rm(e)?new rk(t):new $C(t,{allowProjection:e!==$.Fragment});class MM extends pr{constructor(t){super(t),t.animationState||(t.animationState=uk(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Wu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let DM=0;class NM extends pr{constructor(){super(...arguments),this.id=DM++,this.isExitComplete=!1}update(){var u;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:c,custom:d}=this.node.getProps();if(typeof c=="string"){const p=Kr(this.node,c,d);if(p){const{transition:m,transitionEnd:g,...y}=p;for(const v in y)(u=this.node.getValue(v))==null||u.jump(y[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);i&&!t&&o.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const RM={animation:{Feature:MM},exit:{Feature:NM}};function No(e){return{point:{x:e.pageX,y:e.pageY}}}const OM=e=>t=>Em(t)&&e(t,No(t));function mo(e,t,i,a){return So(e,t,OM(i),a)}const Gw=({current:e})=>e?e.ownerDocument.defaultView:null,Sv=(e,t)=>Math.abs(e-t);function zM(e,t){const i=Sv(e.x,t.x),a=Sv(e.y,t.y);return Math.sqrt(i**2+a**2)}const Tv=new Set(["auto","scroll"]);class Yw{constructor(t,i,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:u=!1,distanceThreshold:c=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=au(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Ud(this.lastMoveEventInfo,this.history),A=this.startEvent!==null,M=zM(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!A&&!M)return;const{point:R}=x,{timestamp:C}=Nt;this.history.push({...R,timestamp:C});const{onStart:B,onMove:D}=this.handlers;A||(B&&B(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,x)},this.handlePointerMove=(x,A)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=A,this.lastMoveEventInfo=au(A,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(x,A)=>{this.end();const{onEnd:M,onSessionEnd:R,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const B=Ud(x.type==="pointercancel"?this.lastMoveEventInfo:au(A,this.transformPagePoint),this.history);this.startEvent&&M&&M(x,B),R&&R(x,B)},!Em(t))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const p=No(t),m=au(p,this.transformPagePoint),{point:g}=m,{timestamp:y}=Nt;this.history=[{...g,timestamp:y}];const{onSessionStart:v}=i;v&&v(t,Ud(m,this.history)),this.removeListeners=ko(mo(this.contextWindow,"pointermove",this.handlePointerMove),mo(this.contextWindow,"pointerup",this.handlePointerUp),mo(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let i=t.parentElement;for(;i;){const a=getComputedStyle(i);(Tv.has(a.overflowX)||Tv.has(a.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const i=this.scrollPositions.get(t);if(!i)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:o.x-i.x,y:o.y-i.y};u.x===0&&u.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,o),Je.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),hr(this.updatePoint)}}function au(e,t){return t?{point:t(e.point)}:e}function Ev(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ud({point:e},t){return{point:e,delta:Ev(e,Xw(t)),offset:Ev(e,jM(t)),velocity:LM(t,.1)}}function jM(e){return e[0]}function Xw(e){return e[e.length-1]}function LM(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,a=null;const o=Xw(e);for(;i>=0&&(a=e[i],!(o.timestamp-a.timestamp>hn(t)));)i--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>hn(t)*2&&(a=e[1]);const u=An(o.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const c={x:(o.x-a.x)/u,y:(o.y-a.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function IM(e,{min:t,max:i},a){return t!==void 0&&ei&&(e=a?at(i,e,a.max):Math.min(e,i)),e}function Av(e,t,i){return{min:t!==void 0?e.min+t:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function UM(e,{top:t,left:i,bottom:a,right:o}){return{x:Av(e.x,i,o),y:Av(e.y,t,a)}}function _v(e,t){let i=t.min-e.min,a=t.max-e.max;return t.max-t.mina?i=vo(t.min,t.max-a,e.min):a>o&&(i=vo(e.min,e.max-o,t.min)),Zn(0,1,i)}function VM(e,t){const i={};return t.min!==void 0&&(i.min=t.min-e.min),t.max!==void 0&&(i.max=t.max-e.min),i}const Oh=.35;function HM(e=Oh){return e===!1?e=0:e===!0&&(e=Oh),{x:Cv(e,"left","right"),y:Cv(e,"top","bottom")}}function Cv(e,t,i){return{min:kv(e,t),max:kv(e,i)}}function kv(e,t){return typeof e=="number"?e:e[t]||0}const qM=new WeakMap;class FM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=y=>{i&&this.snapToCursor(No(y).point),this.stopAnimation()},c=(y,v)=>{const{drag:x,dragPropagation:A,onDragStart:M}=this.getProps();if(x&&!A&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yC(x),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fn(C=>{let B=this.getAxisMotionValue(C).get()||0;if(Qn.test(B)){const{projection:D}=this.visualElement;if(D&&D.layout){const H=D.layout.layoutBox[C];H&&(B=qt(H)*(parseFloat(B)/100))}}this.originPoint[C]=B}),M&&Je.update(()=>M(y,v),!1,!0),Eh(this.visualElement,"transform");const{animationState:R}=this.visualElement;R&&R.setActive("whileDrag",!0)},d=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:A,onDirectionLock:M,onDrag:R}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=v;if(A&&this.currentDirection===null){this.currentDirection=YM(C),this.currentDirection!==null&&M&&M(this.currentDirection);return}this.updateAxis("x",v.point,C),this.updateAxis("y",v.point,C),this.visualElement.render(),R&&Je.update(()=>R(y,v),!1,!0)},p=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new Yw(t,{onSessionStart:u,onStart:c,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:Gw(this.visualElement),element:this.visualElement.current})}stop(t,i){const a=t||this.latestPointerEvent,o=i||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Je.postRender(()=>d(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,i,a){const{drag:o}=this.getProps();if(!a||!su(t,o,this.currentDirection))return;const u=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=IM(c,this.constraints[t],this.elastic[t])),u.set(c)}resolveConstraints(){var u;const{dragConstraints:t,dragElastic:i}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(u=this.visualElement.projection)==null?void 0:u.layout,o=this.constraints;t&&Pa(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=UM(a.layoutBox,t):this.constraints=!1,this.elastic=HM(i),o!==this.constraints&&!Pa(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Fn(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=VM(a.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!Pa(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const u=YC(a,o.root,this.visualElement.getTransformPagePoint());let c=BM(o.layout.layoutBox,u);if(i){const d=i(qC(c));this.hasMutatedConstraints=!!d,d&&(c=hw(d))}return c}startAnimation(t){const{drag:i,dragMomentum:a,dragElastic:o,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),p=this.constraints||{},m=Fn(g=>{if(!su(g,i,this.currentDirection))return;let y=p&&p[g]||{};(c===!0||c===g)&&(y={min:0,max:0});const v=o?200:1e6,x=o?40:1e7,A={type:"inertia",velocity:a?t[g]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,A)});return Promise.all(m).then(d)}startAxisValueAnimation(t,i){const a=this.getAxisMotionValue(t);return Eh(this.visualElement,t),a.start(vm(t,a,0,i,this.visualElement,!1))}stopAnimation(){Fn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[i];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){Fn(i=>{const{drag:a}=this.getProps();if(!su(i,a,this.currentDirection))return;const{projection:o}=this.visualElement,u=this.getAxisMotionValue(i);if(o&&o.layout){const{min:c,max:d}=o.layout.layoutBox[i],p=u.get()||0;u.set(t[i]-at(c,d,.5)+p)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:a}=this.visualElement;if(!Pa(i)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Fn(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const p=d.get();o[c]=PM({min:p,max:p},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Fn(c=>{if(!su(c,t,null))return;const d=this.getAxisMotionValue(c),{min:p,max:m}=this.constraints[c];d.set(at(p,m,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qM.set(this.visualElement,this);const t=this.visualElement.current,i=mo(t,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps(),v=m.target,x=v!==t&&TC(v);g&&y&&!x&&this.start(m)});let a;const o=()=>{const{dragConstraints:m}=this.getProps();Pa(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),a||(a=GM(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:u}=this.visualElement,c=u.addEventListener("measure",o);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),Je.read(o);const d=So(window,"resize",()=>this.scalePositionWithinConstraints()),p=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Fn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),i(),c(),p&&p(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:u=!1,dragElastic:c=Oh,dragMomentum:d=!0}=t;return{...t,drag:i,dragDirectionLock:a,dragPropagation:o,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function Mv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function GM(e,t,i){const a=Lb(e,Mv(i)),o=Lb(t,Mv(i));return()=>{a(),o()}}function su(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function YM(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class XM extends pr{constructor(t){super(t),this.removeGroupControls=_n,this.removeListeners=_n,this.controls=new FM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_n}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Bd=e=>(t,i)=>{e&&Je.update(()=>e(t,i),!1,!0)};class KM extends pr{constructor(){super(...arguments),this.removePointerDownListener=_n}onPointerDown(t){this.session=new Yw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gw(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Bd(t),onStart:Bd(i),onMove:Bd(a),onEnd:(u,c)=>{delete this.session,o&&Je.postRender(()=>o(u,c))}}}mount(){this.removePointerDownListener=mo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Pd=!1;class QM extends $.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:a,layoutId:o}=this.props,{projection:u}=t;u&&(i.group&&i.group.add(u),a&&a.register&&o&&a.register(u),Pd&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Su.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:a,drag:o,isPresent:u}=this.props,{projection:c}=a;return c&&(c.isPresent=u,t.layoutDependency!==i&&c.setOptions({...c.options,layoutDependency:i}),Pd=!0,o||t.layoutDependency!==i||i===void 0||t.isPresent!==u?c.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?c.promote():c.relegate()||Je.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=i,a.root.didUpdate(),Tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:a}=this.props,{projection:o}=t;Pd=!0,o&&(o.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Kw(e){const[t,i]=jw(),a=$.useContext(rm);return S.jsx(QM,{...e,layoutGroup:a,switchLayoutGroup:$.useContext(qw),isPresent:t,safeToRemove:i})}const WM={pan:{Feature:KM},drag:{Feature:XM,ProjectionNode:zw,MeasureLayout:Kw}};function Dv(e,t,i){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",i==="Start");const o="onHover"+i,u=a[o];u&&Je.postRender(()=>u(t,No(t)))}class ZM extends pr{mount(){const{current:t}=this.node;t&&(this.unmount=vC(t,(i,a)=>(Dv(this.node,a,"Start"),o=>Dv(this.node,o,"End"))))}unmount(){}}class $M extends pr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ko(So(this.node.current,"focus",()=>this.onFocus()),So(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Nv(e,t,i){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",i==="Start");const o="onTap"+(i==="End"?"":i),u=a[o];u&&Je.postRender(()=>u(t,No(t)))}class JM extends pr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:a}=this.node.props;this.unmount=AC(t,(o,u)=>(Nv(this.node,u,"Start"),(c,{success:d})=>Nv(this.node,c,d?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(a==null?void 0:a.tap)===!1})}unmount(){}}const zh=new WeakMap,Vd=new WeakMap,eD=e=>{const t=zh.get(e.target);t&&t(e)},tD=e=>{e.forEach(eD)};function nD({root:e,...t}){const i=e||document;Vd.has(i)||Vd.set(i,{});const a=Vd.get(i),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(tD,{root:e,...t})),a[o]}function iD(e,t,i){const a=nD(t);return zh.set(e,i),a.observe(e),()=>{zh.delete(e),a.unobserve(e)}}const rD={some:0,all:1};class aD extends pr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var p;(p=this.stopObserver)==null||p.call(this);const{viewport:t={}}=this.node.getProps(),{root:i,margin:a,amount:o="some",once:u}=t,c={root:i?i.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:rD[o]},d=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),x=g?y:v;x&&x(m)};this.stopObserver=iD(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(sD(t,i))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function sD({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const oD={inView:{Feature:aD},tap:{Feature:JM},focus:{Feature:$M},hover:{Feature:ZM}},lD={layout:{ProjectionNode:zw,MeasureLayout:Kw}},uD={...RM,...oD,...WM,...lD},$a=CM(uD,kM);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,a)=>a?a.toUpperCase():i.toLowerCase()),Rv=e=>{const t=fD(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qw=(...e)=>e.filter((t,i,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===i).join(" ").trim(),dD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var hD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mD=$.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:u,iconNode:c,...d},p)=>$.createElement("svg",{ref:p,...hD,width:t,height:t,stroke:e,strokeWidth:a?Number(i)*24/Number(t):i,className:Qw("lucide",o),...!u&&!dD(d)&&{"aria-hidden":"true"},...d},[...c.map(([m,g])=>$.createElement(m,g)),...Array.isArray(u)?u:[u]]));/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const et=(e,t)=>{const i=$.forwardRef(({className:a,...o},u)=>$.createElement(mD,{ref:u,iconNode:t,className:Qw(`lucide-${cD(Rv(e))}`,`lucide-${e}`,a),...o}));return i.displayName=Rv(e),i};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pD=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],gD=et("check-check",pD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bD=et("check",yD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xD=et("chevron-right",vD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wD=[["path",{d:"M10.88 21.94 15.46 14",key:"xkve6t"}],["path",{d:"M21.17 8H12",key:"19dcdn"}],["path",{d:"M3.95 6.06 8.54 14",key:"g8jz9m"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],SD=et("chromium",wD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],jh=et("circle-alert",TD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ED=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],AD=et("circle-check",ED);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _D=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],CD=et("copy",_D);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kD=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],MD=et("external-link",kD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DD=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ww=et("file-text",DD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ND=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],RD=et("file",ND);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OD=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],zD=et("image",OD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jD=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],LD=et("link-2",jD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ID=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zw=et("loader-circle",ID);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],BD=et("log-out",UD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PD=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Ov=et("mic",PD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VD=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],HD=et("music",VD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qD=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],zv=et("paperclip",qD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FD=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],GD=et("pause",FD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YD=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],XD=et("play",YD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KD=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],QD=et("send",KD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WD=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Om=et("shield-check",WD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZD=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],zm=et("sparkles",ZD);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $D=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],JD=et("square",$D);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eN=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],tN=et("wand-sparkles",eN);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nN=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],iN=et("workflow",nN);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Lh=et("x",rN);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sN=et("zap",aN),oN=()=>{};var jv={};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $w=function(e){const t=[];let i=0;for(let a=0;a>6|192,t[i++]=o&63|128):(o&64512)===55296&&a+1>18|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128,t[i++]=o&63|128):(t[i++]=o>>12|224,t[i++]=o>>6&63|128,t[i++]=o&63|128)}return t},lN=function(e){const t=[];let i=0,a=0;for(;i191&&o<224){const u=e[i++];t[a++]=String.fromCharCode((o&31)<<6|u&63)}else if(o>239&&o<365){const u=e[i++],c=e[i++],d=e[i++],p=((o&7)<<18|(u&63)<<12|(c&63)<<6|d&63)-65536;t[a++]=String.fromCharCode(55296+(p>>10)),t[a++]=String.fromCharCode(56320+(p&1023))}else{const u=e[i++],c=e[i++];t[a++]=String.fromCharCode((o&15)<<12|(u&63)<<6|c&63)}}return t.join("")},Jw={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,a=[];for(let o=0;o>2,y=(u&3)<<4|d>>4;let v=(d&15)<<2|m>>6,x=m&63;p||(x=64,c||(v=64)),a.push(i[g],i[y],i[v],i[x])}return a.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray($w(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):lN(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const i=t?this.charToByteMapWebSafe_:this.charToByteMap_,a=[];for(let o=0;o>4;if(a.push(v),m!==64){const x=d<<4&240|m>>2;if(a.push(x),y!==64){const A=m<<6&192|y;a.push(A)}}}return a},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class uN extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const cN=function(e){const t=$w(e);return Jw.encodeByteArray(t,!0)},eS=function(e){return cN(e).replace(/\./g,"")},tS=function(e){try{return Jw.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function fN(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const dN=()=>fN().__FIREBASE_DEFAULTS__,hN=()=>{if(typeof process>"u"||typeof jv>"u")return;const e=jv.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},mN=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&tS(e[1]);return t&&JSON.parse(t)},jm=()=>{try{return oN()||dN()||hN()||mN()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},pN=e=>{var t,i;return(i=(t=jm())==null?void 0:t.emulatorHosts)==null?void 0:i[e]},nS=()=>{var e;return(e=jm())==null?void 0:e.config},iS=e=>{var t;return(t=jm())==null?void 0:t[`_${e}`]};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gN{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,i)=>{this.resolve=t,this.reject=i})}wrapCallback(t){return(i,a)=>{i?this.reject(i):this.resolve(a),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(i):t(i,a))}}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ft(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function yN(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Ft())}function bN(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function vN(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function xN(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function wN(){const e=Ft();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function SN(){try{return typeof indexedDB=="object"}catch{return!1}}function TN(){return new Promise((e,t)=>{try{let i=!0;const a="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(a);o.onsuccess=()=>{o.result.close(),i||self.indexedDB.deleteDatabase(a),e(!0)},o.onupgradeneeded=()=>{i=!1},o.onerror=()=>{var u;t(((u=o.error)==null?void 0:u.message)||"")}}catch(i){t(i)}})}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const EN="FirebaseError";class gr extends Error{constructor(t,i,a){super(i),this.code=t,this.customData=a,this.name=EN,Object.setPrototypeOf(this,gr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ro.prototype.create)}}class Ro{constructor(t,i,a){this.service=t,this.serviceName=i,this.errors=a}create(t,...i){const a=i[0]||{},o=`${this.service}/${t}`,u=this.errors[t],c=u?AN(u,a):"Error",d=`${this.serviceName}: ${c} (${o}).`;return new gr(o,d,a)}}function AN(e,t){return e.replace(_N,(i,a)=>{const o=t[a];return o!=null?String(o):`<${a}?>`})}const _N=/\{\$([^}]+)}/g;function CN(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Ja(e,t){if(e===t)return!0;const i=Object.keys(e),a=Object.keys(t);for(const o of i){if(!a.includes(o))return!1;const u=e[o],c=t[o];if(Lv(u)&&Lv(c)){if(!Ja(u,c))return!1}else if(u!==c)return!1}for(const o of a)if(!i.includes(o))return!1;return!0}function Lv(e){return e!==null&&typeof e=="object"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Oo(e){const t=[];for(const[i,a]of Object.entries(e))Array.isArray(a)?a.forEach(o=>{t.push(encodeURIComponent(i)+"="+encodeURIComponent(o))}):t.push(encodeURIComponent(i)+"="+encodeURIComponent(a));return t.length?"&"+t.join("&"):""}function kN(e,t){const i=new MN(e,t);return i.subscribe.bind(i)}class MN{constructor(t,i){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=i,this.task.then(()=>{t(this)}).catch(a=>{this.error(a)})}next(t){this.forEachObserver(i=>{i.next(t)})}error(t){this.forEachObserver(i=>{i.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,i,a){let o;if(t===void 0&&i===void 0&&a===void 0)throw new Error("Missing Observer.");DN(t,["next","error","complete"])?o=t:o={next:t,error:i,complete:a},o.next===void 0&&(o.next=Hd),o.error===void 0&&(o.error=Hd),o.complete===void 0&&(o.complete=Hd);const u=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),u}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let i=0;i{if(this.observers!==void 0&&this.observers[t]!==void 0)try{i(this.observers[t])}catch(a){typeof console<"u"&&console.error&&console.error(a)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function DN(e,t){if(typeof e!="object"||e===null)return!1;for(const i of t)if(i in e&&typeof e[i]=="function")return!0;return!1}function Hd(){}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function yr(e){return e&&e._delegate?e._delegate:e}/** * @license * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Lm(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function NN(e){return(await fetch(e,{credentials:"include"})).ok}class es{constructor(t,i,a){this.name=t,this.instanceFactory=i,this.type=a,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Hr="[DEFAULT]";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class RN{constructor(t,i){this.name=t,this.container=i,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const i=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(i)){const a=new gN;if(this.instancesDeferred.set(i,a),this.isInitialized(i)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:i});o&&a.resolve(o)}catch{}}return this.instancesDeferred.get(i).promise}getImmediate(t){const i=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),a=(t==null?void 0:t.optional)??!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(o){if(a)return null;throw o}else{if(a)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(zN(t))try{this.getOrInitializeService({instanceIdentifier:Hr})}catch{}for(const[i,a]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(i);try{const u=this.getOrInitializeService({instanceIdentifier:o});a.resolve(u)}catch{}}}}clearInstance(t=Hr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(i=>"INTERNAL"in i).map(i=>i.INTERNAL.delete()),...t.filter(i=>"_delete"in i).map(i=>i._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Hr){return this.instances.has(t)}getOptions(t=Hr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:i={}}=t,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(`${this.name}(${a}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:a,options:i});for(const[u,c]of this.instancesDeferred.entries()){const d=this.normalizeInstanceIdentifier(u);a===d&&c.resolve(o)}return o}onInit(t,i){const a=this.normalizeInstanceIdentifier(i),o=this.onInitCallbacks.get(a)??new Set;o.add(t),this.onInitCallbacks.set(a,o);const u=this.instances.get(a);return u&&t(u,a),()=>{o.delete(t)}}invokeOnInitCallbacks(t,i){const a=this.onInitCallbacks.get(i);if(a)for(const o of a)try{o(t,i)}catch{}}getOrInitializeService({instanceIdentifier:t,options:i={}}){let a=this.instances.get(t);if(!a&&this.component&&(a=this.component.instanceFactory(this.container,{instanceIdentifier:ON(t),options:i}),this.instances.set(t,a),this.instancesOptions.set(t,i),this.invokeOnInitCallbacks(a,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,a)}catch{}return a||null}normalizeInstanceIdentifier(t=Hr){return this.component?this.component.multipleInstances?t:Hr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function ON(e){return e===Hr?void 0:e}function zN(e){return e.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jN{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const i=this.getProvider(t.name);if(i.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);i.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const i=new RN(t,this);return this.providers.set(t,i),i}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var $e;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})($e||($e={}));const LN={debug:$e.DEBUG,verbose:$e.VERBOSE,info:$e.INFO,warn:$e.WARN,error:$e.ERROR,silent:$e.SILENT},IN=$e.INFO,UN={[$e.DEBUG]:"log",[$e.VERBOSE]:"log",[$e.INFO]:"info",[$e.WARN]:"warn",[$e.ERROR]:"error"},BN=(e,t,...i)=>{if(tt.some(i=>e instanceof i);let Iv,Uv;function VN(){return Iv||(Iv=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function HN(){return Uv||(Uv=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const aS=new WeakMap,Ih=new WeakMap,sS=new WeakMap,qd=new WeakMap,Im=new WeakMap;function qN(e){const t=new Promise((i,a)=>{const o=()=>{e.removeEventListener("success",u),e.removeEventListener("error",c)},u=()=>{i(cr(e.result)),o()},c=()=>{a(e.error),o()};e.addEventListener("success",u),e.addEventListener("error",c)});return t.then(i=>{i instanceof IDBCursor&&aS.set(i,e)}).catch(()=>{}),Im.set(t,e),t}function FN(e){if(Ih.has(e))return;const t=new Promise((i,a)=>{const o=()=>{e.removeEventListener("complete",u),e.removeEventListener("error",c),e.removeEventListener("abort",c)},u=()=>{i(),o()},c=()=>{a(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",u),e.addEventListener("error",c),e.addEventListener("abort",c)});Ih.set(e,t)}let Uh={get(e,t,i){if(e instanceof IDBTransaction){if(t==="done")return Ih.get(e);if(t==="objectStoreNames")return e.objectStoreNames||sS.get(e);if(t==="store")return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return cr(e[t])},set(e,t,i){return e[t]=i,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function GN(e){Uh=e(Uh)}function YN(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...i){const a=e.call(Fd(this),t,...i);return sS.set(a,t.sort?t.sort():[t]),cr(a)}:HN().includes(e)?function(...t){return e.apply(Fd(this),t),cr(aS.get(this))}:function(...t){return cr(e.apply(Fd(this),t))}}function XN(e){return typeof e=="function"?YN(e):(e instanceof IDBTransaction&&FN(e),PN(e,VN())?new Proxy(e,Uh):e)}function cr(e){if(e instanceof IDBRequest)return qN(e);if(qd.has(e))return qd.get(e);const t=XN(e);return t!==e&&(qd.set(e,t),Im.set(t,e)),t}const Fd=e=>Im.get(e);function KN(e,t,{blocked:i,upgrade:a,blocking:o,terminated:u}={}){const c=indexedDB.open(e,t),d=cr(c);return a&&c.addEventListener("upgradeneeded",p=>{a(cr(c.result),p.oldVersion,p.newVersion,cr(c.transaction),p)}),i&&c.addEventListener("blocked",p=>i(p.oldVersion,p.newVersion,p)),d.then(p=>{u&&p.addEventListener("close",()=>u()),o&&p.addEventListener("versionchange",m=>o(m.oldVersion,m.newVersion,m))}).catch(()=>{}),d}const QN=["get","getKey","getAll","getAllKeys","count"],WN=["put","add","delete","clear"],Gd=new Map;function Bv(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Gd.get(t))return Gd.get(t);const i=t.replace(/FromIndex$/,""),a=t!==i,o=WN.includes(i);if(!(i in(a?IDBIndex:IDBObjectStore).prototype)||!(o||QN.includes(i)))return;const u=async function(c,...d){const p=this.transaction(c,o?"readwrite":"readonly");let m=p.store;return a&&(m=m.index(d.shift())),(await Promise.all([m[i](...d),o&&p.done]))[0]};return Gd.set(t,u),u}GN(e=>({...e,get:(t,i,a)=>Bv(t,i)||e.get(t,i,a),has:(t,i)=>!!Bv(t,i)||e.has(t,i)}));/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ZN{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(i=>{if($N(i)){const a=i.getImmediate();return`${a.library}/${a.version}`}else return null}).filter(i=>i).join(" ")}}function $N(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Bh="@firebase/app",Pv="0.14.11";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ti=new rS("@firebase/app"),JN="@firebase/app-compat",eR="@firebase/analytics-compat",tR="@firebase/analytics",nR="@firebase/app-check-compat",iR="@firebase/app-check",rR="@firebase/auth",aR="@firebase/auth-compat",sR="@firebase/database",oR="@firebase/data-connect",lR="@firebase/database-compat",uR="@firebase/functions",cR="@firebase/functions-compat",fR="@firebase/installations",dR="@firebase/installations-compat",hR="@firebase/messaging",mR="@firebase/messaging-compat",pR="@firebase/performance",gR="@firebase/performance-compat",yR="@firebase/remote-config",bR="@firebase/remote-config-compat",vR="@firebase/storage",xR="@firebase/storage-compat",wR="@firebase/firestore",SR="@firebase/ai",TR="@firebase/firestore-compat",ER="firebase",AR="12.12.0";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ph="[DEFAULT]",_R={[Bh]:"fire-core",[JN]:"fire-core-compat",[tR]:"fire-analytics",[eR]:"fire-analytics-compat",[iR]:"fire-app-check",[nR]:"fire-app-check-compat",[rR]:"fire-auth",[aR]:"fire-auth-compat",[sR]:"fire-rtdb",[oR]:"fire-data-connect",[lR]:"fire-rtdb-compat",[uR]:"fire-fn",[cR]:"fire-fn-compat",[fR]:"fire-iid",[dR]:"fire-iid-compat",[hR]:"fire-fcm",[mR]:"fire-fcm-compat",[pR]:"fire-perf",[gR]:"fire-perf-compat",[yR]:"fire-rc",[bR]:"fire-rc-compat",[vR]:"fire-gcs",[xR]:"fire-gcs-compat",[wR]:"fire-fst",[TR]:"fire-fst-compat",[SR]:"fire-vertex","fire-js":"fire-js",[ER]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Iu=new Map,CR=new Map,Vh=new Map;function Vv(e,t){try{e.container.addComponent(t)}catch(i){Ti.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,i)}}function To(e){const t=e.name;if(Vh.has(t))return Ti.debug(`There were multiple attempts to register component ${t}.`),!1;Vh.set(t,e);for(const i of Iu.values())Vv(i,e);for(const i of CR.values())Vv(i,e);return!0}function oS(e,t){const i=e.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),e.container.getProvider(t)}function Xn(e){return e==null?!1:e.settings!==void 0}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const kR={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},fr=new Ro("app","Firebase",kR);/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class MR{constructor(t,i,a){this._isDeleted=!1,this._options={...t},this._config={...i},this._name=i.name,this._automaticDataCollectionEnabled=i.automaticDataCollectionEnabled,this._container=a,this.container.addComponent(new es("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw fr.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const zo=AR;function lS(e,t={}){let i=e;typeof t!="object"&&(t={name:t});const a={name:Ph,automaticDataCollectionEnabled:!0,...t},o=a.name;if(typeof o!="string"||!o)throw fr.create("bad-app-name",{appName:String(o)});if(i||(i=nS()),!i)throw fr.create("no-options");const u=Iu.get(o);if(u){if(Ja(i,u.options)&&Ja(a,u.config))return u;throw fr.create("duplicate-app",{appName:o})}const c=new jN(o);for(const p of Vh.values())c.addComponent(p);const d=new MR(i,a,c);return Iu.set(o,d),d}function DR(e=Ph){const t=Iu.get(e);if(!t&&e===Ph&&nS())return lS();if(!t)throw fr.create("no-app",{appName:e});return t}function Fa(e,t,i){let a=_R[e]??e;i&&(a+=`-${i}`);const o=a.match(/\s|\//),u=t.match(/\s|\//);if(o||u){const c=[`Unable to register library "${a}" with version "${t}":`];o&&c.push(`library name "${a}" contains illegal characters (whitespace or "/")`),o&&u&&c.push("and"),u&&c.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Ti.warn(c.join(" "));return}To(new es(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const NR="firebase-heartbeat-database",RR=1,Eo="firebase-heartbeat-store";let Yd=null;function uS(){return Yd||(Yd=KN(NR,RR,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Eo)}catch(i){console.warn(i)}}}}).catch(e=>{throw fr.create("idb-open",{originalErrorMessage:e.message})})),Yd}async function OR(e){try{const i=(await uS()).transaction(Eo),a=await i.objectStore(Eo).get(cS(e));return await i.done,a}catch(t){if(t instanceof gr)Ti.warn(t.message);else{const i=fr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Ti.warn(i.message)}}}async function Hv(e,t){try{const a=(await uS()).transaction(Eo,"readwrite");await a.objectStore(Eo).put(t,cS(e)),await a.done}catch(i){if(i instanceof gr)Ti.warn(i.message);else{const a=fr.create("idb-set",{originalErrorMessage:i==null?void 0:i.message});Ti.warn(a.message)}}}function cS(e){return`${e.name}!${e.options.appId}`}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const zR=1024,jR=30;class LR{constructor(t){this.container=t,this._heartbeatsCache=null;const i=this.container.getProvider("app").getImmediate();this._storage=new UR(i),this._heartbeatsCachePromise=this._storage.read().then(a=>(this._heartbeatsCache=a,a))}async triggerHeartbeat(){var t,i;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),u=qv();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((i=this._heartbeatsCache)==null?void 0:i.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===u||this._heartbeatsCache.heartbeats.some(c=>c.date===u))return;if(this._heartbeatsCache.heartbeats.push({date:u,agent:o}),this._heartbeatsCache.heartbeats.length>jR){const c=BR(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(c,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(a){Ti.warn(a)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const i=qv(),{heartbeatsToSend:a,unsentEntries:o}=IR(this._heartbeatsCache.heartbeats),u=eS(JSON.stringify({version:2,heartbeats:a}));return this._heartbeatsCache.lastSentHeartbeatDate=i,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),u}catch(i){return Ti.warn(i),""}}}function qv(){return new Date().toISOString().substring(0,10)}function IR(e,t=zR){const i=[];let a=e.slice();for(const o of e){const u=i.find(c=>c.agent===o.agent);if(u){if(u.dates.push(o.date),Fv(i)>t){u.dates.pop();break}}else if(i.push({agent:o.agent,dates:[o.date]}),Fv(i)>t){i.pop();break}a=a.slice(1)}return{heartbeatsToSend:i,unsentEntries:a}}class UR{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return SN()?TN().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const i=await OR(this.app);return i!=null&&i.heartbeats?i:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return Hv(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return Hv(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...t.heartbeats]})}else return}}function Fv(e){return eS(JSON.stringify({version:2,heartbeats:e})).length}function BR(e){if(e.length===0)return-1;let t=0,i=e[0].date;for(let a=1;anew ZN(t),"PRIVATE")),To(new es("heartbeat",t=>new LR(t),"PRIVATE")),Fa(Bh,Pv,e),Fa(Bh,Pv,"esm2020"),Fa("fire-js","")}PR("");function fS(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const VR=fS,dS=new Ro("auth","Firebase",fS());/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Uu=new rS("@firebase/auth");function HR(e,...t){Uu.logLevel<=$e.WARN&&Uu.warn(`Auth (${zo}): ${e}`,...t)}function Tu(e,...t){Uu.logLevel<=$e.ERROR&&Uu.error(`Auth (${zo}): ${e}`,...t)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function $n(e,...t){throw Bm(e,...t)}function Ln(e,...t){return Bm(e,...t)}function Um(e,t,i){const a={...VR(),[t]:i};return new Ro("auth","Firebase",a).create(t,{appName:e.name})}function Qr(e){return Um(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function qR(e,t,i){const a=i;if(!(t instanceof a))throw a.name!==t.constructor.name&&$n(e,"argument-error"),Um(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Bm(e,...t){if(typeof e!="string"){const i=t[0],a=[...t.slice(1)];return a[0]&&(a[0].appName=e.name),e._errorFactory.create(i,...a)}return dS.create(e,...t)}function Te(e,t,...i){if(!e)throw Bm(t,...i)}function wi(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Tu(t),new Error(t)}function Ei(e,t){e||wi(t)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Hh(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function FR(){return Gv()==="http:"||Gv()==="https:"}function Gv(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function GR(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(FR()||vN()||"connection"in navigator)?navigator.onLine:!0}function YR(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jo{constructor(t,i){this.shortDelay=t,this.longDelay=i,Ei(i>t,"Short delay should be less than long delay!"),this.isMobile=yN()||xN()}get(){return GR()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Pm(e,t){Ei(e.emulator,"Emulator should always be set here");const{url:i}=e.emulator;return t?`${i}${t.startsWith("/")?t.slice(1):t}`:i}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hS{static initialize(t,i,a){this.fetchImpl=t,i&&(this.headersImpl=i),a&&(this.responseImpl=a)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;wi("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;wi("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;wi("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const XR={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const KR=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],QR=new jo(3e4,6e4);function Vm(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function as(e,t,i,a,o={}){return mS(e,o,async()=>{let u={},c={};a&&(t==="GET"?c=a:u={body:JSON.stringify(a)});const d=Oo({key:e.config.apiKey,...c}).slice(1),p=await e._getAdditionalHeaders();p["Content-Type"]="application/json",e.languageCode&&(p["X-Firebase-Locale"]=e.languageCode);const m={method:t,headers:p,...u};return bN()||(m.referrerPolicy="no-referrer"),e.emulatorConfig&&Lm(e.emulatorConfig.host)&&(m.credentials="include"),hS.fetch()(await pS(e,e.config.apiHost,i,d),m)})}async function mS(e,t,i){e._canInitEmulator=!1;const a={...XR,...t};try{const o=new ZR(e),u=await Promise.race([i(),o.promise]);o.clearNetworkTimeout();const c=await u.json();if("needConfirmation"in c)throw ou(e,"account-exists-with-different-credential",c);if(u.ok&&!("errorMessage"in c))return c;{const d=u.ok?c.errorMessage:c.error.message,[p,m]=d.split(" : ");if(p==="FEDERATED_USER_ID_ALREADY_LINKED")throw ou(e,"credential-already-in-use",c);if(p==="EMAIL_EXISTS")throw ou(e,"email-already-in-use",c);if(p==="USER_DISABLED")throw ou(e,"user-disabled",c);const g=a[p]||p.toLowerCase().replace(/[_\s]+/g,"-");if(m)throw Um(e,g,m);$n(e,g)}}catch(o){if(o instanceof gr)throw o;$n(e,"network-request-failed",{message:String(o)})}}async function WR(e,t,i,a,o={}){const u=await as(e,t,i,a,o);return"mfaPendingCredential"in u&&$n(e,"multi-factor-auth-required",{_serverResponse:u}),u}async function pS(e,t,i,a){const o=`${t}${i}?${a}`,u=e,c=u.config.emulator?Pm(e.config,o):`${e.config.apiScheme}://${o}`;return KR.includes(i)&&(await u._persistenceManagerAvailable,u._getPersistenceType()==="COOKIE")?u._getPersistence()._getFinalTarget(c).toString():c}class ZR{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((i,a)=>{this.timer=setTimeout(()=>a(Ln(this.auth,"network-request-failed")),QR.get())})}}function ou(e,t,i){const a={appName:e.name};i.email&&(a.email=i.email),i.phoneNumber&&(a.phoneNumber=i.phoneNumber);const o=Ln(e,t,a);return o.customData._tokenResponse=i,o}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function $R(e,t){return as(e,"POST","/v1/accounts:delete",t)}async function Bu(e,t){return as(e,"POST","/v1/accounts:lookup",t)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function po(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function JR(e,t=!1){const i=yr(e),a=await i.getIdToken(t),o=Hm(a);Te(o&&o.exp&&o.auth_time&&o.iat,i.auth,"internal-error");const u=typeof o.firebase=="object"?o.firebase:void 0,c=u==null?void 0:u.sign_in_provider;return{claims:o,token:a,authTime:po(Xd(o.auth_time)),issuedAtTime:po(Xd(o.iat)),expirationTime:po(Xd(o.exp)),signInProvider:c||null,signInSecondFactor:(u==null?void 0:u.sign_in_second_factor)||null}}function Xd(e){return Number(e)*1e3}function Hm(e){const[t,i,a]=e.split(".");if(t===void 0||i===void 0||a===void 0)return Tu("JWT malformed, contained fewer than 3 sections"),null;try{const o=tS(i);return o?JSON.parse(o):(Tu("Failed to decode base64 JWT payload"),null)}catch(o){return Tu("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function Yv(e){const t=Hm(e);return Te(t,"internal-error"),Te(typeof t.exp<"u","internal-error"),Te(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Ao(e,t,i=!1){if(i)return t;try{return await t}catch(a){throw a instanceof gr&&eO(a)&&e.auth.currentUser===e&&await e.auth.signOut(),a}}function eO({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class tO{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;const a=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,a)}}schedule(t=!1){if(!this.isRunning)return;const i=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},i)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class qh{constructor(t,i){this.createdAt=t,this.lastLoginAt=i,this._initializeTime()}_initializeTime(){this.lastSignInTime=po(this.lastLoginAt),this.creationTime=po(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Pu(e){var y;const t=e.auth,i=await e.getIdToken(),a=await Ao(e,Bu(t,{idToken:i}));Te(a==null?void 0:a.users.length,t,"internal-error");const o=a.users[0];e._notifyReloadListener(o);const u=(y=o.providerUserInfo)!=null&&y.length?gS(o.providerUserInfo):[],c=iO(e.providerData,u),d=e.isAnonymous,p=!(e.email&&o.passwordHash)&&!(c!=null&&c.length),m=d?p:!1,g={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new qh(o.createdAt,o.lastLoginAt),isAnonymous:m};Object.assign(e,g)}async function nO(e){const t=yr(e);await Pu(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function iO(e,t){return[...e.filter(a=>!t.some(o=>o.providerId===a.providerId)),...t]}function gS(e){return e.map(({providerId:t,...i})=>({providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function rO(e,t){const i=await mS(e,{},async()=>{const a=Oo({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:o,apiKey:u}=e.config,c=await pS(e,o,"/v1/token",`key=${u}`),d=await e._getAdditionalHeaders();d["Content-Type"]="application/x-www-form-urlencoded";const p={method:"POST",headers:d,body:a};return e.emulatorConfig&&Lm(e.emulatorConfig.host)&&(p.credentials="include"),hS.fetch()(c,p)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}async function aO(e,t){return as(e,"POST","/v2/accounts:revokeToken",Vm(e,t))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ga{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Te(t.idToken,"internal-error"),Te(typeof t.idToken<"u","internal-error"),Te(typeof t.refreshToken<"u","internal-error");const i="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Yv(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,i)}updateFromIdToken(t){Te(t.length!==0,"internal-error");const i=Yv(t);this.updateTokensAndExpiration(t,null,i)}async getToken(t,i=!1){return!i&&this.accessToken&&!this.isExpired?this.accessToken:(Te(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,i){const{accessToken:a,refreshToken:o,expiresIn:u}=await rO(t,i);this.updateTokensAndExpiration(a,o,Number(u))}updateTokensAndExpiration(t,i,a){this.refreshToken=i||null,this.accessToken=t||null,this.expirationTime=Date.now()+a*1e3}static fromJSON(t,i){const{refreshToken:a,accessToken:o,expirationTime:u}=i,c=new Ga;return a&&(Te(typeof a=="string","internal-error",{appName:t}),c.refreshToken=a),o&&(Te(typeof o=="string","internal-error",{appName:t}),c.accessToken=o),u&&(Te(typeof u=="number","internal-error",{appName:t}),c.expirationTime=u),c}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Ga,this.toJSON())}_performRefresh(){return wi("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function $i(e,t){Te(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class zn{constructor({uid:t,auth:i,stsTokenManager:a,...o}){this.providerId="firebase",this.proactiveRefresh=new tO(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new qh(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const i=await Ao(this,this.stsTokenManager.getToken(this.auth,t));return Te(i,this.auth,"internal-error"),this.accessToken!==i&&(this.accessToken=i,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),i}getIdTokenResult(t){return JR(this,t)}reload(){return nO(this)}_assign(t){this!==t&&(Te(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(i=>({...i})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const i=new zn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return i.metadata._copy(this.metadata),i}_onReload(t){Te(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,i=!1){let a=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),a=!0),i&&await Pu(this),await this.auth._persistUserIfCurrent(this),a&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Xn(this.auth.app))return Promise.reject(Qr(this.auth));const t=await this.getIdToken();return await Ao(this,$R(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,i){const a=i.displayName??void 0,o=i.email??void 0,u=i.phoneNumber??void 0,c=i.photoURL??void 0,d=i.tenantId??void 0,p=i._redirectEventId??void 0,m=i.createdAt??void 0,g=i.lastLoginAt??void 0,{uid:y,emailVerified:v,isAnonymous:x,providerData:A,stsTokenManager:M}=i;Te(y&&M,t,"internal-error");const R=Ga.fromJSON(this.name,M);Te(typeof y=="string",t,"internal-error"),$i(a,t.name),$i(o,t.name),Te(typeof v=="boolean",t,"internal-error"),Te(typeof x=="boolean",t,"internal-error"),$i(u,t.name),$i(c,t.name),$i(d,t.name),$i(p,t.name),$i(m,t.name),$i(g,t.name);const C=new zn({uid:y,auth:t,email:o,emailVerified:v,displayName:a,isAnonymous:x,photoURL:c,phoneNumber:u,tenantId:d,stsTokenManager:R,createdAt:m,lastLoginAt:g});return A&&Array.isArray(A)&&(C.providerData=A.map(B=>({...B}))),p&&(C._redirectEventId=p),C}static async _fromIdTokenResponse(t,i,a=!1){const o=new Ga;o.updateFromServerResponse(i);const u=new zn({uid:i.localId,auth:t,stsTokenManager:o,isAnonymous:a});return await Pu(u),u}static async _fromGetAccountInfoResponse(t,i,a){const o=i.users[0];Te(o.localId!==void 0,"internal-error");const u=o.providerUserInfo!==void 0?gS(o.providerUserInfo):[],c=!(o.email&&o.passwordHash)&&!(u!=null&&u.length),d=new Ga;d.updateFromIdToken(a);const p=new zn({uid:o.localId,auth:t,stsTokenManager:d,isAnonymous:c}),m={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new qh(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(u!=null&&u.length)};return Object.assign(p,m),p}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Xv=new Map;function Si(e){Ei(e instanceof Function,"Expected a class definition");let t=Xv.get(e);return t?(Ei(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Xv.set(e,t),t)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yS{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,i){this.storage[t]=i}async _get(t){const i=this.storage[t];return i===void 0?null:i}async _remove(t){delete this.storage[t]}_addListener(t,i){}_removeListener(t,i){}}yS.type="NONE";const Kv=yS;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Eu(e,t,i){return`firebase:${e}:${t}:${i}`}class Ya{constructor(t,i,a){this.persistence=t,this.auth=i,this.userKey=a;const{config:o,name:u}=this.auth;this.fullUserKey=Eu(this.userKey,o.apiKey,u),this.fullPersistenceKey=Eu("persistence",o.apiKey,u),this.boundEventHandler=i._onStorageEvent.bind(i),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const i=await Bu(this.auth,{idToken:t}).catch(()=>{});return i?zn._fromGetAccountInfoResponse(this.auth,i,t):null}return zn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const i=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,i)return this.setCurrentUser(i)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,i,a="authUser"){if(!i.length)return new Ya(Si(Kv),t,a);const o=(await Promise.all(i.map(async m=>{if(await m._isAvailable())return m}))).filter(m=>m);let u=o[0]||Si(Kv);const c=Eu(a,t.config.apiKey,t.name);let d=null;for(const m of i)try{const g=await m._get(c);if(g){let y;if(typeof g=="string"){const v=await Bu(t,{idToken:g}).catch(()=>{});if(!v)break;y=await zn._fromGetAccountInfoResponse(t,v,g)}else y=zn._fromJSON(t,g);m!==u&&(d=y),u=m;break}}catch{}const p=o.filter(m=>m._shouldAllowMigration);return!u._shouldAllowMigration||!p.length?new Ya(u,t,a):(u=p[0],d&&await u._set(c,d.toJSON()),await Promise.all(i.map(async m=>{if(m!==u)try{await m._remove(c)}catch{}})),new Ya(u,t,a))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Qv(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(wS(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(bS(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(TS(t))return"Blackberry";if(ES(t))return"Webos";if(vS(t))return"Safari";if((t.includes("chrome/")||xS(t))&&!t.includes("edge/"))return"Chrome";if(SS(t))return"Android";{const i=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,a=e.match(i);if((a==null?void 0:a.length)===2)return a[1]}return"Other"}function bS(e=Ft()){return/firefox\//i.test(e)}function vS(e=Ft()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function xS(e=Ft()){return/crios\//i.test(e)}function wS(e=Ft()){return/iemobile/i.test(e)}function SS(e=Ft()){return/android/i.test(e)}function TS(e=Ft()){return/blackberry/i.test(e)}function ES(e=Ft()){return/webos/i.test(e)}function qm(e=Ft()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function sO(e=Ft()){var t;return qm(e)&&!!((t=window.navigator)!=null&&t.standalone)}function oO(){return wN()&&document.documentMode===10}function AS(e=Ft()){return qm(e)||SS(e)||ES(e)||TS(e)||/windows phone/i.test(e)||wS(e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function _S(e,t=[]){let i;switch(e){case"Browser":i=Qv(Ft());break;case"Worker":i=`${Qv(Ft())}-${e}`;break;default:i=e}const a=t.length?t.join(","):"FirebaseCore-web";return`${i}/JsCore/${zo}/${a}`}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lO{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,i){const a=u=>new Promise((c,d)=>{try{const p=t(u);c(p)}catch(p){d(p)}});a.onAbort=i,this.queue.push(a);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const i=[];try{for(const a of this.queue)await a(t),a.onAbort&&i.push(a.onAbort)}catch(a){i.reverse();for(const o of i)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:a==null?void 0:a.message})}}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function uO(e,t={}){return as(e,"GET","/v2/passwordPolicy",Vm(e,t))}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const cO=6;class fO{constructor(t){var a;const i=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=i.minPasswordLength??cO,i.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=i.maxPasswordLength),i.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=i.containsLowercaseCharacter),i.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=i.containsUppercaseCharacter),i.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=i.containsNumericCharacter),i.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=i.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((a=t.allowedNonAlphanumericCharacters)==null?void 0:a.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const i={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,i),this.validatePasswordCharacterOptions(t,i),i.isValid&&(i.isValid=i.meetsMinPasswordLength??!0),i.isValid&&(i.isValid=i.meetsMaxPasswordLength??!0),i.isValid&&(i.isValid=i.containsLowercaseLetter??!0),i.isValid&&(i.isValid=i.containsUppercaseLetter??!0),i.isValid&&(i.isValid=i.containsNumericCharacter??!0),i.isValid&&(i.isValid=i.containsNonAlphanumericCharacter??!0),i}validatePasswordLengthOptions(t,i){const a=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;a&&(i.meetsMinPasswordLength=t.length>=a),o&&(i.meetsMaxPasswordLength=t.length<=o)}validatePasswordCharacterOptions(t,i){this.updatePasswordCharacterOptionsStatuses(i,!1,!1,!1,!1);let a;for(let o=0;o="a"&&a<="z",a>="A"&&a<="Z",a>="0"&&a<="9",this.allowedNonAlphanumericCharacters.includes(a))}updatePasswordCharacterOptionsStatuses(t,i,a,o,u){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=i)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=a)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=u))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dO{constructor(t,i,a,o){this.app=t,this.heartbeatServiceProvider=i,this.appCheckServiceProvider=a,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Wv(this),this.idTokenSubscription=new Wv(this),this.beforeStateQueue=new lO(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=dS,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(u=>this._resolvePersistenceManagerAvailable=u)}_initializeWithPersistence(t,i){return i&&(this._popupRedirectResolver=Si(i)),this._initializationPromise=this.queue(async()=>{var a,o,u;if(!this._deleted&&(this.persistenceManager=await Ya.create(this,t),(a=this._resolvePersistenceManagerAvailable)==null||a.call(this),!this._deleted)){if((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(i),this.lastNotifiedUid=((u=this.currentUser)==null?void 0:u.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const i=await Bu(this,{idToken:t}),a=await zn._fromGetAccountInfoResponse(this,i,t);await this.directlySetCurrentUser(a)}catch(i){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",i),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var u;if(Xn(this.app)){const c=this.app.settings.authIdToken;return c?new Promise(d=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(c).then(d,d))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let a=i,o=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const c=(u=this.redirectUser)==null?void 0:u._redirectEventId,d=a==null?void 0:a._redirectEventId,p=await this.tryRedirectSignIn(t);(!c||c===d)&&(p!=null&&p.user)&&(a=p.user,o=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(a)}catch(c){a=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(c))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return Te(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(t){let i=null;try{i=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return i}async reloadAndSetCurrentUserOrClear(t){try{await Pu(t)}catch(i){if((i==null?void 0:i.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=YR()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Xn(this.app))return Promise.reject(Qr(this));const i=t?yr(t):null;return i&&Te(i.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(i&&i._clone(this))}async _updateCurrentUser(t,i=!1){if(!this._deleted)return t&&Te(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),i||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Xn(this.app)?Promise.reject(Qr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Xn(this.app)?Promise.reject(Qr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Si(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const i=this._getPasswordPolicyInternal();return i.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):i.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await uO(this),i=new fO(t);this.tenantId===null?this._projectPasswordPolicy=i:this._tenantPasswordPolicies[this.tenantId]=i}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new Ro("auth","Firebase",t())}onAuthStateChanged(t,i,a){return this.registerStateListener(this.authStateSubscription,t,i,a)}beforeAuthStateChanged(t,i){return this.beforeStateQueue.pushCallback(t,i)}onIdTokenChanged(t,i,a){return this.registerStateListener(this.idTokenSubscription,t,i,a)}authStateReady(){return new Promise((t,i)=>{if(this.currentUser)t();else{const a=this.onAuthStateChanged(()=>{a(),t()},i)}})}async revokeAccessToken(t){if(this.currentUser){const i=await this.currentUser.getIdToken(),a={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:i};this.tenantId!=null&&(a.tenantId=this.tenantId),await aO(this,a)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,i){const a=await this.getOrInitRedirectPersistenceManager(i);return t===null?a.removeCurrentUser():a.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const i=t&&Si(t)||this._popupRedirectResolver;Te(i,this,"argument-error"),this.redirectPersistenceManager=await Ya.create(this,[Si(i._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var i,a;return this._isInitialized&&await this.queue(async()=>{}),((i=this._currentUser)==null?void 0:i._redirectEventId)===t?this._currentUser:((a=this.redirectUser)==null?void 0:a._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var i;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((i=this.currentUser)==null?void 0:i.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,i,a,o){if(this._deleted)return()=>{};const u=typeof i=="function"?i:i.next.bind(i);let c=!1;const d=this._isInitialized?Promise.resolve():this._initializationPromise;if(Te(d,this,"internal-error"),d.then(()=>{c||u(this.currentUser)}),typeof i=="function"){const p=t.addObserver(i,a,o);return()=>{c=!0,p()}}else{const p=t.addObserver(i);return()=>{c=!0,p()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Te(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=_S(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const a=await this._getAppCheckToken();return a&&(t["X-Firebase-AppCheck"]=a),t}async _getAppCheckToken(){var i;if(Xn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((i=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getToken());return t!=null&&t.error&&HR(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function Ju(e){return yr(e)}class Wv{constructor(t){this.auth=t,this.observer=null,this.addObserver=kN(i=>this.observer=i)}get next(){return Te(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Fm={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function hO(e){Fm=e}function mO(e){return Fm.loadJS(e)}function pO(){return Fm.gapiScript}function gO(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function yO(e,t){const i=oS(e,"auth");if(i.isInitialized()){const o=i.getImmediate(),u=i.getOptions();if(Ja(u,t??{}))return o;$n(o,"already-initialized")}return i.initialize({options:t})}function bO(e,t){const i=(t==null?void 0:t.persistence)||[],a=(Array.isArray(i)?i:[i]).map(Si);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(a,t==null?void 0:t.popupRedirectResolver)}function vO(e,t,i){const a=Ju(e);Te(/^https?:\/\//.test(t),a,"invalid-emulator-scheme");const o=!1,u=CS(t),{host:c,port:d}=xO(t),p=d===null?"":`:${d}`,m={url:`${u}//${c}${p}/`},g=Object.freeze({host:c,port:d,protocol:u.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!a._canInitEmulator){Te(a.config.emulator&&a.emulatorConfig,a,"emulator-config-failed"),Te(Ja(m,a.config.emulator)&&Ja(g,a.emulatorConfig),a,"emulator-config-failed");return}a.config.emulator=m,a.emulatorConfig=g,a.settings.appVerificationDisabledForTesting=!0,Lm(c)?NN(`${u}//${c}${p}`):wO()}function CS(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function xO(e){const t=CS(e),i=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!i)return{host:"",port:null};const a=i[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(a);if(o){const u=o[1];return{host:u,port:Zv(a.substr(u.length+1))}}else{const[u,c]=a.split(":");return{host:u,port:Zv(c)}}}function Zv(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function wO(){function e(){const t=document.createElement("p"),i=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",i.position="fixed",i.width="100%",i.backgroundColor="#ffffff",i.border=".1em solid #000000",i.color="#b50000",i.bottom="0px",i.left="0px",i.margin="0px",i.zIndex="10000",i.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class kS{constructor(t,i){this.providerId=t,this.signInMethod=i}toJSON(){return wi("not implemented")}_getIdTokenResponse(t){return wi("not implemented")}_linkToIdToken(t,i){return wi("not implemented")}_getReauthenticationResolver(t){return wi("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Xa(e,t){return WR(e,"POST","/v1/accounts:signInWithIdp",Vm(e,t))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const SO="http://localhost";class Wr extends kS{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const i=new Wr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(i.idToken=t.idToken),t.accessToken&&(i.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(i.nonce=t.nonce),t.pendingToken&&(i.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(i.accessToken=t.oauthToken,i.secret=t.oauthTokenSecret):$n("argument-error"),i}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const i=typeof t=="string"?JSON.parse(t):t,{providerId:a,signInMethod:o,...u}=i;if(!a||!o)return null;const c=new Wr(a,o);return c.idToken=u.idToken||void 0,c.accessToken=u.accessToken||void 0,c.secret=u.secret,c.nonce=u.nonce,c.pendingToken=u.pendingToken||null,c}_getIdTokenResponse(t){const i=this.buildRequest();return Xa(t,i)}_linkToIdToken(t,i){const a=this.buildRequest();return a.idToken=i,Xa(t,a)}_getReauthenticationResolver(t){const i=this.buildRequest();return i.autoCreate=!1,Xa(t,i)}buildRequest(){const t={requestUri:SO,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const i={};this.idToken&&(i.id_token=this.idToken),this.accessToken&&(i.access_token=this.accessToken),this.secret&&(i.oauth_token_secret=this.secret),i.providerId=this.providerId,this.nonce&&!this.pendingToken&&(i.nonce=this.nonce),t.postBody=Oo(i)}return t}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Gm{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Lo extends Gm{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sr extends Lo{constructor(){super("facebook.com")}static credential(t){return Wr._fromParams({providerId:sr.PROVIDER_ID,signInMethod:sr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return sr.credentialFromTaggedObject(t)}static credentialFromError(t){return sr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return sr.credential(t.oauthAccessToken)}catch{return null}}}sr.FACEBOOK_SIGN_IN_METHOD="facebook.com";sr.PROVIDER_ID="facebook.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xi extends Lo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,i){return Wr._fromParams({providerId:xi.PROVIDER_ID,signInMethod:xi.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:i})}static credentialFromResult(t){return xi.credentialFromTaggedObject(t)}static credentialFromError(t){return xi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:i,oauthAccessToken:a}=t;if(!i&&!a)return null;try{return xi.credential(i,a)}catch{return null}}}xi.GOOGLE_SIGN_IN_METHOD="google.com";xi.PROVIDER_ID="google.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class or extends Lo{constructor(){super("github.com")}static credential(t){return Wr._fromParams({providerId:or.PROVIDER_ID,signInMethod:or.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return or.credentialFromTaggedObject(t)}static credentialFromError(t){return or.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return or.credential(t.oauthAccessToken)}catch{return null}}}or.GITHUB_SIGN_IN_METHOD="github.com";or.PROVIDER_ID="github.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lr extends Lo{constructor(){super("twitter.com")}static credential(t,i){return Wr._fromParams({providerId:lr.PROVIDER_ID,signInMethod:lr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:i})}static credentialFromResult(t){return lr.credentialFromTaggedObject(t)}static credentialFromError(t){return lr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:i,oauthTokenSecret:a}=t;if(!i||!a)return null;try{return lr.credential(i,a)}catch{return null}}}lr.TWITTER_SIGN_IN_METHOD="twitter.com";lr.PROVIDER_ID="twitter.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ts{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,i,a,o=!1){const u=await zn._fromIdTokenResponse(t,a,o),c=$v(a);return new ts({user:u,providerId:c,_tokenResponse:a,operationType:i})}static async _forOperation(t,i,a){await t._updateTokensIfNecessary(a,!0);const o=$v(a);return new ts({user:t,providerId:o,_tokenResponse:a,operationType:i})}}function $v(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Vu extends gr{constructor(t,i,a,o){super(i.code,i.message),this.operationType=a,this.user=o,Object.setPrototypeOf(this,Vu.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:i.customData._serverResponse,operationType:a}}static _fromErrorAndOperation(t,i,a,o){return new Vu(t,i,a,o)}}function MS(e,t,i,a){return(t==="reauthenticate"?i._getReauthenticationResolver(e):i._getIdTokenResponse(e)).catch(u=>{throw u.code==="auth/multi-factor-auth-required"?Vu._fromErrorAndOperation(e,u,t,a):u})}async function TO(e,t,i=!1){const a=await Ao(e,t._linkToIdToken(e.auth,await e.getIdToken()),i);return ts._forOperation(e,"link",a)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function EO(e,t,i=!1){const{auth:a}=e;if(Xn(a.app))return Promise.reject(Qr(a));const o="reauthenticate";try{const u=await Ao(e,MS(a,o,t,e),i);Te(u.idToken,a,"internal-error");const c=Hm(u.idToken);Te(c,a,"internal-error");const{sub:d}=c;return Te(e.uid===d,a,"user-mismatch"),ts._forOperation(e,o,u)}catch(u){throw(u==null?void 0:u.code)==="auth/user-not-found"&&$n(a,"user-mismatch"),u}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function AO(e,t,i=!1){if(Xn(e.app))return Promise.reject(Qr(e));const a="signIn",o=await MS(e,a,t),u=await ts._fromIdTokenResponse(e,a,o);return i||await e._updateCurrentUser(u.user),u}function _O(e,t,i,a){return yr(e).onIdTokenChanged(t,i,a)}function CO(e,t,i){return yr(e).beforeAuthStateChanged(t,i)}function kO(e,t,i,a){return yr(e).onAuthStateChanged(t,i,a)}function Jv(e){return yr(e).signOut()}const Hu="__sak";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class DS{constructor(t,i){this.storageRetriever=t,this.type=i}_isAvailable(){try{return this.storage?(this.storage.setItem(Hu,"1"),this.storage.removeItem(Hu),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,i){return this.storage.setItem(t,JSON.stringify(i)),Promise.resolve()}_get(t){const i=this.storage.getItem(t);return Promise.resolve(i?JSON.parse(i):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const MO=1e3,DO=10;class NS extends DS{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,i)=>this.onStorageEvent(t,i),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=AS(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const i of Object.keys(this.listeners)){const a=this.storage.getItem(i),o=this.localCache[i];a!==o&&t(i,o,a)}}onStorageEvent(t,i=!1){if(!t.key){this.forAllChangedKeys((c,d,p)=>{this.notifyListeners(c,p)});return}const a=t.key;i?this.detachListener():this.stopPolling();const o=()=>{const c=this.storage.getItem(a);!i&&this.localCache[a]===c||this.notifyListeners(a,c)},u=this.storage.getItem(a);oO()&&u!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,DO):o()}notifyListeners(t,i){this.localCache[t]=i;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(i&&JSON.parse(i))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,i,a)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:i,newValue:a}),!0)})},MO)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,i){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,i){await super._set(t,i),this.localCache[t]=JSON.stringify(i)}async _get(t){const i=await super._get(t);return this.localCache[t]=JSON.stringify(i),i}async _remove(t){await super._remove(t),delete this.localCache[t]}}NS.type="LOCAL";const NO=NS;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class RS extends DS{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,i){}_removeListener(t,i){}}RS.type="SESSION";const OS=RS;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function RO(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(i){return{fulfilled:!1,reason:i}}}))}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ec{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const i=this.receivers.find(o=>o.isListeningto(t));if(i)return i;const a=new ec(t);return this.receivers.push(a),a}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const i=t,{eventId:a,eventType:o,data:u}=i.data,c=this.handlersMap[o];if(!(c!=null&&c.size))return;i.ports[0].postMessage({status:"ack",eventId:a,eventType:o});const d=Array.from(c).map(async m=>m(i.origin,u)),p=await RO(d);i.ports[0].postMessage({status:"done",eventId:a,eventType:o,response:p})}_subscribe(t,i){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(i)}_unsubscribe(t,i){this.handlersMap[t]&&i&&this.handlersMap[t].delete(i),(!i||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}ec.receivers=[];/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ym(e="",t=10){let i="";for(let a=0;a{const m=Ym("",20);o.port1.start();const g=setTimeout(()=>{p(new Error("unsupported_event"))},a);c={messageChannel:o,onMessage(y){const v=y;if(v.data.eventId===m)switch(v.data.status){case"ack":clearTimeout(g),u=setTimeout(()=>{p(new Error("timeout"))},3e3);break;case"done":clearTimeout(u),d(v.data.response);break;default:clearTimeout(g),clearTimeout(u),p(new Error("invalid_response"));break}}},this.handlers.add(c),o.port1.addEventListener("message",c.onMessage),this.target.postMessage({eventType:t,eventId:m,data:i},[o.port2])}).finally(()=>{c&&this.removeMessageHandler(c)})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Wn(){return window}function zO(e){Wn().location.href=e}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function zS(){return typeof Wn().WorkerGlobalScope<"u"&&typeof Wn().importScripts=="function"}async function jO(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function LO(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function IO(){return zS()?self:null}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const jS="firebaseLocalStorageDb",UO=1,qu="firebaseLocalStorage",LS="fbase_key";class Io{constructor(t){this.request=t}toPromise(){return new Promise((t,i)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{i(this.request.error)})})}}function tc(e,t){return e.transaction([qu],t?"readwrite":"readonly").objectStore(qu)}function BO(){const e=indexedDB.deleteDatabase(jS);return new Io(e).toPromise()}function Fh(){const e=indexedDB.open(jS,UO);return new Promise((t,i)=>{e.addEventListener("error",()=>{i(e.error)}),e.addEventListener("upgradeneeded",()=>{const a=e.result;try{a.createObjectStore(qu,{keyPath:LS})}catch(o){i(o)}}),e.addEventListener("success",async()=>{const a=e.result;a.objectStoreNames.contains(qu)?t(a):(a.close(),await BO(),t(await Fh()))})})}async function ex(e,t,i){const a=tc(e,!0).put({[LS]:t,value:i});return new Io(a).toPromise()}async function PO(e,t){const i=tc(e,!1).get(t),a=await new Io(i).toPromise();return a===void 0?null:a.value}function tx(e,t){const i=tc(e,!0).delete(t);return new Io(i).toPromise()}const VO=800,HO=3;class IS{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Fh(),this.db)}async _withRetries(t){let i=0;for(;;)try{const a=await this._openDb();return await t(a)}catch(a){if(i++>HO)throw a;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return zS()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ec._getInstance(IO()),this.receiver._subscribe("keyChanged",async(t,i)=>({keyProcessed:(await this._poll()).includes(i.key)})),this.receiver._subscribe("ping",async(t,i)=>["keyChanged"])}async initializeSender(){var i,a;if(this.activeServiceWorker=await jO(),!this.activeServiceWorker)return;this.sender=new OO(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(i=t[0])!=null&&i.fulfilled&&(a=t[0])!=null&&a.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||LO()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Fh();return await ex(t,Hu,"1"),await tx(t,Hu),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,i){return this._withPendingWrite(async()=>(await this._withRetries(a=>ex(a,t,i)),this.localCache[t]=i,this.notifyServiceWorker(t)))}async _get(t){const i=await this._withRetries(a=>PO(a,t));return this.localCache[t]=i,i}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(i=>tx(i,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(o=>{const u=tc(o,!1).getAll();return new Io(u).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const i=[],a=new Set;if(t.length!==0)for(const{fbase_key:o,value:u}of t)a.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(u)&&(this.notifyListeners(o,u),i.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!a.has(o)&&(this.notifyListeners(o,null),i.push(o));return i}notifyListeners(t,i){this.localCache[t]=i;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(i)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),VO)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,i){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}IS.type="LOCAL";const qO=IS;new jo(3e4,6e4);/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function US(e,t){return t?Si(t):(Te(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Xm extends kS{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Xa(t,this._buildIdpRequest())}_linkToIdToken(t,i){return Xa(t,this._buildIdpRequest(i))}_getReauthenticationResolver(t){return Xa(t,this._buildIdpRequest())}_buildIdpRequest(t){const i={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(i.idToken=t),i}}function FO(e){return AO(e.auth,new Xm(e),e.bypassAuthState)}function GO(e){const{auth:t,user:i}=e;return Te(i,t,"internal-error"),EO(i,new Xm(e),e.bypassAuthState)}async function YO(e){const{auth:t,user:i}=e;return Te(i,t,"internal-error"),TO(i,new Xm(e),e.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class BS{constructor(t,i,a,o,u=!1){this.auth=t,this.resolver=a,this.user=o,this.bypassAuthState=u,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(i)?i:[i]}execute(){return new Promise(async(t,i)=>{this.pendingPromise={resolve:t,reject:i};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(a){this.reject(a)}})}async onAuthEvent(t){const{urlResponse:i,sessionId:a,postBody:o,tenantId:u,error:c,type:d}=t;if(c){this.reject(c);return}const p={auth:this.auth,requestUri:i,sessionId:a,tenantId:u||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(d)(p))}catch(m){this.reject(m)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return FO;case"linkViaPopup":case"linkViaRedirect":return YO;case"reauthViaPopup":case"reauthViaRedirect":return GO;default:$n(this.auth,"internal-error")}}resolve(t){Ei(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Ei(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const XO=new jo(2e3,1e4);async function KO(e,t,i){if(Xn(e.app))return Promise.reject(Ln(e,"operation-not-supported-in-this-environment"));const a=Ju(e);qR(e,t,Gm);const o=US(a,i);return new Yr(a,"signInViaPopup",t,o).executeNotNull()}class Yr extends BS{constructor(t,i,a,o,u){super(t,i,o,u),this.provider=a,this.authWindow=null,this.pollId=null,Yr.currentPopupAction&&Yr.currentPopupAction.cancel(),Yr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Te(t,this.auth,"internal-error"),t}async onExecution(){Ei(this.filter.length===1,"Popup operations only handle one event");const t=Ym();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(i=>{this.reject(i)}),this.resolver._isIframeWebStorageSupported(this.auth,i=>{i||this.reject(Ln(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(Ln(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Yr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var i,a;if((a=(i=this.authWindow)==null?void 0:i.window)!=null&&a.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Ln(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,XO.get())};t()}}Yr.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const QO="pendingRedirect",Au=new Map;class WO extends BS{constructor(t,i,a=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],i,void 0,a),this.eventId=null}async execute(){let t=Au.get(this.auth._key());if(!t){try{const a=await ZO(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(a)}catch(i){t=()=>Promise.reject(i)}Au.set(this.auth._key(),t)}return this.bypassAuthState||Au.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const i=await this.auth._redirectUserForId(t.eventId);if(i)return this.user=i,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function ZO(e,t){const i=e3(t),a=JO(e);if(!await a._isAvailable())return!1;const o=await a._get(i)==="true";return await a._remove(i),o}function $O(e,t){Au.set(e._key(),t)}function JO(e){return Si(e._redirectPersistence)}function e3(e){return Eu(QO,e.config.apiKey,e.name)}async function t3(e,t,i=!1){if(Xn(e.app))return Promise.reject(Qr(e));const a=Ju(e),o=US(a,t),c=await new WO(a,o,i).execute();return c&&!i&&(delete c.user._redirectEventId,await a._persistUserIfCurrent(c.user),await a._setRedirectUser(null,t)),c}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const n3=600*1e3;class i3{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let i=!1;return this.consumers.forEach(a=>{this.isEventForConsumer(t,a)&&(i=!0,this.sendToConsumer(t,a),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!r3(t)||(this.hasHandledPotentialRedirect=!0,i||(this.queuedRedirectEvent=t,i=!0)),i}sendToConsumer(t,i){var a;if(t.error&&!PS(t)){const o=((a=t.error.code)==null?void 0:a.split("auth/")[1])||"internal-error";i.onError(Ln(this.auth,o))}else i.onAuthEvent(t)}isEventForConsumer(t,i){const a=i.eventId===null||!!t.eventId&&t.eventId===i.eventId;return i.filter.includes(t.type)&&a}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=n3&&this.cachedEventUids.clear(),this.cachedEventUids.has(nx(t))}saveEventToCache(t){this.cachedEventUids.add(nx(t)),this.lastProcessedEventTime=Date.now()}}function nx(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function PS({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function r3(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return PS(e);default:return!1}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function a3(e,t={}){return as(e,"GET","/v1/projects",t)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const s3=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o3=/^https?/;async function l3(e){if(e.config.emulator)return;const{authorizedDomains:t}=await a3(e);for(const i of t)try{if(u3(i))return}catch{}$n(e,"unauthorized-domain")}function u3(e){const t=Hh(),{protocol:i,hostname:a}=new URL(t);if(e.startsWith("chrome-extension://")){const c=new URL(e);return c.hostname===""&&a===""?i==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):i==="chrome-extension:"&&c.hostname===a}if(!o3.test(i))return!1;if(s3.test(e))return a===e;const o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const c3=new jo(3e4,6e4);function ix(){const e=Wn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let i=0;i{var o,u,c;function a(){ix(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{ix(),i(Ln(e,"network-request-failed"))},timeout:c3.get()})}if((u=(o=Wn().gapi)==null?void 0:o.iframes)!=null&&u.Iframe)t(gapi.iframes.getContext());else if((c=Wn().gapi)!=null&&c.load)a();else{const d=gO("iframefcb");return Wn()[d]=()=>{gapi.load?a():i(Ln(e,"network-request-failed"))},mO(`${pO()}?onload=${d}`).catch(p=>i(p))}}).catch(t=>{throw _u=null,t})}let _u=null;function d3(e){return _u=_u||f3(e),_u}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const h3=new jo(5e3,15e3),m3="__/auth/iframe",p3="emulator/auth/iframe",g3={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},y3=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function b3(e){const t=e.config;Te(t.authDomain,e,"auth-domain-config-required");const i=t.emulator?Pm(t,p3):`https://${e.config.authDomain}/${m3}`,a={apiKey:t.apiKey,appName:e.name,v:zo},o=y3.get(e.config.apiHost);o&&(a.eid=o);const u=e._getFrameworks();return u.length&&(a.fw=u.join(",")),`${i}?${Oo(a).slice(1)}`}async function v3(e){const t=await d3(e),i=Wn().gapi;return Te(i,e,"internal-error"),t.open({where:document.body,url:b3(e),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:g3,dontclear:!0},a=>new Promise(async(o,u)=>{await a.restyle({setHideOnLeave:!1});const c=Ln(e,"network-request-failed"),d=Wn().setTimeout(()=>{u(c)},h3.get());function p(){Wn().clearTimeout(d),o(a)}a.ping(p).then(p,()=>{u(c)})}))}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const x3={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},w3=500,S3=600,T3="_blank",E3="http://localhost";class rx{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function A3(e,t,i,a=w3,o=S3){const u=Math.max((window.screen.availHeight-o)/2,0).toString(),c=Math.max((window.screen.availWidth-a)/2,0).toString();let d="";const p={...x3,width:a.toString(),height:o.toString(),top:u,left:c},m=Ft().toLowerCase();i&&(d=xS(m)?T3:i),bS(m)&&(t=t||E3,p.scrollbars="yes");const g=Object.entries(p).reduce((v,[x,A])=>`${v}${x}=${A},`,"");if(sO(m)&&d!=="_self")return _3(t||"",d),new rx(null);const y=window.open(t||"",d,g);Te(y,e,"popup-blocked");try{y.focus()}catch{}return new rx(y)}function _3(e,t){const i=document.createElement("a");i.href=e,i.target=t;const a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),i.dispatchEvent(a)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const C3="__/auth/handler",k3="emulator/auth/handler",M3=encodeURIComponent("fac");async function ax(e,t,i,a,o,u){Te(e.config.authDomain,e,"auth-domain-config-required"),Te(e.config.apiKey,e,"invalid-api-key");const c={apiKey:e.config.apiKey,appName:e.name,authType:i,redirectUrl:a,v:zo,eventId:o};if(t instanceof Gm){t.setDefaultLanguage(e.languageCode),c.providerId=t.providerId||"",CN(t.getCustomParameters())||(c.customParameters=JSON.stringify(t.getCustomParameters()));for(const[g,y]of Object.entries({}))c[g]=y}if(t instanceof Lo){const g=t.getScopes().filter(y=>y!=="");g.length>0&&(c.scopes=g.join(","))}e.tenantId&&(c.tid=e.tenantId);const d=c;for(const g of Object.keys(d))d[g]===void 0&&delete d[g];const p=await e._getAppCheckToken(),m=p?`#${M3}=${encodeURIComponent(p)}`:"";return`${D3(e)}?${Oo(d).slice(1)}${m}`}function D3({config:e}){return e.emulator?Pm(e,k3):`https://${e.authDomain}/${C3}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Kd="webStorageSupport";class N3{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=OS,this._completeRedirectFn=t3,this._overrideRedirectResult=$O}async _openPopup(t,i,a,o){var c;Ei((c=this.eventManagers[t._key()])==null?void 0:c.manager,"_initialize() not called before _openPopup()");const u=await ax(t,i,a,Hh(),o);return A3(t,u,Ym())}async _openRedirect(t,i,a,o){await this._originValidation(t);const u=await ax(t,i,a,Hh(),o);return zO(u),new Promise(()=>{})}_initialize(t){const i=t._key();if(this.eventManagers[i]){const{manager:o,promise:u}=this.eventManagers[i];return o?Promise.resolve(o):(Ei(u,"If manager is not set, promise should be"),u)}const a=this.initAndGetManager(t);return this.eventManagers[i]={promise:a},a.catch(()=>{delete this.eventManagers[i]}),a}async initAndGetManager(t){const i=await v3(t),a=new i3(t);return i.register("authEvent",o=>(Te(o==null?void 0:o.authEvent,t,"invalid-auth-event"),{status:a.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:a},this.iframes[t._key()]=i,a}_isIframeWebStorageSupported(t,i){this.iframes[t._key()].send(Kd,{type:Kd},o=>{var c;const u=(c=o==null?void 0:o[0])==null?void 0:c[Kd];u!==void 0&&i(!!u),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const i=t._key();return this.originValidationPromises[i]||(this.originValidationPromises[i]=l3(t)),this.originValidationPromises[i]}get _shouldInitProactively(){return AS()||vS()||qm()}}const R3=N3;var sx="@firebase/auth",ox="1.13.0";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class O3{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const i=this.auth.onIdTokenChanged(a=>{t((a==null?void 0:a.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,i),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const i=this.internalListeners.get(t);i&&(this.internalListeners.delete(t),i(),this.updateProactiveRefresh())}assertAuthConfigured(){Te(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function z3(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function j3(e){To(new es("auth",(t,{options:i})=>{const a=t.getProvider("app").getImmediate(),o=t.getProvider("heartbeat"),u=t.getProvider("app-check-internal"),{apiKey:c,authDomain:d}=a.options;Te(c&&!c.includes(":"),"invalid-api-key",{appName:a.name});const p={apiKey:c,authDomain:d,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:_S(e)},m=new dO(a,o,u,p);return bO(m,i),m},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,i,a)=>{t.getProvider("auth-internal").initialize()})),To(new es("auth-internal",t=>{const i=Ju(t.getProvider("auth").getImmediate());return(a=>new O3(a))(i)},"PRIVATE").setInstantiationMode("EXPLICIT")),Fa(sx,ox,z3(e)),Fa(sx,ox,"esm2020")}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const L3=300,I3=iS("authIdTokenMaxAge")||L3;let lx=null;const U3=e=>async t=>{const i=t&&await t.getIdTokenResult(),a=i&&(new Date().getTime()-Date.parse(i.issuedAtTime))/1e3;if(a&&a>I3)return;const o=i==null?void 0:i.token;lx!==o&&(lx=o,await fetch(e,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function B3(e=DR()){const t=oS(e,"auth");if(t.isInitialized())return t.getImmediate();const i=yO(e,{popupRedirectResolver:R3,persistence:[qO,NO,OS]}),a=iS("authTokenSyncURL");if(a&&typeof isSecureContext=="boolean"&&isSecureContext){const u=new URL(a,location.origin);if(location.origin===u.origin){const c=U3(u.toString());CO(i,c,()=>c(i.currentUser)),_O(i,d=>c(d))}}const o=pN("auth");return o&&vO(i,`http://${o}`),i}function P3(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}hO({loadJS(e){return new Promise((t,i)=>{const a=document.createElement("script");a.setAttribute("src",e),a.onload=t,a.onerror=o=>{const u=Ln("internal-error");u.customData=o,i(u)},a.type="text/javascript",a.charset="UTF-8",P3().appendChild(a)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});j3("Browser");function VS(e){var t,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const i=new Array(e.length+t.length);for(let a=0;a({classGroupId:e,validator:t}),HS=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Fu="-",ux=[],F3="arbitrary..",G3=e=>{const t=X3(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Y3(c);const d=c.split(Fu),p=d[0]===""&&d.length>1?1:0;return qS(d,p,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const p=a[c],m=i[c];return p?m?H3(m,p):p:m||ux}return i[c]||ux}}},qS=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const o=e[t],u=i.nextPart.get(o);if(u){const m=qS(e,t+1,u);if(m)return m}const c=i.validators;if(c===null)return;const d=t===0?e.join(Fu):e.slice(t).join(Fu),p=c.length;for(let m=0;me.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),a=t.slice(0,i);return a?F3+a:void 0})(),X3=e=>{const{theme:t,classGroups:i}=e;return K3(i,t)},K3=(e,t)=>{const i=HS();for(const a in e){const o=e[a];Km(o,i,a,t)}return i},Km=(e,t,i,a)=>{const o=e.length;for(let u=0;u{if(typeof e=="string"){W3(e,t,i);return}if(typeof e=="function"){Z3(e,t,i,a);return}$3(e,t,i,a)},W3=(e,t,i)=>{const a=e===""?t:FS(t,e);a.classGroupId=i},Z3=(e,t,i,a)=>{if(J3(e)){Km(e(a),t,i,a);return}t.validators===null&&(t.validators=[]),t.validators.push(q3(i,e))},$3=(e,t,i,a)=>{const o=Object.entries(e),u=o.length;for(let c=0;c{let i=e;const a=t.split(Fu),o=a.length;for(let u=0;u"isThemeGetter"in e&&e.isThemeGetter===!0,ez=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),a=Object.create(null);const o=(u,c)=>{i[u]=c,t++,t>e&&(t=0,a=i,i=Object.create(null))};return{get(u){let c=i[u];if(c!==void 0)return c;if((c=a[u])!==void 0)return o(u,c),c},set(u,c){u in i?i[u]=c:o(u,c)}}},Gh="!",cx=":",tz=[],fx=(e,t,i,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:a,isExternal:o}),nz=e=>{const{prefix:t,experimentalParseClassName:i}=e;let a=o=>{const u=[];let c=0,d=0,p=0,m;const g=o.length;for(let M=0;Mp?m-p:void 0;return fx(u,x,v,A)};if(t){const o=t+cx,u=a;a=c=>c.startsWith(o)?u(c.slice(o.length)):fx(tz,!1,c,void 0,!0)}if(i){const o=a;a=u=>i({className:u,parseClassName:o})}return a},iz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,a)=>{t.set(i,1e6+a)}),i=>{const a=[];let o=[];for(let u=0;u0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},rz=e=>({cache:ez(e.cacheSize),parseClassName:nz(e),sortModifiers:iz(e),...G3(e)}),az=/\s+/,sz=(e,t)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:u}=t,c=[],d=e.trim().split(az);let p="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:y,modifiers:v,hasImportantModifier:x,baseClassName:A,maybePostfixModifierPosition:M}=i(g);if(y){p=g+(p.length>0?" "+p:p);continue}let R=!!M,C=a(R?A.substring(0,M):A);if(!C){if(!R){p=g+(p.length>0?" "+p:p);continue}if(C=a(A),!C){p=g+(p.length>0?" "+p:p);continue}R=!1}const B=v.length===0?"":v.length===1?v[0]:u(v).join(":"),D=x?B+Gh:B,H=D+C;if(c.indexOf(H)>-1)continue;c.push(H);const X=o(C,R);for(let j=0;j0?" "+p:p)}return p},oz=(...e)=>{let t=0,i,a,o="";for(;t{if(typeof e=="string")return e;let t,i="";for(let a=0;a{let i,a,o,u;const c=p=>{const m=t.reduce((g,y)=>y(g),e());return i=rz(m),a=i.cache.get,o=i.cache.set,u=d,d(p)},d=p=>{const m=a(p);if(m)return m;const g=sz(p,i);return o(p,g),g};return u=c,(...p)=>u(oz(...p))},uz=[],xt=e=>{const t=i=>i[e]||uz;return t.isThemeGetter=!0,t},YS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dz=/\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$/,hz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ji=e=>cz.test(e),Me=e=>!!e&&!Number.isNaN(Number(e)),er=e=>!!e&&Number.isInteger(Number(e)),Qd=e=>e.endsWith("%")&&Me(e.slice(0,-1)),vi=e=>fz.test(e),KS=()=>!0,gz=e=>dz.test(e)&&!hz.test(e),Qm=()=>!1,yz=e=>mz.test(e),bz=e=>pz.test(e),vz=e=>!he(e)&&!pe(e),xz=e=>br(e,ZS,Qm),he=e=>YS.test(e),Pr=e=>br(e,$S,gz),dx=e=>br(e,kz,Me),wz=e=>br(e,eT,KS),Sz=e=>br(e,JS,Qm),hx=e=>br(e,QS,Qm),Tz=e=>br(e,WS,bz),lu=e=>br(e,tT,yz),pe=e=>XS.test(e),no=e=>Zr(e,$S),Ez=e=>Zr(e,JS),mx=e=>Zr(e,QS),Az=e=>Zr(e,ZS),_z=e=>Zr(e,WS),uu=e=>Zr(e,tT,!0),Cz=e=>Zr(e,eT,!0),br=(e,t,i)=>{const a=YS.exec(e);return a?a[1]?t(a[1]):i(a[2]):!1},Zr=(e,t,i=!1)=>{const a=XS.exec(e);return a?a[1]?t(a[1]):i:!1},QS=e=>e==="position"||e==="percentage",WS=e=>e==="image"||e==="url",ZS=e=>e==="length"||e==="size"||e==="bg-size",$S=e=>e==="length",kz=e=>e==="number",JS=e=>e==="family-name",eT=e=>e==="number"||e==="weight",tT=e=>e==="shadow",Mz=()=>{const e=xt("color"),t=xt("font"),i=xt("text"),a=xt("font-weight"),o=xt("tracking"),u=xt("leading"),c=xt("breakpoint"),d=xt("container"),p=xt("spacing"),m=xt("radius"),g=xt("shadow"),y=xt("inset-shadow"),v=xt("text-shadow"),x=xt("drop-shadow"),A=xt("blur"),M=xt("perspective"),R=xt("aspect"),C=xt("ease"),B=xt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...H(),pe,he],j=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],P=()=>[pe,he,p],ee=()=>[Ji,"full","auto",...P()],ne=()=>[er,"none","subgrid",pe,he],J=()=>["auto",{span:["full",er,pe,he]},er,pe,he],W=()=>[er,"auto",pe,he],ye=()=>["auto","min","max","fr",pe,he],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...P()],Z=()=>[Ji,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],ae=()=>[Ji,"screen","full","dvw","lvw","svw","min","max","fit",...P()],ce=()=>[Ji,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],T=()=>[e,pe,he],k=()=>[...H(),mx,hx,{position:[pe,he]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",Az,xz,{size:[pe,he]}],le=()=>[Qd,no,Pr],fe=()=>["","none","full",m,pe,he],ue=()=>["",Me,no,Pr],Ae=()=>["solid","dashed","dotted","double"],He=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Me,Qd,mx,hx],At=()=>["","none",A,pe,he],Ot=()=>["none",Me,pe,he],St=()=>["none",Me,pe,he],Un=()=>[Me,pe,he],zt=()=>[Ji,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vi],breakpoint:[vi],color:[KS],container:[vi],"drop-shadow":[vi],ease:["in","out","in-out"],font:[vz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vi],shadow:[vi],spacing:["px",Me],text:[vi],"text-shadow":[vi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ji,he,pe,R]}],container:["container"],columns:[{columns:[Me,he,pe,d]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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"],sr:["sr-only","not-sr-only"],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:X()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[er,"auto",pe,he]}],basis:[{basis:[Ji,"full","auto",d,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,Ji,"auto","initial","none",he]}],grow:[{grow:["",Me,pe,he]}],shrink:[{shrink:["",Me,pe,he]}],order:[{order:[er,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ye()}],"auto-rows":[{"auto-rows":ye()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[d,"screen",...Z()]}],"min-w":[{"min-w":[d,"screen","none",...Z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",i,no,Pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Cz,wz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qd,he]}],"font-family":[{font:[Ez,Sz,t]}],"font-features":[{"font-features":[he]}],"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:[o,pe,he]}],"line-clamp":[{"line-clamp":[Me,"none",pe,dx]}],leading:[{leading:[u,...P()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",pe,Pr]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Me,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},er,pe,he],radial:["",pe,he],conic:[er,pe,he]},_z,Tz]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,pe,he]}],"outline-w":[{outline:["",Me,no,Pr]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",g,uu,lu]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",y,uu,lu]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Me,Pr]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",v,uu,lu]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Me,pe,he]}],"mix-blend":[{"mix-blend":[...He(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":He()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:At()}],brightness:[{brightness:[Me,pe,he]}],contrast:[{contrast:[Me,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",x,uu,lu]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Me,pe,he]}],"hue-rotate":[{"hue-rotate":[Me,pe,he]}],invert:[{invert:["",Me,pe,he]}],saturate:[{saturate:[Me,pe,he]}],sepia:[{sepia:["",Me,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":At()}],"backdrop-brightness":[{"backdrop-brightness":[Me,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Me,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",Me,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Me,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Me,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",pe,he]}],ease:[{ease:["linear","initial",C,pe,he]}],delay:[{delay:[Me,pe,he]}],animate:[{animate:["none",B,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,pe,he]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:Ot()}],"rotate-x":[{"rotate-x":Ot()}],"rotate-y":[{"rotate-y":Ot()}],"rotate-z":[{"rotate-z":Ot()}],scale:[{scale:St()}],"scale-x":[{"scale-x":St()}],"scale-y":[{"scale-y":St()}],"scale-z":[{"scale-z":St()}],"scale-3d":["scale-3d"],skew:[{skew:Un()}],"skew-x":[{"skew-x":Un()}],"skew-y":[{"skew-y":Un()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:zt()}],"translate-x":[{"translate-x":zt()}],"translate-y":[{"translate-y":zt()}],"translate-z":[{"translate-z":zt()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",pe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,he]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Me,no,Pr,dx]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Dz=lz(Mz);function On(...e){return Dz(V3(e))}const Nz=({isConnected:e,onLogout:t})=>S.jsx("header",{className:"relative z-50 border-b border-white/10 bg-black/25 px-4 py-4 backdrop-blur-2xl sm:px-6 lg:px-8",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-7xl items-center justify-between gap-4",children:[S.jsxs("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[S.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-[linear-gradient(135deg,#6366f1_0%,#2563eb_50%,#06b6d4_100%)] shadow-[0_18px_40px_rgba(79,70,229,0.38)]",children:S.jsx(sN,{className:"h-5 w-5 text-white"})}),S.jsxs("div",{className:"min-w-0",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Portal Brief CDC"}),S.jsx("span",{className:"hidden rounded-full border border-white/10 bg-white/5 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-zinc-400 sm:inline-flex",children:"Experiencia guiada"})]}),S.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 sm:gap-3",children:[S.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-2.5 py-1 text-xs text-zinc-300",children:[S.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[e&&S.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-70"}),S.jsx("span",{className:On("relative inline-flex h-2.5 w-2.5 rounded-full",e?"bg-emerald-400":"bg-red-400")})]}),e?"Conectado al flujo":"Sin conexión"]}),S.jsxs("div",{className:"hidden items-center gap-2 rounded-full border border-indigo-400/20 bg-indigo-500/10 px-2.5 py-1 text-xs text-indigo-200 sm:inline-flex",children:[S.jsx(zm,{className:"h-3.5 w-3.5"}),"Flujo validado"]})]})]})]}),S.jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-4 py-2.5 text-sm font-medium text-zinc-200 transition hover:border-white/20 hover:bg-white/10 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50","aria-label":"Cerrar sesión",children:[S.jsx(BD,{className:"h-4 w-4"}),S.jsx("span",{className:"hidden sm:inline",children:"Cerrar sesión"})]})]})}),cu=[{id:"audio",number:1,title:"Nota de voz",hint:"Obligatorio. Graba una nota de voz explicando el brief.",required:!0},{id:"images",number:2,title:"Imágenes de referencia",hint:"Obligatorio. Adjunta una o varias imágenes de referencia.",required:!0},{id:"documents",number:3,title:"Documentos relacionados",hint:"Opcional. Adjunta PDF, Excel, PowerPoint, Word u otros archivos de apoyo.",required:!1},{id:"campaign",number:4,title:"Campaña o elementos gráficos",hint:"Opcional. Si ya existen piezas gráficas o logos, adjúntalos aquí.",required:!1},{id:"links",number:5,title:"Enlaces de referencia online",hint:"Opcional. Pega enlaces, uno por línea.",required:!1},{id:"review",number:6,title:"Revisión y envío",hint:"Revisa la solicitud y envíala solo desde este paso final.",required:!0}],Wd=e=>{const t=Number.isFinite(e)?Math.max(0,e):0,i=Math.floor(t/60),a=t%60;return`${i}:${a.toString().padStart(2,"0")}`},Rz=({onSendMessage:e,isProcessing:t})=>{const[i,a]=$.useState(""),[o,u]=$.useState([]),[c,d]=$.useState(!1),[p,m]=$.useState(0),[g,y]=$.useState(null),[v,x]=$.useState("audio"),[A,M]=$.useState(null),[R,C]=$.useState(null),[B,D]=$.useState(!1),[H,X]=$.useState(0),j=$.useRef(null),te=$.useRef(null),P=$.useRef(null),ee=$.useRef([]),ne=$.useRef(null),J=$.useRef(0),W=$.useRef([]),ye=$.useRef(null),ie=$.useRef(null),K=$.useMemo(()=>o.filter(se=>se.type==="image"&&se.category!=="campaign"),[o]),O=$.useMemo(()=>o.filter(se=>se.category!=="campaign"&&se.type!=="image"),[o]),Z=$.useMemo(()=>o.filter(se=>se.category==="campaign"),[o]),ae=$.useMemo(()=>i.split(` `).map(se=>se.trim()).filter(Boolean).length,[i]),ce=!!g&&K.length>0,T=A!=="yes"||Z.length>0,k=ce&&T,q=(cu.findIndex(se=>se.id===v)+1)/cu.length*100;$.useEffect(()=>{W.current=o},[o]),$.useEffect(()=>{ye.current=g},[g]),$.useEffect(()=>{D(!1),X(0),ie.current&&(ie.current.pause(),ie.current.currentTime=0)},[g==null?void 0:g.url]);const E=async()=>{if(!(!ie.current||!g)){if(B){ie.current.pause(),D(!1),X(Math.floor(ie.current.currentTime||0));return}try{await ie.current.play(),D(!0)}catch(se){console.error("No se pudo reproducir la nota de voz:",se),D(!1),C("No se pudo reproducir la nota de voz. Intenta grabarla nuevamente.")}}};$.useEffect(()=>()=>{var se;W.current.forEach(De=>URL.revokeObjectURL(De.url)),(se=ye.current)!=null&&se.url&&URL.revokeObjectURL(ye.current.url),ne.current&&clearInterval(ne.current)},[]);const le=se=>{switch(se){case"audio":return g?"done":v==="audio"?"active":"pending";case"images":return K.length>0?"done":v==="images"?"active":"pending";case"documents":return O.length>0?"done":v==="documents"?"active":"pending";case"campaign":return A==="no"||A==="yes"&&Z.length>0?"done":v==="campaign"?"active":"pending";case"links":return ae>0?"done":v==="links"?"active":"pending";case"review":return v==="review"?"active":k?"done":"pending";default:return"pending"}},fe=se=>se.type.startsWith("image/")?"image":se.type.startsWith("video/")?"video":se.type.startsWith("audio/")?"audio":se.type.includes("pdf")||se.type.includes("document")||se.type.includes("sheet")||se.type.includes("excel")||se.type.includes("powerpoint")||se.type.startsWith("text/")?"document":"other",ue=()=>v==="campaign"?"campaign":"general",Ae=se=>{const De=Array.from(se.target.files||[]);if(!De.length)return;let Ye=De;v==="images"&&(Ye=De.filter(Lt=>Lt.type.startsWith("image/")),Ye.length!==De.length&&C("En este paso solo se permiten imágenes. Los demás archivos no se agregaron.")),v==="documents"&&(Ye=De.filter(Lt=>!Lt.type.startsWith("image/")&&!Lt.type.startsWith("audio/")),Ye.length!==De.length&&C("En este paso agrega documentos o archivos de apoyo. Las imágenes y audios se omiten aquí.")),v==="campaign"&&(Ye=De.filter(Lt=>!Lt.type.startsWith("audio/")),Ye.length!==De.length&&C("En este paso adjunta piezas, documentos o referencias gráficas. Los audios se omiten aquí."));const jt=ue(),xr=Ye.map(Lt=>({id:Math.random().toString(36).substring(7),file:Lt,type:fe(Lt),url:URL.createObjectURL(Lt),category:jt}));u(Lt=>[...Lt,...xr]),Ye.length>0&&C(null),j.current&&(j.current.value="")},He=se=>{u(De=>{const Ye=De.find(jt=>jt.id===se);return Ye&&URL.revokeObjectURL(Ye.url),De.filter(jt=>jt.id!==se)})},xe=async()=>{try{const se=await navigator.mediaDevices.getUserMedia({audio:!0}),De=new MediaRecorder(se);P.current=De,ee.current=[],De.ondataavailable=Ye=>{Ye.data.size>0&&ee.current.push(Ye.data)},De.onstop=()=>{const Ye=new Blob(ee.current,{type:"audio/webm"}),jt=URL.createObjectURL(Ye);y({blob:Ye,url:jt,duration:J.current}),se.getTracks().forEach(xr=>xr.stop())},De.start(),C(null),d(!0),J.current=0,m(0),ne.current=window.setInterval(()=>{m(Ye=>{const jt=Ye+1;return J.current=jt,jt})},1e3)}catch(se){console.error("Error accessing microphone:",se),C("No se pudo acceder al micrófono. Revisa los permisos del navegador.")}},At=()=>{P.current&&c&&(P.current.stop(),d(!1),ne.current&&clearInterval(ne.current))},Ot=()=>{ie.current&&(ie.current.pause(),ie.current.currentTime=0),D(!1),X(0),g!=null&&g.url&&URL.revokeObjectURL(g.url),y(null),J.current=0,m(0)},St=se=>{x(se),C(null)},Un=()=>{if(v==="audio"){if(!g){C("Debes grabar una nota de voz para continuar.");return}St("images");return}if(v==="images"){if(K.length===0){C("Debes adjuntar al menos una imagen de referencia para continuar.");return}St("documents");return}if(v==="documents"){St("campaign");return}if(v==="campaign"){if(A==="yes"&&Z.length===0){C("Seleccionaste que sí existen elementos gráficos. Adjunta al menos un archivo para continuar.");return}St("links");return}v==="links"&&St("review")},zt=()=>{const se=i.split(` `).map(Ye=>Ye.trim()).filter(Boolean).join(` `),De=["Solicitud enviada desde el portal guiado del Brief CDC.",`Nota de voz: ${g?"sí":"no"}`,`Imágenes de referencia: ${K.length}`,`Documentos relacionados: ${O.length}`,`Campaña o elementos gráficos existentes: ${A==="yes"?"sí":A==="no"?"no":"no indicado"}`,`Archivos de campaña / elementos gráficos: ${Z.length}`];return se&&De.push("","Enlaces de referencia:",se),De.join(` `)},Ai=()=>{if(!ce){C("Completa primero la nota de voz y al menos una imagen de referencia.");return}if(!T){C("Seleccionaste que sí existen elementos gráficos. Adjunta al menos un archivo antes de enviar.");return}if(v!=="review"){C("El envío solo está disponible en el paso final de revisión."),St("review");return}t||(e(zt(),o,g||void 0),a(""),u([]),ie.current&&(ie.current.pause(),ie.current.currentTime=0),D(!1),X(0),y(null),J.current=0,m(0),M(null),x("audio"),C(null))},Bn=cu.find(se=>se.id===v),_i=(g==null?void 0:g.duration)||0;return S.jsxs("div",{className:"rounded-[32px] border border-white/10 bg-[linear-gradient(180deg,rgba(8,12,24,0.96),rgba(10,12,20,0.86))] p-4 shadow-[0_28px_80px_rgba(0,0,0,0.38)] backdrop-blur-2xl sm:p-5 lg:p-6",children:[S.jsxs("div",{className:"mb-5 overflow-hidden rounded-[28px] border border-white/10 bg-white/5 p-4",children:[S.jsxs("div",{className:"mb-3 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[S.jsxs("div",{children:[S.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-indigo-400/20 bg-indigo-500/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.22em] text-indigo-200",children:[S.jsx(tN,{className:"h-3.5 w-3.5"})," Flujo guiado"]}),S.jsx("h3",{className:"mt-3 text-xl font-semibold tracking-tight text-white",children:"Construye la solicitud paso por paso"}),S.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:"Completa primero los pasos obligatorios. Luego podrás adjuntar documentos, piezas gráficas y referencias online."})]}),S.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 px-4 py-3 text-sm text-zinc-300",children:[S.jsx("span",{className:"font-semibold text-white",children:"Progreso:"})," ",k?"listo para enviar":`${Math.round(q)}% del flujo`]})]}),S.jsx("div",{className:"mb-4 h-2 overflow-hidden rounded-full bg-white/5",children:S.jsx($a.div,{className:"h-full rounded-full bg-[linear-gradient(90deg,#6366f1_0%,#3b82f6_55%,#22d3ee_100%)]",animate:{width:`${q}%`},transition:{type:"spring",stiffness:80,damping:18}})}),S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-6",children:cu.map(se=>{const De=le(se.id);return S.jsxs("button",{type:"button",onClick:()=>St(se.id),className:On("group relative flex min-h-[178px] flex-col justify-between overflow-hidden rounded-[24px] border p-4 text-left transition-all",De==="done"&&"border-emerald-400/25 bg-emerald-500/10",De==="active"&&"border-indigo-400/30 bg-[linear-gradient(180deg,rgba(99,102,241,0.18),rgba(59,130,246,0.08))] shadow-[0_18px_40px_rgba(79,70,229,0.18)]",De==="pending"&&"border-white/10 bg-black/20 hover:border-white/20 hover:bg-black/25"),children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("span",{className:"rounded-full border border-white/10 bg-white/5 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.26em] text-zinc-400",children:["Paso ",se.number]}),De==="done"?S.jsx(AD,{className:"h-4 w-4 text-emerald-300"}):De==="active"?S.jsx("div",{className:"h-3 w-3 rounded-full bg-indigo-300 shadow-[0_0_14px_rgba(129,140,248,0.7)]"}):S.jsx("div",{className:"h-3 w-3 rounded-full bg-zinc-600"})]}),S.jsxs("div",{className:"pt-5",children:[S.jsx("h4",{className:"text-sm font-semibold leading-5 text-white",children:se.title}),S.jsx("p",{className:"mt-2 text-xs leading-6 text-zinc-400",children:se.hint})]})]},se.id)})})]}),S.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1.45fr_0.85fr]",children:[S.jsxs("div",{children:[S.jsx(Lw,{children:(o.length>0||g)&&S.jsxs($a.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[g&&S.jsxs("div",{className:"relative overflow-hidden rounded-[24px] border border-indigo-400/25 bg-[linear-gradient(145deg,rgba(99,102,241,0.24),rgba(15,23,42,0.78))] p-4 shadow-[0_18px_45px_rgba(79,70,229,0.14)] sm:col-span-2 xl:col-span-3",children:[S.jsx("div",{className:"pointer-events-none absolute -right-10 -top-10 h-28 w-28 rounded-full bg-indigo-400/20 blur-2xl"}),S.jsxs("div",{className:"relative flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[S.jsxs("div",{className:"flex min-w-0 items-center gap-3 pr-10",children:[S.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl border border-white/10 bg-black/25",children:S.jsx(Ov,{className:"h-6 w-6 text-indigo-100"})}),S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"text-base font-semibold leading-6 text-white",children:"Nota de voz"}),S.jsxs("p",{className:"mt-0.5 text-sm leading-5 text-indigo-100/80",children:["Lista para escuchar · Duración: ",Wd(g.duration)]})]})]}),S.jsx("div",{className:"relative w-full rounded-2xl border border-white/10 bg-black/25 p-3 sm:max-w-[520px]",children:S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("button",{type:"button",onClick:E,className:"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-white text-slate-950 shadow-[0_12px_28px_rgba(0,0,0,0.26)] transition hover:scale-105 hover:bg-zinc-200","aria-label":B?"Pausar nota de voz":"Reproducir nota de voz",children:B?S.jsx(GD,{className:"h-5 w-5 fill-current"}):S.jsx(XD,{className:"ml-0.5 h-5 w-5 fill-current"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[S.jsx("p",{className:"text-sm font-semibold leading-5 text-white",children:B?"Reproduciendo":"Reproducir"}),S.jsxs("p",{className:"font-mono text-xs leading-5 text-indigo-100/80",children:[Wd(H)," / ",Wd(_i)]})]}),S.jsx("input",{type:"range",min:"0",max:Math.max(1,_i),step:"1",value:Math.min(H,_i||0),onChange:se=>{const De=Number(se.target.value);X(De),ie.current&&(ie.current.currentTime=De)},className:"audio-preview-range mt-3 w-full cursor-pointer","aria-label":"Adelantar o atrasar la nota de voz"})]}),S.jsx("audio",{ref:ie,src:g.url,preload:"metadata",onTimeUpdate:se=>X(Math.floor(se.currentTarget.currentTime||0)),onEnded:()=>{D(!1),X(0),ie.current&&(ie.current.currentTime=0)},onPause:se=>{D(!1),X(Math.floor(se.currentTarget.currentTime||0))},onPlay:()=>D(!0),className:"hidden"})]})})]}),S.jsx("button",{onClick:Ot,className:"absolute right-3 top-3 flex h-8 w-8 items-center justify-center rounded-full bg-black/35 text-white transition hover:bg-red-500/80","aria-label":"Eliminar nota de voz",children:S.jsx(Lh,{className:"h-4 w-4"})})]}),o.map(se=>S.jsxs("div",{className:"relative overflow-hidden rounded-[24px] border border-white/10 bg-white/5 p-3.5",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[se.type==="image"?S.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-2xl border border-white/10 bg-black/20",children:S.jsx("img",{src:se.url,alt:"preview",className:"h-full w-full object-cover"})}):S.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-white/10 bg-black/20",children:S.jsx(RD,{className:"h-6 w-6 text-zinc-300"})}),S.jsxs("div",{className:"min-w-0 flex-1 pr-7",children:[S.jsx("p",{className:"truncate text-sm font-medium text-white",children:se.file.name}),S.jsx("p",{className:"mt-1 text-xs text-zinc-400",children:se.category==="campaign"?"Campaña / elemento gráfico":se.type==="image"?"Imagen de referencia":"Documento / archivo de apoyo"})]})]}),S.jsx("button",{onClick:()=>He(se.id),className:"absolute right-3 top-3 flex h-7 w-7 items-center justify-center rounded-full bg-black/30 text-white transition hover:bg-red-500/80","aria-label":"Eliminar archivo",children:S.jsx(Lh,{className:"h-3.5 w-3.5"})})]},se.id))]})}),S.jsxs("div",{className:"rounded-[28px] border border-white/10 bg-black/20 p-4 sm:p-5",children:[S.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[S.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-indigo-400/20 bg-indigo-500/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.24em] text-indigo-200",children:["Paso ",Bn.number]}),S.jsx("h3",{className:"text-lg font-semibold text-white",children:Bn.title}),S.jsx("span",{className:"text-sm text-zinc-400",children:Bn.hint})]}),v==="audio"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"Graba una nota de voz explicando el brief. Incluye país, cliente, marca, tipo de requerimiento, objetivos, entregables, presupuesto y fechas clave."}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsxs("button",{onClick:c?At:xe,className:On("inline-flex items-center gap-2 rounded-2xl px-5 py-3.5 text-sm font-semibold transition-all",c?"bg-red-500/20 text-red-200 hover:bg-red-500/30":"bg-[linear-gradient(135deg,#6366f1_0%,#2563eb_100%)] text-white shadow-[0_18px_40px_rgba(79,70,229,0.25)] hover:brightness-110"),disabled:t,children:[c?S.jsx(JD,{className:"h-4 w-4 fill-current"}):S.jsx(Ov,{className:"h-4 w-4"}),c?`Detener grabación (${p}s)`:"Grabar nota de voz"]}),g&&S.jsx("span",{className:"text-sm text-emerald-300",children:"Nota de voz lista para enviar."})]})]}),v==="images"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"Adjunta una o varias imágenes de referencia. Este paso es obligatorio para continuar."}),S.jsxs("button",{onClick:()=>{var se;return(se=j.current)==null?void 0:se.click()},className:"inline-flex items-center gap-2 rounded-2xl bg-[linear-gradient(135deg,#6366f1_0%,#2563eb_100%)] px-5 py-3.5 text-sm font-semibold text-white shadow-[0_18px_40px_rgba(79,70,229,0.25)] transition hover:brightness-110 disabled:opacity-50",disabled:t||c,children:[S.jsx(zD,{className:"h-4 w-4"}),"Agregar imágenes"]})]}),v==="documents"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"Adjunta documentos relacionados, referencias y archivos de apoyo. Puedes subir PDF, Excel, PowerPoint, Word y otros materiales."}),S.jsxs("button",{onClick:()=>{var se;return(se=j.current)==null?void 0:se.click()},className:"inline-flex items-center gap-2 rounded-2xl border border-white/10 bg-black/25 px-5 py-3.5 text-sm font-semibold text-zinc-100 transition hover:border-white/20 hover:bg-black/35 disabled:opacity-50",disabled:t||c,children:[S.jsx(zv,{className:"h-4 w-4"}),"Agregar documentos relacionados"]})]}),v==="campaign"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"¿Ya existe campaña o elementos gráficos para esta solicitud? Si existen piezas, artes, logos, lineamientos o referencias aprobadas, adjúntalas aquí para evitar retrabajo."}),S.jsxs("div",{className:"mb-5 flex flex-wrap gap-3",children:[S.jsx("button",{type:"button",onClick:()=>{M("yes"),C(null)},className:On("rounded-2xl border px-5 py-3 text-sm font-semibold transition",A==="yes"?"border-indigo-300/40 bg-indigo-500/20 text-white":"border-white/10 bg-black/25 text-zinc-200 hover:border-white/20 hover:bg-black/35"),disabled:t||c,children:"Sí, adjuntar elementos"}),S.jsx("button",{type:"button",onClick:()=>{M("no"),C(null)},className:On("rounded-2xl border px-5 py-3 text-sm font-semibold transition",A==="no"?"border-emerald-300/40 bg-emerald-500/15 text-white":"border-white/10 bg-black/25 text-zinc-200 hover:border-white/20 hover:bg-black/35"),disabled:t||c,children:"No, continuar sin piezas"})]}),A==="yes"&&S.jsxs("button",{onClick:()=>{var se;return(se=j.current)==null?void 0:se.click()},className:"inline-flex items-center gap-2 rounded-2xl border border-white/10 bg-black/25 px-5 py-3.5 text-sm font-semibold text-zinc-100 transition hover:border-white/20 hover:bg-black/35 disabled:opacity-50",disabled:t||c,children:[S.jsx(zv,{className:"h-4 w-4"}),"Adjuntar campaña o elementos gráficos"]})]}),v==="links"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"Pega enlaces de referencia online, uno por línea. Este paso es opcional."}),S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-black/25 px-4 py-3 transition-colors focus-within:border-indigo-400/30",children:[S.jsxs("div",{className:"mb-3 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs font-medium text-zinc-300",children:[S.jsx(LD,{className:"h-3.5 w-3.5 text-indigo-300"})," Enlaces de referencia"]}),S.jsx("textarea",{ref:te,value:i,onChange:se=>a(se.target.value),placeholder:`Pega aquí tus enlaces de referencia, uno por línea https://www.figma.com/... https://drive.google.com/...`,className:"h-40 max-h-40 w-full resize-none overflow-y-auto bg-transparent pr-2 text-[15px] leading-7 text-zinc-100 placeholder:text-zinc-500 outline-none scrollbar-thin",disabled:t})]})]}),v==="review"&&S.jsxs("div",{className:"rounded-[24px] border border-white/10 bg-white/5 p-4",children:[S.jsx("p",{className:"mb-5 text-sm leading-7 text-zinc-300",children:"Revisa el resumen antes de enviar. Este es el único paso donde se puede finalizar la solicitud."}),S.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[S.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4",children:[S.jsx("p",{className:"text-xs uppercase tracking-[0.22em] text-zinc-500",children:"Obligatorios"}),S.jsxs("div",{className:"mt-3 space-y-2 text-sm text-zinc-300",children:[S.jsxs("p",{children:["Nota de voz: ",S.jsx("span",{className:g?"text-emerald-300":"text-amber-300",children:g?"lista":"pendiente"})]}),S.jsxs("p",{children:["Imágenes: ",S.jsx("span",{className:K.length?"text-emerald-300":"text-amber-300",children:K.length})]})]})]}),S.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4",children:[S.jsx("p",{className:"text-xs uppercase tracking-[0.22em] text-zinc-500",children:"Soporte"}),S.jsxs("div",{className:"mt-3 space-y-2 text-sm text-zinc-300",children:[S.jsxs("p",{children:["Documentos: ",S.jsx("span",{className:"text-white",children:O.length})]}),S.jsxs("p",{children:["Campaña / gráficos: ",S.jsx("span",{className:"text-white",children:A==="yes"?`${Z.length} archivo(s)`:A==="no"?"no aplica":"no indicado"})]}),S.jsxs("p",{children:["Enlaces: ",S.jsx("span",{className:"text-white",children:ae})]})]})]})]})]}),S.jsx("input",{type:"file",multiple:!0,className:"hidden",ref:j,onChange:Ae,accept:v==="images"?"image/*":void 0}),R&&S.jsxs("div",{className:"mt-4 flex items-start gap-3 rounded-2xl border border-amber-500/20 bg-amber-500/10 px-4 py-3 text-sm text-amber-100",children:[S.jsx(jh,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),S.jsx("span",{children:R})]}),S.jsxs("div",{className:"sticky bottom-0 mt-5 flex flex-wrap items-center justify-between gap-3 border-t border-white/5 bg-[linear-gradient(180deg,rgba(8,12,24,0),rgba(8,12,24,0.96)_28%)] pt-4 pb-1",children:[S.jsx("div",{className:"text-sm text-zinc-400",children:k?"Todo está listo. El envío solo se realiza desde el paso final.":"Completa primero la nota de voz y las imágenes. Si marcaste campaña, adjunta sus archivos."}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v!=="review"?S.jsxs("button",{onClick:Un,disabled:t,className:"inline-flex items-center gap-2 rounded-2xl border border-white/10 bg-black/25 px-4 py-3 text-sm font-semibold text-zinc-100 transition hover:border-white/20 hover:bg-black/35 disabled:opacity-50",children:["Continuar",S.jsx(xD,{className:"h-4 w-4"})]}):null,v==="review"&&S.jsxs("button",{onClick:Ai,disabled:t||!k,className:"inline-flex items-center gap-2 rounded-2xl bg-[linear-gradient(135deg,#6366f1_0%,#2563eb_100%)] px-5 py-3 text-sm font-semibold text-white shadow-[0_18px_40px_rgba(79,70,229,0.2)] transition hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",children:[t?S.jsx(Zw,{className:"h-4 w-4 animate-spin"}):S.jsx(QD,{className:"h-4 w-4"}),"Finalizar y enviar"]})]})]})]})]}),S.jsxs("aside",{className:"rounded-[28px] border border-white/10 bg-white/5 p-4 sm:p-5",children:[S.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-zinc-500",children:"Panel de control"}),S.jsxs("div",{className:"mt-4 space-y-3",children:[S.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4",children:[S.jsx("p",{className:"text-xs uppercase tracking-[0.22em] text-zinc-500",children:"Obligatorios"}),S.jsxs("div",{className:"mt-3 space-y-3",children:[S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsx("span",{className:"text-zinc-300",children:"Nota de voz"}),S.jsx("span",{className:On("font-semibold",g?"text-emerald-300":"text-zinc-500"),children:g?"Lista":"Pendiente"})]}),S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsx("span",{className:"text-zinc-300",children:"Imágenes"}),S.jsx("span",{className:On("font-semibold",K.length>0?"text-emerald-300":"text-zinc-500"),children:K.length>0?`${K.length} cargada(s)`:"Pendiente"})]})]})]}),S.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4",children:[S.jsx("p",{className:"text-xs uppercase tracking-[0.22em] text-zinc-500",children:"Opcionales"}),S.jsxs("div",{className:"mt-3 space-y-3 text-sm text-zinc-300",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{children:"Documentos"}),S.jsx("span",{className:"font-semibold text-white",children:O.length})]}),S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{children:"Campaña / gráficos"}),S.jsx("span",{className:"font-semibold text-white",children:A==="yes"?Z.length:A==="no"?"No aplica":"No indicado"})]}),S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{children:"Enlaces"}),S.jsx("span",{className:"font-semibold text-white",children:ae})]})]})]}),S.jsxs("div",{className:"rounded-2xl border border-indigo-400/20 bg-[linear-gradient(180deg,rgba(99,102,241,0.16),rgba(99,102,241,0.04))] p-4",children:[S.jsx("p",{className:"text-sm font-semibold text-white",children:"Cómo se procesará tu solicitud"}),S.jsxs("ul",{className:"mt-3 space-y-3 text-sm leading-6 text-zinc-300",children:[S.jsx("li",{children:"• La voz, las imágenes y los PDFs alimentan la interpretación del brief."}),S.jsx("li",{children:"• Los documentos de apoyo se guardan completos en la carpeta del proyecto."}),S.jsx("li",{children:"• Los enlaces se agregan como referencias dentro del documento final."})]})]})]})]})]})]})},nT=6048e5,Oz=864e5,px=Symbol.for("constructDateFrom");function mr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&px in e?e[px](t):e instanceof Date?new e.constructor(t):new Date(t)}function In(e,t){return mr(t||e,e)}let zz={};function nc(){return zz}function _o(e,t){var d,p,m,g;const i=nc(),a=(t==null?void 0:t.weekStartsOn)??((p=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,o=In(e,t==null?void 0:t.in),u=o.getDay(),c=(u=u.getTime()?a+1:i.getTime()>=d.getTime()?a:a-1}function gx(e){const t=In(e),i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return i.setUTCFullYear(t.getFullYear()),+e-+i}function jz(e,...t){const i=mr.bind(null,t.find(a=>typeof a=="object"));return t.map(i)}function yx(e,t){const i=In(e,t==null?void 0:t.in);return i.setHours(0,0,0,0),i}function Lz(e,t,i){const[a,o]=jz(i==null?void 0:i.in,e,t),u=yx(a),c=yx(o),d=+u-gx(u),p=+c-gx(c);return Math.round((d-p)/Oz)}function Iz(e,t){const i=iT(e,t),a=mr(e,0);return a.setFullYear(i,0,4),a.setHours(0,0,0,0),Gu(a)}function Uz(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Bz(e){return!(!Uz(e)&&typeof e!="number"||isNaN(+In(e)))}function Pz(e,t){const i=In(e,t==null?void 0:t.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}const Vz={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hz=(e,t,i)=>{let a;const o=Vz[e];return typeof o=="string"?a=o:t===1?a=o.one:a=o.other.replace("{{count}}",t.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+a:a+" ago":a};function Zd(e){return(t={})=>{const i=t.width?String(t.width):e.defaultWidth;return e.formats[i]||e.formats[e.defaultWidth]}}const qz={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Fz={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Gz={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yz={date:Zd({formats:qz,defaultWidth:"full"}),time:Zd({formats:Fz,defaultWidth:"full"}),dateTime:Zd({formats:Gz,defaultWidth:"full"})},Xz={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Kz=(e,t,i,a)=>Xz[e];function io(e){return(t,i)=>{const a=i!=null&&i.context?String(i.context):"standalone";let o;if(a==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=i!=null&&i.width?String(i.width):c;o=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=i!=null&&i.width?String(i.width):e.defaultWidth;o=e.values[d]||e.values[c]}const u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}const Qz={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wz={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Zz={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Jz={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},e4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},t4=(e,t)=>{const i=Number(e),a=i%100;if(a>20||a<10)switch(a%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},n4={ordinalNumber:t4,era:io({values:Qz,defaultWidth:"wide"}),quarter:io({values:Wz,defaultWidth:"wide",argumentCallback:e=>e-1}),month:io({values:Zz,defaultWidth:"wide"}),day:io({values:$z,defaultWidth:"wide"}),dayPeriod:io({values:Jz,defaultWidth:"wide",formattingValues:e4,defaultFormattingWidth:"wide"})};function ro(e){return(t,i={})=>{const a=i.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],u=t.match(o);if(!u)return null;const c=u[0],d=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],p=Array.isArray(d)?r4(d,y=>y.test(c)):i4(d,y=>y.test(c));let m;m=e.valueCallback?e.valueCallback(p):p,m=i.valueCallback?i.valueCallback(m):m;const g=t.slice(c.length);return{value:m,rest:g}}}function i4(e,t){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return i}function r4(e,t){for(let i=0;i{const a=t.match(e.matchPattern);if(!a)return null;const o=a[0],u=t.match(e.parsePattern);if(!u)return null;let c=e.valueCallback?e.valueCallback(u[0]):u[0];c=i.valueCallback?i.valueCallback(c):c;const d=t.slice(o.length);return{value:c,rest:d}}}const s4=/^(\d+)(th|st|nd|rd)?/i,o4=/\d+/i,l4={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},u4={any:[/^b/i,/^(a|c)/i]},c4={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f4={any:[/1/i,/2/i,/3/i,/4/i]},d4={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},h4={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m4={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},p4={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},g4={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},y4={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},b4={ordinalNumber:a4({matchPattern:s4,parsePattern:o4,valueCallback:e=>parseInt(e,10)}),era:ro({matchPatterns:l4,defaultMatchWidth:"wide",parsePatterns:u4,defaultParseWidth:"any"}),quarter:ro({matchPatterns:c4,defaultMatchWidth:"wide",parsePatterns:f4,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ro({matchPatterns:d4,defaultMatchWidth:"wide",parsePatterns:h4,defaultParseWidth:"any"}),day:ro({matchPatterns:m4,defaultMatchWidth:"wide",parsePatterns:p4,defaultParseWidth:"any"}),dayPeriod:ro({matchPatterns:g4,defaultMatchWidth:"any",parsePatterns:y4,defaultParseWidth:"any"})},v4={code:"en-US",formatDistance:Hz,formatLong:Yz,formatRelative:Kz,localize:n4,match:b4,options:{weekStartsOn:0,firstWeekContainsDate:1}};function x4(e,t){const i=In(e,t==null?void 0:t.in);return Lz(i,Pz(i))+1}function w4(e,t){const i=In(e,t==null?void 0:t.in),a=+Gu(i)-+Iz(i);return Math.round(a/nT)+1}function rT(e,t){var g,y,v,x;const i=In(e,t==null?void 0:t.in),a=i.getFullYear(),o=nc(),u=(t==null?void 0:t.firstWeekContainsDate)??((y=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??o.firstWeekContainsDate??((x=(v=o.locale)==null?void 0:v.options)==null?void 0:x.firstWeekContainsDate)??1,c=mr((t==null?void 0:t.in)||e,0);c.setFullYear(a+1,0,u),c.setHours(0,0,0,0);const d=_o(c,t),p=mr((t==null?void 0:t.in)||e,0);p.setFullYear(a,0,u),p.setHours(0,0,0,0);const m=_o(p,t);return+i>=+d?a+1:+i>=+m?a:a-1}function S4(e,t){var d,p,m,g;const i=nc(),a=(t==null?void 0:t.firstWeekContainsDate)??((p=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=rT(e,t),u=mr((t==null?void 0:t.in)||e,0);return u.setFullYear(o,0,a),u.setHours(0,0,0,0),_o(u,t)}function T4(e,t){const i=In(e,t==null?void 0:t.in),a=+_o(i,t)-+S4(i,t);return Math.round(a/nT)+1}function Ge(e,t){const i=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return i+a}const tr={y(e,t){const i=e.getFullYear(),a=i>0?i:1-i;return Ge(t==="yy"?a%100:a,t.length)},M(e,t){const i=e.getMonth();return t==="M"?String(i+1):Ge(i+1,2)},d(e,t){return Ge(e.getDate(),t.length)},a(e,t){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h(e,t){return Ge(e.getHours()%12||12,t.length)},H(e,t){return Ge(e.getHours(),t.length)},m(e,t){return Ge(e.getMinutes(),t.length)},s(e,t){return Ge(e.getSeconds(),t.length)},S(e,t){const i=t.length,a=e.getMilliseconds(),o=Math.trunc(a*Math.pow(10,i-3));return Ge(o,t.length)}},Ia={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bx={G:function(e,t,i){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return i.era(a,{width:"abbreviated"});case"GGGGG":return i.era(a,{width:"narrow"});case"GGGG":default:return i.era(a,{width:"wide"})}},y:function(e,t,i){if(t==="yo"){const a=e.getFullYear(),o=a>0?a:1-a;return i.ordinalNumber(o,{unit:"year"})}return tr.y(e,t)},Y:function(e,t,i,a){const o=rT(e,a),u=o>0?o:1-o;if(t==="YY"){const c=u%100;return Ge(c,2)}return t==="Yo"?i.ordinalNumber(u,{unit:"year"}):Ge(u,t.length)},R:function(e,t){const i=iT(e);return Ge(i,t.length)},u:function(e,t){const i=e.getFullYear();return Ge(i,t.length)},Q:function(e,t,i){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Ge(a,2);case"Qo":return i.ordinalNumber(a,{unit:"quarter"});case"QQQ":return i.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,i){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Ge(a,2);case"qo":return i.ordinalNumber(a,{unit:"quarter"});case"qqq":return i.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,i){const a=e.getMonth();switch(t){case"M":case"MM":return tr.M(e,t);case"Mo":return i.ordinalNumber(a+1,{unit:"month"});case"MMM":return i.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,i){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Ge(a+1,2);case"Lo":return i.ordinalNumber(a+1,{unit:"month"});case"LLL":return i.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,i,a){const o=T4(e,a);return t==="wo"?i.ordinalNumber(o,{unit:"week"}):Ge(o,t.length)},I:function(e,t,i){const a=w4(e);return t==="Io"?i.ordinalNumber(a,{unit:"week"}):Ge(a,t.length)},d:function(e,t,i){return t==="do"?i.ordinalNumber(e.getDate(),{unit:"date"}):tr.d(e,t)},D:function(e,t,i){const a=x4(e);return t==="Do"?i.ordinalNumber(a,{unit:"dayOfYear"}):Ge(a,t.length)},E:function(e,t,i){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return i.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(a,{width:"short",context:"formatting"});case"EEEE":default:return i.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,i,a){const o=e.getDay(),u=(o-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(u);case"ee":return Ge(u,2);case"eo":return i.ordinalNumber(u,{unit:"day"});case"eee":return i.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(o,{width:"short",context:"formatting"});case"eeee":default:return i.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,i,a){const o=e.getDay(),u=(o-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(u);case"cc":return Ge(u,t.length);case"co":return i.ordinalNumber(u,{unit:"day"});case"ccc":return i.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(o,{width:"narrow",context:"standalone"});case"cccccc":return i.day(o,{width:"short",context:"standalone"});case"cccc":default:return i.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,i){const a=e.getDay(),o=a===0?7:a;switch(t){case"i":return String(o);case"ii":return Ge(o,t.length);case"io":return i.ordinalNumber(o,{unit:"day"});case"iii":return i.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(a,{width:"short",context:"formatting"});case"iiii":default:return i.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,i){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,i){const a=e.getHours();let o;switch(a===12?o=Ia.noon:a===0?o=Ia.midnight:o=a/12>=1?"pm":"am",t){case"b":case"bb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,i){const a=e.getHours();let o;switch(a>=17?o=Ia.evening:a>=12?o=Ia.afternoon:a>=4?o=Ia.morning:o=Ia.night,t){case"B":case"BB":case"BBB":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,i){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),i.ordinalNumber(a,{unit:"hour"})}return tr.h(e,t)},H:function(e,t,i){return t==="Ho"?i.ordinalNumber(e.getHours(),{unit:"hour"}):tr.H(e,t)},K:function(e,t,i){const a=e.getHours()%12;return t==="Ko"?i.ordinalNumber(a,{unit:"hour"}):Ge(a,t.length)},k:function(e,t,i){let a=e.getHours();return a===0&&(a=24),t==="ko"?i.ordinalNumber(a,{unit:"hour"}):Ge(a,t.length)},m:function(e,t,i){return t==="mo"?i.ordinalNumber(e.getMinutes(),{unit:"minute"}):tr.m(e,t)},s:function(e,t,i){return t==="so"?i.ordinalNumber(e.getSeconds(),{unit:"second"}):tr.s(e,t)},S:function(e,t){return tr.S(e,t)},X:function(e,t,i){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return xx(a);case"XXXX":case"XX":return qr(a);case"XXXXX":case"XXX":default:return qr(a,":")}},x:function(e,t,i){const a=e.getTimezoneOffset();switch(t){case"x":return xx(a);case"xxxx":case"xx":return qr(a);case"xxxxx":case"xxx":default:return qr(a,":")}},O:function(e,t,i){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+vx(a,":");case"OOOO":default:return"GMT"+qr(a,":")}},z:function(e,t,i){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+vx(a,":");case"zzzz":default:return"GMT"+qr(a,":")}},t:function(e,t,i){const a=Math.trunc(+e/1e3);return Ge(a,t.length)},T:function(e,t,i){return Ge(+e,t.length)}};function vx(e,t=""){const i=e>0?"-":"+",a=Math.abs(e),o=Math.trunc(a/60),u=a%60;return u===0?i+String(o):i+String(o)+t+Ge(u,2)}function xx(e,t){return e%60===0?(e>0?"-":"+")+Ge(Math.abs(e)/60,2):qr(e,t)}function qr(e,t=""){const i=e>0?"-":"+",a=Math.abs(e),o=Ge(Math.trunc(a/60),2),u=Ge(a%60,2);return i+o+t+u}const wx=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},aT=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},E4=(e,t)=>{const i=e.match(/(P+)(p+)?/)||[],a=i[1],o=i[2];if(!o)return wx(e,t);let u;switch(a){case"P":u=t.dateTime({width:"short"});break;case"PP":u=t.dateTime({width:"medium"});break;case"PPP":u=t.dateTime({width:"long"});break;case"PPPP":default:u=t.dateTime({width:"full"});break}return u.replace("{{date}}",wx(a,t)).replace("{{time}}",aT(o,t))},A4={p:aT,P:E4},_4=/^D+$/,C4=/^Y+$/,k4=["D","DD","YY","YYYY"];function M4(e){return _4.test(e)}function D4(e){return C4.test(e)}function N4(e,t,i){const a=R4(e,t,i);if(console.warn(a),k4.includes(e))throw new RangeError(a)}function R4(e,t,i){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const O4=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,z4=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,j4=/^'([^]*?)'?$/,L4=/''/g,I4=/[a-zA-Z]/;function U4(e,t,i){var g,y,v,x;const a=nc(),o=a.locale??v4,u=a.firstWeekContainsDate??((y=(g=a.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??1,c=a.weekStartsOn??((x=(v=a.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,d=In(e,i==null?void 0:i.in);if(!Bz(d))throw new RangeError("Invalid time value");let p=t.match(z4).map(A=>{const M=A[0];if(M==="p"||M==="P"){const R=A4[M];return R(A,o.formatLong)}return A}).join("").match(O4).map(A=>{if(A==="''")return{isToken:!1,value:"'"};const M=A[0];if(M==="'")return{isToken:!1,value:B4(A)};if(bx[M])return{isToken:!0,value:A};if(M.match(I4))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");return{isToken:!1,value:A}});o.localize.preprocessor&&(p=o.localize.preprocessor(d,p));const m={firstWeekContainsDate:u,weekStartsOn:c,locale:o};return p.map(A=>{if(!A.isToken)return A.value;const M=A.value;(D4(M)||M4(M))&&N4(M,t,String(e));const R=bx[M[0]];return R(d,M,o.localize,m)}).join("")}function B4(e){const t=e.match(j4);return t?t[1].replace(L4,"'"):e}function P4(e,t){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const V4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q4={};function Sx(e,t){return(q4.jsx?H4:V4).test(e)}const F4=/[ \t\n\f\r]/g;function G4(e){return typeof e=="object"?e.type==="text"?Tx(e.value):!1:Tx(e)}function Tx(e){return e.replace(F4,"")===""}class Uo{constructor(t,i,a){this.normal=i,this.property=t,a&&(this.space=a)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function sT(e,t){const i={},a={};for(const o of e)Object.assign(i,o.property),Object.assign(a,o.normal);return new Uo(i,a,t)}function Yh(e){return e.toLowerCase()}class tn{constructor(t,i){this.attribute=i,this.property=t}}tn.prototype.attribute="";tn.prototype.booleanish=!1;tn.prototype.boolean=!1;tn.prototype.commaOrSpaceSeparated=!1;tn.prototype.commaSeparated=!1;tn.prototype.defined=!1;tn.prototype.mustUseProperty=!1;tn.prototype.number=!1;tn.prototype.overloadedBoolean=!1;tn.prototype.property="";tn.prototype.spaceSeparated=!1;tn.prototype.space=void 0;let Y4=0;const ke=$r(),gt=$r(),Xh=$r(),re=$r(),tt=$r(),Ka=$r(),fn=$r();function $r(){return 2**++Y4}const Kh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:gt,commaOrSpaceSeparated:fn,commaSeparated:Ka,number:re,overloadedBoolean:Xh,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),$d=Object.keys(Kh);class Wm extends tn{constructor(t,i,a,o){let u=-1;if(super(t,i),Ex(this,"space",o),typeof a=="number")for(;++u<$d.length;){const c=$d[u];Ex(this,$d[u],(a&Kh[c])===Kh[c])}}}Wm.prototype.defined=!0;function Ex(e,t,i){i&&(e[t]=i)}function ss(e){const t={},i={};for(const[a,o]of Object.entries(e.properties)){const u=new Wm(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,i[Yh(a)]=a,i[Yh(u.attribute)]=a}return new Uo(t,i,e.space)}const oT=ss({properties:{ariaActiveDescendant:null,ariaAtomic:gt,ariaAutoComplete:null,ariaBusy:gt,ariaChecked:gt,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:tt,ariaCurrent:null,ariaDescribedBy:tt,ariaDetails:null,ariaDisabled:gt,ariaDropEffect:tt,ariaErrorMessage:null,ariaExpanded:gt,ariaFlowTo:tt,ariaGrabbed:gt,ariaHasPopup:null,ariaHidden:gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tt,ariaLevel:re,ariaLive:null,ariaModal:gt,ariaMultiLine:gt,ariaMultiSelectable:gt,ariaOrientation:null,ariaOwns:tt,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:gt,ariaReadOnly:gt,ariaRelevant:null,ariaRequired:gt,ariaRoleDescription:tt,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:gt,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lT(e,t){return t in e?e[t]:t}function uT(e,t){return lT(e,t.toLowerCase())}const X4=ss({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ka,acceptCharset:tt,accessKey:tt,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:tt,autoFocus:ke,autoPlay:ke,blocking:tt,capture:null,charSet:null,checked:ke,cite:null,className:tt,cols:re,colSpan:null,content:null,contentEditable:gt,controls:ke,controlsList:tt,coords:re|Ka,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Xh,draggable:gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:tt,height:re,hidden:Xh,high:re,href:null,hrefLang:null,htmlFor:tt,httpEquiv:tt,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:tt,itemRef:tt,itemScope:ke,itemType:tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ke,optimum:re,pattern:null,ping:tt,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:tt,required:ke,reversed:ke,rows:re,rowSpan:re,sandbox:tt,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:gt,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tt,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:gt,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ke,disableRemotePlayback:ke,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:uT}),K4=ss({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fn,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:tt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ka,g2:Ka,glyphName:Ka,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fn,rev:fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fn,requiredFeatures:fn,requiredFonts:fn,requiredFormats:fn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fn,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lT}),cT=ss({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),fT=ss({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uT}),dT=ss({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Q4={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},W4=/[A-Z]/g,Ax=/-[a-z]/g,Z4=/^data[-\w.:]+$/i;function $4(e,t){const i=Yh(t);let a=t,o=tn;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&Z4.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Ax,e5);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Ax.test(u)){let c=u.replace(W4,J4);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}o=Wm}return new o(a,t)}function J4(e){return"-"+e.toLowerCase()}function e5(e){return e.charAt(1).toUpperCase()}const t5=sT([oT,X4,cT,fT,dT],"html"),Zm=sT([oT,K4,cT,fT,dT],"svg");function n5(e){return e.join(" ").trim()}var Ua={},Jd,_x;function i5(){if(_x)return Jd;_x=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=` `,m="/",g="*",y="",v="comment",x="declaration";function A(R,C){if(typeof R!="string")throw new TypeError("First argument must be a string");if(!R)return[];C=C||{};var B=1,D=1;function H(ie){var K=ie.match(t);K&&(B+=K.length);var O=ie.lastIndexOf(p);D=~O?ie.length-O:D+ie.length}function X(){var ie={line:B,column:D};return function(K){return K.position=new j(ie),ee(),K}}function j(ie){this.start=ie,this.end={line:B,column:D},this.source=C.source}j.prototype.content=R;function te(ie){var K=new Error(C.source+":"+B+":"+D+": "+ie);if(K.reason=ie,K.filename=C.source,K.line=B,K.column=D,K.source=R,!C.silent)throw K}function P(ie){var K=ie.exec(R);if(K){var O=K[0];return H(O),R=R.slice(O.length),K}}function ee(){P(i)}function ne(ie){var K;for(ie=ie||[];K=J();)K!==!1&&ie.push(K);return ie}function J(){var ie=X();if(!(m!=R.charAt(0)||g!=R.charAt(1))){for(var K=2;y!=R.charAt(K)&&(g!=R.charAt(K)||m!=R.charAt(K+1));)++K;if(K+=2,y===R.charAt(K-1))return te("End of comment missing");var O=R.slice(2,K-2);return D+=2,H(O),R=R.slice(K),D+=2,ie({type:v,comment:O})}}function W(){var ie=X(),K=P(a);if(K){if(J(),!P(o))return te("property missing ':'");var O=P(u),Z=ie({type:x,property:M(K[0].replace(e,y)),value:O?M(O[0].replace(e,y)):y});return P(c),Z}}function ye(){var ie=[];ne(ie);for(var K;K=W();)K!==!1&&(ie.push(K),ne(ie));return ie}return ee(),ye()}function M(R){return R?R.replace(d,y):y}return Jd=A,Jd}var Cx;function r5(){if(Cx)return Ua;Cx=1;var e=Ua&&Ua.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.default=i;const t=e(i5());function i(a,o){let u=null;if(!a||typeof a!="string")return u;const c=(0,t.default)(a),d=typeof o=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:g}=p;d?o(m,g,p):g&&(u=u||{},u[m]=g)}),u}return Ua}var ao={},kx;function a5(){if(kx)return ao;kx=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(m){return!m||i.test(m)||e.test(m)},c=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},p=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(o,d):m=m.replace(a,d),m.replace(t,c))};return ao.camelCase=p,ao}var so,Mx;function s5(){if(Mx)return so;Mx=1;var e=so&&so.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(r5()),i=a5();function a(o,u){var c={};return!o||typeof o!="string"||(0,t.default)(o,function(d,p){d&&p&&(c[(0,i.camelCase)(d,u)]=p)}),c}return a.default=a,so=a,so}var o5=s5();const l5=nm(o5),hT=mT("end"),$m=mT("start");function mT(e){return t;function t(i){const a=i&&i.position&&i.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function u5(e){const t=$m(e),i=hT(e);if(t&&i)return{start:t,end:i}}function go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dx(e.position):"start"in e||"end"in e?Dx(e):"line"in e||"column"in e?Qh(e):""}function Qh(e){return Nx(e&&e.line)+":"+Nx(e&&e.column)}function Dx(e){return Qh(e&&e.start)+"-"+Qh(e&&e.end)}function Nx(e){return e&&typeof e=="number"?e:1}class Ut extends Error{constructor(t,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let o="",u={},c=!1;if(i&&("line"in i&&"column"in i?u={place:i}:"start"in i&&"end"in i?u={place:i}:"type"in i?u={ancestors:[i],place:i.position}:u={...i}),typeof t=="string"?o=t:!u.cause&&t&&(c=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const p=a.indexOf(":");p===-1?u.ruleId=a:(u.source=a.slice(0,p),u.ruleId=a.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=go(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ut.prototype.file="";Ut.prototype.name="";Ut.prototype.reason="";Ut.prototype.message="";Ut.prototype.stack="";Ut.prototype.column=void 0;Ut.prototype.line=void 0;Ut.prototype.ancestors=void 0;Ut.prototype.cause=void 0;Ut.prototype.fatal=void 0;Ut.prototype.place=void 0;Ut.prototype.ruleId=void 0;Ut.prototype.source=void 0;const Jm={}.hasOwnProperty,c5=new Map,f5=/[A-Z]/g,d5=new Set(["table","tbody","thead","tfoot","tr"]),h5=new Set(["td","th"]),pT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function m5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=S5(i,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=w5(i,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zm:t5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=gT(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function gT(e,t,i){if(t.type==="element")return p5(e,t,i);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return g5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return b5(e,t,i);if(t.type==="mdxjsEsm")return y5(e,t);if(t.type==="root")return v5(e,t,i);if(t.type==="text")return x5(e,t)}function p5(e,t,i){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Zm,e.schema=o),e.ancestors.push(t);const u=bT(e,t.tagName,!1),c=T5(e,t);let d=tp(e,t);return d5.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!G4(p):!0})),yT(e,c,u,t),ep(c,d),e.ancestors.pop(),e.schema=a,e.create(t,u,c,i)}function g5(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Co(e,t.position)}function y5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Co(e,t.position)}function b5(e,t,i){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Zm,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:bT(e,t.name,!0),c=E5(e,t),d=tp(e,t);return yT(e,c,u,t),ep(c,d),e.ancestors.pop(),e.schema=a,e.create(t,u,c,i)}function v5(e,t,i){const a={};return ep(a,tp(e,t)),e.create(t,e.Fragment,a,i)}function x5(e,t){return t.value}function yT(e,t,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(t.node=a)}function ep(e,t){if(t.length>0){const i=t.length>1?t:t[0];i&&(e.children=i)}}function w5(e,t,i){return a;function a(o,u,c,d){const m=Array.isArray(c.children)?i:t;return d?m(u,c,d):m(u,c)}}function S5(e,t){return i;function i(a,o,u,c){const d=Array.isArray(u.children),p=$m(a);return t(o,u,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function T5(e,t){const i={};let a,o;for(o in t.properties)if(o!=="children"&&Jm.call(t.properties,o)){const u=A5(e,o,t.properties[o]);if(u){const[c,d]=u;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&h5.has(t.tagName)?a=d:i[c]=d}}if(a){const u=i.style||(i.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function E5(e,t){const i={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const c=u.expression;c.type;const d=c.properties[0];d.type,Object.assign(i,e.evaluater.evaluateExpression(d.argument))}else Co(e,t.position);else{const o=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else Co(e,t.position);else u=a.value===null?!0:a.value;i[o]=u}return i}function tp(e,t){const i=[];let a=-1;const o=e.passKeys?new Map:c5;for(;++ao?0:o+t:t=t>o?o:t,i=i>0?i:0,a.length<1e4)c=Array.from(a),c.unshift(t,i),e.splice(...c);else for(i&&e.splice(t,i);u0?(Jn(e,e.length,0,t),e):t}const zx={}.hasOwnProperty;function O5(e){const t={};let i=-1;for(;++i13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kn=vr(/[A-Za-z]/),dn=vr(/[\dA-Za-z]/),L5=vr(/[#-'*+\--9=?A-Z^-~]/);function Wh(e){return e!==null&&(e<32||e===127)}const Zh=vr(/\d/),I5=vr(/[\dA-Fa-f]/),U5=vr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function en(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const B5=vr(new RegExp("\\p{P}|\\p{S}","u")),P5=vr(/\s/);function vr(e){return t;function t(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function os(e){const t=[];let i=-1,a=0,o=0;for(;++i55295&&u<57344){const d=e.charCodeAt(i+1);u<56320&&d>56319&&d<57344?(c=String.fromCharCode(u,d),o=1):c="�"}else c=String.fromCharCode(u);c&&(t.push(e.slice(a,i),encodeURIComponent(c)),a=i+o+1,c=""),o&&(i+=o,o=0)}return t.join("")+e.slice(a)}function nt(e,t,i,a){const o=a?a-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(p){return Pe(p)?(e.enter(i),d(p)):t(p)}function d(p){return Pe(p)&&u++c))return;const te=t.events.length;let P=te,ee,ne;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(ee){ne=t.events[P][1].end;break}ee=!0}for(C(a),j=te;jD;){const X=i[H];t.containerState=X[1],X[0].exit.call(t,e)}i.length=D}function B(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function G5(e,t,i){return nt(e,e.attempt(this.parser.constructs.document,t,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lx(e){if(e===null||en(e)||P5(e))return 1;if(B5(e))return 2}function ip(e,t,i){const a=[];let o=-1;for(;++o1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const y={...e[a][1].end},v={...e[i][1].start};Ix(y,-p),Ix(v,p),c={type:p>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:v},u={type:p>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},o={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[i][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=En(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=En(m,[["enter",o,t],["enter",c,t],["exit",c,t],["enter",u,t]]),m=En(m,ip(t.parser.constructs.insideSpan.null,e.slice(a+1,i),t)),m=En(m,[["exit",u,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,m=En(m,[["enter",e[i][1],t],["exit",e[i][1],t]])):g=0,Jn(e,a-1,i-a+3,m),i=a+m.length-g-2;break}}for(i=-1;++i0&&Pe(j)?nt(e,B,"linePrefix",u+1)(j):B(j)}function B(j){return j===null||Se(j)?e.check(Ux,M,H)(j):(e.enter("codeFlowValue"),D(j))}function D(j){return j===null||Se(j)?(e.exit("codeFlowValue"),B(j)):(e.consume(j),D)}function H(j){return e.exit("codeFenced"),t(j)}function X(j,te,P){let ee=0;return ne;function ne(K){return j.enter("lineEnding"),j.consume(K),j.exit("lineEnding"),J}function J(K){return j.enter("codeFencedFence"),Pe(K)?nt(j,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):W(K)}function W(K){return K===d?(j.enter("codeFencedFenceSequence"),ye(K)):P(K)}function ye(K){return K===d?(ee++,j.consume(K),ye):ee>=c?(j.exit("codeFencedFenceSequence"),Pe(K)?nt(j,ie,"whitespace")(K):ie(K)):P(K)}function ie(K){return K===null||Se(K)?(j.exit("codeFencedFence"),te(K)):P(K)}}}function ij(e,t,i){const a=this;return o;function o(c){return c===null?i(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return a.parser.lazy[a.now().line]?i(c):t(c)}}const th={name:"codeIndented",tokenize:aj},rj={partial:!0,tokenize:sj};function aj(e,t,i){const a=this;return o;function o(m){return e.enter("codeIndented"),nt(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):i(m)}function c(m){return m===null?p(m):Se(m)?e.attempt(rj,c,p)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Se(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function p(m){return e.exit("codeIndented"),t(m)}}function sj(e,t,i){const a=this;return o;function o(c){return a.parser.lazy[a.now().line]?i(c):Se(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):nt(e,u,"linePrefix",5)(c)}function u(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Se(c)?o(c):i(c)}}const oj={name:"codeText",previous:uj,resolve:lj,tokenize:cj};function lj(e){let t=e.length-4,i=3,a,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=i;++a=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,i,a){const o=i||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&oo(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),oo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),oo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(c):e.interrupt(a.parser.constructs.flow,i,t)(c)}}function AT(e,t,i,a,o,u,c,d,p){const m=p||Number.POSITIVE_INFINITY;let g=0;return y;function y(C){return C===60?(e.enter(a),e.enter(o),e.enter(u),e.consume(C),e.exit(u),v):C===null||C===32||C===41||Wh(C)?i(C):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),M(C))}function v(C){return C===62?(e.enter(u),e.consume(C),e.exit(u),e.exit(o),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(d),v(C)):C===null||C===60||Se(C)?i(C):(e.consume(C),C===92?A:x)}function A(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function M(C){return!g&&(C===null||C===41||en(C))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(C)):g999||x===null||x===91||x===93&&!p||x===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?i(x):x===93?(e.exit(u),e.enter(o),e.consume(x),e.exit(o),e.exit(a),t):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Se(x)||d++>999?(e.exit("chunkString"),g(x)):(e.consume(x),p||(p=!Pe(x)),x===92?v:y)}function v(x){return x===91||x===92||x===93?(e.consume(x),d++,y):y(x)}}function CT(e,t,i,a,o,u){let c;return d;function d(v){return v===34||v===39||v===40?(e.enter(a),e.enter(o),e.consume(v),e.exit(o),c=v===40?41:v,p):i(v)}function p(v){return v===c?(e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):(e.enter(u),m(v))}function m(v){return v===c?(e.exit(u),p(c)):v===null?i(v):Se(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),nt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===c||v===null||Se(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:g)}function y(v){return v===c||v===92?(e.consume(v),g):g(v)}}function yo(e,t){let i;return a;function a(o){return Se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,a):Pe(o)?nt(e,a,i?"linePrefix":"lineSuffix")(o):t(o)}}const bj={name:"definition",tokenize:xj},vj={partial:!0,tokenize:wj};function xj(e,t,i){const a=this;let o;return u;function u(x){return e.enter("definition"),c(x)}function c(x){return _T.call(a,e,d,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return o=Qa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),p):i(x)}function p(x){return en(x)?yo(e,m)(x):m(x)}function m(x){return AT(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(vj,y,y)(x)}function y(x){return Pe(x)?nt(e,v,"whitespace")(x):v(x)}function v(x){return x===null||Se(x)?(e.exit("definition"),a.parser.defined.push(o),t(x)):i(x)}}function wj(e,t,i){return a;function a(d){return en(d)?yo(e,o)(d):i(d)}function o(d){return CT(e,u,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return Pe(d)?nt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Se(d)?t(d):i(d)}}const Sj={name:"hardBreakEscape",tokenize:Tj};function Tj(e,t,i){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Se(u)?(e.exit("hardBreakEscape"),t(u)):i(u)}}const Ej={name:"headingAtx",resolve:Aj,tokenize:_j};function Aj(e,t){let i=e.length-2,a=3,o,u;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},u={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},Jn(e,a,i-a+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function _j(e,t,i){let a=0;return o;function o(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&a++<6?(e.consume(g),c):g===null||en(g)?(e.exit("atxHeadingSequence"),d(g)):i(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||Se(g)?(e.exit("atxHeading"),t(g)):Pe(g)?nt(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||en(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const Cj=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Px=["pre","script","style","textarea"],kj={concrete:!0,name:"htmlFlow",resolveTo:Nj,tokenize:Rj},Mj={partial:!0,tokenize:zj},Dj={partial:!0,tokenize:Oj};function Nj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Rj(e,t,i){const a=this;let o,u,c,d,p;return m;function m(E){return g(E)}function g(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),y}function y(E){return E===33?(e.consume(E),v):E===47?(e.consume(E),u=!0,M):E===63?(e.consume(E),o=3,a.interrupt?t:T):Kn(E)?(e.consume(E),c=String.fromCharCode(E),R):i(E)}function v(E){return E===45?(e.consume(E),o=2,x):E===91?(e.consume(E),o=5,d=0,A):Kn(E)?(e.consume(E),o=4,a.interrupt?t:T):i(E)}function x(E){return E===45?(e.consume(E),a.interrupt?t:T):i(E)}function A(E){const le="CDATA[";return E===le.charCodeAt(d++)?(e.consume(E),d===le.length?a.interrupt?t:W:A):i(E)}function M(E){return Kn(E)?(e.consume(E),c=String.fromCharCode(E),R):i(E)}function R(E){if(E===null||E===47||E===62||en(E)){const le=E===47,fe=c.toLowerCase();return!le&&!u&&Px.includes(fe)?(o=1,a.interrupt?t(E):W(E)):Cj.includes(c.toLowerCase())?(o=6,le?(e.consume(E),C):a.interrupt?t(E):W(E)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(E):u?B(E):D(E))}return E===45||dn(E)?(e.consume(E),c+=String.fromCharCode(E),R):i(E)}function C(E){return E===62?(e.consume(E),a.interrupt?t:W):i(E)}function B(E){return Pe(E)?(e.consume(E),B):ne(E)}function D(E){return E===47?(e.consume(E),ne):E===58||E===95||Kn(E)?(e.consume(E),H):Pe(E)?(e.consume(E),D):ne(E)}function H(E){return E===45||E===46||E===58||E===95||dn(E)?(e.consume(E),H):X(E)}function X(E){return E===61?(e.consume(E),j):Pe(E)?(e.consume(E),X):D(E)}function j(E){return E===null||E===60||E===61||E===62||E===96?i(E):E===34||E===39?(e.consume(E),p=E,te):Pe(E)?(e.consume(E),j):P(E)}function te(E){return E===p?(e.consume(E),p=null,ee):E===null||Se(E)?i(E):(e.consume(E),te)}function P(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||en(E)?X(E):(e.consume(E),P)}function ee(E){return E===47||E===62||Pe(E)?D(E):i(E)}function ne(E){return E===62?(e.consume(E),J):i(E)}function J(E){return E===null||Se(E)?W(E):Pe(E)?(e.consume(E),J):i(E)}function W(E){return E===45&&o===2?(e.consume(E),O):E===60&&o===1?(e.consume(E),Z):E===62&&o===4?(e.consume(E),k):E===63&&o===3?(e.consume(E),T):E===93&&o===5?(e.consume(E),ce):Se(E)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Mj,q,ye)(E)):E===null||Se(E)?(e.exit("htmlFlowData"),ye(E)):(e.consume(E),W)}function ye(E){return e.check(Dj,ie,q)(E)}function ie(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),K}function K(E){return E===null||Se(E)?ye(E):(e.enter("htmlFlowData"),W(E))}function O(E){return E===45?(e.consume(E),T):W(E)}function Z(E){return E===47?(e.consume(E),c="",ae):W(E)}function ae(E){if(E===62){const le=c.toLowerCase();return Px.includes(le)?(e.consume(E),k):W(E)}return Kn(E)&&c.length<8?(e.consume(E),c+=String.fromCharCode(E),ae):W(E)}function ce(E){return E===93?(e.consume(E),T):W(E)}function T(E){return E===62?(e.consume(E),k):E===45&&o===2?(e.consume(E),T):W(E)}function k(E){return E===null||Se(E)?(e.exit("htmlFlowData"),q(E)):(e.consume(E),k)}function q(E){return e.exit("htmlFlow"),t(E)}}function Oj(e,t,i){const a=this;return o;function o(c){return Se(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):i(c)}function u(c){return a.parser.lazy[a.now().line]?i(c):t(c)}}function zj(e,t,i){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ic,t,i)}}const jj={name:"htmlText",tokenize:Lj};function Lj(e,t,i){const a=this;let o,u,c;return d;function d(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),p}function p(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),X):T===63?(e.consume(T),D):Kn(T)?(e.consume(T),P):i(T)}function m(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),u=0,A):Kn(T)?(e.consume(T),B):i(T)}function g(T){return T===45?(e.consume(T),x):i(T)}function y(T){return T===null?i(T):T===45?(e.consume(T),v):Se(T)?(c=y,Z(T)):(e.consume(T),y)}function v(T){return T===45?(e.consume(T),x):y(T)}function x(T){return T===62?O(T):T===45?v(T):y(T)}function A(T){const k="CDATA[";return T===k.charCodeAt(u++)?(e.consume(T),u===k.length?M:A):i(T)}function M(T){return T===null?i(T):T===93?(e.consume(T),R):Se(T)?(c=M,Z(T)):(e.consume(T),M)}function R(T){return T===93?(e.consume(T),C):M(T)}function C(T){return T===62?O(T):T===93?(e.consume(T),C):M(T)}function B(T){return T===null||T===62?O(T):Se(T)?(c=B,Z(T)):(e.consume(T),B)}function D(T){return T===null?i(T):T===63?(e.consume(T),H):Se(T)?(c=D,Z(T)):(e.consume(T),D)}function H(T){return T===62?O(T):D(T)}function X(T){return Kn(T)?(e.consume(T),j):i(T)}function j(T){return T===45||dn(T)?(e.consume(T),j):te(T)}function te(T){return Se(T)?(c=te,Z(T)):Pe(T)?(e.consume(T),te):O(T)}function P(T){return T===45||dn(T)?(e.consume(T),P):T===47||T===62||en(T)?ee(T):i(T)}function ee(T){return T===47?(e.consume(T),O):T===58||T===95||Kn(T)?(e.consume(T),ne):Se(T)?(c=ee,Z(T)):Pe(T)?(e.consume(T),ee):O(T)}function ne(T){return T===45||T===46||T===58||T===95||dn(T)?(e.consume(T),ne):J(T)}function J(T){return T===61?(e.consume(T),W):Se(T)?(c=J,Z(T)):Pe(T)?(e.consume(T),J):ee(T)}function W(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),o=T,ye):Se(T)?(c=W,Z(T)):Pe(T)?(e.consume(T),W):(e.consume(T),ie)}function ye(T){return T===o?(e.consume(T),o=void 0,K):T===null?i(T):Se(T)?(c=ye,Z(T)):(e.consume(T),ye)}function ie(T){return T===null||T===34||T===39||T===60||T===61||T===96?i(T):T===47||T===62||en(T)?ee(T):(e.consume(T),ie)}function K(T){return T===47||T===62||en(T)?ee(T):i(T)}function O(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):i(T)}function Z(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ae}function ae(T){return Pe(T)?nt(e,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ce(T)}function ce(T){return e.enter("htmlTextData"),c(T)}}const rp={name:"labelEnd",resolveAll:Pj,resolveTo:Vj,tokenize:Hj},Ij={tokenize:qj},Uj={tokenize:Fj},Bj={tokenize:Gj};function Pj(e){let t=-1;const i=[];for(;++t=3&&(m===null||Se(m))?(e.exit("thematicBreak"),t(m)):i(m)}function p(m){return m===o?(e.consume(m),a++,p):(e.exit("thematicBreakSequence"),Pe(m)?nt(e,d,"whitespace")(m):d(m))}}const Jt={continuation:{tokenize:tL},exit:iL,name:"list",tokenize:eL},$j={partial:!0,tokenize:rL},Jj={partial:!0,tokenize:nL};function eL(e,t,i){const a=this,o=a.events[a.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return d;function d(x){const A=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Zh(x)){if(a.containerState.type||(a.containerState.type=A,e.enter(A,{_container:!0})),A==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Cu,i,m)(x):m(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(x)}return i(x)}function p(x){return Zh(x)&&++c<10?(e.consume(x),p):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):i(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(ic,a.interrupt?i:g,e.attempt($j,v,y))}function g(x){return a.containerState.initialBlankLine=!0,u++,v(x)}function y(x){return Pe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):i(x)}function v(x){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function tL(e,t,i){const a=this;return a.containerState._closeFlow=void 0,e.check(ic,o,u);function o(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,nt(e,t,"listItemIndent",a.containerState.size+1)(d)}function u(d){return a.containerState.furtherBlankLines||!Pe(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Jj,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,nt(e,e.attempt(Jt,t,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function nL(e,t,i){const a=this;return nt(e,o,"listItemIndent",a.containerState.size+1);function o(u){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(u):i(u)}}function iL(e){e.exit(this.containerState.type)}function rL(e,t,i){const a=this;return nt(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=a.events[a.events.length-1];return!Pe(u)&&c&&c[1].type==="listItemPrefixWhitespace"?t(u):i(u)}}const Vx={name:"setextUnderline",resolveTo:aL,tokenize:sL};function aL(e,t){let i=e.length,a,o,u;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(o=i)}else e[i][1].type==="content"&&e.splice(i,1),!u&&e[i][1].type==="definition"&&(u=i);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",c,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function sL(e,t,i){const a=this;let o;return u;function u(m){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),o=m,c(m)):i(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===o?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Pe(m)?nt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Se(m)?(e.exit("setextHeadingLine"),t(m)):i(m)}}const oL={tokenize:lL};function lL(e){const t=this,i=e.attempt(ic,a,e.attempt(this.parser.constructs.flowInitial,o,nt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(hj,o)),"linePrefix")));return i;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,i}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,i}}const uL={resolveAll:MT()},cL=kT("string"),fL=kT("text");function kT(e){return{resolveAll:MT(e==="text"?dL:void 0),tokenize:t};function t(i){const a=this,o=this.parser.constructs[e],u=i.attempt(o,c,d);return c;function c(g){return m(g)?u(g):d(g)}function d(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),p}function p(g){return m(g)?(i.exit("data"),u(g)):(i.consume(g),p)}function m(g){if(g===null)return!0;const y=o[g];let v=-1;if(y)for(;++v-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}u>0&&c.push(e[o].slice(0,u))}return c}function AL(e,t){let i=-1;const a=[];let o;for(;++i0){const nn=we.tokenStack[we.tokenStack.length-1];(nn[1]||qx).call(we,void 0,nn[0])}for(oe.position={start:nr(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:nr(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve0&&(a.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:i}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function BL(e,t){const i={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function PL(e,t){const i={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function VL(e,t){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=os(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=u+1,d+=1,e.footnoteCounts.set(a,d);const p={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function HL(e,t){const i={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function qL(e,t){if(e.options.allowDangerousHtml){const i={type:"raw",value:t.value};return e.patch(t,i),e.applyData(t,i)}}function RT(e,t){const i=t.referenceType;let a="]";if(i==="collapsed"?a+="[]":i==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=a:o.push({type:"text",value:a}),o}function FL(e,t){const i=String(t.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return RT(e,t);const o={src:os(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function GL(e,t){const i={src:os(t.url)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),t.title!==null&&t.title!==void 0&&(i.title=t.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function YL(e,t){const i={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,i);const a={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(t,a),e.applyData(t,a)}function XL(e,t){const i=String(t.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return RT(e,t);const o={href:os(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function KL(e,t){const i={href:os(t.url)};t.title!==null&&t.title!==void 0&&(i.title=t.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function QL(e,t,i){const a=e.all(t),o=i?WL(i):OT(t),u={},c=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d1}function ZL(e,t){const i={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(i.start=t.start);++o0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},d=$m(t.children[1]),p=hT(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,u),e.applyData(t,u)}function nI(e,t,i){const a=i?i.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,d=c?c.length:t.children.length;let p=-1;const m=[];for(;++p0,!0),a[0]),o=a.index+a[0].length,a=i.exec(t);return u.push(Yx(t.slice(o),o>0,!1)),u.join("")}function Yx(e,t,i){let a=0,o=e.length;if(t){let u=e.codePointAt(a);for(;u===Fx||u===Gx;)a++,u=e.codePointAt(a)}if(i){let u=e.codePointAt(o-1);for(;u===Fx||u===Gx;)o--,u=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function aI(e,t){const i={type:"text",value:rI(String(t.value))};return e.patch(t,i),e.applyData(t,i)}function sI(e,t){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,i),e.applyData(t,i)}const oI={blockquote:LL,break:IL,code:UL,delete:BL,emphasis:PL,footnoteReference:VL,heading:HL,html:qL,imageReference:FL,image:GL,inlineCode:YL,linkReference:XL,link:KL,listItem:QL,list:ZL,paragraph:$L,root:JL,strong:eI,table:tI,tableCell:iI,tableRow:nI,text:aI,thematicBreak:sI,toml:fu,yaml:fu,definition:fu,footnoteDefinition:fu};function fu(){}const zT=-1,rc=0,bo=1,Yu=2,ap=3,sp=4,op=5,lp=6,jT=7,LT=8,Xx=typeof self=="object"?self:globalThis,lI=(e,t)=>{const i=(o,u)=>(e.set(u,o),o),a=o=>{if(e.has(o))return e.get(o);const[u,c]=t[o];switch(u){case rc:case zT:return i(c,o);case bo:{const d=i([],o);for(const p of c)d.push(a(p));return d}case Yu:{const d=i({},o);for(const[p,m]of c)d[a(p)]=a(m);return d}case ap:return i(new Date(c),o);case sp:{const{source:d,flags:p}=c;return i(new RegExp(d,p),o)}case op:{const d=i(new Map,o);for(const[p,m]of c)d.set(a(p),a(m));return d}case lp:{const d=i(new Set,o);for(const p of c)d.add(a(p));return d}case jT:{const{name:d,message:p}=c;return i(new Xx[d](p),o)}case LT:return i(BigInt(c),o);case"BigInt":return i(Object(BigInt(c)),o);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return i(new DataView(d),c)}}return i(new Xx[u](c),o)};return a},Kx=e=>lI(new Map,e)(0),Ba="",{toString:uI}={},{keys:cI}=Object,lo=e=>{const t=typeof e;if(t!=="object"||!e)return[rc,t];const i=uI.call(e).slice(8,-1);switch(i){case"Array":return[bo,Ba];case"Object":return[Yu,Ba];case"Date":return[ap,Ba];case"RegExp":return[sp,Ba];case"Map":return[op,Ba];case"Set":return[lp,Ba];case"DataView":return[bo,i]}return i.includes("Array")?[bo,i]:i.includes("Error")?[jT,i]:[Yu,i]},du=([e,t])=>e===rc&&(t==="function"||t==="symbol"),fI=(e,t,i,a)=>{const o=(c,d)=>{const p=a.push(c)-1;return i.set(d,p),p},u=c=>{if(i.has(c))return i.get(c);let[d,p]=lo(c);switch(d){case rc:{let g=c;switch(p){case"bigint":d=LT,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return o([zT],c)}return o([d,g],c)}case bo:{if(p){let v=c;return p==="DataView"?v=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(c)),o([p,[...v]],c)}const g=[],y=o([d,g],c);for(const v of c)g.push(u(v));return y}case Yu:{if(p)switch(p){case"BigInt":return o([p,c.toString()],c);case"Boolean":case"Number":case"String":return o([p,c.valueOf()],c)}if(t&&"toJSON"in c)return u(c.toJSON());const g=[],y=o([d,g],c);for(const v of cI(c))(e||!du(lo(c[v])))&&g.push([u(v),u(c[v])]);return y}case ap:return o([d,c.toISOString()],c);case sp:{const{source:g,flags:y}=c;return o([d,{source:g,flags:y}],c)}case op:{const g=[],y=o([d,g],c);for(const[v,x]of c)(e||!(du(lo(v))||du(lo(x))))&&g.push([u(v),u(x)]);return y}case lp:{const g=[],y=o([d,g],c);for(const v of c)(e||!du(lo(v)))&&g.push(u(v));return y}}const{message:m}=c;return o([d,{name:p,message:m}],c)};return u},Qx=(e,{json:t,lossy:i}={})=>{const a=[];return fI(!(t||i),!!t,new Map,a)(e),a},Xu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kx(Qx(e,t)):structuredClone(e):(e,t)=>Kx(Qx(e,t));function dI(e,t){const i=[{type:"text",value:"↩"}];return t>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),i}function hI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||dI,a=e.options.footnoteBackLabel||hI,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p0&&A.push({type:"text",value:" "});let B=typeof i=="string"?i:i(p,x);typeof B=="string"&&(B={type:"text",value:B}),A.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(p,x),className:["data-footnote-backref"]},children:Array.isArray(B)?B:[B]})}const R=g[g.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const B=R.children[R.children.length-1];B&&B.type==="text"?B.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(...A)}else g.push(...A);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Xu(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:` `}]}}const IT=(function(e){if(e==null)return bI;if(typeof e=="function")return ac(e);if(typeof e=="object")return Array.isArray(e)?pI(e):gI(e);if(typeof e=="string")return yI(e);throw new Error("Expected function, string, or object as test")});function pI(e){const t=[];let i=-1;for(;++i":""))+")"})}return v;function v(){let x=UT,A,M,R;if((!t||u(p,m,g[g.length-1]||void 0))&&(x=TI(i(p,g)),x[0]===Wx))return x;if("children"in p&&p.children){const C=p;if(C.children&&x[0]!==wI)for(M=(a?C.children.length:-1)+c,R=g.concat(C);M>-1&&M0&&i.push({type:"text",value:` `}),i}function Zx(e){let t=0,i=e.charCodeAt(t);for(;i===9||i===32;)t++,i=e.charCodeAt(t);return e.slice(t)}function $x(e,t){const i=AI(e,t),a=i.one(e,void 0),o=mI(i),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:` `},o),u}function DI(e,t){return e&&"run"in e?async function(i,a){const o=$x(i,{file:a,...t});await e.run(o,a)}:function(i,a){return $x(i,{file:a,...e||t})}}function Jx(e){if(e)throw e}var ih,e1;function NI(){if(e1)return ih;e1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},c=function(m,g){i&&g.name==="__proto__"?i(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return ih=function p(){var m,g,y,v,x,A,M=arguments[0],R=1,C=arguments.length,B=!1;for(typeof M=="boolean"&&(B=M,M=arguments[1]||{},R=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});Rc.length;let p;d&&c.push(o);try{p=e.apply(this,c)}catch(m){const g=m;if(d&&i)throw g;return o(g)}d||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(c,...d){i||(i=!0,t(c,...d))}function u(c){o(null,c)}}const Gn={basename:jI,dirname:LI,extname:II,join:UI,sep:"/"};function jI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bo(e);let i=0,a=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){i=o+1;break}}else a<0&&(u=!0,a=o+1);return a<0?"":e.slice(i,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){i=o+1;break}}else c<0&&(u=!0,c=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(a=o):(d=-1,a=c));return i===a?a=c:a<0&&(a=e.length),e.slice(i,a)}function LI(e){if(Bo(e),e.length===0)return".";let t=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){t=i;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function II(e){Bo(e);let t=e.length,i=-1,a=0,o=-1,u=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}i<0&&(c=!0,i=t+1),d===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||i<0||u===0||u===1&&o===i-1&&o===a+1?"":e.slice(o,i)}function UI(...e){let t=-1,i;for(;++t0&&e.codePointAt(e.length-1)===47&&(i+="/"),t?"/"+i:i}function PI(e,t){let i="",a=0,o=-1,u=0,c=-1,d,p;for(;++c<=e.length;){if(c2){if(p=i.lastIndexOf("/"),p!==i.length-1){p<0?(i="",a=0):(i=i.slice(0,p),a=i.length-1-i.lastIndexOf("/")),o=c,u=0;continue}}else if(i.length>0){i="",a=0,o=c,u=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,c):i=e.slice(o+1,c),a=c-o-1;o=c,u=0}else d===46&&u>-1?u++:u=-1}return i}function Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VI={cwd:HI};function HI(){return"/"}function tm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qI(e){if(typeof e=="string")e=new URL(e);else if(!tm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return FI(e)}function FI(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let i=-1;for(;++i0){let[x,...A]=g;const M=a[v][1];em(M)&&em(x)&&(x=rh(!0,M,x)),a[v]=[m,x,...A]}}}}const KI=new up().freeze();function lh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ch(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n1(e){if(!em(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function i1(e,t,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hu(e){return QI(e)?e:new PT(e)}function QI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function WI(e){return typeof e=="string"||ZI(e)}function ZI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $I="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",r1=[],a1={allowDangerousHtml:!0},JI=/^(https?|ircs?|mailto|xmpp)$/i,e6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function t6(e){const t=n6(e),i=i6(e);return r6(t.runSync(t.parse(i),i),e)}function n6(e){const t=e.rehypePlugins||r1,i=e.remarkPlugins||r1,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...a1}:a1;return KI().use(jL).use(i).use(DI,a).use(t)}function i6(e){const t=e.children||"",i=new PT;return typeof t=="string"&&(i.value=t),i}function r6(e,t){const i=t.allowedElements,a=t.allowElement,o=t.components,u=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||a6;for(const g of e6)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+$I+g.id,void 0);return BT(e,m),m5(e,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function m(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return c?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let x;for(x in eh)if(Object.hasOwn(eh,x)&&Object.hasOwn(g.properties,x)){const A=g.properties[x],M=eh[x];(M===null||M.includes(g.tagName))&&(g.properties[x]=p(String(A||""),x,g))}}if(g.type==="element"){let x=i?!i.includes(g.tagName):u?u.includes(g.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(g,y,v)),x&&v&&typeof y=="number")return d&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function a6(e){const t=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||i!==-1&&t>i||a!==-1&&t>a||JI.test(e.slice(0,t))?e:""}const s6=/https:\/\/drive\.google\.com\/(?:drive\/u\/\d+\/folders|drive\/folders)\/[^\s)\]}"']+/i,o6=e=>{const t=e.match(s6);return(t==null?void 0:t[0])||null},s1=e=>{const t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,i=Math.floor(t/60),a=t%60;return`${i}:${a.toString().padStart(2,"0")}`},l6=({attachment:e})=>e.type==="image"?S.jsxs("div",{className:"group relative max-w-[320px] overflow-hidden rounded-2xl border border-white/10 bg-black/20",children:[S.jsx("img",{src:e.url,alt:e.file.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-[1.02]"}),S.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 to-transparent px-3 py-2 text-[11px] font-medium text-white/90",children:S.jsx("div",{className:"truncate",children:e.file.name})})]}):e.type==="audio"?S.jsxs("div",{className:"flex w-full max-w-[420px] flex-col gap-3 rounded-2xl border border-white/10 bg-white/5 px-3 py-3",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-black/25",children:S.jsx(HD,{className:"h-4 w-4 text-indigo-200"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"truncate text-sm font-medium text-white/90",children:e.file.name}),S.jsxs("p",{className:"text-[11px] text-zinc-400",children:[(e.file.size/1024).toFixed(1)," KB"]})]})]}),S.jsx("audio",{controls:!0,src:e.url,className:"h-9 w-full rounded-xl"})]}):S.jsxs("div",{className:"flex w-full max-w-[360px] items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-3 py-3",children:[S.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-black/25",children:S.jsx(Ww,{className:"h-4 w-4 text-indigo-200"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"truncate text-sm font-medium text-white/90",children:e.file.name}),S.jsxs("p",{className:"text-[11px] text-zinc-400",children:[(e.file.size/1024).toFixed(1)," KB"]})]})]}),u6=({url:e,onClose:t})=>{const[i,a]=ir.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),a(!0),window.setTimeout(()=>a(!1),1800)}catch(u){console.error("No se pudo copiar el enlace de Drive:",u)}};return S.jsxs($a.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.98},className:"mb-5 overflow-hidden rounded-[28px] border border-indigo-300/25 bg-[linear-gradient(135deg,rgba(99,102,241,0.22),rgba(34,211,238,0.12))] p-4 shadow-[0_22px_60px_rgba(79,70,229,0.22)] sm:p-5",children:[S.jsxs("div",{className:"flex items-start justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-indigo-100/80",children:"Carpeta generada"}),S.jsx("h4",{className:"mt-2 text-lg font-semibold text-white",children:"Enlace de Drive listo"}),S.jsx("p",{className:"mt-1 text-sm leading-6 text-zinc-300",children:"Copia o abre la carpeta con el contenido del brief."})]}),S.jsx("button",{type:"button",onClick:t,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-white/10 text-zinc-200 transition hover:bg-white/20 hover:text-white","aria-label":"Cerrar tarjeta del enlace",children:S.jsx(Lh,{className:"h-4 w-4"})})]}),S.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-2xl border border-white/10 bg-black/25 p-3 sm:flex-row sm:items-center",children:[S.jsx("div",{className:"min-w-0 flex-1 rounded-xl border border-white/10 bg-white/[0.04] px-3 py-2 text-sm text-zinc-200",children:S.jsx("p",{className:"truncate font-mono",children:e})}),S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 rounded-xl bg-white px-4 py-2.5 text-sm font-semibold text-slate-950 transition hover:bg-zinc-200",children:[i?S.jsx(bD,{className:"h-4 w-4"}):S.jsx(CD,{className:"h-4 w-4"}),i?"Copiado":"Copiar"]}),S.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 rounded-xl border border-white/10 bg-white/10 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-white/15",children:[S.jsx(MD,{className:"h-4 w-4"}),"Abrir"]})]})]})]})},c6=({message:e})=>{var R,C;const t=e.sender==="user",[i,a]=ir.useState(!1),[o,u]=ir.useState(0),[c,d]=ir.useState(((R=e.audio)==null?void 0:R.duration)||0),[p,m]=ir.useState(!0),g=ir.useRef(null),y=t?null:o6(e.text),v=Math.max(0,c||((C=e.audio)==null?void 0:C.duration)||0),x=v?Math.min(100,Math.max(0,o/v*100)):0,A=async()=>{if(g.current)try{i?g.current.pause():await g.current.play()}catch(B){console.error("No se pudo reproducir la nota de voz:",B),a(!1)}},M=B=>{const D=Number(B.target.value);u(D),g.current&&(g.current.currentTime=D)};return ir.useEffect(()=>{m(!0)},[e.id,e.text]),ir.useEffect(()=>{var B;if(a(!1),u(0),d(((B=e.audio)==null?void 0:B.duration)||0),e.audio){const D=new Audio(e.audio.url);D.preload="metadata";const H=()=>{u(D.currentTime||0)};D.onloadedmetadata=()=>{var j;const X=Number.isFinite(D.duration)?D.duration:0;d(X||((j=e.audio)==null?void 0:j.duration)||0)},D.ontimeupdate=H,D.onseeking=H,D.onseeked=H,D.onplay=()=>a(!0),D.onpause=()=>{a(!1),H()},D.onended=()=>{a(!1),D.currentTime=0,u(0)},g.current=D}return()=>{g.current&&(g.current.pause(),g.current.src="",g.current=null)}},[e.audio]),S.jsx($a.div,{initial:{opacity:0,y:14,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.32,ease:[.23,1,.32,1]},className:On("mb-5 flex w-full",t?"justify-end":"justify-start"),children:S.jsxs("div",{className:On("flex flex-col gap-1",t?"max-w-3xl items-end":"w-full max-w-none items-start"),children:[!t&&S.jsxs("div",{className:"mb-1 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.2em] text-zinc-400",children:[S.jsx(Om,{className:"h-3.5 w-3.5 text-indigo-300"}),"Respuesta del portal"]}),S.jsxs("div",{className:On("relative overflow-hidden border shadow-[0_16px_40px_rgba(0,0,0,0.25)]",t?"max-w-[85%] rounded-[26px] rounded-br-md border-indigo-400/20 bg-[linear-gradient(135deg,rgba(79,70,229,0.96),rgba(37,99,235,0.92))] px-4 py-4 text-white sm:px-5":"w-full max-w-none rounded-[28px] rounded-bl-md border-white/10 bg-[linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.03))] px-5 py-5 text-zinc-100 backdrop-blur-xl sm:px-6 sm:py-6"),children:[!t&&S.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(129,140,248,0.14),transparent_26%)]"}),S.jsxs("div",{className:"relative",children:[y&&p&&S.jsx(u6,{url:y,onClose:()=>m(!1)}),e.attachments&&e.attachments.length>0&&S.jsx("div",{className:"mb-4 flex flex-wrap gap-3",children:e.attachments.map(B=>S.jsx(l6,{attachment:B},B.id))}),e.audio&&S.jsx("div",{className:"mb-4 rounded-2xl bg-black/20 p-3 pr-4",children:S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("button",{type:"button",onClick:A,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-white/15 transition hover:bg-white/25","aria-label":i?"Pausar audio":"Reproducir audio",children:i?S.jsxs("div",{className:"flex h-3.5 w-3.5 gap-1",children:[S.jsx("div",{className:"h-full w-1 rounded-sm bg-white"}),S.jsx("div",{className:"h-full w-1 rounded-sm bg-white"})]}):S.jsx("div",{className:"ml-0.5 h-0 w-0 border-b-[7px] border-l-[10px] border-t-[7px] border-b-transparent border-l-white border-t-transparent"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-xs font-semibold text-white/80",children:i?"Reproduciendo":"Nota de voz"}),S.jsxs("span",{className:"shrink-0 text-xs font-mono opacity-80",children:[s1(o)," / ",s1(v)]})]}),S.jsxs("div",{className:"relative h-5",children:[S.jsx("div",{className:"absolute left-0 right-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-white/15"}),S.jsx("div",{className:"absolute left-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-white/70",style:{width:`${x}%`}}),S.jsx("input",{type:"range",min:"0",max:Math.max(1,v),step:"0.01",value:Math.min(o,v||0),onChange:M,className:"message-audio-range absolute inset-0 w-full cursor-pointer","aria-label":"Adelantar o atrasar la nota de voz"})]})]})]})}),e.text&&S.jsx("div",{className:On("break-words text-[15px] leading-7 sm:text-base",t?"whitespace-pre-wrap":""),children:t?e.text:S.jsx("div",{className:"prose prose-invert max-w-none prose-p:my-3 prose-p:leading-8 prose-headings:mb-3 prose-headings:mt-1 prose-headings:text-white prose-strong:text-white prose-li:my-1 prose-ul:my-3 prose-ol:my-3 prose-pre:overflow-x-auto prose-pre:rounded-2xl prose-pre:border prose-pre:border-white/10 prose-pre:bg-black/35 prose-pre:p-4 prose-pre:text-[13px] prose-code:text-indigo-200",children:S.jsx(t6,{children:e.text})})})]})]}),S.jsxs("div",{className:"mt-1 flex items-center gap-1.5 px-1",children:[S.jsx("span",{className:"text-[11px] font-medium text-zinc-500",children:U4(e.timestamp,"HH:mm")}),t&&S.jsxs("span",{className:"text-zinc-500",children:[e.status==="sending"&&S.jsx(jh,{className:"h-3.5 w-3.5 animate-pulse text-zinc-400"}),e.status==="sent"&&S.jsx(gD,{className:"h-3.5 w-3.5 text-indigo-400"}),e.status==="error"&&S.jsx(jh,{className:"h-3.5 w-3.5 text-red-500"})]})]})]})})},f6=({onLogin:e,isLoading:t,error:i})=>S.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-[#060816] px-4 text-zinc-100",children:[S.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:[S.jsx("div",{className:"absolute left-[-10%] top-[-15%] h-[34rem] w-[34rem] rounded-full bg-indigo-600/18 blur-3xl"}),S.jsx("div",{className:"absolute right-[-8%] top-[8%] h-[30rem] w-[30rem] rounded-full bg-cyan-400/12 blur-3xl"}),S.jsx("div",{className:"absolute bottom-[-18%] left-[20%] h-[28rem] w-[28rem] rounded-full bg-fuchsia-500/10 blur-3xl"}),S.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:42px_42px] opacity-[0.06]"})]}),S.jsxs($a.div,{initial:{opacity:0,y:18,scale:.98},animate:{opacity:1,y:0,scale:1},className:"relative w-full max-w-xl rounded-[32px] border border-white/10 bg-white/5 p-8 shadow-[0_30px_80px_rgba(0,0,0,0.35)] backdrop-blur-xl",children:[S.jsxs("div",{className:"mb-4 inline-flex items-center gap-2 rounded-full border border-indigo-400/25 bg-indigo-500/10 px-3 py-1 text-xs font-semibold uppercase tracking-[0.22em] text-indigo-200",children:[S.jsx(zm,{className:"h-3.5 w-3.5"}),"Acceso corporativo"]}),S.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl",children:"Portal Brief CDC"}),S.jsx("p",{className:"mt-4 text-sm leading-7 text-zinc-300 sm:text-base",children:"Inicia sesión con tu cuenta corporativa de Google para acceder al portal."}),S.jsx("div",{className:"mt-6 rounded-2xl border border-white/10 bg-black/20 p-4",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(Om,{className:"mt-0.5 h-5 w-5 text-indigo-300"}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-semibold text-white",children:"Acceso restringido"}),S.jsx("p",{className:"mt-1 text-sm leading-6 text-zinc-400",children:"Solo usuarios autorizados de la empresa podrán continuar."})]})]})}),i&&S.jsx("div",{className:"mt-4 rounded-2xl border border-red-500/20 bg-red-500/10 px-4 py-3 text-sm text-red-200",children:i}),S.jsxs("button",{onClick:e,disabled:t,className:"mt-6 inline-flex w-full items-center justify-center gap-3 rounded-2xl bg-[linear-gradient(135deg,#6366f1_0%,#2563eb_50%,#06b6d4_100%)] px-5 py-4 text-sm font-semibold text-white shadow-[0_18px_40px_rgba(79,70,229,0.38)] transition hover:opacity-95 disabled:cursor-not-allowed disabled:opacity-60",children:[S.jsx(SD,{className:"h-4 w-4"}),t?"Abriendo Google...":"Continuar con Google"]})]})]});var d6="firebase",h6="12.12.1";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Fa(d6,h6,"app");const m6={apiKey:"AIzaSyDIQq_OLUEhmo9ncXiLsKycF0MYOhuYb6o",authDomain:"dokploytest.firebaseapp.com",projectId:"dokploytest",storageBucket:"dokploytest.firebasestorage.app",messagingSenderId:"1094920091343",appId:"1:1094920091343:web:4bf41964204e4b5901a9ba"},p6=lS(m6),mu=B3(p6),VT=new xi;VT.setCustomParameters({prompt:"select_account"});const o1="http://localhost:5678/webhook-test/cdc-brief-test-metadata";function g6(){const[e,t]=$.useState([]),[i,a]=$.useState(!1),[o,u]=$.useState(!0),[c,d]=$.useState(null),[p,m]=$.useState(!0),[g,y]=$.useState(!1),[v,x]=$.useState(""),A=$.useRef(null),M=()=>{var D;(D=A.current)==null||D.scrollIntoView({behavior:"smooth",block:"end"})};$.useEffect(()=>{M()},[e,i]),$.useEffect(()=>{const D=kO(mu,H=>{d(H),m(!1)});return()=>D()},[]);const R=async()=>{try{y(!0),x("");const D=await KO(mu,VT);if(!(D.user.email||"").toLowerCase().endsWith("@gomezleemarketing.com".toLowerCase())){await Jv(mu),x("Solo se permite acceso con cuentas corporativas de la empresa.");return}d(D.user)}catch(D){console.error("Google login error:",D),x("No se pudo iniciar sesión con Google.")}finally{y(!1)}},C=async()=>{await Jv(mu),d(null)},B=async(D,H,X)=>{var P;const j=Math.random().toString(36).substring(7),te={id:j,sender:"user",text:D,attachments:H,audio:X,timestamp:new Date,status:"sending"};t(ee=>[...ee,te]),a(!0);try{const ee=new Date().toISOString(),ne=(c==null?void 0:c.displayName)||((P=c==null?void 0:c.email)==null?void 0:P.split("@")[0])||"No especificado",J=(c==null?void 0:c.email)||"No especificado",W=new FormData;W.append("text",D),W.append("timestamp",ee),W.append("submittedAt",ee),W.append("submittedByName",ne),W.append("submittedByEmail",J),W.append("submittedByUid",(c==null?void 0:c.uid)||""),W.append("submittedByPhotoUrl",(c==null?void 0:c.photoURL)||"");let ye=0,ie=0;H.forEach(ce=>{if(ce.category==="campaign"){W.append(`campaign_file_${ie}`,ce.file),W.append(`campaign_file_${ie}_name`,ce.file.name),ie+=1;return}W.append(`file_${ye}`,ce.file),W.append(`file_${ye}_name`,ce.file.name),ye+=1}),W.append("generalFilesCount",String(ye)),W.append("campaignFilesCount",String(ie)),X&&W.append("audio",X.blob,"voice_note.webm");const K=await fetch(o1,{method:"POST",body:W});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);let O;const Z=K.headers.get("content-type");Z&&Z.includes("application/json")?O=await K.json():O=await K.text(),t(ce=>ce.map(T=>T.id===j?{...T,status:"sent"}:T));const ae={id:Math.random().toString(36).substring(7),sender:"system",text:typeof O=="object"?JSON.stringify(O,null,2):O||"Solicitud recibida correctamente.",timestamp:new Date,status:"sent"};t(ce=>[...ce,ae]),u(!0)}catch(ee){console.error("Webhook error:",ee),u(!1),t(J=>J.map(W=>W.id===j?{...W,status:"error"}:W));const ne={id:Math.random().toString(36).substring(7),sender:"system",text:`**Error de conexión:** No se pudo conectar con el webhook configurado. Verifica que la URL esté correcta en el entorno y que el endpoint esté activo y acepte solicitudes POST con FormData.`,timestamp:new Date,status:"error"};t(J=>[...J,ne])}finally{a(!1)}};return p?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#060816] text-zinc-200",children:"Cargando acceso..."}):c?S.jsxs("div",{className:"relative flex min-h-screen flex-col overflow-x-hidden bg-[#060816] text-zinc-100 font-sans selection:bg-indigo-500/30",children:[S.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:[S.jsx("div",{className:"absolute left-[-10%] top-[-15%] h-[34rem] w-[34rem] rounded-full bg-indigo-600/18 blur-3xl"}),S.jsx("div",{className:"absolute right-[-8%] top-[8%] h-[30rem] w-[30rem] rounded-full bg-cyan-400/12 blur-3xl"}),S.jsx("div",{className:"absolute bottom-[-18%] left-[20%] h-[28rem] w-[28rem] rounded-full bg-fuchsia-500/10 blur-3xl"}),S.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:42px_42px] opacity-[0.06]"})]}),S.jsx(Nz,{isConnected:o,onLogout:C}),S.jsx("main",{className:"relative flex-1",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-6 px-4 py-6 pb-8 sm:px-6 lg:px-8",children:[S.jsx("section",{className:"overflow-hidden rounded-[32px] border border-white/10 bg-white/5 shadow-[0_30px_80px_rgba(0,0,0,0.35)] backdrop-blur-xl",children:S.jsxs("div",{className:"grid gap-0 lg:grid-cols-[1.5fr_1fr]",children:[S.jsxs("div",{className:"relative p-6 sm:p-7 lg:p-8",children:[S.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(99,102,241,0.22),transparent_38%),radial-gradient(circle_at_bottom_right,rgba(34,211,238,0.14),transparent_36%)]"}),S.jsxs("div",{className:"relative",children:[S.jsxs("div",{className:"mb-4 inline-flex items-center gap-2 rounded-full border border-indigo-400/25 bg-indigo-500/10 px-3 py-1 text-xs font-semibold uppercase tracking-[0.22em] text-indigo-200",children:[S.jsx(zm,{className:"h-3.5 w-3.5"})," Portal inteligente de briefs"]}),S.jsx("h2",{className:"max-w-3xl text-3xl font-semibold tracking-tight text-white sm:text-4xl",children:"Carga el brief en un flujo claro, visual y mucho más profesional."}),S.jsx("p",{className:"mt-4 max-w-2xl text-sm leading-7 text-zinc-300 sm:text-base",children:"La interfaz guía al usuario paso por paso, reduce errores de carga y organiza audio, imágenes, archivos, piezas gráficas y referencias para construir un brief listo para revisión interna."}),S.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:[{icon:Om,label:"Validaciones obligatorias"},{icon:iN,label:"Proceso guiado por pasos"},{icon:Ww,label:"Entrega estructurada al flujo"}].map(({icon:D,label:H})=>S.jsxs("div",{className:"inline-flex items-center gap-2 rounded-2xl border border-white/10 bg-black/20 px-4 py-3 text-sm text-zinc-200",children:[S.jsx(D,{className:"h-4 w-4 text-indigo-300"}),S.jsx("span",{children:H})]},H))})]})]}),S.jsx("div",{className:"border-t border-white/10 bg-black/20 p-6 sm:p-7 lg:border-l lg:border-t-0 lg:p-8",children:S.jsxs("div",{className:"rounded-[28px] border border-white/10 bg-black/25 p-5",children:[S.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-zinc-500",children:"Resumen del sistema"}),S.jsx("div",{className:"mt-4 space-y-4",children:["La nota de voz, las imágenes y los PDFs sí se analizan automáticamente.","Word, Excel, PowerPoint y otros adjuntos se guardan en la carpeta del proyecto.","Los enlaces online se registran para alimentar el brief final.","El usuario no necesita usar el portal como chat libre: todo queda guiado."].map(D=>S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx("div",{className:"mt-1 h-2.5 w-2.5 rounded-full bg-indigo-400 shadow-[0_0_18px_rgba(129,140,248,0.7)]"}),S.jsx("p",{className:"text-sm leading-6 text-zinc-300",children:D})]},D))})]})})]})}),S.jsxs("section",{className:"rounded-[30px] border border-white/10 bg-black/20 p-4 shadow-[0_24px_60px_rgba(0,0,0,0.28)] backdrop-blur-xl sm:p-5",children:[S.jsx("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:S.jsxs("div",{children:[S.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-zinc-500",children:"Carga guiada"}),S.jsx("h3",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:"Completa el brief y envía la solicitud"})]})}),S.jsx(Rz,{onSendMessage:B,isProcessing:i})]}),S.jsxs("section",{className:"rounded-[30px] border border-white/10 bg-black/20 p-4 shadow-[0_24px_60px_rgba(0,0,0,0.28)] backdrop-blur-xl sm:p-5",children:[S.jsx("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:S.jsxs("div",{children:[S.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-zinc-500",children:"Respuesta del portal"}),S.jsx("h3",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:"Resultado de la solicitud"})]})}),S.jsxs("div",{className:"min-h-[220px] rounded-[24px] border border-white/10 bg-white/[0.03] p-4 sm:p-5 lg:p-6",children:[e.length===0&&!i&&S.jsx("div",{className:"flex min-h-[150px] items-center justify-center rounded-[22px] border border-dashed border-white/10 bg-black/10 px-5 text-center text-sm leading-6 text-zinc-500",children:"Cuando envíes la solicitud, aquí aparecerá la respuesta del flujo y el enlace de Drive."}),S.jsx(Lw,{initial:!1,children:e.map(D=>S.jsx(c6,{message:D},D.id))}),i&&S.jsxs($a.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.9},className:"mb-4 flex w-fit items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3",children:[S.jsx(Zw,{className:"h-4 w-4 animate-spin text-indigo-400"}),S.jsx("span",{className:"text-sm font-medium text-zinc-300",children:"Procesando la solicitud..."})]}),S.jsx("div",{ref:A,className:"h-2"})]})]})]})})]}):S.jsx(f6,{onLogin:R,isLoading:g,error:v})}f_.createRoot(document.getElementById("root")).render(S.jsx($.StrictMode,{children:S.jsx(g6,{})}));