@avatarfactory/react 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,101 @@
1
+ (function(){'use strict';var KT=Object.create;var ap=Object.defineProperty;var ZT=Object.getOwnPropertyDescriptor;var JT=Object.getOwnPropertyNames;var $T=Object.getPrototypeOf,eC=Object.prototype.hasOwnProperty;var e0=(t,e)=>()=>(t&&(e=t(t=0)),e);var pi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),t0=(t,e)=>{for(var n in e)ap(t,n,{get:e[n],enumerable:true});},tC=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of JT(e))!eC.call(t,r)&&r!==n&&ap(t,r,{get:()=>e[r],enumerable:!(i=ZT(e,r))||i.enumerable});return t};var ue=(t,e,n)=>(n=t!=null?KT($T(t)):{},tC(!t||!t.__esModule?ap(n,"default",{value:t,enumerable:true}):n,t));var f0=pi(Qt=>{function up(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<_c(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Wi(t){return t.length===0?null:t[0]}function wc(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,a=r>>>1;i<a;){var s=2*(i+1)-1,u=t[s],d=s+1,g=t[d];if(0>_c(u,n))d<r&&0>_c(g,u)?(t[i]=g,t[d]=n,i=d):(t[i]=u,t[s]=n,i=s);else if(d<r&&0>_c(g,n))t[i]=g,t[d]=n,i=d;else break e}}return e}function _c(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Qt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(n0=performance,Qt.unstable_now=function(){return n0.now()}):(op=Date,i0=op.now(),Qt.unstable_now=function(){return op.now()-i0});var n0,op,i0,hr=[],Xr=[],nC=1,mi=null,In=3,cp=false,sl=false,ll=false,fp=false,o0=typeof setTimeout=="function"?setTimeout:null,s0=typeof clearTimeout=="function"?clearTimeout:null,r0=typeof setImmediate<"u"?setImmediate:null;function Sc(t){for(var e=Wi(Xr);e!==null;){if(e.callback===null)wc(Xr);else if(e.startTime<=t)wc(Xr),e.sortIndex=e.expirationTime,up(hr,e);else break;e=Wi(Xr);}}function dp(t){if(ll=false,Sc(t),!sl)if(Wi(hr)!==null)sl=true,Fo||(Fo=true,Uo());else {var e=Wi(Xr);e!==null&&hp(dp,e.startTime-t);}}var Fo=false,ul=-1,l0=5,u0=-1;function c0(){return fp?true:!(Qt.unstable_now()-u0<l0)}function sp(){if(fp=false,Fo){var t=Qt.unstable_now();u0=t;var e=true;try{e:{sl=!1,ll&&(ll=!1,s0(ul),ul=-1),cp=!0;var n=In;try{t:{for(Sc(t),mi=Wi(hr);mi!==null&&!(mi.expirationTime>t&&c0());){var i=mi.callback;if(typeof i=="function"){mi.callback=null,In=mi.priorityLevel;var r=i(mi.expirationTime<=t);if(t=Qt.unstable_now(),typeof r=="function"){mi.callback=r,Sc(t),e=!0;break t}mi===Wi(hr)&&wc(hr),Sc(t);}else wc(hr);mi=Wi(hr);}if(mi!==null)e=!0;else {var a=Wi(Xr);a!==null&&hp(dp,a.startTime-t),e=!1;}}break e}finally{mi=null,In=n,cp=!1;}e=void 0;}}finally{e?Uo():Fo=false;}}}var Uo;typeof r0=="function"?Uo=function(){r0(sp);}:typeof MessageChannel<"u"?(lp=new MessageChannel,a0=lp.port2,lp.port1.onmessage=sp,Uo=function(){a0.postMessage(null);}):Uo=function(){o0(sp,0);};var lp,a0;function hp(t,e){ul=o0(function(){t(Qt.unstable_now());},e);}Qt.unstable_IdlePriority=5;Qt.unstable_ImmediatePriority=1;Qt.unstable_LowPriority=4;Qt.unstable_NormalPriority=3;Qt.unstable_Profiling=null;Qt.unstable_UserBlockingPriority=2;Qt.unstable_cancelCallback=function(t){t.callback=null;};Qt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):l0=0<t?Math.floor(1e3/t):5;};Qt.unstable_getCurrentPriorityLevel=function(){return In};Qt.unstable_next=function(t){switch(In){case 1:case 2:case 3:var e=3;break;default:e=In;}var n=In;In=e;try{return t()}finally{In=n;}};Qt.unstable_requestPaint=function(){fp=true;};Qt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3;}var n=In;In=t;try{return e()}finally{In=n;}};Qt.unstable_scheduleCallback=function(t,e,n){var i=Qt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3;}return r=n+r,t={id:nC++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,up(Xr,t),Wi(hr)===null&&t===Wi(Xr)&&(ll?(s0(ul),ul=-1):ll=true,hp(dp,n-i))):(t.sortIndex=r,up(hr,t),sl||cp||(sl=true,Fo||(Fo=true,Uo()))),t};Qt.unstable_shouldYield=c0;Qt.unstable_wrapCallback=function(t){var e=In;return function(){var n=In;In=e;try{return t.apply(this,arguments)}finally{In=n;}}};});var h0=pi((LD,d0)=>{d0.exports=f0();});var E0=pi(We=>{var gp=Symbol.for("react.transitional.element"),iC=Symbol.for("react.portal"),rC=Symbol.for("react.fragment"),aC=Symbol.for("react.strict_mode"),oC=Symbol.for("react.profiler"),sC=Symbol.for("react.consumer"),lC=Symbol.for("react.context"),uC=Symbol.for("react.forward_ref"),cC=Symbol.for("react.suspense"),fC=Symbol.for("react.memo"),A0=Symbol.for("react.lazy"),dC=Symbol.for("react.activity"),p0=Symbol.iterator;function hC(t){return t===null||typeof t!="object"?null:(t=p0&&t[p0]||t["@@iterator"],typeof t=="function"?t:null)}var y0={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b0=Object.assign,_0={};function Ho(t,e,n){this.props=t,this.context=e,this.refs=_0,this.updater=n||y0;}Ho.prototype.isReactComponent={};Ho.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState");};Ho.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate");};function S0(){}S0.prototype=Ho.prototype;function vp(t,e,n){this.props=t,this.context=e,this.refs=_0,this.updater=n||y0;}var Ap=vp.prototype=new S0;Ap.constructor=vp;b0(Ap,Ho.prototype);Ap.isPureReactComponent=true;var m0=Array.isArray;function mp(){}var Ut={H:null,A:null,T:null,S:null},w0=Object.prototype.hasOwnProperty;function yp(t,e,n){var i=n.ref;return {$$typeof:gp,type:t,key:e,ref:i!==void 0?i:null,props:n}}function pC(t,e){return yp(t.type,e,t.props)}function bp(t){return typeof t=="object"&&t!==null&&t.$$typeof===gp}function mC(t){var e={"=":"=0",":":"=2"};return "$"+t.replace(/[=:]/g,function(n){return e[n]})}var g0=/\/+/g;function pp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?mC(""+t.key):e.toString(36)}function gC(t){switch(t.status){case "fulfilled":return t.value;case "rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(mp,mp):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e);},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e);})),t.status){case "fulfilled":return t.value;case "rejected":throw t.reason}}throw t}function Vo(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=false;if(t===null)s=true;else switch(a){case "bigint":case "string":case "number":s=true;break;case "object":switch(t.$$typeof){case gp:case iC:s=true;break;case A0:return s=t._init,Vo(s(t._payload),e,n,i,r)}}if(s)return r=r(t),s=i===""?"."+pp(t,0):i,m0(r)?(n="",s!=null&&(n=s.replace(g0,"$&/")+"/"),Vo(r,e,n,"",function(g){return g})):r!=null&&(bp(r)&&(r=pC(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(g0,"$&/")+"/")+s)),e.push(r)),1;s=0;var u=i===""?".":i+":";if(m0(t))for(var d=0;d<t.length;d++)i=t[d],a=u+pp(i,d),s+=Vo(i,e,n,a,r);else if(d=hC(t),typeof d=="function")for(t=d.call(t),d=0;!(i=t.next()).done;)i=i.value,a=u+pp(i,d++),s+=Vo(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return Vo(gC(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return s}function Ec(t,e,n){if(t==null)return t;var i=[],r=0;return Vo(t,i,"","",function(a){return e.call(n,a,r++)}),i}function vC(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n);},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n);}),t._status===-1&&(t._status=0,t._result=e);}if(t._status===1)return t._result.default;throw t._result}var v0=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},AC={map:Ec,forEach:function(t,e,n){Ec(t,function(){e.apply(this,arguments);},n);},count:function(t){var e=0;return Ec(t,function(){e++;}),e},toArray:function(t){return Ec(t,function(e){return e})||[]},only:function(t){if(!bp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};We.Activity=dC;We.Children=AC;We.Component=Ho;We.Fragment=rC;We.Profiler=oC;We.PureComponent=vp;We.StrictMode=aC;We.Suspense=cC;We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ut;We.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ut.H.useMemoCache(t)}};We.cache=function(t){return function(){return t.apply(null,arguments)}};We.cacheSignal=function(){return null};We.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=b0({},t.props),r=t.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!w0.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];i.children=s;}return yp(t.type,r,i)};We.createContext=function(t){return t={$$typeof:lC,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:sC,_context:t},t};We.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)w0.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var u=Array(s),d=0;d<s;d++)u[d]=arguments[d+2];r.children=u;}if(t&&t.defaultProps)for(i in s=t.defaultProps,s)r[i]===void 0&&(r[i]=s[i]);return yp(t,a,r)};We.createRef=function(){return {current:null}};We.forwardRef=function(t){return {$$typeof:uC,render:t}};We.isValidElement=bp;We.lazy=function(t){return {$$typeof:A0,_payload:{_status:-1,_result:t},_init:vC}};We.memo=function(t,e){return {$$typeof:fC,type:t,compare:e===void 0?null:e}};We.startTransition=function(t){var e=Ut.T,n={};Ut.T=n;try{var i=t(),r=Ut.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(mp,v0);}catch(a){v0(a);}finally{e!==null&&n.types!==null&&(e.types=n.types),Ut.T=e;}};We.unstable_useCacheRefresh=function(){return Ut.H.useCacheRefresh()};We.use=function(t){return Ut.H.use(t)};We.useActionState=function(t,e,n){return Ut.H.useActionState(t,e,n)};We.useCallback=function(t,e){return Ut.H.useCallback(t,e)};We.useContext=function(t){return Ut.H.useContext(t)};We.useDebugValue=function(){};We.useDeferredValue=function(t,e){return Ut.H.useDeferredValue(t,e)};We.useEffect=function(t,e){return Ut.H.useEffect(t,e)};We.useEffectEvent=function(t){return Ut.H.useEffectEvent(t)};We.useId=function(){return Ut.H.useId()};We.useImperativeHandle=function(t,e,n){return Ut.H.useImperativeHandle(t,e,n)};We.useInsertionEffect=function(t,e){return Ut.H.useInsertionEffect(t,e)};We.useLayoutEffect=function(t,e){return Ut.H.useLayoutEffect(t,e)};We.useMemo=function(t,e){return Ut.H.useMemo(t,e)};We.useOptimistic=function(t,e){return Ut.H.useOptimistic(t,e)};We.useReducer=function(t,e,n){return Ut.H.useReducer(t,e,n)};We.useRef=function(t){return Ut.H.useRef(t)};We.useState=function(t){return Ut.H.useState(t)};We.useSyncExternalStore=function(t,e,n){return Ut.H.useSyncExternalStore(t,e,n)};We.useTransition=function(){return Ut.H.useTransition()};We.version="19.2.6";});var Rt=pi((BD,M0)=>{M0.exports=E0();});var C0=pi(Bn=>{var yC=Rt();function T0(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Qr(){}var Dn={d:{f:Qr,r:function(){throw Error(T0(522))},D:Qr,C:Qr,L:Qr,m:Qr,X:Qr,S:Qr,M:Qr},p:0,findDOMNode:null},bC=Symbol.for("react.portal");function _C(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return {$$typeof:bC,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var cl=yC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Mc(t,e){if(t==="font")return "";if(typeof e=="string")return e==="use-credentials"?e:""}Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dn;Bn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(T0(299));return _C(t,e,null,n)};Bn.flushSync=function(t){var e=cl.T,n=Dn.p;try{if(cl.T=null,Dn.p=2,t)return t()}finally{cl.T=e,Dn.p=n,Dn.d.f();}};Bn.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dn.d.C(t,e));};Bn.prefetchDNS=function(t){typeof t=="string"&&Dn.d.D(t);};Bn.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Mc(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Dn.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Dn.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0});}};Bn.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Mc(e.as,e.crossOrigin);Dn.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0});}}else e==null&&Dn.d.M(t);};Bn.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Mc(n,e.crossOrigin);Dn.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0});}};Bn.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Mc(e.as,e.crossOrigin);Dn.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0});}else Dn.d.m(t);};Bn.requestFormReset=function(t){Dn.d.r(t);};Bn.unstable_batchedUpdates=function(t,e){return t(e)};Bn.useFormState=function(t,e,n){return cl.H.useFormState(t,e,n)};Bn.useFormStatus=function(){return cl.H.useHostTransitionStatus()};Bn.version="19.2.6";});var Tc=pi((FD,x0)=>{function R0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(R0);}catch(t){console.error(t);}}R0(),x0.exports=C0();});var HS=pi(Jf=>{var mn=h0(),tb=Rt(),SC=Tc();function Z(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);}return "Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function nb(t){return !(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Kl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else {t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function ib(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function rb(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function k0(t){if(Kl(t)!==t)throw Error(Z(188))}function wC(t){var e=t.alternate;if(!e){if(e=Kl(t),e===null)throw Error(Z(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return k0(r),t;if(a===i)return k0(r),e;a=a.sibling;}throw Error(Z(188))}if(n.return!==i.return)n=r,i=a;else {for(var s=false,u=r.child;u;){if(u===n){s=true,n=r,i=a;break}if(u===i){s=true,i=r,n=a;break}u=u.sibling;}if(!s){for(u=a.child;u;){if(u===n){s=true,n=a,i=r;break}if(u===i){s=true,i=a,n=r;break}u=u.sibling;}if(!s)throw Error(Z(189))}}if(n.alternate!==i)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?t:e}function ab(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=ab(t),e!==null)return e;t=t.sibling;}return null}var Ht=Object.assign,EC=Symbol.for("react.element"),Cc=Symbol.for("react.transitional.element"),Al=Symbol.for("react.portal"),qo=Symbol.for("react.fragment"),ob=Symbol.for("react.strict_mode"),em=Symbol.for("react.profiler"),sb=Symbol.for("react.consumer"),_r=Symbol.for("react.context"),Qm=Symbol.for("react.forward_ref"),tm=Symbol.for("react.suspense"),nm=Symbol.for("react.suspense_list"),Km=Symbol.for("react.memo"),Kr=Symbol.for("react.lazy"),im=Symbol.for("react.activity"),MC=Symbol.for("react.memo_cache_sentinel"),O0=Symbol.iterator;function fl(t){return t===null||typeof t!="object"?null:(t=O0&&t[O0]||t["@@iterator"],typeof t=="function"?t:null)}var TC=Symbol.for("react.client.reference");function rm(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===TC?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case qo:return "Fragment";case em:return "Profiler";case ob:return "StrictMode";case tm:return "Suspense";case nm:return "SuspenseList";case im:return "Activity"}if(typeof t=="object")switch(t.$$typeof){case Al:return "Portal";case _r:return t.displayName||"Context";case sb:return (t._context.displayName||"Context")+".Consumer";case Qm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Km:return e=t.displayName||null,e!==null?e:rm(t.type)||"Memo";case Kr:e=t._payload,t=t._init;try{return rm(t(e))}catch{}}return null}var yl=Array.isArray,Ve=tb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yt=SC.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qa={pending:false,data:null,method:null,action:null},am=[],Xo=-1;function Qi(t){return {current:t}}function Sn(t){0>Xo||(t.current=am[Xo],am[Xo]=null,Xo--);}function Lt(t,e){Xo++,am[Xo]=t.current,t.current=e;}var Xi=Qi(null),Dl=Qi(null),sa=Qi(null),sf=Qi(null);function lf(t,e){switch(Lt(sa,e),Lt(Dl,t),Lt(Xi,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Uy(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Uy(e),t=CS(e,t);else switch(t){case "svg":t=1;break;case "math":t=2;break;default:t=0;}}Sn(Xi),Lt(Xi,t);}function ds(){Sn(Xi),Sn(Dl),Sn(sa);}function om(t){t.memoizedState!==null&&Lt(sf,t);var e=Xi.current,n=CS(e,t.type);e!==n&&(Lt(Dl,t),Lt(Xi,n));}function uf(t){Dl.current===t&&(Sn(Xi),Sn(Dl)),sf.current===t&&(Sn(sf),ql._currentValue=Qa);}var _p,I0;function ja(t){if(_p===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);_p=e&&e[1]||"",I0=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":"";}return `
3
+ `+_p+t+I0}var Sp=false;function wp(t,e){if(!t||Sp)return "";Sp=true;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[]);}catch(_){var p=_;}Reflect.construct(t,[],A);}else {try{A.call();}catch(_){p=_;}t.call(A.prototype);}}else {try{throw Error()}catch(_){p=_;}(A=t())&&typeof A.catch=="function"&&A.catch(function(){});}}catch(_){if(_&&p&&typeof _.stack=="string")return [_.stack,p.stack]}return [null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],u=a[1];if(s&&u){var d=s.split(`
4
+ `),g=u.split(`
5
+ `);for(r=i=0;i<d.length&&!d[i].includes("DetermineComponentFrameRoot");)i++;for(;r<g.length&&!g[r].includes("DetermineComponentFrameRoot");)r++;if(i===d.length||r===g.length)for(i=d.length-1,r=g.length-1;1<=i&&0<=r&&d[i]!==g[r];)r--;for(;1<=i&&0<=r;i--,r--)if(d[i]!==g[r]){if(i!==1||r!==1)do if(i--,r--,0>r||d[i]!==g[r]){var v=`
6
+ `+d[i].replace(" at new "," at ");return t.displayName&&v.includes("<anonymous>")&&(v=v.replace("<anonymous>",t.displayName)),v}while(1<=i&&0<=r);break}}}finally{Sp=false,Error.prepareStackTrace=n;}return (n=t?t.displayName||t.name:"")?ja(n):""}function CC(t,e){switch(t.tag){case 26:case 27:case 5:return ja(t.type);case 16:return ja("Lazy");case 13:return t.child!==e&&e!==null?ja("Suspense Fallback"):ja("Suspense");case 19:return ja("SuspenseList");case 0:case 15:return wp(t.type,false);case 11:return wp(t.type.render,false);case 1:return wp(t.type,true);case 31:return ja("Activity");default:return ""}}function P0(t){try{var e="",n=null;do e+=CC(t,n),n=t,t=t.return;while(t);return e}catch(i){return `
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}}var sm=Object.prototype.hasOwnProperty,Zm=mn.unstable_scheduleCallback,Ep=mn.unstable_cancelCallback,RC=mn.unstable_shouldYield,xC=mn.unstable_requestPaint,ri=mn.unstable_now,kC=mn.unstable_getCurrentPriorityLevel,lb=mn.unstable_ImmediatePriority,ub=mn.unstable_UserBlockingPriority,cf=mn.unstable_NormalPriority,OC=mn.unstable_LowPriority,cb=mn.unstable_IdlePriority,IC=mn.log,PC=mn.unstable_setDisableYieldValue,Zl=null,ai=null;function na(t){if(typeof IC=="function"&&PC(t),ai&&typeof ai.setStrictMode=="function")try{ai.setStrictMode(Zl,t);}catch{}}var oi=Math.clz32?Math.clz32:DC,NC=Math.log,LC=Math.LN2;function DC(t){return t>>>=0,t===0?32:31-(NC(t)/LC|0)|0}var Rc=256,xc=262144,kc=4194304;function Ya(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Df(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var u=i&134217727;return u!==0?(i=u&~a,i!==0?r=Ya(i):(s&=u,s!==0?r=Ya(s):n||(n=u&~t,n!==0&&(r=Ya(n))))):(u=i&~a,u!==0?r=Ya(u):s!==0?r=Ya(s):n||(n=i&~t,n!==0&&(r=Ya(n)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function Jl(t,e){return (t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function BC(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 fb(){var t=kc;return kc<<=1,(kc&62914560)===0&&(kc=4194304),t}function Mp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function $l(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0);}function UC(t,e,n,i,r,a){var s=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var u=t.entanglements,d=t.expirationTimes,g=t.hiddenUpdates;for(n=s&~n;0<n;){var v=31-oi(n),A=1<<v;u[v]=0,d[v]=-1;var p=g[v];if(p!==null)for(g[v]=null,v=0;v<p.length;v++){var _=p[v];_!==null&&(_.lane&=-536870913);}n&=~A;}i!==0&&db(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(s&~e));}function db(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-oi(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930;}function hb(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-oi(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r;}}function pb(t,e){var n=e&-e;return n=(n&42)!==0?1:Jm(n),(n&(t.suspendedLanes|e))!==0?0:n}function Jm(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0;}return t}function $m(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function mb(){var t=yt.p;return t!==0?t:(t=window.event,t===void 0?32:US(t.type))}function N0(t,e){var n=yt.p;try{return yt.p=t,e()}finally{yt.p=n;}}var ba=Math.random().toString(36).slice(2),En="__reactFiber$"+ba,Yn="__reactProps$"+ba,ws="__reactContainer$"+ba,lm="__reactEvents$"+ba,FC="__reactListeners$"+ba,VC="__reactHandles$"+ba,L0="__reactResources$"+ba,eu="__reactMarker$"+ba;function eg(t){delete t[En],delete t[Yn],delete t[lm],delete t[FC],delete t[VC];}function Qo(t){var e=t[En];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ws]||n[En]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Gy(t);t!==null;){if(n=t[En])return n;t=Gy(t);}return e}t=n,n=t.parentNode;}return null}function Es(t){if(t=t[En]||t[ws]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function bl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(Z(33))}function as(t){var e=t[L0];return e||(e=t[L0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function _n(t){t[eu]=true;}var gb=new Set,vb={};function ao(t,e){hs(t,e),hs(t+"Capture",e);}function hs(t,e){for(vb[t]=e,t=0;t<e.length;t++)gb.add(e[t]);}var HC=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),D0={},B0={};function zC(t){return sm.call(B0,t)?true:sm.call(D0,t)?false:HC.test(t)?B0[t]=true:(D0[t]=true,false)}function jc(t,e,n){if(zC(e))if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":t.removeAttribute(e);return;case "boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n);}}function Oc(t,e,n){if(n===null)t.removeAttribute(e);else {switch(typeof n){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n);}}function pr(t,e,n,i){if(i===null)t.removeAttribute(n);else {switch(typeof i){case "undefined":case "function":case "symbol":case "boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i);}}function vi(t){switch(typeof t){case "bigint":case "boolean":case "number":case "string":case "undefined":return t;case "object":return t;default:return ""}}function Ab(t){var e=t.type;return (t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function GC(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(t,e,{configurable:true,get:function(){return r.call(this)},set:function(s){n=""+s,a.call(this,s);}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s;},stopTracking:function(){t._valueTracker=null,delete t[e];}}}}function um(t){if(!t._valueTracker){var e=Ab(t)?"checked":"value";t._valueTracker=GC(t,e,""+t[e]);}}function yb(t){if(!t)return false;var e=t._valueTracker;if(!e)return true;var n=e.getValue(),i="";return t&&(i=Ab(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),true):false}function ff(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var WC=/[\n"\\]/g;function bi(t){return t.replace(WC,function(e){return "\\"+e.charCodeAt(0).toString(16)+" "})}function cm(t,e,n,i,r,a,s,u){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+vi(e)):t.value!==""+vi(e)&&(t.value=""+vi(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?fm(t,s,vi(e)):n!=null?fm(t,s,vi(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?t.name=""+vi(u):t.removeAttribute("name");}function bb(t,e,n,i,r,a,s,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){um(t);return}n=n!=null?""+vi(n):"",e=e!=null?""+vi(e):n,u||e===t.value||(t.value=e),t.defaultValue=e;}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=u?t.checked:!!i,t.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),um(t);}function fm(t,e,n){e==="number"&&ff(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n);}function os(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=true;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=true);}else {for(n=""+vi(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=true,i&&(t[r].defaultSelected=true);return}e!==null||t[r].disabled||(e=t[r]);}e!==null&&(e.selected=true);}}function _b(t,e,n){if(e!=null&&(e=""+vi(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+vi(n):"";}function Sb(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(Z(92));if(yl(i)){if(1<i.length)throw Error(Z(93));i=i[0];}n=i;}n==null&&(n=""),e=n;}n=vi(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),um(t);}function ps(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e;}var jC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function U0(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||jC.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px";}function wb(t,e,n){if(e!=null&&typeof e!="object")throw Error(Z(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&U0(t,r,i);}else for(var a in e)e.hasOwnProperty(a)&&U0(t,a,e[a]);}function tg(t){if(t.indexOf("-")===-1)return false;switch(t){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return false;default:return true}}var YC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yc(t){return qC.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Sr(){}var dm=null;function ng(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ko=null,ss=null;function F0(t){var e=Es(t);if(e&&(t=e.stateNode)){var n=t[Yn]||null;e:switch(t=e.stateNode,e.type){case "input":if(cm(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+bi(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Yn]||null;if(!r)throw Error(Z(90));cm(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name);}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&yb(i);}break e;case "textarea":_b(t,n.value,n.defaultValue);break e;case "select":e=n.value,e!=null&&os(t,!!n.multiple,e,false);}}}var Tp=false;function Eb(t,e,n){if(Tp)return t(e,n);Tp=true;try{var i=t(e);return i}finally{if(Tp=false,(Ko!==null||ss!==null)&&(Xf(),Ko&&(e=Ko,t=ss,ss=Ko=null,F0(e),t)))for(e=0;e<t.length;e++)F0(t[e]);}}function Bl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Yn]||null;if(i===null)return null;n=i[e];e:switch(e){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=false;}if(t)return null;if(n&&typeof n!="function")throw Error(Z(231,e,typeof n));return n}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hm=false;if(Cr)try{zo={},Object.defineProperty(zo,"passive",{get:function(){hm=!0;}}),window.addEventListener("test",zo,zo),window.removeEventListener("test",zo,zo);}catch{hm=false;}var zo,ia=null,ig=null,qc=null;function Mb(){if(qc)return qc;var t,e=ig,n=e.length,i,r="value"in ia?ia.value:ia.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var s=n-t;for(i=1;i<=s&&e[n-i]===r[a-i];i++);return qc=r.slice(t,1<i?1-i:void 0)}function Xc(t){var e=t.keyCode;return "charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Ic(){return true}function V0(){return false}function qn(t){function e(n,i,r,a,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===false)?Ic:V0,this.isPropagationStopped=V0,this}return Ht(e.prototype,{preventDefault:function(){this.defaultPrevented=true;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=false),this.isDefaultPrevented=Ic);},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=true),this.isPropagationStopped=Ic);},persist:function(){},isPersistent:Ic}),e}var oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bf=qn(oo),tu=Ht({},oo,{view:0,detail:0}),XC=qn(tu),Cp,Rp,dl,Uf=Ht({},tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return "movementX"in t?t.movementX:(t!==dl&&(dl&&t.type==="mousemove"?(Cp=t.screenX-dl.screenX,Rp=t.screenY-dl.screenY):Rp=Cp=0,dl=t),Cp)},movementY:function(t){return "movementY"in t?t.movementY:Rp}}),H0=qn(Uf),QC=Ht({},Uf,{dataTransfer:0}),KC=qn(QC),ZC=Ht({},tu,{relatedTarget:0}),xp=qn(ZC),JC=Ht({},oo,{animationName:0,elapsedTime:0,pseudoElement:0}),$C=qn(JC),e2=Ht({},oo,{clipboardData:function(t){return "clipboardData"in t?t.clipboardData:window.clipboardData}}),t2=qn(e2),n2=Ht({},oo,{data:0}),z0=qn(n2),i2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},r2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},a2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=a2[t])?!!e[t]:false}function rg(){return o2}var s2=Ht({},tu,{key:function(t){if(t.key){var e=i2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Xc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?r2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rg,charCode:function(t){return t.type==="keypress"?Xc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),l2=qn(s2),u2=Ht({},Uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G0=qn(u2),c2=Ht({},tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rg}),f2=qn(c2),d2=Ht({},oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),h2=qn(d2),p2=Ht({},Uf,{deltaX:function(t){return "deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return "deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),m2=qn(p2),g2=Ht({},oo,{newState:0,oldState:0}),v2=qn(g2),A2=[9,13,27,32],ag=Cr&&"CompositionEvent"in window,wl=null;Cr&&"documentMode"in document&&(wl=document.documentMode);var y2=Cr&&"TextEvent"in window&&!wl,Tb=Cr&&(!ag||wl&&8<wl&&11>=wl),W0=" ",j0=false;function Cb(t,e){switch(t){case "keyup":return A2.indexOf(e.keyCode)!==-1;case "keydown":return e.keyCode!==229;case "keypress":case "mousedown":case "focusout":return true;default:return false}}function Rb(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zo=false;function b2(t,e){switch(t){case "compositionend":return Rb(e);case "keypress":return e.which!==32?null:(j0=true,W0);case "textInput":return t=e.data,t===W0&&j0?null:t;default:return null}}function _2(t,e){if(Zo)return t==="compositionend"||!ag&&Cb(t,e)?(t=Mb(),qc=ig=ia=null,Zo=false,t):null;switch(t){case "paste":return null;case "keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case "compositionend":return Tb&&e.locale!=="ko"?null:e.data;default:return null}}var S2={color:true,date:true,datetime:true,"datetime-local":true,email:true,month:true,number:true,password:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true};function Y0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!S2[t.type]:e==="textarea"}function xb(t,e,n,i){Ko?ss?ss.push(i):ss=[i]:Ko=i,e=xf(e,"onChange"),0<e.length&&(n=new Bf("onChange","change",null,n,i),t.push({event:n,listeners:e}));}var El=null,Ul=null;function w2(t){ES(t,0);}function Ff(t){var e=bl(t);if(yb(e))return t}function q0(t,e){if(t==="change")return e}var kb=false;Cr&&(Cr?(Nc="oninput"in document,Nc||(kp=document.createElement("div"),kp.setAttribute("oninput","return;"),Nc=typeof kp.oninput=="function"),Pc=Nc):Pc=false,kb=Pc&&(!document.documentMode||9<document.documentMode));var Pc,Nc,kp;function X0(){El&&(El.detachEvent("onpropertychange",Ob),Ul=El=null);}function Ob(t){if(t.propertyName==="value"&&Ff(Ul)){var e=[];xb(e,Ul,t,ng(t)),Eb(w2,e);}}function E2(t,e,n){t==="focusin"?(X0(),El=e,Ul=n,El.attachEvent("onpropertychange",Ob)):t==="focusout"&&X0();}function M2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ff(Ul)}function T2(t,e){if(t==="click")return Ff(e)}function C2(t,e){if(t==="input"||t==="change")return Ff(e)}function R2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var li=typeof Object.is=="function"?Object.is:R2;function Fl(t,e){if(li(t,e))return true;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return false;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return false;for(i=0;i<n.length;i++){var r=n[i];if(!sm.call(e,r)||!li(t[r],e[r]))return false}return true}function Q0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function K0(t,e){var n=Q0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return {node:n,offset:e-t};t=i;}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode;}n=void 0;}n=Q0(n);}}function Ib(t,e){return t&&e?t===e?true:t&&t.nodeType===3?false:e&&e.nodeType===3?Ib(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):false:false}function Pb(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ff(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string";}catch{n=false;}if(n)t=e.contentWindow;else break;e=ff(t.document);}return e}function og(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var x2=Cr&&"documentMode"in document&&11>=document.documentMode,Jo=null,pm=null,Ml=null,mm=false;function Z0(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mm||Jo==null||Jo!==ff(i)||(i=Jo,"selectionStart"in i&&og(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ml&&Fl(Ml,i)||(Ml=i,i=xf(pm,"onSelect"),0<i.length&&(e=new Bf("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Jo)));}function Wa(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var $o={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},Op={},Nb={};Cr&&(Nb=document.createElement("div").style,"AnimationEvent"in window||(delete $o.animationend.animation,delete $o.animationiteration.animation,delete $o.animationstart.animation),"TransitionEvent"in window||delete $o.transitionend.transition);function so(t){if(Op[t])return Op[t];if(!$o[t])return t;var e=$o[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Nb)return Op[t]=e[n];return t}var Lb=so("animationend"),Db=so("animationiteration"),Bb=so("animationstart"),k2=so("transitionrun"),O2=so("transitionstart"),I2=so("transitioncancel"),Ub=so("transitionend"),Fb=new Map,gm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");gm.push("scrollEnd");function Li(t,e){Fb.set(t,e),ao(e,[t]);}var df=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:true,cancelable:true,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t);},gi=[],es=0,sg=0;function Vf(){for(var t=es,e=sg=es=0;e<t;){var n=gi[e];gi[e++]=null;var i=gi[e];gi[e++]=null;var r=gi[e];gi[e++]=null;var a=gi[e];if(gi[e++]=null,i!==null&&r!==null){var s=i.pending;s===null?r.next=r:(r.next=s.next,s.next=r),i.pending=r;}a!==0&&Vb(n,r,a);}}function Hf(t,e,n,i){gi[es++]=t,gi[es++]=e,gi[es++]=n,gi[es++]=i,sg|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i);}function lg(t,e,n,i){return Hf(t,e,n,i),hf(t)}function lo(t,e){return Hf(t,null,null,e),hf(t)}function Vb(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=false,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=true)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-oi(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function hf(t){if(50<Nl)throw Nl=0,Bm=null,Error(Z(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var ts={};function P2(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null;}function ni(t,e,n,i){return new P2(t,e,n,i)}function ug(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Er(t,e){var n=t.alternate;return n===null?(n=ni(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function Hb(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Qc(t,e,n,i,r,a){var s=0;if(i=t,typeof t=="function")ug(t)&&(s=1);else if(typeof t=="string")s=DR(t,n,Xi.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case im:return t=ni(31,n,e,r),t.elementType=im,t.lanes=a,t;case qo:return Ka(n.children,r,a,e);case ob:s=8,r|=24;break;case em:return t=ni(12,n,e,r|2),t.elementType=em,t.lanes=a,t;case tm:return t=ni(13,n,e,r),t.elementType=tm,t.lanes=a,t;case nm:return t=ni(19,n,e,r),t.elementType=nm,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _r:s=10;break e;case sb:s=9;break e;case Qm:s=11;break e;case Km:s=14;break e;case Kr:s=16,i=null;break e}s=29,n=Error(Z(130,t===null?"null":typeof t,"")),i=null;}return e=ni(s,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function Ka(t,e,n,i){return t=ni(7,t,i,e),t.lanes=n,t}function Ip(t,e,n){return t=ni(6,t,null,e),t.lanes=n,t}function zb(t){var e=ni(18,null,null,0);return e.stateNode=t,e}function Pp(t,e,n){return e=ni(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var J0=new WeakMap;function _i(t,e){if(typeof t=="object"&&t!==null){var n=J0.get(t);return n!==void 0?n:(e={value:t,source:e,stack:P0(e)},J0.set(t,e),e)}return {value:t,source:e,stack:P0(e)}}var ns=[],is=0,pf=null,Vl=0,Ai=[],yi=0,ga=null,ji=1,Yi="";function yr(t,e){ns[is++]=Vl,ns[is++]=pf,pf=t,Vl=e;}function Gb(t,e,n){Ai[yi++]=ji,Ai[yi++]=Yi,Ai[yi++]=ga,ga=t;var i=ji;t=Yi;var r=32-oi(i)-1;i&=~(1<<r),n+=1;var a=32-oi(e)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,ji=1<<32-oi(e)+r|n<<r|i,Yi=a+t;}else ji=1<<a|n<<r|i,Yi=t;}function cg(t){t.return!==null&&(yr(t,1),Gb(t,1,0));}function fg(t){for(;t===pf;)pf=ns[--is],ns[is]=null,Vl=ns[--is],ns[is]=null;for(;t===ga;)ga=Ai[--yi],Ai[yi]=null,Yi=Ai[--yi],Ai[yi]=null,ji=Ai[--yi],Ai[yi]=null;}function Wb(t,e){Ai[yi++]=ji,Ai[yi++]=Yi,Ai[yi++]=ga,ji=e.id,Yi=e.overflow,ga=t;}var Mn=null,Vt=null,st=false,la=null,Si=false,vm=Error(Z(519));function va(t){var e=Error(Z(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(_i(e,t)),vm}function $0(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[En]=t,e[Yn]=i,n){case "dialog":tt("cancel",e),tt("close",e);break;case "iframe":case "object":case "embed":tt("load",e);break;case "video":case "audio":for(n=0;n<jl.length;n++)tt(jl[n],e);break;case "source":tt("error",e);break;case "img":case "image":case "link":tt("error",e),tt("load",e);break;case "details":tt("toggle",e);break;case "input":tt("invalid",e),bb(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,true);break;case "select":tt("invalid",e);break;case "textarea":tt("invalid",e),Sb(e,i.value,i.defaultValue,i.children);}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===true||TS(e.textContent,n)?(i.popover!=null&&(tt("beforetoggle",e),tt("toggle",e)),i.onScroll!=null&&tt("scroll",e),i.onScrollEnd!=null&&tt("scrollend",e),i.onClick!=null&&(e.onclick=Sr),e=true):e=false,e||va(t,true);}function ey(t){for(Mn=t.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Si=false;return;case 27:case 3:Si=true;return;default:Mn=Mn.return;}}function Go(t){if(t!==Mn)return false;if(!st)return ey(t),st=true,false;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||zm(t.type,t.memoizedProps)),n=!n),n&&Vt&&va(t),ey(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Z(317));Vt=zy(t);}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Z(317));Vt=zy(t);}else e===27?(e=Vt,_a(t.type)?(t=Ym,Ym=null,Vt=t):Vt=e):Vt=Mn?Ei(t.stateNode.nextSibling):null;return true}function eo(){Vt=Mn=null,st=false;}function Np(){var t=la;return t!==null&&(Wn===null?Wn=t:Wn.push.apply(Wn,t),la=null),t}function Hl(t){la===null?la=[t]:la.push(t);}var Am=Qi(null),uo=null,wr=null;function Jr(t,e,n){Lt(Am,e._currentValue),e._currentValue=n;}function Mr(t){t._currentValue=Am.current,Sn(Am);}function ym(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return;}}function bm(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var s=r.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=r;for(var d=0;d<e.length;d++)if(u.context===e[d]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),ym(a.return,n,t),i||(s=null);break e}a=u.next;}}else if(r.tag===18){if(s=r.return,s===null)throw Error(Z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ym(s,n,t),s=null;}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===t){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return;}r=s;}}function Ms(t,e,n,i){t=null;for(var r=e,a=false;r!==null;){if(!a){if((r.flags&524288)!==0)a=true;else if((r.flags&262144)!==0)break}if(r.tag===10){var s=r.alternate;if(s===null)throw Error(Z(387));if(s=s.memoizedProps,s!==null){var u=r.type;li(r.pendingProps.value,s.value)||(t!==null?t.push(u):t=[u]);}}else if(r===sf.current){if(s=r.alternate,s===null)throw Error(Z(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(ql):t=[ql]);}r=r.return;}t!==null&&bm(e,t,n,i),e.flags|=262144;}function mf(t){for(t=t.firstContext;t!==null;){if(!li(t.context._currentValue,t.memoizedValue))return true;t=t.next;}return false}function to(t){uo=t,wr=null,t=t.dependencies,t!==null&&(t.firstContext=null);}function Tn(t){return jb(uo,t)}function Lc(t,e){return uo===null&&to(t),jb(t,e)}function jb(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},wr===null){if(t===null)throw Error(Z(308));wr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288;}else wr=wr.next=e;return n}var N2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:false,addEventListener:function(n,i){t.push(i);}};this.abort=function(){e.aborted=true,t.forEach(function(n){return n()});};},L2=mn.unstable_scheduleCallback,D2=mn.unstable_NormalPriority,fn={$$typeof:_r,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dg(){return {controller:new N2,data:new Map,refCount:0}}function nu(t){t.refCount--,t.refCount===0&&L2(D2,function(){t.controller.abort();});}var Tl=null,_m=0,ms=0,ls=null;function B2(t,e){if(Tl===null){var n=Tl=[];_m=0,ms=Bg(),ls={status:"pending",value:void 0,then:function(i){n.push(i);}};}return _m++,e.then(ty,ty),e}function ty(){if(--_m===0&&Tl!==null){ls!==null&&(ls.status="fulfilled");var t=Tl;Tl=null,ms=0,ls=null;for(var e=0;e<t.length;e++)(0, t[e])();}}function U2(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r);}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0, n[r])(e);},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0, n[r])(void 0);}),i}var ny=Ve.S;Ve.S=function(t,e){aS=ri(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&B2(t,e),ny!==null&&ny(t,e);};var Za=Qi(null);function hg(){var t=Za.current;return t!==null?t:Pt.pooledCache}function Kc(t,e){e===null?Lt(Za,Za.current):Lt(Za,e.pool);}function Yb(){var t=hg();return t===null?null:{parent:fn._currentValue,pool:t}}var Ts=Error(Z(460)),pg=Error(Z(474)),zf=Error(Z(542)),gf={then:function(){}};function iy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function qb(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Sr,Sr),e=n),e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,ay(t),t;default:if(typeof e.status=="string")e.then(Sr,Sr);else {if(t=Pt,t!==null&&100<t.shellSuspendCounter)throw Error(Z(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i;}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i;}});}switch(e.status){case "fulfilled":return e.value;case "rejected":throw t=e.reason,ay(t),t}throw Ja=e,Ts}}function qa(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ja=n,Ts):n}}var Ja=null;function ry(){if(Ja===null)throw Error(Z(459));var t=Ja;return Ja=null,t}function ay(t){if(t===Ts||t===zf)throw Error(Z(483))}var us=null,zl=0;function Dc(t){var e=zl;return zl+=1,us===null&&(us=[]),qb(us,t,e)}function hl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null;}function Bc(t,e){throw e.$$typeof===EC?Error(Z(525)):(t=Object.prototype.toString.call(e),Error(Z(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Xb(t){function e(E,w){if(t){var C=E.deletions;C===null?(E.deletions=[w],E.flags|=16):C.push(w);}}function n(E,w){if(!t)return null;for(;w!==null;)e(E,w),w=w.sibling;return null}function i(E){for(var w=new Map;E!==null;)E.key!==null?w.set(E.key,E):w.set(E.index,E),E=E.sibling;return w}function r(E,w){return E=Er(E,w),E.index=0,E.sibling=null,E}function a(E,w,C){return E.index=C,t?(C=E.alternate,C!==null?(C=C.index,C<w?(E.flags|=67108866,w):C):(E.flags|=67108866,w)):(E.flags|=1048576,w)}function s(E){return t&&E.alternate===null&&(E.flags|=67108866),E}function u(E,w,C,I){return w===null||w.tag!==6?(w=Ip(C,E.mode,I),w.return=E,w):(w=r(w,C),w.return=E,w)}function d(E,w,C,I){var V=C.type;return V===qo?v(E,w,C.props.children,I,C.key):w!==null&&(w.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===Kr&&qa(V)===w.type)?(w=r(w,C.props),hl(w,C),w.return=E,w):(w=Qc(C.type,C.key,C.props,null,E.mode,I),hl(w,C),w.return=E,w)}function g(E,w,C,I){return w===null||w.tag!==4||w.stateNode.containerInfo!==C.containerInfo||w.stateNode.implementation!==C.implementation?(w=Pp(C,E.mode,I),w.return=E,w):(w=r(w,C.children||[]),w.return=E,w)}function v(E,w,C,I,V){return w===null||w.tag!==7?(w=Ka(C,E.mode,I,V),w.return=E,w):(w=r(w,C),w.return=E,w)}function A(E,w,C){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ip(""+w,E.mode,C),w.return=E,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Cc:return C=Qc(w.type,w.key,w.props,null,E.mode,C),hl(C,w),C.return=E,C;case Al:return w=Pp(w,E.mode,C),w.return=E,w;case Kr:return w=qa(w),A(E,w,C)}if(yl(w)||fl(w))return w=Ka(w,E.mode,C,null),w.return=E,w;if(typeof w.then=="function")return A(E,Dc(w),C);if(w.$$typeof===_r)return A(E,Lc(E,w),C);Bc(E,w);}return null}function p(E,w,C,I){var V=w!==null?w.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return V!==null?null:u(E,w,""+C,I);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Cc:return C.key===V?d(E,w,C,I):null;case Al:return C.key===V?g(E,w,C,I):null;case Kr:return C=qa(C),p(E,w,C,I)}if(yl(C)||fl(C))return V!==null?null:v(E,w,C,I,null);if(typeof C.then=="function")return p(E,w,Dc(C),I);if(C.$$typeof===_r)return p(E,w,Lc(E,C),I);Bc(E,C);}return null}function _(E,w,C,I,V){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return E=E.get(C)||null,u(w,E,""+I,V);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case Cc:return E=E.get(I.key===null?C:I.key)||null,d(w,E,I,V);case Al:return E=E.get(I.key===null?C:I.key)||null,g(w,E,I,V);case Kr:return I=qa(I),_(E,w,C,I,V)}if(yl(I)||fl(I))return E=E.get(C)||null,v(w,E,I,V,null);if(typeof I.then=="function")return _(E,w,C,Dc(I),V);if(I.$$typeof===_r)return _(E,w,C,Lc(w,I),V);Bc(w,I);}return null}function T(E,w,C,I){for(var V=null,K=null,F=w,H=w=0,J=null;F!==null&&H<C.length;H++){F.index>H?(J=F,F=null):J=F.sibling;var Y=p(E,F,C[H],I);if(Y===null){F===null&&(F=J);break}t&&F&&Y.alternate===null&&e(E,F),w=a(Y,w,H),K===null?V=Y:K.sibling=Y,K=Y,F=J;}if(H===C.length)return n(E,F),st&&yr(E,H),V;if(F===null){for(;H<C.length;H++)F=A(E,C[H],I),F!==null&&(w=a(F,w,H),K===null?V=F:K.sibling=F,K=F);return st&&yr(E,H),V}for(F=i(F);H<C.length;H++)J=_(F,E,H,C[H],I),J!==null&&(t&&J.alternate!==null&&F.delete(J.key===null?H:J.key),w=a(J,w,H),K===null?V=J:K.sibling=J,K=J);return t&&F.forEach(function(Me){return e(E,Me)}),st&&yr(E,H),V}function x(E,w,C,I){if(C==null)throw Error(Z(151));for(var V=null,K=null,F=w,H=w=0,J=null,Y=C.next();F!==null&&!Y.done;H++,Y=C.next()){F.index>H?(J=F,F=null):J=F.sibling;var Me=p(E,F,Y.value,I);if(Me===null){F===null&&(F=J);break}t&&F&&Me.alternate===null&&e(E,F),w=a(Me,w,H),K===null?V=Me:K.sibling=Me,K=Me,F=J;}if(Y.done)return n(E,F),st&&yr(E,H),V;if(F===null){for(;!Y.done;H++,Y=C.next())Y=A(E,Y.value,I),Y!==null&&(w=a(Y,w,H),K===null?V=Y:K.sibling=Y,K=Y);return st&&yr(E,H),V}for(F=i(F);!Y.done;H++,Y=C.next())Y=_(F,E,H,Y.value,I),Y!==null&&(t&&Y.alternate!==null&&F.delete(Y.key===null?H:Y.key),w=a(Y,w,H),K===null?V=Y:K.sibling=Y,K=Y);return t&&F.forEach(function(Re){return e(E,Re)}),st&&yr(E,H),V}function N(E,w,C,I){if(typeof C=="object"&&C!==null&&C.type===qo&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Cc:e:{for(var V=C.key;w!==null;){if(w.key===V){if(V=C.type,V===qo){if(w.tag===7){n(E,w.sibling),I=r(w,C.props.children),I.return=E,E=I;break e}}else if(w.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===Kr&&qa(V)===w.type){n(E,w.sibling),I=r(w,C.props),hl(I,C),I.return=E,E=I;break e}n(E,w);break}else e(E,w);w=w.sibling;}C.type===qo?(I=Ka(C.props.children,E.mode,I,C.key),I.return=E,E=I):(I=Qc(C.type,C.key,C.props,null,E.mode,I),hl(I,C),I.return=E,E=I);}return s(E);case Al:e:{for(V=C.key;w!==null;){if(w.key===V)if(w.tag===4&&w.stateNode.containerInfo===C.containerInfo&&w.stateNode.implementation===C.implementation){n(E,w.sibling),I=r(w,C.children||[]),I.return=E,E=I;break e}else {n(E,w);break}else e(E,w);w=w.sibling;}I=Pp(C,E.mode,I),I.return=E,E=I;}return s(E);case Kr:return C=qa(C),N(E,w,C,I)}if(yl(C))return T(E,w,C,I);if(fl(C)){if(V=fl(C),typeof V!="function")throw Error(Z(150));return C=V.call(C),x(E,w,C,I)}if(typeof C.then=="function")return N(E,w,Dc(C),I);if(C.$$typeof===_r)return N(E,w,Lc(E,C),I);Bc(E,C);}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,w!==null&&w.tag===6?(n(E,w.sibling),I=r(w,C),I.return=E,E=I):(n(E,w),I=Ip(C,E.mode,I),I.return=E,E=I),s(E)):n(E,w)}return function(E,w,C,I){try{zl=0;var V=N(E,w,C,I);return us=null,V}catch(F){if(F===Ts||F===zf)throw F;var K=ni(29,F,null,E.mode);return K.lanes=I,K.return=E,K}}}var no=Xb(true),Qb=Xb(false),Zr=false;function mg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null};}function Sm(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null});}function ua(t){return {lane:t,tag:0,payload:null,callback:null,next:null}}function ca(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(At&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=hf(t),Vb(t,null,n),e}return Hf(t,i,e,n),hf(t)}function Cl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hb(t,n);}}function Lp(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=s:a=a.next=s,n=n.next;}while(n!==null);a===null?r=a=e:a=a.next=e;}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e;}var wm=false;function Rl(){if(wm){var t=ls;if(t!==null)throw t}}function xl(t,e,n,i){wm=false;var r=t.updateQueue;Zr=false;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,u=r.shared.pending;if(u!==null){r.shared.pending=null;var d=u,g=d.next;d.next=null,s===null?a=g:s.next=g,s=d;var v=t.alternate;v!==null&&(v=v.updateQueue,u=v.lastBaseUpdate,u!==s&&(u===null?v.firstBaseUpdate=g:u.next=g,v.lastBaseUpdate=d));}if(a!==null){var A=r.baseState;s=0,v=g=d=null,u=a;do{var p=u.lane&-536870913,_=p!==u.lane;if(_?(rt&p)===p:(i&p)===p){p!==0&&p===ms&&(wm=true),v!==null&&(v=v.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var T=t,x=u;p=e;var N=n;switch(x.tag){case 1:if(T=x.payload,typeof T=="function"){A=T.call(N,A,p);break e}A=T;break e;case 3:T.flags=T.flags&-65537|128;case 0:if(T=x.payload,p=typeof T=="function"?T.call(N,A,p):T,p==null)break e;A=Ht({},A,p);break e;case 2:Zr=true;}}p=u.callback,p!==null&&(t.flags|=64,_&&(t.flags|=8192),_=r.callbacks,_===null?r.callbacks=[p]:_.push(p));}else _={lane:p,tag:u.tag,payload:u.payload,callback:u.callback,next:null},v===null?(g=v=_,d=A):v=v.next=_,s|=p;if(u=u.next,u===null){if(u=r.shared.pending,u===null)break;_=u,u=_.next,_.next=null,r.lastBaseUpdate=_,r.shared.pending=null;}}while(true);v===null&&(d=A),r.baseState=d,r.firstBaseUpdate=g,r.lastBaseUpdate=v,a===null&&(r.shared.lanes=0),ya|=s,t.lanes=s,t.memoizedState=A;}}function Kb(t,e){if(typeof t!="function")throw Error(Z(191,t));t.call(e);}function Zb(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)Kb(n[t],e);}var gs=Qi(null),vf=Qi(0);function oy(t,e){t=Or,Lt(vf,t),Lt(gs,e),Or=t|e.baseLanes;}function Em(){Lt(vf,Or),Lt(gs,gs.current);}function gg(){Or=vf.current,Sn(gs),Sn(vf);}var ui=Qi(null),wi=null;function $r(t){var e=t.alternate;Lt(on,on.current&1),Lt(ui,t),wi===null&&(e===null||gs.current!==null||e.memoizedState!==null)&&(wi=t);}function Mm(t){Lt(on,on.current),Lt(ui,t),wi===null&&(wi=t);}function Jb(t){t.tag===22?(Lt(on,on.current),Lt(ui,t),wi===null&&(wi=t)):ea();}function ea(){Lt(on,on.current),Lt(ui,ui.current);}function ti(t){Sn(ui),wi===t&&(wi=null),Sn(on);}var on=Qi(0);function Af(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Wm(n)||jm(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return;}e.sibling.return=e.return,e=e.sibling;}return null}var Rr=0,je=null,kt=null,un=null,yf=false,cs=false,io=false,bf=0,Gl=0,fs=null,F2=0;function $t(){throw Error(Z(321))}function vg(t,e){if(e===null)return false;for(var n=0;n<e.length&&n<t.length;n++)if(!li(t[n],e[n]))return false;return true}function Ag(t,e,n,i,r,a){return Rr=a,je=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ve.H=t===null||t.memoizedState===null?x_:xg,io=false,a=n(i,r),io=false,cs&&(a=e_(e,n,i,r)),$b(t),a}function $b(t){Ve.H=Wl;var e=kt!==null&&kt.next!==null;if(Rr=0,un=kt=je=null,yf=false,Gl=0,fs=null,e)throw Error(Z(300));t===null||dn||(t=t.dependencies,t!==null&&mf(t)&&(dn=true));}function e_(t,e,n,i){je=t;var r=0;do{if(cs&&(fs=null),Gl=0,cs=false,25<=r)throw Error(Z(301));if(r+=1,un=kt=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0);}Ve.H=k_,a=e(n,i);}while(cs);return a}function V2(){var t=Ve.H,e=t.useState()[0];return e=typeof e.then=="function"?iu(e):e,t=t.useState()[0],(kt!==null?kt.memoizedState:null)!==t&&(je.flags|=1024),e}function yg(){var t=bf!==0;return bf=0,t}function bg(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n;}function _g(t){if(yf){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next;}yf=false;}Rr=0,un=kt=je=null,cs=false,Gl=bf=0,fs=null;}function Un(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?je.memoizedState=un=t:un=un.next=t,un}function sn(){if(kt===null){var t=je.alternate;t=t!==null?t.memoizedState:null;}else t=kt.next;var e=un===null?je.memoizedState:un.next;if(e!==null)un=e,kt=t;else {if(t===null)throw je.alternate===null?Error(Z(467)):Error(Z(310));kt=t,t={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},un===null?je.memoizedState=un=t:un=un.next=t;}return un}function Gf(){return {lastEffect:null,events:null,stores:null,memoCache:null}}function iu(t){var e=Gl;return Gl+=1,fs===null&&(fs=[]),t=qb(fs,t,e),e=je,(un===null?e.memoizedState:un.next)===null&&(e=e.alternate,Ve.H=e===null||e.memoizedState===null?x_:xg),t}function Wf(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return iu(t);if(t.$$typeof===_r)return Tn(t)}throw Error(Z(438,String(t)))}function Sg(t){var e=null,n=je.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=je.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})));}if(e==null&&(e={data:[],index:0}),n===null&&(n=Gf(),je.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=MC;return e.index++,n}function xr(t,e){return typeof e=="function"?e(t):e}function Zc(t){var e=sn();return wg(e,kt,t)}function wg(t,e,n){var i=t.queue;if(i===null)throw Error(Z(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var s=r.next;r.next=a.next,a.next=s;}e.baseQueue=r=a,i.pending=null;}if(a=t.baseState,r===null)t.memoizedState=a;else {e=r.next;var u=s=null,d=null,g=e,v=false;do{var A=g.lane&-536870913;if(A!==g.lane?(rt&A)===A:(Rr&A)===A){var p=g.revertLane;if(p===0)d!==null&&(d=d.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),A===ms&&(v=true);else if((Rr&p)===p){g=g.next,p===ms&&(v=true);continue}else A={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=A,s=a):d=d.next=A,je.lanes|=p,ya|=p;A=g.action,io&&n(a,A),a=g.hasEagerState?g.eagerState:n(a,A);}else p={lane:A,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},d===null?(u=d=p,s=a):d=d.next=p,je.lanes|=A,ya|=A;g=g.next;}while(g!==null&&g!==e);if(d===null?s=a:d.next=u,!li(a,t.memoizedState)&&(dn=true,v&&(n=ls,n!==null)))throw n;t.memoizedState=a,t.baseState=s,t.baseQueue=d,i.lastRenderedState=a;}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Dp(t){var e=sn(),n=e.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do a=t(a,s.action),s=s.next;while(s!==r);li(a,e.memoizedState)||(dn=true),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a;}return [a,i]}function t_(t,e,n){var i=je,r=sn(),a=st;if(a){if(n===void 0)throw Error(Z(407));n=n();}else n=e();var s=!li((kt||r).memoizedState,n);if(s&&(r.memoizedState=n,dn=true),r=r.queue,Eg(r_.bind(null,i,r,t),[t]),r.getSnapshot!==e||s||un!==null&&un.memoizedState.tag&1){if(i.flags|=2048,vs(9,{destroy:void 0},i_.bind(null,i,r,n,e),null),Pt===null)throw Error(Z(349));a||(Rr&127)!==0||n_(i,e,n);}return n}function n_(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=je.updateQueue,e===null?(e=Gf(),je.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t));}function i_(t,e,n,i){e.value=n,e.getSnapshot=i,a_(e)&&o_(t);}function r_(t,e,n){return n(function(){a_(e)&&o_(t);})}function a_(t){var e=t.getSnapshot;t=t.value;try{var n=e();return !li(t,n)}catch{return true}}function o_(t){var e=lo(t,2);e!==null&&jn(e,t,2);}function Tm(t){var e=Un();if(typeof t=="function"){var n=t;if(t=n(),io){na(true);try{n();}finally{na(false);}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:t},e}function s_(t,e,n,i){return t.baseState=n,wg(t,kt,typeof i=="function"?i:xr)}function H2(t,e,n,i,r){if(Yf(t))throw Error(Z(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:true,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s);}};Ve.T!==null?n(true):a.isTransition=false,i(a),n=e.pending,n===null?(a.next=e.pending=a,l_(e,a)):(a.next=n.next,e.pending=n.next=a);}}function l_(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Ve.T,s={};Ve.T=s;try{var u=n(r,i),d=Ve.S;d!==null&&d(s,u),sy(t,e,u);}catch(g){Cm(t,e,g);}finally{a!==null&&s.types!==null&&(a.types=s.types),Ve.T=a;}}else try{a=n(r,i),sy(t,e,a);}catch(g){Cm(t,e,g);}}function sy(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){ly(t,e,i);},function(i){return Cm(t,e,i)}):ly(t,e,n);}function ly(t,e,n){e.status="fulfilled",e.value=n,u_(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,l_(t,n)));}function Cm(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,u_(e),e=e.next;while(e!==i)}t.action=null;}function u_(t){t=t.listeners;for(var e=0;e<t.length;e++)(0, t[e])();}function c_(t,e){return e}function uy(t,e){if(st){var n=Pt.formState;if(n!==null){e:{var i=je;if(st){if(Vt){t:{for(var r=Vt,a=Si;r.nodeType!==8;){if(!a){r=null;break t}if(r=Ei(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null;}if(r){Vt=Ei(r.nextSibling),i=r.data==="F!";break e}}va(i);}i=false;}i&&(e=n[0]);}}return n=Un(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c_,lastRenderedState:e},n.queue=i,n=T_.bind(null,je,i),i.dispatch=n,i=Tm(false),a=Rg.bind(null,je,false,i.queue),i=Un(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=H2.bind(null,je,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,false]}function cy(t){var e=sn();return f_(e,kt,t)}function f_(t,e,n){if(e=wg(t,e,c_)[0],t=Zc(xr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=iu(e);}catch(s){throw s===Ts?zf:s}else i=e;e=sn();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(je.flags|=2048,vs(9,{destroy:void 0},z2.bind(null,r,n),null)),[i,a,t]}function z2(t,e){t.action=e;}function fy(t){var e=sn(),n=kt;if(n!==null)return f_(e,n,t);sn(),e=e.memoizedState,n=sn();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,false]}function vs(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=je.updateQueue,e===null&&(e=Gf(),je.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function d_(){return sn().memoizedState}function Jc(t,e,n,i){var r=Un();je.flags|=t,r.memoizedState=vs(1|e,{destroy:void 0},n,i===void 0?null:i);}function jf(t,e,n,i){var r=sn();i=i===void 0?null:i;var a=r.memoizedState.inst;kt!==null&&i!==null&&vg(i,kt.memoizedState.deps)?r.memoizedState=vs(e,a,n,i):(je.flags|=t,r.memoizedState=vs(1|e,a,n,i));}function dy(t,e){Jc(8390656,8,t,e);}function Eg(t,e){jf(2048,8,t,e);}function G2(t){je.flags|=4;var e=je.updateQueue;if(e===null)e=Gf(),je.updateQueue=e,e.events=[t];else {var n=e.events;n===null?e.events=[t]:n.push(t);}}function h_(t){var e=sn().memoizedState;return G2({ref:e,nextImpl:t}),function(){if((At&2)!==0)throw Error(Z(440));return e.impl.apply(void 0,arguments)}}function p_(t,e){return jf(4,2,t,e)}function m_(t,e){return jf(4,4,t,e)}function g_(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null);}}if(e!=null)return t=t(),e.current=t,function(){e.current=null;}}function v_(t,e,n){n=n!=null?n.concat([t]):null,jf(4,4,g_.bind(null,e,t),n);}function Mg(){}function A_(t,e){var n=sn();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&vg(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function y_(t,e){var n=sn();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&vg(e,i[1]))return i[0];if(i=t(),io){na(true);try{t();}finally{na(false);}}return n.memoizedState=[i,e],i}function Tg(t,e,n){return n===void 0||(Rr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=sS(),je.lanes|=t,ya|=t,n)}function b_(t,e,n,i){return li(n,e)?n:gs.current!==null?(t=Tg(t,n,i),li(t,e)||(dn=true),t):(Rr&42)===0||(Rr&1073741824)!==0&&(rt&261930)===0?(dn=true,t.memoizedState=n):(t=sS(),je.lanes|=t,ya|=t,e)}function __(t,e,n,i,r){var a=yt.p;yt.p=a!==0&&8>a?a:8;var s=Ve.T,u={};Ve.T=u,Rg(t,false,e,n);try{var d=r(),g=Ve.S;if(g!==null&&g(u,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var v=U2(d,i);kl(t,e,v,si(t));}else kl(t,e,i,si(t));}catch(A){kl(t,e,{then:function(){},status:"rejected",reason:A},si());}finally{yt.p=a,s!==null&&u.types!==null&&(s.types=u.types),Ve.T=s;}}function W2(){}function Rm(t,e,n,i){if(t.tag!==5)throw Error(Z(476));var r=S_(t).queue;__(t,r,e,Qa,n===null?W2:function(){return w_(t),n(i)});}function S_(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Qa,baseState:Qa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:Qa},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function w_(t){var e=S_(t);e.next===null&&(e=t.alternate.memoizedState),kl(t,e.next.queue,{},si());}function Cg(){return Tn(ql)}function E_(){return sn().memoizedState}function M_(){return sn().memoizedState}function j2(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=si();t=ua(n);var i=ca(e,t,n);i!==null&&(jn(i,e,n),Cl(i,e,n)),e={cache:dg()},t.payload=e;return}e=e.return;}}function Y2(t,e,n){var i=si();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null},Yf(t)?C_(e,n):(n=lg(t,e,n,i),n!==null&&(jn(n,t,i),R_(n,e,i)));}function T_(t,e,n){var i=si();kl(t,e,n,i);}function kl(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:false,eagerState:null,next:null};if(Yf(t))C_(e,r);else {var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,u=a(s,n);if(r.hasEagerState=!0,r.eagerState=u,li(u,s))return Hf(t,e,r,0),Pt===null&&Vf(),!1}catch{}if(n=lg(t,e,r,i),n!==null)return jn(n,t,i),R_(n,e,i),true}return false}function Rg(t,e,n,i){if(i={lane:2,revertLane:Bg(),gesture:null,action:i,hasEagerState:false,eagerState:null,next:null},Yf(t)){if(e)throw Error(Z(479))}else e=lg(t,n,i,2),e!==null&&jn(e,t,2);}function Yf(t){var e=t.alternate;return t===je||e!==null&&e===je}function C_(t,e){cs=yf=true;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e;}function R_(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,hb(t,n);}}var Wl={readContext:Tn,use:Wf,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Wl.useEffectEvent=$t;var x_={readContext:Tn,use:Wf,useCallback:function(t,e){return Un().memoizedState=[t,e===void 0?null:e],t},useContext:Tn,useEffect:dy,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Jc(4194308,4,g_.bind(null,e,t),n);},useLayoutEffect:function(t,e){return Jc(4194308,4,t,e)},useInsertionEffect:function(t,e){Jc(4,2,t,e);},useMemo:function(t,e){var n=Un();e=e===void 0?null:e;var i=t();if(io){na(true);try{t();}finally{na(false);}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Un();if(n!==void 0){var r=n(e);if(io){na(true);try{n(e);}finally{na(false);}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=Y2.bind(null,je,t),[i.memoizedState,t]},useRef:function(t){var e=Un();return t={current:t},e.memoizedState=t},useState:function(t){t=Tm(t);var e=t.queue,n=T_.bind(null,je,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Mg,useDeferredValue:function(t,e){var n=Un();return Tg(n,t,e)},useTransition:function(){var t=Tm(false);return t=__.bind(null,je,t.queue,true,false),Un().memoizedState=t,[false,t]},useSyncExternalStore:function(t,e,n){var i=je,r=Un();if(st){if(n===void 0)throw Error(Z(407));n=n();}else {if(n=e(),Pt===null)throw Error(Z(349));(rt&127)!==0||n_(i,e,n);}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,dy(r_.bind(null,i,a,t),[t]),i.flags|=2048,vs(9,{destroy:void 0},i_.bind(null,i,a,n,e),null),n},useId:function(){var t=Un(),e=Pt.identifierPrefix;if(st){var n=Yi,i=ji;n=(i&~(1<<32-oi(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=bf++,0<n&&(e+="H"+n.toString(32)),e+="_";}else n=F2++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Cg,useFormState:uy,useActionState:uy,useOptimistic:function(t){var e=Un();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Rg.bind(null,je,true,n),n.dispatch=e,[t,e]},useMemoCache:Sg,useCacheRefresh:function(){return Un().memoizedState=j2.bind(null,je)},useEffectEvent:function(t){var e=Un(),n={impl:t};return e.memoizedState=n,function(){if((At&2)!==0)throw Error(Z(440));return n.impl.apply(void 0,arguments)}}},xg={readContext:Tn,use:Wf,useCallback:A_,useContext:Tn,useEffect:Eg,useImperativeHandle:v_,useInsertionEffect:p_,useLayoutEffect:m_,useMemo:y_,useReducer:Zc,useRef:d_,useState:function(){return Zc(xr)},useDebugValue:Mg,useDeferredValue:function(t,e){var n=sn();return b_(n,kt.memoizedState,t,e)},useTransition:function(){var t=Zc(xr)[0],e=sn().memoizedState;return [typeof t=="boolean"?t:iu(t),e]},useSyncExternalStore:t_,useId:E_,useHostTransitionStatus:Cg,useFormState:cy,useActionState:cy,useOptimistic:function(t,e){var n=sn();return s_(n,kt,t,e)},useMemoCache:Sg,useCacheRefresh:M_};xg.useEffectEvent=h_;var k_={readContext:Tn,use:Wf,useCallback:A_,useContext:Tn,useEffect:Eg,useImperativeHandle:v_,useInsertionEffect:p_,useLayoutEffect:m_,useMemo:y_,useReducer:Dp,useRef:d_,useState:function(){return Dp(xr)},useDebugValue:Mg,useDeferredValue:function(t,e){var n=sn();return kt===null?Tg(n,t,e):b_(n,kt.memoizedState,t,e)},useTransition:function(){var t=Dp(xr)[0],e=sn().memoizedState;return [typeof t=="boolean"?t:iu(t),e]},useSyncExternalStore:t_,useId:E_,useHostTransitionStatus:Cg,useFormState:fy,useActionState:fy,useOptimistic:function(t,e){var n=sn();return kt!==null?s_(n,kt,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Sg,useCacheRefresh:M_};k_.useEffectEvent=h_;function Bp(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ht({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n);}var xm={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=si(),r=ua(i);r.payload=e,n!=null&&(r.callback=n),e=ca(t,r,i),e!==null&&(jn(e,t,i),Cl(e,t,i));},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=si(),r=ua(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=ca(t,r,i),e!==null&&(jn(e,t,i),Cl(e,t,i));},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=si(),i=ua(n);i.tag=2,e!=null&&(i.callback=e),e=ca(t,i,n),e!==null&&(jn(e,t,n),Cl(e,t,n));}};function hy(t,e,n,i,r,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,s):e.prototype&&e.prototype.isPureReactComponent?!Fl(n,i)||!Fl(r,a):true}function py(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&xm.enqueueReplaceState(e,e.state,null);}function ro(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i]);}if(t=t.defaultProps){n===e&&(n=Ht({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r]);}return n}function O_(t){df(t);}function I_(t){console.error(t);}function P_(t){df(t);}function _f(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack});}catch(i){setTimeout(function(){throw i});}}function my(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null});}catch(r){setTimeout(function(){throw r});}}function km(t,e,n){return n=ua(n),n.tag=3,n.payload={element:null},n.callback=function(){_f(t,e);},n}function N_(t){return t=ua(t),t.tag=3,t}function L_(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){my(e,n,i);};}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){my(e,n,i),typeof r!="function"&&(fa===null?fa=new Set([this]):fa.add(this));var u=i.stack;this.componentDidCatch(i.value,{componentStack:u!==null?u:""});});}function q2(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ms(e,n,r,true),n=ui.current,n!==null){switch(n.tag){case 31:case 13:return wi===null?Tf():n.alternate===null&&en===0&&(en=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===gf?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Xp(t,i,r)),false;case 22:return n.flags|=65536,i===gf?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Xp(t,i,r)),false}throw Error(Z(435,n.tag))}return Xp(t,i,r),Tf(),false}if(st)return e=ui.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==vm&&(t=Error(Z(422),{cause:i}),Hl(_i(t,n)))):(i!==vm&&(e=Error(Z(423),{cause:i}),Hl(_i(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=_i(i,n),r=km(t.stateNode,i,r),Lp(t,r),en!==4&&(en=2)),false;var a=Error(Z(520),{cause:i});if(a=_i(a,n),Pl===null?Pl=[a]:Pl.push(a),en!==4&&(en=2),e===null)return true;i=_i(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=km(n.stateNode,i,t),Lp(n,t),false;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(fa===null||!fa.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=N_(r),L_(r,t,n,i),Lp(n,r),false}n=n.return;}while(n!==null);return false}var kg=Error(Z(461)),dn=false;function wn(t,e,n,i){e.child=t===null?Qb(e,null,n,i):no(e,t.child,n,i);}function gy(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var s={};for(var u in i)u!=="ref"&&(s[u]=i[u]);}else s=i;return to(e),i=Ag(t,e,n,s,a,r),u=yg(),t!==null&&!dn?(bg(t,e,r),kr(t,e,r)):(st&&u&&cg(e),e.flags|=1,wn(t,e,i,r),e.child)}function vy(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!ug(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,D_(t,e,a,i,r)):(t=Qc(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!Og(t,r)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Fl,n(s,i)&&t.ref===e.ref)return kr(t,e,r)}return e.flags|=1,t=Er(a,i),t.ref=e.ref,t.return=e,e.child=t}function D_(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(Fl(a,i)&&t.ref===e.ref)if(dn=false,e.pendingProps=i=a,Og(t,r))(t.flags&131072)!==0&&(dn=true);else return e.lanes=t.lanes,kr(t,e,r)}return Om(t,e,n,i,r)}function B_(t,e,n,i){var r=i.children,a=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a;}else i=0,e.child=null;return Ay(t,e,a,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Kc(e,a!==null?a.cachePool:null),a!==null?oy(e,a):Em(),Jb(e);else return i=e.lanes=536870912,Ay(t,e,a!==null?a.baseLanes|n:n,n,i)}else a!==null?(Kc(e,a.cachePool),oy(e,a),ea(),e.memoizedState=null):(t!==null&&Kc(e,null),Em(),ea());return wn(t,e,r,n),e.child}function _l(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Ay(t,e,n,i,r){var a=hg();return a=a===null?null:{parent:fn._currentValue,pool:a},e.memoizedState={baseLanes:n,cachePool:a},t!==null&&Kc(e,null),Em(),Jb(e),t!==null&&Ms(t,e,i,true),e.childLanes=r,null}function $c(t,e){return e=Sf({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function yy(t,e,n){return no(e,t.child,null,n),t=$c(e,e.pendingProps),t.flags|=2,ti(e),e.memoizedState=null,t}function X2(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(st){if(i.mode==="hidden")return t=$c(e,i),e.lanes=536870912,_l(null,t);if(Mm(e),(t=Vt)?(t=xS(t,Si),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ga!==null?{id:ji,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},n=zb(t),n.return=e,e.child=n,Mn=e,Vt=null)):t=null,t===null)throw va(e);return e.lanes=536870912,null}return $c(e,i)}var a=t.memoizedState;if(a!==null){var s=a.dehydrated;if(Mm(e),r)if(e.flags&256)e.flags&=-257,e=yy(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(Z(558));else if(dn||Ms(t,e,n,false),r=(n&t.childLanes)!==0,dn||r){if(i=Pt,i!==null&&(s=pb(i,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,lo(t,s),jn(i,t,s),kg;Tf(),e=yy(t,e,n);}else t=a.treeContext,Vt=Ei(s.nextSibling),Mn=e,st=true,la=null,Si=false,t!==null&&Wb(e,t),e=$c(e,i),e.flags|=4096;return e}return t=Er(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ef(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else {if(typeof n!="function"&&typeof n!="object")throw Error(Z(284));(t===null||t.ref!==n)&&(e.flags|=4194816);}}function Om(t,e,n,i,r){return to(e),n=Ag(t,e,n,i,void 0,r),i=yg(),t!==null&&!dn?(bg(t,e,r),kr(t,e,r)):(st&&i&&cg(e),e.flags|=1,wn(t,e,n,r),e.child)}function by(t,e,n,i,r,a){return to(e),e.updateQueue=null,n=e_(e,i,n,r),$b(t),i=yg(),t!==null&&!dn?(bg(t,e,a),kr(t,e,a)):(st&&i&&cg(e),e.flags|=1,wn(t,e,n,a),e.child)}function _y(t,e,n,i,r){if(to(e),e.stateNode===null){var a=ts,s=n.contextType;typeof s=="object"&&s!==null&&(a=Tn(s)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xm,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},mg(e),s=n.contextType,a.context=typeof s=="object"&&s!==null?Tn(s):ts,a.state=e.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Bp(e,n,s,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&xm.enqueueReplaceState(a,a.state,null),xl(e,i,a,r),Rl(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=true;}else if(t===null){a=e.stateNode;var u=e.memoizedProps,d=ro(n,u);a.props=d;var g=a.context,v=n.contextType;s=ts,typeof v=="object"&&v!==null&&(s=Tn(v));var A=n.getDerivedStateFromProps;v=typeof A=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=e.pendingProps!==u,v||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||g!==s)&&py(e,a,i,s),Zr=false;var p=e.memoizedState;a.state=p,xl(e,i,a,r),Rl(),g=e.memoizedState,u||p!==g||Zr?(typeof A=="function"&&(Bp(e,n,A,i),g=e.memoizedState),(d=Zr||hy(e,n,d,i,p,g,s))?(v||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=g),a.props=i,a.state=g,a.context=s,i=d):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=false);}else {a=e.stateNode,Sm(t,e),s=e.memoizedProps,v=ro(n,s),a.props=v,A=e.pendingProps,p=a.context,g=n.contextType,d=ts,typeof g=="object"&&g!==null&&(d=Tn(g)),u=n.getDerivedStateFromProps,(g=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==A||p!==d)&&py(e,a,i,d),Zr=false,p=e.memoizedState,a.state=p,xl(e,i,a,r),Rl();var _=e.memoizedState;s!==A||p!==_||Zr||t!==null&&t.dependencies!==null&&mf(t.dependencies)?(typeof u=="function"&&(Bp(e,n,u,i),_=e.memoizedState),(v=Zr||hy(e,n,v,i,p,_,d)||t!==null&&t.dependencies!==null&&mf(t.dependencies))?(g||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,_,d),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,_,d)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=_),a.props=i,a.state=_,a.context=d,i=v):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),i=false);}return a=i,ef(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=no(e,t.child,null,r),e.child=no(e,null,n,r)):wn(t,e,n,r),e.memoizedState=a.state,t=e.child):t=kr(t,e,r),t}function Sy(t,e,n,i){return eo(),e.flags|=256,wn(t,e,n,i),e.child}var Up={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fp(t){return {baseLanes:t,cachePool:Yb()}}function Vp(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=ii),t}function U_(t,e,n){var i=e.pendingProps,r=false,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?false:(on.current&2)!==0),s&&(r=true,e.flags&=-129),s=(e.flags&32)!==0,e.flags&=-33,t===null){if(st){if(r?$r(e):ea(),(t=Vt)?(t=xS(t,Si),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ga!==null?{id:ji,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},n=zb(t),n.return=e,e.child=n,Mn=e,Vt=null)):t=null,t===null)throw va(e);return jm(t)?e.lanes=32:e.lanes=536870912,null}var u=i.children;return i=i.fallback,r?(ea(),r=e.mode,u=Sf({mode:"hidden",children:u},r),i=Ka(i,r,n,null),u.return=e,i.return=e,u.sibling=i,e.child=u,i=e.child,i.memoizedState=Fp(n),i.childLanes=Vp(t,s,n),e.memoizedState=Up,_l(null,i)):($r(e),Im(e,u))}var d=t.memoizedState;if(d!==null&&(u=d.dehydrated,u!==null)){if(a)e.flags&256?($r(e),e.flags&=-257,e=Hp(t,e,n)):e.memoizedState!==null?(ea(),e.child=t.child,e.flags|=128,e=null):(ea(),u=i.fallback,r=e.mode,i=Sf({mode:"visible",children:i.children},r),u=Ka(u,r,n,null),u.flags|=2,i.return=e,u.return=e,i.sibling=u,e.child=i,no(e,t.child,null,n),i=e.child,i.memoizedState=Fp(n),i.childLanes=Vp(t,s,n),e.memoizedState=Up,e=_l(null,i));else if($r(e),jm(u)){if(s=u.nextSibling&&u.nextSibling.dataset,s)var g=s.dgst;s=g,i=Error(Z(419)),i.stack="",i.digest=s,Hl({value:i,source:null,stack:null}),e=Hp(t,e,n);}else if(dn||Ms(t,e,n,false),s=(n&t.childLanes)!==0,dn||s){if(s=Pt,s!==null&&(i=pb(s,n),i!==0&&i!==d.retryLane))throw d.retryLane=i,lo(t,i),jn(s,t,i),kg;Wm(u)||Tf(),e=Hp(t,e,n);}else Wm(u)?(e.flags|=192,e.child=t.child,e=null):(t=d.treeContext,Vt=Ei(u.nextSibling),Mn=e,st=true,la=null,Si=false,t!==null&&Wb(e,t),e=Im(e,i.children),e.flags|=4096);return e}return r?(ea(),u=i.fallback,r=e.mode,d=t.child,g=d.sibling,i=Er(d,{mode:"hidden",children:i.children}),i.subtreeFlags=d.subtreeFlags&65011712,g!==null?u=Er(g,u):(u=Ka(u,r,n,null),u.flags|=2),u.return=e,i.return=e,i.sibling=u,e.child=i,_l(null,i),i=e.child,u=t.child.memoizedState,u===null?u=Fp(n):(r=u.cachePool,r!==null?(d=fn._currentValue,r=r.parent!==d?{parent:d,pool:d}:r):r=Yb(),u={baseLanes:u.baseLanes|n,cachePool:r}),i.memoizedState=u,i.childLanes=Vp(t,s,n),e.memoizedState=Up,_l(t.child,i)):($r(e),n=t.child,t=n.sibling,n=Er(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(s=e.deletions,s===null?(e.deletions=[t],e.flags|=16):s.push(t)),e.child=n,e.memoizedState=null,n)}function Im(t,e){return e=Sf({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Sf(t,e){return t=ni(22,t,null,e),t.lanes=0,t}function Hp(t,e,n){return no(e,t.child,null,n),t=Im(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function wy(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),ym(t.return,e,n);}function zp(t,e,n,i,r,a){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r,s.treeForkCount=a);}function F_(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var s=on.current,u=(s&2)!==0;if(u?(s=s&1|2,e.flags|=128):s&=1,Lt(on,s),wn(t,e,i,n),i=st?Vl:0,!u&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&wy(t,n,e);else if(t.tag===19)wy(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return;}t.sibling.return=t.return,t=t.sibling;}switch(r){case "forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Af(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),zp(e,false,r,n,a,i);break;case "backwards":case "unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Af(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t;}zp(e,true,n,null,a,i);break;case "together":zp(e,false,null,null,void 0,i);break;default:e.memoizedState=null;}return e.child}function kr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ya|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ms(t,e,n,false),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(Z(153));if(e.child!==null){for(t=e.child,n=Er(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Er(t,t.pendingProps),n.return=e;n.sibling=null;}return e.child}function Og(t,e){return (t.lanes&e)!==0?true:(t=t.dependencies,!!(t!==null&&mf(t)))}function Q2(t,e,n){switch(e.tag){case 3:lf(e,e.stateNode.containerInfo),Jr(e,fn,t.memoizedState.cache),eo();break;case 27:case 5:om(e);break;case 4:lf(e,e.stateNode.containerInfo);break;case 10:Jr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Mm(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?($r(e),e.flags|=128,null):(n&e.child.childLanes)!==0?U_(t,e,n):($r(e),t=kr(t,e,n),t!==null?t.sibling:null);$r(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ms(t,e,n,false),i=(n&e.childLanes)!==0),r){if(i)return F_(t,e,n);e.flags|=128;}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Lt(on,on.current),i)break;return null;case 22:return e.lanes=0,B_(t,e,n,e.pendingProps);case 24:Jr(e,fn,t.memoizedState.cache);}return kr(t,e,n)}function V_(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)dn=true;else {if(!Og(t,n)&&(e.flags&128)===0)return dn=false,Q2(t,e,n);dn=(t.flags&131072)!==0;}else dn=false,st&&(e.flags&1048576)!==0&&Gb(e,Vl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=qa(e.elementType),e.type=t,typeof t=="function")ug(t)?(i=ro(t,i),e.tag=1,e=_y(null,e,t,i,n)):(e.tag=0,e=Om(null,e,t,i,n));else {if(t!=null){var r=t.$$typeof;if(r===Qm){e.tag=11,e=gy(null,e,t,i,n);break e}else if(r===Km){e.tag=14,e=vy(null,e,t,i,n);break e}}throw e=rm(t)||t,Error(Z(306,e,""))}}return e;case 0:return Om(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=ro(i,e.pendingProps),_y(t,e,i,r,n);case 3:e:{if(lf(e,e.stateNode.containerInfo),t===null)throw Error(Z(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,Sm(t,e),xl(e,i,null,n);var s=e.memoizedState;if(i=s.cache,Jr(e,fn,i),i!==a.cache&&bm(e,[fn],n,true),Rl(),i=s.element,a.isDehydrated)if(a={element:i,isDehydrated:false,cache:s.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=Sy(t,e,i,n);break e}else if(i!==r){r=_i(Error(Z(424)),e),Hl(r),e=Sy(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Vt=Ei(t.firstChild),Mn=e,st=true,la=null,Si=true,n=Qb(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else {if(eo(),i===r){e=kr(t,e,n);break e}wn(t,e,i,n);}e=e.child;}return e;case 26:return ef(t,e),t===null?(n=jy(e.type,null,e.pendingProps,null))?e.memoizedState=n:st||(n=e.type,t=e.pendingProps,i=kf(sa.current).createElement(n),i[En]=e,i[Yn]=t,Cn(i,n,t),_n(i),e.stateNode=i):e.memoizedState=jy(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return om(e),t===null&&st&&(i=e.stateNode=kS(e.type,e.pendingProps,sa.current),Mn=e,Si=true,r=Vt,_a(e.type)?(Ym=r,Vt=Ei(i.firstChild)):Vt=r),wn(t,e,e.pendingProps.children,n),ef(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&st&&((r=i=Vt)&&(i=wR(i,e.type,e.pendingProps,Si),i!==null?(e.stateNode=i,Mn=e,Vt=Ei(i.firstChild),Si=false,r=true):r=false),r||va(e)),om(e),r=e.type,a=e.pendingProps,s=t!==null?t.memoizedProps:null,i=a.children,zm(r,a)?i=null:s!==null&&zm(r,s)&&(e.flags|=32),e.memoizedState!==null&&(r=Ag(t,e,V2,null,null,n),ql._currentValue=r),ef(t,e),wn(t,e,i,n),e.child;case 6:return t===null&&st&&((t=n=Vt)&&(n=ER(n,e.pendingProps,Si),n!==null?(e.stateNode=n,Mn=e,Vt=null,t=true):t=false),t||va(e)),null;case 13:return U_(t,e,n);case 4:return lf(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=no(e,null,i,n):wn(t,e,i,n),e.child;case 11:return gy(t,e,e.type,e.pendingProps,n);case 7:return wn(t,e,e.pendingProps,n),e.child;case 8:return wn(t,e,e.pendingProps.children,n),e.child;case 12:return wn(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Jr(e,e.type,i.value),wn(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,to(e),r=Tn(r),i=i(r),e.flags|=1,wn(t,e,i,n),e.child;case 14:return vy(t,e,e.type,e.pendingProps,n);case 15:return D_(t,e,e.type,e.pendingProps,n);case 19:return F_(t,e,n);case 31:return X2(t,e,n);case 22:return B_(t,e,n,e.pendingProps);case 24:return to(e),i=Tn(fn),t===null?(r=hg(),r===null&&(r=Pt,a=dg(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},mg(e),Jr(e,fn,r)):((t.lanes&n)!==0&&(Sm(t,e),xl(e,null,null,n),Rl()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Jr(e,fn,i)):(i=a.cache,Jr(e,fn,i),i!==r.cache&&bm(e,[fn],n,true))),wn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(Z(156,e.tag))}function mr(t){t.flags|=4;}function Gp(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=false),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(cS())t.flags|=8192;else throw Ja=gf,pg}else t.flags&=-16777217;}function Ey(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!PS(e))if(cS())t.flags|=8192;else throw Ja=gf,pg}function Uc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?fb():536870912,t.lanes|=e,As|=e);}function pl(t,e){if(!st)switch(t.tailMode){case "hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case "collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null;}}function Ft(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function K2(t,e,n){var i=e.pendingProps;switch(fg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(e),null;case 1:return Ft(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Mr(fn),ds(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Go(e)?mr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Np())),Ft(e),null;case 26:var r=e.type,a=e.memoizedState;return t===null?(mr(e),a!==null?(Ft(e),Ey(e,a)):(Ft(e),Gp(e,r,null,i,n))):a?a!==t.memoizedState?(mr(e),Ft(e),Ey(e,a)):(Ft(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&mr(e),Ft(e),Gp(e,r,t,i,n)),null;case 27:if(uf(e),n=sa.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&mr(e);else {if(!i){if(e.stateNode===null)throw Error(Z(166));return Ft(e),null}t=Xi.current,Go(e)?$0(e):(t=kS(r,i,n),e.stateNode=t,mr(e));}return Ft(e),null;case 5:if(uf(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&mr(e);else {if(!i){if(e.stateNode===null)throw Error(Z(166));return Ft(e),null}if(a=Xi.current,Go(e))$0(e);else {var s=kf(sa.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case "svg":a=s.createElementNS("http://www.w3.org/2000/svg",r);break;case "math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case "script":a=s.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case "select":a=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?a.multiple=true:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?s.createElement(r,{is:i.is}):s.createElement(r);}}a[En]=e,a[Yn]=i;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return;}s.sibling.return=s.return,s=s.sibling;}e.stateNode=a;e:switch(Cn(a,r,i),r){case "button":case "input":case "select":case "textarea":i=!!i.autoFocus;break e;case "img":i=true;break e;default:i=false;}i&&mr(e);}}return Ft(e),Gp(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&mr(e);else {if(typeof i!="string"&&e.stateNode===null)throw Error(Z(166));if(t=sa.current,Go(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Mn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps;}t[En]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===true||TS(t.nodeValue,n)),t||va(e,true);}else t=kf(t).createTextNode(i),t[En]=e,e.stateNode=t;}return Ft(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=Go(e),n!==null){if(t===null){if(!i)throw Error(Z(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Z(557));t[En]=e;}else eo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ft(e),t=false;}else n=Np(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=true;if(!t)return e.flags&256?(ti(e),e):(ti(e),null);if((e.flags&128)!==0)throw Error(Z(558))}return Ft(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Go(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(Z(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Z(317));r[En]=e;}else eo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ft(e),r=false;}else r=Np(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=true;if(!r)return e.flags&256?(ti(e),e):(ti(e),null)}return ti(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Uc(e,e.updateQueue),Ft(e),null);case 4:return ds(),t===null&&Ug(e.stateNode.containerInfo),Ft(e),null;case 10:return Mr(e.type),Ft(e),null;case 19:if(Sn(on),i=e.memoizedState,i===null)return Ft(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)pl(i,false);else {if(en!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=Af(t),a!==null){for(e.flags|=128,pl(i,false),t=a.updateQueue,e.updateQueue=t,Uc(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Hb(n,t),n=n.sibling;return Lt(on,on.current&1|2),st&&yr(e,i.treeForkCount),e.child}t=t.sibling;}i.tail!==null&&ri()>Ef&&(e.flags|=128,r=true,pl(i,false),e.lanes=4194304);}else {if(!r)if(t=Af(a),t!==null){if(e.flags|=128,r=true,t=t.updateQueue,e.updateQueue=t,Uc(e,t),pl(i,true),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!st)return Ft(e),null}else 2*ri()-i.renderingStartTime>Ef&&n!==536870912&&(e.flags|=128,r=true,pl(i,false),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a);}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ri(),t.sibling=null,n=on.current,Lt(on,r?n&1|2:n&1),st&&yr(e,i.treeForkCount),t):(Ft(e),null);case 22:case 23:return ti(e),gg(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Ft(e),e.subtreeFlags&6&&(e.flags|=8192)):Ft(e),n=e.updateQueue,n!==null&&Uc(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&Sn(Za),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Mr(fn),Ft(e),null;case 25:return null;case 30:return null}throw Error(Z(156,e.tag))}function Z2(t,e){switch(fg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Mr(fn),ds(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return uf(e),null;case 31:if(e.memoizedState!==null){if(ti(e),e.alternate===null)throw Error(Z(340));eo();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ti(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Z(340));eo();}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(on),null;case 4:return ds(),null;case 10:return Mr(e.type),null;case 22:case 23:return ti(e),gg(),t!==null&&Sn(Za),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Mr(fn),null;case 25:return null;default:return null}}function H_(t,e){switch(fg(e),e.tag){case 3:Mr(fn),ds();break;case 26:case 27:case 5:uf(e);break;case 4:ds();break;case 31:e.memoizedState!==null&&ti(e);break;case 13:ti(e);break;case 19:Sn(on);break;case 10:Mr(e.type);break;case 22:case 23:ti(e),gg(),t!==null&&Sn(Za);break;case 24:Mr(fn);}}function ru(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i;}n=n.next;}while(n!==r)}}catch(u){Mt(e,e.return,u);}}function Aa(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var s=i.inst,u=s.destroy;if(u!==void 0){s.destroy=void 0,r=e;var d=n,g=u;try{g();}catch(v){Mt(r,d,v);}}}i=i.next;}while(i!==a)}}catch(v){Mt(e,e.return,v);}}function z_(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Zb(e,n);}catch(i){Mt(t,t.return,i);}}}function G_(t,e,n){n.props=ro(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount();}catch(i){Mt(t,e,i);}}function Ol(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode;}typeof n=="function"?t.refCleanup=n(i):n.current=i;}}catch(r){Mt(t,e,r);}}function qi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i();}catch(r){Mt(t,e,r);}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null);}else if(typeof n=="function")try{n(null);}catch(r){Mt(t,e,r);}else n.current=null;}function W_(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case "button":case "input":case "select":case "textarea":n.autoFocus&&i.focus();break e;case "img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet);}}catch(r){Mt(t,t.return,r);}}function Wp(t,e,n){try{var i=t.stateNode;vR(i,t.type,n,e),i[Yn]=e;}catch(r){Mt(t,t.return,r);}}function j_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_a(t.type)||t.tag===4}function jp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||j_(t.return))return null;t=t.return;}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&_a(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child;}if(!(t.flags&2))return t.stateNode}}function Pm(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sr));else if(i!==4&&(i===27&&_a(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Pm(t,e,n),t=t.sibling;t!==null;)Pm(t,e,n),t=t.sibling;}function wf(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&_a(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(wf(t,e,n),t=t.sibling;t!==null;)wf(t,e,n),t=t.sibling;}function Y_(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Cn(e,i,n),e[En]=t,e[Yn]=n;}catch(a){Mt(t,t.return,a);}}var br=false,cn=false,Yp=false,My=typeof WeakSet=="function"?WeakSet:Set,bn=null;function J2(t,e){if(t=t.containerInfo,Vm=Nf,t=Pb(t),og(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType;}catch{n=null;break e}var s=0,u=-1,d=-1,g=0,v=0,A=t,p=null;t:for(;;){for(var _;A!==n||r!==0&&A.nodeType!==3||(u=s+r),A!==a||i!==0&&A.nodeType!==3||(d=s+i),A.nodeType===3&&(s+=A.nodeValue.length),(_=A.firstChild)!==null;)p=A,A=_;for(;;){if(A===t)break t;if(p===n&&++g===r&&(u=s),p===a&&++v===i&&(d=s),(_=A.nextSibling)!==null)break;A=p,p=A.parentNode;}A=_;}n=u===-1||d===-1?null:{start:u,end:d};}else n=null;}n=n||{start:0,end:0};}else n=null;for(Hm={focusedElem:t,selectionRange:n},Nf=false,bn=e;bn!==null;)if(e=bn,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,bn=t;else for(;bn!==null;){switch(e=bn,a=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var T=ro(n.type,r);t=i.getSnapshotBeforeUpdate(T,a),i.__reactInternalSnapshotBeforeUpdate=t;}catch(x){Mt(n,n.return,x);}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Gm(t);else if(n===1)switch(t.nodeName){case "HEAD":case "HTML":case "BODY":Gm(t);break;default:t.textContent="";}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(Z(163))}if(t=e.sibling,t!==null){t.return=e.return,bn=t;break}bn=e.return;}}function q_(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:vr(t,n),i&4&&ru(5,n);break;case 1:if(vr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount();}catch(s){Mt(n,n.return,s);}else {var r=ro(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate);}catch(s){Mt(n,n.return,s);}}i&64&&z_(n),i&512&&Ol(n,n.return);break;case 3:if(vr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode;}try{Zb(t,e);}catch(s){Mt(n,n.return,s);}}break;case 27:e===null&&i&4&&Y_(n);case 26:case 5:vr(t,n),e===null&&i&4&&W_(n),i&512&&Ol(n,n.return);break;case 12:vr(t,n);break;case 31:vr(t,n),i&4&&K_(t,n);break;case 13:vr(t,n),i&4&&Z_(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=sR.bind(null,n),MR(t,n))));break;case 22:if(i=n.memoizedState!==null||br,!i){e=e!==null&&e.memoizedState!==null||cn,r=br;var a=cn;br=i,(cn=e)&&!a?Ar(t,n,(n.subtreeFlags&8772)!==0):vr(t,n),br=r,cn=a;}break;case 30:break;default:vr(t,n);}}function X_(t){var e=t.alternate;e!==null&&(t.alternate=null,X_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&eg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null;}var Kt=null,Gn=false;function gr(t,e,n){for(n=n.child;n!==null;)Q_(t,e,n),n=n.sibling;}function Q_(t,e,n){if(ai&&typeof ai.onCommitFiberUnmount=="function")try{ai.onCommitFiberUnmount(Zl,n);}catch{}switch(n.tag){case 26:cn||qi(n,e),gr(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cn||qi(n,e);var i=Kt,r=Gn;_a(n.type)&&(Kt=n.stateNode,Gn=false),gr(t,e,n),Ll(n.stateNode),Kt=i,Gn=r;break;case 5:cn||qi(n,e);case 6:if(i=Kt,r=Gn,Kt=null,gr(t,e,n),Kt=i,Gn=r,Kt!==null)if(Gn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(n.stateNode);}catch(a){Mt(n,e,a);}else try{Kt.removeChild(n.stateNode);}catch(a){Mt(n,e,a);}break;case 18:Kt!==null&&(Gn?(t=Kt,Vy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Ss(t)):Vy(Kt,n.stateNode));break;case 4:i=Kt,r=Gn,Kt=n.stateNode.containerInfo,Gn=true,gr(t,e,n),Kt=i,Gn=r;break;case 0:case 11:case 14:case 15:Aa(2,n,e),cn||Aa(4,n,e),gr(t,e,n);break;case 1:cn||(qi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&G_(n,e,i)),gr(t,e,n);break;case 21:gr(t,e,n);break;case 22:cn=(i=cn)||n.memoizedState!==null,gr(t,e,n),cn=i;break;default:gr(t,e,n);}}function K_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ss(t);}catch(n){Mt(e,e.return,n);}}}function Z_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ss(t);}catch(n){Mt(e,e.return,n);}}function $2(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new My),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new My),e;default:throw Error(Z(435,t.tag))}}function Fc(t,e){var n=$2(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=lR.bind(null,t,i);i.then(r,r);}});}function Hn(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,s=e,u=s;e:for(;u!==null;){switch(u.tag){case 27:if(_a(u.type)){Kt=u.stateNode,Gn=false;break e}break;case 5:Kt=u.stateNode,Gn=false;break e;case 3:case 4:Kt=u.stateNode.containerInfo,Gn=true;break e}u=u.return;}if(Kt===null)throw Error(Z(160));Q_(a,s,r),Kt=null,Gn=false,a=r.alternate,a!==null&&(a.return=null),r.return=null;}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)J_(e,t),e=e.sibling;}var Ni=null;function J_(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Hn(e,t),zn(t),i&4&&(Aa(3,t,t.return),ru(3,t),Aa(5,t,t.return));break;case 1:Hn(e,t),zn(t),i&512&&(cn||n===null||qi(n,n.return)),i&64&&br&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Ni;if(Hn(e,t),zn(t),i&512&&(cn||n===null||qi(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case "title":a=r.getElementsByTagName("title")[0],(!a||a[eu]||a[En]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),Cn(a,i,n),a[En]=t,_n(a),i=a;break e;case "link":var s=qy("link","href",r).get(i+(n.href||""));if(s){for(var u=0;u<s.length;u++)if(a=s[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(u,1);break t}}a=r.createElement(i),Cn(a,i,n),r.head.appendChild(a);break;case "meta":if(s=qy("meta","content",r).get(i+(n.content||""))){for(u=0;u<s.length;u++)if(a=s[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(u,1);break t}}a=r.createElement(i),Cn(a,i,n),r.head.appendChild(a);break;default:throw Error(Z(468,i))}a[En]=t,_n(a),i=a;}t.stateNode=i;}else Xy(r,t.type,t.stateNode);else t.stateNode=Yy(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?Xy(r,t.type,t.stateNode):Yy(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Wp(t,t.memoizedProps,n.memoizedProps);}break;case 27:Hn(e,t),zn(t),i&512&&(cn||n===null||qi(n,n.return)),n!==null&&i&4&&Wp(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Hn(e,t),zn(t),i&512&&(cn||n===null||qi(n,n.return)),t.flags&32){r=t.stateNode;try{ps(r,"");}catch(T){Mt(t,t.return,T);}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Wp(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Yp=true);break;case 6:if(Hn(e,t),zn(t),i&4){if(t.stateNode===null)throw Error(Z(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i;}catch(T){Mt(t,t.return,T);}}break;case 3:if(rf=null,r=Ni,Ni=Of(e.containerInfo),Hn(e,t),Ni=r,zn(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ss(e.containerInfo);}catch(T){Mt(t,t.return,T);}Yp&&(Yp=false,$_(t));break;case 4:i=Ni,Ni=Of(t.stateNode.containerInfo),Hn(e,t),zn(t),Ni=i;break;case 12:Hn(e,t),zn(t);break;case 31:Hn(e,t),zn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Fc(t,i)));break;case 13:Hn(e,t),zn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qf=ri()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Fc(t,i)));break;case 22:r=t.memoizedState!==null;var d=n!==null&&n.memoizedState!==null,g=br,v=cn;if(br=g||r,cn=v||d,Hn(e,t),cn=v,br=g,zn(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||d||br||cn||Xa(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){d=n=e;try{if(a=d.stateNode,r)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else {u=d.stateNode;var A=d.memoizedProps.style,p=A!=null&&A.hasOwnProperty("display")?A.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim();}}catch(T){Mt(d,d.return,T);}}}else if(e.tag===6){if(n===null){d=e;try{d.stateNode.nodeValue=r?"":d.memoizedProps;}catch(T){Mt(d,d.return,T);}}}else if(e.tag===18){if(n===null){d=e;try{var _=d.stateNode;r?Hy(_,!0):Hy(d.stateNode,!1);}catch(T){Mt(d,d.return,T);}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return;}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling;}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Fc(t,n))));break;case 19:Hn(e,t),zn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Fc(t,i)));break;case 30:break;case 21:break;default:Hn(e,t),zn(t);}}function zn(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(j_(i)){n=i;break}i=i.return;}if(n==null)throw Error(Z(160));switch(n.tag){case 27:var r=n.stateNode,a=jp(t);wf(t,a,r);break;case 5:var s=n.stateNode;n.flags&32&&(ps(s,""),n.flags&=-33);var u=jp(t);wf(t,u,s);break;case 3:case 4:var d=n.stateNode.containerInfo,g=jp(t);Pm(t,g,d);break;default:throw Error(Z(161))}}catch(v){Mt(t,t.return,v);}t.flags&=-3;}e&4096&&(t.flags&=-4097);}function $_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;$_(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling;}}function vr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)q_(t,e.alternate,e),e=e.sibling;}function Xa(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Aa(4,e,e.return),Xa(e);break;case 1:qi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&G_(e,e.return,n),Xa(e);break;case 27:Ll(e.stateNode);case 26:case 5:qi(e,e.return),Xa(e);break;case 22:e.memoizedState===null&&Xa(e);break;case 30:Xa(e);break;default:Xa(e);}t=t.sibling;}}function Ar(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,s=a.flags;switch(a.tag){case 0:case 11:case 15:Ar(r,a,n),ru(4,a);break;case 1:if(Ar(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount();}catch(g){Mt(i,i.return,g);}if(i=a,r=i.updateQueue,r!==null){var u=i.stateNode;try{var d=r.shared.hiddenCallbacks;if(d!==null)for(r.shared.hiddenCallbacks=null,r=0;r<d.length;r++)Kb(d[r],u);}catch(g){Mt(i,i.return,g);}}n&&s&64&&z_(a),Ol(a,a.return);break;case 27:Y_(a);case 26:case 5:Ar(r,a,n),n&&i===null&&s&4&&W_(a),Ol(a,a.return);break;case 12:Ar(r,a,n);break;case 31:Ar(r,a,n),n&&s&4&&K_(r,a);break;case 13:Ar(r,a,n),n&&s&4&&Z_(r,a);break;case 22:a.memoizedState===null&&Ar(r,a,n),Ol(a,a.return);break;case 30:break;default:Ar(r,a,n);}e=e.sibling;}}function Ig(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&nu(n));}function Pg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&nu(t));}function Pi(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)eS(t,e,n,i),e=e.sibling;}function eS(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Pi(t,e,n,i),r&2048&&ru(9,e);break;case 1:Pi(t,e,n,i);break;case 3:Pi(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&nu(t)));break;case 12:if(r&2048){Pi(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,s=a.id,u=a.onPostCommit;typeof u=="function"&&u(s,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0);}catch(d){Mt(e,e.return,d);}}else Pi(t,e,n,i);break;case 31:Pi(t,e,n,i);break;case 13:Pi(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,s=e.alternate,e.memoizedState!==null?a._visibility&2?Pi(t,e,n,i):Il(t,e):a._visibility&2?Pi(t,e,n,i):(a._visibility|=2,jo(t,e,n,i,(e.subtreeFlags&10256)!==0||false)),r&2048&&Ig(s,e);break;case 24:Pi(t,e,n,i),r&2048&&Pg(e.alternate,e);break;default:Pi(t,e,n,i);}}function jo(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||false),e=e.child;e!==null;){var a=t,s=e,u=n,d=i,g=s.flags;switch(s.tag){case 0:case 11:case 15:jo(a,s,u,d,r),ru(8,s);break;case 23:break;case 22:var v=s.stateNode;s.memoizedState!==null?v._visibility&2?jo(a,s,u,d,r):Il(a,s):(v._visibility|=2,jo(a,s,u,d,r)),r&&g&2048&&Ig(s.alternate,s);break;case 24:jo(a,s,u,d,r),r&&g&2048&&Pg(s.alternate,s);break;default:jo(a,s,u,d,r);}e=e.sibling;}}function Il(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Il(n,i),r&2048&&Ig(i.alternate,i);break;case 24:Il(n,i),r&2048&&Pg(i.alternate,i);break;default:Il(n,i);}e=e.sibling;}}var Sl=8192;function Wo(t,e,n){if(t.subtreeFlags&Sl)for(t=t.child;t!==null;)tS(t,e,n),t=t.sibling;}function tS(t,e,n){switch(t.tag){case 26:Wo(t,e,n),t.flags&Sl&&t.memoizedState!==null&&BR(n,Ni,t.memoizedState,t.memoizedProps);break;case 5:Wo(t,e,n);break;case 3:case 4:var i=Ni;Ni=Of(t.stateNode.containerInfo),Wo(t,e,n),Ni=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=Sl,Sl=16777216,Wo(t,e,n),Sl=i):Wo(t,e,n));break;default:Wo(t,e,n);}}function nS(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function ml(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];bn=i,rS(i,t);}nS(t);}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iS(t),t=t.sibling;}function iS(t){switch(t.tag){case 0:case 11:case 15:ml(t),t.flags&2048&&Aa(9,t,t.return);break;case 3:ml(t);break;case 12:ml(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,tf(t)):ml(t);break;default:ml(t);}}function tf(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];bn=i,rS(i,t);}nS(t);}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Aa(8,e,e.return),tf(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,tf(e));break;default:tf(e);}t=t.sibling;}}function rS(t,e){for(;bn!==null;){var n=bn;switch(n.tag){case 0:case 11:case 15:Aa(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++;}break;case 24:nu(n.memoizedState.cache);}if(i=n.child,i!==null)i.return=n,bn=i;else e:for(n=t;bn!==null;){i=bn;var r=i.sibling,a=i.return;if(X_(i),i===n){bn=null;break e}if(r!==null){r.return=a,bn=r;break e}bn=a;}}}var eR={getCacheForType:function(t){var e=Tn(fn),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Tn(fn).controller.signal}},tR=typeof WeakMap=="function"?WeakMap:Map,At=0,Pt=null,nt=null,rt=0,Et=0,ei=null,ra=false,Cs=false,Ng=false,Or=0,en=0,ya=0,$a=0,Lg=0,ii=0,As=0,Pl=null,Wn=null,Nm=false,qf=0,aS=0,Ef=1/0,Mf=null,fa=null,pn=0,da=null,ys=null,Tr=0,Lm=0,Dm=null,oS=null,Nl=0,Bm=null;function si(){return (At&2)!==0&&rt!==0?rt&-rt:Ve.T!==null?Bg():mb()}function sS(){if(ii===0)if((rt&536870912)===0||st){var t=xc;xc<<=1,(xc&3932160)===0&&(xc=262144),ii=t;}else ii=536870912;return t=ui.current,t!==null&&(t.flags|=32),ii}function jn(t,e,n){(t===Pt&&(Et===2||Et===9)||t.cancelPendingCommit!==null)&&(bs(t,0),aa(t,rt,ii,false)),$l(t,n),((At&2)===0||t!==Pt)&&(t===Pt&&((At&2)===0&&($a|=n),en===4&&aa(t,rt,ii,false)),Ki(t));}function lS(t,e,n){if((At&6)!==0)throw Error(Z(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Jl(t,e),r=i?rR(t,e):qp(t,e,true),a=i;do{if(r===0){Cs&&!i&&aa(t,e,0,false);break}else {if(n=t.current.alternate,a&&!nR(n)){r=qp(t,e,false),a=false;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var s=0;else s=t.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){e=s;e:{var u=t;r=Pl;var d=u.current.memoizedState.isDehydrated;if(d&&(bs(u,s).flags|=256),s=qp(u,s,false),s!==2){if(Ng&&!d){u.errorRecoveryDisabledLanes|=a,$a|=a,r=4;break e}a=Wn,Wn=r,a!==null&&(Wn===null?Wn=a:Wn.push.apply(Wn,a));}r=s;}if(a=false,r!==2)continue}}if(r===1){bs(t,0),aa(t,e,0,true);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(Z(345));case 4:if((e&4194048)!==e)break;case 6:aa(i,e,ii,!ra);break e;case 2:Wn=null;break;case 3:case 5:break;default:throw Error(Z(329))}if((e&62914560)===e&&(r=qf+300-ri(),10<r)){if(aa(i,e,ii,!ra),Df(i,0,true)!==0)break e;Tr=e,i.timeoutHandle=RS(Ty.bind(null,i,n,Wn,Mf,Nm,e,ii,$a,As,ra,a,"Throttled",-0,0),r);break e}Ty(i,n,Wn,Mf,Nm,e,ii,$a,As,ra,a,null,-0,0);}}break}while(true);Ki(t);}function Ty(t,e,n,i,r,a,s,u,d,g,v,A,p,_){if(t.timeoutHandle=-1,A=e.subtreeFlags,A&8192||(A&16785408)===16785408){A={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:true,waitingForViewTransition:false,unsuspend:Sr},tS(e,a,A);var T=(a&62914560)===a?qf-ri():(a&4194048)===a?aS-ri():0;if(T=UR(A,T),T!==null){Tr=a,t.cancelPendingCommit=T(Ry.bind(null,t,e,a,n,i,r,s,u,d,v,A,null,p,_)),aa(t,a,s,!g);return}}Ry(t,e,a,n,i,r,s,u,d);}function nR(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!li(a(),r))return !1}catch{return false}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else {if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return true;e=e.return;}e.sibling.return=e.return,e=e.sibling;}}return true}function aa(t,e,n,i){e&=~Lg,e&=~$a,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-oi(r),s=1<<a;i[a]=-1,r&=~s;}n!==0&&db(t,n,e);}function Xf(){return (At&6)===0?(au(0),false):true}function Dg(){if(nt!==null){if(Et===0)var t=nt.return;else t=nt,wr=uo=null,_g(t),us=null,zl=0,t=nt;for(;t!==null;)H_(t.alternate,t),t=t.return;nt=null;}}function bs(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,bR(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Tr=0,Dg(),Pt=t,nt=n=Er(t.current,null),rt=e,Et=0,ei=null,ra=false,Cs=Jl(t,e),Ng=false,As=ii=Lg=$a=ya=en=0,Wn=Pl=null,Nm=false,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-oi(i),a=1<<r;e|=t[r],i&=~a;}return Or=e,Vf(),n}function uS(t,e){je=null,Ve.H=Wl,e===Ts||e===zf?(e=ry(),Et=3):e===pg?(e=ry(),Et=4):Et=e===kg?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ei=e,nt===null&&(en=1,_f(t,_i(e,t.current)));}function cS(){var t=ui.current;return t===null?true:(rt&4194048)===rt?wi===null:(rt&62914560)===rt||(rt&536870912)!==0?t===wi:false}function fS(){var t=Ve.H;return Ve.H=Wl,t===null?Wl:t}function dS(){var t=Ve.A;return Ve.A=eR,t}function Tf(){en=4,ra||(rt&4194048)!==rt&&ui.current!==null||(Cs=true),(ya&134217727)===0&&($a&134217727)===0||Pt===null||aa(Pt,rt,ii,false);}function qp(t,e,n){var i=At;At|=2;var r=fS(),a=dS();(Pt!==t||rt!==e)&&(Mf=null,bs(t,e)),e=false;var s=en;e:do try{if(Et!==0&&nt!==null){var u=nt,d=ei;switch(Et){case 8:Dg(),s=6;break e;case 3:case 2:case 9:case 6:ui.current===null&&(e=!0);var g=Et;if(Et=0,ei=null,rs(t,u,d,g),n&&Cs){s=0;break e}break;default:g=Et,Et=0,ei=null,rs(t,u,d,g);}}iR(),s=en;break}catch(v){uS(t,v);}while(true);return e&&t.shellSuspendCounter++,wr=uo=null,At=i,Ve.H=r,Ve.A=a,nt===null&&(Pt=null,rt=0,Vf()),s}function iR(){for(;nt!==null;)hS(nt);}function rR(t,e){var n=At;At|=2;var i=fS(),r=dS();Pt!==t||rt!==e?(Mf=null,Ef=ri()+500,bs(t,e)):Cs=Jl(t,e);e:do try{if(Et!==0&&nt!==null){e=nt;var a=ei;t:switch(Et){case 1:Et=0,ei=null,rs(t,e,a,1);break;case 2:case 9:if(iy(a)){Et=0,ei=null,Cy(e);break}e=function(){Et!==2&&Et!==9||Pt!==t||(Et=7),Ki(t);},a.then(e,e);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:iy(a)?(Et=0,ei=null,Cy(e)):(Et=0,ei=null,rs(t,e,a,7));break;case 5:var s=null;switch(nt.tag){case 26:s=nt.memoizedState;case 5:case 27:var u=nt;if(s?PS(s):u.stateNode.complete){Et=0,ei=null;var d=u.sibling;if(d!==null)nt=d;else {var g=u.return;g!==null?(nt=g,Qf(g)):nt=null;}break t}}Et=0,ei=null,rs(t,e,a,5);break;case 6:Et=0,ei=null,rs(t,e,a,6);break;case 8:Dg(),en=6;break e;default:throw Error(Z(462))}}aR();break}catch(v){uS(t,v);}while(true);return wr=uo=null,Ve.H=i,Ve.A=r,At=n,nt!==null?0:(Pt=null,rt=0,Vf(),en)}function aR(){for(;nt!==null&&!RC();)hS(nt);}function hS(t){var e=V_(t.alternate,t,Or);t.memoizedProps=t.pendingProps,e===null?Qf(t):nt=e;}function Cy(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=by(n,e,e.pendingProps,e.type,void 0,rt);break;case 11:e=by(n,e,e.pendingProps,e.type.render,e.ref,rt);break;case 5:_g(e);default:H_(n,e),e=nt=Hb(e,Or),e=V_(n,e,Or);}t.memoizedProps=t.pendingProps,e===null?Qf(t):nt=e;}function rs(t,e,n,i){wr=uo=null,_g(e),us=null,zl=0;var r=e.return;try{if(q2(t,r,e,n,rt)){en=1,_f(t,_i(n,t.current)),nt=null;return}}catch(a){if(r!==null)throw nt=r,a;en=1,_f(t,_i(n,t.current)),nt=null;return}e.flags&32768?(st||i===1?t=true:Cs||(rt&536870912)!==0?t=false:(ra=t=true,(i===2||i===9||i===3||i===6)&&(i=ui.current,i!==null&&i.tag===13&&(i.flags|=16384))),pS(e,t)):Qf(e);}function Qf(t){var e=t;do{if((e.flags&32768)!==0){pS(e,ra);return}t=e.return;var n=K2(e.alternate,e,Or);if(n!==null){nt=n;return}if(e=e.sibling,e!==null){nt=e;return}nt=e=t;}while(e!==null);en===0&&(en=5);}function pS(t,e){do{var n=Z2(t.alternate,t);if(n!==null){n.flags&=32767,nt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){nt=t;return}nt=t=n;}while(t!==null);en=6,nt=null;}function Ry(t,e,n,i,r,a,s,u,d){t.cancelPendingCommit=null;do Kf();while(pn!==0);if((At&6)!==0)throw Error(Z(327));if(e!==null){if(e===t.current)throw Error(Z(177));if(a=e.lanes|e.childLanes,a|=sg,UC(t,n,a,s,u,d),t===Pt&&(nt=Pt=null,rt=0),ys=e,da=t,Tr=n,Lm=a,Dm=r,oS=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,uR(cf,function(){return yS(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Ve.T,Ve.T=null,r=yt.p,yt.p=2,s=At,At|=4;try{J2(t,e,n);}finally{At=s,yt.p=r,Ve.T=i;}}pn=1,mS(),gS(),vS();}}function mS(){if(pn===1){pn=0;var t=da,e=ys,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Ve.T,Ve.T=null;var i=yt.p;yt.p=2;var r=At;At|=4;try{J_(e,t);var a=Hm,s=Pb(t.containerInfo),u=a.focusedElem,d=a.selectionRange;if(s!==u&&u&&u.ownerDocument&&Ib(u.ownerDocument.documentElement,u)){if(d!==null&&og(u)){var g=d.start,v=d.end;if(v===void 0&&(v=g),"selectionStart"in u)u.selectionStart=g,u.selectionEnd=Math.min(v,u.value.length);else {var A=u.ownerDocument||document,p=A&&A.defaultView||window;if(p.getSelection){var _=p.getSelection(),T=u.textContent.length,x=Math.min(d.start,T),N=d.end===void 0?x:Math.min(d.end,T);!_.extend&&x>N&&(s=N,N=x,x=s);var E=K0(u,x),w=K0(u,N);if(E&&w&&(_.rangeCount!==1||_.anchorNode!==E.node||_.anchorOffset!==E.offset||_.focusNode!==w.node||_.focusOffset!==w.offset)){var C=A.createRange();C.setStart(E.node,E.offset),_.removeAllRanges(),x>N?(_.addRange(C),_.extend(w.node,w.offset)):(C.setEnd(w.node,w.offset),_.addRange(C));}}}}for(A=[],_=u;_=_.parentNode;)_.nodeType===1&&A.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<A.length;u++){var I=A[u];I.element.scrollLeft=I.left,I.element.scrollTop=I.top;}}Nf=!!Vm,Hm=Vm=null;}finally{At=r,yt.p=i,Ve.T=n;}}t.current=e,pn=2;}}function gS(){if(pn===2){pn=0;var t=da,e=ys,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Ve.T,Ve.T=null;var i=yt.p;yt.p=2;var r=At;At|=4;try{q_(t,e.alternate,e);}finally{At=r,yt.p=i,Ve.T=n;}}pn=3;}}function vS(){if(pn===4||pn===3){pn=0,xC();var t=da,e=ys,n=Tr,i=oS;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?pn=5:(pn=0,ys=da=null,AS(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(fa=null),$m(n),e=e.stateNode,ai&&typeof ai.onCommitFiberRoot=="function")try{ai.onCommitFiberRoot(Zl,e,void 0,(e.current.flags&128)===128);}catch{}if(i!==null){e=Ve.T,r=yt.p,yt.p=2,Ve.T=null;try{for(var a=t.onRecoverableError,s=0;s<i.length;s++){var u=i[s];a(u.value,{componentStack:u.stack});}}finally{Ve.T=e,yt.p=r;}}(Tr&3)!==0&&Kf(),Ki(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Bm?Nl++:(Nl=0,Bm=t):Nl=0,au(0);}}function AS(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,nu(e)));}function Kf(){return mS(),gS(),vS(),yS()}function yS(){if(pn!==5)return false;var t=da,e=Lm;Lm=0;var n=$m(Tr),i=Ve.T,r=yt.p;try{yt.p=32>n?32:n,Ve.T=null,n=Dm,Dm=null;var a=da,s=Tr;if(pn=0,ys=da=null,Tr=0,(At&6)!==0)throw Error(Z(331));var u=At;if(At|=4,iS(a.current),eS(a,a.current,s,n),At=u,au(0,!1),ai&&typeof ai.onPostCommitFiberRoot=="function")try{ai.onPostCommitFiberRoot(Zl,a);}catch{}return !0}finally{yt.p=r,Ve.T=i,AS(t,e);}}function xy(t,e,n){e=_i(n,e),e=km(t.stateNode,e,2),t=ca(t,e,2),t!==null&&($l(t,2),Ki(t));}function Mt(t,e,n){if(t.tag===3)xy(t,t,n);else for(;e!==null;){if(e.tag===3){xy(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(fa===null||!fa.has(i))){t=_i(n,t),n=N_(2),i=ca(e,n,2),i!==null&&(L_(n,i,e,t),$l(i,2),Ki(i));break}}e=e.return;}}function Xp(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new tR;var r=new Set;i.set(e,r);}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Ng=true,r.add(n),t=oR.bind(null,t,e,n),e.then(t,t));}function oR(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Pt===t&&(rt&n)===n&&(en===4||en===3&&(rt&62914560)===rt&&300>ri()-qf?(At&2)===0&&bs(t,0):Lg|=n,As===rt&&(As=0)),Ki(t);}function bS(t,e){e===0&&(e=fb()),t=lo(t,e),t!==null&&($l(t,e),Ki(t));}function sR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),bS(t,n);}function lR(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(Z(314))}i!==null&&i.delete(e),bS(t,n);}function uR(t,e){return Zm(t,e)}var Cf=null,Yo=null,Um=false,Rf=false,Qp=false,oa=0;function Ki(t){t!==Yo&&t.next===null&&(Yo===null?Cf=Yo=t:Yo=Yo.next=t),Rf=true,Um||(Um=true,fR());}function au(t,e){if(!Qp&&Rf){Qp=true;do for(var n=false,i=Cf;i!==null;){if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else {var s=i.suspendedLanes,u=i.pingedLanes;a=(1<<31-oi(42|t)+1)-1,a&=r&~(s&~u),a=a&201326741?a&201326741|1:a?a|2:0;}a!==0&&(n=true,ky(i,a));}else a=rt,a=Df(i,i===Pt?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||Jl(i,a)||(n=true,ky(i,a));i=i.next;}while(n);Qp=false;}}function cR(){_S();}function _S(){Rf=Um=false;var t=0;oa!==0&&yR()&&(t=oa);for(var e=ri(),n=null,i=Cf;i!==null;){var r=i.next,a=SS(i,e);a===0?(i.next=null,n===null?Cf=r:n.next=r,r===null&&(Yo=n)):(n=i,(t!==0||(a&3)!==0)&&(Rf=true)),i=r;}pn!==0&&pn!==5||au(t),oa!==0&&(oa=0);}function SS(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var s=31-oi(a),u=1<<s,d=r[s];d===-1?((u&n)===0||(u&i)!==0)&&(r[s]=BC(u,e)):d<=e&&(t.expiredLanes|=u),a&=~u;}if(e=Pt,n=rt,n=Df(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(Et===2||Et===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Ep(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Jl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Ep(i),$m(n)){case 2:case 8:n=ub;break;case 32:n=cf;break;case 268435456:n=cb;break;default:n=cf;}return i=wS.bind(null,t),n=Zm(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Ep(i),t.callbackPriority=2,t.callbackNode=null,2}function wS(t,e){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Kf()&&t.callbackNode!==n)return null;var i=rt;return i=Df(t,t===Pt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(lS(t,i,e),SS(t,ri()),t.callbackNode!=null&&t.callbackNode===n?wS.bind(null,t):null)}function ky(t,e){if(Kf())return null;lS(t,e,true);}function fR(){_R(function(){(At&6)!==0?Zm(lb,cR):_S();});}function Bg(){if(oa===0){var t=ms;t===0&&(t=Rc,Rc<<=1,(Rc&261888)===0&&(Rc=256)),oa=t;}return oa}function Oy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Yc(""+t)}function Iy(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function dR(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=Oy((r[Yn]||null).action),s=i.submitter;s&&(e=(e=s[Yn]||null)?Oy(e.formAction):s.getAttribute("formAction"),e!==null&&(a=e,s=null));var u=new Bf("action","action",null,i,r);t.push({event:u,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(oa!==0){var d=s?Iy(r,s):new FormData(r);Rm(n,{pending:true,data:d,method:r.method,action:a},null,d);}}else typeof a=="function"&&(u.preventDefault(),d=s?Iy(r,s):new FormData(r),Rm(n,{pending:true,data:d,method:r.method,action:a},a,d));},currentTarget:r}]});}}for(Vc=0;Vc<gm.length;Vc++)Hc=gm[Vc],Py=Hc.toLowerCase(),Ny=Hc[0].toUpperCase()+Hc.slice(1),Li(Py,"on"+Ny);var Hc,Py,Ny,Vc;Li(Lb,"onAnimationEnd");Li(Db,"onAnimationIteration");Li(Bb,"onAnimationStart");Li("dblclick","onDoubleClick");Li("focusin","onFocus");Li("focusout","onBlur");Li(k2,"onTransitionRun");Li(O2,"onTransitionStart");Li(I2,"onTransitionCancel");Li(Ub,"onTransitionEnd");hs("onMouseEnter",["mouseout","mouseover"]);hs("onMouseLeave",["mouseout","mouseover"]);hs("onPointerEnter",["pointerout","pointerover"]);hs("onPointerLeave",["pointerout","pointerover"]);ao("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ao("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ao("onBeforeInput",["compositionend","keypress","textInput","paste"]);ao("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ao("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ao("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jl));function ES(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var s=i.length-1;0<=s;s--){var u=i[s],d=u.instance,g=u.currentTarget;if(u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(v){df(v);}r.currentTarget=null,a=d;}else for(s=0;s<i.length;s++){if(u=i[s],d=u.instance,g=u.currentTarget,u=u.listener,d!==a&&r.isPropagationStopped())break e;a=u,r.currentTarget=g;try{a(r);}catch(v){df(v);}r.currentTarget=null,a=d;}}}}function tt(t,e){var n=e[lm];n===void 0&&(n=e[lm]=new Set);var i=t+"__bubble";n.has(i)||(MS(e,t,2,false),n.add(i));}function Kp(t,e,n){var i=0;e&&(i|=4),MS(n,t,i,e);}var zc="_reactListening"+Math.random().toString(36).slice(2);function Ug(t){if(!t[zc]){t[zc]=true,gb.forEach(function(n){n!=="selectionchange"&&(hR.has(n)||Kp(n,false,t),Kp(n,true,t));});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[zc]||(e[zc]=true,Kp("selectionchange",false,e));}}function MS(t,e,n,i){switch(US(e)){case 2:var r=HR;break;case 8:r=zR;break;default:r=zg;}n=r.bind(null,e,n,t),r=void 0,!hm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=true),i?r!==void 0?t.addEventListener(e,n,{capture:true,passive:r}):t.addEventListener(e,n,true):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,false);}function Zp(t,e,n,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var u=i.stateNode.containerInfo;if(u===r)break;if(s===4)for(s=i.return;s!==null;){var d=s.tag;if((d===3||d===4)&&s.stateNode.containerInfo===r)return;s=s.return;}for(;u!==null;){if(s=Qo(u),s===null)return;if(d=s.tag,d===5||d===6||d===26||d===27){i=a=s;continue e}u=u.parentNode;}}i=i.return;}Eb(function(){var g=a,v=ng(n),A=[];e:{var p=Fb.get(t);if(p!==void 0){var _=Bf,T=t;switch(t){case "keypress":if(Xc(n)===0)break e;case "keydown":case "keyup":_=l2;break;case "focusin":T="focus",_=xp;break;case "focusout":T="blur",_=xp;break;case "beforeblur":case "afterblur":_=xp;break;case "click":if(n.button===2)break e;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":_=H0;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":_=KC;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":_=f2;break;case Lb:case Db:case Bb:_=$C;break;case Ub:_=h2;break;case "scroll":case "scrollend":_=XC;break;case "wheel":_=m2;break;case "copy":case "cut":case "paste":_=t2;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":_=G0;break;case "toggle":case "beforetoggle":_=v2;}var x=(e&4)!==0,N=!x&&(t==="scroll"||t==="scrollend"),E=x?p!==null?p+"Capture":null:p;x=[];for(var w=g,C;w!==null;){var I=w;if(C=I.stateNode,I=I.tag,I!==5&&I!==26&&I!==27||C===null||E===null||(I=Bl(w,E),I!=null&&x.push(Yl(w,I,C))),N)break;w=w.return;}0<x.length&&(p=new _(p,T,null,n,v),A.push({event:p,listeners:x}));}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",_=t==="mouseout"||t==="pointerout",p&&n!==dm&&(T=n.relatedTarget||n.fromElement)&&(Qo(T)||T[ws]))break e;if((_||p)&&(p=v.window===v?v:(p=v.ownerDocument)?p.defaultView||p.parentWindow:window,_?(T=n.relatedTarget||n.toElement,_=g,T=T?Qo(T):null,T!==null&&(N=Kl(T),x=T.tag,T!==N||x!==5&&x!==27&&x!==6)&&(T=null)):(_=null,T=g),_!==T)){if(x=H0,I="onMouseLeave",E="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(x=G0,I="onPointerLeave",E="onPointerEnter",w="pointer"),N=_==null?p:bl(_),C=T==null?p:bl(T),p=new x(I,w+"leave",_,n,v),p.target=N,p.relatedTarget=C,I=null,Qo(v)===g&&(x=new x(E,w+"enter",T,n,v),x.target=C,x.relatedTarget=N,I=x),N=I,_&&T)t:{for(x=pR,E=_,w=T,C=0,I=E;I;I=x(I))C++;I=0;for(var V=w;V;V=x(V))I++;for(;0<C-I;)E=x(E),C--;for(;0<I-C;)w=x(w),I--;for(;C--;){if(E===w||w!==null&&E===w.alternate){x=E;break t}E=x(E),w=x(w);}x=null;}else x=null;_!==null&&Ly(A,p,_,x,!1),T!==null&&N!==null&&Ly(A,N,T,x,!0);}}e:{if(p=g?bl(g):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var K=q0;else if(Y0(p))if(kb)K=C2;else {K=M2;var F=E2;}else _=p.nodeName,!_||_.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&tg(g.elementType)&&(K=q0):K=T2;if(K&&(K=K(t,g))){xb(A,K,n,v);break e}F&&F(t,p,g),t==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&fm(p,"number",p.value);}switch(F=g?bl(g):window,t){case "focusin":(Y0(F)||F.contentEditable==="true")&&(Jo=F,pm=g,Ml=null);break;case "focusout":Ml=pm=Jo=null;break;case "mousedown":mm=!0;break;case "contextmenu":case "mouseup":case "dragend":mm=!1,Z0(A,n,v);break;case "selectionchange":if(x2)break;case "keydown":case "keyup":Z0(A,n,v);}var H;if(ag)e:{switch(t){case "compositionstart":var J="onCompositionStart";break e;case "compositionend":J="onCompositionEnd";break e;case "compositionupdate":J="onCompositionUpdate";break e}J=void 0;}else Zo?Cb(t,n)&&(J="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(J="onCompositionStart");J&&(Tb&&n.locale!=="ko"&&(Zo||J!=="onCompositionStart"?J==="onCompositionEnd"&&Zo&&(H=Mb()):(ia=v,ig="value"in ia?ia.value:ia.textContent,Zo=!0)),F=xf(g,J),0<F.length&&(J=new z0(J,t,null,n,v),A.push({event:J,listeners:F}),H?J.data=H:(H=Rb(n),H!==null&&(J.data=H)))),(H=y2?b2(t,n):_2(t,n))&&(J=xf(g,"onBeforeInput"),0<J.length&&(F=new z0("onBeforeInput","beforeinput",null,n,v),A.push({event:F,listeners:J}),F.data=H)),dR(A,t,g,n,v);}ES(A,e);});}function Yl(t,e,n){return {instance:t,listener:e,currentTarget:n}}function xf(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=Bl(t,n),r!=null&&i.unshift(Yl(t,r,a)),r=Bl(t,e),r!=null&&i.push(Yl(t,r,a))),t.tag===3)return i;t=t.return;}return []}function pR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ly(t,e,n,i,r){for(var a=e._reactName,s=[];n!==null&&n!==i;){var u=n,d=u.alternate,g=u.stateNode;if(u=u.tag,d!==null&&d===i)break;u!==5&&u!==26&&u!==27||g===null||(d=g,r?(g=Bl(n,a),g!=null&&s.unshift(Yl(n,g,d))):r||(g=Bl(n,a),g!=null&&s.push(Yl(n,g,d)))),n=n.return;}s.length!==0&&t.push({event:e,listeners:s});}var mR=/\r\n?/g,gR=/\u0000|\uFFFD/g;function Dy(t){return (typeof t=="string"?t:""+t).replace(mR,`
9
+ `).replace(gR,"")}function TS(t,e){return e=Dy(e),Dy(t)===e}function xt(t,e,n,i,r,a){switch(n){case "children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||ps(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&ps(t,""+i);break;case "className":Oc(t,"class",i);break;case "tabIndex":Oc(t,"tabindex",i);break;case "dir":case "role":case "viewBox":case "width":case "height":Oc(t,n,i);break;case "style":wb(t,i,a);break;case "data":if(e!=="object"){Oc(t,"data",i);break}case "src":case "href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Yc(""+i),t.setAttribute(n,i);break;case "action":case "formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&xt(t,e,"name",r.name,r,null),xt(t,e,"formEncType",r.formEncType,r,null),xt(t,e,"formMethod",r.formMethod,r,null),xt(t,e,"formTarget",r.formTarget,r,null)):(xt(t,e,"encType",r.encType,r,null),xt(t,e,"method",r.method,r,null),xt(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Yc(""+i),t.setAttribute(n,i);break;case "onClick":i!=null&&(t.onclick=Sr);break;case "onScroll":i!=null&&tt("scroll",t);break;case "onScrollEnd":i!=null&&tt("scrollend",t);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Z(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Z(60));t.innerHTML=n;}}break;case "multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case "muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "defaultValue":case "defaultChecked":case "innerHTML":case "ref":break;case "autoFocus":break;case "xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Yc(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case "contentEditable":case "spellCheck":case "draggable":case "value":case "autoReverse":case "externalResourcesRequired":case "focusable":case "preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case "inert":case "allowFullScreen":case "async":case "autoPlay":case "controls":case "default":case "defer":case "disabled":case "disablePictureInPicture":case "disableRemotePlayback":case "formNoValidate":case "hidden":case "loop":case "noModule":case "noValidate":case "open":case "playsInline":case "readOnly":case "required":case "reversed":case "scoped":case "seamless":case "itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case "capture":case "download":i===true?t.setAttribute(n,""):i!==false&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case "cols":case "rows":case "size":case "span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case "rowSpan":case "start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case "popover":tt("beforetoggle",t),tt("toggle",t),jc(t,"popover",i);break;case "xlinkActuate":pr(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case "xlinkArcrole":pr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case "xlinkRole":pr(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case "xlinkShow":pr(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case "xlinkTitle":pr(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case "xlinkType":pr(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case "xmlBase":pr(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case "xmlLang":pr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case "xmlSpace":pr(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case "is":jc(t,"is",i);break;case "innerText":case "textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=YC.get(n)||n,jc(t,n,i));}}function Fm(t,e,n,i,r,a){switch(n){case "style":wb(t,i,a);break;case "dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Z(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(Z(60));t.innerHTML=n;}}break;case "children":typeof i=="string"?ps(t,i):(typeof i=="number"||typeof i=="bigint")&&ps(t,""+i);break;case "onScroll":i!=null&&tt("scroll",t);break;case "onScrollEnd":i!=null&&tt("scrollend",t);break;case "onClick":i!=null&&(t.onclick=Sr);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "innerHTML":case "ref":break;case "innerText":case "textContent":break;default:if(!vb.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Yn]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===true?t.setAttribute(n,""):jc(t,n,i);}}}function Cn(t,e,n){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "img":tt("error",t),tt("load",t);var i=false,r=false,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case "src":i=true;break;case "srcSet":r=true;break;case "children":case "dangerouslySetInnerHTML":throw Error(Z(137,e));default:xt(t,e,a,s,n,null);}}r&&xt(t,e,"srcSet",n.srcSet,n,null),i&&xt(t,e,"src",n.src,n,null);return;case "input":tt("invalid",t);var u=a=s=r=null,d=null,g=null;for(i in n)if(n.hasOwnProperty(i)){var v=n[i];if(v!=null)switch(i){case "name":r=v;break;case "type":s=v;break;case "checked":d=v;break;case "defaultChecked":g=v;break;case "value":a=v;break;case "defaultValue":u=v;break;case "children":case "dangerouslySetInnerHTML":if(v!=null)throw Error(Z(137,e));break;default:xt(t,e,i,v,n,null);}}bb(t,a,u,d,g,s,r,false);return;case "select":tt("invalid",t),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(u=n[r],u!=null))switch(r){case "value":a=u;break;case "defaultValue":s=u;break;case "multiple":i=u;default:xt(t,e,r,u,n,null);}e=a,n=s,t.multiple=!!i,e!=null?os(t,!!i,e,false):n!=null&&os(t,!!i,n,true);return;case "textarea":tt("invalid",t),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(u=n[s],u!=null))switch(s){case "value":i=u;break;case "defaultValue":r=u;break;case "children":a=u;break;case "dangerouslySetInnerHTML":if(u!=null)throw Error(Z(91));break;default:xt(t,e,s,u,n,null);}Sb(t,i,r,a);return;case "option":for(d in n)n.hasOwnProperty(d)&&(i=n[d],i!=null)&&(d==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":xt(t,e,d,i,n,null));return;case "dialog":tt("beforetoggle",t),tt("toggle",t),tt("cancel",t),tt("close",t);break;case "iframe":case "object":tt("load",t);break;case "video":case "audio":for(i=0;i<jl.length;i++)tt(jl[i],t);break;case "image":tt("error",t),tt("load",t);break;case "details":tt("toggle",t);break;case "embed":case "source":case "link":tt("error",t),tt("load",t);case "area":case "base":case "br":case "col":case "hr":case "keygen":case "meta":case "param":case "track":case "wbr":case "menuitem":for(g in n)if(n.hasOwnProperty(g)&&(i=n[g],i!=null))switch(g){case "children":case "dangerouslySetInnerHTML":throw Error(Z(137,e));default:xt(t,e,g,i,n,null);}return;default:if(tg(e)){for(v in n)n.hasOwnProperty(v)&&(i=n[v],i!==void 0&&Fm(t,e,v,i,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!=null&&xt(t,e,u,i,n,null));}function vR(t,e,n,i){switch(e){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "input":var r=null,a=null,s=null,u=null,d=null,g=null,v=null;for(_ in n){var A=n[_];if(n.hasOwnProperty(_)&&A!=null)switch(_){case "checked":break;case "value":break;case "defaultValue":d=A;default:i.hasOwnProperty(_)||xt(t,e,_,null,i,A);}}for(var p in i){var _=i[p];if(A=n[p],i.hasOwnProperty(p)&&(_!=null||A!=null))switch(p){case "type":a=_;break;case "name":r=_;break;case "checked":g=_;break;case "defaultChecked":v=_;break;case "value":s=_;break;case "defaultValue":u=_;break;case "children":case "dangerouslySetInnerHTML":if(_!=null)throw Error(Z(137,e));break;default:_!==A&&xt(t,e,p,_,i,A);}}cm(t,s,u,d,g,v,a,r);return;case "select":_=s=u=p=null;for(a in n)if(d=n[a],n.hasOwnProperty(a)&&d!=null)switch(a){case "value":break;case "multiple":_=d;default:i.hasOwnProperty(a)||xt(t,e,a,null,i,d);}for(r in i)if(a=i[r],d=n[r],i.hasOwnProperty(r)&&(a!=null||d!=null))switch(r){case "value":p=a;break;case "defaultValue":u=a;break;case "multiple":s=a;default:a!==d&&xt(t,e,r,a,i,d);}e=u,n=s,i=_,p!=null?os(t,!!n,p,false):!!i!=!!n&&(e!=null?os(t,!!n,e,true):os(t,!!n,n?[]:"",false));return;case "textarea":_=p=null;for(u in n)if(r=n[u],n.hasOwnProperty(u)&&r!=null&&!i.hasOwnProperty(u))switch(u){case "value":break;case "children":break;default:xt(t,e,u,null,i,r);}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case "value":p=r;break;case "defaultValue":_=r;break;case "children":break;case "dangerouslySetInnerHTML":if(r!=null)throw Error(Z(91));break;default:r!==a&&xt(t,e,s,r,i,a);}_b(t,p,_);return;case "option":for(var T in n)p=n[T],n.hasOwnProperty(T)&&p!=null&&!i.hasOwnProperty(T)&&(T==="selected"?t.selected=false:xt(t,e,T,null,i,p));for(d in i)p=i[d],_=n[d],i.hasOwnProperty(d)&&p!==_&&(p!=null||_!=null)&&(d==="selected"?t.selected=p&&typeof p!="function"&&typeof p!="symbol":xt(t,e,d,p,i,_));return;case "img":case "link":case "area":case "base":case "br":case "col":case "embed":case "hr":case "keygen":case "meta":case "param":case "source":case "track":case "wbr":case "menuitem":for(var x in n)p=n[x],n.hasOwnProperty(x)&&p!=null&&!i.hasOwnProperty(x)&&xt(t,e,x,null,i,p);for(g in i)if(p=i[g],_=n[g],i.hasOwnProperty(g)&&p!==_&&(p!=null||_!=null))switch(g){case "children":case "dangerouslySetInnerHTML":if(p!=null)throw Error(Z(137,e));break;default:xt(t,e,g,p,i,_);}return;default:if(tg(e)){for(var N in n)p=n[N],n.hasOwnProperty(N)&&p!==void 0&&!i.hasOwnProperty(N)&&Fm(t,e,N,void 0,i,p);for(v in i)p=i[v],_=n[v],!i.hasOwnProperty(v)||p===_||p===void 0&&_===void 0||Fm(t,e,v,p,i,_);return}}for(var E in n)p=n[E],n.hasOwnProperty(E)&&p!=null&&!i.hasOwnProperty(E)&&xt(t,e,E,null,i,p);for(A in i)p=i[A],_=n[A],!i.hasOwnProperty(A)||p===_||p==null&&_==null||xt(t,e,A,p,i,_);}function By(t){switch(t){case "css":case "script":case "font":case "img":case "image":case "input":case "link":return true;default:return false}}function AR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],a=r.transferSize,s=r.initiatorType,u=r.duration;if(a&&u&&By(s)){for(s=0,u=r.responseEnd,i+=1;i<n.length;i++){var d=n[i],g=d.startTime;if(g>u)break;var v=d.transferSize,A=d.initiatorType;v&&By(A)&&(d=d.responseEnd,s+=v*(d<u?1:(u-g)/(d-g)));}if(--i,e+=8*(a+s)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Vm=null,Hm=null;function kf(t){return t.nodeType===9?t:t.ownerDocument}function Uy(t){switch(t){case "http://www.w3.org/2000/svg":return 1;case "http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function CS(t,e){if(t===0)switch(e){case "svg":return 1;case "math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function zm(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Jp=null;function yR(){var t=window.event;return t&&t.type==="popstate"?t===Jp?false:(Jp=t,true):(Jp=null,false)}var RS=typeof setTimeout=="function"?setTimeout:void 0,bR=typeof clearTimeout=="function"?clearTimeout:void 0,Fy=typeof Promise=="function"?Promise:void 0,_R=typeof queueMicrotask=="function"?queueMicrotask:typeof Fy<"u"?function(t){return Fy.resolve(null).then(t).catch(SR)}:RS;function SR(t){setTimeout(function(){throw t});}function _a(t){return t==="head"}function Vy(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Ss(e);return}i--;}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Ll(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Ll(n);for(var a=n.firstChild;a;){var s=a.nextSibling,u=a.nodeName;a[eu]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=s;}}else n==="body"&&Ll(t.ownerDocument.body);n=r;}while(n);Ss(e);}function Hy(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--;}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i;}while(n)}function Gm(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case "HTML":case "HEAD":case "BODY":Gm(n),eg(n);continue;case "SCRIPT":case "STYLE":continue;case "LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n);}}function wR(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[eu])switch(e){case "meta":if(!t.hasAttribute("itemprop"))break;return t;case "link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case "style":if(t.hasAttribute("data-precedence"))break;return t;case "script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=Ei(t.nextSibling),t===null)break}return null}function ER(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Ei(t.nextSibling),t===null))return null;return t}function xS(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Ei(t.nextSibling),t===null))return null;return t}function Wm(t){return t.data==="$?"||t.data==="$~"}function jm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function MR(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else {var i=function(){e(),n.removeEventListener("DOMContentLoaded",i);};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i;}}function Ei(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Ym=null;function zy(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return Ei(t.nextSibling);e--;}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++;}t=t.nextSibling;}return null}function Gy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--;}else n!=="/$"&&n!=="/&"||e++;}t=t.previousSibling;}return null}function kS(t,e,n){switch(e=kf(n),t){case "html":if(t=e.documentElement,!t)throw Error(Z(452));return t;case "head":if(t=e.head,!t)throw Error(Z(453));return t;case "body":if(t=e.body,!t)throw Error(Z(454));return t;default:throw Error(Z(451))}}function Ll(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);eg(t);}var Mi=new Map,Wy=new Set;function Of(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ir=yt.d;yt.d={f:TR,r:CR,D:RR,C:xR,L:kR,m:OR,X:PR,S:IR,M:NR};function TR(){var t=Ir.f(),e=Xf();return t||e}function CR(t){var e=Es(t);e!==null&&e.tag===5&&e.type==="form"?w_(e):Ir.r(t);}var Rs=typeof document>"u"?null:document;function OS(t,e,n){var i=Rs;if(i&&typeof e=="string"&&e){var r=bi(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Wy.has(r)||(Wy.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),Cn(e,"link",t),_n(e),i.head.appendChild(e)));}}function RR(t){Ir.D(t),OS("dns-prefetch",t,null);}function xR(t,e){Ir.C(t,e),OS("preconnect",t,e);}function kR(t,e,n){Ir.L(t,e,n);var i=Rs;if(i&&t&&e){var r='link[rel="preload"][as="'+bi(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+bi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+bi(n.imageSizes)+'"]')):r+='[href="'+bi(t)+'"]';var a=r;switch(e){case "style":a=_s(t);break;case "script":a=xs(t);}Mi.has(a)||(t=Ht({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Mi.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(ou(a))||e==="script"&&i.querySelector(su(a))||(e=i.createElement("link"),Cn(e,"link",t),_n(e),i.head.appendChild(e)));}}function OR(t,e){Ir.m(t,e);var n=Rs;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+bi(i)+'"][href="'+bi(t)+'"]',a=r;switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":a=xs(t);}if(!Mi.has(a)&&(t=Ht({rel:"modulepreload",href:t},e),Mi.set(a,t),n.querySelector(r)===null)){switch(i){case "audioworklet":case "paintworklet":case "serviceworker":case "sharedworker":case "worker":case "script":if(n.querySelector(su(a)))return}i=n.createElement("link"),Cn(i,"link",t),_n(i),n.head.appendChild(i);}}}function IR(t,e,n){Ir.S(t,e,n);var i=Rs;if(i&&t){var r=as(i).hoistableStyles,a=_s(t);e=e||"default";var s=r.get(a);if(!s){var u={loading:0,preload:null};if(s=i.querySelector(ou(a)))u.loading=5;else {t=Ht({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Mi.get(a))&&Fg(t,n);var d=s=i.createElement("link");_n(d),Cn(d,"link",t),d._p=new Promise(function(g,v){d.onload=g,d.onerror=v;}),d.addEventListener("load",function(){u.loading|=1;}),d.addEventListener("error",function(){u.loading|=2;}),u.loading|=4,nf(s,e,i);}s={type:"stylesheet",instance:s,count:1,state:u},r.set(a,s);}}}function PR(t,e){Ir.X(t,e);var n=Rs;if(n&&t){var i=as(n).hoistableScripts,r=xs(t),a=i.get(r);a||(a=n.querySelector(su(r)),a||(t=Ht({src:t,async:true},e),(e=Mi.get(r))&&Vg(t,e),a=n.createElement("script"),_n(a),Cn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function NR(t,e){Ir.M(t,e);var n=Rs;if(n&&t){var i=as(n).hoistableScripts,r=xs(t),a=i.get(r);a||(a=n.querySelector(su(r)),a||(t=Ht({src:t,async:true,type:"module"},e),(e=Mi.get(r))&&Vg(t,e),a=n.createElement("script"),_n(a),Cn(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a));}}function jy(t,e,n,i){var r=(r=sa.current)?Of(r):null;if(!r)throw Error(Z(446));switch(t){case "meta":case "title":return null;case "style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=_s(n.href),n=as(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case "link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=_s(n.href);var a=as(r).hoistableStyles,s=a.get(t);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=r.querySelector(ou(t)))&&!a._p&&(s.instance=a,s.state.loading=5),Mi.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Mi.set(t,n),a||LR(r,t,n,s.state))),e&&i===null)throw Error(Z(528,""));return s}if(e&&i!==null)throw Error(Z(529,""));return null;case "script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xs(n),n=as(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Z(444,t))}}function _s(t){return 'href="'+bi(t)+'"'}function ou(t){return 'link[rel="stylesheet"]['+t+"]"}function IS(t){return Ht({},t,{"data-precedence":t.precedence,precedence:null})}function LR(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),Cn(e,"link",n),_n(e),t.head.appendChild(e));}function xs(t){return '[src="'+bi(t)+'"]'}function su(t){return "script[async]"+t}function Yy(t,e,n){if(e.count++,e.instance===null)switch(e.type){case "style":var i=t.querySelector('style[data-href~="'+bi(n.href)+'"]');if(i)return e.instance=i,_n(i),i;var r=Ht({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),_n(i),Cn(i,"style",r),nf(i,n.precedence,t),e.instance=i;case "stylesheet":r=_s(n.href);var a=t.querySelector(ou(r));if(a)return e.state.loading|=4,e.instance=a,_n(a),a;i=IS(n),(r=Mi.get(r))&&Fg(i,r),a=(t.ownerDocument||t).createElement("link"),_n(a);var s=a;return s._p=new Promise(function(u,d){s.onload=u,s.onerror=d;}),Cn(a,"link",i),e.state.loading|=4,nf(a,n.precedence,t),e.instance=a;case "script":return a=xs(n.src),(r=t.querySelector(su(a)))?(e.instance=r,_n(r),r):(i=n,(r=Mi.get(a))&&(i=Ht({},n),Vg(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),_n(r),Cn(r,"link",i),t.head.appendChild(r),e.instance=r);case "void":return null;default:throw Error(Z(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,nf(i,n.precedence,t));return e.instance}function nf(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var u=i[s];if(u.dataset.precedence===e)a=u;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild));}function Fg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title);}function Vg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity);}var rf=null;function qy(t,e,n){if(rf===null){var i=new Map,r=rf=new Map;r.set(n,i);}else r=rf,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[eu]||a[En]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(e)||"";s=t+s;var u=i.get(s);u?u.push(a):i.set(s,[a]);}}return i}function Xy(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null);}function DR(t,e,n){if(n===1||e.itemProp!=null)return false;switch(t){case "meta":case "title":return true;case "style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return true;case "link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):true;case "script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return true}return false}function PS(t){return !(t.type==="stylesheet"&&(t.state.loading&3)===0)}function BR(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==false)&&(n.state.loading&4)===0){if(n.instance===null){var r=_s(i.href),a=e.querySelector(ou(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=If.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=a,_n(a);return}a=e.ownerDocument||e,i=IS(i),(r=Mi.get(r))&&Fg(i,r),a=a.createElement("link"),_n(a);var s=a;s._p=new Promise(function(u,d){s.onload=u,s.onerror=d;}),Cn(a,"link",i),n.instance=a;}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=If.bind(t),e.addEventListener("load",n),e.addEventListener("error",n));}}var $p=0;function UR(t,e){return t.stylesheets&&t.count===0&&af(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&af(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a();}},6e4+e);0<t.imgBytes&&$p===0&&($p=62500*AR());var r=setTimeout(function(){if(t.waitingForImages=false,t.count===0&&(t.stylesheets&&af(t,t.stylesheets),t.unsuspend)){var a=t.unsuspend;t.unsuspend=null,a();}},(t.imgBytes>$p?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r);}}:null}function If(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)af(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t();}}}var Pf=null;function af(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Pf=new Map,e.forEach(FR,t),Pf=null,If.call(t));}function FR(t,e){if(!(e.state.loading&4)){var n=Pf.get(t);if(n)var i=n.get(null);else {n=new Map,Pf.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s);}i&&n.set(null,i);}r=e.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=If.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4;}}var ql={$$typeof:_r,Provider:null,Consumer:null,_currentValue:Qa,_currentValue2:Qa,_threadCount:0};function VR(t,e,n,i,r,a,s,u,d){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mp(0),this.hiddenUpdates=Mp(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=d,this.incompleteTransitions=new Map;}function NS(t,e,n,i,r,a,s,u,d,g,v,A){return t=new VR(t,e,n,s,d,g,v,A,u),e=1,a===true&&(e|=24),a=ni(3,null,null,e),t.current=a,a.stateNode=t,e=dg(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},mg(a),t}function LS(t){return t?(t=ts,t):ts}function DS(t,e,n,i,r,a){r=LS(r),i.context===null?i.context=r:i.pendingContext=r,i=ua(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=ca(t,i,e),n!==null&&(jn(n,t,e),Cl(n,t,e));}function Qy(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e;}}function Hg(t,e){Qy(t,e),(t=t.alternate)&&Qy(t,e);}function BS(t){if(t.tag===13||t.tag===31){var e=lo(t,67108864);e!==null&&jn(e,t,67108864),Hg(t,67108864);}}function Ky(t){if(t.tag===13||t.tag===31){var e=si();e=Jm(e);var n=lo(t,e);n!==null&&jn(n,t,e),Hg(t,e);}}var Nf=true;function HR(t,e,n,i){var r=Ve.T;Ve.T=null;var a=yt.p;try{yt.p=2,zg(t,e,n,i);}finally{yt.p=a,Ve.T=r;}}function zR(t,e,n,i){var r=Ve.T;Ve.T=null;var a=yt.p;try{yt.p=8,zg(t,e,n,i);}finally{yt.p=a,Ve.T=r;}}function zg(t,e,n,i){if(Nf){var r=qm(i);if(r===null)Zp(t,e,i,Lf,n),Zy(t,i);else if(WR(r,t,e,n,i))i.stopPropagation();else if(Zy(t,i),e&4&&-1<GR.indexOf(t)){for(;r!==null;){var a=Es(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=Ya(a.pendingLanes);if(s!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;s;){var d=1<<31-oi(s);u.entanglements[1]|=d,s&=~d;}Ki(a),(At&6)===0&&(Ef=ri()+500,au(0));}}break;case 31:case 13:u=lo(a,2),u!==null&&jn(u,a,2),Xf(),Hg(a,2);}if(a=qm(i),a===null&&Zp(t,e,i,Lf,n),a===r)break;r=a;}r!==null&&i.stopPropagation();}else Zp(t,e,i,null,n);}}function qm(t){return t=ng(t),Gg(t)}var Lf=null;function Gg(t){if(Lf=null,t=Qo(t),t!==null){var e=Kl(t);if(e===null)t=null;else {var n=e.tag;if(n===13){if(t=ib(e),t!==null)return t;t=null;}else if(n===31){if(t=rb(e),t!==null)return t;t=null;}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null;}else e!==t&&(t=null);}}return Lf=t,null}function US(t){switch(t){case "beforetoggle":case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "toggle":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 2;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 8;case "message":switch(kC()){case lb:return 2;case ub:return 8;case cf:case OC:return 32;case cb:return 268435456;default:return 32}default:return 32}}var Xm=false,ha=null,pa=null,ma=null,Xl=new Map,Ql=new Map,ta=[],GR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Zy(t,e){switch(t){case "focusin":case "focusout":ha=null;break;case "dragenter":case "dragleave":pa=null;break;case "mouseover":case "mouseout":ma=null;break;case "pointerover":case "pointerout":Xl.delete(e.pointerId);break;case "gotpointercapture":case "lostpointercapture":Ql.delete(e.pointerId);}}function gl(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=Es(e),e!==null&&BS(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function WR(t,e,n,i,r){switch(e){case "focusin":return ha=gl(ha,t,e,n,i,r),true;case "dragenter":return pa=gl(pa,t,e,n,i,r),true;case "mouseover":return ma=gl(ma,t,e,n,i,r),true;case "pointerover":var a=r.pointerId;return Xl.set(a,gl(Xl.get(a)||null,t,e,n,i,r)),true;case "gotpointercapture":return a=r.pointerId,Ql.set(a,gl(Ql.get(a)||null,t,e,n,i,r)),true}return false}function FS(t){var e=Qo(t.target);if(e!==null){var n=Kl(e);if(n!==null){if(e=n.tag,e===13){if(e=ib(n),e!==null){t.blockedOn=e,N0(t.priority,function(){Ky(n);});return}}else if(e===31){if(e=rb(n),e!==null){t.blockedOn=e,N0(t.priority,function(){Ky(n);});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null;}function of(t){if(t.blockedOn!==null)return false;for(var e=t.targetContainers;0<e.length;){var n=qm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);dm=i,n.target.dispatchEvent(i),dm=null;}else return e=Es(n),e!==null&&BS(e),t.blockedOn=n,false;e.shift();}return true}function Jy(t,e,n){of(t)&&n.delete(e);}function jR(){Xm=false,ha!==null&&of(ha)&&(ha=null),pa!==null&&of(pa)&&(pa=null),ma!==null&&of(ma)&&(ma=null),Xl.forEach(Jy),Ql.forEach(Jy);}function Gc(t,e){t.blockedOn===e&&(t.blockedOn=null,Xm||(Xm=true,mn.unstable_scheduleCallback(mn.unstable_NormalPriority,jR)));}var Wc=null;function $y(t){Wc!==t&&(Wc=t,mn.unstable_scheduleCallback(mn.unstable_NormalPriority,function(){Wc===t&&(Wc=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(Gg(i||n)===null)continue;break}var a=Es(n);a!==null&&(t.splice(e,3),e-=3,Rm(a,{pending:true,data:r,method:n.method,action:i},i,r));}}));}function Ss(t){function e(d){return Gc(d,t)}ha!==null&&Gc(ha,t),pa!==null&&Gc(pa,t),ma!==null&&Gc(ma,t),Xl.forEach(e),Ql.forEach(e);for(var n=0;n<ta.length;n++){var i=ta[n];i.blockedOn===t&&(i.blockedOn=null);}for(;0<ta.length&&(n=ta[0],n.blockedOn===null);)FS(n),n.blockedOn===null&&ta.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[Yn]||null;if(typeof a=="function")s||$y(n);else if(s){var u=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[Yn]||null)u=s.formAction;else if(Gg(r)!==null)continue}else u=s.action;typeof u=="function"?n[i+1]=u:(n.splice(i,3),i-=3),$y(n);}}}function VS(){function t(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(s){return r=s})},focusReset:"manual",scroll:"manual"});}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20);}function n(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"});}}if(typeof navigation=="object"){var i=false,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=true,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null);}}}function Wg(t){this._internalRoot=t;}Zf.prototype.render=Wg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Z(409));var n=e.current,i=si();DS(n,i,t,e,null,null);};Zf.prototype.unmount=Wg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;DS(t.current,2,null,t,null,null),Xf(),e[ws]=null;}};function Zf(t){this._internalRoot=t;}Zf.prototype.unstable_scheduleHydration=function(t){if(t){var e=mb();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ta.length&&e!==0&&e<ta[n].priority;n++);ta.splice(n,0,t),n===0&&FS(t);}};var eb=tb.version;if(eb!=="19.2.6")throw Error(Z(527,eb,"19.2.6"));yt.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Z(188)):(t=Object.keys(t).join(","),Error(Z(268,t)));return t=wC(e),t=t!==null?ab(t):null,t=t===null?null:t.stateNode,t};var YR={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:Ve,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(vl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!vl.isDisabled&&vl.supportsFiber))try{Zl=vl.inject(YR),ai=vl;}catch{}var vl;Jf.createRoot=function(t,e){if(!nb(t))throw Error(Z(299));var n=false,i="",r=O_,a=I_,s=P_;return e!=null&&(e.unstable_strictMode===true&&(n=true),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=NS(t,1,false,null,null,n,i,null,r,a,s,VS),t[ws]=e.current,Ug(t),new Wg(e)};Jf.hydrateRoot=function(t,e,n){if(!nb(t))throw Error(Z(299));var i=false,r="",a=O_,s=I_,u=P_,d=null;return n!=null&&(n.unstable_strictMode===true&&(i=true),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(d=n.formState)),e=NS(t,1,true,e,n??null,i,r,d,a,s,u,VS),e.context=LS(null),n=e.current,i=si(),i=Jm(i),r=ua(i),r.callback=null,ca(n,r,i),n=i,e.current.lanes=n,$l(e,n),Ki(e),t[ws]=e.current,Ug(t),new Zf(e)};Jf.version="19.2.6";});var WS=pi((HD,GS)=>{function zS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zS);}catch(t){console.error(t);}}zS(),GS.exports=HS();});var x1=pi(Vd=>{var dO=Symbol.for("react.transitional.element"),hO=Symbol.for("react.fragment");function R1(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r]);}else n=e;return e=n.ref,{$$typeof:dO,type:t,key:i,ref:e!==void 0?e:null,props:n}}Vd.Fragment=hO;Vd.jsx=R1;Vd.jsxs=R1;});var Be=pi((V6,k1)=>{k1.exports=x1();});var Bu=pi((Du,Fv)=>{(function(e,n){typeof Du=="object"&&typeof Fv=="object"?Fv.exports=n():typeof define=="function"&&define.amd?define([],n):typeof Du=="object"?Du.rive=n():e.rive=n();})(Du,()=>(()=>{var t=[,((r,a,s)=>{s.r(a),s.d(a,{Animation:()=>u.Animation});var u=s(2);}),((r,a,s)=>{s.r(a),s.d(a,{Animation:()=>u});var u=(function(){function d(g,v,A,p){this.animation=g,this.artboard=v,this.playing=p,this.loopCount=0,this.scrubTo=null,this.instance=new A.LinearAnimationInstance(g,v);}return Object.defineProperty(d.prototype,"name",{get:function(){return this.animation.name},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"time",{get:function(){return this.instance.time},set:function(g){this.instance.time=g;},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:false,configurable:true}),Object.defineProperty(d.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:false,configurable:true}),d.prototype.advance=function(g){this.scrubTo===null?this.instance.advance(g):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null);},d.prototype.apply=function(g){this.instance.apply(g);},d.prototype.cleanup=function(){this.instance.delete();},d})();}),((r,a,s)=>{s.r(a),s.d(a,{RuntimeLoader:()=>v});var u=s(4),d=s(5),g=function(){return g=Object.assign||function(A){for(var p,_=1,T=arguments.length;_<T;_++){p=arguments[_];for(var x in p)Object.prototype.hasOwnProperty.call(p,x)&&(A[x]=p[x]);}return A},g.apply(this,arguments)},v=(function(){function A(){}return A.notifyError=function(p){var _;for(A.isLoading=false;A.errorCallbackQueue.length>0;)(_=A.errorCallbackQueue.shift())===null||_===void 0||_(p);A.callBackQueue=[];},A.loadRuntime=function(){var p=A.wasmURL,_=A.wasmBinary;A.enablePerfMarks&&performance.mark("rive:wasm-init:start"),u.default(g({locateFile:function(){return p}},_?{wasmBinary:_}:{})).then(function(T){var x;for(A.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),A.runtime=T,A.errorCallbackQueue=[];A.callBackQueue.length>0;)(x=A.callBackQueue.shift())===null||x===void 0||x(A.runtime);}).catch(function(T){var x={message:T?.message||"Unknown error",type:T?.name||"Error",wasmError:T instanceof WebAssembly.CompileError||T instanceof WebAssembly.RuntimeError,originalError:T};console.debug("Rive WASM load error details:",x);var N=A.wasmFallbackURL,E=N!==null&&p.toLowerCase()===N.toLowerCase();if(N!==null&&!E)console.warn("Failed to load WASM from ".concat(p," (").concat(x.message,"), trying fallback URL: ").concat(N)),A.wasmBinary=null,A.setWasmUrl(N),A.loadRuntime();else {var w=E?"the configured WASM URL or its fallback (".concat(N,")"):p,C=["Could not load Rive WASM file from ".concat(w,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
10
+ Error details:`,"- Type: ".concat(x.type),"- Message: ".concat(x.message),"- WebAssembly-specific error: ".concat(x.wasmError),`
11
+ To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.awaitInstance() again"].join(`
12
+ `);console.error(C),A.notifyError(new Error(C));}});},A.getInstance=function(p,_){A.isLoading||(A.isLoading=true,A.loadRuntime()),A.runtime?p(A.runtime):(A.callBackQueue.push(p),_&&A.errorCallbackQueue.push(_));},A.awaitInstance=function(){return new Promise(function(p,_){return A.getInstance(p,_)})},A.setWasmUrl=function(p){A.wasmURL=p;},A.getWasmUrl=function(){return A.wasmURL},A.setWasmFallbackUrl=function(p){A.wasmFallbackURL=p;},A.getWasmFallbackUrl=function(){return A.wasmFallbackURL},A.setWasmBinary=function(p){if(p instanceof ArrayBuffer||p===null){A.wasmBinary=p;return}console.error("setWasmBinary expects an ArrayBuffer or null");},A.getWasmBinary=function(){return A.wasmBinary},A.isLoading=false,A.callBackQueue=[],A.wasmURL="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/rive.wasm"),A.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(d.name,"@").concat(d.version,"/rive_fallback.wasm"),A.wasmBinary=null,A.errorCallbackQueue=[],A.enablePerfMarks=false,A})();}),((r,a,s)=>{s.r(a),s.d(a,{default:()=>d});var u=(()=>{var g=typeof document<"u"?document.currentScript?.src:void 0;return(function(v={}){var A,p=v,_,T,x=new Promise((o,l)=>{_=o,T=l;}),N=typeof window=="object",E=typeof importScripts=="function";function w(){function o(k){let P=h;f=l=0,h=new Map,P.forEach(W=>{try{W(k);}catch(G){console.error(G);}}),this.mb(),b&&b.Nb();}let l=0,f=0,h=new Map,b=null,S=null;this.requestAnimationFrame=function(k){l||(l=requestAnimationFrame(o.bind(this)));let P=++f;return h.set(P,k),P},this.cancelAnimationFrame=function(k){h.delete(k),l&&h.size==0&&(cancelAnimationFrame(l),l=0);},this.Lb=function(k){S&&(document.body.remove(S),S=null),k||(S=document.createElement("div"),S.style.backgroundColor="black",S.style.position="fixed",S.style.right=0,S.style.top=0,S.style.color="white",S.style.padding="4px",S.innerHTML="RIVE FPS",k=function(P){S.innerHTML="RIVE FPS "+P.toFixed(1);},document.body.appendChild(S)),b=new function(){let P=0,W=0;this.Nb=function(){var G=performance.now();W?(++P,G-=W,1e3<G&&(k(1e3*P/G),P=W=0)):(W=G,P=0);};};},this.mb=function(){};}function C(){console.assert(true);let o=new Map,l=-1/0;this.push=function(f){return f=f+255>>8,o.has(f)&&clearTimeout(o.get(f)),o.set(f,setTimeout(function(){o.delete(f),o.length==0?l=-1/0:f==l&&(l=Math.max(...o.keys()),console.assert(l<f));},1e3)),l=Math.max(f,l),l<<8};}let I=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){I&&I();let o=p.decodeAudio;p.decodeAudio=function(S,k){S=o(S),k(S);};let l=p.decodeFont;p.decodeFont=function(S,k){S=l(S),k(S);};let f=p.setFallbackFontCb;p.setFallbackFontCallback=typeof f=="function"?function(S){f(S);}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");};let h=p.FileAssetLoader;p.ptrToAsset=S=>{let k=p.ptrToFileAsset(S);return k.isImage?p.ptrToImageAsset(S):k.isFont?p.ptrToFontAsset(S):k.isAudio?p.ptrToAudioAsset(S):k},p.CustomFileAssetLoader=h.extend("CustomFileAssetLoader",{__construct:function({loadContents:S}){this.__parent.__construct.call(this),this.Bb=S;},loadContents:function(S,k){return S=p.ptrToAsset(S),this.Bb(S,k)}}),p.CDNFileAssetLoader=h.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);},loadContents:function(S){let k=p.ptrToAsset(S);return S=k.cdnUuid,S===""?false:((function(P,W){var G=new XMLHttpRequest;G.responseType="arraybuffer",G.onreadystatechange=function(){G.readyState==4&&G.status==200&&W(G);},G.open("GET",P,true),G.send(null);})(k.cdnBaseUrl+"/"+S,P=>{k.decode(new Uint8Array(P.response));}),true)}}),p.FallbackFileAssetLoader=h.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.ib=[];},addLoader:function(S){this.ib.push(S);},loadContents:function(S,k){for(let P of this.ib)if(P.loadContents(S,k))return true;return false}});let b=p.computeAlignment;p.computeAlignment=function(S,k,P,W,G=1){return b.call(this,S,k,P,W,G)};};let V=p.onRuntimeInitialized;p.onRuntimeInitialized=function(){function o(ie){this.G=ie,this.Ab=ie.getContext("2d"),this.Eb=h,this.S=[],this.ja=0,this.clear=function(){console.assert(this.ja==0),this.S=[],b.delete(this);},this.save=function(){++this.ja,this.S.push(h.save.bind(h));},this.restore=function(){0<this.ja&&(this.S.push(h.restore.bind(h)),--this.ja);},this.transform=function(se){this.S.push(h.transform.bind(h,se));},this.align=function(se,Le,Fe,Je,It=1){this.S.push(h.align.bind(h,se,Le,Fe,Je,It));},this.flush=function(){console.assert(this.ja==0),b.add(this),h.Ya||f();},this.delete=function(){};}function l(ie,se=false){var Le={alpha:true,depth:se,stencil:se,antialias:se,premultipliedAlpha:true,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:false,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};if(se=ie.getContext("webgl2",Le),!se)return null;Le=YT(se,Le),Jh(Le);let Fe=S(ie.width,ie.height);Fe.Ma=Le,Fe.G=ie,Fe.Na=ie.width,Fe.Za=ie.height,Fe.T=se;var Je=Fe.delete;return Fe.delete=function(){Je.call(this);var It=this.Ma;cr===yn[It]&&(cr=null),typeof JSEvents=="object"&&JSEvents.Qc(yn[It].F.canvas),yn[It]&&yn[It].F.canvas&&(yn[It].F.canvas.zb=void 0),this.Ma=this.G=this.Na=this.T=yn[It]=null;},Fe}function f(){if(h){var ie=h.Db,se=0,Le=0,Fe=0,Je=Array(b.size),It=0;for(var qt of b)qt.ea=Math.min(qt.G.width,ie),qt.da=Math.min(qt.G.height,ie),qt.Ka=qt.da*qt.ea,se=Math.max(se,qt.ea),Le=Math.max(Le,qt.da),Fe+=qt.Ka,Je[It++]=qt;if(b.clear(),!(0>=Fe)){for(se=1<<(0>=se?0:32-Math.clz32(se-1)),Le=1<<(0>=Le?0:32-Math.clz32(Le-1));Le*se<Fe;)se<=Le?se*=2:Le*=2;for(se=Math.min(se,ie),se=Math.min(Le,ie),Je.sort((dr,rp)=>rp.Ka-dr.Ka),Fe=new p.DynamicRectanizer(ie),qt=0;qt<Je.length;){for(Fe.reset(se,Le),It=qt;It<Je.length;++It){var Xt=Je[It],Nt=Fe.addRect(Xt.ea,Xt.da);if(0>Nt){console.assert(It>qt);break}Xt.pa=Nt&65535,Xt.qa=Nt>>16;}for(Xt=W.push(Fe.drawWidth()),Nt=G.push(Fe.drawHeight()),console.assert(Xt>=Fe.drawWidth()),console.assert(Nt>=Fe.drawHeight()),console.assert(Xt<=ie),console.assert(Nt<=ie),h.G.width!=Xt&&(h.G.width=Xt),h.G.height!=Nt&&(h.G.height=Nt),h.clear(),Xt=qt;Xt<It;++Xt){Nt=Je[Xt],h.saveClipRect(Nt.pa,Nt.qa,Nt.pa+Nt.ea,Nt.qa+Nt.da);let dr=new p.Mat2D;dr.xx=Nt.ea/Nt.G.width,dr.yy=Nt.da/Nt.G.height,dr.xy=dr.yx=0,dr.tx=Nt.pa,dr.ty=Nt.qa,h.transform(dr);for(let rp of Nt.S)rp();h.restoreClipRect(),Nt.S=[];}for(h.flush();qt<It;++qt)Xt=Je[qt],Nt=Xt.Ab,Nt.globalCompositeOperation="copy",Nt.drawImage(h.G,Xt.pa,Xt.qa,Xt.ea,Xt.da,0,0,Xt.G.width,Xt.G.height);qt=It;}}}}V&&V();let h=null,b=new Set,S=p.makeRenderer;p.makeRenderer=function(ie,se){if(!h){let Le=function(Fe){var Je=document.createElement("canvas");return Je.width=1,Je.height=1,h=l(Je,Fe),h?(h.Ya=!!h.T.getExtension("WEBGL_shader_pixel_local_storage"),h.Db=Math.min(h.T.getParameter(h.T.MAX_RENDERBUFFER_SIZE),h.T.getParameter(h.T.MAX_TEXTURE_SIZE)),h.La=!h.Ya,(Fe=h.T.getExtension("WEBGL_debug_renderer_info"))&&(Je=h.T.getParameter(Fe.UNMASKED_RENDERER_WEBGL),h.T.getParameter(Fe.UNMASKED_VENDOR_WEBGL).includes("Google")&&Je.includes("ANGLE Metal Renderer")&&(h.La=false)),h):null};if(h=Le(true),!h)throw "Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";h.La||(h=Le(false));}return se?new o(ie):l(ie,h.La)};let k=p.Artboard.prototype.delete;p.Artboard.prototype.delete=function(){this.Fb=true,k.call(this);};let P=p.Artboard.prototype.draw;p.Artboard.prototype.draw=function(ie){ie.S?ie.S.push(()=>{this.Fb||P.call(this,ie.Eb);}):P.call(this,ie);};let W=new C,G=new C,re=new w;p.requestAnimationFrame=re.requestAnimationFrame.bind(re),p.cancelAnimationFrame=re.cancelAnimationFrame.bind(re),p.enableFPSCounter=re.Lb.bind(re),re.mb=f,p.resolveAnimationFrame=f;let Ce=p.load;p.load=function(ie,se,Le=true){let Fe=new p.FallbackFileAssetLoader;return se!==void 0&&Fe.addLoader(se),Le&&(se=new p.CDNFileAssetLoader,Fe.addLoader(se)),Promise.resolve(Ce(ie,Fe))};let Oe=p.WebGL2Renderer.prototype.clear;p.WebGL2Renderer.prototype.clear=function(){Jh(this.Ma);let ie=this.G;(this.Na!=ie.width||this.Za!=ie.height)&&(this.resize(ie.width,ie.height),this.Na=ie.width,this.Za=ie.height),Oe.call(this);},p.decodeImage=function(ie,se){ie=p.decodeWebGL2Image(ie),se(ie);};let j=p.Renderer.prototype.align;p.Renderer.prototype.align=function(ie,se,Le,Fe,Je=1){j.call(this,ie,se,Le,Fe,Je);};};var K=Object.assign({},p),F="./this.program",H="",J,Y;(N||E)&&(E?H=self.location.href:typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),g&&(H=g),H.startsWith("blob:")?H="":H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1),E&&(Y=o=>{var l=new XMLHttpRequest;return l.open("GET",o,false),l.responseType="arraybuffer",l.send(null),new Uint8Array(l.response)}),J=(o,l,f)=>{if(ye(o)){var h=new XMLHttpRequest;h.open("GET",o,true),h.responseType="arraybuffer",h.onload=()=>{h.status==200||h.status==0&&h.response?l(h.response):f();},h.onerror=f,h.send(null);}else fetch(o,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url))).then(l,f);});var Me=p.print||console.log.bind(console),Re=p.printErr||console.error.bind(console);Object.assign(p,K),K=null,p.thisProgram&&(F=p.thisProgram);var he;p.wasmBinary&&(he=p.wasmBinary);var De,fe=false,Q,te,D,U,z,X,oe,ge;function be(){var o=De.buffer;p.HEAP8=Q=new Int8Array(o),p.HEAP16=D=new Int16Array(o),p.HEAPU8=te=new Uint8Array(o),p.HEAPU16=U=new Uint16Array(o),p.HEAP32=z=new Int32Array(o),p.HEAPU32=X=new Uint32Array(o),p.HEAPF32=oe=new Float32Array(o),p.HEAPF64=ge=new Float64Array(o);}var _e=[],ve=[],He=[];function ct(){var o=p.preRun.shift();_e.unshift(o);}var ot=0,Ae=null;function ze(o){throw p.onAbort?.(o),o="Aborted("+o+")",Re(o),fe=true,o=new WebAssembly.RuntimeError(o+". Build with -sASSERTIONS for more info."),T(o),o}var xe=o=>o.startsWith("data:application/octet-stream;base64,"),ye=o=>o.startsWith("file://"),Ye;function Xe(o){if(o==Ye&&he)return new Uint8Array(he);if(Y)return Y(o);throw "both async and sync fetching of the wasm failed"}function qe(o){return he?Promise.resolve().then(()=>Xe(o)):new Promise((l,f)=>{J(o,h=>l(new Uint8Array(h)),()=>{try{l(Xe(o));}catch(h){f(h);}});})}function _t(o,l,f){return qe(o).then(h=>WebAssembly.instantiate(h,l)).then(f,h=>{Re(`failed to asynchronously prepare wasm: ${h}`),ze(h);})}function Tt(o,l){var f=Ye;return he||typeof WebAssembly.instantiateStreaming!="function"||xe(f)||ye(f)||typeof fetch!="function"?_t(f,o,l):fetch(f,{credentials:"same-origin"}).then(h=>WebAssembly.instantiateStreaming(h,o).then(l,function(b){return Re(`wasm streaming compile failed: ${b}`),Re("falling back to ArrayBuffer instantiation"),_t(f,o,l)}))}var mt,gt,Qe={570520:(o,l,f,h,b)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.h>"u"){window.h={Fa:0},window.h.I={},window.h.I.Ca=o,window.h.I.capture=l,window.h.I.Pa=f,window.h.ha={},window.h.ha.stopped=h,window.h.ha.ub=b;let S=window.h;S.C=[],S.mc=function(k){for(var P=0;P<S.C.length;++P)if(S.C[P]==null)return S.C[P]=k,P;return S.C.push(k),S.C.length-1},S.yb=function(k){for(S.C[k]=null;0<S.C.length&&S.C[S.C.length-1]==null;)S.C.pop();},S.Tc=function(k){for(var P=0;P<S.C.length;++P)if(S.C[P]==k)return S.yb(P)},S.ta=function(k){return S.C[k]},S.Xa=["touchend","click"],S.unlock=function(){for(var k=0;k<S.C.length;++k){var P=S.C[k];P!=null&&P.K!=null&&P.state===S.ha.ub&&P.K.resume().then(()=>{qA(P.nb);},W=>{console.error("Failed to resume audiocontext",W);});}S.Xa.map(function(W){document.removeEventListener(W,S.unlock,true);});},S.Xa.map(function(k){document.addEventListener(k,S.unlock,true);});}return window.h.Fa+=1,1},572698:()=>{typeof window.h<"u"&&(window.h.Xa.map(function(o){document.removeEventListener(o,window.h.unlock,true);}),--window.h.Fa,window.h.Fa===0&&delete window.h);},573002:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,573106:()=>{try{var o=new(window.AudioContext||window.webkitAudioContext),l=o.sampleRate;return o.close(),l}catch{return 0}},573277:(o,l,f,h,b,S)=>{if(typeof window.h>"u")return -1;var k={},P={};return o==window.h.I.Ca&&f!=0&&(P.sampleRate=f),k.K=new(window.AudioContext||window.webkitAudioContext)(P),k.K.suspend(),k.state=window.h.ha.stopped,f=0,o!=window.h.I.Ca&&(f=l),k.Y=k.K.createScriptProcessor(h,f,l),k.Y.onaudioprocess=function(W){if((k.ua==null||k.ua.length==0)&&(k.ua=new Float32Array(oe.buffer,b,h*l)),o==window.h.I.capture||o==window.h.I.Pa){for(var G=0;G<l;G+=1)for(var re=W.inputBuffer.getChannelData(G),Ce=k.ua,Oe=0;Oe<h;Oe+=1)Ce[Oe*l+G]=re[Oe];XA(S,h,b);}if(o==window.h.I.Ca||o==window.h.I.Pa)for(QA(S,h,b),G=0;G<W.outputBuffer.numberOfChannels;++G)for(re=W.outputBuffer.getChannelData(G),Ce=k.ua,Oe=0;Oe<h;Oe+=1)re[Oe]=Ce[Oe*l+G];else for(G=0;G<W.outputBuffer.numberOfChannels;++G)W.outputBuffer.getChannelData(G).fill(0);},o!=window.h.I.capture&&o!=window.h.I.Pa||navigator.mediaDevices.getUserMedia({audio:true,video:false}).then(function(W){k.Ga=k.K.createMediaStreamSource(W),k.Ga.connect(k.Y),k.Y.connect(k.K.destination);}).catch(function(W){console.log("Failed to get user media: "+W);}),o==window.h.I.Ca&&k.Y.connect(k.K.destination),k.nb=S,window.h.mc(k)},576154:o=>window.h.ta(o).K.sampleRate,576227:o=>{o=window.h.ta(o),o.Y!==void 0&&(o.Y.onaudioprocess=function(){},o.Y.disconnect(),o.Y=void 0),o.Ga!==void 0&&(o.Ga.disconnect(),o.Ga=void 0),o.K.close(),o.K=void 0,o.nb=void 0;},576627:o=>{window.h.yb(o);},576677:o=>{o=window.h.ta(o),o.K.resume(),o.state=window.h.ha.ub;},576816:o=>{o=window.h.ta(o),o.K.suspend(),o.state=window.h.ha.stopped;}},pe=o=>{for(;0<o.length;)o.shift()(p);};function y(){var o=z[+Da>>2];return Da+=4,o}var c=(o,l)=>{for(var f=0,h=o.length-1;0<=h;h--){var b=o[h];b==="."?o.splice(h,1):b===".."?(o.splice(h,1),f++):f&&(o.splice(h,1),f--);}if(l)for(;f;f--)o.unshift("..");return o},m=o=>{var l=o.charAt(0)==="/",f=o.substr(-1)==="/";return (o=c(o.split("/").filter(h=>!!h),!l).join("/"))||l||(o="."),o&&f&&(o+="/"),(l?"/":"")+o},M=o=>{var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(o).slice(1);return o=l[0],l=l[1],!o&&!l?".":(l&&(l=l.substr(0,l.length-1)),o+l)},O=o=>{if(o==="/")return "/";o=m(o),o=o.replace(/\/$/,"");var l=o.lastIndexOf("/");return l===-1?o:o.substr(l+1)},B=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return o=>crypto.getRandomValues(o);ze("initRandomDevice");},q=o=>(q=B())(o),le=(...o)=>{for(var l="",f=false,h=o.length-1;-1<=h&&!f;h--){if(f=0<=h?o[h]:"/",typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!f)return "";l=f+"/"+l,f=f.charAt(0)==="/";}return l=c(l.split("/").filter(b=>!!b),!f).join("/"),(f?"/":"")+l||"."},Ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,de=(o,l,f)=>{var h=l+f;for(f=l;o[f]&&!(f>=h);)++f;if(16<f-l&&o.buffer&&Ne)return Ne.decode(o.subarray(l,f));for(h="";l<f;){var b=o[l++];if(b&128){var S=o[l++]&63;if((b&224)==192)h+=String.fromCharCode((b&31)<<6|S);else {var k=o[l++]&63;b=(b&240)==224?(b&15)<<12|S<<6|k:(b&7)<<18|S<<12|k<<6|o[l++]&63,65536>b?h+=String.fromCharCode(b):(b-=65536,h+=String.fromCharCode(55296|b>>10,56320|b&1023));}}else h+=String.fromCharCode(b);}return h},ke=[],vt=o=>{for(var l=0,f=0;f<o.length;++f){var h=o.charCodeAt(f);127>=h?l++:2047>=h?l+=2:55296<=h&&57343>=h?(l+=4,++f):l+=3;}return l},ft=(o,l,f,h)=>{if(!(0<h))return 0;var b=f;h=f+h-1;for(var S=0;S<o.length;++S){var k=o.charCodeAt(S);if(55296<=k&&57343>=k){var P=o.charCodeAt(++S);k=65536+((k&1023)<<10)|P&1023;}if(127>=k){if(f>=h)break;l[f++]=k;}else {if(2047>=k){if(f+1>=h)break;l[f++]=192|k>>6;}else {if(65535>=k){if(f+2>=h)break;l[f++]=224|k>>12;}else {if(f+3>=h)break;l[f++]=240|k>>18,l[f++]=128|k>>12&63;}l[f++]=128|k>>6&63;}l[f++]=128|k&63;}}return l[f]=0,f-b};function Ke(o,l){var f=Array(vt(o)+1);return o=ft(o,f,0,f.length),l&&(f.length=o),f}var Gt=[];function rn(o,l){Gt[o]={input:[],H:[],V:l},et(o,$e);}var $e={open(o){var l=Gt[o.node.Ea];if(!l)throw new we(43);o.s=l,o.seekable=false;},close(o){o.s.V.sa(o.s);},sa(o){o.s.V.sa(o.s);},read(o,l,f,h){if(!o.s||!o.s.V.hb)throw new we(60);for(var b=0,S=0;S<h;S++){try{var k=o.s.V.hb(o.s);}catch{throw new we(29)}if(k===void 0&&b===0)throw new we(6);if(k==null)break;b++,l[f+S]=k;}return b&&(o.node.timestamp=Date.now()),b},write(o,l,f,h){if(!o.s||!o.s.V.Sa)throw new we(60);try{for(var b=0;b<h;b++)o.s.V.Sa(o.s,l[f+b]);}catch{throw new we(29)}return h&&(o.node.timestamp=Date.now()),b}},an={hb(){e:{if(!ke.length){var o=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(o=window.prompt("Input: "),o!==null&&(o+=`
13
+ `)),!o){o=null;break e}ke=Ke(o,true);}o=ke.shift();}return o},Sa(o,l){l===null||l===10?(Me(de(o.H,0)),o.H=[]):l!=0&&o.H.push(l);},sa(o){o.H&&0<o.H.length&&(Me(de(o.H,0)),o.H=[]);},Wb(){return {xc:25856,zc:5,wc:191,yc:35387,vc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Xb(){return 0},Yb(){return [24,80]}},Wt={Sa(o,l){l===null||l===10?(Re(de(o.H,0)),o.H=[]):l!=0&&o.H.push(l);},sa(o){o.H&&0<o.H.length&&(Re(de(o.H,0)),o.H=[]);}};function jt(o,l){var f=o.l?o.l.length:0;f>=l||(l=Math.max(l,f*(1048576>f?2:1.125)>>>0),f!=0&&(l=Math.max(l,256)),f=o.l,o.l=new Uint8Array(l),0<o.v&&o.l.set(f.subarray(0,o.v),0));}var Ie={N:null,U(){return Ie.createNode(null,"/",16895,0)},createNode(o,l,f,h){if((f&61440)===24576||(f&61440)===4096)throw new we(63);return Ie.N||(Ie.N={dir:{node:{X:Ie.j.X,P:Ie.j.P,ka:Ie.j.ka,Aa:Ie.j.Aa,sb:Ie.j.sb,xb:Ie.j.xb,tb:Ie.j.tb,rb:Ie.j.rb,Ha:Ie.j.Ha},stream:{aa:Ie.m.aa}},file:{node:{X:Ie.j.X,P:Ie.j.P},stream:{aa:Ie.m.aa,read:Ie.m.read,write:Ie.m.write,$a:Ie.m.$a,jb:Ie.m.jb,lb:Ie.m.lb}},link:{node:{X:Ie.j.X,P:Ie.j.P,la:Ie.j.la},stream:{}},ab:{node:{X:Ie.j.X,P:Ie.j.P},stream:dt}}),f=Hr(o,l,f,h),(f.mode&61440)===16384?(f.j=Ie.N.dir.node,f.m=Ie.N.dir.stream,f.l={}):(f.mode&61440)===32768?(f.j=Ie.N.file.node,f.m=Ie.N.file.stream,f.v=0,f.l=null):(f.mode&61440)===40960?(f.j=Ie.N.link.node,f.m=Ie.N.link.stream):(f.mode&61440)===8192&&(f.j=Ie.N.ab.node,f.m=Ie.N.ab.stream),f.timestamp=Date.now(),o&&(o.l[l]=f,o.timestamp=f.timestamp),f},Fc(o){return o.l?o.l.subarray?o.l.subarray(0,o.v):new Uint8Array(o.l):new Uint8Array(0)},j:{X(o){var l={};return l.Cc=(o.mode&61440)===8192?o.id:1,l.Hc=o.id,l.mode=o.mode,l.Nc=1,l.uid=0,l.Gc=0,l.Ea=o.Ea,(o.mode&61440)===16384?l.size=4096:(o.mode&61440)===32768?l.size=o.v:(o.mode&61440)===40960?l.size=o.link.length:l.size=0,l.tc=new Date(o.timestamp),l.Mc=new Date(o.timestamp),l.Ac=new Date(o.timestamp),l.Gb=4096,l.uc=Math.ceil(l.size/l.Gb),l},P(o,l){if(l.mode!==void 0&&(o.mode=l.mode),l.timestamp!==void 0&&(o.timestamp=l.timestamp),l.size!==void 0&&(l=l.size,o.v!=l))if(l==0)o.l=null,o.v=0;else {var f=o.l;o.l=new Uint8Array(l),f&&o.l.set(f.subarray(0,Math.min(l,o.v))),o.v=l;}},ka(){throw Jn[44]},Aa(o,l,f,h){return Ie.createNode(o,l,f,h)},sb(o,l,f){if((o.mode&61440)===16384){try{var h=rr(l,f);}catch{}if(h)for(var b in h.l)throw new we(55)}delete o.parent.l[o.name],o.parent.timestamp=Date.now(),o.name=f,l.l[f]=o,l.timestamp=o.parent.timestamp;},xb(o,l){delete o.l[l],o.timestamp=Date.now();},tb(o,l){var f=rr(o,l),h;for(h in f.l)throw new we(55);delete o.l[l],o.timestamp=Date.now();},rb(o){var l=[".",".."],f;for(f of Object.keys(o.l))l.push(f);return l},Ha(o,l,f){return o=Ie.createNode(o,l,41471,0),o.link=f,o},la(o){if((o.mode&61440)!==40960)throw new we(28);return o.link}},m:{read(o,l,f,h,b){var S=o.node.l;if(b>=o.node.v)return 0;if(o=Math.min(o.node.v-b,h),8<o&&S.subarray)l.set(S.subarray(b,b+o),f);else for(h=0;h<o;h++)l[f+h]=S[b+h];return o},write(o,l,f,h,b,S){if(l.buffer===Q.buffer&&(S=false),!h)return 0;if(o=o.node,o.timestamp=Date.now(),l.subarray&&(!o.l||o.l.subarray)){if(S)return o.l=l.subarray(f,f+h),o.v=h;if(o.v===0&&b===0)return o.l=l.slice(f,f+h),o.v=h;if(b+h<=o.v)return o.l.set(l.subarray(f,f+h),b),h}if(jt(o,b+h),o.l.subarray&&l.subarray)o.l.set(l.subarray(f,f+h),b);else for(S=0;S<h;S++)o.l[b+S]=l[f+S];return o.v=Math.max(o.v,b+h),h},aa(o,l,f){if(f===1?l+=o.position:f===2&&(o.node.mode&61440)===32768&&(l+=o.node.v),0>l)throw new we(28);return l},$a(o,l,f){jt(o.node,l+f),o.node.v=Math.max(o.node.v,l+f);},jb(o,l,f,h,b){if((o.node.mode&61440)!==32768)throw new we(43);if(o=o.node.l,b&2||o.buffer!==Q.buffer){if((0<f||f+l<o.length)&&(o.subarray?o=o.subarray(f,f+l):o=Array.prototype.slice.call(o,f,f+l)),f=true,ze(),l=void 0,!l)throw new we(48);Q.set(o,l);}else f=false,l=o.byteOffset;return {o:l,sc:f}},lb(o,l,f,h){return Ie.m.write(o,l,0,h,f,false),0}}},zi=(o,l)=>{var f=0;return o&&(f|=365),l&&(f|=146),f},Kn=null,L={},Ri=[],Fr=1,Zn=null,Gi=true,we=class{constructor(o){this.name="ErrnoError",this.$=o;}},Jn={},Vr=class{constructor(){this.h={},this.node=null;}get flags(){return this.h.flags}set flags(o){this.h.flags=o;}get position(){return this.h.position}set position(o){this.h.position=o;}},Na=class{constructor(o,l,f,h){o||(o=this),this.parent=o,this.U=o.U,this.Ba=null,this.id=Fr++,this.name=l,this.mode=f,this.j={},this.m={},this.Ea=h;}get read(){return (this.mode&365)===365}set read(o){o?this.mode|=365:this.mode&=-366;}get write(){return (this.mode&146)===146}set write(o){o?this.mode|=146:this.mode&=-147;}};function fi(o,l={}){if(o=le(o),!o)return {path:"",node:null};if(l=Object.assign({gb:true,Ua:0},l),8<l.Ua)throw new we(32);o=o.split("/").filter(k=>!!k);for(var f=Kn,h="/",b=0;b<o.length;b++){var S=b===o.length-1;if(S&&l.parent)break;if(f=rr(f,o[b]),h=m(h+"/"+o[b]),f.Ba&&(!S||S&&l.gb)&&(f=f.Ba.root),!S||l.fb){for(S=0;(f.mode&61440)===40960;)if(f=Oh(h),h=le(M(h),f),f=fi(h,{Ua:l.Ua+1}).node,40<S++)throw new we(32)}}return {path:h,node:f}}function ir(o){for(var l;;){if(o===o.parent)return o=o.U.kb,l?o[o.length-1]!=="/"?`${o}/${l}`:o+l:o;l=l?`${o.name}/${l}`:o.name,o=o.parent;}}function wo(o,l){for(var f=0,h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h)|0;return (o+f>>>0)%Zn.length}function rr(o,l){var f=(o.mode&61440)===16384?(f=Te(o,"x"))?f:o.j.ka?0:2:54;if(f)throw new we(f);for(f=Zn[wo(o.id,l)];f;f=f.ac){var h=f.name;if(f.parent.id===o.id&&h===l)return f}return o.j.ka(o,l)}function Hr(o,l,f,h){return o=new Na(o,l,f,h),l=wo(o.parent.id,o.name),o.ac=Zn[l],Zn[l]=o}function ne(o){var l=["r","w","rw"][o&3];return o&512&&(l+="w"),l}function Te(o,l){if(Gi)return 0;if(!l.includes("r")||o.mode&292){if(l.includes("w")&&!(o.mode&146)||l.includes("x")&&!(o.mode&73))return 2}else return 2;return 0}function Pe(o,l){try{return rr(o,l),20}catch{}return Te(o,"wx")}function Ge(o){if(o=Ri[o],!o)throw new we(8);return o}function ht(o,l=-1){if(o=Object.assign(new Vr,o),l==-1)e:{for(l=0;4096>=l;l++)if(!Ri[l])break e;throw new we(33)}return o.W=l,Ri[l]=o}function Jt(o,l=-1){return o=ht(o,l),o.m?.Ec?.(o),o}var dt={open(o){o.m=L[o.node.Ea].m,o.m.open?.(o);},aa(){throw new we(70)}};function et(o,l){L[o]={m:l};}function Ct(o,l){var f=l==="/";if(f&&Kn)throw new we(10);if(!f&&l){var h=fi(l,{gb:false});if(l=h.path,h=h.node,h.Ba)throw new we(10);if((h.mode&61440)!==16384)throw new we(54)}l={type:o,Pc:{},kb:l,Zb:[]},o=o.U(l),o.U=l,l.root=o,f?Kn=o:h&&(h.Ba=l,h.U&&h.U.Zb.push(l));}function Ot(o,l,f){var h=fi(o,{parent:true}).node;if(o=O(o),!o||o==="."||o==="..")throw new we(28);var b=Pe(h,o);if(b)throw new we(b);if(!h.j.Aa)throw new we(63);return h.j.Aa(h,o,l,f)}function St(o){return Ot(o,16895,0)}function gn(o,l,f){typeof f>"u"&&(f=l,l=438),Ot(o,l|8192,f);}function ar(o,l){if(!le(o))throw new we(44);var f=fi(l,{parent:true}).node;if(!f)throw new we(44);l=O(l);var h=Pe(f,l);if(h)throw new we(h);if(!f.j.Ha)throw new we(63);f.j.Ha(f,l,o);}function Oh(o){if(o=fi(o).node,!o)throw new we(44);if(!o.j.la)throw new we(28);return le(ir(o.parent),o.j.la(o))}function Eo(o,l,f){if(o==="")throw new we(44);if(typeof l=="string"){var h={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[l];if(typeof h>"u")throw Error(`Unknown file open mode: ${l}`);l=h;}if(f=l&64?(typeof f>"u"?438:f)&4095|32768:0,typeof o=="object")var b=o;else {o=m(o);try{b=fi(o,{fb:!(l&131072)}).node;}catch{}}if(h=false,l&64)if(b){if(l&128)throw new we(20)}else b=Ot(o,f,0),h=true;if(!b)throw new we(44);if((b.mode&61440)===8192&&(l&=-513),l&65536&&(b.mode&61440)!==16384)throw new we(54);if(!h&&(f=b?(b.mode&61440)===40960?32:(b.mode&61440)===16384&&(ne(l)!=="r"||l&512)?31:Te(b,ne(l)):44))throw new we(f);if(l&512&&!h){if(f=b,f=typeof f=="string"?fi(f,{fb:true}).node:f,!f.j.P)throw new we(63);if((f.mode&61440)===16384)throw new we(31);if((f.mode&61440)!==32768)throw new we(28);if(h=Te(f,"w"))throw new we(h);f.j.P(f,{size:0,timestamp:Date.now()});}return l&=-131713,b=ht({node:b,path:ir(b),flags:l,seekable:true,position:0,m:b.m,nc:[],error:false}),b.m.open&&b.m.open(b),!p.logReadFiles||l&1||(Qs||(Qs={}),o in Qs||(Qs[o]=1)),b}function Ju(o,l,f){if(o.W===null)throw new we(8);if(!o.seekable||!o.m.aa)throw new we(70);if(f!=0&&f!=1&&f!=2)throw new we(28);o.position=o.m.aa(o,l,f),o.nc=[];}var $u;function La(o,l,f){o=m("/dev/"+o);var h=zi(!!l,!!f);ec||(ec=64);var b=ec++<<8|0;et(b,{open(S){S.seekable=false;},close(){f?.buffer?.length&&f(10);},read(S,k,P,W){for(var G=0,re=0;re<W;re++){try{var Ce=l();}catch{throw new we(29)}if(Ce===void 0&&G===0)throw new we(6);if(Ce==null)break;G++,k[P+re]=Ce;}return G&&(S.node.timestamp=Date.now()),G},write(S,k,P,W){for(var G=0;G<W;G++)try{f(k[P+G]);}catch{throw new we(29)}return W&&(S.node.timestamp=Date.now()),G}}),gn(o,h,b);}var ec,or={},Qs,Da=void 0,zr=(o,l)=>Object.defineProperty(l,"name",{value:o}),Ks=[],xi=[],Ue,$n=o=>{if(!o)throw new Ue("Cannot use deleted val. handle = "+o);return xi[o]},ki=o=>{switch(o){case void 0:return 2;case null:return 4;case true:return 6;case false:return 8;default:let l=Ks.pop()||xi.length;return xi[l]=o,xi[l+1]=1,l}},tc=o=>{var l=Error,f=zr(o,function(h){this.name=o,this.message=h,h=Error(h).stack,h!==void 0&&(this.stack=this.toString()+`
14
+ `+h.replace(/^Error(:[^\n]*)?\n/,""));});return f.prototype=Object.create(l.prototype),f.prototype.constructor=f,f.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},f},nc,ic,Zt=o=>{for(var l="";te[o];)l+=ic[te[o++]];return l},Ba=[],Mo=()=>{for(;Ba.length;){var o=Ba.pop();o.g.ga=false,o.delete();}},Gr,di={},Wr=(o,l)=>{if(l===void 0)throw new Ue("ptr should not be undefined");for(;o.B;)l=o.na(l),o=o.B;return l},sr={},Zs=o=>{o=YA(o);var l=Zt(o);return fr(o),l},jr=(o,l)=>{var f=sr[o];if(f===void 0)throw o=`${l} has unknown type ${Zs(o)}`,new Ue(o);return f},Ua=()=>{},To=false,rc=(o,l,f)=>l===f?o:f.B===void 0?null:(o=rc(o,l,f.B),o===null?null:f.Jb(o)),ac={},Ih=(o,l)=>(l=Wr(o,l),di[l]),Fa,Co=(o,l)=>{if(!l.u||!l.o)throw new Fa("makeClassHandle requires ptr and ptrType");if(!!l.J!=!!l.D)throw new Fa("Both smartPtrType and smartPtr must be specified");return l.count={value:1},Yr(Object.create(o,{g:{value:l,writable:true}}))},Yr=o=>typeof FinalizationRegistry>"u"?(Yr=l=>l,o):(To=new FinalizationRegistry(l=>{l=l.g,--l.count.value,l.count.value===0&&(l.D?l.J.O(l.D):l.u.i.O(l.o));}),Yr=l=>{var f=l.g;return f.D&&To.register(l,{g:f},l),l},Ua=l=>{To.unregister(l);},Yr(o)),Ro={},Va=o=>{for(;o.length;){var l=o.pop();o.pop()(l);}};function lr(o){return this.fromWireType(X[o>>2])}var qr={},xo={},kn=(o,l,f)=>{function h(P){if(P=f(P),P.length!==o.length)throw new Fa("Mismatched type converter count");for(var W=0;W<o.length;++W)hi(o[W],P[W]);}o.forEach(function(P){xo[P]=l;});var b=Array(l.length),S=[],k=0;l.forEach((P,W)=>{sr.hasOwnProperty(P)?b[W]=sr[P]:(S.push(P),qr.hasOwnProperty(P)||(qr[P]=[]),qr[P].push(()=>{b[W]=sr[P],++k,k===S.length&&h(b);}));}),S.length===0&&h(b);};function Ph(o,l,f={}){var h=l.name;if(!o)throw new Ue(`type "${h}" must have a positive integer typeid pointer`);if(sr.hasOwnProperty(o)){if(f.Tb)return;throw new Ue(`Cannot register type '${h}' twice`)}sr[o]=l,delete xo[o],qr.hasOwnProperty(o)&&(l=qr[o],delete qr[o],l.forEach(b=>b()));}function hi(o,l,f={}){if(!("argPackAdvance"in l))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ph(o,l,f)}var ko=o=>{throw new Ue(o.g.u.i.name+" instance already deleted")};function Oo(){}var Js=(o,l,f)=>{if(o[l].A===void 0){var h=o[l];o[l]=function(...b){if(!o[l].A.hasOwnProperty(b.length))throw new Ue(`Function '${f}' called with an invalid number of arguments (${b.length}) - expects one of (${o[l].A})!`);return o[l].A[b.length].apply(this,b)},o[l].A=[],o[l].A[h.fa]=h;}},$s=(o,l,f)=>{if(p.hasOwnProperty(o)){if(f===void 0||p[o].A!==void 0&&p[o].A[f]!==void 0)throw new Ue(`Cannot register public name '${o}' twice`);if(Js(p,o,o),p.hasOwnProperty(f))throw new Ue(`Cannot register multiple overloads of a function with the same number of arguments (${f})!`);p[o].A[f]=l;}else p[o]=l,f!==void 0&&(p[o].Oc=f);},Se=o=>{if(o===void 0)return "_unknown";o=o.replace(/[^a-zA-Z0-9_]/g,"$");var l=o.charCodeAt(0);return 48<=l&&57>=l?`_${o}`:o};function pt(o,l,f,h,b,S,k,P){this.name=o,this.constructor=l,this.M=f,this.O=h,this.B=b,this.Ob=S,this.na=k,this.Jb=P,this.ob=[];}var Yt=(o,l,f)=>{for(;l!==f;){if(!l.na)throw new Ue(`Expected null or instance of ${f.name}, got an instance of ${l.name}`);o=l.na(o),l=l.B;}return o};function ur(o,l){if(l===null){if(this.Ra)throw new Ue(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new Ue(`Cannot pass "${il(l)}" as a ${this.name}`);if(!l.g.o)throw new Ue(`Cannot pass deleted object as a pointer of type ${this.name}`);return Yt(l.g.o,l.g.u.i,this.i)}function Nh(o,l){if(l===null){if(this.Ra)throw new Ue(`null is not a valid ${this.name}`);if(this.wa){var f=this.Ta();return o!==null&&o.push(this.O,f),f}return 0}if(!l||!l.g)throw new Ue(`Cannot pass "${il(l)}" as a ${this.name}`);if(!l.g.o)throw new Ue(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.va&&l.g.u.va)throw new Ue(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);if(f=Yt(l.g.o,l.g.u.i,this.i),this.wa){if(l.g.D===void 0)throw new Ue("Passing raw pointer to smart pointer is illegal");switch(this.hc){case 0:if(l.g.J===this)f=l.g.D;else throw new Ue(`Cannot convert argument of type ${l.g.J?l.g.J.name:l.g.u.name} to parameter type ${this.name}`);break;case 1:f=l.g.D;break;case 2:if(l.g.J===this)f=l.g.D;else {var h=l.clone();f=this.cc(f,ki(()=>h.delete())),o!==null&&o.push(this.O,f);}break;default:throw new Ue("Unsupporting sharing policy")}}return f}function Lh(o,l){if(l===null){if(this.Ra)throw new Ue(`null is not a valid ${this.name}`);return 0}if(!l.g)throw new Ue(`Cannot pass "${il(l)}" as a ${this.name}`);if(!l.g.o)throw new Ue(`Cannot pass deleted object as a pointer of type ${this.name}`);if(l.g.u.va)throw new Ue(`Cannot convert argument of type ${l.g.u.name} to parameter type ${this.name}`);return Yt(l.g.o,l.g.u.i,this.i)}function Io(o,l,f,h,b,S,k,P,W,G,re){this.name=o,this.i=l,this.Ra=f,this.va=h,this.wa=b,this.bc=S,this.hc=k,this.qb=P,this.Ta=W,this.cc=G,this.O=re,b||l.B!==void 0?this.toWireType=Nh:(this.toWireType=h?ur:Lh,this.L=null);}var oc=(o,l,f)=>{if(!p.hasOwnProperty(o))throw new Fa("Replacing nonexistent public symbol");p[o].A!==void 0&&f!==void 0?p[o].A[f]=l:(p[o]=l,p[o].fa=f);},Po=[],sc,Ha=o=>{var l=Po[o];return l||(o>=Po.length&&(Po.length=o+1),Po[o]=l=sc.get(o)),l},Dh=(o,l,f=[])=>(o.includes("j")?(o=o.replace(/p/g,"i"),l=(0, p["dynCall_"+o])(l,...f)):l=Ha(l)(...f),l),Bh=(o,l)=>(...f)=>Dh(o,l,f),vn=(o,l)=>{o=Zt(o);var f=o.includes("j")?Bh(o,l):Ha(l);if(typeof f!="function")throw new Ue(`unknown function pointer with signature ${o}: ${l}`);return f},lc,Oi=(o,l)=>{function f(S){b[S]||sr[S]||(xo[S]?xo[S].forEach(f):(h.push(S),b[S]=true));}var h=[],b={};throw l.forEach(f),new lc(`${o}: `+h.map(Zs).join([", "]))};function Uh(o){for(var l=1;l<o.length;++l)if(o[l]!==null&&o[l].L===void 0)return true;return false}function No(o,l,f,h,b){var S=l.length;if(2>S)throw new Ue("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=l[1]!==null&&f!==null,P=Uh(l),W=l[0].name!=="void",G=S-2,re=Array(G),Ce=[],Oe=[];return zr(o,function(...j){if(j.length!==G)throw new Ue(`function ${o} called with ${j.length} arguments, expected ${G}`);if(Oe.length=0,Ce.length=k?2:1,Ce[0]=b,k){var ie=l[1].toWireType(Oe,this);Ce[1]=ie;}for(var se=0;se<G;++se)re[se]=l[se+2].toWireType(Oe,j[se]),Ce.push(re[se]);if(j=h(...Ce),P)Va(Oe);else for(se=k?1:2;se<l.length;se++){var Le=se===1?ie:re[se-2];l[se].L!==null&&l[se].L(Le);}return ie=W?l[0].fromWireType(j):void 0,ie})}var za=(o,l)=>{for(var f=[],h=0;h<o;h++)f.push(X[l+4*h>>2]);return f},el=o=>{o=o.trim();let l=o.indexOf("(");return l!==-1?o.substr(0,l):o},tl=(o,l,f)=>{if(!(o instanceof Object))throw new Ue(`${f} with invalid "this": ${o}`);if(!(o instanceof l.i.constructor))throw new Ue(`${f} incompatible with "this" of type ${o.constructor.name}`);if(!o.g.o)throw new Ue(`cannot call emscripten binding method ${f} on deleted object`);return Yt(o.g.o,o.g.u.i,l.i)},nl=o=>{9<o&&--xi[o+1]===0&&(xi[o]=void 0,Ks.push(o));},Fh={name:"emscripten::val",fromWireType:o=>{var l=$n(o);return nl(o),l},toWireType:(o,l)=>ki(l),argPackAdvance:8,readValueFromPointer:lr,L:null},Vh=(o,l,f)=>{switch(l){case 1:return f?function(h){return this.fromWireType(Q[h])}:function(h){return this.fromWireType(te[h])};case 2:return f?function(h){return this.fromWireType(D[h>>1])}:function(h){return this.fromWireType(U[h>>1])};case 4:return f?function(h){return this.fromWireType(z[h>>2])}:function(h){return this.fromWireType(X[h>>2])};default:throw new TypeError(`invalid integer width (${l}): ${o}`)}},il=o=>{if(o===null)return "null";var l=typeof o;return l==="object"||l==="array"||l==="function"?o.toString():""+o},Hh=(o,l)=>{switch(l){case 4:return function(f){return this.fromWireType(oe[f>>2])};case 8:return function(f){return this.fromWireType(ge[f>>3])};default:throw new TypeError(`invalid float width (${l}): ${o}`)}},zh=(o,l,f)=>{switch(l){case 1:return f?h=>Q[h]:h=>te[h];case 2:return f?h=>D[h>>1]:h=>U[h>>1];case 4:return f?h=>z[h>>2]:h=>X[h>>2];default:throw new TypeError(`invalid integer width (${l}): ${o}`)}},uc=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Gh=(o,l)=>{for(var f=o>>1,h=f+l/2;!(f>=h)&&U[f];)++f;if(f<<=1,32<f-o&&uc)return uc.decode(te.subarray(o,f));for(f="",h=0;!(h>=l/2);++h){var b=D[o+2*h>>1];if(b==0)break;f+=String.fromCharCode(b);}return f},Wh=(o,l,f)=>{if(f??(f=2147483647),2>f)return 0;f-=2;var h=l;f=f<2*o.length?f/2:o.length;for(var b=0;b<f;++b)D[l>>1]=o.charCodeAt(b),l+=2;return D[l>>1]=0,l-h},jh=o=>2*o.length,Yh=(o,l)=>{for(var f=0,h="";!(f>=l/4);){var b=z[o+4*f>>2];if(b==0)break;++f,65536<=b?(b-=65536,h+=String.fromCharCode(55296|b>>10,56320|b&1023)):h+=String.fromCharCode(b);}return h},qh=(o,l,f)=>{if(f??(f=2147483647),4>f)return 0;var h=l;f=h+f-4;for(var b=0;b<o.length;++b){var S=o.charCodeAt(b);if(55296<=S&&57343>=S){var k=o.charCodeAt(++b);S=65536+((S&1023)<<10)|k&1023;}if(z[l>>2]=S,l+=4,l+4>f)break}return z[l>>2]=0,l-h},Xh=o=>{for(var l=0,f=0;f<o.length;++f){var h=o.charCodeAt(f);55296<=h&&57343>=h&&++f,l+=4;}return l},cc=(o,l,f)=>{var h=[];return o=o.toWireType(h,f),h.length&&(X[l>>2]=ki(h)),o},Lo=[],fc={},dc=o=>{var l=fc[o];return l===void 0?Zt(o):l},Qh=o=>{var l=Lo.length;return Lo.push(o),l},Ee=(o,l)=>{for(var f=Array(o),h=0;h<o;++h)f[h]=jr(X[l+4*h>>2],"parameter "+h);return f},Ze=Reflect.construct,An=o=>o%4===0&&(o%100!==0||o%400===0),Do=[0,31,60,91,121,152,182,213,244,274,305,335],hc=[0,31,59,90,120,151,181,212,243,273,304,334],Kh=[],IA=o=>{o.Dc=o.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");},PA=o=>{o.Lc=o.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");},NA=o=>{var l="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");return (o.getSupportedExtensions()||[]).filter(f=>l.includes(f))},LA=1,rl=[],Ii=[],pc=[],al=[],Bo=[],Ga=[],mc=[],yn=[],DA={},Zh=4,BA=0,gc=o=>{for(var l=LA++,f=o.length;f<l;f++)o[f]=null;return l},ol=(o,l,f,h)=>{for(var b=0;b<o;b++){var S=$[f](),k=S&&gc(h);S?(S.name=k,h[k]=S):On||(On=1282),z[l+4*b>>2]=k;}},YT=(o,l)=>{var f=gc(yn),h={handle:f,attributes:l,version:l.Kc,F:o};return o.canvas&&(o.canvas.zb=h),yn[f]=h,(typeof l.Kb>"u"||l.Kb)&&qT(h),f},Jh=o=>(cr=yn[o],p.Bc=$=cr?.F,!(o&&!$)),qT=o=>{if(o||(o=cr),!o.Ub){o.Ub=true;var l=o.F;IA(l),PA(l),2<=o.version&&(l.cb=l.getExtension("EXT_disjoint_timer_query_webgl2")),(2>o.version||!l.cb)&&(l.cb=l.getExtension("EXT_disjoint_timer_query")),l.$b=l.getExtension("WEBGL_multi_draw"),NA(l).forEach(f=>{f.includes("lose_context")||f.includes("debug")||l.getExtension(f);});}},On,cr,$h={},UA=()=>{if(!ep){var o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:F||"./this.program"},l;for(l in $h)$h[l]===void 0?delete o[l]:o[l]=$h[l];var f=[];for(l in o)f.push(`${l}=${o[l]}`);ep=f;}return ep},ep,tp=[];function FA(){var o=NA($);return o=o.concat(o.map(l=>"GL_"+l))}var XT=(o,l)=>{if(l){var f=void 0;switch(o){case 36346:f=1;break;case 36344:return;case 34814:case 36345:f=0;break;case 34466:var h=$.getParameter(34467);f=h?h.length:0;break;case 33309:if(2>cr.version){On||(On=1282);return}f=FA().length;break;case 33307:case 33308:if(2>cr.version){On||(On=1280);return}f=o==33307?3:0;}if(f===void 0)switch(h=$.getParameter(o),typeof h){case "number":f=h;break;case "boolean":f=h?1:0;break;case "string":On||(On=1280);return;case "object":if(h===null)switch(o){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:f=0;break;default:On||(On=1280);return}else {if(h instanceof Float32Array||h instanceof Uint32Array||h instanceof Int32Array||h instanceof Array){for(o=0;o<h.length;++o)z[l+4*o>>2]=h[o];return}try{f=h.name|0;}catch(b){On||(On=1280),Re(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${o})! (error: ${b})`);return}}break;default:On||(On=1280),Re(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${o}) and it returns ${h} of type ${typeof h}!`);return}z[l>>2]=f;}else On||(On=1281);},vc=o=>{var l=vt(o)+1,f=yc(l);return f&&ft(o,te,f,l),f},VA=o=>o.slice(-1)=="]"&&o.lastIndexOf("["),np=o=>(o-=5120,o==0?Q:o==1?te:o==2?D:o==4?z:o==6?oe:o==5||o==28922||o==28520||o==30779||o==30782?X:U),HA=[31,29,31,30,31,30,31,31,30,31,30,31],zA=[31,28,31,30,31,30,31,31,30,31,30,31],GA=(o,l,f,h)=>{function b(j,ie,se){for(j=typeof j=="number"?j.toString():j||"";j.length<ie;)j=se[0]+j;return j}function S(j,ie){return b(j,ie,"0")}function k(j,ie){function se(Fe){return 0>Fe?-1:0<Fe?1:0}var Le;return (Le=se(j.getFullYear()-ie.getFullYear()))===0&&(Le=se(j.getMonth()-ie.getMonth()))===0&&(Le=se(j.getDate()-ie.getDate())),Le}function P(j){switch(j.getDay()){case 0:return new Date(j.getFullYear()-1,11,29);case 1:return j;case 2:return new Date(j.getFullYear(),0,3);case 3:return new Date(j.getFullYear(),0,2);case 4:return new Date(j.getFullYear(),0,1);case 5:return new Date(j.getFullYear()-1,11,31);case 6:return new Date(j.getFullYear()-1,11,30)}}function W(j){var ie=j.ba;for(j=new Date(new Date(j.ca+1900,0,1).getTime());0<ie;){var se=j.getMonth(),Le=(An(j.getFullYear())?HA:zA)[se];if(ie>Le-j.getDate())ie-=Le-j.getDate()+1,j.setDate(1),11>se?j.setMonth(se+1):(j.setMonth(0),j.setFullYear(j.getFullYear()+1));else {j.setDate(j.getDate()+ie);break}}return se=new Date(j.getFullYear()+1,0,4),ie=P(new Date(j.getFullYear(),0,4)),se=P(se),0>=k(ie,j)?0>=k(se,j)?j.getFullYear()+1:j.getFullYear():j.getFullYear()-1}var G=X[h+40>>2];h={kc:z[h>>2],jc:z[h+4>>2],Ia:z[h+8>>2],Va:z[h+12>>2],Ja:z[h+16>>2],ca:z[h+20>>2],R:z[h+24>>2],ba:z[h+28>>2],Sc:z[h+32>>2],ic:z[h+36>>2],lc:G&&G?de(te,G):""},f=f?de(te,f):"",G={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var re in G)f=f.replace(new RegExp(re,"g"),G[re]);var Ce="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Oe="January February March April May June July August September October November December".split(" ");G={"%a":j=>Ce[j.R].substring(0,3),"%A":j=>Ce[j.R],"%b":j=>Oe[j.Ja].substring(0,3),"%B":j=>Oe[j.Ja],"%C":j=>S((j.ca+1900)/100|0,2),"%d":j=>S(j.Va,2),"%e":j=>b(j.Va,2," "),"%g":j=>W(j).toString().substring(2),"%G":W,"%H":j=>S(j.Ia,2),"%I":j=>(j=j.Ia,j==0?j=12:12<j&&(j-=12),S(j,2)),"%j":j=>{for(var ie=0,se=0;se<=j.Ja-1;ie+=(An(j.ca+1900)?HA:zA)[se++]);return S(j.Va+ie,3)},"%m":j=>S(j.Ja+1,2),"%M":j=>S(j.jc,2),"%n":()=>`
15
+ `,"%p":j=>0<=j.Ia&&12>j.Ia?"AM":"PM","%S":j=>S(j.kc,2),"%t":()=>" ","%u":j=>j.R||7,"%U":j=>S(Math.floor((j.ba+7-j.R)/7),2),"%V":j=>{var ie=Math.floor((j.ba+7-(j.R+6)%7)/7);if(2>=(j.R+371-j.ba-2)%7&&ie++,ie)ie==53&&(se=(j.R+371-j.ba)%7,se==4||se==3&&An(j.ca)||(ie=1));else {ie=52;var se=(j.R+7-j.ba-1)%7;(se==4||se==5&&An(j.ca%400-1))&&ie++;}return S(ie,2)},"%w":j=>j.R,"%W":j=>S(Math.floor((j.ba+7-(j.R+6)%7)/7),2),"%y":j=>(j.ca+1900).toString().substring(2),"%Y":j=>j.ca+1900,"%z":j=>{j=j.ic;var ie=0<=j;return j=Math.abs(j)/60,(ie?"+":"-")+("0000"+(j/60*100+j%60)).slice(-4)},"%Z":j=>j.lc,"%%":()=>"%"},f=f.replace(/%%/g,"\0\0");for(re in G)f.includes(re)&&(f=f.replace(new RegExp(re,"g"),G[re](h)));return f=f.replace(/\0\0/g,"%"),re=Ke(f,false),re.length>l?0:(Q.set(re,o),re.length-1)};[44].forEach(o=>{Jn[o]=new we(o),Jn[o].stack="<generic error, no stack>";}),Zn=Array(4096),Ct(Ie,"/"),St("/tmp"),St("/home"),St("/home/web_user"),(function(){St("/dev"),et(259,{read:()=>0,write:(h,b,S,k)=>k}),gn("/dev/null",259),rn(1280,an),rn(1536,Wt),gn("/dev/tty",1280),gn("/dev/tty1",1536);var o=new Uint8Array(1024),l=0,f=()=>(l===0&&(l=q(o).byteLength),o[--l]);La("random",f),La("urandom",f),St("/dev/shm"),St("/dev/shm/tmp");})(),(function(){St("/proc");var o=St("/proc/self");St("/proc/self/fd"),Ct({U(){var l=Hr(o,"fd",16895,73);return l.j={ka(f,h){var b=Ge(+h);return f={parent:null,U:{kb:"fake"},j:{la:()=>b.path}},f.parent=f}},l}},"/proc/self/fd");})(),Ue=p.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError";}},xi.push(0,1,void 0,1,null,1,true,1,false,1),p.count_emval_handles=()=>xi.length/2-5-Ks.length,nc=p.PureVirtualError=tc("PureVirtualError");for(var WA=Array(256),Ac=0;256>Ac;++Ac)WA[Ac]=String.fromCharCode(Ac);ic=WA,p.getInheritedInstanceCount=()=>Object.keys(di).length,p.getLiveInheritedInstances=()=>{var o=[],l;for(l in di)di.hasOwnProperty(l)&&o.push(di[l]);return o},p.flushPendingDeletes=Mo,p.setDelayFunction=o=>{Gr=o,Ba.length&&Gr&&Gr(Mo);},Fa=p.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError";}},Object.assign(Oo.prototype,{isAliasOf:function(o){if(!(this instanceof Oo&&o instanceof Oo))return false;var l=this.g.u.i,f=this.g.o;o.g=o.g;var h=o.g.u.i;for(o=o.g.o;l.B;)f=l.na(f),l=l.B;for(;h.B;)o=h.na(o),h=h.B;return l===h&&f===o},clone:function(){if(this.g.o||ko(this),this.g.ia)return this.g.count.value+=1,this;var o=Yr,l=Object,f=l.create,h=Object.getPrototypeOf(this),b=this.g;return o=o(f.call(l,h,{g:{value:{count:b.count,ga:b.ga,ia:b.ia,o:b.o,u:b.u,D:b.D,J:b.J}}})),o.g.count.value+=1,o.g.ga=false,o},delete(){if(this.g.o||ko(this),this.g.ga&&!this.g.ia)throw new Ue("Object already scheduled for deletion");Ua(this);var o=this.g;--o.count.value,o.count.value===0&&(o.D?o.J.O(o.D):o.u.i.O(o.o)),this.g.ia||(this.g.D=void 0,this.g.o=void 0);},isDeleted:function(){return !this.g.o},deleteLater:function(){if(this.g.o||ko(this),this.g.ga&&!this.g.ia)throw new Ue("Object already scheduled for deletion");return Ba.push(this),Ba.length===1&&Gr&&Gr(Mo),this.g.ga=true,this}}),Object.assign(Io.prototype,{Pb(o){return this.qb&&(o=this.qb(o)),o},bb(o){this.O?.(o);},argPackAdvance:8,readValueFromPointer:lr,fromWireType:function(o){function l(){return this.wa?Co(this.i.M,{u:this.bc,o:f,J:this,D:o}):Co(this.i.M,{u:this,o})}var f=this.Pb(o);if(!f)return this.bb(o),null;var h=Ih(this.i,f);if(h!==void 0)return h.g.count.value===0?(h.g.o=f,h.g.D=o,h.clone()):(h=h.clone(),this.bb(o),h);if(h=this.i.Ob(f),h=ac[h],!h)return l.call(this);h=this.va?h.Hb:h.pointerType;var b=rc(f,this.i,h.i);return b===null?l.call(this):this.wa?Co(h.i.M,{u:h,o:b,J:this,D:o}):Co(h.i.M,{u:h,o:b})}}),lc=p.UnboundTypeError=tc("UnboundTypeError");for(var $,ip=0;32>ip;++ip)tp.push(Array(ip));var jA={__syscall_fcntl64:function(o,l,f){Da=f;try{var h=Ge(o);switch(l){case 0:var b=y();if(0>b)break;for(;Ri[b];)b++;return Jt(h,b).W;case 1:case 2:return 0;case 3:return h.flags;case 4:return b=y(),h.flags|=b,0;case 12:return b=y(),D[b+0>>1]=2,0;case 13:case 14:return 0}return -28}catch(S){if(typeof or>"u"||S.name!=="ErrnoError")throw S;return -S.$}},__syscall_ioctl:function(o,l,f){Da=f;try{var h=Ge(o);switch(l){case 21509:return h.s?0:-59;case 21505:if(!h.s)return -59;if(h.s.V.Wb){o=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var b=y();z[b>>2]=25856,z[b+4>>2]=5,z[b+8>>2]=191,z[b+12>>2]=35387;for(var S=0;32>S;S++)Q[b+S+17]=o[S]||0;}return 0;case 21510:case 21511:case 21512:return h.s?0:-59;case 21506:case 21507:case 21508:if(!h.s)return -59;if(h.s.V.Xb)for(b=y(),o=[],S=0;32>S;S++)o.push(Q[b+S+17]);return 0;case 21519:return h.s?(b=y(),z[b>>2]=0):-59;case 21520:return h.s?-28:-59;case 21531:if(b=y(),!h.m.Vb)throw new we(59);return h.m.Vb(h,l,b);case 21523:return h.s?(h.s.V.Yb&&(S=[24,80],b=y(),D[b>>1]=S[0],D[b+2>>1]=S[1]),0):-59;case 21524:return h.s?0:-59;case 21515:return h.s?0:-59;default:return -28}}catch(k){if(typeof or>"u"||k.name!=="ErrnoError")throw k;return -k.$}},__syscall_openat:function(o,l,f,h){Da=h;try{l=l?de(te,l):"";var b=l;if(b.charAt(0)==="/")l=b;else {var S=o===-100?"/":Ge(o).path;if(b.length==0)throw new we(44);l=m(S+"/"+b);}var k=h?y():0;return Eo(l,f,k).W}catch(P){if(typeof or>"u"||P.name!=="ErrnoError")throw P;return -P.$}},_abort_js:()=>{ze("");},_embind_create_inheriting_constructor:(o,l,f)=>{o=Zt(o),l=jr(l,"wrapper"),f=$n(f);var h=l.i,b=h.M,S=h.B.M,k=h.B.constructor;return o=zr(o,function(...P){h.B.ob.forEach(function(W){if(this[W]===S[W])throw new nc(`Pure virtual function ${W} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:b}),this.__construct(...P);}),b.__construct=function(...P){if(this===b)throw new Ue("Pass correct 'this' to __construct");P=k.implement(this,...P),Ua(P);var W=P.g;if(P.notifyOnDestruction(),W.ia=true,Object.defineProperties(this,{g:{value:W}}),Yr(this),P=W.o,P=Wr(h,P),di.hasOwnProperty(P))throw new Ue(`Tried to register registered instance: ${P}`);di[P]=this;},b.__destruct=function(){if(this===b)throw new Ue("Pass correct 'this' to __destruct");Ua(this);var P=this.g.o;if(P=Wr(h,P),di.hasOwnProperty(P))delete di[P];else throw new Ue(`Tried to unregister unregistered instance: ${P}`)},o.prototype=Object.create(b),Object.assign(o.prototype,f),ki(o)},_embind_finalize_value_object:o=>{var l=Ro[o];delete Ro[o];var f=l.Ta,h=l.O,b=l.eb,S=b.map(k=>k.Sb).concat(b.map(k=>k.ec));kn([o],S,k=>{var P={};return b.forEach((W,G)=>{var re=k[G],Ce=W.Qb,Oe=W.Rb,j=k[G+b.length],ie=W.dc,se=W.fc;P[W.Mb]={read:Le=>re.fromWireType(Ce(Oe,Le)),write:(Le,Fe)=>{var Je=[];ie(se,Le,j.toWireType(Je,Fe)),Va(Je);}};}),[{name:l.name,fromWireType:W=>{var G={},re;for(re in P)G[re]=P[re].read(W);return h(W),G},toWireType:(W,G)=>{for(var re in P)if(!(re in G))throw new TypeError(`Missing field: "${re}"`);var Ce=f();for(re in P)P[re].write(Ce,G[re]);return W!==null&&W.push(h,Ce),Ce},argPackAdvance:8,readValueFromPointer:lr,L:h}]});},_embind_register_bigint:()=>{},_embind_register_bool:(o,l,f,h)=>{l=Zt(l),hi(o,{name:l,fromWireType:function(b){return !!b},toWireType:function(b,S){return S?f:h},argPackAdvance:8,readValueFromPointer:function(b){return this.fromWireType(te[b])},L:null});},_embind_register_class:(o,l,f,h,b,S,k,P,W,G,re,Ce,Oe)=>{re=Zt(re),S=vn(b,S),P&&(P=vn(k,P)),G&&(G=vn(W,G)),Oe=vn(Ce,Oe);var j=Se(re);$s(j,function(){Oi(`Cannot construct ${re} due to unbound types`,[h]);}),kn([o,l,f],h?[h]:[],ie=>{if(ie=ie[0],h)var se=ie.i,Le=se.M;else Le=Oo.prototype;ie=zr(re,function(...qt){if(Object.getPrototypeOf(this)!==Fe)throw new Ue("Use 'new' to construct "+re);if(Je.Z===void 0)throw new Ue(re+" has no accessible constructor");var Xt=Je.Z[qt.length];if(Xt===void 0)throw new Ue(`Tried to invoke ctor of ${re} with invalid number of parameters (${qt.length}) - expected (${Object.keys(Je.Z).toString()}) parameters instead!`);return Xt.apply(this,qt)});var Fe=Object.create(Le,{constructor:{value:ie}});ie.prototype=Fe;var Je=new pt(re,ie,Fe,Oe,se,S,P,G);if(Je.B){var It;(It=Je.B).oa??(It.oa=[]),Je.B.oa.push(Je);}return se=new Io(re,Je,true,false,false),It=new Io(re+"*",Je,false,false,false),Le=new Io(re+" const*",Je,false,true,false),ac[o]={pointerType:It,Hb:Le},oc(j,ie),[se,It,Le]});},_embind_register_class_class_function:(o,l,f,h,b,S,k)=>{var P=za(f,h);l=Zt(l),l=el(l),S=vn(b,S),kn([],[o],W=>{function G(){Oi(`Cannot call ${re} due to unbound types`,P);}W=W[0];var re=`${W.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]);var Ce=W.i.constructor;return Ce[l]===void 0?(G.fa=f-1,Ce[l]=G):(Js(Ce,l,re),Ce[l].A[f-1]=G),kn([],P,Oe=>{if(Oe=No(re,[Oe[0],null].concat(Oe.slice(1)),null,S,k),Ce[l].A===void 0?(Oe.fa=f-1,Ce[l]=Oe):Ce[l].A[f-1]=Oe,W.i.oa)for(let j of W.i.oa)j.constructor.hasOwnProperty(l)||(j.constructor[l]=Oe);return []}),[]});},_embind_register_class_class_property:(o,l,f,h,b,S,k,P)=>{l=Zt(l),S=vn(b,S),kn([],[o],W=>{W=W[0];var G=`${W.name}.${l}`,re={get(){Oi(`Cannot access ${G} due to unbound types`,[f]);},enumerable:true,configurable:true};return re.set=P?()=>{Oi(`Cannot access ${G} due to unbound types`,[f]);}:()=>{throw new Ue(`${G} is a read-only property`)},Object.defineProperty(W.i.constructor,l,re),kn([],[f],Ce=>{Ce=Ce[0];var Oe={get(){return Ce.fromWireType(S(h))},enumerable:true};return P&&(P=vn(k,P),Oe.set=j=>{var ie=[];P(h,Ce.toWireType(ie,j)),Va(ie);}),Object.defineProperty(W.i.constructor,l,Oe),[]}),[]});},_embind_register_class_constructor:(o,l,f,h,b,S)=>{var k=za(l,f);b=vn(h,b),kn([],[o],P=>{P=P[0];var W=`constructor ${P.name}`;if(P.i.Z===void 0&&(P.i.Z=[]),P.i.Z[l-1]!==void 0)throw new Ue(`Cannot register multiple constructors with identical number of parameters (${l-1}) for class '${P.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return P.i.Z[l-1]=()=>{Oi(`Cannot construct ${P.name} due to unbound types`,k);},kn([],k,G=>(G.splice(1,0,null),P.i.Z[l-1]=No(W,G,null,b,S),[])),[]});},_embind_register_class_function:(o,l,f,h,b,S,k,P)=>{var W=za(f,h);l=Zt(l),l=el(l),S=vn(b,S),kn([],[o],G=>{function re(){Oi(`Cannot call ${Ce} due to unbound types`,W);}G=G[0];var Ce=`${G.name}.${l}`;l.startsWith("@@")&&(l=Symbol[l.substring(2)]),P&&G.i.ob.push(l);var Oe=G.i.M,j=Oe[l];return j===void 0||j.A===void 0&&j.className!==G.name&&j.fa===f-2?(re.fa=f-2,re.className=G.name,Oe[l]=re):(Js(Oe,l,Ce),Oe[l].A[f-2]=re),kn([],W,ie=>(ie=No(Ce,ie,G,S,k),Oe[l].A===void 0?(ie.fa=f-2,Oe[l]=ie):Oe[l].A[f-2]=ie,[])),[]});},_embind_register_class_property:(o,l,f,h,b,S,k,P,W,G)=>{l=Zt(l),b=vn(h,b),kn([],[o],re=>{re=re[0];var Ce=`${re.name}.${l}`,Oe={get(){Oi(`Cannot access ${Ce} due to unbound types`,[f,k]);},enumerable:true,configurable:true};return Oe.set=W?()=>Oi(`Cannot access ${Ce} due to unbound types`,[f,k]):()=>{throw new Ue(Ce+" is a read-only property")},Object.defineProperty(re.i.M,l,Oe),kn([],W?[f,k]:[f],j=>{var ie=j[0],se={get(){var Fe=tl(this,re,Ce+" getter");return ie.fromWireType(b(S,Fe))},enumerable:true};if(W){W=vn(P,W);var Le=j[1];se.set=function(Fe){var Je=tl(this,re,Ce+" setter"),It=[];W(G,Je,Le.toWireType(It,Fe)),Va(It);};}return Object.defineProperty(re.i.M,l,se),[]}),[]});},_embind_register_emval:o=>hi(o,Fh),_embind_register_enum:(o,l,f,h)=>{function b(){}l=Zt(l),b.values={},hi(o,{name:l,constructor:b,fromWireType:function(S){return this.constructor.values[S]},toWireType:(S,k)=>k.value,argPackAdvance:8,readValueFromPointer:Vh(l,f,h),L:null}),$s(l,b);},_embind_register_enum_value:(o,l,f)=>{var h=jr(o,"enum");l=Zt(l),o=h.constructor,h=Object.create(h.constructor.prototype,{value:{value:f},constructor:{value:zr(`${h.name}_${l}`,function(){})}}),o.values[f]=h,o[l]=h;},_embind_register_float:(o,l,f)=>{l=Zt(l),hi(o,{name:l,fromWireType:h=>h,toWireType:(h,b)=>b,argPackAdvance:8,readValueFromPointer:Hh(l,f),L:null});},_embind_register_function:(o,l,f,h,b,S)=>{var k=za(l,f);o=Zt(o),o=el(o),b=vn(h,b),$s(o,function(){Oi(`Cannot call ${o} due to unbound types`,k);},l-1),kn([],k,P=>(oc(o,No(o,[P[0],null].concat(P.slice(1)),null,b,S),l-1),[]));},_embind_register_integer:(o,l,f,h,b)=>{if(l=Zt(l),b===-1&&(b=4294967295),b=P=>P,h===0){var S=32-8*f;b=P=>P<<S>>>S;}var k=l.includes("unsigned")?function(P,W){return W>>>0}:function(P,W){return W};hi(o,{name:l,fromWireType:b,toWireType:k,argPackAdvance:8,readValueFromPointer:zh(l,f,h!==0),L:null});},_embind_register_memory_view:(o,l,f)=>{function h(S){return new b(Q.buffer,X[S+4>>2],X[S>>2])}var b=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][l];f=Zt(f),hi(o,{name:f,fromWireType:h,argPackAdvance:8,readValueFromPointer:h},{Tb:true});},_embind_register_std_string:(o,l)=>{l=Zt(l);var f=l==="std::string";hi(o,{name:l,fromWireType:function(h){var b=X[h>>2],S=h+4;if(f)for(var k=S,P=0;P<=b;++P){var W=S+P;if(P==b||te[W]==0){if(k=k?de(te,k,W-k):"",G===void 0)var G=k;else G+="\0",G+=k;k=W+1;}}else {for(G=Array(b),P=0;P<b;++P)G[P]=String.fromCharCode(te[S+P]);G=G.join("");}return fr(h),G},toWireType:function(h,b){b instanceof ArrayBuffer&&(b=new Uint8Array(b));var S=typeof b=="string";if(!(S||b instanceof Uint8Array||b instanceof Uint8ClampedArray||b instanceof Int8Array))throw new Ue("Cannot pass non-string to std::string");var k=f&&S?vt(b):b.length,P=yc(4+k+1),W=P+4;if(X[P>>2]=k,f&&S)ft(b,te,W,k+1);else if(S)for(S=0;S<k;++S){var G=b.charCodeAt(S);if(255<G)throw fr(W),new Ue("String has UTF-16 code units that do not fit in 8 bits");te[W+S]=G;}else for(S=0;S<k;++S)te[W+S]=b[S];return h!==null&&h.push(fr,P),P},argPackAdvance:8,readValueFromPointer:lr,L(h){fr(h);}});},_embind_register_std_wstring:(o,l,f)=>{if(f=Zt(f),l===2)var h=Gh,b=Wh,S=jh,k=P=>U[P>>1];else l===4&&(h=Yh,b=qh,S=Xh,k=P=>X[P>>2]);hi(o,{name:f,fromWireType:P=>{for(var W=X[P>>2],G,re=P+4,Ce=0;Ce<=W;++Ce){var Oe=P+4+Ce*l;(Ce==W||k(Oe)==0)&&(re=h(re,Oe-re),G===void 0?G=re:(G+="\0",G+=re),re=Oe+l);}return fr(P),G},toWireType:(P,W)=>{if(typeof W!="string")throw new Ue(`Cannot pass non-string to C++ string type ${f}`);var G=S(W),re=yc(4+G+l);return X[re>>2]=G/l,b(W,re+4,G+l),P!==null&&P.push(fr,re),re},argPackAdvance:8,readValueFromPointer:lr,L(P){fr(P);}});},_embind_register_value_object:(o,l,f,h,b,S)=>{Ro[o]={name:Zt(l),Ta:vn(f,h),O:vn(b,S),eb:[]};},_embind_register_value_object_field:(o,l,f,h,b,S,k,P,W,G)=>{Ro[o].eb.push({Mb:Zt(l),Sb:f,Qb:vn(h,b),Rb:S,ec:k,dc:vn(P,W),fc:G});},_embind_register_void:(o,l)=>{l=Zt(l),hi(o,{Ic:true,name:l,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(o,l,f)=>te.copyWithin(o,l,l+f),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(o,l,f)=>(o=$n(o),l=jr(l,"emval::as"),cc(l,f,o)),_emval_call:(o,l,f,h)=>(o=Lo[o],l=$n(l),o(null,l,f,h)),_emval_call_method:(o,l,f,h,b)=>(o=Lo[o],l=$n(l),f=dc(f),o(l,l[f],h,b)),_emval_decref:nl,_emval_get_method_caller:(o,l,f)=>{var h=Ee(o,l),b=h.shift();o--;var S=Array(o);return l=`methodCaller<(${h.map(k=>k.name).join(", ")}) => ${b.name}>`,Qh(zr(l,(k,P,W,G)=>{for(var re=0,Ce=0;Ce<o;++Ce)S[Ce]=h[Ce].readValueFromPointer(G+re),re+=h[Ce].argPackAdvance;return k=f===1?Ze(P,S):P.apply(k,S),cc(b,W,k)}))},_emval_get_property:(o,l)=>(o=$n(o),l=$n(l),ki(o[l])),_emval_incref:o=>{9<o&&(xi[o+1]+=1);},_emval_new_array:()=>ki([]),_emval_new_cstring:o=>ki(dc(o)),_emval_new_object:()=>ki({}),_emval_run_destructors:o=>{var l=$n(o);Va(l),nl(o);},_emval_set_property:(o,l,f)=>{o=$n(o),l=$n(l),f=$n(f),o[l]=f;},_emval_take_value:(o,l)=>(o=jr(o,"_emval_take_value"),o=o.readValueFromPointer(l),ki(o)),_gmtime_js:function(o,l,f){o=new Date(1e3*(l+2097152>>>0<4194305-!!o?(o>>>0)+4294967296*l:NaN)),z[f>>2]=o.getUTCSeconds(),z[f+4>>2]=o.getUTCMinutes(),z[f+8>>2]=o.getUTCHours(),z[f+12>>2]=o.getUTCDate(),z[f+16>>2]=o.getUTCMonth(),z[f+20>>2]=o.getUTCFullYear()-1900,z[f+24>>2]=o.getUTCDay(),z[f+28>>2]=(o.getTime()-Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0))/864e5|0;},_localtime_js:function(o,l,f){o=new Date(1e3*(l+2097152>>>0<4194305-!!o?(o>>>0)+4294967296*l:NaN)),z[f>>2]=o.getSeconds(),z[f+4>>2]=o.getMinutes(),z[f+8>>2]=o.getHours(),z[f+12>>2]=o.getDate(),z[f+16>>2]=o.getMonth(),z[f+20>>2]=o.getFullYear()-1900,z[f+24>>2]=o.getDay(),z[f+28>>2]=(An(o.getFullYear())?Do:hc)[o.getMonth()]+o.getDate()-1|0,z[f+36>>2]=-(60*o.getTimezoneOffset()),l=new Date(o.getFullYear(),6,1).getTimezoneOffset();var h=new Date(o.getFullYear(),0,1).getTimezoneOffset();z[f+32>>2]=(l!=h&&o.getTimezoneOffset()==Math.min(h,l))|0;},_tzset_js:(o,l,f,h)=>{var b=new Date().getFullYear(),S=new Date(b,0,1),k=new Date(b,6,1);b=S.getTimezoneOffset();var P=k.getTimezoneOffset();X[o>>2]=60*Math.max(b,P),z[l>>2]=+(b!=P),o=W=>W.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1],S=o(S),k=o(k),P<b?(ft(S,te,f,17),ft(k,te,h,17)):(ft(S,te,h,17),ft(k,te,f,17));},beginPixelLocalStorageWEBGL:function(o,l,f){(o=yn[o].F.Da)&&o.beginPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},decode_image:function(o,l,f){var h=p.images;h||(h=new Map,p.images=h);var b=new Image;h.set(o,b),l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),b.src=URL.createObjectURL(new Blob([f],{type:"image/png"})),b.onload=function(){p._setWebImage(o,b.width,b.height);};},delete_image:function(o){var l=p.images;l&&l.get(o)&&l.delete(o);},emscripten_asm_const_int:(o,l,f)=>{Kh.length=0;for(var h;h=te[l++];){var b=h!=105;b&=h!=112,f+=b&&f%8?4:0,Kh.push(h==112?X[f>>2]:h==105?z[f>>2]:ge[f>>3]),f+=b?8:4;}return Qe[o](...Kh)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:o=>{var l=te.length;if(o>>>=0,2147483648<o)return false;for(var f=1;4>=f;f*=2){var h=l*(1+.2/f);h=Math.min(h,o+100663296);var b=Math;h=Math.max(o,h);e:{b=(b.min.call(b,2147483648,h+(65536-h%65536)%65536)-De.buffer.byteLength+65535)/65536;try{De.grow(b),be();var S=1;break e}catch{}S=void 0;}if(S)return true}return false},emscripten_webgl_enable_extension:(o,l)=>(o=yn[o],l=l?de(te,l):"",l.startsWith("GL_")&&(l=l.substr(3)),l=="WEBGL_draw_instanced_base_vertex_base_instance"&&IA($),l=="WEBGL_multi_draw_instanced_base_vertex_base_instance"&&PA($),l=="WEBGL_multi_draw"&&($.$b=$.getExtension("WEBGL_multi_draw")),!!o.F.getExtension(l)),emscripten_webgl_get_current_context:()=>cr?cr.handle:0,emscripten_webgl_make_context_current:o=>Jh(o)?0:-5,enable_WEBGL_provoking_vertex:function(o){return o=yn[o].F,o.pb=o.getExtension("WEBGL_provoking_vertex"),!!o.pb},enable_WEBGL_shader_pixel_local_storage_coherent:function(o){o=yn[o].F;let l=o.getExtension("WEBGL_shader_pixel_local_storage");return l&&l.isCoherent()&&l.framebufferTexturePixelLocalStorageWEBGL.length==5?(o.Da=l,true):false},endPixelLocalStorageWEBGL:function(o,l,f){(o=yn[o].F.Da)&&o.endPixelLocalStorageWEBGL(p.HEAPU32.subarray(f,f+l));},environ_get:(o,l)=>{var f=0;return UA().forEach((h,b)=>{var S=l+f;for(b=X[o+4*b>>2]=S,S=0;S<h.length;++S)Q[b++]=h.charCodeAt(S);Q[b]=0,f+=h.length+1;}),0},environ_sizes_get:(o,l)=>{var f=UA();X[o>>2]=f.length;var h=0;return f.forEach(b=>h+=b.length+1),X[l>>2]=h,0},fd_close:function(o){try{var l=Ge(o);if(l.W===null)throw new we(8);l.Qa&&(l.Qa=null);try{l.m.close&&l.m.close(l);}catch(f){throw f}finally{Ri[l.W]=null;}return l.W=null,0}catch(f){if(typeof or>"u"||f.name!=="ErrnoError")throw f;return f.$}},fd_read:function(o,l,f,h){try{e:{var b=Ge(o);o=l;for(var S,k=l=0;k<f;k++){var P=X[o>>2],W=X[o+4>>2];o+=8;var G=b,re=S,Ce=Q;if(0>W||0>re)throw new we(28);if(G.W===null)throw new we(8);if((G.flags&2097155)===1)throw new we(8);if((G.node.mode&61440)===16384)throw new we(31);if(!G.m.read)throw new we(28);var Oe=typeof re<"u";if(!Oe)re=G.position;else if(!G.seekable)throw new we(70);var j=G.m.read(G,Ce,P,W,re);Oe||(G.position+=j);var ie=j;if(0>ie){var se=-1;break e}if(l+=ie,ie<W)break;typeof S<"u"&&(S+=ie);}se=l;}return X[h>>2]=se,0}catch(Le){if(typeof or>"u"||Le.name!=="ErrnoError")throw Le;return Le.$}},fd_seek:function(o,l,f,h,b){l=f+2097152>>>0<4194305-!!l?(l>>>0)+4294967296*f:NaN;try{if(isNaN(l))return 61;var S=Ge(o);return Ju(S,l,h),gt=[S.position>>>0,(mt=S.position,1<=+Math.abs(mt)?0<mt?+Math.floor(mt/4294967296)>>>0:~~+Math.ceil((mt-+(~~mt>>>0))/4294967296)>>>0:0)],z[b>>2]=gt[0],z[b+4>>2]=gt[1],S.Qa&&l===0&&h===0&&(S.Qa=null),0}catch(k){if(typeof or>"u"||k.name!=="ErrnoError")throw k;return k.$}},fd_write:function(o,l,f,h){try{e:{var b=Ge(o);o=l;for(var S,k=l=0;k<f;k++){var P=X[o>>2],W=X[o+4>>2];o+=8;var G=b,re=P,Ce=W,Oe=S,j=Q;if(0>Ce||0>Oe)throw new we(28);if(G.W===null)throw new we(8);if((G.flags&2097155)===0)throw new we(8);if((G.node.mode&61440)===16384)throw new we(31);if(!G.m.write)throw new we(28);G.seekable&&G.flags&1024&&Ju(G,0,2);var ie=typeof Oe<"u";if(!ie)Oe=G.position;else if(!G.seekable)throw new we(70);var se=G.m.write(G,j,re,Ce,Oe,void 0);ie||(G.position+=se);var Le=se;if(0>Le){var Fe=-1;break e}l+=Le,typeof S<"u"&&(S+=Le);}Fe=l;}return X[h>>2]=Fe,0}catch(Je){if(typeof or>"u"||Je.name!=="ErrnoError")throw Je;return Je.$}},framebufferPixelLocalClearValuefvWEBGL:function(o,l,f,h,b,S){(o=yn[o].F.Da)&&o.framebufferPixelLocalClearValuefvWEBGL(l,[f,h,b,S]);},framebufferTexturePixelLocalStorageWEBGL:function(o,l,f,h,b,S){(o=yn[o].F.Da)&&o.framebufferTexturePixelLocalStorageWEBGL(l,Bo[f],h,b,S);},glActiveTexture:o=>$.activeTexture(o),glAttachShader:(o,l)=>{$.attachShader(Ii[o],Ga[l]);},glBindBuffer:(o,l)=>{o==35051?$.Oa=l:o==35052&&($.ra=l),$.bindBuffer(o,rl[l]);},glBindBufferRange:(o,l,f,h,b)=>{$.bindBufferRange(o,l,rl[f],h,b);},glBindFramebuffer:(o,l)=>{$.bindFramebuffer(o,pc[l]);},glBindRenderbuffer:(o,l)=>{$.bindRenderbuffer(o,al[l]);},glBindTexture:(o,l)=>{$.bindTexture(o,Bo[l]);},glBindVertexArray:o=>{$.bindVertexArray(mc[o]);},glBlendEquation:o=>$.blendEquation(o),glBlendFunc:(o,l)=>$.blendFunc(o,l),glBlitFramebuffer:(o,l,f,h,b,S,k,P,W,G)=>$.blitFramebuffer(o,l,f,h,b,S,k,P,W,G),glBufferData:(o,l,f,h)=>{f&&l?$.bufferData(o,te,h,f,l):$.bufferData(o,l,h);},glBufferSubData:(o,l,f,h)=>{f&&$.bufferSubData(o,l,te,h,f);},glClear:o=>$.clear(o),glClearBufferfv:(o,l,f)=>{$.clearBufferfv(o,l,oe,f>>2);},glClearBufferuiv:(o,l,f)=>{$.clearBufferuiv(o,l,X,f>>2);},glClearColor:(o,l,f,h)=>$.clearColor(o,l,f,h),glClearDepthf:o=>$.clearDepth(o),glClearStencil:o=>$.clearStencil(o),glColorMask:(o,l,f,h)=>{$.colorMask(!!o,!!l,!!f,!!h);},glCompileShader:o=>{$.compileShader(Ga[o]);},glCompressedTexSubImage2D:(o,l,f,h,b,S,k,P,W)=>{$.ra||!P?$.compressedTexSubImage2D(o,l,f,h,b,S,k,P,W):$.compressedTexSubImage2D(o,l,f,h,b,S,k,te,W,P);},glCreateProgram:()=>{var o=gc(Ii),l=$.createProgram();return l.name=o,l.za=l.xa=l.ya=0,l.Wa=1,Ii[o]=l,o},glCreateShader:o=>{var l=gc(Ga);return Ga[l]=$.createShader(o),l},glCullFace:o=>$.cullFace(o),glDeleteBuffers:(o,l)=>{for(var f=0;f<o;f++){var h=z[l+4*f>>2],b=rl[h];b&&($.deleteBuffer(b),b.name=0,rl[h]=null,h==$.Oa&&($.Oa=0),h==$.ra&&($.ra=0));}},glDeleteFramebuffers:(o,l)=>{for(var f=0;f<o;++f){var h=z[l+4*f>>2],b=pc[h];b&&($.deleteFramebuffer(b),b.name=0,pc[h]=null);}},glDeleteProgram:o=>{if(o){var l=Ii[o];l?($.deleteProgram(l),l.name=0,Ii[o]=null):On||(On=1281);}},glDeleteRenderbuffers:(o,l)=>{for(var f=0;f<o;f++){var h=z[l+4*f>>2],b=al[h];b&&($.deleteRenderbuffer(b),b.name=0,al[h]=null);}},glDeleteShader:o=>{if(o){var l=Ga[o];l?($.deleteShader(l),Ga[o]=null):On||(On=1281);}},glDeleteTextures:(o,l)=>{for(var f=0;f<o;f++){var h=z[l+4*f>>2],b=Bo[h];b&&($.deleteTexture(b),b.name=0,Bo[h]=null);}},glDeleteVertexArrays:(o,l)=>{for(var f=0;f<o;f++){var h=z[l+4*f>>2];$.deleteVertexArray(mc[h]),mc[h]=null;}},glDepthFunc:o=>$.depthFunc(o),glDepthMask:o=>{$.depthMask(!!o);},glDepthRangef:(o,l)=>$.depthRange(o,l),glDisable:o=>$.disable(o),glDrawArrays:(o,l,f)=>{$.drawArrays(o,l,f);},glDrawArraysInstanced:(o,l,f,h)=>{$.drawArraysInstanced(o,l,f,h);},glDrawBuffers:(o,l)=>{for(var f=tp[o],h=0;h<o;h++)f[h]=z[l+4*h>>2];$.drawBuffers(f);},glDrawElements:(o,l,f,h)=>{$.drawElements(o,l,f,h);},glDrawElementsInstanced:(o,l,f,h,b)=>{$.drawElementsInstanced(o,l,f,h,b);},glEnable:o=>$.enable(o),glEnableVertexAttribArray:o=>{$.enableVertexAttribArray(o);},glFlush:()=>$.flush(),glFramebufferRenderbuffer:(o,l,f,h)=>{$.framebufferRenderbuffer(o,l,f,al[h]);},glFramebufferTexture2D:(o,l,f,h,b)=>{$.framebufferTexture2D(o,l,f,Bo[h],b);},glFrontFace:o=>$.frontFace(o),glGenBuffers:(o,l)=>{ol(o,l,"createBuffer",rl);},glGenFramebuffers:(o,l)=>{ol(o,l,"createFramebuffer",pc);},glGenRenderbuffers:(o,l)=>{ol(o,l,"createRenderbuffer",al);},glGenTextures:(o,l)=>{ol(o,l,"createTexture",Bo);},glGenVertexArrays:(o,l)=>{ol(o,l,"createVertexArray",mc);},glGenerateMipmap:o=>$.generateMipmap(o),glGetIntegerv:(o,l)=>XT(o,l),glGetProgramiv:(o,l,f)=>{if(f)if(o>=LA)On||(On=1281);else if(o=Ii[o],l==35716)o=$.getProgramInfoLog(o),o===null&&(o="(unknown error)"),z[f>>2]=o.length+1;else if(l==35719){if(!o.za)for(l=0;l<$.getProgramParameter(o,35718);++l)o.za=Math.max(o.za,$.getActiveUniform(o,l).name.length+1);z[f>>2]=o.za;}else if(l==35722){if(!o.xa)for(l=0;l<$.getProgramParameter(o,35721);++l)o.xa=Math.max(o.xa,$.getActiveAttrib(o,l).name.length+1);z[f>>2]=o.xa;}else if(l==35381){if(!o.ya)for(l=0;l<$.getProgramParameter(o,35382);++l)o.ya=Math.max(o.ya,$.getActiveUniformBlockName(o,l).length+1);z[f>>2]=o.ya;}else z[f>>2]=$.getProgramParameter(o,l);else On||(On=1281);},glGetString:o=>{var l=DA[o];if(!l){switch(o){case 7939:l=vc(FA().join(" "));break;case 7936:case 7937:case 37445:case 37446:(l=$.getParameter(o))||On||(On=1280),l=l?vc(l):0;break;case 7938:l=vc(`OpenGL ES 3.0 (${$.getParameter(7938)})`);break;case 35724:l=$.getParameter(35724);var f=l.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);f!==null&&(f[1].length==3&&(f[1]+="0"),l=`OpenGL ES GLSL ES ${f[1]} (${l})`),l=vc(l);break;default:On||(On=1280);}DA[o]=l;}return l},glGetUniformBlockIndex:(o,l)=>$.getUniformBlockIndex(Ii[o],l?de(te,l):""),glGetUniformLocation:(o,l)=>{if(l=l?de(te,l):"",o=Ii[o]){var f=o,h=f.ma,b=f.wb,S;if(!h)for(f.ma=h={},f.vb={},S=0;S<$.getProgramParameter(f,35718);++S){var k=$.getActiveUniform(f,S),P=k.name;k=k.size;var W=VA(P);W=0<W?P.slice(0,W):P;var G=f.Wa;for(f.Wa+=k,b[W]=[k,G],P=0;P<k;++P)h[G]=P,f.vb[G++]=W;}if(f=o.ma,h=0,b=l,S=VA(l),0<S&&(h=parseInt(l.slice(S+1))>>>0,b=l.slice(0,S)),(b=o.wb[b])&&h<b[0]&&(h+=b[1],f[h]=f[h]||$.getUniformLocation(o,l)))return h}else On||(On=1281);return -1},glInvalidateFramebuffer:(o,l,f)=>{for(var h=tp[l],b=0;b<l;b++)h[b]=z[f+4*b>>2];$.invalidateFramebuffer(o,h);},glLinkProgram:o=>{o=Ii[o],$.linkProgram(o),o.ma=0,o.wb={};},glPixelStorei:(o,l)=>{o==3317?Zh=l:o==3314&&(BA=l),$.pixelStorei(o,l);},glReadPixels:(o,l,f,h,b,S,k)=>{if($.Oa)$.readPixels(o,l,f,h,b,S,k);else {var P=np(S);k>>>=31-Math.clz32(P.BYTES_PER_ELEMENT),$.readPixels(o,l,f,h,b,S,P,k);}},glRenderbufferStorageMultisample:(o,l,f,h,b)=>$.renderbufferStorageMultisample(o,l,f,h,b),glScissor:(o,l,f,h)=>$.scissor(o,l,f,h),glShaderSource:(o,l,f,h)=>{for(var b="",S=0;S<l;++S){var k=(k=X[f+4*S>>2])?de(te,k,h?X[h+4*S>>2]:void 0):"";b+=k;}$.shaderSource(Ga[o],b);},glStencilFunc:(o,l,f)=>$.stencilFunc(o,l,f),glStencilFuncSeparate:(o,l,f,h)=>$.stencilFuncSeparate(o,l,f,h),glStencilMask:o=>$.stencilMask(o),glStencilOp:(o,l,f)=>$.stencilOp(o,l,f),glStencilOpSeparate:(o,l,f,h)=>$.stencilOpSeparate(o,l,f,h),glTexParameteri:(o,l,f)=>$.texParameteri(o,l,f),glTexStorage2D:(o,l,f,h,b)=>$.texStorage2D(o,l,f,h,b),glTexStorage3D:(o,l,f,h,b,S)=>$.texStorage3D(o,l,f,h,b,S),glTexSubImage2D:(o,l,f,h,b,S,k,P,W)=>{if($.ra)$.texSubImage2D(o,l,f,h,b,S,k,P,W);else if(W){var G=np(P);$.texSubImage2D(o,l,f,h,b,S,k,P,G,W>>>31-Math.clz32(G.BYTES_PER_ELEMENT));}else {if(W){G=np(P);var re=S*((BA||b)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[k-6402]||1)*G.BYTES_PER_ELEMENT+Zh-1&-Zh);W=G.subarray(W>>>31-Math.clz32(G.BYTES_PER_ELEMENT),W+re>>>31-Math.clz32(G.BYTES_PER_ELEMENT));}else W=null;$.texSubImage2D(o,l,f,h,b,S,k,P,W);}},glUniform1i:(o,l)=>{var f=$,h=f.uniform1i,b=$.Ib;if(b){var S=b.ma[o];typeof S=="number"&&(b.ma[o]=S=$.getUniformLocation(b,b.vb[o]+(0<S?`[${S}]`:""))),o=S;}else On||(On=1282),o=void 0;h.call(f,o,l);},glUniformBlockBinding:(o,l,f)=>{o=Ii[o],$.uniformBlockBinding(o,l,f);},glUseProgram:o=>{o=Ii[o],$.useProgram(o),$.Ib=o;},glVertexAttribDivisor:(o,l)=>{$.vertexAttribDivisor(o,l);},glVertexAttribIPointer:(o,l,f,h,b)=>{$.vertexAttribIPointer(o,l,f,h,b);},glVertexAttribPointer:(o,l,f,h,b,S)=>{$.vertexAttribPointer(o,l,f,!!h,b,S);},glViewport:(o,l,f,h)=>$.viewport(o,l,f,h),invoke_vii:QT,isWindowsBrowser:function(){return -1<navigator.platform.indexOf("Win")},provokingVertexWEBGL:function(o,l){(o=yn[o].F.pb)&&o.provokingVertexWEBGL(l);},strftime:GA,strftime_l:(o,l,f,h)=>GA(o,l,f,h),upload_image:function(o,l){var f=p.images;f&&(l=f.get(l))&&(o=yn[o].F,o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,l),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false));},wasm_start_image_decode:function(o,l,f){l=p.HEAP8.subarray(l,l+f),f=new Uint8Array(f),f.set(l),createImageBitmap(new Blob([f])).then(function(h){var b=new OffscreenCanvas(h.width,h.height).getContext("2d");b.drawImage(h,0,0),b=b.getImageData(0,0,h.width,h.height);var S=b.data.length,k=p.Cb(S);p.oc.set(b.data,k),p.qc(o,h.width,h.height,k,S);}).catch(function(h){h=h.message||"decode failed";var b=p.Jc(h)+1,S=p.Cb(b);p.Rc(h,S,b),p.rc(o,S),p.pc(S);});}},wt=(function(){function o(f){return wt=f.exports,De=wt.memory,be(),sc=wt.__indirect_function_table,ve.unshift(wt.__wasm_call_ctors),ot--,p.monitorRunDependencies?.(ot),ot==0&&(Ae&&(f=Ae,Ae=null,f())),wt}var l={env:jA,wasi_snapshot_preview1:jA};if(ot++,p.monitorRunDependencies?.(ot),p.instantiateWasm)try{return p.instantiateWasm(l,o)}catch(f){Re(`Module.instantiateWasm callback failed with error: ${f}`),T(f);}return Ye||(Ye=xe("webgl2_advanced.wasm")?"webgl2_advanced.wasm":p.locateFile?p.locateFile("webgl2_advanced.wasm",H):H+"webgl2_advanced.wasm"),Tt(l,function(f){o(f.instance);}).catch(T),{}})(),fr=o=>(fr=wt.free)(o),yc=o=>(yc=wt.malloc)(o);p._setWebImage=(o,l,f)=>(p._setWebImage=wt.setWebImage)(o,l,f);var YA=o=>(YA=wt.__getTypeName)(o);p._wasm_image_decode_complete=(o,l,f,h,b)=>(p._wasm_image_decode_complete=wt.wasm_image_decode_complete)(o,l,f,h,b),p._wasm_image_decode_error=(o,l)=>(p._wasm_image_decode_error=wt.wasm_image_decode_error)(o,l);var qA=p._ma_device__on_notification_unlocked=o=>(qA=p._ma_device__on_notification_unlocked=wt.ma_device__on_notification_unlocked)(o);p._ma_malloc_emscripten=(o,l)=>(p._ma_malloc_emscripten=wt.ma_malloc_emscripten)(o,l),p._ma_free_emscripten=(o,l)=>(p._ma_free_emscripten=wt.ma_free_emscripten)(o,l);var XA=p._ma_device_process_pcm_frames_capture__webaudio=(o,l,f)=>(XA=p._ma_device_process_pcm_frames_capture__webaudio=wt.ma_device_process_pcm_frames_capture__webaudio)(o,l,f),QA=p._ma_device_process_pcm_frames_playback__webaudio=(o,l,f)=>(QA=p._ma_device_process_pcm_frames_playback__webaudio=wt.ma_device_process_pcm_frames_playback__webaudio)(o,l,f),KA=(o,l)=>(KA=wt.setThrew)(o,l),ZA=o=>(ZA=wt._emscripten_stack_restore)(o),JA=()=>(JA=wt.emscripten_stack_get_current)();p.dynCall_iiiji=(o,l,f,h,b,S)=>(p.dynCall_iiiji=wt.dynCall_iiiji)(o,l,f,h,b,S),p.dynCall_iij=(o,l,f,h)=>(p.dynCall_iij=wt.dynCall_iij)(o,l,f,h),p.dynCall_iiji=(o,l,f,h,b)=>(p.dynCall_iiji=wt.dynCall_iiji)(o,l,f,h,b),p.dynCall_jii=(o,l,f)=>(p.dynCall_jii=wt.dynCall_jii)(o,l,f),p.dynCall_vijj=(o,l,f,h,b,S)=>(p.dynCall_vijj=wt.dynCall_vijj)(o,l,f,h,b,S),p.dynCall_jiji=(o,l,f,h,b)=>(p.dynCall_jiji=wt.dynCall_jiji)(o,l,f,h,b),p.dynCall_viijii=(o,l,f,h,b,S,k)=>(p.dynCall_viijii=wt.dynCall_viijii)(o,l,f,h,b,S,k),p.dynCall_iiiiij=(o,l,f,h,b,S,k)=>(p.dynCall_iiiiij=wt.dynCall_iiiiij)(o,l,f,h,b,S,k),p.dynCall_iiiiijj=(o,l,f,h,b,S,k,P,W)=>(p.dynCall_iiiiijj=wt.dynCall_iiiiijj)(o,l,f,h,b,S,k,P,W),p.dynCall_iiiiiijj=(o,l,f,h,b,S,k,P,W,G)=>(p.dynCall_iiiiiijj=wt.dynCall_iiiiiijj)(o,l,f,h,b,S,k,P,W,G);function QT(o,l,f){var h=JA();try{Ha(o)(l,f);}catch(b){if(ZA(h),b!==b+0)throw b;KA(1,0);}}var bc;Ae=function o(){bc||$A(),bc||(Ae=o);};function $A(){function o(){if(!bc&&(bc=true,p.calledRun=true,!fe)){if(p.noFSInit||$u||($u=true,p.stdin=p.stdin,p.stdout=p.stdout,p.stderr=p.stderr,p.stdin?La("stdin",p.stdin):ar("/dev/tty","/dev/stdin"),p.stdout?La("stdout",null,p.stdout):ar("/dev/tty","/dev/stdout"),p.stderr?La("stderr",null,p.stderr):ar("/dev/tty1","/dev/stderr"),Eo("/dev/stdin",0),Eo("/dev/stdout",1),Eo("/dev/stderr",1)),Gi=false,pe(ve),_(p),p.onRuntimeInitialized&&p.onRuntimeInitialized(),p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;){var l=p.postRun.shift();He.unshift(l);}pe(He);}}if(!(0<ot)){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)ct();pe(_e),0<ot||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("");},1),o();},1)):o());}}if(p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);0<p.preInit.length;)p.preInit.pop()();return $A(),A=x,A})})();let d=u;}),(r=>{r.exports=JSON.parse(`{"name":"@rive-app/webgl2","version":"2.38.0","description":"Rive's webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`);}),((r,a,s)=>{s.r(a),s.d(a,{AudioAssetWrapper:()=>v.AudioAssetWrapper,AudioWrapper:()=>v.AudioWrapper,BLANK_URL:()=>g.BLANK_URL,CustomFileAssetLoaderWrapper:()=>v.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>v.FileAssetWrapper,FileFinalizer:()=>v.FileFinalizer,FocusSessionState:()=>d.FocusSessionState,FontAssetWrapper:()=>v.FontAssetWrapper,FontWrapper:()=>v.FontWrapper,ImageAssetWrapper:()=>v.ImageAssetWrapper,ImageWrapper:()=>v.ImageWrapper,KeyboardInteractions:()=>d.KeyboardInteractions,RiveFont:()=>A.RiveFont,createFinalization:()=>v.createFinalization,finalizationRegistry:()=>v.finalizationRegistry,registerTouchInteractions:()=>u.registerTouchInteractions,sanitizeUrl:()=>g.sanitizeUrl});var u=s(7),d=s(8),g=s(9),v=s(10),A=s(11);}),((r,a,s)=>{s.r(a),s.d(a,{registerTouchInteractions:()=>v});var u=void 0,d=function(A,p,_){var T,x=[];if(p)for(var N=0;N<A.length;N++){var E=A[N];x.push({clientX:E.clientX,clientY:E.clientY,identifier:E.identifier});}else {var w=_!==null?(T=Array.from(A).find(function(C){return C.identifier===_}))!==null&&T!==void 0?T:null:A[0];w&&x.push({clientX:w.clientX,clientY:w.clientY,identifier:w.identifier});}return x},g=function(A,p,_,T){var x,N=A;return !((x=N.changedTouches)===null||x===void 0)&&x.length?(!p&&["touchstart","touchmove"].includes(A.type)&&A.preventDefault(),d(N.changedTouches,_,T)):[{clientX:A.clientX,clientY:A.clientY,identifier:0}]},v=function(A){var p=A.canvas,_=A.artboard,T=A.stateMachines,x=T===void 0?[]:T,N=A.renderer,E=A.rive,w=A.fit,C=A.alignment,I=A.isTouchScrollEnabled,V=I===void 0?false:I,K=A.dispatchPointerExit,F=K===void 0?true:K,H=A.enableMultiTouch,J=H===void 0?false:H,Y=A.layoutScaleFactor,Me=Y===void 0?1:Y,Re=A.advanceAndDrain;if(!p||!x.length||!N||!E||!_||typeof window>"u")return null;var he=null,De=false,fe=null,Q=function(U){var z;if(De&&U instanceof MouseEvent){U.type=="mouseup"&&(De=false);return}De=V&&U.type==="touchend"&&he==="touchstart",he=U.type;var X=U.currentTarget.getBoundingClientRect();if(!J&&U.type==="touchstart"&&fe===null){var oe=(z=U.changedTouches)===null||z===void 0?void 0:z[0];oe&&(fe=oe.identifier);}var ge=g(U,V,J,J?null:fe),be=E.computeAlignment(w,C,{minX:0,minY:0,maxX:X.width,maxY:X.height},_.bounds,Me),_e=new E.Mat2D;switch(be.invert(_e),ge.forEach(function(Qe){var pe=Qe.clientX,y=Qe.clientY;if(!(!pe&&!y)){var c=pe-X.left,m=y-X.top,M=new E.Vec2D(c,m),O=E.mapXY(_e,M),B=O.x(),q=O.y();Qe.transformedX=B,Qe.transformedY=q,O.delete(),M.delete();}}),_e.delete(),be.delete(),U.type){case "mouseout":for(var ve=function(Qe){F?ge.forEach(function(pe){Qe.pointerExit(pe.transformedX,pe.transformedY,pe.identifier);}):ge.forEach(function(pe){Qe.pointerMove(pe.transformedX,pe.transformedY,pe.identifier);});},He=0,ct=x;He<ct.length;He++){var ot=ct[He];ve(ot);}break;case "touchmove":case "mouseover":case "mousemove":{for(var ae=function(Qe){ge.forEach(function(pe){Qe.pointerMove(pe.transformedX,pe.transformedY,pe.identifier);});},Ae=0,ze=x;Ae<ze.length;Ae++){var ot=ze[Ae];ae(ot);}break}case "touchstart":case "mousedown":{for(var xe=function(Qe){ge.forEach(function(pe){Qe.pointerDown(pe.transformedX,pe.transformedY,pe.identifier);});},ye=0,Ye=x;ye<Ye.length;ye++){var ot=Ye[ye];xe(ot);}Re(0);break}case "touchend":{for(var Xe=function(Qe){ge.forEach(function(pe){Qe.pointerUp(pe.transformedX,pe.transformedY,pe.identifier),Qe.pointerExit(pe.transformedX,pe.transformedY,pe.identifier);});},qe=0,_t=x;qe<_t.length;qe++){var ot=_t[qe];Xe(ot);}Re(0),!J&&ge.some(function(Qe){return Qe.identifier===fe})&&(fe=null);break}case "mouseup":{for(var Tt=function(Qe){ge.forEach(function(pe){Qe.pointerUp(pe.transformedX,pe.transformedY,pe.identifier);});},mt=0,gt=x;mt<gt.length;mt++){var ot=gt[mt];Tt(ot);}Re(0);break}}},te=function(){fe=null;},D=Q.bind(u);return p.addEventListener("mouseover",D),p.addEventListener("mouseout",D),p.addEventListener("mousemove",D),p.addEventListener("mousedown",D),p.addEventListener("mouseup",D),p.addEventListener("touchmove",D,{passive:V}),p.addEventListener("touchstart",D,{passive:V}),p.addEventListener("touchend",D),p.addEventListener("touchcancel",te),function(){p.removeEventListener("mouseover",D),p.removeEventListener("mouseout",D),p.removeEventListener("mousemove",D),p.removeEventListener("mousedown",D),p.removeEventListener("mouseup",D),p.removeEventListener("touchmove",D),p.removeEventListener("touchstart",D),p.removeEventListener("touchend",D),p.removeEventListener("touchcancel",te);}};}),((r,a,s)=>{s.r(a),s.d(a,{FocusSessionState:()=>u,KeyboardInteractions:()=>d});var u;(function(g){g.NotFocused="notFocused",g.EntryPending="entryPending",g.RiveFocused="riveFocused";})(u||(u={}));var d=(function(){function g(v){var A=v.canvas,p=v.stateMachine,_=v.hasFocusNodes,T=this;this.focusSessionState=u.NotFocused,this.onCanvasFocus=function(x){if(T.hasFocusNodes&&!T.mainSm.focusState().hasFocus&&(T.focusSessionState=u.EntryPending,!!T.isKeyboardDrivenFocus())){var N=T.cameFromBeforeCanvas(x.relatedTarget);(N?T.mainSm.focusNext():T.mainSm.focusPrevious())&&(T.focusSessionState=u.RiveFocused);}},this.onCanvasBlur=function(x){T.focusSessionState=u.NotFocused;},this.onKeyDown=function(x){if(T.focusSessionState!==u.NotFocused&&x.code==="Tab"&&T.hasFocusNodes){var N=!x.shiftKey,E=N?T.mainSm.focusNext():T.mainSm.focusPrevious();E?(T.focusSessionState=u.RiveFocused,x.preventDefault()):T.focusSessionState=u.NotFocused;}},this.canvas=A,this.mainSm=p,this.hasFocusNodes=_,A.addEventListener("focus",this.onCanvasFocus),A.addEventListener("blur",this.onCanvasBlur),A.addEventListener("keydown",this.onKeyDown);}return g.prototype.setFocusSessionState=function(v){this.focusSessionState=v;},g.prototype.notifyRiveFocused=function(){this.focusSessionState=u.RiveFocused;},g.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return false}},g.prototype.cameFromBeforeCanvas=function(v){if(!v)return true;var A=this.canvas.compareDocumentPosition(v);return A&Node.DOCUMENT_POSITION_PRECEDING?true:!(A&Node.DOCUMENT_POSITION_FOLLOWING)},g.prototype.cleanup=function(){this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown);},g})();}),((r,a,s)=>{s.r(a),s.d(a,{BLANK_URL:()=>_,sanitizeUrl:()=>N});var u=/^([^\w]*)(javascript|data|vbscript)/im,d=/&#(\w+)(^\w|;)?/g,g=/&(newline|tab);/gi,v=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,A=/^.+(:|&colon;)/gim,p=[".","/"],_="about:blank";function T(E){return p.indexOf(E[0])>-1}function x(E){var w=E.replace(v,"");return w.replace(d,function(C,I){return String.fromCharCode(I)})}function N(E){if(!E)return _;var w=x(E).replace(g,"").replace(v,"").trim();if(!w)return _;if(T(w))return w;var C=w.match(A);if(!C)return w;var I=C[0];return u.test(I)?_:w}}),((r,a,s)=>{s.r(a),s.d(a,{AudioAssetWrapper:()=>E,AudioWrapper:()=>p,CustomFileAssetLoaderWrapper:()=>T,FileAssetWrapper:()=>x,FileFinalizer:()=>d,FontAssetWrapper:()=>w,FontWrapper:()=>_,ImageAssetWrapper:()=>N,ImageWrapper:()=>A,createFinalization:()=>K,finalizationRegistry:()=>V});var u=(function(){var F=function(H,J){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,Me){Y.__proto__=Me;}||function(Y,Me){for(var Re in Me)Object.prototype.hasOwnProperty.call(Me,Re)&&(Y[Re]=Me[Re]);},F(H,J)};return function(H,J){if(typeof J!="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");F(H,J);function Y(){this.constructor=H;}H.prototype=J===null?Object.create(J):(Y.prototype=J.prototype,new Y);}})(),d=(function(){function F(H){this.selfUnref=false,this._file=H;}return F.prototype.unref=function(){this._file&&this._file.unref();},F})(),g=(function(){function F(H){this._finalizableObject=H;}return F.prototype.unref=function(){this._finalizableObject.unref();},F})(),v=(function(){function F(){this.selfUnref=false;}return F.prototype.unref=function(){},F})(),A=(function(F){u(H,F);function H(J){var Y=F.call(this)||this;return Y._nativeImage=J,Y}return Object.defineProperty(H.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref();},H})(v),p=(function(F){u(H,F);function H(J){var Y=F.call(this)||this;return Y._nativeAudio=J,Y}return Object.defineProperty(H.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref();},H})(v),_=(function(F){u(H,F);function H(J){var Y=F.call(this)||this;return Y._nativeFont=J,Y}return Object.defineProperty(H.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:false,configurable:true}),H.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref();},H})(v),T=(function(){function F(H,J){this._assetLoaderCallback=J,this.assetLoader=new H.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)});}return F.prototype.loadContents=function(H,J){var Y;if(H.isImage)Y=new N(H);else if(H.isAudio)Y=new E(H);else if(H.isFont)Y=new w(H);else return false;return this._assetLoaderCallback(Y,J)},F})(),x=(function(){function F(H){this._nativeFileAsset=H;}return F.prototype.decode=function(H){this._nativeFileAsset.decode(H);},Object.defineProperty(F.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:false,configurable:true}),Object.defineProperty(F.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:false,configurable:true}),F})(),N=(function(F){u(H,F);function H(){return F!==null&&F.apply(this,arguments)||this}return H.prototype.setRenderImage=function(J){this._nativeFileAsset.setRenderImage(J.nativeImage);},H})(x),E=(function(F){u(H,F);function H(){return F!==null&&F.apply(this,arguments)||this}return H.prototype.setAudioSource=function(J){this._nativeFileAsset.setAudioSource(J.nativeAudio);},H})(x),w=(function(F){u(H,F);function H(){return F!==null&&F.apply(this,arguments)||this}return H.prototype.setFont=function(J){this._nativeFileAsset.setFont(J.nativeFont);},H})(x),C=(function(){function F(H){}return F.prototype.register=function(H){H.selfUnref=true;},F.prototype.unregister=function(H){},F})(),I=typeof FinalizationRegistry<"u"?FinalizationRegistry:C,V=new I(function(F){F?.unref();}),K=function(F,H){var J=new g(H);V.register(F,J);};}),((r,a,s)=>{s.r(a),s.d(a,{RiveFont:()=>d});var u=s(3),d=(function(){function g(){}return g.setFallbackFontCallback=function(v){g._fallbackFontCallback=v??null,g._wireFallbackProc();},g._fontToPtr=function(v){var A;if(v==null)return null;var p=v.nativeFont,_=(A=p?.ptr)===null||A===void 0?void 0:A.call(p);return _??null},g._getFallbackPtr=function(v,A){return A<0||A>=v.length?null:g._fontToPtr(v[A])},g._wireFallbackProc=function(){u.RuntimeLoader.getInstance(function(v){var A=g._fallbackFontCallback;A?v.setFallbackFontCallback((function(p,_,T){var x=A(p,T);return x?Array.isArray(x)?g._getFallbackPtr(x,_):_===0?g._fontToPtr(x):null:null})):v.setFallbackFontCallback(null);});},g._fallbackFontCallback=null,g})();})],e={};function n(r){var a=e[r];if(a!==void 0)return a.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.d=(r,a)=>{for(var s in a)n.o(a,s)&&!n.o(r,s)&&Object.defineProperty(r,s,{enumerable:true,get:a[s]});},n.o=(r,a)=>Object.prototype.hasOwnProperty.call(r,a),n.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:true});};var i={};return (()=>{n.r(i),n.d(i,{Alignment:()=>x,DataEnum:()=>_e,DataType:()=>ge,DrawOptimizationOptions:()=>N,EventType:()=>Y,Fit:()=>T,Layout:()=>E,LoopType:()=>Me,Rive:()=>oe,RiveEventType:()=>I,RiveFile:()=>X,RiveFont:()=>s.RiveFont,RuntimeLoader:()=>a.RuntimeLoader,StateMachineInput:()=>C,StateMachineInputType:()=>w,Testing:()=>mt,ViewModel:()=>be,ViewModelInstance:()=>He,ViewModelInstanceArtboard:()=>qe,ViewModelInstanceAssetImage:()=>Xe,ViewModelInstanceBoolean:()=>Ae,ViewModelInstanceColor:()=>Ye,ViewModelInstanceEnum:()=>xe,ViewModelInstanceList:()=>ye,ViewModelInstanceNumber:()=>ae,ViewModelInstanceString:()=>ot,ViewModelInstanceTrigger:()=>ze,ViewModelInstanceValue:()=>ct,decodeAudio:()=>gt,decodeFont:()=>pe,decodeImage:()=>Qe});var r=n(1),a=n(3),s=n(6),u=(function(){var y=function(c,m){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,O){M.__proto__=O;}||function(M,O){for(var B in O)Object.prototype.hasOwnProperty.call(O,B)&&(M[B]=O[B]);},y(c,m)};return function(c,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");y(c,m);function M(){this.constructor=c;}c.prototype=m===null?Object.create(m):(M.prototype=m.prototype,new M);}})(),d=function(){return d=Object.assign||function(y){for(var c,m=1,M=arguments.length;m<M;m++){c=arguments[m];for(var O in c)Object.prototype.hasOwnProperty.call(c,O)&&(y[O]=c[O]);}return y},d.apply(this,arguments)},g=function(y,c,m,M){function O(B){return B instanceof m?B:new m(function(q){q(B);})}return new(m||(m=Promise))(function(B,q){function le(ke){try{de(M.next(ke));}catch(vt){q(vt);}}function Ne(ke){try{de(M.throw(ke));}catch(vt){q(vt);}}function de(ke){ke.done?B(ke.value):O(ke.value).then(le,Ne);}de((M=M.apply(y,[])).next());})},v=function(y,c){var m={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},M,O,B,q=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return q.next=le(0),q.throw=le(1),q.return=le(2),typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function le(de){return function(ke){return Ne([de,ke])}}function Ne(de){if(M)throw new TypeError("Generator is already executing.");for(;q&&(q=0,de[0]&&(m=0)),m;)try{if(M=1,O&&(B=de[0]&2?O.return:de[0]?O.throw||((B=O.return)&&B.call(O),0):O.next)&&!(B=B.call(O,de[1])).done)return B;switch(O=0,B&&(de=[de[0]&2,B.value]),de[0]){case 0:case 1:B=de;break;case 4:return m.label++,{value:de[1],done:!1};case 5:m.label++,O=de[1],de=[0];continue;case 7:de=m.ops.pop(),m.trys.pop();continue;default:if(B=m.trys,!(B=B.length>0&&B[B.length-1])&&(de[0]===6||de[0]===2)){m=0;continue}if(de[0]===3&&(!B||de[1]>B[0]&&de[1]<B[3])){m.label=de[1];break}if(de[0]===6&&m.label<B[1]){m.label=B[1],B=de;break}if(B&&m.label<B[2]){m.label=B[2],m.ops.push(de);break}B[2]&&m.ops.pop(),m.trys.pop();continue}de=c.call(y,m);}catch(ke){de=[6,ke],O=0;}finally{M=B=0;}if(de[0]&5)throw de[1];return {value:de[0]?de[1]:void 0,done:true}}},A=function(y,c,m){for(var M=0,O=c.length,B;M<O;M++)(B||!(M in c))&&(B||(B=Array.prototype.slice.call(c,0,M)),B[M]=c[M]);return y.concat(B||Array.prototype.slice.call(c))},p=(function(y){u(c,y);function c(){var m=y!==null&&y.apply(this,arguments)||this;return m.isHandledError=true,m}return c})(Error),_=function(y){return y&&y.isHandledError?y.message:"Problem loading file; may be corrupt!"},T;(function(y){y.Cover="cover",y.Contain="contain",y.Fill="fill",y.FitWidth="fitWidth",y.FitHeight="fitHeight",y.None="none",y.ScaleDown="scaleDown",y.Layout="layout";})(T||(T={}));var x;(function(y){y.Center="center",y.TopLeft="topLeft",y.TopCenter="topCenter",y.TopRight="topRight",y.CenterLeft="centerLeft",y.CenterRight="centerRight",y.BottomLeft="bottomLeft",y.BottomCenter="bottomCenter",y.BottomRight="bottomRight";})(x||(x={}));var N;(function(y){y.AlwaysDraw="alwaysDraw",y.DrawOnChanged="drawOnChanged";})(N||(N={}));var E=(function(){function y(c){var m,M,O,B,q,le,Ne;this.fit=(m=c?.fit)!==null&&m!==void 0?m:T.Contain,this.alignment=(M=c?.alignment)!==null&&M!==void 0?M:x.Center,this.layoutScaleFactor=(O=c?.layoutScaleFactor)!==null&&O!==void 0?O:1,this.minX=(B=c?.minX)!==null&&B!==void 0?B:0,this.minY=(q=c?.minY)!==null&&q!==void 0?q:0,this.maxX=(le=c?.maxX)!==null&&le!==void 0?le:0,this.maxY=(Ne=c?.maxY)!==null&&Ne!==void 0?Ne:0;}return y.new=function(c){var m=c.fit,M=c.alignment,O=c.minX,B=c.minY,q=c.maxX,le=c.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new y({fit:m,alignment:M,minX:O,minY:B,maxX:q,maxY:le})},y.prototype.copyWith=function(c){var m=c.fit,M=c.alignment,O=c.layoutScaleFactor,B=c.minX,q=c.minY,le=c.maxX,Ne=c.maxY;return new y({fit:m??this.fit,alignment:M??this.alignment,layoutScaleFactor:O??this.layoutScaleFactor,minX:B??this.minX,minY:q??this.minY,maxX:le??this.maxX,maxY:Ne??this.maxY})},y.prototype.runtimeFit=function(c){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var m;return this.fit===T.Cover?m=c.Fit.cover:this.fit===T.Contain?m=c.Fit.contain:this.fit===T.Fill?m=c.Fit.fill:this.fit===T.FitWidth?m=c.Fit.fitWidth:this.fit===T.FitHeight?m=c.Fit.fitHeight:this.fit===T.ScaleDown?m=c.Fit.scaleDown:this.fit===T.Layout?m=c.Fit.layout:m=c.Fit.none,this.cachedRuntimeFit=m,m},y.prototype.runtimeAlignment=function(c){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var m;return this.alignment===x.TopLeft?m=c.Alignment.topLeft:this.alignment===x.TopCenter?m=c.Alignment.topCenter:this.alignment===x.TopRight?m=c.Alignment.topRight:this.alignment===x.CenterLeft?m=c.Alignment.centerLeft:this.alignment===x.CenterRight?m=c.Alignment.centerRight:this.alignment===x.BottomLeft?m=c.Alignment.bottomLeft:this.alignment===x.BottomCenter?m=c.Alignment.bottomCenter:this.alignment===x.BottomRight?m=c.Alignment.bottomRight:m=c.Alignment.center,this.cachedRuntimeAlignment=m,m},y})(),w;(function(y){y[y.Number=56]="Number",y[y.Trigger=58]="Trigger",y[y.Boolean=59]="Boolean";})(w||(w={}));var C=(function(){function y(c,m){this.type=c,this.runtimeInput=m;}return Object.defineProperty(y.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(c){this.runtimeInput.value=c;},enumerable:false,configurable:true}),y.prototype.fire=function(){this.type===w.Trigger&&this.runtimeInput.fire();},y.prototype.delete=function(){this.runtimeInput=null;},y})(),I;(function(y){y[y.General=128]="General",y[y.OpenUrl=131]="OpenUrl";})(I||(I={}));var V=(function(){function y(c){this.isBindableArtboard=false,this.isBindableArtboard=c;}return y})(),K=(function(y){u(c,y);function c(m,M){var O=y.call(this,false)||this;return O.nativeArtboard=m,O.file=M,O}return c})(V),F=(function(y){u(c,y);function c(m){var M=y.call(this,true)||this;return M.selfUnref=false,M.nativeArtboard=m,M}return Object.defineProperty(c.prototype,"viewModel",{set:function(m){this.nativeViewModel=m.nativeInstance;},enumerable:false,configurable:true}),c.prototype.destroy=function(){var m;this.selfUnref&&(this.nativeArtboard.unref(),(m=this.nativeViewModel)===null||m===void 0||m.unref());},c})(V),H=(function(){function y(c,m,M,O){this.stateMachine=c,this.playing=M,this.artboard=O,this.inputs=[],this.instance=new m.StateMachineInstance(c,O),this.initInputs(m),this.hasFocusNodes=this.instance.hasFocusNodes();}return Object.defineProperty(y.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"statesChanged",{get:function(){for(var c=[],m=0;m<this.instance.stateChangedCount();m++)c.push(this.instance.stateChangedNameByIndex(m));return c},enumerable:false,configurable:true}),y.prototype.advance=function(c){this.instance.advance(c);},y.prototype.advanceAndApply=function(c){this.instance.advanceAndApply(c);},y.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},y.prototype.reportedEventAt=function(c){return this.instance.reportedEventAt(c)},y.prototype.initInputs=function(c){for(var m=0;m<this.instance.inputCount();m++){var M=this.instance.input(m);this.inputs.push(this.mapRuntimeInput(M,c));}},y.prototype.mapRuntimeInput=function(c,m){if(c.type===m.SMIInput.bool)return new C(w.Boolean,c.asBool());if(c.type===m.SMIInput.number)return new C(w.Number,c.asNumber());if(c.type===m.SMIInput.trigger)return new C(w.Trigger,c.asTrigger())},y.prototype.cleanup=function(){this.inputs.forEach(function(c){c.delete();}),this.inputs.length=0,this.instance.delete();},y.prototype.bindViewModelInstance=function(c){c.runtimeInstance!=null&&this.instance.bindViewModelInstance(c.runtimeInstance);},y.prototype.focusState=function(){return this.instance.focusState()},y.prototype.clearFocus=function(){this.instance.clearFocus();},y})(),J=(function(){function y(c,m,M,O,B){O===void 0&&(O=[]),B===void 0&&(B=[]),this.runtime=c,this.artboard=m,this.eventManager=M,this.animations=O,this.stateMachines=B;}return y.prototype.add=function(c,m,M){if(M===void 0&&(M=true),c=Tt(c),c.length===0)this.animations.forEach(function(Ke){return Ke.playing=m}),this.stateMachines.forEach(function(Ke){return Ke.playing=m});else for(var O=this.animations.map(function(Ke){return Ke.name}),B=this.stateMachines.map(function(Ke){return Ke.name}),q=0;q<c.length;q++){var le=O.indexOf(c[q]),Ne=B.indexOf(c[q]);if(le>=0||Ne>=0)le>=0?this.animations[le].playing=m:this.stateMachines[Ne].playing=m;else {var de=this.artboard.animationByName(c[q]);if(de){var ke=new r.Animation(de,this.artboard,this.runtime,m);ke.advance(0),ke.apply(1),this.animations.push(ke);}else {var vt=this.artboard.stateMachineByName(c[q]);if(vt){var ft=new H(vt,this.runtime,m,this.artboard);this.stateMachines.push(ft);}}}}return M&&(m?this.eventManager.fire({type:Y.Play,data:this.playing}):this.eventManager.fire({type:Y.Pause,data:this.paused})),m?this.playing:this.paused},y.prototype.initLinearAnimations=function(c,m,M){M===void 0&&(M=false);for(var O=this.animations.map(function(ke){return ke.name}),B=0;B<c.length;B++){var q=O.indexOf(c[B]);if(q>=0)this.animations[q].playing=m;else {var le=this.artboard.animationByName(c[B]);if(le){var Ne=new r.Animation(le,this.artboard,this.runtime,m);Ne.advance(0),Ne.apply(1),this.animations.push(Ne);}else if(M){var de="State Machine with name ".concat(c[B]," not found");throw new p(de)}else console.error("Animation with name ".concat(c[B]," not found."));}}},y.prototype.initStateMachines=function(c,m){for(var M=this.stateMachines.map(function(Ne){return Ne.name}),O=0;O<c.length;O++){var B=M.indexOf(c[O]);if(B>=0)this.stateMachines[B].playing=m;else {var q=this.artboard.stateMachineByName(c[O]);if(q){var le=new H(q,this.runtime,m,this.artboard);this.stateMachines.push(le);}else console.warn("State Machine with name ".concat(c[O]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([c[O]],m,true);}}},y.prototype.play=function(c){return this.add(c,true)},y.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(c){c.playing||c.advanceAndApply(0);});},y.prototype.pause=function(c){return this.add(c,false)},y.prototype.scrub=function(c,m){var M=this.animations.filter(function(O){return c.includes(O.name)});return M.forEach(function(O){return O.scrubTo=m}),M.map(function(O){return O.name})},Object.defineProperty(y.prototype,"playing",{get:function(){return this.animations.filter(function(c){return c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"paused",{get:function(){return this.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}).concat(this.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}))},enumerable:false,configurable:true}),y.prototype.stop=function(c){var m=this;c=Tt(c);var M=[];if(c.length===0)M=this.animations.map(function(q){return q.name}).concat(this.stateMachines.map(function(q){return q.name})),this.animations.forEach(function(q){return q.cleanup()}),this.stateMachines.forEach(function(q){return q.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else {var O=this.animations.filter(function(q){return c.includes(q.name)});O.forEach(function(q){q.cleanup(),m.animations.splice(m.animations.indexOf(q),1);});var B=this.stateMachines.filter(function(q){return c.includes(q.name)});B.forEach(function(q){q.cleanup(),m.stateMachines.splice(m.stateMachines.indexOf(q),1);}),M=O.map(function(q){return q.name}).concat(B.map(function(q){return q.name}));}return this.eventManager.fire({type:Y.Stop,data:M}),M},Object.defineProperty(y.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(c,m){return c||m.playing},false)||this.stateMachines.reduce(function(c,m){return c||m.playing},false)},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"isPaused",{get:function(){return !this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:false,configurable:true}),y.prototype.atLeastOne=function(c,m){m===void 0&&(m=true);var M;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([M=this.artboard.animationByIndex(0).name],c,m):this.artboard.stateMachineCount()>0&&this.add([M=this.artboard.stateMachineByIndex(0).name],c,m)),M},y.prototype.handleLooping=function(){for(var c=0,m=this.animations.filter(function(O){return O.playing});c<m.length;c++){var M=m[c];M.loopValue===0&&M.loopCount?(M.loopCount=0,this.stop(M.name)):M.loopValue===1&&M.loopCount?(this.eventManager.fire({type:Y.Loop,data:{animation:M.name,type:Me.Loop}}),M.loopCount=0):M.loopValue===2&&M.loopCount>1&&(this.eventManager.fire({type:Y.Loop,data:{animation:M.name,type:Me.PingPong}}),M.loopCount=0);}},y.prototype.handleStateChanges=function(){for(var c=[],m=0,M=this.stateMachines.filter(function(B){return B.playing});m<M.length;m++){var O=M[m];c.push.apply(c,O.statesChanged);}c.length>0&&this.eventManager.fire({type:Y.StateChange,data:c});},y.prototype.handleAdvancing=function(c){this.eventManager.fire({type:Y.Advance,data:c});},y})(),Y;(function(y){y.Load="load",y.LoadError="loaderror",y.Play="play",y.Pause="pause",y.Stop="stop",y.Loop="loop",y.Draw="draw",y.Advance="advance",y.StateChange="statechange",y.RiveEvent="riveevent",y.AudioStatusChange="audiostatuschange";})(Y||(Y={}));var Me;(function(y){y.OneShot="oneshot",y.Loop="loop",y.PingPong="pingpong";})(Me||(Me={}));var Re=(function(){function y(c){c===void 0&&(c=[]),this.listeners=c;}return y.prototype.getListeners=function(c){return this.listeners.filter(function(m){return m.type===c})},y.prototype.add=function(c){this.listeners.includes(c)||this.listeners.push(c);},y.prototype.remove=function(c){for(var m=0;m<this.listeners.length;m++){var M=this.listeners[m];if(M.type===c.type&&M.callback===c.callback){this.listeners.splice(m,1);break}}},y.prototype.removeAll=function(c){var m=this;c?this.listeners.filter(function(M){return M.type===c}).forEach(function(M){return m.remove(M)}):this.listeners.splice(0,this.listeners.length);},y.prototype.fire=function(c){var m=this.getListeners(c.type);m.forEach(function(M){return M.callback(c)});},y})(),he=(function(){function y(c){this.eventManager=c,this.queue=[];}return y.prototype.add=function(c){this.queue.push(c);},y.prototype.process=function(){for(;this.queue.length>0;){var c=this.queue.shift();c?.action&&c.action(),c?.event&&this.eventManager.fire(c.event);}},y})(),De;(function(y){y[y.AVAILABLE=0]="AVAILABLE",y[y.UNAVAILABLE=1]="UNAVAILABLE";})(De||(De={}));var fe=(function(y){u(c,y);function c(){var m=y!==null&&y.apply(this,arguments)||this;return m._started=false,m._enabled=false,m._status=De.UNAVAILABLE,m}return c.prototype.delay=function(m){return g(this,void 0,void 0,function(){return v(this,function(M){return [2,new Promise(function(O){return setTimeout(O,m)})]})})},c.prototype.timeout=function(){return g(this,void 0,void 0,function(){return v(this,function(m){return [2,new Promise(function(M,O){return setTimeout(O,50)})]})})},c.prototype.reportToListeners=function(){this.fire({type:Y.AudioStatusChange}),this.removeAll();},c.prototype.enableAudio=function(){return g(this,void 0,void 0,function(){return v(this,function(m){return this._enabled||(this._enabled=true,this._status=De.AVAILABLE,this.reportToListeners()),[2]})})},c.prototype.testAudio=function(){return g(this,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:if(!(this._status===De.UNAVAILABLE&&this._audioContext!==null))return [3,4];M.label=1;case 1:return M.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return M.sent(),this.enableAudio(),[3,4];case 3:return M.sent(),[3,4];case 4:return [2]}})})},c.prototype._establishAudio=function(){return g(this,void 0,void 0,function(){return v(this,function(m){switch(m.label){case 0:return this._started?[3,5]:(this._started=true,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),m.label=2;case 2:return this._status!==De.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return m.sent(),[4,this.delay(1e3)];case 4:return m.sent(),[3,2];case 5:return [2]}})})},c.prototype.listenForUserAction=function(){var m=this,M=function(){return g(m,void 0,void 0,function(){return v(this,function(O){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",M,{once:true});},c.prototype.establishAudio=function(){return g(this,void 0,void 0,function(){return v(this,function(m){return this._establishAudio(),[2]})})},Object.defineProperty(c.prototype,"systemVolume",{get:function(){return this._status===De.UNAVAILABLE?(this.testAudio(),0):1},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"status",{get:function(){return this._status},enumerable:false,configurable:true}),c})(Re),Q=new fe,te=(function(){function y(){}return y.prototype.observe=function(){},y.prototype.unobserve=function(){},y.prototype.disconnect=function(){},y})(),D=globalThis.ResizeObserver||te,U=(function(){function y(){var c=this;this._elementsMap=new Map,this._onObservedEntry=function(m){var M=c._elementsMap.get(m.target);M!==null?M.onResize(m.target.clientWidth==0||m.target.clientHeight==0):c._resizeObserver.unobserve(m.target);},this._onObserved=function(m){m.forEach(c._onObservedEntry);},this._resizeObserver=new D(this._onObserved);}return y.prototype.add=function(c,m){var M={onResize:m,element:c};return this._elementsMap.set(c,M),this._resizeObserver.observe(c),M},y.prototype.remove=function(c){this._resizeObserver.unobserve(c.element),this._elementsMap.delete(c.element);},y})(),z=new U,X=(function(){function y(c){this.enableRiveAssetCDN=true,this.enablePerfMarks=false,this.referenceCount=0,this.destroyed=false,this.selfUnref=false,this.bindableArtboards=[],this.src=c.src,this.buffer=c.buffer,c.assetLoader&&(this.assetLoader=c.assetLoader),this.enableRiveAssetCDN=typeof c.enableRiveAssetCDN=="boolean"?c.enableRiveAssetCDN:true,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this.eventManager=new Re,c.onLoad&&this.on(Y.Load,c.onLoad),c.onLoadError&&this.on(Y.LoadError,c.onLoadError);}return y.prototype.releaseFile=function(){var c;this.selfUnref&&((c=this.file)===null||c===void 0||c.unref()),this.file=null;},y.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(c){return c.destroy()});},y.prototype.initData=function(){return g(this,void 0,void 0,function(){var c,m,M,O,B,q;return v(this,function(le){switch(le.label){case 0:if(!(this.src&&!this.buffer))return [3,4];le.label=1;case 1:return le.trys.push([1,3,,4]),c=this,[4,_t(this.src)];case 2:return c.buffer=le.sent(),[3,4];case 3:throw m=le.sent(),m instanceof Error?m:new p(y.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(O=new s.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),M=O.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),B=this,[4,this.runtime.load(new Uint8Array(this.buffer),M,this.enableRiveAssetCDN)]);case 5:return B.file=le.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),q=new s.FileFinalizer(this.file),s.finalizationRegistry.register(this,q),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:Y.Load,data:this}):this.fireLoadError(y.fileLoadErrorMessage),[2])}})})},y.prototype.loadRiveFileBytes=function(){return g(this,void 0,void 0,function(){var c;return v(this,function(m){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),c=this.src?_t(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&c.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end");}),[2,c]})})},y.prototype.loadRuntime=function(){return g(this,void 0,void 0,function(){var c;return v(this,function(m){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),c=a.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&c.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end");}),[2,c]})})},y.prototype.init=function(){return g(this,void 0,void 0,function(){var c,m,M,O;return v(this,function(B){switch(B.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(y.missingErrorMessage),[2];B.label=1;case 1:return B.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return c=B.sent(),m=c[0],M=c[1],this.destroyed?[2]:(this.buffer=m,this.runtime=M,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()]);case 3:return B.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return O=B.sent(),this.fireLoadError(O instanceof Error?O.message:y.fileLoadErrorMessage),[3,5];case 5:return [2]}})})},y.prototype.fireLoadError=function(c){throw this.eventManager.fire({type:Y.LoadError,data:c}),new p(c)},y.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},y.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},y.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=true);},y.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},y.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},y.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup();},y.prototype.createBindableArtboard=function(c){if(c!=null){var m=new F(c);return (0, s.createFinalization)(m,m.nativeArtboard),this.bindableArtboards.push(m),m}return null},y.prototype.getArtboard=function(c){var m=this.file.artboardByName(c);if(m!=null)return new K(m,this)},y.prototype.getBindableArtboard=function(c){var m=this.file.bindableArtboardByName(c);return this.createBindableArtboard(m)},y.prototype.getDefaultBindableArtboard=function(){var c=this.file.bindableArtboardDefault();return this.createBindableArtboard(c)},y.prototype.internalBindableArtboardFromArtboard=function(c){var m=this.file.internalBindableArtboardFromArtboard(c);return this.createBindableArtboard(m)},y.prototype.viewModelByName=function(c){var m=this.file.viewModelByName(c);return m!==null?new be(m):null},y.missingErrorMessage="Rive source file or data buffer required",y.fileLoadErrorMessage="The file failed to load",y})(),oe=(function(){function y(c){var m=this,M,O,B;this.loaded=false,this.destroyed=false,this._observed=null,this.readyForPlaying=false,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=false,this.automaticallyHandleEvents=false,this.dispatchPointerExit=true,this.enableMultiTouch=false,this.enableRiveAssetCDN=true,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=false,this._needsRedraw=false,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._pageVisibilityHandler=null,this._explicitlyStoppedRendering=false,this._viewModelInstance=null,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=false,this._focusOptions={allowFocusInterrupt:false},this.drawOptimization=N.DrawOnChanged,this.enablePerfMarks=false,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=false,this.onCanvasResize=function(q){var le=m._hasZeroSize!==q;m._hasZeroSize=q,q?(!m._layout.maxX||!m._layout.maxY)&&m.resizeToCanvas():le&&m.resizeDrawingSurfaceToCanvas();},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=c.canvas,c.canvas.constructor===HTMLCanvasElement&&(this._observed=z.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=c.src,this.buffer=c.buffer,this.riveFile=c.riveFile,this.layout=(M=c.layout)!==null&&M!==void 0?M:new E,this.shouldDisableRiveListeners=!!c.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!c.isTouchScrollEnabled,this.automaticallyHandleEvents=!!c.automaticallyHandleEvents,this.dispatchPointerExit=c.dispatchPointerExit===false?c.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!c.enableMultiTouch,this.drawOptimization=(O=c.drawingOptions)!==null&&O!==void 0?O:this.drawOptimization,this.enableRiveAssetCDN=c.enableRiveAssetCDN===void 0?true:c.enableRiveAssetCDN,this.enablePerfMarks=!!c.enablePerfMarks,this.enablePerfMarks&&(a.RuntimeLoader.enablePerfMarks=true),this._focusOptions=(B=c.focusOptions)!==null&&B!==void 0?B:this._focusOptions,this.eventManager=new Re,c.onLoad&&this.on(Y.Load,c.onLoad),c.onLoadError&&this.on(Y.LoadError,c.onLoadError),c.onPlay&&this.on(Y.Play,c.onPlay),c.onPause&&this.on(Y.Pause,c.onPause),c.onStop&&this.on(Y.Stop,c.onStop),c.onLoop&&this.on(Y.Loop,c.onLoop),c.onStateChange&&this.on(Y.StateChange,c.onStateChange),c.onAdvance&&this.on(Y.Advance,c.onAdvance),c.onload&&!c.onLoad&&this.on(Y.Load,c.onload),c.onloaderror&&!c.onLoadError&&this.on(Y.LoadError,c.onloaderror),c.onplay&&!c.onPlay&&this.on(Y.Play,c.onplay),c.onpause&&!c.onPause&&this.on(Y.Pause,c.onpause),c.onstop&&!c.onStop&&this.on(Y.Stop,c.onstop),c.onloop&&!c.onLoop&&this.on(Y.Loop,c.onloop),c.onstatechange&&!c.onStateChange&&this.on(Y.StateChange,c.onstatechange),c.assetLoader&&(this.assetLoader=c.assetLoader),this.taskQueue=new he(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:c.autoplay,autoBind:c.autoBind,animations:c.animations,stateMachines:c.stateMachines,artboard:c.artboard,useOffscreenRenderer:c.useOffscreenRenderer,tabIndex:c.tabIndex});}return Object.defineProperty(y.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:false,configurable:true}),y.new=function(c){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new y(c)},y.prototype.onSystemAudioChanged=function(){this.volume=this._volume;},y.prototype.init=function(c){var m=this,M=c.src,O=c.buffer,B=c.riveFile,q=c.animations,le=c.stateMachines,Ne=c.artboard,de=c.autoplay,ke=de===void 0?false:de,vt=c.useOffscreenRenderer,ft=vt===void 0?false:vt,Ke=c.autoBind,Gt=Ke===void 0?false:Ke,rn=c.tabIndex;if(!this.destroyed){if(this.src=M,this.buffer=O,this.riveFile=B,this._tabIndex=rn??null,!this.src&&!this.buffer&&!this.riveFile)throw new p(y.missingErrorMessage);var $e=Tt(q),an=Tt(le);this.loaded=false,this.readyForPlaying=false,a.RuntimeLoader.awaitInstance().then(function(Wt){if(!m.destroyed){m.runtime=Wt,m.removeRiveListeners(),m.deleteRiveRenderer(),m.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(m.renderer=m.runtime.makeRenderer(m.canvas,ft),!m.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(jt){throw console.error(jt),new p("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}m.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),m.canvas.width||m.canvas.height||m.resizeDrawingSurfaceToCanvas(),m.initData(Ne,$e,an,ke,Gt).then(function(jt){if(jt)return m.setupRiveListeners()}).catch(function(jt){console.error(jt);});}}).catch(function(Wt){m.eventManager.fire({type:Y.LoadError,data:Wt.message});});}},y.prototype.setupRiveListeners=function(c){var m=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var M=this.animator.stateMachines.filter(function(ke){return ke.playing}),O=M.filter(function(ke){return m.runtime.hasListeners(ke.instance)}).map(function(ke){return ke.instance}),B=this.isTouchScrollEnabled,q=this.dispatchPointerExit,le=this.enableMultiTouch;c&&"isTouchScrollEnabled"in c&&(B=c.isTouchScrollEnabled),this.eventCleanup=(0, s.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:O,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:B,dispatchPointerExit:q,enableMultiTouch:le,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)});var Ne=M.filter(function(ke){return ke.hasFocusNodes});if(Ne.length){var de=this.canvas.tabIndex;(de===-1||isNaN(de))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),typeof window<"u"&&(this._keyboardInteractions=new s.KeyboardInteractions({canvas:this.canvas,stateMachine:Ne[0].instance,hasFocusNodes:true}));}}},y.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null);},y.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions();},y.prototype.initializeAudio=function(){var c=this,m;Q.status==De.UNAVAILABLE&&(this.file.hasAudio||!((m=this.artboard)===null||m===void 0)&&m.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:Y.AudioStatusChange,callback:function(){return c.onSystemAudioChanged()}},Q.add(this._audioEventListener),Q.establishAudio());},y.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height);},y.prototype.initData=function(c,m,M,O,B){return g(this,void 0,void 0,function(){var q,le,Ne,de;return v(this,function(ke){switch(ke.label){case 0:return ke.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(q=new X({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=q,[4,q.init()]);case 1:if(ke.sent(),this.destroyed)return q.destroyIfUnused(),[2,false];ke.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(c,m,M,O,B),this.initArtboardSize(),this.initializeAudio();try{this.loaded=!0,this.eventManager.fire({type:Y.Load,data:(de=this.src)!==null&&de!==void 0?de:"buffer"});}catch(vt){console.error(vt);}return this.animator.advanceIfPaused(),this.readyForPlaying=true,this.taskQueue.process(),this.drawFrame(),[2,true];case 3:return le=ke.sent(),Ne=_(le),this.eventManager.fire({type:Y.LoadError,data:Ne}),[2,Promise.reject(Ne)];case 4:return [2]}})})},y.prototype.initArtboard=function(c,m,M,O,B){if(this.file){var q=c?this.file.artboardByName(c):this.file.defaultArtboard();if(!q)throw new p("Invalid artboard name or no default artboard");this.artboard=q,q.volume=this._volume*Q.systemVolume,this.animator=new J(this.runtime,this.artboard,this.eventManager);var le;if(m.length>0||M.length>0?(le=m.concat(M),this.animator.initLinearAnimations(m,O),this.animator.initStateMachines(M,O)):le=[this.animator.atLeastOne(O,false)],this.taskQueue.add({event:{type:O?Y.Play:Y.Pause,data:le}}),B){var Ne=this.file.defaultArtboardViewModel(q);if(Ne!==null){var de=Ne.defaultInstance();if(de!==null){var ke=new He(de,null);(0, s.createFinalization)(ke,ke.runtimeInstance),this.bindViewModelInstance(ke);}}}}},y.prototype.drawFrame=function(){var c,m;!((c=document?.timeline)===null||c===void 0)&&c.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(m=this.runtime)===null||m===void 0||m.resolveAnimationFrame()):this.scheduleRendering();},y.prototype._canvasSizeChanged=function(){var c=false;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,c=true),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,c=true)),c},y.prototype.pollFocusState=function(){if(!this._keyboardInteractions){this._prevHasFocus=false;return}var c=this.animator.stateMachines.find(function(M){return M.playing&&M.hasFocusNodes});if(!c){this._prevHasFocus=false;return}if(this.canvas instanceof HTMLCanvasElement){var m=c.focusState().hasFocus;if(m){this._keyboardInteractions.notifyRiveFocused(),this._prevHasFocus||(this.canvas!==document.activeElement&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=true);return}this._prevHasFocus=false,this._keyboardInteractions.focusSessionState===s.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(s.FocusSessionState.NotFocused);}},y.prototype.advanceAndReportChanges=function(c){for(var m,M=this.animator.animations.filter(function(Ie){return Ie.playing||Ie.needsScrub}).sort(function(Ie){return Ie.needsScrub?-1:1}),O=0,B=M;O<B.length;O++){var q=B[O];q.advance(c),q.instance.didLoop&&(q.loopCount+=1),q.apply(1);}for(var le=this.animator.stateMachines.filter(function(Ie){return Ie.playing}),Ne=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,de=0,ke=le;de<ke.length;de++){var vt=ke[de],ft=vt.reportedEventCount();if(ft)for(var Ke=0;Ke<ft;Ke++){var Gt=vt.reportedEventAt(Ke);if(Gt)if(Gt.type===I.OpenUrl){if(this.eventManager.fire({type:Y.RiveEvent,data:Gt}),this.automaticallyHandleEvents){var rn=document.createElement("a"),$e=Gt,an=$e.url,Wt=$e.target,jt=(0, s.sanitizeUrl)(an);an&&rn.setAttribute("href",jt),Wt&&rn.setAttribute("target",Wt),jt&&jt!==s.BLANK_URL&&rn.click();}}else this.eventManager.fire({type:Y.RiveEvent,data:Gt});}Ne>=0&&performance.mark("rive:sm-advance:start:f".concat(Ne)),vt.advanceAndApply(c),Ne>=0&&(performance.mark("rive:sm-advance:end:f".concat(Ne)),performance.measure("rive:sm-advance:f".concat(Ne),"rive:sm-advance:start:f".concat(Ne),"rive:sm-advance:end:f".concat(Ne)));}this.animator.stateMachines.length==0&&this.artboard.advance(c),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(c),this.pollFocusState(),(m=this._viewModelInstance)===null||m===void 0||m.handleCallbacks();},y.prototype.draw=function(c,m){this.frameRequestId=null;var M=performance.now(),O=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=c),this.renderSecondTimer+=c-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,m?.());var B=(c-this.lastRenderTime)/1e3;this.lastRenderTime=c,this.advanceAndReportChanges(B);var q=this.renderer;this._hasZeroSize||(this.drawOptimization==N.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(q.clear(),q.save(),O>=0&&performance.mark("rive:align-renderer:start:f".concat(O)),this.alignRenderer(),O>=0&&(performance.mark("rive:align-renderer:end:f".concat(O)),performance.measure("rive:align-renderer:f".concat(O),"rive:align-renderer:start:f".concat(O),"rive:align-renderer:end:f".concat(O))),O>=0&&performance.mark("rive:artboard-draw:start:f".concat(O)),this.artboard.draw(q),O>=0&&(performance.mark("rive:artboard-draw:end:f".concat(O)),performance.measure("rive:artboard-draw:f".concat(O),"rive:artboard-draw:start:f".concat(O),"rive:artboard-draw:end:f".concat(O))),q.restore(),O>=0&&performance.mark("rive:renderer-flush:start:f".concat(O)),q.flush(),O>=0&&(performance.mark("rive:renderer-flush:end:f".concat(O)),performance.measure("rive:renderer-flush:f".concat(O),"rive:renderer-flush:start:f".concat(O),"rive:renderer-flush:end:f".concat(O))),this._needsRedraw=false),this.frameCount++;var le=performance.now();for(this.frameTimes.push(le),this.durations.push(le-M);this.frameTimes[0]<=le-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0);},y.prototype.alignRenderer=function(){var c=this,m=c.renderer,M=c.runtime,O=c._layout,B=c.artboard;m.align(O.runtimeFit(M),O.runtimeAlignment(M),{minX:O.minX,minY:O.minY,maxX:O.maxX,maxY:O.maxY},B.bounds,this._devicePixelRatioUsed*O.layoutScaleFactor);},Object.defineProperty(y.prototype,"fps",{get:function(){return this.durations.length},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(c,m){return c+m},0)/this.durations.length).toFixed(4)},enumerable:false,configurable:true}),y.prototype.cleanup=function(){var c,m;this.destroyed=true,this.stopRendering(),this.cleanupInstances(),this._observed!==null&&z.remove(this._observed),this.removeRiveListeners(),this.file&&((c=this.riveFile)===null||c===void 0||c.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(Q.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=null,this._dataEnums=null;},y.prototype.deleteRiveRenderer=function(){var c;(c=this.renderer)===null||c===void 0||c.delete(),this.renderer=null;},y.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null);},y.prototype.retrieveTextRun=function(c){var m;if(!c){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var M=this.artboard.textRun(c);if(!M){console.warn("Could not access a text run with name '".concat(c,"' in the '").concat((m=this.artboard)===null||m===void 0?void 0:m.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return M},y.prototype.getTextRunValue=function(c){var m=this.retrieveTextRun(c);return m?m.text:void 0},y.prototype.setTextRunValue=function(c,m){var M=this.retrieveTextRun(c);M&&(M.text=m);},y.prototype.play=function(c,m){var M=this;if(c=Tt(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return M.play(c,m)}});return}this.animator.play(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering();},y.prototype.pause=function(c){var m=this;if(c=Tt(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.pause(c)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(c);},y.prototype.scrub=function(c,m){var M=this;if(c=Tt(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return M.scrub(c,m)}});return}this.animator.scrub(c,m||0),this.drawFrame();},y.prototype.stop=function(c){var m=this;if(c=Tt(c),!this.readyForPlaying){this.taskQueue.add({action:function(){return m.stop(c)}});return}this.animator&&this.animator.stop(c),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions();},y.prototype.reset=function(c){var m,M,O=c?.artboard,B=Tt(c?.animations),q=Tt(c?.stateMachines),le=(m=c?.autoplay)!==null&&m!==void 0?m:false,Ne=(M=c?.autoBind)!==null&&M!==void 0?M:false;this.cleanupInstances(),this.initArtboard(O,B,q,le,Ne),this.taskQueue.process();},y.prototype.load=function(c){this.file=null,this.stop(),this.init(c);},Object.defineProperty(y.prototype,"layout",{get:function(){return this._layout},set:function(c){this._layout=c,(!c.maxX||!c.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame();},enumerable:false,configurable:true}),y.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height});},y.prototype.resizeDrawingSurfaceToCanvas=function(c){if(this.canvas instanceof HTMLCanvasElement&&window){var m=this.canvas.getBoundingClientRect(),M=m.width,O=m.height,B=c||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=B,this.canvas.width=B*M,this.canvas.height=B*O,this._needsRedraw=true,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===T.Layout){var q=this._layout.layoutScaleFactor;this.artboard.width=M/q,this.artboard.height=O/q;}}},Object.defineProperty(y.prototype,"source",{get:function(){return this.src},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.animationCount();m++)c.push(this.artboard.animationByIndex(m).name);return c},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return [];for(var c=[],m=0;m<this.artboard.stateMachineCount();m++)c.push(this.artboard.stateMachineByIndex(m).name);return c},enumerable:false,configurable:true}),y.prototype.stateMachineInputs=function(c){if(this.loaded){var m=this.animator.stateMachines.find(function(M){return M.name===c});return m?.inputs}},y.prototype.retrieveInputAtPath=function(c,m){if(!c){console.warn("No input name provided for path '".concat(m,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var M=this.artboard.inputByPath(c,m);if(!M){console.warn("Could not access an input with name: '".concat(c,"', at path:'").concat(m,"'"));return}return M},y.prototype.setBooleanStateAtPath=function(c,m,M){var O=this.retrieveInputAtPath(c,M);O&&(O.type===w.Boolean?O.asBool().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(M,"' is not a boolean")));},y.prototype.setNumberStateAtPath=function(c,m,M){var O=this.retrieveInputAtPath(c,M);O&&(O.type===w.Number?O.asNumber().value=m:console.warn("Input with name: '".concat(c,"', at path:'").concat(M,"' is not a number")));},y.prototype.fireStateAtPath=function(c,m){var M=this.retrieveInputAtPath(c,m);M&&(M.type===w.Trigger?M.asTrigger().fire():console.warn("Input with name: '".concat(c,"', at path:'").concat(m,"' is not a trigger")));},y.prototype.retrieveTextAtPath=function(c,m){if(!c){console.warn("No text name provided for path '".concat(m,"'"));return}if(!m){console.warn("No path provided for text '".concat(c,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(c,"', at path: '").concat(m,"', but the Artboard is null"));return}var M=this.artboard.textByPath(c,m);if(!M){console.warn("Could not access text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return M},y.prototype.getTextRunValueAtPath=function(c,m){var M=this.retrieveTextAtPath(c,m);if(!M){console.warn("Could not get text with name: '".concat(c,"', at path:'").concat(m,"'"));return}return M.text},y.prototype.setTextRunValueAtPath=function(c,m,M){var O=this.retrieveTextAtPath(c,M);if(!O){console.warn("Could not set text with name: '".concat(c,"', at path:'").concat(M,"'"));return}O.text=m;},Object.defineProperty(y.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(c){return !c.playing}).map(function(c){return c.name}):[]},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"isStopped",{get:function(){var c,m;return (m=(c=this.animator)===null||c===void 0?void 0:c.isStopped)!==null&&m!==void 0?m:true},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:false,configurable:true}),y.prototype.on=function(c,m){this.eventManager.add({type:c,callback:m});},y.prototype.off=function(c,m){this.eventManager.remove({type:c,callback:m});},y.prototype.unsubscribe=function(c,m){console.warn("This function is deprecated: please use `off()` instead."),this.off(c,m);},y.prototype.removeAllRiveEventListeners=function(c){this.eventManager.removeAll(c);},y.prototype.unsubscribeAll=function(c){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(c);},y.prototype.stopRendering=function(){this._explicitlyStoppedRendering=true,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null);},y.prototype.startRendering=function(){this._explicitlyStoppedRendering=false,this.drawFrame();},y.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw));},y.prototype._onPageVisibilityChange=function(){var c,m;document.hidden?(this.frameRequestId!==null&&(!((c=this.runtime)===null||c===void 0)&&c.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((m=this.animator)===null||m===void 0)&&m.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering();},y.prototype.enableFPSCounter=function(c){this.runtime.enableFPSCounter(c);},y.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter();},Object.defineProperty(y.prototype,"contents",{get:function(){if(this.loaded){for(var c={artboards:[]},m=0;m<this.file.artboardCount();m++){for(var M=this.file.artboardByIndex(m),O={name:M.name,animations:[],stateMachines:[]},B=0;B<M.animationCount();B++){var q=M.animationByIndex(B);O.animations.push(q.name);}for(var le=0;le<M.stateMachineCount();le++){for(var Ne=M.stateMachineByIndex(le),de=Ne.name,ke=new this.runtime.StateMachineInstance(Ne,M),vt=[],ft=0;ft<ke.inputCount();ft++){var Ke=ke.input(ft);vt.push({name:Ke.name,type:Ke.type});}O.stateMachines.push({name:de,inputs:vt});}c.artboards.push(O);}return c}},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(c){this._volume=c,this.artboard&&(this.artboard.volume=c*Q.systemVolume);},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"artboardWidth",{get:function(){var c;return this.artboard?this.artboard.width:(c=this._artboardWidth)!==null&&c!==void 0?c:0},set:function(c){this._artboardWidth=c,this.artboard&&(this.artboard.width=c);},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"artboardHeight",{get:function(){var c;return this.artboard?this.artboard.height:(c=this._artboardHeight)!==null&&c!==void 0?c:0},set:function(c){this._artboardHeight=c,this.artboard&&(this.artboard.height=c);},enumerable:false,configurable:true}),y.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0);},Object.defineProperty(y.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(c){this._devicePixelRatioUsed=c;},enumerable:false,configurable:true}),y.prototype.bindViewModelInstance=function(c){var m;this.artboard&&!this.destroyed&&c&&c.runtimeInstance&&(c.internalIncrementReferenceCount(),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=c,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(M){return M.bindViewModelInstance(c)}):this.artboard.bindViewModelInstance(c.runtimeInstance));},Object.defineProperty(y.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:false,configurable:true}),y.prototype.viewModelByIndex=function(c){var m=this.file.viewModelByIndex(c);return m!==null?new be(m):null},y.prototype.viewModelByName=function(c){var m;return (m=this.riveFile)===null||m===void 0?void 0:m.viewModelByName(c)},y.prototype.enums=function(){if(this._dataEnums===null){var c=this.file.enums();this._dataEnums=c.map(function(m){return new _e(m)});}return this._dataEnums},y.prototype.defaultViewModel=function(){if(this.artboard){var c=this.file.defaultArtboardViewModel(this.artboard);if(c)return new be(c)}return null},y.prototype.getArtboard=function(c){var m,M;return (M=(m=this.riveFile)===null||m===void 0?void 0:m.getArtboard(c))!==null&&M!==void 0?M:null},y.prototype.getBindableArtboard=function(c){var m,M;return (M=(m=this.riveFile)===null||m===void 0?void 0:m.getBindableArtboard(c))!==null&&M!==void 0?M:null},y.prototype.getDefaultBindableArtboard=function(){var c,m;return (m=(c=this.riveFile)===null||c===void 0?void 0:c.getDefaultBindableArtboard())!==null&&m!==void 0?m:null},y.prototype.clearFocus=function(){var c=this.animator.stateMachines.filter(function(m){return m.playing&&m.hasFocusNodes});c.forEach(function(m){return m.clearFocus()});},y.missingErrorMessage="Rive source file or data buffer required",y.cleanupErrorMessage="Attempt to use file after calling cleanup.",y})(),ge;(function(y){y.none="none",y.string="string",y.number="number",y.boolean="boolean",y.color="color",y.list="list",y.enumType="enumType",y.trigger="trigger",y.viewModel="viewModel",y.integer="integer",y.listIndex="listIndex",y.image="image",y.artboard="artboard";})(ge||(ge={}));var be=(function(){function y(c){this._viewModel=c;}return Object.defineProperty(y.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"name",{get:function(){return this._viewModel.name},enumerable:false,configurable:true}),y.prototype.instanceByIndex=function(c){var m=this._viewModel.instanceByIndex(c);if(m!==null){var M=new He(m,null);return (0, s.createFinalization)(M,m),M}return null},y.prototype.instanceByName=function(c){var m=this._viewModel.instanceByName(c);if(m!==null){var M=new He(m,null);return (0, s.createFinalization)(M,m),M}return null},y.prototype.defaultInstance=function(){var c=this._viewModel.defaultInstance();if(c!==null){var m=new He(c,null);return (0, s.createFinalization)(m,c),m}return null},y.prototype.instance=function(){var c=this._viewModel.instance();if(c!==null){var m=new He(c,null);return (0, s.createFinalization)(m,c),m}return null},Object.defineProperty(y.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:false,configurable:true}),y})(),_e=(function(){function y(c){this._dataEnum=c;}return Object.defineProperty(y.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:false,configurable:true}),y})(),ve;(function(y){y.Number="number",y.String="string",y.Boolean="boolean",y.Color="color",y.Trigger="trigger",y.Enum="enum",y.List="list",y.Image="image",y.Artboard="artboard";})(ve||(ve={}));var He=(function(){function y(c,m){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=false,this._runtimeInstance=c,m!==null&&this._parents.push(m);}return Object.defineProperty(y.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:false,configurable:true}),y.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(c){c.handleCallbacks();}),this._propertiesWithCallbacks.forEach(function(c){c.clearChanges();})),this._children.forEach(function(c){return c.handleCallbacks()});},y.prototype.addParent=function(c){this._parents.includes(c)||(this._parents.push(c),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&c.addToViewModelCallbacks(this));},y.prototype.removeParent=function(c){var m=this._parents.indexOf(c);if(m!==-1){var M=this._parents[m];M.removeFromViewModelCallbacks(this),this._parents.splice(m,1);}},y.prototype.addToPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)||(this._propertiesWithCallbacks.push(c),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(M){M.addToViewModelCallbacks(m);}));},y.prototype.removeFromPropertyCallbacks=function(c){var m=this;this._propertiesWithCallbacks.includes(c)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(M){return M!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(M){M.removeFromViewModelCallbacks(m);}));},y.prototype.addToViewModelCallbacks=function(c){var m=this;this._children.includes(c)||(this._children.push(c),this._parents.forEach(function(M){M.addToViewModelCallbacks(m);}));},y.prototype.removeFromViewModelCallbacks=function(c){var m=this;this._children.includes(c)&&(this._children=this._children.filter(function(M){return M!==c}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(M){M.removeFromViewModelCallbacks(m);}));},y.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(c){c.clearCallbacks();});},y.prototype.propertyFromPath=function(c,m){var M=c.split("/");return this.propertyFromPathSegments(M,0,m)},y.prototype.viewModelFromPathSegments=function(c,m){var M=this.internalViewModelInstance(c[m]);return M!==null?m==c.length-1?M:M.viewModelFromPathSegments(c,m++):null},y.prototype.propertyFromPathSegments=function(c,m,M){var O,B,q,le,Ne,de,ke,vt,ft,Ke,Gt,rn,$e,an,Wt,jt,Ie,zi;if(m<c.length-1){var Kn=this.internalViewModelInstance(c[m]);return Kn!==null?Kn.propertyFromPathSegments(c,m+1,M):null}var L=null;switch(M){case ve.Number:if(L=(B=(O=this._runtimeInstance)===null||O===void 0?void 0:O.number(c[m]))!==null&&B!==void 0?B:null,L!==null)return new ae(L,this);break;case ve.String:if(L=(le=(q=this._runtimeInstance)===null||q===void 0?void 0:q.string(c[m]))!==null&&le!==void 0?le:null,L!==null)return new ot(L,this);break;case ve.Boolean:if(L=(de=(Ne=this._runtimeInstance)===null||Ne===void 0?void 0:Ne.boolean(c[m]))!==null&&de!==void 0?de:null,L!==null)return new Ae(L,this);break;case ve.Color:if(L=(vt=(ke=this._runtimeInstance)===null||ke===void 0?void 0:ke.color(c[m]))!==null&&vt!==void 0?vt:null,L!==null)return new Ye(L,this);break;case ve.Trigger:if(L=(Ke=(ft=this._runtimeInstance)===null||ft===void 0?void 0:ft.trigger(c[m]))!==null&&Ke!==void 0?Ke:null,L!==null)return new ze(L,this);break;case ve.Enum:if(L=(rn=(Gt=this._runtimeInstance)===null||Gt===void 0?void 0:Gt.enum(c[m]))!==null&&rn!==void 0?rn:null,L!==null)return new xe(L,this);break;case ve.List:if(L=(an=($e=this._runtimeInstance)===null||$e===void 0?void 0:$e.list(c[m]))!==null&&an!==void 0?an:null,L!==null)return new ye(L,this);break;case ve.Image:if(L=(jt=(Wt=this._runtimeInstance)===null||Wt===void 0?void 0:Wt.image(c[m]))!==null&&jt!==void 0?jt:null,L!==null)return new Xe(L,this);break;case ve.Artboard:if(L=(zi=(Ie=this._runtimeInstance)===null||Ie===void 0?void 0:Ie.artboard(c[m]))!==null&&zi!==void 0?zi:null,L!==null)return new qe(L,this);break}return null},y.prototype.internalViewModelInstance=function(c){var m;if(this._viewModelInstances.has(c))return this._viewModelInstances.get(c);var M=(m=this._runtimeInstance)===null||m===void 0?void 0:m.viewModel(c);if(M!==null){var O=new y(M,this);return (0, s.createFinalization)(O,M),O.internalIncrementReferenceCount(),this._viewModelInstances.set(c,O),O}return null},y.prototype.number=function(c){var m=this.propertyFromPath(c,ve.Number);return m},y.prototype.string=function(c){var m=this.propertyFromPath(c,ve.String);return m},y.prototype.boolean=function(c){var m=this.propertyFromPath(c,ve.Boolean);return m},y.prototype.color=function(c){var m=this.propertyFromPath(c,ve.Color);return m},y.prototype.trigger=function(c){var m=this.propertyFromPath(c,ve.Trigger);return m},y.prototype.enum=function(c){var m=this.propertyFromPath(c,ve.Enum);return m},y.prototype.list=function(c){var m=this.propertyFromPath(c,ve.List);return m},y.prototype.image=function(c){var m=this.propertyFromPath(c,ve.Image);return m},y.prototype.artboard=function(c){var m=this.propertyFromPath(c,ve.Artboard);return m},y.prototype.viewModel=function(c){var m=c.split("/"),M=m.length>1?this.viewModelFromPathSegments(m.slice(0,m.length-1),0):this;return M!=null?M.internalViewModelInstance(m[m.length-1]):null},y.prototype.internalReplaceViewModel=function(c,m){var M;if(m.runtimeInstance!==null){var O=((M=this._runtimeInstance)===null||M===void 0?void 0:M.replaceViewModel(c,m.runtimeInstance))||false;if(O){m.internalIncrementReferenceCount();var B=this.internalViewModelInstance(c);B!==null&&(B.removeParent(this),this._children.includes(B)&&(this._children=this._children.filter(function(q){return q!==B})),B.cleanup()),this._viewModelInstances.set(c,m),m.addParent(this);}return O}return false},y.prototype.replaceViewModel=function(c,m){var M,O=c.split("/"),B=O.length>1?this.viewModelFromPathSegments(O.slice(0,O.length-1),0):this;return (M=B?.internalReplaceViewModel(O[O.length-1],m))!==null&&M!==void 0?M:false},y.prototype.incrementReferenceCount=function(){var c;this._referenceCount++,(c=this._runtimeInstance)===null||c===void 0||c.incrementReferenceCount();},y.prototype.decrementReferenceCount=function(){var c;this._referenceCount--,(c=this._runtimeInstance)===null||c===void 0||c.decrementReferenceCount();},Object.defineProperty(y.prototype,"properties",{get:function(){var c;return ((c=this._runtimeInstance)===null||c===void 0?void 0:c.getProperties().map(function(m){return d({},m)}))||[]},enumerable:false,configurable:true}),Object.defineProperty(y.prototype,"viewModelName",{get:function(){var c,m;return (m=(c=this._runtimeInstance)===null||c===void 0?void 0:c.getViewModelName())!==null&&m!==void 0?m:""},enumerable:false,configurable:true}),y.prototype.internalIncrementReferenceCount=function(){this._referenceCount++;},y.prototype.cleanup=function(){var c=this,m;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((m=this._runtimeInstance)===null||m===void 0||m.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(B){B.cleanup();}),this._viewModelInstances.clear();var M=A([],this._children);this._children.length=0;var O=A([],this._parents);this._parents.length=0,M.forEach(function(B){B.removeParent(c);}),O.forEach(function(B){B.removeFromViewModelCallbacks(c);});}},y})(),ct=(function(){function y(c,m){this.callbacks=[],this._viewModelInstanceValue=c,this._parentViewModel=m;}return y.prototype.on=function(c){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(c)||(this.callbacks.push(c),this._parentViewModel.addToPropertyCallbacks(this));},y.prototype.off=function(c){c?this.callbacks=this.callbacks.filter(function(m){return m!==c}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this);},y.prototype.internalHandleCallback=function(c){},y.prototype.handleCallbacks=function(){var c=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(m){c.internalHandleCallback(m);});},y.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges();},y.prototype.clearCallbacks=function(){this.callbacks.length=0;},Object.defineProperty(y.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:false,configurable:true}),y})(),ot=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(ct),ae=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(ct),Ae=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(ct),ze=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return c.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},c.prototype.internalHandleCallback=function(m){m();},c})(ct),xe=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(m){this._viewModelInstanceValue.valueIndex=m;},enumerable:false,configurable:true}),Object.defineProperty(c.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m(this.value);},c})(ct),ye=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:false,configurable:true}),c.prototype.addInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(m.runtimeInstance),m.addParent(this._parentViewModel));},c.prototype.addInstanceAt=function(m,M){return m.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(m.runtimeInstance,M)?(m.addParent(this._parentViewModel),true):false},c.prototype.removeInstance=function(m){m.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(m.runtimeInstance),m.removeParent(this._parentViewModel));},c.prototype.removeInstanceAt=function(m){this._viewModelInstanceValue.removeInstanceAt(m);},c.prototype.instanceAt=function(m){var M=this._viewModelInstanceValue.instanceAt(m);if(M!=null){var O=new He(M,this._parentViewModel);return (0, s.createFinalization)(O,M),O}return null},c.prototype.swap=function(m,M){this._viewModelInstanceValue.swap(m,M);},c.prototype.internalHandleCallback=function(m){m();},c})(ct),Ye=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(m){this._viewModelInstanceValue.value=m;},enumerable:false,configurable:true}),c.prototype.rgb=function(m,M,O){this._viewModelInstanceValue.rgb(m,M,O);},c.prototype.rgba=function(m,M,O,B){this._viewModelInstanceValue.argb(B,m,M,O);},c.prototype.argb=function(m,M,O,B){this._viewModelInstanceValue.argb(m,M,O,B);},c.prototype.alpha=function(m){this._viewModelInstanceValue.alpha(m);},c.prototype.opacity=function(m){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,m))*255));},c.prototype.internalHandleCallback=function(m){m(this.value);},c})(ct),Xe=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var M;this._viewModelInstanceValue.value((M=m?.nativeImage)!==null&&M!==void 0?M:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(ct),qe=(function(y){u(c,y);function c(m,M){return y.call(this,m,M)||this}return Object.defineProperty(c.prototype,"value",{set:function(m){var M,O,B;m.isBindableArtboard?B=m:B=m.file.internalBindableArtboardFromArtboard(m.nativeArtboard),this._viewModelInstanceValue.value((M=B?.nativeArtboard)!==null&&M!==void 0?M:null),B?.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((O=B?.nativeViewModel)!==null&&O!==void 0?O:null);},enumerable:false,configurable:true}),c.prototype.internalHandleCallback=function(m){m();},c})(ct),_t=function(y){return g(void 0,void 0,void 0,function(){var c,m,M;return v(this,function(O){switch(O.label){case 0:return c=new Request(y),[4,fetch(c)];case 1:if(m=O.sent(),!m.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(m.status));return [4,m.arrayBuffer()];case 2:return M=O.sent(),[2,M]}})})},Tt=function(y){return typeof y=="string"?[y]:y instanceof Array?y:[]},mt={EventManager:Re,TaskQueueManager:he},gt=function(y){return g(void 0,void 0,void 0,function(){var c,m,M;return v(this,function(O){switch(O.label){case 0:return c=new Promise(function(B){return a.RuntimeLoader.getInstance(function(q){q.decodeAudio(y,B);})}),[4,c];case 1:return m=O.sent(),M=new s.AudioWrapper(m),s.finalizationRegistry.register(M,m),[2,M]}})})},Qe=function(y){return g(void 0,void 0,void 0,function(){var c,m,M;return v(this,function(O){switch(O.label){case 0:return c=new Promise(function(B){return a.RuntimeLoader.getInstance(function(q){q.decodeImage(y,B);})}),[4,c];case 1:return m=O.sent(),M=new s.ImageWrapper(m),s.finalizationRegistry.register(M,m),[2,M]}})})},pe=function(y){return g(void 0,void 0,void 0,function(){var c,m,M;return v(this,function(O){switch(O.label){case 0:return c=new Promise(function(B){return a.RuntimeLoader.getInstance(function(q){q.decodeFont(y,B);})}),[4,c];case 1:return m=O.sent(),M=new s.FontWrapper(m),s.finalizationRegistry.register(M,m),[2,M]}})})};})(),i})());});var Gv=pi(hn=>{Object.defineProperty(hn,"__esModule",{value:true});var zv,me=Rt(),Ui=Bu();function IO(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Qd=IO(me);function H1(t){var e=t||U1(),n=me.useState(e),i=n[0],r=n[1];return me.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var a=function(){r(t||U1());},s=window.matchMedia("screen and (resolution: "+i+"dppx)");return s.hasOwnProperty("addEventListener")?s.addEventListener("change",a):s.addListener(a),function(){s.hasOwnProperty("removeEventListener")?s.removeEventListener("change",a):s.removeListener(a);}}},[i,t]),i}function U1(){return Math.min(Math.max(1,"u">typeof window&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:1),3)}var PO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})();function NO(t,e){var n=0;return function(){for(var i=this,r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];clearTimeout(n),n=window.setTimeout(function(){return t.apply(i,a)},e);}}var LO=globalThis.ResizeObserver||PO,DO=globalThis.ResizeObserver!==void 0,Xd=DO,BO=!Xd;function UO(t,e){e===void 0&&(e=true);var n=me.useState({width:0,height:0}),i=n[0],r=n[1];me.useEffect(function(){if("u">typeof window&&e){var s=function(){r({width:window.innerWidth,height:window.innerHeight});};return BO&&(s(),window.addEventListener("resize",s)),function(){return window.removeEventListener("resize",s)}}},[]);var a=me.useRef(new LO(NO(function(s){Xd&&r({width:s[s.length-1].contentRect.width,height:s[s.length-1].contentRect.height});},0)));return me.useEffect(function(){var s=a.current;if(!e)return void s.disconnect();var u=t.current;return t.current&&Xd&&s.observe(t.current),function(){s.disconnect(),u&&Xd&&s.unobserve(u);}},[t,a]),i}var FO={useDevicePixelRatio:true,fitCanvasToArtboardHeight:false,useOffscreenRenderer:true,shouldResizeCanvasToContainer:true};function z1(t){return Object.assign({},FO,t)}function G1(t){var e=t.riveLoaded,n=e!==void 0&&e,i=t.canvasElem,r=t.containerRef,a=t.options,s=t.onCanvasHasResized,u=t.artboardBounds,d=z1(a===void 0?{}:a),g=me.useState({height:0,width:0}),v=g[0],A=v.height,p=v.width,_=g[1],T=me.useState({height:0,width:0}),x=T[0],N=x.height,E=x.width,w=T[1],C=me.useState(true),I=C[0],V=C[1],K=d.fitCanvasToArtboardHeight,F=d.shouldResizeCanvasToContainer,H=d.useDevicePixelRatio,J=d.customDevicePixelRatio,Y=UO(r,F),Me=H1(J),Re=u??{},he=Re.maxX,De=Re.maxY,fe=me.useCallback(function(){var Q,te,D,U,z=(Q=(D=r.current)==null?void 0:D.clientWidth)!=null?Q:0,X=(te=(U=r.current)==null?void 0:U.clientHeight)!=null?te:0;return K&&u?{width:z,height:u.maxY/u.maxX*z}:{width:z,height:X}},[r,K,he,De]);me.useEffect(function(){if(F&&r.current&&n){var Q=fe(),te=Q.width,D=Q.height,U=false;if(i){var z=te!==p||D!==A;if(d.fitCanvasToArtboardHeight&&z&&(r.current.style.height=D+"px",U=true),d.useDevicePixelRatio){var X=te*Me!==E||D*Me!==N;if(z||X){var oe=Me*te,ge=Me*D;i.width=oe,i.height=ge,i.style.width=te+"px",i.style.height=D+"px",w({width:oe,height:ge}),U=true;}}else z&&(i.width=te,i.height=D,w({width:te,height:D}),U=true);_({width:te,height:D});}s&&(I||U)&&s&&s(),I&&V(false);}},[i,r,Y,Me,fe,I,V,N,E,A,p,s,F,K,H,n]),me.useEffect(function(){w({width:0,height:0});},[i]);}var VO=(function(){function t(){}var e=t.prototype;return e.observe=function(){},e.unobserve=function(){},e.disconnect=function(){},t})(),HO=globalThis.IntersectionObserver||VO,zO=(function(){function t(){var n=this;this.elementsMap=new Map,this.onObserved=function(i){i.forEach(function(r){var a=n.elementsMap.get(r.target);a&&a(r);});},this.observer=new HO(this.onObserved);}var e=t.prototype;return e.registerCallback=function(n,i){this.observer.observe(n),this.elementsMap.set(n,i);},e.removeCallback=function(n){this.observer.unobserve(n),this.elementsMap.delete(n);},t})(),F1=function(){return zv||(zv=new zO),zv};function GO(){return {observe:me.useCallback(function(t,e){F1().registerCallback(t,e);},[]),unobserve:me.useCallback(function(t){F1().removeCallback(t);},[])}}function Bs(){return (Bs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function W1(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}function WO(t){var e=t.setContainerRef,n=t.setCanvasRef,i=t.className,r=i===void 0?"":i,a=t.style,s=t.children,u=W1(t,["setContainerRef","setCanvasRef","className","style","children"]),d=Bs({width:"100%",height:"100%"},a);return Qd.default.createElement("div",Bs({ref:e,className:r},!r&&{style:d}),Qd.default.createElement("canvas",Bs({ref:n,style:{verticalAlign:"top",width:0,height:0}},u),s))}function j1(t,e){e===void 0&&(e={});var n=me.useState(null),i=n[0],r=n[1],a=me.useRef(null),s=me.useRef(null),u=me.useState(null),d=u[0],g=u[1],v=!!t,A=z1(e),p=H1(),_=me.useCallback(function(){if(d){if(d.layout&&d.layout.fit===Ui.Fit.Layout&&i){var V=p*d.layout.layoutScaleFactor;d.devicePixelRatioUsed=p,d.artboardWidth=i?.width/V,d.artboardHeight=i?.height/V;}d.startRendering(),d.resizeToCanvas();}},[d,p]);G1({riveLoaded:!!d,canvasElem:i,containerRef:a,options:A,onCanvasHasResized:_,artboardBounds:d?.bounds});var T=me.useCallback(function(V){V===null&&i&&(i.height=0,i.width=0),r(V);},[]);me.useEffect(function(){if(i&&t){var V,K=d!=null;if(d==null){var F=A.useOffscreenRenderer,H=t.onRiveReady,J=W1(t,["onRiveReady"]);V=new Ui.Rive(Bs({useOffscreenRenderer:F},J,{canvas:i})),s.current!=null&&s.current.cleanup(),s.current=V,V.on(Ui.EventType.Load,function(){K=true,H&&H(V),i?g(V):V.cleanup();});}return function(){K||V==null||V.cleanup();}}},[i,v,d]);var x=me.useCallback(function(V){a.current=V;},[]),N=GO(),E=N.observe,w=N.unobserve;me.useEffect(function(){var V,K=false,F=function(){if(i&&K){var H=i.getBoundingClientRect();H.width>0&&H.height>0&&H.top<(window.innerHeight||document.documentElement.clientHeight)&&H.bottom>0&&H.left<(window.innerWidth||document.documentElement.clientWidth)&&H.right>0&&(d?.startRendering(),K=false);}};return i&&A.shouldUseIntersectionObserver!==false&&E(i,function(H){H.isIntersecting?d&&d.startRendering():d&&d.stopRendering(),K=!H.isIntersecting,clearTimeout(V),H.isIntersecting||H.boundingClientRect.width!==0||(V=setTimeout(F,10));}),function(){i&&w(i);}},[E,w,d,i,A.shouldUseIntersectionObserver]),me.useEffect(function(){return function(){d&&(d.cleanup(),g(null));}},[d,i]),me.useEffect(function(){return function(){s.current!=null&&s.current.cleanup();}},[]);var C=t?.animations;me.useEffect(function(){d&&C&&(d.isPlaying?(d.stop(d.animationNames),d.play(C)):d.isPaused&&(d.stop(d.animationNames),d.pause(C)));},[C,d]);var I=me.useCallback(function(V){return Qd.default.createElement(WO,Bs({setContainerRef:x,setCanvasRef:T},V))},[T,x]);return {canvas:i,container:a.current,setCanvasRef:T,setContainerRef:x,rive:d,RiveComponent:I}}function jO(t,e){if(t==null)return {};var n,i,r={},a=Object.getOwnPropertyNames(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n]);return r}var YO=function(t){var e=t.src,n=t.artboard,i=t.animations,r=t.stateMachines,a=t.layout,s=t.useOffscreenRenderer,u=t.shouldDisableRiveListeners,d=t.shouldResizeCanvasToContainer,g=t.automaticallyHandleEvents,v=t.children,A=jO(t,["src","artboard","animations","stateMachines","layout","useOffscreenRenderer","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),p=j1({src:e,artboard:n,animations:i,layout:a,stateMachines:r,autoplay:true,shouldDisableRiveListeners:u!==void 0&&u,automaticallyHandleEvents:g!==void 0&&g},{useOffscreenRenderer:s===void 0||s,shouldResizeCanvasToContainer:d===void 0||d}).RiveComponent;return Qd.default.createElement(p,A,v)};function qO(t,e,n,i){var r=me.useState(null),a=r[0],s=r[1];return me.useEffect(function(){var u=function(){if(t&&e&&n||s(null),t&&e&&n){var d=t.stateMachineInputs(e);if(d){var g=d.find(function(v){return v.name===n});i!==void 0&&g&&(g.value=i),s(g||null);}}else s(null);};u(),t&&t.on(Ui.EventType.Load,function(){u();});},[t]),a}function XO(t,e){var n=e??{},i=n.name,r=n.useDefault,a=me.useState(null),s=a[0],u=a[1];return me.useEffect(function(){var d=function(){if(!t)return void u(null);u(i!=null?(t.viewModelByName==null?void 0:t.viewModelByName.call(t,i))||null:t.defaultViewModel()||null);};return d(),t&&t.on(Ui.EventType.Load,d),function(){t&&t.off(Ui.EventType.Load,d);}},[t,i,r!==void 0&&r]),s}function QO(t,e){var n=e??{},i=n.name,r=n.useDefault,a=r!==void 0&&r,s=n.useNew,u=s!==void 0&&s,d=n.rive,g=me.useState(null),v=g[0],A=g[1];return me.useEffect(function(){if(!t)return void A(null);var p=null;A(p=i!=null?t.instanceByName(i)||null:a?(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null:u?(t.instance==null?void 0:t.instance.call(t))||null:(t.defaultInstance==null?void 0:t.defaultInstance.call(t))||null),d&&p&&d.viewModelInstance!==p&&d.bindViewModelInstance(p);},[t,i,a,u,d]),v}function Y1(){return (Y1=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);}return t}).apply(this,arguments)}function Lr(t,e,n){var i=me.useState(null),r=i[0],a=i[1],s=me.useState(n.defaultValue),u=s[0],d=s[1],g=me.useState(null),v=g[0],A=g[1],p=me.useRef(null),_=me.useRef(t),T=me.useRef(n);me.useEffect(function(){T.current=n;},[n]);var x=me.useCallback(function(){var C=p.current,I=_.current,V=T.current;if(!C||!I)return a(null),d(V.defaultValue),A(null),function(){};var K=V.getProperty(C,I);if(K){a(K),d(V.getValue(K)),V.getExtendedData&&A(V.getExtendedData(K));var F=function(){d(V.getValue(K)),V.getExtendedData&&A(V.getExtendedData(K)),V.onPropertyEvent&&V.onPropertyEvent();};return K.on(F),function(){K.off(F);}}return function(){}},[]);me.useEffect(function(){return p.current=e,_.current=t,x()},[e,t,x]);var N=me.useCallback(function(C){if(r&&p.current===e)try{C(r),T.current.getExtendedData&&A(T.current.getExtendedData(r));return}catch{}if(p.current)try{var I=T.current.getProperty(p.current,_.current);I&&(a(I),C(I),T.current.getExtendedData&&A(T.current.getExtendedData(I)));}catch{}},[r,e]),E=me.useMemo(function(){return T.current.buildPropertyOperations(N)},[N]),w=Y1({value:u},E);return n.getExtendedData&&(w.extendedData=v),w}function KO(t,e){var n=Lr(t,e,{getProperty:me.useCallback(function(i,r){return i.number(r)},[]),getValue:me.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function ZO(t,e){var n=Lr(t,e,{getProperty:me.useCallback(function(i,r){return i.string(r)},[]),getValue:me.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function JO(t,e){var n=Lr(t,e,{getProperty:me.useCallback(function(i,r){return i.boolean(r)},[]),getValue:me.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,setValue:n.setValue}}function $O(t,e){var n=Lr(t,e,{getProperty:me.useCallback(function(i,r){return i.color(r)},[]),getValue:me.useCallback(function(i){return i.value},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});},setRgb:function(r,a,s){i(function(u){u.rgb(r,a,s);});},setRgba:function(r,a,s,u){i(function(d){d.rgba(r,a,s,u);});},setAlpha:function(r){i(function(a){a.alpha(r);});},setOpacity:function(r){i(function(a){a.opacity(r);});}}},[])});return {value:n.value,setValue:n.setValue,setRgb:n.setRgb,setRgba:n.setRgba,setAlpha:n.setAlpha,setOpacity:n.setOpacity}}function eI(t,e){var n=Lr(t,e,{getProperty:me.useCallback(function(i,r){return i.enum(r)},[]),getValue:me.useCallback(function(i){return i.value},[]),defaultValue:null,getExtendedData:me.useCallback(function(i){return i.values},[]),buildPropertyOperations:me.useCallback(function(i){return {setValue:function(r){i(function(a){a.value=r;});}}},[])});return {value:n.value,values:n.extendedData||[],setValue:n.setValue}}function tI(t,e,n){var i=(n??{}).onTrigger;return {trigger:Lr(t,e,{getProperty:me.useCallback(function(r,a){return r.trigger(a)},[]),getValue:me.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:i,buildPropertyOperations:me.useCallback(function(r){return {trigger:function(){r(function(a){a.trigger();});}}},[])}).trigger}}function nI(t,e){return {setValue:Lr(t,e,{getProperty:me.useCallback(function(n,i){return n.image(i)},[]),getValue:me.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}function iI(t,e){var n,i=me.useState(0)[1],r=Lr(t,e,{getProperty:me.useCallback(function(a,s){return a.list(s)},[]),getValue:me.useCallback(function(a){return a.length},[]),defaultValue:null,onPropertyEvent:function(){i(function(a){return a+1});},buildPropertyOperations:me.useCallback(function(a){return {addInstance:function(s){a(function(u){return u.addInstance(s)});},addInstanceAt:function(s,u){var d=false;return a(function(g){d=g.addInstanceAt(s,u);}),d},removeInstance:function(s){a(function(u){return u.removeInstance(s)});},removeInstanceAt:function(s){a(function(u){return u.removeInstanceAt(s)});},getInstanceAt:function(s){var u=null;return a(function(d){u=d.instanceAt(s);}),u},swap:function(s,u){a(function(d){return d.swap(s,u)});}}},[])});return {length:(n=r.value)!=null?n:0,addInstance:r.addInstance,addInstanceAt:r.addInstanceAt,removeInstance:r.removeInstance,removeInstanceAt:r.removeInstanceAt,getInstanceAt:r.getInstanceAt,swap:r.swap}}function V1(t,e,n,i,r,a,s){try{var u=t[a](s),d=u.value;}catch(g){n(g);return}u.done?e(d):Promise.resolve(d).then(i,r);}function rI(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function s(d){V1(a,i,r,s,u,"next",d);}function u(d){V1(a,i,r,s,u,"throw",d);}s(void 0);})}}function aI(t,e){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),u=Object.defineProperty;return u(s,"next",{value:d(0)}),u(s,"throw",{value:d(1)}),u(s,"return",{value:d(2)}),typeof Symbol=="function"&&u(s,Symbol.iterator,{value:function(){return this}}),s;function d(g){return function(v){var A=[g,v];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,A[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&A[0]?i.return:A[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,A[1])).done)return r;switch(i=0,r&&(A=[2&A[0],r.value]),A[0]){case 0:case 1:r=A;break;case 4:return a.label++,{value:A[1],done:!1};case 5:a.label++,i=A[1],A=[0];continue;case 7:A=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(A[0]===6||A[0]===2)){a=0;continue}if(A[0]===3&&(!r||A[1]>r[0]&&A[1]<r[3])){a.label=A[1];break}if(A[0]===6&&a.label<r[1]){a.label=r[1],r=A;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(A);break}r[2]&&a.ops.pop(),a.trys.pop();continue}A=e.call(t,a);}catch(p){A=[6,p],i=0;}finally{n=r=0;}if(5&A[0])throw A[1];return {value:A[0]?A[1]:void 0,done:true}}}}function oI(t){var e=me.useState(null),n=e[0],i=e[1],r=me.useState("idle"),a=r[0],s=r[1];return me.useEffect(function(){var u=null;return rI(function(){return aI(this,function(d){try{s("loading"),(u=new Ui.RiveFile(t)).init(),u.on(Ui.EventType.Load,function(){u?.getInstance(),i(u),s("success");}),u.on(Ui.EventType.LoadError,function(){s("failed");}),i(u);}catch(g){console.error(g),s("failed");}return [2]})})(),function(){u?.cleanup();}},[t.src,t.buffer]),{riveFile:n,status:a}}function sI(t,e){return {setValue:Lr(t,e,{getProperty:me.useCallback(function(n,i){return n.artboard(i)},[]),getValue:me.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:me.useCallback(function(n){return {setValue:function(i){n(function(r){r.value=i;});}}},[])}).setValue}}hn.default=YO,hn.useResizeCanvas=G1,hn.useRive=j1,hn.useRiveFile=oI,hn.useStateMachineInput=qO,hn.useViewModel=XO,hn.useViewModelInstance=QO,hn.useViewModelInstanceArtboard=sI,hn.useViewModelInstanceBoolean=JO,hn.useViewModelInstanceColor=$O,hn.useViewModelInstanceEnum=eI,hn.useViewModelInstanceImage=nI,hn.useViewModelInstanceList=iI,hn.useViewModelInstanceNumber=KO,hn.useViewModelInstanceString=ZO,hn.useViewModelInstanceTrigger=tI,Object.keys(Ui).forEach(function(t){t==="default"||hn.hasOwnProperty(t)||Object.defineProperty(hn,t,{enumerable:true,get:function(){return Ui[t]}});});});var RE={};t0(RE,{VAD_WORKER_SOURCE:()=>qI});var qI,xE=e0(()=>{qI='"use strict";(()=>{var Ft=Object.defineProperty;var Et=(t,s)=>()=>(t&&(s=t(t=0)),s);var gt=(t,s)=>{for(var n in s)Ft(t,n,{get:s[n],enumerable:!0})};var St={};gt(St,{cmvn:()=>Yt,graph:()=>$t});var $t,Yt,Tt=Et(()=>{"use strict";$t={inputs:["feat","caches_in"],outputs:["probs","caches_out"],cache_shape:[8,1,128,19],nodes:[{op:"Gather",inputs:["caches_in","/Constant_output_0"],outputs:["/Gather_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_1_output_0"],outputs:["/Gather_1_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_2_output_0"],outputs:["/Gather_2_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_3_output_0"],outputs:["/Gather_3_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_4_output_0"],outputs:["/Gather_4_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_5_output_0"],outputs:["/Gather_5_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_6_output_0"],outputs:["/Gather_6_output_0"],attrs:{axis:0}},{op:"Gather",inputs:["caches_in","/Constant_7_output_0"],outputs:["/Gather_7_output_0"],attrs:{axis:0}},{op:"MatMul",inputs:["feat","onnx::MatMul_403"],outputs:["/model/dfsmn/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc1.0.bias","/model/dfsmn/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fc1/fc1.1/Relu_output_0","onnx::MatMul_404"],outputs:["/model/dfsmn/fc2/fc2.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fc2.0.bias","/model/dfsmn/fc2/fc2.0/MatMul_output_0"],outputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fc2/fc2.0/Add_output_0"],outputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fc2/fc2.1/Relu_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_output_0","/model/dfsmn/fsmn1/Transpose_output_0"],outputs:["/model/dfsmn/fsmn1/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmn1/Concat_output_0","model.dfsmn.fsmn1.lookback_filter.weight"],outputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmn1/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmn1/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmn1/Transpose_output_0","/model/dfsmn/fsmn1/Slice_2_output_0"],outputs:["/model/dfsmn/fsmn1/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmn1/Add_output_0"],outputs:["/model/dfsmn/fsmn1/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"MatMul",inputs:["/model/dfsmn/fsmn1/Transpose_1_output_0","onnx::MatMul_417"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.0.fc1.0.bias","/model/dfsmn/fsmns.0/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/fc1/fc1.1/Relu_output_0","onnx::MatMul_418"],outputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_1_output_0","/model/dfsmn/fsmns.0/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.0/fsmn/Concat_output_0","model.dfsmn.fsmns.0.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_output_0","/model/dfsmn/fsmns.0/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.0/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.0/fsmn/Transpose_1_output_0","/model/dfsmn/fsmn1/Transpose_1_output_0"],outputs:["/model/dfsmn/fsmns.0/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.0/Add_output_0","onnx::MatMul_431"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.1.fc1.0.bias","/model/dfsmn/fsmns.1/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/fc1/fc1.1/Relu_output_0","onnx::MatMul_432"],outputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_2_output_0","/model/dfsmn/fsmns.1/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.1/fsmn/Concat_output_0","model.dfsmn.fsmns.1.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_output_0","/model/dfsmn/fsmns.1/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.1/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.1/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.1/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.1/Add_output_0","onnx::MatMul_445"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.2.fc1.0.bias","/model/dfsmn/fsmns.2/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/fc1/fc1.1/Relu_output_0","onnx::MatMul_446"],outputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_3_output_0","/model/dfsmn/fsmns.2/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.2/fsmn/Concat_output_0","model.dfsmn.fsmns.2.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_output_0","/model/dfsmn/fsmns.2/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.2/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.2/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.1/Add_output_0"],outputs:["/model/dfsmn/fsmns.2/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.2/Add_output_0","onnx::MatMul_459"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.3.fc1.0.bias","/model/dfsmn/fsmns.3/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/fc1/fc1.1/Relu_output_0","onnx::MatMul_460"],outputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_4_output_0","/model/dfsmn/fsmns.3/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.3/fsmn/Concat_output_0","model.dfsmn.fsmns.3.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_output_0","/model/dfsmn/fsmns.3/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.3/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.3/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.2/Add_output_0"],outputs:["/model/dfsmn/fsmns.3/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.3/Add_output_0","onnx::MatMul_473"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.4.fc1.0.bias","/model/dfsmn/fsmns.4/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/fc1/fc1.1/Relu_output_0","onnx::MatMul_474"],outputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_5_output_0","/model/dfsmn/fsmns.4/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.4/fsmn/Concat_output_0","model.dfsmn.fsmns.4.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_output_0","/model/dfsmn/fsmns.4/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.4/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.4/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.3/Add_output_0"],outputs:["/model/dfsmn/fsmns.4/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.4/Add_output_0","onnx::MatMul_487"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.5.fc1.0.bias","/model/dfsmn/fsmns.5/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/fc1/fc1.1/Relu_output_0","onnx::MatMul_488"],outputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_6_output_0","/model/dfsmn/fsmns.5/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.5/fsmn/Concat_output_0","model.dfsmn.fsmns.5.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_output_0","/model/dfsmn/fsmns.5/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.5/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.5/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.4/Add_output_0"],outputs:["/model/dfsmn/fsmns.5/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.5/Add_output_0","onnx::MatMul_501"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.fsmns.6.fc1.0.bias","/model/dfsmn/fsmns.6/fc1/fc1.0/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.0/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/fc1/fc1.1/Relu_output_0","onnx::MatMul_502"],outputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fc2/MatMul_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],attrs:{perm:[0,2,1]}},{op:"Concat",inputs:["/Gather_7_output_0","/model/dfsmn/fsmns.6/fsmn/Transpose_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0"],attrs:{axis:2}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0"],attrs:{}},{op:"Conv",inputs:["/model/dfsmn/fsmns.6/fsmn/Concat_output_0","model.dfsmn.fsmns.6.fsmn.lookback_filter.weight"],outputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0"],attrs:{dilations:[1],group:128,kernel_shape:[20],pads:[19,19],strides:[1]}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/lookback_filter/Conv_output_0","/model/dfsmn/fsmn1/Constant_5_output_0","/model/dfsmn/fsmn1/Constant_1_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0"],attrs:{}},{op:"Slice",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_1_output_0","/model/dfsmn/fsmn1/Constant_9_output_0","/model/dfsmn/fsmn1/Constant_2_output_0","/model/dfsmn/fsmn1/Constant_output_0","/model/dfsmn/fsmn1/Constant_3_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],attrs:{}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_output_0","/model/dfsmn/fsmns.6/fsmn/Slice_2_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],attrs:{}},{op:"Transpose",inputs:["/model/dfsmn/fsmns.6/fsmn/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0"],attrs:{perm:[0,2,1]}},{op:"Add",inputs:["/model/dfsmn/fsmns.6/fsmn/Transpose_1_output_0","/model/dfsmn/fsmns.5/Add_output_0"],outputs:["/model/dfsmn/fsmns.6/Add_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/fsmns.6/Add_output_0","onnx::MatMul_515"],outputs:["/model/dfsmn/dnns/dnns.0/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.dfsmn.dnns.0.bias","/model/dfsmn/dnns/dnns.0/MatMul_output_0"],outputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],attrs:{}},{op:"Relu",inputs:["/model/dfsmn/dnns/dnns.0/Add_output_0"],outputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0"],attrs:{}},{op:"MatMul",inputs:["/model/dfsmn/dnns/dnns.1/Relu_output_0","onnx::MatMul_516"],outputs:["/model/out/MatMul_output_0"],attrs:{}},{op:"Add",inputs:["model.out.bias","/model/out/MatMul_output_0"],outputs:["/model/out/Add_output_0"],attrs:{}},{op:"Sigmoid",inputs:["/model/out/Add_output_0"],outputs:["probs"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmn1/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.0/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_1_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.1/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_2_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.2/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_3_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.3/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_4_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.4/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_5_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.5/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_6_output_0"],attrs:{}},{op:"Unsqueeze",inputs:["/model/dfsmn/fsmns.6/fsmn/Slice_output_0","/model/dfsmn/fsmn1/Constant_5_output_0"],outputs:["/Unsqueeze_7_output_0"],attrs:{}},{op:"Concat",inputs:["/Unsqueeze_output_0","/Unsqueeze_1_output_0","/Unsqueeze_2_output_0","/Unsqueeze_3_output_0","/Unsqueeze_4_output_0","/Unsqueeze_5_output_0","/Unsqueeze_6_output_0","/Unsqueeze_7_output_0"],outputs:["caches_out"],attrs:{axis:0}}],weights:{"model.dfsmn.fc1.0.bias":{dtype:"fp32",shape:[256],off:0},"model.dfsmn.fc2.0.bias":{dtype:"fp32",shape:[128],off:1024},"model.dfsmn.fsmn1.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:1536,scale_off:4096,scale_shape:[1,1,20]},"model.dfsmn.fsmns.0.fc1.0.bias":{dtype:"fp32",shape:[256],off:4176},"model.dfsmn.fsmns.0.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:5200,scale_off:7760,scale_shape:[1,1,20]},"model.dfsmn.fsmns.1.fc1.0.bias":{dtype:"fp32",shape:[256],off:7840},"model.dfsmn.fsmns.1.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:8864,scale_off:11424,scale_shape:[1,1,20]},"model.dfsmn.fsmns.2.fc1.0.bias":{dtype:"fp32",shape:[256],off:11504},"model.dfsmn.fsmns.2.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:12528,scale_off:15088,scale_shape:[1,1,20]},"model.dfsmn.fsmns.3.fc1.0.bias":{dtype:"fp32",shape:[256],off:15168},"model.dfsmn.fsmns.3.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:16192,scale_off:18752,scale_shape:[1,1,20]},"model.dfsmn.fsmns.4.fc1.0.bias":{dtype:"fp32",shape:[256],off:18832},"model.dfsmn.fsmns.4.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:19856,scale_off:22416,scale_shape:[1,1,20]},"model.dfsmn.fsmns.5.fc1.0.bias":{dtype:"fp32",shape:[256],off:22496},"model.dfsmn.fsmns.5.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:23520,scale_off:26080,scale_shape:[1,1,20]},"model.dfsmn.fsmns.6.fc1.0.bias":{dtype:"fp32",shape:[256],off:26160},"model.dfsmn.fsmns.6.fsmn.lookback_filter.weight":{dtype:"int8_pc",shape:[128,1,20],off:27184,scale_off:29744,scale_shape:[1,1,20]},"model.dfsmn.dnns.0.bias":{dtype:"fp32",shape:[256],off:29824},"model.out.bias":{dtype:"fp32",shape:[1],off:30848},"onnx::MatMul_403":{dtype:"int8_pc",shape:[80,256],off:30852,scale_off:51332,scale_shape:[1,256]},"onnx::MatMul_404":{dtype:"int8_pc",shape:[256,128],off:52356,scale_off:85124,scale_shape:[1,128]},"onnx::MatMul_417":{dtype:"int8_pc",shape:[128,256],off:85636,scale_off:118404,scale_shape:[1,256]},"onnx::MatMul_418":{dtype:"int8_pc",shape:[256,128],off:119428,scale_off:152196,scale_shape:[1,128]},"onnx::MatMul_431":{dtype:"int8_pc",shape:[128,256],off:152708,scale_off:185476,scale_shape:[1,256]},"onnx::MatMul_432":{dtype:"int8_pc",shape:[256,128],off:186500,scale_off:219268,scale_shape:[1,128]},"onnx::MatMul_445":{dtype:"int8_pc",shape:[128,256],off:219780,scale_off:252548,scale_shape:[1,256]},"onnx::MatMul_446":{dtype:"int8_pc",shape:[256,128],off:253572,scale_off:286340,scale_shape:[1,128]},"onnx::MatMul_459":{dtype:"int8_pc",shape:[128,256],off:286852,scale_off:319620,scale_shape:[1,256]},"onnx::MatMul_460":{dtype:"int8_pc",shape:[256,128],off:320644,scale_off:353412,scale_shape:[1,128]},"onnx::MatMul_473":{dtype:"int8_pc",shape:[128,256],off:353924,scale_off:386692,scale_shape:[1,256]},"onnx::MatMul_474":{dtype:"int8_pc",shape:[256,128],off:387716,scale_off:420484,scale_shape:[1,128]},"onnx::MatMul_487":{dtype:"int8_pc",shape:[128,256],off:420996,scale_off:453764,scale_shape:[1,256]},"onnx::MatMul_488":{dtype:"int8_pc",shape:[256,128],off:454788,scale_off:487556,scale_shape:[1,128]},"onnx::MatMul_501":{dtype:"int8_pc",shape:[128,256],off:488068,scale_off:520836,scale_shape:[1,256]},"onnx::MatMul_502":{dtype:"int8_pc",shape:[256,128],off:521860,scale_off:554628,scale_shape:[1,128]},"onnx::MatMul_515":{dtype:"int8_pc",shape:[128,256],off:555140,scale_off:587908,scale_shape:[1,256]},"onnx::MatMul_516":{dtype:"fp32",shape:[256,1],off:588932},"/Constant_output_0":{dtype:"int32",shape:[],off:589956},"/Constant_1_output_0":{dtype:"int32",shape:[],off:589960},"/Constant_2_output_0":{dtype:"int32",shape:[],off:589964},"/Constant_3_output_0":{dtype:"int32",shape:[],off:589968},"/Constant_4_output_0":{dtype:"int32",shape:[],off:589972},"/Constant_5_output_0":{dtype:"int32",shape:[],off:589976},"/Constant_6_output_0":{dtype:"int32",shape:[],off:589980},"/Constant_7_output_0":{dtype:"int32",shape:[],off:589984},"/model/dfsmn/fsmn1/Constant_output_0":{dtype:"int32",shape:[1],off:589988},"/model/dfsmn/fsmn1/Constant_1_output_0":{dtype:"int32",shape:[1],off:589992},"/model/dfsmn/fsmn1/Constant_2_output_0":{dtype:"int32",shape:[1],off:589996},"/model/dfsmn/fsmn1/Constant_3_output_0":{dtype:"int32",shape:[1],off:59e4},"/model/dfsmn/fsmn1/Constant_5_output_0":{dtype:"int32",shape:[1],off:590004},"/model/dfsmn/fsmn1/Constant_9_output_0":{dtype:"int32",shape:[1],off:590008}}},Yt={means:[10.42295174919564,10.862097411631494,11.764544378124809,12.490164701573908,13.25983008289003,13.89594383242307,14.364940238918987,14.593948347480778,14.749723601612253,14.668315348346496,14.730796723156509,14.775052459167833,14.9890519821556,15.178004932637085,15.253520314586988,15.328637048782031,15.334018588850057,15.288641702136166,15.4276616890477,15.246266155846598,15.092573799088989,15.290421940704482,15.07575008669762,15.186772872540853,15.088673242416798,15.170797396442111,15.070178088017926,15.150795340269006,15.108532832116397,15.115345080167454,15.141279987705998,15.131832359605129,15.145195868641611,15.19151892676777,15.235478667211774,15.306369752614641,15.373021476906201,15.416394625766584,15.459857436373436,15.39143273165164,15.46357624247469,15.399661212735632,15.462907917820873,15.441629120393843,15.484969525295984,15.552401775001249,15.638091925650645,15.705489346158819,15.767008852632651,15.855123781367105,15.867269782501769,15.891537408746947,15.9231448295521,15.978382613315533,16.014801667676718,16.048674939996204,16.082029914992358,16.09680075379873,16.093736693349236,16.07247919506059,16.075509664672943,16.02227087563821,15.976762101902347,15.89786454765505,15.812741644368487,15.711205109067762,15.604198886052728,15.553519438005933,15.51025275187747,15.460023817226517,15.4156843628003,15.37602764551613,15.328348980305998,15.295370796331634,15.185470194591382,15.017044975516262,14.905080029850632,14.623806569017782,14.138093813776406,13.313870348004635],inv_std:[.2494980879825924,.23563235243542163,.23145152525802104,.2332233926481505,.23182660283718737,.22853356937894798,.2243486976577694,.21898920450844725,.21832438092730974,.22082592767700662,.2229673556813116,.22288416257259386,.22234810686081127,.22100642502031184,.21994202276343874,.22005444019015313,.22070092118977014,.22150809748461409,.22236667273698002,.22305291750035372,.22335341587062665,.22438905727453648,.22547701626910854,.2269007560258811,.22823023223045188,.22931472070164832,.23046728075908798,.23083553439603108,.23143382733873202,.2322065940520882,.2325798897870885,.2336197007969686,.23437240620327746,.23508252486137127,.23578078965798868,.235892002292441,.2360209777141303,.23663799549538955,.2374987640063862,.2379845180109627,.23899377757763487,.239748152899516,.24030835895648858,.2409769361661754,.24143248909906587,.24135465696291541,.24079937967447773,.24047405396120294,.23995525139180407,.23952287673801784,.2394808893818449,.2393650908183211,.23929339134427347,.23902199338028696,.23857873289710127,.23814701563685442,.23804621120577427,.23824193788738984,.2386009552212688,.23915406501238878,.23922540730102645,.2393830803524144,.2397336021407156,.2396056154523928,.24028502694537057,.2406181323375118,.2406792985927079,.24096201908324874,.24043605546026958,.24021526735270676,.23972514279402155,.23871998076352863,.2374413126648784,.23619509194955604,.23337281484306663,.2268023271445609,.2257750261856693,.22503847248255957,.2263113742246566,.2289949344716713]}});var J=11920929e-14,Y=t=>1127*Math.log(1+t/700),kt=(()=>{let t=new Float64Array(400),s=2*Math.PI/399;for(let n=0;n<400;n++)t[n]=Math.pow(.5-.5*Math.cos(s*n),.85);return t})(),vt=(()=>{let s=Y(20),o=(Y(8e3)-s)/81,u=[];for(let a=0;a<80;a++){let e=s+a*o,f=s+(a+1)*o,p=s+(a+2)*o,m=new Float64Array(256),_=-1,d=-1;for(let r=0;r<256;r++){let l=Y(31.25*r);l>e&&l<p&&(m[r]=l<=f?(l-e)/(f-e):(p-l)/(p-f),_===-1&&(_=r),d=r)}u.push({offset:_,weights:m.slice(_,d+1)})}return u})(),Rt=(()=>{let t=new Uint16Array(512),s=Math.log2(512);for(let n=0;n<512;n++){let o=n,u=0;for(let a=0;a<s;a++)u=u<<1|o&1,o>>=1;t[n]=u}return t})(),st=new Float64Array(512/2),nt=new Float64Array(512/2);for(let t=0;t<512/2;t++)st[t]=Math.cos(-2*Math.PI*t/512),nt[t]=Math.sin(-2*Math.PI*t/512);function Nt(t,s,n){for(let o=0;o<512;o++){let u=Rt[o];if(u>o){let a=t[o];t[o]=t[u],t[u]=a;let e=s[o];s[o]=s[u],s[u]=e}}for(let o=2;o<=512;o<<=1){let u=o>>1,a=512/o;for(let e=0;e<512;e+=o)for(let f=0;f<u;f++){let p=st[f*a],m=nt[f*a],_=e+f,d=_+u,r=t[d]*p-s[d]*m,l=t[d]*m+s[d]*p;t[d]=t[_]-r,s[d]=s[_]-l,t[_]+=r,s[_]+=l}}for(let o=0;o<=256;o++)n[o]=t[o]*t[o]+s[o]*s[o]}var E=new Float64Array(512),K=new Float64Array(512),tt=new Float64Array(257);function It(t,s,n,o){for(let e=0;e<400;e++)E[e]=t[s+e];let u=0;for(let e=0;e<400;e++)u+=E[e];let a=u/400;for(let e=0;e<400;e++)E[e]-=a;for(let e=399;e>0;e--)E[e]-=.97*E[e-1];E[0]-=.97*E[0];for(let e=0;e<400;e++)E[e]*=kt[e];for(let e=400;e<512;e++)E[e]=0;K.fill(0),Nt(E,K,tt);for(let e=0;e<80;e++){let{offset:f,weights:p}=vt[e],m=0;for(let _=0;_<p.length;_++)m+=p[_]*tt[f+_];m<J&&(m=J),n[o+e]=Math.log(m)}}function ot(t){let s=new Float64Array(t.length);for(let n=0;n<t.length;n++){let o=t[n];o>1?o=1:o<-1&&(o=-1),s[n]=Math.trunc(Math.fround(o*32767))}return s}function Dt(t,s,n){let{means:o,inv_std:u}=n;for(let a=0;a<s;a++){let e=a*80;for(let f=0;f<80;f++)t[e+f]=(t[e+f]-o[f])*u[f]}}var O=class{constructor(s){this.buffer=[];this.bufferStart=0;this.nextFrame=0;this.cmvn=s}reset(){this.buffer=[],this.bufferStart=0,this.nextFrame=0}push(s){for(let f=0;f<s.length;f++)this.buffer.push(s[f]);let n=this.bufferStart+this.buffer.length,o=[],u=0;for(;this.nextFrame*160+400<=n;){let f=this.nextFrame*160-this.bufferStart,p=new Float32Array(80);It(this.buffer,f,p,0),Dt(p,1,this.cmvn);for(let m=0;m<80;m++)o.push(p[m]);this.nextFrame++,u++}let a=this.nextFrame*160,e=a-this.bufferStart;return e>0&&(this.buffer=this.buffer.slice(e),this.bufferStart=a),{feats:new Float32Array(o),n:u}}};var b=class{constructor(s,n){this.shape=s;this.data=n}get rank(){return this.shape.length}get isInt(){return this.data instanceof Int32Array}};function w(t){let s=1;for(let n of t)s*=n;return s}function S(t){let s=new Array(t.length),n=1;for(let o=t.length-1;o>=0;o--)s[o]=n,n*=t[o];return s}function ut(t){return new b(t.slice(),new Float32Array(w(t)))}function ft(t,s){let n=Math.max(t.length,s.length),o=new Array(n);for(let u=0;u<n;u++){let a=t[t.length-1-u]??1,e=s[s.length-1-u]??1;if(a!==e&&a!==1&&e!==1)throw new Error(`broadcast mismatch ${t} vs ${s}`);o[n-1-u]=Math.max(a,e)}return o}function mt(t,s,n){let o=ft(t.shape,s.shape),u=w(o),a=new Float32Array(u),e=o.length,f=S(t.shape),p=S(s.shape),m=new Int32Array(e),_=new Int32Array(e);for(let c=0;c<e;c++){let M=c-(e-t.rank),y=c-(e-s.rank);m[c]=M>=0&&t.shape[M]!==1?f[M]:0,_[c]=y>=0&&s.shape[y]!==1?p[y]:0}let d=new Int32Array(e),r=t.data,l=s.data,A=0,h=0;for(let c=0;c<u;c++){a[c]=n(r[A],l[h]);for(let M=e-1;M>=0;M--){if(++d[M]<o[M]){A+=m[M],h+=_[M];break}d[M]=0,A-=m[M]*(o[M]-1),h-=_[M]*(o[M]-1)}}return new b(o,a)}function at(t,s){return mt(t,s,(n,o)=>n+o)}function pt(t,s){return mt(t,s,(n,o)=>n*o)}function _t(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=t.data[n]>0?t.data[n]:0;return new b(t.shape.slice(),s)}function dt(t){let s=new Float32Array(t.data.length);for(let n=0;n<s.length;n++)s[n]=1/(1+Math.exp(-t.data[n]));return new b(t.shape.slice(),s)}function lt(t,s){let n=s??t.shape.map((r,l)=>t.rank-1-l),o=n.map(r=>t.shape[r]),u=t.data.length,a=new Float32Array(u),e=S(t.shape),f=o.length,p=new Int32Array(f);for(let r=0;r<f;r++)p[r]=e[n[r]];let m=new Int32Array(f),_=t.data,d=0;for(let r=0;r<u;r++){a[r]=_[d];for(let l=f-1;l>=0;l--){if(++m[l]<o[l]){d+=p[l];break}m[l]=0,d-=p[l]*(o[l]-1)}}return new b(o,a)}function rt(t,s){let n=t[0],o=n.rank,u=s<0?s+o:s,a=n.shape.slice();a[u]=t.reduce((m,_)=>m+_.shape[u],0);let e=new Float32Array(w(a)),f=S(a),p=0;for(let m of t){let _=S(m.shape),d=new Array(o).fill(0);for(let r=0;r<m.data.length;r++){let l=r;for(let h=0;h<o;h++)d[h]=Math.floor(l/_[h]),l-=d[h]*_[h];let A=0;for(let h=0;h<o;h++){let c=h===u?d[h]+p:d[h];A+=c*f[h]}e[A]=m.data[r]}p+=m.shape[u]}return new b(a,e)}function ct(t,s,n){let o=t.rank,u=n<0?n+o:n,a=S(t.shape),e=s.rank===0,f=e?[s.data[0]]:Array.from(s.data),p=e?[]:s.shape.slice(),m=[...t.shape.slice(0,u),...p,...t.shape.slice(u+1)],_=new Float32Array(w(m)),d=S(m),r=p.length;for(let l=0;l<_.length;l++){let A=l,h=new Array(m.length);for(let i=0;i<m.length;i++)h[i]=Math.floor(A/d[i]),A-=h[i]*d[i];let c=0;for(let i=0;i<u;i++)c+=h[i]*a[i];let M=0;for(let i=0;i<r;i++)M=M*p[i]+h[u+i];let y=f[e?0:M];y<0&&(y+=t.shape[u]),c+=y*a[u];for(let i=u+1;i<o;i++)c+=h[i-1+r]*a[i];_[l]=t.data[c]}return new b(m,_)}function it(t,s){let n=t.rank+s.length,o=s.map(e=>e<0?e+n:e).sort((e,f)=>e-f),u=t.shape.slice();for(let e of o)u.splice(e,0,1);let a=t.data instanceof Int32Array?Int32Array.from(t.data):Float32Array.from(t.data);return new b(u,a)}var Gt=2**31-1;function ht(t,s,n,o,u){let a=t.rank,e=o??s.map((c,M)=>M),f=u??s.map(()=>1),p=new Array(a).fill(0),m=t.shape.slice(),_=new Array(a).fill(1);for(let c=0;c<e.length;c++){let M=e[c]<0?e[c]+a:e[c],y=t.shape[M],i=s[c];i<0&&(i+=y),i=Math.max(0,Math.min(i,y));let T=n[c];T>=Gt?T=y:(T<0&&(T+=y),T=Math.max(0,Math.min(T,y))),p[M]=i,m[M]=T,_[M]=f[c]}let d=new Array(a);for(let c=0;c<a;c++)d[c]=Math.max(0,Math.ceil((m[c]-p[c])/_[c]));let r=S(t.shape),l=S(d),h=t.data instanceof Int32Array?new Int32Array(w(d)):new Float32Array(w(d));for(let c=0;c<h.length;c++){let M=c,y=0;for(let i=0;i<a;i++){let T=Math.floor(M/l[i]);M-=T*l[i],y+=(p[i]+T*_[i])*r[i]}h[c]=t.data[y]}return new b(d,h)}function Mt(t,s){let n=t,o=s,u=!1,a=!1;n.rank===1&&(n=new b([1,n.shape[0]],n.data),u=!0),o.rank===1&&(o=new b([o.shape[0],1],o.data),a=!0);let e=n.shape[n.rank-2],f=n.shape[n.rank-1],p=o.shape[o.rank-2],m=o.shape[o.rank-1];if(f!==p)throw new Error(`matmul inner dim ${f} vs ${p}`);let _=n.shape.slice(0,n.rank-2),d=o.shape.slice(0,o.rank-2),r=ft(_,d),l=w(r),A=[...r,e,m],h=new Float32Array(w(A)),c=e*f,M=p*m,y=e*m,i=S(r),T=S(_),B=S(d),D=new Array(r.length);for(let g=0;g<l;g++){let G=g;for(let C=0;C<r.length;C++)D[C]=Math.floor(G/i[C]),G-=D[C]*i[C];let L=0;for(let C=0;C<_.length;C++){let R=D[C+(r.length-_.length)];L+=(_[C]===1?0:R)*T[C]}let v=0;for(let C=0;C<d.length;C++){let R=D[C+(r.length-d.length)];v+=(d[C]===1?0:R)*B[C]}let U=L*c,$=v*M,P=g*y;for(let C=0;C<e;C++){let R=U+C*f;for(let H=0;H<m;H++){let N=0;for(let k=0;k<f;k++)N+=n.data[R+k]*o.data[$+k*m+H];h[P+C*m+H]=N}}}let x=new b(A,h);return u&&(x=et(x,x.rank-2)),a&&(x=et(x,x.rank-1)),x}function et(t,s){let n=t.shape.slice();return n.splice(s,1),new b(n,t.data)}function At(t,s,n,o,u,a,e){let[f,p,m]=t.shape,[_,d,r]=s.shape,l=u[0],A=a[0],h=e[0],c=m+l+u[1],M=Math.floor((c-(A*(r-1)+1))/h)+1,y=new Float32Array(f*_*M),i=S(t.shape),T=S(s.shape),B=_/o,D=p/o;for(let x=0;x<f;x++)for(let g=0;g<o;g++)for(let G=0;G<B;G++){let L=g*B+G;for(let v=0;v<M;v++){let U=0,$=v*h-l;for(let P=0;P<d;P++){let C=g*D+P,R=x*i[0]+C*i[1],H=L*T[0]+P*T[1];for(let N=0;N<r;N++){let k=$+N*A;k<0||k>=m||(U+=s.data[H+N]*t.data[R+k])}}n&&(U+=n.data[L]),y[x*_*M+L*M+v]=U}}return new b([f,_,M],y)}var Lt=80;function Pt(t,s){let n=w(t.shape);if(t.dtype==="int8_pc"){let u=new Float32Array(n);for(let f=0;f<n;f++)u[f]=s.getInt8(t.off+f);let a=w(t.scale_shape),e=new Float32Array(a);for(let f=0;f<a;f++)e[f]=s.getFloat32(t.scale_off+f*4,!0);return pt(new b(t.shape.slice(),u),new b(t.scale_shape.slice(),e))}if(t.dtype==="int32"){let u=new Int32Array(n);for(let a=0;a<n;a++)u[a]=s.getInt32(t.off+a*4,!0);return new b(t.shape.slice(),u)}let o=new Float32Array(n);for(let u=0;u<n;u++)o[u]=s.getFloat32(t.off+u*4,!0);return new b(t.shape.slice(),o)}var q=class{constructor(s,n){this.weights={};this.nodes=s.nodes,this.inputNames=s.inputs,this.outputNames=s.outputs,this.cacheShape=s.cache_shape;let o=new DataView(n.buffer,n.byteOffset,n.byteLength);for(let[u,a]of Object.entries(s.weights))this.weights[u]=Pt(a,o);this.reset()}reset(){this.cache=ut(this.cacheShape)}get cacheState(){return this.cache.data}step(s,n){let o={...this.weights};o[this.inputNames[0]]=new b([1,n,Lt],s),o[this.inputNames[1]]=this.cache;for(let f of this.nodes){let p=f.attrs,m=f.inputs.map(d=>d?o[d]:null),_;switch(f.op){case"MatMul":_=Mt(m[0],m[1]);break;case"Add":_=at(m[0],m[1]);break;case"Relu":_=_t(m[0]);break;case"Sigmoid":_=dt(m[0]);break;case"Transpose":_=lt(m[0],p.perm);break;case"Concat":_=rt(m.filter(d=>d!==null),p.axis);break;case"Gather":_=ct(m[0],m[1],p.axis??0);break;case"Unsqueeze":{let d=m.length>1&&m[1]!==null?Array.from(m[1].data):p.axes;_=it(m[0],d);break}case"Slice":{let d=Array.from(m[1].data),r=Array.from(m[2].data),l=m.length>3&&m[3]!==null?Array.from(m[3].data):void 0,A=m.length>4&&m[4]!==null?Array.from(m[4].data):void 0;_=ht(m[0],d,r,l,A);break}case"Conv":_=At(m[0],m[1],m.length>2?m[2]:null,p.group??1,p.pads??[0,0],p.dilations??[1],p.strides??[1]);break;default:throw new Error("unhandled op "+f.op)}o[f.outputs[0]]=_}this.cache=o[this.outputNames[1]];let u=o[this.outputNames[0]],a=S(u.shape),e=new Float32Array(n);for(let f=0;f<n;f++)e[f]=u.data[f*a[1]];return e}};var I=80,bt=160/16e3*1e3,Ht=1e3/bt,Ut=700,F=Math.round(Ut/bt),yt=8,Z=yt+1,zt=.2,Bt=.75,Ot=15,qt=4,Vt=50;function Wt(t,s,n){let o=0;for(let p=0;p<s;p++)o+=t[p];o/=s;let u=n*s/Ht,a=2*Math.cos(2*Math.PI*u/s),e=0,f=0;for(let p=0;p<s;p++){let m=t[p]-o+a*e-f;f=e,e=m}return Math.sqrt(Math.max(0,e*e+f*f-a*e*f))/s}function Qt(t,s){let n=0;for(let u=0;u<s;u++)n+=t[u];n/=s;let o=0;for(let u=0;u<s;u++)o+=(t[u]-n)**2;return Math.sqrt(o/s)}function Ct(t,s,n){let o=Math.min(s-1,Math.max(0,Math.round(n*(s-1))));return t[o]}var V=class{constructor(){this.motion=new Float64Array(F);this.flux=new Float64Array(F);this.level=new Float64Array(F);this.candidate=new Uint8Array(F);this.count=0;this.position=0;this.history=new Float32Array(Z*I);this.historyNorm=new Float64Array(Z);this.historyPosition=0;this.seen=0;this.scratchMotion=new Float64Array(F);this.scratchFlux=new Float64Array(F);this.scratchLevel=new Float64Array(F)}reset(){this.count=0,this.position=0,this.historyPosition=0,this.seen=0}push(s,n,o){let u=0,a=0,e=this.historyPosition*I;for(let l=0;l<I;l++){let A=s[n+l];this.history[e+l]=A,u+=A,a+=A*A}let f=Math.sqrt(a);this.historyNorm[this.historyPosition]=f;let p=(this.historyPosition+1)%Z;if(this.historyPosition=p,this.seen++,this.seen<=yt)return;let m=p*I,_=0,d=0;for(let l=0;l<I;l++)_+=this.history[e+l]*this.history[m+l],d+=Math.abs(this.history[e+l]-this.history[m+l]);let r=f*this.historyNorm[p];this.motion[this.position]=r>1e-9?1-_/r:0,this.flux[this.position]=d/I,this.level[this.position]=u/I,this.candidate[this.position]=o>=zt?1:0,this.position=(this.position+1)%F,this.count<F&&this.count++}score(){let s=this.count<F?0:this.position,n=0;for(let e=0;e<this.count;e++){let f=(s+e)%F;this.scratchLevel[e]=this.level[f],this.candidate[f]&&(this.scratchMotion[n]=this.motion[f],this.scratchFlux[n]=this.flux[f],n++)}if(n<Ot)return null;let o=this.scratchMotion.subarray(0,n),u=this.scratchFlux.subarray(0,n);o.sort(),u.sort();let a=0;if(this.count>=Vt){let e=Qt(this.scratchLevel,this.count);e>1e-6&&(a=Wt(this.scratchLevel,this.count,qt)/e)}return{motion:Ct(o,n,Bt),medianFlux:Ct(u,n,.5),modulation:a,frames:n}}};var z=5,Zt=80,jt=160/16e3*1e3;function xt(t){let s=new O(t.cmvn),n=new q(t.graph,t.weights),o=new V,u=new Float64Array(z),a=0,e=0,f=0,p=0,m=null;function _(d){return a<z?(u[e]=d,f+=d,a++,e=(e+1)%z,f/a):(f+=d-u[e],u[e]=d,e=(e+1)%z,f/z)}return{pushPcm(d){let{feats:r,n:l}=s.push(ot(d));if(l===0)return;let A=n.step(r,l);if(!m){p+=l;return}for(let h=0;h<l;h++){p++;let c=_(A[h]);o.push(r,h*Zt,c),m(c,p*jt,o.score())}},onProb(d){m=d},reset(){s.reset(),n.reset(),o.reset(),u.fill(0),a=0,e=0,f=0,p=0}}}async function wt(t){let s=await Promise.resolve().then(()=>(Tt(),St));return{graph:s.graph,cmvn:s.cmvn,weights:t}}var W=self,Q=null;async function Xt(t){let s=await wt(new Uint8Array(t));Q=xt(s),Q.onProb((n,o,u)=>W.postMessage({type:"prob",prob:n,tMs:o,speech:u})),W.postMessage({type:"ready"})}W.onmessage=t=>{let s=t.data;switch(s.type){case"init":Xt(s.weights).catch(n=>W.postMessage({type:"error",message:String(n)}));return;case"pcm":Q?.pushPcm(new Float32Array(s.buffer));return;case"reset":Q?.reset();return}};})();\n';});var OE={};t0(OE,{MOOD_WORKER_SOURCE:()=>ZI});var ZI,IE=e0(()=>{ZI=`"use strict";(()=>{var o=self,l=/^(INFO: |[IW]\\d{4} |Graph successfully started running)/;for(let t of["log","info","warn","error"]){let e=console[t].bind(console);console[t]=(...r)=>{typeof r[0]=="string"&&l.test(r[0])||e(...r)}}var s=null,i=(t,e,r)=>t.FaceLandmarker.createFromOptions({wasmLoaderPath:e.loaderUrl,wasmBinaryPath:e.wasmUrl},{baseOptions:{modelAssetBuffer:e.model,delegate:r},runningMode:"VIDEO",numFaces:1,outputFaceBlendshapes:!0});async function d(t){o.importScripts(t.bundleUrl);let e=o.Vision;if(!e?.FaceLandmarker)throw new Error("MediaPipe bundle defined no Vision global");if(t.delegate==="GPU")try{s=await i(e,t,"GPU"),o.postMessage({type:"ready",delegate:"GPU"});return}catch{}s=await i(e,t,"CPU"),o.postMessage({type:"ready",delegate:"CPU"})}function p(t,e){try{if(!s)throw new Error("frame before init");let n=s.detectForVideo(t,e).faceBlendshapes?.[0]?.categories;o.postMessage({type:"result",blendshapes:n?Object.fromEntries(n.map(a=>[a.categoryName,a.score])):null})}catch(r){o.postMessage({type:"error",message:String(r)})}finally{t.close()}}o.onmessage=t=>{let e=t.data;e.type==="init"?d(e).catch(r=>o.postMessage({type:"error",message:String(r)})):p(e.frame,e.timestampMs)};})();
16
+ `;});var WT=ue(WS());var it=ue(Rt());var $f="33d964ca31c2dcf0c6ef3bfe4204c140829a7400bc73242e39b6b121fa174ce0";var ed="api.avatarfactory.in",jg=()=>`wss://${ed}`,Yg=()=>`https://${ed}`,jS=()=>`https://${ed}/v1/vad/weights-${$f}.bin`,qg=(t,e)=>`https://${ed}/v1/assets/${t}.${e}`;var lu=class lu{static setLogLevel(e){this.level=e;}static sanitize(e){return e.map(n=>{if(n&&typeof n=="object"){let i={...n};for(let r of lu.SENSITIVE_FIELDS)r in i&&(i[r]="[REDACTED]");return i}return n})}static format(e,n,i){return `[${new Date().toISOString()}] [${e}] [${n}] ${i}`}static muted(e){return this.level>e&&!this.onLog}static debug(e,n,...i){if(this.muted(0))return;let r=this.sanitize(i);this.onLog?.(0,e,n,...r),this.level<=0&&console.debug(this.format("DEBUG",e,n),...r);}static info(e,n,...i){if(this.muted(1))return;let r=this.sanitize(i);this.onLog?.(1,e,n,...r),this.level<=1&&console.info(this.format("INFO",e,n),...r);}static warn(e,n,...i){if(this.muted(2))return;let r=this.sanitize(i);this.onLog?.(2,e,n,...r),this.level<=2&&console.warn(this.format("WARN",e,n),...r);}static error(e,n,...i){if(this.muted(3))return;let r=this.sanitize(i);this.onLog?.(3,e,n,...r),this.level<=3&&console.error(this.format("ERROR",e,n),...r);}static event(e,n,...i){this.info(`Event:${e}`,n,...i);}};lu.level=4,lu.SENSITIVE_FIELDS=["apiKey","sessionToken","getSessionToken","byok"];var R=lu;var Xg=new Map;function uu(t,e,n){let i=Xg.get(t.sha256);if(i)return i;let r=qR(t,e,n).catch(a=>{throw Xg.delete(t.sha256),a});return Xg.set(t.sha256,r),r}async function qR(t,e,n){let i=await XR(t.sha256,n);if(i&&await YS(i,t))return i;let r=await fetch(e,{priority:"low"});if(!r.ok)throw new Error(`asset ${t.sha256} HTTP ${r.status}`);let a=new Uint8Array(await r.arrayBuffer());if(!await YS(a,t))throw new Error(`asset ${t.sha256} failed integrity check (${a.byteLength}B)`);return n?.write(t.sha256,a)?.catch(s=>{R.warn("Assets","failed to cache asset",{sha256:t.sha256,cause:s});}),a}async function XR(t,e){try{return await e?.read(t)??null}catch(n){return R.warn("Assets","asset cache read failed",{sha256:t,cause:n}),null}}async function YS(t,e){if(t.byteLength!==e.byteLength)return false;let n=globalThis.crypto?.subtle;if(!n)return R.warn("Assets","no SubtleCrypto \u2014 asset checked by length only"),true;let i=await n.digest("SHA-256",t);return QR(new Uint8Array(i))===e.sha256}function QR(t){let e="";for(let n=0;n<t.length;n++)e+=t[n].toString(16).padStart(2,"0");return e}function qS(t,e){return uu({sha256:$f,byteLength:590012},t,e&&{read:n=>e.getCachedVadWeights?.(n),write:(n,i)=>e.setCachedVadWeights?.(n,i)})}var Qg={A:2,E:4,I:6,O:8,U:7,Y:6,P:21,B:21,M:21,F:18,V:18,T:19,D:19,N:19,S:15,Z:15,L:14,R:13,K:20,C:20,G:20,Q:20,H:12,W:7,J:16,X:15," ":0,".":0,",":0,"!":0,"?":0,":":0,";":0,"-":0,"(":0,")":0,'"':0,"'":0,DEFAULT:0},td={TH:19,SH:16,CH:16,PH:18,GH:0,CK:20,NG:20,AI:4,AU:8,EA:6,EE:6,IE:6,OA:8,OO:7,OU:8,OW:8,UE:7,ER:5,IR:5,UR:5,AR:2,OR:8};var Kg=400,XS=4e3,Sa={loop:true,volume:.4,fadeOutMs:350},QS=15e3,Zg=500,KS=4010,ZS=4011,JS=6e3,$S=1500,ew=[1e3,2e3,4e3,8e3,15e3],tw={echoCancellation:false,noiseSuppression:false,autoGainControl:false,channelCount:1},Jg=350,$g=-9999,ev=9999,Zi=Number.NEGATIVE_INFINITY,cu=.28,nd=1,tv=.15,nv=2.5,id=1,iv=.2,rv=2,rd=1,av=.25,ov=1.6,ad=60,sv=.1,lv=200,od=40,uv=0,cv=100,fv=12e3,dv=1e3,sd=0,ld=250,nw=3,iw=10,hv=2500;var pv=1e3,fu=.25,ud=.25,cd=.01,rw=200,aw=250,ow=12e4,sw=12e3;var fd=t=>{if(!Array.isArray(t))return null;let e=[];for(let n of t){let{visemeId:i,start:r,end:a}=n??{};!Number.isInteger(i)||!Number.isFinite(r)||!Number.isFinite(a)||e.push({char:"",visemeId:i,start:r,end:a});}return e},mv=(t,e)=>{let n=[],i=t[0];for(let a=1;a<t.length;a++){let s=t[a];s.start*1e3-i.start*1e3<=e&&s.char!==" "&&i.char!==" "?i={...i,end:s.end,char:i.char+s.char}:(td?.[i.char]&&(i={...i,visemeId:td?.[i.char]??0}),n.push(i),i=s);}n.push(i);let r=n.length-1;for(;r>=0&&n[r].visemeId===0;)r--;if(r<n.length-1){let a=n[n.length-1];n[r]={...n[r],end:a.start},n.splice(r+1,n.length-(r+1),{...a,start:n[r].end});}return n},dd=(t,e=40)=>{if(!t||!Array.isArray(t.character_start_times_seconds))return [];let n=t.characters.map((i,r)=>{let a=t.character_start_times_seconds[r]??0,s=t.character_end_times_seconds[r]??a+.05,u=(i||" ").toUpperCase();return {char:i,start:a,end:s,visemeId:Qg[u]??0}});return mv(n,e)},du=(t,{defaultDurationMs:e=50}={})=>{if(!t)return null;let n=Array.isArray(t.chars)?t.chars:[],i=Array.isArray(t.charStartTimesMs)?t.charStartTimesMs:[],r=Array.isArray(t.charDurationsMs)?t.charDurationsMs:[],a=n.length,s=new Array(a).fill(0),u=new Array(a).fill(e);for(let v=0;v<a;v++){let A=i[v],p=A==null?NaN:Number(A);s[v]=Number.isFinite(p)?p:0;let _=r[v],T=_==null?NaN:Number(_);u[v]=Number.isFinite(T)&&T>=0?T:NaN;}for(let v=0;v<a;v++)Number.isFinite(u[v])||(u[v]=v+1<a&&Number.isFinite(s[v+1])&&s[v+1]>s[v]?s[v+1]-s[v]:e);let d=new Array(a),g=new Array(a);for(let v=0;v<a;v++){let A=s[v]/1e3,p=(s[v]+Math.max(0,u[v]))/1e3;d[v]=Number.isFinite(A)?A:0,g[v]=Number.isFinite(p)?Math.max(d[v],p):d[v]+.001;}return {characters:n,character_start_times_seconds:d,character_end_times_seconds:g}};var gv=["idle","listening","thinking","talking"];var lw=t=>typeof t=="string"&&gv.includes(t),ks=t=>typeof t=="string"&&t.trim()&&t.length<=64?t:null,wa=t=>{let e=Number(t);return Number.isFinite(e)&&e>0?Math.min(Math.round(e),6e5):0};function ZR(t){if(!t||typeof t!="object")return null;let e=t,n=ks(e.gate),i=ks(e.act),r=i&&Array.isArray(e.acts)?e.acts.filter(a=>Number.isInteger(a)&&a>0&&a<=99):[];return !n&&!i?null:{gate:n,act:i,acts:r,...lw(e.fallback)&&{fallback:e.fallback}}}var JR=["oneShot","loop","pingPong"],$R=/^[^\0\r\n]{1,120}$/;function ex(t){if(!t||typeof t!="object")return null;let e=t,n=ks(e.gate),i=ks(e.act),r=wa(e.windowMaxMs);if(!n||!i||!r)return null;let a=Math.min(wa(e.windowMinMs),r),s=[];for(let u of Array.isArray(e.acts)?e.acts:[]){let d=u??{},g=d.id,v=wa(d.ms);if(!Number.isInteger(g)||g<1||g>99||!v||s.some(_=>_.id===g))continue;let A=JR.includes(d.loop)?d.loop:"loop",p=typeof d.timeline=="string"&&$R.test(d.timeline)?d.timeline:void 0;s.push({id:g,ms:v,loop:A,...p&&{timeline:p}});}return s.length?{gate:n,act:i,acts:s,windowMinMs:a,windowMaxMs:r}:null}var tx=12,nx=4;function ix(t){let e=(Array.isArray(t)?t:[]).map(ks).filter(n=>!!n);return [...new Set(e)].slice(0,nx)}function rx(t){if(!t||typeof t!="object")return null;let e=t,n=[];for(let i of Array.isArray(e.gestures)?e.gestures:[]){let r=i??{},a=ks(r.trigger),s=wa(r.ms);if(!(!a||!s||n.some(u=>u.trigger===a))&&(n.push({trigger:a,ms:s}),n.length===tx))break}return n.length?{gestures:n}:null}function uw(t,e,n,i,r=Math.random){if(!t?.length||n<i)return null;let a=t.filter(u=>u.trigger!==e),s=a.length?a:t;return s[Math.floor(r()*s.length)]}function hd(t){if(!t||typeof t!="object")return null;let e=t,n=e.branches??{},i={};for(let u of gv){let d=ZR(n[u]);d&&(i[u]=d);}let r=ex(e.idleActs);if(r&&(i.idle={gate:r.gate,act:r.act,acts:r.acts.map(u=>u.id)}),!Object.keys(i).length)return null;let a=rx(e.playful),s=ix(e.idleTriggers);return {version:Number(e.version)||1,branches:i,quietToIdleMs:wa(e.quietToIdleMs),idleCycleMs:wa(e.idleCycleMs),playfulAfterMs:wa(e.playfulAfterMs),playfulRoles:Array.isArray(e.playfulRoles)?e.playfulRoles.filter(lw):[],thinkingMaxMs:wa(e.thinkingMaxMs),...r&&{idleActs:r},...a&&{playful:a},...s.length&&{idleTriggers:s}}}var vv=t=>t.trim().replace(/\s+/g," ").slice(0,Kg).trimEnd(),ax=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e.toString(16).padStart(8,"0")},Av=(t,e,n)=>`${t}:${e}:${ax(n)}`;var hu=t=>t.environment!=="meeting"?t:{...t,autoStart:t.autoStart??true,controls:t.controls??{enabled:false},statusBanner:{enabled:false,...t.statusBanner},thinkingIndicator:{enabled:false,...t.thinkingIndicator},connectTone:t.connectTone??{enabled:false},turnTaking:{echoGate:false,clientBargeIn:false,...t.turnTaking}};var cw=()=>{if(typeof document>"u")return true;let t=document.permissionsPolicy??document.featurePolicy;return typeof t?.allowsFeature!="function"||t.allowsFeature("microphone")!==false};var Ji=1e3,Os=(t,e,n,i)=>typeof t=="number"&&Number.isFinite(t)?Math.max(e,Math.min(n,t)):i,Pr=class{constructor(){this.speed=nd;this.jawSpeed=id;this.openness=rd;this.holdSec=ad/Ji;this.rest=od;this.offsetSec=sd/Ji;this.maxStepFrames=nw;}apply(e){e&&(this.speed=Os(e.mouthSpeed,tv,nv,this.speed),this.jawSpeed=Os(e.jawSpeed,iv,rv,this.jawSpeed),this.openness=Os(e.mouthOpenness,av,ov,this.openness),this.holdSec=Os(e.mouthHold,sv,lv,this.holdSec*Ji)/Ji,this.rest=Os(e.mouthRest,uv,cv,this.rest),this.offsetSec=Os(e.offsetMs,-ld,ld,this.offsetSec*Ji)/Ji);}reset(e){this.speed=nd,this.jawSpeed=id,this.openness=rd,this.holdSec=ad/Ji,this.rest=od,this.offsetSec=sd/Ji,this.apply(e);}snapshot(){return {offsetMs:Math.round(this.offsetSec*Ji),mouthSpeed:this.speed,jawSpeed:this.jawSpeed,mouthOpenness:this.openness,mouthHold:Math.round(this.holdSec*Ji),mouthRest:this.rest}}};var pd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function yv(t){let e="",n=t.length;for(let i=0;i<n;i+=3){let r=t[i],a=i+1<n?t[i+1]:0,s=i+2<n?t[i+2]:0;e+=pd[r>>2],e+=pd[(r&3)<<4|a>>4],e+=i+1<n?pd[(a&15)<<2|s>>6]:"=",e+=i+2<n?pd[s&63]:"=";}return e}var pu=t=>t.characters.join("").replace(/\s+/g," ").trim(),mu=t=>{let{characters:e,character_start_times_seconds:n,character_end_times_seconds:i}=t,r=[],a="",s=0,u=0,d=()=>{a&&(r.push({text:a,start:s,end:u}),a="");};for(let g=0;g<e.length;g++){let v=e[g];if(/\s/.test(v)){d();continue}a||(s=n[g]??0),a+=v,u=i[g]??s;}return d(),r},bv=t=>t.split(/\s+/).filter(Boolean).map(e=>({text:e,start:0,end:0})),md=(t,e)=>{let n=0;for(;n<t.words.length&&t.words[n].start<=e;)n++;return n},_v=(t,e)=>t.words.slice(0,md(t,e)).map(n=>n.text).join(" ").trim();var Sv=["hmm","hmmm","mhm","mhmm","mm","mmm","uh","um","umm","uh huh","yeah","yep","ok","okay","right","haan","han","achha","accha","theek hai","theek"];var gd={mode:"healthy",commitPostPauseMs:680,settleMs:60,circuitBreakerEnabled:true},wv={mode:"degraded",commitPostPauseMs:100,settleMs:100,circuitBreakerEnabled:false},fw=1200,dw=600,hw=5,pw=3,mw=6e4,gw=400,vw=6e3,Aw=.5,yw=80,bw=3,_w=100,Sw=2,ww=.6,Ew=.8,Mw=4,Cw=400,Rw=40;function Tv(t){let e="idle",n=null,i=null,r=0,a=0,s=0,u=0,d="",g=null,v=0,A=0,p=0,_=0,T=0,x=0;function N(){return t.getPolicy?.()??gd}function E(){return N().circuitBreakerEnabled?{pause:T,threshold:x}:{pause:0,threshold:0}}function w(){return Math.min(.95,(e==="soft_pause"?.3:.5)+E().threshold)}function C(){return d.trim().length>0&&!xw(d)}function I(fe){return g===null||g.motion>=fe}function V(){return g?{speechMotion:g.motion,speechMedianFlux:g.medianFlux,speechModulation:g.modulation}:{}}function K(){n=null,i=null,r=0,a=0,s=0,u=0,d="",g=null;}function F(){A=0,p=0;}function H(){e="idle",K(),F(),_=0,T=0,x=0;}function J(fe){t.onTelemetry?.({voiceOnsetToPauseMs:s-r,outcome:"commit",commitClause:fe,totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:N().mode,...V()}),t.commitInterrupt(),H();}function Y(fe){d.trim().length===0&&u<60?_++:_=0,t.onTelemetry?.({voiceOnsetToPauseMs:s-r,outcome:"resume",totalVoicedMs:a,postPauseVoicedMs:u,transcript:d||void 0,wordlessResumeStreak:_,mode:N().mode,...V()}),t.resumePlayback(),N().circuitBreakerEnabled&&_>=3&&(T=150,x=.1),a>=100?(A=a,p=fe+500):F(),e="speaking",K();}function Me(fe,Q,te){if(te!==void 0&&(g=te),v=Q,!t.isAvatarSpeaking()){e!=="idle"&&De();return}if(e==="idle"&&(e="speaking",K()),fe>=w()){if(n===null&&(n=Q),i!==null){let X=Q-i;X>0&&X<=150&&(a+=X,e==="soft_pause"&&Q-s>N().settleMs&&(u+=Math.min(X,30)));}i=Q;}else i!==null&&Q-i>150&&(n=null);if(e==="speaking"){n!==null&&Q-n>=70+E().pause&&(e="soft_pause",r=n,s=Q,t.pausePlayback());return}if(u>=N().commitPostPauseMs&&!C()&&I(.02)){J("post_pause");return}let z=i!==null&&Q-i<=150;if(z&&Q-r>=1e3&&!C()&&I(.02)){J("sustained");return}if(!z&&i!==null&&Q-i>=900){Y(Q);return}}function Re(fe){if(e==="idle"||!fe||t.getActiveScriptTail&&Ow(fe,t.getActiveScriptTail()))return;d=d?`${d} ${fe}`:fe;let Q=p>0&&v<=p,te=a<100;(te&&Q?A:a)<100||xw(fe)&&(e==="speaking"&&(e="soft_pause",r=n??0,s=0,t.pausePlayback()),J(te?"words_late":"words"));}function he(){e!=="idle"&&(e==="speaking"&&(e="soft_pause",s=0,t.pausePlayback()),J("manual"));}function De(){e==="soft_pause"&&t.resumePlayback(),H();}return {onVadProb:Me,onPartialTranscript:Re,manualStop:he,abort:De,reset:De}}function vd(t){return t.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function kw(t){return t.replace(/(.)\1+/g,"$1")}var Sx=new Set(Sv.filter(t=>!t.includes(" ")).map(kw)),wx=Sv.filter(t=>t.includes(" "));function xw(t){let e=vd(t);if(!e)return false;for(let i of wx)e=e.replace(new RegExp(`(^| )${i}( |$)`,"g")," ");return e.split(" ").filter(Boolean).some(i=>!Sx.has(kw(i)))}function Ow(t,e,n=ww){let i=vd(t).split(" ").filter(Boolean);if(i.length===0)return false;let r=new Set(vd(e).split(" ").filter(Boolean));if(r.size===0)return false;let a=0;for(let s of i)r.has(s)&&a++;return a/i.length>=n}function Iw(t,e){return vd(t).split(" ").filter(Boolean).length<Mw?false:Ow(t,e,Ew)}var Pw=/^[a-z0-9][a-z0-9_.]{0,63}$/;var Ad=class{constructor(){this.sentByName=new Map;this.windowStartedAt=0;this.windowCount=0;}validate(e){if(!Pw.test(e.name))return {ok:false,reason:"invalid_name",message:`notify() name must be a slug matching ${Pw} \u2014 got "${e.name}"`};if(e.say!==void 0&&e.say.length>1e3)return {ok:false,reason:"say_too_long",message:"notify() say is too long (max 1000 chars)"};if(e.data===void 0)return {ok:true};let n;if(typeof e.data=="string")n=e.data;else try{n=JSON.stringify(e.data);}catch{return {ok:false,reason:"data_invalid",message:"notify() data is not serializable"}}return n.length>512?{ok:false,reason:"data_too_long",message:"notify() data is too long (max 512 chars serialized)"}:{ok:true,data:n}}admit(e,n,i){let r=this.sentByName.get(e);return r&&i-r.sentAt<n?{ok:false,reason:"cooldown"}:(i-this.windowStartedAt>=1e4&&(this.windowStartedAt=i,this.windowCount=0),this.windowCount>=5?{ok:false,reason:"rate_limit"}:(this.windowCount+=1,this.sweepExpired(i),this.sentByName.set(e,{sentAt:i,cooldownMs:n}),{ok:true}))}sweepExpired(e){if(!(this.sentByName.size<64))for(let[n,i]of this.sentByName)e-i.sentAt>=i.cooldownMs&&this.sentByName.delete(n);}};var Nw=/^[a-z][a-z0-9_]{0,63}$/,Lw=/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,Ex=new Set(["confirm_action","cancel_action"]),Dw=16,Bw=8,Uw=300,Fw=120,Vw=20,Mx=1e3,Tx=250,co={unavailable:"that action is not available right now",invalidArgs:"the details did not match what that action needs",failed:"the action failed",timedOut:"it took too long"},Cx=new Set(["string","email","phone","date","datetime","number","boolean","enum"]),Hw="[]",yd=class{constructor(e){this.transport=e;this.actions=new Map;this.lastSent=Hw;this.syncTimer=null;}get size(){return this.actions.size}get(e){return this.actions.get(e)}register(e){let n=xx(e);if(n)return {ok:false,message:`registerAction(): ${n}`};if(!this.actions.has(e.name)&&this.actions.size>=Dw)return {ok:false,message:`registerAction(): at most ${Dw} actions at once \u2014 "${e.name}" was not added`};let i={declaration:Rx(e),handler:e.handler,...e.check&&{check:e.check}};return this.actions.set(e.name,i),this.scheduleSync(),{ok:true,unregister:()=>{this.actions.get(e.name)===i&&(this.actions.delete(e.name),this.scheduleSync());}}}declarations(){return [...this.actions.values()].map(e=>e.declaration).sort((e,n)=>e.name<n.name?-1:e.name>n.name?1:0)}syncNow(){if(this.clearSyncTimer(),!this.transport.canDeclare())return;let e=this.declarations(),n=JSON.stringify(e);n!==this.lastSent&&this.transport.send(e)&&(this.lastSent=n);}resetSession(){this.clearSyncTimer(),this.lastSent=Hw;}scheduleSync(){this.clearSyncTimer(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.syncNow();},Tx);}clearSyncTimer(){this.syncTimer!==null&&(clearTimeout(this.syncTimer),this.syncTimer=null);}},Rx=t=>{let e={};for(let[i,r]of Object.entries(t.params??{}))e[i]={type:r.type,...r.description!==void 0&&{description:r.description},...r.required!==void 0&&{required:r.required},...r.type==="enum"&&{values:[...r.values??[]]},...r.check===true&&{check:true}};let n=t.ui&&{...t.ui.inputs!==void 0&&{inputs:t.ui.inputs==="*"?"*":[...t.ui.inputs]},...t.ui.review!==void 0&&{review:t.ui.review}};return {name:t.name,description:t.description.trim(),params:e,...t.kind==="lookup"&&{kind:"lookup"},...t.undoable===true&&{undoable:true},...n&&{ui:n}}},Ea=t=>!!t&&typeof t=="object"&&!Array.isArray(t),xx=t=>{if(!Ea(t))return "the action must be an object";let{name:e,description:n,params:i,handler:r}=t;if(typeof e!="string"||!Nw.test(e))return `name must match ${Nw} \u2014 got "${String(e)}"`;if(Ex.has(e))return `"${e}" is reserved`;if(typeof n!="string"||!n.trim())return `"${e}" needs a description`;if(n.length>Uw)return `"${e}" description is too long (max ${Uw} chars)`;if(typeof r!="function")return `"${e}" needs a handler`;let a=kx(t);if(a)return `"${e}" ${a}`;if(i===void 0)return null;if(!Ea(i))return `"${e}" params must be an object`;let s=Object.entries(i);if(s.length>Bw)return `"${e}" has too many params (max ${Bw})`;for(let[u,d]of s){let g=Ox(u,d);if(g)return `"${e}" param "${u}": ${g}`}return null},kx=t=>{let{kind:e,ui:n,check:i,undoable:r}=t,a=Ea(t.params)?t.params:{};if(e!==void 0&&e!=="action"&&e!=="lookup")return `kind must be "action" or "lookup" \u2014 got "${String(e)}"`;if(r!==void 0&&typeof r!="boolean")return "undoable must be a boolean";if(e==="lookup"&&r)return "is a lookup, which changes nothing to undo";let s=Object.values(a).some(g=>Ea(g)&&g.check===true);if(e==="lookup"&&(s||i!==void 0))return "is a lookup, which cannot check values";if(s&&typeof i!="function")return "marks a param check: true but has no check function";if(i!==void 0&&typeof i!="function")return "check must be a function";if(n===void 0)return null;if(!Ea(n))return "ui must be an object";if(n.review!==void 0&&typeof n.review!="boolean")return "ui.review must be a boolean";if(e==="lookup"&&n.review)return "is a lookup, which has no review";let{inputs:u}=n;if(u===void 0||u==="*")return null;if(!Array.isArray(u))return 'ui.inputs must be "*" or a list of params';let d=u.find(g=>!(String(g)in a));return d===void 0?null:`ui.inputs names "${String(d)}", which is not a param`},Ox=(t,e)=>{if(!Lw.test(t))return `name must match ${Lw}`;if(!Ea(e))return "must be an object";if(!Cx.has(e.type))return `unknown type "${String(e.type)}"`;if(e.description!==void 0&&(typeof e.description!="string"||e.description.length>Fw))return `description must be a string of at most ${Fw} chars`;if(e.required!==void 0&&typeof e.required!="boolean")return "required must be a boolean";if(e.check!==void 0&&typeof e.check!="boolean")return "check must be a boolean";if(e.type!=="enum")return null;let n=e.values;return Array.isArray(n)&&n.length>0&&n.length<=Vw&&n.every(r=>typeof r=="string"&&r.trim())?null:`an enum needs 1\u2013${Vw} non-empty string values`},Ix=/^\d{4}-\d{2}-\d{2}$/,Px=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/,Cv=(t,e)=>{switch(t.type){case "string":case "email":case "phone":return typeof e=="string";case "date":return typeof e=="string"&&Ix.test(e);case "datetime":return typeof e=="string"&&Px.test(e);case "number":return typeof e=="number"&&Number.isFinite(e);case "boolean":return typeof e=="boolean";case "enum":return typeof e=="string"&&!!t.values?.includes(e)}},Gw=(t,e)=>{if(e!==void 0&&!Ea(e))return null;let n=e??{},i={};for(let[r,a]of Object.entries(t.params)){let s=n[r];if(s==null||s===""){if(a.required!==false)return null;continue}if(!Cv(a,s))return null;i[r]=s;}return i},zw=t=>String(t).slice(0,Mx),Ww=t=>Ea(t)?t.ok===true?t.result===void 0||t.result===null?{ok:true}:{ok:true,result:zw(t.result)}:t.ok===false?{ok:false,error:(t.error===void 0||t.error===null?"":zw(t.error).trim())||co.failed}:null:null;var _d=2500,Nx=200,Lx=5,gu=t=>!!t&&typeof t=="object"&&!Array.isArray(t),jw=t=>{if(!gu(t))return null;let{actionId:e,revision:n,name:i,stage:r,args:a,missing:s,awaiting:u,outcome:d}=t;return typeof e!="string"||!e||typeof n!="number"||!Number.isFinite(n)||typeof i!="string"||typeof r!="string"?null:{actionId:e,revision:n,name:i,stage:r,args:gu(a)?{...a}:{},missing:Array.isArray(s)?s.filter(g=>typeof g=="string"):[],awaiting:gu(u)&&typeof u.kind=="string"?{...u}:null,...gu(d)&&typeof d.ok=="boolean"&&{outcome:{ok:d.ok,message:typeof d.message=="string"?d.message:""}}}},Dx=new Set(["done","cancelled","expired"]),bd=class{constructor(){this.current=null;}get flow(){return this.current}apply(e){let n=this.current;return n&&n.actionId===e.actionId&&e.revision<=n.revision?false:(this.current=e,true)}get isLive(){return !!this.current&&!Dx.has(this.current.stage)}clear(){this.current=null;}},Yw=(t,e)=>{let n={};for(let[i,r]of Object.entries(e)){let a=t.params[i];if(!a)return {ok:false,message:`"${t.name}" has no param "${i}"`};if(!Cv(a,r))return {ok:false,message:`"${t.name}" param "${i}" must be a ${a.type}`};n[i]=r;}return Object.keys(n).length?{ok:true,args:n}:{ok:false,message:"input needs at least one value"}},qw=async(t,e,n,i)=>{if(!t)return {ok:true,unverified:true};let r,a=Promise.resolve().then(()=>t(e,n,i)).then(Bx,()=>null),s=new Promise(d=>{r=setTimeout(()=>d(null),_d);}),u=await Promise.race([a,s]);return clearTimeout(r),u??{ok:true,unverified:true}},Bx=t=>{if(!gu(t)||typeof t.ok!="boolean")return null;if(t.ok)return t.value===void 0?{ok:true}:{ok:true,value:t.value};let e=typeof t.reason=="string"?t.reason.slice(0,Nx):void 0,n=Array.isArray(t.suggestions)?t.suggestions.slice(0,Lx):void 0,i=typeof t.param=="string"&&t.param?t.param:void 0;return {ok:false,...e&&{reason:e},...n?.length&&{suggestions:n},...i&&{param:i}}};var Ps=t=>{let e=t.cause?.name;return typeof e=="string"&&e!==""&&e!=="Error"?e:null};var Xw=t=>`Initialization Failed: ${t.code} (${Ps(t)??t.message})`.slice(0,123);var Ux=50,Fx=4e3,Sd=class{constructor(e,n=Ux){this.onChange=e;this.entries=[];this.activeUserEntryId=null;this.lastFinalText="";this.lastFinalAt=0;this.activeAvatarEntryId=null;this.activeAvatarJobId=null;this.entryCounter=0;this.consumedChunks=0;this.openChars=[];this.openStarts=[];this.openEnds=[];this.maxEntries=Math.max(1,n);}applyUserTranscript({text:e,isFinal:n,turnId:i}){let r=e?.trim()??"";if(!r)return;let a=this.findEntry(this.activeUserEntryId);if(a&&a.turnId!==i&&(this.upsert({...a,isFinal:true}),a=null),a&&a.text===r&&a.isFinal===n||!a&&r===this.lastFinalText&&Date.now()-this.lastFinalAt<Fx)return;let s={id:a?.id??this.nextId("user"),speaker:"user",text:r,words:bv(r),isFinal:n,turnId:i,createdAt:a?.createdAt??Date.now()};this.upsert(s),this.activeUserEntryId=n?null:s.id,n&&(this.lastFinalText=r,this.lastFinalAt=Date.now()),this.emit();}applyAvatarSpeech(e){let n=e.alignments??[],i=e.chunkOffset??0,r=i+n.length;if(this.activeAvatarJobId!==e.jobId&&(this.finalizeAvatar(),this.activeAvatarJobId=e.jobId,this.consumedChunks=0),r<=this.consumedChunks)return;this.activeAvatarEntryId||(this.activeAvatarEntryId=this.nextId("avatar"),this.openChars=[],this.openStarts=[],this.openEnds=[]);for(let d=Math.max(0,this.consumedChunks-i);d<n.length;d++){let g=e.displayAlignments?.[d]??n[d];g?.characters?.length&&(this.openChars.push(...g.characters),this.openStarts.push(...g.character_start_times_seconds),this.openEnds.push(...g.character_end_times_seconds));}if(this.consumedChunks=r,!this.openChars.length)return;let a={characters:this.openChars,character_start_times_seconds:this.openStarts,character_end_times_seconds:this.openEnds},s=pu(a);if(!s)return;let u=this.findEntry(this.activeAvatarEntryId);u?.text!==s&&(this.upsert({id:this.activeAvatarEntryId,speaker:"avatar",text:s,words:mu(a),isFinal:false,turnId:e.turnId,createdAt:u?.createdAt??Date.now()}),this.emit());}finalizeAvatar(){let e=this.findEntry(this.activeAvatarEntryId);this.activeAvatarEntryId=null,this.openChars=[],this.openStarts=[],this.openEnds=[],!(!e||e.isFinal)&&(this.upsert({...e,isFinal:true}),this.emit());}reset(){let e=this.entries.length>0;this.entries=[],this.activeUserEntryId=null,this.lastFinalText="",this.lastFinalAt=0,this.activeAvatarEntryId=null,this.activeAvatarJobId=null,this.consumedChunks=0,this.openChars=[],this.openStarts=[],this.openEnds=[],e&&this.emit();}getEntries(){return [...this.entries]}upsert(e){let n=this.entries.findIndex(i=>i.id===e.id);if(n>=0){this.entries[n]=e;return}this.entries.push(e),this.entries.length>this.maxEntries&&this.entries.splice(0,this.entries.length-this.maxEntries);}findEntry(e){return e?this.entries.find(n=>n.id===e)??null:null}nextId(e){return `${e}-${++this.entryCounter}`}emit(){this.onChange(this.getEntries());}};var wd=class{constructor(e){this.deps=e;this.held=false;this.open=false;this.preRollToFlush=[];this.recentFrames=[];this.tailTimer=null;this.maxHoldTimer=null;this.silenceByteSize=new Map;}isHeld(){return this.held}isTurnOpen(){return this.open}press(){if(this.held)return false;this.held=true;let e=this.open;return this.clearTailTimer(),this.open=true,e||(this.preRollToFlush=this.recentFrames.map(n=>n.buffer),this.recentFrames=[]),this.maxHoldTimer=setTimeout(()=>{this.maxHoldTimer=null,R.warn("PushToTalk","hold hit its ceiling \u2014 releasing"),this.release();},ow),R.event("ptt","press",{isContinuation:e,preRollFrames:this.preRollToFlush.length}),this.deps.onHeldChange(true),e||this.deps.onTurnStart(),!e}release(){this.held&&(this.held=false,this.clearMaxHoldTimer(),R.event("ptt","release"),this.deps.onHeldChange(false),this.tailTimer=setTimeout(()=>{this.tailTimer=null,this.closeTurn();},aw));}gate(e){if(!this.open)return this.rememberFrame(e),[this.silenceOfSize(e.byteLength)];if(!this.preRollToFlush.length)return [e];let n=this.preRollToFlush;return this.preRollToFlush=[],n.push(e),n}reset(){this.held=false,this.open=false,this.preRollToFlush=[],this.recentFrames=[],this.clearTailTimer(),this.clearMaxHoldTimer();}closeTurn(){this.open&&(this.open=false,this.preRollToFlush=[],this.deps.onTurnEnd());}rememberFrame(e){let n=Date.now();for(this.recentFrames.push({capturedAt:n,buffer:e.slice(0)});this.recentFrames.length&&n-this.recentFrames[0].capturedAt>rw;)this.recentFrames.shift();}silenceOfSize(e){let n=this.silenceByteSize.get(e);return n||(n=new ArrayBuffer(e),this.silenceByteSize.size>8&&this.silenceByteSize.clear(),this.silenceByteSize.set(e,n)),n}clearTailTimer(){this.tailTimer&&(clearTimeout(this.tailTimer),this.tailTimer=null);}clearMaxHoldTimer(){this.maxHoldTimer&&(clearTimeout(this.maxHoldTimer),this.maxHoldTimer=null);}};var Qw="server_tick";var Ed=class{constructor(){this.wedge=[];}note(e,n){if(typeof e!="number"||!Number.isFinite(e))return null;let i=n-e;for(;this.wedge.length>0&&this.wedge[this.wedge.length-1].offset>=i;)this.wedge.pop();for(this.wedge.push({offset:i,at:n});this.wedge.length>0&&n-this.wedge[0].at>6e4;)this.wedge.shift();let r=i-this.wedge[0].offset;return r<25?0:r}minOffset(){return this.wedge.length>0?this.wedge[0].offset:null}hasSamples(){return this.wedge.length>0}reset(){this.wedge=[];}};var Md=class{constructor(e){this.opts=e;this.timer=null;this.lastProbeAt=0;this.lastMessageAt=0;this.loopLagPeak=0;this.ticksSeen=false;this.suspended=false;this.degraded=false;this.degradedAt=0;this.cleanSince=null;this.lastSeq=null;this.seqAtGap=null;this.resumeAt=null;this.resumeSeqJump=null;this.resumeCount=0;}begin(e=Date.now()){this.lastProbeAt=e,this.lastMessageAt=e;}start(e=Date.now()){this.timer||(this.begin(e),this.timer=setInterval(()=>this.tick(Date.now()),100));}stop(){this.timer&&clearInterval(this.timer),this.timer=null;}noteMessage(e,n,i=false){let r=this.expired(n)||this.degraded;this.lastMessageAt=n,this.loopLagPeak=0,this.suspended=false,i&&(this.ticksSeen=true);let a=typeof e=="number"&&Number.isFinite(e)?e:null;r&&this.resumeAt===null&&(this.resumeAt=n,this.seqAtGap=this.lastSeq),this.resumeAt!==null&&n-this.resumeAt<=300&&(this.resumeCount++,a!==null&&this.seqAtGap!==null&&(this.resumeSeqJump=a-this.seqAtGap)),a!==null&&(this.lastSeq=a),this.degraded&&this.cleanSince===null&&(this.cleanSince=n);}reset(){this.stop(),this.lastMessageAt=0,this.loopLagPeak=0,this.ticksSeen=false,this.suspended=false,this.degraded=false,this.degradedAt=0,this.cleanSince=null,this.lastSeq=null,this.seqAtGap=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}tick(e){let n=Math.max(0,e-this.lastProbeAt-100);if(this.lastProbeAt=e,n>this.loopLagPeak&&(this.loopLagPeak=n),this.degraded){this.evaluateRecovery(e);return}let i=this.currentGap(e);i!==null&&(this.degraded=true,this.degradedAt=e,this.cleanSince=null,this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0,this.opts.onVerdict({state:"degraded",scope:this.loopLagPeak>=this.opts.loopLagHighMs?"device":"network",gapMs:i,loopLagMs:this.loopLagPeak}));}currentGap(e,n=1e3){if(!this.ticksSeen||this.suspended)return null;let i=e-this.lastMessageAt;return i>=n?i:null}evaluateRecovery(e){if(e-this.degradedAt>6e4){this.suspended=true,this.clear(e);return}if(this.currentGap(e,700)!==null){this.cleanSince=null;return}this.cleanSince!==null&&e-this.cleanSince>=2500&&this.clear(e);}clear(e){this.degraded=false,this.cleanSince=null;let n=this.resumeCount>=4&&this.resumeSeqJump!==null?this.resumeSeqJump:void 0;this.opts.onVerdict({state:"ok",scope:"network",gapMs:e-this.degradedAt,...n!==void 0&&{seqJump:n}}),this.resumeAt=null,this.resumeSeqJump=null,this.resumeCount=0;}expired(e){return this.currentGap(e)!==null}};var vu=class{constructor(){this.listeners={};}on(e,n){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(n),()=>{this.listeners[e].delete(n);}}emit(e,...n){let i=this.listeners[e];if(i)for(let r of i)r(...n);}hasListeners(e){return (this.listeners[e]?.size??0)>0}removeAll(){for(let e in this.listeners)this.listeners[e]?.clear();}};var Zw=t=>{let e=[];return t.fieldType&&e.push(t.fieldType),t.filled!==void 0&&e.push(t.filled?"filled":"empty"),t.checked!==void 0&&e.push(t.checked?"checked":"not checked"),t.shows&&e.push(`shows "${t.shows}"`),t.choiceOf&&e.push(`choice in ${t.choiceOf}`),t.options?.length&&e.push(`one of: ${t.options.join(" | ")}`),t.submits&&e.push("submits form"),t.count&&e.push(`${t.count} identical`),t.disabled&&e.push("disabled"),t.sensitive&&e.push("never fillable"),t.path&&e.push(t.path),t.site&&e.push(t.site),t.current&&e.push("this page"),t.children&&e.push(`contains ${t.children.join(" ")}`),e},Jw=t=>t.length>0?` [${t.join(", ")}]`:"",Xx=(t,e)=>{let n=e.filter(r=>r.item?.screenPosition).length,i=[`list${t.id} "${t.name}" \u2014 ${t.total} items, ${n} on screen`];for(let r of e){let a=r.item,s=Zw(r);a.screenPosition&&s.unshift(`on screen #${a.screenPosition}`);let u=a.detail?` \u2014 ${a.detail}`:"";i.push(` ${a.position}. ${r.handle} ${r.kind} "${r.name}"${u}${Jw(s)}`);}return i};function Rv(t){let e=[`On the ${t.pageName} page \u2014 ${t.url} \u2014 "${t.title}"`],n=a=>`${a.handle} ${a.kind} "${a.name}"${Jw(Zw(a))}`,i=t.lists??[];if(i.length===0){for(let a of t.nodes)e.push(n(a));return e.join(`
17
+ `)}let r=t.nodes.filter(a=>!a.item);for(let a of r)a.kind!=="link"&&e.push(n(a));for(let a of i){let s=t.nodes.filter(u=>u.item?.list===a.id).sort((u,d)=>u.item.position-d.item.position);s.length>0&&e.push(...Xx(a,s));}for(let a of r)a.kind==="link"&&e.push(n(a));return e.join(`
18
+ `)}function $w(t){return t.nodes.map(e=>({h:e.handle,n:e.name,...e.kind==="field"&&e.fieldType&&{t:e.fieldType},...e.sensitive&&{sensitive:true},...e.submits&&{submit:true},...e.item&&{card:{list:e.item.list,position:e.item.position,...e.item.screenPosition&&{screen:e.item.screenPosition},...e.item.detail&&{detail:e.item.detail}}}}))}var e1=t=>{let e=t?.fields;if(!Array.isArray(e))return [];let n=new Map;for(let i of e){if(n.size>=12)break;let{h:r,v:a}=i??{};typeof r!="string"||typeof a!="string"||n.set(r,a.slice(0,2e3));}return [...n].map(([i,r])=>({handle:i,value:r}))},Qx={stale:"the page changed since it was read",unknown_target:"it is not on this page",not_fillable:"it is not a box the avatar can type into",sensitive:"passwords and payment details are only theirs to type",disabled:"it is disabled right now",read_only:"it is read-only",no_such_option:"none of its choices matches",rejected:"the page would not take that value",invalid:"the site says that value is not valid"},t1=t=>{let e=t.filter(r=>r.outcome!=="ok");if(e.length===0)return;let n=t.filter(r=>r.outcome==="ok").map(r=>`"${r.name}"`),i=e.map(r=>{let a=Qx[r.outcome];return `"${r.name}" (${a}${r.detail?`: ${r.detail}`:""})`});return [n.length>0?`filled ${n.join(", ")}`:"",`could not fill ${i.join(", ")}`].filter(Boolean).join("; ")},n1={stale:"the page has changed since it was read",unknown_target:"that button is not on this page",not_a_submit:"that button does not send a form",disabled:"that button is disabled right now",invalid:"the form is not complete yet",requires_reload:"sending this form would open a new page and end this call, so they need to press it themselves"};var Ma={camera:true,screen:false,micMute:true,endCall:true,actions:false,mood:false,page:{read:false,scroll:false,navigate:false,click:false,fill:false,submit:false}},Di=(t,e)=>typeof t=="boolean"?t:e,i1=t=>{if(!t||typeof t!="object")return Ma;let e=t,n=e.page&&typeof e.page=="object"?e.page:{},i=Di(n.read,Ma.page.read),r=i&&Di(n.click,false);return {camera:Di(e.camera,Ma.camera),screen:Di(e.screen,Ma.screen),micMute:Di(e.micMute,Ma.micMute),endCall:Di(e.endCall,Ma.endCall),actions:Di(e.actions,Ma.actions),mood:Di(e.mood,Ma.mood),page:{read:i,scroll:i&&Di(n.scroll,false),navigate:i&&Di(n.navigate,false),click:r,fill:i&&Di(n.fill,false),submit:r}}};var Kx=/^([xy])=([+-]?)(\d{1,5})(%?)$/;var Zx=t=>{let e=Kx.exec(t);if(!e)return null;let[,n,i,r,a]=e,s=Number(r);return !a&&s>2e4||a&&s>100?null:{axis:n,move:{value:i==="-"?-s:s,percent:a==="%",relative:i!==""}}},Au=t=>{let e=t.split(",");if(e.length>2)return null;let n={};for(let i of e){let r=Zx(i.trim());if(!r||n[r.axis])return null;n[r.axis]=r.move;}return n.x||n.y?n:null};var Jx=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),$x=/^bounce(?:=(.+))?$/,ek=new Set(["forever","loop","infinite"]),tk=5,nk=t=>{if(t===void 0)return 1;if(ek.has(t))return "forever";if(!/^\d{1,3}$/.test(t))return null;let e=Number(t);return e<1?null:Math.min(e,tk)},yu=t=>{let e=t.trim().toLowerCase();if(!e)return null;if(Jx.has(e))return {kind:"spot",spot:e};if(e==="expand")return {kind:"stage",open:true};if(e==="collapse")return {kind:"stage",open:false};if(e==="stop"||e==="still")return {kind:"effect",effect:"stop"};let n=$x.exec(e);if(n){let r=nk(n[1]);return r===null?null:{kind:"effect",effect:"bounce",times:r}}let i=Au(e);return i?{kind:"move",...i}:null};var ik=new Set(["search","open","new_tab","switch","close","reload"]),rk=new Set(["search","open","switch"]);function r1(t){if(typeof t!="string")return null;let e=t.indexOf("="),n=(e<0?t:t.slice(0,e)).trim(),i=e<0?"":t.slice(e+1).trim();return !ik.has(n)||rk.has(n)&&!i?null:i?{action:n,target:i}:{action:n}}var uk=new Set(["CONNECTION_FAILED","SERVER_ERROR","SESSION_TOKEN_FETCH_FAILED"]),a1=1e3,o1=1e3,ck=50,fk=600,dk={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that place is not on this page"},hk={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that link is not on this page",not_navigable:"that is not a link on this site",requires_reload:"opening that page would end this call",already_here:"they are already on that page",no_history:"there is nowhere in this call's history to go"},pk={ok:void 0,stale:"the page has changed since it was read",unknown_target:"that is not on this page",not_clickable:"that is not a button or field the avatar can press",submits_form:"that button submits a form, which needs a confirmed action",requires_reload:"pressing that would open a new page and end this call",disabled:"that is disabled right now"},mk=400,gk=[300,1e3,2500],vk=3e3,Ak="the page could not be reached",yk={ok:void 0,not_found:"no open tab matches that",blocked:"that is not a web address it can open",failed:"the browser refused"},bk=1e3,s1=12e3,xv=()=>{},_k=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}catch{return}},bu=t=>typeof t?.arg=="string"?t.arg:"",Sk=t=>t?.arg==="tab"||t?.arg==="window"||t?.arg==="screen"?t.arg:null,_u=t=>typeof t?.generation=="number"?t.generation:void 0,Su=class extends Error{constructor(n){super("Failed to fetch session token");this.reason=n;this.name="SessionTokenError";}},wu=class{constructor(e,n){this.sessionPhase="idle";this.paintPhase="none";this.turnPhase="idle";this.playful={last:null,busyUntilMs:0};this.sessionId=0;this.turnId=0;this.isConnected=false;this.lifecycle=0;this.userStoppedAt=null;this.speakReportedForStop=false;this.deliveryLagMs=null;this.firstAudioAt=null;this.firstAudioLagMs=null;this.transit=new Ed;this.reconnectAttempt=0;this.hasBeenLive=false;this.reconnectTimer=null;this.intentionalClose=false;this.serverInitiatedReason=null;this.lastEmittedError=null;this.noticeReceived=false;this.noticeOnly=false;this.visualState="normal";this.micMuted=false;this.speakerMuted=false;this.pushToTalk=null;this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"};this.downlinkScope="network";this.downlinkVerdict=null;this.netStatusLastSentAt=0;this.netStatusTimer=null;this.moodDetectionOn=false;this.moodLatest=null;this.moodLastSentKey=null;this.moodLastSentAt=0;this.moodTimer=null;this.appEvents=new Ad;this.actions=new yd({canDeclare:()=>this.canDeclareActions(),send:e=>this.sendActionsSet(e)});this.actionCallsSeen=new Set;this.actionFlows=new bd;this.actionsGrantWarned=false;this.actionRereadTimer=null;this.jobQueue=[];this.processing=false;this.turnOpen=false;this.scriptTail={jobId:-1,upto:0,text:""};this.activeStream=null;this.ws=null;this.micStream=null;this.micStartedAt=null;this.agcEnabled=true;this.agcRestoreTimer=null;this.events=new vu;this.transcript=null;this.greetingText="";this.greetingLanguage="en";this.greetingKey="";this.greetingEntry=null;this.greetingDecided=false;this.greetingDecisionTimer=null;this.greetingAwaitingPlayback=false;this.greetingDelayTimer=null;this.greetingAwaitingPaint=null;this.greetingPaintTimer=null;this.greetingAwaitingMic=null;this.greetingMicTimer=null;this.micPipelineSettled=false;this.talkingArmed=false;this.playerLeadInTimer=null;this.connectTonePlaying=false;this.connectToneTimer=null;this.connectToneStartedAt=null;this.tonePainted=false;this.toneSessionLive=false;this.greetingPlayed=false;this.skipGreetingOnce=false;this.greetedThisSession=false;this.jobCounter=0;this.riveReady=false;this.avatarConfig=null;this.serverReady=false;this.voiceSettings=null;this.watermark=false;this.lipSyncTuning=new Pr;this.rivSrc=null;this.pendingRivBytes=null;this.pendingSession=false;this.pendingContext=[];this.lastContextSnapshot=null;this.firstPage=null;this.pageGeneration=0;this.lastPageContext=null;this.pageReadThisUtterance=false;this.pageWork=Promise.resolve();this.pageSession=0;this.heardSpeech=null;this.pendingTours=new Map;this.tourRequestSeq=0;this.sessionCapabilities=null;this.initAckPromise=null;this.initAckResolve=null;this.initAckReject=null;this.loadInFlight=null;this.startInvoked=false;this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null};this.firstChunkPending=true;this.responseSlow=false;this.heldResumeToken=null;this.stopCount=0;this.mountSurface="inline";this.load=()=>this.serverReady?Promise.resolve():this.loadInFlight?this.loadInFlight:(this.loadInFlight=this.runLoad().finally(()=>{this.loadInFlight=null;}),this.loadInFlight);this.runLoad=async()=>{let e=this.lifecycle;this.setPaintPhase("loading");try{if(this.mode==="player")await this.paintFromCache(e)?this.revalidatePaint(e):await this.fetchRenderConfig(e);else {let n=await this.paintFromCache(e);this.mode==="call"&&!this.startInvoked&&(n?await this.revalidatePaint(e):await this.fetchRenderConfig(e));}}catch(n){if(this.stale(e))return;R.error("Runtime","Avatar load failed",n),this.setPaintPhase("failed");let i=n instanceof Su;this.emitError(i?"SESSION_TOKEN_FETCH_FAILED":"AVATAR_LOAD_FAILED",i?"Failed to fetch session token":"Failed to load avatar","sdk",{cause:i?n.reason:n});return}this.stale(e)||this.mode!=="call"&&this.start();};this.start=async()=>{let e=this.lifecycle,n=this.stopCount;if(this.cancelReconnect(),this.startInvoked=true,this.lastEmittedError=null,this.startConnectTone(),this.mode!=="player"&&this.setSessionPhase("connecting"),await this.load(),!this.stale(e)){if(this.paintPhase==="failed"){this.setSessionPhase("idle");return}if(this.mode==="player"){this.setSessionPhase("active");return}try{(!this.ws||this.ws.readyState===WebSocket.CLOSED)&&await this.openWebSocket();let i=this.ws;if(this.staleSocket(e,i)||(this.initAckPromise&&(R.debug("Runtime","Waiting for server to acknowledge init..."),await this.initAckPromise),this.staleSocket(e,i))||this.noticeOnly)return;this.ws?.send(JSON.stringify({type:"start"}));}catch(i){if(this.stopCount!==n&&!this.lastEmittedError||(!this.stale(e)&&this.paintPhase!=="painted"&&this.setPaintPhase("failed"),this.lastEmittedError))return;if(i instanceof Su){this.emitError("SESSION_TOKEN_FETCH_FAILED","Failed to fetch session token","sdk",{cause:i.reason});return}this.emitError("UNKNOWN","Unexpected runtime error","sdk",{cause:i});}}};this.paintFromCache=async e=>{let[n,i]=await Promise.all([this.cache.getCachedRiv(this.avatarId),this.cache.getCachedAvatarConfig(this.avatarId)]);if(this.stale(e))return false;if(this.cachedConfigVersion=i?.configVersion,this.cachedRivVersion=n?.rivVersion,n&&i){let r=await this.urlResolver.bytesToSrc(n.bytes);return this.stale(e)?(this.urlResolver.revokeSrc(r),false):(this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig={...i,rive:{...i.rive,src:r}},this.pendingRivBytes=n.bytes,this.serverReady=true,this.onRivReady(),true)}return n&&(this.pendingRivBytes=n.bytes),false};this.resolveSessionToken=async()=>{try{let e=await this.getSessionToken();if(!e)throw new Error("getSessionToken() returned an empty token");return e}catch(e){throw new Su(e)}};this.fetchRenderConfig=async e=>{let n={"Content-Type":"application/json"},i={avatarId:this.avatarId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin},needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion}},r="";this.deployId?r=this.deployId:this.getSessionToken?r=await this.resolveSessionToken():this.apiKey&&(r=this.apiKey),n.Authorization=`Bearer ${r}`;let a=await fetch(`${this.httpUrl}/v1/avatar/config`,{method:"POST",headers:n,body:JSON.stringify(i)});if(!a.ok)throw new Error(`config route HTTP ${a.status}`);let s=await a.json();if(this.serverReady)return this.repaintFromPayload(s,e);let u=s.rivUrl?await this.fetchRivBytes(s.rivUrl):this.pendingRivBytes;if(!u)throw new Error("config response had no rivUrl and no cache");await this.applyRenderPayload(s,u,e);};this.paintForNotice=async()=>{let e=this.lifecycle;try{R.info("Runtime","notice with nothing painted \u2014 resolving config"),await this.fetchRenderConfig(e);}catch(n){if(this.stale(e))return;R.error("Runtime","Notice paint failed \u2014 notice will be silent",n),this.setPaintPhase("failed");}};this.revalidatePaint=async e=>{try{await this.fetchRenderConfig(e);}catch(n){R.warn("Runtime","Revalidation failed \u2014 keeping the cached paint",n);}};this.repaintFromPayload=async(e,n)=>{let i=e.rivUrl?await this.fetchRivBytes(e.rivUrl):null;if(e.rivUrl&&!i&&R.warn("Rive","New rig failed to download \u2014 keeping the painted one"),i)return this.applyRenderPayload(e,i,n);if(this.stale(n))return;let r=e.watermark===true!==this.watermark;this.watermark=e.watermark===true;let a=e.configVersion!==void 0&&e.configVersion!==this.avatarConfig?.configVersion,s=JSON.stringify(hd(e.performance)??null)!==JSON.stringify(this.avatarConfig?.performance??null);!a&&!r&&!s||(this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.cachedConfigVersion=e.configVersion,e.rivVersion!==void 0&&(this.cachedRivVersion=e.rivVersion),(a||s)&&e.cacheable!==false&&this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{}),this.onRivReady());};this.applyRenderPayload=async(e,n,i)=>{let r=await this.urlResolver.bytesToSrc(n);if(this.stale(i))return this.urlResolver.revokeSrc(r);this.watermark=e.watermark===true,this.cachedConfigVersion=e.configVersion,this.cachedRivVersion=e.rivVersion,this.rivSrc&&this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=r,this.avatarConfig=this.paintedConfigFrom(e,this.rivSrc),this.serverReady=true,e.cacheable!==false&&(e.rivVersion!==void 0&&this.cache.setCachedRiv(this.avatarId,n,e.rivVersion).catch(()=>{}),this.cache.setCachedAvatarConfig(this.avatarId,this.toCacheableConfig(this.avatarConfig)).catch(()=>{})),this.pendingRivBytes=n,this.onRivReady();};this.setMountSurface=e=>{this.mountSurface=e;};this.getLipSyncTuning=()=>this.lipSyncTuning;this.speakAudio=async e=>{if(this.mode!=="audio"){this.emitError("INVALID_MODE","speakAudio can only be used in audio mode","sdk",{fatal:false});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakAudio() needs a live session \u2014 call start() first","sdk",{fatal:false});return}try{let n;e instanceof Blob?n=await e.arrayBuffer():e instanceof Float32Array?n=e.buffer:n=e;let i=15*1024*1024;if(n.byteLength>i){this.emitError("INVALID_INPUT","Audio payload too large (max 15MB)","sdk",{fatal:!1});return}this.ws?.send(n);}catch(n){this.emitError("UNKNOWN","Failed to process audio payload","sdk",{cause:n,fatal:false});}};this.isPushToTalk=()=>this.turnTaking==="push-to-talk";this.isTalking=()=>this.pushToTalk?.isHeld()??false;this.startTalking=()=>{this.pushToTalk&&this.sessionPhase==="active"&&(this.noticeReceived||this.pushToTalk.press());};this.stopTalking=()=>{this.pushToTalk?.release();};this.setMicMuted=e=>{this.micMuted!==e&&(this.micMuted=e,this.queueClientNetStatus(),this.events.emit("mic-muted",e));};this.setSpeakerMuted=e=>{this.speakerMuted!==e&&(this.speakerMuted=e,this.events.emit("speaker-muted",e));};this.getMicMuted=()=>this.micMuted;this.getSpeakerMuted=()=>this.speakerMuted;this.commandHandlers={stop:e=>{this.cancelSpeech(),this.reportCommandStatus("stop",this.commandTurnId(e),"ok");},request_vision:e=>{this.events.emit("vision-request",this.commandTurnId(e));},flip_camera:e=>{let n=typeof e?.args=="string"?e.args:null,i=n==="front"?"front":n==="back"?"back":"toggle";this.events.emit("camera-flip",i,this.commandTurnId(e));},mute_mic:e=>{if(this.environment==="meeting"){this.reportCommandStatus("mute_mic",this.commandTurnId(e),"unsupported");return}this.setMicMuted(true),this.reportCommandStatus("mute_mic",this.commandTurnId(e),"ok");},unmute_mic:e=>{this.setMicMuted(false),this.reportCommandStatus("unmute_mic",this.commandTurnId(e),"ok");},close_camera:e=>{this.events.emit("camera-close",this.commandTurnId(e));},open_camera:e=>{this.events.emit("camera-open",this.commandTurnId(e));},request_screen:e=>{let n=this.commandTurnId(e);if(!this.capabilities?.screen){this.reportScreenStatus("unavailable",n,{reason:"not granted"});return}if(!this.perception?.screen||!this.events.hasListeners("screen-request")){this.reportScreenStatus("unavailable",n,{reason:"screen sharing is not enabled here"});return}this.events.emit("screen-request",Sk(e),n);},stop_screen:e=>{let n=this.commandTurnId(e);if(!this.events.hasListeners("screen-stop")){this.reportCommandStatus("stop_screen",n,"unsupported");return}this.events.emit("screen-stop",n);},scroll_to:e=>this.runPageCommand("scroll_to",e,n=>n.scroll,async(n,i)=>{let r=await n.scroll(bu(e),_u(e));this.reportCommandStatus("scroll_to",i,r==="ok"?"ok":"failed",dk[r]);}),navigate_to:e=>this.runPageCommand("navigate_to",e,n=>n.navigate,async(n,i)=>{let r=await n.navigate(bu(e),_u(e));this.reportCommandStatus("navigate_to",i,r==="ok"?"ok":"failed",hk[r]);}),click_element:e=>this.runPageCommand("click_element",e,n=>n.click,async(n,i)=>{let r=await n.click(bu(e),_u(e));this.reportCommandStatus("click_element",i,r==="ok"?"ok":"failed",pk[r]),r==="ok"&&this.scheduleReadAfterAction();}),fill_fields:e=>this.runPageCommand("fill_fields",e,n=>n.fill,async(n,i)=>{let r=e1(e);if(r.length===0){this.reportCommandStatus("fill_fields",i,"failed","there was nothing to fill");return}let a=await n.fill(r,_u(e)),s=t1(a);R.event("page","Fields filled",{fields:a.map(u=>`${u.handle}:${u.outcome}`)}),this.reportCommandStatus("fill_fields",i,s?"failed":"ok",s),a.some(u=>u.outcome==="ok")&&this.scheduleReadAfterAction();}),submit_form:e=>this.runPageCommand("submit_form",e,n=>n.submit,async(n,i)=>{let{outcome:r,detail:a}=await n.submit(bu(e),_u(e)),s=r==="ok"?void 0:`${n1[r]}${a?`: ${a}`:""}`;this.reportCommandStatus("submit_form",i,r==="ok"?"ok":"failed",s),r==="ok"&&this.scheduleReadAfterAction();}),widget_control:e=>{let n=this.commandTurnId(e);if(this.mountSurface!=="widget"){this.reportCommandStatus("widget_control",n,"unsupported","the avatar is not in a widget here");return}let i=yu(bu(e));if(!i){this.reportCommandStatus("widget_control",n,"failed","that is not somewhere the avatar can put itself");return}this.events.emit("widget-command",i,n);},browser:e=>{let n=this.commandTurnId(e),i=this.browser;if(!i){this.reportCommandStatus("browser",n,"unsupported","this client cannot drive the browser");return}let r=r1(e?.arg);if(!r){this.reportCommandStatus("browser",n,"failed","that is not a browser command");return}Promise.resolve().then(()=>i.run(r)).catch(a=>(R.warn("Runtime","browser command threw",{error:String(a)}),"failed")).then(a=>this.reportCommandStatus("browser",n,a==="ok"?"ok":"failed",yk[a]));},close_call:e=>{this.reportCommandStatus("close_call",this.commandTurnId(e),"ok"),this.stop({intentionalClose:true,code:4001,reason:"Closed by server command"});}};this.loadCachedGreeting=async()=>{if(!(!this.greeting?.enabled||this.greetingEntry))try{let e=await this.cache.getCachedGreeting(this.greetingKey);if(!e)return;this.greetingEntry=e,this.sentGreetingId=e.greetingId,R.debug("Greeting","Loaded greeting from cache",{greetingId:e.greetingId});}catch{}};this.openWebSocket=async()=>{if(!this.wsUrl)throw new Error("WebSocket URL not resolved");if(this.ws&&this.ws.readyState===WebSocket.OPEN)return;if(!this.pendingRivBytes){let n=await this.cache.getCachedRiv(this.avatarId);this.pendingRivBytes=n?.bytes??null,this.cachedRivVersion=n?.rivVersion;}await this.loadCachedGreeting();let e=this.getSessionToken?await this.resolveSessionToken():void 0;return this.initAckPromise=new Promise((n,i)=>{this.initAckResolve=n,this.initAckReject=i;}),new Promise((n,i)=>{try{let r=new WebSocket(this.wsUrl);this.ws=r,r.binaryType="arraybuffer",r.onopen=()=>{if(this.ws!==r)return;R.event("WebSocket","Connection opened"),this.intentionalClose=!1,this.serverInitiatedReason=null;let a=_k();r.send(JSON.stringify({type:"init",...this.deployId?{deployId:this.deployId,...this.embedHostOrigin&&{hostOrigin:this.embedHostOrigin}}:{avatarId:this.avatarId,...e?{sessionToken:e}:{apiKey:this.apiKey}},...this.onResumeState&&{resumable:!0},...this.resumeKept&&{resume:this.resumeKept},...this.voiceSettings&&{voiceSettings:this.voiceSettings},...this.brain&&{brain:this.brain},...this.languages!==void 0&&{languages:this.languages},...this.perception&&{perception:{...this.perception,...this.readsMood&&{mood:!0}}},...this.greeting?.enabled&&{greeting:{enabled:!0,...this.greetingText&&{message:this.greetingText},language:this.greetingLanguage,...this.sentGreetingId&&{cachedGreetingId:this.sentGreetingId}}},...this.useOwnVoice!==void 0&&{useOwnVoice:this.useOwnVoice},...this.useOwnBrain!==void 0&&{useOwnBrain:this.useOwnBrain},mode:this.mode,turnTaking:this.turnTaking,systemPrompt:this.systemPrompt,needAvatarStream:!this.pendingRivBytes,...this.cachedConfigVersion!==void 0&&{cachedConfigVersion:this.cachedConfigVersion},...this.cachedRivVersion!==void 0&&{cachedRivVersion:this.cachedRivVersion},...this.platform&&{platform:this.platform},...this.browser&&{browser:!0},surface:this.mountSurface,...this.framed!==void 0&&{framed:this.framed},...this.micBlocked()&&{micBlocked:!0},...a&&{timeZone:a}})),n();},r.onmessage=a=>{this.ws===r&&this.handleServerMessage(a);},r.onclose=a=>{if(this.ws!==r){R.debug("WebSocket","Ignoring onclose \u2014 already handled");return}let s=this.intentionalClose,u=this.serverInitiatedReason;if(this.isConnected=!1,this.events.emit("connection-status",!1),u)R.info("WebSocket","Closed following server message",{...u});else if(a.code===KS)R.info("WebSocket","Meeting ended; closed by the server");else if(a.code===ZS)R.info("WebSocket","A newer session took over this meeting");else if(s)R.info("WebSocket","Connection closed gracefully");else {let{code:d,message:g}=this.classifyClose(a);this.emitError(d,g,"network",{cause:a?.reason});}this.ws=null,this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket closed before init acknowledged"),this.stop();},r.onerror=a=>{if(this.ws!==r)return;let s=this.intentionalClose,u=this.serverInitiatedReason;u?R.info("WebSocket","Transport error after server message",{...u}):s?R.info("WebSocket","Transport error during intentional close"):this.emitError("CONNECTION_FAILED","Transport error on the connection to the avatar service","network",{cause:a}),this.ws=null,this.isConnected=!1,this.events.emit("connection-status",!1),this.intentionalClose=!1,this.serverReady=!1,this.rejectInitAck("WebSocket error before init acknowledged"),this.stop(),i(a);};}catch(r){this.emitError("CONNECTION_FAILED","Could not open a connection to the avatar service","network",{cause:r}),i(r);}})};this.onRivReady=async()=>{if(!this.avatarConfig)return;this.setPaintPhase("painted");let e=this.avatarConfig.rive,n=this.voiceSettings?.visimeMs;this.lipSyncTuning.reset(this.avatarConfig.lipSync),this.lipSyncTuning.apply(this.voiceSettings?.lipSync),R.event("Runtime","lip-sync tuning seeded",{configVersion:this.avatarConfig.configVersion,fromConfig:!!this.avatarConfig.lipSync,overridden:!!this.voiceSettings?.lipSync,...this.lipSyncTuning.snapshot()}),this.events.emit("avatar-config",{...this.avatarConfig,rive:{...e,src:this.rivSrc,watermark:this.watermark},lipSync:{...this.avatarConfig.lipSync,...n!==void 0?{visemeMs:n}:{}}}),this.pendingSession&&(this.pendingSession=false,R.info("Runtime","Riv ready \u2014 starting deferred session"),this.startSession());};this.micBlocked=()=>this.mode==="call"&&this.usesDefaultMic&&!cw();this.startMic=async()=>{let e=this.ws;if(this.micBlocked())return this.emitError("MIC_PERMISSION_DENIED","This page does not allow the microphone","sdk"),false;let n;try{n=await this.getMicStreamFn();}catch(i){return this.emitError("MIC_PERMISSION_DENIED","Microphone permission denied","sdk",{cause:i}),false}return this.ws!==e||e?.readyState!==WebSocket.OPEN?(R.warn("Runtime","session closed while awaiting mic \u2014 releasing it"),n.getTracks().forEach(i=>i.stop()),false):(this.micStream=n,this.micPipelineSettled=false,this.micStartedAt=Date.now(),this.agcEnabled=true,this.events.emit("mic-start",this.micStream),true)};this.setAgcForAvatarSpeech=e=>{if(!(!this.micStream||this.environment==="meeting")){if(this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),e){this.applyAgc(false);return}this.agcRestoreTimer=setTimeout(()=>{this.agcRestoreTimer=null,this.applyAgc(true);},fk);}};this.fetchRivBytes=async(e,n=false)=>{try{let i=await fetch(e);if(!i.ok)throw new Error(`HTTP ${i.status}`);return await i.arrayBuffer()}catch(i){return n?(R.error("Rive","Riv fetch failed after retry",{cause:i}),null):(R.warn("Rive","Riv fetch failed \u2014 retrying once",{cause:i}),this.fetchRivBytes(e,true))}};let i=hu(e);if(this.environment=i.environment,this.environment==="meeting"&&(this.lipSyncTuning.maxStepFrames=iw),i.debug&&R.setLogLevel(0),R.debug("Runtime","Initializing with config",i),this.mode=i.mode||"call",this.turnTaking=this.mode==="call"&&i.turnTaking?.mode==="push-to-talk"?"push-to-talk":"auto",this.turnTaking==="push-to-talk"&&(this.pushToTalk=new wd({onTurnStart:()=>this.openUserTurn(),onTurnEnd:()=>this.closeUserTurn(),onHeldChange:r=>this.events.emit("ptt-held",r)})),this.greeting=n.embedResume?.kept?void 0:i.avatar?.greeting,this.connectTone=n.embedResume?.kept?void 0:i.connectTone,this.avatarId=i.avatar?.avatarId||"default",this.systemPrompt=i.avatar?.systemPrompt,this.apiKey=i.apiKey,this.getSessionToken=i.getSessionToken,this.deployId=i.deployId,this.voiceSettings=i.avatar?.voiceSettings||null,!this.apiKey&&!this.getSessionToken&&!this.deployId)throw new Error("AvatarConfig requires apiKey, getSessionToken, or deployId");this.useOwnVoice=i.avatar?.voiceSettings?.useOwnVoice,this.useOwnBrain=i.avatar?.brain?.useOwnBrain,this.brain=i.avatar?.brain,this.languages=i.avatar?.languages,this.perception=i.perception,this.readsMood=this.mode==="call"&&!!i.perception?.camera&&!!n.readsMood,this.wsUrl=jg(),this.httpUrl=Yg(),this.greeting?.enabled&&(this.greetingLanguage=this.greeting.language??"en",this.greetingText=this.greeting.message?vv(this.greeting.message):"",this.greetingKey=Av(this.avatarId,this.greetingLanguage,this.greetingText)),i.transcript?.enabled&&(this.transcript=new Sd(r=>this.events.emit("transcript",r),i.transcript.maxEntries)),this.cache=n.cache,this.urlResolver=n.urlResolver,this.pageSurface=n.pageSurface,this.browser=n.browser,this.pageBeforeLive=n.pageBeforeLive??false,this.reportsMicPipeline=n.reportsMicPipeline??false,this.usesDefaultMic=!n.getMicStream,this.getMicStreamFn=n.getMicStream??(async()=>{let r=await navigator.mediaDevices.getUserMedia({audio:this.environment==="meeting"?tw:{echoCancellation:true,noiseSuppression:true,autoGainControl:false,channelCount:1}});return R.event("mic","settings",{...r.getAudioTracks()[0]?.getSettings()}),r}),this.platform=n.platform,this.framed=n.framed,this.embedHostOrigin=n.embedHostOrigin,this.onResumeState=n.embedResume?.onState,this.resumeKept=n.embedResume?.kept,this.downlinkWatchdog=new Md({loopLagHighMs:this.platform?500:250,onVerdict:r=>this.applyDownlinkVerdict(r)});}paintedConfigFrom(e,n){return {avatarId:e.avatarId,configVersion:e.configVersion,pipelineMode:e.pipelineMode,rive:{...e.rive??{artboard:"",stateMachine:"",layout:{}},src:n},lipSync:e.lipSync,performance:hd(e.performance)??void 0}}toCacheableConfig(e){return {...e,rive:{...e.rive,src:"",watermark:void 0}}}async startSession(){if(this.isConnected||(this.resetHealth(),this.mode==="call"&&!this.noticeOnly&&!await this.startMic()))return;if(this.pageBeforeLive&&this.firstPage){let n=this.pageSession;if(await Promise.race([this.firstPage,new Promise(i=>setTimeout(i,vk))]),n!==this.pageSession)return}if(this.isConnected=true,this.downlinkWatchdog.start(),this.mode==="call"&&!this.noticeOnly&&this.queueClientNetStatus(),this.pushToTalk&&this.sendClientVadStatus(true,"push_to_talk"),this.events.emit("connection-status",true),this.heldResumeToken&&this.onResumeState?.(this.heldResumeToken),this.heldResumeToken=null,this.setSessionPhase("active"),this.reconnectAttempt=0,this.hasBeenLive=true,this.markToneSessionLive(),this.noticeOnly)return;this.actions.syncNow(),this.greetingPlayed=false;let e=this.skipGreetingOnce;if(this.skipGreetingOnce=false,this.greetedThisSession=!!this.greeting?.enabled&&!e,!this.greeting?.enabled||e){this.greetingPlayed=e,this.enterListening();return}if(!this.playGreeting()){if(!this.greetingDecided){this.greetingAwaitingPlayback=true,this.setTurnPhase("greeting"),this.armGreetingBackstop();return}this.enterListening();}}stop(e={intentionalClose:false}){this.stopCount++,e.intentionalClose&&(this.intentionalClose=true,this.cancelReconnect()),this.teardownSession(e.code,e.reason,true),this.setSessionPhase("idle");}scheduleReconnect(e){if(this.environment!=="meeting"||this.reconnectTimer||!uk.has(e.code))return;let n=ew[this.reconnectAttempt];if(n===void 0){R.warn("Runtime","Meeting reconnect attempts exhausted",{attempts:this.reconnectAttempt});return}this.reconnectAttempt++,R.event("session","reconnect_scheduled",{attempt:this.reconnectAttempt,delayMs:n,code:e.code}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.hasBeenLive&&this.skipNextGreeting(),this.start();},n);}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);}setLipSyncTuning(e){this.lipSyncTuning.apply(e);}speakText(e){try{if(this.mode!=="tts"){this.emitError("INVALID_MODE","speakText() is only available in text mode","sdk",{fatal:!1});return}if(!e.trim()){this.emitError("INVALID_INPUT","speakText() needs non-empty text","sdk",{fatal:!1});return}if(e.length>5e3){this.emitError("INVALID_INPUT","Text too long (max 5000 chars)","sdk",{fatal:!1});return}if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","speakText() needs a live session \u2014 call start() first","sdk",{fatal:!1});return}this.ws?.send(JSON.stringify({type:"input",payload:{text:e}}));}catch(n){this.emitError("UNKNOWN","Unexpected error in speakText()","sdk",{cause:n,fatal:false});}}addLiveContext({context:e,update:n}){if(!e||e.trim().length===0){this.emitError("INVALID_INPUT","Context cannot be empty","sdk",{fatal:false});return}if(e.length>2e3){this.emitError("INVALID_INPUT","Context too long (max 2000 chars)","sdk",{fatal:false});return}let i=e.trim();if(!(!n&&i===this.lastContextSnapshot)){if(n||(this.lastContextSnapshot=i),this.ws?.readyState!==WebSocket.OPEN||!this.sessionCapabilities){n||(this.pendingContext=[]),this.pendingContext.push({context:i,update:n}),this.pendingContext.length>16&&this.pendingContext.shift();return}this.sendLiveContext(i,n);}}get capabilities(){return this.sessionCapabilities}pageSendSkipReason(e){return this.mode!=="call"?"wrong_mode":this.ws?.readyState!==WebSocket.OPEN?"no_session":this.capabilities?.page.read?e===this.lastPageContext?"unchanged":null:"not_granted"}skipNextGreeting(){this.skipGreetingOnce=true;}async requestTour(){if(!this.isConnected||!this.ws)return null;let e=await this.readPage();if(!e||e.reason==="not_granted"||e.reason==="wrong_mode"||e.reason==="no_session")return R.warn("Runtime","requestTour(): the page cannot be sent",{reason:e?.reason??"no_page_surface"}),null;let n=`t${++this.tourRequestSeq}`;return new Promise(i=>{let r=s=>{clearTimeout(a),this.pendingTours.delete(n),i(s);},a=setTimeout(()=>r(null),sw);this.pendingTours.set(n,r),this.ws?.send(JSON.stringify({type:"tour_request",requestId:n,greeted:this.greetedThisSession}));})}async sendFirstPage(){if(!this.pageSurface||!this.capabilities?.page.read)return;let e=this.pageSession;for(let n of [...gk,null]){let i=await this.readPage();if(i?.sent||this.pageGeneration>0||e!==this.pageSession||i)return;if(n===null){R.warn("Runtime","The page never answered at call start; waiting for a change");return}if(R.warn("Runtime","First page read reached no page \u2014 retrying",{delayMs:n}),await new Promise(r=>setTimeout(r,n)),e!==this.pageSession)return}}readPage(){let e=this.pageSurface;return e?this.queuePageWork(()=>this.readPageNow(e)):(R.debug("Runtime","readPage(): no page surface on this platform"),Promise.resolve(null))}async readPageNow(e){let n=this.pageSession;try{let i=this.pageGeneration+1,r=await e.read(i);if(!r)return null;let a=Rv(r),s=r.unreadable?`${a} (${r.unreadable})`:a,u=n===this.pageSession?this.pageSendSkipReason(s):"no_session";return u?(await e.retag(this.pageGeneration),r.generation=this.pageGeneration):(this.pageGeneration=i,this.lastPageContext=s,this.ws?.send(JSON.stringify({type:"page_context",context:a,url:r.url,generation:r.generation,handles:$w(r),...r.covered&&{covered:r.covered},...r.unreadable&&{unreadable:r.unreadable}}))),R.event("page","Page read",{generation:r.generation,page:r.pageName,pageNamedBy:r.pageNamedBy,nodes:r.nodes.length,unnamed:Object.values(r.unnamed).reduce((d,g)=>d+g,0),characters:a.length,sent:!u,...u&&{reason:u}}),{index:r,context:a,sent:!u,...u&&{reason:u}}}catch(i){return this.emitError("UNKNOWN","Failed to read the host page","sdk",{cause:i,fatal:false}),null}}queuePageWork(e){let n=this.pageWork.then(e,e);return this.pageWork=n.catch(()=>{}),n}sendLiveContext(e,n){try{this.ws?.send(JSON.stringify({type:"live_context",context:e,update:n}));}catch(i){this.emitError("UNKNOWN","Failed to send live context","sdk",{cause:i,fatal:false});}}flushPendingContext(){if(this.pendingContext.length===0)return;let e=this.pendingContext;this.pendingContext=[];for(let n of e)this.sendLiveContext(n.context,n.update);}notify(e){try{if(this.mode==="player"){this.emitError("INVALID_MODE","notify() needs a session \u2014 player mode never opens a socket","sdk",{fatal:!1});return}let n=this.appEvents.validate(e);if(!n.ok){this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1});return}let i=e.policy??"idle_only";if(!(this.ws?.readyState===WebSocket.OPEN)&&i!=="context_only"){R.event("app","Event dropped",{name:e.name,reason:"no_session"});return}let a=e.cooldownMs??5e3,s=this.appEvents.admit(e.name,a,Date.now());if(!s.ok){R.event("app","Event dropped",{name:e.name,reason:s.reason});return}if(i==="context_only"){this.addLiveContext({context:n.data?`${e.name}: ${n.data}`:e.name,update:!0});return}this.ws?.send(JSON.stringify({type:"app_event",name:e.name,data:n.data,policy:i,say:e.say})),R.event("app","Event sent",{name:e.name,policy:i});}catch(n){this.emitError("UNKNOWN","Unexpected error in notify()","sdk",{cause:n,fatal:false});}}registerAction(e){try{if(this.mode!=="call")return this.emitError("INVALID_MODE","registerAction() needs call mode \u2014 only a call can confirm an action","sdk",{fatal:!1}),xv;let n=this.actions.register(e);return n.ok?n.unregister:(this.emitError("INVALID_INPUT",n.message,"sdk",{fatal:!1}),xv)}catch(n){return this.emitError("UNKNOWN","Unexpected error in registerAction()","sdk",{cause:n,fatal:false}),xv}}canDeclareActions(){if(this.ws?.readyState!==WebSocket.OPEN)return false;let e=this.capabilities;return e?e.actions?true:(this.actions.size>0&&!this.actionsGrantWarned&&(this.actionsGrantWarned=true,R.warn("Runtime","actions not granted for this avatar",{registered:this.actions.size})),false):false}sendActionsSet(e){try{return this.ws?.send(JSON.stringify({type:"actions_set",actions:e})),R.event("action","Actions declared",{names:e.map(n=>n.name)}),!0}catch(n){return R.warn("Runtime","failed to send actions_set",{err:n}),false}}async handleActionRun(e){let n=typeof e?.callId=="string"?e.callId:"",i=typeof e?.name=="string"?e.name:"";if(!n){R.warn("Runtime","action_run without a callId cannot be answered",{name:i});return}if(this.actionCallsSeen.has(n)){R.warn("Runtime","duplicate action_run ignored",{callId:n,name:i});return}this.actionCallsSeen.add(n);let r=this.ws,a=Date.now();R.event("action","Action run",{callId:n,name:i});let s=await this.runAction(n,i,e.args);if(R.event("action","Action result",{callId:n,name:i,ok:s.ok,ms:Date.now()-a}),r===null||r!==this.ws||r.readyState!==WebSocket.OPEN){R.warn("Runtime","action_result not sent: the session ended mid-run",{callId:n,name:i,ok:s.ok});return}try{r.send(JSON.stringify({type:"action_result",callId:n,...s}));}catch(u){R.warn("Runtime","failed to send action_result",{callId:n,err:u});}}async runAction(e,n,i){let r=this.actions.get(n);if(!r)return R.warn("Runtime","action_run for an unregistered action",{name:n}),{ok:false,error:co.unavailable};let a=Gw(r.declaration,i);if(!a)return R.warn("Runtime","action_run args do not match the declaration",{name:n,params:Object.keys(r.declaration.params)}),{ok:false,error:co.invalidArgs};let s=new AbortController,u=Promise.resolve().then(()=>r.handler(a,{callId:e,signal:s.signal})).then(g=>{let v=Ww(g);return v||(R.warn("Runtime","action handler returned no { ok } result",{name:n}),{ok:false,error:co.failed})},g=>(R.error("Runtime","action handler threw",{name:n,err:g}),{ok:false,error:co.failed})),d=new Promise(g=>{let v=setTimeout(()=>{s.abort(),R.warn("Runtime","action handler timed out",{name:n,timeoutMs:s1}),g({ok:false,error:co.timedOut});},s1);u.then(()=>clearTimeout(v));});return Promise.race([u,d])}getActionFlow(){return this.actionFlows.flow}sendActionUi(e,n,i){let r=this.ws;if(!r||r.readyState!==WebSocket.OPEN)return this.emitError("NOT_CONNECTED","sendActionUi() needs a live session","sdk",{fatal:false}),false;let a=this.actionFlows.isLive?this.actionFlows.flow:null,s;if(e==="input"){let u=a?.name??i??"",d=this.actions.get(u),g=d?Yw(d.declaration,n??{}):{ok:false,message:`no registered action "${u}"`};if(!g.ok)return this.emitError("INVALID_INPUT",`sendActionUi(): ${g.message}`,"sdk",{fatal:false}),false;s={type:"action_ui",op:e,...a?{actionId:a.actionId}:{name:u},args:g.args};}else {if(!a)return this.emitError("INVALID_INPUT",`sendActionUi("${e}") needs an action in progress`,"sdk",{fatal:false}),false;s={type:"action_ui",op:e,actionId:a.actionId,revision:a.revision};}try{return r.send(JSON.stringify(s)),R.event("action","Action UI sent",{op:e,actionId:a?.actionId,params:n?Object.keys(n):[]}),!0}catch(u){return R.warn("Runtime","failed to send action_ui",{op:e,err:u}),false}}handleActionState(e){let n=jw(e);if(!n){R.warn("Runtime","action_state ignored: not a flow");return}this.actionFlows.apply(n)&&(R.event("action","Action flow",{actionId:n.actionId,name:n.name,stage:n.stage,revision:n.revision,awaiting:n.awaiting?.kind??null}),this.events.emit("action-flow",n));}async handleActionCheck(e){let n=typeof e?.checkId=="string"?e.checkId:"",i=typeof e?.name=="string"?e.name:"",r=typeof e?.param=="string"?e.param:"";if(!n){R.warn("Runtime","action_check without a checkId cannot be answered",{name:i});return}let a=this.ws,s=e?.args&&typeof e.args=="object"&&!Array.isArray(e.args)?e.args:{},u=await qw(this.actions.get(i)?.check,r,e?.value,s);if(R.event("action","Action check answered",{checkId:n,name:i,param:r,ok:u.ok,unverified:u.unverified===true}),a===null||a!==this.ws||a.readyState!==WebSocket.OPEN){R.warn("Runtime","action_check_result not sent: the session ended",{checkId:n});return}try{a.send(JSON.stringify({type:"action_check_result",checkId:n,...u}));}catch(d){R.warn("Runtime","failed to send action_check_result",{checkId:n,err:d});}}reportPerceptionOutcome(e,n,i){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","reportPerceptionOutcome() needs a live session","sdk",{fatal:false});return}try{this.ws.send(JSON.stringify({type:"perception_status",turnId:n,outcome:e,...e==="granted"&&{hasHistory:!!i?.hasHistory,feed:i?.feed??"off"}}));}catch(r){this.emitError("UNKNOWN","Failed to send perception status","sdk",{cause:r,fatal:false});}}sendCameraState(e){if(this.ws?.readyState===WebSocket.OPEN&&!(e.access===void 0&&e.feed===void 0&&e.facing===void 0&&e.canFlip===void 0&&e.availableCameras===void 0)){try{this.ws.send(JSON.stringify({type:"camera_state",...e.access!==void 0&&{access:e.access},...e.feed!==void 0&&{feed:e.feed},...e.facing!==void 0&&{facing:e.facing},...e.canFlip!==void 0&&{canFlip:e.canFlip},...e.availableCameras!==void 0&&{availableCameras:e.availableCameras}}));}catch(n){R.warn("Runtime","failed to send camera_state",{err:n});}(e.feed==="off"||e.access&&e.access!=="granted")&&this.clearMood();}}get canReadMood(){return this.readsMood&&!!this.capabilities?.mood}get isMoodDetectionOn(){return this.moodDetectionOn}setMoodDetection(e){e!==this.moodDetectionOn&&(this.moodDetectionOn=e,this.moodLatest=null,this.events.emit("mood-detection",e),this.queueMoodState());}reportMood(e){!this.canReadMood||!this.moodDetectionOn||(this.moodLatest=e,this.queueMoodState());}resyncMoodSwitch(){this.moodLastSentKey="off",this.queueMoodState();}moodStateKey(){return this.moodDetectionOn?this.moodLatest?.state??"on":"off"}queueMoodState(){if(!this.canReadMood||this.moodTimer||this.moodStateKey()===this.moodLastSentKey)return;let e=Date.now()-this.moodLastSentAt;if(e>=o1){this.sendMoodState();return}this.moodTimer=setTimeout(()=>{this.moodTimer=null,this.sendMoodState();},o1-e);}sendMoodState(){let e=this.moodStateKey();if(e===this.moodLastSentKey||this.ws?.readyState!==WebSocket.OPEN)return;let n=this.moodDetectionOn?this.moodLatest:null;try{this.ws.send(JSON.stringify({type:"mood_state",enabled:this.moodDetectionOn,...n&&{label:n.state,confidence:n.confidence}})),this.moodLastSentKey=e,this.moodLastSentAt=Date.now(),R.debug("Runtime","mood_state sent",{key:e});}catch(i){R.warn("Runtime","failed to send mood_state",{err:i});}}clearMood(){this.moodLatest=null,this.moodLastSentKey!=="off"&&this.moodLastSentKey!==null&&(this.moodLastSentKey="on");}reportScreenStatus(e,n,i){if(R.event("screen","Share status",{outcome:e,turnId:n,surface:i?.surface??null,browser:i?.browser??null,reason:i?.reason??null}),this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_status",turnId:n,outcome:e,...i?.surface&&{surface:i.surface},...i?.browser&&{browser:i.browser},...i?.reason&&{reason:i.reason}}));}catch(r){R.warn("Runtime","failed to send screen_status",{err:r});}}sendScreenState(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_state",feed:e.feed,...e.surface&&{surface:e.surface}}));}catch(n){R.warn("Runtime","failed to send screen_state",{err:n});}}sendScreenFrame(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"screen_frame",format:"jpeg",width:e.width,height:e.height,frame:yv(e.bytes)}));}catch(n){R.warn("Runtime","failed to send screen_frame",{err:n});}}reportCommandStatus(e,n,i,r){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"command_status",command:e,turnId:n,outcome:i,...r&&{reason:r}}));}catch(a){R.warn("Runtime","failed to send command_status",{err:a});}}loadVadWeights(){return qS(jS(),this.cache)}noteUserVoice(){this.events.emit("user-voice");}sendClientVadStatus(e,n){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"client_vad_status",active:e,...n&&{reason:n}}));}catch(i){R.warn("Runtime","failed to send client_vad_status",{err:i});}}sendClientNetStatus(){if(this.ws?.readyState===WebSocket.OPEN){try{this.ws.send(JSON.stringify({type:"client_net_status",micMuted:this.micMuted,...this.downlinkVerdict&&{downlink:this.downlinkVerdict}})),this.downlinkVerdict?.state==="ok"&&(this.downlinkVerdict=null);}catch(e){R.warn("Runtime","failed to send client_net_status",{err:e});}this.netStatusLastSentAt=Date.now();}}queueClientNetStatus(){if(this.netStatusTimer)return;let e=Date.now()-this.netStatusLastSentAt;if(e>=a1){this.sendClientNetStatus();return}this.netStatusTimer=setTimeout(()=>{this.netStatusTimer=null,this.sendClientNetStatus();},a1-e);}sendVisionFrames(e,n){if(this.ws?.readyState!==WebSocket.OPEN){this.emitError("NOT_CONNECTED","sendVisionFrames() needs a live session","sdk",{fatal:false});return}if(!e.length){R.warn("Runtime","vision frames requested but buffer is empty",{turnId:n});return}try{let i=e.map(r=>yv(r));this.ws.send(JSON.stringify({type:"vision_query",turnId:n,format:"jpeg",frames:i}));}catch(i){this.emitError("UNKNOWN","Failed to send vision frames","sdk",{cause:i,fatal:false});}}play(e){if(this.mode!=="player"){this.emitError("INVALID_MODE","play() can only be used in player mode","sdk",{fatal:false});return}this.jobQueue.push({...e,sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,chunkOffset:0}),!(this.processing||this.playerLeadInTimer)&&(this.setTalkingArmed(true),this.playerLeadInTimer=setTimeout(()=>{this.playerLeadInTimer=null,this.setTalkingArmed(false),this.processQueue();},Jg));}setTalkingArmed(e){this.talkingArmed!==e&&(this.talkingArmed=e,this.events.emit("talking-armed",e));}clearPlayerLeadIn(){this.playerLeadInTimer&&(clearTimeout(this.playerLeadInTimer),this.playerLeadInTimer=null),this.setTalkingArmed(false);}sendPcmChunk(e){if(!this.micMuted&&!this.noticeReceived&&!(this.ws?.readyState!==WebSocket.OPEN||!this.isConnected)){if(!this.pushToTalk){this.ws.send(e);return}for(let n of this.pushToTalk.gate(e))this.ws.send(n);}}openUserTurn(){(this.turnPhase==="speaking"||this.turnPhase==="greeting")&&this.interrupt({notifyServer:true,reason:"push_to_talk"}),this.sendClientTurnSignal("client_turn_start");}closeUserTurn(){this.sendClientTurnSignal("client_turn_end");}sendClientTurnSignal(e){if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:e,turnId:this.turnId}));}catch(n){R.warn("Runtime",`failed to send ${e}`,{err:n});}}interrupt(e){R.event("bargein","interrupt",{reason:e?.reason??"api",turnId:this.turnId,turnPhase:this.turnPhase});let n=this.turnId;this.sessionId++,this.turnId++,e?.notifyServer&&this.sendClientInterruptToServer(n,e.reason),this.resetSpeechPipeline(),this.setResponseSlow(false),this.events.emit("interrupt"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setHeardSpeechProvider(e){this.heardSpeech=e;}readHeardSpeech(){try{let e=this.heardSpeech?.()?.trim();return e?e.slice(0,bk):void 0}catch{return}}sendClientInterruptToServer(e,n){if(this.ws&&this.ws.readyState===WebSocket.OPEN){let i=this.readHeardSpeech();try{this.ws.send(JSON.stringify({type:"client_interrupt",turnId:e,...n&&{reason:n},...i&&{heard:i}}));}catch{}}}stopSpeaking(){this.sessionPhase==="active"&&(R.event("Runtime","User stopped the avatar"),this.interrupt({notifyServer:true,reason:"user_cancel"}));}cancelSpeech(){R.event("bargein","server_cancel_speech",{turnId:this.turnId,turnPhase:this.turnPhase}),this.resetSpeechPipeline(),this.events.emit("speech-cancelled"),this.sessionPhase==="active"&&this.setTurnPhase("listening");}setResponseSlow(e){this.responseSlow!==e&&(this.responseSlow=e,this.events.emit("avatar_slow_response",e));}armFirstChunk(){this.firstChunkPending=true;}resetSpeechPipeline(){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.jobQueue=[],this.processing=false,this.turnOpen=false,this.activeStream=null,this.clearPlayerLeadIn(),this.armFirstChunk(),this.sendAvatarSpeakingSignalToServer(false),this.transcript?.finalizeAvatar();}grantedPageSurface(e,n,i){let r=this.capabilities?.page;return !r||!i(r)?(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","this avatar is not allowed to do that to the page"),null):this.pageSurface?this.pageSurface:(this.reportCommandStatus(e,this.commandTurnId(n),"unsupported","no page surface on this platform"),null)}runPageCommand(e,n,i,r){let a=this.grantedPageSurface(e,n,i);if(!a)return;let s=this.commandTurnId(n);this.queuePageWork(()=>r(a,s)).catch(u=>{R.warn("Runtime","page command failed",{command:e,error:String(u)}),this.reportCommandStatus(e,s,"failed",Ak);});}scheduleReadAfterAction(){this.actionRereadTimer&&clearTimeout(this.actionRereadTimer),this.actionRereadTimer=setTimeout(()=>{this.actionRereadTimer=null,this.readPage();},mk);}commandTurnId(e){return typeof e?.turnId=="number"&&Number.isFinite(e.turnId)?e.turnId:this.turnId}handleCommand(e){let n=typeof e?.intent=="string"?e.intent:null;if(!n){R.warn("Runtime","command message missing intent",{msg:e});return}this.setResponseSlow(false);let i=this.commandHandlers[n];if(!i){R.warn("Runtime","unknown command intent",{intent:n}),this.reportCommandStatus(n,this.commandTurnId(e),"unsupported","unknown command");return}i(e);}dispose(e="SDK Disposed"){this.lifecycle++,this.cancelReconnect(),this.loadInFlight=null,this.teardownSession(4003,e,false),this.setSessionPhase("idle"),this.setPaintPhase("none");}setAvatarId(e){let n=e||"default";return n===this.avatarId?false:(R.event("Runtime","Avatar changed",{from:this.avatarId,to:n}),this.dispose("Avatar changed"),this.avatarId=n,this.startInvoked=false,this.load(),true)}stale(e){return e!==this.lifecycle}staleSocket(e,n){return this.stale(e)?(this.ws===n&&(this.ws=null),n?.close(4003,"SDK Disposed"),true):false}destroy(){this.dispose(),this.events.removeAll();}getPaintPhase(){return this.paintPhase}getSessionPhase(){return this.sessionPhase}getMode(){return this.mode}getTurnPhase(){return this.turnPhase}getTalkingArmed(){return this.talkingArmed}getSessionId(){return this.sessionId}on(e,n){return this.events.on(e,n)}markRiveReady(){this.riveReady||(this.riveReady=true,this.events.emit("avatar-ready"),this.releaseGreetingForPaint("rive-ready"),this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()));}notifyPlaybackEnded(){this.processing&&(this.processing=false,this.activeStream=null,this.armFirstChunk(),this.processQueue());}notifyAvatarLoadError(e){this.setPaintPhase("failed"),this.emitError("AVATAR_LOAD_FAILED","Failed to load avatar","sdk",{cause:e});}getAvatarConfig(){return this.serverReady?this.avatarConfig:null}getAvailableActions(){return Object.keys(this.avatarConfig?.rive?.gestures??{})}triggerAction(e){e&&this.events.emit("gesture",e);}avatarClicked(){if(this.turnPhase==="speaking"||this.turnPhase==="greeting")return;if(this.sessionPhase==="active"){try{this.ws?.send(JSON.stringify({type:"avatar_click"}));}catch{}return}let e=Date.now(),n=uw(this.avatarConfig?.performance?.playful?.gestures,this.playful.last,e,this.playful.busyUntilMs);n&&(this.playful={last:n.trigger,busyUntilMs:e+n.ms},this.events.emit("gesture",n.trigger));}setSessionPhase(e){this.sessionPhase!==e&&(this.sessionPhase=e,R.debug("Runtime","Session phase",{next:e}),this.events.emit("session-phase",e),e!=="active"&&this.turnPhase!=="idle"&&this.setTurnPhase("idle"));}setPaintPhase(e){this.paintPhase!==e&&(this.paintPhase=e,R.debug("Runtime","Paint phase",{next:e}),this.events.emit("paint-phase",e),e==="painted"&&this.markTonePainted(),e==="failed"&&this.stopConnectTone("paint-failed"),e==="failed"&&this.releaseGreetingForPaint("paint-failed"));}setTurnPhase(e){this.turnPhase!==e&&(this.turnPhase=e,R.debug("Runtime","Turn phase",{next:e}),this.events.emit("turn-phase",e));}startConnectTone(){!this.connectTone?.enabled||this.connectTonePlaying||this.mode!=="player"&&(this.tonePainted=this.paintPhase==="painted",this.toneSessionLive=this.sessionPhase==="active",!(this.tonePainted&&this.toneSessionLive)&&(this.connectTonePlaying=true,this.connectToneStartedAt=Date.now(),R.event("ConnectTone","Ringback start",{paintedOnEntry:this.tonePainted,liveOnEntry:this.toneSessionLive}),this.events.emit("connect-tone","start",this.resolvedConnectTone()),this.connectToneTimer=setTimeout(()=>{R.warn("ConnectTone","Ringback hit its ceiling \u2014 stopping"),this.stopConnectTone("ceiling");},QS)));}stopConnectTone(e){this.connectToneTimer&&(clearTimeout(this.connectToneTimer),this.connectToneTimer=null),this.connectTonePlaying&&(this.connectTonePlaying=false,R.event("ConnectTone","Ringback stop",{reason:e,audibleMs:this.connectToneStartedAt?Date.now()-this.connectToneStartedAt:null}),this.connectToneStartedAt=null,this.events.emit("connect-tone","stop"));}resolvedConnectTone(){return {...Sa,...this.connectTone}}getPendingConnectTone(){return this.connectTonePlaying?this.resolvedConnectTone():null}markTonePainted(){this.tonePainted=true,this.toneSessionLive&&this.stopConnectTone("painted+live");}markToneSessionLive(){this.toneSessionLive=true,this.tonePainted&&this.stopConnectTone("painted+live");}settleGreeting(e){this.greetingDecided||(this.greetingDecided=true,this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),R.event("Greeting","Decision settled",{outcome:e}));}armGreetingBackstop(){this.greetingDecided||this.greetingDecisionTimer||(this.greetingDecisionTimer=setTimeout(()=>{this.greetingDecisionTimer=null,R.warn("Greeting","No greeting decision from server \u2014 listening"),this.settleGreeting("timeout"),this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&this.enterListening();},XS));}handleGreetingPayload(e,n){if(!n?.audio_base64){this.settleGreeting("empty-payload"),this.resolveGreetingPlayback();return}let i={greetingId:e,audioChunks:[n.audio_base64],alignments:[n.normalized_alignment??n.alignment??null],...n.visemes&&{visemes:[fd(n.visemes)]},cachedAt:Date.now()};this.greetingEntry=i,this.sentGreetingId=e,this.cache.setCachedGreeting(this.greetingKey,i).catch(()=>{}),this.settleGreeting("synthesized"),this.resolveGreetingPlayback();}resolveGreetingPlayback(){this.greetingAwaitingPlayback&&(this.greetingAwaitingPlayback=false,this.sessionPhase==="active"&&(this.playGreeting()||this.enterListening()));}playGreeting(){if(this.greetingPlayed)return false;let e=this.greetingEntry;if(!e?.audioChunks.length)return false;this.greetingPlayed=true,R.event("Greeting","Playing greeting",{greetingId:e.greetingId}),this.setTurnPhase("greeting");let n={audioChunks:e.audioChunks,alignments:e.alignments,...e.visemes&&{visemes:e.visemes},sessionId:this.sessionId,turnId:this.turnId,isGreeting:true,jobId:++this.jobCounter,chunkOffset:0},i=()=>{this.greetingDelayTimer=setTimeout(()=>{this.greetingDelayTimer=null,n.sessionId===this.sessionId&&this.sessionPhase==="active"&&this.enqueueJob(n);},Zg);},r=()=>{this.greetingWaitsForPaint()?this.holdGreetingForPaint(i):i();};return this.greetingWaitsForMic()?this.holdGreetingForMic(r):r(),true}reportMicPipelineSettled(){this.micPipelineSettled=true,this.releaseGreetingForMic("settled");}greetingWaitsForMic(){return this.reportsMicPipeline&&!!this.micStream&&!this.micPipelineSettled}holdGreetingForMic(e){this.greetingAwaitingMic=e,this.greetingMicTimer=setTimeout(()=>this.releaseGreetingForMic("timeout"),$S),R.event("Greeting","Held for mic pipeline");}releaseGreetingForMic(e){let n=this.greetingAwaitingMic;this.clearGreetingMicHold(),n&&(R.event("Greeting","Released after mic hold",{reason:e}),n());}clearGreetingMicHold(){this.greetingAwaitingMic=null,this.greetingMicTimer&&(clearTimeout(this.greetingMicTimer),this.greetingMicTimer=null);}greetingWaitsForPaint(){return this.environment==="meeting"&&!this.riveReady&&this.paintPhase!=="failed"}holdGreetingForPaint(e){this.greetingAwaitingPaint=e,this.greetingPaintTimer=setTimeout(()=>this.releaseGreetingForPaint("timeout"),JS),R.event("Greeting","Held for first paint");}releaseGreetingForPaint(e){let n=this.greetingAwaitingPaint;this.clearGreetingPaintHold(),n&&(R.event("Greeting","Released after paint hold",{reason:e}),n());}clearGreetingPaintHold(){this.greetingAwaitingPaint=null,this.greetingPaintTimer&&(clearTimeout(this.greetingPaintTimer),this.greetingPaintTimer=null);}enterListening(){this.setTurnPhase("listening");}enterThinking(){this.setTurnPhase("thinking"),this.events.emit("avatar_thinking");}holdsSpeech(){return this.processing||this.jobQueue.length>0||this.utteranceBuffer.audio.length>0}enqueueJob(e){this.jobQueue.push(e),this.processQueue();}processQueue(){if(this.processing)return;let e=this.jobQueue.shift();if(!e){this.transcript?.finalizeAvatar(),this.turnOpen?this.enterThinking():this.enterListening(),this.sendAvatarSpeakingSignalToServer(false);return}if(e.sessionId!==this.sessionId){this.processQueue();return}this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(e),this.sendAvatarSpeakingSignalToServer(true);}emitSpeak(e){this.setResponseSlow(false),this.rollScriptTail(e),this.transcript?.applyAvatarSpeech(e),this.events.emit("speak",e);}rollScriptTail(e){let n=this.scriptTail;n.jobId!==e.jobId&&(n.jobId=e.jobId,n.upto=0,n.text="");let i=e.alignments??[],r=e.chunkOffset+i.length;if(r<=n.upto)return;let a=[];for(let s=Math.max(0,n.upto-e.chunkOffset);s<i.length;s++){let u=i[s];if(!u)continue;let d=pu(u);d&&a.push(d);}n.upto=r,n.text=[n.text,...a].join(" ").slice(-200);}getScriptTail(){return this.scriptTail.text}applyAgc(e){if(this.agcEnabled===e||typeof this.micStream?.getAudioTracks!="function")return;let n=this.micStream.getAudioTracks()[0];n&&(this.agcEnabled=e,R.event("mic","agc",{enabled:e}),n.applyConstraints({autoGainControl:e}).catch(i=>R.warn("Runtime","AGC toggle rejected",{enabled:e,error:i})));}async handleServerMessage(e){if(typeof e.data!="string")return;let n=Date.now(),i;try{i=JSON.parse(e.data);}catch{return}let r=this.transit.note(i.sentAt,n);switch(this.downlinkWatchdog.noteMessage(i.seq,n,i.type===Qw),i.type){case "avatar_config":{let a=i.config;if(!a?.rive&&!this.serverReady){this.emitError("AVATAR_LOAD_FAILED","Server config had no rive configuration","server"),this.rejectInitAck("Server config missing rive configuration");return}if(this.serverReady)await this.repaintFromPayload(a,this.lifecycle);else {let s=a.rivUrl?await this.fetchRivBytes(a.rivUrl):this.pendingRivBytes;if(!s){this.emitError("AVATAR_LOAD_FAILED","No rivUrl in avatar_config and no cache","server"),this.rejectInitAck("no riv bytes");return}await this.applyRenderPayload(a,s,this.lifecycle);}this.resolveInitAck();break}case "greeting_current":{R.event("Greeting","Server confirmed cached greeting",{greetingId:i.greetingId}),this.settleGreeting("cache-hit"),this.resolveGreetingPlayback();break}case "greeting":{R.event("Greeting","Received greeting audio",{greetingId:i.greetingId}),this.handleGreetingPayload(i.greetingId,i.job);break}case "greeting_unavailable":{R.info("Greeting","Server sent no greeting",{reason:i.reason??null}),this.settleGreeting(`unavailable:${i.reason??"unspecified"}`),this.resolveGreetingPlayback();break}case "notice_only":{this.noticeOnly=true,R.info("Runtime","notice_only \u2014 suppressing mic/greeting",{kind:i.kind}),this.serverReady||await this.paintForNotice(),this.setSessionPhase("idle"),this.resolveInitAck();break}case "resume_state":{if(typeof i.token!="string")break;this.isConnected?this.onResumeState?.(i.token):this.heldResumeToken=i.token;break}case "session_started":{this.resumeKept=void 0,this.heldResumeToken=null,this.sessionCapabilities=i1(i.capabilities);let{camera:a,screen:s,micMute:u,endCall:d,actions:g,page:v}=this.sessionCapabilities;R.event("session","Capabilities resolved",{camera:a,screen:s,micMute:u,endCall:d,actions:g,pageRead:v.read,pageScroll:v.scroll,pageNavigate:v.navigate,pageClick:v.click}),this.resyncMoodSwitch(),this.flushPendingContext(),this.noticeOnly||(this.firstPage=this.sendFirstPage()),this.serverReady?this.startSession():(R.info("Runtime","session_started before riv ready \u2014 deferring"),this.pendingSession=true);break}case "error":case "closed":{let a=i.type==="error",s=a?"SERVER_ERROR":"SERVER_CLOSE_REQUESTED",u=i.message||(a?"Server error":"Server requested closure");this.serverInitiatedReason={code:s,message:u},this.emitError(s,u,"server"),this.rejectInitAck(u);return}case "usage_limit_reached":case "avatar_not_allowed":{let a=i.type==="usage_limit_reached",s=i.message||(a?"Usage limit reached":"This avatar is not in your active slots, and your active slots are full");this.serverInitiatedReason={code:i.type,message:s},this.handleNotice({kind:i.kind??"plan",action:i.action,message:s});return}case "brain_error":{let a=i.message||"The assistant failed to respond";this.emitError("BRAIN_ERROR",a,"server",{fatal:false}),this.turnOpen=false,this.turnPhase==="thinking"&&this.enterListening();return}case "stream_health":{let a=i.service,s=i.state;if(!this.isHealthService(a)||!this.isHealthState(s)){R.warn("Runtime","stream_health: unknown service/state",{service:i.service,state:i.state});return}R.event("Runtime","stream_health",{service:a,state:s,code:i.code??null,detail:i.detail??null}),this.health[a]=s,this.emitHealth(a,i.code);return}case "tts_alignment":{if(i.turnId!==this.turnId)return;let a=i.audio_base64??i.audio_base64_string??"";if(!a)return;this.firstAudioAt===null&&(this.firstAudioAt=n,this.firstAudioLagMs=r);let s=this.mode==="call"&&!this.noticeOnly?du(i.normalized_alignment??i.alignment):i.normalized_alignment??null;R.debug("TTS","Processed alignment",s);let u=i.display_alignment?du(i.display_alignment):null;if(this.utteranceBuffer.audio.push(a),this.utteranceBuffer.alignments.push(s),this.utteranceBuffer.displayAlignments.push(u),this.utteranceBuffer.visemes.push(fd(i.visemes)),!this.utteranceBuffer.flushTimer){let d=this.firstChunkPending?0:ck;this.firstChunkPending=false,this.utteranceBuffer.flushTimer=setTimeout(()=>{this.flushUtterance();},d);}return}case "user_transcript":{R.debug("Transcript","user_transcript received",{text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??null,event:i.event??null,msSinceMicStart:this.micStartedAt===null?null:Date.now()-this.micStartedAt,micMuted:this.micMuted,turnPhase:this.turnPhase});let a=this.turnPhase==="speaking"&&Iw(i.text??"",this.getScriptTail());a||this.transcript?.applyUserTranscript({text:i.text??"",isFinal:!!i.isFinal,turnId:i.turnId??this.turnId}),i.text&&this.events.emit("user-partial",i.text,!!i.isFinal),i.text&&!a&&!this.pageReadThisUtterance&&this.capabilities?.page.read&&(this.pageReadThisUtterance=true,this.readPage());return}case "user_speaking":{this.events.emit("user-speaking");return}case "user_stopped_speaking":{this.deliveryLagMs=r,this.pageReadThisUtterance=false,this.userStoppedAt=n-(r??0),this.speakReportedForStop=false,this.firstAudioAt=null,this.firstAudioLagMs=null;return}case "avatar_thinking":{if(i.settles===true&&(this.turnOpen=true,this.holdsSpeech()))return;this.enterThinking();return}case "turn_settled":{this.turnOpen=false,this.turnPhase==="thinking"&&i.audioPending!==true&&!this.holdsSpeech()&&this.enterListening();return}case "avatar_slow_response":{this.setResponseSlow(true);return}case "avatar_speech_starting":{this.utteranceBuffer.audio.length&&(this.utteranceBuffer.flushTimer&&(clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer.flushTimer=null),this.flushUtterance()),this.transcript?.finalizeAvatar(),this.armFirstChunk(),this.events.emit("avatar_speech_starting");return}case "interrupt":{R.event("bargein","server_interrupt",{turnId:this.turnId,turnPhase:this.turnPhase}),this.interrupt({reason:"server"});return}case "command":{this.handleCommand(i);return}case "tour":{let a=Array.isArray(i.steps)?i.steps:null;this.pendingTours.get(i.requestId)?.(a);return}case "tour_unavailable":{R.warn("Runtime","Server could not write a tour",{reason:i.reason}),this.pendingTours.get(i.requestId)?.(null);return}case "action_run":{this.handleActionRun(i);return}case "action_state":{this.handleActionState(i);return}case "action_check":{this.handleActionCheck(i);return}case "gesture":{if(typeof i.name=="string"){let a=typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,s=typeof i.speechless=="boolean"?i.speechless:void 0;this.events.emit("gesture",i.name,a,s);}return}case "beep":{this.events.emit("beep",typeof i.atMs=="number"&&Number.isFinite(i.atMs)?i.atMs:void 0,typeof i.speechless=="boolean"?i.speechless:void 0);return}}}teardownSession(e,n,i=true){this.utteranceBuffer.flushTimer&&clearTimeout(this.utteranceBuffer.flushTimer),this.utteranceBuffer={audio:[],alignments:[],displayAlignments:[],visemes:[],flushTimer:null},this.turnOpen=false,this.stopConnectTone("session-teardown"),this.toneSessionLive=false,this.greetingDelayTimer&&(clearTimeout(this.greetingDelayTimer),this.greetingDelayTimer=null),this.clearGreetingPaintHold(),this.clearGreetingMicHold(),this.clearPlayerLeadIn(),this.greetingDecisionTimer&&(clearTimeout(this.greetingDecisionTimer),this.greetingDecisionTimer=null),this.greetingDecided=false,this.greetingAwaitingPlayback=false,this.greetingPlayed=false,this.sessionCapabilities=null,this.pageGeneration=0,this.lastPageContext=null,this.firstPage=null,this.pageSession++;for(let a of [...this.pendingTours.values()])a(null);this.actionRereadTimer&&(clearTimeout(this.actionRereadTimer),this.actionRereadTimer=null),this.actions.resetSession(),this.actionCallsSeen.clear(),this.actionFlows.flow&&(this.actionFlows.clear(),this.events.emit("action-flow",null)),this.actionsGrantWarned=false,this.armFirstChunk(),this.setResponseSlow(false),this.micMuted&&(this.micMuted=false,this.events.emit("mic-muted",false)),this.speakerMuted&&(this.speakerMuted=false,this.events.emit("speaker-muted",false)),this.sendAvatarSpeakingSignalToServer(false),this.isConnected&&(this.isConnected=false,this.events.emit("connection-status",false)),this.downlinkWatchdog.reset(),this.resetHealth(),this.heldResumeToken=null,this.lastContextSnapshot&&(this.pendingContext=[{context:this.lastContextSnapshot}]),this.netStatusTimer&&(clearTimeout(this.netStatusTimer),this.netStatusTimer=null),this.netStatusLastSentAt=0,this.moodTimer&&(clearTimeout(this.moodTimer),this.moodTimer=null),this.moodLatest=null,this.moodLastSentKey=null,this.moodLastSentAt=0,this.intentionalClose=false,this.serverInitiatedReason=null;let r=this.ws;this.ws=null,r?.close(e,n),this.agcRestoreTimer!==null&&(clearTimeout(this.agcRestoreTimer),this.agcRestoreTimer=null),this.micStream&&(this.micStream.getTracks().forEach(a=>a.stop()),this.micStream=null,this.micStartedAt=null,this.events.emit("mic-stop")),this.pushToTalk?.reset(),this.jobQueue=[],this.processing=false,this.activeStream=null,this.turnId=0,this.sessionId=0,this.userStoppedAt=null,this.speakReportedForStop=false,this.deliveryLagMs=null,this.firstAudioAt=null,this.firstAudioLagMs=null,this.transit.reset(),this.pendingSession=false,this.rejectInitAck("Runtime stopped"),this.transcript?.reset(),this.scriptTail={jobId:-1,upto:0,text:""},this.noticeReceived=false,this.noticeOnly=false,this.visualState="normal",i||(this.serverReady=false,this.rivSrc&&(this.urlResolver.revokeSrc(this.rivSrc),this.rivSrc=null),this.pendingRivBytes=null,this.riveReady=false,this.avatarConfig=null,this.cachedConfigVersion=void 0,this.watermark=false);}sendAvatarSpeakingSignalToServer(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_speaking",value:e}));}catch{}}resolveInitAck(){this.initAckResolve?.(),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}rejectInitAck(e){this.initAckReject?.(new Error(e)),this.initAckResolve=null,this.initAckReject=null,this.initAckPromise=null;}emitError(e,n,i,r){let a=r?.fatal??true,s={code:e,message:n,source:i,cause:r?.cause,fatal:a,retryable:a&&e!=="MIC_PERMISSION_DENIED"};if(this.lastEmittedError=s,R.error("Runtime",`${i.toUpperCase()} ERROR: ${n}`,{code:e,fatal:a}),this.events.emit("error",s),!a)return;let u=i==="server"&&this.initAckReject!==null;this.failSession(s),u||this.scheduleReconnect(s);}reportAudioBlocked(e){this.emitError("UNKNOWN",`Audio ${e} is blocked: the page has not had a user gesture`,"sdk",{fatal:false});}classifyClose(e){let n=e?.reason?.trim();switch(e?.code){case 4008:return {code:"SESSION_IDLE_TIMEOUT",message:n||"Session disconnected due to inactivity"};case 1008:return {code:"SERVER_CLOSE_REQUESTED",message:n||"The service ended the session"};case 1009:return {code:"SERVER_CLOSE_REQUESTED",message:n||"Message too big"};case 1011:return {code:"SERVER_ERROR",message:"The service ended the session after a component failure"};default:return {code:"CONNECTION_FAILED",message:n?`Connection to the avatar service closed: ${n}`:"Connection to the avatar service was lost unexpectedly"}}}failSession(e){if(e.code==="SESSION_IDLE_TIMEOUT"){this.stop({intentionalClose:true,code:4002,reason:"Idle timeout reached"});return}if(e.code==="AVATAR_LOAD_FAILED"||e.code==="MIC_PERMISSION_DENIED"||e.source==="sdk"){this.stop({intentionalClose:true,code:4004,reason:Xw(e)});return}this.stop({intentionalClose:false,code:4e3,reason:e.message});}setVisualState(e){this.visualState!==e&&(this.visualState=e,R.event("Runtime","Visual state",{state:e}),this.events.emit("visual",e));}applyDownlinkVerdict(e){if(this.noticeReceived)return;let n=e.state==="degraded"?"degraded":"ok";this.downlinkVerdict=e,this.downlinkScope=e.scope,R.event("Runtime","downlink_health",{...e}),this.health.downlink!==n&&(this.health.downlink=n,this.emitHealth("downlink","DOWNLINK_SLOW")),this.queueClientNetStatus();}transcriptPathDegraded(){return this.health.downlink!=="ok"&&this.downlinkScope!=="device"||this.health.ingest!=="ok"||this.health.stt!=="ok"}isHealthService(e){return e==="ingest"||e==="stt"||e==="llm"||e==="tts"}isHealthState(e){return e==="ok"||e==="degraded"||e==="failed"}resolveHealthConcern(e,n){let i=s=>s===e?n:void 0;if(this.health.ingest!=="ok")return {scope:"network",service:"ingest",state:this.health.ingest,code:i("ingest")};if(this.health.downlink!=="ok")return {scope:this.downlinkScope,service:"downlink",state:this.health.downlink,code:i("downlink")};let r=["stt","llm","tts"],a=null;for(let s of r){let u=this.health[s];if(u==="failed"){a=s;break}u==="degraded"&&a===null&&(a=s);}return a===null?null:{scope:"service",service:a,state:this.health[a],code:i(a)}}emitHealth(e,n){let i={services:{...this.health},concern:this.resolveHealthConcern(e,n)};this.events.emit("health",i);}resetHealth(){let e=Object.values(this.health).some(n=>n!=="ok");this.health={ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},this.downlinkScope="network",this.downlinkVerdict=null,e&&this.emitHealth();}handleNotice(e){this.noticeReceived=true,this.downlinkWatchdog.stop(),this.downlinkVerdict=null,this.health.downlink!=="ok"&&(this.health.downlink="ok",this.emitHealth()),R.event("Runtime","Session notice",{...e}),this.stopConnectTone("notice"),this.events.emit("notice",e),this.setVisualState("expired");}flushUtterance(){let e=this.utteranceBuffer;if(e.flushTimer=null,!e.audio.length)return;if(!this.riveReady){R.debug("Runtime","Holding speech \u2014 renderer not ready",{chunks:e.audio.length});return}(!this.activeStream||this.activeStream.turnId!==this.turnId)&&(this.activeStream={sessionId:this.sessionId,turnId:this.turnId,jobId:++this.jobCounter,emittedChunks:0});let n={audioChunks:e.audio,alignments:e.alignments,displayAlignments:e.displayAlignments,visemes:e.visemes,sessionId:this.activeStream.sessionId,turnId:this.activeStream.turnId,jobId:this.activeStream.jobId,chunkOffset:this.activeStream.emittedChunks};this.activeStream.emittedChunks+=e.audio.length,e.audio=[],e.alignments=[],e.displayAlignments=[],e.visemes=[],this.processing=true,this.setTurnPhase("speaking"),this.emitSpeak(n),this.sendAvatarSpeakingSignalToServer(true),this.reportAvatarStartedSpeaking();}reportAvatarStartedSpeaking(){if(this.speakReportedForStop)return;this.speakReportedForStop=true;let e=Date.now(),n=this.userStoppedAt!==null?e-this.userStoppedAt:null,i=this.firstAudioAt!==null?e-this.firstAudioAt:null;if(this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"avatar_started_speaking",turnId:this.turnId,clientLatencyMs:n,deliveryLagMs:this.firstAudioLagMs,stopNoticeLagMs:this.deliveryLagMs,clientRenderMs:i}));}catch{}}};var Td=5e3;var wk=t=>new Promise((e,n)=>{let i=setTimeout(()=>n(new Error("page surface did not answer")),Td);t.then(r=>{clearTimeout(i),e(r);},r=>{clearTimeout(i),n(r);});});function kv(t){let e=(n,i)=>wk(t({method:n,args:i}));return {read:async n=>{try{return await e("read",[n])}catch(i){return R.warn("Page","remote read reached no page",{error:String(i)}),null}},retag:n=>e("retag",[n]),scroll:(n,i)=>e("scroll",[n,i]),navigate:(n,i)=>e("navigate",[n,i]),click:(n,i)=>e("click",[n,i]),fill:(n,i)=>e("fill",[n,i]),submit:(n,i)=>e("submit",[n,i])}}var Fn={position:"bottom-right",offset:{x:20,y:20},bubbleSize:64,panel:{w:384,h:560},panelBackground:"#F4F2EE",avatarScale:.6,draggable:false,launcher:"avatar",mobile:"sheet",zIndex:2147483e3,teaserDelayMs:8e3,mobileBreakpointPx:640},Ta=t=>({...t,position:t?.position??Fn.position,offset:t?.offset??Fn.offset,bubbleSize:t?.bubbleSize??Fn.bubbleSize,panel:t?.panel??Fn.panel,panelBackground:t?.panelBackground??Fn.panelBackground,avatarScale:t?.avatarScale??Fn.avatarScale,draggable:t?.draggable??Fn.draggable,launcher:t?.launcher??Fn.launcher,mobile:t?.mobile??Fn.mobile,zIndex:t?.zIndex??Fn.zIndex});var Cd=1e3,Rd="I'm right here, so let me know if you have any questions.",Mk=80,Ov=t=>{if(typeof t!="string")return;let e=t.trim();return e&&e.length<=Mk?e:void 0},Tk=["above","below","left","right"],f1=(t,e)=>{let n=typeof e=="string"?{target:e}:e,i=Ov(n?.target);if(!i)return;let r=Tk.find(a=>a===n?.from);return r?{kind:t,target:i,from:r}:{kind:t,target:i}},Ck=t=>{let e=f1("point",t.point);if(e)return e;let n=f1("go",t.go);if(n)return n;if(typeof t.spot!="string")return;let i=yu(t.spot);return i?.kind==="spot"?{kind:"spot",spot:i.spot}:void 0},Rk=t=>{let e=typeof t=="string"?{target:t}:t,n=Ov(e?.target);if(n)return {target:n,strong:e?.strong===true}},d1=t=>t.split(/\s+/).filter(Boolean),xd=(t,e=Rd)=>{let n=[],i=[];for(let a of t??[]){let s=d1(typeof a?.say=="string"?a.say:"");if(!s.length)continue;let u=typeof a.gesture=="string"&&a.gesture.trim()?a.gesture.trim():void 0;i.push({wordIndex:n.length,move:Ck(a),highlight:Rk(a.highlight),scroll:Ov(a.scroll),gesture:u}),n.push(...s);}if(!i.length)return {text:"",words:[],steps:[]};i[0].move||(i[0].move={kind:"spot",spot:"center"});let r=e===false?[]:d1(e);return r.length&&(i.push({wordIndex:n.length,move:{kind:"home"},scrollTop:true}),n.push(...r)),{text:n.join(" "),words:n,steps:i}},Iv=t=>{let e=JSON.stringify(t.steps)+t.text,n=5381;for(let i=0;i<e.length;i++)n=(n<<5)+n+e.charCodeAt(i)|0;return (n>>>0).toString(36)};var h1=t=>t.toLowerCase().normalize("NFKC").replace(/[^\p{L}\p{N}]+/gu,""),xk=(t,e,n)=>{let i="";for(let r=1;r<=3&&n-r>=0;r++){if(i=e[n-r]+i,i===t)return r;if(!t.endsWith(i))return 0}return 0},Pv=(t,e)=>{let n=t.map(h1),i=e.map(_=>h1(_.text)),r=n.length+1,a=i.length+1,s=new Int32Array(r*a),u=(_,T)=>n[_-1]?xk(n[_-1],i,T):0;for(let _=1;_<r;_++)for(let T=1;T<a;T++){let x=Math.max(s[(_-1)*a+T],s[_*a+T-1]),N=u(_,T);N&&(x=Math.max(x,s[(_-1)*a+T-N]+1)),s[_*a+T]=x;}let d=n.map(()=>null),g=r-1,v=a-1;for(;g>0&&v>0;){let _=s[g*a+v];if(_===s[(g-1)*a+v])g--;else if(_===s[g*a+v-1])v--;else {let T=u(g,v);d[g-1]={from:v-T,to:v},g--,v-=T;}}let A=n.map((_,T)=>{let x=d[T];return !x||_.length<=3&&!(d[T-1]?.to===x.from||d[T+1]?.from===x.to)?null:e[x.from].start}),p=null;for(let _=n.length-1;_>=0;_--)A[_]!==null?p=A[_]:p!==null&&(A[_]=p);return A};var Eu=class{constructor(){this.jobId=null;this.consumed=0;this.chars=[];this.starts=[];this.ends=[];this.cachedWords=[];}add(e){let n=e.alignments??[],i=e.chunkOffset??0;this.jobId!==e.jobId&&(this.reset(),this.jobId=e.jobId);let r=i+n.length;if(!(r<=this.consumed)){for(let a=Math.max(0,this.consumed-i);a<n.length;a++){let s=e.displayAlignments?.[a]??n[a];s?.characters?.length&&(this.chars.push(...s.characters),this.starts.push(...s.character_start_times_seconds),this.ends.push(...s.character_end_times_seconds));}this.consumed=r,this.cachedWords=null;}}get words(){return this.cachedWords??(this.cachedWords=mu({characters:this.chars,character_start_times_seconds:this.starts,character_end_times_seconds:this.ends})),this.cachedWords}reset(){this.jobId=null,this.consumed=0,this.chars=[],this.starts=[],this.ends=[],this.cachedWords=[];}};var p1=["right","left","below","above"],kd=(t,e,n)=>Math.min(Math.max(t,e),Math.max(e,n)),m1=(t,e,n,i,r)=>t>=r&&e>=r&&t+n.w<=i.w-r&&e+n.h<=i.h-r,kk=(t,e)=>{let n=t/2+e/2,i=[0];for(let r=24;r<=n;r+=24)i.push(-r,r);return i},Nv=(t,e,n,{margin:i,gap:r=16,prefer:a,blocked:s})=>{let u=typeof r=="number"?r:r.x,d=typeof r=="number"?r:r.y,g=t.top+t.height/2-e.h/2,v=t.left+t.width/2-e.w/2,A={right:{left:t.left+t.width+u,top:g},left:{left:t.left-u-e.w,top:g},below:{left:v,top:t.top+t.height+d},above:{left:v,top:t.top-d-e.h}},p=a?[a,...p1.filter(_=>_!==a)]:p1;for(let _ of p){let{left:T,top:x}=A[_];if(_==="right"||_==="left"){let E={left:T,top:kd(x,i,n.h-e.h-i),side:_};if(m1(E.left,E.top,e,n,i))return E;continue}let N=null;for(let E of kk(t.width,e.w)){let w={left:kd(T+E,i,n.w-e.w-i),top:x,side:_};if(m1(w.left,w.top,e,n,i)&&(N??(N=w),!s?.({left:w.left,top:w.top,width:e.w,height:e.h})))return w}if(N)return N}return {left:kd(A.right.left,i,n.w-e.w-i),top:kd(g,i,n.h-e.h-i),side:"right"}};var Lv=t=>{let e=new Uint8Array(t.length/4);for(let n=0;n<e.length;n+=1){let i=n*4;e[n]=(t[i]+t[i+1]+t[i+2])/3;}return e},Ok=(t,e)=>{let n=0,i=0;for(let r=0;r<e.length;r+=1){let a=Math.abs(t[r]-e[r]);n+=a,a>i&&(i=a);}return {mean:e.length?n/e.length:0,max:i}},Dv=(t,e,n)=>{if(!t||t.length!==e.length)return true;let{mean:i,max:r}=Ok(t,e);return i>=4?true:r>=8&&n>=4e3};var b1={happy:[{shape:"mouthSmile",weight:.8},{shape:"cheekSquint",weight:.2}],surprised:[{shape:"browInnerUp",weight:.25},{shape:"browOuterUp",weight:.25},{shape:"eyeWide",weight:.1},{shape:"jawOpen",weight:.4,mouth:true}],angry:[{shape:"browDown",weight:.85},{shape:"noseSneer",weight:.15}],sad:[{shape:"mouthFrown",weight:.55,mouth:true},{shape:"browInnerUp",weight:.45}]},Ik={happy:.45,surprised:.3,angry:.2,sad:.35},g1=.3,v1=.2,Pk={neutral:1,happy:1,surprised:1,angry:.7,sad:.7},Nk=1500,Lk=.6,Dk=1e3,Bk=2e3,Uk=.03,Fk=.2,Vk=new Set(["browInnerUp","browOuterUp","eyeWide"]),A1=.1,y1=.3,Od=t=>Math.round(t*100)/100,Mu=[...new Set([...Object.values(b1).flatMap(t=>t.map(e=>e.shape)),"eyeBlink"])],Tu=(t,e)=>{let n=t[e];if(typeof n=="number")return n;let i=t[`${e}Left`]??0,r=t[`${e}Right`]??0;return (i+r)/2},Cu=class{constructor(){this.baseline=new Map;this.window=[];this.current=null;this.candidate=null;this.faceLostAtMs=null;this.last=null;}update(e,n,i){if(!e)return this.noteNoFace(n);if(this.faceLostAtMs=null,this.baseline.size===0)for(let d of Mu)this.baseline.set(d,Math.min(Tu(e,d),y1));let r=new Map;for(let d of Mu){let g=this.baseline.get(d)??0,v=Tu(e,d);r.set(d,g<1?Math.max(0,(v-g)/(1-g)):0);}let{label:a,scores:s}=this.frameLabel(r,i),u=["browInnerUp","browOuterUp"].reduce((d,g)=>d+Math.max(0,(this.baseline.get(g)??0)-Tu(e,g)),0)/2;if(this.last={raw:Object.fromEntries(Mu.map(d=>[d,Od(Tu(e,d))])),baseline:Object.fromEntries(Mu.map(d=>[d,Od(this.baseline.get(d)??0)])),browDrop:Od(u),scores:s,label:a},a==="neutral"&&!i&&this.learnBaseline(e),a==="neutral"&&i)return this.candidate=null,this.current;for(this.window.push({atMs:n,label:a});this.window.length&&n-this.window[0].atMs>Nk;)this.window.shift();return this.vote(n)}inspect(){return this.last}reset(){this.last=null,this.baseline.clear(),this.window=[],this.current=null,this.candidate=null,this.faceLostAtMs=null;}frameLabel(e,n){let i={},r="neutral",a=0;for(let[s,u]of Object.entries(b1)){let d=0;for(let v of u)v.mouth&&n||(d+=v.weight*(e.get(v.shape)??0));if(s==="angry"||s==="sad"){let v=e.get("mouthSmile")??0;d*=1-Math.max(0,v-v1)/(1-v1);}if(s==="surprised"){let v=e.get("eyeBlink")??0;d*=1-Math.max(0,v-g1)/(1-g1);}i[s]=Od(d);let g=d-Ik[s];g>a&&(r=s,a=g);}return {label:r,scores:i}}learnBaseline(e){for(let n of Mu){let i=Tu(e,n),r=this.baseline.get(n)??0;if(i-r>A1)continue;let a=Vk.has(n);if(a&&r-i>A1)continue;let s=i<r&&!a?Fk:Uk;this.baseline.set(n,Math.min(r+s*(i-r),y1));}}vote(e){let n=new Map;for(let s of this.window)n.set(s.label,(n.get(s.label)??0)+1);let i=null,r=0;for(let[s,u]of n){let d=u/this.window.length;d>r&&(i=s,r=d);}if(!i||r<Lk)return this.candidate=null,this.current;let a=Math.round(r*Pk[i]*100)/100;return this.current?.state===i?(this.candidate=null,this.current={state:i,confidence:a},this.current):(this.candidate?.label!==i&&(this.candidate={label:i,sinceMs:e}),e-this.candidate.sinceMs>=Dk&&(this.current={state:i,confidence:a},this.candidate=null),this.current)}noteNoFace(e){return this.faceLostAtMs??(this.faceLostAtMs=e),e-this.faceLostAtMs<Bk?this.current:(this.window=[],this.candidate=null,this.baseline.clear(),this.current={state:"no_face",confidence:1},this.current)}};var Hk={top:"top",middle:"middle",center:"middle",centre:"middle",bottom:"bottom"},zk=new Set(["up","down"]),Bv=t=>{let e=t.trim().toLowerCase();if(!e)return null;let n=Hk[e];if(n)return {kind:"edge",edge:n};if(zk.has(e))return {kind:"step",direction:e};let i=Au(e);return i?{kind:"axis",...i}:null};function Ru(t){let e=t,n=new Set;return {subscribe(i){return n.add(i),()=>n.delete(i)},getSnapshot:()=>e,getServerSnapshot:()=>t,set(i){if(!Object.is(e,i)){e=i;for(let r of n)r();}}}}var xu=class{constructor(e,n=Math.random){this.idleActs=e;this.random=n;this.pass=[];this.round=[];this.lastId=null;}next(){this.round.length||(this.round=this.planRound());let e=this.round.shift();return this.lastId=e.id,e}planRound(){let{windowMinMs:e,windowMaxMs:n}=this.idleActs;this.pass.length||(this.pass=this.shuffled());let i=[],r=0;for(let s of [...this.pass])i.length&&r+s.ms>n||(i.push({act:s,holdMs:s.ms}),r+=s.ms,this.pass.splice(this.pass.indexOf(s),1));let a=s=>s.holdMs/s.act.ms;for(;r<e;){let s=n-r,u=i.filter(({act:g})=>g.loop!=="oneShot"&&g.ms<=s);if(!u.length)break;let d=u.reduce((g,v)=>a(v)<a(g)||a(v)===a(g)&&v.act.ms>g.act.ms?v:g);d.holdMs+=d.act.ms,r+=d.act.ms;}return i.map(({act:s,holdMs:u})=>({id:s.id,holdMs:u,cycleMs:s.ms,...s.timeline&&{timeline:s.timeline}}))}shuffled(){let e=[...this.idleActs.acts];for(let n=e.length-1;n>0;n--){let i=Math.floor(this.random()*(n+1));[e[n],e[i]]=[e[i],e[n]];}return e.length>1&&e[0].id===this.lastId&&e.push(e.shift()),e}};var _1={quietToIdleMs:fv,idleCycleMs:0,playfulAfterMs:0,playfulRoles:[],idleTriggers:[],thinkingMaxMs:0},Gk={has:()=>false,fire:()=>{}},Id="trigger:",Wk=.5,ku=class{constructor(e,n={},i=()=>{},r=()=>true,a=Gk){this.writeMode=e;this.cycle=i;this.rigHas=r;this.rigTriggers=a;this.phase="off";this.timer=null;this.cycleTimer=null;this.attending=false;this.idleSince=0;this.idleRole="idle";this.idleStep="idle";this.planner=null;this.hold=null;this.holdStartMs=0;this.holdEntered=false;this.followsRig=false;this.rigPose=null;this.timings={..._1,...typeof n=="number"?{quietToIdleMs:n}:n},this.planner=this.timings.idleActs?new xu(this.timings.idleActs):null,this.followsRig=this.namesActs();}setMode(e,n){e!=="idle"&&(this.rigPose=null),this.writeMode(e,n);}namesActs(){return !!this.timings.idleActs?.acts.some(e=>e.timeline)}configure(e){this.timings={..._1,...e},this.planner=this.timings.idleActs?new xu(this.timings.idleActs):null,this.hold=null,this.followsRig=this.namesActs(),this.phase==="listening"?this.listen(false):this.phase==="idle"?this.settle():this.phase==="thinking"&&this.armThinkingLimit();}rest(e){if(this.clear(),!e){this.phase="off",this.setMode("idle");return}this.listen(true);}connect(){this.clear(),this.phase="off",this.idleSince=Date.now(),this.settle();}resume(e){switch(this.phase){case "busy":return;case "off":e?this.connect():this.setMode("idle");return;case "listening":this.setMode("listening");return;case "idle":this.setMode(this.idleRole,this.idleRole==="idle"?this.hold?.id:void 0);return;case "thinking":this.setMode("thinking");return}}think(){if(!(this.phase==="busy"||this.phase==="off")){if(this.phase==="thinking"){this.armThinkingLimit();return}this.startThinking();}}restThinking(){this.startThinking();}startThinking(){this.clear(),this.phase="thinking",this.setMode("thinking"),this.armThinkingLimit();}stopThinking(){this.phase==="thinking"&&this.listen(true);}userActivity(){this.phase==="busy"||this.phase==="off"||this.listen(false);}setAttending(e){e!==this.attending&&(this.attending=e,this.userActivity());}busy(){this.clear(),this.phase="busy",this.rigPose=null;}dispose(){this.clear();}rigEntered(e){this.timings.idleActs?.acts.some(n=>n.timeline===e)&&(this.rigPose={timeline:e,sinceMs:Date.now()},!(this.phase!=="idle"||this.idleRole!=="idle"||this.holdEntered||e!==this.hold?.timeline)&&(this.holdEntered=true,this.holdStartMs=Date.now(),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.cycleTimer=null,this.armCycle()));}get current(){return this.phase}listen(e){this.clear(),(e||this.phase!=="listening")&&this.setMode("listening"),this.phase="listening",this.timings.quietToIdleMs>0&&!this.attending&&(this.timer=setTimeout(()=>{this.timer=null,!(this.phase!=="listening"||this.attending)&&(this.idleSince=Date.now(),this.settle());},this.timings.quietToIdleMs));}settle(){this.clear(),this.phase!=="idle"?(this.phase="idle",this.idleRole="idle",this.idleStep="idle",this.setMode("idle",this.nextHold(Date.now()))):this.idleRole==="idle"&&this.planner&&!this.hold&&this.cycle(this.nextHold(Date.now())),this.armCycle();}nextHold(e){if(this.hold=this.planner?.next()??null,this.holdStartMs=e,this.holdEntered=false,this.hold?.timeline&&this.rigPose&&this.rigPose.timeline===this.hold.timeline){let n=Math.floor((e-this.rigPose.sinceMs)/this.hold.cycleMs);this.holdStartMs=this.rigPose.sinceMs+Math.max(0,n)*this.hold.cycleMs,this.holdEntered=true;}return this.hold?.id}armCycle(){let e=this.idleRole==="idle"?this.hold:null;if(!e){this.timings.idleCycleMs>0&&this.armTimer(this.timings.idleCycleMs,()=>this.onCycle());return}if(this.followsRig&&!this.holdEntered){let i=Math.max(...this.timings.idleActs?.acts.map(r=>r.ms)??[0]);this.armTimer(this.holdStartMs+i+e.cycleMs-Date.now(),()=>{this.followsRig=false,this.holdEntered=true,this.holdStartMs=Date.now(),this.armCycle();});return}let n=this.holdStartMs+e.holdMs-e.cycleMs*(1-Wk);this.armTimer(n-Date.now(),()=>this.onCycle());}armTimer(e,n){this.cycleTimer=setTimeout(()=>{this.cycleTimer=null,n();},Math.max(0,e));}onCycle(){if(this.phase!=="idle")return;let{playfulAfterMs:e,playfulRoles:n,idleTriggers:i=[]}=this.timings,r=n.length>0||i.length>0,s=e>0&&r&&Date.now()-this.idleSince>=e?this.nextIdleStep(n,i):"idle";if(s.startsWith(Id)){this.idleRole!=="idle"&&(this.idleRole="idle",this.setMode("idle",this.nextHold(Date.now()))),this.idleStep=s,this.rigTriggers.fire(s.slice(Id.length)),this.armCycle();return}let u=s;this.idleStep=u;let d=this.idleRole==="idle"&&this.hold?this.holdStartMs+this.hold.holdMs:Date.now(),g=u==="idle"?this.nextHold(d):void 0;u===this.idleRole?this.cycle(g):(this.idleRole=u,this.setMode(u,g)),this.armCycle();}nextIdleStep(e,n){let i=[...e.filter(r=>r!==this.idleStep&&(r===this.idleRole||this.rigHas(r))),...n.map(r=>Id+r).filter(r=>r!==this.idleStep&&this.rigTriggers.has(r.slice(Id.length)))];return i.length?i[Math.floor(Math.random()*i.length)]:this.idleRole}armThinkingLimit(){this.timer!==null&&clearTimeout(this.timer),this.timer=null,!(this.timings.thinkingMaxMs<=0)&&(this.timer=setTimeout(()=>{this.timer=null,this.phase==="thinking"&&this.listen(true);},this.timings.thinkingMaxMs));}clear(){this.timer!==null&&clearTimeout(this.timer),this.cycleTimer!==null&&clearTimeout(this.cycleTimer),this.timer=null,this.cycleTimer=null;}};var jk=2,Ou=class{constructor(e){this.writeControl=e;this.policy=null;this.role=null;this.lastAct={};}setPolicy(e){e!==this.policy&&(this.policy=e,this.role=null,this.lastAct={});}get hasPolicy(){return this.policy!==null}get mode(){return this.role}get act(){return this.role?this.lastAct[this.role]??null:null}setMode(e,n){return e===this.role&&(n===void 0||n===this.lastAct[e])?true:this.enter(e,n)}cycle(e){return this.role?this.enter(this.role,e):false}reapply(){let e=this.role;return e?this.write(e,this.lastAct[e]??0):false}has(e){if(e==="idle"||e===this.role)return true;let n=this.policy?.branches[e]?.gate;return !!n&&this.writeControl(n,false)}stop(){this.role=null;}enter(e,n){if(!this.policy)return R.debug("BranchToggler","no performance policy \u2014 branch not written",{role:e}),false;let i=n??this.pickAct(e);return this.write(e,i)?(this.lastAct[e]=i,this.role=e,true):(R.debug("BranchToggler","branch write did not land \u2014 staying put",{wanted:e,role:this.role}),false)}pickAct(e){let n=this.policy?.branches[e]?.acts??[];if(!n.length)return 0;let i=n.length>1?n.filter(r=>r!==this.lastAct[e]):n;return i[Math.floor(Math.random()*i.length)]}resolve(e){let n=e;for(let i=0;i<=jk;i++){let r=this.policy?.branches[n];if(!r)return null;if(!r.gate||!r.fallback||this.writeControl(r.gate,false))return r;n=r.fallback;}return null}write(e,n){let i=this.resolve(e);if(!i&&e!=="idle")return false;let r=Object.values(this.policy?.branches??{}).filter(d=>d!==i),a=new Set(r.map(d=>d.gate).filter(d=>!!d&&d!==i?.gate)),s=new Set(r.map(d=>d.act).filter(d=>!!d&&d!==i?.act)),u=[];i?.act&&n&&u.push(this.writeControl(i.act,n));for(let d of a)u.push(this.writeControl(d,false));i?.gate&&u.push(this.writeControl(i.gate,true));for(let d of s)u.push(this.writeControl(d,0));return u.some(Boolean)}};var Iu=(t,e,n)=>{let i=e?.[t];return {input:i?.input??t,type:i?.type??"trigger",value:i?.value??1,binding:i?.binding??(n?"data-binding":"input"),resetMs:i?.resetMs,returnMs:i?.returnMs??hv}};var Pu=class{constructor(){this.segments=[];this.playable=0;}schedule(e,n,i){let r=this.segments[this.segments.length-1],a=i??(r?r.start+r.duration:0);return this.segments.push({at:e,start:a,duration:n}),r&&e<r.at&&this.segments.sort((s,u)=>s.at-u.at),this.playable=Math.max(this.playable,a+n),a}isAnchored(){return this.segments.length>0}timeAt(e){let n=this.segments;if(n.length===0)return $g;for(;n.length>1&&n[1].at<=e;)n.shift();let i=n[0];return i.start+(e-i.at)}playableTime(){return this.playable}reanchor(){this.segments.length=0;}reset(){this.segments.length=0,this.playable=0;}};var Pd="viseme",Nd={plain:t=>`${t}`,prefix:t=>`${Pd}${t}`,"prefix-space":t=>`${Pd} ${t}`,suffix:t=>`${t}${Pd}`},S1=["plain","prefix","prefix-space","suffix"],qk=/^(?:viseme\s*(\d+)|(\d+)\s*viseme|(\d+))$/i,fo=t=>{let e=t.trim().match(qk);if(!e)return null;let n=e[1]??e[2]??e[3];if(n===void 0)return null;let i=Number(n);return Number.isNaN(i)?null:i};function Nu(t){let e=[0,1,2,6,21];for(let n of S1){let i=Nd[n];for(let r of e){let a=false;try{a=t(i(r));}catch{a=false;}if(a)return {format:i,shape:n,matched:true}}}return {format:Nd.plain,shape:"plain",matched:false}}var Ld="Watermark_opacity";var Xk=4e3,Qk=6,Kk=.2,E1=-90,Zk=25,Jk=200,Dd=-50,$k=18,M1=10,eO=10,tO=500,nO=1e3,iO=3,rO=10,aO=500,oO=30,sO=30,lO=-50,uO=-30,Ls=80,cO=400,Nr=t=>t<=1e-7?-140:20*Math.log10(t),Ns=t=>t.length?Nr(t.reduce((e,n)=>e+n,0)/t.length):-140;function T1(t,e){let n=0,i=0,r=0;for(let a=0;a<t.length;a++){for(i+=t[a].mic*t[a].mic;r<a&&t[a].t-t[r].t>e;)i-=t[r].mic*t[r].mic,r++;t[a].t-t[r].t<e*.9||(n=Math.max(n,i/(a-r+1)));}return Nr(Math.sqrt(n))}var Bd=class{constructor(){this.buf=[];this.pausedAt=null;this.floorDb=null;this.floorComputedAt=0;this.erlSamples=[];this.erlSampledAt=0;this.micDb=-140;this.gateOpen=false;this.gateHoldUntil=0;this.gateLevelDb=-140;this.renderAudibleSince=null;}push(e,n){let i=Date.now();this.buf.push({t:i,mic:e,render:n});let r=i-Xk,a=0;for(;a<this.buf.length&&this.buf[a].t<r;)a++;a&&this.buf.splice(0,a),Nr(n)>=Dd?this.renderAudibleSince===null&&(this.renderAudibleSince=i):this.renderAudibleSince=null,this.micDb=Nr(e),this.updateFloor(),this.updateErl(),this.updateGate();}updateErl(){let e=Date.now();if(e-this.erlSampledAt<tO)return;let n=this.recent(nO);!n||n.renderDb<Dd||this.floorDb!==null&&this.pausedAt===null&&(n.micDb<=E1||n.micDb<this.floorDb+rO&&(this.renderAudibleSince===null||e-this.renderAudibleSince<aO)||(this.erlSampledAt=e,this.erlSamples.push(n.erlDb),this.erlSamples.length>eO&&this.erlSamples.shift()));}erlEstimateDb(){if(this.erlSamples.length<iO)return $k;let e=[...this.erlSamples].sort((n,i)=>n-i);return Math.min(e[Math.floor(e.length/2)],oO)}updateFloor(){let e=Date.now();if(this.floorDb!==null&&e-this.floorComputedAt<Jk)return;let n=[];for(let i of this.buf){let r=Nr(i.mic);r>E1&&n.push(r);}n.length<Zk||(n.sort((i,r)=>i-r),this.floorDb=n[Math.floor((n.length-1)*Kk)],this.floorComputedAt=e);}updateGate(){this.gateLevelDb=Nr(this.meanMicRms(Ls));let e=this.gateThresholdDb();if(this.gateLevelDb>=e){this.gateHoldUntil=Date.now()+cO,this.gateOpen=true;return}this.gateOpen=Date.now()<this.gateHoldUntil;}gateThresholdDb(){let e=this.floorDb===null?-1/0:this.floorDb+sO,n=Nr(this.meanRenderRms(Ls)),i=n>=Dd?n-this.erlEstimateDb()+M1:-1/0;return Math.min(Math.max(lO,e,i),uO)}meanMicRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].mic,r++;return r?i/r:0}meanRenderRms(e){let n=Date.now()-e,i=0,r=0;for(let a=this.buf.length-1;a>=0&&!(this.buf[a].t<n);a--)i+=this.buf[a].render,r++;return r?i/r:0}isLive(){return this.gateOpen}levels(){return {micNowDb:+this.micDb.toFixed(1),gateLevelDb:+this.gateLevelDb.toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),floorDb:+(this.floorDb??-140).toFixed(1),erlEstDb:+this.erlEstimateDb().toFixed(1)}}markPaused(){this.pausedAt=Date.now();}clearPaused(){this.pausedAt=null;}report(){if(this.buf.length<10)return null;let e=Date.now(),n=this.pausedAt??e,i=this.buf.filter(A=>A.t>=n-500&&A.t<=n),r=this.buf.filter(A=>A.t>n),a=Ns(i.map(A=>A.mic)),s=Ns(i.map(A=>A.render)),u=this.floorDb??-140,d=u+Qk,g=-1;for(let A of r)if(Nr(A.mic)<=d){g=A.t-n;break}let v=i.length?Math.max(...i.map(A=>Nr(A.mic))):-140;return {micPreDb:+a.toFixed(1),renderPreDb:+s.toFixed(1),erlDb:+(s-a).toFixed(1),micPostDb:+Ns(r.map(A=>A.mic)).toFixed(1),micFloorDb:+u.toFixed(1),micPeakDb:+v.toFixed(1),micPostSustainedDb:+T1(this.buf.filter(A=>A.t>n+60),Ls).toFixed(1),gateAtDb:+this.gateThresholdDb().toFixed(1),micDecayMs:g}}provablyNotEcho(e,n){if(this.pausedAt===null)return false;let i=this.pausedAt,r=this.buf.filter(d=>d.t>=i-500&&d.t<=i),a=this.buf.filter(d=>d.t>i+n);if(r.length===0||a.length===0)return false;let s=Ns(r.map(d=>d.render));if(s<Dd)return false;let u=s-this.erlEstimateDb()+M1;return T1(a,Ls)>=u+e}recent(e){let n=Date.now()-e,i=this.buf.filter(s=>s.t>=n);if(i.length<5)return null;let r=Ns(i.map(s=>s.mic)),a=Ns(i.map(s=>s.render));return {micDb:+r.toFixed(1),renderDb:+a.toFixed(1),erlDb:+(a-r).toFixed(1)}}reset(){this.buf=[],this.pausedAt=null,this.floorDb=null,this.floorComputedAt=0,this.erlSamples=[],this.erlSampledAt=0,this.micDb=-140,this.gateOpen=false,this.gateHoldUntil=0,this.gateLevelDb=-140,this.renderAudibleSince=null;}};function C1(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e/Math.max(1,t.length))}var Ud=class{constructor(e){this.onModeChange=e;this.pending=null;this.samples=[];this.blackoutStreak=0;this.lastEpisodeAt=0;this.mode="healthy";this.episodesInMode=0;}noteVoiceFrame(e,n){this.expirePending(n);let i=this.pending;if(e<Aw){i&&i.endedAt===null&&n-i.lastVoicedAt>150&&(i.endedAt=n);return}if(!i){this.pending={onsetAt:n,voicedMs:0,lastVoicedAt:n,endedAt:null};return}i.endedAt=null;let r=n-i.lastVoicedAt;r>0&&r<=150&&(i.voicedMs+=r),i.lastVoicedAt=n;}noteTranscript(e){let n=this.pending;n&&(this.pending=null,this.blackoutStreak=0,this.samples.push(e-n.onsetAt),this.samples.length>hw&&this.samples.shift(),this.closeEpisode(e));}policy(e,n=false){return this.isStale(e)&&this.setMode("healthy","stale"),n?wv:this.mode==="degraded"?wv:gd}currentMode(){return this.mode}lagMs(){return this.median()}getBlackoutStreak(){return this.blackoutStreak}clearPending(){this.pending=null;}reset(){this.pending=null,this.samples=[],this.blackoutStreak=0,this.lastEpisodeAt=0,this.mode="healthy",this.episodesInMode=0;}expirePending(e){let n=this.pending;!n||n.endedAt===null||e-n.endedAt<vw||(this.pending=null,!(n.voicedMs<gw)&&(this.blackoutStreak++,this.closeEpisode(e)));}closeEpisode(e){this.lastEpisodeAt=e,this.episodesInMode++,!(this.episodesInMode<pw)&&this.setMode(this.verdict(e),"lag");}setMode(e,n){if(e===this.mode)return;let i=this.mode;this.mode=e,this.episodesInMode=0,this.onModeChange?.({from:i,to:e,reason:n,lagMs:this.median(),blackoutStreak:this.blackoutStreak,samples:this.samples.length});}isStale(e){return this.lastEpisodeAt===0||e-this.lastEpisodeAt>mw}median(){if(this.samples.length===0)return null;let e=[...this.samples].sort((n,i)=>n-i);return e[Math.floor(e.length/2)]}verdict(e){let n=this.median();return n===null||this.isStale(e)?"healthy":n>fw?"degraded":n<dw?"healthy":this.mode}};var Lu=class{constructor(e,n,i){this.runtime=e;this.sensorProvider=n;this.vad=null;this.controller=null;this.initPromise=null;this.playback=null;this.speaking=false;this.micMuted=false;this.handedBack=false;this.framesPushed=0;this.voicedFramesSeen=0;this.userVoicedAtMs=0;this.voiceRunStartedAt=0;this.voiceWakeSent=false;this.partialsWhileBlind=0;this.trace=new Bd;this.asrLag=new Ud(e=>R.event("bargein","policy",e));this.lastEchoLogAt=0;this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0};this.dutyBreaches=0;this.sessionStartedAt=Date.now();this.gatedFrames=0;this.farEndMs=0;this.softPaused=false;this.uplinkDelay=[];this.echoGate=i?.echoGate??true;}setPlaybackControls(e){this.playback=e;}setSpeaking(e){let n=this.speaking!==e;this.speaking=e,n&&this.runtime.setAgcForAvatarSpeech(e),e||(this.softPaused=false),n&&e&&this.resetBlindWatch();}isUserVoiced(){return Date.now()-this.userVoicedAtMs<Cw}isAvatarAudible(){return this.speaking||(this.playback?.hasPendingAudio?.()??false)}setMicMuted(e){this.micMuted!==e&&(this.micMuted=e,e&&(this.controller?.abort(),this.vad?.reset(),this.trace.reset(),this.uplinkDelay=[],this.asrLag.clearPending()));}effectivePolicy(){return this.asrLag.policy(Date.now(),this.runtime.transcriptPathDegraded())}prefetch(){this.runtime.loadVadWeights().catch(()=>{});}async ensureInit(){if(this.sessionStartedAt=Date.now(),this.controller){this.runtime.sendClientVadStatus(true);return}return this.initPromise||(this.initPromise=this.init()),this.initPromise}async init(){try{let e=await this.sensorProvider.create(await this.runtime.loadVadWeights()),n=Tv({isAvatarSpeaking:()=>this.isAvatarAudible(),pausePlayback:()=>{R.event("bargein","soft_pause",{mode:this.effectivePolicy().mode,...this.trace.levels()}),this.softPaused=!0,this.trace.markPaused(),this.playback?.pause();},resumePlayback:()=>{this.softPaused=!1,this.trace.clearPaused(),this.playback?.resume();},commitInterrupt:()=>this.runtime.interrupt({notifyServer:!0,reason:"barge_in"}),getActiveScriptTail:()=>this.runtime.getScriptTail(),isProvablyNotEcho:()=>this.trace.provablyNotEcho(10,60),getPolicy:()=>this.effectivePolicy(),onTelemetry:i=>R.event("bargein",i.outcome,{mode:i.mode,policySource:i.mode==="degraded"&&this.asrLag.currentMode()!=="degraded"?"health":"measured",pathFault:this.runtime.transcriptPathDegraded(),blackoutStreak:this.asrLag.getBlackoutStreak(),asrLagMs:this.asrLag.lagMs(),clause:i.commitClause,onsetToPauseMs:i.voiceOnsetToPauseMs,voicedMs:i.totalVoicedMs,postPauseMs:i.postPauseVoicedMs,wordlessStreak:i.wordlessResumeStreak,transcript:i.transcript,motion:i.speechMotion,medianFlux:i.speechMedianFlux,modulation:i.speechModulation,...this.trace.report()??{}})});e.onProb((i,r,a)=>{if(this.isAvatarAudible()?this.voiceRunStartedAt=0:(this.asrLag.noteVoiceFrame(i,Date.now()),i>=.5&&(this.userVoicedAtMs=Date.now()),this.noteVoiceForWake(i)),i>=.5&&this.voicedFramesSeen++,!this.echoGate||this.trace.isLive()&&!this.isWarming()){n.onVadProb(i,r,a);return}i>=.5&&this.gatedFrames++,n.onVadProb(0,r,null);}),this.vad=e,this.controller=n,this.handedBack=!1,this.resetBlindWatch(),R.debug("BargeIn","client VAD initialized"),this.runtime.sendClientVadStatus(!0);}catch(e){R.error("BargeIn","failed to init client VAD",e),this.initPromise=null,this.handedBack=true,this.runtime.sendClientVadStatus(false,"asset_load_failed");}}disable(e){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null,this.dutyBreaches=0,this.handedBack=true,R.warn("BargeIn","client VAD disabled",{reason:e}),this.runtime.sendClientVadStatus(false,e);}pushLevel(e,n){this.micMuted||(this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=n/16e3*1e3),this.trace.push(e,this.playback?.getOutputLevel?.()??0),this.logEchoHealth());}pushPcm(e){if(this.micMuted)return;this.isAvatarAudible()&&this.farEndMs<1500&&(this.farEndMs+=e.length/16e3*1e3),this.trace.push(C1(e),this.playback?.getOutputLevel?.()??0),this.logEchoHealth();let n=e.length,i=Date.now();this.vad&&(this.vad.pushPcm(e),this.framesPushed++),this.noteVadCost(Date.now()-i,n);}noteVadCost(e,n){let i=this.vadCost;i.calls++,i.totalMs+=e,i.audioMs+=n/16e3*1e3,e>i.maxMs&&(i.maxMs=e);let r=Date.now();if(i.at===0){i.at=r;return}let a=r-i.at;if(a<1e3)return;let s=Math.round(i.totalMs/a*100);this.vadCost={at:r,calls:0,totalMs:0,maxMs:0,audioMs:0},this.noteSensorHealth(s);}noteSensorHealth(e){if(this.vad){if(e<yw){this.dutyBreaches=0;return}++this.dutyBreaches<bw||(R.warn("BargeIn","client VAD cannot keep up",{dutyPct:e}),this.disable("sensor_too_slow"));}}isWarming(){return this.isAvatarAudible()&&this.farEndMs<1500}logEchoHealth(){}onPartialTranscript(e){e&&this.asrLag.noteTranscript(Date.now()),e&&this.noteBlindSensor(),this.controller?.onPartialTranscript(e);}noteBlindSensor(){!this.controller||this.micMuted||this.isAvatarAudible()&&(this.farEndMs<1500||this.framesPushed<_w||this.voicedFramesSeen>0||++this.partialsWhileBlind<Sw||(R.warn("BargeIn","client VAD scored nothing while ASR returned words",{framesPushed:this.framesPushed}),this.disable("sensor_blind")));}resetBlindWatch(){this.framesPushed=0,this.voicedFramesSeen=0,this.partialsWhileBlind=0;}shouldUplink(){return this.handedBack||!this.isAvatarAudible()||this.softPaused?true:this.isWarming()?false:this.trace.isLive()}noteVoiceForWake(e){if(e<.5||!this.trace.isLive()){this.voiceRunStartedAt=0,this.voiceWakeSent=false;return}let n=Date.now();this.voiceRunStartedAt||(this.voiceRunStartedAt=n),!(this.voiceWakeSent||n-this.voiceRunStartedAt<Rw)&&(this.voiceWakeSent=true,this.runtime.noteUserVoice());}releaseUplinkFrames(e){if(!this.echoGate)return [e];if(!this.isAvatarAudible()){let a=this.uplinkDelay.map(s=>s.frame);return this.uplinkDelay=[],[...a,e]}let n=Date.now();this.uplinkDelay.push({t:n,frame:e});let i=this.shouldUplink(),r=[];for(;this.uplinkDelay.length>0&&n-this.uplinkDelay[0].t>=Ls;){let a=this.uplinkDelay.shift();i||a.frame.fill(0),r.push(a.frame);}return r}reset(){this.vad?.reset(),this.controller?.reset(),this.trace.reset(),this.sessionStartedAt=Date.now(),this.softPaused=false,this.uplinkDelay=[],this.farEndMs=0,this.asrLag.reset(),this.dutyBreaches=0,this.vadCost={at:0,calls:0,totalMs:0,maxMs:0,audioMs:0},this.userVoicedAtMs=0,this.voiceRunStartedAt=0,this.voiceWakeSent=false,this.resetBlindWatch();}dispose(){this.vad?.destroy?.(),this.vad=null,this.controller=null,this.initPromise=null;}};var yo=ue(Rt());var I1=ue(Be()),pO=({children:t,className:e,style:n})=>(0, I1.jsx)("div",{className:`avatar-shell-root ${e??""}`,style:n,children:t}),O1=pO;var ce=ue(Rt()),Hu=ue(Bu());var tn=ue(Bu()),$i=(t,e)=>{let n=[...e?[e]:[],...t.stateMachineNames??[]];for(let i of n){let r;try{r=t.stateMachineInputs(i);}catch{r=void 0;}if(r?.length)return {name:i,inputs:r}}return {name:null,inputs:[]}},Hd=(t,e)=>{let n;switch(t?.fit){case "fill":n=tn.Fit.Fill;break;case "cover":n=tn.Fit.Cover;break;case "fitWidth":n=tn.Fit.FitWidth;break;case "fitHeight":n=tn.Fit.FitHeight;break;case "none":n=tn.Fit.None;break;case "scaleDown":n=tn.Fit.ScaleDown;break;case "layout":n=tn.Fit.Layout;break;default:n=tn.Fit.Contain;}e&&(n=tn.Fit.Contain);let i;switch(t?.alignment){case "topLeft":i=tn.Alignment.TopLeft;break;case "topCenter":i=tn.Alignment.TopCenter;break;case "topRight":i=tn.Alignment.TopRight;break;case "centerLeft":i=tn.Alignment.CenterLeft;break;case "centerRight":i=tn.Alignment.CenterRight;break;case "bottomLeft":i=tn.Alignment.BottomLeft;break;case "bottomCenter":i=tn.Alignment.BottomCenter;break;case "bottomRight":i=tn.Alignment.BottomRight;break;default:i=tn.Alignment.Center;}return new tn.Layout({fit:n,alignment:i})};var P1="EnhancedLipSync",Vv=100,mO=.55,gO=.35,vO=.45,AO=.4,zd=.04,yO=60,bO=2,N1=64,Gd=class{constructor(){this.rive=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.currentValues=new Map;this.inputs=new Map;this.silenceInput=null;this.jawOpen=0;this.lastActiveTime=Zi;this.lastTickTime=0;this.tuning=new Pr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/yO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,s=false,u=1/0;for(let _ of this.visemes){let T=_.start-zd,x=_.end+zd;if(u===1/0&&_.start>r&&_.visemeId!==0&&(u=_.start-r),r<T||r>x)continue;let N=_.end-_.start,E=Math.min(.06,N*.45),w=1;if(r<_.start+E?w=(r-T)/(E+zd):r>_.end-E&&(w=(x-r)/(E+zd)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){s=true;let C=a.get(_.visemeId)||0;a.set(_.visemeId,Math.max(C,w));}}let d=0;for(let _ of a.values())d+=_;if(d>1)for(let[_,T]of a)a.set(_,T/d);s&&(this.lastActiveTime=r);let v=r-this.lastActiveTime<this.tuning.holdSec?1:0,A=v>this.jawOpen?mO:gO,p=i*this.tuning.jawSpeed;this.jawOpen+=(v-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0);for(let[_,T]of this.currentValues){let x=a.get(_)||0,E=Math.min(Vv,x*this.jawOpen*Vv*this.tuning.openness)-T,w=E>0?vO:AO,C=T+E*(1-Math.pow(1-w,i));this.currentValues.set(_,C);let I=this.inputs.get(_);I&&(I.value=Math.round(C));}if(this.silenceInput){let _=Math.min(r-this.lastActiveTime,u),T=this.tuning.holdSec,x=Math.min(1,Math.max(0,(_-T)/(cu-T))),N=this.tuning.rest+x*(Vv-this.tuning.rest);this.silenceInput.value=Math.round((1-this.jawOpen)*N);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i,r){this.clock=n,r&&(this.tuning=r),this.currentValues.clear(),this.jawOpen=0,this.visemes=[],this.lastTickTime=0,this.retarget(e,i);}retarget(e,n){if(this.rive=e,this.inputs.clear(),this.silenceInput=null,!e)return;let{name:i,inputs:r}=$i(e,n);for(let a of r){let s=fo(a.name);if(s!==null){if(s===0){this.silenceInput=a,a.value=0;continue}this.inputs.set(s,a),this.currentValues.has(s)||this.currentValues.set(s,0),a.value=Math.round(this.currentValues.get(s)??0);}}this.inputs.size===0?R.error(P1,"no viseme inputs on the rig \u2014 lip-sync will not move",{requestedStateMachine:n??"(unset)",resolvedStateMachine:i,artboardStateMachines:e.stateMachineNames,inputNames:r.map(a=>a.name)}):R.debug(P1,"bound to rig",{stateMachine:i,visemeIds:[...this.inputs.keys()].sort((a,s)=>a-s),silenceInputFound:!!this.silenceInput});}detach(){this.retarget(null);}appendVisemes(e){this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes();}clearVisemes(){this.visemes=[],this.lastActiveTime=Zi;}pruneSpentVisemes(){if(this.visemes.length<=N1||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-bO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-N1),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.tick());}stop(){if(this.running){this.running=false,this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.inputs.values())try{e.value=0;}catch{}if(this.silenceInput)try{this.silenceInput.value=this.tuning.rest;}catch{}this.visemes=[],this.inputs.clear(),this.currentValues.clear(),this.silenceInput=null,this.rive=null,this.clock=null,this.lastTickTime=0;}}forceSilence(){this.lastActiveTime=Zi,this.jawOpen=0;for(let[e,n]of this.inputs)n.value=0,this.currentValues.set(e,0);this.silenceInput&&(this.silenceInput.value=this.tuning.rest);}};var Wd=100,_O=.55,SO=.35,wO=.45,EO=.4,jd=.04,L1=0,MO=0,TO=60,CO=2,D1=64,Bi="DataBindingLipSync",po=class{constructor(){this.vmInstance=null;this.clock=null;this.visemes=[];this.rafId=null;this.running=false;this.numberProps=new Map;this.currentValues=new Map;this.silenceProp=null;this.formatName=e=>`${e}`;this.jawOpen=0;this.lastActiveTime=Zi;this.lastTickTime=0;this.lastTickLogTime=0;this.silencing=false;this.tuning=new Pr;this.tick=()=>{if(!this.running||!this.clock)return;let e=performance.now(),n=this.lastTickTime?Math.min((e-this.lastTickTime)/(1e3/TO),this.tuning.maxStepFrames):1;this.lastTickTime=e;let i=n*this.tuning.speed,r=this.clock.getAlignmentTime(),a=new Map,s=false;for(let _ of this.visemes){let T=_.start-jd,x=_.end+jd;if(r<T||r>x)continue;let N=_.end-_.start,E=Math.min(.06,N*.45),w=1;if(r<_.start+E?w=(r-T)/(E+jd):r>_.end-E&&(w=(x-r)/(E+jd)),w=Math.max(0,Math.min(1,w)),w>0&&_.visemeId!==0){s=true;let C=a.get(_.visemeId)??0;a.set(_.visemeId,Math.max(C,w));}}let u=0;for(let _ of a.values())u+=_;if(u>1)for(let[_,T]of a)a.set(_,T/u);s&&(this.lastActiveTime=r);let d=r-this.lastActiveTime<this.tuning.holdSec,g=0;if(!d){for(let _ of this.visemes)if(_.start>r&&_.visemeId!==0){let T=_.start-r;T<L1&&(g=MO*(1-T/L1));break}}let v=d?1:g,A=v>this.jawOpen?_O:SO,p=i*this.tuning.jawSpeed;this.jawOpen+=(v-this.jawOpen)*(1-Math.pow(1-A,p)),this.jawOpen<.01&&(this.jawOpen=0),this.silencing&&this.jawOpen===0&&(this.silencing=false,R.debug(Bi,"tick: silence complete"));for(let[_,T]of this.numberProps){let x=a.get(_)??0,N=Math.min(Wd,x*this.jawOpen*Wd*this.tuning.openness),E=this.currentValues.get(_)??0,w=N-E,C=w>0?wO:EO,I=E+w*(1-Math.pow(1-C,i)),V=Math.round(I);if(this.currentValues.set(_,I),!!T)try{T.value=V;}catch(K){R.error(Bi,`tick: failed writing visemeId=${_} value=${V}`,K);}}try{if(this.silenceProp){let _=Wd;if(!this.silencing){let T=r-this.lastActiveTime,x=1/0;for(let C of this.visemes)if(C.start>r&&C.visemeId!==0){x=C.start-r;break}let N=Math.min(T,x),E=this.tuning.holdSec,w=Math.min(1,Math.max(0,(N-E)/(cu-E)));_=this.tuning.rest+w*(Wd-this.tuning.rest);}this.silenceProp.value=Math.round((1-this.jawOpen)*_);}}catch(_){R.error(Bi,"tick: failed writing silence prop",_);}this.rafId=requestAnimationFrame(this.tick);};}initialize(e,n,i){this.clock=n,i&&(this.tuning=i);let r=n.getAlignmentTime();this.jawOpen=r>.05?1:0,this.lastActiveTime=this.jawOpen>0?r:Zi,this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.lastTickTime=0,this.lastTickLogTime=0,this.silencing=false,this.retarget(e),R.debug(Bi,"initialize",{initialT:r.toFixed(3),jawPreWarmed:this.jawOpen>0});try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch(a){R.error(Bi,"initialize: failed to set silence prop to rest",a);}this.prepareSpeech();}retarget(e){if(this.vmInstance=e,this.silenceProp=null,!e){for(let r of this.numberProps.keys())this.numberProps.set(r,null);return}let{format:n,shape:i}=Nu(r=>{try{return e.number(r)!==null}catch{return !1}});this.formatName=n;for(let r of this.numberProps.keys())this.numberProps.set(r,e.number(this.formatName(r)));this.silenceProp=e.number(this.formatName(0)),R.debug(Bi,"bound to rig",{viewModelName:e.viewModelName??"unknown",visemeNameShape:i,silencePropFound:!!this.silenceProp,trackedIds:this.numberProps.size});}detach(){this.retarget(null);}prepareSpeech(){this.silencing=false;}appendVisemes(e){for(let n of e)if(n.visemeId!==0&&!this.numberProps.has(n.visemeId)){let i=this.vmInstance?.number(this.formatName(n.visemeId))??null;this.numberProps.set(n.visemeId,i),this.currentValues.set(n.visemeId,0);try{i&&(i.value=0);}catch{}}this.visemes.push(...e),this.visemes.sort((n,i)=>n.start-i.start),this.pruneSpentVisemes(),R.debug(Bi,"appendVisemes",{newCount:e.length,totalVisemes:this.visemes.length,trackedIds:Array.from(this.numberProps.keys()),nullProps:Array.from(this.numberProps.entries()).filter(([,n])=>!n).map(([n])=>n)});}clearVisemes(){this.visemes=[],this.lastActiveTime=Zi;}pruneSpentVisemes(){if(this.visemes.length<=D1||!this.clock||!this.clock.isLive())return;let e=this.clock.getAlignmentTime()-CO;if(e<=0)return;let n=0;for(;n<this.visemes.length&&this.visemes[n].end<e;)n++;n=Math.min(n,this.visemes.length-D1),n>0&&this.visemes.splice(0,n);}start(){this.running||(this.running=true,this.lastTickTime=0,this.prepareSpeech(),R.debug(Bi,"start"),this.tick());}stop(){if(this.running){this.running=false,R.debug(Bi,"stop"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}interrupt(){if(this.running){this.running=false,R.debug(Bi,"interrupt"),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null);for(let e of this.numberProps.values())try{e&&(e.value=0);}catch{}try{this.silenceProp&&(this.silenceProp.value=this.tuning.rest);}catch{}this.visemes=[],this.numberProps.clear(),this.currentValues.clear(),this.silenceProp=null,this.vmInstance=null,this.clock=null,this.lastTickTime=0,this.silencing=false;}}forceSilence(){this.lastActiveTime=Zi,this.silencing=true,R.debug(Bi,"forceSilence \u2014 jaw decaying naturally");}};var Hv=25,RO=.8,xO=.003,kO=300,B1=.7,Yd=class{constructor(e,n){this.alignmentBaseCtxTime=null;this.scheduleCursor=0;this.timeline=new Pu;this.decodedQueue=[];this.activeSources=new Set;this.pendingDecodes=0;this.schedulerTimer=null;this.interrupted=false;this.drainTimer=null;this.muted=false;this.paused=false;this.ownsContext=!n,this.ctx=n??new AudioContext,this.gain=this.ctx.createGain(),this.gain.gain.value=B1,this.analyser=this.ctx.createAnalyser(),this.analyser.fftSize=512,this.analyserBuf=new Float32Array(this.analyser.fftSize),this.gain.connect(this.analyser),this.analyser.connect(this.ctx.destination),this.onEnded=e,this.warm(),this.startScheduler();}warm(){try{this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{});let e=this.ctx.createBuffer(1,1,this.ctx.sampleRate),n=this.ctx.createBufferSource();n.buffer=e,n.connect(this.ctx.destination),n.start();}catch{}}setMuted(e){if(this.muted=e,this.ctx.state==="closed")return;let n=e?0:B1,i=this.ctx.currentTime;try{this.gain.gain.cancelScheduledValues(i),this.gain.gain.setValueAtTime(this.gain.gain.value,i),this.gain.gain.linearRampToValueAtTime(n,i+.02);}catch{this.gain.gain.value=n;}}isMuted(){return this.muted}playBeep(){if(this.ctx.state!=="closed")try{let e=this.ctx.currentTime,n=this.ctx.createOscillator(),i=this.ctx.createGain();n.frequency.value=pv,i.gain.setValueAtTime(0,e),i.gain.linearRampToValueAtTime(ud,e+cd),i.gain.setValueAtTime(ud,e+fu-cd),i.gain.linearRampToValueAtTime(0,e+fu),n.connect(i),i.connect(this.gain),n.onended=()=>i.disconnect(),n.start(e),n.stop(e+fu);}catch(e){R.warn("TtsPlayer","beep failed",{err:e});}}enqueueChunk(e,n){if(this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"){this.pendingDecodes++;try{this.decodeBase64(e).then(i=>{this.ctx.state!=="closed"&&(this.decodedQueue.push({buffer:i,alignmentStart:n}),this.decodedQueue.sort((r,a)=>r.alignmentStart-a.alignmentStart));}).catch(()=>{}).finally(()=>this.settleDecode());}catch{this.settleDecode();}}}enqueueSequentialChunk(e){this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null),this.ctx.state!=="closed"&&(this.pendingDecodes++,this.decodeBase64(e).then(n=>{this.ctx.state!=="closed"&&this.decodedQueue.push({buffer:n,alignmentStart:1/0});}).catch(()=>{}).finally(()=>this.settleDecode()));}settleDecode(){this.pendingDecodes>0&&this.pendingDecodes--,this.maybeArmDrain();}hasPendingAudio(){return this.activeSources.size>0||this.decodedQueue.length>0||this.pendingDecodes>0}maybeArmDrain(){this.interrupted||this.hasPendingAudio()||(this.drainTimer&&clearTimeout(this.drainTimer),this.drainTimer=window.setTimeout(()=>{this.drainTimer=null,!this.interrupted&&!this.hasPendingAudio()&&this.onEnded?.();},kO));}async decodeBase64(e){let n=atob(e),i=new Uint8Array(n.length);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return this.ctx.decodeAudioData(i.buffer)}startScheduler(){let e=()=>{if(this.interrupted||this.ctx.state==="closed")return;if(this.paused){this.schedulerTimer=window.setTimeout(e,Hv);return}let n=this.ctx.currentTime,i=false,r=false;if(this.alignmentBaseCtxTime===null){let a=this.decodedQueue[0];if(!a){this.schedulerTimer=window.setTimeout(e,Hv);return}let s=a.alignmentStart===1/0?0:a.alignmentStart;this.alignmentBaseCtxTime=n+.1-s,this.scheduleCursor=n+.1,i=true,R.debug("TtsPlayer","alignment clock anchored",{headStart:s,bufferDuration:a.buffer.duration,outputLatency:this.ctx.outputLatency??null,baseLatency:this.ctx.baseLatency??null,queuedChunks:this.decodedQueue.length,ctxState:this.ctx.state});}for(;this.decodedQueue.length>0&&(this.decodedQueue[0].alignmentStart===1/0||this.alignmentBaseCtxTime+this.decodedQueue[0].alignmentStart<n+RO);){let{buffer:a,alignmentStart:s}=this.decodedQueue.shift(),u;s===1/0?u=this.scheduleCursor:(u=this.alignmentBaseCtxTime+s,u<n+.02&&this.activeSources.size===0&&(this.scheduleCursor>0&&n-this.scheduleCursor<1&&R.warn("TtsPlayer","Playback stalled, realigning",{lateBySec:Number((n-u).toFixed(3))}),this.alignmentBaseCtxTime=n+.1-s,u=this.alignmentBaseCtxTime+s,i=true,this.timeline.reanchor()),Math.abs(u-this.scheduleCursor)<.1?u=this.scheduleCursor:u=Math.max(u,this.scheduleCursor)),this.timeline.schedule(u,a.duration,s===1/0?void 0:s),R.debug("TtsPlayer","chunk placed",{alignmentStart:s===1/0?null:s,startAt:Number(u.toFixed(3)),movedBySec:s===1/0?null:Number((u-(this.alignmentBaseCtxTime+s)).toFixed(3)),bufferDuration:Number(a.duration.toFixed(3))});let d=this.ctx.createBufferSource();d.buffer=a;let g=this.ctx.createGain();if(d.connect(g),g.connect(this.gain),u>this.scheduleCursor+.001){let v=Math.min(xO,a.duration/2);g.gain.setValueAtTime(0,u),g.gain.linearRampToValueAtTime(1,u+v);}else g.gain.setValueAtTime(1,u);d.start(u),this.scheduleCursor=u+a.duration,this.activeSources.add(d),r=true,d.onended=()=>{this.activeSources.delete(d),this.activeSources.size===0&&this.emitTimeline(),this.maybeArmDrain();};}(i||r)&&this.emitTimeline(),this.schedulerTimer=window.setTimeout(e,Hv);};e();}getAlignmentTime(){return this.timeline.timeAt(this.ctx.currentTime-(this.ctx.outputLatency||0))}getPlayableAlignmentTime(){return this.timeline.playableTime()}getOutputLevel(){if(this.ctx.state==="closed")return 0;try{this.analyser.getFloatTimeDomainData(this.analyserBuf);}catch{return 0}let e=0;for(let n=0;n<this.analyserBuf.length;n++)e+=this.analyserBuf[n]*this.analyserBuf[n];return Math.sqrt(e/this.analyserBuf.length)}isAudioActive(){return this.activeSources.size>0||this.decodedQueue.length>0}isPlaybackScheduled(){return this.activeSources.size>0}pause(){this.paused||this.interrupted||this.ctx.state!=="closed"&&(this.paused=true,this.emitTimeline(),this.ctx.suspend().catch(()=>{}).then(()=>this.emitTimeline()));}isPaused(){return this.paused}resume(){this.paused&&this.ctx.state!=="closed"&&(this.paused=false,this.ctx.resume().catch(()=>{}).then(()=>this.emitTimeline()));}interrupt(){this.interrupted=true,this.paused=false,this.drainTimer&&(clearTimeout(this.drainTimer),this.drainTimer=null);for(let e of this.activeSources)try{e.stop();}catch{}this.activeSources.clear(),this.decodedQueue.length=0,this.pendingDecodes=0,this.alignmentBaseCtxTime=null,this.scheduleCursor=0,this.timeline.reset(),this.schedulerTimer&&(clearTimeout(this.schedulerTimer),this.schedulerTimer=null),this.emitTimeline();}emitTimeline(){try{this.onTimeline?.();}catch{}}destroy(){let e=this.paused;this.interrupt();try{this.gain.disconnect(),this.analyser.disconnect();}catch{}if(this.ownsContext){try{this.ctx.state!=="closed"&&this.ctx.close().catch(()=>{});}catch{}return}(e||this.ctx.state==="suspended")&&this.ctx.resume().catch(()=>{});}};var Ds=ue(Be());var OO=({label:t="Connecting",className:e,style:n})=>(0, Ds.jsxs)("div",{className:`af-loader ${e??""}`,style:n,role:"status","aria-live":"polite","aria-label":`${t}\u2026`,children:[(0, Ds.jsx)("span",{className:"af-loader__orb","aria-hidden":"true"}),(0, Ds.jsx)("span",{className:"af-loader__letters","aria-hidden":"true",children:Array.from(t).map((i,r)=>(0, Ds.jsx)("span",{className:"af-loader__letter",style:{animationDelay:`${r*.1}s`},children:i.trim()===""?"\xA0":i},`${i}-${r}`))})]}),qd=OO;var Us=ue(Rt()),$1=ue(Gv());var X1=ue(Gv());var lI=6e4,uI=3,Kd="Renderer",q1=false,Ca=0,Fu="live",Wv=0,Uu=[],Q1=new Set,jv=new WeakMap,Yv=new WeakMap,qv=new Set,Xv=new Set,Qv=()=>{for(let t of qv)t();},Kv=t=>{for(let e of Xv)try{e(t);}catch(n){R.error(Kd,"renderer event listener threw",n);}},cI=(t,e)=>!t.isConnected&&t.width===1&&t.height===1&&typeof e=="object"&&e!==null&&"renderViaOffscreenBackBuffer"in e,fI=()=>{let t=X1.RuntimeLoader;return typeof t.isLoading!="boolean"||!("runtime"in t)?false:(t.runtime=void 0,t.isLoading=false,true)},dI=t=>{for(;Uu.length>0&&t-Uu[0]>lI;)Uu.shift();return Uu.length>=uI?false:(Uu.push(t),true)},hI=t=>{if(!Q1.delete(t)||Fu==="unrecoverable")return;let e=`${t.width}x${t.height}`;Wv=performance.now(),R.event(Kd,"shared context lost",{generation:Ca,surface:e}),Kv({type:"lost",generation:Ca,surface:e});let n=dI(Wv)?fI()?null:"runtime-unsupported":"loss-storm";if(n){R.error(Kd,"shared context unrecoverable",{generation:Ca,reason:n}),Fu="unrecoverable",Kv({type:"unrecoverable",generation:Ca,reason:n}),Qv();return}Ca+=1,Fu="recovering",Qv();},pI=(t,e)=>{if(jv.set(t,e),Q1.add(t),t.addEventListener("webglcontextlost",()=>hI(t),{once:true}),Fu!=="recovering")return;let n=Math.round(performance.now()-Wv);R.event(Kd,"shared context rebuilt",{generation:Ca,recoveryMs:n}),Fu="live",Kv({type:"recovered",generation:Ca,recoveryMs:n}),Qv();};function Zd(){if(q1||typeof HTMLCanvasElement>"u")return;q1=true;let t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(n,i){let r=t.call(this,n,i);return n==="webgl2"&&r&&!jv.has(this)&&cI(this,i)&&pI(this,r),r};let e=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(...n){let i=n[0],r=i instanceof HTMLCanvasElement?jv.get(i):void 0;r?.isContextLost()||(r&&Yv.set(this.canvas,(Yv.get(this.canvas)??0)+1),e.apply(this,n));};}var K1=()=>Ca;var Z1=t=>Yv.get(t)??0;function J1(t){return qv.add(t),()=>{qv.delete(t);}}function Jd(t){return Xv.add(t),()=>{Xv.delete(t);}}var tE=ue(Be()),mI=({src:t,artboard:e,stateMachine:n,autoBind:i,layout:r,onReady:a,onLoadError:s})=>{(0, Us.useEffect)(()=>Zd(),[]);let u=(0, Us.useRef)(a);u.current=a;let d=(0, Us.useRef)(s);d.current=s;let{rive:g,RiveComponent:v}=(0, $1.useRive)({src:t,autoplay:true,autoBind:i,useOffscreenRenderer:true,layout:r,...e&&{artboard:e},...n&&{stateMachines:n},onLoadError:A=>d.current(A instanceof Error?A:new Error("Rive load failed"))});return (0, Us.useEffect)(()=>{g&&u.current(g);},[g]),(0, tE.jsx)(v,{className:"rive-renderer-canvas"})},eE=mI;var Zv=(t,e,n)=>{for(let i of e){for(let[r,a]of Object.entries(i.properties))try{if(typeof a=="boolean"){let s=t.boolean(r);s?(s.value=a,n&&R.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (boolean)`)):n&&R.error("Renderer",`data-binding: boolean prop "${r}" not found on ${i.name}`);}else if(typeof a=="number"){let s=t.number(r);if(s)s.value=a,n&&R.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (number)`);else {let u=t.color(r);u?(u.value=a,n&&R.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (color)`)):n&&R.error("Renderer",`data-binding: prop "${r}" not found as number or color on ${i.name}`);}}else if(typeof a=="string"){let s=t.string(r);if(s)s.value=a,n&&R.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (string)`);else {let u=t.enum(r);u?(u.value=a,n&&R.debug("Renderer",`data-binding: set ${i.name}.${r} = ${a} (enum)`)):n&&R.error("Renderer",`data-binding: prop "${r}" not found as string or enum on ${i.name}`);}}}catch(s){n&&R.error("Renderer",`data-binding: exception setting ${i.name}.${r}`,s);}n&&R.debug("Renderer","data-binding: appearance overrides applied",{name:i.name});}};var nE=ue(Rt());function iE(){return (0, nE.useSyncExternalStore)(J1,K1,()=>0)}var Vu=ue(Rt());var gI=3,vI=250,AI=(t,e)=>{let n=t?.querySelector("canvas"),i=e?.getContext("2d");return !n||!e||!i||!n.width||!n.height?false:(e.width=n.width,e.height=n.height,i.drawImage(n,0,0),e.hidden=false,true)},yI=t=>{t&&(t.hidden=true,t.width=0,t.height=0);};function rE(t,e,n){let i=(0, Vu.useRef)(false);(0, Vu.useEffect)(()=>(Zd(),Jd(r=>{r.type!=="lost"||i.current||(i.current=AI(t.current,e.current));})),[t,e]),(0, Vu.useEffect)(()=>{if(!n||!i.current)return;let r=gI,a=-1,s=0,u=requestAnimationFrame(function d(g){let v=t.current?.querySelector("canvas"),A=v?Z1(v):0;A>a&&(a>=0&&(r-=1),A>0&&!s&&(s=g),a=A);let p=s>0&&g-s>=vI;if(r>0&&!p){u=requestAnimationFrame(d);return}yI(e.current),i.current=false;});return ()=>cancelAnimationFrame(u)},[n,t,e]);}var ln=ue(Be()),bI=120,_I=8,aE=()=>(0, ln.jsx)("div",{className:"rive-renderer-loader",children:(0, ln.jsx)(qd,{label:"Loading"})}),oE=()=>(0, ln.jsxs)("div",{className:"rive-renderer-error",children:[(0, ln.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, ln.jsx)("circle",{cx:"12",cy:"8",r:"3.5"}),(0, ln.jsx)("path",{d:"M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7"}),(0, ln.jsx)("line",{x1:"17",y1:"17",x2:"21",y2:"21"}),(0, ln.jsx)("line",{x1:"21",y1:"17",x2:"17",y2:"21"})]}),(0, ln.jsx)("span",{className:"rive-renderer-error-text",children:"Avatar unavailable"})]}),SI=({lastResponse:t,onPlaybackEnd:e,className:n,style:i,onRiveReady:r,onRiveError:a,resetToken:s,avatarConfig:u,error:d,loader:g,errorFallback:v,shouldArmTalking:A,isConnected:p,userActivity:_,userAttending:T,isThinking:x,thinkingSignal:N,gestureQueue:E,gestureSignal:w,onAvatarClick:C,lipSyncTuning:I,visualState:V,onSpeechClock:K,speakerMuted:F,onRegisterPlaybackControls:H,getAudioContext:J,createSpeechPlayer:Y,fit:Me,environment:Re,rigActivity:he})=>{let De=Re==="meeting",[fe,Q]=(0, ce.useState)(false),[te,D]=(0, ce.useState)(false),[U,z]=(0, ce.useState)(null),X=iE(),oe=Me?{...u?.rive?.layout||{},fit:Me}:u?.rive?.layout||null,ge=Hd(oe,u?.rive?.watermark),be=Number(u?.lipSync?.visemeMs)||40,_e=(u?.pipelineMode??"input")==="data-binding",ve=(0, ce.useRef)(r);ve.current=r;let He=(0, ce.useRef)(a);He.current=a;let ct=(0, ce.useCallback)(ne=>{z(ne),Q(true),ve.current?.();},[]),ot=(0, ce.useCallback)(ne=>{R.error("Renderer","Failed to load Avatar file",ne),D(true),He.current?.(ne);},[]),ae=(0, ce.useRef)(null),Ae=(0, ce.useRef)(null),ze=(0, ce.useRef)(null);rE(Ae,ze,U);let xe=(0, ce.useRef)(null),ye=(0, ce.useRef)(null),Ye=(0, ce.useRef)(Y??((ne,Te)=>new Yd(ne,Te))),Xe=(0, ce.useRef)([]),qe=(0, ce.useRef)(null),_t=(0, ce.useRef)(0),Tt=(0, ce.useRef)(0),mt=(0, ce.useRef)(null),gt=(0, ce.useRef)(null),Qe=(0, ce.useRef)(ne=>`${ne}`),pe=(0, ce.useRef)(false);pe.current=!!A;let y=(0, ce.useRef)(false);y.current=!!p,(0, ce.useEffect)(()=>{ye.current?.setMuted(!!F);},[F]);let c=V==="expired",m=(0, ce.useRef)(false);m.current=c;let M=(0, ce.useRef)(K);M.current=K;let O=(0, ce.useCallback)(ne=>{M.current?.(ne);},[]),B=(0, ce.useRef)(J);B.current=J;let q=(0, ce.useRef)(H);q.current=H,(0, ce.useEffect)(()=>{let ne={pause:()=>ye.current?.pause(),resume:()=>ye.current?.resume(),getOutputLevel:()=>ye.current?.getOutputLevel()??0,hasPendingAudio:()=>ye.current?.hasPendingAudio()??false,reset:()=>{Gi(),xe.current instanceof po?xe.current.interrupt():xe.current?.stop(),xe.current=null,ye.current?.destroy(),ye.current=null,O(null),_t.current=0,mt.current=null,Wt();}};return q.current?.(ne),()=>q.current?.(null)},[]);let le=(0, ce.useRef)(null);le.current=U??null;let Ne=(0, ce.useRef)(void 0);Ne.current=u?.rive?.stateMachine;let de=(0, ce.useRef)(_e);de.current=_e,(0, ce.useEffect)(()=>Jd(ne=>{ne.type==="lost"&&(he?.detach(),xe.current?.detach(),le.current?.stopRendering(),le.current=null,gt.current=null,z(null));}),[he]);let ke=(0, ce.useCallback)((ne,Te)=>{try{if(de.current){let ht=gt.current,Jt=typeof Te=="boolean"?ht?.boolean(ne):ht?.number(ne);return Jt?(Jt.value=Te,!0):!1}let Pe=le.current;if(!Pe)return !1;let Ge=$i(Pe,Ne.current).inputs.find(ht=>ht.name===ne);return Ge?(Ge.value=Te,!0):!1}catch{return false}},[]),vt=(0, ce.useCallback)((ne,Te)=>{let Pe=ke(ne,Te);return (de.current?gt.current:le.current)&&he?.reportWrite(ne,Te,Pe),Pe},[ke,he]),ft=(0, ce.useRef)(null),Ke=(0, ce.useCallback)(()=>(ft.current||(ft.current=new Ou(vt)),ft.current),[vt]),Gt=(0, ce.useRef)(null),rn=(0, ce.useRef)({has:()=>false,fire:()=>{}}),$e=(0, ce.useCallback)(()=>(Gt.current||(Gt.current=new ku((ne,Te)=>Ke().setMode(ne,Te),{},ne=>Ke().cycle(ne),ne=>Ke().has(ne),{has:ne=>rn.current.has(ne),fire:ne=>rn.current.fire(ne)})),Gt.current),[Ke]),an=(0, ce.useCallback)(()=>{$e().busy(),Ke().setMode("talking");},[$e,Ke]),Wt=(0, ce.useCallback)(()=>{$e().rest(y.current);},[$e]),jt=(0, ce.useCallback)(ne=>ne==="talking"?an():$e().resume(y.current),[an,$e]);(0, ce.useEffect)(()=>()=>Gt.current?.dispose(),[]);let Ie=u?.performance??null,zi=(0, ce.useRef)(null);(0, ce.useEffect)(()=>{if(zi.current===Ie||(zi.current=Ie,Ke().setPolicy(Ie),!Ie))return;let ne=$e();ne.configure(Ie),ne.current==="busy"?Ke().setMode("talking"):ne.resume(y.current);},[Ie,Ke,$e]),(0, ce.useEffect)(()=>{N&&$e().think();},[N,$e]),(0, ce.useEffect)(()=>{x||$e().stopThinking();},[x,$e]),(0, ce.useEffect)(()=>{_&&$e().userActivity();},[_,$e]),(0, ce.useEffect)(()=>{$e().setAttending(!!T);},[T,$e]);let Kn=(0, ce.useCallback)(()=>y.current?"listening":"idle",[]),L=(0, ce.useCallback)(()=>ye.current?.isAudioActive()||pe.current?"talking":Kn(),[Kn]);(0, ce.useEffect)(()=>{if(!U||!fe||!u||!_e)return;R.debug("Renderer","data-binding: init start",{viewModelCount:U.viewModelCount,autoBindInstance:!!U.viewModelInstance});let ne=U.viewModelInstance;if(!ne){R.error("Renderer","data-binding: rive.viewModelInstance is null after autoBind \u2014 check the .riv file has a ViewModel");return}gt.current=ne;let{format:Te,shape:Pe,matched:Ge}=Nu(et=>{try{return ne.number(et)!==null}catch{return !1}});Qe.current=Te,Ge?R.debug("Renderer","data-binding: viseme naming detected",{shape:Pe}):R.error("Renderer","data-binding: no viseme props found on the rig \u2014 lip-sync will not move");let ht=L();ht==="talking"&&R.debug("Renderer","data-binding: VM bound mid-turn \u2014 entering talking"),jt(ht);let Jt=u.rive.viewModel??[];Zv(ne,Jt,true);let dt=requestAnimationFrame(()=>Zv(ne,Jt,false));return ()=>cancelAnimationFrame(dt)},[U,fe,u,_e]),(0, ce.useEffect)(()=>{!U||!fe||_e||jt(L());},[U,fe,_e,jt,L]),(0, ce.useEffect)(()=>{if(!U||!fe||!u)return;let ne=u.rive.watermark?1:0;try{if(_e){let Te=U.viewModelInstance?.number(Ld);Te&&(Te.value=ne);}else {let{inputs:Te}=$i(U,u.rive?.stateMachine),Pe=Te.find(Ge=>Ge.name===Ld);Pe&&(Pe.value=ne);}}catch(Te){R.error("Renderer","failed to set Watermark_opacity",Te);}},[U,fe,u,_e]),(0, ce.useEffect)(()=>{if(!U||!fe)return;let ne=xe.current;ne instanceof po?ne.retarget(gt.current):ne&&ne.retarget(U,u?.rive?.stateMachine),ft.current?.reapply();},[U,fe]);let Ri=u?.rive?.stateMachine;(0, ce.useEffect)(()=>{if(!U||!fe||!he)return;let ne=_e?"data-binding":"input",Te=requestAnimationFrame(()=>{Te=requestAnimationFrame(()=>he.attach({rive:U,binding:ne,stateMachine:Ri}));});return ()=>{cancelAnimationFrame(Te),he.detach();}},[U,fe,_e,Ri,he]),(0, ce.useEffect)(()=>{A&&(an(),R.debug("Renderer","arming talking branch ahead of audio"));},[A,an]),(0, ce.useEffect)(()=>{ye.current?.isAudioActive()||p&&pe.current||(p?$e().connect():Wt());},[p,Wt,$e]);let Fr=(0, ce.useCallback)(ne=>{let Te=le.current;if(!Te)return;let{input:Pe,type:Ge,value:ht,binding:Jt,resetMs:dt}=Iu(ne,u?.rive?.gestures,_e);R.debug("Renderer","gesture: firing",{name:ne,input:Pe,type:Ge,binding:Jt}),he?.reportGesture(ne,Pe);try{if(Jt==="data-binding"){let et=gt.current;if(!et)return;if(Ge==="trigger")et.trigger(Pe)?.trigger();else if(Ge==="boolean"){let Ct=et.boolean(Pe);Ct&&(Ct.value=ht!==0,dt&&setTimeout(()=>{let Ot=gt.current?.boolean(Pe);Ot&&(Ot.value=!1);},dt));}else {let Ct=et.number(Pe);Ct&&(Ct.value=ht);}}else {let{name:et,inputs:Ct}=$i(Te,u?.rive?.stateMachine),Ot=Ct.find(St=>St.name===Pe);if(!Ot)return;Ge==="trigger"?(Ot.fire(),he?.reportTrigger(Pe)):Ge==="boolean"?(Ot.value=ht!==0,dt&&setTimeout(()=>{let St=(et?le.current?.stateMachineInputs(et):null)?.find(gn=>gn.name===Pe);St&&(St.value=!1);},dt)):Ot.value=ht;}}catch(et){R.error("Renderer",`gesture: failed to fire "${ne}"`,et);}},[u,_e,he]),Zn=(0, ce.useCallback)(ne=>{let Te=le.current;if(!Te)return false;let{input:Pe,type:Ge,binding:ht}=Iu(ne,u?.rive?.gestures,_e);if(Ge!=="trigger")return false;try{if(ht==="data-binding")return !!gt.current?.trigger(Pe);let{inputs:Jt}=$i(Te,u?.rive?.stateMachine);return Jt.some(dt=>dt.name===Pe)}catch{return false}},[u,_e]);rn.current={has:Zn,fire:Fr};let Gi=(0, ce.useCallback)(()=>{for(let ne of Xe.current)ne();Xe.current=[];},[]),we=(0, ce.useCallback)(ne=>{let{name:Te,atMs:Pe,speechless:Ge}=ne,ht=()=>{ne.beep?ye.current?.playBeep():Fr(Te);};if(Pe==null){R.debug("Renderer","gesture: scheduling",{name:Te,mode:"immediate"}),ht();return}let Jt=!!ye.current?.isAudioActive(),dt=Ge==null?Jt:!Ge;R.debug("Renderer","gesture: scheduling",{name:Te,atMs:Pe,speechless:Ge,audioActive:Jt,mode:dt?"alignment":"delay"});let et={cancel:()=>{}},Ct=()=>{Xe.current=Xe.current.filter(Ot=>Ot!==et.cancel);};if(dt){let Ot=Pe/1e3,St=requestAnimationFrame(function gn(){let ar=ye.current;if(ar){if(ar.getAlignmentTime()>=Ot){R.debug("Renderer","gesture: firing (alignment reached)",{name:Te,atMs:Pe,alignmentMs:Math.round(ar.getAlignmentTime()*1e3)}),Ct(),ht();return}St=requestAnimationFrame(gn);}});et.cancel=()=>cancelAnimationFrame(St);}else {let Ot=window.setTimeout(()=>{R.debug("Renderer","gesture: firing (delay elapsed)",{name:Te,atMs:Pe}),Ct(),ht();},Pe);et.cancel=()=>clearTimeout(Ot);}Xe.current.push(et.cancel);},[Fr]);(0, ce.useEffect)(()=>{if(!U||!fe)return;let ne=E?.current;if(!ne||ne.length===0)return;let Te=ne.splice(0,ne.length);for(let Pe of Te)we(Pe);},[w,U,fe,E,we]),(0, ce.useEffect)(()=>Gi,[Gi]);let Jn=(0, ce.useCallback)(()=>{let ne=ye.current;if(!ne)return ev;let Te=I?.offsetSec??0;return Math.min(ne.getAlignmentTime()+Te,ne.getPlayableAlignmentTime()+Te+.5)},[I]),Vr=(0, ce.useCallback)(()=>!!ye.current?.isPlaybackScheduled(),[]),Na=(0, ce.useCallback)(async()=>{if(!fe||!t)return;let{audioChunks:ne,alignments:Te,sessionId:Pe,jobId:Ge,chunkOffset:ht}=t;if(an(),mt.current!==Ge&&(mt.current!==null&&(xe.current?.clearVisemes(),xe.current instanceof po&&xe.current.prepareSpeech()),_t.current=0),mt.current=Ge,qe.current!==Pe&&(R.debug("Renderer","new epoch \u2192 reset audio + lipsync"),xe.current?.stop(),xe.current=null,ye.current?.destroy(),ye.current=null,O(null),qe.current=Pe,_t.current=0),!xe.current||!ye.current){xe.current&&(xe.current.stop(),xe.current=null),R.debug("Renderer","init audio + lipsync"),ye.current||(ye.current=Ye.current(()=>{let et=e?.()===true;xe.current?.clearVisemes(),xe.current?.forceSilence(),et&&y.current?$e().restThinking():Wt();},B.current?.()??null),ye.current.setMuted(!!F),O(()=>ye.current?.isPlaybackScheduled()?ye.current.getAlignmentTime():null));let dt=u?.pipelineMode??"input";if(R.debug("Renderer","engine selection",{pipelineMode:dt,lipSyncVmReady:!!gt.current}),dt==="data-binding"){let et=gt.current;if(!et&&U){R.error("Renderer","data-binding: lip-sync ViewModel not initialized \u2014 was bindViewModelInstance called before first speak?");return}let Ct=new po;Ct.initialize(et,{getAlignmentTime:Jn,isLive:Vr},I),xe.current=Ct;}else {let et=new Gd;et.initialize(U,{getAlignmentTime:Jn,isLive:Vr},u?.rive?.stateMachine,I),xe.current=et;}xe.current.start();}ht>_t.current&&R.error("Renderer","gap in TTS chunks \u2014 a speak batch was dropped",{expected:_t.current,got:ht,jobId:Ge});let Jt=Math.max(0,_t.current-ht);for(let dt=Jt;dt<ne.length;dt++){let et=ne[dt],Ct=Te[dt];if(_t.current=ht+dt+1,!et)continue;if(!Ct){ye.current.enqueueSequentialChunk(et),R.debug("Renderer","appended sequential (no-alignment) chunk",{index:ht+dt});continue}let Ot=Ct.character_start_times_seconds[0]??0,St=t.visemes?.[dt]??dd(Ct,be);if(ye.current.enqueueChunk(et,Ot),xe.current.appendVisemes(St),R.debug("Renderer","appended chunk",{alignmentStart:Ot,firstViseme:St[0],lastViseme:St[St.length-1],alignmentNow:ye.current.getAlignmentTime()}),t.isGreeting){let gn=Ct.character_end_times_seconds;R.event("Renderer","greeting chunk queued",{chunkIndex:ht+dt,totalChunks:ne.length,alignmentStart:Ot,alignmentSpan:gn?.[gn.length-1]??null,chars:Ct.characters?.length??0,visemeCount:St.length,firstVisemeStart:St[0]?.start??null,clockAtQueue:ye.current.getAlignmentTime()});}}},[t,U,fe,e,be,u,_e,an,Wt,$e,O,Jn,Vr,I]),fi=()=>{Gi(),xe.current?.stop(),xe.current=null,ye?.current?.destroy(),ye.current=null,O(null),ft.current?.stop(),qe.current=null,_t.current=0,mt.current=null,Wt();};(0, ce.useEffect)(()=>{if(!U)return;let ne=()=>{U&&(U.layout=Hd(oe,u?.rive?.watermark),U.resetArtboardSize?.());};return U.on(Hu.EventType.Load,ne),U?.isPlaying&&ne(),()=>{U.off(Hu.EventType.Load,ne);}},[U]),(0, ce.useEffect)(()=>{if(!U)return;let ne=Te=>{if(Array.isArray(Te.data))for(let Pe of Te.data)typeof Pe=="string"&&$e().rigEntered(Pe);};return U.on(Hu.EventType.StateChange,ne),()=>U.off(Hu.EventType.StateChange,ne)},[U,$e]),(0, ce.useEffect)(()=>{U&&(U.layout=Hd(oe,u?.rive?.watermark));},[U,Me,u]),(0, ce.useEffect)(()=>{let ne=ae.current;if(!ne||!U)return;let Te=0,Pe=null,Ge=()=>{let dt=ne.querySelector(".rive-renderer-canvas > canvas");if(!dt)return;let et=dt.clientWidth;if(!et)return;let Ct=dt.getBoundingClientRect(),Ot=Ct.width/et;if(!Ot||!isFinite(Ot))return;let gn=(De?1:window.devicePixelRatio||1)/Ot;dt.width===Math.trunc(gn*Ct.width)&&dt.height===Math.trunc(gn*Ct.height)||U.resizeDrawingSurfaceToCanvas?.(gn);},ht=()=>{Pe&&clearTimeout(Pe),Pe=setTimeout(()=>{cancelAnimationFrame(Te),Te=requestAnimationFrame(Ge);},bI);},Jt=new ResizeObserver(ht);return Jt.observe(ne),Te=requestAnimationFrame(Ge),()=>{Pe&&clearTimeout(Pe),cancelAnimationFrame(Te),Jt.disconnect();}},[U,De]),(0, ce.useEffect)(()=>{if(t&&fe&&Na(),!t&&U){if((u?.pipelineMode??"input")==="data-binding"){let Te=gt.current;if(Te){for(let Pe=1;Pe<=21;Pe++)try{let Ge=Te.number(Qe.current(Pe));Ge&&(Ge.value=0);}catch{}try{let Pe=Te.number(Qe.current(0));Pe&&(Pe.value=100);}catch{}}}else {let{inputs:Te}=$i(U,u?.rive?.stateMachine);Te.forEach(Pe=>{let Ge=fo(Pe.name);Ge!==null&&(Pe.value=Ge===0?100:0);});}m.current||(pe.current?an():Wt());}},[U,fe,t,Na,u,A]),(0, ce.useEffect)(()=>()=>{try{fi();}catch(ne){R.error("Renderer","Reset failed",ne);}},[]),(0, ce.useEffect)(()=>{s!==Tt.current&&(Tt.current=s,fi());},[s]);let ir=(0, ce.useRef)(null);if(!u)return (0, ln.jsx)("div",{className:`rive-renderer-root ${d?.fatal?"":"rive-renderer-root--loading"} ${n??""}`,style:i,children:d?.fatal?v??(0, ln.jsx)(oE,{}):g??(0, ln.jsx)(aE,{})});let wo=C&&fe?{onPointerDown:ne=>{ir.current={x:ne.clientX,y:ne.clientY};},onClick:ne=>{let Te=ir.current;ir.current=null,!(!Te||Math.hypot(ne.clientX-Te.x,ne.clientY-Te.y)>_I)&&C();}}:null,rr=!te&&!fe,Hr=te?v??(0, ln.jsx)(oE,{}):rr?g??(0, ln.jsx)(aE,{}):null;return (0, ln.jsxs)("div",{className:`rive-renderer-root ${rr?"rive-renderer-root--loading":""} ${n??""}`,style:{...i,...c?{filter:"grayscale(1)",transition:"filter 600ms ease"}:null},children:[(0, ln.jsxs)("div",{className:"rive-renderer-canvasWrapper",ref:ae,...wo,children:[(0, ln.jsx)("div",{className:"rive-renderer-surface",ref:Ae,children:(0, ln.jsx)(eE,{src:u.rive?.src,artboard:u.rive?.artboard,stateMachine:u.rive?.stateMachine,autoBind:_e,layout:ge,onReady:ct,onLoadError:ot},X)}),(0, ln.jsx)("canvas",{ref:ze,className:"rive-renderer-hold",hidden:true,"aria-hidden":"true"})]}),Hr]})},sE=(0, ce.memo)(SI);var er=ue(Rt());var Fs=ue(Be()),EI=.08,MI=6e3,lE=t=>t.speaker==="avatar"&&!t.isFinal&&t.words.some(e=>e.end>0),TI=({store:t,speechClockRef:e,position:n="bottom-center",controlsVisible:i,className:r,style:a})=>{let s=(0, er.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot),u=i&&n.startsWith("bottom"),d=s.slice(-2),g=d.find(lE)??null,[v,A]=(0, er.useState)(0),[p,_]=(0, er.useState)(false),T=(0, er.useRef)(null);T.current=g,(0, er.useEffect)(()=>{if(!g)return;A(0);let N=0,E=()=>{let w=T.current,C=e.current?.();if(w&&C!=null){let I=md(w,C+EI);A(V=>I>V?I:V);}N=requestAnimationFrame(E);};return N=requestAnimationFrame(E),()=>cancelAnimationFrame(N)},[g?.id,e]),(0, er.useEffect)(()=>{if(_(false),!s[s.length-1]?.isFinal)return;let E=setTimeout(()=>_(true),MI);return ()=>clearTimeout(E)},[s]);let x=d.map(N=>({entry:N,wordCount:lE(N)?Math.min(v,N.words.length):N.words.length})).filter(N=>N.wordCount>0);return x.length?(0, Fs.jsx)("div",{className:["avatar-captions",`avatar-captions--${n}`,u?"avatar-captions--raised":"",p?"avatar-captions--hidden":"",r??""].filter(Boolean).join(" "),style:a,role:"log","aria-live":"polite",children:x.map(({entry:N,wordCount:E},w)=>(0, Fs.jsxs)("p",{className:`avatar-captions-line avatar-captions-line--${N.speaker} ${w===x.length-1?"":"avatar-captions-line--past"}`,children:[N.speaker==="user"&&(0, Fs.jsx)("span",{className:"avatar-captions-tag",children:"You"}),N.words.slice(0,E).map((C,I)=>(0, Fs.jsx)("span",{className:`avatar-captions-word ${N.isFinal?"":"avatar-captions-word--interim"}`,children:C.text},`${I}-${C.text}`))]},N.id))}):null},uE=TI;var cE=ue(Rt()),mo=ue(Be()),CI={network:{title:"Your connection is unstable",detail:"Check your internet \u2014 audio may drop until it recovers."},device:{title:"Your device is struggling to keep up",detail:"Closing other tabs or apps should help."},service:{title:"Responses are running slow",detail:"It's on our side \u2014 replies may lag for a bit."}},RI=({store:t,position:e="bottom-left",controlsVisible:n,className:i,style:r})=>{let s=(0, cE.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot).concern;if(!s||s.state!=="degraded")return null;let u=CI[s.scope],d=n&&e.startsWith("bottom");return (0, mo.jsxs)("div",{className:["avatar-status-banner",`avatar-status-banner--${e}`,`avatar-status-banner--${s.state}`,d?"avatar-status-banner--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite",children:[(0, mo.jsx)("span",{className:"avatar-status-banner-dot","aria-hidden":"true"}),(0, mo.jsxs)("span",{className:"avatar-status-banner-text",children:[(0, mo.jsx)("span",{className:"avatar-status-banner-title",children:u.title}),(0, mo.jsx)("span",{className:"avatar-status-banner-detail",children:u.detail})]})]})},fE=RI;var Vs=ue(Be()),xI=({visible:t,position:e="top-left",controlsVisible:n,className:i,style:r})=>{if(!t)return null;let a=n&&e.startsWith("bottom");return (0, Vs.jsxs)("div",{className:["avatar-thinking-indicator",`avatar-thinking-indicator--${e}`,a?"avatar-thinking-indicator--raised":"",i??""].filter(Boolean).join(" "),style:r,role:"status","aria-live":"polite","aria-label":"The avatar is thinking",children:[(0, Vs.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, Vs.jsx)("span",{className:"avatar-thinking-indicator-dot"}),(0, Vs.jsx)("span",{className:"avatar-thinking-indicator-dot"})]})},dE=xI;var Dt=ue(Be()),zu=({size:t=22,children:e})=>(0, Dt.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e}),$d=({muted:t,size:e})=>(0, Dt.jsxs)(zu,{size:e,children:[(0, Dt.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, Dt.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, Dt.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),t&&(0, Dt.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),eh=({muted:t,size:e})=>(0, Dt.jsxs)(zu,{size:e,children:[(0, Dt.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, Dt.jsxs)(Dt.Fragment,{children:[(0, Dt.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, Dt.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, Dt.jsxs)(Dt.Fragment,{children:[(0, Dt.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, Dt.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),hE=({size:t})=>(0, Dt.jsx)(zu,{size:t,children:(0, Dt.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),th=({size:t})=>(0, Dt.jsx)(zu,{size:t,children:(0, Dt.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),nh=({size:t})=>(0, Dt.jsxs)(zu,{size:t,children:[(0, Dt.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, Dt.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]});var Pn=ue(Be()),kI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isMicMuted:a,isSpeakerMuted:s,setMicMuted:u,setSpeakerMuted:d,showStopSpeaking:g,isSpeaking:v,stopSpeaking:A})=>(0, Pn.jsx)("div",{className:`avatar-controls-root ${i}`,children:t?(0, Pn.jsx)("button",{type:"button",onClick:e,className:"avatar-controls-button avatar-controls-call","aria-label":"Start call",disabled:!r,children:(0, Pn.jsx)(th,{})}):(0, Pn.jsxs)(Pn.Fragment,{children:[(0, Pn.jsx)("button",{type:"button",onClick:()=>u(!a),className:`avatar-controls-button avatar-controls-mute${a?" avatar-controls-muted":""}`,"aria-label":a?"Unmute microphone":"Mute microphone","aria-pressed":a,children:(0, Pn.jsx)($d,{muted:a})}),(0, Pn.jsx)("button",{type:"button",onClick:()=>d(!s),className:`avatar-controls-button avatar-controls-mute${s?" avatar-controls-muted":""}`,"aria-label":s?"Unmute avatar audio":"Mute avatar audio","aria-pressed":s,children:(0, Pn.jsx)(eh,{muted:s})}),g&&v&&(0, Pn.jsx)("button",{type:"button",onClick:A,className:"avatar-controls-button avatar-controls-stop-speaking","aria-label":"Stop the avatar from speaking",children:(0, Pn.jsx)(hE,{})}),(0, Pn.jsx)("button",{type:"button",onClick:n,className:"avatar-controls-button avatar-controls-hangup","aria-label":"End call",children:(0, Pn.jsx)(nh,{})})]})}),pE=kI;var go=ue(Rt()),tr=ue(Be()),OI=t=>{let e=t;if(!e?.tagName)return false;let n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||e.isContentEditable},II=({isTalking:t,isSpeaking:e,startTalking:n,stopTalking:i,spacebar:r,disabled:a=false})=>{let s=(0, go.useRef)({isTalking:t,startTalking:n,stopTalking:i,disabled:a});s.current={isTalking:t,startTalking:n,stopTalking:i,disabled:a};let u=t?"Listening":e?"Hold to interrupt":"Hold to talk",d=(0, go.useCallback)(v=>{a||v.button!==0||(v.currentTarget.setPointerCapture?.(v.pointerId),n());},[a,n]),g=(0, go.useCallback)(()=>i(),[i]);return (0, go.useEffect)(()=>{if(!r)return;let v=_=>{_.code!=="Space"||_.repeat||OI(_.target)||s.current.disabled||(_.preventDefault(),s.current.startTalking());},A=_=>{_.code!=="Space"||!s.current.isTalking||(_.preventDefault(),s.current.stopTalking());},p=()=>{s.current.isTalking&&s.current.stopTalking();};return window.addEventListener("keydown",v),window.addEventListener("keyup",A),window.addEventListener("blur",p),()=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",A),window.removeEventListener("blur",p);}},[r]),(0, tr.jsxs)("button",{type:"button",className:`avatar-ptt-button${t?" avatar-ptt-holding":""}`,disabled:a,"aria-label":u,"aria-pressed":t,onPointerDown:d,onPointerUp:g,onPointerCancel:g,onContextMenu:v=>v.preventDefault(),children:[(0, tr.jsx)("span",{className:"avatar-ptt-halo","aria-hidden":"true"}),(0, tr.jsxs)("span",{className:"avatar-ptt-face",children:[(0, tr.jsxs)("svg",{className:"avatar-ptt-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0, tr.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0, tr.jsx)("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),(0, tr.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"22"})]}),(0, tr.jsx)("span",{className:"avatar-ptt-label",children:u},u)]})]})},mE=II;var Bt=ue(Be()),PI=({muted:t})=>(0, Bt.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, Bt.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4V5z"}),t?(0, Bt.jsxs)(Bt.Fragment,{children:[(0, Bt.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0, Bt.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0, Bt.jsxs)(Bt.Fragment,{children:[(0, Bt.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0, Bt.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})]}),NI=({isIdle:t,start:e,stop:n,className:i="",avatarReady:r,isSpeakerMuted:a,setSpeakerMuted:s,isTalking:u,isSpeaking:d,startTalking:g,stopTalking:v,spacebar:A})=>t?(0, Bt.jsx)("div",{className:`avatar-ptt-root ${i}`,children:(0, Bt.jsxs)("button",{type:"button",onClick:e,className:"avatar-ptt-connect","aria-label":"Start call",disabled:!r,children:[(0, Bt.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0, Bt.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),(0, Bt.jsx)("span",{children:"Connect"})]})}):(0, Bt.jsxs)("div",{className:`avatar-ptt-root ${i}`,children:[(0, Bt.jsx)("button",{type:"button",onClick:()=>s(!a),className:`avatar-ptt-secondary${a?" avatar-ptt-secondary-off":""}`,"aria-label":a?"Unmute avatar audio":"Mute avatar audio","aria-pressed":a,children:(0, Bt.jsx)(PI,{muted:a})}),(0, Bt.jsx)(mE,{isTalking:u,isSpeaking:d,startTalking:g,stopTalking:v,spacebar:A}),(0, Bt.jsx)("button",{type:"button",onClick:n,className:"avatar-ptt-secondary avatar-ptt-hangup","aria-label":"End call",children:(0, Bt.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0, Bt.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"}),(0, Bt.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]})})]}),gE=NI;var ih=ue(Rt()),at=ue(Be()),Jv=()=>(0, at.jsx)("span",{className:"avatar-pip-swap-hint","aria-hidden":"true",children:(0, at.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",children:(0, at.jsx)("path",{d:"M4 10V4h6M20 14v6h-6",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),vE=()=>(0, at.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, at.jsx)("path",{d:"M16 10.5V8a2 2 0 0 0-2-2H6.5M3 6.5V16a2 2 0 0 0 2 2h9M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0, at.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),LI=()=>(0, at.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, at.jsx)("rect",{x:"3",y:"6",width:"13",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, at.jsx)("path",{d:"M16 13.5l5 3.5V7l-5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),DI=({on:t})=>(0, at.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, at.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0, at.jsx)("path",{d:"M8.5 14.5c.9 1.2 2.1 1.8 3.5 1.8s2.6-.6 3.5-1.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, at.jsx)("path",{d:"M9 9.5h.01M15 9.5h.01",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round"}),!t&&(0, at.jsx)("path",{d:"M3 3l18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),BI=({on:t,toggle:e})=>(0, at.jsxs)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":"Detect mood",title:t?"Detect mood: on":"Detect mood: off",className:`avatar-camera-preview-mood${t?" on":""}`,onClick:e,children:[(0, at.jsx)(DI,{on:t}),(0, at.jsx)("span",{className:"avatar-camera-preview-mood-label",children:"Detect mood"}),(0, at.jsx)("span",{className:"avatar-camera-preview-mood-track","aria-hidden":"true",children:(0, at.jsx)("span",{className:"avatar-camera-preview-mood-knob"})})]}),UI=({sessionOpen:t,stream:e,mirrored:n=true,corner:i="bottom-right",variant:r="corner",onSwap:a,onToggleVideo:s,onFlip:u,mood:d})=>{let g=(0, ih.useRef)(null),v=e!==null;return (0, ih.useEffect)(()=>{let A=g.current;A&&(A.srcObject=e,e&&A.play().catch(()=>{}));},[e]),t?(0, at.jsxs)("div",{className:`avatar-camera-preview ${r==="stage"?"stage":i}${v?"":" video-off"}${a?" swappable":""}`,...a&&{role:"button",tabIndex:0,"aria-label":"Show camera full size",onClick:a,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a());}},children:[v?(0, at.jsx)("video",{ref:g,className:`avatar-camera-preview-video${n?" mirrored":""}`,playsInline:true,muted:true,autoPlay:true}):(0, at.jsxs)("div",{className:"avatar-camera-preview-off","aria-label":"Video off",children:[(0, at.jsx)(vE,{}),(0, at.jsx)("span",{children:"Video off"})]}),a&&(0, at.jsx)(Jv,{}),(0, at.jsxs)("div",{className:"avatar-camera-preview-actions",onClick:A=>A.stopPropagation(),children:[d&&v&&(0, at.jsx)(BI,{on:d.on,toggle:d.toggle}),u&&v&&(0, at.jsx)("button",{type:"button",className:"avatar-camera-preview-btn",onClick:u,title:"Switch camera","aria-label":"Switch camera",children:(0, at.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, at.jsx)("path",{d:"M4 8a6 6 0 0 1 10-4.5M20 16a6 6 0 0 1-10 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0, at.jsx)("path",{d:"M4 4v4h4M20 20v-4h-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),s&&(0, at.jsx)("button",{type:"button",className:`avatar-camera-preview-btn${v?"":" off"}`,onClick:s,title:v?"Turn off video":"Turn on video","aria-label":v?"Turn off video":"Turn on video","aria-pressed":!v,children:v?(0, at.jsx)(vE,{}):(0, at.jsx)(LI,{})})]})]}):null},AE=UI;var ci=ue(Be()),FI=()=>(0, ci.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0, ci.jsx)("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0, ci.jsx)("path",{d:"M8 20h8M12 16v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),VI=({phase:t,onShare:e,onDismiss:n,onStop:i,position:r="top-center",controlsVisible:a,className:s,style:u})=>{if(t!=="awaiting_click"&&t!=="live")return null;let d=a&&r.startsWith("bottom"),g=["avatar-screen-share",`avatar-screen-share--${r}`,t==="live"?"live":"",d?"avatar-screen-share--raised":"",s??""].filter(Boolean).join(" ");return t==="awaiting_click"?(0, ci.jsxs)("div",{className:g,style:u,role:"group","aria-label":"Screen sharing request",children:[(0, ci.jsxs)("button",{type:"button",className:"avatar-screen-share-primary",onClick:e,children:[(0, ci.jsx)(FI,{}),"Share your screen"]}),(0, ci.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:n,children:"Not now"})]}):(0, ci.jsxs)("div",{className:g,style:u,role:"status",children:[(0, ci.jsx)("span",{className:"avatar-screen-share-dot","aria-hidden":"true"}),(0, ci.jsx)("span",{children:"Sharing your screen"}),(0, ci.jsx)("button",{type:"button",className:"avatar-screen-share-secondary",onClick:i,children:"Stop"})]})},yE=VI;var _h=ue(Rt());var ee=ue(Rt());var bE=`
19
+ class PCMProcessor extends AudioWorkletProcessor {
20
+ process(inputs) {
21
+ const input = inputs[0];
22
+ if (!input || !input[0]) return true;
23
+
24
+ const channelData = new Float32Array(input[0]);
25
+ this.port.postMessage(channelData, [channelData.buffer]);
26
+
27
+ return true;
28
+ }
29
+ }
30
+
31
+ registerProcessor("pcm-processor", PCMProcessor);
32
+ `;var HI={};var vo=()=>HI;async function rh(t){let e=()=>t.state==="running";for(let n=0;n<5;n++){if(e())return true;if(t.state==="closed")return false;await Promise.race([t.resume().catch(()=>{}),new Promise(i=>setTimeout(i,400))]);}return e()}function _E(t,e){let n=2*Math.PI*t/e,i=Math.cos(n),r=Math.sin(n)/(2*Math.SQRT1_2),a=1+r,s=(1-i)/2/a,u=(1-i)/a,d=s,g=-2*i/a,v=(1-r)/a,A=0,p=0,_=0,T=0;return x=>{for(let N=0;N<x.length;N++){let E=x[N],w=s*E+u*A+d*p-g*_-v*T;p=A,A=E,T=_,_=w,x[N]=w;}}}function zI(t){let e=t/16e3,n=t>16e3?_E(7e3,t):null,i=t>16e3?_E(7e3,t):null,r=1,a=0;return s=>{let u=s.length;if(u===0)return new Float32Array(0);let d=s.slice();n&&i&&(n(d),i(d));let g=Math.max(0,Math.ceil((u-r)/e)),v=new Float32Array(g);for(let A=0;A<g;A++){let p=Math.floor(r),_=r-p,T=p===0?a:d[p-1],x=d[p];v[A]=T*(1-_)+x*_,r+=e;}return a=d[u-1],r-=u,v}}async function SE(t,e,n){let i=new AudioContext(n!=null?{sampleRate:n}:void 0);try{await i.audioWorklet.addModule(e);let r=i.createMediaStreamSource(t),a=new AudioWorkletNode(i,"pcm-processor");return {ctx:i,source:r,worklet:a}}catch(r){throw i.state!=="closed"&&i.close().catch(()=>{}),r}}async function wE(t,e,n){let i=n?.sampleRate??16e3,r=n?.workletUrl??vo().pcmWorklet,a=r??URL.createObjectURL(new Blob([bE],{type:"application/javascript"})),s;try{try{s=await SE(t,a,i);}catch(T){R.warn("Audio","Mic graph failed at requested rate; retrying at hardware rate",{requested:i,error:String(T)}),s=await SE(t,a,void 0);}}finally{r||URL.revokeObjectURL(a);}let{ctx:u,source:d,worklet:g}=s;rh(u).then(T=>{n?.onSettled?.(),!(T||u.state==="closed")&&(R.warn("Audio","Mic AudioContext stayed suspended; uplink is silent"),n?.onBlocked?.());});let v=u.sampleRate,A=v!==16e3,p=A?zI(v):null;A&&R.warn("Audio","AudioContext rate is not 16kHz; resampling mic uplink",{requested:i,actual:v});let _=n?.onFloat32;return g.port.onmessage=T=>{let x=T.data,N=p?p(x):x;if(N.length===0)return;let E=new Int16Array(N.length);for(let w=0;w<N.length;w++)E[w]=Math.max(-1,Math.min(1,N[w]))*32767;_&&_(p?N:N.slice()),e(E);},d.connect(g),{stop(){try{g.disconnect();}catch{}try{d.disconnect();}catch{}try{u.state!=="closed"&&u.close().catch(()=>{});}catch{}}}}var EE="data:audio/mpeg;base64,//NoxAAQoEqwX0YYAgWUtG/4iIiP4gmnbGEAQgg8Hwffghh/D+UdwflAxhgDg+D4P1AgGMH//0f/xOD74gBAEDkTg+f1BjB8P/xOH//lAQTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAyU8beX5qYAoBQKBQKBQKRWKhaLRaI66OG/9uYyG5nliZ+kagG+7LE/aonsG5wGQguIG4Buhk4VQwHQwFRjnDPEBJgvkKpRHG4gOK4LMH8zHkZMrmiZgbtoldJM8Zm6kFLrq5u6CabS2QA8SBP0urqQKiaCFNZoXzU+m6zdP/17ugzJGhoT5FB6JkkhhEAJEUiITDIjm/9tNjRbp6lpvxWghcmSZJIc4qk+XiGk0LmHk+b///ZbvdNr/5iRMexwJEMIeOQQwi45iBBy4fWbm5uRRMA//NoxAAxM6qIDd2gAAtTM1rEplLKRQC2TSSBGtNNMAAdMJiRM2QgMGwMZMn6o2UACYSlOdTBiYyCmYPAypqocIQAEBRBEmyqVTQdAJjgMDJANEAKBiQHkXQFQADAYQCI4gKBOsXh3OklOniuhWgdLpgipTutkUUUWRRR6VJKit0HRRy8pjJToOK4bKMUTVFFraSST6LM9FJ0kkv86pMsD4E4l1FT3SrVbrqSSRZFettLRRszoE+I2SWicU9X/U6Js+o1fZReRRV0TyyImQlhj9+lMQU1FAAA//NoxAAlK8acvtjbTcHLdvf5d9i9yXPS99B9utHCoOi1FG4OeF8C3ZhQwfsRpePfGLdnVu1VuY8pyoFWX1jeGqCRZ5579mRST6Yxcoq+R8FEv/Skv4kmLJofL6TM0FrLE00PmyXZSOs460ElPf91JJuXA+BSl5NKp7LXUqtbsu3//6hiiRbX9n++dJSjLtbcxL7vsplBFjymSLpQNn4hp+XSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAqO8ZwHOpbLAoVyV2U25ungghAEmA93XVf1ebIiExzTMHEk1eo5GCIDAUCTAqCDagsRwNAEAu480iMvJFY/HHnh0lAQwQE+CEHl1RkugFQUhvSMpCe4yzZtjvvwED1vV2yyq/dz1GU36mpNPVnPR2ok8EhKaJ1GtVRl9T6nVMUdVS209FFRkEEJS61amu6/XWtv/tq60R9BaE7myP/+t2qTX90n+kZjhIDrOoGZpvfydCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxw9qxVsofVoQGvVss/nr/weufw+o1xZagafii6k2sP27AikB07rRSG5fKHftP5ORNy5cwycYhFY3G599IEic/Xt4A0MLeKp7SveyzyDHvdj4Mm0l40k9FeKhXIp7SqyDCw/AoRBcyT7IFBovANx6JLwKKKKL2KGFnwL2iS8Gg9QxwU4+nNOPU/GUdnk0HNP7a3Ahv4DyVQNbPI8mY3N4/wyVf3s8uXQOFjjxJr71/n/4zf7tjX+bZtT3+vu+NZ3TKncMXjtGIe/iPJQ2ho6tMQU1F//NoxAAvM96kBt5QmQXNLKmeW5Owl+r8uX1HQYPmnYxgi+D0DVORLLLIJh4cwXig5DFqCcym0QQ2hSXq6Z0tsAhh+xraSravxAQhKMA2y2B+YCi0qcGxcv3t0sax0noIQ6smuxEHs0qQHaXbWNEnMeUKnXNWw4c3K4bD2lqLGSsNRTuqHOa4rRQ8k1oprpUaV5W2ldtq+Pu/uogtVHRbyOKtozb4ememuuJ9I9l5jsdfIxDnHbOa0c010LGzMMo4erQcbMLUOQ+IWTEFNRQMACQgABAAAAAA//NoxAArM9qUDuNRbSqPeP1MZyq/qTpQIYk5j+s6hZjXOHMRihcqyfp27CITiRpkWdnPCVzdaedhhzUiQDGfQenohPg6Vt6BQcRI+KxV/qH7k1f5jrVe9paK2WZF50rI0kUcyNjFCutFSWmkZO3mTOy0FhYmjr1ttpWqM3C1/yTXEcM26zE1XCKrX1yt8RDMdyvqv/w1//P/txxMSuugswsc0hl2qclSih0M2qjr4p4Kuq1NgioQZ8WVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsY8J8FurLUQgbjjXprUEPq5QWAEWLhPxaqfDcwwFTG2CD5kIzDkBx4QS+6D69gsD40hr/U7d2nvtLn9d6ILJQtHQHKoKmgAwBQD0M1RCEBxICAqEJkqEwyAcALpe+KmhQ1FjIVmKjlGjnNeeTfFw6W6TYh0N9rozj//69gFyfF9/Ef9BJeecSeZ6mYuxWvXqzmtsy0Mli5SpVWIeT1ar5hG/b+bEs4kIPooQD5Lzy3H1GxcXfBjDvapTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAA//NoxAAo88KEHu6alA4pJZaPlaT1YgzAMFVyIzKmhgABDD0CjlkaDLiUoXTeF8UpDUB3ihbY5VTR6U8lUPQxcLwH9SiTZVUwQtTKGBwicAwxCMxqzVLpgU3ZVGbMy5ifN32ol1BVVZyrer+l+yC2TE9BtGpQQZR2q30vSZf79SV/PJrUtKi95qkfQWpnWizbsfTSU1uuvff//1mJtH030rOYrWm2+ktGYJnjxV2FRLUhMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAnpA6cFNGHQRqf7P+fuVt0QEpdoC0w2DppmNsnVXAYYxByHznltQVqJsPS/UHQcWI/FWhib7ppgwu0R9JBlZdMqi1TuPRW5eAwGFkyd46dhxbv13c4gAAO7v8iObn/9d3dz/d3d3Afd3f0Rz/iIjn8RERz9EREPRERE+Iif5In7u6fa7u5e7u7n9f/R3dzRE//JE0AAAQgQARMi//0T///rv/XdwNw9MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3BqMDOZQlSCNTWuW5mWJPGGAKY0TQYSWvOK6JiRPnjw6jMiUBioHQlBWwDZAEQDFFml1LNXTZdpYZQJFZnTzAmJvbUOPsy0YfSgh93n2hVIUDYRnDktrCIWvJJnmVFRU0VFYlRUVFRUV/+pVVZmj6VWFmv6Ulm5quV+a/H88rXBzKqrVQ2qytZTWtfdlM39tcX////fzX/zUmrWqk1Iqq338M2xtcCxTeq8MzXx1DM3BTft3DMocs+bhSYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAArLA54HuoPWQnGoQI699JMZNAEYQBgwGD7KGK4KhUBlZ1gjB1mzt8OgwH14EIcv0vAwHEAwjBOOv4+bpAkCI4gOzwp5qCEyRkVWgOnFZDGhwHwcDCpX5m7OD4jDXFHJNNSmWRoypr2Uyf8aElrWNo+yJ4ZZniFqJr4XqaZnH+vN40Uu++skZf9eMCOILtHoY7QW3JuSOhdzed/uv/82Pln6b/5hyETMwThIR06f//99yrEiBjCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAm7BaIHuDbUDLtu5JRS4Y/Gh0BCQAMHoAOb85HUEBDNTW5MazDjLYZpGBGAAFbn+zbPbkR7hYpJG04wIGGkvHJpvNmI0KXN1f5ktGyE+TIcqsDL/2G/OgxCFrTEV1OcdsEpZZaqR59G2p+uYk2ndPMTqlIdnCyMXWtlLQdJJlmClpvdTt////8usp0q1Jpf1rUSKaOkYCSrXV2/a//vuyZiVsxkmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAs3A5kEu7UlA+TMr9eJij5vKARGQUMXwWDNuQSJumEIEGInhm/BGGeD4qCCEwU0IA8Kkp+QUUDMplzvhQCfmUMXlcZdIYA2bGzno8HLYXwzVh46HGLBNRB2fuQMPDyYhICakWyVGdXKV6FWMVzR4jEF0Rh+eQkp1B9myxhXfRHMoa5i6a1IqfmemQi0vdnQ93W88hMO////9jqj4ZFlupmb+e5jiuMTXdRWEEUPq19Pu3nulNqzRkE4lsAqYgpqKBgASEAAIAAAAAAAAAAAAAAAAAA//NoxAAty/6QFt5Q0RwRSkYmaac37GGvg09K0N8oHZ+KyJOkLNVrXIoMVCM2GFOHZxHcEsGy2VEBZgsoi+icqFMMcAQNM1cuuBACsIt+nIsCHDiAouyDk1V2nJ0K3u8/ErmrGHM/rePc9Ke1eop4W7mbririUmKn+klqLKBYJR7wtpL/9Xz1//9f/zfM2hZ6TFJPVpNpFOlWk308U8K83XHdSNF4q0n/4+eIp4Mn6/9Sf/+pKDxjC2UXhXeB1pNpzZAtTiYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAt076MFuLbVS/tpkqofr4v87zvkhhDBlDkuUxFWeJZFHFbbHYm1UwFezFwUBQFEIAUmgqXKcR712zTc3hZkomYcFHKdtXca8jKHAlTKC5fFX2MxtND0pU6Gxw1Fh57YPSx9Xd8OPe2Xxc0bQfahUfcLtuToCw7jFMtSlrns5qq31USla/9y6G1H06KQ1AzopqOIG61Uj51A8ZOtmpNexx2mLo1s6zpqdG9kkb//9+cPfWa/49ShU5xf9/u9ZDQmhMQU1FAwAJCAAEAAAAAAAAAAAAA//NoxAAvJBZ4FuGbTB/ils3LMpXORFhqUoAX4YGFotYIQOYetZyQOjwVdNR9PVV5kz+nojQHCRCqCla3UbE15tqCRL6h9BCYdKKyI2pGRzUNMXmK+djZI4K9TvOHq/y10/+fUa318ue1ajRL82m11Y1TCnQUdDljxUpStExMfpIMy0mWXal6j/60VxJgzvb1rQWr9Tosy2q6TfUqeDietT7KRq12UbHVmhkiSJpapZKDuLVGC1KLpcApxyuplKR2WzIakUzFBe0+pMQU1FAwAJCAAEAAAAAA//NoxAAp665wFu5azS6adkuuUU5DELbgxMwGKcHGQmO4DBTBZTRqXCICFSKAShN0xMRE7wCk4EFTwhZz84RWjhpfZdFySoOfXC1VlLXlkoW2PBNjhdq5ibpHqT7OWeeMXVrpHmWugYmr0mVNbqqov6Jg+sFZNnV11p+yy63ahf2/XuTgflKVt3t+r0etdBvu7mYQqKtvZ2+pmdVKSqCFSlkskipFaBgcGgli+CaXTIO/Le/80mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAxQ6pcDV6gADyrAkVsO/AzW0eiyRgzAvlYiBfwWAMMC8BkwGBozIOATMCwBwv+YE4BoEAgBgAhgJBnGiEH6YJAMBECaFABlAU4g/oyZUEfkGBvwdYhoBYMM0FvIFQQbIJAHlGgMaFzQ6xO58ihKG6aalmayePNbRRXsgYe9SCqNGbutF00y89BWkzLUIDKNC+ZuowLhcQTLhcLiDG9N13MXu7snd7bY6BJk0l1JdKy70Gr9//1qQLwoMtMmbI//60Pa3ZLX3NiOSebV3XrTEFNRQAA//NoxAAx6/Lpn494AqQAABPPLtvXdrv//fCR9MafKhArcG4r7MTRbXmjSKaMrzr5vdn3ojBt/D5aHrdoXfZxA1oWcbn/4xFIqHC9pYL22/bf3/SnpSiHwXr2E+Zov/xvezLQtfFvPMMCqnAHDUnoJ+ohSoShsb/5m//OhwViscGePu990PcB8kiRyJP46kOg6xjwcf//0x6f4o/vun//3WDCYnL2fQWWbVreTfrTWJf8TfWb7pr6vd48iP7//3vf729i40zQYi5bma1vbNdf59t5tqTaYgpo//NoxAAwzBaAF9yoAAWapz+2asSQRGEQ8YlehlAkmFAE0Iz8WzIIgMPjoyX6DfZDIAIAg8llWMAhQxisjLglCBC7L8WYwLnFkkEFzEoBAAiukYBjJngYRBgGCwADhEYCbRKIIiELmI4gouEmSZYutUkpaToUJoh9bfWi/vR2ddXo1VpD8JGXS6km7uuyupIzXdSkk0dt7+utZKEiujtrP1K6uqtKpTrooppsupOOg3RomKn///db+db7pMkk5gpyfSZSZoZJlE2VNUUlPpGR9SYgpqKAAAAA//NoxAAli+KUHttPUFt975se9vdhksMQ8HrmbkZGrPE8JgswEs6kpA8EbpRkoWBkXzWd3tLVqxyNRSJAVCjcXUfeXUBoXS2zl+82SSSaub0E0yTSu1aCt8vLQV00TJOq0/1rZSGXgbxgaIMt1KZHf6KPm2TU82j0+OigMv/UKoy2foples5XuutQoE5A5HX//p1Mf47+0Iw9zkOMImnI0wci1SYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArw95oEujPSSQClnSR6q4a6TBljjVEC3AC4MmBD1sPRgMdT6E/HDhuCAVMEQLAwNonmDo9BjPlAFsQTrRjeqYfmNw+y9iBQCQGDIwmRtQJJEHAsr1ZQhBMwcAZ1LViHrgUAAcw/TAIdIKBDHbad83wFRpM9tXOs/NZ2qxoAOY9KO2/1nfpnvtU2PiIHv+ijQXjY6z0NT7K6/+p420X/+c6mPQKk2tlWOTzCo4Lj1HBSLBvc4tYqrtMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAww9ZwBO6UmBnhdqVydu66TAswDRMAQcE4wDBjwjg0JRhMBxg+e50KBgChw+ShyYUDS5mYZs3QQgBwgCAC1iiZgARehxKrc0T2HlBw4bgeclrmvPwvsCi1UQYEBQBCuAkeEUHla2u9nb/zlent3rUnJz3MMJDHQgMMY8jJyRp9z1qe7zDGoxjKUD0VD2bzz3z1vtf+6Cod3dUYWQTeZpx8RTfaeljL+ayqqWQ0hE07Hx/q/+26E5C3com3RxkNmVx4QlnPljw9D6yWIExBTUUDAAkI//NoxAAuE9Z4FuZQ0QCDakronZdSnYiYFERqcREAtFiiaXWaXJgMGAXqnKSIIQyBgYh2DAa74kTTRoTUIWw4wUFBSr6vzGHpQCtouYv8mNah503kSpIjTjUASy0waAWSQ2bukS11+ZqCnZitrJmOO6Thm+oKO5JNWFX+vZfZr9WutYFlrtdfmFX4/9v6/hjpVe2q6EoBmEFViOWrn9Y66+P69lmrZoxvXrVQ0/H//8/mh16123/6Xp1A+xKaxRsJnVUU3nUTEFNRQMACQgABAAAAAAAAAAAA//NoxAAv0/5gFOjVbQWWtr6qzvJL05fwwJGszTAtYo8fpuoiRhCAxgyDhiZx5iSNhhEDpfIoA54gSERgyUhn6FhCAbcmMvyWWeFpHIk1uOpGMvEgyWc7qqkGv4DQEMHwBpYYn4Xqal9NunfipKaTilrQr/HNR1otiONMjOnux005omh3rrD9FQwQV53d36z5iYmMYbVEQgEcIz1OeqHPOO+k9c9kv5vaqkw8MSs7v/zzEy49M2QjK6H3uLBhcgOOcfNIizMQ6kqIReJWExBTUUDAAkIAAQAA//NoxAAm+95sFuYOlSeJbjQ3a5GI5FR0ymMRoQDYMUJ0caDyEKoCMXWU2IDiZq/lGG3sGOSCCabu7kvYbKYpqharB8PJuuu71E5b5St/zEaWTuNuWMSeOkWUOWql1IDrXOuuXOZv5ph8vFBJTGqfO7GGbT6uguOXvqd/zRkgv7nhMqvb//Kula19Hf0UR2Z2z26f7NULk36nnaPzzUnGo5FqGGSmpPkOQpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAvS4JQCu7QmAkp1haUiAFgYVAoUTkwsDUwUSox0Dk6+wMxxBURhUYsPWc0AqRIsZMFMBYaHCUyx8PJVzDA5/kGE4kyGiJ6uUzlYQeBl8kIKZwErFgd3G8SSYCbUUrFcWk3UuwmzuZZTavvLYttCKfST+qqB5MStTctGPSnoqLjmG1/yx381NwNqE6/5El81NGxFB6rJc/bCAFxgxZlOonruPrJ/+MfP0MleJc2xCmK+xqxx/P/svmkXz2MF75I/ACZAM719iYgpqKBgASEAAIAAAAA//NoxAAqe7qAFtjLeRkTk1fP7VLSkAyCigVKlEjKbIvYsgwYHNQAYGUweVVQACRmjQaQyGdCAkASVda71iRSPrDq7afTK2IBEF3PYAkImIuyG3HtumzufqRiMXs69i7T2zRCcQm7+WX38uIVe6I+hZ/u8RCDgYGIru8RE0Trno76fn/u5/1zAEAABHQuIhdSF1w79d34nohV30I6aJ5Tqc//zs0+hJCTndAEAjsHA4xsZmx7454AmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtzAK1fsIe+8AhKa3bb54a/9yWcgyVjI6KmbuoTDNS1jAQj83GYl1NTU0QzarQByQajijg6tV5lVhrba8VWijlhm/vMKO1Ug4WWBZpFVWpWtrkletdQk8SI6lU1KJm3V7rEaurQo19QaMNYuvi1s2fRrfMF7XXq+HjNZ8+rWtaxcb19f1q9VrLb1rWa0K3+7bzXWWMxXHVf62/tCt/8//G7e2sf/fvi2sPrbmgtrA9iywI0PcPEj7dsSXx/4NWYKYgpqKBgASEAAIAAAAAAAAAAAAA//NoxAAxA7JYHOrbVAE5WKcsdopW05uRgENJkcD4NEwDFEaeIEEGEnuYADCa0BuYCgshJb5E4wWBkxnvI2RAkBBsRBA05LAcCcdABC1mEyzCUOSu4xiAwtSzVMBj8oJQQFgLXNGpTM9OsNag9mBmVX7Wl3U88sa9eO4PSyumuuEl4qz1Ut7rhM1A8Ph0vrOtk1l1uf3Pdyv9XFRNNp17uipY8AhEkWdJTqqm2ips6gtmqa2paTIKUmmOAPKTpLb//+5r86a99U1QY4BgM0hbcqlMQU1FAAAA//NoxAAvw8ZQFuobURlBhCKjX2xzL/LZAATmZQeAEECIsjXEugESgGA8xCL4x2E8MBNQUKA0YVgQAQFMT4cH3WCBfSISedYcAIKAAxd3Z4RgW+C1iqBhMiyhS31it3dxEIiE5psvv0NXLqgxdDAuKj6ofoT9tsw6hOM+eqh76i/1e55uo/oOzTjl36hV/9aR/qq2/XUoXAlc4s2RdaatWronEGTdFJFVJ0D5TKDJmx4OgLWXS6bOy1//7NMU/njCyqqSjps6S1LNUKHcTEFNRQMACQgABAAA//NoxAAs+8JcHuFbTA065GY9yWxykcJlZoIFkAZMOgc048QABXqMEPA1SFRwALVbmjknoYdJh6UXBgviD3MyQTKOL/m6ZeENwO6IGCKvGUu7RRZ6mPbt5/6mLRaCxHZSwUUF0vlZB67FSrspkUtWFF5EWyBqbhJTVZuaWTUkYoGyDOpb0zJJ9Gyr6l6k5wQQjH0TVJFzyGqySClqQSM0UNrrW6jBbnq0jcqCmurdd/1d0l62W1dJJmPtzAy7WPvIXpiCmooGABIQAAgAAAAAAAAAAAAAAAAA//NoxAApEgp0Ft5QlRgCttHzlHBqHQx46EoEEgqfgWXC9adRl2sawwGIKhKLwoOgYYBmDe5WuLCBAaKiW7GVfyuRw2/ZbQy3wx8zzxAMrxrEMryQCPTCp6znCwjkNQ9BcYt1cVdSi3aD0dJjVv//mJtHSfllKBYSUUt06TEzEsOPFCxhRo8wMjAqS9U6wY//0fdH//tuxXXKTBx7EWr////9Xs6r+p6a9ByaLfn6+8/WUxBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAlmtp0HtjbSFLK7tabUomL1OF4gBFaKCKJmqKttdBh9Yd0FqwQuSRFpgXQAdfS+xuQvtXf65NUL2PWWxNSN1Y2O1ZTyalkuq7s9sXgZY4kyPIQKt/FBanmnYe30K2RX7rRY3JgLMsmKDqXUnXoqWp51S7tqrbf9j6KB+srPorNVOm3sikj2mtmQOgNKK6Rk34gaWOkLipMUFxRAWXEE8mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAwq6JIFO7WzAKShgrdGUJzrSTvMFYaNhRDICqLfmwiPAYljAwRTAeoDUItTAAGlbSQC4cGAQMIR6BVbJdqKJJKwjAWuV0o+/Kw7d2HKqH4uwIBjCw4tgwZqogAhole2XSKvYehdqJbJSutspxU7c62oqN9L//B5tKPnPuuGucet+fAznbPnWlLpbV/XFxbbmbfmrP93/7YX/4falKenM9dtY3uHXFWyFYqqps8X9O76+47+OXnoVPkk9bmqJmrjrLfbjoxTw+whbcrYmIKaigYAEhA//NoxAApe2JIFObKlBkSRnEOOcmktctSYlzh/sNGCVUCisehLYOJAyHTG/+P8pkycGEiUAAiTZICGBqonJNTWFbnG1ZmMqyua87XmMwCqQ6BDIAFo6uZVEknAEd3KteriYXRYjMZitdRJy0dwZCuwlYxtWuOk19zjqM9gGS+q7edGPVF6KUny/2bRCi5ZTuHTPOk4nKlUDpxZEILGbqRO856W/SWRDjSLY+waCYW0OIWVdiYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAu+2JIDO7KmCLJAzd5LA6eiOhiKYRx2A5hSIA0eZqYWJgWEYoBhiOMh16DhhYoYQJgpmNFCTIjQUmzDigzQWMPJzDQAxQOFQUBDDMXSdxiblKhQEGsjS7U50kC96JQAAhYGUqFgQCADkv0kQ7r3v48bvyu5epx8TsQj72VFlVCHQXVlRNSK+pxjkOjB9GOgOinR5O5Luky3rLVfVmZTiDKhboPa6jggOMVZGM7aDH3cZWkmrpS7P//rEQOtOieJCOXstvWmIKaigYAEhAACAAAAAAA//NoxAAq0oJkDt4Q0SOWt8JM3TKHYSBSEfxjAREaUjNWQHAqe5rtGbC2GKiZEWmBgQIAjIygyz/K+09fH2nPANuL0AAWUL+XLAjLnhXbI2SwFDRc0gYe7ibAcIcCs9MFbTD1LXCib8xKxfr3jpppuvn5qUuaadov/27Xb4tVphqNKHNrF1FrO01/8ft8TE1C000ooGxFZv33lhyKzPr/p70KqmvrympAoYmI8RdymqzvWWmZ7ztufpMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAApUt5MHOjNcAnHXCdL7KDKQaS9xg+ept2HBhiSY8VZhoqoICcGASYjRea0AMAgtIgmhoAAGYBgkYAEWbMhgX9ROUVWqVAJXmsWQQ4z2GnryREdmGoajUZAASiQMyNrNHKaD6W53DWrt+WoZNTIuJgKIEy/blNqFcSG2CgKnUkbKNlDnNzp9//mxeV5qV3m72ORD5lutHDe7bj427kt8x56PzILw2+5VDLu/AuJY1MQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArmqowAO6K0PQ5Fl0mxEDIEAQwJ3U5LHAxHZcwxDox2owwgActOZxaSffBqY4AsYqgkjgWXAAcGPMonKpAHFBlC8HB4EBhQZCg5CgFhlpiB7dGVm/TLyl8CQ1Hhg2NiXidO/zV6zV3KKbCZlnGoo0cNOyKhhcVEm1L9WIpTVUm3TR1ufSl7rx2ri7bqQzvRWc3IFAw0oeKLOOCRrvOqPaKu3hZakdfLPTZUUdiR8WCYxQ8sggYbWmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkImpUHubQWE7tLYLMqq8pGQFiGiggMBDcIKTV4MoEUVTDDs3IjHghobYZM0gwfjMSOGLtIZ9XkbtNrPYMKo6alLu40tX1DIERSpruI4nGjhqfA2xBj/xKJmMiWx9d/Ag5LySPJrqyLcd6EslzdjFLMMv+etZf+OquW+YRuxICuGk1x4VDwqeHgQUc5os54oH1ssWplXNXeUTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAr+vJEBO5G0FknWtqDusnIFQGMKGDNEgRAgLmCQBGdxcJ7opmAQSDRSMcTlMAASFQQMOAyMFYvM3hBO9M01zHDV21ks+X3Lllpy25f8wSTNBC4RnkquXIgETUTvBI5jhlr0rH4nM5+VxuG5fY+kwQIAAAgw4t3P64d3d3/vuLd35l/7hw4GBvogGBgYdzhZ9tO2xEXpu+RLTe1CQYZcGHQsjpFm06WeSaJC8kQiriwc//fsQUBAEAAmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAj44pwHtjLSBNZt+NY2cqaChwvB1Ao5FQUzsdkxi4PRRWE2HXUBMGmQMfN/NLqZUsE4sZjuFWtLqcmDoalViZlLAYFq3JTGaUBEr/+Zsx1ozMzNqX7ZMqku1PahjFLoJAYPB5cxkM/0ZqOxSllpKrK0qpMPDHRUGlY0WEmzGK7qUqb3K3KUoqIkVS9n+y7fpViP2KcRMOiVMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtGm40DO7QzBQAEASw6gLjOir8xGM872IEKBwYMA+cCBaYbgCYQCSYuPSYChwFgkCAWEQVGEgYmCoeGK3pmhR1GBB4sDKWlgOC4/F10MySoEIayBNJX53RaXNMGASzkteNCSmrNyuU/UFxBs+RPEBENu45GtU8fnNT3tc/w4cq13XVevzcxg1g26/mftach6t5GKL46bhkac63ThwyGqse49gCsiHb2RV67GttL7/lX4X1NXWSPNDZNTh27WmIKaigYAEhAACAAAAAAAAAAAAAAAAA//NoxAAoqnY0Cu6UzBQR6kF5frBVKTBYag9bCAFhgCjZNmjBIFCQAzGA1zIYIAgNR4ExAFoCBQwxEAyArE+IIA6gM0IEeAt6tRZhfF5GqkQlmLtqVHvbFvmzoOsmgpIxB9wKK/czPKnnyppA46yS5VFfe6KcWbc7RlUjZ2bIGSr7zHBwscfpdE7tMWpeuer3ObM1Y5VJT1OV0QpSWfGahNaneJv9VMlsfetDGTynL3piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAmKnpEHO4WyAU7eF9sciYO8id4EI41CBEDAIgJMbjRZ2FQAMEguMWALJQMS5bsl4XbMMh9OYAVGuve2JiThQRBdyUvA5UM3zs9a8IdR5y8Mg9FbNjXZ764s3qfnbf/e6a+IuqfTanpW7cnMS6slPhiQC4QRKnnpZM1Uf8/3PeyWd1/9IXKJEN2StNtpPC7FywNTjXGzQNJFhc5c/7Mr/9EgmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArgu5QFtmHVBgCsDM6OeuZKZmFSh3Q0YUKF6jLVgHHYgADBEw2QoMmDgwYVvdQEgpgpoeoimFEQCGGjls1JumkGzCMu2ytJ4xYmMwJgElhQAXA/dYuAgY3Nl8OuPWQaILTLJ7Cj04z03d2QTx02QdPobH/e/Hj3piB6d20PphCSBpPYwnpCiEk6BFA6wdMxC0zELh7aPcT+volldC3/z/iURvErxYEJ0QGTDBcPja9ou6TRpJukExBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArqoZADObQzHlI2drcekaygqBCX1GojuGHlFQx4HQ4fggAmETOeUFoCCCmCcaOQWD5iR1nhgCY8HrQBwUoUCg3Nf6RLSlbnTJgAxtCPZJyIDBAYLByk3VQ8f1l0rkUpluUdBxZw022tTdSLhtUtGlYZ6/bRZWFRpNNKsk4lRh0g2KAWKBsebRVio5YFnFRwseCk4VNKOlWaGlY9a4tqtGdmu4vNSwJPDowLjCUKMZXX+vsbUOd7UpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtgqokAPdQXELE5l4lsAuAIYBgDZgqpCGMGEeMBEAYSTNslDEUKCIRDFotztQXzCcBggNVnA0GAECZk8Dp7cGpg8BQYAaRIsBZgKBjaK3LqYUhaIAOBIAmFwbmoQuFuTAMKl8JJtIUcWNAUVvTMgFwbBDI+XJklubkcISP1yXUfFQsXzBR9/+aOr4sZfySo396djrsb9u3j4z82Yi4577+Jnpmm/J+L7uP8dBadMVyWKB9XzLGqdqPWVY+QdfpTEFNRQMACQgABAAAAAAAAAAAAAAA//NoxAAi2qJEHuDNNEpNtCGvxuMxhz18mI5AEh8GhxS8xQGw4LFo0XDLQpGAqu92WzPUBEIbGErEHzdprLXYDm6SXxGhZ4+hj8CpfODq2BAjJ5vJfn0Uve0xp8YGHMvcMPDBf36/L/IYY0cPwgfUdLCFJeYVdMu5hSbx63MdT/qOVlJumWk0FU8pbYnU1GoQfvLPVF5FSf2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAoAqIsFO8QXAbtBw7C62kIRhwEmJa5B7zjQbmEQwahRA6EgECzB4OHjcFwQs9M1EQmCwUzhgg2uEv1oi6otTtLiuViUsKLdgZcq4UOd+BIbgyH4Efi9L4sKGi6DikiZXmpzP4nQLT/D/f7il73FJcXEWEg+8hrsR671Z1si+A9uMfOLLF/YlHXD8QIr1GMkRFuaG1sp1jnajqDjbx3sUZ/Zd/uaouj6uxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAtSg4wDO6M0A0AwJ3YLLOJ+rmMBwxOgQWMDwxHgMMMj5MEwCYyYcCIBhEGAWEYDlUHDBcPDEwXzRUbDL8XDUETYljXAw7sbYgYw4YNeKnAQHDBREVLfLlLxFtggiDlQRIEl50NRUumtQBDUaIg4mAACOaeC11iKZrsdh05VFRyJJFawS2fcdkt/9w7Mez0RrN2LKdpZ3JK1nZ/8+fvv1sZyX307iWOmQKaExQg1kNCtLScXvV092n//dp5z8gmIKaigYAEhAACAAAAAAAAAAAAAAAA//NoxAAtq0YkDO6QzB0APAUxaEpXF1zBICDBA7zactDAYfTD4CjC5xDEgNxYNhk0jPAHhQFAwFAgCjAUFgMC5jhbJnQDQcPYYGL06Ro2DTAs2RRpHdlD9OszGVyqBUVmBGbpG/PDI9AIoYnOpEFwTC8FmsNQqah5WW/5IP+fvt5tat+riU5l4eYburp+GtL65XHGDnYejCS2YbT1dZtqLJGtsU7j5lpEVK2iJ7tr5qe/m//hZ5+6////xvTw17CZ/byHemIKaigYAEhAACAAAAAAAAAAAAAA//NoxAAtk7oYAumFWIL4Hgwj8CKODwNmHAjkylGEglGPAlmqOtipVgYViQ1DYgMxABAOCIWBNBAAQoMQKJA10t3EIXmCAMpsgoBYwq9/JFHlqZZ14tAVA9UOoFI/NDnOSnI/Qq1irfDdd6c0SGf59uhH9Ksk+/bdF8+s0tGf7P8Zm9D/Xdz/Zfdpj0HOay0elunUnK95jlVdwwf72nn/tTs3Yo1gq3aqj1D5hf5+9l61K5H1c9166prpxKNOADKSCmO6ExBTUUDAAkIAAQAAAAAAAAAAAAAA//NoxAAsw0oYAO4QyCAAC9K+QuEIFBsw7AAwPFAyvHswKLYEgWcFUkYfh+Y3gIQDwbfCcBgRMDAkGALFgFL3GK8wnPwxBOTCYAMTyAoLrwzkRetwaGlkrf38eCjhKES0Xo4ecFSqDG1mc92q84YH91EHze0Uli7TDvS8/dpaQ8dvKx9d3DJRCxntx3OmxiNC3jmT3G3vfG23c/U46amPeNR/pNY+a7m4+vyom28ZdlIiWJkR1wgFCdApQWOIkvZqTEFNRQMACQgABAAAAAAAAAAAAAAAAAAA//NoxAArCrYoDODNcDMADgSXkV242KM4iKxk0sAQjAQFnW0iJIVoxiQ7HOA+IQWXMVc8YgFBrZmnLjGXWZCUAZhC4VhFVS/aeinBd9dQAAScoCBiS6zi2ClIOAZfRCh04qw9530pYfoIcqzkrl+g4HCAxG3WsABS00R0T67hFMu3t6btEDsIBmBsl0p/IfS87topTv9PKQfvrSpk+oXSi9hbO/v/8paC6ddRw125ZyKsV6yiLdTsMc6mIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArk2Y8BOZG0Z4jDK2CxFNBCeQDQz+MRCCBCAzRB1Egs/hpVTmrA0BQA8I0IQYBxkeG0aCY+SAUXZc/pjgMRgEuqh2V8XlRwTGS6CSS2KzS0ykzABFDhYYuaxBYWBFjQ3FZiHqGWzMZh6qJDCgEQAo1RuUy5rx2vxy3P/h1F2okMLEgWzlDX/7WUp1vKKl+/5dn8GZjpMagnb/Iz8MU2BgmMNbelEFKRn5fy/+5fSYLxHrH4yuldxMQU1FAwAJCAAEAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAkInY4FOYGzBvvSC3wcJTR7y9LIw8HGHwULDYxiajB4AEQRMlPcz8KRYKNwEgU/4wDTFGzPhCAaiz1zYkiM0p+InRPvL5e7QLlBj/TEKrNypoHxyr8Ow6WDQcizWZ/5Is/aX+rBaRTjAiNVMwbkpqZX/LKs/Mi85CzzkX8smQjpjhh6PwMYKiNQSHyoDSCpNTHOH19+vs+vtTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuKpIgCu+QsAoMGgGLZJoNGTSUVMM0FOOQCMJxLDgAMJxMIhsMIwEMOhxMaQJMGgGLICwYrCA4CowwBvTROBTMEwABS9KxmYwAbAqaydU27jcF2sAMEACdds4taHuOFKG+w+S8FwlDSw2SHoj3ED5kPqe1gaPObqVZmvZ8VrmVZU42ZSpqiLdk5iensb1v9jxm+Oq4sq5x92hMdyOxOp8STnw7D5OEiRJrjMetK3JU9sC1zOdD1JGLMuahcgZYeuyaYgpqKBgASEAAIAAAAAAAAAAA//NoxAAsk4YcAujLdEDICLSXOpYXDFgRMK4XNvyQMMwrMQwdMVm3BoGA4LgYJxkOIiJRgmBAOA4DBSYLBYZBJwfcF2ChsWHX6luYDgcXMWnD0ZfiIxeGDDEIJe8Tw1fu00WvVbNyxjRWeYfvGmFtSVwakWTiVyFQXn6aqq2fJntDZe3TVDhzbMjLQzgtaRHxIZFZtAA1yHrbkoKo7ILWH23Ml9XyLv3oT7p3wo36PRqj0JpRsPHoSDi4cyB33UrTEFNRQMACQgABAAAAAAAAAAAAAAAAAAAA//NoxAAr6mYkCuZMzBoFgq1tajwgoAmGgcYe84Q4zIIVMHAQzVoEgTBJXM/kMzeVTAQoMSAcgCJiIoGUDgYeih5Q2iFYS1RuassCCBlSI8AQAwBDKOM5g5Lh+gLGFAKt8nlDZQqKDg0x0ACxIowRMGpEAAg6Hwv8WFk917Pp3Lv29wQMxlb19shsgqLZ7t3fdyMjPj7V9y7u2yK8Zjae///bHynZ1OsegkXiUc2Fyjfqr6NVFlq+l4oKN3dCYgpqKBgASEAAIAAAAAAAAAAAAAAAAAAAAAAA//NoxAAp0tYsDObG0BFApN9HxSKYYp0DdGb+WThkoZNs6ExAKzBAjMvOs9uRgMSxIOSMs8YFEBjsKHLCKZYNmGAq3XLX6vpMmPNjRRfh7zDSQcnzIyYmHnSYk0UKBocARuCnda61mHYZhmWymU00al2AYMKlbY22OuqhVVV2ZhWz1c22Y84ff0FVVEqvc2MzP5VoXuu1PM/ypjakMerIx1IL40LHySTv0VcKDTEn9xd37vzj0xBTUUDAAkIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAArq0YcAOoFVEiTBEGjA4Fw4SwgAE1jCyhz94GzBIIgqHxzpQwYQRbEwiHU2ZGgwGFNc6hSwSHMwMGw04BNO51GhqbIZMqSKkTsS+EF3UExgKRyegOBJrjgRphMCwNfu5T6KT2N+AmquZgfIzTrEaJa2jrVoU+7G1TTcMOuxv9y8zVjKq7e+eR3Mj0sQLa77RoioZGu8yPMpnUZGjpp8GzzvV9Mja6kppdmqkLQ9qrUu++0A8g5sOpiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAsC04cAO7QeE/mHKDBQCQIABhWAZkknZ/gFQ0Thdw6LC4yMAcxMKGQ818KDgUOfl9pEJOmAahzwiz5qrZYytmON2qzzdrEnUJHE9GpOWdoqCjfdz/paudOFrZLYaLy+J+RBsfkrZAXKtLE1tFw8oJnlbbGXVSjiUffSRt1PfW437Pm85qLx1N4hQ+dFwozpKkR/8bZfd3PfzVyN66jkf/8H/7Q91HPP/6j7WV4kVUtKEnVocbrBDX1piCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAte/IkC12IAB8S9oGjF0DBIHjBQBjAoiDq4VQEPJi0MBuMoZjuKZgiBphqKJggExYAQOBpJ1FAHAwYEGAQg6pczBlGE4OYTZcKZJl+QcBOKhBiDkXc3LRWSN5fQRJ0+xkkpjFKtk3NTdNXUW1qSun7vN84k6zZF0KSjxupk05cdbo6CKR9nerUlRQQT6dtWYe6Zm6+pM4gpnWtJlqZbMfdk6zM/tplv10var6jB/rT9Tn2+qyt0kFV6n+cdkggmIKaigYAEhAACAAAAAAAAAAAAAAA//NoxAAybBbhH42gAgCARROByOhyOx8L/UtdKXxxakALwA2+aLcV0li94AQcChAAJYB0FzEOEdjB2wMlbA968KEBawbGyZJhGr8MYgYkaHiC08ZcWWYqfV/FnjjIOJwLIzYcYj0WR/5Ax3g3UEakGAxQoLhQGgYCgBuVEUWR//D+hYuLaDcsN/H8MjixigxmyuRcgJGEVRKRdmVSX//k+5cRTPE2VzAuMaMmgUnWVTAfzUmDh00l1Rj////oUGoN/OsViImBwyENHaYjydHJOpmZMkVKBLpg//NoxAAuy76UF9yoAT0Tk0ctYzkFvqMDMwwBpFWjAqAEAQo6jpZFAIKQDKDMBfVdMG9fmC3zyJ4pkCFJCUwbtAAA4GHBuBpgfAYaDYBADAsKQxiH6i4AFBaHKjXIkOcpJTonDJE6ZJXLpdLs8tbPTN3Z12ZK1TpI+q3tXpEcGXhmzxkXjZ/79SRsmykq0epWmitlJJJPR1rRbq9kUbVzIvU0Vl0y+pSX0UW20kn7ot1JGJqjSMiLGyVq60V6kjJJYn0FFSlH/eEmIKaigYAEhAACAAAAAAAA//NoxAAsnBJ8DutLbCtxxrtemjUy0YADOLLRDDAHdtFoDElQBv3zCcDUgVV37ayvltGtOcjrI5qRRiHMU3CIAg4EQgLDQkUwSFBCBQWAEtcj2FwiMMw1DAOfZTNVd+4PjElxs3MPkFMooMiuSb+bl1lUKZhoLYyU6/7Zec7ZTmISIzY0tRUfXkcwuMdWdA622lKEV/1TmdTS6RjGEgV4oecTClHNbyfv+v8tmxMOl5Bgw2yzXSskUnRmdu869FHJiCmooGABIQAAgAAAAAAAAAAAAAAAAAAA//NoxAAr/A6AFurLUTWdj0siDsTctekwCAcOSV1Ggu4roMBQwhI88FEIID8v0u984Zp2G08g7NTkNNinI2j6uYqgAj8ZPAeCAHcqDgCASt5gOAoKappiVNE1uA5OEq2sooJcGhPc1rh9Xd200hvxscfiuEdnE23X/kx6l0wqBls9cXMM9WRsokaZfrzkiJOkTbVyoxn3Eyisw9mGGaOKwsq+i/p+36v7B0JJ3FzNXtNzOLCLOhbprGOjtUawmIKaigYAEhAACAAAAAAAAAAAAAAAAAAAAAAA//NoxAAt2+5wFu7KnCUKbgcAzEYIUHpG6gwNDMYEQYADTSUDguAZKExg/LZ8mVSAMDDyh6V6giom6wM2VsT10zbQIyGgUzXIj+KgR4s0YuIAkCAI4LAwBABR3N8RggHTOUOT6s2qWbyzrY0zfaitTtuzjbtb1rQfE3Oyb0qMH23W4ga40QZH5gGM31L+/dq//Eha3qiXYwxjmH6ldHIDOzSMH3V1W2hv//93VjJDoeKWUoQFG9nMRIxzoHloORxHjjTI8kmIKaigYAEhAACAAAAAAAAAAAAA//NoxAAua45oDusPRCNxpY2bxRlcDcyQhjFYA6eDguAwqBIgCow3805NKIZBIwFAILALKgCABedDoj+kYvBx3bYczeOugpaiM3ACg2YoIaYTAmHA+QgiDgMW+CAxMeBfAQIJkx9G6XHTIfTVc0PZIKp4+5HzrTrW5CJipjOqKtjZp0787y30GoL9mv+ytNdB1TTVT1S5o8hdqGsYh8ufH0LDqVNqyXec7HC0ieNZj6or+e7/v0t2uPEU9y2PQIiw4dU5VgvuemIKaigYAEhAACAAAAAAAAAA//NoxAAmC8J8HuNLUBbfv9ZmzZzmMyEaILyB7XKgsGAYwR8TAYyS9YhK7UrsxXCliUis26vY513YeTKBpQfyO241TQWyerOZb062bmJrND6tR01RZI6ikz1VHTyLVJJJa3VRRVYvUSVSRUWg5SkUp65ieM3frVpld7aU8rruuMGIDhwcKGOoZjDlbqyuk9EjK01u1SX9P9635N9GflR0rx8hfeP2JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//NoxAAuu45YDPbamC1opznSstnG7mAOFkDhaxUBJhYOAbSDHgKzCWV5NEoUw1Q/QFKdmCgKb7tNEeVvkn1cMqc6cht/i/4wAioCYuMmh/4KGETAUdotppDgel8DguGntYe+k7di+X67N1o2ggpqJMfeShP+ta1VVLdq3eXmsszYxZdEkwhjQ8bNW9Lq12pmjqvdVO6aFCaIO60k3WbF5I2m0ooVd1u7HD6ajmmpR5VFa1svX//6NTKUg3UySCzqKbXnFANFKNSYgpqKBgASEAAIAAAAAAAA//NoxAAsC4JwH12gABG5bq6SrT2ZpuA6DQ0U6a6pErWfmD4emD7jnVwbGQQfBAWEQAL4WEZxHJDWsPZmbEUYhxiRQNtHNAyzAERkUEKDDZBnQkJALyjLDIlMcxIzLKCCl2NUXTVWpM3Wi6BiXVfQT9aK0W8xbUcWmylSiOlTrWiir+talrM1KU7ar1oJJl2jVtRRPosY5gm+iiiitKylNNUtExbdba6lrZv/3SouxdMndrn4ADYUG4GXIT30JiCmooGABIQAAgAAAAAAAAAAAAAAAAAAAAAA//NoxAAu4lpkC52gACSQHMHQDkYgAkwhA8wIDgw3EQdGEiMAtuYKBqYxAUZC/qZICSbsF8aAgebDugZdhqFgi2LlEaigxYwNMRAzoAAowMaPgA5GAMWGaEtCASAwBDCANAIuYaYIEQGMBkINpEB4IBREITGaJVEaCDRZZAEjSqo6tSOLKHgWWSpAh2NSqftVkUIekSROF8u+ZH0Nutubk4ZGJuZmDHv/vX/1m6BseNzoMBEDm9nu/CIbCALjkBZ/7P/0BdA0OmakxBTUUDAAkIAAQAAAAAAA//NoxAAvAkIsAdp4AAsNM4pNcvNQfBSEVEGbVG3fG/eGYFsQa2YQuaRSaQqFAhq4h06xrj6IiKThggCYIClyX2MKGCtHcA7AQgkRYjtBsgZSXN5bScnTEL8F8DmQk/h6jKdsKGoarbVrIxK6M2q2NKwq1WxYSeOplhK5XPrvU6oY0F7F1Z8+t8bzWusWri1rWy9e2zBi19nz6uLW+a1r869rbzX+ta6xZ8MBo8CobEp0sDWJZ6DUFR4KuEQcLP/yUGnA1Ep1H/wVTEFNRQMACQgABAAAAAAA";var GI=[440,480],$v=2,WI=4,jI=4,TE=.02,CE=1e-4,YI=.02,ah=class{constructor(e){this.audioOut=e;this.ctx=null;this.gain=null;this.sources=[];this.stopTimer=null;this.generation=0;this.muted=false;this.volume=Sa.volume;}start(e){this.stopImmediate();let n=++this.generation,{src:i,loop:r=Sa.loop,volume:a=Sa.volume}=e;this.volume=a;let s=this.audioOut.acquire();if(!s)return;let u=s.createGain();u.connect(s.destination),this.ctx=s,this.gain=u,R.debug("ConnectTone","Player start",{state:s.state,builtIn:!i,loop:r,volume:a,muted:this.muted}),(async()=>{if(s.state==="suspended"){try{await s.resume();}catch(v){R.warn("ConnectTone","resume() rejected \u2014 autoplay blocked",{err:String(v)});}if(n!==this.generation)return;let g=s.state;if(R.debug("ConnectTone","Post-resume state",{state:g}),g!=="running"){R.warn("ConnectTone","Context still suspended \u2014 no user gesture, ringback will be silent",{state:g});return}}let d=!i;u.gain.value=this.muted?0:a;try{let g=await fetch(i??EE).then(_=>_.arrayBuffer()),v=await s.decodeAudioData(g);if(n!==this.generation)return;let A=s.createBufferSource();A.buffer=v,A.loop=r;let p=d?this.applyLoopWindow(A,v):0;A.connect(u),A.start(0,p),this.sources.push(A),R.debug("ConnectTone","Decoded tone playing",{builtIn:d,durationS:v.duration,loopStart:A.loopStart,loopEnd:A.loopEnd});}catch(g){R.warn("ConnectTone","Decoded tone failed \u2014 falling back to synth",{builtIn:d,err:String(g)}),n===this.generation&&this.startSynthesized(s,u,r);}})();}applyLoopWindow(e,n){let i=n.getChannelData(0),r=0;for(;r<i.length&&Math.abs(i[r])<YI;)r++;let a=r/n.sampleRate;return r>=i.length||a+2.7315>n.duration?(R.warn("ConnectTone","Loop window not found \u2014 looping whole buffer",{startS:a,durationS:n.duration}),0):(e.loopStart=a,e.loopEnd=a+2.7315,a)}startSynthesized(e,n,i){let r=e.currentTime,a=$v+WI,s=i?jI:1,u=this.muted?0:this.volume;try{n.gain.setValueAtTime(0,r);for(let d=0;d<s;d++){let g=r+d*a;n.gain.setValueAtTime(0,g),n.gain.linearRampToValueAtTime(u,g+TE),n.gain.setValueAtTime(u,g+$v-TE),n.gain.linearRampToValueAtTime(0,g+$v);}for(let d of GI){let g=e.createOscillator();g.type="sine",g.frequency.value=d,g.connect(n),g.start(r),g.stop(r+s*a),this.sources.push(g);}R.debug("ConnectTone","Synthesized ringback scheduled",{cycles:s,level:u,ctxTime:r});}catch(d){R.warn("ConnectTone","Failed to schedule ringback",{err:String(d)});}}stop(e=Sa.fadeOutMs){this.generation++;let n=this.ctx,i=this.gain;if(!n||!i){this.stopImmediate();return}let r=Math.max(0,e)/1e3;try{let a=n.currentTime,s=i.gain;if(typeof s.cancelAndHoldAtTime=="function")s.cancelAndHoldAtTime(a);else {let d=s.value;s.cancelScheduledValues(a),s.setValueAtTime(d,a);}let u=Math.max(s.value,CE);s.setValueAtTime(u,a),s.exponentialRampToValueAtTime(CE,a+r),s.setValueAtTime(0,a+r);}catch{}this.stopTimer=setTimeout(()=>this.stopImmediate(),e+20);}setMuted(e){if(this.muted=e,!(!this.gain||!this.ctx||this.ctx.state==="closed"))try{e?this.gain.disconnect():this.gain.connect(this.ctx.destination);}catch{}}destroy(){this.generation++,this.stopImmediate();}stopImmediate(){this.stopTimer&&(clearTimeout(this.stopTimer),this.stopTimer=null);for(let e of this.sources){try{e.stop();}catch{}try{e.disconnect();}catch{}}this.sources=[];try{this.gain?.disconnect();}catch{}this.gain=null,this.ctx=null;}};var oh=class{constructor(){this.ctx=null;this.released=false;}acquire(){if(this.released)return null;if(this.ctx&&this.ctx.state!=="closed")return this.ctx;try{this.ctx=new AudioContext;}catch(e){R.warn("AudioOut","AudioContext unavailable",{err:String(e)}),this.ctx=null;}return this.ctx}peek(){return this.ctx&&this.ctx.state!=="closed"?this.ctx:null}warm(){let e=this.acquire();if(e)try{e.state==="suspended"&&e.resume().catch(()=>{});let n=e.createBufferSource();n.buffer=e.createBuffer(1,1,e.sampleRate),n.connect(e.destination),n.start();}catch{}}ensureRunning(){let e=this.acquire();return e?rh(e):Promise.resolve(false)}release(){this.released=true;let e=this.ctx;this.ctx=null,!(!e||e.state==="closed")&&e.close().catch(()=>{});}};async function XI(t){if(typeof Worker>"u")return Promise.reject(new Error("Web Workers unavailable"));let e=vo().vadWorker??URL.createObjectURL(new Blob([(await Promise.resolve().then(()=>(xE(),RE))).VAD_WORKER_SOURCE],{type:"application/javascript"})),n=new Worker(e),i=null;return new Promise((r,a)=>{n.onmessage=s=>{let u=s.data;u.type==="prob"?i?.(u.prob,u.tMs,u.speech??null):u.type==="ready"?r({pushPcm(d){n.postMessage({type:"pcm",buffer:d.buffer},[d.buffer]);},onProb(d){i=d;},reset(){n.postMessage({type:"reset"});},destroy(){n.terminate(),URL.revokeObjectURL(e);}}):u.type==="error"&&(n.terminate(),URL.revokeObjectURL(e),a(new Error(u.message)));},n.onerror=s=>{n.terminate(),URL.revokeObjectURL(e),a(new Error(s.message||"VAD worker failed"));},n.postMessage({type:"init",weights:t.slice().buffer});})}var kE={create:XI};var QI=6,KI=1500,sh=class{constructor(e){this.stream=null;this.video=null;this.canvas=null;this.timer=null;this.buffer=[];this.startedAt=0;this.capturing=false;this.listeners=new Set;this.stateListeners=new Set;this.frameWaiters=new Set;this.blockedTicks=0;this.permissionStatus=null;this.everGranted=false;this.sessionOpen=false;this.userDisabled=false;this.stopped=false;this.pendingOpen=null;this.capabilities=null;this.handleTrackEnded=()=>{this.isActive&&(R.warn("Perception","camera track ended unexpectedly"),this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange());};this.handlePermissionChange=()=>{this.permissionStatus?.state==="denied"&&(R.warn("Perception","camera permission revoked mid-session"),this.everGranted=false,this.teardownCapture(),this.emitStateChange({access:"denied",feed:"off"}),this.emitChange());};this.fps=e?.fps??3,this.bufferMs=e?.bufferMs??12e3,this.maxEdge=e?.maxEdge??512,this.jpegQuality=e?.jpegQuality??.7,this.historyThresholdMs=e?.historyThresholdMs??3e3,this.facing=e?.facing??"user",this.maxFrames=Math.max(1,e?.maxFrames??3);}get isActive(){return this.stream!==null}get isSessionOpen(){return this.sessionOpen}get isVideoOff(){return this.userDisabled}get feed(){return this.isActive?"live":"off"}getStream(){return this.stream}getVideoElement(){return this.video}getFacing(){return this.facing}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}onStateChange(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}hasHistory(){return this.isActive&&Date.now()-this.startedAt>=this.historyThresholdMs}waitForFrames(e){if(this.freshFrames().length>0)return Promise.resolve(this.snapshot());if(!this.isActive)return Promise.resolve([]);this.buffer.length>0&&R.warn("Perception","newest frame is stale \u2014 waiting for a fresh one",{ageMs:Date.now()-this.buffer[this.buffer.length-1].t});let n=Date.now();return new Promise(i=>{let r=()=>{clearTimeout(a),this.frameWaiters.delete(r);let s=this.snapshot();R.info("Perception","waited for frames",{count:s.length,waitedMs:Date.now()-n}),i(s);},a=setTimeout(r,e);this.frameWaiters.add(r);})}async willPrompt(){if(this.isActive||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return false;try{let e=await navigator.permissions?.query({name:"camera"});if(e)return e.state==="prompt"}catch{}return !this.everGranted}async ensureCamera(){if(this.isActive)return "granted";if(this.stopped||typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia)return "unavailable";let e;try{e=await this.openCamera();}catch(n){let i=n?.name;return R.warn("Perception","camera getUserMedia failed",{name:i}),i==="NotAllowedError"||i==="SecurityError"?"denied":"unavailable"}return e?(this.sessionOpen=true,this.userDisabled=false,this.emitChange(),this.emitStateChange({facing:this.facingLabel()}),this.reportCapabilities(),"granted"):"unavailable"}async setVideoEnabled(e){if(e){if(this.stopped||(this.userDisabled=false,this.isActive))return;let n;try{n=await this.openCamera();}catch(i){let r=i?.name;R.warn("Perception","failed to re-enable video",{name:r});let a=r==="NotAllowedError"||r==="SecurityError";a&&(this.everGranted=false),this.emitStateChange(a?{access:"denied",feed:"off"}:{feed:"off"}),this.emitChange();return}if(!n)return;this.sessionOpen=true,this.emitStateChange({feed:"live",facing:this.facingLabel()}),this.emitChange(),this.reportCapabilities();return}this.userDisabled=true,this.teardownCapture(),this.emitStateChange({feed:"off"}),this.emitChange();}snapshot(){return this.freshFrames().slice(-this.maxFrames).map(e=>e.bytes)}freshFrames(){let e=Date.now()-KI;return this.buffer.filter(n=>n.t>=e)}openCamera(){return this.stream?Promise.resolve(true):(this.pendingOpen??(this.pendingOpen=this.openStream(this.facing).then(e=>(this.everGranted=true,this.stopped||this.userDisabled?(e.getTracks().forEach(n=>n.stop()),R.info("Perception","released a camera opened after teardown"),false):(this.stream=e,this.attachTrackWatchers(),this.watchPermission(),this.startCaptureLoop(),true))).finally(()=>{this.pendingOpen=null;})),this.pendingOpen)}stop(){let e=this.sessionOpen||this.isActive;this.stopped=true,this.teardownCapture(),this.permissionStatus&&(this.permissionStatus.removeEventListener("change",this.handlePermissionChange),this.permissionStatus=null),this.sessionOpen=false,this.userDisabled=false,e&&this.emitChange();}async flip(e="toggle"){if(!this.isActive)return "unavailable";let n=e==="front"?"user":e==="back"||this.facing==="user"?"environment":"user";if(n===this.facing)return "unchanged";let i;try{i=await this.openStream(n);}catch(r){let a=r?.name;return R.warn("Perception","camera flip failed \u2014 keeping current camera",{name:a,next:n}),a==="OverconstrainedError"||a==="NotFoundError"?"unavailable":"failed"}return this.stopped||this.userDisabled||!this.stream?(i.getTracks().forEach(r=>r.stop()),"unavailable"):(this.detachTrackWatchers(),this.stream?.getTracks().forEach(r=>r.stop()),this.stream=i,this.facing=n,this.attachTrackWatchers(),this.video&&(this.video.srcObject=i),this.emitStateChange({facing:this.facingLabel()}),this.emitChange(),"switched")}facingLabel(){return this.facing==="environment"?"back":"front"}teardownCapture(){if(this.detachTrackWatchers(),this.timer&&(clearInterval(this.timer),this.timer=null),this.video){try{this.video.pause();}catch{}this.video.srcObject=null,this.video.remove(),this.video=null;}this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.buffer=[],this.canvas=null,this.capturing=false,this.startedAt=0,this.blockedTicks=0,[...this.frameWaiters].forEach(e=>e());}openStream(e){return navigator.mediaDevices.getUserMedia({video:{facingMode:e},audio:false})}async reportCapabilities(){try{this.capabilities||(this.capabilities=await this.detectCapabilities()),this.emitStateChange({canFlip:this.capabilities.canFlip,availableCameras:this.capabilities.availableCameras});}catch{}}async detectCapabilities(){let e=this.stream?.getVideoTracks()[0]?.getCapabilities?.().facingMode??[],n=e.includes("user")&&e.includes("environment"),i=0;try{i=(await navigator.mediaDevices.enumerateDevices()).filter(d=>d.kind==="videoinput").length;}catch{}let r=navigator.mediaDevices.getSupportedConstraints?.().facingMode??false,a=n||r&&i>=2,s=a?["front","back"]:[this.facing==="environment"?"back":"front"];return {canFlip:a,availableCameras:s}}emitChange(){this.listeners.forEach(e=>{try{e();}catch{}});}emitStateChange(e){this.stateListeners.forEach(n=>{try{n(e);}catch{}});}async watchPermission(){if(!this.permissionStatus)try{let e=await navigator.permissions?.query({name:"camera"});if(!e)return;this.permissionStatus=e,e.addEventListener("change",this.handlePermissionChange);}catch{}}attachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.addEventListener("ended",this.handleTrackEnded));}detachTrackWatchers(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded));}startCaptureLoop(){let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),this.video=e,this.canvas=document.createElement("canvas"),this.startedAt=Date.now(),e.play().catch(i=>R.error("Perception","capture video failed to play",{name:i?.name,message:i?.message}));let n=Math.max(1,Math.round(1e3/this.fps));this.timer=setInterval(()=>{this.captureFrame();},n);}async captureFrame(){if(this.capturing||!this.video||!this.canvas)return;let e=this.video.videoWidth,n=this.video.videoHeight;if(!e||!n){this.blockedTicks+=1,this.blockedTicks===QI&&R.error("Perception","capture video is not producing frames",{afterMs:Date.now()-this.startedAt,paused:this.video.paused,readyState:this.video.readyState,inDocument:this.video.isConnected});return}this.capturing=true;try{let i=Math.min(1,this.maxEdge/Math.max(e,n)),r=Math.max(1,Math.round(e*i)),a=Math.max(1,Math.round(n*i));this.canvas.width=r,this.canvas.height=a;let s=this.canvas.getContext("2d");if(!s)return;s.drawImage(this.video,0,0,r,a);let u=await this.canvasToJpegBytes(this.canvas);if(u){let d=Date.now(),g=this.buffer.length===0;this.buffer.push({t:d,bytes:u}),this.pruneBuffer(d),g&&R.info("Perception","first frame captured",{afterMs:d-this.startedAt,blockedTicks:this.blockedTicks}),this.frameWaiters.size>0&&[...this.frameWaiters].forEach(v=>v());}}catch(i){R.warn("Perception","frame capture failed",{err:i});}finally{this.capturing=false;}}canvasToJpegBytes(e){return new Promise(n=>{e.toBlob(i=>{if(!i)return n(null);i.arrayBuffer().then(r=>n(new Uint8Array(r))).catch(()=>n(null));},"image/jpeg",this.jpegQuality);})}pruneBuffer(e){let n=e-this.bufferMs,i=0;for(;i<this.buffer.length&&this.buffer[i].t<n;)i++;i>0&&this.buffer.splice(0,i);}};var Hs={bundle:{sha256:"98db72469ffb176f5e9f2687be0f70783893aca681f7789c34b872b0a764371a",byteLength:155465,ext:"js"},loader:{sha256:"e170ee67dd4e16c1a6fcd8840a206687e5a59b22c20e4a902bc445b095454d73",byteLength:323377,ext:"js"},wasm:{sha256:"8da277a733926eacd0474b8704b36742d6ec3231c57a860c5b889dff8f1df886",byteLength:11756954,ext:"wasm"},model:{sha256:"64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",byteLength:3758596,ext:"task"}};var JI="CPU",$I=3e4;async function PE(t){if(typeof Worker>"u")throw new Error("Web Workers unavailable");let e=vo().moodAssets?.replace(/\/+$/,""),n=g=>e?`${e}/${g.sha256}.${g.ext}`:qg(g.sha256,g.ext),i=t?.getCachedAsset?{read:g=>t.getCachedAsset?.(g),write:(g,v)=>t.setCachedAsset?.(g,v)}:void 0,r=g=>uu(g,n(g),i),a=[],s=(g,v)=>{let A=URL.createObjectURL(new Blob([g],{type:v}));return a.push(A),A},u=async g=>e?n(g):s(await r(g),"text/javascript"),d=null;try{let[g,v,A,p,_]=await Promise.all([vo().moodWorker??Promise.resolve().then(()=>(IE(),OE)).then(({MOOD_WORKER_SOURCE:N})=>s(N,"text/javascript")),u(Hs.bundle),u(Hs.loader),r(Hs.wasm).then(N=>s(N,"application/wasm")),r(Hs.model)]);d=new Worker(g);let T={type:"init",bundleUrl:v,loaderUrl:A,wasmUrl:p,model:_,delegate:JI};d.postMessage(T);let x=await eP(d);return t?.pruneCachedAssets?.(Object.values(Hs).map(N=>N.sha256)).catch(()=>{}),tP(d,x)}catch(g){throw d?.terminate(),g}finally{for(let g of a)URL.revokeObjectURL(g);}}function eP(t){return new Promise((e,n)=>{let i=setTimeout(()=>n(new Error("mood worker did not start in time")),$I);t.onerror=r=>{clearTimeout(i),n(new Error(r.message||"mood worker failed to load"));},t.onmessage=r=>{let a=r.data;a.type==="ready"?(clearTimeout(i),e(a.delegate)):a.type==="error"&&(clearTimeout(i),n(new Error(a.message)));};})}function tP(t,e){let n=null,i=r=>{let a=n;n=null,a&&("error"in r?a.reject(r.error):a.resolve(r.blendshapes));};return t.onerror=r=>i({error:new Error(r.message||"mood worker crashed")}),t.onmessage=r=>{let a=r.data;a.type==="result"?i({blendshapes:a.blendshapes}):a.type==="error"&&i({error:new Error(a.message)});},{delegate:e,detect:(r,a)=>n?(r.close(),Promise.reject(new Error("detect already pending"))):new Promise((s,u)=>{n={resolve:s,reject:u};let d={type:"frame",frame:r,timestampMs:a};t.postMessage(d,[r]);}),terminate:()=>{i({error:new Error("mood worker terminated")}),t.terminate();}}}var NE=5,LE=480,nP="afx:mood-debug",iP=()=>{try{return globalThis.localStorage?.getItem(nP)==="1"}catch{return false}},rP=t=>{if(typeof VideoFrame=="function")try{return Promise.resolve(new VideoFrame(t))}catch{}return createImageBitmap(t,{resizeWidth:LE,resizeHeight:Math.round(LE*t.videoHeight/t.videoWidth),resizeQuality:"low"})},lh=class{constructor(e){this.options=e;this.classifier=new Cu;this.worker=null;this.timer=null;this.generation=0;this.detecting=false;this.failed=false;this.timestampMs=0;this.debug=false;this.ticks=0;}start(){if(this.timer||this.failed)return;this.worker??(this.worker=PE(this.options.cache));let e=this.generation;this.worker.then(n=>{e!==this.generation||this.timer||(this.debug=iP(),R.info("Mood","face model ready",{delegate:n.delegate,debug:this.debug}),this.timer=setInterval(()=>{this.tick(n);},1e3/NE));},n=>{e===this.generation&&this.fail("face model failed to load",n);});}stop(){this.generation+=1,this.timer&&(clearInterval(this.timer),this.timer=null),this.classifier.reset();}dispose(){this.stop(),this.worker?.then(e=>e.terminate(),()=>{}),this.worker=null;}async tick(e){if(this.detecting)return;let n=this.options.getVideo();if(!n||n.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||!n.videoWidth)return;let i=this.generation;this.detecting=true;try{let r=await rP(n);this.timestampMs=Math.max(performance.now(),this.timestampMs+1);let a=await e.detect(r,this.timestampMs);if(i!==this.generation)return;let s=this.classifier.update(a,Date.now(),this.options.isUserSpeaking());s&&this.options.onReading(s),this.debug&&++this.ticks%NE===0&&this.logFrame(s);}catch(r){i===this.generation&&this.fail("face detection failed",r);}finally{this.detecting=false;}}logFrame(e){let n=this.classifier.inspect();if(!n)return;let i=r=>Object.entries(r).map(([a,s])=>`${a}=${s}`).join(" ");R.info("Mood",`frame label=${n.label} reading=${e?.state??"none"} | scores ${i(n.scores)} | browDrop=${n.browDrop} | raw ${i(n.raw)} | base ${i(n.baseline)}`);}fail(e,n){this.failed=true,this.dispose(),R.warn("Mood",`${e}; mood reading is off for this session`,{cause:n});}};var aP=1280,oP=.75,sP=1e3,DE=5,BE=300,lP=6e4,uP=2500,cP=3,fP=new Set(["InvalidAccessError","InvalidStateError","NotAllowedError"]),dP={tab:"browser",window:"window",screen:"monitor"},hP=()=>{if(typeof navigator>"u")return "other";let t=navigator.userAgentData?.brands??[];if(t.some(n=>/Edge/i.test(n.brand)))return "edge";if(t.some(n=>/Chrom/i.test(n.brand)))return "chrome";let e=navigator.userAgent;return /Edg\//.test(e)?"edge":/Firefox\//.test(e)?"firefox":/Chrome\//.test(e)?"chrome":/Safari\//.test(e)?"safari":"other"},pP=t=>t==="browser"?"tab":t==="window"?"window":t==="monitor"?"screen":void 0,mP=()=>{if(typeof navigator>"u"||typeof document>"u")return "no browser";if(navigator.userAgentData?.mobile===true||/Android|iPhone|iPad|iPod/i.test(navigator.userAgent))return "mobile browsers cannot share a screen";if(typeof navigator.mediaDevices?.getDisplayMedia!="function")return "this browser cannot share a screen";let e=document.permissionsPolicy??document.featurePolicy;return typeof e?.allowsFeature=="function"&&!e.allowsFeature("display-capture")?"the embedding page does not allow display-capture":null},uh=class{constructor(e){this.browser=hP();this.phase="idle";this.surface=null;this.requestedSurface=null;this.turnId=null;this.clickTimer=null;this.listeners=new Set;this.disposed=false;this.stream=null;this.imageCapture=null;this.grabFailures=0;this.video=null;this.thumbCanvas=null;this.frameCanvas=null;this.sampleTimer=null;this.sampling=false;this.lastTickAt=0;this.throttleLogged=false;this.lastSentThumb=null;this.lastSentAt=0;this.handleTrackEnded=()=>{this.phase==="live"&&(R.info("Perception","screen share ended by the user"),this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"}));};this.handlers=e;}get currentPhase(){return this.phase}get currentSurface(){return this.surface}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,n){if(this.disposed){this.handlers.onStatus("unavailable",n,{reason:"session ended"});return}let i=mP();if(i){this.handlers.onStatus("unavailable",n,{reason:i});return}if(this.turnId=n,this.phase==="live"){this.report("granted",{surface:this.surface??void 0}),this.turnId=null;return}if(this.phase==="awaiting_click"){this.report("awaiting_click");return}this.phase!=="picking"&&(this.requestedSurface=e,this.pick(false));}shareFromClick(){this.phase!=="awaiting_click"||this.disposed||(this.clearClickTimer(),this.pick(true));}dismiss(){this.phase==="awaiting_click"&&(this.clearClickTimer(),this.finish("declined","dismissed"));}stop(){if(this.phase==="live"){this.releaseCapture(),this.setPhase("idle"),this.handlers.onState({feed:"off"});return}(this.phase==="awaiting_click"||this.phase==="picking")&&(this.clearClickTimer(),this.finish("declined","withdrawn"));}dispose(){this.disposed=true,this.clearClickTimer(),this.releaseCapture(),this.turnId=null,this.setPhase("idle"),this.listeners.clear();}async pick(e){this.setPhase("picking");let n=navigator.userActivation?.isActive??e,i=Date.now(),r=setTimeout(()=>{this.phase==="picking"&&!this.disposed&&this.report("picking");},BE),a;try{a=await navigator.mediaDevices.getDisplayMedia(this.pickerOptions());}catch(s){if(clearTimeout(r),this.disposed||this.phase!=="picking")return;let u=s?.name??"Error",d=Date.now()-i<BE;if(R.info("Perception","screen picker refused",{name:u,fromClick:e,hadActivation:n,afterMs:Date.now()-i}),!e&&!n&&d&&fP.has(u)){this.awaitClick();return}if(u==="NotAllowedError"){this.finish("declined",d?"blocked by the browser":"cancelled");return}this.finish("unavailable",u);return}if(clearTimeout(r),this.disposed||this.phase!=="picking"){a.getTracks().forEach(s=>s.stop()),R.info("Perception","released a screen shared after the request ended");return}this.adopt(a);}pickerOptions(){return {video:{frameRate:{ideal:DE,max:DE},...this.requestedSurface&&{displaySurface:dP[this.requestedSurface]}},audio:false,selfBrowserSurface:"exclude",surfaceSwitching:"include"}}awaitClick(){this.setPhase("awaiting_click"),this.report("awaiting_click"),this.clickTimer=setTimeout(()=>{this.clickTimer=null,this.phase==="awaiting_click"&&this.finish("declined","no click");},lP);}adopt(e){let n=e.getVideoTracks()[0];if(!n){e.getTracks().forEach(i=>i.stop()),this.finish("unavailable","no video track");return}this.stream=e,this.surface=pP(n.getSettings?.().displaySurface)??this.requestedSurface,n.addEventListener("ended",this.handleTrackEnded),this.setPhase("live"),this.report("granted",{surface:this.surface??void 0}),this.turnId=null,this.startSampler(n);}report(e,n){this.turnId!==null&&this.handlers.onStatus(e,this.turnId,{browser:this.browser,...n});}finish(e,n){this.report(e,{reason:n}),this.turnId=null,this.setPhase("idle");}clearClickTimer(){this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=null;}setPhase(e){this.phase!==e&&(this.phase=e,this.listeners.forEach(n=>{try{n();}catch{}}));}startSampler(e){let n=globalThis.ImageCapture;typeof n=="function"?this.imageCapture=new n(e):this.attachVideo(),this.thumbCanvas=document.createElement("canvas"),this.thumbCanvas.width=32,this.thumbCanvas.height=32,this.frameCanvas=document.createElement("canvas"),this.lastTickAt=Date.now(),this.sampleTimer=setInterval(()=>{this.sample();},sP);}attachVideo(){if(this.video||!this.stream)return;let e=document.createElement("video");e.playsInline=true,e.muted=true,e.autoplay=true,e.srcObject=this.stream,e.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),e.play().catch(()=>{}),this.video=e;}async sample(){if(this.sampling||!this.stream)return;let e=Date.now(),n=e-this.lastTickAt;this.lastTickAt=e,n>uP&&!this.throttleLogged&&(this.throttleLogged=true,R.warn("Perception","screen sampling throttled",{gapMs:n,hidden:document.hidden})),this.sampling=true;let i=null;try{if(i=await this.grabSource(),!i||!this.thumbCanvas||!this.stream)return;let r=this.thumbCanvas.getContext("2d",{willReadFrequently:!0});if(!r)return;r.drawImage(i.image,0,0,32,32);let a=Lv(r.getImageData(0,0,32,32).data);if(!Dv(this.lastSentThumb,a,e-this.lastSentAt))return;let s=await this.encode(i);if(!s||!this.stream)return;this.lastSentThumb=a,this.lastSentAt=e,this.handlers.onFrame(s);}catch(r){R.warn("Perception","screen frame failed",{name:r?.name});}finally{i?.release(),this.sampling=false;}}async grabSource(){if(this.imageCapture)try{let n=await this.imageCapture.grabFrame();return this.grabFailures=0,{image:n,width:n.width,height:n.height,release:()=>n.close()}}catch(n){return this.grabFailures+=1,this.grabFailures>=cP&&(R.warn("Perception","grabFrame keeps failing \u2014 using a video element",{name:n?.name}),this.imageCapture=null,this.attachVideo()),null}let e=this.video;return !e||!e.videoWidth||!e.videoHeight?null:{image:e,width:e.videoWidth,height:e.videoHeight,release:()=>{}}}encode(e){let n=this.frameCanvas;if(!n)return Promise.resolve(null);let i=Math.min(1,aP/Math.max(e.width,e.height)),r=Math.max(1,Math.round(e.width*i)),a=Math.max(1,Math.round(e.height*i));return n.width=r,n.height=a,n.getContext("2d")?.drawImage(e.image,0,0,r,a),new Promise(s=>{n.toBlob(u=>{if(!u)return s(null);u.arrayBuffer().then(d=>s({bytes:new Uint8Array(d),width:r,height:a})).catch(()=>s(null));},"image/jpeg",oP);})}releaseCapture(){this.stream?.getVideoTracks().forEach(e=>e.removeEventListener("ended",this.handleTrackEnded)),this.sampleTimer&&clearInterval(this.sampleTimer),this.sampleTimer=null,this.video&&(this.video.srcObject=null,this.video.remove(),this.video=null),this.stream?.getTracks().forEach(e=>e.stop()),this.stream=null,this.imageCapture=null,this.grabFailures=0,this.thumbCanvas=null,this.frameCanvas=null,this.lastSentThumb=null,this.lastSentAt=0,this.throttleLogged=false,this.surface=null;}};var gP="avatarfactory-riv-cache",Dr="riv-files",Ra="avatar-configs",Gs="greetings",Ws="vad-weights",fh="cache-keys",xa="content-assets";var UE="riv-wrap-key";var zs=null;function Ti(){return zs||(zs=new Promise((e,n)=>{let i=indexedDB.open(gP,6);i.onupgradeneeded=r=>{let a=i.result;a.objectStoreNames.contains(Dr)?r.oldVersion<5&&i.transaction?.objectStore(Dr).clear():a.createObjectStore(Dr),a.objectStoreNames.contains(Ra)||a.createObjectStore(Ra),a.objectStoreNames.contains(Gs)||a.createObjectStore(Gs),a.objectStoreNames.contains(Ws)||a.createObjectStore(Ws),a.objectStoreNames.contains(fh)||a.createObjectStore(fh),a.objectStoreNames.contains(xa)||a.createObjectStore(xa);},i.onblocked=()=>n(new Error("indexedDB upgrade to v6 blocked")),i.onsuccess=()=>{let r=i.result;r.onversionchange=()=>{r.close(),zs=null;},e(r);},i.onerror=()=>n(i.error);}).catch(e=>{throw zs=null,e}),zs)}var ch=null;function FE(t){return ch||(ch=vP(t).catch(()=>null).then(e=>(e||(ch=null),e))),ch}async function vP(t){let e=globalThis.crypto?.subtle;if(!e)return null;let n=await e.generateKey({name:"AES-GCM",length:256},false,["encrypt","decrypt"]);return new Promise(i=>{let r=t.transaction(fh,"readwrite"),a=r.objectStore(fh),s=a.get(UE),u=n;s.onsuccess=()=>{let d=s.result;d?u=d:a.put(n,UE);},r.oncomplete=()=>i(u),r.onerror=()=>i(null);})}async function VE(t){try{let e=await Ti(),n=await FE(e);if(!n)return null;let i=await new Promise(a=>{let u=e.transaction(Dr,"readonly").objectStore(Dr).get(t);u.onsuccess=()=>{let d=u.result;a(d?.cipher?d:null);},u.onerror=()=>a(null);});return i?{bytes:await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:i.iv},n,i.cipher),rivVersion:i.rivVersion}:null}catch{return null}}async function HE(t,e,n){try{let i=await Ti(),r=await FE(i);if(!r)return;let a=globalThis.crypto.getRandomValues(new Uint8Array(12)),s=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:a},r,e);return new Promise(u=>{let d={cipher:s,iv:a,rivVersion:n},g=i.transaction(Dr,"readwrite");g.objectStore(Dr).put(d,t),g.oncomplete=()=>u(),g.onerror=()=>u();})}catch{}}async function AP(t){try{let e=await Ti();return new Promise(n=>{let i=e.transaction([Dr,Ra],"readwrite");i.objectStore(Dr).delete(t),i.objectStore(Ra).delete(t),i.oncomplete=()=>n(),i.onerror=()=>n();})}catch{}}async function zE(t){try{let e=await Ti();return new Promise(n=>{let r=e.transaction(Ra,"readonly").objectStore(Ra).get(t);r.onsuccess=()=>{let a=r.result;if(!a){n(null);return}let s=a;if(!s.cachedAt||Date.now()-s.cachedAt>6048e5){AP(t),n(null);return}n(s.config);},r.onerror=()=>n(null);})}catch{return null}}async function GE(t,e){try{let n=await Ti();return new Promise(i=>{let r={config:e,cachedAt:Date.now()},a=n.transaction(Ra,"readwrite");a.objectStore(Ra).put(r,t),a.oncomplete=()=>i(),a.onerror=()=>i();})}catch{}}async function WE(t){try{let e=await Ti();return new Promise(n=>{let r=e.transaction(Gs,"readonly").objectStore(Gs).get(t);r.onsuccess=()=>{let a=r.result;if(!a?.cachedAt||Date.now()-a.cachedAt>2592e6){n(null);return}n(a);},r.onerror=()=>n(null);})}catch{return null}}async function jE(t,e){try{let n=await Ti();return new Promise(i=>{let r=n.transaction(Gs,"readwrite"),a=r.objectStore(Gs);a.put(e,t);let s=t.slice(0,t.indexOf(":"));if(s){let u=IDBKeyRange.bound(`${s}:`,`${s}:\uFFFF`),d=a.openKeyCursor(u);d.onsuccess=()=>{let g=d.result;g&&(g.key!==t&&a.delete(g.key),g.continue());};}r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function YE(t){try{let e=await Ti();return new Promise(n=>{let r=e.transaction(Ws,"readonly").objectStore(Ws).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function qE(t,e){try{let n=await Ti();return new Promise(i=>{let r=n.transaction(Ws,"readwrite"),a=r.objectStore(Ws);a.put(e,t);let s=a.openKeyCursor();s.onsuccess=()=>{let u=s.result;u&&(u.key!==t&&a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function XE(t){try{let e=await Ti();return new Promise(n=>{let r=e.transaction(xa,"readonly").objectStore(xa).get(t);r.onsuccess=()=>{let a=r.result;n(a instanceof Uint8Array?a:null);},r.onerror=()=>n(null);})}catch{return null}}async function QE(t,e){try{let n=await Ti();return new Promise(i=>{let r=n.transaction(xa,"readwrite");r.objectStore(xa).put(e,t),r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}async function KE(t){try{let e=await Ti(),n=new Set(t);return new Promise(i=>{let r=e.transaction(xa,"readwrite"),a=r.objectStore(xa),s=a.openKeyCursor();s.onsuccess=()=>{let u=s.result;u&&(n.has(String(u.key))||a.delete(u.key),u.continue());},r.oncomplete=()=>i(),r.onerror=()=>i();})}catch{}}var eA={getCachedRiv:VE,setCachedRiv:HE,getCachedAvatarConfig:zE,setCachedAvatarConfig:GE,getCachedGreeting:WE,setCachedGreeting:jE,getCachedVadWeights:YE,setCachedVadWeights:qE,getCachedAsset:XE,setCachedAsset:QE,pruneCachedAssets:KE};var ZE={async bytesToSrc(t){let e=new Blob([t],{type:"application/octet-stream"});return URL.createObjectURL(e)},revokeSrc(t){URL.revokeObjectURL(t);}};var yP=/^(cc-|new-password|current-password|one-time-code)/,bP=/\b(?:card (?:number|no|num)|cc (?:number|num|no)|cvv|cvc|csc|security code|iban|ssn|social security|otp)\b/,_P=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase(),dh=(t,e="")=>{if(t.getAttribute("type")==="password"||yP.test(t.getAttribute("autocomplete")||""))return true;let n=["name","id","aria-label","placeholder"].map(i=>t.getAttribute(i)||"").concat(e).join(" ");return bP.test(_P(n))},Gu=t=>(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&(t.type==="submit"||t.type==="image")&&t.form!==null;var SP=/\bsponsored\b/i,wP="nav, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]",tA=t=>{if(t.closest(wP))return true;let e=t.closest("header, footer");return !!e&&!e.parentElement?.closest("article, section, main, [role=main]")},EP=t=>{let e=t.getAttribute("role"),n=Array.from(t.classList).sort().slice(0,3).join(".");return `${t.tagName}${e?`[${e}]`:""}${n?`.${n}`:""}`},MP=t=>[t,t.parentElement,t.parentElement?.parentElement].map(e=>e?EP(e):"").join("<"),TP=t=>{let e=0;for(let n=t.parentElement;n;n=n.parentElement)e+=1;return e},JE=(t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,CP=t=>{let e=t.ownerDocument.defaultView;if(!e)return false;let n=t.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return i>=0&&r>=0&&i<=e.innerWidth&&r<=e.innerHeight},hh=(t,e)=>{if(t.length<=e)return t;let n=t.slice(0,e),i=n.lastIndexOf(" ");return `${i>0?n.slice(0,i):n}\u2026`},RP=t=>{let e=new Map,n=new Map;for(let r of t){let a=r.el;for(let s=0;a&&s<=8&&a!==a.ownerDocument.body;s+=1){let u=MP(a),d=e.get(u);d||e.set(u,d=new Set),d.add(a);let g=n.get(a);g||n.set(a,g=[]),g.push(r),a=a.parentElement;}}let i=[];for(let r of e.values()){if(r.size<3)continue;let a=Array.from(r).sort(JE);a.some((s,u)=>u>0&&a[u-1].contains(s))||i.push({cards:a,depth:a.reduce((s,u)=>s+TP(u),0)/a.length});}return {groups:i,controlsIn:n}},xP=t=>{let e=new Set;for(let n of t){let i=new Set(n.cards);for(let r of t){let a=r.depth-n.depth;if(r===n||a<=0||a>8)continue;let s=new Map;for(let d of r.cards){let g=d.parentElement;for(let v=0;g&&v<8;v+=1,g=g.parentElement)if(i.has(g)){s.set(g,(s.get(g)??0)+1);break}}if(s.size<3)continue;Array.from(s.values()).reduce((d,g)=>d+g,0)/s.size>=1.5?e.add(n):e.add(r);}}return t.filter(n=>!e.has(n))};function $E(t,e){let n=new Map,i=p=>{let _=n.get(p);return _===void 0&&n.set(p,_=e.textOf(p)),_},{groups:r,controlsIn:a}=RP(t),s=p=>{if(tA(p)||SP.test(i(p)))return false;let _=a.get(p)??[];return _.length!==1?_.length>1:i(p).length>_[0].name.length+3},u=p=>{let _=(N,E)=>i(E.el).length-i(N.el).length,T=p.filter(({el:N})=>N.matches("a[href], [role=link]"));return [...T.filter(({el:N})=>e.pathOf(N))].sort(_)[0]??[...T].sort(_)[0]??p[0]},d=(p,_)=>{let T=p[0].parentElement;for(let x=0;T&&x<3;x+=1,T=T.parentElement){let N=T.getAttribute("aria-label")?.trim();if(N)return hh(N,60);let E=T.previousElementSibling;for(let w=0;E&&w<3;w+=1){let C=E.matches("h1, h2, h3, [role=heading]")?E:E.querySelector("h1, h2, h3, [role=heading]"),I=C?i(C):"";if(I)return hh(I,60);E=E.previousElementSibling;}}return `List ${_}`},g=xP(r.map(p=>({...p,cards:p.cards.filter(s)})).filter(p=>p.cards.length>=3)).sort((p,_)=>JE(p.cards[0],_.cards[0])),v={lists:[],primary:new Map,secondary:new Set},A=new Set;for(let p of g){if(v.lists.length>=6)break;let _=v.lists.length+1,T=[],x=[],N=0;for(let E of p.cards){let w=(a.get(E)??[]).filter(({el:K})=>!A.has(K)),C=u(w);if(!C)continue;let I=i(C.el),V=hh(i(E).replace(I," ").replace(/\s+/g," ").trim(),90);T.push([C.el,{list:_,position:T.length+1,...CP(E)&&{screenPosition:++N},...V&&{detail:V},name:hh(I,60)||C.name}]);for(let{el:K}of w)K!==C.el&&x.push(K);}if(!(T.length<3)){v.lists.push({id:_,name:d(p.cards,_),total:T.length});for(let[E,w]of T)v.primary.set(E,w),A.add(E);for(let E of x)v.secondary.add(E),A.add(E);}}return v}var nA=/^skip (?:to\b|navigation\b|nav\b|main\b|links\b)/i,kP=25,OP=60,IP=40,sA={maxControls:OP,reservedLinks:0,groupLists:false,maxItems:0,preferVisible:false};var sM=60,PP=120,NP=200,eM=2,lM="main, section, article, aside, nav, header, footer, [role=region], [role=tabpanel], [role=main], [role=navigation], [role=banner], [role=contentinfo]",uM="h1, h2, h3, [role=heading]",cM="button, summary, [role=button], [role=tab], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=option], input[type=submit], input[type=button], input[type=reset]",LP=new Set(["option","menuitemradio","menuitemcheckbox"]),fM="a[href], [role=link]",aA="input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea, [contenteditable=''], [contenteditable=true], [role=textbox], [role=combobox]",DP="form, [role=form]",tM={section:"s",button:"b",link:"l",field:"f",form:"frm"},nn=(t,e)=>(t.getAttribute(e)||"").trim(),dM=/\s*[.(]?\s*opens? in (?:a )?new (?:tab|window)\)?\.?/gi,Rn=(t,e=sM)=>t.replace(dM,"").replace(/\s+/g," ").trim().slice(0,e),hM=(t,e)=>{let n=Rn(t,1/0);if(n.length<=e)return n;let i=n.slice(0,e),r=i.lastIndexOf(" ");return r>0?i.slice(0,r):i},BP=t=>!!t.body&&t.body.getBoundingClientRect().width>0,lA=(t,e)=>{let n=t;if(typeof n.checkVisibility=="function"&&!n.checkVisibility({contentVisibilityAuto:true,visibilityProperty:true}))return false;if(!e)return true;let i=t.getBoundingClientRect();return i.width>=eM&&i.height>=eM},UP=(t,e)=>{let n=e.defaultView;if(!n)return false;let i=t.getBoundingClientRect(),r=i.left+i.width/2,a=i.top+i.height/2;if(r<0||a<0||r>n.innerWidth||a>n.innerHeight)return false;let s=e.elementFromPoint(r,a);return !!s&&s!==t&&!t.contains(s)&&!s.contains(t)},FP=(t,e)=>{let n=e.defaultView;if(!n)return true;let i=t.getBoundingClientRect();return i.bottom>0&&i.right>0&&i.top<n.innerHeight&&i.left<n.innerWidth},VP=(t,e)=>{if(t.closest("[inert]"))return true;let n=e.defaultView;return n?n.getComputedStyle(t).pointerEvents==="none":false},gh=t=>{let e=nn(t,"aria-label");if(e)return Rn(e);let n=nn(t,"aria-labelledby");if(!n)return "";let i=n.split(/\s+/).map(r=>{let a=t.ownerDocument.getElementById(r);return a?ka(a):""}).join(" ");return Rn(i)},HP=new Set(["A","ABBR","B","BDI","BDO","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","RUBY","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]),pM="script, style, [aria-hidden=true], [hidden]",ka=(t,e,n=true)=>{if(t.nodeType===Node.TEXT_NODE)return t.nodeValue||"";if(t.nodeType!==Node.ELEMENT_NODE)return "";let i=t;if(!n&&e&&i.matches(e))return "";let r="";for(let a of Array.from(i.childNodes))r+=ka(a,e,false);return HP.has(i.tagName)?r:` ${r} `},mM=(t,e)=>{let n=[],i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:r=>r!==t&&r.nodeType===Node.ELEMENT_NODE&&r.matches(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let r=i.nextNode();r;r=i.nextNode())r.nodeType===Node.TEXT_NODE&&n.push(r.nodeValue??"");return n},zP=t=>{let e=Rn(ka(t,pM));return e.length>NP?"":e},GP=t=>{let e=t.querySelector("img[alt], [role=img][aria-label]");return e?Rn(nn(e,"alt")||nn(e,"aria-label")):""},WP=t=>{let e=t.labels?.[0];if(e)return Rn(ka(e));if(t.id){let i=t.ownerDocument.querySelector(`label[for="${CSS.escape(t.id)}"]`);if(i)return Rn(ka(i))}let n=t.closest("label");return n?Rn(ka(n)):""},jP=t=>t.length>=3&&/[a-z]/i.test(t)&&/[aeiou]/i.test(t)&&!/\d{3}/.test(t),js=t=>{if(!t)return "";let e=Rn(t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase());return jP(e)?e:""},YP=t=>{let e=nn(t,"autocomplete");if(e&&e!=="off"&&e!=="on")return js(e);let n=nn(t,"type");return n&&n!=="text"?`${n} field`:""},qP=(t,e)=>{for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.matches(lM))return false;return true},gM=t=>{for(let e of Array.from(t.querySelectorAll(uM)))if(qP(t,e))return Rn(ka(e));return ""},XP=4,vM=30,Wu=t=>{for(let[e,n]of t){let i=n();if(i)return {name:i,namedBy:e}}return {name:"",namedBy:"none"}},QP={nav:"navigation",header:"header",footer:"footer",main:"main content",aside:"sidebar"},KP=t=>Wu([["aria",()=>gh(t)],["heading",()=>gM(t)],["id",()=>js(t.id)],["landmark",()=>QP[t.tagName.toLowerCase()]??""]]),nM=t=>Wu([["aria",()=>gh(t)],["text",()=>zP(t)],["img-alt",()=>GP(t)],["title",()=>nn(t,"title")],["id",()=>js(nn(t,"name")||t.id)]]),ZP=t=>Wu([["aria",()=>gh(t)],["label",()=>WP(t)],["placeholder",()=>nn(t,"placeholder")],["title",()=>nn(t,"title")],["id",()=>js(nn(t,"name")||t.id)],["type",()=>YP(t)]]),AM=t=>nn(t,"role")==="combobox"&&!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement),JP=t=>t.hasAttribute("data-placeholder")?"":Rn(mM(t,"[aria-hidden=true]").join("")),$P=(t,e)=>{if(!LP.has(nn(t,"role")))return null;let n=t.closest("[role=listbox], [role=menu]");if(!n?.id)return null;let i=CSS.escape(n.id);return e.querySelector(`[aria-controls~="${i}"], [aria-owns~="${i}"]`)},eN=t=>{let e=nn(t,"type");if(e==="checkbox"||e==="radio")return e;if(AM(t))return "combobox";let n=nn(t,"autocomplete");if(n&&n!=="off"&&n!=="on")return n;if(e)return e;let i=t.tagName.toLowerCase();return i==="select"||i==="textarea"||i==="input"?i:nn(t,"role")==="combobox"?"combobox":"text"},tN=t=>t instanceof HTMLInputElement&&(t.type==="checkbox"||t.type==="radio"),iA=12,nN=t=>{let e=Array.from(t.options).filter(i=>!i.disabled&&i.value!=="").map(i=>Rn(i.label||i.text,sM)).filter(Boolean);if(e.length<=iA)return e;let n=e.length-iA;return [...e.slice(0,iA),`+${n} more`]},iM=t=>t.disabled===true||nn(t,"aria-disabled")==="true",iN=t=>{if(tN(t))return {checked:t.checked};if(!AM(t))return {filled:rN(t)};let e=JP(t);return e?{shows:e}:{filled:false}},rN=t=>{let e=t.value;return typeof e=="string"?e.trim().length>0:Rn(t.textContent||"").length>0},rM=(t,e)=>{let n=nn(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return i.origin===e.location.origin?i.pathname+i.search:void 0}catch{return}},rA=60,aN=t=>{if(t.length<=rA)return t;let e=t.split("?")[0];return e.length<=rA?e:`${e.slice(0,rA)}\u2026`},oN=t=>{for(let e of ["q","url","u"]){let n=t.searchParams.get(e);if(!(!n||!/^https?:\/\//i.test(n)))try{let i=new URL(n);if(i.origin!==t.origin)return i}catch{}}},sN=t=>t.querySelector("cite")?.textContent?.trim().match(/^(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+(?:\.[a-z0-9-]+)+)/i)?.[1]?.toLowerCase(),lN=(t,e)=>{let n=nn(t,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,e.baseURI);return /^https?:$/.test(i.protocol)?(i.origin===e.location.origin?oN(i):i)?.hostname.replace(/^www\./,"")??sN(t):void 0}catch{return}},aM=t=>t.split("?")[0].replace(/\/+$/,"")||"/",uN=/\s+[—–|·:]\s+/,cN=(t,e)=>Wu([["route",()=>dN(js(fN(t.location.pathname)))],["self-link",()=>Rn(e)],["title",()=>Rn(t.title.split(uN)[0]||"")]]),fN=t=>t.split("/").filter(Boolean).pop()||"",dN=t=>t?t[0].toUpperCase()+t.slice(1):"",hN=(t,e)=>{let n=t;for(let i=0;i<e&&n;i+=1)n=n.parentElement;return n?hM(ka(n,`${cM}, ${fM}, ${aA}`),vM):""},ph=(t,e=[])=>{let n=new Map;for(let r of t){let a=n.get(r.name);a?a.push(r):n.set(r.name,[r]);}let i=[];for(let r of n.values()){if(r.length===1){i.push(r[0]);continue}let a=nn(r[0].el,"href");if(a&&r.every(d=>nn(d.el,"href")===a)){i.push({...r[0],count:r.length});continue}let s=r.map(d=>hM(yM(d.el,e),vM));if(s.every(Boolean)&&new Set(s).size===r.length){r.forEach((d,g)=>{d.name=`${d.name} \u2014 in "${s[g]}"`;}),i.push(...r);continue}let u=false;for(let d=1;d<=XP&&!u;d+=1){let g=r.map(v=>hN(v.el,d));g.some(v=>!v)||new Set(g).size===r.length&&(r.forEach((v,A)=>{v.name=`${v.name} \u2014 ${g[A]}`;}),u=true);}u?i.push(...r):i.push({...r[0],count:r.length});}return i.sort(oA)},mh=(t,e,n,i,r=false)=>{let a=[],s=[],u=0;for(let d of Array.from(t.querySelectorAll(e))){if(!lA(d,n)||r&&n&&VP(d,t))continue;let g=r&&n&&UP(d,t),v=i(d);if(g){v.name&&s.push(v.name);continue}if(!v.name){u+=1;continue}a.push({el:d,name:v.name,namedBy:v.namedBy});}return {named:a,unnamed:u,covered:s}},pN=t=>t.length>=2&&/[a-z]/i.test(t),mN=(t,e,n)=>{let i=[];for(let r of Array.from(t.querySelectorAll(uM))){if(!lA(r,e)||n.some(s=>s.contains(r)))continue;let a=Rn(r.textContent||"");pN(a)&&i.push({el:r,name:a,namedBy:"heading-block"});}return i},oA=(t,e)=>t.el.compareDocumentPosition(e.el)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,gN=t=>{let e=[];for(let n of t)e.some(r=>r.name===n.name&&(r.el.contains(n.el)||n.el.contains(r.el)))||e.push(n);return e},yM=(t,e)=>{let n="",i="";for(let r of e)r.el.contains(t)?n=r.name:r.el.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING&&(i=r.name);return n||i},vN=t=>mM(t,pM).join(" ").replace(dM,"").replace(/\s+/g," ").trim(),AN=(t,e)=>{let n=Array.from(t.primary).sort(([,i],[,r])=>(i.screenPosition?0:1)-(r.screenPosition?0:1)||i.list-r.list||i.position-r.position);return new Map(n.slice(0,e))},oM=({list:t,position:e,screenPosition:n,detail:i})=>({list:t,position:e,...n&&{screenPosition:n},...i&&{detail:i}});function bM(t=document,e=1,n=sA){let i=BP(t),r=new Map,a=[],s={},u={section:0,button:0,link:0,field:0,form:0},d=new Map,g=(D,U)=>{u[U]+=1;let z=`${tM[U]}${u[U]}`;return r.set(z,D),d.set(D,z),z},v=mh(t,lM,i,KP);s.section=v.unnamed;let A=gN([...v.named,...mN(t,i,v.named.map(D=>D.el))].sort(oA)),p=ph(A).slice(0,kP),_=p.filter(D=>D.namedBy!=="landmark");for(let{el:D,name:U,namedBy:z}of _)a.push({handle:g(D,"section"),kind:"section",name:U,namedBy:z});let T=mh(t,cM,i,nM,true);T.named=T.named.filter(D=>!D.el.matches(aA));let x=mh(t,fM,i,nM,true);T.named=T.named.filter(({name:D})=>!nA.test(D)),x.named=x.named.filter(({name:D})=>!nA.test(D));let N=mh(t,aA,i,ZP,true);s.button=T.unnamed,s.link=x.unnamed,s.field=N.unnamed;let E=n.groupLists&&i?$E([...T.named,...x.named],{textOf:vN,pathOf:D=>rM(D,t)}):null,w=E?AN(E,n.maxItems):null;if(E&&w){let D=U=>E.primary.has(U.el)&&!w.has(U.el);T.named=T.named.filter(U=>!D(U)),x.named=x.named.filter(U=>!D(U));for(let U of [...T.named,...x.named]){let z=w.get(U.el);z&&(U.name=z.name);}}let C=ph(N.named,p),I=ph(T.named,p),V=ph(x.named,p),K=Math.min(n.reservedLinks,V.length),F={left:n.maxControls-K},H=D=>{let U=FP(D.el,t)?0:3;return E?.secondary.has(D.el)?U?7:6:w?.has(D.el)?U:U+(tA(D.el)?2:1)},J=D=>{let U=Math.max(0,F.left),z=D.slice(0,U);if(n.preferVisible&&i&&D.length>U){let X=D.map(oe=>({candidate:oe,rank:H(oe)}));X.sort((oe,ge)=>oe.rank-ge.rank),z=X.slice(0,U).map(({candidate:oe})=>oe).sort(oA);}return F.left-=z.length,z};for(let{el:D,name:U,namedBy:z,count:X}of J(C))a.push({handle:g(D,"field"),kind:"field",name:U,namedBy:z,fieldType:eN(D),...iN(D),...D instanceof HTMLSelectElement&&{options:nN(D)},...X&&{count:X},...iM(D)&&{disabled:true},...dh(D,U)&&{sensitive:true}});for(let{el:D,name:U,namedBy:z,count:X}of J(I)){let oe=$P(D,t),ge=oe?d.get(oe):void 0,be=w?.get(D);a.push({handle:g(D,"button"),kind:"button",name:U,namedBy:z,...be&&{item:oM(be)},...ge&&{choiceOf:ge},...X&&{count:X},...Gu(D)&&{submits:true},...iM(D)&&{disabled:true}});}let Y=aM(t.location.pathname),Me="";F.left+=K;for(let{el:D,name:U,namedBy:z,count:X}of J(V)){let oe=rM(D,t),ge=lN(D,t),be=oe?.includes("?")?oe.slice(oe.indexOf("?")):"",_e=!!oe&&aM(oe)===Y&&(!be||be===t.location.search);_e&&!Me&&(Me=U);let ve=w?.get(D);a.push({handle:g(D,"link"),kind:"link",name:U,namedBy:z,...ve&&{item:oM(ve)},...X&&{count:X},...oe&&!ve&&!ge&&{path:aN(oe)},...ge&&{site:ge},..._e&&{current:true}});}let Re=new Map(a.map(D=>[r.get(D.handle),D.handle]));for(let D of Array.from(t.querySelectorAll(DP))){if(!lA(D,i))continue;let U=[];for(let[oe,ge]of Re)D.contains(oe)&&!ge.startsWith(tM.section)&&U.push(ge);if(U.length===0)continue;let{name:z,namedBy:X}=Wu([["aria",()=>gh(D)],["heading",()=>gM(D)],["section",()=>yM(D,p)],["id",()=>js(nn(D,"name")||D.id)]]);a.push({handle:g(D,"form"),kind:"form",name:z||"form",namedBy:X,children:U});}let{name:he,namedBy:De}=cN(t,Me),fe=new Set(a.map(D=>D.item?.list)),Q=E?.lists.filter(D=>fe.has(D.id))??[],te=[...new Set([...T.covered,...x.covered,...N.covered].filter(D=>!nA.test(D)))].slice(0,IP);return {index:{generation:e,url:t.location.pathname+t.location.search,title:Rn(t.title,PP),pageName:he||"this",pageNamedBy:De,nodes:a,unnamed:s,...Q.length>0&&{lists:Q},...i&&{covered:te}},elements:r}}var MM=/^(?:true|yes|y|on|1|check|checked|tick|ticked|select|selected)$/i,yN=/^(?:false|no|n|off|0|uncheck|unchecked|untick|unticked|deselect)$/i,bN={date:"dates go in as YYYY-MM-DD",time:"times go in as HH:MM, 24-hour","datetime-local":"a date and time goes in as YYYY-MM-DDTHH:MM",month:"a month goes in as YYYY-MM",week:"a week goes in as YYYY-Www",number:"only a plain number fits",range:"only a plain number fits",color:"a colour goes in as #rrggbb"},_M=t=>t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim(),SM=(t,e)=>{let n=t.filter(e);return n.length===1?n[0]:void 0},TM=(t,e,n)=>{let i=_M(n);if(!i)return;let r=a=>e(a).map(_M);return t.find(a=>r(a).includes(i))??SM(t,a=>r(a).some(s=>s.startsWith(i)))??SM(t,a=>r(a).some(s=>s.includes(i)))},_N=(t,e)=>{let n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptor(n,"value")?.set;i?i.call(t,e):t.value=e;},CM=(t,e)=>{t.focus({preventScroll:true}),_N(t,e),t.dispatchEvent(new Event("input",{bubbles:true})),t.dispatchEvent(new Event("change",{bubbles:true})),t.blur();},wM=(t,e)=>t.readOnly?{outcome:"read_only"}:(CM(t,e),e&&t.value===""?{outcome:"rejected",detail:bN[t.type]}:e&&!t.validity.valid?{outcome:"invalid",detail:t.validationMessage}:{outcome:"ok"}),SN=(t,e)=>{let n=Array.from(t.options).filter(r=>!r.disabled),i=TM(n,r=>[r.value,r.label||r.text],e);return i?(CM(t,i.value),{outcome:"ok"}):{outcome:"no_such_option",detail:n.filter(r=>r.value!=="").map(r=>r.label||r.text).join(", ")}},EM=t=>t.labels?.[0]?.textContent?.trim()||t.getAttribute("aria-label")||t.value,wN=(t,e)=>{let n=t.form??t.ownerDocument,i=t.name?Array.from(n.querySelectorAll(`input[type=radio][name="${CSS.escape(t.name)}"]`)):[t],r=TM(i,a=>[a.value,EM(a)],e)??(MM.test(e.trim())?t:void 0);return r?r.disabled?{outcome:"disabled"}:(r.checked||r.click(),r.checked?{outcome:"ok"}:{outcome:"rejected"}):{outcome:"no_such_option",detail:i.map(EM).join(", ")}},EN=(t,e)=>{let n=MM.test(e.trim())?true:yN.test(e.trim())?false:void 0;return n===void 0?{outcome:"rejected",detail:'a tick box takes "yes" or "no"'}:(t.checked!==n&&t.click(),t.checked===n?{outcome:"ok"}:{outcome:"rejected"})},MN=(t,e)=>(t.focus({preventScroll:true}),window.getSelection()?.selectAllChildren(t),(e?document.execCommand("insertText",false,e):document.execCommand("delete"))||(t.textContent=e,t.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:e}))),t.blur(),{outcome:"ok"}),RM=(t,e)=>t instanceof HTMLSelectElement?SN(t,e):t instanceof HTMLTextAreaElement?wM(t,e):t instanceof HTMLInputElement?t.type==="radio"?wN(t,e):t.type==="checkbox"?EN(t,e):t.type==="file"?{outcome:"not_fillable"}:wM(t,e):t instanceof HTMLElement&&t.isContentEditable?MN(t,e):{outcome:"not_fillable"},TN=t=>"willValidate"in t&&t.willValidate,CN=(t,e)=>{let n=Array.from(t.elements).find(r=>TN(r)&&!r.validity.valid);if(!n)return;let i=n.validationMessage||"still needs a valid value";return `"${e(n)}": ${i}`},xM=(t,e,n=false)=>{let i=t.form;if(i&&!i.noValidate&&!t.formNoValidate){let u=CN(i,e);if(u)return {outcome:"invalid",detail:u}}let r=false,a=false,s=u=>{r=true,a=u.defaultPrevented,n||u.preventDefault();};window.addEventListener("submit",s);try{t.click();}finally{window.removeEventListener("submit",s);}return !r||a||n?{outcome:"ok"}:{outcome:"requires_reload"}};var RN=new Set(["date","time","datetime-local","month","week","color"]),xN=t=>{let e=t.getBoundingClientRect();return {clientX:e.left+e.width/2,clientY:e.top+e.height/2}},ju=(t,e,n,i)=>{let r={bubbles:true,cancelable:true,composed:true,view:window,button:0,buttons:i?1:0,...n};return e.startsWith("pointer")?typeof PointerEvent!="function"?true:t.dispatchEvent(new PointerEvent(e,{...r,pointerId:1,pointerType:"mouse",isPrimary:true})):t.dispatchEvent(new MouseEvent(e,r))},uA=t=>{let e=xN(t),n=ju(t,"pointerdown",e,true),i=ju(t,"mousedown",e,true);n&&i&&t instanceof HTMLElement&&t.focus({preventScroll:true}),ju(t,"pointerup",e,false),ju(t,"mouseup",e,false),t instanceof HTMLElement?t.click():ju(t,"click",e,false);},kN=t=>{if(t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&RN.has(t.type))try{t.showPicker?.();}catch{}},kM=t=>{uA(t),kN(t);};var Ys=0,Ao=0,vh=null,ON=()=>{let t=vh;if(vh=null,t==="forward"){Ys+=1,Ao=Math.max(0,Ao-1);return}t==="back"?Ao+=1:Ao=0,Ys=Math.max(0,Ys-1);},cA={canGo:t=>t==="back"?Ys>0:Ao>0,go(t){vh=t,t==="back"?window.history.back():window.history.forward();}};function OM(t){if(typeof window>"u")return ()=>{};let e=null,n=()=>{e&&clearTimeout(e),e=setTimeout(t,500);};Ys=0,Ao=0,vh=null;let{pushState:i,replaceState:r}=window.history,a=(g,v)=>function(...A){let p=g.apply(this,A);return v&&(Ys+=1,Ao=0),n(),p},s=()=>{ON(),n();},u=a(i,true),d=a(r,false);return window.history.pushState=u,window.history.replaceState=d,window.addEventListener("popstate",s),window.addEventListener("hashchange",n),()=>{e&&clearTimeout(e),window.history.pushState===u&&(window.history.pushState=i),window.history.replaceState===d&&(window.history.replaceState=r),window.removeEventListener("popstate",s),window.removeEventListener("hashchange",n);}}var IN=.8,PN="l",pA="b",fA="f",LM="s",NN=new Set([LM,pA]),qs=t=>/^([a-z]{1,4})\d{1,4}$/.exec(t)?.[1]??"",LN=/\s+—\s+.*$/,dA=t=>t.toLowerCase().replace(/\s+/g," ").trim(),DN=t=>{try{return new URL(t,window.location.href).origin===window.location.origin}catch{return false}},IM=t=>t.replace(/\/+$/,"")||"/",BN=t=>{try{return IM(new URL(t,window.location.href).pathname)===IM(window.location.pathname)}catch{return false}},PM=(t,e,n)=>{let i=false,r=s=>{i=s.defaultPrevented,e||s.preventDefault();};window.addEventListener("click",r);try{t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));}finally{window.removeEventListener("click",r);}if(i||e)return "ok";let a=t.href;return n===void 0||!a?"requires_reload":(setTimeout(()=>window.location.assign(a),n),"ok")},hA=t=>t.matches(":disabled")||t.getAttribute("aria-disabled")==="true",UN=new Set(["back","forward"]),DM=t=>cA.canGo(t)?(cA.go(t),"ok"):"no_history",FN=t=>{let e=window.navigation;return e?(t==="back"?!e.canGoBack:!e.canGoForward)?"no_history":(t==="back"?e.back():e.forward(),"ok"):DM(t)},VN=()=>{let t=document.documentElement;return {x:Math.max(0,t.scrollWidth-window.innerWidth),y:Math.max(0,t.scrollHeight-window.innerHeight)}},NM=(t,e,n,i)=>{if(!t)return e;if(t.relative){let r=t.percent?i*t.value/100:t.value;return e+r}return t.percent?n*t.value/100:t.value},HN=t=>{let e=VN();if(t.kind==="edge"){let n=t.edge==="top"?0:t.edge==="bottom"?e.y:e.y/2;window.scrollTo({top:n,behavior:"smooth"});return}if(t.kind==="step"){let n=window.innerHeight*IN;window.scrollBy({top:t.direction==="up"?-n:n,behavior:"smooth"});return}window.scrollTo({left:NM(t.x,window.scrollX,e.x,window.innerWidth),top:NM(t.y,window.scrollY,e.y,window.innerHeight),behavior:"smooth"});};function zN(t={}){let e=t.survivesDocumentLoad??false,n=t.indexProfile??sA,i=t.followLinksAnywhere??false,r=t.documentLoadAfterMs,a=null,s=(v,A)=>!a||a.generation!==A?null:a.elements.get(v)??null,u=v=>{let A=a?.elements.get(v);return A?.isConnected?{element:A,isSection:qs(v)===LM}:null},d=v=>a?.generation===v?"unknown_target":"stale",g=v=>{for(let[A,p]of a?.elements??[])if(p===v)return a?.names.get(A)??A;return v.labels?.[0]?.textContent?.trim()||v.getAttribute("aria-label")||v.getAttribute("placeholder")||v.getAttribute("name")||"a field"};return {elementNamed(v){let A=dA(v);if(!a||!A)return null;let p=null;for(let[_,T]of a.names)if(NN.has(qs(_))){if(dA(T)===A)return u(_);!p&&dA(T.replace(LN,""))===A&&(p=_);}return p?u(p):null},read(v){let{index:A,elements:p}=bM(document,v,n),_=new Map(A.nodes.map(T=>[T.handle,T.name]));return a={generation:v,elements:p,names:_},A},retag(v){a&&(a.generation=v);},scroll(v,A){let p=Bv(v);if(p)return HN(p),"ok";if(A===void 0)return "unknown_target";let _=s(v,A);return _?_.isConnected?(_.scrollIntoView({behavior:"smooth",block:"start"}),"ok"):"stale":d(A)},navigate(v,A){if(UN.has(v)){let x=v;return e?FN(x):DM(x)}if(A===void 0)return "unknown_target";if(qs(v)!==PN)return "not_navigable";let p=s(v,A);if(!p)return d(A);if(!p.isConnected)return "stale";let _=p.getAttribute("href");if(!_)return "not_navigable";let T=DN(_);return !T&&!i?"not_navigable":T&&BN(_)?"already_here":PM(p,e,r)},click(v,A){if(A===void 0)return "unknown_target";let p=qs(v);if(p!==pA&&p!==fA)return "not_clickable";let _=s(v,A);return _?_.isConnected?Gu(_)?"submits_form":hA(_)?"disabled":(_.scrollIntoView({behavior:"smooth",block:"center"}),p===fA?(kM(_),"ok"):_.closest("a[href]")?PM(_,e,r)==="ok"?"ok":"requires_reload":(uA(_),"ok")):"stale":d(A)},fill(v,A){let p=false;return v.map(({handle:_,value:T})=>{let x=a?.names.get(_)??_,N=(I,V)=>({handle:_,name:x,outcome:I,...V&&{detail:V}});if(A===void 0)return N("unknown_target");if(qs(_)!==fA)return N("not_fillable");let E=s(_,A);if(!E)return N(d(A));if(!E.isConnected)return N("stale");if(dh(E,x))return N("sensitive");if(hA(E))return N("disabled");p||(E.scrollIntoView({behavior:"smooth",block:"center"}),p=true);let{outcome:w,detail:C}=RM(E,T);return N(w,C)})},submit(v,A){if(A===void 0)return {outcome:"unknown_target"};if(qs(v)!==pA)return {outcome:"not_a_submit"};let p=s(v,A);return p?p.isConnected?Gu(p)?hA(p)?{outcome:"disabled"}:(p.scrollIntoView({behavior:"smooth",block:"center"}),xM(p,g,e)):{outcome:"not_a_submit"}:{outcome:"stale"}:{outcome:d(A)}}}}var Ah=zN();var mA=ue(Bu());var GN=100,WN=.001,jN=21,UM=t=>{let e=fo(t);return e!==null&&e<=jN},YN=t=>t.type===mA.StateMachineInputType.Trigger?"trigger":t.type===mA.StateMachineInputType.Boolean?"boolean":"number",qN=(t,e)=>{let{name:n,inputs:i}=$i(t,e),r=i.map(a=>{let s=YN(a);return {path:a.name,kind:s,source:"input",isViseme:s==="number"&&UM(a.name),read:()=>s==="trigger"?null:a.value}});return {stateMachine:n,probes:r}},XN=(t,e,n,i)=>{let r={path:i,source:"property",isViseme:false};switch(n){case "number":{let a=t.number(e);return a&&{...r,kind:"number",isViseme:UM(e),read:()=>a.value}}case "boolean":{let a=t.boolean(e);return a&&{...r,kind:"boolean",read:()=>a.value}}case "string":{let a=t.string(e);return a&&{...r,kind:"string",read:()=>a.value}}case "color":{let a=t.color(e);return a&&{...r,kind:"color",read:()=>a.value}}case "enumType":{let a=t.enum(e);return a&&{...r,kind:"enum",read:()=>a.value}}case "trigger":{let a=t.trigger(e);return a&&{...r,kind:"trigger",read:()=>null,property:a}}default:return null}},FM=(t,e="")=>t.properties.flatMap(({name:n,type:i})=>{let r=e?`${e}/${n}`:n;if(i==="viewModel"){let s=t.viewModel(n);return s?FM(s,r):[]}let a=XN(t,n,i,r);return a?[a]:[]}),QN=(t,e)=>typeof t=="number"&&typeof e=="number"?Math.abs(t-e)>WN:t!==e,BM=({read:t,property:e,...n},i)=>({...n,value:i}),gA=class{constructor(e,n){this.target=e;this.emit=n;this.last=new Map;this.unreadable=new Set;this.triggerHandlers=new Map;this.timer=null;this.sample=()=>{for(let e of this.probes){if(e.kind==="trigger")continue;let n=this.read(e);if(n===void 0)continue;let i=this.last.get(e)??null;QN(n,i)&&(this.last.set(e,n),this.emit({type:"change",value:BM(e,n),previous:i}));}};let i=qN(e.rive,e.stateMachine),r=e.rive.viewModelInstance;this.stateMachine=i.stateMachine,this.probes=[...i.probes,...r?FM(r):[]];}snapshot(){let e=this.probes.flatMap(n=>{let i=this.read(n);return i===void 0?[]:[BM(n,i)]});return {type:"snapshot",binding:this.target.binding,stateMachine:this.stateMachine,values:e}}start(){if(!this.timer){for(let e of this.probes){let n=this.read(e);n!==void 0&&this.last.set(e,n);}this.listenForTriggers(),this.timer=setInterval(this.sample,GN);}}stop(){this.timer&&clearInterval(this.timer),this.timer=null;for(let[e,n]of this.triggerHandlers)e.property?.off(n);this.triggerHandlers.clear();}listenForTriggers(){for(let e of this.probes){if(!e.property)continue;let n=()=>this.emit({type:"trigger",path:e.path,source:"property"});e.property.on(n),this.triggerHandlers.set(e,n);}}read(e){if(!this.unreadable.has(e))try{return e.read()}catch(n){this.unreadable.add(e),R.warn("RigActivity",`can't read "${e.path}", skipping it`,{error:String(n)});return}}},yh=class{constructor(){this.listeners=new Set;this.watcher=null;this.subscribe=e=>(this.listeners.add(e),this.watcher&&(this.watcher.start(),e(this.watcher.snapshot())),()=>{this.listeners.delete(e),this.listeners.size===0&&this.watcher?.stop();});this.emit=e=>{for(let n of this.listeners)try{n(e);}catch(i){R.warn("RigActivity","a listener threw",{error:String(i)});}};}attach(e){this.detach();try{this.watcher=new gA(e,this.emit);}catch(n){R.warn("RigActivity","could not read the rig",{error:String(n)});return}this.listeners.size!==0&&(this.watcher.start(),this.emit(this.watcher.snapshot()));}detach(){this.watcher&&(this.watcher.stop(),this.watcher=null,this.emit({type:"detached"}));}reportTrigger(e){this.listeners.size&&this.emit({type:"trigger",path:e,source:"input"});}reportGesture(e,n){this.listeners.size&&this.emit({type:"gesture",name:e,target:n});}reportWrite(e,n,i){this.listeners.size&&this.emit({type:"write",path:e,value:n,landed:i});}};var VM=7e3,KN=()=>{if(typeof window>"u")return false;try{return window.self!==window.top}catch{return true}},ZN=(t,e,n,i)=>{let r=(0, ee.useMemo)(()=>hu(t),[t]),a=r.environment==="meeting",s=(0, ee.useRef)(null),u=(0, ee.useRef)(e),[d,g]=(0, ee.useState)("idle"),[v,A]=(0, ee.useState)("none"),[p,_]=(0, ee.useState)("idle"),[T,x]=(0, ee.useState)(null),[N,E]=(0, ee.useState)(false),[w,C]=(0, ee.useState)(null),[I,V]=(0, ee.useState)(false),[K,F]=(0, ee.useState)(null),[H,J]=(0, ee.useState)(false),Y=(0, ee.useRef)(null),Me=(0, ee.useRef)(null),Re=(0, ee.useRef)(null),he=(0, ee.useRef)(null),De=(0, ee.useRef)(null),fe=(0, ee.useRef)(null),Q=(0, ee.useRef)(null),te=(0, ee.useRef)(null);te.current||(te.current=new oh);let[D,U]=(0, ee.useState)(null),[z,X]=(0, ee.useState)("user"),[oe,ge]=(0, ee.useState)(false),[be,_e]=(0, ee.useState)("idle"),[ve,He]=(0, ee.useState)(0),[ct,ot]=(0, ee.useState)(0),[ae,Ae]=(0, ee.useState)(false),[ze,xe]=(0, ee.useState)(false),[ye,Ye]=(0, ee.useState)(false),[Xe,qe]=(0, ee.useState)(false),[_t,Tt]=(0, ee.useState)(false),[mt,gt]=(0, ee.useState)(false),[Qe,pe]=(0, ee.useState)(false),[y,c]=(0, ee.useState)(0),[m,M]=(0, ee.useState)(0),O=(0, ee.useRef)(0),B=(0, ee.useRef)(0),q=(0, ee.useRef)(null),le=(0, ee.useRef)([]),[Ne,de]=(0, ee.useState)(0),ke=(0, ee.useRef)(0),vt=(0, ee.useMemo)(()=>new yh,[]),ft=(0, ee.useRef)(null);ft.current||(ft.current=Ru([]));let Ke=ft.current,Gt=(0, ee.useRef)(null);Gt.current||(Gt.current=Ru(null));let rn=Gt.current,$e=(0, ee.useRef)(null),[an,Wt]=(0, ee.useState)(null),jt=(0, ee.useRef)(null);jt.current||(jt.current=Ru({services:{ingest:"ok",stt:"ok",llm:"ok",tts:"ok",downlink:"ok"},concern:null}));let Ie=jt.current,[zi,Kn]=(0, ee.useState)("normal");s.current||(s.current=new wu(r,{cache:eA,urlResolver:ZE,pageSurface:u.current?.surface??(n||a?void 0:Ah),pageBeforeLive:u.current?.pageBeforeLive,browser:u.current?.browser,framed:KN(),embedHostOrigin:n,embedResume:i,readsMood:true,reportsMicPipeline:true}));let L=s.current,Ri=L.isPushToTalk();!fe.current&&(r.mode??"call")==="call"&&!Ri&&r.turnTaking?.clientBargeIn!==false&&(fe.current=new Lu(L,kE,{echoGate:r.turnTaking?.echoGate}),fe.current.prefetch()),fe.current?.setSpeaking(N);let Fr=(0, ee.useCallback)(()=>{if(!Re.current){let Se=new sh;Se.subscribe(()=>{U(Se.getStream()),X(Se.getFacing()),ge(Se.isSessionOpen);}),Se.onStateChange(pt=>L.sendCameraState(pt)),Re.current=Se;}return Re.current},[L]),Zn=(0, ee.useCallback)(()=>{he.current?.stop(),Re.current?.stop(),Re.current=null;},[]),Gi=(0, ee.useCallback)(()=>(he.current??(he.current=new lh({getVideo:()=>Re.current?.getVideoElement()??null,isUserSpeaking:()=>fe.current?.isUserVoiced()??false,onReading:Se=>L.reportMood(Se),cache:eA})),he.current),[L]),we=(0, ee.useCallback)(()=>{if(!De.current){let Se=new uh({onStatus:(pt,Yt,ur)=>L.reportScreenStatus(pt,Yt,ur),onState:pt=>L.sendScreenState(pt),onFrame:pt=>L.sendScreenFrame(pt)});Se.subscribe(()=>_e(Se.currentPhase)),De.current=Se;}return De.current},[L]),Jn=(0, ee.useCallback)(()=>{De.current?.dispose(),De.current=null,_e("idle");},[]),Vr=(0, ee.useCallback)(async()=>{let Se=Re.current;Se&&await Se.setVideoEnabled(!Se.isActive);},[]);(0, ee.useEffect)(()=>{if(L)return q.current&&(clearTimeout(q.current),q.current=null),L.load(),()=>{q.current=setTimeout(()=>{L.dispose(),fe.current?.dispose(),te.current?.release();},0);}},[L]);let Na=r.avatar?.avatarId||"default";(0, ee.useEffect)(()=>{L.setAvatarId(Na)&&(C(null),Wt(null),Kn("normal"),F(null),V(false));},[L,Na]),(0, ee.useEffect)(()=>{if(!L)return;let Se=L.on("session-phase",Ee=>{g(Ee),Ee==="connecting"&&(C(null),Wt(null),Kn("normal"),He(Ze=>Ze+1));}),pt=L.on("paint-phase",A),Yt=L.on("turn-phase",Ee=>{_(Ee),(Ee==="listening"||Ee==="idle")&&Ae(false);}),ur=L.on("talking-armed",xe);g(L.getSessionPhase()),A(L.getPaintPhase()),_(L.getTurnPhase()),xe(L.getTalkingArmed());let Nh=L.on("speak",Ee=>{x(Ee),E(true);}),Lh=L.on("interrupt",()=>{Y.current?.reset(),x(null),E(false),Ae(false),le.current=[];}),Io=L.on("speech-cancelled",()=>{Y.current?.reset(),E(false),Ae(false),le.current=[];}),oc=L.on("avatar_thinking",()=>{Ae(true),M(Ee=>Ee+1);}),Po=L.on("avatar_slow_response",Ye),sc=L.on("mic-start",async Ee=>{fe.current?.ensureInit();try{Me.current=await wE(Ee,Ze=>{let An=fe.current;if(!An){L.sendPcmChunk(Ze.buffer);return}for(let Do of An.releaseUplinkFrames(Ze))L.sendPcmChunk(Do.buffer);},{sampleRate:16e3,onFloat32:Ze=>fe.current?.pushPcm(Ze),onBlocked:a?()=>L.reportAudioBlocked("mic"):void 0,onSettled:()=>L.reportMicPipelineSettled()});}catch{fe.current?.disable("mic_pipeline_failed"),L.reportMicPipelineSettled();}}),Ha=()=>{let Ee=Date.now();Ee-O.current<dv||(O.current=Ee,c(Ze=>Ze+1));},Dh=L.on("user-partial",Ee=>{fe.current?.onPartialTranscript(Ee),Ee.trim()&&Ha();}),Bh=L.on("user-speaking",Ha),vn=L.on("user-voice",Ha),lc=L.on("mic-muted",Ee=>{qe(Ee),fe.current?.setMicMuted(Ee);}),Oi=L.on("speaker-muted",Ee=>{Tt(Ee),Q.current?.setMuted(Ee);}),Uh=L.on("mood-detection",gt),No=L.on("ptt-held",pe),za=Ee=>{let Ze=Q.current??(Q.current=new ah(te.current));Ze.setMuted(L.getSpeakerMuted()),Ze.start(Ee);},el=L.on("connect-tone",(Ee,Ze)=>{if(Ee==="start"){Ze&&za(Ze);return}Q.current?.stop(r.connectTone?.fadeOutMs);}),tl=L.getPendingConnectTone();tl&&(R.debug("SDK","connect-tone was already ringing on listener attach"),za(tl));let nl=L.on("avatar-ready",()=>{V(true);}),Fh=L.on("gesture",(Ee,Ze,An)=>{ke.current++,R.debug("SDK","gesture: received",{name:Ee,atMs:Ze,speechless:An,token:ke.current}),le.current.push({name:Ee,token:ke.current,atMs:Ze,speechless:An}),de(ke.current);}),Vh=L.on("beep",(Ee,Ze)=>{ke.current++,le.current.push({name:"beep",beep:true,token:ke.current,atMs:Ee,speechless:Ze}),de(ke.current);}),il=L.on("vision-request",async Ee=>{if(!r.perception?.camera){L.reportPerceptionOutcome("unavailable",Ee);return}let Ze=Fr();if(Ze.isActive){L.reportPerceptionOutcome("granted",Ee,{hasHistory:Ze.hasHistory(),feed:"live"});let hc=await Ze.waitForFrames(VM);hc.length&&L.sendVisionFrames(hc,Ee);return}if(Ze.isVideoOff){L.reportPerceptionOutcome("granted",Ee,{hasHistory:false,feed:"off"});return}await Ze.willPrompt()&&L.reportPerceptionOutcome("prompting",Ee);let An=await Ze.ensureCamera();if(An!=="granted"){L.reportPerceptionOutcome(An,Ee);return}L.reportPerceptionOutcome("granted",Ee,{hasHistory:Ze.hasHistory(),feed:Ze.feed});let Do=await Ze.waitForFrames(VM);Do.length&&L.sendVisionFrames(Do,Ee);}),Hh=L.on("camera-flip",async(Ee,Ze)=>{let An=Re.current?await Re.current.flip(Ee):"unavailable";An==="switched"||An==="unchanged"?L.reportCommandStatus("flip_camera",Ze,"ok"):An==="unavailable"?L.reportCommandStatus("flip_camera",Ze,"unsupported","requested camera is not available"):L.reportCommandStatus("flip_camera",Ze,"failed","could not switch camera");}),zh=L.on("camera-close",async Ee=>{try{await Re.current?.setVideoEnabled(!1),L.reportCommandStatus("close_camera",Ee,"ok");}catch{L.reportCommandStatus("close_camera",Ee,"failed","could not turn camera off");}}),uc=L.on("camera-open",async Ee=>{try{await Re.current?.setVideoEnabled(!0),L.reportCommandStatus("open_camera",Ee,"ok");}catch{L.reportCommandStatus("open_camera",Ee,"failed","could not turn camera on");}}),Gh=L.on("screen-request",(Ee,Ze)=>{we().request(Ee,Ze);}),Wh=L.on("screen-stop",Ee=>{De.current?.stop(),L.reportCommandStatus("stop_screen",Ee,"ok");}),jh=L.on("transcript",Ke.set),Yh=L.on("action-flow",rn.set),qh=L.on("notice",Ee=>{Wt(Ee);}),Xh=L.on("health",Ee=>{Ie.set(Ee);}),cc=L.on("visual",Ee=>{Kn(Ee);}),Lo=L.on("error",C),fc=L.getAvatarConfig();fc&&F(fc);let dc=L.on("avatar-config",Ee=>{R.debug("SDK","Received avatar config subscription update",Ee),F(Ee);}),Qh=L.on("connection-status",Ee=>{J(Ee),Ee||(Me.current&&(Me.current.stop(),Me.current=null),fe.current?.reset(),Zn(),Jn(),x(null),E(false),Ae(false),pe(false),He(Ze=>Ze+1));});return ()=>{Se(),pt(),Yt(),ur(),Nh(),Lh(),Io(),oc(),Po(),sc(),Dh(),Bh(),vn(),lc(),Oi(),Uh(),No(),el(),nl(),Fh(),Vh(),il(),Hh(),zh(),uc(),Gh(),Wh(),jh(),Yh(),qh(),Xh(),cc(),Lo(),dc(),Qh(),Me.current?.stop(),Me.current=null,fe.current?.reset(),Zn(),Jn(),Q.current?.destroy(),Q.current=null;}},[L,Fr,Zn,we,Jn]);let fi=(0, ee.useCallback)(()=>(E(false),Ae(false),x(null),L.notifyPlaybackEnded(),L.getTurnPhase()==="thinking"),[L]),ir=(0, ee.useCallback)(Se=>{Zn(),Jn(),L.stop({intentionalClose:true,code:4001,reason:Se||"Manual disconnect"});},[L,Zn,Jn]),wo=(0, ee.useCallback)(()=>L.markRiveReady(),[L]),rr=(0, ee.useCallback)(Se=>{if(B.current<1){B.current++,ot(pt=>pt+1);return}B.current=0,L.notifyAvatarLoadError(Se);},[L]),Hr=(0, ee.useRef)(new Map),ne=(0, ee.useCallback)((Se,pt)=>{let Yt;switch(Se){case "start":Yt=L.on("connection-status",ur=>{ur&&pt();});break;case "stop":Yt=L.on("connection-status",ur=>{ur||pt();});break;case "interrupt":Yt=L.on("interrupt",pt);break;case "error":Yt=L.on("error",pt);break;case "speaking":Yt=L.on("speak",()=>{pt();});break;case "ready":Yt=L.on("avatar-ready",pt);break;case "notice":Yt=L.on("notice",pt);break;case "health":Yt=L.on("health",pt);break;case "transcript":Yt=L.on("transcript",pt);break;default:return}Hr.current.set(pt,Yt);},[L]),Te=(0, ee.useCallback)((Se,pt)=>{let Yt=Hr.current.get(pt);Yt&&(Yt(),Hr.current.delete(pt));},[]),Pe=(0, ee.useCallback)(Se=>{$e.current=Se;},[]);(0, ee.useEffect)(()=>(L.setHeardSpeechProvider(()=>{let Se=[...Ke.getSnapshot()].reverse().find(Yt=>Yt.speaker==="avatar"),pt=$e.current?.();return !Se||Se.isFinal||pt==null?null:_v(Se,pt)}),()=>L.setHeardSpeechProvider(null)),[L,Ke]);let Ge=(0, ee.useCallback)(Se=>{Y.current=Se,fe.current?.setPlaybackControls(Se);},[]),ht=(0, ee.useCallback)(()=>te.current?.acquire()??null,[]),Jt=(0, ee.useCallback)(Se=>L.setMicMuted(Se),[L]),dt=(0, ee.useCallback)(Se=>L.setSpeakerMuted(Se),[L]),et=(0, ee.useCallback)(Se=>L.setMoodDetection(Se),[L]),Ct=(0, ee.useCallback)(()=>L.startTalking(),[L]),Ot=(0, ee.useCallback)(()=>L.stopTalking(),[L]),St=(0, ee.useCallback)(()=>{te.current?.warm(),L.start();},[L]),gn=(0, ee.useRef)(false);(0, ee.useEffect)(()=>{!r.autoStart||gn.current||(gn.current=true,St(),te.current?.ensureRunning().then(Se=>{Se||L.reportAudioBlocked("output");}));},[r.autoStart,St,L]);let ar=(0, ee.useCallback)(()=>ir(),[ir]),Oh=(0, ee.useCallback)(()=>L.interrupt(),[L]),Eo=(0, ee.useCallback)(()=>L.stopSpeaking(),[L]),Ju=(0, ee.useCallback)(Se=>L.speakText(Se),[L]),$u=(0, ee.useCallback)(Se=>L.speakAudio(Se),[L]),La=(0, ee.useCallback)(Se=>L.setLipSyncTuning(Se),[L]),ec=(0, ee.useCallback)(Se=>L.play(Se),[L]),or=(0, ee.useCallback)(Se=>L.addLiveContext(Se),[L]),Qs=(0, ee.useCallback)(Se=>L.notify(Se),[L]),Da=(0, ee.useCallback)(()=>L.readPage(),[L]),zr=(0, ee.useCallback)(Se=>L.registerAction(Se),[L]),Ks=(0, ee.useCallback)((...Se)=>L.sendActionUi(...Se),[L]),xi=(0, ee.useCallback)(()=>L.requestTour(),[L]),Ue=(0, ee.useCallback)(()=>L.skipNextGreeting(),[L]),$n=(0, ee.useCallback)(Se=>L.on("speak",Se),[L]),ki=(0, ee.useCallback)(Se=>L.on("widget-command",Se),[L]),tc=(0, ee.useCallback)((Se,pt)=>L.reportCommandStatus("widget_control",Se,pt),[L]);(0, ee.useEffect)(()=>!H||!L.capabilities?.page.read||!u.current&&n?void 0:(u.current?.watch??OM)(()=>{L.readPage();}),[H,L,n]);let nc=(0, ee.useCallback)(Se=>L.triggerAction(Se),[L]),ic=(0, ee.useCallback)(()=>L.avatarClicked(),[L]),Zt=(0, ee.useMemo)(()=>K?.rive?.gestures?Object.keys(K.rive.gestures):[],[K]),Ba=(0, ee.useMemo)(()=>({enabled:r?.controls?.enabled||false,stopSpeaking:r?.controls?.stopSpeaking||false}),[r?.controls?.enabled,r?.controls?.stopSpeaking]),Mo=(0, ee.useCallback)(()=>{Vr();},[Vr]),Gr=(0, ee.useCallback)(()=>{Re.current?.flip();},[]),di=(0, ee.useCallback)(()=>L.setMoodDetection(!L.isMoodDetectionOn),[L]),Wr=H&&L.canReadMood,sr=(0, ee.useMemo)(()=>({stream:D,facing:z,sessionOpen:oe,toggleVideo:Mo,flip:Gr,mood:Wr?{on:mt,toggle:di}:null}),[D,z,oe,Mo,Gr,Wr,mt,di]),Zs=D!==null&&Wr&&mt;(0, ee.useEffect)(()=>{Zs?Gi().start():he.current?.stop();},[Zs,Gi]),(0, ee.useEffect)(()=>()=>he.current?.dispose(),[]);let jr=(0, ee.useCallback)(()=>De.current?.shareFromClick(),[]),Ua=(0, ee.useCallback)(()=>De.current?.dismiss(),[]),To=(0, ee.useCallback)(()=>De.current?.stop(),[]),rc=(0, ee.useMemo)(()=>({phase:be,share:jr,dismiss:Ua,stop:To}),[be,jr,Ua,To]),ac=d==="idle",Ih=d==="connecting",Fa=d==="active"&&p==="listening",Co=v==="painted"&&I,Yr=v==="failed",Ro=v==="loading"||v==="painted"&&!I,Va=ae||ze||p==="greeting"||!!an,lr=r.transcript,qr=!!lr?.enabled&&lr.captions!==false,xo=lr?.position??"bottom-center",kn=r.statusBanner,Ph=kn?.enabled!==false,hi=kn?.position??"bottom-left",ko=r.thinkingIndicator,Oo=ko?.enabled!==false,Js=ko?.position??"top-left",$s=r.screenShare?.position??"top-center";return {isReady:Co,isLoading:Ro,isConnecting:Ih,isSpeaking:N,isListening:Fa,isThinking:ae,isResponseSlow:ye,isIdle:ac,isFailed:Yr,isConnected:H,isMicMuted:Xe,isSpeakerMuted:_t,setMicMuted:Jt,setSpeakerMuted:dt,isMoodDetectionAvailable:Wr,isMoodDetectionOn:mt,setMoodDetection:et,isPushToTalk:Ri,isTalking:Qe,startTalking:Ct,stopTalking:Ot,on:ne,off:Te,start:St,stop:ar,interrupt:Oh,stopSpeaking:Eo,speakText:Ju,speakAudio:$u,play:ec,addLiveContext:or,notify:Qs,readPage:Da,registerAction:zr,triggerAction:nc,setLipSyncTuning:La,availableActions:Zt,notice:an,_healthStore:Ie,_transcriptStore:Ke,_actionFlowStore:rn,_sendActionUi:Ks,avatarId:r.avatar?.avatarId,error:w,controls:Ba,_currentJob:T,_onPlaybackEnd:fi,_onRiveReady:wo,_onRiveError:rr,_resetToken:ve,_mode:L.getMode(),_setMountSurface:L.setMountSurface,_onWidgetCommand:ki,_onSpeechJob:$n,_requestTour:xi,_skipNextGreeting:Ue,_reportWidgetStatus:tc,_riveKey:`${ct}:${K?.rive?.src??""}`,_avatarConfig:K,_shouldArmTalking:Va,_userActivity:y,_thinkingSignal:m,_speakerMuted:_t,_gestureQueue:le,_gestureSignal:Ne,_avatarClicked:ic,_lipSyncTuning:L.getLipSyncTuning(),_rigActivity:vt,_visualState:zi,_camera:sr,_screen:rc,_screenSharePosition:$s,_captionsEnabled:qr,_captionPosition:xo,_statusBannerEnabled:Ph,_statusBannerPosition:hi,_thinkingIndicatorEnabled:Oo,_thinkingIndicatorPosition:Js,_speechClockRef:$e,_registerSpeechClock:Pe,_registerPlaybackControls:Ge,_getAudioContext:ht,_spacebarToTalk:r.turnTaking?.spacebar!==false,_environment:r.environment,mode:r.mode||"call"}},HM=ZN;var Xn=ue(Rt()),WM=ue(Be()),zM=(0, Xn.createContext)(null),GM=({children:t})=>{let[e,n]=(0, Xn.useState)(false),[i,r]=(0, Xn.useState)("dormant"),[a,s]=(0, Xn.useState)("idle"),u=(0, Xn.useRef)(null),d=(0, Xn.useCallback)(v=>n(v),[]),g=(0, Xn.useMemo)(()=>({isOpen:e,stage:i,setOpen:d,setStage:r,tourState:a,setTourState:s,tourControlsRef:u}),[e,i,d,a]);return (0, WM.jsx)(zM.Provider,{value:g,children:t})};function bh(){let t=(0, Xn.useContext)(zM);if(!t)throw new Error("useAvatarWidget must be used within <AvatarProvider>");return t}var vA=ue(Be()),jM=(0, _h.createContext)(null),YM=({config:t,children:e,pageHost:n,embedHostOrigin:i,embedResume:r})=>{let a=HM(t,n,i,r);return (0, vA.jsx)(jM.Provider,{value:a,children:(0, vA.jsx)(GM,{children:e})})};function Vn(){let t=(0, _h.useContext)(jM);if(!t)throw new Error("useAvatar must be used within <AvatarProvider>");return t}var Nn=ue(Be()),JN=t=>{let e=Vn(),i=e?.controls?.enabled!==false&&e.mode==="call",r=e?._camera?.sessionOpen??false,a=!!t?.usePictureInPicture&&r,[s,u]=(0, yo.useState)(true);(0, yo.useEffect)(()=>{r&&u(true);},[r]);let d=a&&s,g=(0, yo.useCallback)(()=>u(true),[]),v=(0, yo.useCallback)(()=>u(false),[]),A=e?._environment!=="meeting",p=A&&!!e?.isConnecting&&!!e?._avatarConfig,_=[d?`avatar-pip-frame swappable ${t?.pictureInPictureCorner??"bottom-right"}`:"avatar-stage-layer",p?"avatar-stage-loading":""].filter(Boolean).join(" "),T=(0, Nn.jsx)(sE,{lastResponse:e?._currentJob,onPlaybackEnd:e?._onPlaybackEnd,avatarConfig:e?._avatarConfig||null,fit:t?.fit,error:e?.error,className:t?.className,style:t?.style,onRiveReady:e?._onRiveReady,onRiveError:e?._onRiveError,resetToken:e?._resetToken,shouldArmTalking:e?._shouldArmTalking,isConnected:e?.isConnected,userActivity:e?._userActivity,userAttending:e?.isTalking,isThinking:e?.isThinking,thinkingSignal:e?._thinkingSignal,gestureQueue:e?._gestureQueue,gestureSignal:e?._gestureSignal,onAvatarClick:d||!A?void 0:e?._avatarClicked,lipSyncTuning:e?._lipSyncTuning,visualState:e?._visualState,onSpeechClock:e?._registerSpeechClock,onRegisterPlaybackControls:e?._registerPlaybackControls,getAudioContext:e?._getAudioContext,createSpeechPlayer:e?._createSpeechPlayer,speakerMuted:e?._speakerMuted,rigActivity:e?._rigActivity,loader:t?.loader,errorFallback:t?.errorFallback,environment:e?._environment},e?._riveKey);return (0, Nn.jsxs)(O1,{children:[(a||!t?.hideCameraPreview)&&(0, Nn.jsx)(AE,{sessionOpen:r,stream:e?._camera?.stream??null,mirrored:e?._camera?.facing!=="environment",corner:t?.cameraPreviewCorner??"bottom-right",variant:d?"stage":"corner",onSwap:a&&!d?g:void 0,onToggleVideo:e?._camera?.toggleVideo,onFlip:e?._camera?.flip,mood:e?._camera?.mood}),(0, Nn.jsxs)("div",{className:_,...d&&{role:"button",tabIndex:0,"aria-label":"Show avatar full size",onClick:v,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),v());}},children:[T,d&&(0, Nn.jsx)(Jv,{})]}),e?._captionsEnabled&&(0, Nn.jsx)(uE,{store:e._transcriptStore,speechClockRef:e._speechClockRef,position:e._captionPosition,controlsVisible:i,className:t?.captionClassName,style:t?.captionStyle}),e?._statusBannerEnabled&&(0, Nn.jsx)(fE,{store:e._healthStore,position:e._statusBannerPosition,controlsVisible:i,className:t?.statusBannerClassName,style:t?.statusBannerStyle}),e?._thinkingIndicatorEnabled&&(0, Nn.jsx)(dE,{visible:!!e?.isResponseSlow,position:e._thinkingIndicatorPosition,controlsVisible:i,className:t?.thinkingIndicatorClassName,style:t?.thinkingIndicatorStyle}),e?._screen&&(0, Nn.jsx)(yE,{phase:e._screen.phase,onShare:e._screen.share,onDismiss:e._screen.dismiss,onStop:e._screen.stop,position:e._screenSharePosition,controlsVisible:i,className:t?.screenShareClassName,style:t?.screenShareStyle}),e._mode!=="player"&&A&&(0, Nn.jsx)("div",{className:`connectivity-dot ${e.isConnected?"connected":"disconnected"}`,title:e.isConnected?"Connected to Server":"Disconnected"}),p&&(0, Nn.jsx)("div",{className:"avatar-connecting-overlay",children:t?.loader??(0, Nn.jsx)(qd,{label:"Connecting"})}),i&&e?.isPushToTalk&&(0, Nn.jsx)(gE,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isSpeakerMuted:e?.isSpeakerMuted,setSpeakerMuted:e?.setSpeakerMuted,isTalking:e?.isTalking,isSpeaking:e?.isSpeaking,startTalking:e?.startTalking,stopTalking:e?.stopTalking,spacebar:e?._spacebarToTalk}),i&&!e?.isPushToTalk&&(0, Nn.jsx)(pE,{className:"avatar-controls",isIdle:e?.isIdle,start:e?.start,stop:e?.stop,avatarReady:e?.isReady,isMicMuted:e?.isMicMuted,isSpeakerMuted:e?.isSpeakerMuted,setMicMuted:e?.setMicMuted,setSpeakerMuted:e?.setSpeakerMuted,showStopSpeaking:e?.controls?.stopSpeaking===true,isSpeaking:e?.isSpeaking,stopSpeaking:e?.stopSpeaking})]})},Sh=JN;var AA=ue(Rt());function qM(){let t=Vn(),e=(0, AA.useSyncExternalStore)(t._transcriptStore.subscribe,t._transcriptStore.getSnapshot,t._transcriptStore.getServerSnapshot),n=(0, AA.useSyncExternalStore)(t._healthStore.subscribe,t._healthStore.getSnapshot,t._healthStore.getServerSnapshot);return {isReady:t.isReady,isLoading:t.isLoading,isConnecting:t.isConnecting,isSpeaking:t.isSpeaking,isListening:t.isListening,isThinking:t.isThinking,isResponseSlow:t.isResponseSlow,isIdle:t.isIdle,isFailed:t.isFailed,isConnected:t.isConnected,isMicMuted:t.isMicMuted,isSpeakerMuted:t.isSpeakerMuted,setMicMuted:t.setMicMuted,setSpeakerMuted:t.setSpeakerMuted,isMoodDetectionAvailable:t.isMoodDetectionAvailable,isMoodDetectionOn:t.isMoodDetectionOn,setMoodDetection:t.setMoodDetection,isPushToTalk:t.isPushToTalk,isTalking:t.isTalking,startTalking:t.startTalking,stopTalking:t.stopTalking,on:t.on,off:t.off,start:t.start,speakText:t?.speakText,speakAudio:t?.speakAudio,play:t?.play,stop:t.stop,interrupt:t.interrupt,stopSpeaking:t.stopSpeaking,avatarId:t.avatarId,error:t.error,notice:t?.notice,health:n,transcript:e,controls:t?.controls,addLiveContext:t?.addLiveContext,notify:t?.notify,readPage:t?.readPage,registerAction:t?.registerAction,triggerAction:t?.triggerAction,setLipSyncTuning:t?.setLipSyncTuning,availableActions:t?.availableActions}}var Xs=ue(Rt());function XM(t){let{_actionFlowStore:e,_sendActionUi:n}=Vn(),i=(0, Xs.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot),r=i&&(!t)?i:null,a=(0, Xs.useCallback)(d=>n("input",d,t),[n,t]),s=(0, Xs.useCallback)(()=>n("confirm"),[n]),u=(0, Xs.useCallback)(()=>n("cancel"),[n]);return {flow:r,input:a,confirm:s,cancel:u}}var ut=ue(Rt());var Ia=ue(Rt()),sT=ue(Tc());var wh=(t,e)=>{let n=0,i=performance.now()+1e3,r=()=>{n=0,e(),performance.now()<i&&(n=requestAnimationFrame(r));},a=()=>{n||(n=requestAnimationFrame(r));},s=()=>{i=Math.max(i,performance.now()+120),a();};e(),n=requestAnimationFrame(r),window.addEventListener("scroll",s,{capture:true,passive:true}),window.addEventListener("resize",a,{passive:true});let u=typeof ResizeObserver=="function"?new ResizeObserver(a):null;return u?.observe(t),()=>{n&&cancelAnimationFrame(n),window.removeEventListener("scroll",s,{capture:true}),window.removeEventListener("resize",a),u?.disconnect();}};var $N={min:4,max:16},eL={min:2,max:8},bA=50,QM=(t,e)=>Math.min(e.max,Math.max(e.min,t)),JM=t=>{let e=parseFloat(getComputedStyle(t).fontSize)||16;return {x:QM(e*.3,$N),y:QM(e*.12,eL)}},_A=220,tL=4,$M="af-tour-ink",eT="af-tour-ink-strong",Eh="af-tour-ink-behind",KM="af-tour-behind-style",nL="#fef08a",iL="#facc15",rL="#171717",aL="#ffffff",oL=.179,sL=.4,Oa,tT=t=>{if(Oa??(Oa=document.createElement("canvas").getContext("2d",{willReadFrequently:true})),!Oa)return null;let e="#010203";if(Oa.fillStyle=e,Oa.fillStyle=t,Oa.fillStyle===e&&t.trim().toLowerCase()!==e)return null;Oa.clearRect(0,0,1,1),Oa.fillRect(0,0,1,1);let[n,i,r,a]=Oa.getImageData(0,0,1,1).data;if(a<128)return null;let s=u=>Math.round(u*(a/255)+255*(1-a/255));return [s(n),s(i),s(r)]},ZM=([t,e,n])=>{let i=r=>{let a=r/255;return a<=.04045?a/12.92:((a+.055)/1.055)**2.4};return .2126*i(t)+.7152*i(e)+.0722*i(n)},lL=(t,e)=>t.map(n=>Math.round(n+(255-n)*e/100)),uL=t=>{let e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let n=e.nextNode();n;n=e.nextNode())if(n.nodeValue?.trim()&&n.parentElement)return tT(getComputedStyle(n.parentElement).color);return null},nT=()=>typeof CSS<"u"&&!!CSS.highlights&&typeof Highlight=="function",iT=(t,e,n)=>{if(!nT())return {behind:false};let i=tT(n??(e?iL:nL));if(!i)return {behind:false};let r=n&&!e?lL(i,bA):i,a=ZM(r)>oL,s=uL(t),u=!!s&&ZM(s)>sL;return a&&!u?{behind:false}:{behind:true,background:`rgb(${r.join(" ")})`,ink:a?rL:aL}},rT=(t,e)=>{let n=document.getElementById(KM);n||(n=document.createElement("style"),n.id=KM,document.head.appendChild(n));let i=e?`;text-shadow:.35px 0 0 ${t.ink}`:"";n.textContent=`::highlight(${Eh}){background-color:${t.background};color:${t.ink}${i}}`;},yA=Math.sqrt(51),cL=t=>{let e=t/1e3;return 1-Math.exp(-7*e)*(Math.cos(yA*e)+7/yA*Math.sin(yA*e))},fL=t=>{for(let e=0;e<800;e+=4)if(cL(e)>=t)return e;return 800},SA=t=>{let e=document.createRange();e.selectNodeContents(t);let n=[];for(let i of Array.from(e.getClientRects())){if(i.width<1||i.height<1)continue;let r=n.find(s=>Math.abs(s.top-i.top)<tL);if(!r){n.push({left:i.left,top:i.top,width:i.width,height:i.height});continue}let a=Math.max(r.left+r.width,i.right);r.left=Math.min(r.left,i.left),r.width=a-r.left,r.height=Math.max(r.height,i.height);}return n},aT=(t,e)=>t.length===e.length&&t.every((n,i)=>Math.abs(n.left-e[i].left)<.5&&Math.abs(n.top-e[i].top)<.5&&Math.abs(n.width-e[i].width)<.5),dL=(t,e)=>{let n=0;return t.forEach((i,r)=>{Math.abs(i.top-e)<Math.abs(t[n].top-e)&&(n=r);}),n},hL=(t,e)=>{let n=[],i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let r=i.nextNode();r;r=i.nextNode()){let a=r.nodeValue??"",s=e?/\S+\s*/g:/\S+/g;for(let u=s.exec(a);u;u=s.exec(a)){let d=document.createRange();d.setStart(r,u.index),d.setEnd(r,u.index+u[0].length),n.push(d);}}return n},oT=(t,e,n)=>{if(!nT()||!e.length)return ()=>{};let i=CSS.highlights,r=i.get(n)??new Highlight;i.set(n,r);let a=[],s=hL(t,n===Eh).map(u=>{let d=u.getBoundingClientRect(),g=dL(e,d.top),v=(d.left+d.width/2-e[g].left)/e[g].width,A=g*200+fL(Math.min(1,Math.max(0,v)));return setTimeout(()=>{r.add(u),a.push(u);},A)});return ()=>{s.forEach(clearTimeout),a.forEach(u=>r.delete(u)),r.size===0&&i.get(n)===r&&i.delete(n);}};var wA=ue(Be()),mL=({target:t,strong:e=false,color:n,leaving:i=false})=>{let[r,a]=(0, Ia.useState)([]),s=(0, Ia.useMemo)(()=>JM(t),[t]),u=(0, Ia.useMemo)(()=>iT(t,e,n),[t,e,n]),d=n?{"--af-highlight-strong-color":n,"--af-highlight-color":`color-mix(in srgb, ${n} ${100-bA}%, white)`}:void 0;(0, Ia.useEffect)(()=>{let v=[];return wh(t,()=>{let A=SA(t);aT(v,A)||(v=A,a(A));})},[t]);let g=r.length>0;return (0, Ia.useEffect)(()=>{if(i||!g)return;u.behind&&rT(u,e);let v=u.behind?Eh:e?eT:$M;return oT(t,SA(t),v)},[t,e,i,g,u]),typeof document>"u"?null:(0, sT.createPortal)((0, wA.jsx)("div",{className:"af-tour-layer af-tour-layer--marks",style:d,"aria-hidden":"true",children:!u.behind&&r.map((v,A)=>(0, wA.jsx)("span",{className:`af-tour-mark${e?" af-tour-mark--strong":""}${i?" af-tour-mark--out":""}`,style:{left:v.left-s.x,top:v.top-s.y,width:v.width+s.x*2,height:v.height+s.y*2,animationDelay:i?void 0:`${A*200}ms`}},A))}),document.body)},lT=mL;var qu=ue(Rt()),dT=ue(Tc());var Th=".af-widget, .af-tour-layer",gL="h1, h2, h3, h4, h5, h6, button, a, [role=button], label, li, p";var TA=t=>t.toLowerCase().replace(/\s+/g," ").trim(),EA=t=>{if(t.closest(Th)||t.closest("[aria-hidden='true'], [hidden]"))return false;let e=t.getBoundingClientRect();if(e.width<2||e.height<2)return false;let n=t.checkVisibility;return typeof n=="function"?n.call(t,{visibilityProperty:true}):true},cT=t=>TA(t.innerText??t.textContent??""),MA=t=>{let e=document.createRange();e.selectNodeContents(t);let n=e.getBoundingClientRect();return n.width>=2&&n.height>=2?n:t.getBoundingClientRect()},Mh=t=>t.width*t.height;var bo=t=>{let e=t.getBoundingClientRect(),n=MA(t);return Mh(e)<=Mh(n)*4?e:n},vL=(t,e,n)=>{let i=t;for(;i.parentElement&&i.parentElement!==n;){let r=i.parentElement;if(cT(r).length>e.length+40||Mh(MA(r))>Mh(MA(i))*4)break;i=r;}return i},AL=(t,e)=>{let n=TA(t);return n===e?3:n.startsWith(e)?2:n.includes(e)?1:0},yL="h1, h2, h3, h4, h5, h6, [role=heading]",fT=(t,e)=>{if(typeof document>"u"||!document.body)return null;let n=TA(t);if(!n)return null;let i=e?.(t);if(i&&EA(i.element)){if(!i.isSection)return i.element;let r=a=>Array.from(i.element.querySelectorAll(a)).find(EA);return uT(i.element,n)??r(yL)??r("p")??i.element}return uT(document.body,n)},uT=(t,e)=>{let n=null,i=0,r=false,a=(u,d,g=false)=>{if(!u)return;let v=AL(d,e);v<=i||!EA(u)||(n=u,i=v,r=g);},s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let u=s.nextNode();u&&i<3;u=s.nextNode())a(u.parentElement,u.textContent??"");for(let u of Array.from(t.querySelectorAll(gL))){if(i===3)break;a(u,cT(u));}for(let u of Array.from(t.querySelectorAll("[aria-label], img[alt]"))){if(i===3)break;let d=u.getAttribute("aria-label");a(u,d??u.getAttribute("alt")??"",d!==null);}return n?r?n:vL(n,e,t):null};var bL="button, a[href], input, select, textarea, [role=button]",_L=8,CA=(t,e)=>t.left<e.left+e.width&&e.left<t.left+t.width&&t.top<e.top+e.height&&e.top<t.top+t.height,Yu=(t,e)=>({left:t.left-e,top:t.top-e,width:t.width+e*2,height:t.height+e*2}),Ch=t=>{if(typeof document>"u"||!document.body)return [];let e=[],n=a=>{a.width>0&&a.height>0&&CA(a,t)&&e.push(a);},i=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT),r=document.createRange();for(let a=i.nextNode();a;a=i.nextNode()){let s=a.parentElement;!s||!a.nodeValue?.trim()||s.closest(Th)||CA(s.getBoundingClientRect(),t)&&(r.selectNodeContents(a),Array.from(r.getClientRects()).forEach(n));}for(let a of Array.from(document.querySelectorAll(bL)))a.closest(Th)||n(a.getBoundingClientRect());return e},Rh=(t,e)=>{let n=Yu(t,_L);return e.some(i=>CA(i,n))};var Pa=ue(Be()),Ci=40,Fi=14,hT=150,SL={right:-90,left:90,below:0,above:180},wL=(t,e,n)=>{let i=Math.min(Math.max(t,n.left),n.right),r=Math.min(Math.max(e,n.top),n.bottom);return Math.atan2(r-e,i-t)*180/Math.PI+90},EL=(t,e)=>{let n=t.top+t.height/2-Ci/2,r=[t.right+Fi,t.left-Fi-Ci].map(s=>({left:s,top:n,width:Ci,height:Ci})).filter(s=>s.left>=Fi&&s.left+s.width<=window.innerWidth-Fi),a=r.find(s=>!Rh(s,Ch(Yu(s,16))))??r[0];return a?{x:a.left,y:n,deg:wL(a.left+Ci/2,n+Ci/2,e)}:null},ML=(t,e)=>{let n=t.left+t.width/2-Ci/2,i=t.top+t.height/2-Ci/2,r=SL[e];return e==="right"?{x:t.right+Fi,y:i,deg:r}:e==="left"?{x:t.left-Fi-Ci,y:i,deg:r}:e==="below"?{x:n,y:t.bottom+Fi,deg:r}:{x:n,y:t.top-Fi-Ci,deg:r}},TL=({target:t,side:e,avatar:n,leaving:i=false})=>{let r=(0, qu.useRef)(null),a=(0, qu.useRef)(n);return a.current=n,(0, qu.useLayoutEffect)(()=>{let s=null;return wh(t,()=>{let u=r.current;if(!u)return;let d=bo(t);if(!s){let A=e==="above"||e==="below"?a.current():null,p=(A&&EL(A,d))??ML(d,e);s={x:p.x-d.left,y:p.y-d.top,deg:p.deg};}let g=d.left+s.x,v=d.top+s.y;u.style.transform=`translate(${g}px, ${v}px) rotate(${s.deg}deg)`;})},[t,e]),typeof document>"u"?null:(0, dT.createPortal)((0, Pa.jsx)("div",{className:"af-tour-layer","aria-hidden":"true",children:(0, Pa.jsx)("div",{ref:r,className:"af-tour-arrow",children:(0, Pa.jsx)("div",{className:`af-tour-arrow__badge${i?" af-tour-arrow__badge--out":""}`,children:(0, Pa.jsxs)("svg",{className:"af-tour-arrow__glyph",viewBox:"0 0 24 24",width:22,height:22,fill:"none",stroke:"currentColor",strokeWidth:2.25,strokeLinecap:"round",strokeLinejoin:"round",children:[(0, Pa.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0, Pa.jsx)("polyline",{points:"5 12 12 5 19 12"})]})})})}),document.body)},pT=TL;var xh=ue(Rt()),RA=(t,e)=>{let[n,i]=(0, xh.useState)(t?{value:t,leaving:false}:null);return (0, xh.useEffect)(()=>{if(t){i({value:t,leaving:false});return}i(a=>a?{...a,leaving:true}:null);let r=setTimeout(()=>i(null),e);return ()=>clearTimeout(r)},[t,e]),n};var lt=ue(Rt());var mT=(t,e)=>t==="start"?e.margin:t==="end"?e.viewport-e.size-e.margin:(e.viewport-e.size)/2,CL={"top-left":"start","middle-left":"start","bottom-left":"start","top-center":"center",center:"center","bottom-center":"center","top-right":"end","middle-right":"end","bottom-right":"end"},RL={"top-left":"start","top-center":"start","top-right":"start","middle-left":"center",center:"center","middle-right":"center","bottom-left":"end","bottom-center":"end","bottom-right":"end"},Xu=(t,e,n,i)=>({x:mT(CL[t],{size:e.w,viewport:n.w,margin:i.x}),y:mT(RL[t],{size:e.h,viewport:n.h,margin:i.y})}),xA=(t,e,n)=>{if(!t)return e;let i=t.percent?n*t.value/100:t.value;return t.relative?e+i:i};var xL=t=>t.top>=96&&t.bottom<=window.innerHeight-96,kL=t=>new Promise(e=>{let n=Number.NaN,i=0,r=0,a=()=>{clearTimeout(s),cancelAnimationFrame(r),e();},s=setTimeout(a,1600),u=()=>{let d=t.getBoundingClientRect().top;i=Math.abs(d-n)<.5?i+1:0,n=d,i>=5?a():r=requestAnimationFrame(u);};r=requestAnimationFrame(u);}),gT=async t=>{let e=t.getBoundingClientRect();if(xL(e))return;let n=e.height<=window.innerHeight-192;t.scrollIntoView({behavior:"smooth",block:n?"center":"start"}),await kL(t);};var OL=.15,IL=450,PL=1200,NL=15e3,vT={x:Ci+Fi*2,y:Fi*2},LL="tour.play",DL=t=>{try{if(t==="session")return sessionStorage;if(t==="visitor"||t===void 0)return localStorage}catch{}return null},BL=t=>new Promise(e=>setTimeout(e,t)),AT=(t,e,n,i)=>{let r=t?.closing??Rd,a=(0, lt.useMemo)(()=>xd(t?.steps,r),[t?.steps,r]),s=a.steps.length>0,u=!s&&t?.generate===true,d=t?.greeting===false,g=s?`af-tour:${Iv(a)}`:i?.seenKey??`af-tour:auto:${typeof window>"u"?"":window.location.pathname}`,v=(0, lt.useMemo)(()=>DL(t?.once),[t?.once]),A=(0, lt.useCallback)(()=>{try{return !!v?.getItem(g)}catch{return false}},[v,g]),[p,_]=(0, lt.useState)("idle"),[T,x]=(0, lt.useState)(A),[N,E]=(0, lt.useState)(null),[w,C]=(0, lt.useState)(null);(0, lt.useEffect)(()=>x(A()),[A]);let I=(0, lt.useRef)({avatar:e,mover:n,compiled:a,closing:r,page:i});I.current={avatar:e,mover:n,compiled:a,closing:r,page:i};let V=(0, lt.useRef)(null),K=(0, lt.useRef)(0),F=(0, lt.useRef)(null),H=(0, lt.useRef)(null),J=(0, lt.useRef)(null),Y=(0, lt.useCallback)(()=>{if(x(true),t?.once!==false)try{v?.setItem(g,"1");}catch{}},[v,g,t?.once]),Me=(0, lt.useCallback)(()=>{let{mover:ae}=I.current;ae.returnTo(F.current,ae.dockPoint());},[]),Re=()=>{K.current+=1,H.current=null,E(null),C(null),I.current.page?.clear();},he=()=>{let ae=I.current.page;ae?ae.scrollTop():window.scrollTo({top:0,behavior:"smooth"});},De=async(ae,Ae,ze)=>{let xe=(Ye,Xe)=>R.warn("Tour","Tour target not found on the page",{action:Ye,target:Xe});Ae.scroll&&!await ae.scroll(Ae.scroll)&&xe("scroll",Ae.scroll);let ye=Ae.move;if(ye?.kind==="home")Me();else if(ye?.kind==="spot")U(ye.spot);else if(ye){if(!ze())return;let Ye=await ae.scroll(ye.target);Ye?ze()&&D(Ye,ye.kind==="point"?vT:void 0,ye.from,null,()=>{}):xe(ye.kind,ye.target);}if(Ae.highlight&&ze()){let{target:Ye,strong:Xe}=Ae.highlight;await ae.mark(Ye,Xe)||xe("highlight",Ye);}},fe=(0, lt.useCallback)(()=>{V.current&&(V.current.cancelled=true,V.current=null,J.current=null,Re(),Me(),_("done"));},[Me]),Q=()=>{let ae=I.current.mover.rootRef.current?.getBoundingClientRect();return ae?{w:ae.width,h:ae.height}:null},te=ae=>{let Ae=I.current.mover.rootRef.current?.getBoundingClientRect();if(!Ae)return;let ze=bo(ae);H.current={element:ae,dx:Ae.left-ze.left,dy:Ae.top-ze.top};},D=(ae,Ae,ze,xe,ye)=>{let Ye=Q();if(!Ye)return;let{offset:Xe,moveTo:qe,viewport:_t}=I.current.mover,Tt=Math.max(Ye.w,Ye.h)+(typeof Ae=="object"?Ae.x:Ae??0)+32,mt=xe?Ch(Yu(bo(xe),Tt)):null,gt=Nv(ae,Ye,_t(),{margin:Math.min(Xe.x,Xe.y),gap:Ae,prefer:ze,blocked:mt?Qe=>Rh(Qe,mt):void 0});qe(gt.left,gt.top,()=>ye(gt.side));},U=ae=>{let Ae=Q();if(!Ae)return;let{offset:ze,moveTo:xe,viewport:ye}=I.current.mover,Ye=Xu(ae,Ae,ye(),ze);xe(Ye.x,Ye.y);},z=(ae,Ae)=>{let ze=fT(Ae,Ah.elementNamed);return ze||R.warn("Tour","Tour target not found on the page",{action:ae,target:Ae}),ze},X=async(ae,Ae)=>(await gT(ae),!Ae.cancelled),oe=(0, lt.useCallback)(async(ae,Ae)=>{let{avatar:ze}=I.current;Re();let xe=K.current,ye=()=>!Ae.cancelled&&K.current===xe;ae.gesture&&ze.triggerAction?.(ae.gesture),ae.scrollTop&&he();let Ye=I.current.page;if(Ye){await De(Ye,ae,ye);return}if(ae.scroll){let qe=z("scroll",ae.scroll);if(qe&&!await X(qe,Ae)||!ye())return}let Xe=ae.move;if(Xe?.kind==="home")Me();else if(Xe?.kind==="spot")U(Xe.spot);else if(Xe){let qe=z(Xe.kind,Xe.target);if(qe){if(!await X(qe,Ae)||!ye())return;let _t=Xe.kind==="point";D(bo(qe),_t?vT:void 0,Xe.from,qe,Tt=>{ye()&&(te(qe),_t&&E({target:qe,side:Tt,step:xe}));});}}if(ae.highlight){let qe=z("highlight",ae.highlight.target);if(qe&&!Xe&&!ae.scroll&&(!await X(qe,Ae)||!ye()))return;qe&&C({...ae.highlight,element:qe,step:xe});}},[Me]),ge=(0, lt.useCallback)(async(ae,Ae)=>{let{avatar:ze}=I.current,{words:xe,steps:ye,text:Ye}=Ae,[Xe,...qe]=ye;if(Xe&&await oe(Xe,ae),await BL(IL),ae.cancelled)return;let _t=new Eu,Tt=xe.map(()=>null),mt=ze._onSpeechJob(c=>{_t.add(c),Tt=Pv(xe,_t.words);});ze.notify?.({name:LL,say:Ye,policy:"queue"}),_("playing");let gt=performance.now(),Qe=0,pe=null,y=null;await new Promise(c=>{let m=()=>{if(ae.cancelled)return c();let M=I.current.avatar._speechClockRef.current?.()??null,O=performance.now();for(M!==null?(pe??(pe=O),y=null):pe!==null&&(y??(y=O));Qe<qe.length;){let le=Tt[qe[Qe].wordIndex];if(le===null||M===null||M<le-OL)break;R.debug("Tour","Step",{step:Qe+1,at:le,clock:M}),oe(qe[Qe++],ae);}let B=y!==null&&O-y>=PL,q=pe===null&&O-gt>=NL;if(q&&R.warn("Tour","Tour line was never heard \u2014 standing down"),B||q)return c();requestAnimationFrame(m);};requestAnimationFrame(m);}),mt(),!ae.cancelled&&Qe<qe.length&&(R.warn("Tour","Speech ended before some steps were matched to it",{unmatched:qe.length-Qe,of:qe.length}),Re(),he(),Me());},[oe,Me]),be=(0, lt.useCallback)(async ae=>{let{compiled:Ae,closing:ze}=I.current;if(Ae.steps.length)return Ae;let xe=await J.current;if(ae.cancelled)return null;let ye=xd(xe??[],ze);return ye.steps.length||R.warn("Tour","No tour could be written for this page"),ye.steps.length?ye:null},[]),_e=(0, lt.useCallback)(()=>{let ae=V.current;ae&&(_("playing"),(async()=>{let Ae=await be(ae),ze=false;Ae&&Ae.text.length>Cd?R.warn("Tour","Tour is too long to speak as one line",{chars:Ae.text.length,max:Cd}):Ae&&!ae.cancelled&&(await ge(ae,Ae),ze=true),V.current===ae&&(ze||Me(),ae.cancelled=true,V.current=null,J.current=null,Re(),_("done"));})());},[be,ge,Me]),ve=(0, lt.useCallback)(()=>{if(!V.current)return;let ae=p==="playing";fe(),ae&&I.current.avatar.stopSpeaking?.();},[fe,p]),He=(s||u)&&!T&&p==="idle",ct=(0, lt.useCallback)(()=>{if(V.current)return;Y(),V.current={cancelled:false},F.current=I.current.mover.placement,_("starting");let{avatar:ae}=I.current;!ae.isConnected&&ae.isIdle&&(d&&ae._skipNextGreeting(),ae.start());},[Y,d]);(0, lt.useEffect)(()=>{if(p==="idle"||p==="done")return;let ae=0,Ae=()=>{ae=0;let xe=H.current;if(!xe)return;let ye=bo(xe.element);I.current.mover.followTo(ye.left+xe.dx,ye.top+xe.dy);},ze=()=>{H.current&&!ae&&(ae=requestAnimationFrame(Ae));};return window.addEventListener("scroll",ze,{capture:true,passive:true}),()=>{window.removeEventListener("scroll",ze,{capture:true}),ae&&cancelAnimationFrame(ae);}},[p]),(0, lt.useEffect)(()=>{let ae=V.current;p!=="starting"||!e.isConnected||!ae||(!I.current.compiled.steps.length&&!J.current&&(J.current=I.current.avatar._requestTour()),oe({wordIndex:0,move:{kind:"spot",spot:"center"}},ae));},[p,e.isConnected,oe]),(0, lt.useEffect)(()=>{p!=="starting"||!e.isConnected||!e.isListening||_e();},[p,e.isConnected,e.isListening,_e]),(0, lt.useEffect)(()=>{let ae=()=>{V.current&&fe();};return e.on("interrupt",ae),e.on("stop",ae),()=>{e.off("interrupt",ae),e.off("stop",ae);}},[e.on,e.off,fe]);let ot=(0, lt.useRef)(false);return (0, lt.useEffect)(()=>{if(p!=="starting"){ot.current=false;return}e.isConnecting?ot.current=true:e.isIdle&&ot.current&&fe();},[p,e.isIdle,e.isConnecting,fe]),(0, lt.useEffect)(()=>()=>{V.current&&(V.current.cancelled=true);},[]),{state:p,pointer:N,mark:w,pending:He,start:ct,stop:ve,markSeen:Y}};var Qu=ue(Be()),UL=t=>{let e=Math.floor(t/60),n=t%60;return `${e}:${String(n).padStart(2,"0")}`},FL=({expanded:t,live:e,elapsed:n,label:i,onOpen:r,dragHandlers:a})=>t?null:(0, Qu.jsxs)("button",{type:"button",className:`af-widget__launcher${e?" af-widget__launcher--live":""}`,onClick:r,...a,"aria-label":i,children:[e&&(0, Qu.jsx)("span",{className:"af-widget__ring","aria-hidden":"true"}),e&&n!==null&&(0, Qu.jsx)("span",{className:"af-widget__timer",children:UL(n)})]}),yT=FL;var Ln=ue(Rt());var Vi=ue(Be()),VL=2400,HL=3400,zL=2,bT="af-widget-teaser-dismissed",GL=()=>{try{return !!sessionStorage.getItem(bT)}catch{return false}},_T=t=>{let e=!!t?.text?.trim(),n=t?.delayMs??Fn.teaserDelayMs,[i,r]=(0, Ln.useState)(false),[a,s]=(0, Ln.useState)(GL);(0, Ln.useEffect)(()=>{if(!e||a)return;let d=setTimeout(()=>r(true),n);return ()=>clearTimeout(d)},[e,a,n]);let u=(0, Ln.useCallback)(()=>{s(true);try{sessionStorage.setItem(bT,"1");}catch{}},[]);return (0, Ln.useMemo)(()=>({visible:e&&i&&!a,dismiss:u}),[e,i,a,u])},WL=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,jL=({text:t,onAccept:e,onDismiss:n})=>{let i=WL(),[r,a]=(0, Ln.useState)(i),[s,u]=(0, Ln.useState)(null),d=(0, Ln.useRef)(null);return (0, Ln.useLayoutEffect)(()=>{let g=d.current?.scrollWidth;g&&u(g+zL);},[t]),(0, Ln.useEffect)(()=>{if(i)return;let g=setTimeout(()=>a(v=>!v),r?HL:VL);return ()=>clearTimeout(g)},[r,i]),(0, Vi.jsxs)("div",{className:"af-widget__pill",children:[(0, Vi.jsx)("span",{className:"af-widget__pill-glow","aria-hidden":"true"}),(0, Vi.jsxs)("button",{type:"button",className:`af-widget__pill-button${r?" af-widget__pill-button--open":""}`,style:s?{"--af-pill-open-width":`${s}px`}:void 0,onClick:g=>{g.stopPropagation(),e();},"aria-label":t,children:[(0, Vi.jsxs)("span",{className:"af-widget__pill-dots","aria-hidden":"true",children:[(0, Vi.jsx)("span",{}),(0, Vi.jsx)("span",{}),(0, Vi.jsx)("span",{})]}),(0, Vi.jsx)("span",{ref:d,className:"af-widget__pill-text",children:t})]}),(0, Vi.jsx)("button",{type:"button",className:"af-widget__pill-close","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),n();},children:"\xD7"})]})},ST=jL;var wT=t=>{if(!t?.fatal)return null;if(t.code==="MIC_PERMISSION_DENIED")switch(Ps(t)){case "NotFoundError":case "OverconstrainedError":return "No microphone found. Connect a microphone to talk to the avatar.";case "NotReadableError":case "AbortError":return "Your microphone is in use by another app. Close it, then try again.";default:return "Microphone access is blocked. Allow the microphone for this site in your browser, then try again."}return t.code==="CONNECTION_FAILED"||t.code==="UNKNOWN"?"The call couldn't connect. Check your internet connection, then try again.":null};var xn=ue(Be()),YL=()=>{let t=Vn();if(t.isIdle){let n=wT(t.error);return (0, xn.jsxs)(xn.Fragment,{children:[n&&(0, xn.jsx)("p",{className:"af-widget__help",role:"alert",children:n}),(0, xn.jsx)("div",{className:"af-widget__callbar af-widget__callbar--idle",children:(0, xn.jsxs)("button",{type:"button",className:"af-widget__call af-widget__call--start",onClick:t.start,disabled:!t.isReady,children:[(0, xn.jsx)(th,{size:18}),(0, xn.jsx)("span",{children:n?"Try again":"Start talking"})]})})]})}let e=!!t.isConnected;return (0, xn.jsxs)("div",{className:"af-widget__callbar",role:"toolbar","aria-label":"Call controls",children:[(0, xn.jsx)("button",{type:"button",className:"af-widget__callbar-button",onClick:()=>t.setMicMuted(!t.isMicMuted),"aria-label":t.isMicMuted?"Unmute microphone":"Mute microphone","aria-pressed":t.isMicMuted,disabled:!e,children:(0, xn.jsx)($d,{muted:t.isMicMuted,size:20})}),(0, xn.jsx)("button",{type:"button",className:"af-widget__callbar-button",onClick:()=>t.setSpeakerMuted(!t.isSpeakerMuted),"aria-label":t.isSpeakerMuted?"Unmute avatar audio":"Mute avatar audio","aria-pressed":t.isSpeakerMuted,disabled:!e,children:(0, xn.jsx)(eh,{muted:t.isSpeakerMuted,size:20})}),(0, xn.jsx)("button",{type:"button",className:"af-widget__call af-widget__call--end",onClick:t.stop,"aria-label":e?"End call":"Cancel",title:e?"End call":"Cancel",children:(0, xn.jsx)(nh,{size:20})})]})},ET=YL;var Hi=ue(Be()),qL=t=>`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`,XL=({expanded:t,title:e,live:n,connecting:i,elapsed:r,onCollapse:a,composer:s,dragHandlers:u})=>t?(0, Hi.jsxs)("div",{className:"af-widget__chrome",children:[(0, Hi.jsxs)("header",{className:"af-widget__header",...u,children:[e&&(0, Hi.jsx)("span",{className:"af-widget__title",children:e}),(n||i)&&(0, Hi.jsxs)("span",{className:`af-widget__status${n?" af-widget__status--live":""}`,role:"status",children:[(0, Hi.jsx)("span",{className:"af-widget__status-dot","aria-hidden":"true"}),n?r!=null?qL(r):"Live":"Connecting"]}),(0, Hi.jsx)("button",{type:"button",className:"af-widget__collapse",onClick:a,"aria-label":n?"Minimise \u2014 the call continues":"Close",children:(0, Hi.jsx)("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:(0, Hi.jsx)("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),s&&(0, Hi.jsx)("div",{className:"af-widget__composer",children:s})]}):null,MT=XL;var nr=ue(Rt());var TT=(t,e,n)=>Math.min(Math.max(t,e),Math.max(e,n)),CT=(t,e,n,i,r)=>({left:TT(t.fromRight?t.x-e:t.x,r.x,i.w-e-r.x),top:TT(t.fromBottom?t.y-n:t.y,r.y,i.h-n-r.y)}),RT=(t,e,n,i,r)=>{let a=(0, nr.useMemo)(()=>Ta(t),[t]),s=(0, nr.useCallback)(()=>typeof window>"u"?{w:1280,h:800}:{w:window.innerWidth,h:window.innerHeight},[]),[u,d]=(0, nr.useState)(s),g=r??u;(0, nr.useEffect)(()=>{if(typeof window>"u")return;let _=()=>d(s());return window.addEventListener("resize",_),window.addEventListener("orientationchange",_),()=>{window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_);}},[s]);let v=g.w<Fn.mobileBreakpointPx,A=e&&v&&a.mobile==="sheet",p=(0, nr.useMemo)(()=>{if(!e){let w=a.bubbleSize,C=i?CT(i,w,w,g,a.offset):null;return {w,h:w,position:a.position,sheet:false,left:C?C.left:null,top:C?C.top:null}}if(A)return {w:g.w,h:g.h,position:a.position,sheet:true,left:null,top:null};let _=Math.max(240,g.w-a.offset.x*2),T=Math.max(320,g.h-a.offset.y*2),x=Math.min(a.panel.w,_),N=Math.min(a.panel.h,T),E=i?CT(i,x,N,g,a.offset):null;return {w:x,h:N,position:a.position,sheet:false,left:E?E.left:null,top:E?E.top:null}},[e,A,a,g,i]);return (0, nr.useEffect)(()=>{n?.(p);},[p,n]),{box:p,isMobile:v}};var bt=ue(Rt()),xT=4,kT=.995,kA=kT/(1-kT),PT=100,QL=70,KL=.05,ZL=120,OA=1,JL=64,$L=480,eD=1100,tD=.55,nD=.06,iD=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,Br=(t,e,n)=>Math.min(Math.max(t,e),Math.max(e,n)),OT=t=>({fromRight:t.endsWith("right"),fromBottom:t.startsWith("bottom")}),_o=(t,e,n,i)=>({...t,x:t.fromRight?e+i.w:e,y:t.fromBottom?n+i.h:n}),IT=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,rD=(t,e)=>{let n=t[t.length-1];if(!n||e-n.t>QL)return {x:0,y:0};let i=t.find(a=>n.t-a.t<=PT)??t[0],r=n.t-i.t;return r<=0?{x:0,y:0}:{x:(n.x-i.x)/r,y:(n.y-i.y)/r}},NT=(t,e,n,i,r)=>{let a=(0, bt.useMemo)(()=>({viewport:()=>({w:window.innerWidth,h:window.innerHeight}),boxRect:()=>t.current?.getBoundingClientRect()??null,pointer:Q=>({x:Q.clientX,y:Q.clientY})}),[t]),s=r??a,[u,d]=(0, bt.useState)(null),[g,v]=(0, bt.useState)(false),[A,p]=(0, bt.useState)(false),_=(0, bt.useRef)(false),T=(0, bt.useRef)(null),x=(0, bt.useRef)(null),N=(0, bt.useRef)(null),E=(0, bt.useRef)({px:0,py:0,x:0,y:0,w:0,h:0}),w=(0, bt.useRef)([]),C=(0, bt.useRef)(null),I=(0, bt.useRef)(OT(n));(0, bt.useEffect)(()=>{u||(I.current=OT(n));},[u,n]);let V=(0, bt.useCallback)(Q=>t.current?.style.setProperty("--af-widget-lift",`${Q}`),[t]),K=(0, bt.useCallback)(()=>{C.current!==null&&(cancelAnimationFrame(C.current),C.current=null,V(0),p(false));},[V]),F=(0, bt.useCallback)((Q,te,D,U,z)=>{let X=Math.hypot(te.x-Q.x,te.y-Q.y),oe=Br(X*tD,$L,eD),ge=performance.now();p(true);let be=_e=>{let ve=Math.min(1,(_e-ge)/oe),He=iD(ve);if(d(_o(U,Q.x+(te.x-Q.x)*He,Q.y+(te.y-Q.y)*He,D)),V(Math.sin(Math.PI*ve)*nD),ve>=1){C.current=null,p(false),z?.();return}C.current=requestAnimationFrame(be);};C.current=requestAnimationFrame(be);},[V]),H=(0, bt.useCallback)((Q,te,D,U,z)=>{let X={...Q},oe=performance.now();p(true);let ge=be=>{let _e=Math.min(be-oe,JL);oe=be;let ve=1-Math.exp(-_e/kA);X={x:X.x+(te.x-X.x)*ve,y:X.y+(te.y-X.y)*ve};let He=Math.hypot(te.x-X.x,te.y-X.y)<OA,ct=He?te:X;if(d(_o(U,ct.x,ct.y,D)),He){C.current=null,p(false),z?.();return}C.current=requestAnimationFrame(ge);};C.current=requestAnimationFrame(ge);},[]),J=(0, bt.useCallback)(()=>{N.current?.();let Q=T.current;if(Q===null)return;T.current=null;let te=x.current;x.current=null,te?.hasPointerCapture?.(Q)&&te.releasePointerCapture(Q),v(false);let D=_.current?s.boxRect():null;if(!D)return;let U={w:D.width,h:D.height},z=s.viewport(),X=IT(),oe=z.w-U.w-i.x,ge=z.h-U.h-i.y,be=X?{x:0,y:0}:rD(w.current,performance.now()),_e={x:Br(D.left+be.x*kA,i.x,oe),y:Br(D.top+be.y*kA,i.y,ge)};if(Math.hypot(be.x,be.y)>=KL){let ct={x:_e.x+U.w/2>z.w/2?oe:i.x,y:_e.y+U.h/2>z.h/2?ge:i.y};Math.hypot(ct.x-_e.x,ct.y-_e.y)<ZL&&(_e=ct);}let ve={fromRight:_e.x+U.w/2>z.w/2,fromBottom:_e.y+U.h/2>z.h/2};I.current=ve;let He=Math.hypot(_e.x-D.left,_e.y-D.top)<OA;if(X||He){d(_o(ve,_e.x,_e.y,U));return}H({x:D.left,y:D.top},_e,U,ve);},[s,i.x,i.y,H]),Y=(0, bt.useCallback)((Q,te,D)=>{let U=s.boxRect();if(!U)return;K();let z={w:U.width,h:U.height},X=s.viewport(),oe=Math.max(i.x,X.w-z.w-i.x),ge=Math.max(i.y,X.h-z.h-i.y),be={x:Br(Q,i.x,oe),y:Br(te,i.y,ge)},_e={fromRight:be.x+z.w/2>X.w/2,fromBottom:be.y+z.h/2>X.h/2};if(I.current=_e,Math.hypot(be.x-U.left,be.y-U.top)<OA||IT()){d(_o(_e,be.x,be.y,z)),D?.();return}F({x:U.left,y:U.top},be,z,_e,D);},[s,i.x,i.y,F,K]),Me=(0, bt.useCallback)((Q,te)=>{let D=s.boxRect();D&&(K(),d(_o(I.current,Q,te,{w:D.width,h:D.height})));},[s,K]),Re=(0, bt.useCallback)((Q,te)=>{let D=s.boxRect();if(!D)return;let U=Q?{x:Q.fromRight?Q.x-D.width:Q.x,y:Q.fromBottom?Q.y-D.height:Q.y}:te;Y(U.x,U.y,()=>d(Q));},[s,Y]),he=(0, bt.useCallback)(Q=>{let te=T.current;if(te===null||Q.pointerId!==te)return;if(Q.buttons===0&&Q.pointerType!=="touch"){J();return}let{px:D,py:U,x:z,y:X,w:oe,h:ge}=E.current,be=s.pointer(Q),_e=be.x-D,ve=be.y-U;if(!_.current&&Math.abs(_e)<xT&&Math.abs(ve)<xT)return;_.current||(_.current=true,v(true),x.current?.isConnected&&x.current.setPointerCapture(te));let He=s.viewport(),ct=Br(z+_e,i.x,He.w-oe-i.x),ot=Br(X+ve,i.y,He.h-ge-i.y),ae=w.current,Ae=performance.now();for(ae.push({x:ct,y:ot,t:Ae});ae.length>2&&Ae-ae[0].t>PT;)ae.shift();d(_o(I.current,ct,ot,{w:oe,h:ge}));},[s,i.x,i.y,J]),De=(0, bt.useCallback)(Q=>{if(!e||Q.button!==0)return;J(),K();let te=s.boxRect();if(!te)return;let D=s.pointer(Q);E.current={px:D.x,py:D.y,x:te.left,y:te.top,w:te.width,h:te.height},w.current=[],_.current=false,T.current=Q.pointerId,x.current=Q.currentTarget;let U=z=>{z.pointerId===T.current&&J();};window.addEventListener("pointermove",he),window.addEventListener("pointerup",U),window.addEventListener("pointercancel",U),N.current=()=>{N.current=null,window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",U),window.removeEventListener("pointercancel",U);};},[e,s,K,J,he]),fe=(0, bt.useCallback)(()=>{let Q=_.current;return _.current=false,Q},[]);return (0, bt.useEffect)(()=>()=>{N.current?.(),K();},[K]),(0, bt.useEffect)(()=>{if(typeof window>"u")return;let Q=()=>{let te=s.boxRect();if(!te)return;K();let{width:D,height:U}=te,z=s.viewport();d(X=>X&&_o(X,Br(X.fromRight?X.x-D:X.x,i.x,z.w-D-i.x),Br(X.fromBottom?X.y-U:X.y,i.y,z.h-U-i.y),{w:D,h:U}));};return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),()=>{window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q);}},[s,i.x,i.y,K]),{placement:u,dragging:g,gliding:A,consumeDragClick:fe,moveTo:Y,followTo:Me,returnTo:Re,handlers:{onPointerDown:De}}};var Qn=ue(Be()),aD=500,oD=12,sD=24,lD=t=>`${t.fromBottom?"bottom":"top"}-${t.fromRight?"right":"left"}`,uD=t=>{let e={fg:"#16181d",scrim:"rgba(16, 24, 32, 0.08)"},n={fg:"#ffffff",scrim:"rgba(255, 255, 255, 0.16)"},i=t.trim().replace(/^#/,""),r=i.length===3?i.split("").map(u=>u+u).join(""):i;if(!/^[0-9a-f]{6}$/i.test(r))return e;let a=u=>{let d=parseInt(r.slice(u,u+2),16)/255;return d<=.04045?d/12.92:((d+.055)/1.055)**2.4};return .2126*a(0)+.7152*a(2)+.0722*a(4)>.45?e:n},cD=({appearance:t,title:e,launcherLabel:n="Talk to the assistant",composer:i,open:r,onOpenChange:a,autoStart:s=true,onResize:u,onStageChange:d,usePictureInPicture:g,hostViewport:v,framed:A=false,tour:p,tourPage:_,className:T,style:x})=>{let N=Vn();N._setMountSurface("widget");let E=bh(),[w,C]=(0, ut.useState)(null),I=(0, ut.useRef)(null),V=r!==void 0,K=V?r:E.isOpen,[F,H]=(0, ut.useState)(false),[J,Y]=(0, ut.useState)(null),Me=(0, ut.useRef)(true);(0, ut.useEffect)(()=>{if(Me.current){Me.current=false;return}H(true);let pe=setTimeout(()=>H(false),aD);return ()=>clearTimeout(pe)},[K]),(0, ut.useEffect)(()=>{V&&E.setOpen(r);},[V,r,E]);let Re=(0, ut.useCallback)(pe=>{V||E.setOpen(pe),a?.(pe);},[V,E,a]),he=Ta(t),De=(0, ut.useRef)(null),fe=(0, ut.useRef)(null),Q=(0, ut.useRef)(v),te=(0, ut.useMemo)(()=>A?{viewport:()=>Q.current??{w:window.innerWidth,h:window.innerHeight},boxRect:()=>fe.current,pointer:pe=>({x:pe.screenX,y:pe.screenY})}:void 0,[A]),D=NT(De,he.draggable,he.position,he.offset,te),U=A&&D.placement?lD(D.placement):he.position,z=A?K?sD:oD:void 0,X=(0, ut.useCallback)(pe=>u?.(A?{...pe,position:U,gutter:z}:pe),[u,A,U,z]),{box:oe}=RT(t,K,X,D.placement,v);(0, ut.useLayoutEffect)(()=>{if(Q.current=v,!A||!v){fe.current=null;return}let pe=he.position.endsWith("right"),y=he.position.startsWith("bottom");fe.current={left:oe.left??(pe?v.w-oe.w-he.offset.x:he.offset.x),top:oe.top??(y?v.h-oe.h-he.offset.y:he.offset.y),width:oe.w,height:oe.h};},[A,v,oe,he.position,he.offset.x,he.offset.y]);let ge=uD(he.panelBackground),be=(0, ut.useCallback)(()=>A&&Q.current||{w:window.innerWidth,h:window.innerHeight},[A]),_e=(0, ut.useCallback)(()=>{let pe=De.current?.getBoundingClientRect(),y=pe?{w:pe.width,h:pe.height}:{w:0,h:0};return Xu(he.position,y,be(),he.offset)},[he.position,he.offset,be]),ve=AT(p,N,{rootRef:De,placement:D.placement,offset:he.offset,dockPoint:_e,moveTo:D.moveTo,followTo:D.followTo,returnTo:D.returnTo,viewport:be},_);(0, ut.useEffect)(()=>{E.setTourState(ve.state);},[ve.state,E]),(0, ut.useEffect)(()=>(E.tourControlsRef.current={start:ve.start,stop:ve.stop},()=>{E.tourControlsRef.current=null;}),[ve.start,ve.stop,E.tourControlsRef]);let He=!!N.isConnected,ct=!!N.isConnecting,ot=N.notice?"ended":He?"live":ct?"connecting":K?"expanded":"dormant";(0, ut.useEffect)(()=>{E.setStage(ot),d?.(ot);},[ot,d,E]),(0, ut.useEffect)(()=>N._onWidgetCommand((pe,y)=>{if(pe.kind==="stage")Re(pe.open);else if(pe.kind==="effect")Y(pe.effect==="bounce"?pe.times:null);else if(v){N._reportWidgetStatus(y,"unsupported");return}else {let c=De.current?.getBoundingClientRect(),m={w:window.innerWidth,h:window.innerHeight};if(c){let M={w:c.width,h:c.height},O=pe.kind==="spot"?Xu(pe.spot,M,m,he.offset):{x:xA(pe.x,c.left,m.w),y:xA(pe.y,c.top,m.h)};D.moveTo(O.x,O.y);}}N._reportWidgetStatus(y,"ok");}),[N,Re,D,he.offset,v]),(0, ut.useEffect)(()=>{(!He||N.notice)&&Y(null);},[He,N.notice]),(0, ut.useEffect)(()=>{if(!He){I.current=null,C(null);return}I.current??(I.current=Date.now());let pe=()=>C(Math.floor((Date.now()-(I.current??0))/1e3));pe();let y=setInterval(pe,1e3);return ()=>clearInterval(y)},[He]);let ae=(0, ut.useRef)(false);(0, ut.useEffect)(()=>{if(He){ae.current=true;return}ae.current&&(ae.current=false,Re(false));},[He,Re]);let Ae=(0, ut.useCallback)(()=>{if(ve.pending){ve.start();return}Re(true),s&&N.isIdle&&N.start();},[s,N,Re,ve]),ze=(0, ut.useCallback)(()=>{D.consumeDragClick()||Ae();},[Ae,D]),xe=RA(ve.pointer,hT),ye=(0, ut.useCallback)(()=>De.current?.getBoundingClientRect()??null,[]),Ye=RA(ve.mark,_A),Xe=_T(t?.teaser),qe=Xe.visible&&!K&&!!N.isIdle,_t=(0, ut.useCallback)(()=>{Xe.dismiss(),ve.pending&&ve.markSeen();},[Xe,ve]),Tt=(0, ut.useCallback)(()=>{D.consumeDragClick()||Re(false);},[Re,D]),mt=he.draggable&&!oe.sheet?D.handlers:void 0,gt=i===void 0&&N.mode==="call"&&!N.isPushToTalk,Qe=["af-widget",`af-widget--${U}`,K?"af-widget--expanded":"af-widget--collapsed",F?"af-widget--settling":"",N.isSpeaking?"af-widget--speaking":"",oe.sheet?"af-widget--sheet":"",!A&&oe.left!==null?"af-widget--free":"",D.dragging?"af-widget--dragging":"",D.gliding?"af-widget--gliding":"",J!==null?"af-widget--bouncing":"",he.draggable?"af-widget--draggable":"",He?"af-widget--live":"",gt?"af-widget--callbar":"",A?"af-widget--framed":"",T??""].filter(Boolean).join(" ");return (0, Qn.jsxs)("div",{ref:De,className:Qe,style:{"--af-widget-w":`${oe.w}px`,"--af-widget-h":`${oe.h}px`,"--af-widget-left":!A&&oe.left!==null?`${oe.left}px`:void 0,"--af-widget-top":!A&&oe.top!==null?`${oe.top}px`:void 0,"--af-widget-offset-x":`${oe.sheet?0:z??he.offset.x}px`,"--af-widget-offset-y":`${oe.sheet?0:z??he.offset.y}px`,"--af-widget-radius":oe.sheet?"0px":K?"24px":`${he.bubbleSize/2}px`,"--af-widget-accent":he.accent??"#ffffff","--af-widget-live":he.accent??"#16a34a","--af-widget-bg":he.panelBackground,"--af-widget-fg":ge.fg,"--af-widget-scrim":ge.scrim,"--af-widget-avatar-scale":`${he.avatarScale}`,"--af-widget-bounce-count":J===null?void 0:J==="forever"?"infinite":`${J}`,zIndex:he.zIndex,...x},children:[(0, Qn.jsxs)("div",{className:"af-widget__frame",onAnimationEnd:pe=>{pe.animationName==="af-widget-bounce"&&Y(null);},children:[(0, Qn.jsx)("div",{className:"af-widget__stage",children:(0, Qn.jsx)(Sh,{fit:K?"contain":void 0,usePictureInPicture:K&&g})}),F&&(0, Qn.jsx)("div",{className:"af-widget__settle","aria-hidden":"true",children:(0, Qn.jsx)("span",{className:"af-widget__settle-spinner"})}),(0, Qn.jsx)(MT,{expanded:K,title:e,live:He,connecting:ct,elapsed:w,onCollapse:Tt,composer:gt?(0, Qn.jsx)(ET,{}):i,dragHandlers:mt}),(0, Qn.jsx)(yT,{expanded:K,live:He,elapsed:w,label:n,onOpen:ze,dragHandlers:mt})]}),qe&&t?.teaser&&(0, Qn.jsx)(ST,{text:t.teaser.text,onAccept:Ae,onDismiss:_t}),Ye&&(0, Qn.jsx)(lT,{target:Ye.value.element,strong:Ye.value.strong,color:p?.highlightColor,leaving:Ye.leaving},`mark-${Ye.value.step}`),xe&&(0, Qn.jsx)(pT,{target:xe.value.target,side:xe.value.side,avatar:ye,leaving:xe.leaving},`arrow-${xe.value.step}`)]})},LT=cD;var Ur=ue(Rt());function DT(){let t=Vn(),e=bh(),n=(0, Ur.useCallback)(()=>e.setOpen(true),[e]),i=(0, Ur.useCallback)(()=>e.setOpen(false),[e]),r=(0, Ur.useCallback)(()=>e.setOpen(!e.isOpen),[e]),a=(0, Ur.useCallback)(()=>{e.setOpen(true),t.isIdle&&t.start();},[e,t]),s=(0, Ur.useCallback)(()=>e.tourControlsRef.current?.start(),[e]),u=(0, Ur.useCallback)(()=>e.tourControlsRef.current?.stop(),[e]);return (0, Ur.useMemo)(()=>({isOpen:e.isOpen,stage:e.stage,open:n,close:i,toggle:r,openAndStart:a,tourState:e.tourState,startTour:s,stopTour:u}),[e.isOpen,e.stage,e.tourState,n,i,r,a,s,u])}var BT="avatarfactory";var UT="resume",FT="resume";var fD=new Set(["host.info","context.set","context.event","cmd.open","cmd.close","cmd.start","cmd.stop","cmd.destroy","action.set","action.result","action.ui","action.check_result","page.result","page.changed","tour.result"]),dD=new Set(["ready","resize","state","event","beacon","action.run","action.flow","action.check","page.call","tour.do"]),hD=(t,e)=>({ns:BT,v:1,deployId:t,...e}),kh=(t,e)=>{if(t.origin!==e.origin||e.source!==void 0&&t.source!==e.source)return null;let n=t.data;return !n||typeof n!="object"||n.ns!==BT||n.v!==1||n.deployId!==e.deployId||typeof n.type!="string"||!(e.direction==="from-loader"?fD:dD).has(n.type)?null:n},Ku=(t,e,n,i)=>{t.postMessage(hD(n,i),e);};var pD=2600,mD=t=>!!t&&typeof t=="object"&&["left","top","width","height"].every(e=>Number.isFinite(t[e])),VT=(t,e)=>{let n=new Map,i=new Map,r=new Set,a=0,s=p=>{window.parent!==window&&Ku(window.parent,t,e,p);},u=p=>{let _=kh(p,{origin:t,deployId:e,direction:"from-loader",source:window.parent});if(_)switch(_.type){case "page.result":{let{callId:T,ok:x,value:N,error:E}=_.payload,w=n.get(T);n.delete(T),x?w?.resolve(N):w?.reject(new Error(E??"the page refused"));return}case "page.changed":r.forEach(T=>T());return;case "tour.result":{let{seq:T,found:x,rect:N}=_.payload;i.get(T)?.({found:x===true,rect:mD(N)?N:void 0}),i.delete(T);return}}};window.addEventListener("message",u);let d={surface:kv(p=>new Promise((_,T)=>{let x=`p${++a}`;n.set(x,{resolve:_,reject:T}),setTimeout(()=>n.delete(x),Td),s({type:"page.call",payload:{callId:x,call:p}});})),watch:p=>(r.add(p),()=>r.delete(p)),pageBeforeLive:true},g=p=>new Promise(_=>{let T=++a,x=setTimeout(()=>{i.delete(T),_({found:false});},pD);i.set(T,N=>{clearTimeout(x),_(N);}),s({type:"tour.do",payload:{seq:T,...p}});});return {pageHost:d,tourPage:(p,_)=>({seenKey:p,scroll:async T=>(await g({op:"scroll",target:T})).rect??null,mark:async(T,x)=>(await g({op:"mark",target:T,strong:x,color:_})).found,clear:()=>{g({op:"clear"});},scrollTop:()=>{g({op:"top"});}}),dispose:()=>window.removeEventListener("message",u)}};var gD=new Set(["bottom-right","bottom-left","top-right","top-left"]),vD=new Set(["sheet","corner"]),HT={min:0,max:200},AD={min:40,max:160},yD={min:280,max:640},bD={min:360,max:900},_D=/^(#[0-9a-f]{3,8}|rgba?\(\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*(,\s*[\d.]+%?\s*)?\))$/i,Zu=(t,e)=>typeof t=="number"&&Number.isFinite(t)?Math.min(e.max,Math.max(e.min,Math.round(t))):void 0,SD=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),zT=t=>{let e=t&&typeof t=="object"?t:{},n=e.appearance&&typeof e.appearance=="object"?e.appearance:{},i=n.offset,r=n.panel,a=Zu(i?.x,HT),s=Zu(i?.y,HT),u=Zu(r?.w,yD),d=Zu(r?.h,bD),g=e.tour;return {layout:e.layout==="inline"?"inline":"widget",appearance:SD({position:typeof n.position=="string"&&gD.has(n.position)?n.position:void 0,offset:a!==void 0&&s!==void 0?{x:a,y:s}:void 0,bubbleSize:Zu(n.bubbleSize,AD),panel:u!==void 0&&d!==void 0?{w:u,h:d}:void 0,accent:typeof n.accent=="string"&&_D.test(n.accent.trim())?n.accent.trim():void 0,draggable:typeof n.draggable=="boolean"?n.draggable:void 0,mobile:typeof n.mobile=="string"&&vD.has(n.mobile)?n.mobile:void 0}),tour:g&&typeof g=="object"?{once:g.once==="session"?"session":"visitor"}:void 0,pageAccess:e.pageAccess===true}};var So=ue(Be()),MD=()=>new URLSearchParams(window.location.search).get("page")==="1",TD=()=>{let t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(FT);if(e)return window.history.replaceState(null,"",window.location.pathname+window.location.search),{token:e,led:t.get("led")==="1"}},GT=({projection:t,hostOrigin:e})=>{let{behaviour:n}=t,[i]=(0, it.useState)(()=>VT(e,t.deployId));(0, it.useEffect)(()=>i.dispose,[i]);let[r]=(0, it.useState)(()=>MD()?i.pageHost:void 0),[a]=(0, it.useState)(()=>({kept:TD(),onState:u=>Ku(window.parent,e,t.deployId,{type:"event",payload:{name:UT,detail:{token:u}}})})),s=(0, it.useMemo)(()=>({deployId:t.deployId,mode:t.mode,avatar:{avatarId:t.avatarId,greeting:n?.greeting},connectTone:n?.connectTone,transcript:n?.transcript}),[t.deployId,t.mode,t.avatarId,n]);return xD(),(0, So.jsx)(YM,{config:s,embedHostOrigin:e,pageHost:r,embedResume:a,children:(0, So.jsx)(CD,{projection:t,hostOrigin:e,channel:i,carriesOn:!!a.kept})})},CD=({projection:t,hostOrigin:e,channel:n,carriesOn:i})=>{let r=qM(),{_sendActionUi:a}=Vn(),s=DT(),{flow:u}=XM(),[d,g]=(0, it.useState)(null),[v,A]=(0, it.useState)(0),[p,_]=(0, it.useState)(null),T=(0, it.useRef)(new Map),x=(0, it.useRef)(new Map),N=(0, it.useRef)([]),E=(0, it.useRef)(0),{deployId:w,configVersion:C,mode:I}=t,V=(0, it.useMemo)(()=>({...t.appearance,...p?.config.appearance}),[t.appearance,p]),K=(0, it.useMemo)(()=>Ta(V),[V]),F=(0, it.useMemo)(()=>Ta(t.appearance).position,[t.appearance]),H=(0, it.useMemo)(()=>p?.config.tour?{...t.tour,generate:true,once:p.config.tour.once}:t.tour,[t.tour,p]),J=(0, it.useMemo)(()=>p&&H?n.tourPage(`af-tour:site:${e}`,H.highlightColor):void 0,[n,p,H]),Y=(0, it.useCallback)(D=>{window.parent!==window&&Ku(window.parent,e,w,D);},[e,w]),Me=v>=2,Re=(0, it.useMemo)(()=>Me?{...V,draggable:V.draggable??true,teaser:void 0}:{...V,offset:{x:0,y:0},draggable:false,teaser:void 0},[V,Me]),he=(0, it.useCallback)(D=>{N.current.forEach(U=>U()),N.current=D.flatMap(U=>{let z=Object.values(U.params??{}).some(oe=>oe.check),X=r.registerAction?.({...U,handler:(oe,{callId:ge,signal:be})=>new Promise(_e=>{T.current.set(ge,_e),be.addEventListener("abort",()=>T.current.delete(ge)),Y({type:"action.run",payload:{callId:ge,name:U.name,args:oe}});}),...z&&{check:(oe,ge,be)=>new Promise(_e=>{let ve=`check-${++E.current}`;x.current.set(ve,_e),setTimeout(()=>x.current.delete(ve),_d),Y({type:"action.check",payload:{checkId:ve,name:U.name,param:oe,value:ge,args:be}});})}});return X?[X]:[]});},[r,Y]);(0, it.useEffect)(()=>{let D=U=>{let z=kh(U,{origin:e,deployId:w,direction:"from-loader",source:window.parent});if(z)switch(z.type){case "host.info":{let{w:X,h:oe}=z.payload.viewport;g(be=>be&&be.w===X&&be.h===oe?be:{w:X,h:oe}),A(z.payload.frameLayout??0);let ge={config:zT(z.payload.config)};_(be=>be&&JSON.stringify(be)===JSON.stringify(ge)?be:ge);return}case "context.set":r.addLiveContext?.({context:z.payload.context});return;case "context.event":r.addLiveContext?.({context:`${z.payload.name}: ${z.payload.context}`,update:true});return;case "cmd.open":s.open();return;case "cmd.close":s.close();return;case "cmd.start":r.start?.();return;case "cmd.stop":case "cmd.destroy":r.stop?.();return;case "action.set":he(z.payload.actions);return;case "action.result":{let{callId:X,ok:oe,result:ge,error:be}=z.payload,_e=T.current.get(X);T.current.delete(X),_e?.(oe?{ok:true,result:ge}:{ok:false,error:be??"failed"});return}case "action.check_result":{let{checkId:X,ok:oe,reason:ge,suggestions:be,param:_e,value:ve}=z.payload,He=x.current.get(X);x.current.delete(X),He?.(oe?{ok:true,value:ve}:{ok:false,reason:ge,suggestions:be,param:_e});return}case "action.ui":a(z.payload.op,z.payload.args,z.payload.name);return}};return window.addEventListener("message",D),()=>window.removeEventListener("message",D)},[e,w,r,s,he,a]),(0, it.useEffect)(()=>()=>N.current.forEach(D=>D()),[]),(0, it.useEffect)(()=>{Y({type:"ready",payload:{configVersion:C,mode:I,position:F}});},[Y,C,I,F]),(0, it.useEffect)(()=>{let D=(ge,be)=>Y({type:"event",payload:{name:ge,detail:be}}),U=()=>D("start"),z=()=>D("stop"),X=ge=>D("notice",{kind:ge.kind,action:ge.action}),oe=ge=>D("error",{code:ge.code,fatal:ge.fatal,cause:Ps(ge)});return r.on?.("start",U),r.on?.("stop",z),r.on?.("notice",X),r.on?.("error",oe),()=>{r.off?.("start",U),r.off?.("stop",z),r.off?.("notice",X),r.off?.("error",oe);}},[r.on,r.off,Y]);let De=(0, it.useRef)(false);(0, it.useEffect)(()=>{!i||De.current||(De.current=true,s.open(),r.start?.());},[i,s,r]),(0, it.useEffect)(()=>{Y({type:"event",payload:{name:"speaking",detail:{speaking:r.isSpeaking}}});},[r.isSpeaking,Y]),(0, it.useEffect)(()=>{Y({type:"action.flow",payload:{flow:u}});},[u,Y]);let fe=(0, it.useCallback)(D=>Y({type:"resize",payload:{w:D.w,h:D.h,position:D.position,sheet:D.sheet,offset:K.offset,left:D.left,top:D.top,gutter:D.gutter}}),[Y,K.offset]),Q=(0, it.useRef)(null),te=(0, it.useCallback)(D=>{D!==Q.current&&(Q.current=D,Y({type:"state",payload:{stage:D}}));},[Y]);return !d||!p?null:p.config.layout==="inline"?(0, So.jsx)(RD,{}):(0, So.jsx)(LT,{appearance:Re,hostViewport:d,framed:Me,tour:H,tourPage:J,onResize:fe,onStageChange:te})},RD=()=>(Vn()._setMountSurface("inline"),(0, So.jsx)("div",{style:{width:"100vw",height:"100vh"},children:(0, So.jsx)(Sh,{style:{width:"100%",height:"100%"}})})),xD=()=>{(0, it.useEffect)(()=>{for(let t of [document.documentElement,document.body])Object.assign(t.style,{background:"transparent",margin:"0",overflow:"hidden",colorScheme:"normal",fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"});},[]);};function zt(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t));}zt(`.avatar-controls-root{position:absolute;bottom:10px;display:flex;align-items:center;justify-content:center;gap:12px;pointer-events:none}.avatar-controls-button{pointer-events:auto;width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.2);cursor:pointer;color:#fff;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);transition:transform .2s ease,box-shadow .2s ease,background-color .2s ease}.avatar-controls-button:active{transform:scale(.95)}.avatar-controls-call{background-color:#059669eb;box-shadow:0 4px 12px #00000026}.avatar-controls-call:hover{transform:scale(1.05);background-color:#10b981;box-shadow:0 6px 18px #0003}.avatar-controls-hangup{background-color:#e11d48eb;box-shadow:0 4px 12px #00000026}.avatar-controls-hangup:hover{transform:scale(1.05);background-color:#f43f5e;box-shadow:0 6px 18px #0003}.avatar-controls-mute{background-color:#1f29378c;box-shadow:0 4px 12px #00000026}.avatar-controls-mute:hover{transform:scale(1.05);background-color:#374151b3;box-shadow:0 6px 18px #0003}.avatar-controls-muted{background-color:#e11d48d9}.avatar-controls-muted:hover{background-color:#f43f5e}.avatar-controls-stop-speaking{background-color:#d97706e6;box-shadow:0 4px 12px #00000026}.avatar-controls-stop-speaking:hover{transform:scale(1.05);background-color:#f59e0b;box-shadow:0 6px 18px #0003}.avatar-controls-connecting{background-color:#6b7280;cursor:default}.avatar-controls-connecting:hover{transform:none;box-shadow:0 10px 25px #0006;background-color:#6b7280}@keyframes avatar-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.avatar-controls-spinner{animation:avatar-spin .9s linear infinite}
33
+ `);zt(`.avatar-ptt-root{position:absolute;bottom:10px;display:flex;align-items:center;justify-content:center;gap:10px;pointer-events:none}.avatar-ptt-secondary{pointer-events:auto;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.14);background-color:#18181b8c;color:#fff;cursor:pointer;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);transition:transform .18s cubic-bezier(.34,1.4,.64,1),background-color .18s ease,border-color .18s ease}.avatar-ptt-secondary:hover{transform:scale(1.06);background-color:#27272ab8}.avatar-ptt-secondary:active{transform:scale(.94)}.avatar-ptt-secondary-off{background-color:#e11d48d1;border-color:#ffffff38}.avatar-ptt-hangup:hover{background-color:#e11d48d9;border-color:#ffffff3d}.avatar-ptt-connect{pointer-events:auto;height:48px;padding:0 22px;border-radius:999px;display:flex;align-items:center;gap:9px;border:1px solid rgba(255,255,255,.18);background:linear-gradient(180deg,#10b981,#059669);color:#fff;font:600 14px/1 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:.01em;cursor:pointer;box-shadow:0 6px 20px #05966959;transition:transform .18s cubic-bezier(.34,1.4,.64,1),box-shadow .18s ease,filter .18s ease}.avatar-ptt-connect:hover:not(:disabled){transform:translateY(-1px) scale(1.02);box-shadow:0 10px 26px #0596696b}.avatar-ptt-connect:active:not(:disabled){transform:scale(.97)}.avatar-ptt-connect:disabled{cursor:default;filter:grayscale(.7);opacity:.55;box-shadow:none}.avatar-ptt-button{pointer-events:auto;position:relative;height:52px;min-width:178px;padding:0;border:none;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:none;user-select:none;-webkit-user-select:none}.avatar-ptt-face{position:relative;z-index:1;height:100%;padding:0 26px;border-radius:999px;display:flex;align-items:center;justify-content:center;gap:10px;border:1px solid rgba(255,255,255,.16);background:linear-gradient(180deg,#27272ad1,#18181be0);color:#ffffffeb;font:600 14.5px/1 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:.01em;white-space:nowrap;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 8px 24px #00000047,inset 0 1px #ffffff14;transition:transform .22s cubic-bezier(.34,1.4,.64,1),background .22s ease,border-color .22s ease,box-shadow .22s ease,color .22s ease}.avatar-ptt-button:hover .avatar-ptt-face{transform:translateY(-1px);border-color:#ffffff42}.avatar-ptt-holding .avatar-ptt-face{transform:scale(1.04);border-color:#ffffff57;background:linear-gradient(180deg,#6366f1,#4f46e5);color:#fff;box-shadow:0 10px 30px #4f46e573,inset 0 1px #ffffff38}.avatar-ptt-icon{flex:none;opacity:.8;transition:opacity .22s ease,transform .22s cubic-bezier(.34,1.4,.64,1)}.avatar-ptt-holding .avatar-ptt-icon{opacity:1;transform:scale(1.12)}.avatar-ptt-label{display:inline-block;animation:avatar-ptt-label-in .26s cubic-bezier(.22,1,.36,1)}@keyframes avatar-ptt-label-in{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}.avatar-ptt-halo{position:absolute;inset:-3px;border-radius:999px;background:#6366f1;opacity:0;transform:scale(.96);transition:opacity .3s ease,transform .3s ease}.avatar-ptt-holding .avatar-ptt-halo{animation:avatar-ptt-pulse 1.6s cubic-bezier(.25,.6,.35,1) infinite}@keyframes avatar-ptt-pulse{0%{opacity:.42;transform:scale(.98)}70%{opacity:0;transform:scale(1.14)}to{opacity:0;transform:scale(1.14)}}.avatar-ptt-button:disabled{cursor:default}.avatar-ptt-button:disabled .avatar-ptt-face{opacity:.5}@media(prefers-reduced-motion:reduce){.avatar-ptt-face,.avatar-ptt-icon,.avatar-ptt-secondary,.avatar-ptt-connect{transition-duration:.01ms}.avatar-ptt-holding .avatar-ptt-halo,.avatar-ptt-label{animation:none}.avatar-ptt-holding .avatar-ptt-halo{opacity:.3}}
34
+ `);zt(`.avatar-shell-root{position:relative;width:100%;height:100%;overflow:hidden;border-radius:inherit}.connectivity-dot{position:absolute;top:10px;right:25px;width:12px;height:12px;border-radius:50%;border:2px solid white;box-shadow:0 0 4px #0000004d;z-index:10;transition:background-color .3s ease}.connectivity-dot.connected{background-color:#4caf50}.connectivity-dot.disconnected{background-color:#f44336}
35
+ `);zt(`.avatar-root{position:relative;width:100%;height:100%}.avatar-connecting-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;container-type:size;pointer-events:none;z-index:21;animation:avatar-connecting-in .24s ease-out both}@keyframes avatar-connecting-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.avatar-connecting-overlay{animation:none}}.avatar-controls{position:absolute;left:50%;bottom:12px;transform:translate(-50%);z-index:10;display:flex;align-items:center;justify-content:center}
36
+ `);zt(`.avatar-captions{position:absolute;z-index:12;display:flex;flex-direction:column;justify-content:flex-end;gap:6px;width:min(620px,calc(100% - 32px));--avatar-captions-max-lines: 2;--avatar-captions-text-line: 21px;--avatar-captions-pill-padding: 14px;max-height:calc(var(--avatar-captions-max-lines) * var(--avatar-captions-text-line) + var(--avatar-captions-pill-padding));overflow:hidden;border-radius:12px;pointer-events:none;transition:opacity .5s ease}.avatar-captions--top-left,.avatar-captions--bottom-left{left:16px;align-items:flex-start}.avatar-captions--top-right,.avatar-captions--bottom-right{right:16px;align-items:flex-end}.avatar-captions--top-center,.avatar-captions--bottom-center{left:50%;transform:translate(-50%);align-items:center}.avatar-captions--top-left,.avatar-captions--top-center,.avatar-captions--top-right{top:16px}.avatar-captions--bottom-left,.avatar-captions--bottom-center,.avatar-captions--bottom-right{bottom:16px}.avatar-captions--top-left .avatar-captions-line,.avatar-captions--bottom-left .avatar-captions-line{justify-content:flex-start;text-align:left}.avatar-captions--top-right .avatar-captions-line,.avatar-captions--bottom-right .avatar-captions-line{justify-content:flex-end;text-align:right}.avatar-captions--raised{bottom:72px}.avatar-captions--hidden{opacity:0}.avatar-captions-line{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:3px 6px;max-width:100%;margin:0;padding:7px 12px;border-radius:12px;background:#0c0c0ea8;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);color:#fff;font-family:system-ui,-apple-system,Segoe UI,sans-serif;font-size:15px;font-weight:500;line-height:1.4;letter-spacing:.01em;text-align:center;animation:avatar-captions-line-in .24s ease-out both}.avatar-captions-line--past{opacity:.45;font-size:13.5px}.avatar-captions-tag{padding:1px 7px;border-radius:999px;background:#ffffff29;font-size:10.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}.avatar-captions-word{display:inline-block;animation:avatar-captions-word-in .26s cubic-bezier(.2,.8,.2,1) both}.avatar-captions-word--interim{opacity:.82}@keyframes avatar-captions-line-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes avatar-captions-word-in{0%{opacity:0;transform:translateY(4px);filter:blur(2px)}to{opacity:1;transform:translateY(0);filter:blur(0)}}@media(prefers-reduced-motion:reduce){.avatar-captions-line,.avatar-captions-word{animation:none}}
37
+ `);zt(`.avatar-status-banner{position:absolute;z-index:13;display:flex;align-items:center;gap:9px;max-width:min(360px,calc(100% - 32px));padding:8px 13px 8px 11px;border-radius:999px;background:#0c0c0eb8;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 4px 16px #00000047;color:#fff;font-family:system-ui,-apple-system,Segoe UI,sans-serif;pointer-events:none;animation:avatar-status-banner-in .24s ease-out both}.avatar-status-banner--top-left,.avatar-status-banner--bottom-left{left:16px}.avatar-status-banner--top-right,.avatar-status-banner--bottom-right{right:16px}.avatar-status-banner--top-left,.avatar-status-banner--top-right{top:16px}.avatar-status-banner--bottom-left,.avatar-status-banner--bottom-right{bottom:28px}.avatar-status-banner--raised{bottom:80px}.avatar-status-banner-dot{flex:none;width:9px;height:9px;border-radius:50%;background:#f5b53d;box-shadow:0 0 #f5b53d8c;animation:avatar-status-banner-pulse 1.8s ease-out infinite}.avatar-status-banner--failed .avatar-status-banner-dot{background:#f0533f;box-shadow:0 0 #f0533f8c;animation-duration:1.2s}.avatar-status-banner-text{display:flex;flex-direction:column;gap:1px;min-width:0}.avatar-status-banner-title{font-size:13px;font-weight:600;line-height:1.3;letter-spacing:.005em}.avatar-status-banner-detail{font-size:11.5px;font-weight:450;line-height:1.3;color:#ffffffad}@keyframes avatar-status-banner-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes avatar-status-banner-pulse{0%{box-shadow:0 0 #f5b53d80}70%,to{box-shadow:0 0 0 7px #f5b53d00}}@media(prefers-reduced-motion:reduce){.avatar-status-banner,.avatar-status-banner-dot{animation:none}}
38
+ `);zt(`.avatar-thinking-indicator{position:absolute;z-index:11;display:flex;align-items:center;gap:6px;padding:9px 13px;border-radius:999px;background:#0c0c0ea8;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:none;animation:avatar-thinking-in .2s ease-out both}.avatar-thinking-indicator--top-left,.avatar-thinking-indicator--bottom-left{left:16px}.avatar-thinking-indicator--top-right,.avatar-thinking-indicator--bottom-right{right:16px}.avatar-thinking-indicator--top-center,.avatar-thinking-indicator--bottom-center{left:50%;transform:translate(-50%)}.avatar-thinking-indicator--top-left,.avatar-thinking-indicator--top-center,.avatar-thinking-indicator--top-right{top:16px}.avatar-thinking-indicator--bottom-left,.avatar-thinking-indicator--bottom-center,.avatar-thinking-indicator--bottom-right{bottom:16px}.avatar-thinking-indicator--raised{bottom:72px}.avatar-thinking-indicator-dot{width:7px;height:7px;border-radius:50%;background:#ffffffd9;animation:avatar-thinking-bounce 1.2s ease-in-out infinite}.avatar-thinking-indicator-dot:nth-child(2){animation-delay:.16s}.avatar-thinking-indicator-dot:nth-child(3){animation-delay:.32s}@keyframes avatar-thinking-bounce{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}@keyframes avatar-thinking-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.avatar-thinking-indicator--top-center,.avatar-thinking-indicator--bottom-center{animation:avatar-thinking-fade .2s ease-out both}@keyframes avatar-thinking-fade{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.avatar-thinking-indicator{animation:none}.avatar-thinking-indicator-dot{animation:avatar-thinking-pulse 1.4s ease-in-out infinite}.avatar-thinking-indicator-dot:nth-child(2){animation-delay:.2s}.avatar-thinking-indicator-dot:nth-child(3){animation-delay:.4s}}@keyframes avatar-thinking-pulse{0%,to{opacity:.4}50%{opacity:1}}
39
+ `);zt(`.rive-renderer-root{position:relative;width:100%;height:100%;min-height:0;overflow:hidden;border-radius:inherit}.rive-renderer-canvasWrapper{position:absolute;inset:0;width:100%;height:100%}.rive-renderer-canvas{width:100%;height:100%}.rive-renderer-canvas>canvas{display:block;width:100%!important;height:100%!important}.rive-renderer-surface{position:absolute;inset:0}.rive-renderer-hold{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}.rive-renderer-hold[hidden]{display:none}.rive-renderer-loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;container-type:size;z-index:20}.rive-renderer-error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#0000008c;z-index:20;color:#ffffffb3}.rive-renderer-error-text{font-size:13px;font-family:system-ui,sans-serif;letter-spacing:.01em}
40
+ `);zt(`.avatar-camera-preview{position:absolute;z-index:20;width:22%;min-width:96px;max-width:180px;aspect-ratio:3 / 4;border-radius:12px;overflow:hidden;background:#000;box-shadow:0 4px 16px #00000059;border:1px solid rgba(255,255,255,.18)}.avatar-camera-preview.top-left{top:12px;left:12px}.avatar-camera-preview.top-right{top:12px;right:12px}.avatar-camera-preview.bottom-left{bottom:12px;left:12px}.avatar-camera-preview.bottom-right{bottom:12px;right:12px}.avatar-camera-preview.stage{--af-camera-stage-inset: 10px;--af-camera-stage-radius: 18px;inset:var(--af-camera-stage-inset);width:auto;min-width:0;max-width:none;aspect-ratio:auto;border:none;border-radius:var(--af-camera-stage-radius);background:#0d0f16;box-shadow:0 1px 2px #10122024,0 14px 34px -14px #10122080,inset 0 0 0 1px #ffffff29;z-index:1;animation:avatar-camera-stage-in .32s cubic-bezier(.2,.8,.2,1) backwards}@keyframes avatar-camera-stage-in{0%{opacity:0;transform:scale(1.015)}to{opacity:1;transform:none}}.avatar-camera-preview.stage:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(125% 95% at 50% 45%,transparent 52%,rgba(10,12,20,.3) 100%),linear-gradient(to top,rgba(8,10,18,.45),transparent 30%)}.avatar-camera-preview.stage .avatar-camera-preview-actions{top:0;bottom:auto;z-index:2;padding:12px;background:linear-gradient(to bottom,#080a126b,#080a1200)}.avatar-camera-preview.stage .avatar-camera-preview-btn{width:36px;height:36px;background:#ffffff29;box-shadow:inset 0 0 0 1px #ffffff38;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.avatar-camera-preview.stage .avatar-camera-preview-btn:hover{background:#ffffff4d}.avatar-camera-preview.stage .avatar-camera-preview-off{gap:10px;font-size:14px;background:#0d0f16}.avatar-camera-preview.swappable,.avatar-pip-frame.swappable{cursor:pointer;transition:transform .18s ease,box-shadow .18s ease}.avatar-camera-preview.swappable:hover,.avatar-pip-frame.swappable:hover{transform:scale(1.03)}.avatar-camera-preview.swappable:focus-visible,.avatar-pip-frame.swappable:focus-visible{outline:2px solid #ffffff;outline-offset:2px}.avatar-pip-swap-hint{position:absolute;top:6px;right:6px;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;color:#fff;background:#0c0e1680;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);opacity:0;transition:opacity .15s ease;pointer-events:none}.swappable:hover .avatar-pip-swap-hint,.swappable:focus-visible .avatar-pip-swap-hint{opacity:1}@media(hover:none){.avatar-pip-swap-hint{opacity:1}.avatar-camera-preview.swappable:hover,.avatar-pip-frame.swappable:hover{transform:none}}.avatar-stage-layer{position:absolute;inset:0}.avatar-pip-frame{position:absolute;z-index:20;width:26%;min-width:104px;max-width:200px;aspect-ratio:3 / 4;border:none;border-radius:16px;overflow:hidden;background:radial-gradient(118% 76% at 50% 6%,rgba(186,207,243,.42),transparent 62%),linear-gradient(to bottom,#fff,#eaeef9);box-shadow:0 1px 2px #10122029,0 16px 34px -14px #1012208c,inset 0 0 0 1px #ffffffbf;animation:avatar-pip-frame-in .32s cubic-bezier(.2,.8,.2,1) backwards}@keyframes avatar-pip-frame-in{0%{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}.avatar-pip-frame.top-left{top:20px;left:20px}.avatar-pip-frame.top-right{top:20px;right:20px}.avatar-pip-frame.bottom-left{bottom:20px;left:20px}.avatar-pip-frame.bottom-right{bottom:20px;right:20px}@media(prefers-reduced-motion:reduce){.avatar-camera-preview.stage,.avatar-pip-frame{animation:none}}.avatar-camera-preview-video{width:100%;height:100%;object-fit:cover;display:block}.avatar-camera-preview-video.mirrored{transform:scaleX(-1)}.avatar-camera-preview-off{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#ffffff8c;background:#1b1b1f;font-size:11px;font-family:inherit;user-select:none}.avatar-camera-preview-actions{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px;background:linear-gradient(to top,#0000008c,#0000);opacity:0;transition:opacity .15s ease}.avatar-camera-preview:hover .avatar-camera-preview-actions,.avatar-camera-preview:focus-within .avatar-camera-preview-actions,.avatar-camera-preview.video-off .avatar-camera-preview-actions{opacity:1}@media(hover:none){.avatar-camera-preview-actions{opacity:1}}.avatar-camera-preview-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:50%;cursor:pointer;color:#fff;background:#ffffff2e;backdrop-filter:blur(4px);transition:background .15s ease}.avatar-camera-preview-btn:hover{background:#ffffff52}.avatar-camera-preview-btn.off{background:#d93b3b}.avatar-camera-preview-btn.off:hover{background:#e85555}.avatar-camera-preview-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.avatar-camera-preview-mood{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:28px;height:28px;padding:0;border:none;border-radius:999px;cursor:pointer;color:#ffffffb3;background:#ffffff2e;backdrop-filter:blur(4px);font:inherit;transition:background .15s ease,color .15s ease}.avatar-camera-preview-mood:hover{background:#ffffff52}.avatar-camera-preview-mood.on{color:#fff;background:#2fa86bd9}.avatar-camera-preview-mood.on:hover{background:#3aba79eb}.avatar-camera-preview-mood:focus-visible{outline:2px solid #fff;outline-offset:2px}.avatar-camera-preview-mood-label,.avatar-camera-preview-mood-track{display:none}.avatar-camera-preview.stage .avatar-camera-preview-mood{width:auto;height:36px;padding:0 10px 0 12px;color:#fff;background:#ffffff29;box-shadow:inset 0 0 0 1px #ffffff38;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.avatar-camera-preview.stage .avatar-camera-preview-mood:hover{background:#ffffff4d}.avatar-camera-preview.stage .avatar-camera-preview-mood-label{display:inline;font-size:13px;font-weight:500;white-space:nowrap}.avatar-camera-preview.stage .avatar-camera-preview-mood-track{position:relative;display:inline-block;width:28px;height:16px;border-radius:999px;background:#ffffff47;transition:background .15s ease}.avatar-camera-preview.stage .avatar-camera-preview-mood.on .avatar-camera-preview-mood-track{background:#2fa86b}.avatar-camera-preview-mood-knob{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .15s ease}.avatar-camera-preview-mood.on .avatar-camera-preview-mood-knob{transform:translate(12px)}@media(prefers-reduced-motion:reduce){.avatar-camera-preview-mood-knob{transition:none}}
41
+ `);zt(`.avatar-screen-share{position:absolute;z-index:14;--avatar-screen-share-x: 0;--avatar-screen-share-from: -6px;transform:translate(var(--avatar-screen-share-x));display:flex;align-items:center;gap:8px;max-width:calc(100% - 32px);padding:6px;border-radius:999px;background:#0c0c0ec7;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 4px 16px #00000047;color:#fff;font-family:system-ui,-apple-system,Segoe UI,sans-serif;font-size:13px;white-space:nowrap;animation:avatar-screen-share-in .22s ease-out both}.avatar-screen-share.live{padding:6px 6px 6px 12px}.avatar-screen-share--top-left,.avatar-screen-share--bottom-left{left:16px}.avatar-screen-share--top-right,.avatar-screen-share--bottom-right{right:16px}.avatar-screen-share--top-center,.avatar-screen-share--bottom-center{left:50%;--avatar-screen-share-x: -50%}.avatar-screen-share--top-left,.avatar-screen-share--top-center,.avatar-screen-share--top-right{top:16px}.avatar-screen-share--bottom-left,.avatar-screen-share--bottom-center,.avatar-screen-share--bottom-right{bottom:16px;--avatar-screen-share-from: 6px}.avatar-screen-share--raised{bottom:72px}@keyframes avatar-screen-share-in{0%{opacity:0;transform:translate(var(--avatar-screen-share-x),var(--avatar-screen-share-from))}to{opacity:1;transform:translate(var(--avatar-screen-share-x))}}.avatar-screen-share-primary,.avatar-screen-share-secondary{display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border:none;border-radius:999px;font:inherit;font-weight:600;cursor:pointer;transition:background .15s ease}.avatar-screen-share-primary{color:#0d0f16;background:#fff}.avatar-screen-share-primary:hover{background:#e8eaf0}.avatar-screen-share-secondary{color:#fff;background:#ffffff29}.avatar-screen-share-secondary:hover{background:#ffffff47}.avatar-screen-share-primary:focus-visible,.avatar-screen-share-secondary:focus-visible{outline:2px solid #fff;outline-offset:2px}.avatar-screen-share-dot{width:8px;height:8px;border-radius:50%;background:#d93b3b;animation:avatar-screen-share-pulse 1.6s ease-in-out infinite}@keyframes avatar-screen-share-pulse{50%{opacity:.35}}@media(prefers-reduced-motion:reduce){.avatar-screen-share,.avatar-screen-share-dot{animation:none}}
42
+ `);zt(`:where(.af-loader,.rive-renderer-loader,.avatar-connecting-overlay){--af-loader-1: #e3e9f7;--af-loader-2: #cfdaf2;--af-loader-3: #b8c7e9;--af-loader-4: #90a6da;--af-loader-ink: #47506b;--af-loader-avatar-blur: 10px}.rive-renderer-loader,.avatar-connecting-overlay{overflow:hidden}.rive-renderer-canvasWrapper{transition:filter .45s ease}.rive-renderer-root--loading .rive-renderer-canvasWrapper,.avatar-stage-loading .rive-renderer-canvasWrapper{filter:blur(var(--af-loader-avatar-blur))}.rive-renderer-loader:before,.avatar-connecting-overlay:before{content:"";position:absolute;top:50%;left:50%;width:76%;aspect-ratio:1;border-radius:50%;background:radial-gradient(40% 40% at 32% 28%,var(--af-loader-3),transparent 70%),radial-gradient(42% 42% at 70% 30%,var(--af-loader-2),transparent 70%),radial-gradient(46% 46% at 66% 74%,var(--af-loader-4),transparent 72%),radial-gradient(44% 44% at 30% 70%,var(--af-loader-1),transparent 72%);filter:blur(26px);opacity:.8;transform:translate(-50%,-50%);animation:af-loader-aura 9s linear infinite;pointer-events:none}@supports (width: 1cqmin){.rive-renderer-loader:before,.avatar-connecting-overlay:before{width:var(--af-loader-aura-size, 76cqmin);filter:blur(clamp(7px,7cqmin,24px))}}@keyframes af-loader-aura{0%{transform:translate(-50%,-50%) rotate(0) scale(1)}50%{transform:translate(-50%,-50%) rotate(180deg) scale(1.06)}to{transform:translate(-50%,-50%) rotate(360deg) scale(1)}}.af-loader{position:relative;display:flex;align-items:center;justify-content:center;width:7em;height:7em;font-family:inherit;font-size:15px;color:var(--af-loader-ink);user-select:none}@supports (width: 1cqmin){.af-loader{font-size:clamp(6px,11cqmin,15px)}}.af-loader__orb{position:absolute;inset:0;border-radius:50%;filter:blur(2px);animation:af-loader-rotate 3s linear infinite}@keyframes af-loader-rotate{0%{transform:rotate(90deg);box-shadow:0 .6em 1.25em #fff inset,0 1.25em 1.9em 0 var(--af-loader-2) inset,0 3.75em 3.75em 0 var(--af-loader-4) inset}33%{transform:rotate(210deg);box-shadow:0 .6em 1.25em #fff inset,0 1.25em 1em 0 var(--af-loader-1) inset,0 3em 3.75em 0 var(--af-loader-3) inset}66%{transform:rotate(330deg);box-shadow:0 .6em 1.25em #fff inset,0 1.25em .6em 0 var(--af-loader-3) inset,0 2.5em 3.75em 0 var(--af-loader-4) inset}to{transform:rotate(450deg);box-shadow:0 .6em 1.25em #fff inset,0 1.25em 1.9em 0 var(--af-loader-2) inset,0 3.75em 3.75em 0 var(--af-loader-4) inset}}.af-loader__letters{position:relative;z-index:1;display:flex;font-size:.85em;font-weight:600;letter-spacing:.02em}.af-loader__letter{display:inline-block;opacity:.4;animation:af-loader-letter 2s infinite}@keyframes af-loader-letter{0%,to{opacity:.4;transform:translateY(0)}20%{opacity:1;transform:scale(1.15)}40%{opacity:.7;transform:translateY(0)}}@container (max-width: 150px){.af-loader__letters{display:none}}@media(prefers-reduced-motion:reduce){.rive-renderer-loader:before,.avatar-connecting-overlay:before{animation:none}.af-loader__orb{animation-duration:9s}.af-loader__letter{animation:none;opacity:.75}}
43
+ `);zt(`.af-widget{position:fixed;width:var(--af-widget-w);height:var(--af-widget-h);transition:width .32s cubic-bezier(.2,.8,.2,1),height .32s cubic-bezier(.2,.8,.2,1)}.af-widget--bottom-right{right:var(--af-widget-offset-x);bottom:var(--af-widget-offset-y)}.af-widget--bottom-left{left:var(--af-widget-offset-x);bottom:var(--af-widget-offset-y)}.af-widget--top-right{right:var(--af-widget-offset-x);top:var(--af-widget-offset-y)}.af-widget--top-left{left:var(--af-widget-offset-x);top:var(--af-widget-offset-y)}.af-widget--sheet{inset:0}.af-widget--free{left:var(--af-widget-left);top:var(--af-widget-top);right:auto;bottom:auto;transition:width .32s cubic-bezier(.2,.8,.2,1),height .32s cubic-bezier(.2,.8,.2,1),left .32s cubic-bezier(.2,.8,.2,1),top .32s cubic-bezier(.2,.8,.2,1)}.af-widget--dragging,.af-widget--dragging .af-widget__frame,.af-widget--gliding,.af-widget--gliding .af-widget__frame{transition:none}.af-widget--sheet.af-widget--free{inset:0}.af-widget{--af-widget-bounce-lift: -12px}.af-widget--expanded{--af-widget-bounce-lift: -7px}@keyframes af-widget-bounce{0%{transform:translateZ(0);animation-timing-function:cubic-bezier(.22,.68,.36,1)}22%{transform:translate3d(0,var(--af-widget-bounce-lift),0);animation-timing-function:cubic-bezier(.6,0,.85,.35)}40%{transform:translateZ(0);animation-timing-function:cubic-bezier(.22,.68,.36,1)}52%{transform:translate3d(0,calc(var(--af-widget-bounce-lift) * .42),0);animation-timing-function:cubic-bezier(.6,0,.85,.35)}62%{transform:translateZ(0)}to{transform:translateZ(0)}}.af-widget--bouncing .af-widget__frame{animation:af-widget-bounce 1.4s;animation-iteration-count:var(--af-widget-bounce-count, 1);will-change:transform}.af-widget--draggable.af-widget--collapsed .af-widget__launcher,.af-widget--draggable.af-widget--expanded:not(.af-widget--sheet) .af-widget__header{cursor:grab;touch-action:none;user-select:none}.af-widget--dragging .af-widget__launcher,.af-widget--dragging .af-widget__header{cursor:grabbing}.af-widget__frame{position:relative;width:100%;height:100%;overflow:hidden;border-radius:var(--af-widget-radius);background:linear-gradient(to bottom,color-mix(in srgb,var(--af-widget-bg) 82%,#fff) 0%,var(--af-widget-bg) 58%,color-mix(in srgb,var(--af-widget-bg) 92%,var(--af-widget-fg)) 100%);box-shadow:0 0 0 1px color-mix(in srgb,var(--af-widget-fg) 8%,transparent),inset 0 1px color-mix(in srgb,#fff 60%,transparent),0 1px 2px #0000000a,0 10px 28px -10px #00000029,0 34px 70px -26px #0000004d;transition:background .22s ease,border-radius .32s cubic-bezier(.2,.8,.2,1),box-shadow .32s ease}@supports not (color: color-mix(in srgb,red 50%,blue)){.af-widget__frame{background:var(--af-widget-bg)}}.af-widget--expanded .af-widget__frame:before{content:"";position:absolute;inset:0;background:radial-gradient(62% 46% at 50% 40%,color-mix(in srgb,#fff 72%,transparent),transparent 72%);opacity:.7;transition:opacity .6s ease;pointer-events:none}.af-widget--expanded.af-widget--speaking .af-widget__frame:before{opacity:1}.af-widget--expanded .af-widget__frame:after{content:"";position:absolute;left:50%;bottom:9%;width:46%;height:26px;transform:translate(-50%);border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--af-widget-fg) 17%,transparent),transparent);pointer-events:none}.af-widget--collapsed .af-widget__frame{background:transparent;box-shadow:none}.af-widget--collapsed .af-widget__frame{scale:calc(1 + var(--af-widget-lift, 0))}.af-widget__stage{position:absolute;inset:0;transition:opacity .16s ease}.af-widget--expanded .af-widget__stage .rive-renderer-canvasWrapper{inset:calc((1 - var(--af-widget-avatar-scale)) * 50%);width:auto;height:auto}.af-widget--expanded .af-widget__stage .rive-renderer-loader,.af-widget--expanded .af-widget__stage .avatar-connecting-overlay{--af-loader-aura-size: calc(76cqmin * var(--af-widget-avatar-scale))}.af-widget--sheet .af-widget__stage .rive-renderer-canvasWrapper{inset:0;width:100%;height:100%}.af-widget--sheet .af-widget__stage .rive-renderer-loader,.af-widget--sheet .af-widget__stage .avatar-connecting-overlay{--af-loader-aura-size: 76cqmin}.af-widget--settling .af-widget__stage{opacity:0}.af-widget__settle{position:absolute;inset:0;display:grid;place-items:center;z-index:15;pointer-events:none;animation:af-widget-chrome-in .16s ease-out both}.af-widget__settle-spinner{width:26px;height:26px;border-radius:50%;border:2px solid var(--af-widget-scrim);border-top-color:var(--af-widget-fg);animation:af-widget-spin .85s linear infinite}@keyframes af-widget-spin{to{transform:rotate(360deg)}}.af-widget--collapsed .af-widget__stage{pointer-events:none}.af-widget--collapsed .avatar-captions,.af-widget--collapsed .avatar-status-banner,.af-widget--collapsed .avatar-thinking-indicator,.af-widget--collapsed .avatar-controls,.af-widget--collapsed .connectivity-dot{display:none}.af-widget__launcher{position:absolute;inset:0;padding:0;border:0;border-radius:inherit;background:transparent;cursor:pointer;z-index:14;transition:transform .22s cubic-bezier(.2,.8,.2,1)}.af-widget--collapsed .af-widget__frame:hover .af-widget__launcher{transform:translateY(-2px) scale(1.04)}.af-widget__launcher:active{transform:scale(.96)}.af-widget--collapsed .af-widget__frame:before{content:"";position:absolute;inset:-18%;border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--af-widget-accent) 34%,transparent),transparent);opacity:0;transition:opacity .26s ease;pointer-events:none}.af-widget--collapsed .af-widget__frame:hover:before,.af-widget--live.af-widget--collapsed .af-widget__frame:before{opacity:1}.af-widget__launcher:focus-visible{outline:2px solid var(--af-widget-accent);outline-offset:3px}.af-widget__ring{position:absolute;inset:-3px;border-radius:50%;border:2px solid var(--af-widget-accent);animation:af-widget-pulse 2s ease-in-out infinite;pointer-events:none}.af-widget__timer{position:absolute;left:50%;bottom:-7px;transform:translate(-50%);padding:1px 7px;border-radius:999px;background:#0c0c0edb;color:#fff;font:600 10px/1.5 system-ui,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.02em}@keyframes af-widget-pulse{0%,to{opacity:.55;transform:scale(1)}50%{opacity:1;transform:scale(1.06)}}.af-widget__chrome{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none;z-index:16;animation:af-widget-chrome-in .22s ease-out 90ms both}.af-widget__header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 14px 0;pointer-events:auto}.af-widget__title{color:var(--af-widget-fg);font:600 14px/1.3 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:-.015em}.af-widget__status,.af-widget__collapse{background:color-mix(in srgb,var(--af-widget-bg) 62%,transparent);backdrop-filter:blur(16px) saturate(150%);-webkit-backdrop-filter:blur(16px) saturate(150%);box-shadow:0 0 0 1px color-mix(in srgb,var(--af-widget-fg) 8%,transparent),0 2px 8px -4px #00000024}.af-widget__status{display:inline-flex;align-items:center;gap:7px;margin-right:auto;height:28px;padding:0 11px 0 10px;border-radius:999px;color:var(--af-widget-fg);font:600 12px/1 system-ui,-apple-system,Segoe UI,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.01em}.af-widget__title+.af-widget__status{margin-left:8px}.af-widget__status-dot{position:relative;width:7px;height:7px;border-radius:50%;background:currentColor;opacity:.45;animation:af-widget-blink 1.4s ease-in-out infinite}.af-widget__status--live .af-widget__status-dot{background:var(--af-widget-live);opacity:1;animation:none}.af-widget__status--live .af-widget__status-dot:after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--af-widget-live);animation:af-widget-ripple 2.2s ease-out infinite}@keyframes af-widget-ripple{0%{transform:scale(1);opacity:.55}to{transform:scale(3);opacity:0}}@keyframes af-widget-blink{0%,to{opacity:.25}50%{opacity:.75}}.af-widget__collapse{flex:none;display:grid;place-items:center;width:32px;height:32px;margin-left:auto;padding:0;border:0;border-radius:50%;color:var(--af-widget-fg);cursor:pointer;transition:background .16s ease,transform .16s ease}.af-widget__collapse:hover{background:color-mix(in srgb,var(--af-widget-bg) 86%,var(--af-widget-fg))}.af-widget__collapse:active{transform:scale(.94)}.af-widget__collapse:focus-visible{outline:2px solid var(--af-widget-fg);outline-offset:2px}.af-widget__composer{padding:36px 14px 16px;background:linear-gradient(to top,color-mix(in srgb,var(--af-widget-bg) 78%,transparent),transparent);pointer-events:auto}.af-widget--callbar .avatar-controls,.af-widget--callbar.af-widget--expanded .connectivity-dot{display:none}.af-widget--callbar.af-widget--expanded .af-widget__frame:after,.af-widget--callbar .af-loader__letters{display:none}.af-widget--callbar .avatar-captions--bottom-left,.af-widget--callbar .avatar-captions--bottom-center,.af-widget--callbar .avatar-captions--bottom-right,.af-widget--callbar .avatar-status-banner--bottom-left,.af-widget--callbar .avatar-status-banner--bottom-right,.af-widget--callbar .avatar-thinking-indicator--bottom-left,.af-widget--callbar .avatar-thinking-indicator--bottom-center,.af-widget--callbar .avatar-thinking-indicator--bottom-right,.af-widget--callbar .avatar-screen-share--bottom-left,.af-widget--callbar .avatar-screen-share--bottom-center,.af-widget--callbar .avatar-screen-share--bottom-right{bottom:88px}.af-widget__callbar{display:flex;align-items:center;justify-content:center;gap:10px;width:fit-content;margin:0 auto;padding:7px;border-radius:999px;background:#141418cc;backdrop-filter:blur(20px) saturate(160%);-webkit-backdrop-filter:blur(20px) saturate(160%);box-shadow:inset 0 0 0 1px #ffffff14,inset 0 1px #ffffff1a,0 14px 34px -14px #0000008c}.af-widget__help{max-width:260px;margin:0 auto 10px;padding:8px 12px;border-radius:12px;background:#141418d1;color:#fff;font:500 12.5px/1.4 system-ui,-apple-system,Segoe UI,sans-serif;text-align:center;text-wrap:pretty}.af-widget__callbar--idle{padding:0;background:none;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none}.af-widget__callbar-button,.af-widget__call{border:0;cursor:pointer;transition:background .16s ease,color .16s ease,transform .16s ease,opacity .16s ease,box-shadow .16s ease}.af-widget__callbar-button{flex:none;display:grid;place-items:center;width:46px;height:46px;padding:0;border-radius:50%;background:#ffffff1a;color:#fff}.af-widget__callbar-button:hover:not(:disabled){background:#ffffff2e}.af-widget__callbar-button[aria-pressed=true]{background:#fff;color:#141418}.af-widget__call{display:inline-flex;align-items:center;justify-content:center;gap:9px;color:#fff;font:600 14.5px/1 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:-.005em}.af-widget__call--start{height:50px;padding:0 26px 0 22px;border-radius:999px;background:var(--af-widget-fg);color:var(--af-widget-bg);box-shadow:inset 0 1px #ffffff24,0 1px 2px #0000001f,0 12px 26px -12px #00000080}.af-widget__call--start:hover:not(:disabled){transform:translateY(-1px);box-shadow:inset 0 1px #ffffff24,0 1px 2px #0000001f,0 16px 30px -12px #0000008c}.af-widget__call--end{width:58px;height:46px;border-radius:999px;background:#ef4444}.af-widget__call--end:hover{background:#f05252}.af-widget__callbar-button:active:not(:disabled),.af-widget__call:active:not(:disabled){transform:scale(.95)}.af-widget__callbar-button:disabled,.af-widget__call:disabled{opacity:.4;cursor:default}.af-widget__callbar-button:focus-visible,.af-widget__call:focus-visible{outline:2px solid #fff;outline-offset:2px}.af-widget__call--start:focus-visible{outline-color:var(--af-widget-fg)}@keyframes af-widget-chrome-in{0%{opacity:0}to{opacity:1}}.af-widget--framed.af-widget--expanded .af-widget__frame{box-shadow:0 0 0 1px color-mix(in srgb,var(--af-widget-fg) 8%,transparent),inset 0 1px color-mix(in srgb,#fff 60%,transparent),0 1px 2px #0000000d,0 10px 22px -8px #00000038}@media(prefers-reduced-motion:reduce){.af-widget,.af-widget__frame,.af-widget__stage,.af-widget__launcher,.af-widget__callbar-button,.af-widget__call{transition:none}.af-widget__chrome,.af-widget__settle,.af-widget__status-dot,.af-widget__status-dot:after,.af-widget--bouncing .af-widget__frame{animation:none}.af-widget--bouncing .af-widget__frame{will-change:auto}.af-widget--collapsed .af-widget__frame:hover .af-widget__launcher{transform:none}.af-widget__ring{animation:af-widget-ring-fade 2s ease-in-out infinite}}@keyframes af-widget-ring-fade{0%,to{opacity:.5}50%{opacity:1}}
44
+ `);var jT=ue(Be()),kD="afx-embed",OD="afx-root",ID=()=>{let t=document.getElementById(kD)?.textContent,e=document.getElementById(OD);if(!t||!e){console.error("[avatarfactory] runtime page is missing its embed props");return}let n=JSON.parse(t);(0, WT.createRoot)(e).render((0, jT.jsx)(GT,{...n}));};ID();
45
+ /*! Bundled license information:
46
+
47
+ scheduler/cjs/scheduler.production.js:
48
+ (**
49
+ * @license React
50
+ * scheduler.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ *)
57
+
58
+ react/cjs/react.production.js:
59
+ (**
60
+ * @license React
61
+ * react.production.js
62
+ *
63
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
64
+ *
65
+ * This source code is licensed under the MIT license found in the
66
+ * LICENSE file in the root directory of this source tree.
67
+ *)
68
+
69
+ react-dom/cjs/react-dom.production.js:
70
+ (**
71
+ * @license React
72
+ * react-dom.production.js
73
+ *
74
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
75
+ *
76
+ * This source code is licensed under the MIT license found in the
77
+ * LICENSE file in the root directory of this source tree.
78
+ *)
79
+
80
+ react-dom/cjs/react-dom-client.production.js:
81
+ (**
82
+ * @license React
83
+ * react-dom-client.production.js
84
+ *
85
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
86
+ *
87
+ * This source code is licensed under the MIT license found in the
88
+ * LICENSE file in the root directory of this source tree.
89
+ *)
90
+
91
+ react/cjs/react-jsx-runtime.production.js:
92
+ (**
93
+ * @license React
94
+ * react-jsx-runtime.production.js
95
+ *
96
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
97
+ *
98
+ * This source code is licensed under the MIT license found in the
99
+ * LICENSE file in the root directory of this source tree.
100
+ *)
101
+ */})();