PageSourceSearch

https://the-agent.timo-reymann.de/component.js?v=2026-07-07_2106

js timo-reymann.de collected 2026-10-04 07:54:26 UTC 718,559 bytes, 1,249 lines download raw bytes

vendor: 5,331 bytes, lines 1-17
1var TE=Object.defineProperty,Hy=t=>{throw TypeError(t)},wE=(t,e,n)=>e in t?TE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,U=(t,e,n)=>wE(t,typeof e!="symbol"?e+"":e,n),qy=(t,e,n)=>e.has(t)||Hy("Cannot "+n),jl=(t,e,n)=>(qy(t,e,"read from private field"),n?n.call(t):e.get(t)),Bl=(t,e,n)=>e.has(t)?Hy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Pl=(t,e,n,i)=>(qy(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),Ll,Vy,Ul,Hl,ql,$y,Fy;function CE(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in t)){const o=Object.getOwnPropertyDescriptor(i,a);o&&Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function qa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pf={exports:{}},Va={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Yy;function EE(){if(Yy)return Va;Yy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,a,o){var u=null;if(o!==void 0&&(u=""+o),a.key!==void 0&&(u=""+a.key),"key"in a){o={};for(var d in a)d!=="key"&&(o[d]=a[d])}else o=a;return a=o.ref,{$$typeof:t,type:i,key:u,ref:a!==void 0?a:null,props:o}}return Va.Fragment=e,Va.jsx=n,Va.jsxs=n,Va}var Gy;function AE(){return Gy||(Gy=1,pf.exports=EE()),pf.exports}var T=AE(),mf={exports:{}},we={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var Qy;function RE(){if(Qy)return we;Qy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function b(j){return j===null||typeof j!="object"?null:(j=y&&j[y]||j["@@iterator"],typeof j=="function"?j:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function C(j,ne,M){this.props=j,this.context=ne,this.refs=w,this.updater=M||S}C.prototype.isReactComponent={},C.prototype.setState=function(j,ne){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,ne,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function A(){}A.prototype=C.prototype;function R(j,ne,M){this.props=j,this.context=ne,this.refs=w,this.updater=M||S}var D=R.prototype=new A;D.constructor=R,_(D,C.prototype),D.isPureReactComponent=!0;var N=Array.isArray;function I(){}var z={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function X(j,ne,M){var de=M.ref;return{$$typeof:t,type:j,key:ne,ref:de!==void 0?de:null,props:M}}function V(j,ne){return X(j.type,ne,j.props)}function $(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function L(j){var ne={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(M){return ne[M]})}var Q=/\/+/g;function ee(j,ne){return typeof j=="object"&&j!==null&&j.key!=null?L(""+j.key):ne.toString(36)}function J(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(I,I):(j.status="pending",j.then(function(ne){j.status==="pending"&&(j.status="fulfilled",j.value=ne)},function(ne){j.status==="pending"&&(j.status="rejected",j.reason=ne)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function P(j,ne,M,de,me){var ge=typeof j;(ge==="undefined"||ge==="boolean")&&(j=null);var Re=!1;if(j===null)Re=!0;else switch(ge){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(j.$$typeof){case t:case e:Re=!0;break;case m:return Re=j._init,P(Re(j._payload),ne,M,de,me)}}if(Re)return me=me(j),Re=de===""?"."+ee(j,0):de,N(me)?(M="",Re!=null&&(M=Re.replace(Q,"$&/")+"/"),P(me,ne,M,"",function(Dt){return Dt})):me!=null&&($(me)&&(me=V(me,M+(me.key==null||j&&j.key===me.key?"":(""+me.key).replace(Q,"$&/")+"/")+Re)),ne.push(me)),1;Re=0;var Ge=de===""?".":de+":";if(N(j))for(var qe=0;qe<j.length;qe++)de=j[qe],ge=Ge+ee(de,qe),Re+=P(de,ne,M,ge,me);else if(qe=b(j),typeof qe=="function")for(j=qe.call(j),qe=0;!(de=j.next()).done;)de=de.value,ge=Ge+ee(de,qe++),Re+=P(de,ne,M,ge,me);else if(ge==="object"){if(typeof j.then=="function")return P(J(j),ne,M,de,me);throw ne=String(j),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Re}
vendor: 4,418 bytes, line 17
17function te(j,ne,M){if(j==null)return j;var de=[],me=0;return P(j,de,"","",function(ge){return ne.call(M,ge,me++)}),de}function G(j){if(j._status===-1){var ne=j._result;ne=ne(),ne.then(function(M){(j._status===0||j._status===-1)&&(j._status=1,j._result=M)},function(M){(j._status===0||j._status===-1)&&(j._status=2,j._result=M)}),j._status===-1&&(j._status=0,j._result=ne)}if(j._status===1)return j._result.default;throw j._result}var le=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},k={map:te,forEach:function(j,ne,M){te(j,function(){ne.apply(this,arguments)},M)},count:function(j){var ne=0;return te(j,function(){ne++}),ne},toArray:function(j){return te(j,function(ne){return ne})||[]},only:function(j){if(!$(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return we.Activity=v,we.Children=k,we.Component=C,we.Fragment=n,we.Profiler=a,we.PureComponent=R,we.StrictMode=i,we.Suspense=f,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,we.__COMPILER_RUNTIME={__proto__:null,c:function(j){return z.H.useMemoCache(j)}},we.cache=function(j){return function(){return j.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(j,ne,M){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var de=_({},j.props),me=j.key;if(ne!=null)for(ge in ne.key!==void 0&&(me=""+ne.key),ne)!q.call(ne,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&ne.ref===void 0||(de[ge]=ne[ge]);var ge=arguments.length-2;if(ge===1)de.children=M;else if(1<ge){for(var Re=Array(ge),Ge=0;Ge<ge;Ge++)Re[Ge]=arguments[Ge+2];de.children=Re}return X(j.type,me,de)},we.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:o,_context:j},j},we.createElement=function(j,ne,M){var de,me={},ge=null;if(ne!=null)for(de in ne.key!==void 0&&(ge=""+ne.key),ne)q.call(ne,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(me[de]=ne[de]);var Re=arguments.length-2;if(Re===1)me.children=M;else if(1<Re){for(var Ge=Array(Re),qe=0;qe<Re;qe++)Ge[qe]=arguments[qe+2];me.children=Ge}if(j&&j.defaultProps)for(de in Re=j.defaultProps,Re)me[de]===void 0&&(me[de]=Re[de]);return X(j,ge,me)},we.createRef=function(){return{current:null}},we.forwardRef=function(j){return{$$typeof:d,render:j}},we.isValidElement=$,we.lazy=function(j){return{$$typeof:m,_payload:{_status:-1,_result:j},_init:G}},we.memo=function(j,ne){return{$$typeof:h,type:j,compare:ne===void 0?null:ne}},we.startTransition=function(j){var ne=z.T,M={};z.T=M;try{var de=j(),me=z.S;me!==null&&me(M,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(I,le)}catch(ge){le(ge)}finally{ne!==null&&M.types!==null&&(ne.types=M.types),z.T=ne}},we.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},we.use=function(j){return z.H.use(j)},we.useActionState=function(j,ne,M){return z.H.useActionState(j,ne,M)},we.useCallback=function(j,ne){return z.H.useCallback(j,ne)},we.useContext=function(j){return z.H.useContext(j)},we.useDebugValue=function(){},we.useDeferredValue=function(j,ne){return z.H.useDeferredValue(j,ne)},we.useEffect=function(j,ne){return z.H.useEffect(j,ne)},we.useEffectEvent=function(j){return z.H.useEffectEvent(j)},we.useId=function(){return z.H.useId()},we.useImperativeHandle=function(j,ne,M){return z.H.useImperativeHandle(j,ne,M)},we.useInsertionEffect=function(j,ne){return z.H.useInsertionEffect(j,ne)},we.useLayoutEffect=function(j,ne){return z.H.useLayoutEffect(j,ne)},we.useMemo=function(j,ne){return z.H.useMemo(j,ne)},we.useOptimistic=function(j,ne){return z.H.useOptimistic(j,ne)},we.useReducer=function(j,ne,M){return z.H.useReducer(j,ne,M)},we.useRef=function(j){return z.H.useRef(j)},we.useState=function(j){return z.H.useState(j)},we.useSyncExternalStore=function(j,ne,M){return z.H.useSyncExternalStore(j,ne,M)},we.useTransition=function(){return z.H.useTransition()},we.version="19.2.8",we}var Xy;
vendor: 4,102 bytes, lines 17-25
17function gf(){return Xy||(Xy=1,mf.exports=RE()),mf.exports}var O=gf();const bt=qa(O),$a=CE({__proto__:null,default:bt},[O]);var vf={exports:{}},Fa={},yf={exports:{}},bf={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var Ky;function ME(){return Ky||(Ky=1,(function(t){function e(P,te){var G=P.length;P.push(te);e:for(;0<G;){var le=G-1>>>1,k=P[le];if(0<a(k,te))P[le]=te,P[G]=k,G=le;else break e}}function n(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var te=P[0],G=P.pop();if(G!==te){P[0]=G;e:for(var le=0,k=P.length,j=k>>>1;le<j;){var ne=2*(le+1)-1,M=P[ne],de=ne+1,me=P[de];if(0>a(M,G))de<k&&0>a(me,M)?(P[le]=me,P[de]=G,le=de):(P[le]=M,P[ne]=G,le=ne);else if(de<k&&0>a(me,G))P[le]=me,P[de]=G,le=de;else break e}}return te}function a(P,te){var G=P.sortIndex-te.sortIndex;return G!==0?G:P.id-te.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var f=[],h=[],m=1,v=null,y=3,b=!1,S=!1,_=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(P){for(var te=n(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=P)i(h),te.sortIndex=te.expirationTime,e(f,te);else break;te=n(h)}}function N(P){if(_=!1,D(P),!S)if(n(f)!==null)S=!0,I||(I=!0,L());else{var te=n(h);te!==null&&J(N,te.startTime-P)}}var I=!1,z=-1,q=5,X=-1;function V(){return w?!0:!(t.unstable_now()-X<q)}function $(){if(w=!1,I){var P=t.unstable_now();X=P;var te=!0;try{e:{S=!1,_&&(_=!1,A(z),z=-1),b=!0;var G=y;try{t:{for(D(P),v=n(f);v!==null&&!(v.expirationTime>P&&V());){var le=v.callback;if(typeof le=="function"){v.callback=null,y=v.priorityLevel;var k=le(v.expirationTime<=P);if(P=t.unstable_now(),typeof k=="function"){v.callback=k,D(P),te=!0;break t}v===n(f)&&i(f),D(P)}else i(f);v=n(f)}if(v!==null)te=!0;else{var j=n(h);j!==null&&J(N,j.startTime-P),te=!1}}break e}finally{v=null,y=G,b=!1}te=void 0}}finally{te?L():I=!1}}}var L;if(typeof R=="function")L=function(){R($)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ee=Q.port2;Q.port1.onmessage=$,L=function(){ee.postMessage(null)}}else L=function(){C($,0)};function J(P,te){z=C(function(){P(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(P){switch(y){case 1:case 2:case 3:var te=3;break;default:te=y}var G=y;y=te;try{return P()}finally{y=G}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(P,te){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var G=y;y=P;try{return te()}finally{y=G}},t.unstable_scheduleCallback=function(P,te,G){var le=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?le+G:le):G=le,P){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=G+k,P={id:m++,callback:te,priorityLevel:P,startTime:G,expirationTime:k,sortIndex:-1},G>le?(P.sortIndex=G,e(h,P),n(f)===null&&P===n(h)&&(_?(A(z),z=-1):_=!0,J(N,G-le))):(P.sortIndex=k,e(f,P),S||b||(S=!0,I||(I=!0,L()))),P},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(P){var te=y;return function(){var G=y;y=te;try{return P.apply(this,arguments)}finally{y=G}}}})(bf)),bf}var Zy;function kE(){return Zy||(Zy=1,yf.exports=ME()),yf.exports}var xf={exports:{}},Et={};
vendor: 5,129 bytes, lines 25-41
25/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var Jy;function IE(){if(Jy)return Et;Jy=1;var t=gf();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,h,m){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:v==null?null:""+v,children:f,containerInfo:h,implementation:m}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Et.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return o(f,h,null,m)},Et.flushSync=function(f){var h=u.T,m=i.p;try{if(u.T=null,i.p=2,f)return f()}finally{u.T=h,i.p=m,i.d.f()}},Et.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},Et.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Et.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,v=d(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:b}):m==="script"&&i.d.X(f,{crossOrigin:v,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Et.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},Et.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,v=d(m,h.crossOrigin);i.d.L(f,m,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Et.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},Et.requestFormReset=function(f){i.d.r(f)},Et.unstable_batchedUpdates=function(f,h){return f(h)},Et.useFormState=function(f,h,m){return u.H.useFormState(f,h,m)},Et.useFormStatus=function(){return u.H.useHostTransitionStatus()},Et.version="19.2.8",Et}var Wy;function e0(){if(Wy)return xf.exports;Wy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),xf.exports=IE(),xf.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var t0;function OE(){if(t0)return Fa;t0=1;var t=kE(),e=gf(),n=e0();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var s=r,l=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(l=s.return),r=s.return;while(r)}return s.tag===3?l:null}function u(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(o(r)!==r)throw Error(i(188))}function h(r){var s=r.alternate;
vendor: 10,411 bytes, lines 41-48
41if(!s){if(s=o(r),s===null)throw Error(i(188));return s!==r?null:r}for(var l=r,c=s;;){var p=l.return;if(p===null)break;var g=p.alternate;if(g===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===l)return f(p),r;if(g===c)return f(p),s;g=g.sibling}throw Error(i(188))}if(l.return!==c.return)l=p,c=g;else{for(var x=!1,E=p.child;E;){if(E===l){x=!0,l=p,c=g;break}if(E===c){x=!0,c=p,l=g;break}E=E.sibling}if(!x){for(E=g.child;E;){if(E===l){x=!0,l=g,c=p;break}if(E===c){x=!0,c=g,l=p;break}E=E.sibling}if(!x)throw Error(i(189))}}if(l.alternate!==c)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?r:s}function m(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=m(r),s!==null)return s;r=r.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function L(r){return r===null||typeof r!="object"?null:(r=$&&r[$]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function ee(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case _:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case R:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case D:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case z:return s=r.displayName||null,s!==null?s:ee(r.type)||"Memo";case q:s=r._payload,r=r._init;try{return ee(r(s))}catch{}}return null}var J=Array.isArray,P=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},le=[],k=-1;function j(r){return{current:r}}function ne(r){0>k||(r.current=le[k],le[k]=null,k--)}function M(r,s){k++,le[k]=r.current,r.current=s}var de=j(null),me=j(null),ge=j(null),Re=j(null);function Ge(r,s){switch(M(ge,s),M(me,r),M(de,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?cy(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=cy(s),r=dy(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}ne(de),M(de,r)}function qe(){ne(de),ne(me),ne(ge)}function Dt(r){r.memoizedState!==null&&M(Re,r);var s=de.current,l=dy(s,r.type);s!==l&&(M(me,r),M(de,l))}function Cn(r){me.current===r&&(ne(de),ne(me)),Re.current===r&&(ne(Re),Pa._currentValue=G)}var ai,Ui;function Gt(r){if(ai===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);ai=s&&s[1]||"",Ui=-1<l.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+ai+r+Ui}var Wn=!1;function Tr(r,s){if(!r||Wn)return"";Wn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(re){var W=re}Reflect.construct(r,[],oe)}else{try{oe.call()}catch(re){W=re}r.call(oe.prototype)}}else{try{throw Error()}catch(re){W=re}(oe=r())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(re){if(re&&W&&typeof re.stack=="string")return[re.stack,W.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),x=g[0],E=g[1];if(x&&E){var B=x.split(`
44`),Z=E.split(`
45`);for(p=c=0;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;for(;p<Z.length&&!Z[p].includes("DetermineComponentFrameRoot");)p++;if(c===B.length||p===Z.length)for(c=B.length-1,p=Z.length-1;1<=c&&0<=p&&B[c]!==Z[p];)p--;for(;1<=c&&0<=p;c--,p--)if(B[c]!==Z[p]){if(c!==1||p!==1)do if(c--,p--,0>p||B[c]!==Z[p]){var ie=`
46`+B[c].replace(" at new "," at ");return r.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",r.displayName)),ie}while(1<=c&&0<=p);break}}}finally{Wn=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Gt(l):""}function Hi(r,s){switch(r.tag){case 26:case 27:case 5:return Gt(r.type);case 16:return Gt("Lazy");case 13:return r.child!==s&&s!==null?Gt("Suspense Fallback"):Gt("Suspense");case 19:return Gt("SuspenseList");case 0:case 15:return Tr(r.type,!1);case 11:return Tr(r.type.render,!1);case 1:return Tr(r.type,!0);case 31:return Gt("Activity");default:return""}}function qi(r){try{var s="",l=null;do s+=Hi(r,l),l=r,r=r.return;while(r);return s}catch(c){return`
47Error generating stack: `+c.message+`
48`+c.stack}}var wr=Object.prototype.hasOwnProperty,En=t.unstable_scheduleCallback,Ks=t.unstable_cancelCallback,Ju=t.unstable_shouldYield,Wu=t.unstable_requestPaint,Mt=t.unstable_now,ec=t.unstable_getCurrentPriorityLevel,se=t.unstable_ImmediatePriority,fe=t.unstable_UserBlockingPriority,xe=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,Qt=t.log,er=t.unstable_setDisableYieldValue,kt=null,mt=null;function Nt(r){if(typeof Qt=="function"&&er(r),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(kt,r)}catch{}}var Ze=Math.clz32?Math.clz32:uw,Cr=Math.log,An=Math.LN2;function uw(r){return r>>>=0,r===0?32:31-(Cr(r)/An|0)|0}var xo=256,_o=262144,So=4194304;function oi(r){var s=r&42;if(s!==0)return s;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function To(r,s,l){var c=r.pendingLanes;if(c===0)return 0;var p=0,g=r.suspendedLanes,x=r.pingedLanes;r=r.warmLanes;var E=c&134217727;return E!==0?(c=E&~g,c!==0?p=oi(c):(x&=E,x!==0?p=oi(x):l||(l=E&~r,l!==0&&(p=oi(l))))):(E=c&~g,E!==0?p=oi(E):x!==0?p=oi(x):l||(l=c&~r,l!==0&&(p=oi(l)))),p===0?0:s!==0&&s!==p&&(s&g)===0&&(g=p&-p,l=s&-s,g>=l||g===32&&(l&4194048)!==0)?s:p}function Zs(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function cw(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Fp(){var r=So;return So<<=1,(So&62914560)===0&&(So=4194304),r}function tc(r){for(var s=[],l=0;31>l;l++)s.push(r);return s}function Js(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function dw(r,s,l,c,p,g){var x=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var E=r.entanglements,B=r.expirationTimes,Z=r.hiddenUpdates;for(l=x&~l;0<l;){var ie=31-Ze(l),oe=1<<ie;E[ie]=0,B[ie]=-1;var W=Z[ie];if(W!==null)for(Z[ie]=null,ie=0;ie<W.length;ie++){var re=W[ie];re!==null&&(re.lane&=-536870913)}l&=~oe}c!==0&&Yp(r,c,0),g!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=g&~(x&~s))}function Yp(r,s,l){r.pendingLanes|=s,r.suspendedLanes&=~s;var c=31-Ze(s);r.entangledLanes|=s,r.entanglements[c]=r.entanglements[c]|1073741824|l&261930}function Gp(r,s){var l=r.entangledLanes|=s;for(r=r.entanglements;l;){var c=31-Ze(l),p=1<<c;p&s|r[c]&s&&(r[c]|=s),l&=~p}}function Qp(r,s){var l=s&-s;return l=(l&42)!==0?1:nc(l),(l&(r.suspendedLanes|s))!==0?0:l}function nc(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function rc(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Xp(){var r=te.p;return r!==0?r:(r=window.event,r===void 0?32:Ny(r.type))}function Kp(r,s){var l=te.p;try{return te.p=r,s()}finally{te.p=l}}var Er=Math.random().toString(36).slice(2),xt="__reactFiber$"+Er,zt="__reactProps$"+Er,Vi="__reactContainer$"+Er,ic="__reactEvents$"+Er,fw="__reactListeners$"+Er,hw="__reactHandles$"+Er,Zp="__reactResources$"+Er,Ws="__reactMarker$"+Er;function sc(r){delete r[xt],delete r[zt],delete r[ic],delete r[fw],delete r[hw]}function $i(r){var s=r[xt];if(s)return s;for(var l=r.parentNode;l;){if(s=l[Vi]||l[xt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(r=yy(r);r!==null;){if(l=r[xt])return l;r=yy(r)}return s}r=l,l=r.parentNode}return null}function Fi(r){if(r=r[xt]||r[Vi]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function ea(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function Yi(r){var s=r[Zp];return s||(s=r[Zp]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function vt(r){r[Ws]=!0}var Jp=new Set,Wp={};function li(r,s){Gi(r,s),Gi(r+"Capture",s)}function Gi(r,s){for(Wp[r]=s,r=0;r<s.length;r++)Jp.add(s[r])}var pw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
vendor: 6,764 bytes, line 48
48037D\\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]*$"),em={},tm={};function mw(r){return wr.call(tm,r)?!0:wr.call(em,r)?!1:pw.test(r)?tm[r]=!0:(em[r]=!0,!1)}function wo(r,s,l){if(mw(s))if(l===null)r.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+l)}}function Co(r,s,l){if(l===null)r.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+l)}}function tr(r,s,l,c){if(c===null)r.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(s,l,""+c)}}function on(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function nm(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function gw(r,s,l){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,g=c.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return p.call(this)},set:function(x){l=""+x,g.call(this,x)}}),Object.defineProperty(r,s,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(x){l=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function ac(r){if(!r._valueTracker){var s=nm(r)?"checked":"value";r._valueTracker=gw(r,s,""+r[s])}}function rm(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var l=s.getValue(),c="";return r&&(c=nm(r)?r.checked?"true":"false":r.value),r=c,r!==l?(s.setValue(r),!0):!1}function Eo(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var vw=/[\n"\\]/g;function ln(r){return r.replace(vw,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function oc(r,s,l,c,p,g,x,E){r.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?r.type=x:r.removeAttribute("type"),s!=null?x==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+on(s)):r.value!==""+on(s)&&(r.value=""+on(s)):x!=="submit"&&x!=="reset"||r.removeAttribute("value"),s!=null?lc(r,x,on(s)):l!=null?lc(r,x,on(l)):c!=null&&r.removeAttribute("value"),p==null&&g!=null&&(r.defaultChecked=!!g),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.name=""+on(E):r.removeAttribute("name")}function im(r,s,l,c,p,g,x,E){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(r.type=g),s!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||s!=null)){ac(r);return}l=l!=null?""+on(l):"",s=s!=null?""+on(s):l,E||s===r.value||(r.value=s),r.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=E?r.checked:!!c,r.defaultChecked=!!c,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.name=x),ac(r)}function lc(r,s,l){s==="number"&&Eo(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Qi(r,s,l,c){if(r=r.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=s.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&c&&(r[l].defaultSelected=!0)}else{for(l=""+on(l),s=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}s!==null||r[p].disabled||(s=r[p])}s!==null&&(s.selected=!0)}}function sm(r,s,l){if(s!=null&&(s=""+on(s),s!==r.value&&(r.value=s),l==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=l!=null?""+on(l):""}function am(r,s,l,c){if(s==null){if(c!=null){if(l!=null)throw Error(i(92));if(J(c)){if(1<c.length)throw Error(i(93));c=c[0]}l=c}l==null&&(l=""),s=l}l=on(s),r.defaultValue=l,c=r.textContent,c===l&&c!==""&&c!==null&&(r.value=c),ac(r)}function Xi(r,s){if(s){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=s;return}}r.textContent=s}var yw=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 om(r,s,l){var c=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":c?r.setProperty(s,l):typeof l!="number"||l===0||yw.has(s)?s==="float"?r.cssFloat=l:r[s]=(""+l).trim():r[s]=l+"px"}function lm(r,s,l){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in s)c=s[p],s.hasOwnProperty(p)&&l[p]!==c&&om(r,p,c)}else for(var g in s)s.hasOwnProperty(g)&&om(r,g,s[g])}function uc(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bw=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"],["colorRen
48dering","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"]]),xw=/^[\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 Ao(r){return xw.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function nr(){}var cc=null;function dc(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ki=null,Zi=null;function um(r){var s=Fi(r);if(s&&(r=s.stateNode)){var l=r[zt]||null;e:switch(r=s.stateNode,s.type){case"input":if(oc(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ln(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var c=l[s];if(c!==r&&c.form===r.form){var p=c[zt]||null;if(!p)throw Error(i(90));oc(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)c=l[s],c.form===r.form&&rm(c)}break e;case"textarea":sm(r,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&Qi(r,!!l.multiple,s,!1)}}}var fc=!1;function cm(r,s,l){if(fc)return r(s,l);fc=!0;try{var c=r(s);return c}finally{if(fc=!1,(Ki!==null||Zi!==null)&&(pl(),Ki&&(s=Ki,r=Zi,Zi=Ki=null,um(s),r)))for(s=0;s<r.length;s++)um(r[s])}}function ta(r,s){var l=r.stateNode;if(l===null)return null;var c=l[zt]||null;if(c===null)return null;l=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(i(231,s,typeof l));return l}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=!1;if(rr)try{var na={};Object.defineProperty(na,"passive",{get:function(){hc=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{hc=!1}var Ar=null,pc=null,Ro=null;function dm(){if(Ro)return Ro;var r,s=pc,l=s.length,c,p="value"in Ar?Ar.value:Ar.textContent,g=p.length;for(r=0;r<l&&s[r]===p[r];r++);var x=l-r;for(c=1;c<=x&&s[l-c]===p[g-c];c++);return Ro=p.slice(r,1<c?1-c:void 0)}function Mo(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function ko(){return!0}function fm(){return!1}function jt(r){function s(l,c,p,g,x){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=g,this.target=x,this.currentTarget=null;for(var E in r)r.hasOwnProperty(E)&&(l=r[E],this[E]=l?l(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?ko:fm,this.isPropagationStopped=fm,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ko)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ko)},persist:function(){},isPersistent:ko}),s}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=jt(ui),ra=v({},ui,{view:0,detail:0}),_w=jt(ra),mc,gc,ia,Oo=v({},ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ia&&(ia&&r.type==="mousemove"?(mc=r.screenX-ia.screenX,gc=r.screenY-ia.screenY):gc=mc=0,ia=r),mc)}
vendor: 4,733 bytes, line 48
48,movementY:function(r){return"movementY"in r?r.movementY:gc}}),hm=jt(Oo),Sw=v({},Oo,{dataTransfer:0}),Tw=jt(Sw),ww=v({},ra,{relatedTarget:0}),vc=jt(ww),Cw=v({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),Ew=jt(Cw),Aw=v({},ui,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Rw=jt(Aw),Mw=v({},ui,{data:0}),pm=jt(Mw),kw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iw={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"},Ow={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dw(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=Ow[r])?!!s[r]:!1}function yc(){return Dw}var Nw=v({},ra,{key:function(r){if(r.key){var s=kw[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Mo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Iw[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yc,charCode:function(r){return r.type==="keypress"?Mo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Mo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),zw=jt(Nw),jw=v({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mm=jt(jw),Bw=v({},ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yc}),Pw=jt(Bw),Lw=v({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uw=jt(Lw),Hw=v({},Oo,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),qw=jt(Hw),Vw=v({},ui,{newState:0,oldState:0}),$w=jt(Vw),Fw=[9,13,27,32],bc=rr&&"CompositionEvent"in window,sa=null;rr&&"documentMode"in document&&(sa=document.documentMode);var Yw=rr&&"TextEvent"in window&&!sa,gm=rr&&(!bc||sa&&8<sa&&11>=sa),vm=" ",ym=!1;function bm(r,s){switch(r){case"keyup":return Fw.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ji=!1;function Gw(r,s){switch(r){case"compositionend":return xm(s);case"keypress":return s.which!==32?null:(ym=!0,vm);case"textInput":return r=s.data,r===vm&&ym?null:r;default:return null}}function Qw(r,s){if(Ji)return r==="compositionend"||!bc&&bm(r,s)?(r=dm(),Ro=pc=Ar=null,Ji=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return gm&&s.locale!=="ko"?null:s.data;default:return null}}var Xw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _m(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!Xw[r.type]:s==="textarea"}function Sm(r,s,l,c){Ki?Zi?Zi.push(c):Zi=[c]:Ki=c,s=_l(s,"onChange"),0<s.length&&(l=new Io("onChange","change",null,l,c),r.push({event:l,listeners:s}))}var aa=null,oa=null;function Kw(r){iy(r,0)}function Do(r){var s=ea(r);if(rm(s))return r}function Tm(r,s){if(r==="change")return s}var wm=!1;if(rr){var xc;if(rr){var _c="oninput"in document;if(!_c){var Cm=document.createElement("div");Cm.setAttribute("oninput","return;"),_c=typeof Cm.oninput=="function"}xc=_c}else xc=!1;wm=xc&&(!document.documentMode||9<document.documentMode)}function Em(){aa&&(aa.detachEvent("onpropertychange",Am),oa=aa=null)}function Am(r){if(r.propertyName==="value"&&Do(oa)){var s=[];Sm(s,oa,r,dc(r)),cm(Kw,s)}}function Zw(r,s,l){r==="focusin"?(Em(),aa=s,oa=l,aa.attachEvent("onpropertychange",Am)):r==="focusout"&&Em()}function Jw(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Do(oa)}function Ww(r,s){if(r==="click")return Do(s)}function eC(r,s){if(r==="input"||r==="change")return Do(s)}function tC(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}
vendor: 18,217 bytes, line 48
48var Xt=typeof Object.is=="function"?Object.is:tC;function la(r,s){if(Xt(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var l=Object.keys(r),c=Object.keys(s);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!wr.call(s,p)||!Xt(r[p],s[p]))return!1}return!0}function Rm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Mm(r,s){var l=Rm(r);r=0;for(var c;l;){if(l.nodeType===3){if(c=r+l.textContent.length,r<=s&&c>=s)return{node:l,offset:s-r};r=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rm(l)}}function km(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?km(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Im(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Eo(r.document);s instanceof r.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)r=s.contentWindow;else break;s=Eo(r.document)}return s}function Sc(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var nC=rr&&"documentMode"in document&&11>=document.documentMode,Wi=null,Tc=null,ua=null,wc=!1;function Om(r,s,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;wc||Wi==null||Wi!==Eo(c)||(c=Wi,"selectionStart"in c&&Sc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ua&&la(ua,c)||(ua=c,c=_l(Tc,"onSelect"),0<c.length&&(s=new Io("onSelect","select",null,s,l),r.push({event:s,listeners:c}),s.target=Wi)))}function ci(r,s){var l={};return l[r.toLowerCase()]=s.toLowerCase(),l["Webkit"+r]="webkit"+s,l["Moz"+r]="moz"+s,l}var es={animationend:ci("Animation","AnimationEnd"),animationiteration:ci("Animation","AnimationIteration"),animationstart:ci("Animation","AnimationStart"),transitionrun:ci("Transition","TransitionRun"),transitionstart:ci("Transition","TransitionStart"),transitioncancel:ci("Transition","TransitionCancel"),transitionend:ci("Transition","TransitionEnd")},Cc={},Dm={};rr&&(Dm=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function di(r){if(Cc[r])return Cc[r];if(!es[r])return r;var s=es[r],l;for(l in s)if(s.hasOwnProperty(l)&&l in Dm)return Cc[r]=s[l];return r}var Nm=di("animationend"),zm=di("animationiteration"),jm=di("animationstart"),rC=di("transitionrun"),iC=di("transitionstart"),sC=di("transitioncancel"),Bm=di("transitionend"),Pm=new Map,Ec="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(" ");Ec.push("scrollEnd");function Rn(r,s){Pm.set(r,s),li(s,[r])}var No=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},un=[],ts=0,Ac=0;function zo(){for(var r=ts,s=Ac=ts=0;s<r;){var l=un[s];un[s++]=null;var c=un[s];un[s++]=null;var p=un[s];un[s++]=null;var g=un[s];if(un[s++]=null,c!==null&&p!==null){var x=c.pending;x===null?p.next=p:(p.next=x.next,x.next=p),c.pending=p}g!==0&&Lm(l,p,g)}}function jo(r,s,l,c){un[ts++]=r,un[ts++]=s,un[ts++]=l,un[ts++]=c,Ac|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Rc(r,s,l,c){return jo(r,s,l,c),Bo(r)}function fi(r,s){return jo(r,null,null,s),Bo(r)}function Lm(r,s,l){r.lanes|=l;var c=r.alternate;c!==null&&(c.lanes|=l);for(var p=!1,g=r.return;g!==null;)g.childLanes|=l,c=g.alternate,c!==null&&(c.childLanes|=l),g.tag===22&&(r=g.stateNode,r===null||r._visibility&1||(p=!0)),r=g,g=g.return;return r.tag===3?(g=r.stateNode,p&&s!==null&&(p=31-Ze(l),r=g.hiddenUpdates,c=r[p],c===null?r[p]=[s]:c.push(s),s.lane=l|536870912),g):null}function Bo(r){if(50<Ia)throw Ia=0,Bd=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var ns={};function aC(r,s,l,c){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(r,s,l,c){return new aC(r,s,l,c)}function Mc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ir(r,s){var l=r.alternate;return l===null?(l=Kt(r.tag,s,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=s,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,s=r.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function Um(r,s){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,s=l.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function Po(r,s,l,c,p,g){var x=0;if(c=r,typeof r=="function")Mc(r)&&(x=1);else if(typeof r=="string")x=dE(r,l,de.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Kt(31,l,s,p),r.elementType=X,r.lanes=g,r;case _:return hi(l.children,p,g,s);case w:x=8,p|=24;break;case C:return r=Kt(12,l,s,p|2),r.elementType=C,r.lanes=g,r;case N:return r=Kt(13,l,s,p),r.elementType=N,r.lanes=g,r;case I:return r=Kt(19,l,s,p),r.elementType=I,r.lanes=g,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:x=10;break e;case A:x=9;break e;case D:x=11;break e;case z:x=14;break e;case q:x=16,c=null;break e}x=29,l=Error(i(130,r===null?"null":typeof r,"")),c=null}return s=Kt(x,l,s,p),s.elementType=r,s.type=c,s.lanes=g,s}function hi(r,s,l,c){return r=Kt(7,r,c,s),r.lanes=l,r}function kc(r,s,l){return r=Kt(6,r,null,s),r.lanes=l,r}function Hm(r){var s=Kt(18,null,null,0);return s.stateNode=r,s}function Ic(r,s,l){return s=Kt(4,r.children!==null?r.children:[],r.key,s),s.lanes=l,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var qm=new WeakMap;function cn(r,s){if(typeof r=="object"&&r!==null){var l=qm.get(r);return l!==void 0?l:(s={value:r,source:s,stack:qi(s)},qm.set(r,s),s)}return{value:r,source:s,stack:qi(s)}}var rs=[],is=0,Lo=null,ca=0,dn=[],fn=0,Rr=null,jn=1,Bn="";function sr(r,s){rs[is++]=ca,rs[is++]=Lo,Lo=r,ca=s}function Vm(r,s,l){dn[fn++]=jn,dn[fn++]=Bn,dn[fn++]=Rr,Rr=r;var c=jn;r=Bn;var p=32-Ze(c)-1;c&=~(1<<p),l+=1;var g=32-Ze(s)+p;if(30<g){var x=p-p%5;g=(c&(1<<x)-1).toString(32),c>>=x,p-=x,jn=1<<32-Ze(s)+p|l<<p|c,Bn=g+r}else jn=1<<g|l<<p|c,Bn=r}function Oc(r){r.return!==null&&(sr(r,1),Vm(r,1,0))}function Dc(r){for(;r===Lo;)Lo=rs[--is],rs[is]=null,ca=rs[--is],rs[is]=null;for(;r===Rr;)Rr=dn[--fn],dn[fn]=null,Bn=dn[--fn],dn[fn]=null,jn=dn[--fn],dn[fn]=null}function $m(r,s){dn[fn++]=jn,dn[fn++]=Bn,dn[fn++]=Rr,jn=s.id,Bn=s.overflow,Rr=r}var _t=null,tt=null,Ne=!1,Mr=null,hn=!1,Nc=Error(i(519));function kr(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw da(cn(s,r)),Nc}function Fm(r){var s=r.stateNode,l=r.type,c=r.memoizedProps;switch(s[xt]=r,s[zt]=c,l){case"dialog":Ie("cancel",s),Ie("close",s);break;case"iframe":case"object":case"embed":Ie("load",s);break;case"video":case"audio":for(l=0;l<Da.length;l++)Ie(Da[l],s);break;case"source":Ie("error",s);break;case"img":case"image":case"link":Ie("error",s),Ie("load",s);break;case"details":Ie("toggle",s);break;case"input":Ie("invalid",s),im(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ie("invalid",s);break;case"textarea":Ie("invalid",s),am(s,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||c.suppressHydrationWarning===!0||ly(s.textContent,l)?(c.popover!=null&&(Ie("beforetoggle",s),Ie("toggle",s)),c.onScroll!=null&&Ie("scroll",s),c.onScrollEnd!=null&&Ie("scrollend",s),c.onClick!=null&&(s.onclick=nr),s=!0):s=!1,s||kr(r,!0)}function Ym(r){for(_t=r.return;_t;)switch(_t.tag){case 5:case 31:case 13:hn=!1;return;case 27:case 3:hn=!0;return;default:_t=_t.return}}function ss(r){if(r!==_t)return!1;if(!Ne)return Ym(r),Ne=!0,!1;var s=r.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||Jd(r.type,r.memoizedProps)),l=!l),l&&tt&&kr(r),Ym(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));tt=vy(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));tt=vy(r)}else s===27?(s=tt,$r(r.type)?(r=rf,rf=null,tt=r):tt=s):tt=_t?mn(r.stateNode.nextSibling):null;return!0}function pi(){tt=_t=null,Ne=!1}function zc(){var r=Mr;return r!==null&&(Ut===null?Ut=r:Ut.push.apply(Ut,r),Mr=null),r}function da(r){Mr===null?Mr=[r]:Mr.push(r)}var jc=j(null),mi=null,ar=null;function Ir(r,s,l){M(jc,s._currentValue),s._currentValue=l}function or(r){r._currentValue=jc.current,ne(jc)}function Bc(r,s,l){for(;r!==null;){var c=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),r===l)break;r=r.return}}function Pc(r,s,l,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var g=p.dependencies;if(g!==null){var x=p.child;g=g.firstContext;e:for(;g!==null;){var E=g;g=p;for(var B=0;B<s.length;B++)if(E.context===s[B]){g.lanes|=l,E=g.alternate,E!==null&&(E.lanes|=l),Bc(g.return,l,r),c||(x=null);break e}g=E.next}}else if(p.tag===18){if(x=p.return,x===null)throw Error(i(341));x.lanes|=l,g=x.alternate,g!==null&&(g.lanes|=l),Bc(x,l,r),x=null}else x=p.child;if(x!==null)x.return=p;else for(x=p;x!==null;){if(x===r){x=null;break}if(p=x.sibling,p!==null){p.return=x.return,x=p;break}x=x.return}p=x}}function as(r,s,l,c){r=null;for(var p=s,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var x=p.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var E=p.type;Xt(p.pendingProps.value,x.value)||(r!==null?r.push(E):r=[E])}}else if(p===Re.current){if(x=p.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Pa):r=[Pa])}p=p.return}r!==null&&Pc(s,r,l,c),s.flags|=262144}function Uo(r){for(r=r.firstContext;r!==null;){if(!Xt(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function gi(r){mi=r,ar=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function St(r){return Gm(mi,r)}function Ho(r,s){return mi===null&&gi(r),Gm(r,s)}function Gm(r,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},ar===null){if(r===null)throw Error(i(308));ar=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else ar=ar.next=s;return l}var oC=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(l,c){r.push(c)}};this.abort=function(){s.aborted=!0,r.forEach(function(l){return l()})}},lC=t.unstable_scheduleCallback,uC=t.unstable_NormalPriority,ct={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lc(){return{controller:new oC,data:new Map,refCount:0}}function fa(r){r.refCount--,r.refCount===0&&lC(uC,function(){r.controller.abort()})}var ha=null,Uc=0,os=0,ls=null;function cC(r,s){if(ha===null){var l=ha=[];Uc=0,os=Vd(),ls={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Uc++,s.then(Qm,Qm),s}function Qm(){if(--Uc===0&&ha!==null){ls!==null&&(ls.status="fulfilled");var r=ha;ha=null,os=0,ls=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function dC(r,s){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){c.status="fulfilled",c.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var Xm=P.S;P.S=function(r,s){Ov=Mt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&cC(r,s),Xm!==null&&Xm(r,s)};var vi=j(null);function Hc(){var r=vi.current;return r!==null?r:Je.pooledCache}function qo(r,s){s===null?M(vi,vi.current):M(vi,s.pool)}function Km(){var r=Hc();return r===null?null:{parent:ct._currentValue,pool:r}}var us=Error(i(460)),qc=Error(i(474)),Vo=Error(i(542)),$o={then:function(){}};function Zm(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Jm(r,s,l){switch(l=r[l],l===void 0?r.push(s):l!==s&&(s.then(nr,nr),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,eg(r),r;default:if(typeof s.status=="string")s.then(nr,nr);else{if(r=Je,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(c){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=c}},function(c){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,eg(r),r}throw bi=s,us}}function yi(r){try{var s=r._init;return s(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(bi=l,us):l}}var bi=null;function Wm(){if(bi===null)throw Error(i(459));var r=bi;return bi=null,r}function eg(r){if(r===us||r===Vo)throw Error(i(483))}var cs=null,pa=0;function Fo(r){var s=pa;return pa+=1,cs===null&&(cs=[]),Jm(cs,r,s)}function ma(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Yo(r,s){throw s.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function tg(r){function s(F,H){if(r){var K=F.deletions;K===null?(F.deletions=[H],F.flags|=16):K.push(H)}}function l(F,H){if(!r)return null;for(;H!==null;)s(F,H),H=H.sibling;return null}function c(F){for(var H=new Map;F!==null;)F.key!==null?H.set(F.key,F):H.set(F.index,F),F=F.sibling;return H}function p(F,H){return F=ir(F,H),F.index=0,F.sibling=null,F}function g(F,H,K){return F.index=K,r?(K=F.alternate,K!==null?(K=K.index,K<H?(F.flags|=67108866,H):K):(F.flags|=67108866,H)):(F.flags|=1048576,H)}function x(F){return r&&F.alternate===null&&(F.flags|=67108866),F}function E(F,H,K,ae){return H===null||H.tag!==6?(H=kc(K,F.mode,ae),H.return=F,H):(H=p(H,K),H.return=F,H)}function B(F,H,K,ae){var ve=K.type;return ve===_?ie(F,H,K.props.children,ae,K.key):H!==null&&(H.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===q&&yi(ve)===H.type)?(H=p(H,K.props),ma(H,K),H.return=F,H):(H=Po(K.type,K.key,K.props,null,F.mode,ae),ma(H,K),H.return=F,H)}function Z(F,H,K,ae){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=Ic(K,F.mode,ae),H.return=F,H):(H=p(H,K.children||[]),H.return=F,H)}function ie(F,H,K,ae,ve){return H===null||H.tag!==7?(H=hi(K,F.mode,ae,ve),H.return=F,H):(H=p(H,K),H.return=F,H)}function oe(F,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=kc(""+H,F.mode,K),H.return=F,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return K=Po(H.type,H.key,H.props,null,F.mode,K),ma(K,H),K.return=F,K;case S:return H=Ic(H,F.mode,K),H.return=F,H;case q:return H=yi(H),oe(F,H,K)}if(J(H)||L(H))return H=hi(H,F.mode,K,null),H.return=F,H;if(typeof H.then=="function")return oe(F,Fo(H),K);if(H.$$typeof===R)return oe(F,Ho(F,H),K);Yo(F,H)}return null}function W(F,H,K,ae){var ve=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ve!==null?null:E(F,H,""+K,ae);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return K.key===ve?B(F,H,K,ae):null;case S:return K.key===ve?Z(F,H,K,ae):null;case q:return K=yi(K),W(F,H,K,ae)}if(J(K)||L(K))return ve!==null?null:ie(F,H,K,ae,null);if(typeof K.then=="function")return W(F,H,Fo(K),ae);if(K.$$typeof===R)return W(F,H,Ho(F,K),ae);Yo(F,K)}return null}function re(F,H,K,ae,ve){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return F=F.get(K)||null,E(H,F,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return F=F.get(ae.key===null?K:ae.key)||null,B(H,F,ae,ve);case S:return F=F.get(ae.key===null?K:ae.key)||null,Z(H,F,ae,ve);case q:return ae=yi(ae),re(F,H,K,ae,ve)}if(J(ae)||L(ae))return F=F.get(K)||null,ie(H,F,ae,ve,null);if(typeof ae.then=="function")return re(F,H,K,Fo(ae),ve);if(ae.$$typeof===R)return re(F,H,K,Ho(H,ae),ve);Yo(H,ae)}return null}function he(F,H,K,ae){for(var ve=null,je=null,pe=H,Ae=H=0,De=null;pe!==null&&Ae<K.length;Ae++){pe.index>Ae?(De=pe,pe=null):De=pe.sibling;
vendor: 4,211 bytes, line 48
48var Be=W(F,pe,K[Ae],ae);if(Be===null){pe===null&&(pe=De);break}r&&pe&&Be.alternate===null&&s(F,pe),H=g(Be,H,Ae),je===null?ve=Be:je.sibling=Be,je=Be,pe=De}if(Ae===K.length)return l(F,pe),Ne&&sr(F,Ae),ve;if(pe===null){for(;Ae<K.length;Ae++)pe=oe(F,K[Ae],ae),pe!==null&&(H=g(pe,H,Ae),je===null?ve=pe:je.sibling=pe,je=pe);return Ne&&sr(F,Ae),ve}for(pe=c(pe);Ae<K.length;Ae++)De=re(pe,F,Ae,K[Ae],ae),De!==null&&(r&&De.alternate!==null&&pe.delete(De.key===null?Ae:De.key),H=g(De,H,Ae),je===null?ve=De:je.sibling=De,je=De);return r&&pe.forEach(function(Xr){return s(F,Xr)}),Ne&&sr(F,Ae),ve}function be(F,H,K,ae){if(K==null)throw Error(i(151));for(var ve=null,je=null,pe=H,Ae=H=0,De=null,Be=K.next();pe!==null&&!Be.done;Ae++,Be=K.next()){pe.index>Ae?(De=pe,pe=null):De=pe.sibling;var Xr=W(F,pe,Be.value,ae);if(Xr===null){pe===null&&(pe=De);break}r&&pe&&Xr.alternate===null&&s(F,pe),H=g(Xr,H,Ae),je===null?ve=Xr:je.sibling=Xr,je=Xr,pe=De}if(Be.done)return l(F,pe),Ne&&sr(F,Ae),ve;if(pe===null){for(;!Be.done;Ae++,Be=K.next())Be=oe(F,Be.value,ae),Be!==null&&(H=g(Be,H,Ae),je===null?ve=Be:je.sibling=Be,je=Be);return Ne&&sr(F,Ae),ve}for(pe=c(pe);!Be.done;Ae++,Be=K.next())Be=re(pe,F,Ae,Be.value,ae),Be!==null&&(r&&Be.alternate!==null&&pe.delete(Be.key===null?Ae:Be.key),H=g(Be,H,Ae),je===null?ve=Be:je.sibling=Be,je=Be);return r&&pe.forEach(function(SE){return s(F,SE)}),Ne&&sr(F,Ae),ve}function Ke(F,H,K,ae){if(typeof K=="object"&&K!==null&&K.type===_&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case b:e:{for(var ve=K.key;H!==null;){if(H.key===ve){if(ve=K.type,ve===_){if(H.tag===7){l(F,H.sibling),ae=p(H,K.props.children),ae.return=F,F=ae;break e}}else if(H.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===q&&yi(ve)===H.type){l(F,H.sibling),ae=p(H,K.props),ma(ae,K),ae.return=F,F=ae;break e}l(F,H);break}else s(F,H);H=H.sibling}K.type===_?(ae=hi(K.props.children,F.mode,ae,K.key),ae.return=F,F=ae):(ae=Po(K.type,K.key,K.props,null,F.mode,ae),ma(ae,K),ae.return=F,F=ae)}return x(F);case S:e:{for(ve=K.key;H!==null;){if(H.key===ve)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){l(F,H.sibling),ae=p(H,K.children||[]),ae.return=F,F=ae;break e}else{l(F,H);break}else s(F,H);H=H.sibling}ae=Ic(K,F.mode,ae),ae.return=F,F=ae}return x(F);case q:return K=yi(K),Ke(F,H,K,ae)}if(J(K))return he(F,H,K,ae);if(L(K)){if(ve=L(K),typeof ve!="function")throw Error(i(150));return K=ve.call(K),be(F,H,K,ae)}if(typeof K.then=="function")return Ke(F,H,Fo(K),ae);if(K.$$typeof===R)return Ke(F,H,Ho(F,K),ae);Yo(F,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(l(F,H.sibling),ae=p(H,K),ae.return=F,F=ae):(l(F,H),ae=kc(K,F.mode,ae),ae.return=F,F=ae),x(F)):l(F,H)}return function(F,H,K,ae){try{pa=0;var ve=Ke(F,H,K,ae);return cs=null,ve}catch(pe){if(pe===us||pe===Vo)throw pe;var je=Kt(29,pe,null,F.mode);return je.lanes=ae,je.return=F,je}}}var xi=tg(!0),ng=tg(!1),Or=!1;function Vc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Dr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Nr(r,s,l){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(Le&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,s=Bo(r),Lm(r,null,l),s}return jo(r,c,s,l),Bo(r)}function ga(r,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var c=s.lanes;c&=r.pendingLanes,l|=c,s.lanes=l,Gp(r,l)}}function Fc(r,s){var l=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var x={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?p=g=x:g=g.next=x,l=l.next}while(l!==null);g===null?p=g=s:g=g.next=s}else p=g=s;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},r.updateQueue=l;return}
vendor: 4,240 bytes, line 48
48r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=s:r.next=s,l.lastBaseUpdate=s}var Yc=!1;function va(){if(Yc){var r=ls;if(r!==null)throw r}}function ya(r,s,l,c){Yc=!1;var p=r.updateQueue;Or=!1;var g=p.firstBaseUpdate,x=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var B=E,Z=B.next;B.next=null,x===null?g=Z:x.next=Z,x=B;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,E=ie.lastBaseUpdate,E!==x&&(E===null?ie.firstBaseUpdate=Z:E.next=Z,ie.lastBaseUpdate=B))}if(g!==null){var oe=p.baseState;x=0,ie=Z=B=null,E=g;do{var W=E.lane&-536870913,re=W!==E.lane;if(re?(Oe&W)===W:(c&W)===W){W!==0&&W===os&&(Yc=!0),ie!==null&&(ie=ie.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var he=r,be=E;W=s;var Ke=l;switch(be.tag){case 1:if(he=be.payload,typeof he=="function"){oe=he.call(Ke,oe,W);break e}oe=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=be.payload,W=typeof he=="function"?he.call(Ke,oe,W):he,W==null)break e;oe=v({},oe,W);break e;case 2:Or=!0}}W=E.callback,W!==null&&(r.flags|=64,re&&(r.flags|=8192),re=p.callbacks,re===null?p.callbacks=[W]:re.push(W))}else re={lane:W,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ie===null?(Z=ie=re,B=oe):ie=ie.next=re,x|=W;if(E=E.next,E===null){if(E=p.shared.pending,E===null)break;re=E,E=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);ie===null&&(B=oe),p.baseState=B,p.firstBaseUpdate=Z,p.lastBaseUpdate=ie,g===null&&(p.shared.lanes=0),Lr|=x,r.lanes=x,r.memoizedState=oe}}function rg(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function ig(r,s){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)rg(l[r],s)}var ds=j(null),Go=j(0);function sg(r,s){r=gr,M(Go,r),M(ds,s),gr=r|s.baseLanes}function Gc(){M(Go,gr),M(ds,ds.current)}function Qc(){gr=Go.current,ne(ds),ne(Go)}var Zt=j(null),pn=null;function zr(r){var s=r.alternate;M(lt,lt.current&1),M(Zt,r),pn===null&&(s===null||ds.current!==null||s.memoizedState!==null)&&(pn=r)}function Xc(r){M(lt,lt.current),M(Zt,r),pn===null&&(pn=r)}function ag(r){r.tag===22?(M(lt,lt.current),M(Zt,r),pn===null&&(pn=r)):jr()}function jr(){M(lt,lt.current),M(Zt,Zt.current)}function Jt(r){ne(Zt),pn===r&&(pn=null),ne(lt)}var lt=j(0);function Qo(r){for(var s=r;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||tf(l)||nf(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var lr=0,Ee=null,Qe=null,dt=null,Xo=!1,fs=!1,_i=!1,Ko=0,ba=0,hs=null,fC=0;function at(){throw Error(i(321))}function Kc(r,s){if(s===null)return!1;for(var l=0;l<s.length&&l<r.length;l++)if(!Xt(r[l],s[l]))return!1;return!0}function Zc(r,s,l,c,p,g){return lr=g,Ee=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,P.H=r===null||r.memoizedState===null?Vg:fd,_i=!1,g=l(c,p),_i=!1,fs&&(g=lg(s,l,c,p)),og(r),g}function og(r){P.H=Sa;var s=Qe!==null&&Qe.next!==null;if(lr=0,dt=Qe=Ee=null,Xo=!1,ba=0,hs=null,s)throw Error(i(300));r===null||ft||(r=r.dependencies,r!==null&&Uo(r)&&(ft=!0))}function lg(r,s,l,c){Ee=r;var p=0;do{if(fs&&(hs=null),ba=0,fs=!1,25<=p)throw Error(i(301));if(p+=1,dt=Qe=null,r.updateQueue!=null){var g=r.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}P.H=$g,g=s(l,c)}while(fs);return g}function hC(){var r=P.H,s=r.useState()[0];return s=typeof s.then=="function"?xa(s):s,r=r.useState()[0],(Qe!==null?Qe.memoizedState:null)!==r&&(Ee.flags|=1024),s}function Jc(){var r=Ko!==0;return Ko=0,r}function Wc(r,s,l){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~l}function ed(r){if(Xo){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Xo=!1}lr=0,dt=Qe=Ee=null,fs=!1,ba=Ko=0,hs=null}function It(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Ee.memoizedState=dt=r:dt=dt.next=r,dt}
vendor: 8,472 bytes, line 48
48function ut(){if(Qe===null){var r=Ee.alternate;r=r!==null?r.memoizedState:null}else r=Qe.next;var s=dt===null?Ee.memoizedState:dt.next;if(s!==null)dt=s,Qe=r;else{if(r===null)throw Ee.alternate===null?Error(i(467)):Error(i(310));Qe=r,r={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},dt===null?Ee.memoizedState=dt=r:dt=dt.next=r}return dt}function Zo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xa(r){var s=ba;return ba+=1,hs===null&&(hs=[]),r=Jm(hs,r,s),s=Ee,(dt===null?s.memoizedState:dt.next)===null&&(s=s.alternate,P.H=s===null||s.memoizedState===null?Vg:fd),r}function Jo(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return xa(r);if(r.$$typeof===R)return St(r)}throw Error(i(438,String(r)))}function td(r){var s=null,l=Ee.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var c=Ee.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Zo(),Ee.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(r),c=0;c<r;c++)l[c]=V;return s.index++,l}function ur(r,s){return typeof s=="function"?s(r):s}function Wo(r){var s=ut();return nd(s,Qe,r)}function nd(r,s,l){var c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=l;var p=r.baseQueue,g=c.pending;if(g!==null){if(p!==null){var x=p.next;p.next=g.next,g.next=x}s.baseQueue=p=g,c.pending=null}if(g=r.baseState,p===null)r.memoizedState=g;else{s=p.next;var E=x=null,B=null,Z=s,ie=!1;do{var oe=Z.lane&-536870913;if(oe!==Z.lane?(Oe&oe)===oe:(lr&oe)===oe){var W=Z.revertLane;if(W===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),oe===os&&(ie=!0);else if((lr&W)===W){Z=Z.next,W===os&&(ie=!0);continue}else oe={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(E=B=oe,x=g):B=B.next=oe,Ee.lanes|=W,Lr|=W;oe=Z.action,_i&&l(g,oe),g=Z.hasEagerState?Z.eagerState:l(g,oe)}else W={lane:oe,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(E=B=W,x=g):B=B.next=W,Ee.lanes|=oe,Lr|=oe;Z=Z.next}while(Z!==null&&Z!==s);if(B===null?x=g:B.next=E,!Xt(g,r.memoizedState)&&(ft=!0,ie&&(l=ls,l!==null)))throw l;r.memoizedState=g,r.baseState=x,r.baseQueue=B,c.lastRenderedState=g}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function rd(r){var s=ut(),l=s.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=r;var c=l.dispatch,p=l.pending,g=s.memoizedState;if(p!==null){l.pending=null;var x=p=p.next;do g=r(g,x.action),x=x.next;while(x!==p);Xt(g,s.memoizedState)||(ft=!0),s.memoizedState=g,s.baseQueue===null&&(s.baseState=g),l.lastRenderedState=g}return[g,c]}function ug(r,s,l){var c=Ee,p=ut(),g=Ne;if(g){if(l===void 0)throw Error(i(407));l=l()}else l=s();var x=!Xt((Qe||p).memoizedState,l);if(x&&(p.memoizedState=l,ft=!0),p=p.queue,ad(fg.bind(null,c,p,r),[r]),p.getSnapshot!==s||x||dt!==null&&dt.memoizedState.tag&1){if(c.flags|=2048,ps(9,{destroy:void 0},dg.bind(null,c,p,l,s),null),Je===null)throw Error(i(349));g||(lr&127)!==0||cg(c,s,l)}return l}function cg(r,s,l){r.flags|=16384,r={getSnapshot:s,value:l},s=Ee.updateQueue,s===null?(s=Zo(),Ee.updateQueue=s,s.stores=[r]):(l=s.stores,l===null?s.stores=[r]:l.push(r))}function dg(r,s,l,c){s.value=l,s.getSnapshot=c,hg(s)&&pg(r)}function fg(r,s,l){return l(function(){hg(s)&&pg(r)})}function hg(r){var s=r.getSnapshot;r=r.value;try{var l=s();return!Xt(r,l)}catch{return!0}}function pg(r){var s=fi(r,2);s!==null&&Ht(s,r,2)}function id(r){var s=It();if(typeof r=="function"){var l=r;if(r=l(),_i){Nt(!0);try{l()}finally{Nt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:r},s}function mg(r,s,l,c){return r.baseState=l,nd(r,Qe,typeof c=="function"?c:ur)}function pC(r,s,l,c,p){if(nl(r))throw Error(i(485));if(r=s.action,r!==null){var g={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){g.listeners.push(x)}};P.T!==null?l(!0):g.isTransition=!1,c(g),l=s.pending,l===null?(g.next=s.pending=g,gg(s,g)):(g.next=l.next,s.pending=l.next=g)}}function gg(r,s){var l=s.action,c=s.payload,p=r.state;if(s.isTransition){var g=P.T,x={};P.T=x;try{var E=l(p,c),B=P.S;B!==null&&B(x,E),vg(r,s,E)}catch(Z){sd(r,s,Z)}finally{g!==null&&x.types!==null&&(g.types=x.types),P.T=g}}else try{g=l(p,c),vg(r,s,g)}catch(Z){sd(r,s,Z)}}function vg(r,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){yg(r,s,c)},function(c){return sd(r,s,c)}):yg(r,s,l)}function yg(r,s,l){s.status="fulfilled",s.value=l,bg(s),r.state=l,s=r.pending,s!==null&&(l=s.next,l===s?r.pending=null:(l=l.next,s.next=l,gg(r,l)))}function sd(r,s,l){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=l,bg(s),s=s.next;while(s!==c)}r.action=null}function bg(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function xg(r,s){return s}function _g(r,s){if(Ne){var l=Je.formState;if(l!==null){e:{var c=Ee;if(Ne){if(tt){t:{for(var p=tt,g=hn;p.nodeType!==8;){if(!g){p=null;break t}if(p=mn(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){tt=mn(p.nextSibling),c=p.data==="F!";break e}}kr(c)}c=!1}c&&(s=l[0])}}return l=It(),l.memoizedState=l.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xg,lastRenderedState:s},l.queue=c,l=Ug.bind(null,Ee,c),c.dispatch=l,c=id(!1),g=dd.bind(null,Ee,!1,c.queue),c=It(),p={state:s,dispatch:null,action:r,pending:null},c.queue=p,l=pC.bind(null,Ee,p,g,l),p.dispatch=l,c.memoizedState=r,[s,l,!1]}function Sg(r){var s=ut();return Tg(s,Qe,r)}function Tg(r,s,l){if(s=nd(r,s,xg)[0],r=Wo(ur)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=xa(s)}catch(x){throw x===us?Vo:x}else c=s;s=ut();var p=s.queue,g=p.dispatch;return l!==s.memoizedState&&(Ee.flags|=2048,ps(9,{destroy:void 0},mC.bind(null,p,l),null)),[c,g,r]}function mC(r,s){r.action=s}function wg(r){var s=ut(),l=Qe;if(l!==null)return Tg(s,l,r);ut(),s=s.memoizedState,l=ut();var c=l.queue.dispatch;return l.memoizedState=r,[s,c,!1]}function ps(r,s,l,c){return r={tag:r,create:l,deps:c,inst:s,next:null},s=Ee.updateQueue,s===null&&(s=Zo(),Ee.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=r.next=r:(c=l.next,l.next=r,r.next=c,s.lastEffect=r),r}function Cg(){return ut().memoizedState}function el(r,s,l,c){var p=It();Ee.flags|=r,p.memoizedState=ps(1|s,{destroy:void 0},l,c===void 0?null:c)}function tl(r,s,l,c){var p=ut();c=c===void 0?null:c;var g=p.memoizedState.inst;Qe!==null&&c!==null&&Kc(c,Qe.memoizedState.deps)?p.memoizedState=ps(s,g,l,c):(Ee.flags|=r,p.memoizedState=ps(1|s,g,l,c))}function Eg(r,s){el(8390656,8,r,s)}function ad(r,s){tl(2048,8,r,s)}function gC(r){Ee.flags|=4;var s=Ee.updateQueue;if(s===null)s=Zo(),Ee.updateQueue=s,s.events=[r];else{var l=s.events;l===null?s.events=[r]:l.push(r)}}function Ag(r){var s=ut().memoizedState;return gC({ref:s,nextImpl:r}),function(){if((Le&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function Rg(r,s){return tl(4,2,r,s)}function Mg(r,s){return tl(4,4,r,s)}function kg(r,s){if(typeof s=="function"){r=r();var l=s(r);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Ig(r,s,l){l=l!=null?l.concat([r]):null,tl(4,4,kg.bind(null,s,r),l)}function od(){}function Og(r,s){var l=ut();s=s===void 0?null:s;var c=l.memoizedState;return s!==null&&Kc(s,c[1])?c[0]:(l.memoizedState=[r,s],r)}function Dg(r,s){var l=ut();s=s===void 0?null:s;var c=l.memoizedState;if(s!==null&&Kc(s,c[1]))return c[0];if(c=r(),_i){Nt(!0);try{r()}finally{Nt(!1)}}return l.memoizedState=[c,s],c}function ld(r,s,l){return l===void 0||(lr&1073741824)!==0&&(Oe&261930)===0?r.memoizedState=s:(r.memoizedState=l,r=Nv(),Ee.lanes|=r,Lr|=r,l)}function Ng(r,s,l,c){return Xt(l,s)?l:ds.current!==null?(r=ld(r,l,c),Xt(r,s)||(ft=!0),r):(lr&42)===0||(lr&1073741824)!==0&&(Oe&261930)===0?(ft=!0,r.memoizedState=l):(r=Nv(),Ee.lanes|=r,Lr|=r,s)}function zg(r,s,l,c,p){var g=te.p;te.p=g!==0&&8>g?g:8;var x=P.T,E={};P.T=E,dd(r,!1,s,l);try{var B=p(),Z=P.S;if(Z!==null&&Z(E,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ie=dC(B,c);
vendor: 7,414 bytes, line 48
48_a(r,s,ie,tn(r))}else _a(r,s,c,tn(r))}catch(oe){_a(r,s,{then:function(){},status:"rejected",reason:oe},tn())}finally{te.p=g,x!==null&&E.types!==null&&(x.types=E.types),P.T=x}}function vC(){}function ud(r,s,l,c){if(r.tag!==5)throw Error(i(476));var p=jg(r).queue;zg(r,p,s,G,l===null?vC:function(){return Bg(r),l(c)})}function jg(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:G},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:l},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Bg(r){var s=jg(r);s.next===null&&(s=r.alternate.memoizedState),_a(r,s.next.queue,{},tn())}function cd(){return St(Pa)}function Pg(){return ut().memoizedState}function Lg(){return ut().memoizedState}function yC(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var l=tn();r=Dr(l);var c=Nr(s,r,l);c!==null&&(Ht(c,s,l),ga(c,s,l)),s={cache:Lc()},r.payload=s;return}s=s.return}}function bC(r,s,l){var c=tn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nl(r)?Hg(s,l):(l=Rc(r,s,l,c),l!==null&&(Ht(l,r,c),qg(l,s,c)))}function Ug(r,s,l){var c=tn();_a(r,s,l,c)}function _a(r,s,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(nl(r))Hg(s,p);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var x=s.lastRenderedState,E=g(x,l);if(p.hasEagerState=!0,p.eagerState=E,Xt(E,x))return jo(r,s,p,0),Je===null&&zo(),!1}catch{}if(l=Rc(r,s,p,c),l!==null)return Ht(l,r,c),qg(l,s,c),!0}return!1}function dd(r,s,l,c){if(c={lane:2,revertLane:Vd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},nl(r)){if(s)throw Error(i(479))}else s=Rc(r,l,c,2),s!==null&&Ht(s,r,2)}function nl(r){var s=r.alternate;return r===Ee||s!==null&&s===Ee}function Hg(r,s){fs=Xo=!0;var l=r.pending;l===null?s.next=s:(s.next=l.next,l.next=s),r.pending=s}function qg(r,s,l){if((l&4194048)!==0){var c=s.lanes;c&=r.pendingLanes,l|=c,s.lanes=l,Gp(r,l)}}var Sa={readContext:St,use:Jo,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Sa.useEffectEvent=at;var Vg={readContext:St,use:Jo,useCallback:function(r,s){return It().memoizedState=[r,s===void 0?null:s],r},useContext:St,useEffect:Eg,useImperativeHandle:function(r,s,l){l=l!=null?l.concat([r]):null,el(4194308,4,kg.bind(null,s,r),l)},useLayoutEffect:function(r,s){return el(4194308,4,r,s)},useInsertionEffect:function(r,s){el(4,2,r,s)},useMemo:function(r,s){var l=It();s=s===void 0?null:s;var c=r();if(_i){Nt(!0);try{r()}finally{Nt(!1)}}return l.memoizedState=[c,s],c},useReducer:function(r,s,l){var c=It();if(l!==void 0){var p=l(s);if(_i){Nt(!0);try{l(s)}finally{Nt(!1)}}}else p=s;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=bC.bind(null,Ee,r),[c.memoizedState,r]},useRef:function(r){var s=It();return r={current:r},s.memoizedState=r},useState:function(r){r=id(r);var s=r.queue,l=Ug.bind(null,Ee,s);return s.dispatch=l,[r.memoizedState,l]},useDebugValue:od,useDeferredValue:function(r,s){var l=It();return ld(l,r,s)},useTransition:function(){var r=id(!1);return r=zg.bind(null,Ee,r.queue,!0,!1),It().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,l){var c=Ee,p=It();if(Ne){if(l===void 0)throw Error(i(407));l=l()}else{if(l=s(),Je===null)throw Error(i(349));(Oe&127)!==0||cg(c,s,l)}p.memoizedState=l;var g={value:l,getSnapshot:s};return p.queue=g,Eg(fg.bind(null,c,g,r),[r]),c.flags|=2048,ps(9,{destroy:void 0},dg.bind(null,c,g,l,s),null),l},useId:function(){var r=It(),s=Je.identifierPrefix;if(Ne){var l=Bn,c=jn;l=(c&~(1<<32-Ze(c)-1)).toString(32)+l,s="_"+s+"R_"+l,l=Ko++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=fC++,s="_"+s+"r_"+l.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:cd,useFormState:_g,useActionState:_g,useOptimistic:function(r){var s=It();s.memoizedState=s.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=dd.bind(null,Ee,!0,l),l.dispatch=s,[r,s]},useMemoCache:td,useCacheRefresh:function(){return It().memoizedState=yC.bind(null,Ee)},useEffectEvent:function(r){var s=It(),l={impl:r};return s.memoizedState=l,function(){if((Le&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},fd={readContext:St,use:Jo,useCallback:Og,useContext:St,useEffect:ad,useImperativeHandle:Ig,useInsertionEffect:Rg,useLayoutEffect:Mg,useMemo:Dg,useReducer:Wo,useRef:Cg,useState:function(){return Wo(ur)},useDebugValue:od,useDeferredValue:function(r,s){var l=ut();return Ng(l,Qe.memoizedState,r,s)},useTransition:function(){var r=Wo(ur)[0],s=ut().memoizedState;return[typeof r=="boolean"?r:xa(r),s]},useSyncExternalStore:ug,useId:Pg,useHostTransitionStatus:cd,useFormState:Sg,useActionState:Sg,useOptimistic:function(r,s){var l=ut();return mg(l,Qe,r,s)},useMemoCache:td,useCacheRefresh:Lg};fd.useEffectEvent=Ag;var $g={readContext:St,use:Jo,useCallback:Og,useContext:St,useEffect:ad,useImperativeHandle:Ig,useInsertionEffect:Rg,useLayoutEffect:Mg,useMemo:Dg,useReducer:rd,useRef:Cg,useState:function(){return rd(ur)},useDebugValue:od,useDeferredValue:function(r,s){var l=ut();return Qe===null?ld(l,r,s):Ng(l,Qe.memoizedState,r,s)},useTransition:function(){var r=rd(ur)[0],s=ut().memoizedState;return[typeof r=="boolean"?r:xa(r),s]},useSyncExternalStore:ug,useId:Pg,useHostTransitionStatus:cd,useFormState:wg,useActionState:wg,useOptimistic:function(r,s){var l=ut();return Qe!==null?mg(l,Qe,r,s):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:td,useCacheRefresh:Lg};$g.useEffectEvent=Ag;function hd(r,s,l,c){s=r.memoizedState,l=l(c,s),l=l==null?s:v({},s,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var pd={enqueueSetState:function(r,s,l){r=r._reactInternals;var c=tn(),p=Dr(c);p.payload=s,l!=null&&(p.callback=l),s=Nr(r,p,c),s!==null&&(Ht(s,r,c),ga(s,r,c))},enqueueReplaceState:function(r,s,l){r=r._reactInternals;var c=tn(),p=Dr(c);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=Nr(r,p,c),s!==null&&(Ht(s,r,c),ga(s,r,c))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var l=tn(),c=Dr(l);c.tag=2,s!=null&&(c.callback=s),s=Nr(r,c,l),s!==null&&(Ht(s,r,l),ga(s,r,l))}};function Fg(r,s,l,c,p,g,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,g,x):s.prototype&&s.prototype.isPureReactComponent?!la(l,c)||!la(p,g):!0}function Yg(r,s,l,c){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,c),s.state!==r&&pd.enqueueReplaceState(s,s.state,null)}function Si(r,s){var l=s;if("ref"in s){l={};for(var c in s)c!=="ref"&&(l[c]=s[c])}if(r=r.defaultProps){l===s&&(l=v({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}function Gg(r){No(r)}function Qg(r){console.error(r)}
vendor: 15,383 bytes, line 48
48function Xg(r){No(r)}function rl(r,s){try{var l=r.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function Kg(r,s,l){try{var c=r.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function md(r,s,l){return l=Dr(l),l.tag=3,l.payload={element:null},l.callback=function(){rl(r,s)},l}function Zg(r){return r=Dr(r),r.tag=3,r}function Jg(r,s,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var g=c.value;r.payload=function(){return p(g)},r.callback=function(){Kg(s,l,c)}}var x=l.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(r.callback=function(){Kg(s,l,c),typeof p!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var E=c.stack;this.componentDidCatch(c.value,{componentStack:E!==null?E:""})})}function xC(r,s,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=l.alternate,s!==null&&as(s,l,p,!0),l=Zt.current,l!==null){switch(l.tag){case 31:case 13:return pn===null?ml():l.alternate===null&&ot===0&&(ot=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===$o?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([c]):s.add(c),Ud(r,c,p)),!1;case 22:return l.flags|=65536,c===$o?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([c]):l.add(c)),Ud(r,c,p)),!1}throw Error(i(435,l.tag))}return Ud(r,c,p),ml(),!1}if(Ne)return s=Zt.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==Nc&&(r=Error(i(422),{cause:c}),da(cn(r,l)))):(c!==Nc&&(s=Error(i(423),{cause:c}),da(cn(s,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=cn(c,l),p=md(r.stateNode,c,p),Fc(r,p),ot!==4&&(ot=2)),!1;var g=Error(i(520),{cause:c});if(g=cn(g,l),ka===null?ka=[g]:ka.push(g),ot!==4&&(ot=2),s===null)return!0;c=cn(c,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=md(l.stateNode,c,r),Fc(l,r),!1;case 1:if(s=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Ur===null||!Ur.has(g))))return l.flags|=65536,p&=-p,l.lanes|=p,p=Zg(p),Jg(p,r,l,c),Fc(l,p),!1}l=l.return}while(l!==null);return!1}var gd=Error(i(461)),ft=!1;function Tt(r,s,l,c){s.child=r===null?ng(s,null,l,c):xi(s,r.child,l,c)}function Wg(r,s,l,c,p){l=l.render;var g=s.ref;if("ref"in c){var x={};for(var E in c)E!=="ref"&&(x[E]=c[E])}else x=c;return gi(s),c=Zc(r,s,l,x,g,p),E=Jc(),r!==null&&!ft?(Wc(r,s,p),cr(r,s,p)):(Ne&&E&&Oc(s),s.flags|=1,Tt(r,s,c,p),s.child)}function ev(r,s,l,c,p){if(r===null){var g=l.type;return typeof g=="function"&&!Mc(g)&&g.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=g,tv(r,s,g,c,p)):(r=Po(l.type,null,c,s,s.mode,p),r.ref=s.ref,r.return=s,s.child=r)}if(g=r.child,!wd(r,p)){var x=g.memoizedProps;if(l=l.compare,l=l!==null?l:la,l(x,c)&&r.ref===s.ref)return cr(r,s,p)}return s.flags|=1,r=ir(g,c),r.ref=s.ref,r.return=s,s.child=r}function tv(r,s,l,c,p){if(r!==null){var g=r.memoizedProps;if(la(g,c)&&r.ref===s.ref)if(ft=!1,s.pendingProps=c=g,wd(r,p))(r.flags&131072)!==0&&(ft=!0);else return s.lanes=r.lanes,cr(r,s,p)}return vd(r,s,l,c,p)}function nv(r,s,l,c){var p=c.children,g=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,r!==null){for(c=s.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~g}else c=0,s.child=null;return rv(r,s,g,l,c)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&qo(s,g!==null?g.cachePool:null),g!==null?sg(s,g):Gc(),ag(s);else return c=s.lanes=536870912,rv(r,s,g!==null?g.baseLanes|l:l,l,c)}else g!==null?(qo(s,g.cachePool),sg(s,g),jr(),s.memoizedState=null):(r!==null&&qo(s,null),Gc(),jr());return Tt(r,s,p,l),s.child}function Ta(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function rv(r,s,l,c,p){var g=Hc();return g=g===null?null:{parent:ct._currentValue,pool:g},s.memoizedState={baseLanes:l,cachePool:g},r!==null&&qo(s,null),Gc(),ag(s),r!==null&&as(r,s,c,!0),s.childLanes=p,null}function il(r,s){return s=al({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function iv(r,s,l){return xi(s,r.child,null,l),r=il(s,s.pendingProps),r.flags|=2,Jt(s),s.memoizedState=null,r}function _C(r,s,l){var c=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(Ne){if(c.mode==="hidden")return r=il(s,c),s.lanes=536870912,Ta(null,r);if(Xc(s),(r=tt)?(r=gy(r,hn),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Rr!==null?{id:jn,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},l=Hm(r),l.return=s,s.child=l,_t=s,tt=null)):r=null,r===null)throw kr(s);return s.lanes=536870912,null}return il(s,c)}var g=r.memoizedState;if(g!==null){var x=g.dehydrated;if(Xc(s),p)if(s.flags&256)s.flags&=-257,s=iv(r,s,l);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if(ft||as(r,s,l,!1),p=(l&r.childLanes)!==0,ft||p){if(c=Je,c!==null&&(x=Qp(c,l),x!==0&&x!==g.retryLane))throw g.retryLane=x,fi(r,x),Ht(c,r,x),gd;ml(),s=iv(r,s,l)}else r=g.treeContext,tt=mn(x.nextSibling),_t=s,Ne=!0,Mr=null,hn=!1,r!==null&&$m(s,r),s=il(s,c),s.flags|=4096;return s}return r=ir(r.child,{mode:c.mode,children:c.children}),r.ref=s.ref,s.child=r,r.return=s,r}function sl(r,s){var l=s.ref;if(l===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(r===null||r.ref!==l)&&(s.flags|=4194816)}}function vd(r,s,l,c,p){return gi(s),l=Zc(r,s,l,c,void 0,p),c=Jc(),r!==null&&!ft?(Wc(r,s,p),cr(r,s,p)):(Ne&&c&&Oc(s),s.flags|=1,Tt(r,s,l,p),s.child)}function sv(r,s,l,c,p,g){return gi(s),s.updateQueue=null,l=lg(s,c,l,p),og(r),c=Jc(),r!==null&&!ft?(Wc(r,s,g),cr(r,s,g)):(Ne&&c&&Oc(s),s.flags|=1,Tt(r,s,l,g),s.child)}function av(r,s,l,c,p){if(gi(s),s.stateNode===null){var g=ns,x=l.contextType;typeof x=="object"&&x!==null&&(g=St(x)),g=new l(c,g),s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=pd,s.stateNode=g,g._reactInternals=s,g=s.stateNode,g.props=c,g.state=s.memoizedState,g.refs={},Vc(s),x=l.contextType,g.context=typeof x=="object"&&x!==null?St(x):ns,g.state=s.memoizedState,x=l.getDerivedStateFromProps,typeof x=="function"&&(hd(s,l,x,c),g.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(x=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),x!==g.state&&pd.enqueueReplaceState(g,g.state,null),ya(s,c,g,p),va(),g.state=s.memoizedState),typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(r===null){g=s.stateNode;var E=s.memoizedProps,B=Si(l,E);g.props=B;var Z=g.context,ie=l.contextType;x=ns,typeof ie=="object"&&ie!==null&&(x=St(ie));var oe=l.getDerivedStateFromProps;ie=typeof oe=="function"||typeof g.getSnapshotBeforeUpdate=="function",E=s.pendingProps!==E,ie||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E||Z!==x)&&Yg(s,g,c,x),Or=!1;var W=s.memoizedState;g.state=W,ya(s,c,g,p),va(),Z=s.memoizedState,E||W!==Z||Or?(typeof oe=="function"&&(hd(s,l,oe,c),Z=s.memoizedState),(B=Or||Fg(s,l,B,c,W,Z,x))?(ie||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(s.flags|=4194308)):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=Z),g.props=c,g.state=Z,g.context=x,c=B):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{g=s.stateNode,$c(r,s),x=s.memoizedProps,ie=Si(l,x),g.props=ie,oe=s.pendingProps,W=g.context,Z=l.contextType,B=ns,typeof Z=="object"&&Z!==null&&(B=St(Z)),E=l.getDerivedStateFromProps,(Z=typeof E=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(x!==oe||W!==B)&&Yg(s,g,c,B),Or=!1,W=s.memoizedState,g.state=W,ya(s,c,g,p),va();var re=s.memoizedState;x!==oe||W!==re||Or||r!==null&&r.dependencies!==null&&Uo(r.dependencies)?(typeof E=="function"&&(hd(s,l,E,c),re=s.memoizedState),(ie=Or||Fg(s,l,ie,c,W,re,B)||r!==null&&r.dependencies!==null&&Uo(r.dependencies))?(Z||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,re,B),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,re,B)),typeof g.componentDidUpdate=="function"&&(s.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof g.componentDidUpdate!="function"||x===r.memoizedProps&&W===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||x===r.memoizedProps&&W===r.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=re),g.props=c,g.state=re,g.context=B,c=ie):(typeof g.componentDidUpdate!="function"||x===r.memoizedProps&&W===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||x===r.memoizedProps&&W===r.memoizedState||(s.flags|=1024),c=!1)}return g=c,sl(r,s),c=(s.flags&128)!==0,g||c?(g=s.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:g.render(),s.flags|=1,r!==null&&c?(s.child=xi(s,r.child,null,p),s.child=xi(s,null,l,p)):Tt(r,s,l,p),s.memoizedState=g.state,r=s.child):r=cr(r,s,p),r}function ov(r,s,l,c){return pi(),s.flags|=256,Tt(r,s,l,c),s.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(r){return{baseLanes:r,cachePool:Km()}}function xd(r,s,l){return r=r!==null?r.childLanes&~l:0,s&&(r|=en),r}function lv(r,s,l){var c=s.pendingProps,p=!1,g=(s.flags&128)!==0,x;if((x=g)||(x=r!==null&&r.memoizedState===null?!1:(lt.current&2)!==0),x&&(p=!0,s.flags&=-129),x=(s.flags&32)!==0,s.flags&=-33,r===null){if(Ne){if(p?zr(s):jr(),(r=tt)?(r=gy(r,hn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Rr!==null?{id:jn,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},l=Hm(r),l.return=s,s.child=l,_t=s,tt=null)):r=null,r===null)throw kr(s);return nf(r)?s.lanes=32:s.lanes=536870912,null}var E=c.children;return c=c.fallback,p?(jr(),p=s.mode,E=al({mode:"hidden",children:E},p),c=hi(c,p,l,null),E.return=s,c.return=s,E.sibling=c,s.child=E,c=s.child,c.memoizedState=bd(l),c.childLanes=xd(r,x,l),s.memoizedState=yd,Ta(null,c)):(zr(s),_d(s,E))}var B=r.memoizedState;if(B!==null&&(E=B.dehydrated,E!==null)){if(g)s.flags&256?(zr(s),s.flags&=-257,s=Sd(r,s,l)):s.memoizedState!==null?(jr(),s.child=r.child,s.flags|=128,s=null):(jr(),E=c.fallback,p=s.mode,c=al({mode:"visible",children:c.children},p),E=hi(E,p,l,null),E.flags|=2,c.return=s,E.return=s,c.sibling=E,s.child=c,xi(s,r.child,null,l),c=s.child,c.memoizedState=bd(l),c.childLanes=xd(r,x,l),s.memoizedState=yd,s=Ta(null,c));else if(zr(s),nf(E)){if(x=E.nextSibling&&E.nextSibling.dataset,x)var Z=x.dgst;x=Z,c=Error(i(419)),c.stack="",c.digest=x,da({value:c,source:null,stack:null}),s=Sd(r,s,l)}else if(ft||as(r,s,l,!1),x=(l&r.childLanes)!==0,ft||x){if(x=Je,x!==null&&(c=Qp(x,l),c!==0&&c!==B.retryLane))throw B.retryLane=c,fi(r,c),Ht(x,r,c),gd;tf(E)||ml(),s=Sd(r,s,l)}else tf(E)?(s.flags|=192,s.child=r.child,s=null):(r=B.treeContext,tt=mn(E.nextSibling),_t=s,Ne=!0,Mr=null,hn=!1,r!==null&&$m(s,r),s=_d(s,c.children),s.flags|=4096);return s}return p?(jr(),E=c.fallback,p=s.mode,B=r.child,Z=B.sibling,c=ir(B,{mode:"hidden",children:c.children}),c.subtreeFlags=B.subtreeFlags&65011712,Z!==null?E=ir(Z,E):(E=hi(E,p,l,null),E.flags|=2),E.return=s,c.return=s,c.sibling=E,s.child=c,Ta(null,c),c=s.child,E=r.child.memoizedState,E===null?E=bd(l):(p=E.cachePool,p!==null?(B=ct._currentValue,p=p.parent!==B?{parent:B,pool:B}:p):p=Km(),E={baseLanes:E.baseLanes|l,cachePool:p}),c.memoizedState=E,c.childLanes=xd(r,x,l),s.memoizedState=yd,Ta(r.child,c)):(zr(s),l=r.child,r=l.sibling,l=ir(l,{mode:"visible",children:c.children}),l.return=s,l.sibling=null,r!==null&&(x=s.deletions,x===null?(s.deletions=[r],s.flags|=16):x.push(r)),s.child=l,s.memoizedState=null,l)}function _d(r,s){return s=al({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function al(r,s){return r=Kt(22,r,null,s),r.lanes=0,r}function Sd(r,s,l){return xi(s,r.child,null,l),r=_d(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function uv(r,s,l){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s),Bc(r.return,s,l)}function Td(r,s,l,c,p,g){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:g}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=c,x.tail=l,x.tailMode=p,x.treeForkCount=g)}function cv(r,s,l){var c=s.pendingProps,p=c.revealOrder,g=c.tail;c=c.children;var x=lt.current,E=(x&2)!==0;if(E?(x=x&1|2,s.flags|=128):x&=1,M(lt,x),Tt(r,s,c,l),c=Ne?ca:0,!E&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&uv(r,l,s);else if(r.tag===19)uv(r,l,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(l=s.child,p=null;l!==null;)r=l.alternate,r!==null&&Qo(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),Td(s,!1,p,l,g,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(r=p.alternate,r!==null&&Qo(r)===null){s.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Td(s,!0,l,null,g,c);break;case"together":Td(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function cr(r,s,l){if(r!==null&&(s.dependencies=r.dependencies),Lr|=s.lanes,(l&s.childLanes)===0)if(r!==null){if(as(r,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,l=ir(r,r.pendingProps),s.child=l,l.return=s;r.sibling!==null;)r=r.sibling,l=l.sibling=ir(r,r.pendingProps),l.return=s;l.sibling=null}return s.child}function wd(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Uo(r)))}function SC(r,s,l){switch(s.tag){case 3:Ge(s,s.stateNode.containerInfo),Ir(s,ct,r.memoizedState.cache),pi();break;case 27:case 5:Dt(s);break;case 4:Ge(s,s.stateNode.containerInfo);break;case 10:Ir(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Xc(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(zr(s),s.flags|=128,null):(l&s.child.childLanes)!==0?lv(r,s,l):(zr(s),r=cr(r,s,l),r!==null?r.sibling:null);zr(s);break;case 19:var p=(r.flags&128)!==0;if(c=(l&s.childLanes)!==0,c||(as(r,s,l,!1),c=(l&s.childLanes)!==0),p){
vendor: 4,705 bytes, line 48
48if(c)return cv(r,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),M(lt,lt.current),c)break;return null;case 22:return s.lanes=0,nv(r,s,l,s.pendingProps);case 24:Ir(s,ct,r.memoizedState.cache)}return cr(r,s,l)}function dv(r,s,l){if(r!==null)if(r.memoizedProps!==s.pendingProps)ft=!0;else{if(!wd(r,l)&&(s.flags&128)===0)return ft=!1,SC(r,s,l);ft=(r.flags&131072)!==0}else ft=!1,Ne&&(s.flags&1048576)!==0&&Vm(s,ca,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(r=yi(s.elementType),s.type=r,typeof r=="function")Mc(r)?(c=Si(r,c),s.tag=1,s=av(null,s,r,c,l)):(s.tag=0,s=vd(null,s,r,c,l));else{if(r!=null){var p=r.$$typeof;if(p===D){s.tag=11,s=Wg(null,s,r,c,l);break e}else if(p===z){s.tag=14,s=ev(null,s,r,c,l);break e}}throw s=ee(r)||r,Error(i(306,s,""))}}return s;case 0:return vd(r,s,s.type,s.pendingProps,l);case 1:return c=s.type,p=Si(c,s.pendingProps),av(r,s,c,p,l);case 3:e:{if(Ge(s,s.stateNode.containerInfo),r===null)throw Error(i(387));c=s.pendingProps;var g=s.memoizedState;p=g.element,$c(r,s),ya(s,c,null,l);var x=s.memoizedState;if(c=x.cache,Ir(s,ct,c),c!==g.cache&&Pc(s,[ct],l,!0),va(),c=x.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:x.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=ov(r,s,c,l);break e}else if(c!==p){p=cn(Error(i(424)),s),da(p),s=ov(r,s,c,l);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,tt=mn(r.firstChild),_t=s,Ne=!0,Mr=null,hn=!0,l=ng(s,null,c,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pi(),c===p){s=cr(r,s,l);break e}Tt(r,s,c,l)}s=s.child}return s;case 26:return sl(r,s),r===null?(l=Sy(s.type,null,s.pendingProps,null))?s.memoizedState=l:Ne||(l=s.type,r=s.pendingProps,c=Sl(ge.current).createElement(l),c[xt]=s,c[zt]=r,wt(c,l,r),vt(c),s.stateNode=c):s.memoizedState=Sy(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Dt(s),r===null&&Ne&&(c=s.stateNode=by(s.type,s.pendingProps,ge.current),_t=s,hn=!0,p=tt,$r(s.type)?(rf=p,tt=mn(c.firstChild)):tt=p),Tt(r,s,s.pendingProps.children,l),sl(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&Ne&&((p=c=tt)&&(c=JC(c,s.type,s.pendingProps,hn),c!==null?(s.stateNode=c,_t=s,tt=mn(c.firstChild),hn=!1,p=!0):p=!1),p||kr(s)),Dt(s),p=s.type,g=s.pendingProps,x=r!==null?r.memoizedProps:null,c=g.children,Jd(p,g)?c=null:x!==null&&Jd(p,x)&&(s.flags|=32),s.memoizedState!==null&&(p=Zc(r,s,hC,null,null,l),Pa._currentValue=p),sl(r,s),Tt(r,s,c,l),s.child;case 6:return r===null&&Ne&&((r=l=tt)&&(l=WC(l,s.pendingProps,hn),l!==null?(s.stateNode=l,_t=s,tt=null,r=!0):r=!1),r||kr(s)),null;case 13:return lv(r,s,l);case 4:return Ge(s,s.stateNode.containerInfo),c=s.pendingProps,r===null?s.child=xi(s,null,c,l):Tt(r,s,c,l),s.child;case 11:return Wg(r,s,s.type,s.pendingProps,l);case 7:return Tt(r,s,s.pendingProps,l),s.child;case 8:return Tt(r,s,s.pendingProps.children,l),s.child;case 12:return Tt(r,s,s.pendingProps.children,l),s.child;case 10:return c=s.pendingProps,Ir(s,s.type,c.value),Tt(r,s,c.children,l),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,gi(s),p=St(p),c=c(p),s.flags|=1,Tt(r,s,c,l),s.child;case 14:return ev(r,s,s.type,s.pendingProps,l);case 15:return tv(r,s,s.type,s.pendingProps,l);case 19:return cv(r,s,l);case 31:return _C(r,s,l);case 22:return nv(r,s,l,s.pendingProps);case 24:return gi(s),c=St(ct),r===null?(p=Hc(),p===null&&(p=Je,g=Lc(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=l),p=g),s.memoizedState={parent:c,cache:p},Vc(s),Ir(s,ct,p)):((r.lanes&l)!==0&&($c(r,s),ya(s,null,null,l),va()),p=r.memoizedState,g=s.memoizedState,p.parent!==c?(p={parent:c,cache:c},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Ir(s,ct,c)):(c=g.cache,Ir(s,ct,c),c!==p.cache&&Pc(s,[ct],l,!0))),Tt(r,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function dr(r){r.flags|=4}function Cd(r,s,l,c,p){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Pv())r.flags|=8192;else throw bi=$o,qc}else r.flags&=-16777217}function fv(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ay(s))if(Pv())r.flags|=8192;else throw bi=$o,qc}function ol(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?Fp():536870912,r.lanes|=s,ys|=s)}function wa(r,s){if(!Ne)switch(r.tailMode){case"hidden":s=r.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;
vendor: 4,543 bytes, line 48
48c===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function nt(r){var s=r.alternate!==null&&r.alternate.child===r.child,l=0,c=0;if(s)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=l,s}function TC(r,s,l){var c=s.pendingProps;switch(Dc(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(s),null;case 1:return nt(s),null;case 3:return l=s.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),or(ct),qe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(ss(s)?dr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,zc())),nt(s),null;case 26:var p=s.type,g=s.memoizedState;return r===null?(dr(s),g!==null?(nt(s),fv(s,g)):(nt(s),Cd(s,p,null,c,l))):g?g!==r.memoizedState?(dr(s),nt(s),fv(s,g)):(nt(s),s.flags&=-16777217):(r=r.memoizedProps,r!==c&&dr(s),nt(s),Cd(s,p,r,c,l)),null;case 27:if(Cn(s),l=ge.current,p=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&dr(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return nt(s),null}r=de.current,ss(s)?Fm(s):(r=by(p,c,l),s.stateNode=r,dr(s))}return nt(s),null;case 5:if(Cn(s),p=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&dr(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return nt(s),null}if(g=de.current,ss(s))Fm(s);else{var x=Sl(ge.current);switch(g){case 1:g=x.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=x.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=x.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?x.createElement("select",{is:c.is}):x.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?x.createElement(p,{is:c.is}):x.createElement(p)}}g[xt]=s,g[zt]=c;e:for(x=s.child;x!==null;){if(x.tag===5||x.tag===6)g.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===s)break e;for(;x.sibling===null;){if(x.return===null||x.return===s)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}s.stateNode=g;e:switch(wt(g,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&dr(s)}}return nt(s),Cd(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,l),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==c&&dr(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(i(166));if(r=ge.current,ss(s)){if(r=s.stateNode,l=s.memoizedProps,c=null,p=_t,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[xt]=s,r=!!(r.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||ly(r.nodeValue,l)),r||kr(s,!0)}else r=Sl(r).createTextNode(c),r[xt]=s,s.stateNode=r}return nt(s),null;case 31:if(l=s.memoizedState,r===null||r.memoizedState!==null){if(c=ss(s),l!==null){if(r===null){if(!c)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[xt]=s}else pi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;nt(s),r=!1}else l=zc(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return s.flags&256?(Jt(s),s):(Jt(s),null);if((s.flags&128)!==0)throw Error(i(558))}return nt(s),null;case 13:if(c=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ss(s),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[xt]=s}else pi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;nt(s),p=!1}else p=zc(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Jt(s),s):(Jt(s),null)}return Jt(s),(s.flags&128)!==0?(s.lanes=l,s):(l=c!==null,r=r!==null&&r.memoizedState!==null,l&&(c=s.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&
vendor: 24,127 bytes, line 48
48(c.flags|=2048)),l!==r&&l&&(s.child.flags|=8192),ol(s,s.updateQueue),nt(s),null);case 4:return qe(),r===null&&Gd(s.stateNode.containerInfo),nt(s),null;case 10:return or(s.type),nt(s),null;case 19:if(ne(lt),c=s.memoizedState,c===null)return nt(s),null;if(p=(s.flags&128)!==0,g=c.rendering,g===null)if(p)wa(c,!1);else{if(ot!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(g=Qo(r),g!==null){for(s.flags|=128,wa(c,!1),r=g.updateQueue,s.updateQueue=r,ol(s,r),s.subtreeFlags=0,r=l,l=s.child;l!==null;)Um(l,r),l=l.sibling;return M(lt,lt.current&1|2),Ne&&sr(s,c.treeForkCount),s.child}r=r.sibling}c.tail!==null&&Mt()>fl&&(s.flags|=128,p=!0,wa(c,!1),s.lanes=4194304)}else{if(!p)if(r=Qo(g),r!==null){if(s.flags|=128,p=!0,r=r.updateQueue,s.updateQueue=r,ol(s,r),wa(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Ne)return nt(s),null}else 2*Mt()-c.renderingStartTime>fl&&l!==536870912&&(s.flags|=128,p=!0,wa(c,!1),s.lanes=4194304);c.isBackwards?(g.sibling=s.child,s.child=g):(r=c.last,r!==null?r.sibling=g:s.child=g,c.last=g)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=Mt(),r.sibling=null,l=lt.current,M(lt,p?l&1|2:l&1),Ne&&sr(s,c.treeForkCount),r):(nt(s),null);case 22:case 23:return Jt(s),Qc(),c=s.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(l&536870912)!==0&&(s.flags&128)===0&&(nt(s),s.subtreeFlags&6&&(s.flags|=8192)):nt(s),l=s.updateQueue,l!==null&&ol(s,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==l&&(s.flags|=2048),r!==null&&ne(vi),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),or(ct),nt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function wC(r,s){switch(Dc(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return or(ct),qe(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Cn(s),null;case 31:if(s.memoizedState!==null){if(Jt(s),s.alternate===null)throw Error(i(340));pi()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(Jt(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));pi()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return ne(lt),null;case 4:return qe(),null;case 10:return or(s.type),null;case 22:case 23:return Jt(s),Qc(),r!==null&&ne(vi),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return or(ct),null;case 25:return null;default:return null}}function hv(r,s){switch(Dc(s),s.tag){case 3:or(ct),qe();break;case 26:case 27:case 5:Cn(s);break;case 4:qe();break;case 31:s.memoizedState!==null&&Jt(s);break;case 13:Jt(s);break;case 19:ne(lt);break;case 10:or(s.type);break;case 22:case 23:Jt(s),Qc(),r!==null&&ne(vi);break;case 24:or(ct)}}function Ca(r,s){try{var l=s.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&r)===r){c=void 0;var g=l.create,x=l.inst;c=g(),x.destroy=c}l=l.next}while(l!==p)}}catch(E){Fe(s,s.return,E)}}function Br(r,s,l){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&r)===r){var x=c.inst,E=x.destroy;if(E!==void 0){x.destroy=void 0,p=s;var B=l,Z=E;try{Z()}catch(ie){Fe(p,B,ie)}}}c=c.next}while(c!==g)}}catch(ie){Fe(s,s.return,ie)}}function pv(r){var s=r.updateQueue;if(s!==null){var l=r.stateNode;try{ig(s,l)}catch(c){Fe(r,r.return,c)}}}function mv(r,s,l){l.props=Si(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(c){Fe(r,s,c)}}function Ea(r,s){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof l=="function"?r.refCleanup=l(c):l.current=c}}catch(p){Fe(r,s,p)}}function Pn(r,s){var l=r.ref,c=r.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){Fe(r,s,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){Fe(r,s,p)}else l.current=null}function gv(r){var s=r.type,l=r.memoizedProps,c=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){Fe(r,r.return,p)}}function Ed(r,s,l){try{var c=r.stateNode;YC(c,r.type,l,s),c[zt]=s}catch(p){Fe(r,r.return,p)}}function vv(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&$r(r.type)||r.tag===4}function Ad(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||vv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&$r(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Rd(r,s,l){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(r),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=nr));else if(c!==4&&(c===27&&$r(r.type)&&(l=r.stateNode,s=null),r=r.child,r!==null))for(Rd(r,s,l),r=r.sibling;r!==null;)Rd(r,s,l),r=r.sibling}function ll(r,s,l){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?l.insertBefore(r,s):l.appendChild(r);else if(c!==4&&(c===27&&$r(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(ll(r,s,l),r=r.sibling;r!==null;)ll(r,s,l),r=r.sibling}function yv(r){var s=r.stateNode,l=r.memoizedProps;try{for(var c=r.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);wt(s,c,l),s[xt]=r,s[zt]=l}catch(g){Fe(r,r.return,g)}}var fr=!1,ht=!1,Md=!1,bv=typeof WeakSet=="function"?WeakSet:Set,yt=null;function CC(r,s){if(r=r.containerInfo,Kd=Ml,r=Im(r),Sc(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var x=0,E=-1,B=-1,Z=0,ie=0,oe=r,W=null;t:for(;;){for(var re;oe!==l||p!==0&&oe.nodeType!==3||(E=x+p),oe!==g||c!==0&&oe.nodeType!==3||(B=x+c),oe.nodeType===3&&(x+=oe.nodeValue.length),(re=oe.firstChild)!==null;)W=oe,oe=re;for(;;){if(oe===r)break t;if(W===l&&++Z===p&&(E=x),W===g&&++ie===c&&(B=x),(re=oe.nextSibling)!==null)break;oe=W,W=oe.parentNode}oe=re}l=E===-1||B===-1?null:{start:E,end:B}}else l=null}l=l||{start:0,end:0}}else l=null;for(Zd={focusedElem:r,selectionRange:l},Ml=!1,yt=s;yt!==null;)if(s=yt,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,yt=r;else for(;yt!==null;){switch(s=yt,g=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)p=r[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&g!==null){r=void 0,l=s,p=g.memoizedProps,g=g.memoizedState,c=l.stateNode;try{var he=Si(l.type,p);r=c.getSnapshotBeforeUpdate(he,g),c.__reactInternalSnapshotBeforeUpdate=r}catch(be){Fe(l,l.return,be)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,l=r.nodeType,l===9)ef(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ef(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,yt=r;break}yt=s.return}}function xv(r,s,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:pr(r,l),c&4&&Ca(5,l);break;case 1:if(pr(r,l),c&4)if(r=l.stateNode,s===null)try{r.componentDidMount()}catch(x){Fe(l,l.return,x)}else{var p=Si(l.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(p,s,r.__reactInternalSnapshotBeforeUpdate)}catch(x){Fe(l,l.return,x)}}c&64&&pv(l),c&512&&Ea(l,l.return);break;case 3:if(pr(r,l),c&64&&(r=l.updateQueue,r!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{ig(r,s)}catch(x){Fe(l,l.return,x)}}break;case 27:s===null&&c&4&&yv(l);case 26:case 5:pr(r,l),s===null&&c&4&&gv(l),c&512&&Ea(l,l.return);break;case 12:pr(r,l);break;case 31:pr(r,l),c&4&&Tv(r,l);break;case 13:pr(r,l),c&4&&wv(r,l),c&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=NC.bind(null,l),eE(r,l))));break;case 22:if(c=l.memoizedState!==null||fr,!c){s=s!==null&&s.memoizedState!==null||ht,p=fr;var g=ht;fr=c,(ht=s)&&!g?mr(r,l,(l.subtreeFlags&8772)!==0):pr(r,l),fr=p,ht=g}break;case 30:break;default:pr(r,l)}}function _v(r){var s=r.alternate;s!==null&&(r.alternate=null,_v(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&sc(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var rt=null,Bt=!1;function hr(r,s,l){for(l=l.child;l!==null;)Sv(r,s,l),l=l.sibling}function Sv(r,s,l){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(kt,l)}catch{}switch(l.tag){case 26:ht||Pn(l,s),hr(r,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ht||Pn(l,s);var c=rt,p=Bt;$r(l.type)&&(rt=l.stateNode,Bt=!1),hr(r,s,l),za(l.stateNode),rt=c,Bt=p;break;case 5:ht||Pn(l,s);case 6:if(c=rt,p=Bt,rt=null,hr(r,s,l),rt=c,Bt=p,rt!==null)if(Bt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(l.stateNode)}catch(g){Fe(l,s,g)}else try{rt.removeChild(l.stateNode)}catch(g){Fe(l,s,g)}break;case 18:rt!==null&&(Bt?(r=rt,py(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),Es(r)):py(rt,l.stateNode));break;case 4:c=rt,p=Bt,rt=l.stateNode.containerInfo,Bt=!0,hr(r,s,l),rt=c,Bt=p;break;case 0:case 11:case 14:case 15:Br(2,l,s),ht||Br(4,l,s),hr(r,s,l);break;case 1:ht||(Pn(l,s),c=l.stateNode,typeof c.componentWillUnmount=="function"&&mv(l,s,c)),hr(r,s,l);break;case 21:hr(r,s,l);break;case 22:ht=(c=ht)||l.memoizedState!==null,hr(r,s,l),ht=c;break;default:hr(r,s,l)}}function Tv(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Es(r)}catch(l){Fe(s,s.return,l)}}}function wv(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Es(r)}catch(l){Fe(s,s.return,l)}}function EC(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new bv),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new bv),s;default:throw Error(i(435,r.tag))}}function ul(r,s){var l=EC(r);s.forEach(function(c){if(!l.has(c)){l.add(c);var p=zC.bind(null,r,c);c.then(p,p)}})}function Pt(r,s){var l=s.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],g=r,x=s,E=x;e:for(;E!==null;){switch(E.tag){case 27:if($r(E.type)){rt=E.stateNode,Bt=!1;break e}break;case 5:rt=E.stateNode,Bt=!1;break e;case 3:case 4:rt=E.stateNode.containerInfo,Bt=!0;break e}E=E.return}if(rt===null)throw Error(i(160));Sv(g,x,p),rt=null,Bt=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Cv(s,r),s=s.sibling}var Mn=null;function Cv(r,s){var l=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Pt(s,r),Lt(r),c&4&&(Br(3,r,r.return),Ca(3,r),Br(5,r,r.return));break;case 1:Pt(s,r),Lt(r),c&512&&(ht||l===null||Pn(l,l.return)),c&64&&fr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Mn;if(Pt(s,r),Lt(r),c&512&&(ht||l===null||Pn(l,l.return)),c&4){var g=l!==null?l.memoizedState:null;if(c=r.memoizedState,l===null)if(c===null)if(r.stateNode===null){e:{c=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Ws]||g[xt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(c),p.head.insertBefore(g,p.querySelector("head > title"))),wt(g,c,l),g[xt]=r,vt(g),c=g;break e;case"link":var x=Cy("link","href",p).get(c+(l.href||""));if(x){for(var E=0;E<x.length;E++)if(g=x[E],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){x.splice(E,1);break t}}g=p.createElement(c),wt(g,c,l),p.head.appendChild(g);break;case"meta":if(x=Cy("meta","content",p).get(c+(l.content||""))){for(E=0;E<x.length;E++)if(g=x[E],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){x.splice(E,1);break t}}g=p.createElement(c),wt(g,c,l),p.head.appendChild(g);break;default:throw Error(i(468,c))}g[xt]=r,vt(g),c=g}r.stateNode=c}else Ey(p,r.type,r.stateNode);else r.stateNode=wy(p,c,r.memoizedProps);else g!==c?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,c===null?Ey(p,r.type,r.stateNode):wy(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Ed(r,r.memoizedProps,l.memoizedProps)}break;case 27:Pt(s,r),Lt(r),c&512&&(ht||l===null||Pn(l,l.return)),l!==null&&c&4&&Ed(r,r.memoizedProps,l.memoizedProps);break;case 5:if(Pt(s,r),Lt(r),c&512&&(ht||l===null||Pn(l,l.return)),r.flags&32){p=r.stateNode;try{Xi(p,"")}catch(he){Fe(r,r.return,he)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Ed(r,p,l!==null?l.memoizedProps:p)),c&1024&&(Md=!0);break;case 6:if(Pt(s,r),Lt(r),c&4){if(r.stateNode===null)throw Error(i(162));c=r.memoizedProps,l=r.stateNode;try{l.nodeValue=c}catch(he){Fe(r,r.return,he)}}break;case 3:if(Cl=null,p=Mn,Mn=Tl(s.containerInfo),Pt(s,r),Mn=p,Lt(r),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Es(s.containerInfo)}catch(he){Fe(r,r.return,he)}Md&&(Md=!1,Ev(r));break;case 4:c=Mn,Mn=Tl(r.stateNode.containerInfo),Pt(s,r),Lt(r),Mn=c;break;case 12:Pt(s,r),Lt(r);break;case 31:Pt(s,r),Lt(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ul(r,c)));break;case 13:Pt(s,r),Lt(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(dl=Mt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ul(r,c)));break;case 22:p=r.memoizedState!==null;var B=l!==null&&l.memoizedState!==null,Z=fr,ie=ht;if(fr=Z||p,ht=ie||B,Pt(s,r),ht=ie,fr=Z,Lt(r),c&8192)e:for(s=r.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||B||fr||ht||Ti(r)),l=null,s=r;;){if(s.tag===5||s.tag===26){if(l===null){B=l=s;try{if(g=B.stateNode,p)x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{E=B.stateNode;var oe=B.memoizedProps.style,W=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;E.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(he){Fe(B,B.return,he)}}}else if(s.tag===6){if(l===null){B=s;try{B.stateNode.nodeValue=p?"":B.memoizedProps}catch(he){Fe(B,B.return,he)}}}else if(s.tag===18){if(l===null){B=s;try{var re=B.stateNode;p?my(re,!0):my(B.stateNode,!1)}catch(he){Fe(B,B.return,he)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=r.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,ul(r,l))));break;case 19:Pt(s,r),Lt(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ul(r,c)));break;case 30:break;case 21:break;default:Pt(s,r),Lt(r)}}function Lt(r){var s=r.flags;if(s&2){try{for(var l,c=r.return;c!==null;){if(vv(c)){l=c;break}c=c.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var p=l.stateNode,g=Ad(r);ll(r,g,p);break;case 5:var x=l.stateNode;l.flags&32&&(Xi(x,""),l.flags&=-33);var E=Ad(r);ll(r,E,x);break;case 3:case 4:var B=l.stateNode.containerInfo,Z=Ad(r);Rd(r,Z,B);break;default:throw Error(i(161))}}catch(ie){Fe(r,r.return,ie)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Ev(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;Ev(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function pr(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)xv(r,s.alternate,s),s=s.sibling}function Ti(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Br(4,s,s.return),Ti(s);break;case 1:Pn(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&mv(s,s.return,l),Ti(s);break;case 27:za(s.stateNode);case 26:case 5:Pn(s,s.return),Ti(s);break;case 22:s.memoizedState===null&&Ti(s);break;case 30:Ti(s);break;default:Ti(s)}r=r.sibling}}function mr(r,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,p=r,g=s,x=g.flags;switch(g.tag){case 0:case 11:case 15:mr(p,g,l),Ca(4,g);break;case 1:if(mr(p,g,l),c=g,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Z){Fe(c,c.return,Z)}if(c=g,p=c.updateQueue,p!==null){var E=c.stateNode;try{var B=p.shared.hiddenCallbacks;if(B!==null)for(p.shared.hiddenCallbacks=null,p=0;p<B.length;p++)rg(B[p],E)}catch(Z){Fe(c,c.return,Z)}}l&&x&64&&pv(g),Ea(g,g.return);break;case 27:yv(g);case 26:case 5:mr(p,g,l),l&&c===null&&x&4&&gv(g),Ea(g,g.return);break;case 12:mr(p,g,l);break;case 31:mr(p,g,l),l&&x&4&&Tv(p,g);break;case 13:mr(p,g,l),l&&x&4&&wv(p,g);break;case 22:g.memoizedState===null&&mr(p,g,l),Ea(g,g.return);break;case 30:break;default:mr(p,g,l)}s=s.sibling}}function kd(r,s){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&fa(l))}function Id(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&fa(r))}function kn(r,s,l,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Av(r,s,l,c),s=s.sibling}function Av(r,s,l,c){var p=s.flags;switch(s.tag){case 0:case 11:case 15:kn(r,s,l,c),p&2048&&Ca(9,s);break;case 1:kn(r,s,l,c);break;case 3:kn(r,s,l,c),p&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&fa(r)));break;case 12:if(p&2048){kn(r,s,l,c),r=s.stateNode;try{var g=s.memoizedProps,x=g.id,E=g.onPostCommit;typeof E=="function"&&E(x,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(B){Fe(s,s.return,B)}}else kn(r,s,l,c);break;case 31:kn(r,s,l,c);break;case 13:kn(r,s,l,c);break;case 23:break;case 22:g=s.stateNode,x=s.alternate,s.memoizedState!==null?g._visibility&2?kn(r,s,l,c):Aa(r,s):g._visibility&2?kn(r,s,l,c):(g._visibility|=2,ms(r,s,l,c,(s.subtreeFlags&10256)!==0||!1)),p&2048&&kd(x,s);break;case 24:kn(r,s,l,c),p&2048&&Id(s.alternate,s);break;default:kn(r,s,l,c)}}function ms(r,s,l,c,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var g=r,x=s,E=l,B=c,Z=x.flags;switch(x.tag){case 0:case 11:case 15:ms(g,x,E,B,p),Ca(8,x);break;case 23:break;case 22:var ie=x.stateNode;x.memoizedState!==null?ie._visibility&2?ms(g,x,E,B,p):Aa(g,x):(ie._visibility|=2,ms(g,x,E,B,p)),p&&Z&2048&&kd(x.alternate,x);break;case 24:ms(g,x,E,B,p),p&&Z&2048&&Id(x.alternate,x);break;default:ms(g,x,E,B,p)}s=s.sibling}}function Aa(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=r,c=s,p=c.flags;switch(c.tag){case 22:Aa(l,c),p&2048&&kd(c.alternate,c);break;case 24:Aa(l,c),p&2048&&Id(c.alternate,c);break;default:Aa(l,c)}s=s.sibling}}var Ra=8192;function gs(r,s,l){if(r.subtreeFlags&Ra)for(r=r.child;r!==null;)Rv(r,s,l),r=r.sibling}function Rv(r,s,l){switch(r.tag){case 26:gs(r,s,l),r.flags&Ra&&r.memoizedState!==null&&fE(l,Mn,r.memoizedState,r.memoizedProps);break;case 5:gs(r,s,l);break;case 3:case 4:var c=Mn;Mn=Tl(r.stateNode.containerInfo),gs(r,s,l),Mn=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Ra,Ra=16777216,gs(r,s,l),Ra=c):gs(r,s,l));break;default:gs(r,s,l)}}function Mv(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Ma(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];yt=c,Iv(c,r)}Mv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)kv(r),r=r.sibling}function kv(r){switch(r.tag){case 0:case 11:case 15:Ma(r),r.flags&2048&&Br(9,r,r.return);break;case 3:Ma(r);break;case 12:Ma(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,cl(r)):Ma(r);break;default:Ma(r)}}function cl(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];yt=c,Iv(c,r)}Mv(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Br(8,s,s.return),cl(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,cl(s));break;default:cl(s)}r=r.sibling}}function Iv(r,s){for(;yt!==null;){var l=yt;switch(l.tag){case 0:case 11:case 15:Br(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:fa(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,yt=c;else e:for(l=r;yt!==null;){c=yt;var p=c.sibling,g=c.return;if(_v(c),c===l){yt=null;break e}if(p!==null){p.return=g,yt=p;break e}yt=g}}}var AC={getCacheForType:function(r){var s=St(ct),l=s.data.get(r);return l===void 0&&(l=r(),s.data.set(r,l)),l},cacheSignal:function(){return St(ct).controller.signal}},RC=typeof WeakMap=="function"?WeakMap:Map,Le=0,Je=null,ke=null,Oe=0,$e=0,Wt=null,Pr=!1,vs=!1,Od=!1,gr=0,ot=0,Lr=0,wi=0,Dd=0,en=0,ys=0,ka=null,Ut=null,Nd=!1,dl=0,Ov=0,fl=1/0,hl=null,Ur=null,gt=0,Hr=null,bs=null,vr=0,zd=0,jd=null,Dv=null,Ia=0,Bd=null;function tn(){return(Le&2)!==0&&Oe!==0?Oe&-Oe:P.T!==null?Vd():Xp()}function Nv(){if(en===0)if((Oe&536870912)===0||Ne){var r=_o;_o<<=1,(_o&3932160)===0&&(_o=262144),en=r}else en=536870912;return r=Zt.current,r!==null&&(r.flags|=32),en}function Ht(r,s,l){(r===Je&&($e===2||$e===9)||r.cancelPendingCommit!==null)&&(xs(r,0),qr(r,Oe,en,!1)),Js(r,l),((Le&2)===0||r!==Je)&&(r===Je&&((Le&2)===0&&(wi|=l),ot===4&&qr(r,Oe,en,!1)),Ln(r))}function zv(r,s,l){if((Le&6)!==0)throw Error(i(327));var c=!l&&(s&127)===0&&(s&r.expiredLanes)===0||Zs(r,s),p=c?IC(r,s):Ld(r,s,!0),g=c;do{if(p===0){vs&&!c&&qr(r,s,0,!1);break}else{if(l=r.current.alternate,g&&!MC(l)){p=Ld(r,s,!1),g=!1;continue}if(p===2){if(g=s,r.errorRecoveryDisabledLanes&g)var x=0;else x=r.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){s=x;e:{var E=r;p=ka;var B=E.current.memoizedState.isDehydrated;if(B&&(xs(E,x).flags|=256),x=Ld(E,x,!1),x!==2){if(Od&&!B){E.errorRecoveryDisabledLanes|=g,wi|=g,p=4;break e}g=Ut,Ut=p,g!==null&&(Ut===null?Ut=g:Ut.push.apply(Ut,g))}p=x}if(g=!1,p!==2)continue}}if(p===1){xs(r,0),qr(r,s,0,!0);break}e:{switch(c=r,g=p,g){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:qr(c,s,en,!Pr);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(p=dl+300-Mt(),10<p)){if(qr(c,s,en,!Pr),To(c,0,!0)!==0)break e;vr=s,c.timeoutHandle=fy(jv.bind(null,c,l,Ut,hl,Nd,s,en,wi,ys,Pr,g,"Throttled",-0,0),p);break e}jv(c,l,Ut,hl,Nd,s,en,wi,ys,Pr,g,null,-0,0)}}break}while(!0);Ln(r)}function jv(r,s,l,c,p,g,x,E,B,Z,ie,oe,W,re){if(r.timeoutHandle=-1,oe=s.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nr},Rv(s,g,oe);var he=(g&62914560)===g?dl-Mt():(g&4194048)===g?Ov-Mt():0;if(he=hE(oe,he),he!==null){vr=g,r.cancelPendingCommit=he($v.bind(null,r,s,g,l,c,p,x,E,B,ie,oe,null,W,re)),qr(r,g,x,
vendor: 22,821 bytes, lines 48-49
48!Z);return}}$v(r,s,g,l,c,p,x,E,B)}function MC(r){for(var s=r;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],g=p.getSnapshot;p=p.value;try{if(!Xt(g(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function qr(r,s,l,c){s&=~Dd,s&=~wi,r.suspendedLanes|=s,r.pingedLanes&=~s,c&&(r.warmLanes|=s),c=r.expirationTimes;for(var p=s;0<p;){var g=31-Ze(p),x=1<<g;c[g]=-1,p&=~x}l!==0&&Yp(r,l,s)}function pl(){return(Le&6)===0?(Oa(0),!1):!0}function Pd(){if(ke!==null){if($e===0)var r=ke.return;else r=ke,ar=mi=null,ed(r),cs=null,pa=0,r=ke;for(;r!==null;)hv(r.alternate,r),r=r.return;ke=null}}function xs(r,s){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,XC(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),vr=0,Pd(),Je=r,ke=l=ir(r.current,null),Oe=s,$e=0,Wt=null,Pr=!1,vs=Zs(r,s),Od=!1,ys=en=Dd=wi=Lr=ot=0,Ut=ka=null,Nd=!1,(s&8)!==0&&(s|=s&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=s;0<c;){var p=31-Ze(c),g=1<<p;s|=r[p],c&=~g}return gr=s,zo(),l}function Bv(r,s){Ee=null,P.H=Sa,s===us||s===Vo?(s=Wm(),$e=3):s===qc?(s=Wm(),$e=4):$e=s===gd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Wt=s,ke===null&&(ot=1,rl(r,cn(s,r.current)))}function Pv(){var r=Zt.current;return r===null?!0:(Oe&4194048)===Oe?pn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?r===pn:!1}function Lv(){var r=P.H;return P.H=Sa,r===null?Sa:r}function Uv(){var r=P.A;return P.A=AC,r}function ml(){ot=4,Pr||(Oe&4194048)!==Oe&&Zt.current!==null||(vs=!0),(Lr&134217727)===0&&(wi&134217727)===0||Je===null||qr(Je,Oe,en,!1)}function Ld(r,s,l){var c=Le;Le|=2;var p=Lv(),g=Uv();(Je!==r||Oe!==s)&&(hl=null,xs(r,s)),s=!1;var x=ot;e:do try{if($e!==0&&ke!==null){var E=ke,B=Wt;switch($e){case 8:Pd(),x=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(s=!0);var Z=$e;if($e=0,Wt=null,_s(r,E,B,Z),l&&vs){x=0;break e}break;default:Z=$e,$e=0,Wt=null,_s(r,E,B,Z)}}kC(),x=ot;break}catch(ie){Bv(r,ie)}while(!0);return s&&r.shellSuspendCounter++,ar=mi=null,Le=c,P.H=p,P.A=g,ke===null&&(Je=null,Oe=0,zo()),x}function kC(){for(;ke!==null;)Hv(ke)}function IC(r,s){var l=Le;Le|=2;var c=Lv(),p=Uv();Je!==r||Oe!==s?(hl=null,fl=Mt()+500,xs(r,s)):vs=Zs(r,s);e:do try{if($e!==0&&ke!==null){s=ke;var g=Wt;t:switch($e){case 1:$e=0,Wt=null,_s(r,s,g,1);break;case 2:case 9:if(Zm(g)){$e=0,Wt=null,qv(s);break}s=function(){$e!==2&&$e!==9||Je!==r||($e=7),Ln(r)},g.then(s,s);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:Zm(g)?($e=0,Wt=null,qv(s)):($e=0,Wt=null,_s(r,s,g,7));break;case 5:var x=null;switch(ke.tag){case 26:x=ke.memoizedState;case 5:case 27:var E=ke;if(x?Ay(x):E.stateNode.complete){$e=0,Wt=null;var B=E.sibling;if(B!==null)ke=B;else{var Z=E.return;Z!==null?(ke=Z,gl(Z)):ke=null}break t}}$e=0,Wt=null,_s(r,s,g,5);break;case 6:$e=0,Wt=null,_s(r,s,g,6);break;case 8:Pd(),ot=6;break e;default:throw Error(i(462))}}OC();break}catch(ie){Bv(r,ie)}while(!0);return ar=mi=null,P.H=c,P.A=p,Le=l,ke!==null?0:(Je=null,Oe=0,zo(),ot)}function OC(){for(;ke!==null&&!Ju();)Hv(ke)}function Hv(r){var s=dv(r.alternate,r,gr);r.memoizedProps=r.pendingProps,s===null?gl(r):ke=s}function qv(r){var s=r,l=s.alternate;switch(s.tag){case 15:case 0:s=sv(l,s,s.pendingProps,s.type,void 0,Oe);break;case 11:s=sv(l,s,s.pendingProps,s.type.render,s.ref,Oe);break;case 5:ed(s);default:hv(l,s),s=ke=Um(s,gr),s=dv(l,s,gr)}r.memoizedProps=r.pendingProps,s===null?gl(r):ke=s}function _s(r,s,l,c){ar=mi=null,ed(s),cs=null,pa=0;var p=s.return;try{if(xC(r,p,s,l,Oe)){ot=1,rl(r,cn(l,r.current)),ke=null;return}}catch(g){if(p!==null)throw ke=p,g;ot=1,rl(r,cn(l,r.current)),ke=null;return}s.flags&32768?(Ne||c===1?r=!0:vs||(Oe&536870912)!==0?r=!1:(Pr=r=!0,(c===2||c===9||c===3||c===6)&&(c=Zt.current,c!==null&&c.tag===13&&(c.flags|=16384))),Vv(s,r)):gl(s)}function gl(r){var s=r;do{if((s.flags&32768)!==0){Vv(s,Pr);return}r=s.return;var l=TC(s.alternate,s,gr);if(l!==null){ke=l;return}if(s=s.sibling,s!==null){ke=s;return}ke=s=r}while(s!==null);ot===0&&(ot=5)}function Vv(r,s){do{var l=wC(r.alternate,r);if(l!==null){l.flags&=32767,ke=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(r=r.sibling,r!==null)){ke=r;return}ke=r=l}while(r!==null);ot=6,ke=null}function $v(r,s,l,c,p,g,x,E,B){r.cancelPendingCommit=null;do vl();while(gt!==0);if((Le&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(g=s.lanes|s.childLanes,g|=Ac,dw(r,l,g,x,E,B),r===Je&&(ke=Je=null,Oe=0),bs=s,Hr=r,vr=l,zd=g,jd=p,Dv=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,jC(xe,function(){return Xv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=te.p,te.p=2,x=Le,Le|=4;try{CC(r,s,l)}finally{Le=x,te.p=p,P.T=c}}gt=1,Fv(),Yv(),Gv()}}function Fv(){if(gt===1){gt=0;var r=Hr,s=bs,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=P.T,P.T=null;var c=te.p;te.p=2;var p=Le;Le|=4;try{Cv(s,r);var g=Zd,x=Im(r.containerInfo),E=g.focusedElem,B=g.selectionRange;if(x!==E&&E&&E.ownerDocument&&km(E.ownerDocument.documentElement,E)){if(B!==null&&Sc(E)){var Z=B.start,ie=B.end;if(ie===void 0&&(ie=Z),"selectionStart"in E)E.selectionStart=Z,E.selectionEnd=Math.min(ie,E.value.length);else{var oe=E.ownerDocument||document,W=oe&&oe.defaultView||window;if(W.getSelection){var re=W.getSelection(),he=E.textContent.length,be=Math.min(B.start,he),Ke=B.end===void 0?be:Math.min(B.end,he);!re.extend&&be>Ke&&(x=Ke,Ke=be,be=x);var F=Mm(E,be),H=Mm(E,Ke);if(F&&H&&(re.rangeCount!==1||re.anchorNode!==F.node||re.anchorOffset!==F.offset||re.focusNode!==H.node||re.focusOffset!==H.offset)){var K=oe.createRange();K.setStart(F.node,F.offset),re.removeAllRanges(),be>Ke?(re.addRange(K),re.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),re.addRange(K))}}}}for(oe=[],re=E;re=re.parentNode;)re.nodeType===1&&oe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<oe.length;E++){var ae=oe[E];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Ml=!!Kd,Zd=Kd=null}finally{Le=p,te.p=c,P.T=l}}r.current=s,gt=2}}function Yv(){if(gt===2){gt=0;var r=Hr,s=bs,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=P.T,P.T=null;var c=te.p;te.p=2;var p=Le;Le|=4;try{xv(r,s.alternate,s)}finally{Le=p,te.p=c,P.T=l}}gt=3}}function Gv(){if(gt===4||gt===3){gt=0,Wu();var r=Hr,s=bs,l=vr,c=Dv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?gt=5:(gt=0,bs=Hr=null,Qv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ur=null),rc(l),s=s.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(kt,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=P.T,p=te.p,te.p=2,P.T=null;try{for(var g=r.onRecoverableError,x=0;x<c.length;x++){var E=c[x];g(E.value,{componentStack:E.stack})}}finally{P.T=s,te.p=p}}(vr&3)!==0&&vl(),Ln(r),p=r.pendingLanes,(l&261930)!==0&&(p&42)!==0?r===Bd?Ia++:(Ia=0,Bd=r):Ia=0,Oa(0)}}function Qv(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,fa(s)))}function vl(){return Fv(),Yv(),Gv(),Xv()}function Xv(){if(gt!==5)return!1;var r=Hr,s=zd;zd=0;var l=rc(vr),c=P.T,p=te.p;try{te.p=32>l?32:l,P.T=null,l=jd,jd=null;var g=Hr,x=vr;if(gt=0,bs=Hr=null,vr=0,(Le&6)!==0)throw Error(i(331));var E=Le;if(Le|=4,kv(g.current),Av(g,g.current,x,l),Le=E,Oa(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(kt,g)}catch{}return!0}finally{te.p=p,P.T=c,Qv(r,s)}}function Kv(r,s,l){s=cn(l,s),s=md(r.stateNode,s,2),r=Nr(r,s,2),r!==null&&(Js(r,2),Ln(r))}function Fe(r,s,l){if(r.tag===3)Kv(r,r,l);else for(;s!==null;){if(s.tag===3){Kv(s,r,l);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ur===null||!Ur.has(c))){r=cn(l,r),l=Zg(2),c=Nr(s,l,2),c!==null&&(Jg(l,c,s,r),Js(c,2),Ln(c));break}}s=s.return}}function Ud(r,s,l){var c=r.pingCache;if(c===null){c=r.pingCache=new RC;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(l)||(Od=!0,p.add(l),r=DC.bind(null,r,s,l),s.then(r,r))}function DC(r,s,l){var c=r.pingCache;c!==null&&c.delete(s),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,Je===r&&(Oe&l)===l&&(ot===4||ot===3&&(Oe&62914560)===Oe&&300>Mt()-dl?(Le&2)===0&&xs(r,0):Dd|=l,ys===Oe&&(ys=0)),Ln(r)}function Zv(r,s){s===0&&(s=Fp()),r=fi(r,s),r!==null&&(Js(r,s),Ln(r))}function NC(r){var s=r.memoizedState,l=0;s!==null&&(l=s.retryLane),Zv(r,l)}function zC(r,s){var l=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(s),Zv(r,l)}function jC(r,s){return En(r,s)}var yl=null,Ss=null,Hd=!1,bl=!1,qd=!1,Vr=0;function Ln(r){r!==Ss&&r.next===null&&(Ss===null?yl=Ss=r:Ss=Ss.next=r),bl=!0,Hd||(Hd=!0,PC())}function Oa(r,s){if(!qd&&bl){qd=!0;do for(var l=!1,c=yl;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var g=0;else{var x=c.suspendedLanes,E=c.pingedLanes;g=(1<<31-Ze(42|r)+1)-1,g&=p&~(x&~E),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,ty(c,g))}else g=Oe,g=To(c,c===Je?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||Zs(c,g)||(l=!0,ty(c,g));c=c.next}while(l);qd=!1}}function BC(){Jv()}function Jv(){bl=Hd=!1;var r=0;Vr!==0&&QC()&&(r=Vr);for(var s=Mt(),l=null,c=yl;c!==null;){var p=c.next,g=Wv(c,s);g===0?(c.next=null,l===null?yl=p:l.next=p,p===null&&(Ss=l)):(l=c,(r!==0||(g&3)!==0)&&(bl=!0)),c=p}gt!==0&&gt!==5||Oa(r),Vr!==0&&(Vr=0)}function Wv(r,s){for(var l=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,g=r.pendingLanes&-62914561;0<g;){var x=31-Ze(g),E=1<<x,B=p[x];B===-1?((E&l)===0||(E&c)!==0)&&(p[x]=cw(E,s)):B<=s&&(r.expiredLanes|=E),g&=~E}if(s=Je,l=Oe,l=To(r,r===s?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,l===0||r===s&&($e===2||$e===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Ks(c),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Zs(r,l)){if(s=l&-l,s===r.callbackPriority)return s;switch(c!==null&&Ks(c),rc(l)){case 2:case 8:l=fe;break;case 32:l=xe;break;case 268435456:l=Ve;break;default:l=xe}return c=ey.bind(null,r),l=En(l,c),r.callbackPriority=s,r.callbackNode=l,s}return c!==null&&c!==null&&Ks(c),r.callbackPriority=2,r.callbackNode=null,2}function ey(r,s){if(gt!==0&&gt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(vl()&&r.callbackNode!==l)return null;var c=Oe;return c=To(r,r===Je?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(zv(r,c,s),Wv(r,Mt()),r.callbackNode!=null&&r.callbackNode===l?ey.bind(null,r):null)}function ty(r,s){if(vl())return null;zv(r,s,!0)}function PC(){KC(function(){(Le&6)!==0?En(se,BC):Jv()})}function Vd(){if(Vr===0){var r=os;r===0&&(r=xo,xo<<=1,(xo&261888)===0&&(xo=256)),Vr=r}return Vr}function ny(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ao(""+r)}function ry(r,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,r.id&&l.setAttribute("form",r.id),s.parentNode.insertBefore(l,s),r=new FormData(r),l.parentNode.removeChild(l),r}function LC(r,s,l,c,p){if(s==="submit"&&l&&l.stateNode===p){var g=ny((p[zt]||null).action),x=c.submitter;x&&(s=(s=x[zt]||null)?ny(s.formAction):x.getAttribute("formAction"),s!==null&&(g=s,x=null));var E=new Io("action","action",null,c,p);r.push({event:E,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Vr!==0){var B=x?ry(p,x):new FormData(p);ud(l,{pending:!0,data:B,method:p.method,action:g},null,B)}}else typeof g=="function"&&(E.preventDefault(),B=x?ry(p,x):new FormData(p),ud(l,{pending:!0,data:B,method:p.method,action:g},g,B))},currentTarget:p}]})}}for(var $d=0;$d<Ec.length;$d++){var Fd=Ec[$d],UC=Fd.toLowerCase(),HC=Fd[0].toUpperCase()+Fd.slice(1);Rn(UC,"on"+HC)}Rn(Nm,"onAnimationEnd"),Rn(zm,"onAnimationIteration"),Rn(jm,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(rC,"onTransitionRun"),Rn(iC,"onTransitionStart"),Rn(sC,"onTransitionCancel"),Rn(Bm,"onTransitionEnd"),Gi("onMouseEnter",["mouseout","mouseover"]),Gi("onMouseLeave",["mouseout","mouseover"]),Gi("onPointerEnter",["pointerout","pointerover"]),Gi("onPointerLeave",["pointerout","pointerover"]),li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),li("onBeforeInput",["compositionend","keypress","textInput","paste"]),li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Da="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(" "),qC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Da));function iy(r,s){s=(s&4)!==0;for(var l=0;l<r.length;l++){var c=r[l],p=c.event;c=c.listeners;e:{var g=void 0;if(s)for(var x=c.length-1;0<=x;x--){var E=c[x],B=E.instance,Z=E.currentTarget;if(E=E.listener,B!==g&&p.isPropagationStopped())break e;g=E,p.currentTarget=Z;try{g(p)}catch(ie){No(ie)}p.currentTarget=null,g=B}else for(x=0;x<c.length;x++){if(E=c[x],B=E.instance,Z=E.currentTarget,E=E.listener,B!==g&&p.isPropagationStopped())break e;g=E,p.currentTarget=Z;try{g(p)}catch(ie){No(ie)}p.currentTarget=null,g=B}}}}function Ie(r,s){var l=s[ic];l===void 0&&(l=s[ic]=new Set);var c=r+"__bubble";l.has(c)||(sy(s,r,2,!1),l.add(c))}function Yd(r,s,l){var c=0;s&&(c|=4),sy(l,r,c,s)}var xl="_reactListening"+Math.random().toString(36).slice(2);function Gd(r){if(!r[xl]){r[xl]=!0,Jp.forEach(function(l){l!=="selectionchange"&&(qC.has(l)||Yd(l,!1,r),Yd(l,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[xl]||(s[xl]=!0,Yd("selectionchange",!1,s))}}function sy(r,s,l,c){switch(Ny(s)){case 2:var p=gE;break;case 8:p=vE;break;default:p=uf}l=p.bind(null,s,l,r),p=void 0,!hc||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(s,l,{capture:!0,passive:p}):r.addEventListener(s,l,!0):p!==void 0?r.addEventListener(s,l,{passive:p}):r.addEventListener(s,l,!1)}function Qd(r,s,l,c,p){var g=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var x=c.tag;if(x===3||x===4){var E=c.stateNode.containerInfo;if(E===p)break;if(x===4)for(x=c.return;x!==null;){var B=x.tag;if((B===3||B===4)&&x.stateNode.containerInfo===p)return;x=x.return}for(;E!==null;){if(x=$i(E),x===null)return;if(B=x.tag,B===5||B===6||B===26||B===27){c=g=x;continue e}E=E.parentNode}}c=c.return}cm(function(){var Z=g,ie=dc(l),oe=[];e:{var W=Pm.get(r);if(W!==void 0){var re=Io,he=r;switch(r){case"keypress":if(Mo(l)===0)break e;case"keydown":case"keyup":re=zw;break;case"focusin":he="focus",re=vc;break;case"focusout":he="blur",re=vc;break;case"beforeblur":case"afterblur":re=vc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=hm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=Tw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=Pw;break;case Nm:case zm:case jm:re=Ew;break;case Bm:re=Uw;break;case"scroll":case"scrollend":re=_w;break;case"wheel":re=qw;break;case"copy":case"cut":case"paste":re=Rw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=mm;break;case"toggle":case"beforetoggle":re=$w}var be=(s&4)!==0,Ke=!be&&(r==="scroll"||r==="scrollend"),F=be?W!==null?W+"Capture":null:W;be=[];for(var H=Z,K;H!==null;){var ae=H;if(K=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||K===null||F===null||(ae=ta(H,F),ae!=null&&be.push(Na(H,ae,K))),Ke)break;H=H.return}0<be.length&&(W=new re(W,he,null,l,ie),oe.push({event:W,listeners:be}))}}if((s&7)===0){e:{if(W=r==="mouseover"||r==="pointerover",re=r==="mouseout"||r==="pointerout",W&&l!==cc&&(he=l.relatedTarget||l.fromElement)&&($i(he)||he[Vi]))break e;if((re||W)&&(W=ie.window===ie?ie:(W=ie.ownerDocument)?W.defaultView||W.parentWindow:window,re?(he=l.relatedTarget||l.toElement,re=Z,he=he?$i(he):null,he!==null&&(Ke=o(he),be=he.tag,he!==Ke||be!==5&&be!==27&&be!==6)&&(he=null)):(re=null,he=Z),re!==he)){if(be=hm,ae="onMouseLeave",F="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(be=mm,ae="onPointerLeave",F="onPointerEnter",H="pointer"),Ke=re==null?W:ea(re),K=he==null?W:ea(he),W=new be(ae,H+"leave",re,l,ie),W.target=Ke,W.relatedTarget=K,ae=null,$i(ie)===Z&&(be=new be(F,H+"enter",he,l,ie),be.target=K,be.relatedTarget=Ke,ae=be),Ke=ae,re&&he)t:{for(be=VC,F=re,H=he,K=0,ae=F;ae;ae=be(ae))K++;ae=0;for(var ve=H;ve;ve=be(ve))ae++;for(;0<K-ae;)F=be(F),K--;for(;0<ae-K;)H=be(H),ae--;for(;K--;){if(F===H||H!==null&&F===H.alternate){be=F;break t}F=be(F),H=be(H)}be=null}else be=null;re!==null&&ay(oe,W,re,be,!1),he!==null&&Ke!==null&&ay(oe,Ke,he,be,!0)}}e:{if(W=Z?ea(Z):window,re=W.nodeName&&W.nodeName.toLowerCase(),re==="select"||re==="input"&&W.type==="file")var je=Tm;else if(_m(W))if(wm)je=eC;else{je=Jw;var pe=Zw}else re=W.nodeName,!re||re.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?Z&&uc(Z.elementType)&&(je=Tm):je=Ww;if(je&&(je=je(r,Z))){Sm(oe,je,l,ie);break e}pe&&pe(r,W,Z),r==="focusout"&&Z&&W.type==="number"&&Z.memoizedProps.value!=null&&lc(W,"number",W.value)}switch(pe=Z?ea(Z):window,r){case"focusin":(_m(pe)||pe.contentEditable==="true")&&(Wi=pe,Tc=Z,ua=null);break;case"focusout":ua=Tc=Wi=null;break;case"mousedown":wc=!0;break;case"contextmenu":case"mouseup":case"dragend":wc=!1,Om(oe,l,ie);break;case"selectionchange":if(nC)break;case"keydown":case"keyup":Om(oe,l,ie)}var Ae;if(bc)e:{switch(r){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else Ji?bm(r,l)&&(De="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(gm&&l.locale!=="ko"&&(Ji||De!=="onCompositionStart"?De==="onCompositionEnd"&&Ji&&(Ae=dm()):(Ar=ie,pc="value"in Ar?Ar.value:Ar.textContent,Ji=!0)),pe=_l(Z,De),0<pe.length&&(De=new pm(De,r,null,l,ie),oe.push({event:De,listeners:pe}),Ae?De.data=Ae:(Ae=xm(l),Ae!==null&&(De.data=Ae)))),(Ae=Yw?Gw(r,l):Qw(r,l))&&(De=_l(Z,"onBeforeInput"),0<De.length&&(pe=new pm("onBeforeInput","beforeinput",null,l,ie),oe.push({event:pe,listeners:De}),pe.data=Ae)),LC(oe,r,Z,l,ie)}iy(oe,s)})}function Na(r,s,l){return{instance:r,listener:s,currentTarget:l}}function _l(r,s){for(var l=s+"Capture",c=[];r!==null;){var p=r,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=ta(r,l),p!=null&&c.unshift(Na(r,p,g)),p=ta(r,s),p!=null&&c.push(Na(r,p,g))),r.tag===3)return c;r=r.return}return[]}function VC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function ay(r,s,l,c,p){for(var g=s._reactName,x=[];l!==null&&l!==c;){var E=l,B=E.alternate,Z=E.stateNode;if(E=E.tag,B!==null&&B===c)break;E!==5&&E!==26&&E!==27||Z===null||(B=Z,p?(Z=ta(l,g),Z!=null&&x.unshift(Na(l,Z,B))):p||(Z=ta(l,g),Z!=null&&x.push(Na(l,Z,B)))),l=l.return}x.length!==0&&r.push({event:s,listeners:x})}var $C=/\r\n?/g,FC=/\u0000|\uFFFD/g;function oy(r){return(typeof r=="string"?r:""+r).replace($C,`
49`).replace(FC,"")}function ly(r,s){return s=oy(s),oy(r)===s}function Xe(r,s,l,c,p,g){switch(l){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Xi(r,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Xi(r,""+c);break;case"className":Co(r,"class",c);break;case"tabIndex":Co(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Co(r,l,c);break;case"style":lm(r,c,g);break;case"data":if(s!=="object"){Co(r,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||l!=="href")){r.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(l);break}c=Ao(""+c),r.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(l,"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 g=="function"&&(l==="formAction"?(s!=="input"&&Xe(r,s,"name",p.name,p,null),Xe(r,s,"formEncType",p.formEncType,p,null),Xe(r,s,"formMethod",p.formMethod,p,null),Xe(r,s,"formTarget",p.formTarget,p,null)):(Xe(r,s,"encType",p.encType,p,null),Xe(r,s,"method",p.method,p,null),Xe(r,s,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(l);break}c=Ao(""+c),r.setAttribute(l,c);break;case"onClick":c!=null&&(r.onclick=nr);break;case"onScroll":c!=null&&Ie("scroll",r);break;case"onScrollEnd":c!=null&&Ie("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}l=Ao(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(l,""+c):r.removeAttribute(l);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"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":c===!0?r.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(l,c):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(l,c):r.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(l):r.setAttribute(l,c);break;case"popover":Ie("beforetoggle",r),Ie("toggle",r),wo(r,"popover",c);break;case"xlinkActuate":tr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":tr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":tr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":tr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":tr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":tr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":tr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":tr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":tr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":wo(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=bw.get(l)||l,wo(r,l,c))}}function Xd(r,s,l,c,p,g){switch(l){case"style":lm(r,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"children":typeof c=="string"?Xi(r,c):(typeof c=="number"||typeof c=="bigint")&&Xi(r,""+c);break;case"onScroll":c!=null&&Ie("scroll",r);break;case"onScrollEnd":c!=null&&Ie("scrollend",r);break;case"onClick":c!=null&&(r.onclick=nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),g=r[zt]||null,g=g!=null?g[l]:null,typeof g=="function"&&r.removeEventListener(s,g,p),typeof c=="function")){typeof g!="function"&&g!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(s,c,p);break e}l in r?r[l]=c:c===!0?r.setAttribute(l,""):wo(r,l,c)}}}function wt(r,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",r),Ie("load",r);var c=!1,p=!1,g;for(g in l)if(l.hasOwnProperty(g)){var x=l[g];if(x!=null)switch(g){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Xe(r,s,g,x,l,null)}}p&&Xe(r,s,"srcSet",l.srcSet,l,null),c&&Xe(r,s,"src",l.src,l,null);return;case"input":Ie("invalid",r);var E=g=x=p=null,B=null,Z=null;for(c in l)if(l.hasOwnProperty(c)){var ie=l[c];if(ie!=null)switch(c){case"name":p=ie;break;case"type":x=ie;break;case"checked":B=ie;break;case"defaultChecked":Z=ie;break;case"value":g=ie;break;case"defaultValue":E=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,s));break;default:Xe(r,s,c,ie,l,null)}}im(r,g,E,B,Z,x,p,!1);return;case"select":Ie("invalid",r),c=x=g=null;for(p in l)if(l.hasOwnProperty(p)&&(E=l[p],E!=null))switch(p){case"value":g=E;break;case"defaultValue":x=E;break;case"multiple":c=E;default:Xe(r,s,p,E,l,null)}s=g,l=x,r.multiple=!!c,s!=null?Qi(r,!!c,s,!1):l!=null&&Qi(r,!!c,l,!0);return;case"textarea":Ie("invalid",r),g=p=c=null;for(x in l)if(l.hasOwnProperty(x)&&(E=l[x],E!=null))switch(x){case"value":c=E;break;case"defaultValue":p=E;break;case"children":g=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:Xe(r,s,x,E,l,null)}am(r,c,p,g);return;case"option":for(B in l)l.hasOwnProperty(B)&&(c=l[B],c!=null)&&(B==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":Xe(r,s,B,c,l,null));return;case"dialog":Ie("beforetoggle",r),Ie("toggle",r),Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":Ie("load",r);break;case"video":case"audio":for(c=0;c<Da.length;c++)Ie(Da[c],r);break;case"image":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"embed":case"source":case"link":Ie("error",r),Ie("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in l)if(l.hasOwnProperty(Z)&&(c=l[Z],c!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Xe(r,s,Z,c,l,null)}return;
vendor: 8,088 bytes, line 49
49default:if(uc(s)){for(ie in l)l.hasOwnProperty(ie)&&(c=l[ie],c!==void 0&&Xd(r,s,ie,c,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(c=l[E],c!=null&&Xe(r,s,E,c,l,null))}function YC(r,s,l,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,x=null,E=null,B=null,Z=null,ie=null;for(re in l){var oe=l[re];if(l.hasOwnProperty(re)&&oe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":B=oe;default:c.hasOwnProperty(re)||Xe(r,s,re,null,c,oe)}}for(var W in c){var re=c[W];if(oe=l[W],c.hasOwnProperty(W)&&(re!=null||oe!=null))switch(W){case"type":g=re;break;case"name":p=re;break;case"checked":Z=re;break;case"defaultChecked":ie=re;break;case"value":x=re;break;case"defaultValue":E=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,s));break;default:re!==oe&&Xe(r,s,W,re,c,oe)}}oc(r,x,E,B,Z,ie,g,p);return;case"select":re=x=E=W=null;for(g in l)if(B=l[g],l.hasOwnProperty(g)&&B!=null)switch(g){case"value":break;case"multiple":re=B;default:c.hasOwnProperty(g)||Xe(r,s,g,null,c,B)}for(p in c)if(g=c[p],B=l[p],c.hasOwnProperty(p)&&(g!=null||B!=null))switch(p){case"value":W=g;break;case"defaultValue":E=g;break;case"multiple":x=g;default:g!==B&&Xe(r,s,p,g,c,B)}s=E,l=x,c=re,W!=null?Qi(r,!!l,W,!1):!!c!=!!l&&(s!=null?Qi(r,!!l,s,!0):Qi(r,!!l,l?[]:"",!1));return;case"textarea":re=W=null;for(E in l)if(p=l[E],l.hasOwnProperty(E)&&p!=null&&!c.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Xe(r,s,E,null,c,p)}for(x in c)if(p=c[x],g=l[x],c.hasOwnProperty(x)&&(p!=null||g!=null))switch(x){case"value":W=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==g&&Xe(r,s,x,p,c,g)}sm(r,W,re);return;case"option":for(var he in l)W=l[he],l.hasOwnProperty(he)&&W!=null&&!c.hasOwnProperty(he)&&(he==="selected"?r.selected=!1:Xe(r,s,he,null,c,W));for(B in c)W=c[B],re=l[B],c.hasOwnProperty(B)&&W!==re&&(W!=null||re!=null)&&(B==="selected"?r.selected=W&&typeof W!="function"&&typeof W!="symbol":Xe(r,s,B,W,c,re));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 be in l)W=l[be],l.hasOwnProperty(be)&&W!=null&&!c.hasOwnProperty(be)&&Xe(r,s,be,null,c,W);for(Z in c)if(W=c[Z],re=l[Z],c.hasOwnProperty(Z)&&W!==re&&(W!=null||re!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,s));break;default:Xe(r,s,Z,W,c,re)}return;default:if(uc(s)){for(var Ke in l)W=l[Ke],l.hasOwnProperty(Ke)&&W!==void 0&&!c.hasOwnProperty(Ke)&&Xd(r,s,Ke,void 0,c,W);for(ie in c)W=c[ie],re=l[ie],!c.hasOwnProperty(ie)||W===re||W===void 0&&re===void 0||Xd(r,s,ie,W,c,re);return}}for(var F in l)W=l[F],l.hasOwnProperty(F)&&W!=null&&!c.hasOwnProperty(F)&&Xe(r,s,F,null,c,W);for(oe in c)W=c[oe],re=l[oe],!c.hasOwnProperty(oe)||W===re||W==null&&re==null||Xe(r,s,oe,W,c,re)}function uy(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GC(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],g=p.transferSize,x=p.initiatorType,E=p.duration;if(g&&E&&uy(x)){for(x=0,E=p.responseEnd,c+=1;c<l.length;c++){var B=l[c],Z=B.startTime;if(Z>E)break;var ie=B.transferSize,oe=B.initiatorType;ie&&uy(oe)&&(B=B.responseEnd,x+=ie*(B<E?1:(E-Z)/(B-Z)))}if(--c,s+=8*(g+x)/(p.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Kd=null,Zd=null;function Sl(r){return r.nodeType===9?r:r.ownerDocument}function cy(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dy(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function Jd(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Wd=null;function QC(){var r=window.event;return r&&r.type==="popstate"?r===Wd?!1:(Wd=r,!0):(Wd=null,!1)}var fy=typeof setTimeout=="function"?setTimeout:void 0,XC=typeof clearTimeout=="function"?clearTimeout:void 0,hy=typeof Promise=="function"?Promise:void 0,KC=typeof queueMicrotask=="function"?queueMicrotask:typeof hy<"u"?function(r){return hy.resolve(null).then(r).catch(ZC)}:fy;function ZC(r){setTimeout(function(){throw r})}function $r(r){return r==="head"}function py(r,s){var l=s,c=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){r.removeChild(p),Es(s);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")za(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,za(l);for(var g=l.firstChild;g;){var x=g.nextSibling,E=g.nodeName;g[Ws]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=x}}else l==="body"&&za(r.ownerDocument.body);l=p}while(l);Es(s)}function my(r,s){var l=r;r=0;do{var c=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=c}while(l)}function ef(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ef(l),sc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function JC(r,s,l,c){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ws])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(g=r.getAttribute("rel"),g==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(g!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(g=r.getAttribute("src"),(g!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===g)return r}else return r;if(r=mn(r.nextSibling),r===null)break}return null}function WC(r,s,l){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=mn(r.nextSibling),r===null))return null;return r}function gy(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=mn(r.nextSibling),r===null))return null;return r}function tf(r){return r.data==="$?"||r.data==="$~"}function nf(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function eE(r,s){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||l.readyState!=="loading")s();else{var c=function(){s(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function mn(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;
vendor: 3,291 bytes, line 49
49if(s==="/$"||s==="/&")return null}}return r}var rf=null;function vy(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(s===0)return mn(r.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}r=r.nextSibling}return null}function yy(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return r;s--}else l!=="/$"&&l!=="/&"||s++}r=r.previousSibling}return null}function by(r,s,l){switch(s=Sl(l),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function za(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);sc(r)}var gn=new Map,xy=new Set;function Tl(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var yr=te.d;te.d={f:tE,r:nE,D:rE,C:iE,L:sE,m:aE,X:lE,S:oE,M:uE};function tE(){var r=yr.f(),s=pl();return r||s}function nE(r){var s=Fi(r);s!==null&&s.tag===5&&s.type==="form"?Bg(s):yr.r(r)}var Ts=typeof document>"u"?null:document;function _y(r,s,l){var c=Ts;if(c&&typeof s=="string"&&s){var p=ln(s);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),xy.has(p)||(xy.add(p),r={rel:r,crossOrigin:l,href:s},c.querySelector(p)===null&&(s=c.createElement("link"),wt(s,"link",r),vt(s),c.head.appendChild(s)))}}function rE(r){yr.D(r),_y("dns-prefetch",r,null)}function iE(r,s){yr.C(r,s),_y("preconnect",r,s)}function sE(r,s,l){yr.L(r,s,l);var c=Ts;if(c&&r&&s){var p='link[rel="preload"][as="'+ln(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+ln(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+ln(l.imageSizes)+'"]')):p+='[href="'+ln(r)+'"]';var g=p;switch(s){case"style":g=ws(r);break;case"script":g=Cs(r)}gn.has(g)||(r=v({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:r,as:s},l),gn.set(g,r),c.querySelector(p)!==null||s==="style"&&c.querySelector(ja(g))||s==="script"&&c.querySelector(Ba(g))||(s=c.createElement("link"),wt(s,"link",r),vt(s),c.head.appendChild(s)))}}function aE(r,s){yr.m(r,s);var l=Ts;if(l&&r){var c=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+ln(c)+'"][href="'+ln(r)+'"]',g=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Cs(r)}if(!gn.has(g)&&(r=v({rel:"modulepreload",href:r},s),gn.set(g,r),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ba(g)))return}c=l.createElement("link"),wt(c,"link",r),vt(c),l.head.appendChild(c)}}}function oE(r,s,l){yr.S(r,s,l);var c=Ts;if(c&&r){var p=Yi(c).hoistableStyles,g=ws(r);s=s||"default";var x=p.get(g);if(!x){var E={loading:0,preload:null};if(x=c.querySelector(ja(g)))E.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":s},l),(l=gn.get(g))&&sf(r,l);var B=x=c.createElement("link");vt(B),wt(B,"link",r),B._p=new Promise(function(Z,ie){B.onload=Z,B.onerror=ie}),B.addEventListener("load",function(){E.loading|=1}),B.addEventListener("error",function(){E.loading|=2}),E.loading|=4,wl(x,s,c)}
vendor: 5,509 bytes, line 49
49x={type:"stylesheet",instance:x,count:1,state:E},p.set(g,x)}}}function lE(r,s){yr.X(r,s);var l=Ts;if(l&&r){var c=Yi(l).hoistableScripts,p=Cs(r),g=c.get(p);g||(g=l.querySelector(Ba(p)),g||(r=v({src:r,async:!0},s),(s=gn.get(p))&&af(r,s),g=l.createElement("script"),vt(g),wt(g,"link",r),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function uE(r,s){yr.M(r,s);var l=Ts;if(l&&r){var c=Yi(l).hoistableScripts,p=Cs(r),g=c.get(p);g||(g=l.querySelector(Ba(p)),g||(r=v({src:r,async:!0,type:"module"},s),(s=gn.get(p))&&af(r,s),g=l.createElement("script"),vt(g),wt(g,"link",r),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function Sy(r,s,l,c){var p=(p=ge.current)?Tl(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=ws(l.href),l=Yi(p).hoistableStyles,c=l.get(s),c||(c={type:"style",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=ws(l.href);var g=Yi(p).hoistableStyles,x=g.get(r);if(x||(p=p.ownerDocument||p,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,x),(g=p.querySelector(ja(r)))&&!g._p&&(x.instance=g,x.state.loading=5),gn.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},gn.set(r,l),g||cE(p,r,l,x.state))),s&&c===null)throw Error(i(528,""));return x}if(s&&c!==null)throw Error(i(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Cs(l),l=Yi(p).hoistableScripts,c=l.get(s),c||(c={type:"script",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function ws(r){return'href="'+ln(r)+'"'}function ja(r){return'link[rel="stylesheet"]['+r+"]"}function Ty(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function cE(r,s,l,c){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=r.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),wt(s,"link",l),vt(s),r.head.appendChild(s))}function Cs(r){return'[src="'+ln(r)+'"]'}function Ba(r){return"script[async]"+r}function wy(r,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var c=r.querySelector('style[data-href~="'+ln(l.href)+'"]');if(c)return s.instance=c,vt(c),c;var p=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),vt(c),wt(c,"style",p),wl(c,l.precedence,r),s.instance=c;case"stylesheet":p=ws(l.href);var g=r.querySelector(ja(p));if(g)return s.state.loading|=4,s.instance=g,vt(g),g;c=Ty(l),(p=gn.get(p))&&sf(c,p),g=(r.ownerDocument||r).createElement("link"),vt(g);var x=g;return x._p=new Promise(function(E,B){x.onload=E,x.onerror=B}),wt(g,"link",c),s.state.loading|=4,wl(g,l.precedence,r),s.instance=g;case"script":return g=Cs(l.src),(p=r.querySelector(Ba(g)))?(s.instance=p,vt(p),p):(c=l,(p=gn.get(g))&&(c=v({},l),af(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),vt(p),wt(p,"link",c),r.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,wl(c,l.precedence,r));return s.instance}function wl(r,s,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,g=p,x=0;x<c.length;x++){var E=c[x];if(E.dataset.precedence===s)g=E;else if(g!==p)break}g?g.parentNode.insertBefore(r,g.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(r,s.firstChild))}function sf(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function af(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var Cl=null;function Cy(r,s,l){if(Cl===null){var c=new Map,p=Cl=new Map;p.set(l,c)}else p=Cl,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(r))return c;for(c.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var g=l[p];if(!(g[Ws]||g[xt]||r==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var x=g.getAttribute(s)||"";x=r+x;var E=c.get(x);E?E.push(g):c.set(x,[g])}}return c}function Ey(r,s,l){r=r.ownerDocument||r,r.head.insertBefore(l,s==="title"?r.querySelector("head > title"):null)}function dE(r,s,l){if(l===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Ay(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function fE(r,s,l,c){if(l.type==="stylesheet"&&(typeof c.media!="str
49ing"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=ws(c.href),g=s.querySelector(ja(p));if(g){s=g._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=El.bind(r),s.then(r,r)),l.state.loading|=4,l.instance=g,vt(g);return}g=s.ownerDocument||s,c=Ty(c),(p=gn.get(p))&&sf(c,p),g=g.createElement("link"),vt(g);var x=g;x._p=new Promise(function(E,B){x.onload=E,x.onerror=B}),wt(g,"link",c),l.instance=g}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=El.bind(r),s.addEventListener("load",l),s.addEventListener("error",l))}}var of=0;function hE(r,s){return r.stylesheets&&r.count===0&&Rl(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var c=setTimeout(function(){if(r.stylesheets&&Rl(r,r.stylesheets),r.unsuspend){var g=r.unsuspend;r.unsuspend=null,g()}},6e4+s);0<r.imgBytes&&of===0&&(of=62500*GC());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Rl(r,r.stylesheets),r.unsuspend)){var g=r.unsuspend;r.unsuspend=null,g()}},(r.imgBytes>of?50:800)+s);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function El(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rl(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Al=null;function Rl(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Al=new Map,s.forEac
vendor: 11,290 bytes, line 49
49h(pE,r),Al=null,El.call(r))}function pE(r,s){if(!(s.state.loading&4)){var l=Al.get(r);if(l)var c=l.get(null);else{l=new Map,Al.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var x=p[g];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(l.set(x.dataset.precedence,x),c=x)}c&&l.set(null,c)}p=s.instance,x=p.getAttribute("data-precedence"),g=l.get(x)||c,g===c&&l.set(null,p),l.set(x,p),this.count++,c=El.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),g?g.parentNode.insertBefore(p,g.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),s.state.loading|=4}}var Pa={$$typeof:R,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function mE(r,s,l,c,p,g,x,E,B){this.tag=1,this.containerInfo=r,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=tc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tc(0),this.hiddenUpdates=tc(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Ry(r,s,l,c,p,g,x,E,B,Z,ie,oe){return r=new mE(r,s,l,x,B,Z,ie,oe,E),s=1,g===!0&&(s|=24),g=Kt(3,null,null,s),r.current=g,g.stateNode=r,s=Lc(),s.refCount++,r.pooledCache=s,s.refCount++,g.memoizedState={element:c,isDehydrated:l,cache:s},Vc(g),r}function My(r){return r?(r=ns,r):ns}function ky(r,s,l,c,p,g){p=My(p),c.context===null?c.context=p:c.pendingContext=p,c=Dr(s),c.payload={element:l},g=g===void 0?null:g,g!==null&&(c.callback=g),l=Nr(r,c,s),l!==null&&(Ht(l,r,s),ga(l,r,s))}function Iy(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<s?l:s}}function lf(r,s){Iy(r,s),(r=r.alternate)&&Iy(r,s)}function Oy(r){if(r.tag===13||r.tag===31){var s=fi(r,67108864);s!==null&&Ht(s,r,67108864),lf(r,67108864)}}function Dy(r){if(r.tag===13||r.tag===31){var s=tn();s=nc(s);var l=fi(r,s);l!==null&&Ht(l,r,s),lf(r,s)}}var Ml=!0;function gE(r,s,l,c){var p=P.T;P.T=null;var g=te.p;try{te.p=2,uf(r,s,l,c)}finally{te.p=g,P.T=p}}function vE(r,s,l,c){var p=P.T;P.T=null;var g=te.p;try{te.p=8,uf(r,s,l,c)}finally{te.p=g,P.T=p}}function uf(r,s,l,c){if(Ml){var p=cf(c);if(p===null)Qd(r,s,c,kl,l),zy(r,c);else if(bE(p,r,s,l,c))c.stopPropagation();else if(zy(r,c),s&4&&-1<yE.indexOf(r)){for(;p!==null;){var g=Fi(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var x=oi(g.pendingLanes);if(x!==0){var E=g;for(E.pendingLanes|=2,E.entangledLanes|=2;x;){var B=1<<31-Ze(x);E.entanglements[1]|=B,x&=~B}Ln(g),(Le&6)===0&&(fl=Mt()+500,Oa(0))}}break;case 31:case 13:E=fi(g,2),E!==null&&Ht(E,g,2),pl(),lf(g,2)}if(g=cf(c),g===null&&Qd(r,s,c,kl,l),g===p)break;p=g}p!==null&&c.stopPropagation()}else Qd(r,s,c,null,l)}}function cf(r){return r=dc(r),df(r)}var kl=null;function df(r){if(kl=null,r=$i(r),r!==null){var s=o(r);if(s===null)r=null;else{var l=s.tag;if(l===13){if(r=u(s),r!==null)return r;r=null}else if(l===31){if(r=d(s),r!==null)return r;r=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return kl=r,null}function Ny(r){switch(r){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(ec()){case se:return 2;case fe:return 8;case xe:case Me:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var ff=!1,Fr=null,Yr=null,Gr=null,La=new Map,Ua=new Map,Qr=[],yE="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(r,s){switch(r){case"focusin":case"focusout":Fr=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Gr=null;break;case"pointerover":case"pointerout":La.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ua.delete(s.pointerId)}}function Ha(r,s,l,c,p,g){return r===null||r.nativeEvent!==g?(r={blockedOn:s,domEventName:l,eventSystemFlags:c,nativeEvent:g,targetContainers:[p]},s!==null&&(s=Fi(s),s!==null&&Oy(s)),r):(r.eventSystemFlags|=c,s=r.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),r)}function bE(r,s,l,c,p){switch(s){case"focusin":return Fr=Ha(Fr,r,s,l,c,p),!0;case"dragenter":return Yr=Ha(Yr,r,s,l,c,p),!0;case"mouseover":return Gr=Ha(Gr,r,s,l,c,p),!0;case"pointerover":var g=p.pointerId;return La.set(g,Ha(La.get(g)||null,r,s,l,c,p)),!0;case"gotpointercapture":return g=p.pointerId,Ua.set(g,Ha(Ua.get(g)||null,r,s,l,c,p)),!0}return!1}function jy(r){var s=$i(r.target);if(s!==null){var l=o(s);if(l!==null){if(s=l.tag,s===13){if(s=u(l),s!==null){r.blockedOn=s,Kp(r.priority,function(){Dy(l)});return}}else if(s===31){if(s=d(l),s!==null){r.blockedOn=s,Kp(r.priority,function(){Dy(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Il(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var l=cf(r.nativeEvent);if(l===null){l=r.nativeEvent;var c=new l.constructor(l.type,l);cc=c,l.target.dispatchEvent(c),cc=null}else return s=Fi(l),s!==null&&Oy(s),r.blockedOn=l,!1;s.shift()}return!0}function By(r,s,l){Il(r)&&l.delete(s)}function xE(){ff=!1,Fr!==null&&Il(Fr)&&(Fr=null),Yr!==null&&Il(Yr)&&(Yr=null),Gr!==null&&Il(Gr)&&(Gr=null),La.forEach(By),Ua.forEach(By)}function Ol(r,s){r.blockedOn===s&&(r.blockedOn=null,ff||(ff=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xE)))}var Dl=null;function Py(r){Dl!==r&&(Dl=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Dl===r&&(Dl=null);for(var s=0;s<r.length;s+=3){var l=r[s],c=r[s+1],p=r[s+2];if(typeof c!="function"){if(df(c||l)===null)continue;break}var g=Fi(l);g!==null&&(r.splice(s,3),s-=3,ud(g,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Es(r){function s(B){return Ol(B,r)}Fr!==null&&Ol(Fr,r),Yr!==null&&Ol(Yr,r),Gr!==null&&Ol(Gr,r),La.forEach(s),Ua.forEach(s);for(var l=0;l<Qr.length;l++){var c=Qr[l];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Qr.length&&(l=Qr[0],l.blockedOn===null);)jy(l),l.blockedOn===null&&Qr.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],g=l[c+1],x=p[zt]||null;if(typeof g=="function")x||Py(l);else if(x){var E=null;if(g&&g.hasAttribute("formAction")){if(p=g,x=g[zt]||null)E=x.formAction;else if(df(p)!==null)continue}else E=x.action;typeof E=="function"?l[c+1]=E:(l.splice(c,3),c-=3),Py(l)}}}function Ly(){function r(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(x){return p=x})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function hf(r){this._internalRoot=r}Nl.prototype.render=hf.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var l=s.current,c=tn();ky(l,c,r,s,null,null)},Nl.prototype.unmount=hf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;ky(r.current,2,null,r,null,null),pl(),s[Vi]=null}};function Nl(r){this._internalRoot=r}Nl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Xp();r={blockedOn:null,target:r,priority:s};for(var l=0;l<Qr.length&&s!==0&&s<Qr[l].priority;l++);Qr.splice(l,0,r),l===0&&jy(r)}};var Uy=e.version;if(Uy!=="19.2.8")throw Error(i(527,Uy,"19.2.8"));te.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(s),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var _E={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zl.isDisabled&&zl.supportsFiber)try{kt=zl.inject(_E),mt=zl}catch{}}return Fa.createRoot=function(r,s){if(!a(r))throw Error(i(299));var l=!1,c="",p=Gg,g=Qg,x=Xg;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError)),s=Ry(r,1,!1,null,null,l,c,null,p,g,x,Ly),r[Vi]=s.current,Gd(r),new hf(s)},Fa.hydrateRoot=function(r,s,l){if(!a(r))throw Error(i(299));var c=!1,p="",g=Gg,x=Qg,E=Xg,B=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(x=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(B=l.formState)),s=Ry(r,1,!0,s,l??null,c,p,B,g,x,E,Ly),s.context=My(null),l=s.current,c=tn(),c=nc(c),p=Dr(c),p.callback=null,Nr(l,p,c),l=c,s.current.lanes=l,Js(s,l),Ln(s),r[Vi]=s.current,Gd(r),new Nl(s)},Fa.version="19.2.8",Fa}var n0;function DE(){if(n0)return vf.exports;n0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}
49return t(),vf.exports=OE(),vf.exports}var NE=DE();let As=null;function zE(t,e){t.currentIndex=0,t.wipContextDeps=null,t.wipCommitCallbacks=[];const n=As;As=t;try{if(e(),t.isFirstRender=!1,t.cells.length!==t.currentIndex)throw new Error(`Rendered ${t.currentIndex} hooks but expected ${t.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{As=n}}function Kr(){if(!As)throw new Error("No resource fiber available");return As}function Rs(){return As}const _f=Symbol("tap.Context.defaultValue"),jE=t=>t;let Un=new Map;const Ci=new Set,r0=()=>new Map(Un),i0=(t,e)=>{const n=Un;Un=t;try{return e()}finally{Un=n}},s0=(t,e)=>{t[_f]=e},a0=t=>typeof t=="object"&&t!==null&&_f in t,o0=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&t.$$typeof===Symbol.for("react.context"),Sf=t=>a0(t)||o0(t),l0=t=>{if(!a0(t)){if(o0(t)){s0(t,t._currentValue??t._currentValue2);return}throw new Error("A tap resource's `use()` only accepts a tap context.")}},u0=(t,e,n)=>{if(typeof t!="object"||t===null)throw new Error("useContextProvider only accepts a React context.");l0(t);const i=t,a=Kr(),o=Ce(void 0),u=o.current===void 0||!Object.is(o.current.value,e);ye(()=>{o.current={value:e}},[e]);const d=Un.get(i),f=d!==void 0||Un.has(i);Un.set(i,{value:e,source:a});try{return BE(i,u,n)}finally{f?Un.set(i,d):Un.delete(i)}},BE=(t,e,n)=>{const i=Ci.has(t);e?Ci.add(t):Ci.delete(t);try{return n()}finally{i?Ci.add(t):Ci.delete(t)}},PE=t=>{l0(t);const e=t,n=LE(e,t),i=Kr();return(i.wipContextDeps??(i.wipContextDeps=new Map)).set(e,n.source),n.value},LE=(t,e)=>Un.get(t)??{value:jE(e)[_f],source:null},UE=(t,e,n,i)=>{if(!i)return n;let a=n;for(const[o,u]of i)u===e||u===t||(a??(a=new Map)).set(o,u);return a},c0=(t,e=t.wipContextDeps)=>{const n=Rs();!n||!e||(n.wipContextDeps=UE(n,t,n.wipContextDeps,e))},d0=()=>Ci.size>0,Tf=t=>{if(!t.contextDeps||!d0())return!1;for(const e of Ci.keys())if(t.contextDeps.has(e))return!0;return!1},HE=[0,1,2,3];function qE(t){const e=[];for(const n of HE){const i=t[n];if(i!==void 0)for(let a=0;a<i.length;a++)try{i[a]()}catch(o){e.push(o)}}if(e.length>0){if(e.length===1)throw e[0];for(const n of e)console.error(n);throw new AggregateError(e,"Errors during commit")}}function VE(t){var e;const n=[];for(const i of t.cells)if(i?.type==="effect"&&(i.deps=null,i.cleanup))try{(e=i.cleanup)==null||e.call(i)}catch(a){n.push(a)}finally{i.cleanup=void 0}if(n.length>0){if(n.length===1)throw n[0];for(const i of n)console.error(i);throw new AggregateError(n,"Errors during cleanup")}}const f0=t=>({version:0,committedVersion:0,context:r0(),dispatchUpdate:t,changelog:[],rollbackCallbacks:[]}),Vl=t=>{t.committedVersion=t.version,t.changelog.length=0,t.rollbackCallbacks.length=0},Ya=(t,e)=>{const n=t.version>e;if(t.version=e,n){for(let i=0;i<t.rollbackCallbacks.length;i++)t.rollbackCallbacks[i]();if(t.rollbackCallbacks.length=0,e===t.committedVersion)t.changelog.length=0;else{if(t.committedVersion>e)throw new Error("Version is less than committed version");for(;t.committedVersion+t.changelog.length>e;)t.changelog.pop();for(let i=0;i<t.changelog.length;i++)h0(t.changelog[i]);Vl(t)}}},h0=t=>{var e;m0(t.fiber,t.cell),t.queued||(t.queued=!0,((e=t.cell).queue??(e.queue=[])).push(t))},Ga=(t,e,n)=>{const i=t.wipCommitCallbacks;(i[e]??(i[e]=[])).push(n)},p0=(t,e)=>{t.rollbackCallbacks.push(e)},m0=(t,e)=>{var n;e.isDirty||(e.isDirty=!0,(n=t.markDirty)==null||n.call(t),p0(t.root,()=>{if(e.queue!==null){for(const i of e.queue)i.queued=!1;e.queue=null}e.workInProgress=e.current,e.isDirty=!1}))},wf=()=>{throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.")},Cf=()=>{throw new Error("Hook order changed between renders")},$E=(t,e,n)=>{if(t.isNeverMounted)throw new Error("Resource updated before mount");let i=!1,a=!0;t.root.dispatchUpdate(()=>(i||(i=!0,n&&t.root.changelog.length===0&&!e.cell.isDirty&&!e.hasEagerState&&(e.eagerState=n(e.cell.workInProgress,e.action),e.hasEagerState=!0,a=!Object.is(e.cell.current,e.eagerState))),a),()=>(i=!0,a=!0,h0(e),t.root.changelog.push(e),!0))},FE=(t,e,n,i,a)=>{const o=i?i(n):n,u={type:"reducer",workInProgress:o,current:o,isDirty:!1,queue:null,renderQueue:null,reducer:e,dispatch:d=>{const f=Rs();if(f!==null){if(f!==t)throw new Error("Cannot update a resource while rendering a different resource.");(t.renderPendingCells??(t.renderPendingCells=new Set)).add(u),(u.renderQueue??(u.renderQueue=[])).push(d)}else $E(t,{fiber:t,cell:u,action:d,hasEagerState:!1,eagerState:void 0,queued:!1},a?e:void 0)}};return u};function g0(t,e,n,i){var a;const o=Kr(),u=o.currentIndex++,d=o.cells[u],f=(()=>
49{if(d!==void 0)return d.type==="reducer"?d:Cf();!o.isFirstRender&&u>=o.cells.length&&wf();const m=FE(o,t,e,n,i);return o.cells[u]=m,m})(),h=f.queue;if(h!==null){const m=t===f.reducer;for(let v=0;v<h.length;v++){const y=h[v];(!y.hasEagerState||!m)&&(y.eagerState=t(f.workInProgress,y.action),y.hasEagerState=!0),y.queued=!1,f.workInProgress=y.eagerState}f.queue=null}if(f.reducer=t,f.renderQueue!==null){let m=f.workInProgress;for(const v of f.renderQueue)m=t(m,v);f.renderQueue=null,(a=o.renderPendingCells)==null||a.delete(f),Object.is(m,f.workInProgress)||(m0(o,f),f.workInProgress=m)}return f.isDirty&&Ga(o,0,()=>{f.current=f.workInProgress,f.isDirty=!1}),[f.workInProgress,f.dispatch]}function v0(t,e,n){return g0(t,e,n,!1)}const YE=(t,e)=>typeof e=="function"?e(t):e,GE=t=>t===void 0?void 0:typeof t=="function"?t():t;function Ef(t){return g0(YE,t,GE,!0)}const $l=(t,e)=>{for(let n=0;n<t.length&&n<e.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0},y0=(t,e)=>{Ga(t,0,()=>{e.current=e.wip,e.currentDeps=e.wipDeps,e.isDirty=!1})},Fl=(t,e)=>{const n=Kr(),i=n.currentIndex++;let a=n.cells[i];if(a===void 0){!n.isFirstRender&&i>=n.cells.length&&wf();const d=t();return a={type:"memo",current:d,currentDeps:e,wip:d,wipDeps:e,isDirty:!1},n.cells[i]=a,d}a.type!=="memo"&&Cf();const o=a;if($l(o.wipDeps,e))return o.isDirty&&y0(n,o),o.wip;const u=t();return o.wip=u,o.wipDeps=e,o.isDirty||(o.isDirty=!0,p0(n.root,()=>{o.wip=o.current,o.wipDeps=o.currentDeps,o.isDirty=!1})),y0(n,o),u};function Yl(t){return Fl(()=>({current:t}),[])}const Af=(t,e)=>Fl(()=>t,e),QE=()=>({type:"effect",cleanup:void 0,deps:null});function Ms(t,e){const n=Kr(),i=n.currentIndex++,a=n.cells[i],o=a===void 0?QE():a.type==="effect"?a:Cf();if(a===void 0&&(!n.isFirstRender&&i>=n.cells.length&&wf(),n.cells[i]=o),!(e&&o.deps&&$l(o.deps,e))){if(o.deps!==null&&!!e!=!!o.deps)throw new Error("useEffect called with and without dependencies across re-renders");Ga(n,2,()=>{var u;try{(u=o.cleanup)==null||u.call(o)}finally{o.cleanup=void 0}}),Ga(n,3,()=>{try{const u=t();if(u!==void 0&&typeof u!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof u}`);o.cleanup=u}finally{o.deps=e}})}}function Rf(t){const e=Kr(),n=Yl(t);return n.current!==t&&Ga(e,1,()=>{n.current=t}),Af(((...i)=>n.current(...i)),[])}const Gl=t=>{if(!Sf(t))throw new Error("A tap resource's `use()` only accepts a tap context.");return PE(t)},b0=(t,e,n=e)=>{const i=Yl(!0),a=i.current?n():e();i.current=!1;const[,o]=Ef(0),u=Rf(()=>{Object.is(a,e())||o(d=>d+1)});return Ms(()=>(u(),t(u)),[t]),a},x0=(t,e)=>{},XE=bt;function KE(t){const e=O.useRef(t);return O.useInsertionEffect(()=>{e.current=t}),O.useCallback(((...n)=>e.current(...n)),[])}const ZE=XE.useEffectEvent??KE,vn=()=>Rs()!==null,yn=bt,it=t=>vn()?Ef(t):yn.useState(t),JE=(t,e,n)=>vn()?v0(t,e,n):yn.useReducer(t,e,n),Ce=t=>vn()?Yl(t):yn.useRef(t),Ue=(t,e)=>vn()?Fl(t,e):yn.useMemo(t,e),Zr=(t,e)=>vn()?Af(t,e):yn.useCallback(t,e),ye=(t,e)=>vn()?Ms(t,e):yn.useEffect(t,e),Qa=(t,e)=>vn()?Ms(t,e):yn.useLayoutEffect(t,e),bn=t=>vn()?Rf(t):ZE(t),ks=(t,e,n)=>vn()?b0(t,e,n):yn.useSyncExternalStore(t,e,n),WE=(t,e)=>vn()?x0():yn.useDebugValue(t,e),xn=t=>{const e=yn.createContext(t);return s0(e,t),e},_0=t=>vn()&&Sf(t)?Gl(t):yn.use(t),_n=t=>vn()&&Sf(t)?Gl(t):yn.useContext(t),S0=bt,T0=Symbol.for("react.memo_cache_sentinel"),w0=t=>new Array(t).fill(T0),eA=t=>S0.useMemo(()=>{const e=w0(t);return e[T0]=!0,e},[]),Y=t=>{var e;const n=Rs();if(n===null)return(((e=S0.__COMPILER_RUNTIME)==null?void 0:e.c)??eA)(t);const i=n.memoCache;let a=i.workInProgress;if(a===null){const d=i.current;a=d===null?[]:d.map(f=>f.slice()),i.workInProgress=a}const o=i.index++;let u=a[o];return u===void 0&&(u=w0(t),a[o]=u),u};function ze(t){return(...e)=>({hook:t,args:e})}function In(t,e,n){return n?{...e,key:t,deps:n}:{...e,key:t}}const tA=50;let Hn={schedulers:new Set([]),isScheduled:!1};var nA=class{constructor(t){U(this,"_task"),U(this,"_isDirty",!1),this._task=t}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,Hn.schedulers.add(this),rA()}runTask(){this._isDirty=!1,this._task()}};const rA=()=>{Hn.isScheduled||(Hn.isScheduled=!0,iA())},Mf=()=>{try{const t=[];let e=0;for(const n of Hn.schedulers)if(Hn.schedulers.delete(n),!!n.isDirty){if(e++,e>tA)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside useEffect.");try{n.runTask()}catch(i){t.push(i)}}if(t.length>0){if(t.length===1)throw t[0];for(const n of t)console.error(n);throw new AggregateError(t,"Errors occurred during flushSync")}}finally{Hn.schedulers.clear(),Hn.isScheduled=!1}},iA=(()=>
49{if(typeof MessageChannel<"u"){const t=new MessageChannel;return t.port1.onmessage=Mf,()=>t.port2.postMessage(null)}return()=>setTimeout(Mf,0)})(),C0=t=>{const e=Hn;Hn={schedulers:new Set([]),isScheduled:!0};try{const n=t();return Mf(),n}finally{Hn=e}},sA={useState:Ef,useReducer:v0,useRef:Yl,useMemo:Fl,useCallback:Af,useEffect:Ms,useLayoutEffect:Ms,useInsertionEffect:Ms,useEffectEvent:Rf,useContext:Gl,use:Gl,useSyncExternalStore:b0,useDebugValue:x0},E0=bt,Ei=E0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??E0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ql=Ei==null?null:"H"in Ei?{get current(){return Ei.H},set current(t){Ei.H=t}}:"ReactCurrentDispatcher"in Ei?{get current(){return Ei.ReactCurrentDispatcher.current},set current(t){Ei.ReactCurrentDispatcher.current=t}}:null;function aA(t){if(!Ql)return t();const e=Ql.current;Ql.current=sA;try{return t()}finally{Ql.current=e}}function A0(t,e,n=void 0,i){return{hook:t,root:e,markDirty:n,devStrictMode:i,cells:[],contextDeps:null,wipContextDeps:null,commitCallbacks:null,wipCommitCallbacks:null,memoCache:{current:null,workInProgress:null,index:0},renderPendingCells:null,currentIndex:0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function Is(t){if(!t.isMounted)throw new Error("Tried to unmount a fiber that is already unmounted");t.isMounted=!1,VE(t)}function Ai(t,e){var n;if(t.memoCache.workInProgress=null,t.renderPendingCells!==null){for(const o of t.renderPendingCells)o.renderQueue=null;t.renderPendingCells.clear()}let i=0,a;do{if(++i>25)throw new Error("Too many re-renders. tap limits the number of renders to prevent an infinite loop.");t.memoCache.index=0,zE(t,()=>{a=aA(()=>t.hook(...e))})}while((((n=t.renderPendingCells)==null?void 0:n.size)??0)>0);return c0(t),a}function Xa(t){const e=t.wipCommitCallbacks??t.commitCallbacks??[];t.wipCommitCallbacks=null,t.commitCallbacks=e,t.isMounted=!0,t.contextDeps=t.wipContextDeps,Vl(t.root),t.memoCache.workInProgress!==null&&(t.memoCache.current=t.memoCache.workInProgress,t.memoCache.workInProgress=null),t.isNeverMounted=!1,qE(e)}const oA=()=>{const t=Kr();return t.devStrictMode?t.isFirstRender?"child":"root":null},lA=()=>null,uA=()=>lA,R0=()=>Rs()?oA:uA(),cA=t=>t(),dA=t=>{const e=Ue(()=>new nA(()=>b()),[]),n=Ue(()=>[],[]),i=R0(),a=Ue(()=>{const S=f0((_,w)=>{if(!e.isDirty){if(!_())return;w()}Ya(S,S.committedVersion+S.changelog.length),n.push(w),e.markDirty()});return A0(cA,S,void 0,i())},[n,e,i]),o=r0(),u=a.root.version-a.root.committedVersion,d=i0(o,()=>Ai(a,[t])),f=Ce(!1),h=Ce([t]),m=Ce(d),v=Ue(()=>new Set,[]),y=S=>{e.isDirty||m.current===S||(m.current=S,v.forEach(_=>_()))},b=bn(()=>{Ya(a.root,a.root.committedVersion),n.forEach(_=>{_()}),Ya(a.root,a.root.committedVersion+a.root.changelog.length);const S=i0(a.root.context,()=>Ai(a,h.current));if(e.isDirty)throw new Error("Scheduler is dirty, this should never happen");Vl(a.root),n.length=0,f.current&&Xa(a),y(S)});return ye(()=>(f.current=!0,()=>{f.current=!1,Is(a)}),[a]),ye(()=>{h.current=[t],Vl(a.root),n.splice(0,u),a.root.context=o,Xa(a),y(d)}),Ue(()=>({getValue:()=>m.current,subscribe:S=>(v.add(S),()=>v.delete(S))}),[v])},fA=()=>{const t=Ce(0),e=t.current,n=Kr();return{version:e,markDirty:Ue(()=>()=>{var i;t.current++,(i=n?.markDirty)==null||i.call(n)},[n]),root:n.root}},hA=()=>{const t=Ue(()=>f0((a,o)=>{let u=!1;i(d=>(u=!a(),u?d:d+1)),u||n(o)}),[]),[e,n]=JE((a,o)=>(Ya(t,a),a+(o()?1:0)),0),[,i]=it(0);return Ya(t,e),{root:t,version:e,markDirty:void 0}},kf=()=>{const t=R0(),{root:e,version:n,markDirty:i}=Rs()?fA():hA();return{version:n,createFiber:Zr((a,o,u)=>A0(a,e,u?()=>{u(),i?.()}:i,t()),[])}},M0=(t,e,n)=>{const i=Ce(null),a=i.current??(i.current={wipDeps:null,wip:null,currentDeps:null,current:null});return a.wipDeps=a.currentDeps,a.wip=a.current,ye(()=>{a.currentDeps=a.wipDeps,a.current=a.wip}),!n&&a.currentDeps&&$l(a.currentDeps,e)?a.current:(a.wipDeps=e,a.wip=t(),a.wip)};function qt(t){const{version:e,createFiber:n}=kf(),i=Ue(()=>n(t.hook,t.key),[t.hook,t.key,n]),a=M0(()=>({value:Ai(i,t.args)}),[i,e,t.args],Tf(i));return ye(()=>()=>Is(i),[i]),ye(()=>{Xa(i)},[i,a]),a.value}const k0=(t,e)=>{const n=t.get(e);n&&(n.isDirty=!0)},pA=(t,e)=>!t.isDirty&&!Tf(t.fiber)&&e!==void 0&&t.committedDeps!==void 0&&$l(t.committedDeps,e),mA=t=>{if(!d0())return!1;for(const{fiber:e}of t.values())if(Tf(e))return!0;return!1};function Xl(t){const e=Ue(()=>new Map,[]),{version:n,createFiber:i}=kf(),a=mA(e),o=M0(()=>{const u=new Set,d=[];let f=0;for(let h=0;h<t.length;h++){const m=t[h],v=m.key;if(v===void 0)throw new Error(`useResources did not provide a key for array at index ${h}`);
49if(u.has(v))throw new Error(`Duplicate key ${v} in useResources`);u.add(v);let y=e.get(v);if(y)if(y.fiber.hook!==m.hook){const b=i(m.hook,m.key,()=>k0(e,v)),S=Ai(b,m.args);y.next={value:S,deps:m.deps,remount:b}}else if(pA(y,m.deps))y.fiber.contextDeps&&c0(y.fiber,y.fiber.contextDeps),y.next="skip";else{const b=Ai(y.fiber,m.args);y.next={value:b,deps:m.deps}}else{const b=i(m.hook,m.key,()=>k0(e,v));y={fiber:b,next:{value:Ai(b,m.args),deps:m.deps},isDirty:!1,committedDeps:void 0,committedValue:void 0},f++,e.set(v,y)}d.push(typeof y.next=="object"?y.next.value:y.committedValue)}if(e.size>d.length-f)for(const h of e.keys())u.has(h)||(e.get(h).next="delete");return d},[t,e,i,n],a);return ye(()=>()=>{for(const u of e.keys()){const d=e.get(u).fiber;Is(d)}},[e]),ye(()=>{for(const[u,d]of e.entries()){const f=d.next;f==="delete"?(d.fiber.isMounted&&Is(d.fiber),e.delete(u)):f==="skip"||(f.remount&&(Is(d.fiber),d.fiber=f.remount),Xa(d.fiber),d.committedDeps=f.deps,d.committedValue=f.value,d.isDirty=!1)}},[o,e]),o}const gA=t=>t(),vA=t=>{const{createFiber:e}=kf(),n=Ue(()=>e(gA,void 0),[e]),i=Ai(n,[t]);ye(()=>()=>{Is(n)},[n]);let a=!1;const o=()=>{a&&n.isMounted||(a=!0,Xa(n))};return ye(o),{value:i,effects:o}},yA=()=>{const t=Y(4),[e,n]=it(xA);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(f,h)=>(n(m=>({...m,renderers:{...m.renderers,[f]:[...m.renderers[f]??[],h]}})),()=>{n(m=>{var v;return{...m,renderers:{...m.renderers,[f]:((v=m.renderers[f])==null?void 0:v.filter(y=>y!==h))??[]}}})}),t[0]=i):i=t[0];const a=i;let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=f=>(n(h=>({...h,fallbacks:[...h.fallbacks,f]})),()=>{n(h=>({...h,fallbacks:h.fallbacks.filter(m=>m!==f)}))}),t[1]=o):o=t[1];const u=o;let d;return t[2]!==e?(d={getState:()=>e,setDataUI:a,setFallbackDataUI:u},t[2]=e,t[3]=d):d=t[3],d},bA=ze(yA);function xA(){return{renderers:{},fallbacks:[]}}const _A=t=>{const e=Array.from(t).map(i=>i.getModelContext()).sort((i,a)=>(a.priority??0)-(i.priority??0)),n={};return e.reduce((i,a)=>{var o;const u=a.priority??0;if(a.system&&(i.system?i.system+=`
50
51${a.system}`:i.system=a.system),a.tools)for(const[d,f]of Object.entries(a.tools)){const h=(o=i.tools)==null?void 0:o[d];if(h&&h!==f){const m=n[d];if(m===u)throw new Error(`You tried to define a tool with the name ${d}, but it already exists.`);const v=m>u?h:f,y=m>u?f:h;i.tools[d]={...y,...v},n[d]=Math.max(m,u);continue}i.tools||(i.tools={}),i.tools[d]=f,n[d]??(n[d]=u)}return a.config&&(i.config={...i.config,...a.config}),a.callSettings&&(i.callSettings={...i.callSettings,...a.callSettings}),a.unstable_composerMetadata&&(i.unstable_composerMetadata={...i.unstable_composerMetadata,...a.unstable_composerMetadata}),i},{})};var If=class{constructor(){U(this,"_providers",new Set),U(this,"_subscribers",new Set)}getModelContext(){return _A(this._providers)}registerModelContextProvider(t){var e;this._providers.add(t);const n=(e=t.subscribe)==null?void 0:e.call(t,()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(t),n?.(),this.notifySubscribers()}}notifySubscribers(){for(const t of this._subscribers)t()}subscribe(t){return this._subscribers.add(t),()=>{this._subscribers.delete(t)}}};const Of=[],SA={modelName:void 0,toolNames:Of},TA=(t,e)=>t===e||t.length===e.length&&t.every((n,i)=>n===e[i]),Kl=(t,e)=>{var n;const i=t.getModelContext(),a=(n=i.config)==null?void 0:n.modelName,o=i.tools?Object.keys(i.tools).sort():Of,u=o.length?o:Of;return a===e.modelName&&TA(u,e.toolNames)?e:{modelName:a,toolNames:u}},wA=()=>{const t=Y(11);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new If,t[0]=e):e=t[0];const n=e;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=()=>Kl(n,SA),t[1]=i):i=t[1];const[a,o]=it(i);let u,d;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>(o(b=>Kl(n,b)),n.subscribe(()=>{o(b=>Kl(n,b))})),d=[n],t[2]=u,t[3]=d):(u=t[2],d=t[3]),ye(u,d);let f;t[4]!==a?(f=()=>Kl(n,a),t[4]=a,t[5]=f):f=t[5];let h,m,v;t[6]===Symbol.for("react.memo_cache_sentinel")?(h=()=>n.getModelContext(),m=b=>n.subscribe(b),v=b=>n.registerModelContextProvider(b),t[6]=h,t[7]=m,t[8]=v):(h=t[6],m=t[7],v=t[8]);let y;return t[9]!==f?(y={getState:f,getModelContext:h,subscribe:m,register:v},t[9]=f,t[10]=y):y=t[10],y},I0=ze(wA),CA=t=>t.display!==void 0?t.display==="standalone":t.type==="human",EA=(t,e)=>{var n,i;if(!(((n=e.status)==null?void 0:n.type)==="running"||((i=e.status)==null?void 0:i.type)==="requires-action")){const o=t.complete;return typeof o!="function"?o??null:o({args:e.args,result:e.result})}const a=t.running;return typeof a!="function"?a??null:a({args:e.args})},AA=t=>function(n){return EA(t,n)},Df=Symbol("assistant-ui.store.clientIndex"),RA=t=>t[Df],O0=xn([]),Nf=()=>_0(O0),MA=(t,e)=>{const n=Y(3),i=Nf();let a;return n[0]!==t||n[1]!==i?(a=[...i,t],n[0]=t,n[1]=i,n[2]=a):a=n[2],u0(O0,a,e)},kA=new Set(["$$typeof","nodeType","then"]),Zl=(t,e)=>{if(t===Symbol.toStringTag)return e;if(typeof t!="symbol"){if(t==="toJSON")return()=>e;if(!kA.has(t))return!1}};var zf=class{getOwnPropertyDescriptor(t,e){const n=this.get(t,e);if(n!==void 0)return{value:n,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}};
51const Jl=Symbol("assistant-ui.store.getValue"),IA=t=>{var e;const n=t[Jl];if(!n)throw new Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with useClientResource(), not a plain resource.");return(e=n.getState)==null?void 0:e.call(n)},D0=new Map;function OA(t){let e=D0.get(t);return e||(e=function(...n){if(!this||typeof this!="object")throw new Error(`Method "${String(t)}" called without proper context. This may indicate the function was called incorrectly.`);const i=this[Jl];if(!i)throw new Error(`Method "${String(t)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);const a=i[t];if(!a)throw new Error(`Method "${String(t)}" is not implemented.`);if(typeof a!="function")throw new Error(`"${String(t)}" is not a function.`);return a(...n)},D0.set(t,e)),e}var DA=class extends zf{constructor(t,e){super(),U(this,"outputRef"),U(this,"index"),U(this,"boundFns"),U(this,"cachedReceiver"),this.outputRef=t,this.index=e}get(t,e,n){if(e===Jl)return this.outputRef.current;if(e===Df)return this.index;const i=Zl(e,"ClientProxy");if(i!==!1)return i;const a=this.outputRef.current[e];if(typeof a=="function"){this.cachedReceiver!==n&&(this.boundFns=new Map,this.cachedReceiver=n);let o=this.boundFns.get(e);return o||(o=OA(e).bind(n),this.boundFns.set(e,o)),o}return a}ownKeys(){return Object.keys(this.outputRef.current)}has(t,e){return e===Jl||e===Df?!0:e in this.outputRef.current}};const Ka=t=>{var e;const n=Ce(null),i=Nf().length,a=Ue(()=>new Proxy({},new DA(n,i)),[i]),o=MA(a,function(){return qt(t)});return n.current||(n.current=o),ye(()=>{n.current=o}),{methods:a,state:(e=o.getState)==null?void 0:e.call(o),key:t.key}},NA=ze(Ka),Za=Symbol("assistant-ui.store.proxiedAssistantState"),jf=t=>t==="on"||t==="subscribe"||typeof t=="symbol",N0=t=>{class e extends zf{get(i,a){const o=Zl(a,"AssistantState");if(o!==!1)return o;const u=a;if(!jf(u))return IA(t[u]())}ownKeys(){return Object.keys(t).filter(i=>!jf(i))}has(i,a){return!jf(a)&&a in t}}return new Proxy({},new e)},zA=t=>t[Za],z0=()=>()=>{},j0=t=>{const e=(()=>{throw new Error(t)});return e.source=null,e.query=null,e};var jA=class extends zf{get(t,e){if(e==="subscribe"||e==="on")return z0;if(e===Za)return BA;const n=Zl(e,"DefaultAssistantClient");return n!==!1?n:j0("You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.")}ownKeys(){return["subscribe","on",Za]}has(t,e){return e==="subscribe"||e==="on"||e===Za}};const Wl=new Proxy({},new jA),BA=N0(Wl),PA=()=>new Proxy({},{get(t,e){const n=Zl(e,"AssistantClient");return n!==!1?n:j0(`The current scope does not have a "${String(e)}" property.`)}}),B0=xn(Wl),P0=Symbol("assistant-ui.store.useEffects"),LA=()=>{},UA=t=>t[P0]??LA,HA=()=>{"use no memo";return ye(UA(L0())),null},L0=()=>_n(B0),Sn=({value:t,children:e})=>{"use no memo";return T.jsxs(B0.Provider,{value:t,children:[T.jsx(HA,{}),e]})},Bf=t=>null,Tn=ze(Bf),Pf=Symbol("assistant-ui.transform-scopes");function U0(t,e){const n=t;if(n[Pf])throw new Error("transformScopes is already attached to this resource");n[Pf]=e}function qA(t){return t[Pf]}const H0=t=>typeof t=="string"?{scope:t.split(".")[0],event:t}:{scope:t.scope,event:t.event},q0=xn(null),VA=(t,e)=>u0(q0,t,e),V0=()=>{const t=_0(q0);if(!t)throw new Error("AssistantTapContext is not available");return t},$0=()=>V0().clientRef,Lf=()=>{const t=Y(3),{emit:e}=V0(),n=Nf();let i;return t[0]!==n||t[1]!==e?(i=(a,o)=>{e(a,o,n)},t[0]=n,t[1]=e,t[2]=i):i=t[2],bn(i)};function $A(t,e){const n={...t},i=new Set;let a=!0;for(;a;){a=!1;for(const d of Object.values(n)){if(d.hook===Bf||i.has(d.hook))continue;i.add(d.hook);const f=qA(d.hook);if(f){f(n,e),a=!0;break}}}const o={},u={};for(const[d,f]of Object.entries(n))f.hook===Bf?u[d]=f:o[d]=f;return{rootClients:o,derivedClients:u}}const F0=t=>Ue(()=>t,[...Object.entries(t).flat()]),FA=(t,e)=>{const n=Y(6);let i;n[0]!==e||n[1]!==t?(i=$A(t,e),n[0]=e,n[1]=t,n[2]=i):i=n[2];const{rootClients:a,derivedClients:o}=i,u=F0(a),d=F0(o);let f;return n[3]!==u||n[4]!==d?(f={rootClients:u,derivedClients:d},n[3]=u,n[4]=d,n[5]=f):f=n[5],f},YA=()=>{const t=Y(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,t[0]=e):e=t[0];const n=e;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,t[1]=i):i=t[1];const a=i;let o;if(t[2]===Symbol.for("react.memo_cache_sentinel")){const u=new Set;o={on(d,f){const h=f;if(d==="*")return a.add(h),()=>a.delete(h);let m=n.get(d);return m||(m=new Set,n.set(d,m)),m.add(h),()=>
51{m.delete(h),m.size===0&&n.delete(d)}},emit(d,f,h){const m=n.get(d);!m&&a.size===0||queueMicrotask(()=>{const v=[];if(m)for(const y of m)try{y(f,h)}catch(b){const S=b;v.push(S)}if(a.size>0){const y={event:d,payload:f};for(const b of a)try{b(y,h)}catch(S){const _=S;v.push(_)}}if(v.length>0){if(v.length===1)throw v[0];for(const y of v)console.error(y);throw new AggregateError(v,"Errors occurred during event emission")}})},subscribe(d){return u.add(d),()=>u.delete(d)},notifySubscribers(){for(const d of u)try{d()}catch(f){console.error("NotificationManager: subscriber callback error",f)}}},t[2]=o}else o=t[2];return o},GA=ze(YA),Y0=t=>Ue(()=>t,t),QA=({element:t,emit:e,clientRef:n})=>{const{methods:i,state:a}=VA({clientRef:n,emit:e},function(){return Ka(t)});return Ue(()=>({state:a,methods:i}),[i,a])},XA=({element:t,notifications:e,clientRef:n,name:i})=>{const a=dA(function(){return QA({element:t,emit:e.emit,clientRef:n})});return ye(()=>a.subscribe(e.notifySubscribers),[a,e]),Ue(()=>{const o=()=>a.getValue().methods;return Object.defineProperties(o,{source:{value:"root",writable:!1},query:{value:{},writable:!1},name:{value:i,configurable:!0}}),o},[a,i])},KA=ze(XA),ZA=()=>{const t=Y(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n={clients:e,subscribe:void 0,on:void 0},t[1]=n):n=t[1],n},JA=ze(ZA),WA=t=>{const e=Y(14),{clients:n,clientRef:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=GA(),e[0]=a):a=e[0];const o=qt(a);let u;e[1]!==i.parent||e[2]!==o.notifySubscribers?(u=()=>i.parent.subscribe(o.notifySubscribers),e[1]=i.parent,e[2]=o.notifySubscribers,e[3]=u):u=e[3];let d;e[4]!==i||e[5]!==o?(d=[i,o],e[4]=i,e[5]=o,e[6]=d):d=e[6],ye(u,d);let f;e[7]!==i||e[8]!==n||e[9]!==o?(f=Object.keys(n).map(v=>In(v,KA({element:n[v],notifications:o,clientRef:i,name:v}))),e[7]=i,e[8]=n,e[9]=o,e[10]=f):f=e[10];const h=Y0(Xl(f));let m;return e[11]!==o||e[12]!==h?(m={notifications:o,results:h},e[11]=o,e[12]=h,e[13]=m):m=e[13],m},eR=t=>{const{clientRef:e}=t,{notifications:n,results:i}=WA(t);return Ue(()=>({clients:i,subscribe:n.subscribe,on:function(a,o){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:u,event:d}=H0(a);if(u!=="*"&&this[u].source===null)throw new Error(`Scope "${u}" is not available. Use { scope: "*", event: "${d}" } to listen globally.`);const f=n.on(d,(m,v)=>{if(u==="*"){o(m);return}const y=this[u]();y===v[RA(y)]&&o(m)});if(u!=="*"&&e.parent[u].source===null)return f;const h=e.parent.on(a,o);return()=>{f(),h()}}}),[i,n,e])},tR=ze(eR);function Uf(t){return t.args?t.args[0]:t.props}const nR=({element:t,clientRef:e,name:n})=>{const i=Ce(Uf(t));return i.current=Uf(t),Ue(()=>{const a=()=>i.current.get(e.current);return Object.defineProperties(a,{source:{value:i.current.source},query:{value:i.current.query},name:{value:n,configurable:!0}}),a},[e,n])},rR=ze(nR),iR=(t,e)=>{let n;try{const i={};for(const a of Object.keys(e.query).sort())i[a]=e.query[a];n=JSON.stringify(i)}catch{n=String(e.query)}return`${t}::${e.source}::${n}`},sR=t=>{const e=Y(3),{clients:n,clientRef:i}=t;let a;return e[0]!==i||e[1]!==n?(a=Object.keys(n).map(o=>{const u=o,d=n[u];return In(iR(u,Uf(d)),rR({element:d,clientRef:i,name:u}))}),e[0]=i,e[1]=n,e[2]=a):a=e[2],Y0(Xl(a))},aR=t=>{const e=Y(3),{rootClients:n,clientRef:i}=t;let a;return e[0]!==i||e[1]!==n?(a=Object.keys(n).length>0?tR({clients:n,clientRef:i}):JA(),e[0]=i,e[1]=n,e[2]=a):a=e[2],qt(a)},oR=({parent:t,clients:e})=>{const{rootClients:n,derivedClients:i}=FA(e,t),a=Ce({parent:t,current:null}).current;ye(()=>{a.current=d});const o=aR({rootClients:n,clientRef:a}),u=sR({clients:i,clientRef:a}),d=Ue(()=>{const f=t===Wl?PA():t,h=Object.create(f);Object.assign(h,{subscribe:o.subscribe??t.subscribe,on:o.on??t.on,[Za]:N0(h)});for(const m of o.clients)h[m.name]=m;for(const m of u)h[m.name]=m;return h},[t,o,u]);return a.current===null&&(a.current=d),d},lR=t=>{const{value:e,effects:n}=vA(function(){return oR(t)});return e[P0]=n,e};function _e(t,{parent:e}={parent:L0()}){if(t)return lR({parent:e??Wl,clients:t});if(e===null)throw new Error("received null parent, this usage is not allowed");return e}const ce=t=>{const e=Y(6),n=_e();let i;e[0]!==n?(i=zA(n),e[0]=n,e[1]=i):i=e[1];const a=i;let o,u;e[2]!==a||e[3]!==t?(o=()=>t(a),u=()=>t(a),e[2]=a,e[3]=t,e[4]=o,e[5]=u):(o=e[4],u=e[5]);const d=ks(n.subscribe,o,u);
51if(d===a)throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return WE(d),d},G0=t=>{const{children:e,condition:n}=t;return ce(n)?e:null};G0.displayName="AuiIf";const uR=t=>{const e=_e(),n=Ce(!1),i=n.current?null:t(e);return ce(()=>n.current?t(e):i),()=>(n.current=!0,t(e))},cR=Object.freeze({});function Os(t){const e=Y(3),{getItemState:n,children:i}=t,a=uR(n);let o;return e[0]!==i||e[1]!==a?(o=i(a),e[0]=i,e[1]=a,e[2]=o):o=e[2],dR(o)}const dR=t=>{const e=typeof t=="object"&&t!=null&&"type"in t?t:null,n=e?.type,i=e?.key;return Ue(()=>e,[n,i,typeof e?.props=="object"&&e.props!=null&&Object.entries(e.props).length===0?cR:e?.props])??t},fR=bt.createContext(!0);function Q0(){throw new Error("A function wrapped in useEffectEvent can't be called during rendering.")}const hR="use"in bt?()=>{try{return bt.use(fR)}catch{return!1}}:()=>!1;function pR(t){const e=bt.useRef(Q0);return bt.useInsertionEffect(()=>{e.current=t},[t]),(...n)=>{hR()&&Q0();const i=e.current;return i(...n)}}const eu=(t,e)=>{const n=Y(11),i=_e(),a=pR(e);let o;n[0]!==t?(o=H0(t),n[0]=t,n[1]=o):o=n[1];const{scope:u,event:d}=o;let f;n[2]!==i||n[3]!==a||n[4]!==d||n[5]!==u?(f=()=>i.on({scope:u,event:d},a),n[2]=i,n[3]=a,n[4]=d,n[5]=u,n[6]=f):f=n[6];let h;n[7]!==i||n[8]!==d||n[9]!==u?(h=[i,u,d],n[7]=i,n[8]=d,n[9]=u,n[10]=h):h=n[10],ye(f,h)},mR=t=>{if(t.key===void 0)throw new Error("useClientLookup: Element has no key");return t.key};function Ri(t){const e=Y(15);let n;e[0]!==t?(n=t.map(yR),e[0]=t,e[1]=n):n=e[1];const i=Xl(n);let a;e[2]!==i?(a=Object.keys(i),e[2]=i,e[3]=a):a=e[3];const o=a;let u;e[4]!==i?(u=i.reduce(vR,{}),e[4]=i,e[5]=u):u=e[5];const d=u;let f;e[6]!==i?(f=i.map(gR),e[6]=i,e[7]=f):f=e[7];const h=f;let m;e[8]!==d||e[9]!==o||e[10]!==i?(m=y=>{if("index"in y){if(y.index<0||y.index>=o.length)throw new Error(`useClientLookup: Index ${y.index} out of bounds (length: ${o.length})`);return i[y.index].methods}const b=d[y.key];if(b===void 0)throw new Error(`useClientLookup: Key "${y.key}" not found`);return i[b].methods},e[8]=d,e[9]=o,e[10]=i,e[11]=m):m=e[11];let v;return e[12]!==h||e[13]!==m?(v={state:h,get:m},e[12]=h,e[13]=m,e[14]=v):v=e[14],v}function gR(t){return t.state}function vR(t,e,n){return t[e.key]=n,t}function yR(t){return In(mR(t),NA(t),t.deps)}const X0=t=>{const e=Y(15),{toolkit:n,mcpApp:i}=t;let a;e[0]!==i?(a=i?[In("mcpApp",i)]:[],e[0]=i,e[1]=a):a=e[1];const o=Xl(a)[0],[u,d]=it(xR);let f;e[2]!==u?(f=Object.fromEntries(Object.entries(u).map(SR)),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o||e[5]!==f||e[6]!==u?(h={toolUIs:u,mcpApp:o,tools:f},e[4]=o,e[5]=f,e[6]=u,e[7]=h):h=e[7];const m=h,v=$0();let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=(C,A,R)=>{const D={render:A,standalone:R?.standalone??!1};return d(N=>({...N,[C]:[...N[C]??[],D]})),()=>{d(N=>{var I;const z=((I=N[C])==null?void 0:I.filter(X=>X!==D))??[];if(z.length>0)return{...N,[C]:z};const q={...N};return delete q[C],q})}},e[8]=y):y=e[8];const b=y;let S,_;e[9]!==v||e[10]!==n?(S=()=>{if(!n)return;const C=[];for(const[R,D]of Object.entries(n)){const N="render"in D?D.render:void 0,I="renderText"in D?D.renderText:void 0,z=N??(I?AA(I):void 0);z&&C.push(b(R,z,{standalone:CA(D)}))}const A=Object.entries(n).reduce(TR,{});return C.push(v.current.modelContext().register({getModelContext:()=>({tools:A})})),()=>{C.forEach(wR)}},_=[n,b,v],e[9]=v,e[10]=n,e[11]=S,e[12]=_):(S=e[11],_=e[12]),ye(S,_);let w;return e[13]!==m?(w={getState:()=>m,setToolUI:b},e[13]=m,e[14]=w):w=e[14],w},bR=ze(X0);U0(X0,(t,e)=>{!t.modelContext&&e.modelContext.source===null&&(t.modelContext=I0())});function xR(){return{}}function _R(t){return t.render}function SR(t){const[e,n]=t;return[e,n.map(_R)]}function TR(t,e){const[n,i]=e;if(i.type==="mcp")return t;const{display:a,render:o,renderText:u,...d}=i;return t[n]=d,t}function wR(t){return t()}const Mi=t=>ks(t.subscribe,t.getState),CR=t=>{const e=Y(8),{runtime:n}=t,i=Mi(n);let a;e[0]!==i?(a=()=>i,e[0]=i,e[1]=a):a=e[1];let o;e[2]!==n?(o=()=>n,e[2]=n,e[3]=o):o=e[3];let u;return e[4]!==n.remove||e[5]!==a||e[6]!==o?(u={getState:a,remove:n.remove,__internal_getRuntime:o},e[4]=n.remove,e[5]=a,e[6]=o,e[7]=u):u=e[7],u},K0=ze(CR),ER=t=>{const e=Y(5),{runtime:n,index:i}=t;let a;e[0]!==i||e[1]!==n?(a=n.getAttachmentByIndex(i),e[0]=i,e[1]=n,e[2]=a):a=e[2];const o=a;let u;return e[3]!==o?(u=K0({runtime:o}),e[3]=o,e[4]=u):u=e[4],qt(u)},AR=ze(ER),RR=({item:t,onSteer:e,onRemove:n})=>({getState:()=>t,steer:e,remove:n}),MR=ze(RR),kR=t=>{const e=Y(55),{threadIdRef:n,messageIdRef:i,runtime:a}=t,o=Mi(a),u=Lf();let d,f;e[0]!==u||e[1]!==i||e[2]!==a||e[3]!==n?(d=()=>{const z=[];for(const q of["send","attachmentAdd"]){const X=a.unstable_on(q,()=>{u(`composer.${q}`,{threadId:n.current,...i&&{messageId:i.current}})});z.push(X)}return z.push(a.unstable_on("attachmentAddError",q=>{u("composer.attachmentAddError",{threadId:n.current,...i&&{messageId:i.current},...q.attachmentId&&{attachmentId:q.attachmentId},reason:q.reason,message:q.message})}
51)),()=>{for(const q of z)q()}},f=[a,u,n,i],e[0]=u,e[1]=i,e[2]=a,e[3]=n,e[4]=d,e[5]=f):(d=e[4],f=e[5]),ye(d,f);let h;if(e[6]!==a||e[7]!==o.attachments){let z;e[9]!==a?(z=(q,X)=>In(q.id,AR({runtime:a,index:X}),[a,X]),e[9]=a,e[10]=z):z=e[10],h=o.attachments.map(z),e[6]=a,e[7]=o.attachments,e[8]=h}else h=e[8];const m=Ri(h),v=o.queue;let y;if(e[11]!==v||e[12]!==a){let z;e[14]!==a?(z=q=>In(q.id,MR({item:q,onSteer:()=>a.steerQueueItem(q.id),onRemove:()=>a.removeQueueItem(q.id)})),e[14]=a,e[15]=z):z=e[15],y=v.map(z),e[11]=v,e[12]=a,e[13]=y}else y=e[13];const b=Ri(y),S=o.type??"thread";let _;e[16]!==m.state||e[17]!==v||e[18]!==o.attachmentAccept||e[19]!==o.canCancel||e[20]!==o.canSend||e[21]!==o.dictation||e[22]!==o.isEditing||e[23]!==o.isEmpty||e[24]!==o.quote||e[25]!==o.role||e[26]!==o.runConfig||e[27]!==o.text||e[28]!==S?(_={text:o.text,role:o.role,attachments:m.state,runConfig:o.runConfig,isEditing:o.isEditing,canCancel:o.canCancel,canSend:o.canSend,attachmentAccept:o.attachmentAccept,isEmpty:o.isEmpty,type:S,dictation:o.dictation,quote:o.quote,queue:v},e[16]=m.state,e[17]=v,e[18]=o.attachmentAccept,e[19]=o.canCancel,e[20]=o.canSend,e[21]=o.dictation,e[22]=o.isEditing,e[23]=o.isEmpty,e[24]=o.quote,e[25]=o.role,e[26]=o.runConfig,e[27]=o.text,e[28]=S,e[29]=_):_=e[29];const w=_;let C;e[30]!==w?(C=()=>w,e[30]=w,e[31]=C):C=e[31];const A=a.beginEdit??IR;let R;e[32]!==m?(R=z=>"id"in z?m.get({key:z.id}):m.get(z),e[32]=m,e[33]=R):R=e[33];let D;e[34]!==b?(D=z=>b.get(z),e[34]=b,e[35]=D):D=e[35];let N;e[36]!==a?(N=()=>a,e[36]=a,e[37]=N):N=e[37];let I;return e[38]!==a.addAttachment||e[39]!==a.cancel||e[40]!==a.clearAttachments||e[41]!==a.reset||e[42]!==a.send||e[43]!==a.setQuote||e[44]!==a.setRole||e[45]!==a.setRunConfig||e[46]!==a.setText||e[47]!==a.startDictation||e[48]!==a.stopDictation||e[49]!==D||e[50]!==N||e[51]!==C||e[52]!==A||e[53]!==R?(I={getState:C,setText:a.setText,setRole:a.setRole,setRunConfig:a.setRunConfig,addAttachment:a.addAttachment,reset:a.reset,clearAttachments:a.clearAttachments,send:a.send,cancel:a.cancel,beginEdit:A,startDictation:a.startDictation,stopDictation:a.stopDictation,setQuote:a.setQuote,attachment:R,queueItem:D,__internal_getRuntime:N},e[38]=a.addAttachment,e[39]=a.cancel,e[40]=a.clearAttachments,e[41]=a.reset,e[42]=a.send,e[43]=a.setQuote,e[44]=a.setRole,e[45]=a.setRunConfig,e[46]=a.setText,e[47]=a.startDictation,e[48]=a.stopDictation,e[49]=D,e[50]=N,e[51]=C,e[52]=A,e[53]=R,e[54]=I):I=e[54],I},Z0=ze(kR);function IR(){throw new Error("beginEdit is not supported in this runtime")}const J0=t=>({get current(){return t()}}),OR=t=>{const e=Y(13),{runtime:n}=t,i=Mi(n);let a;e[0]!==i?(a=()=>i,e[0]=i,e[1]=a):a=e[1];let o,u,d,f;e[2]!==n?(o=m=>n.addToolResult(m),u=m=>n.resumeToolCall(m),d=m=>n.respondToToolApproval(m),f=()=>n,e[2]=n,e[3]=o,e[4]=u,e[5]=d,e[6]=f):(o=e[3],u=e[4],d=e[5],f=e[6]);let h;return e[7]!==a||e[8]!==o||e[9]!==u||e[10]!==d||e[11]!==f?(h={getState:a,addToolResult:o,resumeToolCall:u,respondToToolApproval:d,__internal_getRuntime:f},e[7]=a,e[8]=o,e[9]=u,e[10]=d,e[11]=f,e[12]=h):h=e[12],h},DR=ze(OR),NR=t=>{const e=Y(5),{runtime:n,index:i}=t;let a;e[0]!==i||e[1]!==n?(a=n.getAttachmentByIndex(i),e[0]=i,e[1]=n,e[2]=a):a=e[2];const o=a;let u;return e[3]!==o?(u=K0({runtime:o}),e[3]=o,e[4]=u):u=e[4],qt(u)},zR=ze(NR),jR=t=>{const e=Y(5),{runtime:n,index:i}=t;let a;e[0]!==i||e[1]!==n?(a=n.getMessagePartByIndex(i),e[0]=i,e[1]=n,e[2]=a):a=e[2];const o=a;let u;return e[3]!==o?(u=DR({runtime:o}),e[3]=o,e[4]=u):u=e[4],qt(u)},BR=ze(jR),PR=t=>{const e=Y(55),{runtime:n,threadIdRef:i}=t,a=Mi(n),[o,u]=it(!1),[d,f]=it(!1);let h;e[0]!==n?(h=J0(()=>n.getState().id),e[0]=n,e[1]=h):h=e[1];const m=h;let v;e[2]!==m||e[3]!==n.composer||e[4]!==i?(v=Z0({runtime:n.composer,threadIdRef:i,messageIdRef:m}),e[2]=m,e[3]=n.composer,e[4]=i,e[5]=v):v=e[5];const y=Ka(v);let b;if(e[6]!==n||e[7]!==a.content){let G;e[9]!==n?(G=(le,k)=>In("toolCallId"in le&&le.toolCallId!=null?`toolCallId-${le.toolCallId}`:`index-${k}`,BR({runtime:n,index:k}),[n,k]),e[9]=n,e[10]=G):G=e[10],b=a.content.map(G),e[6]=n,e[7]=a.content,e[8]=b}else b=e[8];const S=Ri(b);let _;e[11]!==a.attachments?(_=a.attachments??[],e[11]=a.attachments,e[12]=_):_=e[12];let w;if(e[13]!==n||e[14]!==_){let G;e[16]!==n?(G=(le,k)=>In(le.id,zR({runtime:n,index:k}),[n,k]),e[16]=n,e[17]=G):G=e[17],w=_.map(G),e[13]=n,e[14]=_,e[15]=w}else w=e[15];const C=Ri(w),A=a;let R;e[18]!==y.state||e[19]!==o||e[20]!==d||e[21]!==S.state||e[22]!==A?(R={...A,parts:S.state,composer:y.state,isCopied:o,isHovering:d},e[18]=y.state,e[19]=o,e[20]=d,e[21]=S.state,e[22]=A,e[23]=R):R=e[23];const D=R;let N;e[24]!==D?(N=()=>D,e[24]=D,e[25]=N):N=e[25];let I;e[26]!==y.methods?(I=()=>y.methods,e[26]=y.methods,e[27]=I):I=e[27];let z,q,X,V,$,L,Q;e[28]!==n?(z=()=>n.delete(),q=G=>n.reload(G),X=()=>n.speak(),V=()=>n.stopSpeaking(),$=G=>n.submitFeedback(G),L=G=>n.switchToBranch(G),Q=()=>n.unstable_getCopyText(),e[28]=n,e[29]=z,e[30]=q,e[31]=X,e[32]=V,e[33]=$,e[34]=L,e[35]=Q):(z=e[29],q=e[30],X=e[31],V=e[32],$=e[33],L=e[34],Q=e[35]);let ee;e[36]!==S?(ee=G=>"index"in G?S.get({index:G.index}):S.get({key:`toolCallId-${G.toolCallId}`}),e[36]=S,e[37]=ee):ee=e[37];let J;e[38]!==C?(J=G=>"id"in G?C.get({key:G.id}):C.get(G),e[38]=C,e[39]=J):J=e[39];let P;e[40]!==n?(P=()=>n,e[40]=n,e[41]=P):P=e[41];let te;return e[42]!==z||e[43]!==q||e[44]!==X||e[45]!==V||e[46]!==$||e[47]!==L||e[48]!==Q||e[49]!==ee||e[50]!==J||e[51]!==P||e[52]!==N||e[53]!==I?(te={getState:N,composer:I,delete:z,reload:q,speak:X,stopSpeaking:V,submitFeedback:$,switchToBranch:L,getCopyText:Q,part:ee,attachment:J,setIsCopied:u,setIsHovering:f,__internal_getRuntime:P},e[42]=z,e[43]=q,e[44]=X,e[45]=V,e[46]=$,e[47]=L,e[48]=Q,e[49]=ee,e[50]=J,e[51]=P,e[52]=N,e[53]=I,e[54]=te):te=e[54],te},LR=ze(PR),UR=t=>{const e=Y(6),{runtime:n,id:i,threadIdRef:a}=t;let o;e[0]!==i||e[1]!==n?(o=n.getMessageById(i),e[0]=i,e[1]=n,e[2]=o):o=e[2];const u=o;let d;return e[3]!==u||e[4]!==a?(d=LR({runtime:u,threadIdRef:a}),e[3]=u,e[4]=a,e[5]=d):d=e[5],qt(d)},HR=ze(UR),qR=t=>{const e=Y(58),{runtime:n}=t,i=Mi(n),a=Lf();let o,u;e[0]!==a||e[1]!==n?(o=()=>{const N=[];for(const I of["runStart","runEnd","initialize","modelContextUpdate"]){const z=n.unstable_on(I,()=>{var q;const X=((q=n.getState())==null?void 0:q.threadId)||"unknown";a(`thread.${I}`,{threadId:X})});N.push(z)}return()=>{for(const I of N)I()}},u=[n,a],e[0]=a,e[1]=n,e[2]=o,e[3]=u):(o=e[2],u=e[3]),ye(o,u);let d;e[4]!==n?(d=J0(()=>n.getState().threadId),e[4]=n,e[5]=d):d=e[5];const f=d;let h;e[6]!==n.composer||e[7]!==f?(h=Z0({runtime:n.composer,threadIdRef:f}),e[6]=n.composer,e[7]=f,e[8]=h):h=e[8];const m=Ka(h);let v;if(e[9]!==n||e[10]!==i.messages||e[11]!==f){let N;e[13]!==n||e[14]!==f?(N=I=>In(I.id,HR({runtime:n,id:I.id,threadIdRef:f}),[n,I.id,f]),e[13]=n,e[14]=f,e[15]=N):N=e[15],v=i.messages.map(N),e[9]=n,e[10]=i.messages,e[11]=f,e[12]=v}else v=e[12];const y=Ri(v),b=y.state.length===0&&!i.isLoading;let S;e[16]!==m.state||e[17]!==y.state||e[18]!==i.capabilities||e[19]!==i.extras||e[20]!==i.isDisabled||e[21]!==i.isLoading||e[22]!==i.isRunning||e[23]!==i.speech||e[24]!==i.state||e[25]!==i.suggestions||e[26]!==i.voice||e[27]!==b?(S={isEmpty:b,isDisabled:i.isDisabled,isLoading:i.isLoading,isRunning:i.isRunning,capabilities:i.capabilities,state:i.state,suggestions:i.suggestions,extras:i.extras,speech:i.speech,voice:i.voice,composer:m.state,messages:y.state},e[16]=m.state,e[17]=y.state,e[18]=i.capabilities,e[19]=i.extras,e[20]=i.isDisabled,e[21]=i.isLoading,e[22]=i.isRunning,e[23]=i.speech,e[24]=i.state,e[25]=i.suggestions,e[26]=i.voice,e[27]=b,e[28]=S):S=e[28];const _=S;let w;e[29]!==_?(w=()=>_,e[29]=_,e[30]=w):w=e[30];let C;e[31]!==m.methods?(C=()=>m.methods,e[31]=m.methods,e[32]=C):C=e[32];let A;e[33]!==y?(A=N=>"id"in N?y.get({key:N.id}):y.get(N),e[33]=y,e[34]=A):A=e[34];let R;e[35]!==n?(R=()=>n,e[35]=n,e[36]=R):R=e[36];let D;return e[37]!==n.append||e[38]!==n.cancelRun||e[39]!==n.connectVoice||e[40]!==n.deleteMessage||e[41]!==n.disconnectVoice||e[42]!==n.export||e[43]!==n.getModelContext||e[44]!==n.getVoiceVolume||e[45]!==n.import||e[46]!==n.muteVoice||e[47]!==n.reset||e[48]!==n.resumeRun||e[49]!==n.startRun||e[50]!==n.stopSpeaking||e[51]!==n.subscribeVoiceVolume||e[52]!==n.unmuteVoice||e[53]!==A||e[54]!==R||e[55]!==w||e[56]!==C?(D={getState:w,composer:C,append:n.append,deleteMessage:n.deleteMessage,startRun:n.startRun,resumeRun:n.resumeRun,cancelRun:n.cancelRun,getModelContext:n.getModelContext,export:n.export,import:n.import,reset:n.reset,stopSpeaking:n.stopSpeaking,connect
51Voice:n.connectVoice,disconnectVoice:n.disconnectVoice,getVoiceVolume:n.getVoiceVolume,subscribeVoiceVolume:n.subscribeVoiceVolume,muteVoice:n.muteVoice,unmuteVoice:n.unmuteVoice,message:A,__internal_getRuntime:R},e[37]=n.append,e[38]=n.cancelRun,e[39]=n.connectVoice,e[40]=n.deleteMessage,e[41]=n.disconnectVoice,e[42]=n.export,e[43]=n.getModelContext,e[44]=n.getVoiceVolume,e[45]=n.import,e[46]=n.muteVoice,e[47]=n.reset,e[48]=n.resumeRun,e[49]=n.startRun,e[50]=n.stopSpeaking,e[51]=n.subscribeVoiceVolume,e[52]=n.unmuteVoice,e[53]=A,e[54]=R,e[55]=w,e[56]=C,e[57]=D):D=e[57],D},VR=ze(qR),$R=t=>{const e=Y(20),{runtime:n}=t,i=Mi(n),a=Lf();let o,u;e[0]!==a||e[1]!==n?(o=()=>{const m=[];for(const v of["switchedTo","switchedAway"]){const y=n.unstable_on(v,()=>{a(`threadListItem.${v}`,{threadId:n.getState().id})});m.push(y)}return()=>{for(const v of m)v()}},u=[n,a],e[0]=a,e[1]=n,e[2]=o,e[3]=u):(o=e[2],u=e[3]),ye(o,u);let d;e[4]!==i?(d=()=>i,e[4]=i,e[5]=d):d=e[5];let f;e[6]!==n?(f=()=>n,e[6]=n,e[7]=f):f=e[7];let h;return e[8]!==n.archive||e[9]!==n.delete||e[10]!==n.detach||e[11]!==n.generateTitle||e[12]!==n.initialize||e[13]!==n.rename||e[14]!==n.switchTo||e[15]!==n.unarchive||e[16]!==n.updateCustom||e[17]!==d||e[18]!==f?(h={getState:d,switchTo:n.switchTo,rename:n.rename,updateCustom:n.updateCustom,archive:n.archive,unarchive:n.unarchive,delete:n.delete,generateTitle:n.generateTitle,initialize:n.initialize,detach:n.detach,__internal_getRuntime:f},e[8]=n.archive,e[9]=n.delete,e[10]=n.detach,e[11]=n.generateTitle,e[12]=n.initialize,e[13]=n.rename,e[14]=n.switchTo,e[15]=n.unarchive,e[16]=n.updateCustom,e[17]=d,e[18]=f,e[19]=h):h=e[19],h},W0=ze($R),FR=t=>{const e=Y(5),{runtime:n,id:i}=t;let a;e[0]!==i||e[1]!==n?(a=n.getItemById(i),e[0]=i,e[1]=n,e[2]=a):a=e[2];const o=a;let u;return e[3]!==o?(u=W0({runtime:o}),e[3]=o,e[4]=u):u=e[4],qt(u)},YR=ze(FR),GR=t=>{const e=Y(40),{runtime:n,__internal_assistantRuntime:i}=t,a=Mi(n);let o;e[0]!==n.main?(o=VR({runtime:n.main}),e[0]=n.main,e[1]=o):o=e[1];const u=Ka(o);let d;e[2]!==n||e[3]!==a.threadItems?(d=Object.keys(a.threadItems).map(I=>In(I,YR({runtime:n,id:I}),[n,I])),e[2]=n,e[3]=a.threadItems,e[4]=d):d=e[4];const f=Ri(d),h=a.newThreadId??null;let m;e[5]!==u.state||e[6]!==a.archivedThreadIds||e[7]!==a.hasMore||e[8]!==a.isLoading||e[9]!==a.isLoadingMore||e[10]!==a.mainThreadId||e[11]!==a.threadIds||e[12]!==h||e[13]!==f.state?(m={mainThreadId:a.mainThreadId,newThreadId:h,isLoading:a.isLoading,isLoadingMore:a.isLoadingMore,hasMore:a.hasMore,threadIds:a.threadIds,archivedThreadIds:a.archivedThreadIds,threadItems:f.state,main:u.state},e[5]=u.state,e[6]=a.archivedThreadIds,e[7]=a.hasMore,e[8]=a.isLoading,e[9]=a.isLoadingMore,e[10]=a.mainThreadId,e[11]=a.threadIds,e[12]=h,e[13]=f.state,e[14]=m):m=e[14];const v=m;let y;e[15]!==v?(y=()=>v,e[15]=v,e[16]=y):y=e[16];let b;e[17]!==u.methods?(b=()=>u.methods,e[17]=u.methods,e[18]=b):b=e[18];let S;e[19]!==v||e[20]!==f?(S=I=>
51{if(I==="main")return f.get({key:v.mainThreadId});if("id"in I)return f.get({key:I.id});const{index:z,archived:q}=I,X=q!==void 0&&q?v.archivedThreadIds[z]:v.threadIds[z];return f.get({key:X})},e[19]=v,e[20]=f,e[21]=S):S=e[21];let _,w,C,A,R;e[22]!==n?(A=async(I,z)=>{await n.switchToThread(I,z)},R=async()=>{await n.switchToNewThread()},_=()=>n.getLoadThreadsPromise(),w=()=>n.reload(),C=()=>n.loadMore(),e[22]=n,e[23]=_,e[24]=w,e[25]=C,e[26]=A,e[27]=R):(_=e[23],w=e[24],C=e[25],A=e[26],R=e[27]);let D;e[28]!==i?(D=()=>i,e[28]=i,e[29]=D):D=e[29];let N;return e[30]!==_||e[31]!==w||e[32]!==C||e[33]!==D||e[34]!==y||e[35]!==b||e[36]!==S||e[37]!==A||e[38]!==R?(N={getState:y,thread:b,item:S,switchToThread:A,switchToNewThread:R,getLoadThreadsPromise:_,reload:w,loadMore:C,__internal_getAssistantRuntime:D},e[30]=_,e[31]=w,e[32]=C,e[33]=D,e[34]=y,e[35]=b,e[36]=S,e[37]=A,e[38]=R,e[39]=N):N=e[39],N},QR=ze(GR),XR=t=>({getState:()=>t}),KR=ze(XR),ZR=t=>{const e=Y(11);let n;e[0]!==t?(n=()=>({suggestions:(t??[]).map(WR)}),e[0]=t,e[1]=n):n=e[1];const[i]=it(n);let a;e[2]!==i.suggestions?(a=i.suggestions.map(eM),e[2]=i.suggestions,e[3]=a):a=e[3];const o=Ri(a);let u;e[4]!==i?(u=()=>i,e[4]=i,e[5]=u):u=e[5];let d;e[6]!==o?(d=h=>{const{index:m}=h;return o.get({index:m})},e[6]=o,e[7]=d):d=e[7];let f;return e[8]!==u||e[9]!==d?(f={getState:u,suggestion:d},e[8]=u,e[9]=d,e[10]=f):f=e[10],f},JR=ze(ZR);function WR(t){return typeof t=="string"?{title:t,label:"",prompt:t}:{title:t.title,label:t.label,prompt:t.prompt}}function eM(t,e){return In(e,KR(t),[t])}const tM=(t,e)=>{t.thread??(t.thread=Tn({source:"threads",query:{type:"main"},get:n=>n.threads().thread("main")})),t.threadListItem??(t.threadListItem=Tn({source:"threads",query:{type:"main"},get:n=>n.threads().item("main")})),t.composer??(t.composer=Tn({source:"thread",query:{},get:n=>n.threads().thread("main").composer()})),!t.modelContext&&e.modelContext.source===null&&(t.modelContext=I0()),!t.suggestions&&e.suggestions.source===null&&(t.suggestions=JR())},eb=t=>{const e=Y(6),n=$0();let i,a;e[0]!==n||e[1]!==t?(i=()=>t.registerModelContextProvider(n.current.modelContext()),a=[t,n],e[0]=n,e[1]=t,e[2]=i,e[3]=a):(i=e[2],a=e[3]),ye(i,a);let o;return e[4]!==t?(o=QR({runtime:t.threads,__internal_assistantRuntime:t}),e[4]=t,e[5]=o):o=e[5],qt(o)},nM=ze(eb);U0(eb,(t,e)=>{tM(t,e),!t.tools&&e.tools.source===null&&(t.tools=bR({})),!t.dataRenderers&&e.dataRenderers.source===null&&(t.dataRenderers=bA())});const rM=t=>{var e;return(e=t._core)==null?void 0:e.RenderComponent},iM=O.memo(({runtime:t,aui:e=null,children:n})=>{"use no memo";const i=_e({threads:nM(t)},{parent:e}),a=rM(t),o=T.jsxs(Sn,{value:i,children:[a&&T.jsx(a,{}),n]});return e?T.jsx(Sn,{value:e,children:o}):o}),tb=t=>{let e;const n=new Set,i=(h,m)=>{const v=typeof h=="function"?h(e):h;if(!Object.is(v,e)){const y=e;e=m??(typeof v!="object"||v===null)?v:Object.assign({},e,v),n.forEach(b=>b(e,y))}},a=()=>e,d={setState:i,getState:a,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=e=t(i,a,d);return d},sM=(t=>t?tb(t):tb),aM=t=>t;function oM(t,e=aM){const n=bt.useSyncExternalStore(t.subscribe,bt.useCallback(()=>e(t.getState()),[t,e]),bt.useCallback(()=>e(t.getInitialState()),[t,e]));return bt.useDebugValue(n),n}const nb=t=>{const e=sM(t),n=i=>oM(e,i);return Object.assign(n,e),n},Ds=(t=>t?nb(t):nb);function Ct(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}function Ja(t,e=0){return e>100?!1:t===null||typeof t=="string"||typeof t=="boolean"?!0:typeof t=="number"?!Number.isNaN(t)&&Number.isFinite(t):Array.isArray(t)?t.every(n=>Ja(n,e+1)):Ct(t)?Object.entries(t).every(([n,i])=>typeof n=="string"&&Ja(i,e+1)):!1}const lM=100,Hf=(t,e,n)=>{if(t===e)return!0;if(n>lM||t==null||e==null)return!1;if(Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:t.every((o,u)=>Hf(o,e[u],n+1));if(Array.isArray(e)||!Ct(t)||!Ct(e))return!1;const i=Object.keys(t),a=Object.keys(e);return i.length!==a.length?!1:i.every(o=>Object.hasOwn(e,o)&&Hf(t[o],e[o],n+1))},rb=(t,e)=>!Ja(t)||!Ja(e)?!1:Hf(t,e,0);function uM(t){const e=t.metadata;if(!e||typeof e!="object")return;const n=e.custom;if(!n||typeof n!="object")return;const i=n.interactables;return Array.isArray(i)?i:void 0}function cM(t){return`update_${t.replace(/[^a-zA-Z0-9_-]/g,"_")}`}const ib=t=>{if(!Ct(t))return;const e=t.id;return typeof e=="string"||typeof e=="number"?e:void 0};function dM(t,e,n){let i=Array.isArray(e.set)?[...e.set]:[...t];if(e.clear===!0&&(i=[]),Array.isArray(e.remove)&&e.remove.length>0){const o=new Set(e.remove);i=i.filter(u=>{const d=ib(u);return d!==void 0?!o.has(d):!o.has(u)})}const a=e.update;if(Array.isArray(a)&&a.length>0&&(i=i.map(o=>{const u=ib(o);if(u===void 0||!Ct(o))return o;const d=a.find(f=>Ct(f)&&f.id===u);return d?{...o,...d}:o})),Array.isArray(e.add)&&e.add.length>0){const o=n?e.add.map(u=>{if(!Ct(u)||u.id!==void 0)return u;const d=n();return d===void 0?u:{...u,id:d}}):e.add;i=[...i,...o]}return i}function qf(t,e,n){if(!Ct(t)||!Ct(e))return e;const i=Ct(n?.arrayBaseline)?n.arrayBaseline:t,a={...t};for(const[o,u]of Object.entries(e)){const d=i[o];Array.isArray(d)&&Ct(u)?a[o]=dM(d,u,n?.idFactory&&(n.idKeyedFields===void 0||n.idKeyedFields.has(o))?()=>{var f;return(f=n.idFactory)==null?void 0:f.call(n,o)}:void 0):a[o]=u}return a}function fM(t,e){if(!Ct(t)||!Ct(e))return;for(const a of Object.keys(t))if(!(a in e))return;const n={};
51for(const[a,o]of Object.entries(e))(!(a in t)||!rb(t[a],o))&&(n[a]=o);const i=Object.keys(n).length;if(!(i===0||i===Object.keys(e).length))return n}const hM=t=>{if(!t||typeof t!="object")return;const e=t;return e.type==="tool-call"?e:void 0},pM=(t,e)=>{if(!t.args||typeof t.args!="object")return!1;const n=Ct(t.result)?t.result:void 0;if(n?.success===!1)return!1;if(typeof n?.id=="string")return n.id===e;const i=t.args.id;return i===e||i===void 0},mM=t=>{const e=Ct(t)?t.addedItemIds:void 0;if(!Ct(e))return;const n=new Map;for(const[i,a]of Object.entries(e)){if(!Array.isArray(a))continue;const o=a.filter(u=>typeof u=="string");o.length>0&&n.set(i,o)}if(n.size!==0)return i=>{var a;return(a=n.get(i))==null?void 0:a.shift()}},sb=new WeakMap;function gM(t,e,n){var i;let a=sb.get(t);a||(a=new Map,sb.set(t,a));let o=a.get(n);o||(o=new Map,a.set(n,o));const u=o.get(e);if(u)return u;const d=cM(n),f=[],h=()=>f[f.length-1];for(const m of t){if(m.role==="user"){const v=(i=uM(m))==null?void 0:i.find(y=>y.id===e);if(!v)continue;if(v.partial){const y=h();y&&f.push({state:qf(y.state,v.state),origin:"user-edit"})}else f.push({state:v.state,origin:"user-edit"});continue}if(m.role==="assistant")for(const v of m.content??[]){const y=hM(v);if(y){if(y.toolCallId===e&&y.toolName===n)y.args&&typeof y.args=="object"&&f.push({state:y.args,origin:"create",toolCallId:e});else if(y.toolName===d&&pM(y,e)){const b=h();if(b){const{id:S,..._}=y.args,w=mM(y.result);f.push({state:w?qf(b.state,_,{idFactory:w}):qf(b.state,_),origin:"update",toolCallId:y.toolCallId})}}}}}return o.set(e,f),f}function vM(t,e,n){const i=gM(t,e,n),a=i[i.length-1];return a?{state:a.state}:void 0}function ab(t,e){if(!t)return;const{interactables:n,...i}=t,a={...i};if(Array.isArray(n)){const o=[];for(const u of n){const d=vM(e,u.id,u.name);if(!d){o.push({id:u.id,name:u.name,state:u.state});continue}if(rb(u.state,d.state))continue;const f=fM(d.state,u.state);o.push(f?{id:u.id,name:u.name,state:f,partial:!0}:{id:u.id,name:u.name,state:u.state})}o.length&&(a.interactables=o)}return Object.keys(a).length?a:void 0}const Vf={toResponse(t,e){return new Response(Vf.toByteStream(t,e),{headers:e.headers??{}})},fromResponse(t,e){return Vf.fromByteStream(t.body,e)},toByteStream(t,e){return t.pipeThrough(e)},fromByteStream(t,e){return t.pipeThrough(e)}},ob=()=>{let t,e;const n=new Promise((i,a)=>{t=i,e=a});if(!t||!e)throw new Error("Failed to create promise");return{promise:n,resolve:t,reject:e}},yM=()=>{const t=[];let e=!1,n,i;const a=o=>{o.promise||(o.promise=o.reader.read().then(({done:u,value:d})=>{o.promise=void 0,u?(t.splice(t.indexOf(o),1),e&&t.length===0&&n.close()):n.enqueue(d),i?.resolve(),i=void 0}).catch(u=>{console.error(u),t.forEach(d=>{d.reader.cancel()}),t.length=0,n.error(u),i?.reject(u),i=void 0}))};return{readable:new ReadableStream({start(o){n=o},pull(){return i=ob(),t.forEach(o=>{a(o)}),i.promise},cancel(){t.forEach(o=>{o.reader.cancel()}),t.length=0}}),isSealed(){return e},seal(){e=!0,t.length===0&&n.close()},addStream(o){if(e)throw new Error("Cannot add streams after the run callback has settled.");const u={reader:o.getReader()};t.push(u),a(u)},enqueue(o){this.addStream(new ReadableStream({start(u){u.enqueue(o),u.close()}}))}}};var lb=class{constructor(t){U(this,"_controller"),U(this,"_isClosed",!1),this._controller=t}append(t){return this._controller.enqueue({type:"text-delta",path:[],textDelta:t}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}};const ub=t=>new ReadableStream({start(e){var n;return(n=t.start)==null?void 0:n.call(t,new lb(e))},pull(e){var n;return(n=t.pull)==null?void 0:n.call(t,new lb(e))},cancel(e){var n;return(n=t.cancel)==null?void 0:n.call(t,e)}}),cb=()=>{let t;return[ub({start(e){t=e}}),t]};var db=class{constructor(t){U(this,"_controller"),U(this,"_isClosed",!1),U(this,"_mergeTask"),U(this,"_argsTextController"),this._controller=t;const e=ub({start:i=>{this._argsTextController=i}});let n=!1;this._mergeTask=e.pipeTo(new WritableStream({write:i=>{switch(i.type){case"text-delta":n=!0,this._controller.enqueue(i);break;case"part-finish":n||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw new Error(`Unexpected chunk type: ${i.type}`)}}}))}get argsText(){return this._argsTextController}async setResponse(t){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...t.artifact!==void 0?{artifact:t.artifact}:{},result:t.result,isError:t.isError??!1,...t.modelContent!==void 0?{modelContent:t.modelContent}:{},...t.messages!==void 0?{messages:t.messages}:{}})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}};const bM=t=>new ReadableStream({start(e){var n;return(n=t.start)==null?void 0:n.call(t,new db(e))},pull(e){var n;return(n=t.pull)==null?void 0:n.call(t,new db(e))},cancel(e){var n;return(n=t.cancel)==null?void 0:n.call(t,e)}}),xM=()=>{let t;return[bM({start(e){t=e}}),t]};var fb=class{constructor(){U(this,"value",-1)}up(){return++this.value}},_M=class extends TransformStream{constructor(t){super({transform(e,n){n.enqueue({...e,path:[t,...e.path]})}})}};(class extends TransformStream{constructor(t){super({transform(e,n){const{path:[i,...a]}=e;if(t!==i)throw new Error(`Path mismatch: expected ${t}, got ${i}`);n.enqueue({...e,path:a})}})}});var SM=class extends TransformStream{constructor(t){const e=new fb,n=new Map;super({transform(i,a){i.type==="part-start"&&i.path.length===0&&n.set(e.up(),t.up());const[o,...u]=i.path;if(o===void 0){a.enqueue(i);return}const d=n.get(o);if(d===void 0)throw new Error("Path not found");a.enqueue({...i,path:[d,...u]})}})}},TM=class extends TransformStream{constructor(t){super();const e=t(super.readable);Object.defineProperty(this,"readable",{value:e,writable:!1})}};let hb=(t,e=21)=>(n=e)=>{let i="",a=n|0;for(;a-- >0;)i+=t[Math.random()*t.length|0];return i};const pb=hb("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);var wM=class lw{constructor(e){U(this,"_state"),U(this,"_parentId"),this._state=e||{merger:yM(),contentCounter:new fb}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(e){this._state.closeSubscriber=e}_addPart(e,n){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:e,path:[]}),this._state.merger.addStream(n.pipeThrough(new _M(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new SM(this._state.contentCounter)))}appendText(e){var n;(((n=this._state.append)==null?void 0:n.kind)!=="text"||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:"text",parentId:this._parentId,controller:this.addTextPart()}),this._state.append.controller.append(e)}appendReasoning(e){var n;(((n=this._state.append)==null?void 0:n.kind)!=="reasoning"||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:"reasoning",parentId:this._parentId,controller:this.addReasoningPart()}),this._state.append.controller.append(e)}addTextPart(){const[e,n]=cb();return this._addPart(this._withParentIdOption({type:"text"}),e),n}addReasoningPart(){const[e,n]=cb();return this._addPart(this._withParentIdOption({type:"reasoning"}),e),n}addToolCallPart(e){const n=typeof e=="string"?{toolName:e}:e,i=n.toolName,a=n.toolCallId??pb(),[o,u]=xM();return this._addPart({type:"tool-call",toolName:i,toolCallId:a,...this._parentId&&{parentId:this._parentId}},o),n.argsText!==void 0&&(u.argsText.append(n.argsText),u.argsText.close()),n.args!==void 0&&(u.argsText.append(JSON.stringify(n.args)),u.argsText.close()),n.response!==void 0&&u.setResponse(n.response),u}_finishedPartStream(){return new ReadableStream({start(e){e.enqueue({type:"part-finish",path:[]}),e.close()}})}_withParentIdOption(e){return this._parentId?{...e,parentId:this._parentId}:e}appendSource(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendFile(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendData(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}enqueue(e){this._state.merger.enqueue(e),e.type==="part-start"&&e.path.length===0&&this._state.contentCounter.up()}withParentId(e){const n=new lw(this._state);return n._parentId=e,n}close(){var e,n,i,a;(n=(e=this._state.append)==null?void 0:e.controller)==null||n.close(),this._state.merger.seal(),(a=(i=this._state).closeSubscriber)==null||a.call(i)}};function CM(t){const e=new wM;return(async()=>{try{await t(e)}catch(i){throw e.__internal_isClosed||e.enqueue({type:"error",path:[],error:String(i)}),i}finally{e.__internal_isClosed||e.close()}})(),e.__internal_getReadable()}function EM(){const{resolve:t,promise:e}=ob();let n;return[CM(i=>(n=i,n.__internal_subscribeToClose(t),e)),n]}var AM=class extends TransformStream{constructor(t,e,n){const[i,a]=EM();let o;super({start(u){var d;return o=i.pipeTo(new WritableStream({write(f){u.enqueue(f)},abort(f){u.error(f)},close(){u.terminate()}})).catch(f=>{u.error(f)}),(d=t.start)==null?void 0:d.call(t,a)},transform(u){var d;return(d=t.transform)==null?void 0:d.call(t,u,a)},async flush(){var u;await((u=t.flush)==null?void 0:u.call(t,a)),a.close(),await o}},e,n)}};function RM(t){const e=["ROOT"];let n=-1,i=null;const a=[];let o;function u(){o!==void 0&&(a.push(JSON.parse(`"${o}"`)),o=void 0)}function d(v,y,b){switch(v){case'"':n=y,e.pop(),e.push(b),e.push("INSIDE_STRING"),u();break;case"f":case"t":case"n":n=y,i=y,e.pop(),e.push(b),e.push("INSIDE_LITERAL");break;case"-":e.pop(),e.push(b),e.push("INSIDE_NUMBER"),u();break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=y,e.pop(),e.push(b),e.push("INSIDE_NUMBER"),u();break;case"{":n=y,e.pop(),e.push(b),e.push("INSIDE_OBJECT_START"),u();break;case"[":n=y,e.pop(),e.push(b),e.push("INSIDE_ARRAY_START"),u();break}}function f(v,y){switch(v){case",":e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=y,e.pop(),o=a.pop();break}}
51function h(v,y){switch(v){case",":e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA"),o=(Number(o)+1).toString();break;case"]":n=y,e.pop(),o=a.pop();break}}for(let v=0;v<t.length;v++){const y=t[v];switch(e[e.length-1]){case"ROOT":d(y,v,"FINISH");break;case"INSIDE_OBJECT_START":switch(y){case'"':e.pop(),e.push("INSIDE_OBJECT_KEY"),o="";break;case"}":n=v,e.pop(),o=a.pop();break}break;case"INSIDE_OBJECT_AFTER_COMMA":y==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"),o="");break;case"INSIDE_OBJECT_KEY":switch(y){case'"':e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY");break;case"\\":e.push("INSIDE_STRING_ESCAPE"),o+=y;break;default:o+=y;break}break;case"INSIDE_OBJECT_AFTER_KEY":y===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":d(y,v,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":f(y,v);break;case"INSIDE_STRING":switch(y){case'"':e.pop(),n=v,o=a.pop();break;case"\\":e.push("INSIDE_STRING_ESCAPE");break;default:n=v}break;case"INSIDE_ARRAY_START":y==="]"?(n=v,e.pop(),o=a.pop()):(n=v,o="0",d(y,v,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(y){case",":e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA"),o=(Number(o)+1).toString();break;case"]":n=v,e.pop(),o=a.pop();break;default:n=v;break}break;case"INSIDE_ARRAY_AFTER_COMMA":d(y,v,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":e.pop(),e[e.length-1]==="INSIDE_STRING"?n=v:e[e.length-1]==="INSIDE_OBJECT_KEY"&&(o+=y);break;case"INSIDE_NUMBER":switch(y){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=v;break;case"e":case"E":case"-":case".":break;case",":e.pop(),o=a.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&h(y,v),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&f(y,v);break;case"}":e.pop(),o=a.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&f(y,v);break;case"]":e.pop(),o=a.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&h(y,v);break;default:e.pop(),o=a.pop();break}break;case"INSIDE_LITERAL":{const b=t.substring(i,v+1);!"false".startsWith(b)&&!"true".startsWith(b)&&!"null".startsWith(b)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?f(y,v):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&h(y,v)):n=v;break}}}let m=t.slice(0,n+1);for(let v=e.length-1;v>=0;v--)switch(e[v]){case"INSIDE_STRING":m+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":m+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":m+="]";break;case"INSIDE_LITERAL":{const y=t.substring(i,t.length);"true".startsWith(y)?m+="true".slice(y.length):"false".startsWith(y)?m+="false".slice(y.length):"null".startsWith(y)&&(m+="null".slice(y.length))}}return[m,a]}var ki={exports:{}},mb;function MM(){if(mb)return ki.exports;mb=1;const t=typeof Buffer<"u",e=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function i(d,f,h){h==null&&f!==null&&typeof f=="object"&&(h=f,f=void 0),t&&Buffer.isBuffer(d)&&(d=d.toString()),d&&d.charCodeAt(0)===65279&&(d=d.slice(1));const m=JSON.parse(d,f);if(m===null||typeof m!="object")return m;const v=h&&h.protoAction||"error",y=h&&h.constructorAction||"error";if(v==="ignore"&&y==="ignore")return m;if(v!=="ignore"&&y!=="ignore"){if(e.test(d)===!1&&n.test(d)===!1)return m}else if(v!=="ignore"&&y==="ignore"){if(e.test(d)===!1)return m}else if(n.test(d)===!1)return m;return a(m,{protoAction:v,constructorAction:y,safe:h&&h.safe})}function a(d,{protoAction:f="error",constructorAction:h="error",safe:m}={}){let v=[d];for(;v.length;){const y=v;v=[];for(const b of y){if(f!=="ignore"&&Object.prototype.hasOwnProperty.call(b,"__proto__")){if(m===!0)return null;if(f==="error")throw new SyntaxError("Object contains forbidden prototype property");delete b.__proto__}if(h!=="ignore"&&Object.prototype.hasOwnProperty.call(b,"constructor")&&b.constructor!==null&&typeof b.constructor=="object"&&Object.prototype.hasOwnProperty.call(b.constructor,"prototype")){if(m===!0)return null;if(h==="error")throw new SyntaxError("Object contains forbidden prototype property");delete b.constructor}for(const S in b){const _=b[S];_&&typeof _=="object"&&v.push(_)}}}return d}function o(d,f,h){const{stackTraceLimit:m}=Error;Error.stackTraceLimit=0;try{return i(d,f,h)}finally{Error.stackTraceLimit=m}}function u(d,f){const{stackTraceLimit:h}=Error;Error.stackTraceLimit=0;try{return i(d,f,{safe:!0})}catch{return}finally{Error.stackTraceLimit=h}}return ki.exports=o,ki.exports.default=o,ki.exports.parse=o,ki.exports.safeParse=u,ki.exports.scan=a,ki.exports}var kM=MM();const gb=qa(kM),$f=Symbol("aui.parse-partial-json-object.meta"),vb=t=>{if(t.length===0)return{[$f]:{state:"partial",partialPath:[]}};try{const e=gb.parse(t);if(typeof e!="object"||e===null)throw new Error("argsText is expected to be an object");return e[$f]={state:"complete",partialPath:[]},e}catch{try{const[e,n]=RM(t),i=gb.parse(e);if(typeof i!="object"||i===null)throw new Error("argsText is expected to be an object");return i[$f]={state:"partial",partialPath:n},i}catch{return}}};var IM=class Xs{constructor(e=null){U(this,"_state"),this._state=e}get state(){return this._state}append(e){this._state=e.reduce((n,i)=>Xs.apply(n,i),this._state)}static apply(e,n){const i=n.type;switch(i){case"set":return Xs.updatePath(e,n.path,()=>n.value);case"append-text":return Xs.updatePath(e,n.path,a=>{if(typeof a!="string")throw new Error(`Expected string at path [${n.path.join(", ")}]`);return a+n.value});default:throw new Error(`Invalid operation type: ${i}`)}}static updatePath(e,n,i){if(n.length===0)return i(e);if(e??(e={}),typeof e!="object")throw new Error(`Invalid path: [${n.join(", ")}]`);const[a,...o]=n;if(Array.isArray(e)){const d=Number(a);if(Number.isNaN(d))throw new Error(`Expected array index at [${n.join(", ")}]`);if(d>e.length||d<0)throw new Error("Insert array index out of bounds");const f=[...e];return f[d]=Xs.updatePath(f[d],o,i),f}const u={...e};return u[a]=Xs.updatePath(u[a],o,i),u}},OM=class{constructor(){U(this,"_streamStartTime"),U(this,"_firstTokenTime"),U(this,"_totalChunks",0),U(this,"_toolCallIds",new Set),this._streamStartTime=Date.now()}recordChunk(){this._totalChunks++}recordFirstToken(){this._firstTokenTime===void 0&&(this._firstTokenTime=Date.now())}recordToolCallStart(t){this._toolCallIds.add(t)}getTiming(t,e){const n=Date.now()-this._streamStartTime,i=t&&t>0?t:e?Math.ceil(e.length/4):void 0,a=i&&n>0?i/n*1e3:void 0;return{streamStartTime:this._streamStartTime,...this._firstTokenTime!==void 0?{firstTokenTime:this._firstTokenTime-this._streamStartTime}:void 0,totalStreamTime:n,...i!==void 0?{tokenCount:i}:void 0,...a!==void 0?{tokensPerSecond:a}:void 0,totalChunks:this._totalChunks,toolCallCount:this._toolCallIds.size}}};const DM=({unstable_state:t=null}={})=>({role:"assistant",status:{type:"running"},parts:[],get content(){return this.parts},metadata:{unstable_state:t,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}),tu=(t,e,n)=>{if(t.parts.length===0)throw new Error("No parts available to update.");if(e.path.length!==1)throw new Error("Nested paths are not supported yet.");const i=e.path[0],a=n(t.parts[i]);return{...t,parts:[...t.parts.slice(0,i),a,...t.parts.slice(i+1)],get content(){return this.parts}}},NM=(t,e)=>{const n=e.part;if(n.type==="text"||n.type==="reasoning"){const i={type:n.type,text:"",status:{type:"running"},...n.parentId&&{parentId:n.parentId}};return{...t,parts:[...t.parts,i],get content(){return this.parts}}}else if(n.type==="tool-call"){const i={type:"tool-call",state:"partial-call",status:{type:"running",isArgsComplete:!1},toolCallId:n.toolCallId,toolName:n.toolName,argsText:"",args:{},timing:{startedAt:Date.now()},...n.parentId&&{parentId:n.parentId}};return{...t,parts:[...t.parts,i],get content(){return this.parts}}}else if(n.type==="source"){const i={type:"source",sourceType:n.sourceType,id:n.id,url:n.url,...n.title?{title:n.title}:void 0,...n.parentId&&{parentId:n.parentId}};return{...t,parts:[...t.parts,i],get content(){return this.parts}}}else if(n.type==="file"){const i={type:"file",mimeType:n.mimeType,data:n.data,...n.parentId&&{parentId:n.parentId}};return{...t,parts:[...t.parts,i],get content(){return this.parts}}}else if(n.type==="data"){const i={type:"data",name:n.name,data:n.data,...n.parentId&&{parentId:n.parentId}};return{...t,parts:[...t.parts,i],get content(){return this.parts}}}else throw new Error(`Unsupported part type: ${n.type}`)},zM=(t,e)=>tu(t,e,n=>{if(n.type!=="tool-call")throw new Error("Last is not a tool call");return n.state!=="partial-call"?n:{...n,state:"call"}}),jM=(t,e)=>tu(t,e,n=>({...n,status:{type:"complete",reason:"unknown"}})),BM=(t,e)=>tu(t,e,n=>{if(n.type==="text"||n.type==="reasoning")return{...n,text:n.text+e.textDelta};if(n.type==="tool-call"){const i=n.argsText+e.textDelta,a=vb(i)??n.args;return{...n,argsText:i,args:a}}else throw new Error("text-delta received but part is neither text nor tool-call")}
51),PM=(t,e)=>tu(t,e,n=>{if(n.type==="tool-call")return{...n,state:"result",...n.timing!==void 0?{timing:{...n.timing,completedAt:n.timing.completedAt??Date.now()}}:{},...e.artifact!==void 0?{artifact:e.artifact}:{},result:e.result,isError:e.isError??!1,...e.modelContent!==void 0?{modelContent:e.modelContent}:{},...e.messages!==void 0?{messages:e.messages}:{},status:{type:"complete",reason:"stop"}};throw new Error("Result chunk received but part is not a tool-call")}),yb=(t,e)=>{var n,i;if(((n=t.status)==null?void 0:n.type)==="incomplete"&&((i=t.status)==null?void 0:i.reason)==="error")return t;const a=LM(e);return{...t,status:a}},LM=t=>t.finishReason==="tool-calls"?{type:"requires-action",reason:"tool-calls"}:t.finishReason==="stop"||t.finishReason==="unknown"?{type:"complete",reason:t.finishReason}:{type:"incomplete",reason:t.finishReason},UM=(t,e)=>({...t,metadata:{...t.metadata,unstable_annotations:[...t.metadata.unstable_annotations,...e.annotations]}}),HM=(t,e)=>({...t,metadata:{...t.metadata,unstable_data:[...t.metadata.unstable_data,...e.data]}}),qM=(t,e)=>({...t,metadata:{...t.metadata,steps:[...t.metadata.steps,{state:"started",messageId:e.messageId}]}}),VM=(t,e)=>{var n;const i=t.metadata.steps.slice(),a=i.length-1;return i.length>0&&((n=i[a])==null?void 0:n.state)==="started"?i[a]={...i[a],state:"finished",finishReason:e.finishReason,usage:e.usage,isContinued:e.isContinued}:i.push({state:"finished",messageId:pb(),finishReason:e.finishReason,usage:e.usage,isContinued:e.isContinued}),{...t,metadata:{...t.metadata,steps:i}}},$M=(t,e)=>({...t,status:{type:"incomplete",reason:"error",error:e.error}}),FM=(t,e)=>{const n=new IM(t.metadata.unstable_state);return n.append(e.operations),{...t,metadata:{...t.metadata,unstable_state:n.state}}},bb=(t,e)=>{let n=0;for(const a of e.metadata.steps)a.state==="finished"&&a.usage&&(n+=a.usage.outputTokens);let i="";for(const a of e.parts)(a.type==="text"||a.type==="reasoning")&&(i+=a.text);return t.getTiming(n>0?n:void 0,i||void 0)},YM=t=>{let e=!1;return()=>{e||(e=!0,queueMicrotask(()=>{e=!1,t()}))}};var GM=class extends TransformStream{constructor({initialMessage:t,throttle:e,onError:n}={}){let i=t??DM();const a=new OM;let o;const u=e?YM(()=>{o?.enqueue(i)}):()=>{o?.enqueue(i)};super({start(d){o=d},transform(d){a.recordChunk();const f=d.type;switch(f){case"part-start":i=NM(i,d),d.part.type==="tool-call"&&a.recordToolCallStart(d.part.toolCallId);break;case"tool-call-args-text-finish":i=zM(i,d);break;case"part-finish":i=jM(i,d);break;case"text-delta":i=BM(i,d),a.recordFirstToken();break;case"result":i=PM(i,d);break;case"message-finish":i=yb(i,d);break;case"annotations":i=UM(i,d);break;case"data":i=HM(i,d);break;case"step-start":i=qM(i,d);break;case"step-finish":i=VM(i,d);break;case"error":i=$M(i,d),n?.(d.error);break;case"update-state":i=FM(i,d);break;default:throw new Error(`Unsupported chunk type: ${f}`)}i.status.type!=="running"&&(i={...i,metadata:{...i.metadata,timing:bb(a,i)}}),u()},flush(d){var f,h;if(((f=i.status)==null?void 0:f.type)==="running"){const m=((h=i.parts)==null?void 0:h.some(v=>v.type==="tool-call"&&(v.state==="call"||v.state==="partial-call")&&v.result===void 0))??!1;i=yb(i,{finishReason:m?"tool-calls":"unknown"}),i={...i,metadata:{...i.metadata,timing:bb(a,i)}},d.enqueue(i)}}})}},QM=class extends TM{constructor(){super(t=>{const e=new AM({transform(n,i){i.appendText(n)}});return t.pipeThrough(new TextDecoderStream).pipeThrough(e)})}},XM=class Zu{constructor(e){U(this,"readable"),this.readable=e,this.readable=e}static fromAssistantStream(e){return new Zu(e.pipeThrough(new GM))}async unstable_result(){let e;for await(const n of this)e=n;return e||{role:"assistant",status:{type:"complete",reason:"unknown"},parts:[],content:[],metadata:{unstable_state:null,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}}[Symbol.asyncIterator](){const e=this.readable.getReader();return{async next(){const{done:n,value:i}=await e.read();return n?{done:!0,value:void 0}:{done:!1,value:i}}}}tee(){const[e,n]=this.readable.tee();return[new Zu(e),new Zu(n)]}};const xb=Symbol.for("aui.tool-response");var KM=class Vp{constructor(e){U(this,"artifact"),U(this,"result"),U(this,"isError"),U(this,"modelContent"),U(this,"messages"),e.artifact!==void 0&&(this.artifact=e.artifact),this.result=e.result,this.isError=e.isError??!1,e.modelContent!==void 0&&(this.modelContent=e.modelContent),e.messages!==void 0&&(this.messages=e.messages)}get[xb](){return!0}static[Symbol.hasInstance](e){return typeof e=="object"&&e!==null&&xb in e}static toResponse(e){return e instanceof Vp?e:new Vp({result:e===void 0?"<no result>":e})}};const qn=hb("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),_b=t=>{const e=Y(7),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"message",query:{type:"index",index:n},get:f=>f.message().attachment({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={attachment:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},Sb=t=>{const e=Y(7),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"composer",query:{type:"index",index:n},get:f=>f.composer().attachment({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={attachment:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},ZM=t=>{const e=Y(7),{runtime:n,children:i}=t;let a;e[0]!==n?(a=W0({runtime:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={threadListItem:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},Tb=t=>{const e=Y(10),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"thread",query:{type:"index",index:n},get:h=>h.thread().message({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==n?(o=Tn({source:"message",query:{},get:h=>h.thread().message({index:n}).composer()}),e[2]=n,e[3]=o):o=e[3];let u;e[4]!==a||e[5]!==o?(u={message:a,composer:o},e[4]=a,e[5]=o,e[6]=u):u=e[6];const d=_e(u);let f;return e[7]!==d||e[8]!==i?(f=T.jsx(Sn,{value:d,children:i}),e[7]=d,e[8]=i,e[9]=f):f=e[9],f},Ff=t=>{const e=Y(7),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"message",query:{type:"index",index:n},get:f=>f.message().part({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={part:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},JM=t=>{const e=Y(7),{text:n,isRunning:i}=t;let a;e[0]!==i?(a=i?{type:"running"}:{type:"complete"},e[0]=i,e[1]=a):a=e[1];let o;e[2]!==a||e[3]!==n?(o={type:"text",text:n,status:a},e[2]=a,e[3]=n,e[4]=o):o=e[4];const u=o;let d;return e[5]!==u?(d={getState:()=>u,addToolResult:ek,resumeToolCall:tk,respondToToolApproval:nk},e[5]=u,e[6]=d):d=e[6],d},WM=ze(JM),Yf=t=>{const e=Y(8),{text:n,isRunning:i,children:a}=t,o=i===void 0?!1:i;let u;e[0]!==o||e[1]!==n?(u=WM({text:n,isRunning:o}),e[0]=o,e[1]=n,e[2]=u):u=e[2];let d;e[3]!==u?(d={part:u},e[3]=u,e[4]=d):d=e[4];const f=_e(d);let h;return e[5]!==f||e[6]!==a?(h=T.jsx(Sn,{value:f,children:a}
51),e[5]=f,e[6]=a,e[7]=h):h=e[7],h};function ek(){throw new Error("Not supported")}function tk(){throw new Error("Not supported")}function nk(){throw new Error("Not supported")}const rk=Object.freeze({type:"complete"}),ik=t=>{var e;const n=Y(9),{parts:i,getMessagePart:a}=t,[o,u]=it(!0),d=((e=i[i.length-1])==null?void 0:e.status)??rk;let f;n[0]!==o||n[1]!==i||n[2]!==d?(f={parts:i,collapsed:o,status:d},n[0]=o,n[1]=i,n[2]=d,n[3]=f):f=n[3];const h=f;let m;n[4]!==h?(m=()=>h,n[4]=h,n[5]=m):m=n[5];let v;return n[6]!==a||n[7]!==m?(v={getState:m,setCollapsed:u,part:a},n[6]=a,n[7]=m,n[8]=v):v=n[8],v},sk=ze(ik),ak=t=>{const e=Y(5),{startIndex:n,endIndex:i,children:a}=t,o=ce(ok).slice(n,i+1),u=_e(),d=sk({parts:o,getMessagePart:v=>{const{index:y}=v;if(y<0||y>=o.length)throw new Error(`ChainOfThought part index ${y} is out of bounds (0..${o.length-1})`);return u.message().part({index:n+y})}});let f;e[0]!==d?(f={chainOfThought:d},e[0]=d,e[1]=f):f=e[1];const h=_e(f);let m;return e[2]!==h||e[3]!==a?(m=T.jsx(Sn,{value:h,children:a}),e[2]=h,e[3]=a,e[4]=m):m=e[4],m};function ok(t){return t.message.parts}const wb=t=>{const e=Y(7),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"suggestions",query:{index:n},get:f=>f.suggestions().suggestion({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={suggestion:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},lk=t=>{const e=Y(7),{index:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"composer",query:{index:n},get:f=>f.composer().queueItem({index:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==a?(o={queueItem:a},e[2]=a,e[3]=o):o=e[3];const u=_e(o);let d;return e[4]!==u||e[5]!==i?(d=T.jsx(Sn,{value:u,children:i}),e[4]=u,e[5]=i,e[6]=d):d=e[6],d},nu=Symbol("innerMessage"),On=Symbol("skip-update");function uk(t,e){if(t===void 0&&e===void 0)return!0;if(t===void 0||e===void 0)return!1;for(const n of Object.keys(t)){const i=t[n],a=e[n];if(!Object.is(i,a))return!1}return!0}var Wa=class{constructor(){U(this,"_subscribers",new Set)}subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}waitForUpdate(){return new Promise(t=>{const e=this.subscribe(()=>{e(),t()})})}_notifySubscribers(){const t=[];for(const e of this._subscribers)try{e()}catch(n){t.push(n)}if(t.length>0){if(t.length===1)throw t[0];for(const e of t)console.error(e);throw new AggregateError(t)}}},ru=class{constructor(){U(this,"_subscriptions",new Set),U(this,"_connection")}get isConnected(){return!!this._connection}notifySubscribers(t){for(const e of this._subscriptions)e(t)}_updateConnection(){var t;if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else(t=this._connection)==null||t.call(this),this._connection=void 0}subscribe(t){return this._subscriptions.add(t),this._updateConnection(),()=>{this._subscriptions.delete(t),this._updateConnection()}}},Dn=class extends ru{constructor(t){super(),U(this,"binding"),U(this,"_previousState"),U(this,"getState",()=>(this.isConnected||this._syncState(),this._previousState)),this.binding=t;const e=t.getState();if(e===On)throw new Error("Entry not available in the store");this._previousState=e}get path(){return this.binding.path}_syncState(){const t=this.binding.getState();return t===On||uk(t,this._previousState)?!1:(this._previousState=t,!0)}_connect(){const t=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(t)}},Gf=class extends ru{constructor(t){super(),U(this,"binding"),U(this,"_previousStateDirty",!0),U(this,"_previousState"),U(this,"getState",()=>{if(!this.isConnected||this._previousStateDirty){const e=this.binding.getState();e!==On&&(this._previousState=e),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState}),this.binding=t}get path(){return this.binding.path}_connect(){const t=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(t)}},iu=class extends ru{constructor(t){super(),U(this,"binding"),this.binding=t}get path(){return this.binding.path}getState(){return this.binding.getState()}outerSubscribe(t){return this.binding.subscribe(t)}_connect(){const t=()=>{this.notifySubscribers()};
51let e=this.binding.getState(),n=e?.subscribe(t);const i=()=>{const o=this.binding.getState();o!==e&&(e=o,n?.(),n=o?.subscribe(t),t())},a=this.outerSubscribe(i);return()=>{a?.(),n?.()}}},Cb=class extends ru{constructor(t){super(),U(this,"config"),this.config=t}getState(){return this.config.binding.getState()}outerSubscribe(t){return this.config.binding.subscribe(t)}_connect(){const t=o=>{this.notifySubscribers(o)};let e=this.config.binding.getState(),n=e?.unstable_on(this.config.event,t);const i=()=>{const o=this.config.binding.getState();o!==e&&(e=o,n?.(),n=o?.unstable_on(this.config.event,t))},a=this.outerSubscribe(i);return()=>{a?.(),n?.()}}},Eb=class{constructor(t){U(this,"_core"),this._core=t,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(t){return this._core.subscribe(t)}},Ab=class extends Eb{constructor(t,e){super(t),U(this,"_composerApi"),this._composerApi=e}remove(){const t=this._composerApi.getState();if(!t)throw new Error("Composer is not available");return t.removeAttachment(this.getState().id)}},ck=class extends Ab{get source(){return"thread-composer"}},dk=class extends Ab{get source(){return"edit-composer"}},fk=class extends Eb{get source(){return"message"}remove(){throw new Error("Message attachments cannot be removed")}};const su=Object.freeze([]),Rb=Object.freeze({}),hk=t=>Object.freeze({type:"thread",isEditing:t?.isEditing??!1,canCancel:t?.canCancel??!1,canSend:t?.canSend??!1,isEmpty:t?.isEmpty??!0,attachments:t?.attachments??su,text:t?.text??"",role:t?.role??"user",runConfig:t?.runConfig??Rb,attachmentAccept:t?.attachmentAccept??"",dictation:t?.dictation,quote:t?.quote,queue:t?.queue??su,value:t?.text??""}),pk=t=>Object.freeze({type:"edit",isEditing:t?.isEditing??!1,canCancel:t?.canCancel??!1,canSend:t?.canSend??!1,isEmpty:t?.isEmpty??!0,text:t?.text??"",role:t?.role??"user",attachments:t?.attachments??su,runConfig:t?.runConfig??Rb,attachmentAccept:t?.attachmentAccept??"",dictation:t?.dictation,quote:t?.quote,queue:t?.queue??su,parentId:t?.parentId??null,sourceId:t?.sourceId??null,value:t?.text??""});var Mb=class{constructor(t){U(this,"_core"),U(this,"_eventSubscriptionSubjects",new Map),this._core=t}get path(){return this._core.path}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.steerQueueItem=this.steerQueueItem.bind(this),this.removeQueueItem=this.removeQueueItem.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.setText(t)}setRunConfig(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.setRunConfig(t)}addAttachment(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");return e.addAttachment(t)}reset(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.reset()}clearAttachments(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.clearAttachments()}send(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.send(t)}cancel(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.cancel()}steerQueueItem(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.steerQueueItem(t)}removeQueueItem(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.removeQueueItem(t)}setRole(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.setRole(t)}startDictation(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.startDictation()}stopDictation(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.stopDictation()}setQuote(t){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.setQuote(t)}
51subscribe(t){return this._core.subscribe(t)}unstable_on(t,e){let n=this._eventSubscriptionSubjects.get(t);return n||(n=new Cb({event:t,binding:this._core}),this._eventSubscriptionSubjects.set(t,n)),n.subscribe(e)}},mk=class extends Mb{constructor(t){const e=new Gf({path:t.path,getState:()=>hk(t.getState()),subscribe:n=>t.subscribe(n)});super({path:t.path,getState:()=>t.getState(),subscribe:n=>e.subscribe(n)}),U(this,"_getState"),this._getState=e.getState.bind(e),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"thread"}getState(){return this._getState()}getAttachmentByIndex(t){return new ck(new Dn({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}.attachments[${t}]`},getState:()=>{const e=this.getState().attachments[t];return e?{...e,source:"thread-composer"}:On},subscribe:e=>this._core.subscribe(e)}),this._core)}},gk=class extends Mb{constructor(t,e){const n=new Gf({path:t.path,getState:()=>pk(t.getState()),subscribe:i=>t.subscribe(i)});super({path:t.path,getState:()=>t.getState(),subscribe:i=>n.subscribe(i)}),U(this,"_beginEdit"),U(this,"_getState"),this._beginEdit=e,this._getState=n.getState.bind(n),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"edit"}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(t){return new dk(new Dn({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}.attachments[${t}]`},getState:()=>{const e=this.getState().attachments[t];return e?{...e,source:"edit-composer"}:On},subscribe:e=>this._core.subscribe(e)}),this._core)}};const eo=t=>t.content.filter(e=>e.type==="text").map(e=>e.text).join(`
52
53`),kb={"allow-once":!0,"allow-always":!0,"reject-once":!1,"reject-always":!1},vk=(t,e)=>{var n;let i,a;if("optionId"in e){const o=(n=t.options)==null?void 0:n.find(u=>u.id===e.optionId);if(!o)throw new Error(`Tool approval has no option with id "${e.optionId}"`);if("approved"in e)i=e.approved;else{if(!Object.hasOwn(kb,o.kind))throw new Error(`Tool approval option "${o.id}" has a custom kind "${o.kind}"; respond with an explicit approved value instead`);i=kb[o.kind]}a=o.id}else i=e.approved;return{approvalId:t.id,approved:i,...a!==void 0&&{optionId:a},...e.reason!=null&&{reason:e.reason}}};var Ib=class{constructor(t,e,n){U(this,"contentBinding"),U(this,"messageApi"),U(this,"threadApi"),this.contentBinding=t,this.messageApi=e,this.threadApi=n,this.__internal_bindMethods()}get path(){return this.contentBinding.path}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.respondToToolApproval=this.respondToToolApproval.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(t){const e=this.contentBinding.getState();if(!e)throw new Error("Message part is not available");if(e.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const n=this.messageApi.getState();if(!n)throw new Error("Message is not available");const i=e.toolName,a=e.toolCallId,o=KM.toResponse(t);this.threadApi.getState().addToolResult({messageId:n.id,toolName:i,toolCallId:a,result:o.result,artifact:o.artifact,isError:o.isError})}resumeToolCall(t){const e=this.contentBinding.getState();if(!e)throw new Error("Message part is not available");if(e.type!=="tool-call")throw new Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw new Error("Thread API is not available");const n=e.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:n,payload:t})}respondToToolApproval(t){const e=this.contentBinding.getState();if(!e)throw new Error("Message part is not available");if(e.type!=="tool-call")throw new Error("Tried to respond to tool approval on non-tool message part");if(!e.approval||e.approval.approved!==void 0||e.approval.resolution!==void 0)throw new Error("Tool call has no pending approval");if(!this.threadApi)throw new Error("Thread API is not available");this.threadApi.getState().respondToToolApproval(vk(e.approval,t))}subscribe(t){return this.contentBinding.subscribe(t)}};const au=Object.freeze({type:"complete"}),yk=(t,e,n)=>{if(t.role!=="assistant")return au;if(n.type==="tool-call")return n.result?au:t.status;const i=e===Math.max(0,t.content.length-1);return t.status.type==="requires-action"?au:i?t.status:au},Ob=(t,e)=>{const n=t.content[e];if(!n)return On;const i=yk(t,e,n);return Object.freeze({...n,[nu]:n[nu],status:i})};var bk=class{constructor(t,e){U(this,"_core"),U(this,"_threadBinding"),U(this,"composer"),U(this,"_getEditComposerRuntimeCore",()=>this._threadBinding.getState().getEditComposer(this._core.getState().id)),this._core=t,this._threadBinding=e,this.composer=new gk(new iu({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:n=>this._threadBinding.subscribe(n)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.reload=this.reload.bind(this),this.delete=this.delete.bind(this),this.get
53State=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}getState(){return this._core.getState()}delete(){const t=this._core.getState();return this._threadBinding.getState().deleteMessage(t.id)}reload(t={}){const e=this._getEditComposerRuntimeCore(),n=e??this._threadBinding.getState().composer,i=e??n,{runConfig:a=i.runConfig}=t,o=this._core.getState();if(o.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:o.parentId,sourceId:o.id,runConfig:a})}speak(){const t=this._core.getState();return this._threadBinding.getState().speak(t.id)}stopSpeaking(){var t;const e=this._core.getState();if(((t=this._threadBinding.getState().speech)==null?void 0:t.messageId)===e.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:t}){const e=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:e.id,type:t})}switchToBranch({position:t,branchId:e}){const n=this._core.getState();if(e&&t)throw new Error("May not specify both branchId and position");
53if(!e&&!t)throw new Error("Must specify either branchId or position");const i=this._threadBinding.getState().getBranches(n.id);let a=e;if(t==="previous"?a=i[n.branchNumber-2]:t==="next"&&(a=i[n.branchNumber]),!a)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(a)}unstable_getCopyText(){return eo(this.getState())}subscribe(t){return this._core.subscribe(t)}getMessagePartByIndex(t){if(t<0)throw new Error("Message part index must be >= 0");return new Ib(new Dn({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${t}]`,messagePartSelector:{type:"index",index:t}},getState:()=>Ob(this.getState(),t),subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getMessagePartByToolCallId(t){return new Ib(new Dn({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(t)}]`,messagePartSelector:{type:"toolCallId",toolCallId:t}},getState:()=>{const e=this._core.getState(),n=e.content.findIndex(i=>i.type==="tool-call"&&i.toolCallId===t);return n===-1?On:Ob(e,n)},subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getAttachmentByIndex(t){return new fk(new Dn({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${t}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:t}},getState:()=>{var e;const n=(e=this.getState().attachments)==null?void 0:e[t];return n?{...n,source:"message"}:On},subscribe:e=>this._core.subscribe(e)}))}};const xk=t=>({parentId:t.parentId??null,sourceId:t.sourceId??null,runConfig:t.runConfig??{},...t.stream?{stream:t.stream}:{}}),_k=t=>({parentId:t.parentId??null,sourceId:t.sourceId??null,runConfig:t.runConfig??{}}),Sk=(t,e)=>{var n,i;return typeof e=="string"?{createdAt:new Date,parentId:((n=t.at(-1))==null?void 0:n.id)??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:e}],attachments:[],metadata:{custom:{}}}:{createdAt:e.createdAt??new Date,parentId:e.parentId??((i=t.at(-1))==null?void 0:i.id)??null,sourceId:e.sourceId??null,role:e.role??"user",content:e.content,attachments:e.attachments??[],metadata:e.metadata??{custom:{}},runConfig:e.runConfig??{},startRun:e.startRun}},Tk=(t,e)=>{const n=t.messages.at(-1);return Object.freeze({threadId:e.id,metadata:e,capabilities:t.capabilities,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning??(n?.role!=="assistant"?!1:n.status.type==="running"),messages:t.messages,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,voice:t.voice})};var Db=class{constructor(t,e){U(this,"_threadBinding"),U(this,"composer"),U(this,"_eventSubscriptionSubjects",new Map);const n=new Dn({path:t.path,getState:()=>Tk(t.getState(),e.getState()),subscribe:i=>{const a=t.subscribe(i),o=e.subscribe(i);return()=>{a(),o()}}});this._threadBinding={path:t.path,getState:()=>t.getState(),getStateState:()=>n.getState(),outerSubscribe:i=>t.outerSubscribe(i),subscribe:i=>t.subscribe(i)},this.composer=new mk(new iu({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:i=>this._threadBinding.subscribe(i)})),this.__internal_bindMethods()}get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}__internal_bindMethods(){this.append=this.append.bind(this),this.deleteMessage=this.deleteMessage.bind(this),this.resumeRun=this.resumeRun.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.connectVoice=this.connectVoice.bind(this),this.disconnectVoice=this.disconnectVoice.bind(this),this.muteVoice=this.muteVoice.bind(this),this.unmuteVoice=this.unmuteVoice.bind(this),this.getVoiceVolume=this.getVoiceVolume.bind(this),this.subscribeVoiceVolume=this.subscribeVoiceVolume.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.get
53State=this.getState.bind(this)}getState(){return this._threadBinding.getStateState()}append(t){this._threadBinding.getState().append(Sk(this._threadBinding.getState().messages,t))}deleteMessage(t){return this._threadBinding.getState().deleteMessage(t)}subscribe(t){return this._threadBinding.subscribe(t)}getModelContext(){return this._threadBinding.getState().getModelContext()}startRun(t){return this._threadBinding.getState().startRun(_k(t))}resumeRun(t){return this._threadBinding.getState().resumeRun(xk(t))}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(t){this._threadBinding.getState().importExternalState(t)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}connectVoice(){this._threadBinding.getState().connectVoice()}disconnectVoice(){this._threadBinding.getState().disconnectVoice()}getVoiceVolume(){return this._threadBinding.getState().getVoiceVolume()}subscribeVoiceVolume(t){return this._threadBinding.getState().subscribeVoiceVolume(t)}muteVoice(){this._threadBinding.getState().muteVoice()}unmuteVoice(){this._threadBinding.getState().unmuteVoice()}export(){return this._threadBinding.getState().export()}import(t){this._threadBinding.getState().import(t)}reset(t){this._threadBinding.getState().reset(t)}getMessageByIndex(t){if(t<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${t}]`,messageSelector:{type:"index",index:t}},()=>{var e;const n=this._threadBinding.getState().messages,i=n[t];if(i)return{message:i,parentId:((e=n[t-1])==null?void 0:e.id)??null,index:t}})}getMessageById(t){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(t)}]`,messageSelector:{type:"messageId",messageId:t}},()=>this._threadBinding.getState().getMessageById(t))}_getMessageRuntime(t,e){return new bk(new Dn({path:t,getState:()=>{var n;const{message:i,parentId:a,index:o}=e()??{},{messages:u,speech:d}=this._threadBinding.getState();if(!i||a===void 0||o===void 0)return On;const f=this._threadBinding.getState().getBranches(i.id);return{...i,[nu]:i[nu],index:o,isLast:((n=u.at(-1))==null?void 0:n.id)===i.id,parentId:a,branchNumber:f.indexOf(i.id)+1,branchCount:f.length,speech:d?.messageId===i.id?d:void 0}},subscribe:n=>this._threadBinding.subscribe(n)}),this._threadBinding)}unstable_on(t,e){let n=this._eventSubscriptionSubjects.get(t);return n||(n=new Cb({event:t,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(t,n)),n.subscribe(e)}};const Qf=xn(null),Nb=t=>{const e=Y(6),{adapters:n,children:i}=t,a=_n(Qf);let o;e[0]!==n||e[1]!==a?(o={...a,...n},e[0]=n,e[1]=a,e[2]=o):o=e[2];const u=o;let d;return e[3]!==i||e[4]!==u?(d=T.jsx(Qf.Provider,{value:u,children:i}),e[3]=i,e[4]=u,e[5]=d):d=e[5],d},wk=()=>_n(Qf);var ou=class{constructor(t,e){U(this,"_core"),U(this,"_threadListBinding"),this._core=t,this._threadListBinding=e,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.updateCustom=this.updateCustom.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(t){const e=this._core.getState();return this._threadListBinding.switchToThread(e.id,t)}rename(t){const e=this._core.getState();return this._threadListBinding.rename(e.id,t)}updateCustom(t){const e=this._core.getState();if(!this._threadListBinding.updateCustom)throw new Error("Thread list runtime does not support updating custom metadata");return this._threadListBinding.updateCustom(e.id,t)}archive(){const t=this._core.getState();return this._threadListBinding.archive(t.id)}unarchive(){const t=this._core.getState();return this._threadListBinding.unarchive(t.id)}delete(){const t=this._core.getState();return this._threadListBinding.delete(t.id)}initialize(){const t=this._core.getState();return this._threadListBinding.initialize(t.id)}generateTitle(){const t=this._core.getState();return this._threadListBinding.generateTitle(t.id)}unstable_on(t,e){let n=this._core.getState().isMain,i=this._core.getState().id;return this.subscribe(()=>{const a=this._core.getState(),o=a.isMain,u=a.id;n===o&&i===u||(n=o,i=u,!(t==="switchedTo"&&!o)&&(t==="switchedAway"&&o||e({})))})}subscribe(t){return this._core.subscribe(t)}detach(){const t=this._core.getState();this._threadListBinding.detach(t.id)}__internal_getRuntime(){return this}};const zb=Promise.resolve(),Ck=t=>({mainThreadId:t.mainThreadId,newThreadId:t.newThreadId,threadIds:t.threadIds,archivedThreadIds:t.archivedThreadIds,isLoading:t.isLoading,isLoadingMore:t.isLoadingMore??!1,hasMore:t.hasMore??!1,threadItems:t.threadItems}),lu=(t,e)=>{if(e===void 0)return On;const n=t.getItemById(e);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,lastMessageAt:n.lastMessageAt,custom:n.custom,isMain:n.id===t.mainThreadId}:On};var jb=class{constructor(t,e=Db){U(this,"_core"),U(this,"_runtimeFactory"),U(this,"_getState"),U(this,"_mainThreadListItemRuntime"),U(this,"main"),this._core=t,this._runtimeFactory=e;const n=new Gf({path:{},getState:()=>Ck(t),subscribe:i=>t.subscribe(i)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new ou(new Dn({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>lu(this._core,this._core.mainThreadId),subscribe:i=>this._core.subscribe(i)}),this._core),this.main=new e(new iu({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>t.getMainThreadRuntimeCore(),subscribe:i=>t.subscribe(i)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getLoadThreadsPromise=this.getLoadThreadsPromise.bind(this),this.reload=this.reload.bind(this),this.loadMore=this.loadMore.bind(this),this.get
53State=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(t,e){return this._core.switchToThread(t,e)}switchToNewThread(){return this._core.switchToNewThread()}getLoadThreadsPromise(){return this._core.getLoadThreadsPromise()}reload(){var t,e;return((e=(t=this._core).reload)==null?void 0:e.call(t))??zb}loadMore(){var t,e;return((e=(t=this._core).loadMore)==null?void 0:e.call(t))??zb}getState(){return this._getState()}subscribe(t){return this._core.subscribe(t)}get mainItem(){return this._mainThreadListItemRuntime}getById(t){return new this._runtimeFactory(new iu({path:{ref:`threads[threadId=${JSON.stringify(t)}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>this._core.getThreadRuntimeCore(t),subscribe:e=>this._core.subscribe(e)}),this.mainItem)}getItemByIndex(t){return new ou(new Dn({path:{ref:`threadItems[${t}]`,threadSelector:{type:"index",index:t}},getState:()=>lu(this._core,this._core.threadIds[t]),subscribe:e=>this._core.subscribe(e)}),this._core)}getArchivedItemByIndex(t){return new ou(new Dn({path:{ref:`archivedThreadItems[${t}]`,threadSelector:{type:"archiveIndex",index:t}},getState:()=>lu(this._core,this._core.archivedThreadIds[t]),subscribe:e=>this._core.subscribe(e)}),this._core)}getItemById(t){return new ou(new Dn({path:{ref:`threadItems[threadId=${t}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>lu(this._core,t),subscribe:e=>this._core.subscribe(e)}),this._core)}},Xf=class{constructor(t){U(this,"_core"),U(this,"threads"),U(this,"_thread"),this._core=t,this.threads=new jb(t.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.registerModelContextProvider=this.registerModelContextProvider.bind(this)}get thread(){return this._thread}registerModelContextProvider(t){return this._core.registerModelContextProvider(t)}},Kf=class{constructor(){U(this,"_contextProvider",new If)}registerModelContextProvider(t){return this._contextProvider.registerModelContextProvider(t)}getModelContextProvider(){return this._contextProvider}};const Zf=(t,e)=>{if(t.startsWith("data-"))return{type:"data",name:t.substring(5),data:e}},uu=(t,e,n)=>{const{role:i,id:a,createdAt:o,attachments:u,status:d,metadata:f}=t,h={id:a??e,createdAt:o??new Date},m=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content,v=({image:y,...b})=>typeof y!="string"?null:y.match(/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,(.*)$/)?{...b,image:y}:/^(https:\/\/|blob:)/.test(y)?{...b,image:y}:(console.warn("Invalid image data format detected"),null);if(i!=="user"&&u?.length)throw new Error("attachments are only supported for user messages");if(i!=="assistant"&&d)throw new Error("status is only supported for assistant messages");if(i!=="assistant"&&f?.steps)throw new Error("metadata.steps is only supported for assistant messages");switch(i){case"assistant":return{...h,role:i,content:m.map(y=>{var b;const S=y.type;switch(S){case"text":case"reasoning":return(b=y.text)!=null&&b.trim()?y:null;case"file":case"source":return y;case"image":return v(y);case"data":return y;case"generative-ui":return y;case"tool-call":{const{parentId:_,messages:w,...C}=y,A={...C,toolCallId:y.toolCallId??`tool-${qn()}`,..._!==void 0&&{parentId:_},...w!==void 0&&{messages:w}};return y.args?{...A,args:y.args,argsText:y.argsText??JSON.stringify(y.args)}:{...A,args:vb(y.argsText??"")??{},argsText:y.argsText??""}}default:{const _=Zf(S,y.data);if(_)return _;throw new Error(`Unsupported assistant message part type: ${S}`)}}}).filter(y=>!!y),status:d??n,metadata:{unstable_state:f?.unstable_state??null,unstable_annotations:f?.unstable_annotations??[],unstable_data:f?.unstable_data??[],custom:f?.custom??{},steps:f?.steps??[],...f?.timing&&{timing:f.timing},...f?.submittedFeedback&&{submittedFeedback:f.submittedFeedback},...f?.isOptimistic&&{isOptimistic:!0}}};
53case"user":return{...h,role:i,content:m.map(y=>{const b=y.type;switch(b){case"text":case"image":case"audio":case"file":case"data":return y;default:{const S=Zf(b,y.data);if(S)return S;throw new Error(`Unsupported user message part type: ${b}`)}}}),attachments:(u??[]).map(y=>({...y,content:y.content.map(b=>Zf(b.type,b.data)??b)})),metadata:{custom:f?.custom??{}}};case"system":if(m.length!==1||m[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...h,role:i,content:m,metadata:{custom:f?.custom??{}}};default:throw new Error(`Unknown message role: ${i}`)}},to=Symbol("autoStatus"),Ek=Object.freeze(Object.assign({type:"running"},{[to]:!0})),Ak=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[to]:!0})),Rk=Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[to]:!0})),Mk=Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[to]:!0})),Jf=(t,e,n,i,a)=>t&&a?Object.assign({type:"incomplete",reason:"error",error:a},{[to]:!0}):t&&e?Ek:n?Mk:i?Rk:Ak,Bb={fromArray:t=>{const e=t.map(n=>uu(n,qn(),Jf(!1,!1,!1,!1,void 0)));return{messages:e.map((n,i)=>({parentId:i>0?e[i-1].id:null,message:n}))}},fromBranchableArray:(t,e)=>{const n=Jf(!1,!1,!1,!1,void 0);return{...e?.headId!==void 0?{headId:e.headId}:void 0,messages:t.map(({message:i,parentId:a})=>{if(!i.id)throw new Error("ExportedMessageRepository.fromBranchableArray: Each message must have an 'id' field set.");return{parentId:a,message:uu(i,i.id,n)}})}}},cu=t=>t.next?cu(t.next):"current"in t?t:null;var kk=class{constructor(t){U(this,"func"),U(this,"_value",null),this.func=t}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}},Pb=class{constructor(){U(this,"messages",new Map),U(this,"head",null),U(this,"root",{children:[],next:null}),U(this,"_messages",new kk(()=>{var t;const e=new Array((((t=this.head)==null?void 0:t.level)??-1)+1);for(let n=this.head;n;n=n.prev)e[n.level]=n.current;return e}))}updateLevels(t,e){t.level=e;for(const n of t.children){const i=this.messages.get(n);i&&this.updateLevels(i,e+1)}}performOp(t,e,n){const i=e.prev??this.root,a=t??this.root;if(!(n==="relink"&&i===a)){if(n!=="link"&&(i.children=i.children.filter(o=>o!==e.current.id),i.next===e)){const o=i.children.at(-1),u=o?this.messages.get(o):null;if(u===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");i.next=u}if(n!=="cut"){for(let u=t;u;u=u.prev)if(u.current.id===e.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");a.children=[...a.children,e.current.id],(cu(e)===this.head||a.next===null)&&(a.next=e),e.prev=t;const o=t?t.level+1:0;this.updateLevels(e,o)}}}get headId(){var t;return((t=this.head)==null?void 0:t.current.id)??null}get canonicalHeadId(){var t;let e=this.head;for(;(t=e?.current.metadata)!=null&&t.isOptimistic;)e=e.prev;return e?.current.id??null}getMessages(t){var e;if(t===void 0||t===((e=this.head)==null?void 0:e.current.id))return this._messages.value;const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");const i=new Array(n.level+1);for(let a=n;a;a=a.prev)i[a.level]=a.current;return i}addOrUpdateMessage(t,e){const n=this.messages.get(e.id),i=t?this.messages.get(t):null;if(i===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(n){n.current=e,this.performOp(i,n,"relink"),this._messages.dirty();return}const a={prev:i,current:e,next:null,children:[],level:i?i.level+1:0};this.messages.set(e.id,a),this.performOp(i,a,"link"),this.head===i&&(this.head=a),this._messages.dirty()}getMessage(t){var e;const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:((e=n.prev)==null?void 0:e.current.id)??null,message:n.current,index:n.level}}deleteMessage(t,e){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const i=e===void 0?n.prev:e===null?null:this.messages.get(e);if(i===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const a of n.children){const o=this.messages.get(a);if(!o)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(i,o,"relink")}this.performOp(null,n,"cut"),this.messages.delete(t),this.head===n&&(this.head=cu(i??this.root)),this._messages.dirty()}getBranches(t){const e=this.messages.get(t);if(!e)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:n}=e.prev??this.root;return n}evictOffBranchOptimisticMessages(t,e){var n;if(!t)return;const i=new Set;for(let o=e;o;o=o.prev)i.add(o.current.id);const a=[];for(let o=t;o&&!i.has(o.current.id);o=o.prev)(n=o.current.metadata)!=null&&n.isOptimistic&&a.push(o.current.id);for(const o of a)this.messages.has(o)&&this.deleteMessage(o)}switchToBranch(t){const e=this.messages.get(t);if(!e)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const n=this.head,i=e.prev??this.root;i.next=e,this.head=cu(e),this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}resetHead(t){if(t===null){this.clear();return}const e=this.messages.get(t);if(!e)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");const n=this.head;if(e.children.length>0){const i=a=>{for(const o of a.children){const u=this.messages.get(o);u&&(i(u),this.messages.delete(o))}};i(e),e.children=[],e.next=null}this.head=e;for(let i=e;i;i=i.prev)i.prev?i.prev.next=i:this.root.next=i;this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){var t,e;const n=[];for(const[,i]of this.messages)(t=i.current.metadata)!=null&&t.isOptimistic||n.push({message:i.current,parentId:((e=i.prev)==null?void 0:e.current.id)??null});return{headId:this.canonicalHeadId,messages:n}}import({headId:t,messages:e}){var n;for(const{message:i,parentId:a}
53of e)this.addOrUpdateMessage(a,i);this.resetHead(t??((n=e.at(-1))==null?void 0:n.message.id)??null)}};const no=Object.freeze([]);function Lb(t,e){if(e==="*")return!0;const n=e.split(",").map(o=>o.trim().toLowerCase()),i=`.${t.name.split(".").pop().toLowerCase()}`,a=t.type.toLowerCase();for(const o of n){if(o.startsWith(".")&&o===i||o.includes("/")&&o===a)return!0;if(o.endsWith("/*")){const u=o.split("/")[0];if(a.startsWith(`${u}/`))return!0}}return!1}function Ik(t,e){return t.length!==e.length?!1:t.every((n,i)=>n.id===e[i].id)}function Ok(t){const e=qn();return t.type==="image"?{id:e,type:"image",name:t.filename??"image",content:[t],status:{type:"complete"}}:t.type==="file"?{id:e,type:"document",name:t.filename??"document",contentType:t.mimeType,content:[t],status:{type:"complete"}}:t.type==="audio"?{id:e,type:"audio",name:`audio.${t.audio.format}`,contentType:`audio/${t.audio.format}`,content:[t],status:{type:"complete"}}:{id:e,type:"data",name:t.name,content:[t],status:{type:"complete"}}}function Dk(t){const e=[];for(const n of t)n.type!=="text"&&e.push(Ok(n));return e}const Wf=t=>t.status.type==="complete";var Ub=class extends Wa{constructor(){super(...arguments),U(this,"isEditing",!0),U(this,"_attachments",[]),U(this,"_text",""),U(this,"_role","user"),U(this,"_runConfig",{}),U(this,"_quote"),U(this,"_dictation"),U(this,"_dictationSession"),U(this,"_dictationUnsubscribes",[]),U(this,"_dictationBaseText",""),U(this,"_currentInterimText",""),U(this,"_dictationSessionIdCounter",0),U(this,"_activeDictationSessionId"),U(this,"_isCleaningDictation",!1),U(this,"_eventSubscribers",new Map)}enrichWithComposerMetadata(t,e){var n;return e?{...t,metadata:{...t.metadata,custom:{...(n=t.metadata)==null?void 0:n.custom,...e}}}:t}get attachmentAccept(){var t;return((t=this.getAttachmentAdapter())==null?void 0:t.accept)??"*"}get attachments(){return this._attachments}setAttachments(t){this._attachments=t,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}get text(){return this._text}get role(){return this._role}get runConfig(){return this._runConfig}get quote(){return this._quote}setQuote(t){this._quote!==t&&(this._quote=t,this._notifySubscribers())}setText(t){if(this._text!==t){if(this._text=t,this._dictation){this._dictationBaseText=t,this._currentInterimText="";const{status:e,inputDisabled:n}=this._dictation;this._dictation=n?{status:e,inputDisabled:n}:{status:e}}this._notifySubscribers()}}setRole(t){this._role!==t&&(this._role=t,this._notifySubscribers())}setRunConfig(t){this._runConfig!==t&&(this._runConfig=t,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const t=this.getAttachmentAdapter();if(t){const e=this._attachments.filter(n=>!Wf(n));await Promise.all(e.map(n=>t.remove(n)))}}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0&&this._quote===void 0)return;this._role="user",this._runConfig={},this._quote=void 0;const t=this._onClearAttachments();this._emptyTextAndAttachments(),await t}async clearAttachments(){const t=this._onClearAttachments();this.setAttachments([]),await t}async send(t){if(!this.canSend)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());const e=this.getAttachmentAdapter(),n=this.attachments.length>0?Promise.all(this.attachments.map(async u=>{if(Wf(u))return u;if(!e)throw new Error("Attachments are not supported");return await e.send(u)})):[],i=this.text,a=this._quote;this._quote=void 0,this._emptyTextAndAttachments();const o={createdAt:new Date,role:this.role,content:i?[{type:"text",text:i}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{...a?{quote:a}:{}}}};this.handleSend(o,t),this._notifyEventSubscribers("send",{})}cancel(){this.handleCancel()}get queue(){return no}steerQueueItem(t){}removeQueueItem(t){}async addAttachment(t){if(!(t instanceof File)){const a=this.getAttachmentAdapter();if(a&&!Lb({name:t.name,type:t.contentType??""},a.accept)){const u=`File type ${t.contentType||"unknown"} is not accepted. Accepted types: ${a.accept}`,d=new Error(u);throw this._safeEmitAttachmentAddError("not-accepted",u,void 0,d),d}const o={id:t.id??qn(),type:t.type??"document",name:t.name,contentType:t.contentType,content:t.content,status:{type:"complete"}};this._attachments=[...this._attachments,o],this._notifySubscribers(),this._notifyEventSubscribers("attachmentAdd",{});return}const e=a=>{const o=this._attachments.findIndex(u=>u.id===a.id);o!==-1?this._attachments=[...this._attachments.slice(0,o),a,...this._attachments.slice(o+1)]:this._attachments=[...this._attachments,a],this._notifySubscribers()},n=this.getAttachmentAdapter();if(!n){const a="Attachments are not supported",o=new Error(a);throw this._safeEmitAttachmentAddError("no-adapter",a,void 0,o),o}if(!Lb({name:t.name,type:t.type},n.accept)){const a=`File type ${t.type||"unknown"} is not accepted. Accepted types: ${n.accept}`,o=new Error(a);throw this._safeEmitAttachmentAddError("not-accepted",a,void 0,o),o}let i;try{const a=n.add({file:t});
53if(Symbol.asyncIterator in a)for await(const o of a)i=o,e(o);else i=await a,e(i)}catch(a){throw i&&e({...i,status:{type:"incomplete",reason:"error"}}),this._safeEmitAttachmentAddError("adapter-error",a instanceof Error?a.message:String(a),i?.id,a instanceof Error?a:void 0),a}i?.status.type==="incomplete"&&i.status.reason==="error"?this._safeEmitAttachmentAddError("adapter-error","Attachment upload did not complete successfully.",i?.id):this._notifyEventSubscribers("attachmentAdd",{})}_safeEmitAttachmentAddError(t,e,n,i){try{this._notifyEventSubscribers("attachmentAddError",{reason:t,message:e,...n!==void 0&&{attachmentId:n},...i!==void 0&&{error:i}})}catch(a){console.error("[assistant-ui] attachmentAddError subscriber threw:",a)}}async removeAttachment(t){const e=this._attachments.findIndex(i=>i.id===t);if(e===-1)throw new Error("Attachment not found");const n=this._attachments[e];if(!Wf(n)){const i=this.getAttachmentAdapter();if(!i)throw new Error("Attachments are not supported");await i.remove(n)}this._attachments=this._attachments.filter(i=>i.id!==t),this._notifySubscribers()}get dictation(){return this._dictation}_isActiveSession(t,e){return this._activeDictationSessionId===t&&this._dictationSession===e}startDictation(){const t=this.getDictationAdapter();if(!t)throw new Error("Dictation adapter not configured");if(this._dictationSession){for(const f of this._dictationUnsubscribes)f();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}const e=t.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText="";const n=t.listen();this._dictationSession=n;const i=++this._dictationSessionIdCounter;this._activeDictationSessionId=i,this._dictation={status:n.status,inputDisabled:e},this._notifySubscribers();const a=n.onSpeech(f=>{if(!this._isActiveSession(i,n))return;const h=f.isFinal!==!1,m=this._dictationBaseText&&!this._dictationBaseText.endsWith(" ")&&f.transcript?" ":"";if(h){if(this._dictationBaseText=this._dictationBaseText+m+f.transcript,this._currentInterimText="",this._text=this._dictationBaseText,this._dictation){const{transcript:v,...y}=this._dictation;this._dictation=y}this._notifySubscribers()}else this._currentInterimText=m+f.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&(this._dictation={...this._dictation,transcript:f.transcript}),this._notifySubscribers()});this._dictationUnsubscribes.push(a);const o=n.onSpeechStart(()=>{var f;this._isActiveSession(i,n)&&(this._dictation={status:{type:"running"},inputDisabled:e,...((f=this._dictation)==null?void 0:f.transcript)&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(o);const u=n.onSpeechEnd(()=>{this._cleanupDictation({sessionId:i})});this._dictationUnsubscribes.push(u);const d=setInterval(()=>{this._isActiveSession(i,n)&&n.status.type==="ended"&&this._cleanupDictation({sessionId:i})},100);this._dictationUnsubscribes.push(()=>clearInterval(d))}stopDictation(){if(!this._dictationSession)return;const t=this._dictationSession,e=this._activeDictationSessionId;t.stop().finally(()=>{this._cleanupDictation({sessionId:e})})}_cleanupDictation(t){if(!(t?.sessionId!==void 0&&t.sessionId!==this._activeDictationSessionId||this._isCleaningDictation)){this._isCleaningDictation=!0;try{for(const e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText="",this._currentInterimText="",this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_notifyEventSubscribers(t,e){const n=this._eventSubscribers.get(t);if(n)for(const i of n)i(e)}unstable_on(t,e){const n=e;let i=this._eventSubscribers.get(t);return i||(i=new Set,this._eventSubscribers.set(t,i)),i.add(n),()=>{var a;(a=this._eventSubscribers.get(t))==null||a.delete(n)}}},Hb=class extends Ub{constructor(t){super(),U(this,"runtime"),U(this,"_canCancel",!1),this.runtime=t,this.connect()}get canCancel(){return this._canCancel}
53get canSend(){return!this.isEmpty&&!this.runtime.isSendDisabled}get queue(){var t,e;return((e=(t=this.runtime).getQueueItems)==null?void 0:e.call(t))??no}steerQueueItem(t){var e,n;(n=(e=this.runtime).steerQueueItem)==null||n.call(e,t)}removeQueueItem(t){var e,n;(n=(e=this.runtime).removeQueueItem)==null||n.call(e,t)}getAttachmentAdapter(){var t;return(t=this.runtime.adapters)==null?void 0:t.attachments}getDictationAdapter(){var t;return(t=this.runtime.adapters)==null?void 0:t.dictation}connect(){let t=this.runtime.isSendDisabled,e=this.queue;return this.runtime.subscribe(()=>{let n=!1;this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,n=!0),t!==this.runtime.isSendDisabled&&(t=this.runtime.isSendDisabled,n=!0),e!==this.queue&&(e=this.queue,n=!0),n&&this._notifySubscribers()})}async handleSend(t,e){var n;const i=ab(this.runtime.getModelContext().unstable_composerMetadata,this.runtime.messages),a=this.enrichWithComposerMetadata(t,i);this.runtime.append({...a,parentId:((n=this.runtime.messages.at(-1))==null?void 0:n.id)??null,sourceId:null,startRun:e?.startRun,steer:e?.steer})}async handleCancel(){this.runtime.cancelRun()}},Nk=class extends Ub{constructor(t,e,{parentId:n,message:i}){super(),U(this,"runtime"),U(this,"endEditCallback"),U(this,"_previousText"),U(this,"_previousAttachments"),U(this,"_nonTextPassthrough"),U(this,"_parentId"),U(this,"_sourceId"),this.runtime=t,this.endEditCallback=e,this._parentId=n,this._sourceId=i.id,this._previousText=eo(i),this.setText(this._previousText),this.setRole(i.role),i.role==="user"?(this._previousAttachments=[...i.attachments??[],...Dk(i.content)],this._nonTextPassthrough=[]):(this._previousAttachments=i.attachments??[],this._nonTextPassthrough=i.content.filter(a=>a.type!=="text")),this.setAttachments(this._previousAttachments),this.setRunConfig({...t.composer.runConfig})}get canCancel(){return!0}get canSend(){return!this.isEmpty}getAttachmentAdapter(){var t;return(t=this.runtime.adapters)==null?void 0:t.attachments}getDictationAdapter(){var t;return(t=this.runtime.adapters)==null?void 0:t.dictation}get parentId(){return this._parentId}get sourceId(){return this._sourceId}async handleSend(t,e){const n=eo(t),i=!Ik(t.attachments??[],this._previousAttachments);if(n!==this._previousText||i||e?.startRun){const a=this._nonTextPassthrough.length>0?[...t.content,...this._nonTextPassthrough]:t.content,o=this.runtime.messages,u=this._parentId===null?-1:o.findIndex(h=>h.id===this._parentId),d=ab(this.runtime.getModelContext().unstable_composerMetadata,o.slice(0,u+1)),f=this.enrichWithComposerMetadata(t,d);this.runtime.append({...f,content:a,parentId:this._parentId,sourceId:this._sourceId,startRun:e?.startRun})}this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}},zk=class{constructor(t){U(this,"_contextProvider"),U(this,"_subscriptions",new Set),U(this,"_isInitialized",!1),U(this,"repository",new Pb),U(this,"_voiceMessages",[]),U(this,"_voiceGeneration",0),U(this,"_cachedMergedMessages",null),U(this,"_cachedVoiceGeneration",-1),U(this,"_cachedMergedBase",null),U(this,"composer",new Hb(this)),U(this,"_editComposers",new Map),U(this,"_stopSpeaking"),U(this,"speech"),U(this,"_voiceSession"),U(this,"_voiceUnsubs",[]),U(this,"voice"),U(this,"_voiceVolume",0),U(this,"_voiceVolumeSubscribers",new Set),U(this,"getVoiceVolume",()=>this._voiceVolume),U(this,"subscribeVoiceVolume",e=>(this._voiceVolumeSubscribers.add(e),()=>this._voiceVolumeSubscribers.delete(e))),U(this,"_currentAssistantMsg",null),U(this,"_eventSubscribers",new Map),this._contextProvider=t}_markVoiceMessagesDirty(){this._voiceGeneration++,this._cachedMergedMessages=null}_getBaseMessages(){return this.repository.getMessages()}get messages(){if(this._voiceMessages.length===0)return this._getBaseMessages();const t=this._getBaseMessages();return(this._cachedVoiceGeneration!==this._voiceGeneration||this._cachedMergedBase!==t)&&(this._cachedMergedMessages=[...t,...this._voiceMessages],this._cachedVoiceGeneration=this._voiceGeneration,this._cachedMergedBase=t),this._cachedMergedMessages}get state(){let t;for(const e of this.messages)e.role==="assistant"&&(t=e);return t?.metadata.unstable_state??null}getModelContext(){return this._contextProvider.getModelContext()}getEditComposer(t){return this._editComposers.get(t)}beginEdit(t){if(this._editComposers.has(t))throw new Error("Edit already in progress");this._editComposers.set(t,new Nk(this,()=>this._editComposers.delete(t),this.repository.getMessage(t))),this._notifySubscribers()}getMessageById(t){var e;try{return this.repository.getMessage(t)}catch{const n=this.repository.getMessages(),i=this._voiceMessages.findIndex(a=>a.id===t);return i!==-1?{parentId:i>0?this._voiceMessages[i-1].id:((e=n.at(-1))==null?void 0:e.id)??null,message:this._voiceMessages[i],index:n.length+i}:void 0}}getBranches(t){return this._voiceMessages.some(e=>e.id===t)?[]:this.repository.getBranches(t)}switchToBranch(t){this.repository.switchToBranch(t),this._notifySubscribers()}_notifySubscribers(){for(const t of this._subscriptions)t()}_notifyEventSubscribers(t,e){const n=this._eventSubscribers.get(t);if(n)for(const i of n)i(e)}subscribe(t){return this._subscriptions.add(t),()=>this._subscriptions.delete(t)}submitFeedback({messageId:t,type:e}){var n;const i=(n=this.adapters)==null?void 0:n.feedback;if(!i)throw new Error("Feedback adapter not configured");const{message:a,parentId:o}=this.repository.getMessage(t);if(i.submit({message:a,type:e}),a.role==="assistant"){const u={...a,metadata:{...a.metadata,submittedFeedback:{type:e}}};this.repository.addOrUpdateMessage(o,u)}this._notifySubscribers()}speak(t){var e,n;const i=(e=this.adapters)==null?void 0:e.speech;if(!i)throw new Error("Speech adapter not configured");const{message:a}=this.repository.getMessage(t);(n=this._stopSpeaking)==null||n.call(this);const o=i.speak(eo(a)),u=o.subscribe(()=>{o.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:t,status:o.status},this._notifySubscribers()});this.speech={messageId:t,status:o.status},this._notifySubscribers(),this._stopSpeaking=()=>{o.cancel(),u(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}connectVoice(){var t;const e=(t=this.adapters)==null?void 0:t.voice;if(!e)throw new Error("Voice adapter not configured");this.disconnectVoice();const n=e.connect({});this._voiceSession=n;const i=[];let a="listening";this.voice={status:n.status,isMuted:n.isMuted,mode:a},this._voiceVolume=0,this._notifySubscribers(),i.push(n.onStatusChange(o=>{o.type==="ended"?(this._finishVoiceAssistantMessage(),this._voiceSession=void 0,this.voice=void 0):this.voice={status:o,isMuted:n.isMuted,mode:a},this._notifySubscribers()})),i.push(n.onModeChange(o=>{a=o,this.voice&&(this.voice={...this.voice,mode:o},this._notifySubscribers())})),i.push(n.onVolumeChange(o=>{this._voiceVolume=o;for(const u of this._voiceVolumeSubscribers)u()})),i.push(n.onTranscript(o=>{this._handleVoiceTranscript(o)})),this._voiceUnsubs=i}_handleVoiceTranscript(t){if(this.ensureInitialized(),t.role==="user")this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,t.isFinal&&(this._voiceMessages.push({id:qn(),role:"user",content:[{type:"text",text:t.text}],metadata:{custom:{}},createdAt:new Date,status:{type:"complete",reason:"unknown"},attachments:[]}
53),this._markVoiceMessagesDirty(),this._notifySubscribers());else{if(!this._currentAssistantMsg)this._currentAssistantMsg={id:qn(),role:"assistant",content:[{type:"text",text:t.text}],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},status:{type:"running"},createdAt:new Date},this._voiceMessages.push(this._currentAssistantMsg);else{const e=this._voiceMessages.indexOf(this._currentAssistantMsg);if(e===-1)return;const n={...this._currentAssistantMsg,content:[{type:"text",text:t.text}],...t.isFinal?{status:{type:"complete",reason:"stop"}}:{}};this._voiceMessages[e]=n,this._currentAssistantMsg=n}t.isFinal&&(this._currentAssistantMsg=null),this._markVoiceMessagesDirty(),this._notifySubscribers()}}_finishVoiceAssistantMessage(){const t=this._voiceMessages.at(-1);if(t?.role==="assistant"&&t.status.type==="running"){const e=this._voiceMessages.length-1;this._voiceMessages[e]={...t,status:{type:"complete",reason:"stop"}},this._markVoiceMessagesDirty(),this._notifySubscribers()}}disconnectVoice(){var t;this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null;for(const e of this._voiceUnsubs)e();this._voiceUnsubs=[],(t=this._voiceSession)==null||t.disconnect(),this._voiceSession=void 0,this.voice=void 0,this._voiceVolume=0;for(const e of this._voiceVolumeSubscribers)e();this._voiceMessages=[],this._markVoiceMessagesDirty(),this._notifySubscribers()}muteVoice(){if(!this._voiceSession)throw new Error("No active voice session");this._voiceSession.mute(),this.voice={...this.voice,isMuted:!0},this._notifySubscribers()}unmuteVoice(){if(!this._voiceSession)throw new Error("No active voice session");this._voiceSession.unmute(),this.voice={...this.voice,isMuted:!1},this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize",{}))}export(){return this.repository.export()}import(t){this.ensureInitialized(),this.repository.clear(),this.repository.import(t),this._notifySubscribers()}reset(t){this.import(Bb.fromArray(t??[]))}unstable_on(t,e){var n,i;const a=e;if(t==="modelContextUpdate")return((i=(n=this._contextProvider).subscribe)==null?void 0:i.call(n,()=>a({})))??(()=>{});let o=this._eventSubscribers.get(t);return o||(o=new Set,this._eventSubscribers.set(t,o)),o.add(a),t==="initialize"&&this._isInitialized&&queueMicrotask(()=>{o.has(a)&&a({})}),()=>{var u;(u=this._eventSubscribers.get(t))==null||u.delete(a)}}};const jk=t=>{const e=Y(3),{detectorRef:n}=t;let i,a;return e[0]!==n?(i=()=>{n.current=!0},a=[n],e[0]=n,e[1]=i,e[2]=a):(i=e[1],a=e[2]),Qa(i,a),null};var Bk=class extends Wa{constructor(t,e){super(),U(this,"useRuntimeHook"),U(this,"instances",new Map),U(this,"useAliveThreadsKeysChanged",Ds(()=>({}))),U(this,"parent"),U(this,"_RuntimeBinder",({threadId:n,children:i})=>{const{useRuntime:a}=this.useRuntimeHook(),o=a(),u=o.thread.__internal_threadBinding,d=Zr(()=>{const y=this.instances.get(n);if(!y)throw new Error("Thread not found. This is a bug in assistant-ui.");y.runtime=u.getState(),this._notifySubscribers()},[n,u]),f=Ce(!1);f.current||d(),ye(()=>(f.current=!0,d(),u.outerSubscribe(d)),[u,d]);const h=_e(),m=Ce(void 0),v=Ce(!1);return ye(()=>{const y=u.getState(),b=y.__internal_setGetInitializePromise;typeof b=="function"&&b.call(y,()=>m.current)},[u]),ye(()=>(v.current=!1,o.threads.main.unstable_on("initialize",()=>{if(v.current||h.threadListItem().getState().status!=="new")return;v.current=!0,m.current=h.threadListItem().initialize();const y=o.thread.unstable_on("runEnd",()=>{y(),h.threadListItem().generateTitle()})})),[o,h]),T.jsx(T.Fragment,{children:i})}),U(this,"_OuterActiveThreadProvider",O.memo(({threadId:n,provider:i})=>{const a=Ue(()=>new jb(this.parent).getItemById(n),[n]),o=Ce(!1);return ye(()=>{},[i]),T.jsx(ZM,{runtime:a,children:T.jsx(i,{children:T.jsx(this._RuntimeBinder,{threadId:n,children:T.jsx(jk,{detectorRef:o})})})})})),U(this,"__internal_RenderThreadRuntimes",({provider:n})=>(this.useAliveThreadsKeysChanged(),Array.from(this.instances.keys()).map(i=>T.jsx(this._OuterActiveThreadProvider,{threadId:i,provider:n},i)))),this.parent=e,this.useRuntimeHook=Ds(()=>({useRuntime:t}))}startThreadRuntime(t){return this.instances.has(t)||(this.instances.set(t,{}),this.useAliveThreadsKeysChanged.setState({}
53,!0)),new Promise((e,n)=>{const i=()=>{const o=this.instances.get(t);if(!o)a(),n(new Error("Thread was deleted before runtime was started"));else if(o.runtime)a(),e(o.runtime);else return},a=this.subscribe(i);i()})}getThreadRuntimeCore(t){const e=this.instances.get(t);if(e)return e.runtime}stopThreadRuntime(t){this.instances.delete(t),this.useAliveThreadsKeysChanged.setState({},!0)}setRuntimeHook(t){this.useRuntimeHook.getState().useRuntime!==t&&this.useRuntimeHook.setState({useRuntime:t},!0)}};const qb=(t,e,n)=>n.reduce((i,a)=>a?.(i,e)??i,t);var Pk=class extends Wa{constructor(t){super(),U(this,"_pendingTransforms",[]),U(this,"_completedOptimistics",[]),U(this,"_baseValue"),U(this,"_cachedValue"),this._baseValue=t,this._cachedValue=t}_updateState(){this._cachedValue=this._pendingTransforms.reduce((t,e)=>qb(t,e.task,[e.loading,e.optimistic]),this._baseValue),this._notifySubscribers()}get baseValue(){return this._baseValue}get value(){return this._cachedValue}update(t){this._baseValue=t,this._updateState()}async optimisticUpdate(t){const e=t.execute(),n={...t,task:e};try{this._pendingTransforms.push(n),this._updateState();const i=await e;this._baseValue=qb(this._baseValue,i,[t.optimistic,t.then]);for(const a of this._completedOptimistics)this._baseValue=a(this._baseValue);return t.optimistic&&this._completedOptimistics.push(t.optimistic),i}finally{const i=this._pendingTransforms.indexOf(n);i>-1&&this._pendingTransforms.splice(i,1),this._pendingTransforms.length===0&&(this._completedOptimistics.length=0),this._updateState()}}};const Ye=new Error("This is the empty thread, a placeholder for the main thread. You cannot perform any actions on this thread instance. This error is probably because you tried to call a thread method in your render function. Call the method inside a `useEffect` hook instead."),Lk={getMessageById(){},getBranches(){return[]},switchToBranch(){throw Ye},append(){throw Ye},deleteMessage(){throw Ye},startRun(){throw Ye},resumeRun(){throw Ye},cancelRun(){throw Ye},addToolResult(){throw Ye},resumeToolCall(){throw Ye},respondToToolApproval(){throw Ye},speak(){throw Ye},stopSpeaking(){throw Ye},connectVoice(){throw Ye},disconnectVoice(){throw Ye},getVoiceVolume:()=>0,subscribeVoiceVolume:()=>()=>{},muteVoice(){throw Ye},unmuteVoice(){throw Ye},submitFeedback(){throw Ye},getModelContext(){return{}},exportExternalState(){throw Ye},importExternalState(){throw Ye},composer:{attachments:[],attachmentAccept:"*",async addAttachment(){throw Ye},async removeAttachment(){throw Ye},isEditing:!0,canCancel:!1,canSend:!1,isEmpty:!0,text:"",setText(){throw Ye},role:"user",setRole(){throw Ye},runConfig:{},setRunConfig(){throw Ye},async reset(){},async clearAttachments(){},send(){throw Ye},cancel(){},queue:[],steerQueueItem(){},removeQueueItem(){},dictation:void 0,startDictation(){throw Ye},stopDictation(){},quote:void 0,setQuote(){throw Ye},subscribe(){return()=>{}},unstable_on(){return()=>{}}},getEditComposer(){},beginEdit(){throw Ye},speech:void 0,voice:void 0,capabilities:{switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,delete:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1},isDisabled:!1,isSendDisabled:!1,isLoading:!0,messages:[],state:null,suggestions:[],extras:void 0,subscribe(){return()=>{}},import(){throw Ye},export(){return{messages:[]}},reset(){throw Ye},unstable_on(){return()=>{}}};function UL(t){return t}const Vb=t=>t||void 0,$b=(t,e)=>{for(const n of t){if(e.threadIdMap[n.remoteId]!==void 0)continue;switch(n.status){case"regular":e.threadIds.push(n.remoteId);break;case"archived":e.archivedThreadIds.push(n.remoteId);break;default:{const a=n.status;throw new Error(`Unsupported state: ${a}`)}}const i=n.remoteId;e.threadIdMap[n.remoteId]=i,e.threadData[i]={id:n.remoteId,remoteId:n.remoteId,externalId:n.externalId,status:n.status,title:n.title,lastMessageAt:n.lastMessageAt,custom:n.custom,initializeTask:Promise.resolve({remoteId:n.remoteId,externalId:n.externalId})}}return e},Ii=(t,e)=>{const n=t.threadIdMap[e];if(n!==void 0)return t.threadData[n]},du=(t,e,n)=>{const i=Ii(t,e);if(!i)return t;const{id:a,remoteId:o,status:u}=i;if(u===n)return t;const d={...t};switch(u){case"new":d.newThreadId=void 0;break;case"regular":d.threadIds=d.threadIds.filter(f=>f!==a);break;case"archived":d.archivedThreadIds=d.archivedThreadIds.filter(f=>f!==a);break;default:throw new Error(`Unsupported state: ${u}`)}switch(n){case"regular":d.threadIds=[a,...d.threadIds];break;case"archived":d.archivedThreadIds=[a,...d.archivedThreadIds];break;case"deleted":d.threadData=Object.fromEntries(Object.entries(d.threadData).filter(([f])=>f!==a)),d.threadIdMap=Object.fromEntries(Object.entries(d.threadIdMap).filter(([f])=>f!==a&&f!==o));break;default:throw new Error(`Unsupported state: ${n}`)}return n!=="deleted"&&(d.threadData={...d.threadData,[a]:{...i,status:n}}),d};var Uk=class extends Wa{constructor(t,e){super(),U(this,"_options"),U(this,"_hookManager"),U(this,"_loadThreadsPromise"),U(this,"_loadMorePromise"),U(this,"_loadGeneration",0),U(this,"_mainThreadId"),U(this,"_state",new Pk({isLoading:!0,isLoadingMore:!1,
53cursor:void 0,newThreadId:void 0,threadIds:[],archivedThreadIds:[],threadIdMap:{},threadData:{}})),U(this,"contextProvider"),U(this,"_initialThreadLoaded",!1),U(this,"useProvider"),U(this,"_lastNotifiedThreadId"),U(this,"initialize",async n=>{if(this._state.value.newThreadId!==n){const i=this.getItemById(n);if(!i)throw new Error("Thread not found");if(i.status==="new")throw new Error("Unexpected new state");return i.initializeTask}return this._state.optimisticUpdate({execute:()=>this._options.adapter.initialize(n),optimistic:i=>du(i,n,"regular"),loading:(i,a)=>{const o=n;return{...i,threadData:{...i.threadData,[o]:{...i.threadData[o],initializeTask:a}}}},then:(i,{remoteId:a,externalId:o})=>{const u=Ii(i,n);if(!u)return i;const d=n;return{...i,threadIdMap:{...i.threadIdMap,[a]:d},threadData:{...i.threadData,[d]:{...u,initializeTask:Promise.resolve({remoteId:a,externalId:o}),remoteId:a,externalId:o}}}}})}),U(this,"generateTitle",async n=>{var i;const a=this.getItemById(n);if(!a)throw new Error("Thread not found");if(a.status==="new")throw new Error("Thread is not yet initialized");const{remoteId:o}=await a.initializeTask,u=this._hookManager.getThreadRuntimeCore(a.id);if(!u)return;const d=u.messages,f=await this._options.adapter.generateTitle(o,d),h=XM.fromAssistantStream(f);for await(const m of h){const v=(i=m.parts.filter(S=>S.type==="text")[0])==null?void 0:i.text,y=this._state.baseValue,b=Ii(y,a.id);b&&this._state.update({...y,threadData:{...y.threadData,[b.id]:{...b,title:v}}})}}),U(this,"useBoundIds",Ds(()=>[])),U(this,"__internal_RenderComponent",()=>{const n=O.useId();ye(()=>(this.useBoundIds.setState(u=>[...u,n],!0),()=>{this.useBoundIds.setState(u=>u.filter(d=>d!==n),!0)}),[n]);const i=this.useBoundIds(),{Provider:a}=this.useProvider(),o={modelContext:this.contextProvider};return(i.length===0||i[0]===n)&&T.jsx(Nb,{adapters:o,children:T.jsx(this._hookManager.__internal_RenderThreadRuntimes,{provider:a})})}),this.contextProvider=e,this._state.subscribe(()=>{this._notifySubscribers(),this._notifyThreadIdChange()}),this._hookManager=new Bk(t.runtimeHook,this),this.useProvider=Ds(()=>({Provider:t.adapter.unstable_Provider??O.Fragment})),this.__internal_setOptions(t),this.switchToNewThread()}get threadItems(){return this._state.value.threadData}getLoadThreadsPromise(){if(!this._loadThreadsPromise){const t=this._loadGeneration;this._loadThreadsPromise=this._state.optimisticUpdate({execute:()=>this._options.adapter.list(),loading:e=>({...e,isLoading:!0}),then:(e,n)=>{if(t!==this._loadGeneration)return e;const i=$b(n.threads,{threadIds:[],archivedThreadIds:[],threadIdMap:{},threadData:{}});return{...e,isLoading:!1,cursor:Vb(n.nextCursor),threadIds:i.threadIds,archivedThreadIds:i.archivedThreadIds,threadIdMap:{...e.threadIdMap,...i.threadIdMap},threadData:{...e.threadData,...i.threadData}}}}).catch(e=>{t===this._loadGeneration&&(console.error("[assistant-ui] thread list load failed:",e),this._loadThreadsPromise=void 0,this._state.update({...this._state.baseValue,isLoading:!1}))}).then(()=>{})}return this._loadThreadsPromise}loadMore(){if(this._loadMorePromise)return this._loadMorePromise;const t=this._state.value;if(t.cursor===void 0||t.isLoading)return Promise.resolve();const e=this._loadGeneration,n=this._options.adapter,i=t.cursor,a=this._state.optimisticUpdate({execute:()=>n.list({after:i}),loading:o=>({...o,isLoadingMore:!0}),then:(o,u)=>{if(e!==this._loadGeneration||n!==this._options.adapter)return o;const d=$b(u.threads,{threadIds:[...o.threadIds],archivedThreadIds:[...o.archivedThreadIds],threadIdMap:{...o.threadIdMap},threadData:{...o.threadData}});return{...o,isLoadingMore:!1,cursor:Vb(u.nextCursor),threadIds:d.threadIds,archivedThreadIds:d.archivedThreadIds,threadIdMap:d.threadIdMap,threadData:d.threadData}}}).catch(o=>{console.error("[assistant-ui] thread list loadMore failed:",o)}).then(()=>{this._loadMorePromise===a&&(this._loadMorePromise=void 0)});return this._loadMorePromise=a,a}__internal_setOptions(t){if(this._options===t)return;const e=this._options!==void 0&&this._options.adapter!==t.adapter;this._options=t;const n=t.adapter.unstable_Provider??O.Fragment;n!==this.useProvider.getState().Provider&&this.useProvider.setState({Provider:n},!0),this._hookManager.setRuntimeHook(t.runtimeHook),e&&(this._loadGeneration++,this._loadThreadsPromise=void 0,this._loadMorePromise=void 0,this._state.update({...this._state.baseValue,cursor:void 0}))}__internal_load(){this.getLoadThreadsPromise();const t=this._options.threadId??this._options.initialThreadId;!this._initialThreadLoaded&&t&&(this._initialThreadLoaded=!0,this.switchToThread(t).cat
53ch(()=>{}))}reload(){return this._loadGeneration++,this._loadThreadsPromise=void 0,this._loadMorePromise=void 0,this._state.update({...this._state.baseValue,cursor:void 0}),this.getLoadThreadsPromise()}get isLoading(){return this._state.value.isLoading}get isLoadingMore(){return this._state.value.isLoadingMore}get hasMore(){return this._state.value.cursor!==void 0}get threadIds(){return this._state.value.threadIds}get archivedThreadIds(){return this._state.value.archivedThreadIds}get newThreadId(){return this._state.value.newThreadId}get mainThreadId(){return this._mainThreadId}get _mainThreadRemoteId(){var t;if(this._mainThreadId!==void 0)return(t=Ii(this._state.value,this._mainThreadId))==null?void 0:t.remoteId}_notifyThreadIdChange(){var t,e;const n=this._mainThreadRemoteId;this._lastNotifiedThreadId!==n&&(this._lastNotifiedThreadId=n,(e=(t=this._options).onThreadIdChange)==null||e.call(t,n))}getMainThreadRuntimeCore(){const t=this._hookManager.getThreadRuntimeCore(this._mainThreadId);return t||Lk}getThreadRuntimeCore(t){const e=this.getItemById(t);if(!e)throw new Error("Thread not found");const n=this._hookManager.getThreadRuntimeCore(e.id);if(!n)throw new Error("Thread not found");return n}getItemById(t){return Ii(this._state.value,t)}async switchToThread(t,e){let n=this.getItemById(t);if(!n){const a=await this._options.adapter.fetch(t),o=this._state.value,u=a.remoteId,d={...o.threadData,[u]:{id:u,initializeTask:Promise.resolve({remoteId:a.remoteId,externalId:a.externalId}),remoteId:a.remoteId,externalId:a.externalId,status:a.status,title:a.title,lastMessageAt:a.lastMessageAt,custom:a.custom}},f={...o.threadIdMap,[a.remoteId]:u},h=o.threadIds.filter(b=>b!==a.remoteId),m=o.archivedThreadIds.filter(b=>b!==a.remoteId),v=a.status==="regular"?[...h,a.remoteId]:h,y=a.status==="archived"?[...m,a.remoteId]:m;this._state.update({...o,threadIds:v,archivedThreadIds:y,threadIdMap:f,threadData:d}),n=this.getItemById(t)}if(!n)throw new Error("Thread not found");if(this._mainThreadId===n.id)return;const i=this._hookManager.startThreadRuntime(n.id);this.mainThreadId!==void 0?await i:i.then(()=>this._notifySubscribers()),n.status==="archived"&&e?.unarchive!==!1&&await this.unarchive(n.id),this._mainThreadId=n.id,this._notifySubscribers(),this._notifyThreadIdChange()}async switchToNewThread(){for(;this._state.baseValue.newThreadId!==void 0&&this._state.value.newThreadId===void 0;)await this._state.waitForUpdate();const t=this._state.value;let e=this._state.value.newThreadId;if(e===void 0){do e=`__LOCALID_${qn()}`;while(t.threadIdMap[e]);const n=e;this._state.update({...t,newThreadId:e,threadIdMap:{...t.threadIdMap,[e]:n},threadData:{...t.threadData,[n]:{status:"new",id:e,remoteId:void 0,externalId:void 0,title:void 0,custom:void 0}}})}return this.switchToThread(e)}rename(t,e){const n=this.getItemById(t);if(!n)throw new Error("Thread not found");if(n.status==="new")throw new Error("Thread is not yet initialized");return this._state.optimisticUpdate({execute:async()=>{const{remoteId:i}=await n.initializeTask;return this._options.adapter.rename(i,e)},optimistic:i=>{const a=Ii(i,t);return a?{...i,threadData:{...i.threadData,[a.id]:{...a,title:e}}}:i}})}updateCustom(t,e){const n=this.getItemById(t);if(!n)throw new Error("Thread not found");if(n.status==="new")throw new Error("Thread is not yet initialized");if(!this._options.adapter.updateCustom)throw new Error("Remote thread list adapter does not support updating custom metadata");return this._state.optimisticUpdate({execute:async()=>{const{remoteId:i}=await n.initializeTask,a=this._options.adapter;if(!a.updateCustom)throw new Error("Remote thread list adapter does not support updating custom metadata");return a.updateCustom(i,e)},optimistic:i=>{const a=Ii(i,t);return a?{...i,threadData:{...i.threadData,[a.id]:{...a,custom:e}}}:i}})}async _ensureThreadIsNotMain(t){if(t===this.newThreadId)throw new Error("Cannot ensure new thread is not main");t===this._mainThreadId&&await this.switchToNewThread()}async archive(t){const e=this.getItemById(t);if(!e)throw new Error("Thread not found");if(e.status!=="regular")throw new Error("Thread is not yet initialized or already archived");return await this._ensureThreadIsNotMain(e.id),this._state.optimisticUpdate({execute:async()=>{const{remoteId:n}=await e.initializeTask;return this._options.adapter.archive(n)},optimistic:n=>du(n,e.id,"archived")})}unarchive(t){const e=this.getItemById(t);if(!e)throw new Error("Thread not found");if(e.status!=="archived")throw new Error("Thread is not archived");return this._state.optimisticUpdate({execute:async()=>{try{const{remoteId:n}=await e.initializeTask;return await this._options.adapter.unarchive(n)}catch(n){throw await this._ensureThreadIsNotMain(e.id),n}},optimistic:n=>du(n,e.id,"regular")})}async delete(t){const e=this.getItemById(t);if(!e)throw new Error("Thread not found");if(e.status!=="regular"&&e.status!=="archived")throw new Error("Thread is not yet initialized");return await this._ensureThreadIsNotMain(e.id),this._hookManager.stopThreadRuntime(e.id),this._state.optimisticUpdate({execute:async()=>{const{remoteId:n}=await e.initializeTask;return await this._options.adapter.delete(n)},optimistic:n=>du(n,e.id,"deleted")})}async detach(t){const e=this.getItemById(t);if(!e)throw new Error("Thread not found");if(e.status!=="regular"&&e.status!=="archived")throw new Error("Thread is not yet initialized");await this._ensureThreadIsNotMain(e.id),this._hookManager.stopThreadRuntime(e.id)}},Hk=class extends Kf{constructor(t){super(),U(this,"threads"),this.threads=new Uk(t,this._contextProvider)}get RenderComponent(){return this.threads.__internal_RenderComponent}};const qk=t=>{const e=Y(10);let n;e[0]!==t?(n=()=>new Hk(t),e[0]=t,e[1]=n):n=e[1];const[i]=it(n);let a;e[2]!==t||e[3]!==i.threads?(a=()=>{i.threads.__internal_setOptions(t),i.threads.__internal_load()},e[2]=t,e[3]=i.threads,e[4]=a):a=e[4];let o;e[5]!==t||e[6]!==i?(o=[i,t],e[5]=t,e[6]=i,e[7]=o):o=e[7],ye(a,o);let u;return e[8]!==i?(u=new Xf(i),e[8]=i,e[9]=u):u=e[9],u},Vk=t=>{const e=Ce(t.runtimeHook);e.current=t.runtimeHook;const n=Ce(t.threadId??t.initialThreadId),i=Zr(()=>e.current(),[]),a=bn(f=>{var h;(h=t.onThreadIdChange)==null||h.call(t,f)}),o=Ue(()=>({adapter:t.adapter,allowNesting:t.allowNesting,initialThreadId:n.current,runtimeHook:i,onThreadIdChange:a}),[t.adapter,t.allowNesting,i]);if(_e().threadListItem.source!==null){if(!o.allowNesting)throw new Error("useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. Set allowNesting: true to allow nesting (the inner runtime will become a no-op).");return i()}const u=qk(o),d=Ce(t.threadId);return ye(()=>{t.threadId!==d.current&&(d.current=t.threadId,t.threadId?u.threads.switchToThread(t.threadId).catch(()=>{}):u.threads.switchToNewThread().catch(()=>{}))},[u,t.threadId]),u};function $k(t){var e;const n=((e=t.status)==null?void 0:e.type)==="running"?{type:"incomplete",reason:"cancelled"}:t.status;return{role:t.role,content:t.content.map(i=>{const a=i.type;switch(a){case"text":return{type:"text",text:i.text};case"reasoning":return{type:"reasoning",text:i.text};case"source":return i.sourceType==="url"?{type:"source",sourceType:"url",id:i.id,url:i.url,...i.title!=null?{title:i.title}:void 0,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:void 0}:{type:"source",sourceType:"document",id:i.id,title:i.title,mediaType:i.mediaType,...i.filename!=null?{filename:i.filename}:void 0,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:void 0};case"tool-call":return Ja(i.result)||console.warn(`tool-call result is not JSON! ${JSON.stringify(i)}`),{type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,...JSON.stringify(i.args)===i.argsText?{args:i.args}:{argsText:i.argsText},...i.result?{result:i.result}:void 0,...i.isError?{isError:!0}:void 0};case"image":return{type:"image",image:i.image};case"file":return{type:"file",data:i.data,mimeType:i.mimeType,...i.filename?{filename:i.filename}:void 0};default:throw new Error(`Message part type not supported by aui/v0: ${a}`)}}),metadata:t.metadata,...n?{status:n}:void 0}}function Fk(t){const e=t.content,n=uu({id:t.id,createdAt:t.created_at,...e},t.id,{type:"complete",reason:"unknown"});return{parentId:t.parent_id,message:n}}const Fb=t=>{try{const e=t.split(".")[1];if(!e)throw new Error("Invalid JWT format");let n=e.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4!==0;)n+="=";const i=atob(n),a=JSON.parse(i).exp;if(!a||typeof a!="number")throw new Error('JWT does not contain a valid "exp" field');return a*1e3}catch(e){throw new Error(`Unable to determine the token expiry: ${e}`)}};var Yb=(Vy=class{constructor(t){U(this,"strategy","jwt"),U(this,"cac
53hedToken",null),U(this,"tokenExpiry",null),Bl(this,Ll),Pl(this,Ll,t)}async getAuthHeaders(){const t=Date.now();if(this.cachedToken&&this.tokenExpiry&&this.tokenExpiry-t>30*1e3)return{Authorization:`Bearer ${this.cachedToken}`};const e=await jl(this,Ll).call(this);return e?(this.cachedToken=e,this.tokenExpiry=Fb(e),{Authorization:`Bearer ${e}`}):!1}readAuthHeaders(t){const e=t.get("Authorization");if(!e)return;const[n,i]=e.split(" ");if(n!=="Bearer"||!i)throw new Error("Invalid auth header received");this.cachedToken=i,this.tokenExpiry=Fb(i)}},Ll=new WeakMap,Vy),Yk=($y=class{constructor(t,e,n){U(this,"strategy","api-key"),Bl(this,Ul),Bl(this,Hl),Bl(this,ql),Pl(this,Ul,t),Pl(this,Hl,e),Pl(this,ql,n)}async getAuthHeaders(){return{Authorization:`Bearer ${jl(this,Ul)}`,"Aui-User-Id":jl(this,Hl),"Aui-Workspace-Id":jl(this,ql)}}readAuthHeaders(){}},Ul=new WeakMap,Hl=new WeakMap,ql=new WeakMap,$y);const fu="aui:refresh_token";var Gk=class{constructor(t){U(this,"strategy","anon"),U(this,"baseUrl"),U(this,"jwtStrategy"),this.baseUrl=t,this.jwtStrategy=new Yb(async()=>{const e=Date.now(),n=localStorage.getItem(fu),i=n?JSON.parse(n):void 0;if(i)if(new Date(i.expires_at).getTime()-e>30*1e3){const d=await fetch(`${this.baseUrl}/v1/auth/tokens/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:i.token})});if(d.ok){const{access_token:f,refresh_token:h}=await d.json();return h&&localStorage.setItem(fu,JSON.stringify(h)),f}}else localStorage.removeItem(fu);const a=await fetch(`${this.baseUrl}/v1/auth/tokens/anonymous`,{method:"POST"});if(!a.ok)return null;const{access_token:o,refresh_token:u}=await a.json();return!o||!u?null:(localStorage.setItem(fu,JSON.stringify(u)),o)})}async getAuthHeaders(){return this.jwtStrategy.getAuthHeaders()}readAuthHeaders(t){this.jwtStrategy.readAuthHeaders(t)}},Gb=class extends Error{constructor(t){super(t),this.name="APIError"}},Qk=class{constructor(t){if(U(this,"_auth"),U(this,"_baseUrl"),"authToken"in t)this._baseUrl=t.baseUrl,this._auth=new Yb(t.authToken);else if("apiKey"in t)this._baseUrl=(t.baseUrl??"https://backend.assistant-api.com").replace(/\/$/,""),this._auth=new Yk(t.apiKey,t.userId,t.workspaceId);else if("anonymous"in t)this._baseUrl=t.baseUrl,this._auth=new Gk(t.baseUrl);else throw new Error("Invalid configuration: Must provide authToken, apiKey, or anonymous configuration")}async initializeAuth(){return!!this._auth.getAuthHeaders()}async makeRawRequest(t,e={}){const n=await this._auth.getAuthHeaders();if(!n)throw new Error("Authorization failed");const i={...n,...e.headers,"Content-Type":"application/json"},a=new URLSearchParams;if(e.query)for(const[d,f]of Object.entries(e.query))f!==!1&&(f===!0?a.set(d,"true"):a.set(d,f.toString()));const o=new URL(`${this._baseUrl}/v1${t}`);o.search=a.toString();const u=await fetch(o,{method:e.method??"GET",headers:i,body:e.body?JSON.stringify(e.body):null});if(this._auth.readAuthHeaders(u.headers),!u.ok){const d=await u.text();try{throw new Gb(JSON.parse(d).message)}catch(f){throw f instanceof Gb?f:new Error(`Request failed with status ${u.status}, ${d}`)}}return u}async makeRequest(t,e={}){return(await this.makeRawRequest(t,e)).json()}},Xk=class{constructor(t){U(this,"cloud"),this.cloud=t}async create(){return this.cloud.makeRequest("/auth/tokens",{method:"POST"})}},Kk=class{constructor(t){U(this,"cloud"),this.cloud=t}__internal_getAssistantOptions(t){return{api:`${this.cloud._baseUrl}/v1/runs/stream`,headers:async()=>{const e=await this.cloud._auth.getAuthHeaders();if(!e)throw new Error("Authorization failed");return{...e,Accept:"text/plain"}},body:{assistant_id:t,response_format:"vercel-ai-data-stream/v1",thread_id:"unstable_todo"}}}async stream(t){const e=await this.cloud.makeRawRequest("/runs/stream",{method:"POST",headers:{Accept:"text/plain"},body:t});return Vf.fromResponse(e,new QM)}async report(t){return this.cloud.makeRequest("/runs",{method:"POST",body:t})}},Zk=class{constructor(t){U(this,"cloud"),this.cloud=t}async list(t,e){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}/messages`,{query:e})}
53async create(t,e){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}/messages`,{method:"POST",body:e})}async update(t,e,n){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}/messages/${encodeURIComponent(e)}`,{method:"PUT",body:n})}},Jk=class{constructor(t){U(this,"cloud"),U(this,"messages"),this.cloud=t,this.messages=new Zk(t)}async list(t){return this.cloud.makeRequest("/threads",{query:t})}async get(t){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}`)}async create(t){return this.cloud.makeRequest("/threads",{method:"POST",body:t})}async update(t,e){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}`,{method:"PUT",body:e})}async delete(t){return this.cloud.makeRequest(`/threads/${encodeURIComponent(t)}`,{method:"DELETE"})}},Wk=class{constructor(t){U(this,"cloud"),this.cloud=t}async pdfToImages(t){return this.cloud.makeRequest("/files/pdf-to-images",{method:"POST",body:t})}async generatePresignedUploadUrl(t){return this.cloud.makeRequest("/files/attachments/generate-presigned-upload-url",{method:"POST",body:t})}},e4=class{constructor(t){U(this,"threads"),U(this,"auth"),U(this,"runs"),U(this,"files"),U(this,"telemetry");const e=new Qk(t);this.threads=new Jk(e),this.auth={tokens:new Xk(e)},this.runs=new Kk(e),this.files=new Wk(e);const n=t.telemetry;this.telemetry=n===!1?{enabled:!1}:n===!0||n===void 0?{enabled:!0}:{enabled:n.enabled!==!1,...n}}},t4=class{constructor(t){U(this,"cloud"),U(this,"idMapping",{}),this.cloud=t}async append(t,e,n,i,a){const o=n?await this.idMapping[n]??n:null,u=this.cloud.threads.messages.create(t,{parent_id:o,format:i,content:a}).then(({message_id:d})=>(this.idMapping[e]=d,d)).catch(d=>{throw this.idMapping[e]===u&&delete this.idMapping[e],d});return this.idMapping[e]=u,u.then(()=>{})}async update(t,e,n,i){const a=await this.getRemoteId(e);a&&await this.cloud.threads.messages.update(t,a,{content:i})}isPersisted(t){return t in this.idMapping}async getRemoteId(t){const e=this.idMapping[t];if(e)return e}async load(t,e){const{messages:n}=await this.cloud.threads.messages.list(t,e?{format:e}:void 0);for(const i of n)this.idMapping[i.id]=i.id;return n}reset(){this.idMapping={}}};const n4=(t,e)=>({append:async(n,i)=>{const a=e.getId(i.message),o=e.encode(i);return t.append(n,a,i.parentId,e.format,o)},update:t.update?async(n,i,a)=>{const o=e.encode(i);return t.update(n,a,e.format,o)}:void 0,load:async n=>({messages:(await t.load(n,e.format)).filter(i=>i.format===e.format).map(i=>e.decode({id:i.id,parent_id:i.parent_id,format:i.format,content:i.content})).reverse()}),isPersisted:n=>t.isPersisted(n)}),eh=new WeakMap;var r4=class{constructor(t,e){U(this,"cloudRef"),U(this,"aui"),this.cloudRef=t,this.aui=e}get _persistence(){const t=this.aui.threadListItem();return eh.has(t)||eh.set(t,new t4(this.cloudRef.current)),eh.get(t)}withFormat(t){const e=this,n=n4(this._persistence,t);return{async append(i){const{remoteId:a}=await e.aui.threadListItem().initialize();await n.append(a,i)},async update(i,a){var o;const u=e.aui.threadListItem().getState().remoteId;u&&await((o=n.update)==null?void 0:o.call(n,u,i,a))},async delete(){throw new Error("Assistant Cloud does not support deleting thread messages yet.")},reportTelemetry(i,a){const o=i.map(u=>t.encode(u));e._reportRunTelemetry(t.format,o,a)},async load(){const i=e.aui.threadListItem().getState().remoteId;return i?n.load(i):{messages:[]}}}}async append({parentId:t,message:e}){const{remoteId:n}=await this.aui.threadListItem().initialize(),i=$k(e);await this._persistence.append(n,e.id,t,"aui/v0",i),this.cloudRef.current.telemetry.enabled&&this._maybeReportRun(n,"aui/v0",i)}async delete(){throw new Error("Assistant Cloud does not support deleting thread messages yet.")}async load(){const t=this.aui.threadListItem().getState().remoteId;return t?{messages:(await this._persistence.load(t,"aui/v0")).filter(e=>e.format==="aui/v0").map(Fk).reverse()}:{messages:[]}}_reportRunTelemetry(t,e,n){if(!this.cloudRef.current.telemetry.enabled)return;const i=this.aui.threadListItem().getState().remoteId;if(!i)return;const a=o4(t,e);a&&this._sendReport(i,a,n?.durationMs,n?.stepTimestamps)}_maybeReportRun(t,e,n){const i=Kb(e,n);i&&this._sendReport(t,i)}_sendReport(t,e,n,i){const a=a4(e.steps,i),o={thread_id:t,status:e.status,...e.totalSteps!=null?{total_steps:e.totalSteps}:void 0,...e.toolCalls?{tool_calls:e.toolCalls}:void 0,...a?{steps:a}:void 0,...e.inputTokens!=null?{input_tokens:e.inputTokens}:void 0,...e.outputTokens!=null?{output_tokens:e.outputTokens}:void 0,...e.reasoningTokens!=null?{reasoning_tokens:e.reasoningTokens}:void 0,...e.cachedInputTokens!=null?{cached_input_tokens:e.cachedInputTokens}:void 0,...n!=null?{duration_ms:n}:void 0,...e.outputText!=null?{output_text:e.outputText}:void 0,...e.metadata?{metadata:e.metadata}:void 0,...e.modelId?{model_id:e.modelId}:void 0},{beforeReport:u}=this.cloudRef.current.telemetry,d=u?u(o):o;d&&this.cloudRef.current.runs.report(d).catch(()=>{})}};const Qb=5e4;function hu(t){return t.length<=Qb?t:t.slice(0,Qb)}function th(t){if(t!=null)try{return hu(JSON.stringify(t))}catch{return}}const i4=/^[A-Za-z0-9+/]{100,}={0,2}$/;function s4(t){if(t!=null){try{const e=typeof t=="string"?JSON.parse(t):t;if(Array.isArray(e)){const n=e.map(i=>{if(i&&typeof i=="object"&&i.type&&(i.type==="image"||i.type==="audio")&&typeof i.data=="str
53ing"&&i4.test(i.data.slice(0,200))){const a=(i.data.length*3/4/1024).toFixed(1);return{...i,data:`[${i.type}: ${a}KB]`}}return i});return hu(JSON.stringify(n))}}catch{}return th(t)}}function Xb(t,e,n,i,a,o){const u={tool_name:t,tool_call_id:e},d=a??th(n);d!==void 0&&(u.tool_args=d);const f=o==="mcp"?s4(i):th(i);return f!==void 0&&(u.tool_result=f),o&&(u.tool_source=o),u}function a4(t,e){if(!e)return t;if(!t)return e.map(i=>({...i}));const n=Math.min(t.length,e.length);return t.map((i,a)=>({...i,...a<n?e[a]:void 0}))}function Kb(t,e){switch(t){case"aui/v0":return u4(e);case"ai-sdk/v6":return p4(e);default:return null}}function o4(t,e){if(t==="ai-sdk/v6")return m4(e);for(let n=e.length-1;n>=0;n--){const i=Kb(t,e[n]);if(i)return i}return null}const l4={error:"error",incomplete:"incomplete"};function u4(t){var e,n,i,a,o,u,d,f,h,m,v,y;const b=t;if(b.role!=="assistant")return null;const S=(e=b.content)==null?void 0:e.filter($=>$.type==="tool-call"&&$.toolName&&$.toolCallId).map($=>Xb($.toolName,$.toolCallId,$.args,$.result,$.argsText)),_=(n=b.content)==null?void 0:n.filter($=>$.type==="text"&&$.text),w=_&&_.length>0?hu(_.map($=>$.text).join("")):void 0,C=(i=b.metadata)==null?void 0:i.steps;let A,R,D,N;if(C&&C.length>0){let $=0,L=0,Q=0,ee=0,J=!1,P=!1,te=!1,G=!1;for(const le of C)((a=le.usage)==null?void 0:a.inputTokens)!=null&&($+=le.usage.inputTokens,J=!0),((o=le.usage)==null?void 0:o.outputTokens)!=null&&(L+=le.usage.outputTokens,P=!0),((u=le.usage)==null?void 0:u.reasoningTokens)!=null&&(Q+=le.usage.reasoningTokens,te=!0),((d=le.usage)==null?void 0:d.cachedInputTokens)!=null&&(ee+=le.usage.cachedInputTokens,G=!0);A=J?$:void 0,R=P?L:void 0,D=te?Q:void 0,N=G?ee:void 0}const I=(f=b.status)==null?void 0:f.type,z=I&&l4[I]||"completed",q=(h=b.metadata)==null?void 0:h.custom,X=((m=b.metadata)==null?void 0:m.modelId)??(typeof((y=(v=b.metadata)==null?void 0:v.custom)==null?void 0:y.modelId)=="string"?b.metadata.custom.modelId:void 0),V=C&&C.length>1?C.map($=>{var L,Q,ee,J;return{...((L=$.usage)==null?void 0:L.inputTokens)!=null?{input_tokens:$.usage.inputTokens}:void 0,...((Q=$.usage)==null?void 0:Q.outputTokens)!=null?{output_tokens:$.usage.outputTokens}:void 0,...((ee=$.usage)==null?void 0:ee.reasoningTokens)!=null?{reasoning_tokens:$.usage.reasoningTokens}:void 0,...((J=$.usage)==null?void 0:J.cachedInputTokens)!=null?{cached_input_tokens:$.usage.cachedInputTokens}:void 0}}):void 0;return{status:z,...S&&S.length>0?{toolCalls:S}:void 0,...C?.length?{totalSteps:C.length}:void 0,...A!=null?{inputTokens:A}:void 0,...R!=null?{outputTokens:R}:void 0,...D!=null?{reasoningTokens:D}:void 0,...N!=null?{cachedInputTokens:N}:void 0,...w!=null?{outputText:w}:void 0,...q?{metadata:q}:void 0,...V?{steps:V}:void 0,...X?{modelId:X}:void 0}}function c4(t){return t.toolCallId?t.type==="tool-call"||t.type==="dynamic-tool"?!!t.toolName:t.type.startsWith("tool-")||t.type.startsWith("dynamic-tool-"):!1}function d4(t){return t.type==="dynamic-tool"||t.type.startsWith("dynamic-tool-")}function f4(t){const e=d4(t)?"mcp":void 0;return Xb(t.toolName??t.type.slice(5),t.toolCallId,t.args??t.input,t.result??t.output,void 0,e)}function Zb(t){const e=[],n=[],i=[];let a=null;for(const o of t)if(o.type==="step-start")a!==null&&i.push({tool_calls:a}),a=[];else if(o.type==="text"&&o.text)e.push(o.text);else if(c4(o)){const u=f4(o);n.push(u),a!==null&&a.push(u)}return a!==null&&i.push({tool_calls:a}),{textParts:e,toolCalls:n,stepsData:i}}function h4(t){if(!t)return;if(typeof t.modelId=="string")return t.modelId;const e=t.custom;if(typeof e?.modelId=="string")return e.modelId}function Jb(t,e,n,i,a,o){const u=t.length>0,d=u?hu(t.join("")):void 0,f=h4(i),h=a&&a.length>1?a.map(m=>({...m.tool_calls.length>0?{tool_calls:m.tool_calls}:void 0})):void 0;return{status:u?"completed":"incomplete",...e.length>0?{toolCalls:e}:void 0,...n>0?{totalSteps:n}:void 0,...o?.inputTokens!=null?{inputTokens:o.inputTokens}:void 0,...o?.outputTokens!=null?{outputTokens:o.outputTokens}:void 0,...o?.reasoningTokens!=null?{reasoningTokens:o.reasoningTokens}:void 0,...o?.cachedInputTokens!=null?{cachedInputTokens:o.cachedInputTokens}:void 0,...d!=null?{outputText:d}:void 0,...i?{metadata:i}:void 0,...h?{steps:h}:void 0,...f?{modelId:f}:void 0}}function Wb(t){const e=t.inputTokens??t.promptTokens,n=t.outputTokens??t.completionTokens;if(!(e==null&&n==null&&t.reasoningTokens==null&&t.cachedInputTokens==null))return{...e!=null?{inputTokens:e}:void 0,...n!=null?{outputTokens:n}:void 0,...t.reasoningTokens!=null?{reasoningTokens:t.reasoningTokens}:void 0,...t.cachedInputTokens!=null?{cachedInputTokens:t.cachedInputTokens}:void 0}}function e1(t){const e=t?.usage;if(e){const i=Wb(e);if(i)return i}const n=t?.steps;if(n&&n.length>0){let i=0,a=0,o=0,u=0,d=!1,f=!1,h=!1,m=!1,v=!1;for(const y of n){if(!y.usage)continue;const b=Wb(y.usage);b&&(b.inputTokens!=null&&(i+=b.inputTokens,d=!0),b.outputTokens!=null&&(a+=b.outputTokens,f=!0),b.reasoningTokens!=null&&(o+=b.reasoningTokens,h=!0),b.cachedInputTokens!=null&&(u+=b.cachedInputTokens,m=!0),v=!0)}if(v)return{...d?{inputTokens:i}:void 0,...f?{outputTokens:a}:void 0,...h?{reasoningTokens:o}:void 0,...m?{cachedInputTokens:u}:void 0}}}function p4(t){const e=t;if(e.role!=="assistant")return null;const{textParts:n,toolCalls:i,stepsData:a}=Zb(e.parts??[]);return Jb(n,i,a.length,e.metadata,a,e1(e.metadata))}function m4(t){const e=[],n=[],i=[];let a=!1,o,u=0,d=0,f=0,h=0,m=!1,v=!1,y=!1,b=!1;for(const S of t){const _=S;if(_.role!=="assistant")continue;a=!0;const{textParts:w,toolCalls:C,stepsData:A}=Zb(_.parts??[]);e.push(...w),n.push(...C),i.push(...A),_.metadata&&(o=_.metadata);const R=e1(_.metadata);R&&(R.inputTokens!=null&&(u+=R.inputTokens,m=!0),R.outputTokens!=null&&(d+=R.outputTokens,v=!0),R.reasoningTokens!=null&&(f+=R.reasoningTokens,y=!0),R.cachedInputTokens!=null&&(h+=R.cachedInputTokens,b=!0))}return a?Jb(e,n,i.length,o,i,{...m?{inputTokens:u}:void 0,...v?{outputTokens:d}:void 0,...y?{reasoningTokens:f}:void 0,...b?{cachedInputTokens:h}:void 0}):null}function g4(t){const e=Y(3),n=_e();let i;e[0]!==n||e[1]!==t?(i=()=>new r4(t,n),e[0]=n,e[1]=t,e[2]=i):i=e[2];const[a]=it(i);return a}const v4=t=>t.startsWith("image/")?"image":t.startsWith("text/")?"document":"file";var y4=class{constructor(t){U(this,"cloud"),U(this,"accept","*"),U(this,"uploadedUrls",new Map),this.cloud=t}async*add({file:t}){const e=crypto.randomUUID();let n={id:e,type:v4(t.type),name:t.name,contentType:t.type,file:t,status:{type:"running",reason:"uploading",progress:0}};yield n;try{const{signedUrl:i,publicUrl:a}=await this.cloud.files.generatePresignedUploadUrl({filename:t.name});await fetch(i,{method:"PUT",body:t,headers:{"Content-Type":t.type},mode:"cors"}),this.uploadedUrls.set(e,a),n={...n,status:{type:"requires-action",reason:"composer-send"}},yield n}catch{n={...n,status:{type:"incomplete",reason:"error"}},yield n}}async remove(t){this.uploadedUrls.delete(t.id)}async send(t){const e=this.uploadedUrls.get(t.id);if(!e)throw new Error("Attachment not uploaded");this.uploadedUrls.delete(t.id);let n;return t.type==="image"?n=[{type:"image",image:e,filename:t.name}]:n=[{type:"file",data:e,mimeType:t.contentType??"",filename:t.name}],{...t,status:{type:"complete"},content:n}}},b4=class{list(){return Promise.resolve({threads:[]})}rename(){return Promise.resolve()}updateCustom(){return Promise.resolve()}archive(){return Promise.resolve()}unarchive(){return Promise.resolve()}delete(){return Promise.resolve()}initialize(t){return Promise.resolve({remoteId:t,externalId:void 0})}generateTitle(){return Promise.resolve(new ReadableStream)}fetch(t){return Promise.reject(new Error("Thread not found"))}};const t1=t=>Ct(t)?t:void 0,n1=typeof process<"u"&&((Fy=process==null?void 0:process.env)==null?void 0:Fy.NEXT_PUBLIC_ASSISTANT_BASE_URL),nh=n1?new e4({baseUrl:n1,anonymous:!0}):void 0,x4=t=>{const e=Ce(t);ye(()=>{e.current=t},[t]);const n=Zr(function({children:o}){const u=g4({get current(){return e.current.cloud??nh}}),d=e.current.cloud??nh,f=Ue(()=>new y4(d),[d]);return T.jsx(Nb,{adapters:Ue(()=>({history:u,attachments:f}),[u,f]),children:o})},[]),i=t.cloud??nh;if(!i){const a=e,o=new b4;return o.initialize=async u=>{var d,f,h;return{remoteId:u,externalId:(h=await((f=(d=a.current).create)==null?void 0:f.call(d)))==null?void 0:h.externalId}},o}return{list:async()=>{const{threads:a}=await i.threads.list();return{threads:a.map(o=>({status:o.is_archived?"archived":"regular",remoteId:o.id,title:o.title,lastMessageAt:o.last_message_at?new Date(o.last_message_at):void 0,externalId:o.external_id??void 0,custom:t
531(o.metadata)}))}},initialize:async()=>{var a;const o=await(((a=t.create)==null?void 0:a.call(t))??Promise.resolve()),u=o?o.externalId:void 0,{thread_id:d}=await i.threads.create({last_message_at:new Date,external_id:u});return{externalId:u,remoteId:d}},rename:async(a,o)=>i.threads.update(a,{title:o}),updateCustom:async(a,o)=>i.threads.update(a,{metadata:o??null}),archive:async a=>i.threads.update(a,{is_archived:!0}),unarchive:async a=>i.threads.update(a,{is_archived:!1}),delete:async a=>{var o;return await((o=t.delete)==null?void 0:o.call(t,a)),i.threads.delete(a)},generateTitle:async(a,o)=>{const u=o.map(d=>({...d,content:d.content.filter(f=>f.type==="text"||f.type==="tool-call")}));return i.runs.stream({thread_id:a,assistant_id:"system/thread_title",messages:u})},fetch:async a=>{const o=await i.threads.get(a);return{status:o.is_archived?"archived":"regular",remoteId:o.id,title:o.title,lastMessageAt:o.last_message_at?new Date(o.last_message_at):void 0,externalId:o.external_id??void 0,custom:t1(o.metadata)}},unstable_Provider:n}},_4=t=>{const e=Y(10),{id:n,children:i}=t;let a;e[0]!==n?(a=Tn({source:"thread",query:{type:"id",id:n},get:h=>h.thread().message({id:n})}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==n?(o=Tn({source:"message",query:{},get:h=>h.thread().message({id:n}).composer()}),e[2]=n,e[3]=o):o=e[3];let u;e[4]!==a||e[5]!==o?(u={message:a,composer:o},e[4]=a,e[5]=o,e[6]=u):u=e[6];const d=_e(u);let f;return e[7]!==d||e[8]!==i?(f=T.jsx(Sn,{value:d,children:i}),e[7]=d,e[8]=i,e[9]=f):f=e[9],f},rh=(t,e)=>t.Message===e.Message&&t.EditComposer===e.EditComposer&&t.UserEditComposer===e.UserEditComposer&&t.AssistantEditComposer===e.AssistantEditComposer&&t.SystemEditComposer===e.SystemEditComposer&&t.UserMessage===e.UserMessage&&t.AssistantMessage===e.AssistantMessage&&t.SystemMessage===e.SystemMessage,S4=()=>null,r1=new WeakMap,T4=(t,e)=>{let n=r1.get(t);return n||(n=new Set(t.map(i=>i.id)),r1.set(t,n)),n.has(e)},w4=(t,e,n)=>{switch(e){case"user":return n?t.UserEditComposer??t.EditComposer??t.UserMessage??t.Message:t.UserMessage??t.Message;case"assistant":return n?t.AssistantEditComposer??t.EditComposer??t.AssistantMessage??t.Message:t.AssistantMessage??t.Message;case"system":return n?t.SystemEditComposer??t.EditComposer??t.SystemMessage??t.Message:t.SystemMessage??t.Message??S4;default:throw new Error(`Unknown message role: ${e}`)}},ih=t=>{const e=Y(6),{components:n}=t,i=ce(E4),a=ce(A4);let o;e[0]!==n||e[1]!==a||e[2]!==i?(o=w4(n,i,a),e[0]=n,e[1]=a,e[2]=i,e[3]=o):o=e[3];const u=o;let d;return e[4]!==u?(d=T.jsx(u,{}),e[4]=u,e[5]=d):d=e[5],d},i1=O.memo(t=>{const e=Y(5),{index:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(ih,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(Tb,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o},(t,e)=>t.index===e.index&&rh(t.components,e.components));i1.displayName="ThreadPrimitive.MessageByIndex";const s1=O.memo(t=>{const e=Y(7),{messageId:n,components:i}=t;let a;if(e[0]!==n?(a=d=>T4(d.thread.messages,n),e[0]=n,e[1]=a):a=e[1],!ce(a))return null;let o;e[2]!==i?(o=T.jsx(ih,{components:i}),e[2]=i,e[3]=o):o=e[3];let u;return e[4]!==n||e[5]!==o?(u=T.jsx(_4,{id:n,children:o}),e[4]=n,e[5]=o,e[6]=u):u=e[6],u},(t,e)=>t.messageId===e.messageId&&rh(t.components,e.components));s1.displayName="ThreadPrimitive.Unstable_MessageById";const a1=({children:t})=>{const e=ce(n=>n.thread.messages.length);return Ue(()=>e===0?null:Array.from({length:e},(n,i)=>T.jsx(Tb,{index:i,children:T.jsx(Os,{getItemState:a=>a.thread().message({index:i}).getState(),children:a=>t({get message(){return a()}})})},i)),[e,t])},o1=t=>{const e=Y(4),{components:n,children:i}=t;if(n){let o;return e[0]!==n?(o=T.jsx(a1,{children:()=>T.jsx(ih,{components:n})}),e[0]=n,e[1]=o):o=e[1],o}let a;return e[2]!==i?(a=T.jsx(a1,{children:i}),e[2]=i,e[3]=a):a=e[3],a};o1.displayName="ThreadPrimitive.Messages";const C4=O.memo(o1,(t,e)=>t.children||e.children?t.children===e.children:rh(t.components,e.components));function E4(t){return t.message.role}function A4(t){return t.message.composer.isEditing}const l1=t=>{var e;const n=t.message.metadata;if(!(!n||typeof n!="object"))return(e=n.custom)==null?void 0:e.quote};
53var R4=class extends Error{constructor(t,e=`Component "${t}" is not in the generative-ui allowlist.`){super(e),U(this,"componentName"),this.name="GenerativeUIRenderError",this.componentName=t}};const M4=t=>typeof t=="object"&&t!==null,u1=(t,e,n,i)=>{var a;if(t==null)return null;if(typeof t=="string")return t;if(!M4(t)||!("component"in t)||typeof t.component!="string")return typeof process<"u"&&((a=process.env)==null?void 0:a.NODE_ENV)!=="production"&&console.warn(`[generative-ui] Skipping malformed node at ${i}:`,t),null;const{component:o,props:u,children:d,key:f}=t,h=e[o];if(!h){if(n)return T.jsx(n,{component:o,props:u},f??i);throw new R4(o)}const m=d?.length?d.map((v,y)=>u1(v,e,n,`${i}/${y}`)):void 0;return O.createElement(h,{...u??{},key:f??i},...m??[])},k4=t=>{if(!t||t.root===void 0||t.root===null)return[];const e=t.root;return Array.isArray(e)?e:[e]},sh=t=>{const e=Y(11),{spec:n,components:i,Fallback:a}=t;let o;e[0]!==n?(o=k4(n),e[0]=n,e[1]=o):o=e[1];const u=o;let d;if(e[2]!==a||e[3]!==i||e[4]!==u){let h;e[6]!==a||e[7]!==i?(h=(m,v)=>u1(m,i,a,`${v}`),e[6]=a,e[7]=i,e[8]=h):h=e[8],d=u.map(h),e[2]=a,e[3]=i,e[4]=u,e[5]=d}else d=e[5];let f;return e[9]!==d?(f=T.jsx(T.Fragment,{children:d}),e[9]=d,e[10]=f):f=e[10],f};sh.displayName="GenerativeUIRender";const c1=t=>{const e=Y(4),{components:n,spec:i,Fallback:a}=t,o=ce(I4),u=i??o;if(!u)return null;let d;return e[0]!==a||e[1]!==n||e[2]!==u?(d=T.jsx(sh,{spec:u,components:n,Fallback:a}),e[0]=a,e[1]=n,e[2]=u,e[3]=d):d=e[3],d};c1.displayName="MessagePrimitive.GenerativeUI";function I4(t){const e=t.part;return e?.type==="generative-ui"?e.spec:void 0}const O4="ui://",D4=t=>!!t?.startsWith(O4),d1=t=>Symbol.iterator in t,f1=t=>"entries"in t,h1=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),i=e instanceof Map?e:new Map(e.entries());if(n.size!==i.size)return!1;for(const[a,o]of n)if(!i.has(a)||!Object.is(o,i.get(a)))return!1;return!0},N4=(t,e)=>{const n=t[Symbol.iterator](),i=e[Symbol.iterator]();let a=n.next(),o=i.next();for(;!a.done&&!o.done;){if(!Object.is(a.value,o.value))return!1;a=n.next(),o=i.next()}return!!a.done&&!!o.done};function z4(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:d1(t)&&d1(e)?f1(t)&&f1(e)?h1(t,e):N4(t,e):h1({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function ah(t){const e=bt.useRef(void 0);return n=>{const i=t(n);return z4(e.current,i)?e.current:e.current=i}}const oh=t=>{let e=-1;return{startGroup:n=>{e===-1&&(e=n)},endGroup:(n,i)=>{e!==-1&&(i.push({type:t,startIndex:e,endIndex:n}),e=-1)},finalize:(n,i)=>{e!==-1&&i.push({type:t,startIndex:e,endIndex:n})}}},j4=(t,e,n)=>{const i=[];if(e){const a=oh("chainOfThoughtGroup");for(let o=0;o<t.length;o++){const u=t[o];u==="tool-call"||u==="reasoning"?a.startGroup(o):(a.endGroup(o-1,i),i.push({type:"single",index:o}))}a.finalize(t.length-1,i)}else{const a=oh("toolGroup"),o=oh("reasoningGroup");for(let u=0;u<t.length;u++){const d=t[u];d==="tool-call"?(o.endGroup(u-1,i),a.startGroup(u)):d==="reasoning"?(a.endGroup(u-1,i),o.startGroup(u)):(a.endGroup(u-1,i),o.endGroup(u-1,i),i.push({type:"single",index:u}))}a.finalize(t.length-1,i),o.finalize(t.length-1,i)}if(n){const a=new Set;for(const o of i){if(o.type==="single")continue;const u=n[o.startIndex];u!==void 0&&!a.has(u)&&(a.add(u),o.idKey=`id:${u}`)}}return i},B4=t=>{const e=Y(10),n=ce(ah(e3)),i=ce(ah(n3));let a;e:{if(n.length===0){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[0]=d):d=e[0];let f;e[1]!==i?(f={ranges:d,partIds:i},e[1]=i,e[2]=f):f=e[2],a=f;break e}let o;e[3]!==n||e[4]!==i||e[5]!==t?(o=j4(n,t,i),e[3]=n,e[4]=i,e[5]=t,e[6]=o):o=e[6];let u;e[7]!==i||e[8]!==o?(u={ranges:o,partIds:i},e[7]=i,e[8]=o,e[9]=u):u=e[9],a=u}return a},P4=t=>{const e=Y(9);let n,i;e[0]!==t?({Fallback:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n||e[4]!==i.toolName?(a=d=>{var f,h;return((h=(f=d.tools.toolUIs[i.toolName])==null?void 0:f[0])==null?void 0:h.render)??n},e[3]=n,e[4]=i.toolName,e[5]=a):a=e[5];const o=ce(a);if(!o)return null;let u;return e[6]!==o||e[7]!==i?(u=T.jsx(o,{...i}),e[6]=o,e[7]=i,e[8]=u):u=e[8],u},lh=(t,e,n)=>{var i;const a=(i=t.renderers[e])==null?void 0:i[0];return a||(t.fallbacks[0]??n)},L4=t=>{const e=Y(9);let n,i;e[0]!==t?({Fallback:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n||e[4]!==i.name?(a=d=>lh(d.dataRenderers,i.name,n),e[3]=n,e[4]=i.name,e[5]=a):a=e[5];const o=ce(a);if(!o)return null;let u;return e[6]!==o||e[7]!==i?(u=T.jsx(o,{...i}),e[6]=o,e[7]=i,e[8]=u):u=e[8],u},At={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:t})=>t,ReasoningGroup:({children:t})=>t},U4=t=>{var e,n,i,a;const o=Y(47),{components:u}=t;let d;o[0]!==u?(d=u===void 0?{}:u,o[0]=u,o[1]=d):d=o[1];const{Text:f,Reasoning:h,Image:m,Source:v,File:y,Unstable_Audio:b,tools:S,data:_,generativeUI:w}=d,C=f===void 0?At.Text:f,A=h===void 0?At.Reasoning:h,R=m===void 0?At.Image:m,D=v===void 0?At.Source:v,N=y===void 0?At.File:y,I=b===void 0?At.Unstable_Audio:b;let z;o[2]!==S?(z=S===void 0?{}:S,o[2]=S,o[3]=z):z=o[3];const q=z,X=_e(),V=ce(r3),$=V.type;if($==="tool-call"){let L;o[4]!==X?(L=X.part(),o[4]=X,o[5]=L):L=o[5];const Q=L.addToolResult;let ee;o[6]!==X?(ee=X.part(),o[6]=X,o[7]=ee):ee=o[7];const J=ee.resumeToolCall;let P;o[8]!==X?(P=X.part(),o[8]=X,o[9]=P):P=o[9];const te=P.respondToToolApproval;if("Override"in q){let k;return o[10]!==Q||o[11]!==V||o[12]!==te||o[13]!==J||o[14]!==q.Override?(k=T.jsx(q.Override,{...V,addResult:Q,resume:J,respondToApproval:te}),o[10]=Q,o[11]=V,o[12]=te,o[13]=J,o[14]=q.Override,o[15]=k):k=o[15],k}const G=((e=q.by_name)==null?void 0:e[V.toolName])??q.Fallback;let le;return o[16]!==G||o[17]!==Q||o[18]!==V||o[19]!==te||o[20]!==J?(le=T.jsx(P4,{...V,Fallback:G,addResult:Q,resume:J,respondToApproval:te}),o[16]=G,o[17]=Q,o[18]=V,o[19]=te,o[20]=J,o[21]=le):le=o[21],le}if(((n=V.status)==null?void 0:n.type)==="requires-action")throw new Error("Encountered unexpected requires-action status");switch($){case"text":{let L;return o[22]!==C||o[23]!==V?(L=T.jsx(C,{...V}),o[22]=C,o[23]=V,o[24]=L):L=o[24],L}case"reasoning":{let L;return o[25]!==A||o[26]!==V?(L=T.jsx(A,{...V}),o[25]=A,o[26]=V,o[27]=L):L=o[27],L}case"source":{let L;return o[28]!==D||o[29]!==V?(L=T.jsx(D,{...V}),o[28]=D,o[29]=V,o[30]=L):L=o[30],L}case"image":{let L;return o[31]!==R||o[32]!==V?(L=T.jsx(R,{...V}),o[31]=R,o[32]=V,o[33]=L):L=o[33],L}case"file":{let L;return o[34]!==N||o[35]!==V?(L=T.jsx(N,{...V}),o[34]=N,o[35]=V,o[36]=L):L=o[36],L}case"audio":{let L;return o[37]!==I||o[38]!==V?(L=T.jsx(I,{...V}),o[37]=I,o[38]=V,o[39]=L):L=o[39],L}case"data":{const L=((i=_?.by_name)==null?void 0:i[V.name])??_?.Fallback;let Q;return o[40]!==L||o[41]!==V?(Q=T.jsx(L4,{...V,Fallback:L}),o[40]=L,o[41]=V,o[42]=Q):Q=o[42],Q}case"generative-ui":{if(!w?.components)return typeof process<"u"&&((a=process.env)==null?void 0:a.NODE_ENV)!=="production"&&console.warn("MessagePrimitive.Parts received a generative-ui part but no `components.generativeUI.components` allowlist was provided. Pass an allowlist or render with <MessagePrimitive.GenerativeUI />."),null;const L=V;let Q;return o[43]!==w.Fallback||o[44]!==w.components||o[45]!==L.spec?(Q=T.jsx(sh,{spec:L.spec,components:w.components,Fallback:w.Fallback}),o[43]=w.Fallback,o[44]=w.components,o[45]=L.spec,o[46]=Q):Q=o[46],Q}default:return console.warn(`Unknown message part type: ${$}`),null}},ro=O.memo(t=>{const e=Y(5),{index:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(U4,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(Ff,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o}
53,(t,e)=>{var n,i,a,o,u,d,f,h,m,v,y,b,S,_,w,C,A,R,D,N,I,z;return t.index===e.index&&((n=t.components)==null?void 0:n.Text)===((i=e.components)==null?void 0:i.Text)&&((a=t.components)==null?void 0:a.Reasoning)===((o=e.components)==null?void 0:o.Reasoning)&&((u=t.components)==null?void 0:u.Source)===((d=e.components)==null?void 0:d.Source)&&((f=t.components)==null?void 0:f.Image)===((h=e.components)==null?void 0:h.Image)&&((m=t.components)==null?void 0:m.File)===((v=e.components)==null?void 0:v.File)&&((y=t.components)==null?void 0:y.Unstable_Audio)===((b=e.components)==null?void 0:b.Unstable_Audio)&&((S=t.components)==null?void 0:S.tools)===((_=e.components)==null?void 0:_.tools)&&((w=t.components)==null?void 0:w.data)===((C=e.components)==null?void 0:C.data)&&((A=t.components)==null?void 0:A.generativeUI)===((R=e.components)==null?void 0:R.generativeUI)&&((D=t.components)==null?void 0:D.ToolGroup)===((N=e.components)==null?void 0:N.ToolGroup)&&((I=t.components)==null?void 0:I.ReasoningGroup)===((z=e.components)==null?void 0:z.ReasoningGroup)});ro.displayName="MessagePrimitive.PartByIndex";const H4=t=>{const e=Y(6),{status:n,component:i}=t,a=n.type==="running";let o;e[0]!==i||e[1]!==n?(o=T.jsx(i,{type:"text",text:"",status:n}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let u;return e[3]!==a||e[4]!==o?(u=T.jsx(Yf,{text:"",isRunning:a,children:o}),e[3]=a,e[4]=o,e[5]=u):u=e[5],u},q4=Object.freeze({type:"complete"}),V4=Object.freeze({type:"running"}),$4=t=>{const e=Y(6),{components:n}=t,i=ce(i3);if(n?.Empty){let u;return e[0]!==n.Empty||e[1]!==i?(u=T.jsx(n.Empty,{status:i}),e[0]=n.Empty,e[1]=i,e[2]=u):u=e[2],u}if(i.type!=="running")return null;const a=n?.Text??At.Text;let o;return e[3]!==i||e[4]!==a?(o=T.jsx(H4,{status:i,component:a}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o},p1=O.memo($4,(t,e)=>{var n,i,a,o;return((n=t.components)==null?void 0:n.Empty)===((i=e.components)==null?void 0:i.Empty)&&((a=t.components)==null?void 0:a.Text)===((o=e.components)==null?void 0:o.Text)}),F4=t=>{const e=Y(4),{components:n,enabled:i}=t;let a;if(e[0]!==i?(a=u=>{if(!i||u.message.parts.length===0)return!1;const d=u.message.parts[u.message.parts.length-1];return d?.type!=="text"&&d?.type!=="reasoning"},e[0]=i,e[1]=a):a=e[1],!ce(a))return null;let o;return e[2]!==n?(o=T.jsx(p1,{components:n}),e[2]=n,e[3]=o):o=e[3],o},Y4=O.memo(F4,(t,e)=>{var n,i,a,o;return t.enabled===e.enabled&&((n=t.components)==null?void 0:n.Empty)===((i=e.components)==null?void 0:i.Empty)&&((a=t.components)==null?void 0:a.Text)===((o=e.components)==null?void 0:o.Text)}),G4=t=>{const e=Y(4),{Quote:n}=t,i=ce(l1);if(!i)return null;let a;return e[0]!==n||e[1]!==i.messageId||e[2]!==i.text?(a=T.jsx(n,{text:i.text,messageId:i.messageId}),e[0]=n,e[1]=i.messageId,e[2]=i.text,e[3]=a):a=e[3],a},Q4=O.memo(G4);function m1(t,e){var n,i,a,o;const u=((i=(n=t.toolUIs[e.toolName])==null?void 0:n[0])==null?void 0:i.render)??null;return u||(D4((o=(a=e.mcp)==null?void 0:a.app)==null?void 0:o.resourceUri)&&t.mcpApp?t.mcpApp.render:null)}const g1=()=>{const t=Y(12),e=_e(),n=ce(s3),i=ce(a3);if(!i||n.type!=="tool-call")return null;let a;t[0]!==e?(a=e.part(),t[0]=e,t[1]=a):a=t[1];const o=a.addToolResult;let u;t[2]!==e?(u=e.part(),t[2]=e,t[3]=u):u=t[3];const d=u.resumeToolCall;let f;t[4]!==e?(f=e.part(),t[4]=e,t[5]=f):f=t[5];let h;return t[6]!==i||t[7]!==n||t[8]!==a.addToolResult||t[9]!==u.resumeToolCall||t[10]!==f.respondToToolApproval?(h=T.jsx(i,{...n,addResult:o,resume:d,respondToApproval:f.respondToToolApproval}),t[6]=i,t[7]=n,t[8]=a.addToolResult,t[9]=u.resumeToolCall,t[10]=f.respondToToolApproval,t[11]=h):h=t[11],h},v1=()=>{const t=Y(3),e=ce(o3),n=ce(l3);if(!n||e.type!=="data")return null;const i=e;let a;return t[0]!==n||t[1]!==i?(a=T.jsx(n,{...i}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a},X4=()=>{const t=Y(2),e=ce(u3);if(e==="tool-call"){let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=T.jsx(g1,{}),t[0]=n):n=t[0],n}if(e==="data"){let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=T.jsx(v1,{}),t[1]=n):n=t[1],n}return null},K4=Object.freeze({type:"text",text:"",status:V4}),y1=({index:t,children:e})=>{const n=_e(),i=ce(a=>a.dataRenderers);return T.jsx(Ff,{index:t,children:T.jsx(Os,{getItemState:a=>a.message().part({index:t}).getState(),children:a=>e({get part(){const o=a();if(o.type==="tool-call"){const u=m1(n.tools().getState(),o)!==null,d=n.message().part({index:t});return{...o,toolUI:u?T.jsx(g1,{}):null,addResult:d.addToolResult,resume:d.resumeToolCall,respondToApproval:d.respondToToolApproval}}if(o.type==="data"){const u=lh(i,o.name,void 0)!==void 0;return{...o,dataRendererUI:u?T.jsx(v1,{}):null}}return o}})})})},Z4=t=>{const e=Y(9),{children:n}=t,i=ce(c3),a=ce(d3),o=i===0&&a;if(i===0){if(!o)return null;let d;e[0]!==n?(d=n({part:K4}),e[0]=n,e[1]=d):d=e[1];let f;return e[2]!==d?(f=T.jsx(Yf,{text:"",isRunning:!0,children:d}),e[2]=d,e[3]=f):f=e[3],f}let u;if(e[4]!==n||e[5]!==i){let d;e[7]!==n?(d=(f,h)=>T.jsx(y1,{index:h,children:m=>n(m)??T.jsx(X4,{})},h),e[7]=n,e[8]=d):d=e[8],u=T.jsx(T.Fragment,{children:Array.from({length:i},d)}),e[4]=n,e[5]=i,e[6]=u}else u=e[6];return u},uh=t=>{const e=Y(5),{components:n,unstable_showEmptyOnNonTextEnd:i,children:a}=t,o=i===void 0?!0:i;if(a){let d;return e[0]!==a?(d=T.jsx(Z4,{children:a}),e[0]=a,e[1]=d):d=e[1],d}let u;return e[2]!==n||e[3]!==o?(u=T.jsx(J4,{components:n,unstable_showEmptyOnNonTextEnd:o}),e[2]=n,e[3]=o,e[4]=u):u=e[4],u};uh.displayName="MessagePrimitive.Parts";const J4=t=>{const e=Y(15),{components:n,unstable_showEmptyOnNonTextEnd:i}=t,a=ce(f3),{ranges:o,partIds:u}=B4(!!n?.ChainOfThought);let d;e:{if(a===0){let b;e[0]!==n?(b=T.jsx(p1,{components:n}
53),e[0]=n,e[1]=b):b=e[1],d=b;break e}let y;if(e[2]!==n||e[3]!==o||e[4]!==u){const b=new Set,S=_=>{const w=u[_];return w!==void 0&&!b.has(w)?(b.add(w),`part-id:${w}`):`part-${_}`};y=o.map(_=>{if(_.type==="single")return T.jsx(ro,{index:_.index,components:n},_.index);if(_.type==="chainOfThoughtGroup"){const w=n?.ChainOfThought;return w?T.jsx(ak,{startIndex:_.startIndex,endIndex:_.endIndex,children:T.jsx(w,{})},`chainOfThought-${_.idKey??_.startIndex}`):null}else return _.type==="toolGroup"?T.jsx(n?.ToolGroup??At.ToolGroup,{startIndex:_.startIndex,endIndex:_.endIndex,children:Array.from({length:_.endIndex-_.startIndex+1},(w,C)=>{const A=_.startIndex+C;return T.jsx(ro,{index:A,components:n},S(A))})},`tool-${_.idKey??_.startIndex}`):T.jsx(n?.ReasoningGroup??At.ReasoningGroup,{startIndex:_.startIndex,endIndex:_.endIndex,children:Array.from({length:_.endIndex-_.startIndex+1},(w,C)=>{const A=_.startIndex+C;return T.jsx(ro,{index:A,components:n},`part-${A}`)})},`reasoning-${_.startIndex}`)}),e[2]=n,e[3]=o,e[4]=u,e[5]=y}else y=e[5];d=y}const f=d;let h;e[6]!==n?(h=n?.Quote&&T.jsx(Q4,{Quote:n.Quote}),e[6]=n,e[7]=h):h=e[7];let m;e[8]!==n||e[9]!==i?(m=T.jsx(Y4,{components:n,enabled:i}),e[8]=n,e[9]=i,e[10]=m):m=e[10];let v;return e[11]!==f||e[12]!==h||e[13]!==m?(v=T.jsxs(T.Fragment,{children:[h,f,m]}),e[11]=f,e[12]=h,e[13]=m,e[14]=v):v=e[14],v};function W4(t){return t.type}function e3(t){return t.message.parts.map(W4)}function t3(t){return t.type==="tool-call"?t.toolCallId:void 0}function n3(t){return t.message.parts.map(t3)}function r3(t){return t.part}function i3(t){return t.message.status??q4}function s3(t){return t.part}function a3(t){return t.part.type==="tool-call"?m1(t.tools,t.part):null}function o3(t){return t.part}function l3(t){return t.part.type==="data"?lh(t.dataRenderers,t.part.name,void 0)??null:null}function u3(t){return t.part.type}function c3(t){return t.message.parts.length}function d3(t){var e;return(((e=t.message.status)==null?void 0:e.type)??"complete")==="running"}function f3(t){return t.message.parts.length}const h3=Symbol.for("@assistant-ui/groupBy.memoKey"),b1=t=>{const e=t.nextChildIdx++;return t.nodeKey===""?String(e):`${t.nodeKey}.${e}`},x1=(t,e)=>{if(!(e===void 0||t.claimed.has(e)))return t.claimed.add(e),`id:${e}`},p3=(t,e)=>{const n={key:"",nodeKey:"",indices:[],children:[],nextChildIdx:0,claimed:new Set},i=[n],a=()=>{const o=i.pop(),u=i[i.length-1];u.children.push({type:"group",key:o.key,nodeKey:o.nodeKey,idKey:x1(u,e?.[o.indices[0]]),indices:o.indices,children:o.children})};for(let o=0;o<t.length;o++){const u=t[o];let d=0;for(;d<i.length-1&&d<u.length&&i[d+1].key===u[d];)d++;for(;i.length-1>d;)a();for(;i.length-1<u.length;){const h=i[i.length-1];i.push({key:u[i.length-1],nodeKey:b1(h),indices:[],children:[],nextChildIdx:0,claimed:new Set})}const f=i[i.length-1];f.children.push({type:"part",index:o,nodeKey:b1(f),idKey:x1(f,e?.[o])});for(let h=1;h<i.length;h++)i[h].indices.push(o)}for(;i.length>1;)a();return n.children},m3=Object.freeze({type:"complete"}),g3=(t,e,n)=>{if(!n)return!1;switch(t){case"never":return!1;case"always":return!0;case"empty":return e.length===0;case"no-text":{const i=e[e.length-1];return i===void 0||i.type!=="text"&&i.type!=="reasoning"}}},_1=()=>{throw new Error("MessagePrimitive.GroupedParts: rendered `children` under a leaf part. `children` is only meaningful for `group-\u2026` cases \u2014 add a matching case for the part type or return `null` to skip it.")},S1=(t,e,n)=>{var i;if(t.type==="part")return T.jsx(y1,{index:t.index,children:({part:o})=>n({part:o,children:T.jsx(_1,{})})},t.idKey?`part-${t.idKey}`:`part-${t.index}`);const a=((i=e[t.indices.at(-1)])==null?void 0:i.status)??m3;return T.jsx(O.Fragment,{children:n({part:{type:t.key,status:a,indices:t.indices},children:T.jsx(T.Fragment,{children:t.children.map(o=>S1(o,e,n))})})},t.idKey??t.nodeKey)},T1=({groupBy:t,indicator:e="no-text",children:n})=>{const i=ce(ah(u=>u.message.parts)),a=ce(u=>u.tools.toolUIs),o=ce(u=>{var d;return e==="never"?!1:((d=u.message.status)==null?void 0:d.type)==="running"});return T.jsxs(T.Fragment,{children:[Ue(()=>{const u={toolUIs:a};return p3(i.map(d=>t(d,u)??[]),i.map(d=>d.type==="tool-call"?d.toolCallId:void 0))},[i,t[h3]??t,a]).map(u=>S1(u,i,n)),g3(e,i,o)&&n({part:{type:"indicator"},children:T.jsx(_1,{})})]})};T1.displayName="MessagePrimitive.GroupedParts";const v3=t=>{const e=Y(5),{children:n}=t,i=ce(l1);if(!i)return null;let a;e[0]!==n||e[1]!==i?(a=n(i),e[0]=n,e[1]=i,e[2]=a):a=e[2];let o;return e[3]!==a?(o=T.jsx(T.Fragment,{children:a}),e[3]=a,e[4]=o):o=e[4],o}
53,w1=O.memo(v3);w1.displayName="MessagePrimitive.Quote";const C1=(t,e)=>{switch(e.type){case"image":return t?.Image??t?.Attachment;case"document":return t?.Document??t?.Attachment;case"file":return t?.File??t?.Attachment;default:return t?.Attachment}},y3=t=>{const e=Y(5),{components:n}=t,i=ce(b3);if(!i)return null;const a=i;let o;e[0]!==n||e[1]!==a?(o=C1(n,a),e[0]=n,e[1]=a,e[2]=o):o=e[2];const u=o;if(!u)return null;let d;return e[3]!==u?(d=T.jsx(u,{}),e[3]=u,e[4]=d):d=e[4],d},E1=O.memo(t=>{const e=Y(5),{index:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(y3,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(_b,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o},(t,e)=>{var n,i,a,o,u,d,f,h;return t.index===e.index&&((n=t.components)==null?void 0:n.Image)===((i=e.components)==null?void 0:i.Image)&&((a=t.components)==null?void 0:a.Document)===((o=e.components)==null?void 0:o.Document)&&((u=t.components)==null?void 0:u.File)===((d=e.components)==null?void 0:d.File)&&((f=t.components)==null?void 0:f.Attachment)===((h=e.components)==null?void 0:h.Attachment)});E1.displayName="MessagePrimitive.AttachmentByIndex";const A1=({children:t})=>{const e=ce(n=>n.message.role!=="user"?0:(n.message.attachments??[]).length);return Ue(()=>Array.from({length:e},(n,i)=>T.jsx(_b,{index:i,children:T.jsx(Os,{getItemState:a=>a.message().attachment({index:i}).getState(),children:a=>t({get attachment(){return a()}})})},i)),[e,t])},R1=t=>{const e=Y(4),{components:n,children:i}=t;if(n){let o;return e[0]!==n?(o=T.jsx(A1,{children:u=>{const{attachment:d}=u,f=C1(n,d);return f?T.jsx(f,{}):null}}),e[0]=n,e[1]=o):o=e[1],o}let a;return e[2]!==i?(a=T.jsx(A1,{children:i}),e[2]=i,e[3]=a):a=e[3],a};R1.displayName="MessagePrimitive.Attachments";function b3(t){return t.attachment}const M1=(t,e)=>{switch(e.type){case"image":return t?.Image??t?.Attachment;case"document":return t?.Document??t?.Attachment;case"file":return t?.File??t?.Attachment;default:return t?.Attachment}},x3=t=>{const e=Y(5),{components:n}=t,i=ce(_3);if(!i)return null;let a;e[0]!==i||e[1]!==n?(a=M1(n,i),e[0]=i,e[1]=n,e[2]=a):a=e[2];const o=a;if(!o)return null;let u;return e[3]!==o?(u=T.jsx(o,{}),e[3]=o,e[4]=u):u=e[4],u},k1=O.memo(t=>{const e=Y(5),{index:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(x3,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(Sb,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o},(t,e)=>{var n,i,a,o,u,d,f,h;return t.index===e.index&&((n=t.components)==null?void 0:n.Image)===((i=e.components)==null?void 0:i.Image)&&((a=t.components)==null?void 0:a.Document)===((o=e.components)==null?void 0:o.Document)&&((u=t.components)==null?void 0:u.File)===((d=e.components)==null?void 0:d.File)&&((f=t.components)==null?void 0:f.Attachment)===((h=e.components)==null?void 0:h.Attachment)});k1.displayName="ComposerPrimitive.AttachmentByIndex";const I1=({children:t})=>{const e=ce(n=>n.composer.attachments.length);return Ue(()=>Array.from({length:e},(n,i)=>T.jsx(Sb,{index:i,children:T.jsx(Os,{getItemState:a=>a.composer().attachment({index:i}).getState(),children:a=>t({get attachment(){return a()}})})},i)),[e,t])},O1=t=>{const e=Y(4),{components:n,children:i}=t;if(n){let o;return e[0]!==n?(o=T.jsx(I1,{children:u=>{const{attachment:d}=u,f=M1(n,d);return f?T.jsx(f,{}):null}}),e[0]=n,e[1]=o):o=e[1],o}let a;return e[2]!==i?(a=T.jsx(I1,{children:i}),e[2]=i,e[3]=a):a=e[3],a};O1.displayName="ComposerPrimitive.Attachments";function _3(t){return t.attachment}const S3=({children:t})=>{const e=ce(n=>n.composer.queue.length);return Ue(()=>Array.from({length:e},(n,i)=>T.jsx(lk,{index:i,children:T.jsx(Os,{getItemState:a=>a.composer().queueItem({index:i}).getState(),children:a=>t({get queueItem(){return a()}})})},i)),[e,t])},D1=O.memo(S3);D1.displayName="ComposerPrimitive.Queue";const ch=t=>{const{children:e}=t;return ce(T3)?e:null};ch.displayName="MessagePartPrimitive.InProgress";function T3(t){return t.part.status.type==="running"}const N1=t=>{const e=Y(2),{components:n}=t,i=n.Suggestion;let a;return e[0]!==i?(a=T.jsx(i,{}),e[0]=i,e[1]=a):a=e[1],a},z1=O.memo(t=>{const e=Y(5),{index:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(N1,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(wb,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o}
53,(t,e)=>t.index===e.index&&t.components.Suggestion===e.components.Suggestion);z1.displayName="ThreadPrimitive.SuggestionByIndex";const j1=({children:t})=>{const e=ce(n=>n.suggestions.suggestions.length);return Ue(()=>e===0?null:Array.from({length:e},(n,i)=>T.jsx(wb,{index:i,children:T.jsx(Os,{getItemState:a=>a.suggestions().suggestion({index:i}).getState(),children:a=>t({get suggestion(){return a()}})})},i)),[e,t])},B1=t=>{const e=Y(4),{components:n,children:i}=t;if(n){let o;return e[0]!==n?(o=T.jsx(j1,{children:()=>T.jsx(N1,{components:n})}),e[0]=n,e[1]=o):o=e[1],o}let a;return e[2]!==i?(a=T.jsx(j1,{children:i}),e[2]=i,e[3]=a):a=e[3],a};B1.displayName="ThreadPrimitive.Suggestions";const w3=O.memo(B1,(t,e)=>t.children||e.children?t.children===e.children:t.components.Suggestion===e.components.Suggestion),C3=t=>{const e=Y(3);let n;return e[0]!==t.dictation||e[1]!==t.editing?(n=i=>{if(t.editing===!0&&!i.composer.isEditing||t.editing===!1&&i.composer.isEditing)return!1;const a=i.composer.dictation!=null;return!(t.dictation===!0&&!a||t.dictation===!1&&a)},e[0]=t.dictation,e[1]=t.editing,e[2]=n):n=e[2],ce(n)},P1=t=>{const e=Y(3);let n,i;return e[0]!==t?({children:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]),C3(i)?n:null};P1.displayName="ComposerPrimitive.If";const E3=()=>{const t=Y(5),e=_e(),n=ce(A3);let i;t[0]!==e?(i=u=>{e.composer().send(u)},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={send:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function A3(t){return!t.composer.canSend||t.thread.isRunning&&!t.thread.capabilities.queue}const R3=()=>{const t=Y(5),e=_e(),n=ce(M3);let i;t[0]!==e?(i=()=>{e.composer().cancel()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==a||t[3]!==n?(o={cancel:a,disabled:n},t[2]=a,t[3]=n,t[4]=o):o=t[4],o};function M3(t){return!t.composer.canCancel}const k3=()=>{const t=Y(5),e=_e(),n=ce(I3);let i;t[0]!==e?(i=()=>{e.composer().startDictation()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={startDictation:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function I3(t){return t.composer.dictation!=null||!t.thread.capabilities.dictation||!t.composer.isEditing}const O3=()=>{const t=Y(5),e=_e(),n=ce(D3);let i;t[0]!==e?(i=u=>e.composer().addAttachment(u),t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==a||t[3]!==n?(o={addAttachment:a,disabled:n},t[2]=a,t[3]=n,t[4]=o):o=t[4],o};function D3(t){return!t.composer.isEditing}const N3=t=>{const e=Y(12);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{copiedDuration:i,copyToClipboard:a}=n,o=i===void 0?3e3:i,u=_e(),d=ce(j3),f=ce(B3),h=ce(P3),m=ce(L3);let v;e[2]!==u||e[3]!==m||e[4]!==o||e[5]!==a||e[6]!==h?(v=()=>{const S=h?m:u.message().getCopyText();if(!S)return;const _=a??U3;Promise.resolve(_(S)).then(()=>{u.message().setIsCopied(!0),setTimeout(()=>u.message().setIsCopied(!1),o)},H3)},e[2]=u,e[3]=m,e[4]=o,e[5]=a,e[6]=h,e[7]=v):v=e[7];const y=v;let b;return e[8]!==y||e[9]!==d||e[10]!==f?(b={copy:y,disabled:d,isCopied:f},e[8]=y,e[9]=d,e[10]=f,e[11]=b):b=e[11],b};function z3(t){return t.type==="text"&&t.text.length>0}function j3(t){var e;return!((t.message.role!=="assistant"||((e=t.message.status)==null?void 0:e.type)!=="running")&&t.message.parts.some(z3))}function B3(t){return t.message.isCopied}function P3(t){return t.composer.isEditing}function L3(t){return t.composer.text}function U3(){}function H3(){}const q3=()=>{const t=Y(5),e=_e(),n=ce(V3);let i;t[0]!==e?(i=()=>{e.composer().beginEdit()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={edit:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function V3(t){return t.composer.isEditing}const $3=()=>{const t=Y(5),e=_e(),n=ce(F3);let i;t[0]!==e?(i=()=>{e.message().reload()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={reload:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function F3(t){return t.thread.isRunning||t.thread.isDisabled||t.message.role!=="assistant"}const Y3=()=>{const t=Y(5),e=_e(),n=ce(Q3);let i;t[0]!==e?(i=()=>{e.message().submitFeedback({type:"positive"})},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={submit:a,isSubmitted:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o},G3=()=>{const t=Y(5),e=_e(),n=ce(X3);let i;t[0]!==e?(i=()=>{e.message().submitFeedback({type:"negative"})},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={submit:a,isSubmitted:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function Q3(t){var e;return((e=t.message.metadata.submittedFeedback)==null?void 0:e.type)==="positive"}function X3(t){var e;return((e=t.message.metadata.submittedFeedback)==null?void 0:e.type)==="negative"}const K3=()=>{const t=Y(5),e=_e(),n=ce(J3);let i;t[0]!==e?(i=async()=>{e.message().speak()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={speak:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function Z3(t){return t.type==="text"&&t.text.length>0}function J3(t){var e;return!((t.message.role!=="assistant"||((e=t.message.status)==null?void 0:e.type)!=="running")&&t.message.parts.some(Z3))}const W3=()=>{const t=Y(5),e=_e(),n=ce(eI);let i;t[0]!==e?(i=()=>{e.message().stopSpeaking()},t[0]=e,t[1]=i):i=t[1];const a=i;let o;return t[2]!==n||t[3]!==a?(o={stopSpeaking:a,disabled:n},t[2]=n,t[3]=a,t[4]=o):o=t[4],o};function eI(t){return t.message.speech==null}const tI=t=>{const e=Y(8),{prompt:n,send:i,clearComposer:a}=t,o=a===void 0?!0:a,u=_e(),d=ce(nI),f=i??!1;let h;e[0]!==u||e[1]!==o||e[2]!==n||e[3]!==f?(h=()=>{const y=u.thread().getState().isRunning;if(f&&!y)u.thread().append({content:[{type:"text",text:n}],runConfig:u.composer().getState().runConfig}),o&&u.composer().setText("");else if(o)u.composer().setText(n);else{const b=u.composer().getState().text;u.composer().setText(b.trim()?`${b} ${n}`:n)}},e[0]=u,e[1]=o,e[2]=n,e[3]=f,e[4]=h):h=e[4];const m=h;let v;return e[5]!==d||e[6]!==m?(v={trigger:m,disabled:d},e[5]=d,e[6]=m,e[7]=v):v=e[7],v};function nI(t){return t.thread.isDisabled}const rI=()=>ce(iI);function iI(t){var e;return((e=t.message.status)==null?void 0:e.type)==="incomplete"&&t.message.status.reason==="error"?t.message.status.error??"An error occurred":void 0}const sI=t=>{let e=no;const n=new Map,i=new Set;let a=!1,o=0;const u=()=>{for(const S of i)S()},d=S=>{e=S,b.items=S,u()},f=()=>{if(a||e.length===0)return;const S=e[0],_=n.get(S.id);n.delete(S.id),d(e.slice(1)),_&&(a=!0,t.run(_,{steer:!1}))},h=(S,{steer:_})=>{const w=qn(),C=eo(S);n.set(w,S),d([...e,{id:w,prompt:C}]),_?m(w):f()},m=S=>{if(!n.has(S))return;if(t.cancel&&a){const w=n.get(S);n.delete(S),d(e.filter(C=>C.id!==S)),o++,t.cancel(),a=!0,t.run(w,{steer:!0});return}const _=e.find(w=>w.id===S);_&&(d([_,...e.filter(w=>w.id!==S)]),f())},b={items:e,enqueue:h,steer:m,remove:S=>{n.delete(S)&&d(e.filter(_=>_.id!==S))},clear:()=>{e.length!==0&&(n.clear(),d(no))}};return{adapter:b,notifyBusy:()=>{a=!0},notifyIdle:()=>{if(o>0){o--;return}a=!1,f()},subscribe:S=>(i.add(S),()=>{i.delete(S)})}},dh=(t,e)=>{var n;return((n=t.status)==null?void 0:n.type)!=="requires-action"||t.status.reason!=="tool-calls"||t.content.some(i=>i.type==="tool-call"&&i.result===void 0&&i.approval!==void 0&&i.approval.approved===void 0&&i.approval.resolution===void 0)?!1:e===void 0?t.content.every(i=>i.type!=="tool-call"||!!i.result||i.approval!==void 0):t.content.every(i=>i.type!=="tool-call"||!!i.result||i.approval!==void 0||!e.includes(i.toolName))};
53var fh=class extends Error{constructor(t,e){super(e),U(this,"name","AbortError"),U(this,"detach"),this.detach=t}},aI=class extends zk{constructor(t,e){super(t),U(this,"capabilities",{switchToBranch:!0,switchBranchDuringRun:!0,edit:!0,delete:!1,reload:!0,cancel:!0,unstable_copy:!0,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1}),U(this,"abortController",null),U(this,"_queue",null),U(this,"_queueRunInFlight",!1),U(this,"isDisabled",!1),U(this,"isSendDisabled",!1),U(this,"_isLoading",!1),U(this,"_suggestions",[]),U(this,"_suggestionsController",null),U(this,"_options"),U(this,"_lastRunConfig",{}),U(this,"_getThreadId"),U(this,"_getInitializePromise"),U(this,"_loadPromise"),this.__internal_setOptions(e)}get isLoading(){return this._isLoading}get suggestions(){return this._suggestions}get adapters(){return this._options.adapters}__internal_setGetThreadId(t){this._getThreadId=t}__internal_setGetInitializePromise(t){this._getInitializePromise=t}get extras(){}__internal_setOptions(t){var e,n,i,a,o,u,d;if(this._options===t)return;this._options=t;let f=!1;const h=((e=t.adapters)==null?void 0:e.speech)!==void 0;this.capabilities.speech!==h&&(this.capabilities.speech=h,f=!0);const m=((n=t.adapters)==null?void 0:n.dictation)!==void 0;this.capabilities.dictation!==m&&(this.capabilities.dictation=m,f=!0);const v=((i=t.adapters)==null?void 0:i.voice)!==void 0;this.capabilities.voice!==v&&(this.capabilities.voice=v,f=!0);const y=((a=t.adapters)==null?void 0:a.attachments)!==void 0;this.capabilities.attachments!==y&&(this.capabilities.attachments=y,f=!0);const b=((o=t.adapters)==null?void 0:o.feedback)!==void 0;this.capabilities.feedback!==b&&(this.capabilities.feedback=b,f=!0);const S=((d=(u=t.adapters)==null?void 0:u.history)==null?void 0:d.delete)!==void 0;this.capabilities.delete!==S&&(this.capabilities.delete=S,f=!0);const _=t.unstable_enableMessageQueue===!0;_&&!this._queue?(this._queue=sI({run:w=>{this._queueRunInFlight=!0,this._runAppend(w).finally(()=>{var C;this._queueRunInFlight=!1,(C=this._queue)==null||C.notifyIdle()}).catch(()=>{})}}),this._queue.subscribe(()=>this._notifySubscribers())):!_&&this._queue&&(this._queue.adapter.clear("cancel-run"),this._queue=null),this.capabilities.queue!==_&&(this.capabilities.queue=_,f=!0),f&&this._notifySubscribers()}__internal_load(){var t;if(this._loadPromise)return this._loadPromise;const e=((t=this.adapters.history)==null?void 0:t.load())??Promise.resolve(null);return this._isLoading=!0,this._notifySubscribers(),this._loadPromise=e.then(n=>{var i,a;if(!n)return;this.repository.import(n),n.messages.length>0&&this.ensureInitialized(),this._notifySubscribers();const o=(a=(i=this.adapters.history)==null?void 0:i.resume)==null?void 0:a.bind(this.adapters.history);n.unstable_resume&&o&&this.startRun({parentId:this.repository.headId,sourceId:this.repository.headId,runConfig:this._lastRunConfig},o).catch(()=>{})}).finally(()=>{this._isLoading=!1,this._notifySubscribers()}),this._loadPromise}async append(t){var e;const n=t.parentId===(((e=this.messages.at(-1))==null?void 0:e.id)??null),i=t.startRun??t.role==="user";if(this._queue&&i&&n){this._queue.adapter.enqueue(t,{steer:t.steer??!1});return}return this._queue&&!n&&this._queue.adapter.clear("edit"),this._runAppend(t)}getQueueItems(){var t;return((t=this._queue)==null?void 0:t.adapter.items)??no}steerQueueItem(t){var e;(e=this._queue)==null||e.adapter.steer(t)}removeQueueItem(t){var e;(e=this._queue)==null||e.adapter.remove(t)}async _runAppend(t){var e,n;this.ensureInitialized();const i=(e=this._getInitializePromise)==null?void 0:e.call(this);i&&await i;const a=uu(t,qn(),{type:"complete",reason:"unknown"});this.repository.addOrUpdateMessage(t.parentId,a),(n=this._options.adapters.history)==null||n.append({parentId:t.parentId,message:a,...t.runConfig!==void 0&&{runConfig:t.runConfig}}),t.startRun??t.role==="user"?await this.startRun({parentId:a.id,sourceId:t.sourceId,runConfig:t.runConfig??{}}):(this.repository.resetHead(a.id),this._notifySubscribers())}async deleteMessage(t){var e;const n=this._options.adapters.history;if(!n?.delete)throw new Error("Runtime does not support deleting messages.");const i=this.repository.getMessages(),a=i.findIndex(d=>d.id===t);if(a===-1)throw new Error("Message not found.");const o=i[a],u=[{parentId:((e=i[a-1])==null?void 0:e.id)??null,message:o}];await n.delete(u),this.repository.deleteMessage(t),this._notifySubscribers()}resumeRun({stream:t,...e}){if(!t)throw new Error("You must pass a stream parameter to resume runs.");return this.startRun(e,t)}exportExternalState(){throw new Error("Runtime does not support exporting external states.")}importExternalState(){throw new Error("Runtime does not support importing external states.")}async startRun({parentId:t,runConfig:e},n){this.ensureInitialized();const i={id:qn(),role:"assistant",status:{type:"running"},content:[],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},createdAt:new Date};return this._runLoop(t,i,e,n)}async _runLoop(t,e,n,i){var a,o,u,d;this._notifyEventSubscribers("runStart",{});try{(a=this._queue)==null||a.notifyBusy(),this._suggestions=[],(o=this._suggestionsController)==null||o.abort(),this._suggestionsController=null,this._notifySubscribers();do e=await this.performRoundtrip(t,e,n,i),i=void 0;while(dh(e,this._options.unstable_humanToolNames))}finally{this._notifyEventSubscribers("runEnd",{}),this._queueRunInFlight||queueMicrotask(()=>{var h;
53return(h=this._queue)==null?void 0:h.notifyIdle()})}this._suggestionsController=new AbortController;const f=this._suggestionsController.signal;if(this.adapters.suggestion&&((u=e.status)==null?void 0:u.type)!=="requires-action"){const h=(d=this.adapters.suggestion)==null?void 0:d.generate({messages:this.messages});if(Symbol.asyncIterator in h)for await(const m of h){if(f.aborted)break;this._suggestions=m,this._notifySubscribers()}else{const m=await h;if(f.aborted)return;this._suggestions=m,this._notifySubscribers()}}}async performRoundtrip(t,e,n,i){var a,o,u,d,f,h,m,v,y;const b=t?this.repository.getMessages(t):[];(a=this.abortController)==null||a.abort(),this.abortController=new AbortController;const S=e.content,_=(o=e.metadata)==null?void 0:o.unstable_annotations,w=(u=e.metadata)==null?void 0:u.unstable_data,C=(d=e.metadata)==null?void 0:d.steps,A=(f=e.metadata)==null?void 0:f.custom,R=N=>{var I,z,q,X,V;const $=(I=N.metadata)==null?void 0:I.steps,L=$?[...C??[],...$]:void 0,Q=(z=N.metadata)==null?void 0:z.unstable_annotations,ee=(q=N.metadata)==null?void 0:q.unstable_data,J=Q?[..._??[],...Q]:void 0,P=ee?[...w??[],...ee]:void 0;e={...e,...N.content?{content:[...S,...N.content??[]]}:void 0,status:N.status??e.status,...N.metadata?{metadata:{...e.metadata,...N.metadata.unstable_state?{unstable_state:N.metadata.unstable_state}:void 0,...J?{unstable_annotations:J}:void 0,...P?{unstable_data:P}:void 0,...L?{steps:L}:void 0,...(X=N.metadata)!=null&&X.timing?{timing:N.metadata.timing}:void 0,...(V=N.metadata)!=null&&V.custom?{custom:{...A??{},...N.metadata.custom}}:void 0}}:void 0},this.repository.addOrUpdateMessage(t,e),this._notifySubscribers()},D=this._options.maxSteps??2;if((((m=(h=e.metadata)==null?void 0:h.steps)==null?void 0:m.length)??0)>=D)return R({status:{type:"incomplete",reason:"tool-calls"}}),e;R({status:{type:"running"}}),this.repository.resetHead(e.id),this._notifySubscribers();try{this._lastRunConfig=n??{};const{unstable_composerMetadata:N,...I}=this.getModelContext();i=i??this.adapters.chatModel.run.bind(this.adapters.chatModel);const z=this.abortController.signal,q=(v=this._getThreadId)==null?void 0:v.call(this),X=i({messages:b,runConfig:this._lastRunConfig,abortSignal:z,context:I,unstable_assistantMessageId:e.id,unstable_threadId:q,unstable_parentId:t,unstable_getMessage(){return e}});if(Symbol.asyncIterator in X)for await(const V of X){if(z.aborted){R({status:{type:"incomplete",reason:"cancelled"}});break}R(V)}else R(await X);e.status.type==="running"&&R({status:{type:"complete",reason:"unknown"}})}catch(N){if(N instanceof fh)R({status:{type:"incomplete",reason:"cancelled"}});else if(N instanceof Error&&N.name==="AbortError")R({status:{type:"incomplete",reason:"cancelled"}});else throw R({status:{type:"incomplete",reason:"error",error:N instanceof Error?N.message:`[${typeof N}] ${new String(N).toString()}`}}),N}finally{this.abortController=null,(e.status.type==="complete"||e.status.type==="incomplete")&&await((y=this._options.adapters.history)==null?void 0:y.append({parentId:t,message:e,runConfig:this._lastRunConfig}))}return e}detach(){var t,e;(t=this._queue)==null||t.adapter.clear("cancel-run");const n=new fh(!0);(e=this.abortController)==null||e.abort(n),this.abortController=null}cancelRun(){var t,e;(t=this._queue)==null||t.adapter.clear("cancel-run");const n=new fh(!1);(e=this.abortController)==null||e.abort(n),this.abortController=null}addToolResult({messageId:t,toolCallId:e,result:n,isError:i,artifact:a}){const o=this.repository.getMessage(t),{parentId:u}=o;let{message:d}=o;if(d.role!=="assistant")throw new Error("Tried to add tool result to non-assistant message");let f=!1,h=!1;const m=d.content.map(v=>v.type!=="tool-call"||v.toolCallId!==e?v:(h=!0,v.result||(f=!0),{...v,result:n,artifact:a,isError:i}));if(!h)throw new Error("Tried to add tool result to non-existing tool call");d={...d,content:m},this.repository.addOrUpdateMessage(u,d),this._notifySubscribers(),f&&dh(d,this._options.unstable_humanToolNames)&&this._runLoop(u,d,this._lastRunConfig).catch(()=>{})}resumeToolCall(t){throw new Error("Local runtime does not support resuming tool calls. For human-in-the-loop tools, list the tool in unstable_humanToolNames and complete the call with addToolResult.")}respondToToolApproval({approvalId:t,approved:e,optionId:n,reason:i}){var a;let o=this.repository.getMessages().findLast(m=>m.role==="assistant"&&m.content.some(v=>{var y;return v.type==="tool-call"&&((y=v.approval)==null?void 0:y.id)===t}));if(!o)throw new Error("Tried to respond to a non-existing tool approval");if(this.abortController!==null)throw new Error("Tried to respond to a tool approval while a run is in progress");if(((a=o.status)==null?void 0:a.type)!=="requires-action")throw new Error("Tried to respond to a tool approval on a message whose status is not requires-action");const u=o.content.find(m=>{var v;return m.type==="tool-call"&&((v=m.approval)==null?void 0:v.id)===t});if(u?.type!=="tool-call"||!u.approval)throw new Error("Tried to respond to a non-existing tool approval");if(u.approval.resolution!==void 0)throw new Error("Tried to respond to a tool approval that was cancelled or expired");if(u.approval.approved!==void 0)throw new Error("Tried to respond to an already decided tool approval");const d=u.approval,f=o.content.map(m=>{if(m!==u)return m;const v={...d,approved:e,...n!=null&&{optionId:n},...i!=null&&{reason:i}};return e?{...m,approval:v}:{...m,approval:v,result:{error:i||"Tool approval denied"},isError:!0}});o={...o,content:f};const{parentId:h}=this.repository.getMessage(o.id);this.repository.addOrUpdateMessage(h,o),this._notifySubscribers(),this.repository.headId===o.id&&dh(o,this._options.unstable_humanToolNames)&&this._runLoop(h,o,this._lastRunConfig).catch(()=>{})}};const L1=Object.freeze([]),hh="__DEFAULT_ID__",oI=Object.freeze({[hh]:{id:hh,remoteId:void 0,externalId:void 0,status:"regular",title:void 0}});var lI=class extends Wa{constructor(t){super(),U(this,"_mainThread"),this._mainThread=t()}get isLoading(){return!1}getMainThreadRuntimeCore(){return this._mainThread}get newThreadId(){}get threadIds(){return L1}get archivedThreadIds(){return L1}get mainThreadId(){return hh}get threadItems(){return oI}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getLoadThreadsPromise(){return Promise.resolve()}getItemById(t){if(t===this.mainThreadId)return{status:"regular",id:this.mainThreadId,remoteId:this.mainThreadId,externalId:void 0,title:void 0,isMain:!0};throw new Error("Method not implemented")}async switchToThread(){throw new Error("Method not implemented.")}switchToNewThread(){throw new Error("Method not implemented.")}rename(){throw new Error("Method not implemented.")}archive(){throw new Error("Method not implemented.")}detach(){throw new Error("Method not implemented.")}unarchive(){throw new Error("Method not implemented.")}delete(){throw new Error("Method not implemented.")}initialize(t){return Promise.resolve({remoteId:t,externalId:void 0})}generateTitle(){throw new Error("Method not implemented.")}},uI=class extends Kf{constructor(t,e){super(),U(this,"threads"),U(this,"Provider"),U(this,"_options"),this._options=t,this.threads=new lI(()=>new aI(this._contextProvider,this._options)),e&&this.threads.getMainThreadRuntimeCore().import(Bb.fromArray(e))}};const cI=(t,{initialMessages:e,...n})=>{const{modelContext:i,...a}=wk()??{},o={...n,adapters:{...a,...n.adapters,chatModel:t}},[u]=it(()=>new uI(o,e)),d=Ce(void 0);return d.current=ce(f=>f.threadListItem.remoteId),ye(()=>{u.threads.getMainThreadRuntimeCore().__internal_setGetThreadId(()=>d.current)},[u]),ye(()=>()=>{u.threads.getMainThreadRuntimeCore().detach()},[u]),ye(()=>{u.threads.getMainThreadRuntimeCore().__internal_setOptions(o),u.threads.getMainThreadRuntimeCore().__internal_load()}),ye(()=>{if(i)return u.registerModelContextProvider(i)},[i,u]),Ue(()=>new Xf(u),[u])},dI=t=>{const{cloud:e,initialMessages:n,maxSteps:i,adapters:a,unstable_humanToolNames:o,unstable_enableMessageQueue:u,...d}=t;return{localRuntimeOptions:{cloud:e,initialMessages:n,maxSteps:i,adapters:a,unstable_humanToolNames:o,unstable_enableMessageQueue:u},otherOptions:d}},fI=(t,{cloud:e,...n}={})=>Vk({runtimeHook:function(){return cI(t,n)},adapter:x4({cloud:e}),allowNesting:!0}),hI=/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu,U1={serialize(t){const e=t.id!==t.label?`{name=${t.id}}`:"";return`:${t.type}[${t.label}]${e}`},parse(t){const e=[];let n=0;for(const i of t.matchAll(hI)){i.index>n&&e.push({kind:"text",text:t.slice(n,i.index)});const a=i[2];e.push({kind:"mention",type:i[1],label:a,id:i[3]??a}),n=i.index+i[0].length}return n<t.length&&e.push({kind:"text",text:t.slice(n)}),e}};function pI(t,e){function n(i){const a=_n(t);if(!i?.optional&&!a)throw new Error(`This component must be used within ${e}.`);return a}return n}function H1(t,e){function n(a){const o=t(a);return o?o[e]:null}function i(a){let o=!1,u;typeof a=="function"?u=a:a&&typeof a=="object"&&(o=!!a.optional,u=a.selector);const d=n({optional:o});return d?u?d(u):d():null}return{[e]:i,[`${e}Store`]:n}}const q1=xn(null),{useThreadViewport:Oi,useThreadViewportStore:Di}=H1(pI(q1,"ThreadPrimitive.Viewport"),"useThreadViewport"),V1=t=>{const e=new Map,n=()=>{let i=0;for(const a of e.values())i+=a;t(i)};return{register:()=>{const i=Symbol();return e.set(i,0),{setHeight:a=>{e.get(i)!==a&&(e.set(i,a),n())},unregister:()=>{e.delete(i),n()}}}}},mI=(t={})=>{const e=new Set,n=V1(u=>{o.setState({height:{...o.getState().height,viewport:u}})}),i=V1(u=>{o.setState({height:{...o.getState().height,inset:u}})}),a=(u,d)=>(o.setState({element:{...o.getState().element,[u]:d}}),()=>
53{o.getState().element[u]===d&&o.setState({element:{...o.getState().element,[u]:null}})}),o=Ds(()=>{var u,d;return{isAtBottom:!0,scrollToBottom:({behavior:f="auto"}={})=>{for(const h of e)h({behavior:f})},onScrollToBottom:f=>(e.add(f),()=>{e.delete(f)}),turnAnchor:t.turnAnchor??"bottom",topAnchorMessageClamp:{tallerThan:((u=t.topAnchorMessageClamp)==null?void 0:u.tallerThan)??"10em",visibleHeight:((d=t.topAnchorMessageClamp)==null?void 0:d.visibleHeight)??"6em"},height:{viewport:0,inset:0},element:{viewport:null,anchor:null,target:null},targetConfig:null,topAnchorTurn:null,registerViewport:n.register,registerContentInset:i.register,registerViewportElement:f=>a("viewport",f),registerAnchorElement:f=>a("anchor",f),registerAnchorTargetElement:(f,h)=>(o.setState({element:{...o.getState().element,target:f},targetConfig:f&&h?h:null}),()=>{o.getState().element.target===f&&o.setState({element:{...o.getState().element,target:null},targetConfig:null})}),setTopAnchorTurn:f=>{o.setState({topAnchorTurn:f})}}});return o},pu=t=>t,gI=t=>{const e=Y(11);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={optional:!0},e[0]=n):n=e[0];const i=Di(n);let a;e[1]!==t?(a=()=>mI(t),e[1]=t,e[2]=a):a=e[2];const[o]=it(a);let u,d;e[3]!==i||e[4]!==o?(u=()=>i?.getState().onScrollToBottom(()=>{o.getState().scrollToBottom()}),d=[i,o],e[3]=i,e[4]=o,e[5]=u,e[6]=d):(u=e[5],d=e[6]),ye(u,d);let f,h;return e[7]!==i||e[8]!==o?(f=()=>{if(i)return o.subscribe(m=>{i.getState().isAtBottom!==m.isAtBottom&&pu(i).setState({isAtBottom:m.isAtBottom})})},h=[o,i],e[7]=i,e[8]=o,e[9]=f,e[10]=h):(f=e[9],h=e[10]),ye(f,h),o},ph=t=>{const e=Y(7),{children:n,options:i}=t;let a;e[0]!==i?(a=i===void 0?{}:i,e[0]=i,e[1]=a):a=e[1];const o=gI(a);let u;e[2]!==o?(u=()=>({useThreadViewport:o}),e[2]=o,e[3]=u):u=e[3];const[d]=it(u);let f;return e[4]!==n||e[5]!==d?(f=T.jsx(q1.Provider,{value:d,children:n}),e[4]=n,e[5]=d,e[6]=f):f=e[6],f},vI=()=>{const t=Y(3),e=_e();let n,i;return t[0]!==e?(n=()=>{},i=[e],t[0]=e,t[1]=n,t[2]=i):(n=t[1],i=t[2]),ye(n,i),null},yI=t=>{const e=Y(7),{children:n,aui:i,runtime:a}=t,o=i??null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=T.jsx(vI,{}),e[0]=u):u=e[0];let d;e[1]!==n?(d=T.jsx(ph,{children:n}),e[1]=n,e[2]=d):d=e[2];let f;return e[3]!==a||e[4]!==o||e[5]!==d?(f=T.jsxs(iM,{runtime:a,aui:o,children:[u,d]}),e[3]=a,e[4]=o,e[5]=d,e[6]=f):f=e[6],f},bI=O.memo(yI);function xI(t){const e=Y(2),n=_e();let i;e[0]!==n?(i=()=>{var o,u;return n.message.source?((u=(o=n.message()).__internal_getRuntime)==null?void 0:u.call(o))??null:null},e[0]=n,e[1]=i):i=e[1];const a=ce(i);if(!a&&!t?.optional)throw new Error("MessageRuntime is not available");return a}function $1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function _I(...t){return e=>{let n=!1;const i=t.map(a=>{const o=$1(a,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<i.length;a++){const o=i[a];typeof o=="function"?o():$1(t[a],null)}}}}function Vt(...t){return O.useCallback(_I(...t),t)}var F1=Object.defineProperty,Ns=(t,e)=>{let n={};for(var i in t)F1(n,i,{get:t[i],enumerable:!0});return F1(n,Symbol.toStringTag,{value:"Module"}),n},mh=e0();function gh(t){const e=O.forwardRef((n,i)=>{let{children:a,...o}=n,u=null,d=!1;const f=[];Y1(a)&&typeof gu=="function"&&(a=gu(a._payload)),O.Children.forEach(a,y=>{var b;if(EI(y)){d=!0;const S=y;let _="child"in S.props?S.props.child:S.props.children;Y1(_)&&typeof gu=="function"&&(_=gu(_._payload)),u=TI(S,_),f.push((b=u?.props)==null?void 0:b.children)}else f.push(y)}),u?u=O.cloneElement(u,void 0,f):!d&&O.Children.count(a)===1&&O.isValidElement(a)&&(u=a);const h=u?CI(u):void 0,m=Vt(i,h);if(!u){if(a||a===0)throw new Error(d?kI(t):MI(t));return a}const v=wI(o,u.props??{});return u.type!==O.Fragment&&(v.ref=i?m:h),O.cloneElement(u,v)});return e.displayName=`${t}.Slot`,e}var mu=gh("Slot"),SI=Symbol.for("radix.slottable"),TI=(t,e)=>{if("child"in t.props){const n=t.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,t.props.children(n.props.children)):null}return O.isValidElement(e)?e:null};function wI(t,e){const n={...e};for(const i in e){const a=t[i],o=e[i];/^on[A-Z]/.test(i)?a&&o?n[i]=(...d)=>{const f=o(...d);return a(...d),f}:a&&(n[i]=a):i==="style"?n[i]={...a,...o}
53:i==="className"&&(n[i]=[a,o].filter(Boolean).join(" "))}return{...t,...n}}function CI(t){var e,n;let i=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}function EI(t){return O.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===SI}var AI=Symbol.for("react.lazy");function Y1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===AI&&"_payload"in t&&RI(t._payload)}function RI(t){return typeof t=="object"&&t!==null&&"then"in t}var MI=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,kI=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,gu=$a[" use ".trim().toString()],II=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vn=II.reduce((t,e)=>{const n=gh(`Primitive.${e}`),i=O.forwardRef((a,o)=>{const{asChild:u,...d}=a,f=u?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(f,{...d,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function OI(t,e){t&&mh.flushSync(()=>t.dispatchEvent(e))}const DI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"];function NI(t){const e=O.forwardRef((n,i)=>{const a=Y(17);let o,u,d,f;a[0]!==n?({render:d,asChild:o,children:u,...f}=n,a[0]=n,a[1]=o,a[2]=u,a[3]=d,a[4]=f):(o=a[1],u=a[2],d=a[3],f=a[4]);const h=t;if(d&&O.isValidElement(d)){const y=u!==void 0?u:d.props.children,b=f;let S;a[5]!==d||a[6]!==y?(S=O.cloneElement(d,void 0,y),a[5]=d,a[6]=y,a[7]=S):S=a[7];let _;return a[8]!==i||a[9]!==b||a[10]!==S?(_=T.jsx(h,{...b,asChild:!0,ref:i,children:S}),a[8]=i,a[9]=b,a[10]=S,a[11]=_):_=a[11],_}const m=f;let v;return a[12]!==o||a[13]!==u||a[14]!==i||a[15]!==m?(v=T.jsx(h,{...m,asChild:o,ref:i,children:u}),a[12]=o,a[13]=u,a[14]=i,a[15]=m,a[16]=v):v=a[16],v});return e.displayName=typeof t=="string"?t:t.displayName??t.name??"Component",e}function zI(t){const e=Vn[t],n=NI(e);return n.displayName=`Primitive.${t}`,n}const st=DI.reduce((t,e)=>(t[e]=zI(e),t),{}),jI=t=>{const e=Y(5),{hideWhenRunning:n,autohide:i,autohideFloat:a,forceVisible:o}=t;let u;return e[0]!==i||e[1]!==a||e[2]!==o||e[3]!==n?(u=d=>{if(n&&d.thread.isRunning)return"hidden";const f=i==="always"||i==="not-last"&&!d.message.isLast,h=o||d.message.isHovering;return f?h?a==="always"||a==="single-branch"&&d.message.branchCount<=1?"floating":"normal":"hidden":"normal"},e[0]=i,e[1]=a,e[2]=o,e[3]=n,e[4]=u):u=e[4],ce(u)},BI=xn(null),G1=O.forwardRef((t,e)=>{const n=Y(18);let i,a,o,u;n[0]!==t?({hideWhenRunning:o,autohide:i,autohideFloat:a,...u}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u):(i=n[1],a=n[2],o=n[3],u=n[4]);const[d,f]=it(0);let h;n[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let A=!1;return f(PI),()=>{A||(A=!0,f(LI))}},n[5]=h):h=n[5];const m=h;let v;n[6]===Symbol.for("react.memo_cache_sentinel")?(v={acquireInteractionLock:m},n[6]=v):v=n[6];const y=v,b=d>0;let S;n[7]!==i||n[8]!==a||n[9]!==o||n[10]!==b?(S={hideWhenRunning:o,autohide:i,autohideFloat:a,forceVisible:b},n[7]=i,n[8]=a,n[9]=o,n[10]=b,n[11]=S):S=n[11];const _=jI(S);if(_==="hidden")return null;let w;n[12]!==_?(w=_==="floating"?{"data-floating":"true"}:null,n[12]=_,n[13]=w):w=n[13];let C;return n[14]!==e||n[15]!==u||n[16]!==w?(C=T.jsx(BI.Provider,{value:y,children:T.jsx(st.div,{...w,...u,ref:e})}),n[14]=e,n[15]=u,n[16]=w,n[17]=C):C=n[17],C});G1.displayName="ActionBarPrimitive.Root";function PI(t){return t+1}function LI(t){return Math.max(0,t-1)}function Pe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(a){if(t?.(a),n===!1||!a.defaultPrevented)return e?.(a)}}const UI=t=>{const e=Y(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{copiedDuration:i}=n,a=i===void 0?3e3:i;let o;e[2]!==a?(o={copiedDuration:a,copyToClipboard:HI},e[2]=a,e[3]=o):o=e[3];const{copy:u,disabled:d}=N3(o);return d?null:u},Q1=O.forwardRef((t,e)=>{const n=Y(20);let i,a,o,u;n[0]!==t?({copiedDuration:i,onClick:o,disabled:a,...u}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u):(i=n[1],a=n[2],o=n[3],u=n[4]);const d=ce(qI);let f;n[5]!==i?(f={copiedDuration:i},n[5]=i,n[6]=f):f=n[6];const h=UI(f);let m;n[7]!==d?(m=d?{"data-copied":"true"}:{},n[7]=d,n[8]=m):m=n[8];const v=a||!h;let y;n[9]!==h?(y=()=>{h?.()},n[9]=h,n[10]=y):y=n[10];let b;n[11]!==o||n[12]!==y?(b=Pe(o,y),n[11]=o,n[12]=y,n[13]=b):b=n[13];let S;return n[14]!==e||n[15]!==u||n[16]!==m||n[17]!==v||n[18]!==b?(S=T.jsx(st.button,{type:"button",...m,...u,ref:e,disabled:v,onClick:b}),n[14]=e,n[15]=u,n[16]=m,n[17]=v,n[18]=b,n[19]=S):S=n[19],S});Q1.displayName="ActionBarPrimitive.Copy";function HI(t){return typeof navigator>"u"||!navigator.clipboard?Promise.reject(new Error("Clipboard API is unavailable")):navigator.clipboard.writeText(t)}
53function qI(t){return t.message.isCopied}const $n=(t,e,n=[])=>{const i=O.forwardRef((a,o)=>{const u=Y(6),d={},f={};Object.keys(a).forEach(_=>{n.includes(_)?d[_]=a[_]:f[_]=a[_]});const h=e(d)??void 0,m=st,v="button",y=f.disabled||!h,b=Pe(f.onClick,h);let S;return u[0]!==o||u[1]!==f||u[2]!==m.button||u[3]!==y||u[4]!==b?(S=T.jsx(m.button,{...f,type:v,ref:o,disabled:y,onClick:b}),u[0]=o,u[1]=f,u[2]=m.button,u[3]=y,u[4]=b,u[5]=S):S=u[5],S});return i.displayName=t,i},VI=()=>{const{disabled:t,reload:e}=$3();return t?null:e},$I=$n("ActionBarPrimitive.Reload",VI),FI=()=>{const{disabled:t,edit:e}=q3();return t?null:e},YI=$n("ActionBarPrimitive.Edit",FI),GI=()=>{const{disabled:t,speak:e}=K3();return t?null:e},QI=$n("ActionBarPrimitive.Speak",GI);function br(t){const e=O.useRef(t);return O.useEffect(()=>{e.current=t}),O.useMemo(()=>((...n)=>{var i;return(i=e.current)==null?void 0:i.call(e,...n)}),[])}function X1(t,e=globalThis?.document){const n=br(t);O.useEffect(()=>{const i=a=>{a.key==="Escape"&&n(a)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}const XI=()=>{const{disabled:t,stopSpeaking:e}=W3();return t?null:e},K1=O.forwardRef((t,e)=>{const n=Y(12),i=XI();let a;n[0]!==i?(a=h=>{i&&(h.preventDefault(),i())},n[0]=i,n[1]=a):a=n[1],X1(a);const o=!i;let u;n[2]!==i?(u=()=>{i?.()},n[2]=i,n[3]=u):u=n[3];let d;n[4]!==t.onClick||n[5]!==u?(d=Pe(t.onClick,u),n[4]=t.onClick,n[5]=u,n[6]=d):d=n[6];let f;return n[7]!==t||n[8]!==e||n[9]!==o||n[10]!==d?(f=T.jsx(st.button,{type:"button",disabled:o,...t,ref:e,onClick:d}),n[7]=t,n[8]=e,n[9]=o,n[10]=d,n[11]=f):f=n[11],f});K1.displayName="ActionBarPrimitive.StopSpeaking";const KI=()=>{const{submit:t}=Y3();return t},Z1=O.forwardRef((t,e)=>{const n=Y(17);let i,a,o;n[0]!==t?({onClick:a,disabled:i,...o}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);const u=ce(ZI),d=KI();let f;n[4]!==u?(f=u?{"data-submitted":"true"}:{},n[4]=u,n[5]=f):f=n[5];const h=i||!d;let m;n[6]!==d?(m=()=>{d?.()},n[6]=d,n[7]=m):m=n[7];let v;n[8]!==a||n[9]!==m?(v=Pe(a,m),n[8]=a,n[9]=m,n[10]=v):v=n[10];let y;return n[11]!==e||n[12]!==o||n[13]!==f||n[14]!==h||n[15]!==v?(y=T.jsx(st.button,{type:"button",...f,...o,ref:e,disabled:h,onClick:v}),n[11]=e,n[12]=o,n[13]=f,n[14]=h,n[15]=v,n[16]=y):y=n[16],y});Z1.displayName="ActionBarPrimitive.FeedbackPositive";function ZI(t){var e;return((e=t.message.metadata.submittedFeedback)==null?void 0:e.type)==="positive"}const JI=()=>{const{submit:t}=G3();return t},J1=O.forwardRef((t,e)=>{const n=Y(17);let i,a,o;n[0]!==t?({onClick:a,disabled:i,...o}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);const u=ce(WI),d=JI();let f;n[4]!==u?(f=u?{"data-submitted":"true"}:{},n[4]=u,n[5]=f):f=n[5];const h=i||!d;let m;n[6]!==d?(m=()=>{d?.()},n[6]=d,n[7]=m):m=n[7];let v;n[8]!==a||n[9]!==m?(v=Pe(a,m),n[8]=a,n[9]=m,n[10]=v):v=n[10];let y;return n[11]!==e||n[12]!==o||n[13]!==f||n[14]!==h||n[15]!==v?(y=T.jsx(st.button,{type:"button",...f,...o,ref:e,disabled:h,onClick:v}),n[11]=e,n[12]=o,n[13]=f,n[14]=h,n[15]=v,n[16]=y):y=n[16],y});J1.displayName="ActionBarPrimitive.FeedbackNegative";function WI(t){var e;return((e=t.message.metadata.submittedFeedback)==null?void 0:e.type)==="negative"}const eO=t=>{const e=Y(6);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{filename:i,onExport:a}=n,o=_e(),u=ce(nO);let d;e[2]!==o||e[3]!==i||e[4]!==a?(d=async()=>{const h=o.message().getCopyText();if(!h)return;if(a){await a(h);return}const m=new Blob([h],{type:"text/markdown"}),v=URL.createObjectURL(m),y=document.createElement("a");y.href=v,y.download=i??`message-${Date.now()}.md`,y.click(),URL.revokeObjectURL(v)},e[2]=o,e[3]=i,e[4]=a,e[5]=d):d=e[5];const f=d;return u?f:null},W1=O.forwardRef((t,e)=>{const n=Y(19);let i,a,o,u,d;n[0]!==t?({filename:a,onExport:u,onClick:o,disabled:i,...d}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=d):(i=n[1],a=n[2],o=n[3],u=n[4],d=n[5]);let f;n[6]!==a||n[7]!==u?(f={filename:a,onExport:u},n[6]=a,n[7]=u,n[8]=f):f=n[8];const h=eO(f),m=i||!h;let v;n[9]!==h?(v=()=>{h?.()},n[9]=h,n[10]=v):v=n[10];let y;n[11]!==o||n[12]!==v?(y=Pe(o,v),n[11]=o,n[12]=v,n[13]=y):y=n[13];let b;return n[14]!==e||n[15]!==d||n[16]!==m||n[17]!==y?(b=T.jsx(st.button,{type:"button",...d,ref:e,disabled:m,onClick:y}
vendor: 5,439 bytes, line 53
53),n[14]=e,n[15]=d,n[16]=m,n[17]=y,n[18]=b):b=n[18],b});W1.displayName="ActionBarPrimitive.ExportMarkdown";function tO(t){return t.type==="text"&&t.text.length>0}function nO(t){var e;return(t.message.role!=="assistant"||((e=t.message.status)==null?void 0:e.type)!=="running")&&t.message.parts.some(tO)}var rO=Ns({Copy:()=>Q1,Edit:()=>YI,ExportMarkdown:()=>W1,FeedbackNegative:()=>J1,FeedbackPositive:()=>Z1,Reload:()=>$I,Root:()=>G1,Speak:()=>QI,StopSpeaking:()=>K1});function ex(t,e=[]){let n=[];function i(o,u){const d=O.createContext(u);d.displayName=o+"Context";const f=n.length;n=[...n,u];const h=v=>{var y;const{scope:b,children:S,..._}=v,w=((y=b?.[t])==null?void 0:y[f])||d,C=O.useMemo(()=>_,Object.values(_));return T.jsx(w.Provider,{value:C,children:S})};h.displayName=o+"Provider";function m(v,y){var b;const S=((b=y?.[t])==null?void 0:b[f])||d,_=O.useContext(S);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${o}\``)}return[h,m]}const a=()=>{const o=n.map(u=>O.createContext(u));return function(d){const f=d?.[t]||o;return O.useMemo(()=>({[`__scope${t}`]:{...d,[t]:f}}),[d,f])}};return a.scopeName=t,[i,iO(a,...e)]}function iO(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const u=i.reduce((d,{useScope:f,scopeName:h})=>{const v=f(o)[`__scope${h}`];return{...d,...v}},{});return O.useMemo(()=>({[`__scope${e.scopeName}`]:u}),[u])}};return n.scopeName=e.scopeName,n}var Fn=globalThis?.document?O.useLayoutEffect:()=>{},tx=$a[" useEffectEvent ".trim().toString()],nx=$a[" useInsertionEffect ".trim().toString()];function sO(t){if(typeof tx=="function")return tx(t);const e=O.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof nx=="function"?nx(()=>{e.current=t}):Fn(()=>{e.current=t}),O.useMemo(()=>((...n)=>{var i;return(i=e.current)==null?void 0:i.call(e,...n)}),[])}var aO=$a[" useInsertionEffect ".trim().toString()]||Fn;function oO({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[a,o,u]=lO({defaultProp:e,onChange:n}),d=t!==void 0,f=d?t:a;{const m=O.useRef(t!==void 0);O.useEffect(()=>{const v=m.current;v!==d&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=d},[d,i])}const h=O.useCallback(m=>{var v;if(d){const y=uO(m)?m(t):m;y!==t&&((v=u.current)==null||v.call(u,y))}else o(m)},[d,t,o,u]);return[f,h]}function lO({defaultProp:t,onChange:e}){const[n,i]=O.useState(t),a=O.useRef(n),o=O.useRef(e);return aO(()=>{o.current=e},[e]),O.useEffect(()=>{var u;a.current!==n&&((u=o.current)==null||u.call(o,n),a.current=n)},[n,a]),[n,i,o]}function uO(t){return typeof t=="function"}function cO(t,e){return O.useReducer((n,i)=>e[n][i]??n,t)}var vh=t=>{const{present:e,children:n}=t,i=dO(e),a=typeof n=="function"?n({present:i.isPresent}):O.Children.only(n),o=fO(i.ref,hO(a));return typeof n=="function"||i.isPresent?O.cloneElement(a,{ref:o}):null};vh.displayName="Presence";function dO(t){const[e,n]=O.useState(),i=O.useRef(null),a=O.useRef(t),o=O.useRef("none"),u=t?"mounted":"unmounted",[d,f]=cO(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const h=vu(i.current);o.current=d==="mounted"?h:"none"},[d]),Fn(()=>{const h=i.current,m=a.current;if(m!==t){const y=o.current,b=vu(h);t?f("MOUNT"):b==="none"||h?.display==="none"?f("UNMOUNT"):f(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,f]),Fn(()=>{if(e){let h;const m=e.ownerDocument.defaultView??window,v=b=>{const _=vu(i.current).includes(CSS.escape(b.animationName));if(b.target===e&&_&&(f("ANIMATION_END"),!a.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",h=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},y=b=>{b.target===e&&(o.current=vu(i.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{m.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:O.useCallback(h=>{i.current=h?getComputedStyle(h):null,n(h)},[])}}function rx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function fO(...t){const e=O.useRef(t);return e.current=t,O.useCallback(n=>{const i=e.current;let a=!1;const o=i.map(u=>{const d=rx(u,n);return!a&&typeof d=="function"&&(a=!0),d});if(a)return()=>{for(let u=0;u<o.length;u++){const d=o[u];typeof d=="function"?d():rx(i[u],null)}}},[])}function vu(t){return t?.animationName||"none"}function hO(t){var e,n;let i=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var pO=$a[" useId ".trim().toString()]||(()=>{}),mO=0;function gO(t){const[e,n]=O.useState(pO());return Fn(()=>{n(i=>i??String(mO++))},[t]),t||(e?`radix-${e}
53`:"")}var vO="DismissableLayer",yh="dismissableLayer.update",yO="dismissableLayer.pointerDownOutside",bO="dismissableLayer.focusOutside",ix,sx=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ax=O.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...h}=t,m=O.useContext(sx),[v,y]=O.useState(null),b=v?.ownerDocument??globalThis?.document,[,S]=O.useState({}),_=Vt(e,y),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),A=w.indexOf(C),R=v?w.indexOf(v):-1,D=m.layersWithOutsidePointerEventsDisabled.size>0,N=R>=A,I=O.useRef(!1),z=SO($=>{const L=$.target;if(!(L instanceof Node))return;const Q=[...m.branches].some(ee=>ee.contains(L));!N||Q||(o?.($),d?.($),$.defaultPrevented||f?.())},{ownerDocument:b,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:m.dismissableSurfaces}),q=TO($=>{if(i&&I.current)return;const L=$.target;[...m.branches].some(ee=>ee.contains(L))||(u?.($),d?.($),$.defaultPrevented||f?.())},b),X=v?R===w.length-1:!1,V=sO($=>{$.key==="Escape"&&(a?.($),!$.defaultPrevented&&f&&($.preventDefault(),f()))});return O.useEffect(()=>{if(X)return b.addEventListener("keydown",V,{capture:!0}),()=>b.removeEventListener("keydown",V,{capture:!0})},[b,X]),O.useEffect(()=>{if(v)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ix=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),ox(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(v),m.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=ix))}},[v,b,n,m]),O.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),ox())},[v,m]),O.useEffect(()=>{const $=()=>S({});return document.addEventListener(yh,$),()=>document.removeEventListener(yh,$)},[]),T.jsx(Vn.div,{...h,ref:_,style:{pointerEvents:D?N?"auto":"none":void 0,...t.style},onFocusCapture:Pe(t.onFocusCapture,q.onFocusCapture),onBlurCapture:Pe(t.onBlurCapture,q.onBlurCapture),onPointerDownCapture:Pe(t.onPointerDownCapture,z.onPointerDownCapture)})});ax.displayName=vO;var xO="DismissableLayerBranch",_O=O.forwardRef((t,e)=>{const n=O.useContext(sx),i=O.useRef(null),a=Vt(e,i);return O.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),T.jsx(Vn.div,{...t,ref:a})});_O.displayName=xO;function SO(t,e){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o}=e,u=br(t),d=O.useRef(!1),f=O.useRef(!1),h=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function v(){f.current=!1,a.current=!1,h.current.clear()}function y(){return Array.from(h.current.values()).some(Boolean)}function b(A){if(!f.current)return;const R=A.target;R instanceof Node&&[...o].some(N=>N.contains(R))||h.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function S(A){f.current&&h.current.set(A.type,!1)}const _=A=>{if(A.target&&!d.current){let R=function(){n.removeEventListener("click",m.current);const N=y();v(),N||lx(yO,u,D,{discrete:!0})};const D={originalEvent:A};f.current=!0,a.current=i&&A.button===0,h.current.clear(),!i||A.button!==0?R():(n.removeEventListener("click",m.current),m.current=R,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),v();d.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of w)n.addEventListener(A,b,!0),n.addEventListener(A,S);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",_)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",_),n.removeEventListener("click",m.current);for(const A of w)n.removeEventListener(A,b,!0),n.removeEventListener(A,S)}},[n,u,i,a,o]),{onPointerDownCapture:()=>d.current=!0}}function TO(t,e=globalThis?.document){const n=br(t),i=O.useRef(!1);return O.useEffect(()=>{const a=o=>{o.target&&!i.current&&lx(bO,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ox(){const t=new CustomEvent(yh);document.dispatchEvent(t)}function lx(t,e,n,{discrete:i}){const a=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&a.addEventListener(t,e,{once:!0}),i?OI(a,o):a.dispatchEvent(o)}var bh="focusScope.autoFocusOnMount",xh="focusScope.autoFocusOnUnmount",ux={bubbles:!1,cancelable:!0},wO="FocusScope",cx=O.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...u}=t,[d,f]=O.useState(null),h=br(a),m=br(o),v=O.useRef(null),y=Vt(e,f),b=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(i){let _=function(R){if(b.paused||!d)return;const D=R.target;d.contains(D)?v.current=D:Jr(v.current,{select:!0})},w=function(R){if(b.paused||!d)return;const D=R.relatedTarget;D!==null&&(d.contains(D)||Jr(v.current,{select:!0}))},C=function(R){if(document.activeElement===document.body)for(const N of R)N.removedNodes.length>0&&Jr(d)};document.addEventListener("focusin",_),document.addEventListener("focusout",w);const A=new MutationObserver(C);return d&&A.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",w),A.disconnect()}}},[i,d,b.paused]),O.useEffect(()=>{if(d){hx.add(b);const _=document.activeElement;if(!d.contains(_)){const C=new CustomEvent(bh,ux);d.addEventListener(bh,h),d.dispatchEvent(C),C.defaultPrevented||(CO(kO(dx(d)),{select:!0}),document.activeElement===_&&Jr(d))}return()=>{d.removeEventListener(bh,h),setTimeout(()=>{const C=new CustomEvent(xh,ux);d.addEventListener(xh,m),d.dispatchEvent(C),C.defaultPrevented||Jr(_??document.body,{select:!0}),d.removeEventListener(xh,m),hx.remove(b)},0)}}},[d,h,m,b]);const S=O.useCallback(_=>{if(!n&&!i||b.paused)return;const w=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,C=document.activeElement;if(w&&C){const A=_.currentTarget,[R,D]=EO(A);R&&D?!_.shiftKey&&C===D?(_.preventDefault(),n&&Jr(R,{select:!0})):_.shiftKey&&C===R&&(_.preventDefault(),n&&Jr(D,{select:!0})):C===A&&_.preventDefault()}},[n,i,b.paused]);return T.jsx(Vn.div,{tabIndex:-1,...u,ref:y,onKeyDown:S})});cx.displayName=wO;function CO(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(Jr(i,{select:e}),document.activeElement!==n)return}function EO(t){const e=dx(t),n=fx(e,t),i=fx(e.reverse(),t);return[n,i]}function dx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const a=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||a?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function fx(t,e){for(const n of t)if(!AO(n,{upTo:e}))return n}function AO(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function RO(t){return t instanceof HTMLInputElement&&"select"in t}function Jr(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&RO(t)&&e&&t.select()}}var hx=MO();function MO(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=px(t,e),t.unshift(e)},remove(e){var n;t=px(t,e),(n=t[0])==null||n.resume()}}}function px(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function kO(t){return t.filter(e=>e.tagName!=="A")}var IO="Portal",mx=O.forwardRef((t,e)=>{var n;const{container:i,...a}=t,[o,u]=O.useState(!1);Fn(()=>u(!0),[]);const d=i||o&&((n=globalThis?.document)==null?void 0:n.body);return d?mh.createPortal(T.jsx(Vn.div,{...a,ref:e}),d):null});mx.displayName=IO;var yu=0,Wr=null;function OO(){O.useEffect(()=>{Wr||(Wr={start:gx(),end:gx()});const{start:t,end:e}=Wr;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yu++,()=>
vendor: 5,946 bytes, lines 53-68
53{yu===1&&(Wr?.start.remove(),Wr?.end.remove(),Wr=null),yu=Math.max(0,yu-1)}},[])}function gx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Yn=function(){return Yn=Object.assign||function(e){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Yn.apply(this,arguments)};function vx(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]]);return n}function DO(t,e,n){if(n||arguments.length===2)for(var i=0,a=e.length,o;i<a;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var bu="right-scroll-bar-position",xu="width-before-scroll-bar",NO="with-scroll-bars-hidden",zO="--removed-body-scroll-bar-size";function _h(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function jO(t,e){var n=O.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var a=n.value;a!==i&&(n.value=i,n.callback(i,a))}}}})[0];return n.callback=e,n.facade}var BO=typeof window<"u"?O.useLayoutEffect:O.useEffect,yx=new WeakMap;function PO(t,e){var n=jO(null,function(i){return t.forEach(function(a){return _h(a,i)})});return BO(function(){var i=yx.get(n);if(i){var a=new Set(i),o=new Set(t),u=n.current;a.forEach(function(d){o.has(d)||_h(d,null)}),o.forEach(function(d){a.has(d)||_h(d,u)})}yx.set(n,t)},[t]),n}function LO(t){return t}function UO(t,e){e===void 0&&(e=LO);var n=[],i=!1,a={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var u=e(o,i);return n.push(u),function(){n=n.filter(function(d){return d!==u})}},assignSyncMedium:function(o){for(i=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(d){return o(d)},filter:function(){return n}}},assignMedium:function(o){i=!0;var u=[];if(n.length){var d=n;n=[],d.forEach(o),u=n}var f=function(){var m=u;u=[],m.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){u.push(m),h()},filter:function(m){return u=u.filter(m),n}}}};return a}function HO(t){t===void 0&&(t={});var e=UO(null);return e.options=Yn({async:!0,ssr:!1},t),e}var bx=function(t){var e=t.sideCar,n=vx(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return O.createElement(i,Yn({},n))};bx.isSideCarExport=!0;function qO(t,e){return t.useMedium(e),bx}var xx=HO(),Sh=function(){},_u=O.forwardRef(function(t,e){var n=O.useRef(null),i=O.useState({onScrollCapture:Sh,onWheelCapture:Sh,onTouchMoveCapture:Sh}),a=i[0],o=i[1],u=t.forwardProps,d=t.children,f=t.className,h=t.removeScrollBar,m=t.enabled,v=t.shards,y=t.sideCar,b=t.noRelative,S=t.noIsolation,_=t.inert,w=t.allowPinchZoom,C=t.as,A=C===void 0?"div":C,R=t.gapMode,D=vx(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=y,I=PO([n,e]),z=Yn(Yn({},D),a);return O.createElement(O.Fragment,null,m&&O.createElement(N,{sideCar:xx,removeScrollBar:h,shards:v,noRelative:b,noIsolation:S,inert:_,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:R}),u?O.cloneElement(O.Children.only(d),Yn(Yn({},z),{ref:I})):O.createElement(A,Yn({},z,{className:f,ref:I}),d))});_u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_u.classNames={fullWidth:xu,zeroRight:bu};var VO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $O(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=VO();return e&&t.setAttribute("nonce",e),t}function FO(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function YO(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var GO=function(){var t=0,e=null;return{add:function(n){t==0&&(e=$O())&&(FO(e,n),YO(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},QO=function(){var t=GO();return function(e,n){O.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},_x=function(){var t=QO(),e=function(n){var i=n.styles,a=n.dynamic;return t(i,a),null};return e},XO={left:0,top:0,right:0,gap:0},Th=function(t){return parseInt(t||"",10)||0},KO=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Th(n),Th(i),Th(a)]},ZO=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return XO;var e=KO(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},JO=_x(),zs="data-scroll-locked",WO=function(t,e,n,i){var a=t.left,o=t.top,u=t.right,d=t.gap;return n===void 0&&(n="margin"),`
54  .`.concat(NO,` {
55   overflow: hidden `).concat(i,`;
56   padding-right: `).concat(d,"px ").concat(i,`;
57  }
58  body[`).concat(zs,`] {
59    overflow: hidden `).concat(i,`;
60    overscroll-behavior: contain;
61    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
62    padding-left: `.concat(a,`px;
63    padding-top: `).concat(o,`px;
64    padding-right: `).concat(u,`px;
65    margin-left:0;
66    margin-top:0;
67    margin-right: `).concat(d,"px ").concat(i,`;
68    `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(i,";
68")].filter(Boolean).join(""),`
69  }
70  
71  .`).concat(bu,` {
72    right: `).concat(d,"px ").concat(i,`;
73  }
74  
75  .`).concat(xu,` {
76    margin-right: `).concat(d,"px ").concat(i,`;
77  }
78  
79  .`).concat(bu," .").concat(bu,` {
80    right: 0 `).concat(i,`;
81  }
82  
83  .`).concat(xu," .").concat(xu,` {
84    margin-right: 0 `).concat(i,`;
85  }
86  
87  body[`).concat(zs,`] {
88    `).concat(zO,": ").concat(d,`px;
89  }
90`)},Sx=function(){var t=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(t)?t:0},e5=function(){O.useEffect(function(){return document.body.setAttribute(zs,(Sx()+1).toString()),function(){var t=Sx()-1;t<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,t.toString())}},[])},t5=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,a=i===void 0?"margin":i;e5();var o=O.useMemo(function(){return ZO(a)},[a]);return O.createElement(JO,{styles:WO(o,!e,a,n?"":"!important")})},wh=!1;if(typeof window<"u")try{var Su=Object.defineProperty({},"passive",{get:function(){return wh=!0,!0}});window.addEventListener("test",Su,Su),window.removeEventListener("test",Su,Su)}catch{wh=!1}var js=wh?{passive:!1}:!1,n5=function(t){return t.tagName==="TEXTAREA"},Tx=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!n5(t)&&n[e]==="visible")},r5=function(t){return Tx(t,"overflowY")},i5=function(t){return Tx(t,"overflowX")},wx=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var a=Cx(t,i);
vendor: 18,157 bytes, lines 90-93
90if(a){var o=Ex(t,i),u=o[1],d=o[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},s5=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},a5=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},Cx=function(t,e){return t==="v"?r5(e):i5(e)},Ex=function(t,e){return t==="v"?s5(e):a5(e)},o5=function(t,e){return t==="h"&&e==="rtl"?-1:1},l5=function(t,e,n,i,a){var o=o5(t,window.getComputedStyle(e).direction),u=o*i,d=n.target,f=e.contains(d),h=!1,m=u>0,v=0,y=0;do{if(!d)break;var b=Ex(t,d),S=b[0],_=b[1],w=b[2],C=_-w-o*S;(S||C)&&Cx(t,d)&&(v+=C,y+=S);var A=d.parentNode;d=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&d!==document.body||f&&(e.contains(d)||e===d));return(m&&Math.abs(v)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Tu=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ax=function(t){return[t.deltaX,t.deltaY]},Rx=function(t){return t&&"current"in t?t.current:t},u5=function(t,e){return t[0]===e[0]&&t[1]===e[1]},c5=function(t){return`
91  .block-interactivity-`.concat(t,` {pointer-events: none;}
92  .allow-interactivity-`).concat(t,` {pointer-events: all;}
93`)},d5=0,Bs=[];function f5(t){var e=O.useRef([]),n=O.useRef([0,0]),i=O.useRef(),a=O.useState(d5++)[0],o=O.useState(_x)[0],u=O.useRef(t);O.useEffect(function(){u.current=t},[t]),O.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var _=DO([t.lockRef.current],(t.shards||[]).map(Rx),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var d=O.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var C=Tu(_),A=n.current,R="deltaX"in _?_.deltaX:A[0]-C[0],D="deltaY"in _?_.deltaY:A[1]-C[1],N,I=_.target,z=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in _&&z==="h"&&I.type==="range")return!1;var q=window.getSelection(),X=q&&q.anchorNode,V=X?X===I||X.contains(I):!1;if(V)return!1;var $=wx(z,I);if(!$)return!0;if($?N=z:(N=z==="v"?"h":"v",$=wx(z,I)),!$)return!1;if(!i.current&&"changedTouches"in _&&(R||D)&&(i.current=N),!N)return!0;var L=i.current||N;return l5(L,w,_,L==="h"?R:D)},[]),f=O.useCallback(function(_){var w=_;if(!(!Bs.length||Bs[Bs.length-1]!==o)){var C="deltaY"in w?Ax(w):Tu(w),A=e.current.filter(function(N){return N.name===w.type&&(N.target===w.target||w.target===N.shadowParent)&&u5(N.delta,C)})[0];if(A&&A.should){w.cancelable&&w.preventDefault();return}if(!A){var R=(u.current.shards||[]).map(Rx).filter(Boolean).filter(function(N){return N.contains(w.target)}),D=R.length>0?d(w,R[0]):!u.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),h=O.useCallback(function(_,w,C,A){var R={name:_,delta:w,target:C,should:A,shadowParent:h5(C)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(D){return D!==R})},1)},[]),m=O.useCallback(function(_){n.current=Tu(_),i.current=void 0},[]),v=O.useCallback(function(_){h(_.type,Ax(_),_.target,d(_,t.lockRef.current))},[]),y=O.useCallback(function(_){h(_.type,Tu(_),_.target,d(_,t.lockRef.current))},[]);O.useEffect(function(){return Bs.push(o),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",f,js),document.addEventListener("touchmove",f,js),document.addEventListener("touchstart",m,js),function(){Bs=Bs.filter(function(_){return _!==o}),document.removeEventListener("wheel",f,js),document.removeEventListener("touchmove",f,js),document.removeEventListener("touchstart",m,js)}},[]);var b=t.removeScrollBar,S=t.inert;return O.createElement(O.Fragment,null,S?O.createElement(o,{styles:c5(a)}):null,b?O.createElement(t5,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function h5(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const p5=qO(xx,f5);var Mx=O.forwardRef(function(t,e){return O.createElement(_u,Yn({},t,{ref:e,sideCar:p5}))});Mx.classNames=_u.classNames;var m5=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ps=new WeakMap,wu=new WeakMap,Cu={},Ch=0,kx=function(t){return t&&(t.host||kx(t.parentNode))},g5=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=kx(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},v5=function(t,e,n,i){var a=g5(e,Array.isArray(t)?t:[t]);Cu[n]||(Cu[n]=new WeakMap);var o=Cu[n],u=[],d=new Set,f=new Set(a),h=function(v){!v||d.has(v)||(d.add(v),h(v.parentNode))};a.forEach(h);var m=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(y){if(d.has(y))m(y);else try{var b=y.getAttribute(i),S=b!==null&&b!=="false",_=(Ps.get(y)||0)+1,w=(o.get(y)||0)+1;Ps.set(y,_),o.set(y,w),u.push(y),_===1&&S&&wu.set(y,!0),w===1&&y.setAttribute(n,"true"),S||y.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",y,C)}})};return m(e),d.clear(),Ch++,function(){u.forEach(function(v){var y=Ps.get(v)-1,b=o.get(v)-1;Ps.set(v,y),o.set(v,b),y||(wu.has(v)||v.removeAttribute(i),wu.delete(v)),b||v.removeAttribute(n)}),Ch--,Ch||(Ps=new WeakMap,Ps=new WeakMap,wu=new WeakMap,Cu={})}},y5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),a=m5(t);return a?(i.push.apply(i,Array.from(a.querySelectorAll("[aria-live], script"))),v5(i,a,n,"aria-hidden")):function(){return null}};function b5(t){const[e,n]=O.useState(void 0);return Fn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let u,d;if("borderBoxSize"in o){const f=o.borderBoxSize,h=Array.isArray(f)?f[0]:f;u=h.inlineSize,d=h.blockSize}else u=t.offsetWidth,d=t.offsetHeight;n({width:u,height:d})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else n(void 0)},[t]),e}const x5=["top","right","bottom","left"],ei=Math.min,nn=Math.max,Eu=Math.round,Au=Math.floor,Gn=t=>({x:t,y:t}),_5={left:"right",right:"left",bottom:"top",top:"bottom"};function Eh(t,e,n){return nn(t,ei(e,n))}function xr(t,e){return typeof t=="function"?t(e):t}function _r(t){return t.split("-")[0]}function Ls(t){return t.split("-")[1]}function Ah(t){return t==="x"?"y":"x"}function Rh(t){return t==="y"?"height":"width"}function Qn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Mh(t){return Ah(Qn(t))}function S5(t,e,n){n===void 0&&(n=!1);const i=Ls(t),a=Mh(t),o=Rh(a);let u=a==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(u=Ru(u)),[u,Ru(u)]}function T5(t){const e=Ru(t);return[kh(t),e,kh(e)]}function kh(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ix=["left","right"],Ox=["right","left"],w5=["top","bottom"],C5=["bottom","top"];function E5(t,e,n){switch(t){case"top":case"bottom":return n?e?Ox:Ix:e?Ix:Ox;case"left":case"right":return e?w5:C5;default:return[]}}function A5(t,e,n,i){const a=Ls(t);let o=E5(_r(t),n==="start",i);return a&&(o=o.map(u=>u+"-"+a),e&&(o=o.concat(o.map(kh)))),o}function Ru(t){const e=_r(t);return _5[e]+t.slice(e.length)}function R5(t){return{top:0,right:0,bottom:0,left:0,...t}}function Dx(t){return typeof t!="number"?R5(t):{top:t,right:t,bottom:t,left:t}}function Mu(t){const{x:e,y:n,width:i,height:a}=t;return{width:i,height:a,top:n,left:e,right:e+i,bottom:n+a,x:e,y:n}}function Nx(t,e,n){let{reference:i,floating:a}=t;const o=Qn(e),u=Mh(e),d=Rh(u),f=_r(e),h=o==="y",m=i.x+i.width/2-a.width/2,v=i.y+i.height/2-a.height/2,y=i[d]/2-a[d]/2;let b;switch(f){case"top":b={x:m,y:i.y-a.height};break;case"bottom":b={x:m,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:v};break;case"left":b={x:i.x-a.width,y:v};break;default:b={x:i.x,y:i.y}}switch(Ls(e)){case"start":b[u]-=y*(n&&h?-1:1);break;case"end":b[u]+=y*(n&&h?-1:1);break}return b}async function M5(t,e){var n;e===void 0&&(e={});const{x:i,y:a,platform:o,rects:u,elements:d,strategy:f}=t,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:v="floating",altBoundary:y=!1,padding:b=0}=xr(e,t),S=Dx(b),w=d[y?v==="floating"?"reference":"floating":v],C=Mu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(d.floating)),boundary:h,rootBoundary:m,strategy:f})),A=v==="floating"?{x:i,y:a,width:u.floating.width,height:u.floating.height}:u.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d.floating)),D=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},N=Mu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:A,offsetParent:R,strategy:f}):A);return{top:(C.top-N.top+S.top)/D.y,bottom:(N.bottom-C.bottom+S.bottom)/D.y,left:(C.left-N.left+S.left)/D.x,right:(N.right-C.right+S.right)/D.x}}const k5=50,I5=async(t,e,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:o=[],platform:u}=n,d=u.detectOverflow?u:{...u,detectOverflow:M5},f=await(u.isRTL==null?void 0:u.isRTL(e));let h=await u.getElementRects({reference:t,floating:e,strategy:a}),{x:m,y:v}=Nx(h,i,f),y=i,b=0;const S={};for(let _=0;_<o.length;_++){const w=o[_];if(!w)continue;const{name:C,fn:A}=w,{x:R,y:D,data:N,reset:I}=await A({x:m,y:v,initialPlacement:i,placement:y,strategy:a,middlewareData:S,rects:h,platform:d,elements:{reference:t,floating:e}});m=R??m,v=D??v,S[C]={...S[C],...N},I&&b<k5&&(b++,typeof I=="object"&&(I.placement&&(y=I.placement),I.rects&&(h=I.rects===!0?await u.getElementRects({reference:t,floating:e,strategy:a}):I.rects),{x:m,y:v}=Nx(h,y,f)),_=-1)}return{x:m,y:v,placement:y,strategy:a,middlewareData:S}},O5=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:a,rects:o,platform:u,elements:d,middlewareData:f}=e,{element:h,padding:m=0}=xr(t,e)||{};if(h==null)return{};const v=Dx(m),y={x:n,y:i},b=Mh(a),S=Rh(b),_=await u.getDimensions(h),w=b==="y",C=w?"top":"left",A=w?"bottom":"right",R=w?"clientHeight":"clientWidth",D=o.reference[S]+o.reference[b]-y[b]-o.floating[S],N=y[b]-o.reference[b],I=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let z=I?I[R]:0;(!z||!await(u.isElement==null?void 0:u.isElement(I)))&&(z=d.floating[R]||o.floating[S]);const q=D/2-N/2,X=z/2-_[S]/2-1,V=ei(v[C],X),$=ei(v[A],X),L=V,Q=z-_[S]-$,ee=z/2-_[S]/2+q,J=Eh(L,ee,Q),P=!f.arrow&&Ls(a)!=null&&ee!==J&&o.reference[S]/2-(ee<L?V:$)-_[S]/2<0,te=P?ee<L?ee-L:ee-Q:0;return{[b]:y[b]+te,data:{[b]:J,centerOffset:ee-J-te,...P&&{alignmentOffset:te}},reset:P}}}),D5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:a,middlewareData:o,rects:u,initialPlacement:d,platform:f,elements:h}=e,{mainAxis:m=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...w}=xr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=_r(a),A=Qn(d),R=_r(d)===d,D=await(f.isRTL==null?void 0:f.isRTL(h.floating)),N=y||(R||!_?[Ru(d)]:T5(d)),I=S!=="none";!y&&I&&N.push(...A5(d,_,S,D));const z=[d,...N],q=await f.detectOverflow(e,w),X=[];let V=((i=o.flip)==null?void 0:i.overflows)||[];if(m&&X.push(q[C]),v){const ee=S5(a,u,D);X.push(q[ee[0]],q[ee[1]])}if(V=[...V,{placement:a,overflows:X}],!X.every(ee=>ee<=0)){var $,L;const ee=((($=o.flip)==null?void 0:$.index)||0)+1,J=z[ee];if(J&&(!(v==="alignment"?A!==Qn(J):!1)||V.every(G=>Qn(G.placement)===A?G.overflows[0]>0:!0)))return{data:{index:ee,overflows:V},reset:{placement:J}};let P=(L=V.filter(te=>te.overflows[0]<=0).sort((te,G)=>te.overflows[1]-G.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(b){case"bestFit":{var Q;const te=(Q=V.filter(G=>{if(I){const le=Qn(G.placement);return le===A||le==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(le=>le>0).reduce((le,k)=>le+k,0)]).sort((G,le)=>G[1]-le[1])[0])==null?void 0:Q[0];te&&(P=te);break}case"initialPlacement":P=d;break}if(a!==P)return{reset:{placement:P}}}return{}}}};function zx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jx(t){return x5.some(e=>t[e]>=0)}const N5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:a="referenceHidden",...o}=xr(t,e);switch(a){case"referenceHidden":{const u=await i.detectOverflow(e,{...o,elementContext:"reference"}),d=zx(u,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:jx(d)}}}case"escaped":{const u=await i.detectOverflow(e,{...o,altBoundary:!0}),d=zx(u,n.floating);return{data:{escapedOffsets:d,escaped:jx(d)}}}default:return{}}}}},Bx=new Set(["left","top"]);async function z5(t,e){const{placement:n,platform:i,elements:a}=t,o=await(i.isRTL==null?void 0:i.isRTL(a.floating)),u=_r(n),d=Ls(n),f=Qn(n)==="y",h=Bx.has(u)?-1:1,m=o&&f?-1:1,v=xr(e,t);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const j5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:a,y:o,placement:u,middlewareData:d}=e,f=await z5(e,t);return u===((n=d.offset)==null?void 0:n.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:u}}}}},B5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:a,platform:o}=e,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:C=>{let{x:A,y:R}=C;return{x:A,y:R}}},...h}=xr(t,e),m={x:n,y:i},v=await o.detectOverflow(e,h),y=Qn(_r(a)),b=Ah(y);let S=m[b],_=m[y];if(u){const C=b==="y"?"top":"left",A=b==="y"?"bottom":"right",R=S+v[C],D=S-v[A];S=Eh(R,S,D)}if(d){const C=y==="y"?"top":"left",A=y==="y"?"bottom":"right",R=_+v[C],D=_-v[A];_=Eh(R,_,D)}const w=f.fn({...e,[b]:S,[y]:_});return{...w,data:{x:w.x-n,y:w.y-i,enabled:{[b]:u,[y]:d}}}}}},P5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:a,rects:o,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=xr(t,e),m={x:n,y:i},v=Qn(a),y=Ah(v);let b=m[y],S=m[v];const _=xr(d,e),w=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(f){const R=y==="y"?"height":"width",D=o.reference[y]-o.floating[R]+w.mainAxis,N=o.reference[y]+o.reference[R]-w.mainAxis;b<D?b=D:b>N&&(b=N)}if(h){var C,A;const R=y==="y"?"width":"height",D=Bx.has(_r(a)),N=o.reference[v]-o.floating[R]+(D&&((C=u.offset)==null?void 0:C[v])||0)+(D?0:w.crossAxis),I=o.reference[v]+o.reference[R]+(D?0:((A=u.offset)==null?void 0:A[v])||0)-(D?w.crossAxis:0);S<N?S=N:S>I&&(S=I)}return{[y]:b,[v]:S}}}},L5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:a,rects:o,platform:u,elements:d}=e,{apply:f=()=>{},...h}=xr(t,e),m=await u.detectOverflow(e,h),v=_r(a),y=Ls(a),b=Qn(a)==="y",{width:S,height:_}=o.floating;let w,C;v==="top"||v==="bottom"?(w=v,C=y===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(C=v,w=y==="end"?"top":"bottom");const A=_-m.top-m.bottom,R=S-m.left-m.right,D=ei(_-m[w],A),N=ei(S-m[C],R),I=!e.middlewareData.shift;let z=D,q=N;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(q=R),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(z=A),I&&!y){const V=nn(m.left,0),$=nn(m.right,0),L=nn(m.top,0),Q=nn(m.bottom,0);b?q=S-2*(V!==0||$!==0?V+$:nn(m.left,m.right)):z=_-2*(L!==0||Q!==0?L+Q:nn(m.top,m.bottom))}await f({...e,availableWidth:q,availableHeight:z});const X=await u.getDimensions(d.floating);return S!==X.width||_!==X.height?{reset:{rects:!0}}:{}}}};function ku(){return typeof window<"u"}function Us(t){return Px(t)?(t.nodeName||"").toLowerCase():"#document"}function rn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Xn(t){var e;return(e=(Px(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Px(t){return ku()?t instanceof Node||t instanceof rn(t).Node:!1}function Nn(t){return ku()?t instanceof Element||t instanceof rn(t).Element:!1}function Sr(t){return ku()?t instanceof HTMLElement||t instanceof rn(t).HTMLElement:!1}function Lx(t){return!ku()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof rn(t).ShadowRoot}function io(t){const{overflow:e,overflowX:n,overflowY:i,display:a}=zn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&a!=="inline"&&a!=="contents"}function U5(t){return/^(table|td|th)$/.test(Us(t))}function Iu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const H5=/transform|translate|scale|rotate|perspective|filter/,q5=/paint|layout|strict|content/,Ni=t=>!!t&&t!=="none";let Ih;function Oh(t){const e=Nn(t)?zn(t):t;return Ni(e.transform)||Ni(e.translate)||Ni(e.scale)||Ni(e.rotate)||Ni(e.perspective)||!Dh()&&(Ni(e.backdropFilter)||Ni(e.filter))||H5.test(e.willChange||"")||q5.test(e.contain||"")}function V5(t){let e=ti(t);for(;Sr(e)&&!Hs(e);){if(Oh(e))return e;if(Iu(e))return null;e=ti(e)}return null}function Dh(){return Ih==null&&(Ih=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ih}function Hs(t){return/^(html|body|#document)$/.test(Us(t))}function zn(t){return rn(t).getComputedStyle(t)}function Ou(t){return Nn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ti(t){if(Us(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lx(t)&&t.host||Xn(t);return Lx(e)?e.host:e}function Ux(t){const e=ti(t);return Hs(e)?t.ownerDocument?t.ownerDocument.body:t.body:Sr(e)&&io(e)?e:Ux(e)}function so(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=Ux(t),o=a===((i=t.ownerDocument)==null?void 0:i.body),u=rn(a);if(o){const d=Nh(u);
vendor: 6,823 bytes, line 93
93return e.concat(u,u.visualViewport||[],io(a)?a:[],d&&n?so(d):[])}else return e.concat(a,so(a,[],n))}function Nh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Hx(t){const e=zn(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const a=Sr(t),o=a?t.offsetWidth:n,u=a?t.offsetHeight:i,d=Eu(n)!==o||Eu(i)!==u;return d&&(n=o,i=u),{width:n,height:i,$:d}}function zh(t){return Nn(t)?t:t.contextElement}function qs(t){const e=zh(t);if(!Sr(e))return Gn(1);const n=e.getBoundingClientRect(),{width:i,height:a,$:o}=Hx(e);let u=(o?Eu(n.width):n.width)/i,d=(o?Eu(n.height):n.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const $5=Gn(0);function qx(t){const e=rn(t);return!Dh()||!e.visualViewport?$5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function F5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==rn(t)?!1:e}function zi(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),o=zh(t);let u=Gn(1);e&&(i?Nn(i)&&(u=qs(i)):u=qs(t));const d=F5(o,n,i)?qx(o):Gn(0);let f=(a.left+d.x)/u.x,h=(a.top+d.y)/u.y,m=a.width/u.x,v=a.height/u.y;if(o){const y=rn(o),b=i&&Nn(i)?rn(i):i;let S=y,_=Nh(S);for(;_&&i&&b!==S;){const w=qs(_),C=_.getBoundingClientRect(),A=zn(_),R=C.left+(_.clientLeft+parseFloat(A.paddingLeft))*w.x,D=C.top+(_.clientTop+parseFloat(A.paddingTop))*w.y;f*=w.x,h*=w.y,m*=w.x,v*=w.y,f+=R,h+=D,S=rn(_),_=Nh(S)}}return Mu({width:m,height:v,x:f,y:h})}function Du(t,e){const n=Ou(t).scrollLeft;return e?e.left+n:zi(Xn(t)).left+n}function Vx(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Du(t,n),a=n.top+e.scrollTop;return{x:i,y:a}}function Y5(t){let{elements:e,rect:n,offsetParent:i,strategy:a}=t;const o=a==="fixed",u=Xn(i),d=e?Iu(e.floating):!1;if(i===u||d&&o)return n;let f={scrollLeft:0,scrollTop:0},h=Gn(1);const m=Gn(0),v=Sr(i);if((v||!v&&!o)&&((Us(i)!=="body"||io(u))&&(f=Ou(i)),v)){const b=zi(i);h=qs(i),m.x=b.x+i.clientLeft,m.y=b.y+i.clientTop}const y=u&&!v&&!o?Vx(u,f):Gn(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function G5(t){return Array.from(t.getClientRects())}function Q5(t){const e=Xn(t),n=Ou(t),i=t.ownerDocument.body,a=nn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=nn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let u=-n.scrollLeft+Du(t);const d=-n.scrollTop;return zn(i).direction==="rtl"&&(u+=nn(e.clientWidth,i.clientWidth)-a),{width:a,height:o,x:u,y:d}}const $x=25;function X5(t,e){const n=rn(t),i=Xn(t),a=n.visualViewport;let o=i.clientWidth,u=i.clientHeight,d=0,f=0;if(a){o=a.width,u=a.height;const m=Dh();(!m||m&&e==="fixed")&&(d=a.offsetLeft,f=a.offsetTop)}const h=Du(i);if(h<=0){const m=i.ownerDocument,v=m.body,y=getComputedStyle(v),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(i.clientWidth-v.clientWidth-b);S<=$x&&(o-=S)}else h<=$x&&(o+=h);return{width:o,height:u,x:d,y:f}}function K5(t,e){const n=zi(t,!0,e==="fixed"),i=n.top+t.clientTop,a=n.left+t.clientLeft,o=Sr(t)?qs(t):Gn(1),u=t.clientWidth*o.x,d=t.clientHeight*o.y,f=a*o.x,h=i*o.y;return{width:u,height:d,x:f,y:h}}function Fx(t,e,n){let i;if(e==="viewport")i=X5(t,n);else if(e==="document")i=Q5(Xn(t));else if(Nn(e))i=K5(e,n);else{const a=qx(t);i={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Mu(i)}function Yx(t,e){const n=ti(t);return n===e||!Nn(n)||Hs(n)?!1:zn(n).position==="fixed"||Yx(n,e)}function Z5(t,e){const n=e.get(t);if(n)return n;let i=so(t,[],!1).filter(d=>Nn(d)&&Us(d)!=="body"),a=null;const o=zn(t).position==="fixed";let u=o?ti(t):t;for(;Nn(u)&&!Hs(u);){const d=zn(u),f=Oh(u);!f&&d.position==="fixed"&&(a=null),(o?!f&&!a:!f&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||io(u)&&!f&&Yx(t,u))?i=i.filter(m=>m!==u):a=d,u=ti(u)}return e.set(t,i),i}function J5(t){let{element:e,boundary:n,rootBoundary:i,strategy:a}=t;const u=[...n==="clippingAncestors"?Iu(e)?[]:Z5(e,this._c):[].concat(n),i],d=Fx(e,u[0],a);let f=d.top,h=d.right,m=d.bottom,v=d.left;for(let y=1;y<u.length;y++){const b=Fx(e,u[y],a);f=nn(b.top,f),h=ei(b.right,h),m=ei(b.bottom,m),v=nn(b.left,v)}return{width:h-v,height:m-f,x:v,y:f}}function W5(t){const{width:e,height:n}=Hx(t);return{width:e,height:n}}function eD(t,e,n){const i=Sr(e),a=Xn(e),o=n==="fixed",u=zi(t,!0,o,e);let d={scrollLeft:0,scrollTop:0};const f=Gn(0);function h(){f.x=Du(a)}if(i||!i&&!o)if((Us(e)!=="body"||io(a))&&(d=Ou(e)),i){const b=zi(e,!0,o,e);f.x=b.x+e.clientLeft,f.y=b.y+e.clientTop}else a&&h();o&&!i&&a&&h();const m=a&&!i&&!o?Vx(a,d):Gn(0),v=u.left+d.scrollLeft-f.x-m.x,y=u.top+d.scrollTop-f.y-m.y;return{x:v,y,width:u.width,height:u.height}}function jh(t){return zn(t).position==="static"}function Gx(t,e){if(!Sr(t)||zn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Xn(t)===n&&(n=n.ownerDocument.body),n}function Qx(t,e){const n=rn(t);if(Iu(t))return n;if(!Sr(t)){let a=ti(t);for(;a&&!Hs(a);){if(Nn(a)&&!jh(a))return a;a=ti(a)}return n}let i=Gx(t,e);for(;i&&U5(i)&&jh(i);)i=Gx(i,e);return i&&Hs(i)&&jh(i)&&!Oh(i)?n:i||V5(t)||n}const tD=async function(t){const e=this.getOffsetParent||Qx,n=this.getDimensions,i=await n(t.floating);return{reference:eD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function nD(t){return zn(t).direction==="rtl"}const rD={convertOffsetParentRelativeRectToViewportRelativeRect:Y5,getDocumentElement:Xn,getClippingRect:J5,getOffsetParent:Qx,getElementRects:tD,getClientRects:G5,getDimensions:W5,getScale:qs,isElement:Nn,isRTL:nD};function Xx(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function iD(t,e){let n=null,i;const a=Xn(t);function o(){var d;clearTimeout(i),(d=n)==null||d.disconnect(),n=null}function u(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),o();const h=t.getBoundingClientRect(),{left:m,top:v,width:y,height:b}=h;if(d||e(),!y||!b)return;const S=Au(v),_=Au(a.clientWidth-(m+y)),w=Au(a.clientHeight-(v+b)),C=Au(m),R={rootMargin:-S+"px "+-_+"px "+-w+"px "+-C+"px",threshold:nn(0,ei(1,f))||1};let D=!0;function N(I){const z=I[0].intersectionRatio;if(z!==f){if(!D)return u();z?u(!1,z):i=setTimeout(()=>{u(!1,1e-7)},1e3)}z===1&&!Xx(h,t.getBoundingClientRect())&&u(),D=!1}try{n=new IntersectionObserver(N,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,R)}n.observe(t)}return u(!0),o}function sD(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,h=zh(t),m=a||o?[...h?so(h):[],...e?so(e):[]]:[];m.forEach(C=>{a&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const v=h&&d?iD(h,n):null;let y=-1,b=null;
vendor: 4,117 bytes, line 93
93u&&(b=new ResizeObserver(C=>{let[A]=C;A&&A.target===h&&b&&e&&(b.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(e)})),n()}),h&&!f&&b.observe(h),e&&b.observe(e));let S,_=f?zi(t):null;f&&w();function w(){const C=zi(t);_&&!Xx(_,C)&&n(),_=C,S=requestAnimationFrame(w)}return n(),()=>{var C;m.forEach(A=>{a&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),v?.(),(C=b)==null||C.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const aD=j5,oD=B5,lD=D5,uD=L5,cD=N5,Kx=O5,dD=P5,fD=(t,e,n)=>{const i=new Map,a={platform:rD,...n},o={...a.platform,_c:i};return I5(t,e,{...a,platform:o})};var hD=typeof document<"u",pD=function(){},Nu=hD?O.useLayoutEffect:pD;function zu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!zu(t[i],e[i]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,a[i]))return!1;for(i=n;i--!==0;){const o=a[i];if(!(o==="_owner"&&t.$$typeof)&&!zu(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Zx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Jx(t,e){const n=Zx(t);return Math.round(e*n)/n}function Bh(t){const e=O.useRef(t);return Nu(()=>{e.current=t}),e}function mD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:o,floating:u}={},transform:d=!0,whileElementsMounted:f,open:h}=t,[m,v]=O.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[y,b]=O.useState(i);zu(y,i)||b(i);const[S,_]=O.useState(null),[w,C]=O.useState(null),A=O.useCallback(G=>{G!==I.current&&(I.current=G,_(G))},[]),R=O.useCallback(G=>{G!==z.current&&(z.current=G,C(G))},[]),D=o||S,N=u||w,I=O.useRef(null),z=O.useRef(null),q=O.useRef(m),X=f!=null,V=Bh(f),$=Bh(a),L=Bh(h),Q=O.useCallback(()=>{if(!I.current||!z.current)return;const G={placement:e,strategy:n,middleware:y};$.current&&(G.platform=$.current),fD(I.current,z.current,G).then(le=>{const k={...le,isPositioned:L.current!==!1};ee.current&&!zu(q.current,k)&&(q.current=k,mh.flushSync(()=>{v(k)}))})},[y,e,n,$,L]);Nu(()=>{h===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,v(G=>({...G,isPositioned:!1})))},[h]);const ee=O.useRef(!1);Nu(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Nu(()=>{if(D&&(I.current=D),N&&(z.current=N),D&&N){if(V.current)return V.current(D,N,Q);Q()}},[D,N,Q,V,X]);const J=O.useMemo(()=>({reference:I,floating:z,setReference:A,setFloating:R}),[A,R]),P=O.useMemo(()=>({reference:D,floating:N}),[D,N]),te=O.useMemo(()=>{const G={position:n,left:0,top:0};if(!P.floating)return G;const le=Jx(P.floating,m.x),k=Jx(P.floating,m.y);return d?{...G,transform:"translate("+le+"px, "+k+"px)",...Zx(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:le,top:k}},[n,d,P.floating,m.x,m.y]);return O.useMemo(()=>({...m,update:Q,refs:J,elements:P,floatingStyles:te}),[m,Q,J,P,te])}const gD=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:a}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?Kx({element:i.current,padding:a}).fn(n):{}:i?Kx({element:i,padding:a}).fn(n):{}}}},vD=(t,e)=>{const n=aD(t);return{name:n.name,fn:n.fn,options:[t,e]}},yD=(t,e)=>{const n=oD(t);return{name:n.name,fn:n.fn,options:[t,e]}},bD=(t,e)=>({fn:dD(t).fn,options:[t,e]}),xD=(t,e)=>{const n=lD(t);return{name:n.name,fn:n.fn,options:[t,e]}},_D=(t,e)=>{const n=uD(t);return{name:n.name,fn:n.fn,options:[t,e]}},SD=(t,e)=>{const n=cD(t);return{name:n.name,fn:n.fn,options:[t,e]}},TD=(t,e)=>{const n=gD(t);return{name:n.name,fn:n.fn,options:[t,e]}};var wD="Arrow",Wx=O.forwardRef((t,e)=>{const{children:n,width:i=10,height:a=5,...o}=t;return T.jsx(Vn.svg,{...o,ref:e,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});Wx.displayName=wD;
vendor: 9,108 bytes, line 93
93var CD=Wx,Ph="Popper",[e_,t_]=ex(Ph),[ED,n_]=e_(Ph),r_=t=>{const{__scopePopper:e,children:n}=t,[i,a]=O.useState(null),[o,u]=O.useState(void 0);return T.jsx(ED,{scope:e,anchor:i,onAnchorChange:a,placementState:o,setPlacementState:u,children:n})};r_.displayName=Ph;var i_="PopperAnchor",s_=O.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...a}=t,o=n_(i_,n),u=O.useRef(null),d=o.onAnchorChange,f=O.useCallback(S=>{u.current=S,S&&d(S)},[d]),h=Vt(e,f),m=O.useRef(null);O.useEffect(()=>{if(!i)return;const S=m.current;m.current=i.current,S!==m.current&&d(m.current)});const v=o.placementState&&Uh(o.placementState),y=v?.[0],b=v?.[1];return i?null:T.jsx(Vn.div,{"data-radix-popper-side":y,"data-radix-popper-align":b,...a,ref:h})});s_.displayName=i_;var Lh="PopperContent",[AD,RD]=e_(Lh),a_=O.forwardRef((t,e)=>{var n,i,a,o,u,d;const{__scopePopper:f,side:h="bottom",sideOffset:m=0,align:v="center",alignOffset:y=0,arrowPadding:b=0,avoidCollisions:S=!0,collisionBoundary:_=[],collisionPadding:w=0,sticky:C="partial",hideWhenDetached:A=!1,updatePositionStrategy:R="optimized",onPlaced:D,...N}=t,I=n_(Lh,f),[z,q]=O.useState(null),X=Vt(e,q),[V,$]=O.useState(null),L=b5(V),Q=L?.width??0,ee=L?.height??0,J=h+(v!=="center"?"-"+v:""),P=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},te=Array.isArray(_)?_:[_],G=te.length>0,le={padding:P,boundary:te.filter(kD),altBoundary:G},{refs:k,floatingStyles:j,placement:ne,isPositioned:M,middlewareData:de}=mD({strategy:"fixed",placement:J,whileElementsMounted:(...Gt)=>sD(...Gt,{animationFrame:R==="always"}),elements:{reference:I.anchor},middleware:[vD({mainAxis:m+ee,alignmentAxis:y}),S&&yD({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?bD():void 0,...le}),S&&xD({...le}),_D({...le,apply:({elements:Gt,rects:Wn,availableWidth:Tr,availableHeight:Hi})=>{const{width:qi,height:wr}=Wn.reference,En=Gt.floating.style;En.setProperty("--radix-popper-available-width",`${Tr}px`),En.setProperty("--radix-popper-available-height",`${Hi}px`),En.setProperty("--radix-popper-anchor-width",`${qi}px`),En.setProperty("--radix-popper-anchor-height",`${wr}px`)}}),V&&TD({element:V,padding:b}),ID({arrowWidth:Q,arrowHeight:ee}),A&&SD({strategy:"referenceHidden",...le,boundary:G?le.boundary:void 0})]}),me=I.setPlacementState;Fn(()=>(me(ne),()=>{me(void 0)}),[ne,me]);const[ge,Re]=Uh(ne),Ge=br(D);Fn(()=>{M&&Ge?.()},[M,Ge]);const qe=(n=de.arrow)==null?void 0:n.x,Dt=(i=de.arrow)==null?void 0:i.y,Cn=((a=de.arrow)==null?void 0:a.centerOffset)!==0,[ai,Ui]=O.useState();return Fn(()=>{z&&Ui(window.getComputedStyle(z).zIndex)},[z]),T.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:M?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ai,"--radix-popper-transform-origin":[(o=de.transformOrigin)==null?void 0:o.x,(u=de.transformOrigin)==null?void 0:u.y].join(" "),...((d=de.hide)==null?void 0:d.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(AD,{scope:f,placedSide:ge,placedAlign:Re,onArrowChange:$,arrowX:qe,arrowY:Dt,shouldHideArrow:Cn,children:T.jsx(Vn.div,{"data-side":ge,"data-align":Re,...N,ref:X,style:{...N.style,animation:M?void 0:"none"}})})})});a_.displayName=Lh;var o_="PopperArrow",MD={top:"bottom",right:"left",bottom:"top",left:"right"},l_=O.forwardRef(function(e,n){const{__scopePopper:i,...a}=e,o=RD(o_,i),u=MD[o.placedSide];return T.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:T.jsx(CD,{...a,ref:n,style:{...a.style,display:"block"}})})});l_.displayName=o_;function kD(t){return t!==null}var ID=t=>({name:"transformOrigin",options:t,fn(e){var n,i,a;const{placement:o,rects:u,middlewareData:d}=e,h=((n=d.arrow)==null?void 0:n.centerOffset)!==0,m=h?0:t.arrowWidth,v=h?0:t.arrowHeight,[y,b]=Uh(o),S={start:"0%",center:"50%",end:"100%"}[b],_=(((i=d.arrow)==null?void 0:i.x)??0)+m/2,w=(((a=d.arrow)==null?void 0:a.y)??0)+v/2;let C="",A="";return y==="bottom"?(C=h?S:`${_}px`,A=`${-v}px`):y==="top"?(C=h?S:`${_}px`,A=`${u.floating.height+v}px`):y==="right"?(C=`${-v}px`,A=h?S:`${w}px`):y==="left"&&(C=`${u.floating.width+v}px`,A=h?S:`${w}px`),{data:{x:C,y:A}}}});function Uh(t){const[e,n="center"]=t.split("-");return[e,n]}var OD=r_,u_=s_,DD=a_,ND=l_,ju="Popover",[c_,zD]=ex(ju,[t_]),ao=t_(),[jD,ni]=c_(ju),d_=t=>{const{__scopePopover:e,children:n,open:i,defaultOpen:a,onOpenChange:o,modal:u=!1}=t,d=ao(e),f=O.useRef(null),[h,m]=O.useState(!1),[v,y]=oO({prop:i,defaultProp:a??!1,onChange:o,caller:ju});return T.jsx(OD,{...d,children:T.jsx(jD,{scope:e,contentId:gO(),triggerRef:f,open:v,onOpenChange:y,onOpenToggle:O.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:h,onCustomAnchorAdd:O.useCallback(()=>m(!0),[]),onCustomAnchorRemove:O.useCallback(()=>m(!1),[]),modal:u,children:n})})};d_.displayName=ju;var f_="PopoverAnchor",h_=O.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,a=ni(f_,n),o=ao(n),{onCustomAnchorAdd:u,onCustomAnchorRemove:d}=a;return O.useEffect(()=>(u(),()=>d()),[u,d]),T.jsx(u_,{...o,...i,ref:e})});h_.displayName=f_;var p_="PopoverTrigger",m_=O.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,a=ni(p_,n),o=ao(n),u=Vt(e,a.triggerRef),d=T.jsx(Vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":x_(a.open),...i,ref:u,onClick:Pe(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?d:T.jsx(u_,{asChild:!0,...o,children:d})});m_.displayName=p_;var Hh="PopoverPortal",[BD,PD]=c_(Hh,{forceMount:void 0}),g_=t=>{const{__scopePopover:e,forceMount:n,children:i,container:a}=t,o=ni(Hh,e);return T.jsx(BD,{scope:e,forceMount:n,children:T.jsx(vh,{present:n||o.open,children:T.jsx(mx,{asChild:!0,container:a,children:i})})})};g_.displayName=Hh;var Vs="PopoverContent",v_=O.forwardRef((t,e)=>{const n=PD(Vs,t.__scopePopover),{forceMount:i=n.forceMount,...a}=t,o=ni(Vs,t.__scopePopover);return T.jsx(vh,{present:i||o.open,children:o.modal?T.jsx(UD,{...a,ref:e}):T.jsx(HD,{...a,ref:e})})});v_.displayName=Vs;var LD=gh("PopoverContent.RemoveScroll"),UD=O.forwardRef((t,e)=>{const n=ni(Vs,t.__scopePopover),i=O.useRef(null),a=Vt(e,i),o=O.useRef(!1);return O.useEffect(()=>{const u=i.current;if(u)return y5(u)},[]),T.jsx(Mx,{as:LD,allowPinchZoom:!0,children:T.jsx(y_,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(t.onCloseAutoFocus,u=>{var d;u.preventDefault(),o.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Pe(t.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),HD=O.forwardRef((t,e)=>{const n=ni(Vs,t.__scopePopover),i=O.useRef(!1),a=O.useRef(!1);return T.jsx(y_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,d;(u=t.onCloseAutoFocus)==null||u.call(t,o),o.defaultPrevented||(i.current||(d=n.triggerRef.current)==null||d.focus(),o.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const f=o.target;(d=n.triggerRef.current)!=null&&d.contains(f)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),y_=O.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=t,y=ni(Vs,n),b=ao(n);return OO(),T.jsx(cx,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:T.jsx(ax,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:T.jsx(DD,{"data-state":x_(y.open),role:"dialog",id:y.contentId,...b,...v,ref:e,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),b_="PopoverClose",qD=O.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,a=ni(b_,n);return T.jsx(Vn.button,{type:"button",...i,ref:e,onClick:Pe(t.onClick,()=>a.onOpenChange(!1))})});qD.displayName=b_;var VD="PopoverArrow",$D=O.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,a=ao(n);return T.jsx(ND,{...a,...i,ref:e})});$D.displayName=VD;function x_(t){return t?"open":"closed"}var FD=d_,YD=h_,GD=m_,QD=g_,XD=v_;
93const Bu=zD(),KD=t=>{const e=Y(5),{defaultOpen:n,unstable_openOnRunStart:i}=t,a=n===void 0?!1:n,o=i===void 0?!0:i,u=it(a),[,d]=u,f=_e();let h,m;return e[0]!==f||e[1]!==d||e[2]!==o?(h=()=>{if(o)return f.on("thread.runStart",()=>{d(!0)})},m=[o,f,d],e[0]=f,e[1]=d,e[2]=o,e[3]=h,e[4]=m):(h=e[3],m=e[4]),ye(h,m),u},__=t=>{const e=Y(18);let n,i,a,o,u,d;e[0]!==t?({__scopeAssistantModal:n,defaultOpen:i,unstable_openOnRunStart:d,open:o,onOpenChange:a,...u}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=d):(n=e[1],i=e[2],a=e[3],o=e[4],u=e[5],d=e[6]);const f=Bu(n);let h;e[7]!==i||e[8]!==d?(h={defaultOpen:i,unstable_openOnRunStart:d},e[7]=i,e[8]=d,e[9]=h):h=e[9];const[m,v]=KD(h);let y;e[10]!==a||e[11]!==v?(y=w=>{a?.(w),v(w)},e[10]=a,e[11]=v,e[12]=y):y=e[12];const b=y,S=o===void 0?m:o;let _;return e[13]!==b||e[14]!==u||e[15]!==f||e[16]!==S?(_=T.jsx(FD,{...f,open:S,onOpenChange:b,...u}),e[13]=b,e[14]=u,e[15]=f,e[16]=S,e[17]=_):_=e[17],_};__.displayName="AssistantModalPrimitive.Root";const S_=O.forwardRef((t,e)=>{const n=Y(7);let i,a;n[0]!==t?({__scopeAssistantModal:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=Bu(i);let u;return n[3]!==e||n[4]!==a||n[5]!==o?(u=T.jsx(GD,{...o,...a,ref:e}),n[3]=e,n[4]=a,n[5]=o,n[6]=u):u=n[6],u});S_.displayName="AssistantModalPrimitive.Trigger";const T_=O.forwardRef((t,e)=>{const n=Y(22);let i,a,o,u,d,f,h;n[0]!==t?({__scopeAssistantModal:i,side:f,align:a,onInteractOutside:o,dissmissOnInteractOutside:h,portalProps:u,...d}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=d,n[6]=f,n[7]=h):(i=n[1],a=n[2],o=n[3],u=n[4],d=n[5],f=n[6],h=n[7]);const m=h===void 0?!1:h,v=Bu(i),y=f??"top",b=a??"end",S=m?void 0:ZD;let _;n[8]!==o||n[9]!==S?(_=Pe(o,S),n[8]=o,n[9]=S,n[10]=_):_=n[10];let w;n[11]!==e||n[12]!==d||n[13]!==v||n[14]!==y||n[15]!==b||n[16]!==_?(w=T.jsx(XD,{...v,...d,ref:e,side:y,align:b,onInteractOutside:_}),n[11]=e,n[12]=d,n[13]=v,n[14]=y,n[15]=b,n[16]=_,n[17]=w):w=n[17];let C;return n[18]!==u||n[19]!==v||n[20]!==w?(C=T.jsx(QD,{...v,...u,children:w}),n[18]=u,n[19]=v,n[20]=w,n[21]=C):C=n[21],C});T_.displayName="AssistantModalPrimitive.Content";function ZD(t){return t.preventDefault()}const w_=O.forwardRef((t,e)=>{const n=Y(7);let i,a;n[0]!==t?({__scopeAssistantModal:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=Bu(i);let u;return n[3]!==e||n[4]!==a||n[5]!==o?(u=T.jsx(YD,{...o,...a,ref:e}),n[3]=e,n[4]=a,n[5]=o,n[6]=u):u=n[6],u});w_.displayName="AssistantModalPrimitive.Anchor";var Pu=Ns({Anchor:()=>w_,Content:()=>T_,Root:()=>__,Trigger:()=>S_});const JD=t=>{const e=Y(12);let n;return e[0]!==t.assistant||e[1]!==t.copied||e[2]!==t.hasAttachments||e[3]!==t.hasBranches||e[4]!==t.hasContent||e[5]!==t.last||e[6]!==t.lastOrHover||e[7]!==t.speaking||e[8]!==t.submittedFeedback||e[9]!==t.system||e[10]!==t.user?(n=i=>{var a;const{role:o,attachments:u,parts:d,branchCount:f,isLast:h,speech:m,isCopied:v,isHovering:y}=i.message;return!(t.hasBranches===!0&&f<2||t.user&&o!=="user"||t.assistant&&o!=="assistant"||t.system&&o!=="system"||t.lastOrHover===!0&&!y&&!h||t.last!==void 0&&t.last!==h||t.copied===!0&&!v||t.copied===!1&&v||t.speaking===!0&&m==null||t.speaking===!1&&m!=null||t.hasAttachments===!0&&(o!=="user"||!u?.length)||t.hasAttachments===!1&&o==="user"&&u?.length||t.hasContent===!0&&d.length===0||t.hasContent===!1&&d.length>0||t.submittedFeedback!==void 0&&(((a=i.message.metadata.submittedFeedback)==null?void 0:a.type)??null)!==t.submittedFeedback)},e[0]=t.assistant,e[1]=t.copied,e[2]=t.hasAttachments,e[3]=t.hasBranches,e[4]=t.hasContent,e[5]=t.last,e[6]=t.lastOrHover,e[7]=t.speaking,e[8]=t.submittedFeedback,e[9]=t.system,e[10]=t.user,e[11]=n):n=e[11],ce(n)},C_=t=>{const e=Y(3);let n,i;return e[0]!==t?({children:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]),JD(i)?n:null};C_.displayName="MessagePrimitive.If";const E_=xn(null),Lu=()=>_n(E_),WD=t=>{const e=Y(8),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Map,e[0]=i):i=e[0];const a=Ce(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[1]=o):o=e[1];const u=Ce(o);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const w=Array.from(a.current.entries());w.sort(e6),u.current=w.map(t6)},e[2]=d):d=e[2];const f=d;let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=(w,C)=>{const A=C?.priority??0;return a.current.set(w,A),f(),()=>{a.current.delete(w),f()}},e[3]=h):h=e[3];const m=h;let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>u.current,e[4]=v):v=e[4];const y=v;let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b={register:m,getPlugins:y},e[5]=b):b=e[5];const S=b;let _;return e[6]!==n?(_=T.jsx(E_.Provider,{value:S,children:n}),e[6]=n,e[7]=_):_=e[7],_};function e6(t,e){return e[1]-t[1]}function t6(t){const[e]=t;return e}const qh=xn(null),A_=xn(null),Vh=()=>{const t=_n(qh);if(!t)throw new Error("useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot");return t},$h=()=>_n(qh),n6=()=>{const t=_n(A_);if(!t)throw new Error("useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot");return t},r6=()=>{const t=Vh();
93return ks(t.subscribe,t.getTriggers,t.getTriggers)},i6=new Map,R_=()=>()=>{},M_=()=>i6,s6=()=>{const t=$h();return ks(t?t.subscribe:R_,t?t.getTriggers:M_,t?t.getTriggers:M_)},k_=()=>null,a6=()=>{const t=$h();return ks(t?t.subscribeAria:R_,t?t.getActiveAria:k_,t?t.getActiveAria:k_)};function I_(){const t=Y(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Set,t[0]=e):e=t[0];const n=Ce(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{for(const f of n.current)f()},t[1]=i):i=t[1];const a=i;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=f=>(n.current.add(f),()=>{n.current.delete(f)}),t[2]=o):o=t[2];const u=o;let d;return t[3]===Symbol.for("react.memo_cache_sentinel")?(d={notify:a,subscribe:u},t[3]=d):d=t[3],d}const O_=t=>{const e=Y(21),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Map,e[0]=i):i=e[0];const a=Ce(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=new Set,e[1]=o):o=e[1];const u=Ce(o),{notify:d,subscribe:f}=I_();let h;e[2]!==d?(h=Q=>{const{char:ee}=Q;if(a.current.has(ee))return o6;const J=new Map(a.current);J.set(ee,Q),a.current=J,d();for(const P of u.current)P.added(Q);return()=>{const P=new Map(a.current);P.delete(ee),a.current=P,d();for(const te of u.current)te.removed(ee)}},e[2]=d,e[3]=h):h=e[3];const m=h;let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>a.current,e[4]=v):v=e[4];const y=v;let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=Q=>(u.current.add(Q),()=>{u.current.delete(Q)}),e[5]=b):b=e[5];const S=b,_=Ce(null),w=Ce(null),{notify:C,subscribe:A}=I_();let R;e[6]!==C?(R=(Q,ee)=>{if(ee===null){if(w.current!==Q)return;_.current=null,w.current=null,C();return}const J=_.current;w.current===Q&&J!==null&&J.popoverId===ee.popoverId&&J.highlightedItemId===ee.highlightedItemId||(_.current=ee,w.current=Q,C())},e[6]=C,e[7]=R):R=e[7];const D=R;let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=()=>_.current,e[8]=N):N=e[8];const I=N;let z;e[9]!==m||e[10]!==f||e[11]!==A?(z={register:m,getTriggers:y,subscribe:f,subscribeLifecycle:S,getActiveAria:I,subscribeAria:A},e[9]=m,e[10]=f,e[11]=A,e[12]=z):z=e[12];const q=z;let X;e[13]!==D?(X={setActiveAria:D},e[13]=D,e[14]=X):X=e[14];const V=X;let $;e[15]!==V||e[16]!==n?($=T.jsx(A_.Provider,{value:V,children:n}),e[15]=V,e[16]=n,e[17]=$):$=e[17];let L;return e[18]!==$||e[19]!==q?(L=T.jsx(qh.Provider,{value:q,children:$}),e[18]=$,e[19]=q,e[20]=L):L=e[20],L},D_=t=>{const e=Y(4),{children:n}=t;if(Lu()){let a;return e[0]!==n?(a=T.jsx(O_,{children:n}),e[0]=n,e[1]=a):a=e[1],a}let i;return e[2]!==n?(i=T.jsx(WD,{children:T.jsx(O_,{children:n})}),e[2]=n,e[3]=i):i=e[3],i};D_.displayName="ComposerPrimitive.TriggerPopoverRoot";function o6(){}const N_=/\s/u;function l6(t,e,n){const i=t.slice(0,n);for(let a=i.length-1;a>=0;a--){const o=i[a];if(N_.test(o))return null;if(i.startsWith(e,a)){if(a>0&&!N_.test(i[a-1]))continue;return{query:i.slice(a+e.length),offset:a}}}return null}const u6=t=>{const e=Y(7),{text:n,triggerChar:i}=t,[a,o]=it(n.length),u=Math.min(a,n.length);let d;e[0]!==u||e[1]!==n||e[2]!==i?(d=l6(n,i,u),e[0]=u,e[1]=n,e[2]=i,e[3]=d):d=e[3];const f=d,h=f?.query??"";let m;return e[4]!==h||e[5]!==f?(m={trigger:f,query:h,setCursorPosition:o},e[4]=h,e[5]=f,e[6]=m):m=e[6],m},c6=ze(u6);function d6(t){return"type"in t}const f6=t=>{const e=Y(25),{navigableList:n,isSearchMode:i,activeCategoryId:a,query:o,popoverId:u,open:d,selectItem:f,selectCategory:h,goBack:m,close:v}=t,[y,b]=it(0);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{b(0)},e[0]=S):S=e[0];let _;e[1]!==n?(_=[n],e[1]=n,e[2]=_):_=e[2],ye(S,_);let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{b(0)},e[3]=w):w=e[3];let C;e[4]!==a||e[5]!==i?(C=[i,a],e[4]=a,e[5]=i,e[6]=C):C=e[6],ye(w,C);let A;e[7]!==y||e[8]!==n.length?(A=X=>{X<0||X>=n.length||X!==y&&b(X)},e[7]=y,e[8]=n.length,e[9]=A):A=e[9];const R=bn(A);let D;e[10]!==a||e[11]!==v||e[12]!==m||e[13]!==y||e[14]!==n||e[15]!==d||e[16]!==o||e[17]!==h||e[18]!==f?(D=X=>{if(!d)return!1;switch(X.key){case"ArrowDown":return X.preventDefault(),b(V=>{const $=n.length;return $===0?0:V<$-1?V+1:0}),!0;case"ArrowUp":return X.preventDefault(),b(V=>{const $=n.length;return $===0?0:V>0?V-1:$-1}),!0;
93case"Enter":case"Tab":{if(X.shiftKey)return!1;X.preventDefault();const V=n[y];return V&&(d6(V)?f(V):h(V.id)),!0}case"Escape":return X.preventDefault(),v(),!0;case"Backspace":return a&&o===""?(X.preventDefault(),m(),!0):!1;default:return!1}},e[10]=a,e[11]=v,e[12]=m,e[13]=y,e[14]=n,e[15]=d,e[16]=o,e[17]=h,e[18]=f,e[19]=D):D=e[19];const N=bn(D),I=n[y],z=d&&I?`${u}-option-${I.id}`:void 0;let q;return e[20]!==N||e[21]!==R||e[22]!==y||e[23]!==z?(q={highlightedIndex:y,highlightedItemId:z,highlightIndex:R,handleKeyDown:N},e[20]=N,e[21]=R,e[22]=y,e[23]=z,e[24]=q):q=e[24],q},h6=ze(f6);function z_(t,e){var n;return t.id.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)||(((n=t.description)==null?void 0:n.toLowerCase().includes(e))??!1)}const p6=t=>{const e=Y(38),{adapter:n,query:i,open:a}=t,[o,u]=it(null);let d,f;e[0]!==a?(d=()=>{a||u(null)},f=[a],e[0]=a,e[1]=d,e[2]=f):(d=e[1],f=e[2]),ye(d,f);let h;e:{if(!a||!n){let Q;e[3]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[3]=Q):Q=e[3],h=Q;break e}let L;e[4]!==n?(L=n.categories(),e[4]=n,e[5]=L):L=e[5],h=L}const m=h,v=a?o:null;let y;e:{if(!v||!n){let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[6]=Q):Q=e[6],y=Q;break e}let L;e[7]!==n||e[8]!==v?(L=n.categoryItems(v),e[7]=n,e[8]=v,e[9]=L):L=e[9],y=L}const b=y;let S;e:{if(!a||!n||v){S=null;break e}if(!i&&m.length>0){S=null;break e}if(n.search){let Q;e[10]!==n||e[11]!==i?(Q=n.search(i),e[10]=n,e[11]=i,e[12]=Q):Q=e[12],S=Q;break e}let L;if(e[13]!==n||e[14]!==m||e[15]!==i){L=[];const Q=i.toLowerCase();for(const ee of m)for(const J of n.categoryItems(ee.id))z_(J,Q)&&L.push(J);e[13]=n,e[14]=m,e[15]=i,e[16]=L}else L=e[16];S=L}const _=S,w=_!==null;let C;e:{if(w){let Q;e[17]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[17]=Q):Q=e[17],C=Q;break e}if(!i){C=m;break e}let L;if(e[18]!==m||e[19]!==i){const Q=i.toLowerCase();L=m.filter(ee=>ee.label.toLowerCase().includes(Q)),e[18]=m,e[19]=i,e[20]=L}else L=e[20];C=L}const A=C;let R;e:{if(w){let Q;e[21]!==_?(Q=_??[],e[21]=_,e[22]=Q):Q=e[22],R=Q;break e}if(!i){R=b;break e}let L;if(e[23]!==b||e[24]!==i){const Q=i.toLowerCase();L=b.filter(ee=>z_(ee,Q)),e[23]=b,e[24]=i,e[25]=L}else L=e[25];R=L}const D=R;let N;e:{if(w){let L;
93e[26]!==_?(L=_??[],e[26]=_,e[27]=L):L=e[27],N=L;break e}if(v){N=D;break e}N=A}const I=N;let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=L=>{u(L)},e[28]=z):z=e[28];const q=bn(z);let X;e[29]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{u(null)},e[29]=X):X=e[29];const V=bn(X);let $;return e[30]!==v||e[31]!==A||e[32]!==D||e[33]!==V||e[34]!==w||e[35]!==I||e[36]!==q?($={categories:A,items:D,isSearchMode:w,activeCategoryId:v,navigableList:I,selectCategory:q,goBack:V},e[30]=v,e[31]=A,e[32]=D,e[33]=V,e[34]=w,e[35]=I,e[36]=q,e[37]=$):$=e[37],$},m6=ze(p6),g6=t=>{const e=Y(15),{behavior:n,trigger:i,aui:a,triggerChar:o,setCursorPosition:u,onSelected:d}=t,f=Ce(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=w=>(f.current=w,()=>{f.current===w&&(f.current=null)}),e[0]=h):h=e[0];const m=bn(h);let v;e[1]!==a||e[2]!==n||e[3]!==d||e[4]!==i||e[5]!==o?(v=w=>{var C,A;if(!i||!n)return;if((C=f.current)!=null&&C.call(f,w)){d();return}const R=a.composer().getState().text,D=R.slice(0,i.offset),N=R.slice(i.offset+o.length+i.query.length),I=()=>{const z=n.formatter.serialize(w);a.composer().setText(D+z+(N.startsWith(" ")?N:` ${N}`))};n.kind==="directive"?(I(),(A=n.onInserted)==null||A.call(n,w)):(n.removeOnExecute?a.composer().setText(D+(N.startsWith(" ")?N.slice(1):N)):I(),n.onExecute(w)),d()},e[1]=a,e[2]=n,e[3]=d,e[4]=i,e[5]=o,e[6]=v):v=e[6];const y=bn(v);let b;e[7]!==d||e[8]!==u||e[9]!==i?(b=()=>{d(),i&&u(i.offset)},e[7]=d,e[8]=u,e[9]=i,e[10]=b):b=e[10];const S=bn(b);let _;return e[11]!==S||e[12]!==m||e[13]!==y?(_={selectItem:y,close:S,registerSelectItemOverride:m},e[11]=S,e[12]=m,e[13]=y,e[14]=_):_=e[14],_},v6=ze(g6),y6=t=>{const e=Y(46),{adapter:n,text:i,triggerChar:a,behavior:o,aui:u,popoverId:d,isLoading:f}=t;let h;e[0]!==i||e[1]!==a?(h=c6({text:i,triggerChar:a}),e[0]=i,e[1]=a,e[2]=h):h=e[2];const m=qt(h),v=m.trigger!==null&&n!==void 0&&o!==void 0;let y;e[3]!==n||e[4]!==m.query||e[5]!==v?(y=m6({adapter:n,query:m.query,open:v}),e[3]=n,e[4]=m.query,e[5]=v,e[6]=y):y=e[6];const b=qt(y);let S;e[7]!==b?(S=()=>{b.goBack()},e[7]=b,e[8]=S):S=e[8];const _=bn(S);let w;e[9]!==u||e[10]!==o||e[11]!==m.setCursorPosition||e[12]!==m.trigger||e[13]!==_||e[14]!==a?(w=v6({behavior:o,trigger:m.trigger,aui:u,triggerChar:a,setCursorPosition:m.setCursorPosition,onSelected:_}),e[9]=u,e[10]=o,e[11]=m.setCursorPosition,e[12]=m.trigger,e[13]=_,e[14]=a,e[15]=w):w=e[15];const C=qt(w);let A;e[16]!==m.query||e[17]!==b.activeCategoryId||e[18]!==b.goBack||e[19]!==b.isSearchMode||e[20]!==b.navigableList||e[21]!==b.selectCategory||e[22]!==v||e[23]!==d||e[24]!==C.close||e[25]!==C.selectItem?(A=h6({navigableList:b.navigableList,isSearchMode:b.isSearchMode,activeCategoryId:b.activeCategoryId,query:m.query,popoverId:d,open:v,selectItem:C.selectItem,selectCategory:b.selectCategory,goBack:b.goBack,close:C.close}),e[16]=m.query,e[17]=b.activeCategoryId,e[18]=b.goBack,e[19]=b.isSearchMode,e[20]=b.navigableList,e[21]=b.selectCategory,e[22]=v,e[23]=d,e[24]=C.close,e[25]=C.selectItem,e[26]=A):A=e[26];const R=qt(A);let D;return e[27]!==m.query||e[28]!==m.setCursorPosition||e[29]!==f||e[30]!==R.handleKeyDown||e[31]!==R.highlightIndex||e[32]!==R.highlightedIndex||e[33]!==R.highlightedItemId||e[34]!==b.activeCategoryId||e[35]!==b.categories||e[36]!==b.goBack||e[37]!==b.isSearchMode||e[38]!==b.items||e[39]!==b.selectCategory||e[40]!==v||e[41]!==d||e[42]!==C.close||e[43]!==C.registerSelectItemOverride||e[44]!==C.selectItem?(D={open:v,query:m.query,activeCategoryId:b.activeCategoryId,categories:b.categories,items:b.items,highlightedIndex:R.highlightedIndex,isSearchMode:b.isSearchMode,isLoading:f,popoverId:d,highlightedItemId:R.highlightedItemId,selectCategory:b.selectCategory,goBack:b.goBack,selectItem:C.selectItem,close:C.close,highlightIndex:R.highlightIndex,handleKeyDown:R.handleKeyDown,setCursorPosition:m.setCursorPosition,registerSelectItemOverride:C.registerSelectItemOverride},e[27]=m.query,e[28]=m.setCursorPosition,e[29]=f,e[30]=R.handleKeyDown,e[31]=R.highlightIndex,e[32]=R.highlightedIndex,e[33]=R.highlightedItemId,e[34]=b.activeCategoryId,e[35]=b.categories,e[36]=b.goBack,e[37]=b.isSearchMode,e[38]=b.items,e[39]=b.selectCategory,e[40]=v,e[41]=d,e[42]=C.close,e[43]=C.registerSelectItemOverride,e[44]=C.selectItem,e[45]=D):D=e[45],D},b6=ze(y6),Fh=xn(null),$s=()=>{const t=_n(Fh);if(!t)throw new Error("useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover");return t},x6=()=>_n(Fh),j_=xn(null),B_=()=>{const t=_n(j_);if(!t)throw new Error("TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover");return t},P_=O.forwardRef((t,e)=>{const n=Y(61);let i,a,o,u,d,f;n[0]!==t?({char:o,adapter:i,isLoading:f,"aria-label":a,children:u,...d}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=d,n[6]=f):(i=n[1],a=n[2],o=n[3],u=n[4],d=n[5
93],f=n[6]);const h=f===void 0?!1:f,m=_e(),v=ce(_6),y=O.useId(),b=Ce(null),[S,_]=it(null),w=Ce(0);let C;n[7]!==o?(C=me=>(w.current=w.current+1,b.current=me,_(me),()=>{w.current=Math.max(0,w.current-1),b.current===me&&(b.current=null,_(null))}),n[7]=o,n[8]=C):C=n[8];const A=C;let R;n[9]!==A?(R={register:A},n[9]=A,n[10]=R):R=n[10];const D=R,N=S??void 0;let I;n[11]!==i||n[12]!==m||n[13]!==o||n[14]!==h||n[15]!==y||n[16]!==N||n[17]!==v?(I=b6({adapter:i,text:v,triggerChar:o,behavior:N,aui:m,popoverId:y,isLoading:h}),n[11]=i,n[12]=m,n[13]=o,n[14]=h,n[15]=y,n[16]=N,n[17]=v,n[18]=I):I=n[18];const z=qt(I);let q;n[19]!==z?(q=()=>z,n[19]=z,n[20]=q):q=n[20];const X=bn(q),V=Vh();let $;n[21]!==S||n[22]!==o||n[23]!==X||n[24]!==V?($=()=>V.register({char:o,...S?{behavior:S}:{},resource:X()}),n[21]=S,n[22]=o,n[23]=X,n[24]=V,n[25]=$):$=n[25];let L;n[26]!==S||n[27]!==o||n[28]!==V?(L=[V,o,S],n[26]=S,n[27]=o,n[28]=V,n[29]=L):L=n[29],ye($,L);const Q=Lu();let ee;n[30]!==X||n[31]!==Q?(ee=()=>{if(Q)return Q.register(X())},n[30]=X,n[31]=Q,n[32]=ee):ee=n[32];let J;n[33]!==Q?(J=[Q],n[33]=Q,n[34]=J):J=n[34],ye(ee,J);const P=S!==null&&z.open,te=n6();let G,le;n[35]!==te||n[36]!==o||n[37]!==P?(G=()=>{if(P)return()=>{te.setActiveAria(o,null)}},le=[te,o,P],n[35]=te,n[36]=o,n[37]=P,n[38]=G,n[39]=le):(G=n[38],le=n[39]),ye(G,le);let k,j;n[40]!==te||n[41]!==o||n[42]!==P||n[43]!==y||n[44]!==z.highlightedItemId?(k=()=>{P&&te.setActiveAria(o,{popoverId:y,highlightedItemId:z.highlightedItemId})},j=[te,o,y,P,z.highlightedItemId],n[40]=te,n[41]=o,n[42]=P,n[43]=y,n[44]=z.highlightedItemId,n[45]=k,n[46]=j):(k=n[45],j=n[46]),ye(k,j);let ne;n[47]!==a||n[48]!==u||n[49]!==e||n[50]!==P||n[51]!==y||n[52]!==d||n[53]!==z.highlightedItemId?(ne=P?T.jsx(st.div,{role:"listbox",id:y,"aria-label":a??"Suggestions","aria-activedescendant":z.highlightedItemId,"data-state":"open",...d,ref:e,children:u}):u,n[47]=a,n[48]=u,n[49]=e,n[50]=P,n[51]=y,n[52]=d,n[53]=z.highlightedItemId,n[54]=ne):ne=n[54];let M;n[55]!==z||n[56]!==ne?(M=T.jsx(Fh.Provider,{value:z,children:ne}),n[55]=z,n[56]=ne,n[57]=M):M=n[57];let de;return n[58]!==D||n[59]!==M?(de=T.jsx(j_.Provider,{value:D,children:M}),n[58]=D,n[59]=M,n[60]=de):de=n[60],de});P_.displayName="ComposerPrimitive.TriggerPopover";function _6(t){return t.composer.text}const L_=()=>{const t=Y(2),{disabled:e,send:n}=E3();let i;t[0]!==n?(i=()=>n(),t[0]=n,t[1]=i):i=t[1];const a=i;return e?null:a},S6=$n("ComposerPrimitive.Send",L_),U_=O.forwardRef((t,e)=>{const n=Y(12);let i,a;n[0]!==t?({onSubmit:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=L_();let u;n[3]!==o?(u=m=>{m.preventDefault(),o&&o()},n[3]=o,n[4]=u):u=n[4];const d=u;let f;n[5]!==d||n[6]!==i?(f=Pe(i,d),n[5]=d,n[6]=i,n[7]=f):f=n[7];let h;return n[8]!==e||n[9]!==a||n[10]!==f?(h=T.jsx(st.form,{...a,ref:e,onSubmit:f}),n[8]=e,n[9]=a,n[10]=f,n[11]=h):h=n[11],h});U_.displayName="ComposerPrimitive.Root";const H_=t=>{const e=Y(4),n=br(t),i=Oi(T6);let a,o;e[0]!==n||e[1]!==i?(a=()=>i(n),o=[i,n],e[0]=n,e[1]=i,e[2]=a,e[3]=o):(a=e[2],o=e[3]),ye(a,o)};function T6(t){return t.onScrollToBottom}const w6=()=>!1,C6=()=>{},q_=t=>{const e=Y(4);let n;e[0]!==t?(n=o=>{if(typeof window>"u"||t===null||!window.matchMedia)return C6;const u=window.matchMedia(t);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},e[0]=t,e[1]=n):n=e[1];const i=n;let a;return e[2]!==t?(a=()=>typeof window>"u"||t===null||!window.matchMedia?!1:window.matchMedia(t).matches,e[2]=t,e[3]=a):a=e[3],ks(i,a,w6)};function E6(){return ce(A6)}function A6(t){return t.composer.isEditing?t.composer.text:""}function R6(t){return!!ce(M6)||!!t}function M6(t){var e;return t.thread.isDisabled||((e=t.composer.dictation)==null?void 0:e.inputDisabled)}function k6(){const t=Y(4),e=a6();if(!e){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i={},t[0]=i):i=t[0],i}let n;return t[1]!==e.highlightedItemId||t[2]!==e.popoverId?(n={"aria-controls":e.popoverId,"aria-expanded":!0,"aria-haspopup":"listbox","aria-activedescendant":e.highlightedItemId},t[1]=e.highlightedItemId,t[2]=e.popoverId,t[3]=n):n=t[3],n}function Yh(){return Yh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Yh.apply(null,arguments)}function I6(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var O6=O.useLayoutEffect,D6=function(e){var n=bt.useRef(e);return O6(function(){n.current=e}),n},V_=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},N6=function(e,n){var i=bt.useRef();return bt.useCallback(function(a){e.current=a,i.current&&V_(i.current,null),i.current=n,n&&V_(n,a)},[n])},$_={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"}
93,z6=function(e){Object.keys($_).forEach(function(n){e.style.setProperty(n,$_[n],"important")})},F_=z6,Ot=null,Y_=function(e,n){var i=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?i+n.borderSize:i-n.paddingSize};function j6(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=1/0),Ot||(Ot=document.createElement("textarea"),Ot.setAttribute("tabindex","-1"),Ot.setAttribute("aria-hidden","true"),F_(Ot)),Ot.parentNode===null&&document.body.appendChild(Ot);var a=t.paddingSize,o=t.borderSize,u=t.sizingStyle,d=u.boxSizing;Object.keys(u).forEach(function(y){var b=y;Ot.style[b]=u[b]}),F_(Ot),Ot.value=e;var f=Y_(Ot,t);Ot.value=e,f=Y_(Ot,t),Ot.value="x";var h=Ot.scrollHeight-a,m=h*n;d==="border-box"&&(m=m+a+o),f=Math.max(m,f);var v=h*i;return d==="border-box"&&(v=v+a+o),f=Math.min(v,f),[f,h]}var G_=function(){},B6=function(e,n){return e.reduce(function(i,a){return i[a]=n[a],i},{})},P6=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],L6=!!document.documentElement.currentStyle,U6=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var i=B6(P6,n),a=i.boxSizing;if(a==="")return null;L6&&a==="border-box"&&(i.width=parseFloat(i.width)+parseFloat(i.borderRightWidth)+parseFloat(i.borderLeftWidth)+parseFloat(i.paddingRight)+parseFloat(i.paddingLeft)+"px");var o=parseFloat(i.paddingBottom)+parseFloat(i.paddingTop),u=parseFloat(i.borderBottomWidth)+parseFloat(i.borderTopWidth);return{sizingStyle:i,paddingSize:o,borderSize:u}},H6=U6;function Gh(t,e,n){var i=D6(n);O.useLayoutEffect(function(){var a=function(u){return i.current(u)};if(t)return t.addEventListener(e,a),function(){return t.removeEventListener(e,a)}},[])}var q6=function(e,n){Gh(document.body,"reset",function(i){e.current.form===i.target&&n(i)})},V6=function(e){Gh(window,"resize",e)},$6=function(e){Gh(document.fonts,"loadingdone",e)},F6=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Y6=function(e,n){var i=e.cacheMeasurements,a=e.maxRows,o=e.minRows,u=e.onChange,d=u===void 0?G_:u,f=e.onHeightChange,h=f===void 0?G_:f,m=I6(e,F6),v=m.value!==void 0,y=O.useRef(null),b=N6(y,n),S=O.useRef(0),_=O.useRef(),w=function(){var R=y.current,D=i&&_.current?_.current:H6(R);if(D){_.current=D;var N=j6(D,R.value||R.placeholder||"x",o,a),I=N[0],z=N[1];S.current!==I&&(S.current=I,R.style.setProperty("height",I+"px","important"),h(I,{rowHeight:z}))}},C=function(R){v||w(),d(R)};return O.useLayoutEffect(w),q6(y,function(){if(!v){var A=y.current.value;requestAnimationFrame(function(){var R=y.current;R&&A!==R.value&&w()})}}),V6(w),$6(w),O.createElement("textarea",Yh({},m,{onChange:C,ref:b}))},G6=O.forwardRef(Y6);const Q6="(pointer: coarse) and (not (any-pointer: fine))",Q_=O.forwardRef(({autoFocus:t=!1,asChild:e,render:n,disabled:i,onChange:a,onKeyDown:o,onPaste:u,onSelect:d,submitOnEnter:f,submitMode:h,cancelOnEscape:m=!0,unstable_focusOnRunStart:v=!0,unstable_focusOnScrollToBottom:y=!0,unstable_focusOnThreadSwitched:b=!0,unstable_insertNewlineOnTouchEnter:S=!1,addAttachmentOnPaste:_=!0,...w},C)=>{const A=_e(),R=Lu(),D=h??(f===!1?"none":"enter"),N=q_(S?Q6:null),I=S&&N&&D==="enter"?"none":D,z=E6(),q=R6(i),X=Ce(null),V=Vt(C,X),$=Ce(!1);X1(G=>{var le;if(!((le=X.current)!=null&&le.contains(G.target)))return;if(R){for(const j of R.getPlugins())if(j.handleKeyDown(G))return}if(!m)return;const k=A.composer();k.getState().canCancel&&(k.cancel(),G.preventDefault())});const L=G=>{var le,k;if(!q&&!G.nativeEvent.isComposing){if(R){for(const j of R.getPlugins())if(j.handleKeyDown(G))return}if(G.key==="Enter"){const j=A.thread().getState(),ne=j.capabilities.queue;if(G.shiftKey&&(G.ctrlKey||G.metaKey)&&ne&&D!=="none"&&A.composer().getState().canSend){G.preventDefault(),A.composer().send({steer:!0});return}if(G.shiftKey||j.isRunning&&!ne)return;let M=!1;I==="ctrlEnter"?M=G.ctrlKey||G.metaKey:I==="enter"&&(M=!0),M&&(G.preventDefault(),(k=(le=X.current)==null?void 0:le.closest("form"))==null||k.requestSubmit())}}},Q=async G=>{var le;if(!_)return;const k=A.thread().getState().capabilities,j=Array.from(((le=G.clipboardData)==null?void 0:le.files)||[]);if(k.attachments&&j.length>0)try{G.preventDefault(),await Promise.all(j.map(ne=>A.composer().addAttachment(ne)))}catch(ne){console.error("Error adding attachment:",ne)}},ee=t&&!q,J=Zr(()=>{const G=X.current;!G||!ee||(G.focus({preventScroll:!0}),G.setSelectionRange(G.value.length,G.value.length))},[ee]);ye(()=>J(),[J]),H_(()=>{A.composer().getState().type==="thread"&&y&&J()}),ye(()=>{if(!(A.composer().getState().type!=="thread"||!v))return A.on("thread.runStart",J)},[v,J,A]),ye(()=>{if(!(A.composer().getState().type!=="thread"||!b))return A.on("threadListItem.switchedTo",J)},[b,J,A]);const P=k6(),te={name:"input",value:z,...w,...P,ref:V,disabled:q,onCh
93ange:Pe(a,G=>{if(!A.composer().getState().isEditing)return;const le=G.nativeEvent.isComposing===!0;$.current&&!le&&($.current=!1);const k=le||$.current;if(C0(()=>{A.composer().setText(G.target.value)}),k)return;const j=G.target.selectionStart??G.target.value.length;if(R)for(const ne of R.getPlugins())ne.setCursorPosition(j)}),onKeyDown:Pe(o,L),onCompositionStart:Pe(w.onCompositionStart,()=>{$.current=!0}),onCompositionEnd:Pe(w.onCompositionEnd,G=>{if($.current=!1,!A.composer().getState().isEditing)return;const le=G.target;C0(()=>{A.composer().setText(le.value)});const k=le.selectionStart??le.value.length;if(R)for(const j of R.getPlugins())j.setCursorPosition(k)}),onSelect:Pe(d,G=>{if($.current)return;const le=G.target,k=le.selectionStart??le.value.length;if(R)for(const j of R.getPlugins())j.setCursorPosition(k)}),onPaste:Pe(u,Q)};if(n&&O.isValidElement(n)){const G=w.children!==void 0?w.children:n.props.children;return T.jsx(mu,{...te,children:O.cloneElement(n,void 0,G)})}return T.jsx(e?mu:G6,{...te})});Q_.displayName="ComposerPrimitive.Input";const X6=()=>{const{disabled:t,cancel:e}=R3();return t?null:e},K6=$n("ComposerPrimitive.Cancel",X6),Z6=t=>{const e=Y(6);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{multiple:i}=n,a=i===void 0?!0:i,{disabled:o,addAttachment:u}=O3(),d=_e();let f;e[2]!==u||e[3]!==d||e[4]!==a?(f=()=>{const m=document.createElement("input");m.type="file",m.multiple=a,m.hidden=!0;const v=d.composer().getState().attachmentAccept;v!=="*"&&(m.accept=v),document.body.appendChild(m),m.onchange=y=>{const b=y.target.files;if(b){for(const S of b)u(S);document.body.removeChild(m)}},m.oncancel=()=>{(!m.files||m.files.length===0)&&document.body.removeChild(m)},m.click()},e[2]=u,e[3]=d,e[4]=a,e[5]=f):f=e[5];const h=f;return o?null:h},J6=$n("ComposerPrimitive.AddAttachment",Z6,["multiple"]),X_=O.forwardRef((t,e)=>{const n=Y(30),{disabled:i,asChild:a,render:o,children:u,...d}=t,f=a===void 0?!1:a,[h,m]=it(!1),v=_e();let y;n[0]!==i?(y=Q=>{i||(Q.preventDefault(),m(!0))},n[0]=i,n[1]=y):y=n[1];const b=y;let S;n[2]!==i||n[3]!==h?(S=Q=>{i||(Q.preventDefault(),h||m(!0))},n[2]=i,n[3]=h,n[4]=S):S=n[4];const _=S;let w;n[5]!==i?(w=Q=>{if(i)return;Q.preventDefault();const ee=Q.relatedTarget;ee&&Q.currentTarget.contains(ee)||m(!1)},n[5]=i,n[6]=w):w=n[6];const C=w;let A;n[7]!==v||n[8]!==i?(A=async Q=>{if(i)return;Q.preventDefault(),m(!1);const ee=Array.from(Q.dataTransfer.files);await Promise.all(ee.map(async J=>{try{await v.composer().addAttachment(J)}catch(P){console.error("Failed to add attachment:",P)}}))},n[7]=v,n[8]=i,n[9]=A):A=n[9];const R=A;let D;n[10]!==h?(D=h?{"data-dragging":"true"}:null,n[10]=h,n[11]=D):D=n[11];const N=Pe(d.onDragEnterCapture,b),I=Pe(d.onDragOverCapture,_),z=Pe(d.onDragLeaveCapture,C),q=Pe(d.onDropCapture,R);let X;n[12]!==e||n[13]!==d||n[14]!==q||n[15]!==D||n[16]!==N||n[17]!==I||n[18]!==z?(X={...D,...d,onDragEnterCapture:N,onDragOverCapture:I,onDragLeaveCapture:z,onDropCapture:q,ref:e},n[12]=e,n[13]=d,n[14]=q,n[15]=D,n[16]=N,n[17]=I,n[18]=z,n[19]=X):X=n[19];const V=X;if(o&&O.isValidElement(o)){const Q=u!==void 0?u:o.props.children;let ee;n[20]!==o||n[21]!==Q?(ee=O.cloneElement(o,void 0,Q),n[20]=o,n[21]=Q,n[22]=ee):ee=n[22];let J;return n[23]!==V||n[24]!==ee?(J=T.jsx(mu,{...V,children:ee}),n[23]=V,n[24]=ee,n[25]=J):J=n[25],J}const $=f?mu:"div";let L;return n[26]!==$||n[27]!==u||n[28]!==V?(L=T.jsx($,{...V,children:u}),n[26]=$,n[27]=u,n[28]=V,n[29]=L):L=n[29],L});X_.displayName="ComposerPrimitive.AttachmentDropzone";const W6=()=>{const{disabled:t,startDictation:e}=k3();return t?null:e},eN=$n("ComposerPrimitive.Dictate",W6),tN=()=>{const t=Y(2),e=_e(),n=ce(rN);let i;t[0]!==e?(i=()=>{e.composer().stopDictation()},t[0]=e,t[1]=i):i=t[1];const a=i;return n?a:null},nN=$n("ComposerPrimitive.StopDictation",tN);function rN(t){return t.composer.dictation!=null}const K_=O.forwardRef((t,e)=>{const n=Y(7);let i,a;n[0]!==t?({children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=ce(iN);if(!o)return null;const u=i??o;let d;return n[3]!==e||n[4]!==a||n[5]!==u?(d=T.jsx(st.span,{...a,ref:e,children:u}),n[3]=e,n[4]=a,n[5]=u,n[6]=d):d=n[6],d});K_.displayName="ComposerPrimitive.DictationTranscript";function iN(t){var e;return(e=t.composer.dictation)==null?void 0:e.transcript}const Z_=O.forwardRef((t,e)=>{const n=Y(3);if(!ce(sN))return null;let i;return n[0]!==e||n[1]!==t?(i=T.jsx(st.div,{...t,ref:e}),n[0]=e,n[1]=t,n[2]=i):i=n[2],i});Z_.displayName="ComposerPrimitive.Quote";const J_=O.forwardRef((t,e)=>{const n=Y(7);let i,a;n[0]!==t?({children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=ce(aN);if(!o)return null;const u=i??o;let d;return n[3]!==e||n[4]!==a||n[5]!==u?(d=T.jsx(st.span,{...a,ref:e,children:u}),n[3]=e,n[4]=a,n[5]=u,n[6]=d):d=n[6],d});J_.displayName="ComposerPrimitive.QuoteText";const W_=O.forwardRef((t,e)=>{const n=Y(12);let i,a;n[0]!==t?({onClick:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const o=_e();let u;n[3]!==o?(u=()=>{o.composer().setQuote(void 0)},n[3]=o,n[4]=u):u=n[4];const d=u;let f;n[5]!==d||n[6]!==i?(f=Pe(i,d),n[5]=d,n[6]=i,n[7]=f):f=n[7];let h;return n[8]!==e||n[9]!==a||n[10]!==f?(h=T.jsx(st.button,{type:"button",...a,ref:e,onClick:f}),n[8]=e,n[9]=a,n[10]=f,n[11]=h):h=n[11],h});W_.displayName="ComposerPrimitive.QuoteDismiss";function sN(t){return t.composer.quote}function aN(t){var e;return(e=t.composer.quote)==null?void 0:e.text}const eS=O.forwardRef((t,e)=>{const n=Y(12);let i,a,o;n[0]!==t?({children:a,"aria-label":i,...o}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);const{categories:u,activeCategoryId:d,isSearchMode:f,open:h}=$s();if(!h||d||f)return null;const m=i??"Categories";let v;n[4]!==u||n[5]!==a?(v=a(u),n[4]=u,n[5]=a,n[6]=v):v=n[6];let y;return n[7]!==e||n[8]!==o||n[9]!==m||n[10]!==v?(y=T.jsx(st.div,{role:"group","aria-label":m,...o,ref:e,children:v}),n[7]=e,n[8]=o,n[9]=m,n[10]=v,n[11]=y):y=n[11],y});eS.displayName="ComposerPrimitive.TriggerPopoverCategories";const tS=O.forwardRef((t,e)=>{const n=Y(30);let i,a,o,u;n[0]!==t?({categoryId:i,onClick:a,onMouseMove:o,...u}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u):(i=n[1],a=n[2],o=n[3],u=n[4]);const{selectCategory:d,highlightIndex:f,categories:h,highlightedIndex:m,activeCategoryId:v,isSearchMode:y,popoverId:b}=$s();let S;n[5]!==i||n[6]!==d?(S=()=>{d(i)},n[5]=i,n[6]=d,n[7]=S):S=n[7];const _=S;let w;if(n[8]!==h||n[9]!==i){let V;n[11]!==i?(V=$=>
93$.id===i,n[11]=i,n[12]=V):V=n[12],w=h.findIndex(V),n[8]=h,n[9]=i,n[10]=w}else w=n[10];const C=w,A=!v&&!y&&C===m;let R;n[13]!==C||n[14]!==f?(R=()=>{f(C)},n[13]=C,n[14]=f,n[15]=R):R=n[15];const D=R,N=`${b}-option-${i}`,I=A?"":void 0;let z;n[16]!==_||n[17]!==a?(z=Pe(a,_),n[16]=_,n[17]=a,n[18]=z):z=n[18];let q;n[19]!==D||n[20]!==o?(q=Pe(o,D),n[19]=D,n[20]=o,n[21]=q):q=n[21];let X;return n[22]!==e||n[23]!==A||n[24]!==u||n[25]!==N||n[26]!==I||n[27]!==z||n[28]!==q?(X=T.jsx(st.button,{type:"button",role:"option",id:N,"aria-selected":A,"data-highlighted":I,...u,ref:e,onClick:z,onMouseMove:q}),n[22]=e,n[23]=A,n[24]=u,n[25]=N,n[26]=I,n[27]=z,n[28]=q,n[29]=X):X=n[29],X});tS.displayName="ComposerPrimitive.TriggerPopoverCategoryItem";const nS=O.forwardRef((t,e)=>{const n=Y(12);let i,a,o;n[0]!==t?({children:a,"aria-label":i,...o}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);const{items:u,activeCategoryId:d,isSearchMode:f,open:h}=$s();if(!h||!d&&!f)return null;const m=i??"Items";let v;n[4]!==a||n[5]!==u?(v=a(u),n[4]=a,n[5]=u,n[6]=v):v=n[6];let y;return n[7]!==e||n[8]!==o||n[9]!==m||n[10]!==v?(y=T.jsx(st.div,{role:"group","aria-label":m,...o,ref:e,children:v}),n[7]=e,n[8]=o,n[9]=m,n[10]=v,n[11]=y):y=n[11],y});nS.displayName="ComposerPrimitive.TriggerPopoverItems";const rS=O.forwardRef((t,e)=>{const n=Y(30);let i,a,o,u,d;n[0]!==t?({item:a,index:i,onClick:o,onMouseMove:u,...d}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=d):(i=n[1],a=n[2],o=n[3],u=n[4],d=n[5]);const{selectItem:f,highlightIndex:h,items:m,highlightedIndex:v,activeCategoryId:y,isSearchMode:b,popoverId:S}=$s();let _;n[6]!==a||n[7]!==f?(_=()=>{f(a)},n[6]=a,n[7]=f,n[8]=_):_=n[8];const w=_;let C;n[9]!==i||n[10]!==a.id||n[11]!==m?(C=i??m.findIndex($=>$.id===a.id),n[9]=i,n[10]=a.id,n[11]=m,n[12]=C):C=n[12];const A=C,R=(b||y!==null)&&A===v;let D;n[13]!==h||n[14]!==A?(D=()=>{h(A)},n[13]=h,n[14]=A,n[15]=D):D=n[15];const N=D,I=`${S}-option-${a.id}`,z=R?"":void 0;let q;n[16]!==w||n[17]!==o?(q=Pe(o,w),n[16]=w,n[17]=o,n[18]=q):q=n[18];let X;n[19]!==N||n[20]!==u?(X=Pe(u,N),n[19]=N,n[20]=u,n[21]=X):X=n[21];let V;return n[22]!==e||n[23]!==R||n[24]!==d||n[25]!==I||n[26]!==z||n[27]!==q||n[28]!==X?(V=T.jsx(st.button,{type:"button",role:"option",id:I,"aria-selected":R,"data-highlighted":z,...d,ref:e,onClick:q,onMouseMove:X}),n[22]=e,n[23]=R,n[24]=d,n[25]=I,n[26]=z,n[27]=q,n[28]=X,n[29]=V):V=n[29],V});rS.displayName="ComposerPrimitive.TriggerPopoverItem";const iS=O.forwardRef((t,e)=>{const n=Y(10);let i,a;n[0]!==t?({onClick:i,...a}=t,n[0]=t,n[1]=i,n[2]=a):(i=n[1],a=n[2]);const{activeCategoryId:o,isSearchMode:u,goBack:d,open:f}=$s();if(!f||!o||u)return null;let h;n[3]!==d||n[4]!==i?(h=Pe(i,d),n[3]=d,n[4]=i,n[5]=h):h=n[5];let m;return n[6]!==e||n[7]!==a||n[8]!==h?(m=T.jsx(st.button,{type:"button",...a,ref:e,onClick:h}),n[6]=e,n[7]=a,n[8]=h,n[9]=m):m=n[9],m});iS.displayName="ComposerPrimitive.TriggerPopoverBack";const sS=({formatter:t,onExecute:e,removeOnExecute:n})=>{const{register:i}=B_(),a=Ce(e);return a.current=e,ye(()=>i({kind:"action",formatter:t??U1,onExecute:o=>a.current(o),...n!==void 0?{removeOnExecute:n}:{}}),[i,t,n]),null};sS.displayName="ComposerPrimitive.TriggerPopoverAction";const aS=({formatter:t,onInserted:e})=>{const{register:n}=B_(),i=Ce(e);return i.current=e,ye(()=>n({kind:"directive",formatter:t??U1,onInserted:a=>{var o;return(o=i.current)==null?void 0:o.call(i,a)}}),[n,t]),null};aS.displayName="ComposerPrimitive.TriggerPopoverDirective";const oN=Object.assign(P_,{Directive:aS,Action:sS});var Qh=Ns({AddAttachment:()=>J6,AttachmentByIndex:()=>k1,AttachmentDropzone:()=>X_,Attachments:()=>O1,Cancel:()=>K6,Dictate:()=>eN,DictationTranscript:()=>K_,If:()=>P1,Input:()=>Q_,Queue:()=>D1,Quote:()=>Z_,QuoteDismiss:()=>W_,QuoteText:()=>J_,Root:()=>U_,Send:()=>S6,StopDictation:()=>nN,Unstable_TriggerPopover:()=>oN,Unstable_TriggerPopoverBack:()=>iS,Unstable_TriggerPopoverCategories:()=>eS,Unstable_TriggerPopoverCategoryItem:()=>tS,Unstable_TriggerPopoverItem:()=>rS,Unstable_TriggerPopoverItems:()=>nS,Unstable_TriggerPopoverRoot:()=>D_,unstable_useTriggerPopoverRootContext:()=>Vh,unstable_useTriggerPopoverRootContextOptional:()=>$h,unstable_useTriggerPopoverScopeContext:()=>$s,unstable_useTriggerPopoverScopeContextOptional:()=>x6,unstable_useTriggerPopoverTriggers:()=>r6,unstable_useTriggerPopoverTriggersOptional:()=>s6});const oS=()=>ce(lN);function lN(t){if(t.part.type!=="text"&&t.part.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return t.part}const lS=xn(null),uN=t=>({useSmoothStatus:Ds(()=>t)}
93),cN=t=>{const e=Y(6),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={optional:!0},e[0]=i):i=e[0];const a=uS(i),o=_e();let u;e[1]!==o?(u=()=>uN(o.part().getState().status),e[1]=o,e[2]=u):u=e[2];const[d]=it(u);if(a)return n;let f;return e[3]!==n||e[4]!==d?(f=T.jsx(lS.Provider,{value:d,children:n}),e[3]=n,e[4]=d,e[5]=f):f=e[5],f},dN=t=>{const e=O.forwardRef((n,i)=>{const a=Y(3),o=n;let u;return a[0]!==i||a[1]!==o?(u=T.jsx(cN,{children:T.jsx(t,{...o,ref:i})}),a[0]=i,a[1]=o,a[2]=u):u=a[2],u});return e.displayName=t.displayName,e};function uS(t){const e=_n(lS);if(!t?.optional&&!e)throw new Error("This component must be used within a SmoothContextProvider.");return e}const{useSmoothStatus:fN,useSmoothStatusStore:hN}=H1(uS,"useSmoothStatus"),cS=250,dS=5;var pN=class{constructor(t,e){U(this,"currentText"),U(this,"setText"),U(this,"animationFrameId",null),U(this,"lastUpdateTime",Date.now()),U(this,"lastCommitTime",0),U(this,"targetText",""),U(this,"drainMs",cS),U(this,"maxCharIntervalMs",dS),U(this,"maxCharsPerFrame",1/0),U(this,"minCommitMs",0),U(this,"animate",()=>{const n=Date.now();let i=n-this.lastUpdateTime;const a=this.targetText.length-this.currentText.length,o=Math.min(this.maxCharIntervalMs,this.drainMs/a),u=Math.min(a,this.maxCharsPerFrame);let d=0;for(;i>=o&&d<u;)d++,i-=o;d===u&&u===this.maxCharsPerFrame&&(i=0),d!==a?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,d!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+d),this.lastUpdateTime=n-i,(d===a||n-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=n,this.setText(this.currentText)))}),this.currentText=t,this.setText=e}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}};const Xh=Object.freeze({type:"running"}),Uu=(t,e)=>t!==void 0&&t>0?t:e,fS=(t,e=!1)=>{const{text:n}=t,i=q_("(prefers-reduced-motion: reduce)"),a=typeof e=="object"&&e!==null?e:void 0,o=e!==!1&&e!==null&&!i,u=Uu(a?.drainMs,cS),d=Uu(a?.maxCharIntervalMs,dS),f=Uu(a?.maxCharsPerFrame,1/0),h=Uu(a?.minCommitMs,0),[m,v]=it(t.status.type==="running"?"":n),y=_e(),b=ce(()=>y.part()),[S,_]=it(b);(b!==S||!n.startsWith(m))&&(_(b),v(t.status.type==="running"?"":n));const w=hN({optional:!0}),C=br(D=>{if(v(D),w){const N=m!==D||t.status.type==="running"?Xh:t.status;pu(w).setState(N,!0)}});ye(()=>{if(w){const D=o&&(m!==n||t.status.type==="running")?Xh:t.status;pu(w).setState(D,!0)}},[w,o,n,m,t.status]);const[A]=it(new pN(m,C));ye(()=>{A.drainMs=u,A.maxCharIntervalMs=d,A.maxCharsPerFrame=f,A.minCommitMs=h},[A,u,d,f,h]);const R=Ce(b);return ye(()=>{if(!o){A.stop();return}const D=R.current!==b;if(R.current=b,D||!n.startsWith(A.targetText)){t.status.type==="running"?(A.currentText="",A.targetText=n,A.lastCommitTime=0,A.start()):(A.currentText=n,A.targetText=n,A.stop());return}A.targetText=n,A.start()},[A,o,n,t.status.type,b]),ye(()=>()=>{A.stop()},[A]),Ue(()=>o?{...t,text:m,status:n===m?t.status:Xh}:t,[o,m,t,n])},mN=()=>ce(gN);function gN(t){if(t.part.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return t.part}const Kh=O.forwardRef((t,e)=>{const n=Y(10);let i,a,o;n[0]!==t?({smooth:a,component:o,...i}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);const u=a===void 0?!0:a,d=o===void 0?"span":o,{text:f,status:h}=fS(oS(),u);let m;return n[4]!==d||n[5]!==e||n[6]!==i||n[7]!==h.type||n[8]!==f?(m=T.jsx(d,{"data-status":h.type,...i,ref:e,children:f}),n[4]=d,n[5]=e,n[6]=i,n[7]=h.type,n[8]=f,n[9]=m):m=n[9],m});Kh.displayName="MessagePartPrimitive.Text";const Zh=O.forwardRef((t,e)=>{const n=Y(4),{image:i}=mN();let a;return n[0]!==e||n[1]!==i||n[2]!==t?(a=T.jsx(st.img,{src:i,...t,ref:e}),n[0]=e,n[1]=i,n[2]=t,n[3]=a):a=n[3],a});Zh.displayName="MessagePartPrimitive.Image";const ji=t=>{const e=Y(2),n=Ce(void 0);let i;return e[0]!==t?(i=a=>{n.current&&(n.current(),n.current=void 0),a&&(n.current=t(a))},e[0]=t,e[1]=i):i=e[1],i},hS=(t,e)=>{const n=t.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return Number.POSITIVE_INFINITY;const i=Number(n[1]),a=n[2];
93return a==="px"?i:a==="em"?i*(parseFloat(getComputedStyle(e).fontSize)||16):a==="rem"?i*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Number.POSITIVE_INFINITY},vN=t=>t.dataset.messageId,yN=()=>{const t=document.createElement("div");return t.dataset.auiTopAnchorReserve="",t.style.height="0px",t.style.flexShrink="0",t.style.pointerEvents="none",t.setAttribute("aria-hidden","true"),t},pS=(t,e)=>{const n=`${e}px`;return t.style.height!==n?(t.style.height=n,!0):!1},bN=t=>{const e=window.devicePixelRatio||1;return Math.round(t*e)/e},mS=()=>{const t=Y(4),e=_e();let n;t[0]!==e?(n=()=>e.message(),t[0]=e,t[1]=n):n=t[1];const i=ce(n);let a;return t[2]!==i?(a=o=>{const u=()=>{i.setIsHovering(!0)},d=()=>{i.setIsHovering(!1)};return o.addEventListener("mouseenter",u),o.addEventListener("mouseleave",d),o.matches(":hover")&&queueMicrotask(()=>i.setIsHovering(!0)),()=>{o.removeEventListener("mouseenter",u),o.removeEventListener("mouseleave",d),i.setIsHovering(!1)}},t[2]=i,t[3]=a):a=t[3],ji(a)},xN=()=>{const t=Y(2),e=Oi(EN);let n;return t[0]!==e?(n=i=>{var a;return i.message.role==="user"&&i.message.index>0&&i.message.index===i.thread.messages.length-2&&((a=i.thread.messages.at(-1))==null?void 0:a.role)==="assistant"&&(i.message.id===e||i.thread.isRunning)},t[0]=e,t[1]=n):n=t[1],ce(n)},_N=()=>{const t=Y(2),e=Oi(AN);let n;return t[0]!==e?(n=i=>{var a;return i.message.isLast&&i.message.role==="assistant"&&i.message.index>=1&&((a=i.thread.messages.at(i.message.index-1))==null?void 0:a.role)==="user"&&(i.message.id===e||i.thread.isRunning)},t[0]=e,t[1]=n):n=t[1],ce(n)},SN=(t,e)=>{const n=Y(3);let i;return n[0]!==t||n[1]!==e?(i=a=>{if(t)return e.getState().registerAnchorElement(a)},n[0]=t,n[1]=e,n[2]=i):i=n[2],ji(i)},TN=t=>{const e=Y(3),{active:n,threadViewportStore:i}=t;let a;return e[0]!==n||e[1]!==i?(a=o=>{if(!n)return;const u=i.getState(),d=u.topAnchorMessageClamp;return u.registerAnchorTargetElement(o,{tallerThan:hS(d.tallerThan,o),visibleHeight:hS(d.visibleHeight,o)})},e[0]=n,e[1]=i,e[2]=a):a=e[2],ji(a)},wN=t=>{const e=Y(7);let n,i;e[0]!==t?({forwardedRef:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);const a=mS(),o=Vt(n,a),u=ce(RN);let d;return e[3]!==u||e[4]!==i||e[5]!==o?(d=T.jsx(st.div,{...i,ref:o,"data-message-id":u}),e[3]=u,e[4]=i,e[5]=o,e[6]=d):d=e[6],d},CN=t=>{const e=Y(13);let n,i,a;e[0]!==t?({forwardedRef:n,threadViewportStore:a,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a):(n=e[1],i=e[2],a=e[3]);const o=mS(),u=xN(),d=_N(),f=SN(u,a);let h;e[4]!==d||e[5]!==a?(h={active:d,threadViewportStore:a},e[4]=d,e[5]=a,e[6]=h):h=e[6];const m=TN(h),v=Vt(n,o,f,m),y=ce(MN),b=u?"":void 0,S=d?"":void 0;let _;return e[7]!==y||e[8]!==i||e[9]!==v||e[10]!==b||e[11]!==S?(_=T.jsx(st.div,{...i,ref:v,"data-message-id":y,"data-aui-top-anchor-user":b,"data-aui-top-anchor-target":S}),e[7]=y,e[8]=i,e[9]=v,e[10]=b,e[11]=S,e[12]=_):_=e[12],_},gS=O.forwardRef((t,e)=>{const n=Y(7),i=Di();if(i.getState().turnAnchor==="top"){let o;return n[0]!==e||n[1]!==t||n[2]!==i?(o=T.jsx(CN,{...t,forwardedRef:e,threadViewportStore:i}),n[0]=e,n[1]=t,n[2]=i,n[3]=o):o=n[3],o}let a;return n[4]!==e||n[5]!==t?(a=T.jsx(wN,{...t,forwardedRef:e}),n[4]=e,n[5]=t,n[6]=a):a=n[6],a});gS.displayName="MessagePrimitive.Root";function EN(t){var e;return(e=t.topAnchorTurn)==null?void 0:e.anchorId}function AN(t){var e;return(e=t.topAnchorTurn)==null?void 0:e.targetId}function RN(t){return t.message.id}function MN(t){return t.message.id}const Jh={...At,Text:()=>T.jsxs("p",{style:{whiteSpace:"pre-line"},children:[T.jsx(Kh,{}),T.jsx(ch,{children:T.jsx("span",{style:{fontFamily:"revert"},children:" \u25CF"})})]}),Image:()=>T.jsx(Zh,{})},Wh=t=>{const e=Y(10);if("children"in t){let d;return e[0]!==t.children?(d=T.jsx(uh,{children:t.children}),e[0]=t.children,e[1]=d):d=e[1],d}let n,i;e[2]!==t?({components:n,...i}=t,e[2]=t,e[3]=n,e[4]=i):(n=e[3],i=e[4]);let a;e[5]!==n?(a=n?{Text:n.Text??Jh.Text,Image:n.Image??Jh.Image,Reasoning:n.Reasoning??At.Reasoning,Source:n.Source??At.Source,File:n.File??At.File,Unstable_Audio:n.Unstable_Audio??At.Unstable_Audio,..."ChainOfThought"in n?{ChainOfThought:n.ChainOfThought}:{tools:n.tools,data:n.data,ToolGroup:n.ToolGroup??At.ToolGroup,ReasoningGroup:n.ReasoningGroup??At.ReasoningGroup},Empty:n.Empty,Quote:n.Quote,generativeUI:n.generativeUI}:Jh,e[5]=n,e[6]=a):a=e[6];const o=a;let u;return e[7]!==i||e[8]!==o?(u=T.jsx(uh,{components:o,...i}),e[7]=i,e[8]=o,e[9]=u):u=e[9],u};Wh.displayName="MessagePrimitive.Parts";const vS=t=>{const{children:e}=t;return rI()!==void 0?e:null};vS.displayName="MessagePrimitive.Error";const kN=t=>{var e;const n=new Map;for(let a=0;a<t.length;a++){const o=((e=t[a])==null?void 0:e.parentId)??`__ungrouped_${a}`,u=n.get(o)??[];u.push(a),n.set(o,u)}const i=[];
93for(const[a,o]of n){const u=a.startsWith("__ungrouped_")?void 0:a;i.push({groupKey:u,indices:o})}return i},IN=t=>{const e=Y(4),n=ce(HN);let i;e:{if(n.length===0){let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],i=o;break e}let a;e[1]!==t||e[2]!==n?(a=t(n),e[1]=t,e[2]=n,e[3]=a):a=e[3],i=a}return i},ON=t=>{const e=Y(9);let n,i;e[0]!==t?({Fallback:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n||e[4]!==i.toolName?(a=d=>{const f=d.tools.tools[i.toolName]??n;return Array.isArray(f)?f[0]??n:f},e[3]=n,e[4]=i.toolName,e[5]=a):a=e[5];const o=ce(a);if(!o)return null;let u;return e[6]!==o||e[7]!==i?(u=T.jsx(o,{...i}),e[6]=o,e[7]=i,e[8]=u):u=e[8],u},DN=t=>{const e=Y(9);let n,i;e[0]!==t?({Fallback:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n||e[4]!==i.name?(a=d=>{const f=d.dataRenderers.renderers[i.name]??n;return Array.isArray(f)?f[0]??n:f},e[3]=n,e[4]=i.name,e[5]=a):a=e[5];const o=ce(a);if(!o)return null;let u;return e[6]!==o||e[7]!==i?(u=T.jsx(o,{...i}),e[6]=o,e[7]=i,e[8]=u):u=e[8],u},ri={Text:()=>T.jsxs("p",{style:{whiteSpace:"pre-line"},children:[T.jsx(Kh,{}),T.jsx(ch,{children:T.jsx("span",{style:{fontFamily:"revert"},children:" \u25CF"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>T.jsx(Zh,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:t})=>t},NN=t=>{var e,n,i;const a=Y(43),{components:o}=t;let u;a[0]!==o?(u=o===void 0?{}:o,a[0]=o,a[1]=u):u=a[1];const{Text:d,Reasoning:f,Image:h,Source:m,File:v,Unstable_Audio:y,tools:b,data:S}=u,_=d===void 0?ri.Text:d,w=f===void 0?ri.Reasoning:f,C=h===void 0?ri.Image:h,A=m===void 0?ri.Source:m,R=v===void 0?ri.File:v,D=y===void 0?ri.Unstable_Audio:y;let N;a[2]!==b?(N=b===void 0?{}:b,a[2]=b,a[3]=N):N=a[3];const I=N,z=_e(),q=ce(qN),X=q.type;if(X==="tool-call"){let V;a[4]!==z?(V=z.part(),a[4]=z,a[5]=V):V=a[5];const $=V.addToolResult;let L;a[6]!==z?(L=z.part(),a[6]=z,a[7]=L):L=a[7];const Q=L.resumeToolCall;let ee;a[8]!==z?(ee=z.part(),a[8]=z,a[9]=ee):ee=a[9];const J=ee.respondToToolApproval;if("Override"in I){let G;return a[10]!==$||a[11]!==q||a[12]!==J||a[13]!==Q||a[14]!==I.Override?(G=T.jsx(I.Override,{...q,addResult:$,resume:Q,respondToApproval:J}),a[10]=$,a[11]=q,a[12]=J,a[13]=Q,a[14]=I.Override,a[15]=G):G=a[15],G}const P=((e=I.by_name)==null?void 0:e[q.toolName])??I.Fallback;let te;return a[16]!==P||a[17]!==$||a[18]!==q||a[19]!==J||a[20]!==Q?(te=T.jsx(ON,{...q,Fallback:P,addResult:$,resume:Q,respondToApproval:J}),a[16]=P,a[17]=$,a[18]=q,a[19]=J,a[20]=Q,a[21]=te):te=a[21],te}if(((n=q.status)==null?void 0:n.type)==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(X){case"text":{let V;return a[22]!==_||a[23]!==q?(V=T.jsx(_,{...q}),a[22]=_,a[23]=q,a[24]=V):V=a[24],V}case"reasoning":{let V;return a[25]!==w||a[26]!==q?(V=T.jsx(w,{...q}),a[25]=w,a[26]=q,a[27]=V):V=a[27],V}case"source":{let V;return a[28]!==A||a[29]!==q?(V=T.jsx(A,{...q}),a[28]=A,a[29]=q,a[30]=V):V=a[30],V}case"image":{let V;return a[31]!==C||a[32]!==q?(V=T.jsx(C,{...q}),a[31]=C,a[32]=q,a[33]=V):V=a[33],V}case"file":{let V;return a[34]!==R||a[35]!==q?(V=T.jsx(R,{...q}),a[34]=R,a[35]=q,a[36]=V):V=a[36],V}case"audio":{let V;return a[37]!==D||a[38]!==q?(V=T.jsx(D,{...q}),a[37]=D,a[38]=q,a[39]=V):V=a[39],V}case"data":{const V=((i=S?.by_name)==null?void 0:i[q.name])??S?.Fallback;let $;return a[40]!==V||a[41]!==q?($=T.jsx(DN,{...q,Fallback:V}),a[40]=V,a[41]=q,a[42]=$):$=a[42],$}default:return console.warn(`Unknown message part type: ${X}`),null}},zN=t=>{const e=Y(5),{partIndex:n,components:i}=t;let a;e[0]!==i?(a=T.jsx(NN,{components:i}),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==n||e[3]!==a?(o=T.jsx(Ff,{index:n,children:a}),e[2]=n,e[3]=a,e[4]=o):o=e[4],o},jN=O.memo(zN,(t,e)=>{var n,i,a,o,u,d,f,h,m,v,y,b,S,_,w,C,A,R;return t.partIndex===e.partIndex&&((n=t.components)==null?void 0:n.Text)===((i=e.components)==null?void 0:i.Text)&&((a=t.components)==null?void 0:a.Reasoning)===((o=e.components)==null?void 0:o.Reasoning)&&((u=t.components)==null?void 0:u.Source)===((d=e.components)==null?void 0:d.Source)&&((f=t.components)==null?void 0:f.Image)===((h=e.components)==null?void 0:h.Image)&&((m=t.components)==null?void 0:m.File)===((v=e.components)==null?void 0:v.File)&&((y=t.components)==null?void 0:y.Unstable_Audio)===((b=e.components)==null?void 0:b.Unstable_Audio)&&((S=t.components)==null?void 0:S.tools)===((_=e.components)==null?void 0:_.tools)&&((w=t.components)==null?void 0:w.data)===((C=e.components)==null?void 0:C.data)&&((A=t.components)==null?void 0:A.Group)===((R=e.components)==null?void 0:R.Group)}),BN=t=>{const e=Y(6),{status:n,component:i}
93=t,a=n.type==="running";let o;e[0]!==i||e[1]!==n?(o=T.jsx(i,{type:"text",text:"",status:n}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let u;return e[3]!==a||e[4]!==o?(u=T.jsx(Yf,{text:"",isRunning:a,children:o}),e[3]=a,e[4]=o,e[5]=u):u=e[5],u},PN=Object.freeze({type:"complete"}),LN=t=>{const e=Y(6),{components:n}=t,i=ce(VN);if(n?.Empty){let u;return e[0]!==n.Empty||e[1]!==i?(u=T.jsx(n.Empty,{status:i}),e[0]=n.Empty,e[1]=i,e[2]=u):u=e[2],u}const a=n?.Text??ri.Text;let o;return e[3]!==i||e[4]!==a?(o=T.jsx(BN,{status:i,component:a}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o},UN=O.memo(LN,(t,e)=>{var n,i,a,o;return((n=t.components)==null?void 0:n.Empty)===((i=e.components)==null?void 0:i.Empty)&&((a=t.components)==null?void 0:a.Text)===((o=e.components)==null?void 0:o.Text)}),ep=t=>{const e=Y(9),{groupingFunction:n,components:i}=t,a=ce($N),o=IN(n);let u;e:{if(a===0){let m;e[0]!==i?(m=T.jsx(UN,{components:i}),e[0]=i,e[1]=m):m=e[1],u=m;break e}let h;if(e[2]!==i||e[3]!==o){let m;e[5]!==i?(m=(v,y)=>T.jsx(i?.Group??ri.Group,{groupKey:v.groupKey,indices:v.indices,children:v.indices.map(b=>T.jsx(jN,{partIndex:b,components:i},b))},`group-${y}-${v.groupKey??"ungrouped"}`),e[5]=i,e[6]=m):m=e[6],h=o.map(m),e[2]=i,e[3]=o,e[4]=h}else h=e[4];u=h}const d=u;let f;return e[7]!==d?(f=T.jsx(T.Fragment,{children:d}),e[7]=d,e[8]=f):f=e[8],f};ep.displayName="MessagePrimitive.Unstable_PartsGrouped";const yS=t=>{const e=Y(6);let n,i;e[0]!==t?({components:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;return e[3]!==n||e[4]!==i?(a=T.jsx(ep,{...i,components:n,groupingFunction:kN}),e[3]=n,e[4]=i,e[5]=a):a=e[5],a};yS.displayName="MessagePrimitive.Unstable_PartsGroupedByParentId";function HN(t){return t.message.parts}function qN(t){return t.part}function VN(t){return t.message.status??PN}function $N(t){return t.message.parts.length}var oo=Ns({AttachmentByIndex:()=>E1,Attachments:()=>R1,Content:()=>Wh,Error:()=>vS,GenerativeUI:()=>c1,GroupedParts:()=>T1,If:()=>C_,PartByIndex:()=>ro,Parts:()=>Wh,Quote:()=>w1,Root:()=>gS,Unstable_PartsGrouped:()=>ep,Unstable_PartsGroupedByParentId:()=>yS});const FN=t=>{const e=Y(2),n=br(t);let i;return e[0]!==n?(i=a=>{const o=new ResizeObserver(()=>{n()}),u=new MutationObserver(d=>{d.some(YN)&&n()});return o.observe(a),u.observe(a,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{o.disconnect(),u.disconnect()}},e[0]=n,e[1]=i):i=e[1],ji(i)};function YN(t){return t.type!=="attributes"||t.attributeName!=="style"}const GN=({autoScroll:t,scrollToBottomOnRunStart:e=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:i=!0})=>{const a=Ce(null),o=ce(D=>D.thread.messages.length>0),u=Ce(!1),d=Ce(null),f=Di();t===void 0&&(t=f.getState().turnAnchor!=="top");const h=Ce(0),m=Ce(0),v=Ce(0),y=Ce(0),b=Ce(null),S=Zr(D=>{const N=a.current;N&&(b.current=D,N.scrollTo({top:N.scrollHeight,behavior:D}))},[]),_=Zr(D=>{b.current=D,d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null,S(D)})},[S]);Qa(()=>()=>{d.current!==null&&cancelAnimationFrame(d.current)},[]);const w=Zr(()=>{const D=f.getState();return D.turnAnchor==="top"&&D.element.viewport===a.current&&D.element.anchor!==null},[f]),C=()=>{const D=a.current;if(!D)return;const N=f.getState().isAtBottom,I=Math.abs(D.scrollHeight-D.scrollTop-D.clientHeight)<=1||D.scrollHeight<=D.clientHeight;!I&&h.current<D.scrollTop||(I?D.scrollHeight>D.clientHeight+1&&(b.current=null):h.current>D.scrollTop&&m.current===D.scrollHeight&&(b.current=null),(I||b.current===null)&&I!==N&&pu(f).setState({isAtBottom:I})),h.current=D.scrollTop,m.current=D.scrollHeight},A=FN(()=>{const D=a.current;if(!D)return;const{scrollHeight:N,clientHeight:I}=D;if(N===v.current&&I===y.current)return;v.current=N,y.current=I;const z=b.current;z&&w()?b.current=null:z?S(z):t&&f.getState().isAtBottom&&S("instant"),C()}),R=ji(D=>{const N=()=>{b.current=null};return D.addEventListener("scroll",C),D.addEventListener("pointerdown",N),()=>{D.removeEventListener("scroll",C),D.removeEventListener("pointerdown",N)}});return Qa(()=>{if(n){if(!o){u.current=!1;return}u.current||(u.current=!0,b.current===null&&_("instant"))}},[o,_,n]),H_(({behavior:D})=>{S(D)}),eu("thread.runStart",()=>{e&&f.getState().turnAnchor!=="top"&&_("auto")}),eu("threadListItem.switchedTo",()=>{i&&_("instant")}),Vt(A,R,a)},bS=O.forwardRef((t,e)=>{const n=Y(3);let i;return n[0]!==t||n[1]!==e?(i=T.jsx(st.div,{...t,ref:e}),n[0]=t,n[1]=e,n[2]=i):i=n[2],i});bS.displayName="ThreadPrimitive.Root";const xS=t=>{const{children:e}=t;return ce(QN)?e:null};xS.displayName="ThreadPrimitive.Empty";function QN(t){return t.thread.isEmpty}const XN=t=>{const e=Y(4);let n;return e[0]!==t.disabled||e[1]!==t.empty||e[2]!==t.running?(n=i=>!(t.empty===!0&&!i.thread.isEmpty||t.empty===!1&&i.thread.isEmpty||t.running===!0&&!i.thread.isRunning||t.running===!1&&i.thread.isRunning||t.disabled===!0&&!i.thread.isDisabled||t.disabled===!1&&i.thread.isDisabled),e[0]=t.disabled,e[1]=t.empty,e[2]=t.running,e[3]=n):n=e[3],ce(n)},_S=t=>{const e=Y(3);let n,i;return e[0]!==t?({children:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]),XN(i)?n:null};_S.displayName="ThreadPrimitive.If";const SS=(t,e)=>{const n=Y(3);let i;return n[0]!==e||n[1]!==t?(i=a=>{if(!t)return;const o=t(),u=()=>
93{const f=e?e(a):a.offsetHeight;o.setHeight(f)},d=new ResizeObserver(u);return d.observe(a),u(),()=>{d.disconnect(),o.unregister()}},n[0]=e,n[1]=t,n[2]=i):i=n[2],ji(i)},TS=t=>{let e=0,n=t;for(;n;)e+=n.offsetTop,n=n.offsetParent;return e},KN=(t,e)=>{let n=0,i=t;for(;i&&i!==e;)n+=i.offsetTop,i=i.offsetParent;return i===e?n:TS(t)-TS(e)},wS=({viewport:t,anchor:e,tallerThan:n,visibleHeight:i})=>{const a=KN(e,t),o=e.offsetHeight;return a+Math.max(0,o-(o<=n?o:i))},ZN=({scrollHeight:t,...e})=>{const{viewport:n}=e,i=wS(e)+n.clientHeight;return Math.max(0,i-t)},JN=({viewport:t,reserve:e,...n})=>ZN({viewport:t,...n,scrollHeight:t.scrollHeight-e.offsetHeight}),WN=t=>{const e=new ResizeObserver(t),n=new MutationObserver(t);let i=null,a=null,o=null;const u=()=>{e.disconnect(),n.disconnect(),i=null,a=null,o=null};return{target:(d,f,h)=>{i===d&&a===f&&o===h||(u(),e.observe(d),e.observe(f),e.observe(h),n.observe(h,{childList:!0,subtree:!0,characterData:!0}),i=d,a=f,o=h)},disconnect:u}},ez=t=>{let e=null;return{schedule:()=>{e===null&&(e=requestAnimationFrame(()=>{e=null,t()}))},cancel:()=>{e!==null&&(cancelAnimationFrame(e),e=null)}}},tz=t=>{let e=null,n;function i(){const d=t.getState(),{viewport:f,anchor:h,target:m}=d.element,v=d.targetConfig;if(d.turnAnchor!=="top"||!f||!h||!m||!v){o.disconnect(),e&&(pS(e,0),e.remove());return}if(e??(e=yN()),(e.parentElement!==m.parentElement||e.previousElementSibling!==m)&&m.after(e),o.target(f,h,m),pS(e,JN({viewport:f,anchor:h,reserve:e,...v}))){a.schedule();return}const y=vN(h);if(y!==void 0&&n===y)return;const b=bN(wS({viewport:f,anchor:h,...v}));Math.abs(f.scrollTop-b)>1&&f.scrollTo({top:b,behavior:"smooth"}),y!==void 0&&(n=y)}const a=ez(i),o=WN(a.schedule);a.schedule();const u=t.subscribe(a.schedule);return()=>{a.cancel(),u(),o.disconnect(),e?.remove()}},nz=t=>{const e=Y(4),n=Di();let i,a;e[0]!==t||e[1]!==n?(i=()=>{if(t)return tz(n)},a=[t,n],e[0]=t,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),Qa(i,a)},CS=({isRunning:t,messages:e})=>{if(!t)return null;const n=e.at(-1),i=e.at(-2);return i?.role!=="user"||n?.role!=="assistant"?null:{anchorId:i.id,targetId:n.id}},rz=t=>{var e;return(e=CS(t))==null?void 0:e.anchorId},iz=t=>{var e;return(e=CS(t))==null?void 0:e.targetId},sz=()=>SS(Oi(lz),uz),az=()=>ji(Oi(cz)),oz=t=>{const e=Y(13),n=Di();let i;e[0]!==t?(i=b=>{if(t)return rz(b.thread)},e[0]=t,e[1]=i):i=e[1];const a=ce(i);let o;e[2]!==t?(o=b=>{if(t)return iz(b.thread)},e[2]=t,e[3]=o):o=e[3];const u=ce(o);let d;e:{if(!a||!u){d=null;break e}let b;e[4]!==a||e[5]!==u?(b={anchorId:a,targetId:u},e[4]=a,e[5]=u,e[6]=b):b=e[6],d=b}const f=d;let h,m;e[7]!==f||e[8]!==n?(h=()=>
93{if(!f)return;const b=n.getState(),S=b.topAnchorTurn;S?.anchorId===f.anchorId&&S.targetId===f.targetId||b.setTopAnchorTurn(f)},m=[f,n],e[7]=f,e[8]=n,e[9]=h,e[10]=m):(h=e[9],m=e[10]),Qa(h,m);let v;e[11]!==n?(v=()=>{n.getState().setTopAnchorTurn(null)},e[11]=n,e[12]=v):v=e[12];const y=v;eu("thread.initialize",y),eu("threadListItem.switchedTo",y)},ES=O.forwardRef((t,e)=>{const n=Y(18);let i,a,o,u,d,f;n[0]!==t?({autoScroll:i,scrollToBottomOnRunStart:d,scrollToBottomOnInitialize:u,scrollToBottomOnThreadSwitch:f,children:a,...o}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=d,n[6]=f):(i=n[1],a=n[2],o=n[3],u=n[4],d=n[5],f=n[6]);let h;n[7]!==i||n[8]!==u||n[9]!==d||n[10]!==f?(h={autoScroll:i,scrollToBottomOnRunStart:d,scrollToBottomOnInitialize:u,scrollToBottomOnThreadSwitch:f},n[7]=i,n[8]=u,n[9]=d,n[10]=f,n[11]=h):h=n[11];const m=GN(h),v=sz(),y=az(),b=Di();let S;n[12]!==b?(S=b.getState(),n[12]=b,n[13]=S):S=n[13];const _=S.turnAnchor==="top";oz(_),nz(_);const w=Vt(e,m,v,y);let C;return n[14]!==a||n[15]!==w||n[16]!==o?(C=T.jsx(st.div,{...o,ref:w,children:a}),n[14]=a,n[15]=w,n[16]=o,n[17]=C):C=n[17],C});ES.displayName="ThreadPrimitive.ViewportScrollable";const AS=O.forwardRef((t,e)=>{const n=Y(13);let i,a,o;n[0]!==t?({turnAnchor:o,topAnchorMessageClamp:a,...i}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o):(i=n[1],a=n[2],o=n[3]);let u;n[4]!==a||n[5]!==o?(u={turnAnchor:o,topAnchorMessageClamp:a},n[4]=a,n[5]=o,n[6]=u):u=n[6];let d;n[7]!==i||n[8]!==e?(d=T.jsx(ES,{...i,ref:e}),n[7]=i,n[8]=e,n[9]=d):d=n[9];let f;return n[10]!==u||n[11]!==d?(f=T.jsx(ph,{options:u,children:d}),n[10]=u,n[11]=d,n[12]=f):f=n[12],f});AS.displayName="ThreadPrimitive.Viewport";function lz(t){return t.registerViewport}function uz(t){return t.clientHeight}function cz(t){return t.registerViewportElement}const RS=O.forwardRef((t,e)=>{const n=Y(3),i=Vt(e,SS(Oi(dz),fz));let a;return n[0]!==t||n[1]!==i?(a=T.jsx(st.div,{...t,ref:i}),n[0]=t,n[1]=i,n[2]=a):a=n[2],a});RS.displayName="ThreadPrimitive.ViewportFooter";function dz(t){return t.registerContentInset}function fz(t){const e=parseFloat(getComputedStyle(t).marginTop)||0;return t.offsetHeight+e}const hz=t=>{const e=Y(5);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{behavior:i}=n,a=Oi(mz),o=Di();let u;e[2]!==i||e[3]!==o?(u=()=>{o.getState().scrollToBottom({behavior:i})},e[2]=i,e[3]=o,e[4]=u):u=e[4];const d=u;return a?null:d},pz=$n("ThreadPrimitive.ScrollToBottom",hz,["behavior"]);function mz(t){return t.isAtBottom}const gz=t=>{const e=Y(4),{prompt:n,send:i,clearComposer:a,autoSend:o}=t,u=i??o??!1;let d;e[0]!==a||e[1]!==n||e[2]!==u?(d={prompt:n,send:u,clearComposer:a},e[0]=a,e[1]=n,e[2]=u,e[3]=d):d=e[3];const{disabled:f,trigger:h}=tI(d);return f?null:h},vz=$n("ThreadPrimitive.Suggestion",gz,["prompt","send","clearComposer","autoSend","method"]);var tp=Ns({Empty:()=>xS,If:()=>_S,MessageByIndex:()=>i1,Messages:()=>C4,Root:()=>bS,ScrollToBottom:()=>pz,Suggestion:()=>vz,SuggestionByIndex:()=>z1,Suggestions:()=>w3,Unstable_MessageById:()=>s1,Viewport:()=>AS,ViewportFooter:()=>RS,ViewportProvider:()=>ph}),yz=Ns({AssistantRuntimeImpl:()=>Xf,BaseAssistantRuntimeCore:()=>Kf,CompositeContextProvider:()=>If,DefaultThreadComposerRuntimeCore:()=>Hb,MessageRepository:()=>Pb,ThreadRuntimeImpl:()=>Db,getAutoStatus:()=>Jf,splitLocalRuntimeOptions:()=>dI,useComposerInputPluginRegistryOptional:()=>Lu,useSmooth:()=>fS,useSmoothStatus:()=>fN,withSmoothContextProvider:()=>dN});
93const np="chat-conversation-token",bz="chat-messages",xz={render_project_card:"ProjectCard",render_repo_card:"RepoCard",render_recipe_card:"RecipeCard"};function MS(t){try{sessionStorage.setItem(bz,JSON.stringify(t))}catch{}}class _z extends Error{constructor(e,n){super(e),this.name="RateLimitError",this.retryAfterSec=n}}function Sz(){try{return sessionStorage.getItem(np)}catch{return null}}function Tz(t){try{sessionStorage.setItem(np,t)}catch{}}function wz(){try{sessionStorage.removeItem(np)}catch{}}let Hu=null;async function Cz(){if(!(typeof window.turnstile<"u"))return Hu||(Hu=new Promise(t=>{const e=document.createElement("script");e.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",e.async=!0,e.defer=!0,e.onload=()=>t(),document.head.appendChild(e)}),Hu)}function Ez(t){if(!t)return null;const e=t.querySelector('[role="dialog"]');return e||(t.querySelector('[data-side="bottom"]')??null)}async function Az(t,e){await Cz();const n=Ez(e)??e,i=document.createElement("div");i.style.cssText="position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.5);border-radius:inherit";const a=document.createElement("div");return a.style.cssText="background:#fff;border-radius:12px;padding:24px;box-shadow:0 8px 32px rgba(0,0,0,.25)",i.appendChild(a),n?(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(i)):(i.style.position="fixed",i.style.zIndex="2147483647",document.body.appendChild(i)),new Promise((o,u)=>{window.turnstile.render(a,{sitekey:t,callback:d=>{i.remove(),o(d)},"error-callback":()=>{i.remove(),u(new Error("Captcha challenge failed"))}})})}function kS(t,e,n){let i=Sz();async function a(){if(i)return i;const u=t.replace(/\/+$/,""),d={};e&&(d.turnstileToken=await Az(e,n));const f=await fetch(`${u}/conversations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!f.ok){if(f.status===429){const{retryAfter:v}=await f.json().catch(()=>({retryAfter:60}));throw new _z(`Slow down cowboy, this comes from my personal budget. Retry in ${v}s.`,v)}const m=await f.json().catch(()=>({error:f.statusText}));throw new Error(`Failed to create conversation: ${m.error}`)}return i=(await f.json()).token,Tz(i),i}async function o(u,d,f){const h=t.replace(/\/+$/,""),m=await fetch(`${h}/chat`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({message:d}),signal:f});if(m.status===401)throw wz(),i=null,new Error("Session expired. Please try again.");return m}return{async*run({messages:u,abortSignal:d}){try{let f=function(){const A=[];return w&&A.push({type:"text",text:w}),A.push(...C),A};MS(u);const h=await a(),m=u[u.length-1];if(!m)return;const v=m.content.filter(A=>A.type==="text").map(A=>A.text).join("");if(!v)return;const y=await o(h,v,d);if(!y.ok){if(y.status===429){const{retryAfter:R}=await y.json().catch(()=>({retryAfter:60}));yield{content:[],status:{type:"incomplete",reason:"error",error:`Slow down cowboy, this comes from my personal budget. Retry in ${R}s.`}};return}const A=await y.json().catch(()=>({error:y.statusText}));throw new Error(A.error||"Chat request failed")}const b=y.body.getReader(),S=new TextDecoder;let _="",w="";const C=[];for(;;){const{done:A,value:R}=await b.read();if(A)break;_+=S.decode(R,{stream:!0});let D;for(;(D=_.indexOf(`
94
95`))>=0;){const N=_.slice(0,D);_=_.slice(D+2);let I="",z="";for(const q of N.split(`
96`))q.startsWith("event: ")?I=q.slice(7):q.startsWith("data: ")&&(z=q.slice(6));if(z){if(I==="token"){const{text:q}=JSON.parse(z);q&&(w+=q,yield{content:f()})}else if(I==="ui"){const{tool:q,props:X}=JSON.parse(z),V=xz[q];if(!V)continue;C.push({type:"generative-ui",spec:{root:{component:V,props:X}}}),yield{content:f()}}else if(I==="done"){MS([...u,{role:"assistant",content:f()}]);return}else if(I==="error"){const{message:q}=JSON.parse(z);if(q?.toLowerCase().includes("rate")){yield{content:[],status:{type:"incomplete",reason:"error",error:"Slow down cowboy, this comes from my personal budget. Retry in 60s."}};return}throw new Error(q)}}}}}catch(f){yield{content:[],status:{type:"incomplete",reason:"error",error:f instanceof Error?f.message:String(f)}}}}}}const Rz=(t,e)=>typeof t=="string"?t===e:JSON.stringify(t)===JSON.stringify(e),Mz=(t,e)=>{if(!t||!e)return!1;const n=i=>{const{position:a,data:o,...u}=i||{};return u};return JSON.stringify(n(t.properties))===JSON.stringify(n(e.properties))&&Rz(t.children,e.children)},IS=(t,e)=>
96Mz(t.node,e.node),rp=O.createContext(null),kz=()=>O.useContext(rp)!==null,Iz=({children:t,fallbackPre:e,...n})=>{var i;return((i=n.node)==null?void 0:i.children.some(a=>a.type==="element"&&a.tagName==="code"))??!0?T.jsx(rp.Provider,{value:n,children:t}):T.jsx(e,{...n,children:t})},Oz=O.memo(Iz,(t,e)=>t.fallbackPre===e.fallbackPre&&IS(t,e)),Dz=({node:t,...e})=>T.jsx("pre",{...e}),Nz=({node:t,...e})=>T.jsx("code",{...e}),OS=({node:t,components:{Pre:e,Code:n},code:i})=>T.jsx(e,{children:T.jsx(n,{node:t,children:i})}),zz=()=>null,jz=t=>{var e;return((e=/language-([^\s]+)/.exec(t??""))==null?void 0:e[1])??""},Bz=({node:t,components:{Pre:e,Code:n,SyntaxHighlighter:i,CodeHeader:a},language:o,code:u})=>{const d=O.useMemo(()=>({Pre:e,Code:n}),[e,n]);return T.jsxs(T.Fragment,{children:[T.jsx(a,{node:t,language:o,code:u}),T.jsx(i,{node:t,components:d,language:o,code:u})]})};var ip={exports:{}};/*!
97	Copyright (c) 2018 Jed Watson.
98	Licensed under the MIT License (MIT), see
99	http://jedwatson.github.io/classnames
100*/var DS;function Pz(){return DS||(DS=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",u=0;u<arguments.length;u++){var d=arguments[u];d&&(o=a(o,i(d)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var u="";for(var d in o)e.call(o,d)&&o[d]&&(u=a(u,d));return u}function a(o,u){return u?o?o+" "+u:o+u:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(ip)),ip.exports}var Lz=Pz();const NS=qa(Lz),zS=({className:t,...e})=>({className:n,...i})=>({className:NS(t,n),...e,...i});var Uz=Object.defineProperty,Hz=(t,e)=>Uz(t,"name",{value:e,configurable:!0});function lo(t){const e=O.useRef(t);return O.useEffect(()=>{e.current=t}),O.useMemo(()=>((...n)=>{var i;return(i=e.current)==null?void 0:i.call(e,...n)}),[])}Hz(lo,"useCallbackRef");const qz=({node:t,components:{Pre:e,Code:n,SyntaxHighlighter:i,CodeHeader:a},componentsByLanguage:o={},children:u,...d})=>{var f,h;const m=O.useContext(rp),v=zS(m),y=lo(A=>T.jsx(e,{...v(A)})),b=zS(d),S=lo(A=>T.jsx(n,{...b(A)})),_=jz(d.className);if(typeof u!="string")return T.jsx(OS,{node:t,components:{Pre:y,Code:S},code:u});const w=((f=o[_])==null?void 0:f.SyntaxHighlighter)??i,C=((h=o[_])==null?void 0:h.CodeHeader)??a;return T.jsx(Bz,{node:t,components:{Pre:y,Code:S,SyntaxHighlighter:w,CodeHeader:C},language:_,code:u})},Vz=({node:t,components:e,componentsByLanguage:n,...i})=>kz()?T.jsx(qz,{node:t,components:e,componentsByLanguage:n,...i}):T.jsx(e.Code,{...i}),$z=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const i of n){if(!Object.hasOwn(e,i))return!1;const a=t[i],o=e[i];if(a!==o&&(!a||!o||a.SyntaxHighlighter!==o.SyntaxHighlighter||a.CodeHeader!==o.CodeHeader))return!1}return!0},Fz=O.memo(Vz,(t,e)=>t.components===e.components&&$z(t.componentsByLanguage,e.componentsByLanguage)&&IS(t,e));function HL(){}function qL(){}function Yz(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Gz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xz={};function jS(t,e){return(Xz.jsx?Qz:Gz).test(t)}const Kz=/[ \t\n\f\r]/g;function Zz(t){return typeof t=="object"?t.type==="text"?BS(t.value):!1:BS(t)}function BS(t){return t.replace(Kz,"")===""}class uo{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}uo.prototype.normal={},uo.prototype.property={},uo.prototype.space=void 0;function PS(t,e){const n={},i={};for(const a of t)Object.assign(n,a.property),Object.assign(i,a.normal);return new uo(n,i,e)}function sp(t){return t.toLowerCase()}class $t{constructor(e,n){this.attribute=n,this.property=e}}$t.prototype.attribute="",$t.prototype.booleanish=!1,$t.prototype.boolean=!1,$t.prototype.commaOrSpaceSeparated=!1,$t.prototype.commaSeparated=!1,$t.prototype.defined=!1,$t.prototype.mustUseProperty=!1,$t.prototype.number=!1,$t.prototype.overloadedBoolean=!1,$t.prototype.property="",$t.prototype.spaceSeparated=!1,$t.prototype.space=void 0;let Jz=0;const Te=Pi(),pt=Pi(),ap=Pi(),ue=Pi(),We=Pi(),Bi=Pi(),sn=Pi();function Pi(){return 2**++Jz}const op=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:pt,commaOrSpaceSeparated:sn,commaSeparated:Bi,number:ue,overloadedBoolean:ap,spaceSeparated:We},Symbol.toStringTag,{value:"Module"})),lp=Object.keys(op);class up extends $t{constructor(e,n,i,a){let o=-1;if(super(e,n),LS(this,"space",a),typeof i=="number")for(;++o<lp.length;){const u=lp[o];LS(this,lp[o],(i&op[u])===op[u])}}}up.prototype.defined=!0;function LS(t,e,n){n&&(t[e]=n)}function Fs(t){const e={},n={};for(const[i,a]of Object.entries(t.properties)){const o=new up(i,t.transform(t.attributes||{},i),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,n[sp(i)]=i,n[sp(o.attribute)]=i}return new uo(e,n,t.space)}const US=Fs({properties:{ariaActiveDescendant:null,ariaAtomic:pt,ariaAutoComplete:null,ariaBusy:pt,ariaChecked:
vendor: 4,175 bytes, line 100
100pt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:We,ariaCurrent:null,ariaDescribedBy:We,ariaDetails:null,ariaDisabled:pt,ariaDropEffect:We,ariaErrorMessage:null,ariaExpanded:pt,ariaFlowTo:We,ariaGrabbed:pt,ariaHasPopup:null,ariaHidden:pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:We,ariaLevel:ue,ariaLive:null,ariaModal:pt,ariaMultiLine:pt,ariaMultiSelectable:pt,ariaOrientation:null,ariaOwns:We,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:pt,ariaReadOnly:pt,ariaRelevant:null,ariaRequired:pt,ariaRoleDescription:We,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:pt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function HS(t,e){return e in t?t[e]:e}function qS(t,e){return HS(t,e.toLowerCase())}const Wz=Fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bi,acceptCharset:We,accessKey:We,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alpha:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:We,autoFocus:Te,autoPlay:Te,blocking:We,capture:null,charSet:null,checked:Te,cite:null,className:We,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:pt,controls:Te,controlsList:We,coords:ue|Bi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:ap,draggable:pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:We,height:ue,hidden:ap,high:ue,href:null,hrefLang:null,htmlFor:We,httpEquiv:We,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:We,itemRef:We,itemScope:Te,itemType:We,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:ue,pattern:null,ping:We,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:We,required:Te,reversed:Te,rows:ue,rowSpan:ue,sandbox:We,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootCustomElementRegistry:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shadowRootSerializable:Te,shape:null,size:ue,sizes:null,slot:null,span:ue,spell
100Check:pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:pt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:We,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:pt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Te,disablePictureInPicture:Te,disableRemotePlayback:Te,exportParts:Bi,part:We,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:qS}),ej=Fs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
100-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:sn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:We,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bi,g2:Bi,glyphName:Bi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:sn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 15,314 bytes, lines 100-101
100Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:We,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sn,rev:sn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sn,requiredFeatures:sn,requiredFonts:sn,requiredFormats:sn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:sn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:HS}),VS=Fs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),$S=Fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qS}),FS=Fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),tj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},nj=/[A-Z]/g,YS=/-[a-z]/g,rj=/^data[-\w.:]+$/i;function ij(t,e){const n=sp(e);let i=e,a=$t;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rj.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(YS,aj);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!YS.test(o)){let u=o.replace(nj,sj);u.charAt(0)!=="-"&&(u="-"+u),e="data"+u}}a=up}return new a(i,e)}function sj(t){return"-"+t.toLowerCase()}function aj(t){return t.charAt(1).toUpperCase()}const oj=PS([US,Wz,VS,$S,FS],"html"),cp=PS([US,ej,VS,$S,FS],"svg");function lj(t){return t.join(" ").trim()}var Ys={},dp,GS;function uj(){if(GS)return dp;GS=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
101`,h="/",m="*",v="",y="comment",b="declaration";function S(w,C){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];C=C||{};var A=1,R=1;function D(ee){var J=ee.match(e);J&&(A+=J.length);var P=ee.lastIndexOf(f);R=~P?ee.length-P:R+ee.length}function N(){var ee={line:A,column:R};return function(J){return J.position=new I(ee),X(),J}}function I(ee){this.start=ee,this.end={line:A,column:R},this.source=C.source}I.prototype.content=w;function z(ee){var J=new Error(C.source+":"+A+":"+R+": "+ee);if(J.reason=ee,J.filename=C.source,J.line=A,J.column=R,J.source=w,!C.silent)throw J}function q(ee){var J=ee.exec(w);if(J){var P=J[0];return D(P),w=w.slice(P.length),J}}function X(){q(n)}function V(ee){var J;for(ee=ee||[];J=$();)J!==!1&&ee.push(J);return ee}function $(){var ee=N();if(!(h!=w.charAt(0)||m!=w.charAt(1))){for(var J=2;v!=w.charAt(J)&&(m!=w.charAt(J)||h!=w.charAt(J+1));)++J;if(J+=2,v===w.charAt(J-1))return z("End of comment missing");var P=w.slice(2,J-2);return R+=2,D(P),w=w.slice(J),R+=2,ee({type:y,comment:P})}}function L(){var ee=N(),J=q(i);if(J){if($(),!q(a))return z("property missing ':'");var P=q(o),te=ee({type:b,property:_(J[0].replace(t,v)),value:P?_(P[0].replace(t,v)):v});return q(u),te}}function Q(){var ee=[];V(ee);for(var J;J=L();)J!==!1&&(ee.push(J),V(ee));return ee}return X(),Q()}function _(w){return w?w.replace(d,v):v}return dp=S,dp}var QS;function cj(){if(QS)return Ys;QS=1;var t=Ys&&Ys.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const e=t(uj());function n(i,a){let o=null;if(!i||typeof i!="string")return o;const u=(0,e.default)(i),d=typeof a=="function";return u.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:m}=f;d?a(h,m,f):m&&(o=o||{},o[h]=m)}),o}return Ys}var co={},XS;function dj(){if(XS)return co;XS=1,Object.defineProperty(co,"__esModule",{value:!0}),co.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||t.test(h)},u=function(h,m){return m.toUpperCase()},d=function(h,m){return"".concat(m,"-")},f=function(h,m){return m===void 0&&(m={}),o(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(a,d):h=h.replace(i,d),h.replace(e,u))};return co.camelCase=f,co}var fo,KS;function fj(){if(KS)return fo;KS=1;var t=fo&&fo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},e=t(cj()),n=dj();function i(a,o){var u={};return!a||typeof a!="string"||(0,e.default)(a,function(d,f){d&&f&&(u[(0,n.camelCase)(d,o)]=f)}),u}return i.default=i,fo=i,fo}var hj=fj();const pj=qa(hj),ZS=JS("end"),fp=JS("start");function JS(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function mj(t){const e=fp(t),n=ZS(t);if(e&&n)return{start:e,end:n}}function ho(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?WS(t.position):"start"in t||"end"in t?WS(t):"line"in t||"column"in t?hp(t):""}function hp(t){return eT(t&&t.line)+":"+eT(t&&t.column)}function WS(t){return hp(t&&t.start)+"-"+hp(t&&t.end)}function eT(t){return t&&typeof t=="number"?t:1}class Rt extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let a="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?a=e:!o.cause&&e&&(u=!0,a=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?o.ruleId=i:(o.source=i.slice(0,f),o.ruleId=i.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=ho(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rt.prototype.file="",Rt.prototype.name="",Rt.prototype.reason="",Rt.prototype.message="",Rt.prototype.stack="",Rt.prototype.column=void 0,Rt.prototype.line=void 0,Rt.prototype.ancestors=void 0,Rt.prototype.cause=void 0,Rt.prototype.fatal=void 0,Rt.prototype.place=void 0,Rt.prototype.ruleId=void 0,Rt.prototype.source=void 0;const pp={}.hasOwnProperty,gj=new Map,vj=/[A-Z]/g,yj=new Set(["table","tbody","thead","tfoot","tr"]),bj=new Set(["td","th"]),tT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xj(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Rj(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Aj(n,e.jsx,e.jsxs)}const a={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?cp:oj,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=nT(a,t,void 0);return o&&typeof o!="string"?o:a.create(t,a.Fragment,{children:o||void 0},void 0)}function nT(t,e,n){if(e.type==="element")return _j(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Sj(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return wj(t,e,n);if(e.type==="mdxjsEsm")return Tj(t,e);if(e.type==="root")return Cj(t,e,n);if(e.type==="text")return Ej(t,e)}function _j(t,e,n){const i=t.schema;let a=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=cp,t.schema=a),t.ancestors.push(e);const o=iT(t,e.tagName,!1),u=Mj(t,e);let d=gp(t,e);return yj.has(e.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!Zz(f):!0})),rT(t,u,o,e),mp(u,d),t.ancestors.pop(),t.schema=i,t.create(e,o,u,n)}function Sj(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}po(t,e.position)}function Tj(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);po(t,e.position)}function wj(t,e,n){const i=t.schema;let a=i;e.name==="svg"&&i.space==="html"&&(a=cp,t.schema=a),t.ancestors.push(e);const o=e.name===null?t.Fragment:iT(t,e.name,!0),u=kj(t,e),d=gp(t,e);return rT(t,u,o,e),mp(u,d),t.ancestors.pop(),t.schema=i,t.create(e,o,u,n)}function Cj(t,e,n){const i={};return mp(i,gp(t,e)),t.create(e,t.Fragment,i,n)}function Ej(t,e){return e.value}function rT(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function mp(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Aj(t,e,n){return i;function i(a,o,u,d){const h=Array.isArray(u.children)?n:e;return d?h(o,u,d):h(o,u)}}function Rj(t,e){return n;function n(i,a,o,u){const d=Array.isArray(o.children),f=fp(i);return e(a,o,u,d,{columnNumber:f?f.column-1:void 0,fileName:t,lineNumber:f?f.line:void 0},void 0)}}function Mj(t,e){const n={};let i,a;for(a in e.properties)if(a!=="children"&&pp.call(e.properties,a)){const o=Ij(t,a,e.properties[a]);if(o){const[u,d]=o;t.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&bj.has(e.tagName)?i=d:n[u]=d}}if(i){const o=n.style||(n.style={});o[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function kj(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const o=i.data.estree.body[0];o.type;const u=o.expression;u.type;const d=u.properties[0];d.type,Object.assign(n,t.evaluater.evaluateExpression(d.argument))}else po(t,e.position);else{const a=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const d=i.value.data.estree.body[0];d.type,o=t.evaluater.evaluateExpression(d.expression)}else po(t,e.position);else o=i.value===null?!0:i.value;n[a]=o}return n}function gp(t,e){const n=[];let i=-1;const a=t.passKeys?new Map:gj;for(;++i<e.children.length;){const o=e.children[i];let u;if(t.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const h=a.get(f)||0;u=f+"-"+h,a.set(f,h+1)}}const d=nT(t,o,u);d!==void 0&&n.push(d)}return n}function Ij(t,e,n){const i=ij(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Yz(n):lj(n)),i.property==="style"){let a=typeof n=="object"?n:Oj(t,String(n));return t.stylePropertyNameCase==="css"&&(a=Dj(a)),["style",a]}return[t.elementAttributeNameCase==="react"&&i.space?tj[i.property]||i.property:i.attribute,n]}}function Oj(t,e){try{return pj(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,a=new Rt("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=t.filePath||void 0,a.url=tT+"#cannot-parse-style-attribute",a}}function iT(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const a=e.split(".");let o=-1,u;for(;++o<a.length;){const d=jS(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}i=u}else i=jS(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const a=i.value;return pp.call(t.components,a)?t.components[a]:a}if(t.evaluater)return t.evaluater.evaluateExpression(i);po(t)}function po(t,e){const n=new Rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=tT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dj(t){const e={};let n;for(n in t)pp.call(t,n)&&(e[Nj(n)]=t[n]);return e}function Nj(t){let e=t.replace(vj,zj);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function zj(t){return"-"+t.toLowerCase()}const vp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jj={};function Bj(t,e){const n=jj,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sT(t,i,a)}function sT(t,e,n){if(Pj(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return aT(t.children,e,n)}return Array.isArray(t)?aT(t,e,n):""}function aT(t,e,n){const i=[];let a=-1;for(;++a<t.length;)i[a]=sT(t[a],e,n);return i.join("")}function Pj(t){return!!(t&&typeof t=="object")}
vendor: 10,994 bytes, line 101
101const oT=document.createElement("i");function yp(t){const e="&"+t+";";oT.innerHTML=e;const n=oT.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Kn(t,e,n,i){const a=t.length;let o=0,u;if(e<0?e=-e>a?0:a+e:e=e>a?a:e,n=n>0?n:0,i.length<1e4)u=Array.from(i),u.unshift(e,n),t.splice(...u);else for(n&&t.splice(e,n);o<i.length;)u=i.slice(o,o+1e4),u.unshift(e,0),t.splice(...u),o+=1e4,e+=1e4}function wn(t,e){return t.length>0?(Kn(t,t.length,0,e),t):e}const lT={}.hasOwnProperty;function Lj(t){const e={};let n=-1;for(;++n<t.length;)Uj(e,t[n]);return e}function Uj(t,e){let n;for(n in e){const a=(lT.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let u;if(o)for(u in o){lT.call(a,u)||(a[u]=[]);const d=o[u];Hj(a[u],Array.isArray(d)?d:d?[d]:[])}}}function Hj(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Kn(t,0,0,i)}function uT(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Gs(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zn=ii(/[A-Za-z]/),an=ii(/[\dA-Za-z]/),qj=ii(/[#-'*+\--9=?A-Z^-~]/);function bp(t){return t!==null&&(t<32||t===127)}const xp=ii(/\d/),Vj=ii(/[\dA-Fa-f]/),$j=ii(/[!-/:-@[-`{-~]/);function Se(t){return t!==null&&t<-2}function Ft(t){return t!==null&&(t<0||t===32)}function He(t){return t===-2||t===-1||t===32}const Fj=ii(new RegExp("\\p{P}|\\p{S}","u")),Yj=ii(/\s/);function ii(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Qs(t){const e=[];let n=-1,i=0,a=0;for(;++n<t.length;){const o=t.charCodeAt(n);let u="";if(o===37&&an(t.charCodeAt(n+1))&&an(t.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const d=t.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(u=String.fromCharCode(o,d),a=1):u="\uFFFD"}else u=String.fromCharCode(o);u&&(e.push(t.slice(i,n),encodeURIComponent(u)),i=n+a+1,u=""),a&&(n+=a,a=0)}return e.join("")+t.slice(i)}function et(t,e,n,i){const a=i?i-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(f){return He(f)?(t.enter(n),d(f)):e(f)}function d(f){return He(f)&&o++<a?(t.consume(f),d):(t.exit(n),e(f))}}const Gj={tokenize:Qj};function Qj(t){const e=t.attempt(this.parser.constructs.contentInitial,i,a);let n;return e;function i(d){if(d===null){t.consume(d);return}return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),et(t,e,"linePrefix")}function a(d){return t.enter("paragraph"),o(d)}function o(d){const f=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,u(d)}function u(d){if(d===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(d);return}return Se(d)?(t.consume(d),t.exit("chunkText"),o):(t.consume(d),u)}}const Xj={tokenize:Kj},cT={tokenize:Zj};function Kj(t){const e=this,n=[];let i=0,a,o,u;return d;function d(R){if(i<n.length){const D=n[i];return e.containerState=D[1],t.attempt(D[0].continuation,f,h)(R)}return h(R)}function f(R){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,a&&A();const D=e.events.length;let N=D,I;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){I=e.events[N][1].end;break}C(i);let z=D;for(;z<e.events.length;)e.events[z][1].end={...I},z++;return Kn(e.events,N+1,0,e.events.slice(D)),e.events.length=z,h(R)}return d(R)}function h(R){if(i===n.length){if(!a)return y(R);if(a.currentConstruct&&a.currentConstruct.concrete)return S(R);e.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(cT,m,v)(R)}function m(R){return a&&A(),C(i),y(R)}function v(R){return e.parser.lazy[e.now().line]=i!==n.length,u=e.now().offset,S(R)}function y(R){return e.containerState={},t.attempt(cT,b,S)(R)}function b(R){return i++,n.push([e.currentConstruct,e.containerState]),y(R)}function S(R){if(R===null){a&&A(),C(0),t.consume(R);return}return a=a||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),_(R)}function _(R){if(R===null){w(t.exit("chunkFlow"),!0),C(0),t.consume(R);return}return Se(R)?(t.consume(R),w(t.exit("chunkFlow")),i=0,e.interrupt=void 0,d):(t.consume(R),_)}function w(R,D){const N=e.sliceStream(R);if(D&&N.push(null),R.previous=o,o&&(o.next=R),o=R,a.defineSkip(R.start),a.write(N),e.parser.lazy[R.start.line]){let I=a.events.length;for(;I--;)if(a.events[I][1].start.offset<u&&(!a.events[I][1].end||a.events[I][1].end.offset>u))return;const z=e.events.length;let q=z,X,V;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(X){V=e.events[q][1].end;break}X=!0}for(C(i),I=z;I<e.events.length;)e.events[I][1].end={...V},I++;Kn(e.events,q+1,0,e.events.slice(z)),e.events.length=I}}function C(R){let D=n.length;for(;D-- >R;){const N=n[D];e.containerState=N[1],N[0].exit.call(e,t)}n.length=R}function A(){a.write([null]),o=void 0,a=void 0,e.containerState._closeFlow=void 0}}function Zj(t,e,n){return et(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dT(t){if(t===null||Ft(t)||Yj(t))return 1;if(Fj(t))return 2}function _p(t,e,n){const i=[];let a=-1;for(;++a<t.length;){const o=t[a].resolveAll;o&&!i.includes(o)&&(e=o(e,n),i.push(o))}return e}const Sp={name:"attention",resolveAll:Jj,tokenize:Wj};function Jj(t,e){let n=-1,i,a,o,u,d,f,h,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;f=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const v={...t[i][1].end},y={...t[n][1].start};fT(v,-f),fT(y,f),u={type:f>1?"strongSequence":"emphasisSequence",start:v,end:{...t[i][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:y},o={type:f>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},t[i][1].end={...u.start},t[n][1].start={...d.end},h=[],t[i][1].end.offset-t[i][1].start.offset&&(h=wn(h,[["enter",t[i][1],e],["exit",t[i][1],e]])),h=wn(h,[["enter",a,e],["enter",u,e],["exit",u,e],["enter",o,e]]),h=wn(h,_p(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),h=wn(h,[["exit",o,e],["enter",d,e],["exit",d,e],["exit",a,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,h=wn(h,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,Kn(t,i-1,n-i+3,h),n=i+h.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Wj(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,a=dT(i);let o;return u;function u(f){return o=f,t.enter("attentionSequence"),d(f)}function d(f){if(f===o)return t.consume(f),d;const h=t.exit("attentionSequence"),m=dT(f),v=!m||m===2&&a||n.includes(f),y=!a||a===2&&m||n.includes(i);return h._open=!!(o===42?v:v&&(a||!y)),h._close=!!(o===42?y:y&&(m||!v)),e(f)}}function fT(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const e8={name:"autolink",tokenize:t8};function t8(t,e,n){let i=0;return a;function a(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(b){return Zn(b)?(t.consume(b),u):b===64?n(b):h(b)}function u(b){return b===43||b===45||b===46||an(b)?(i=1,d(b)):h(b)}function d(b){return b===58?(t.consume(b),i=0,f):(b===43||b===45||b===46||an(b))&&i++<32?(t.consume(b),d):(i=0,h(b))}function f(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||bp(b)?n(b):(t.consume(b),f)}function h(b){return b===64?(t.consume(b),m):qj(b)?(t.consume(b),h):n(b)}function m(b){return an(b)?v(b):n(b)}function v(b){return b===46?(t.consume(b),i=0,m):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):y(b)}function y(b){if((b===45||an(b))&&i++<63){const S=b===45?y:v;return t.consume(b),S}return n(b)}}const qu={partial:!0,tokenize:n8};function n8(t,e,n){return i;function i(o){return He(o)?et(t,a,"linePrefix")(o):a(o)}function a(o){return o===null||Se(o)?e(o):n(o)}}const hT={continuation:{tokenize:i8},exit:s8,name:"blockQuote",tokenize:r8};function r8(t,e,n){const i=this;return a;function a(u){if(u===62){const d=i.containerState;return d.open||(t.enter("blockQuote",{_container:!0}),d.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(u),t.exit("blockQuoteMarker"),o}return n(u)}function o(u){return He(u)?(t.enter("blockQuotePrefixWhitespace"),t.consume(u),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(u))}}function i8(t,e,n){const i=this;return a;function a(u){return He(u)?et(t,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return t.attempt(hT,e,n)(u)}}function s8(t){t.exit("blockQuote")}const pT={name:"characterEscape",tokenize:a8};function a8(t,e,n){return i;function i(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),a}function a(o){return $j(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const mT={name:"characterReference",tokenize:o8};function o8(t,e,n){const i=this;let a=0,o,u;return d;function d(v){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),f}function f(v){return v===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(v),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),o=31,u=an,m(v))}function h(v){return v===88||v===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(v),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,u=Vj,m):(t.enter("characterReferenceValue"),o=7,u=xp,m(v))}function m(v){if(v===59&&a){const y=t.exit("characterReferenceValue");return u===an&&!yp(i.sliceSerialize(y))?n(v):(t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return u(v)&&a++<o?(t.consume(v),m):n(v)}}const gT={partial:!0,tokenize:u8},vT={concrete:!0,name:"codeFenced",tokenize:l8};function l8(t,e,n){const i=this,a={partial:!0,tokenize:N};let o=0,u=0,d;return f;function f(I){return h(I)}function h(I){const z=i.events[i.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,d=I,t.enter("co
101deFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(I)}function m(I){return I===d?(u++,t.consume(I),m):u<3?n(I):(t.exit("codeFencedFenceSequence"),He(I)?et(t,v,"whitespace")(I):v(I))}function v(I){return I===null||Se(I)?(t.exit("codeFencedFence"),i.interrupt?e(I):t.check(gT,_,D)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),y(I))}function y(I){return I===null||Se(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),v(I)):He(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),et(t,b,"whitespace")(I)):I===96&&I===d?n(I):(t.consume(I),y)}function b(I){return I===null||Se(I)?v(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(I))}function S(I){return I===null||Se(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),v(I)):I===96&&I===d?n(I):(t.consume(I),S)}function _(I){return t.attempt(a,D,w)(I)}function w(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),C}function C(I){return o>0&&He(I)?et(t,A,"linePrefix",o+1)(I):A(I)}function A(I){return I===null||Se(I)?t.check(gT,_,D)(I):(t.enter("codeFlowValue"),R(I))}function R(I){return I===null||Se(I)?(t.exit("codeFlowValue"),A(I)):(t.consume(I),R)}function D(I){return t.exit("codeFenced"),e(I)}function N(I,z,q){let X=0;return V;function V(J){return I.enter("lineEnding"),I.consume(J),I.exit("lineEnding"),$}function $(J){return I.enter("codeFencedFence"),He(J)?et(I,L,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):L(J)}function L(J){return J===d?(I.enter("codeFencedFenceSequence"),Q(J)):q(J)}function Q(J){return J===d?(X++,I.consume(J),Q):X>=u?(I.exit("codeFencedFenceSequence"),He(J)?et(I,ee,"whitespace")(J):ee(J)):q(J)}function ee(J){return J===null||Se(J)?(I.exit("codeFencedFence"),z(J)):q(J)}}}function u8(t,e,n){const i=this;return a;function a(u){return u===null?n(u):(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),o)}function o(u){return i.parser.lazy[i.now().line]?n(u):e(u)}}const Tp={name:"codeIndented",tokenize:d8},c8={partial:!0,tokenize:f8};function d8(t,e,n){const i=this;return a;function a(h){return t.enter("codeIndented"),et(t,o,"linePrefix",5)(h)}function o(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?f(h):Se(h)?t.attempt(c8,u,f)(h):(t.enter("codeFlowValue"),d(h))}function d(h){return h===null||Se(h)?(t.exit("codeFlowValue"),u(h)):(t.consume(h),d)}function f(h){return t.exit("codeIndented"),e(h)}}function f8(t,e,n){const i=this;return a;function a(u){return i.parser.lazy[i.now().line]?n(u):Se(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),a):et(t,o,"linePrefix",5)(u)}function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?e(u):Se(u)?a(u):n(u)}}const h8={name:"codeText",previous:m8,resolve:p8,tokenize:g8};function p8(t){let e=t.length-4,n=3,i,a;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)a===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(a=i):(i===e||t[i][1].type==="lineEnding")&&(t[a][1].type="codeTextData",i!==a+2&&(t[a][1].end=t[i-1][1].end,t.splice(a+2,i-a-2),e-=i-a-2,i=a+2),a=void 0);return t}function m8(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function g8(t,e,n){let i=0,a,o;return u;function u(v){return t.enter("codeText"),t.enter("codeTextSequence"),d(v)}function d(v){return v===96?(t.consume(v),i++,d):(t.exit("codeTextSequence"),f(v))}function f(v){return v===null?n(v):v===32?(t.enter("space"),t.consume(v),t.exit("space"),f):v===96?(o=t.enter("codeTextSequence"),a=0,m(v)):Se(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),f):(t.enter("codeTextData"),h(v))}function h(v){return v===null||v===32||v===96||Se(v)?(t.exit("codeTextData"),f(v)):(t.consume(v),h)}function m(v){return v===96?(t.consume(v),a++,m):a===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(v)):(o.type="codeTextData",h(v))}}class v8{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const a=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return i&&mo(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),mo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);mo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);mo(this.left,n.reverse())}}}function mo(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function yT(t){const e={};let n=-1,i,a,o,u,d,f,h;const m=new v8(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,y8(m,n)),n=e[n],h=!0);else if(i[1]._container){for(o=n,a=void 0;o--;)if(u=m.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(i[1].end={...m.get(a)[1].start},d=m.slice(a,n),d.unshift(i),m.splice(a,n-a+1,d))}}return Kn(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function y8(t,e){const n=t.get(e)[1],i=t.get(e)[2];let a=e-1;const o=[];let u=n._tokenizer;u||(u=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,f=[],h={};let m,v,y=-1,b=n,S=0,_=0;const w=[_];for(;b;){for(;t.get(++a)[1]!==b;);o.push(a),b._tokenizer||(m=i.sliceStream(b),b.next||m.push(null),v&&u.defineSki
vendor: 18,586 bytes, line 101
101p(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),v=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(_=y+1,w.push(_),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):w.pop(),y=w.length;y--;){const C=d.slice(w[y],w[y+1]),A=o.pop();f.push([A,A+C.length-1]),t.splice(A,2,C)}for(f.reverse(),y=-1;++y<f.length;)h[S+f[y][0]]=S+f[y][1],S+=f[y][1]-f[y][0]-1;return h}const b8={resolve:_8,tokenize:S8},x8={partial:!0,tokenize:T8};function _8(t){return yT(t),t}function S8(t,e){let n;return i;function i(d){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?o(d):Se(d)?t.check(x8,u,o)(d):(t.consume(d),a)}function o(d){return t.exit("chunkContent"),t.exit("content"),e(d)}function u(d){return t.consume(d),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function T8(t,e,n){const i=this;return a;function a(u){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),et(t,o,"linePrefix")}function o(u){if(u===null||Se(u))return n(u);const d=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?e(u):t.interrupt(i.parser.constructs.flow,n,e)(u)}}function bT(t,e,n,i,a,o,u,d,f){const h=f||Number.POSITIVE_INFINITY;let m=0;return v;function v(C){return C===60?(t.enter(i),t.enter(a),t.enter(o),t.consume(C),t.exit(o),y):C===null||C===32||C===41||bp(C)?n(C):(t.enter(i),t.enter(u),t.enter(d),t.enter("chunkString",{contentType:"string"}),_(C))}function y(C){return C===62?(t.enter(o),t.consume(C),t.exit(o),t.exit(a),t.exit(i),e):(t.enter(d),t.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===62?(t.exit("chunkString"),t.exit(d),y(C)):C===null||C===60||Se(C)?n(C):(t.consume(C),C===92?S:b)}function S(C){return C===60||C===62||C===92?(t.consume(C),b):b(C)}function _(C){return!m&&(C===null||C===41||Ft(C))?(t.exit("chunkString"),t.exit(d),t.exit(u),t.exit(i),e(C)):m<h&&C===40?(t.consume(C),m++,_):C===41?(t.consume(C),m--,_):C===null||C===32||C===40||bp(C)?n(C):(t.consume(C),C===92?w:_)}function w(C){return C===40||C===41||C===92?(t.consume(C),_):_(C)}}function xT(t,e,n,i,a,o){const u=this;let d=0,f;return h;function h(b){return t.enter(i),t.enter(a),t.consume(b),t.exit(a),t.enter(o),m}function m(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(t.exit(o),t.enter(a),t.consume(b),t.exit(a),t.exit(i),e):Se(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||b===91||b===93||Se(b)||d++>999?(t.exit("chunkString"),m(b)):(t.consume(b),f||(f=!He(b)),b===92?y:v)}function y(b){return b===91||b===92||b===93?(t.consume(b),d++,v):v(b)}}function _T(t,e,n,i,a,o){let u;return d;function d(y){return y===34||y===39||y===40?(t.enter(i),t.enter(a),t.consume(y),t.exit(a),u=y===40?41:y,f):n(y)}function f(y){return y===u?(t.enter(a),t.consume(y),t.exit(a),t.exit(i),e):(t.enter(o),h(y))}function h(y){return y===u?(t.exit(o),f(u)):y===null?n(y):Se(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),et(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===u||y===null||Se(y)?(t.exit("chunkString"),h(y)):(t.consume(y),y===92?v:m)}function v(y){return y===u||y===92?(t.consume(y),m):m(y)}}function go(t,e){let n;return i;function i(a){return Se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),n=!0,i):He(a)?et(t,i,n?"linePrefix":"lineSuffix")(a):e(a)}}const w8={name:"definition",tokenize:E8},C8={partial:!0,tokenize:A8};function E8(t,e,n){const i=this;let a;return o;function o(b){return t.enter("definition"),u(b)}function u(b){return xT.call(i,t,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=Gs(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),f):n(b)}function f(b){return Ft(b)?go(t,h)(b):h(b)}function h(b){return bT(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return t.attempt(C8,v,v)(b)}function v(b){return He(b)?et(t,y,"whitespace")(b):y(b)}function y(b){return b===null||Se(b)?(t.exit("definition"),i.parser.defined.push(a),e(b)):n(b)}}function A8(t,e,n){return i;function i(d){return Ft(d)?go(t,a)(d):n(d)}function a(d){return _T(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return He(d)?et(t,u,"whitespace")(d):u(d)}function u(d){return d===null||Se(d)?e(d):n(d)}}const R8={name:"hardBreakEscape",tokenize:M8};function M8(t,e,n){return i;function i(o){return t.enter("hardBreakEscape"),t.consume(o),a}function a(o){return Se(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const k8={name:"headingAtx",resolve:I8,tokenize:O8};function I8(t,e){let n=t.length-2,i=3,a,o;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(a={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},o={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},Kn(t,i,n-i+1,[["enter",a,e],["enter",o,e],["exit",o,e],["exit",a,e]])),t}function O8(t,e,n){let i=0;return a;function a(m){return t.enter("atxHeading"),o(m)}function o(m){return t.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&i++<6?(t.consume(m),u):m===null||Ft(m)?(t.exit("atxHeadingSequence"),d(m)):n(m)}function d(m){return m===35?(t.enter("atxHeadingSequence"),f(m)):m===null||Se(m)?(t.exit("atxHeading"),e(m)):He(m)?et(t,d,"whitespace")(m):(t.enter("atxHeadingText"),h(m))}function f(m){return m===35?(t.consume(m),f):(t.exit("atxHeadingSequence"),d(m))}function h(m){return m===null||m===35||Ft(m)?(t.exit("atxHeadingText"),d(m)):(t.consume(m),h)}}const D8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ST=["pre","script","style","textarea"],N8={concrete:!0,name:"htmlFlow",resolveTo:B8,tokenize:P8},z8={partial:!0,tokenize:U8},j8={partial:!0,tokenize:L8};function B8(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function P8(t,e,n){const i=this;let a,o,u,d,f;return h;function h(M){return m(M)}function m(M){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(M),v}function v(M){return M===33?(t.consume(M),y):M===47?(t.consume(M),o=!0,_):M===63?(t.consume(M),a=3,i.interrupt?e:k):Zn(M)?(t.consume(M),u=String.fromCharCode(M),w):n(M)}function y(M){return M===45?(t.consume(M),a=2,b):M===91?(t.consume(M),a=5,d=0,S):Zn(M)?(t.consume(M),a=4,i.interrupt?e:k):n(M)}function b(M){return M===45?(t.consume(M),i.interrupt?e:k):n(M)}function S(M){const de="CDATA[";return M===de.charCodeAt(d++)?(t.consume(M),d===de.length?i.interrupt?e:L:S):n(M)}function _(M){return Zn(M)?(t.consume(M),u=String.fromCharCode(M),w):n(M)}function w(M){if(M===null||M===47||M===62||Ft(M)){const de=M===47,me=u.toLowerCase();return!de&&!o&&ST.includes(me)?(a=1,i.interrupt?e(M):L(M)):D8.includes(u.toLowerCase())?(a=6,de?(t.consume(M),C):i.interrupt?e(M):L(M)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(M):o?A(M):R(M))}return M===45||an(M)?(t.consume(M),u+=String.fromCharCode(M),w):n(M)}function C(M){return M===62?(t.consume(M),i.interrupt?e:L):n(M)}function A(M){return He(M)?(t.consume(M),A):V(M)}function R(M){return M===47?(t.consume(M),V):M===58||M===95||Zn(M)?(t.consume(M),D):He(M)?(t.consume(M),R):V(M)}function D(M){return M===45||M===46||M===58||M===95||an(M)?(t.consume(M),D):N(M)}function N(M){return M===61?(t.consume(M),I):He(M)?(t.consume(M),N):R(M)}function I(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(t.consume(M),f=M,z):He(M)?(t.consume(M),I):q(M)}function z(M){return M===f?(t.consume(M),f=null,X):M===null||Se(M)?n(M):(t.consume(M),z)}function q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Ft(M)?N(M):(t.consume(M),q)}function X(M){return M===47||M===62||He(M)?R(M):n(M)}function V(M){return M===62?(t.consume(M),$):n(M)}function $(M){return M===null||Se(M)?L(M):He(M)?(t.consume(M),$):n(M)}function L(M){return M===45&&a===2?(t.consume(M),P):M===60&&a===1?(t.consume(M),te):M===62&&a===4?(t.consume(M),j):M===63&&a===3?(t.consume(M),k):M===93&&a===5?(t.consume(M),le):Se(M)&&(a===6||a===7)?(t.exit("htmlFlowData"),t.check(z8,ne,Q)(M)):M===null||Se(M)?(t.exit("htmlFlowData"),Q(M)):(t.consume(M),L)}function Q(M){return t.check(j8,ee,ne)(M)}function ee(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),J}function J(M){return M===null||Se(M)?Q(M):(t.enter("htmlFlowData"),L(M))}function P(M){return M===45?(t.consume(M),k):L(M)}function te(M){return M===47?(t.consume(M),u="",G):L(M)}function G(M){if(M===62){const de=u.toLowerCase();return ST.includes(de)?(t.consume(M),j):L(M)}return Zn(M)&&u.length<8?(t.consume(M),u+=String.fromCharCode(M),G):L(M)}function le(M){return M===93?(t.consume(M),k):L(M)}function k(M){return M===62?(t.consume(M),j):M===45&&a===2?(t.consume(M),k):L(M)}function j(M){return M===null||Se(M)?(t.exit("htmlFlowData"),ne(M)):(t.consume(M),j)}function ne(M){return t.exit("htmlFlow"),e(M)}}function L8(t,e,n){const i=this;return a;function a(u){return Se(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),o):n(u)}function o(u){return i.parser.lazy[i.now().line]?n(u):e(u)}}function U8(t,e,n){return i;function i(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),t.attempt(qu,e,n)}}const H8={name:"htmlText",tokenize:q8};function q8(t,e,n){const i=this;let a,o,u;return d;function d(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),f}function f(k){return k===33?(t.consume(k),h):k===47?(t.consume(k),N):k===63?(t.consume(k),R):Zn(k)?(t.consume(k),q):n(k)}function h(k){return k===45?(t.consume(k),m):k===91?(t.consume(k),o=0,S):Zn(k)?(t.consume(k),A):n(k)}function m(k){return k===45?(t.consume(k),b):n(k)}function v(k){return k===null?n(k):k===45?(t.consume(k),y):Se(k)?(u=v,te(k)):(t.consume(k),v)}function y(k){return k===45?(t.consume(k),b):v(k)}function b(k){return k===62?P(k):k===45?y(k):v(k)}function S(k){const j="CDATA[";return k===j.charCodeAt(o++)?(t.consume(k),o===j.length?_:S):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),w):Se(k)?(u=_,te(k)):(t.consume(k),_)}function w(k){return k===93?(t.consume(k),C):_(k)}function C(k){return k===62?P(k):k===93?(t.consume(k),C):_(k)}function A(k){return k===null||k===62?P(k):Se(k)?(u=A,te(k)):(t.consume(k),A)}function R(k){return k===null?n(k):k===63?(t.consume(k),D):Se(k)?(u=R,te(k)):(t.consume(k),R)}function D(k){return k===62?P(k):R(k)}function N(k){return Zn(k)?(t.consume(k),I):n(k)}function I(k){return k===45||an(k)?(t.consume(k),I):z(k)}function z(k){return Se(k)?(u=z,te(k)):He(k)?(t.consume(k),z):P(k)}function q(k){return k===45||an(k)?(t.consume(k),q):k===47||k===62||Ft(k)?X(k):n(k)}function X(k){return k===47?(t.consume(k),P):k===58||k===95||Zn(k)?(t.consume(k),V):Se(k)?(u=X,te(k)):He(k)?(t.consume(k),X):P(k)}function V(k){return k===45||k===46||k===58||k===95||an(k)?(t.consume(k),V):$(k)}function $(k){return k===61?(t.consume(k),L):Se(k)?(u=$,te(k)):He(k)?(t.consume(k),$):X(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),a=k,Q):Se(k)?(u=L,te(k)):He(k)?(t.consume(k),L):(t.consume(k),ee)}function Q(k){return k===a?(t.consume(k),a=void 0,J):k===null?n(k):Se(k)?(u=Q,te(k)):(t.consume(k),Q)}function ee(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ft(k)?X(k):(t.consume(k),ee)}function J(k){return k===47||k===62||Ft(k)?X(k):n(k)}function P(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function te(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),G}function G(k){return He(k)?et(t,le,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):le(k)}function le(k){return t.enter("htmlTextData"),u(k)}}const wp={name:"labelEnd",resolveAll:Y8,resolveTo:G8,tokenize:Q8},V8={tokenize:X8},$8={tokenize:K8},F8={tokenize:Z8};function Y8(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const a=i.type==="labelImage"?4:2;i.type="data",e+=a}}return t.length!==n.length&&Kn(t,0,t.length,n),t}function G8(t,e){let n=t.length,i=0,a,o,u,d;for(;n--;)if(a=t[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;t[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(t[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){i=2;break}}else a.type==="labelEnd"&&(u=n);const f={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[o][1].start},end:{...t[u][1].end}},m={type:"labelText",start:{...t[o+i+2][1].end},end:{...t[u-2][1].start}};return d=[["enter",f,e],["enter",h,e]],d=wn(d,t.slice(o+1,o+i+3)),d=wn(d,[["enter",m,e]]),d=wn(d,_p(e.parser.constructs.insideSpan.null,t.slice(o+i+4,u-3),e)),d=wn(d,[["exit",m,e],t[u-2],t[u-1],["exit",h,e]]),d=wn(d,t.slice(u+1)),d=wn(d,[["exit",f,e]]),Kn(t,o,t.length,d),t}function Q8(t,e,n){const i=this;let a=i.events.length,o,u;for(;a--;)if((i.events[a][1].type==="labelImage"||i.events[a][1].type==="labelLink")&&!i.events[a][1]._balanced){o=i.events[a][1];break}return d;function d(y){return o?o._inactive?v(y):(u=i.parser.defined.includes(Gs(i.sliceSerialize({start:o.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(y),t.exit("labelMarker"),t.exit("labelEnd"),f):n(y)}function f(y){return y===40?t.attempt(V8,m,u?m:v)(y):y===91?t.attempt($8,m,u?h:v)(y):u?m(y):v(y)}function h(y){return t.attempt(F8,m,v)(y)}function m(y){return e(y)}function v(y){return o._balanced=!0,n(y)}}function X8(t,e,n){return i;function i(v){return t.enter("resource"),t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),a}function a(v){return Ft(v)?go(t,o)(v):o(v)}function o(v){return v===41?m(v):bT(t,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function u(v){return Ft(v)?go(t,f)(v):m(v)}function d(v){return n(v)}function f(v){return v===34||v===39||v===40?_T(t,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):m(v)}function h(v){return Ft(v)?go(t,m)(v):m(v)}function m(v){return v===41?(t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),t.exit("resource"),e):n(v)}}function K8(t,e,n){const i=this;return a;function a(d){return xT.call(i,t,o,u,"reference","referenceMarker","referenceString")(d)}function o(d){return i.parser.defined.includes(Gs(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(d):n(d)}function u(d){return n(d)}}function Z8(t,e,n){return i;function i(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),a}function a(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const J8={name:"labelStartImage",resolveAll:wp.resolveAll,tokenize:W8};function W8(t,e,n){const i=this;return a;function a(d){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(d),t.exit("labelImageMarker"),o}function o(d){return d===91?(t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelImage"),u):n(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(d):e(d)}}const eB={name:"labelStartLink",resolveAll:wp.resolveAll,tokenize:tB};function tB(t,e,n){const i=this;return a;function a(u){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):e(u)}}const Cp={name:"lineEnding",tokenize:nB};function nB(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),et(t,e,"linePrefix")}}const Vu={name:"thematicBreak",tokenize:rB};function rB(t,e,n){let i=0,a;return o;function o(h){return t.enter("thematicBreak"),u(h)}function u(h){return a=h,d(h)}function d(h){return h===a?(t.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||Se(h))?(t.exit("thematicBreak"),e(h)):n(h)}function f(h){return h===a?(t.consume(h),i++,f):(t.exit("thematicBreakSequence"),He(h)?et(t,d,"whitespace")(h):d(h))}}const Yt={continuation:{tokenize:oB},exit:uB,name:"list",tokenize:aB},iB={partial:!0,tokenize:cB},sB={partial:!0,tokenize:lB};function aB(t,e,n){const i=this,a=i.events[i.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return d;function d(b){const S=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:xp(b)){if(i.containerState.type||(i.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(Vu,n,h)(b):h(b);if(!i.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),f(b)}return n(b)}function f(b){return xp(b)&&++u<10?(t.consume(b),f):(!i.interrupt||u<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),h(b)):n(b)}function h(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,t.check(qu,i.interrupt?n:m,t.attempt(iB,y,v))}
vendor: 5,359 bytes, line 101
101function m(b){return i.containerState.initialBlankLine=!0,o++,y(b)}function v(b){return He(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return i.containerState.size=o+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function oB(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(qu,a,o);function a(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,et(t,e,"listItemIndent",i.containerState.size+1)(d)}function o(d){return i.containerState.furtherBlankLines||!He(d)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(d)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(sB,e,u)(d))}function u(d){return i.containerState._closeFlow=!0,i.interrupt=void 0,et(t,t.attempt(Yt,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function lB(t,e,n){const i=this;return et(t,a,"listItemIndent",i.containerState.size+1);function a(o){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?e(o):n(o)}}function uB(t){t.exit(this.containerState.type)}function cB(t,e,n){const i=this;return et(t,a,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const u=i.events[i.events.length-1];return!He(o)&&u&&u[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const TT={name:"setextUnderline",resolveTo:dB,tokenize:fB};function dB(t,e){let n=t.length,i,a,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(a=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[a][1].type="setextHeadingText",o?(t.splice(a,0,["enter",u,e]),t.splice(o+1,0,["exit",t[i][1],e]),t[i][1].end={...t[o][1].end}):t[i][1]=u,t.push(["exit",u,e]),t}function fB(t,e,n){const i=this;let a;return o;function o(h){let m=i.events.length,v;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){v=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||v)?(t.enter("setextHeadingLine"),a=h,u(h)):n(h)}function u(h){return t.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===a?(t.consume(h),d):(t.exit("setextHeadingLineSequence"),He(h)?et(t,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Se(h)?(t.exit("setextHeadingLine"),e(h)):n(h)}}const hB={tokenize:pB};function pB(t){const e=this,n=t.attempt(qu,i,t.attempt(this.parser.constructs.flowInitial,a,et(t,t.attempt(this.parser.constructs.flow,a,t.attempt(b8,a)),"linePrefix")));return n;function i(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function a(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const mB={resolveAll:CT()},gB=wT("string"),vB=wT("text");function wT(t){return{resolveAll:CT(t==="text"?yB:void 0),tokenize:e};function e(n){const i=this,a=this.parser.constructs[t],o=n.attempt(a,u,d);return u;function u(m){return h(m)?o(m):d(m)}function d(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return h(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function h(m){if(m===null)return!0;const v=a[m];let y=-1;if(v)for(;++y<v.length;){const b=v[y];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function CT(t){return e;function e(n,i){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return t?t(n,i):n}}function yB(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],a=e.sliceStream(i);let o=a.length,u=-1,d=0,f;for(;o--;){const h=a[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(h===-2)f=!0,d++;else if(h!==-1){o++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(d=0),d){const h={type:n===t.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:i.start._bufferIndex+u,_index:i.start._index+o,line:i.end.line,column:i.end.column-d,offset:i.end.offset-d},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(t.splice(n,0,["enter",h,e],["exit",h,e]),n+=2)}n++}return t}const bB={42:Yt,43:Yt,45:Yt,48:Yt,49:Yt,50:Yt,51:Yt,52:Yt,53:Yt,54:Yt,55:Yt,56:Yt,57:Yt,62:hT},xB={91:w8},_B={[-2]:Tp,[-1]:Tp,32:Tp},SB={35:k8,42:Vu,45:[TT,Vu],60:N8,61:TT,95:Vu,96:vT,126:vT},TB={38:mT,92:pT},wB={[-5]:Cp,[-4]:Cp,[-3]:Cp,33:J8,38:mT,42:Sp,60:[e8,H8],91:eB,92:[R8,pT],93:wp,95:Sp,96:h8},CB={null:[Sp,mB]},EB={null:[42,95]},AB={null:[]},RB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:EB,contentInitial:xB,disable:AB,document:bB,flow:SB,flowInitial:_B,insideSpan:CB,string:TB,text:wB},Symbol.toStringTag,{value:"Module"}));function MB(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
vendor: 14,845 bytes, lines 101-103
101olumn:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let u=[],d=[];const f={attempt:z(N),check:z(I),consume:A,enter:R,exit:D,interrupt:z(I,{interrupt:!0})},h={code:null,containerState:{},defineSkip:_,events:[],now:S,parser:t,previous:null,sliceSerialize:y,sliceStream:b,write:v};let m=e.tokenize.call(h,f);return e.resolveAll&&o.push(e),h;function v($){return u=wn(u,$),w(),u[u.length-1]!==null?[]:(q(e,0),h.events=_p(o,h.events,h),h.events)}function y($,L){return IB(b($),L)}function b($){return kB(u,$)}function S(){const{_bufferIndex:$,_index:L,line:Q,column:ee,offset:J}=i;return{_bufferIndex:$,_index:L,line:Q,column:ee,offset:J}}function _($){a[$.line]=$.column,V()}function w(){let $;for(;i._index<u.length;){const L=u[i._index];if(typeof L=="string")for($=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===$&&i._bufferIndex<L.length;)C(L.charCodeAt(i._bufferIndex));else C(L)}}function C($){m=m($)}function A($){Se($)?(i.line++,i.column=1,i.offset+=$===-3?2:1,V()):$!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=$}function R($,L){const Q=L||{};return Q.type=$,Q.start=S(),h.events.push(["enter",Q,h]),d.push(Q),Q}function D($){const L=d.pop();return L.end=S(),h.events.push(["exit",L,h]),L}function N($,L){q($,L.from)}function I($,L){L.restore()}function z($,L){return Q;function Q(ee,J,P){let te,G,le,k;return Array.isArray(ee)?ne(ee):"tokenize"in ee?ne([ee]):j(ee);function j(ge){return Re;function Re(Ge){const qe=Ge!==null&&ge[Ge],Dt=Ge!==null&&ge.null,Cn=[...Array.isArray(qe)?qe:qe?[qe]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return ne(Cn)(Ge)}}function ne(ge){return te=ge,G=0,ge.length===0?P:M(ge[G])}function M(ge){return Re;function Re(Ge){return k=X(),le=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?me():ge.tokenize.call(L?Object.assign(Object.create(h),L):h,f,de,me)(Ge)}}function de(ge){return $(le,k),J}function me(ge){return k.restore(),++G<te.length?M(te[G]):P}}}function q($,L){$.resolveAll&&!o.includes($)&&o.push($),$.resolve&&Kn(h.events,L,h.events.length-L,$.resolve(h.events.slice(L),h)),$.resolveTo&&(h.events=$.resolveTo(h.events,h))}function X(){const $=S(),L=h.previous,Q=h.currentConstruct,ee=h.events.length,J=Array.from(d);return{from:ee,restore:P};function P(){i=$,h.previous=L,h.currentConstruct=Q,h.events.length=ee,d=J,V()}}function V(){i.line in a&&i.column<2&&(i.column=a[i.line],i.offset+=a[i.line]-1)}}function kB(t,e){const n=e.start._index,i=e.start._bufferIndex,a=e.end._index,o=e.end._bufferIndex;let u;if(n===a)u=[t[n].slice(i,o)];else{if(u=t.slice(n,a),i>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(i):u.shift()}o>0&&u.push(t[a].slice(0,o))}return u}function IB(t,e){let n=-1;const i=[];let a;for(;++n<t.length;){const o=t[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
102`;break}case-3:{u=`\r
103`;break}case-2:{u=e?" ":"	";break}case-1:{if(!e&&a)continue;u=" ";break}default:u=String.fromCharCode(o)}a=o===-2,i.push(u)}return i.join("")}function OB(t){const i={constructs:Lj([RB,...(t||{}).extensions||[]]),content:a(Gj),defined:[],document:a(Xj),flow:a(hB),lazy:{},string:a(gB),text:a(vB)};return i;function a(o){return u;function u(d){return MB(i,o,d)}}}function DB(t){for(;!yT(t););return t}const ET=/[\0\t\n\r]/g;function NB(){let t=1,e="",n=!0,i;return a;function a(o,u,d){const f=[];let h,m,v,y,b;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),v=0,e="",n&&(o.charCodeAt(0)===65279&&v++,n=void 0);v<o.length;){if(ET.lastIndex=v,h=ET.exec(o),y=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(y),!h){e=o.slice(v);break}if(b===10&&v===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),v<y&&(f.push(o.slice(v,y)),t+=y-v),b){case 0:{f.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,f.push(-2);t++<m;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:i=!0,t=1}v=y+1}return d&&(i&&f.push(-5),e&&f.push(e),f.push(null)),f}}const zB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jB(t){return t.replace(zB,BB)}function BB(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return uT(n.slice(o?2:1),o?16:10)}return yp(n)||t}const AT={}.hasOwnProperty;function PB(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),LB(n)(DB(OB(n).document().write(NB()(t,e,!0))))}function LB(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wr),autolinkProtocol:X,autolinkEmail:X,atxHeading:o(Wn),blockQuote:o(Dt),characterEscape:X,characterReference:X,codeFenced:o(Cn),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Cn,u),codeText:o(ai,u),codeTextData:X,data:X,codeFlowValue:X,definition:o(Ui),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Gt),hardBreakEscape:o(Tr),hardBreakTrailing:o(Tr),htmlFlow:o(Hi,u),htmlFlowData:X,htmlText:o(Hi,u),htmlTextData:X,image:o(qi),label:u,link:o(wr),listItem:o(Ks),listItemValue:y,listOrdered:o(En,v),listUnordered:o(En),paragraph:o(Ju),reference:M,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Wn),strong:o(Wu),thematicBreak:o(ec)},exit:{atxHeading:f(),atxHeadingSequence:N,autolink:f(),autolinkEmail:qe,autolinkProtocol:Ge,blockQuote:f(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ge,characterReference:Re,codeFenced:f(w),codeFencedFence:_,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:V,codeIndented:f(C),codeText:f(J),codeTextData:V,data:V,definition:f(),definitionDestinationString:D,definitionLabelString:A,definitionTitleString:R,emphasis:f(),hardBreakEscape:f(L),hardBreakTrailing:f(L),htmlFlow:f(Q),htmlFlowData:V,htmlText:f(ee),htmlTextData:V,image:f(te),label:le,labelText:G,lineEnding:$,link:f(P),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:de,resourceDestinationString:k,resourceTitleString:j,resource:ne,setextHeading:f(q),setextHeadingLineSequence:z,setextHeadingText:I,strong:f(),thematicBreak:f()}};RT(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(se){let fe={type:"root",children:[]};const xe={stack:[fe],tokenStack:[],config:e,enter:d,exit:h,buffer:u,resume:m,data:n},Me=[];let Ve=-1;for(;++Ve<se.length;)if(se[Ve][1].type==="listOrdered"||se[Ve][1].type==="listUnordered")if(se[Ve][0]==="enter")Me.push(Ve);else{const Qt=Me.pop();Ve=a(se,Qt,Ve)}for(Ve=-1;++Ve<se.length;){const Qt=e[se[Ve][0]];AT.call(Qt,se[Ve][1].type)&&Qt[se[Ve][1].type].call(Object.assign({sliceSerialize:se[Ve][2].sliceSerialize},xe),se[Ve][1])}if(xe.tokenStack.length>0){const Qt=xe.tokenStack[xe.tokenStack.length-1];(Qt[1]||MT).call(xe,void 0,Qt[0])}for(fe.position={start:si(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:si(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<e.transforms.length;)fe=e.transforms[Ve](fe)||fe;return fe}function a(se,fe,xe){let Me=fe-1,Ve=-1,Qt=!1,er,kt,mt,Nt;for(;++Me<=xe;){const Ze=se[Me];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Ve++:Ve--,Nt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(er&&!Nt&&!Ve&&!mt&&(mt=Me),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!Ve&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Ve===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(er){let Cr=Me;for(kt=void 0;Cr--;){const An=se[Cr];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;kt&&(se[kt][1].type="lineEndingBlank",Qt=!0),An[1].type="lineEnding",kt=Cr}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}mt&&(!kt||mt<kt)&&(er._spread=!0),er.end=Object.assign({},kt?se[kt][1].start:Ze[1].end),se.splice(kt||Me,0,["exit",er,Ze[2]]),Me++,xe++}if(Ze[1].type==="listItemPrefix"){const Cr={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};er=Cr,se.splice(Me,0,["enter",Cr,Ze[2]]),Me++,xe++,mt=void 0,Nt=!0}}}return se[fe][1]._spread=Qt,xe}function o(se,fe){return xe;function xe(Me){d.call(this,se(Me),Me),fe&&fe.call(this,Me)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(se,fe,xe){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([fe,xe||void 0]),se.position={start:si(fe.start),end:void 0}}function f(se){return fe;function fe(xe){se&&se.call(this,xe),h.call(this,xe)}}function h(se,fe){const xe=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==se.type&&(fe?fe.call(this,se,Me[0]):(Me[1]||MT).call(this,se,Me[0]));else throw new Error("Cannot close `"+se.type+"` ("+ho({start:se.start,end:se.end})+"): it\u2019s not open");xe.position.end=si(se.end)}function m(){return Bj(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function y(se){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function b(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=se}function S(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=se}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.value=se.replace(/(\r?\n|\r)$/g,"")}function A(se){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.label=fe,xe.identifier=Gs(this.sliceSerialize(se)).toLowerCase()}function R(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.title=se}function D(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.url=se}function N(se){const fe=this.stack[this.stack.length-1];if(!fe.depth){const xe=this.sliceSerialize(se).length;fe.depth=xe}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function z(se){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function X(se){const xe=this.stack[this.stack.length-1].children;let Me=xe[xe.length-1];(!Me||Me.type!=="text")&&(Me=Mt(),Me.position={start:si(se.start),end:void 0},xe.push(Me)),this.stack.push(Me)}function V(se){const fe=this.stack.pop();fe.value+=this.sliceSerialize(se),fe.position.end=si(se.end)}function $(se){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=fe.children[fe.children.length-1];xe.position.end=si(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(fe.type)&&(X.call(this,se),V.call(this,se))}function L(){this.data.atHardBreak=!0}function Q(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.value=se}function ee(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.value=se}function J(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.value=se}function P(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=fe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function te(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=fe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function G(se){const fe=this.sliceSerialize(se),xe=this.stack[this.stack.length-2];xe.label=jB(fe),xe.identifier=Gs(fe).toLowerCase()}function le(){const se=this.stack[this.stack.length-1],fe=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const Me=se.children;xe.children=Me}else xe.alt=fe}function k(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.url=se}function j(){const se=this.resume(),fe=this.stack[this.stack.length-1];fe.title=se}function ne(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function de(se){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.label=fe,xe.identifier=Gs(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function me(se){this.data.characterReferenceType=se.type}function ge(se){const fe=this.sliceSerialize(se),xe=this.data.characterReferenceType;let Me;xe?(Me=uT(fe,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=yp(fe);const Ve=this.stack[this.stack.length-1];Ve.value+=Me}function Re(se){const fe=this.stack.pop();fe.position.end=si(se.end)}function Ge(se){V.call(this,se);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(se)}function qe(se){V.call(this,se);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(se)}function Dt(){return{type:"blockquote",children:[]}}function Cn(){return{type:"code",lang:null,meta:null,value:""}}function ai(){return{type:"inlineCode",value:""}}function Ui(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Gt(){return{type:"emphasis",children:[]}}function Wn(){return{type:"heading",depth:0,children:[]}}function Tr(){return{type:"break"}}function Hi(){return{type:"html",value:""}}function qi(){return{type:"image",title:null,url:"",alt:null}}function wr(){return{type:"link",title:null,url:"",children:[]}}function En(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Ks(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function Ju(){return{type:"paragraph",children:[]}}function Wu(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function ec(){return{type:"thematicBreak"}}}function si(t){return{line:t.line,column:t.column,offset:t.offset}}function RT(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?RT(t,i):UB(t,i)}}function UB(t,e){let n;for(n in e)if(AT.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function MT(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+ho({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+ho({start:e.start,end:e.end}
vendor: 5,152 bytes, lines 103-107
103)+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+ho({start:e.start,end:e.end})+") is still open")}function HB(t){const e=this;e.parser=n;function n(i){return PB(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function qB(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function VB(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
104`}]}function $B(t,e){const n=e.value?e.value+`
105`:"",i={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(i.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function FB(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function YB(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function GB(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),a=Qs(i.toLowerCase()),o=t.footnoteOrder.indexOf(i);let u,d=t.footnoteCounts.get(i);d===void 0?(d=0,t.footnoteOrder.push(i),u=t.footnoteOrder.length):u=o+1,d+=1,t.footnoteCounts.set(i,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};t.patch(e,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return t.patch(e,h),t.applyData(e,h)}function QB(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function XB(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function kT(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const a=t.all(e),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=i:a.push({type:"text",value:i}),a}function KB(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return kT(t,e);const a={src:Qs(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(a.title=i.title);const o={type:"element",tagName:"img",properties:a,children:[]};return t.patch(e,o),t.applyData(e,o)}function ZB(t,e){const n={src:Qs(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function JB(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function WB(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return kT(t,e);const a={href:Qs(i.url||"")};i.title!==null&&i.title!==void 0&&(a.title=i.title);const o={type:"element",tagName:"a",properties:a,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function eP(t,e){const n={href:Qs(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function tP(t,e,n){const i=t.all(e),a=n?nP(n):IT(e),o={},u=[];if(typeof e.checked=="boolean"){const m=i[0];let v;m&&m.type==="element"&&m.tagName==="p"?v=m:(v={type:"element",tagName:"p",properties:{},children:[]},i.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<i.length;){const m=i[d];(a||d!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
106`}),m.type==="element"&&m.tagName==="p"&&!a?u.push(...m.children):u.push(m)}const f=i[i.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&u.push({type:"text",value:`
107`});const h={type:"element",tagName:"li",properties:o,children:u};return t.patch(e,h),t.applyData(e,h)}function nP(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=IT(n[i])}return e}function IT(t){const e=t.spread;return e??t.children.length>1}function rP(t,e){const n={},i=t.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++a<i.length;){const u=i[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,
vendor: 4,989 bytes, line 107
107!0)};return t.patch(e,o),t.applyData(e,o)}function iP(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function sP(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function aP(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function oP(t,e){const n=t.all(e),i=n.shift(),a=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},d=fp(e.children[1]),f=ZS(e.children[e.children.length-1]);d&&f&&(u.position={start:d,end:f}),a.push(u)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(a,!0)};return t.patch(e,o),t.applyData(e,o)}function lP(t,e,n){const i=n?n.children:void 0,o=(i?i.indexOf(e):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,d=u?u.length:e.children.length;let f=-1;const h=[];for(;++f<d;){const v=e.children[f],y={},b=u?u[f]:void 0;b&&(y.align=b);let S={type:"element",tagName:o,properties:y,children:[]};v&&(S.children=t.all(v),t.patch(v,S),S=t.applyData(v,S)),h.push(S)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(e,m),t.applyData(e,m)}function uP(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const OT=9,DT=32;function cP(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),a=0;const o=[];for(;i;)o.push(NT(e.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(e);return o.push(NT(e.slice(a),a>0,!1)),o.join("")}function NT(t,e,n){let i=0,a=t.length;if(e){let o=t.codePointAt(i);for(;o===OT||o===DT;)i++,o=t.codePointAt(i)}if(n){let o=t.codePointAt(a-1);for(;o===OT||o===DT;)a--,o=t.codePointAt(a-1)}return a>i?t.slice(i,a):""}function dP(t,e){const n={type:"text",value:cP(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function fP(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const hP={blockquote:qB,break:VB,code:$B,delete:FB,emphasis:YB,footnoteReference:GB,heading:QB,html:XB,imageReference:KB,image:ZB,inlineCode:JB,linkReference:WB,link:eP,listItem:tP,list:rP,paragraph:iP,root:sP,strong:aP,table:oP,tableCell:uP,tableRow:lP,text:dP,thematicBreak:fP,toml:$u,yaml:$u,definition:$u,footnoteDefinition:$u};function $u(){}const zT=-1,Fu=0,vo=1,Yu=2,Ep=3,Ap=4,Rp=5,Mp=6,jT=7,BT=8,pP=typeof self=="object"?self:globalThis,PT=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new pP[t](e)},mP=(t,e)=>{const n=(a,o)=>(t.set(o,a),a),i=a=>{if(t.has(a))return t.get(a);const[o,u]=e[a];switch(o){case Fu:case zT:return n(u,a);case vo:{const d=n([],a);for(const f of u)d.push(i(f));return d}case Yu:{const d=n({},a);for(const[f,h]of u)d[i(f)]=i(h);return d}case Ep:return n(new Date(u),a);case Ap:{const{source:d,flags:f}=u;return n(new RegExp(d,f),a)}case Rp:{const d=n(new Map,a);for(const[f,h]of u)d.set(i(f),i(h));return d}case Mp:{const d=n(new Set,a);for(const f of u)d.add(i(f));return d}case jT:{const{name:d,message:f}=u;return n(PT(d,f),a)}case BT:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return n(new DataView(d),u)}}return n(PT(o,u),a)};return i},LT=t=>mP(new Map,t)(0),Li="",{toString:gP}={},{keys:vP}=Object,yo=t=>{const e=typeof t;if(e!=="object"||!t)return[Fu,e];const n=gP.call(t).slice(8,-1);switch(n){case"Array":return[vo,Li];case"Object":return[Yu,Li];case"Date":return[Ep,Li];case"RegExp":return[Ap,Li];case"Map":return[Rp,Li];case"Set":return[Mp,Li];case"DataView":return[vo,n]}return n.includes("Array")?[vo,n]:n.includes("Error")?[jT,n]:[Yu,n]},Gu=([t,e])=>t===Fu&&(e==="function"||e==="symbol"),yP=(t,e,n,i)=>{const a=(u,d)=>{const f=i.push(u)-1;return n.set(d,f),f},o=u=>{if(n.has(u))return n.get(u);let[d,f]=yo(u);switch(d){case Fu:{let m=u;switch(f){case"bigint":d=BT,m=u.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([zT],u)}return a([d,m],u)}case vo:{if(f){let y=u;return f==="DataView"?y=new Uint8Array(u.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(u)),a([f,[...y]],u)}const m=[],v=a([d,m],u);for(const y of u)m.push(o(y));return v}case Yu:{if(f)switch(f){case"BigInt":return a([f,u.toString()],u);case"Boolean":case"Number":case"String":return a([f,u.valueOf()],u)}if(e&&"toJSON"in u)return o(u.toJSON());const m=[],v=a([d,m],u);for(const y of vP(u))(t||!Gu(yo(u[y])))&&m.push([o(y),o(u[y])]);return v}case Ep:return a([d,isNaN(u.getTime())?Li:u.toISOString()],u);case Ap:{const{source:m,flags:v}=u;return a([d,{source:m,flags:v}],u)}case Rp:{const m=[],v=a([d,m],u);
vendor: 11,874 bytes, lines 107-113
107for(const[y,b]of u)(t||!(Gu(yo(y))||Gu(yo(b))))&&m.push([o(y),o(b)]);return v}case Mp:{const m=[],v=a([d,m],u);for(const y of u)(t||!Gu(yo(y)))&&m.push(o(y));return v}}const{message:h}=u;return a([d,{name:f,message:h}],u)};return o},UT=(t,{json:e,lossy:n}={})=>{const i=[];return yP(!(e||n),!!e,new Map,i)(t),i},Qu=typeof structuredClone=="function"?((t,e)=>e&&("json"in e||"lossy"in e)?LT(UT(t,e)):structuredClone(t)):(t,e)=>LT(UT(t,e));function bP(t,e){const n=[{type:"text",value:"\u21A9"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function xP(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function _P(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||bP,i=t.options.footnoteBackLabel||xP,a=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",u=t.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[f]);if(!h)continue;const m=t.all(h),v=String(h.identifier).toUpperCase(),y=Qs(v.toLowerCase());let b=0;const S=[],_=t.footnoteCounts.get(v);for(;_!==void 0&&++b<=_;){S.length>0&&S.push({type:"text",value:" "});let A=typeof n=="string"?n:n(f,b);typeof A=="string"&&(A={type:"text",value:A}),S.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const w=m[m.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const A=w.children[w.children.length-1];A&&A.type==="text"?A.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...S)}else m.push(...S);const C={type:"element",tagName:"li",properties:{id:e+"fn-"+y},children:t.wrap(m,!0)};t.patch(h,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Qu(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
108`},{type:"element",tagName:"ol",properties:{},children:t.wrap(d,!0)},{type:"text",value:`
109`}]}}const HT=(function(t){if(t==null)return CP;if(typeof t=="function")return Xu(t);if(typeof t=="object")return Array.isArray(t)?SP(t):TP(t);if(typeof t=="string")return wP(t);throw new Error("Expected function, string, or object as test")});function SP(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=HT(t[n]);return Xu(i);function i(...a){let o=-1;for(;++o<e.length;)if(e[o].apply(this,a))return!0;return!1}}function TP(t){const e=t;return Xu(n);function n(i){const a=i;let o;for(o in t)if(a[o]!==e[o])return!1;return!0}}function wP(t){return Xu(e);function e(n){return n&&n.type===t}}function Xu(t){return e;function e(n,i,a){return!!(EP(n)&&t.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function CP(){return!0}function EP(t){return t!==null&&typeof t=="object"&&"type"in t}function VL(t){return t}const qT=[],AP=!0,VT=!1,RP="skip";function MP(t,e,n,i){let a;typeof e=="function"&&typeof n!="function"?(i=n,n=e):a=e;const o=HT(a),u=i?-1:1;d(t,void 0,[])();function d(f,h,m){const v=f&&typeof f=="object"?f:{};if(typeof v.type=="string"){const b=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=qT,S,_,w;if((!e||o(f,h,m[m.length-1]||void 0))&&(b=kP(n(f,m)),b[0]===VT))return b;if("children"in f&&f.children){const C=f;if(C.children&&b[0]!==RP)for(_=(i?C.children.length:-1)+u,w=m.concat(C);_>-1&&_<C.children.length;){const A=C.children[_];if(S=d(A,_,w)(),S[0]===VT)return S;_=typeof S[1]=="number"?S[1]:_+u}}return b}}}function kP(t){return Array.isArray(t)?t:typeof t=="number"?[AP,t]:t==null?qT:[t]}function $T(t,e,n,i){let a,o,u;typeof e=="function"&&typeof n!="function"?(o=void 0,u=e,a=n):(o=e,u=n,a=i),MP(t,o,d,a);function d(f,h){const m=h[h.length-1],v=m?m.children.indexOf(f):void 0;return u(f,v,m)}}const kp={}.hasOwnProperty,IP={};function OP(t,e){const n=e||IP,i=new Map,a=new Map,o=new Map,u={...hP,...n.handlers},d={all:h,applyData:NP,definitionById:i,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:u,one:f,options:n,patch:DP,wrap:jP};return $T(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const v=m.type==="definition"?i:a,y=String(m.identifier).toUpperCase();v.has(y)||v.set(y,m)}}),d;function f(m,v){const y=m.type,b=d.handlers[y];if(kp.call(d.handlers,y)&&b)return b(d,m,v);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in m){const{children:_,...w}=m,C=Qu(w);return C.children=d.all(m),C}return Qu(m)}return(d.options.unknownHandler||zP)(d,m,v)}function h(m){const v=[];if("children"in m){const y=m.children;let b=-1;for(;++b<y.length;){const S=d.one(y[b],m);if(S){if(b&&y[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=FT(S.value)),!Array.isArray(S)&&S.type==="element")){const _=S.children[0];_&&_.type==="text"&&(_.value=FT(_.value))}Array.isArray(S)?v.push(...S):v.push(S)}}}return v}}function DP(t,e){t.position&&(e.position=mj(t))}function NP(t,e){let n=e;if(t&&t.data){const i=t.data.hName,a=t.data.hChildren,o=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const u="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Qu(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function zP(t,e){const n=e.data||{},i="value"in e&&!(kp.call(n,"hProperties")||kp.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function jP(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
110`});++i<t.length;)i&&n.push({type:"text",value:`
111`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
112`}),n}function FT(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function YT(t,e){const n=OP(t,e),i=n.one(t,void 0),a=_P(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
113`},a),o}function BP(t,e){return t&&"run"in t?async function(n,i){const a=YT(n,{file:i,...e});await t.run(a,i)}:function(n,i){return YT(n,{file:i,...t||e})}}function GT(t){if(t)throw t}var Ip,QT;function PP(){if(QT)return Ip;QT=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},o=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var m=t.call(h,"constructor"),v=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!v)return!1;var y;for(y in h);return typeof y>"u"||t.call(h,y)},u=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},d=function(h,m){if(m==="__proto__")if(t.call(h,m)){if(i)return i(h,m).value}else return;return h[m]};return Ip=function f(){var h,m,v,y,b,S,_=arguments[0],w=1,C=arguments.length,A=!1;for(typeof _=="boolean"&&(A=_,_=arguments[1]||{},w=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});w<C;++w)if(h=arguments[w],h!=null)for(m in h)v=d(_,m),y=d(h,m),_!==y&&(A&&y&&(o(y)||(b=a(y)))?(b?(b=!1,S=v&&a(v)?v:[]):S=v&&o(v)?v:{},u(_,{name:m,newValue:f(A,S,y)})):typeof y<"u"&&u(_,{name:m,newValue:y}));return _},Ip}var LP=PP();const Op=qa(LP);function Dp(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function UP(){const t=[],e={run:n,use:i};return e;function n(...a){let o=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...a);function d(f,...h){const m=t[++o];let v=-1;if(f){u(f);return}for(;++v<a.length;)(h[v]===null||h[v]===void 0)&&(h[v]=a[v]);a=h,m?HP(m,d)(...h):u(null,...h)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return t.push(a),e}}function HP(t,e){let n;return i;function i(...u){const d=t.length>u.length;let f;d&&u.push(a);try{f=t.apply(this,u)}catch(h){const m=h;if(d&&n)throw m;return a(m)}d||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(u,...d){n||(n=!0,e(u,...d))}function o(u){a(null,u)}}const Jn={basename:qP,dirname:VP,extname:$P,join:FP,sep:"/"};function qP(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');bo(t);let n=0,i=-1,a=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;a--;)if(t.codePointAt(a)===47){if(o){n=a+1;break}}else i<0&&(o=!0,i=a+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let u=-1,d=e.length-1;for(;a--;)if(t.codePointAt(a)===47){if(o){n=a+1;break}}else u<0&&(o=!0,u=a+1),d>-1&&(t.codePointAt(a)===e.codePointAt(d--)?d<0&&(i=a):(d=-1,i=u));return n===i?i=u:i<0&&(i=t.length),t.slice(n,i)}function VP(t){if(bo(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function $P(t){bo(t);let e=t.length,n=-1,i=0,a=-1,o=0,u;for(;e--;){const d=t.codePointAt(e);if(d===47){if(u){i=e+1;break}continue}n<0&&(u=!0,n=e+1),d===46?a<0?a=e:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===i+1?"":t.slice(a,n)}function FP(...t){let e=-1,n;for(;++e<t.length;)bo(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":YP(n)}function YP(t){bo(t);const e=t.codePointAt(0)===47;let n=GP(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function GP(t,e){let n="",i=0,a=-1,o=0,u=-1,d,f;for(;++u<=t.length;){if(u<t.length)d=t.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(a===u-1||o===1))if(a!==u-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),a=u,o=0;continue}}else if(n.length>0){n="",i=0,a=u,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(a+1,u):n=t.slice(a+1,u),i=u-a-1;a=u,o=0}else d===46&&o>-1?o++:o=-1}return n}function bo(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const QP={cwd:XP};function XP(){return"/"}function Np(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function KP(t){if(typeof t=="string")t=new URL(t);else if(!Np(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return ZP(t)}function ZP(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(e)}const zp=["history","path","basename","stem","extname","dirname"];class XT{constructor(e){let n;e?Np(e)?n={path:e}:typeof e=="string"||JP(e)?n={value:e}
vendor: 10,741 bytes, line 113
113:n=e:n={},this.cwd="cwd"in n?"":QP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<zp.length;){const o=zp[i];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)zp.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Jn.basename(this.path):void 0}set basename(e){Bp(e,"basename"),jp(e,"basename"),this.path=Jn.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Jn.dirname(this.path):void 0}set dirname(e){KT(this.basename,"dirname"),this.path=Jn.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Jn.extname(this.path):void 0}set extname(e){if(jp(e,"extname"),KT(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Jn.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Np(e)&&(e=KP(e)),Bp(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Jn.basename(this.path,this.extname):void 0}set stem(e){Bp(e,"stem"),jp(e,"stem"),this.path=Jn.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const a=this.message(e,n,i);throw a.fatal=!0,a}info(e,n,i){const a=this.message(e,n,i);return a.fatal=void 0,a}message(e,n,i){const a=new Rt(e,n,i);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function jp(t,e){if(t&&t.includes(Jn.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Jn.sep+"`")}function Bp(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function KT(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function JP(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const WP=(function(t){const i=this.constructor.prototype,a=i[t],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),eL={}.hasOwnProperty;class $p extends WP{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=UP()}copy(){const e=new $p;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(Op(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Up("data",this.frozen),this.namespace[e]=n,this):eL.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Up("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=n.call(e,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Ku(e),i=this.parser||this.Parser;return Pp("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),Pp("process",this.parser||this.Parser),Lp("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,u){const d=Ku(e),f=i.parse(d);i.run(f,d,function(m,v,y){if(m||!v||!y)return h(m);const b=v,S=i.stringify(b,y);rL(S)?y.value=S:y.result=S,h(m,y)});function h(m,v){m||!v?u(m):o?o(v):n(void 0,v)}}}processSync(e){let n=!1,i;return this.freeze(),Pp("processSync",this.parser||this.Parser),Lp("processSync",this.compiler||this.Compiler),this.process(e,a),JT("processSync","process",n),i;function a(o,u){n=!0,GT(o),i=u}}run(e,n,i){ZT(e),this.freeze();const a=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?o(void 0,i):new Promise(o);function o(u,d){const f=Ku(n);a.run(e,f,h);function h(m,v,y){const b=v||e;m?d(m):u?u(b):i(void 0,b,y)}}}runSync(e,n){let i=!1,a;return this.run(e,n,o),JT("runSync","run",i),a;function o(u,d){GT(u),a=d,i=!0}}stringify(e,n){this.freeze();const i=Ku(n),a=this.compiler||this.Compiler;return Lp("stringify",a),ZT(e),a(e,i)}use(e,...n){const i=this.attachers,a=this.namespace;if(Up("use",this.frozen),e!=null)if(typeof e=="function")f(e,n);else if(typeof e=="object")Array.isArray(e)?d(e):u(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...v]=h;f(m,v)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(h.plugins),h.settings&&(a.settings=Op(!0,a.settings,h.settings))}function d(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const v=h[m];o(v)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,m){let v=-1,y=-1;for(;++v<i.length;)if(i[v][0]===h){y=v;break}if(y===-1)i.push([h,...m]);else if(m.length>0){let[b,...S]=m;const _=i[y][1];Dp(_)&&Dp(b)&&(b=Op(!0,_,b)),i[y]=[h,b,...S]}}}}const tL=new $p().freeze();function Pp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Lp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Up(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ZT(t){if(!Dp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function JT(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Ku(t){return nL(t)?t:new XT(t)}function nL(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function rL(t){return typeof t=="string"||iL(t)}function iL(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const sL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",WT=[],ew={allowDangerousHtml:!0},aL=/^(https?|ircs?|mailto|xmpp)$/i,oL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lL(t){const e=uL(t),n=cL(t);return dL(e.runSync(e.parse(n),n),t)}function uL(t){const e=t.rehypePlugins||WT,n=t.remarkPlugins||WT,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...ew}:ew;return tL().use(HB).use(n).use(BP,i).use(e)}function cL(t){const e=t.children||"",n=new XT;return typeof e=="string"&&(n.value=e),n}function dL(t,e){const n=e.allowedElements,i=e.allowElement,a=e.components,o=e.disallowedElements,u=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||fL;for(const m of oL)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+sL+m.id,void 0);return $T(t,h),xj(t,{Fragment:T.Fragment,components:a,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(m,v,y){if(m.type==="raw"&&y&&typeof v=="number")return u?y.children.splice(v,1):y.children[v]={type:"text",value:m.value},v;if(m.type==="element"){let b;for(b in vp)if(Object.hasOwn(vp,b)&&Object.hasOwn(m.properties,b)){const S=m.properties[b],_=vp[b];(_===null||_.includes(m.tagName))&&(m.properties[b]=f(String(S||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!b&&i&&typeof v=="number"&&(b=!i(m,v,y)),b&&y&&typeof v=="number")return d&&m.children?y.children.splice(v,1,...m.children):y.children.splice(v,1),v}}}function fL(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),a=t.indexOf("/");return e===-1||a!==-1&&e>a||n!==-1&&e>n||i!==-1&&e>i||aL.test(t.slice(0,e))?t:""}const{useSmooth:hL,useSmoothStatus:pL,withSmoothContextProvider:mL}=yz,gL=({components:t,componentsByLanguage:e,smooth:n=!0,defer:i=!1,preprocess:a,...o})=>{const u=oS(),d=O.useMemo(()=>a?{...u,text:a(u.text)}:u,[u,a]),{text:f}=hL(d,n),h=O.useDeferredValue(f),m=i?h:f,{pre:v=Dz,code:y=Nz,SyntaxHighlighter:b=OS,CodeHeader:S=zz}=t??{},_=O.useMemo(()=>({Pre:v,Code:y,SyntaxHighlighter:b,CodeHeader:S}),[v,y,b,S]),w=lo(R=>T.jsx(Fz,{components:_,componentsByLanguage:e,...R})),C=lo(R=>T.jsx(Oz,{fallbackPre:v,...R})),A=O.useMemo(()=>{const{pre:R,code:D,SyntaxHighlighter:N,CodeHeader:I,...z}=t??{};return{...z,pre:C,code:w}},[w,C,t]);return T.jsx(lL,{components:A,...o,children:m})},tw=O.forwardRef(({className:t,containerProps:e,containerComponent:n="div",...i},a)=>{const o=pL();return T.jsx(n,{"data-status":o.type,...e,className:NS(t,e?.className),ref:a,children:T.jsx(gL,{...i})})});tw.displayName="MarkdownTextPrimitive";const vL=mL(tw),yL={TypeScript:"#3178c6",JavaScript:"#f1e05a",Go:"#00ADD8",Python:"#3572A5",Rust:"#dea584",Shell:"#89e051",Dockerfile:"#384d54",HTML:"#e34c26",CSS:"#563d7c",Java:"#b07219",Kotlin:"#A97BFF",Swift:"#F05138",Ruby:"#701516",C:"#555555","C++":"#f34b7d","C#":"#178600",PHP:"#4F5D95",Scala:"#c22d40",Lua:"#000080",R:"#198CE7",Dart:"#00B4AB",Elixir:"#4e2a59",Clojure:"#5881d8",Haskell:"#5e5086",Terraform:"#7B42BC",Ansible:"#EE0000",Kubernetes:"#326CE5",Docker:"#2496ED",React:"#61DAFB",Vue:"#4FC08D",Angular:"#DD0031",Node:"#339933","Next.js":"#000000",GraphQL:"#E10098",PostgreSQL:"#336791",MySQL:"#4479A1",MongoDB:"#47A248",Redis:"#DC382D",Nginx:"#009639"};function nw(t){return yL[t]||"#6e7681"}function bL({status:t}){return T.jsx("span",{className:`chat-project-card-badge ${t==="ongoing"?"chat-project-card-badge--ongoing":"chat-project-card-badge--completed"}
113`,children:t==="ongoing"?"\u25CF Ongoing":"\u2713 Completed"})}function xL({title:t,image:e,description:n,link:i,technologies:a,status:o,dateRange:u}){return T.jsxs("div",{className:"chat-project-card",children:[e&&T.jsx("img",{className:"chat-project-card-image",src:e,alt:`${t} screenshot`,loading:"lazy"}),T.jsxs("div",{className:"chat-project-card-body",children:[T.jsx("h4",{className:"chat-project-card-title",children:t}),T.jsxs("div",{className:"chat-project-card-meta",children:[T.jsx(bL,{status:o}),u&&T.jsx("span",{className:"chat-project-card-date",children:u})]}),T.jsx("p",{className:"chat-project-card-desc",children:n}),a&&a.length>0&&T.jsx("div",{className:"chat-project-card-techs",children:a.map(d=>T.jsx("span",{className:"chat-tech-tag",style:{backgroundColor:nw(d)},children:d},d))}),i&&T.jsxs("a",{href:i,className:"chat-project-card-link",target:"_blank",rel:"noopener noreferrer",children:[T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-card-icon",children:[T.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Open project"]})]})]})}function rw(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function _L({language:t}){if(!t)return null;const e=nw(t);return T.jsxs("span",{className:"chat-repo-lang",children:[T.jsx("span",{className:"chat-repo-lang-dot",style:{backgroundColor:e}}),t]})}function SL({name:t,description:e,url:n,homepage:i,language:a,stars:o,forks:u,topics:d,archived:f}){return T.jsxs("div",{className:"chat-repo-card",children:[T.jsxs("div",{className:"chat-repo-card-header",children:[T.jsxs("a",{href:n,className:"chat-repo-card-name",target:"_blank",rel:"noopener noreferrer",children:[T.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"chat-repo-icon",children:T.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),t]}),f&&T.jsx("span",{className:"chat-repo-archived-badge",children:"Archived"})]}),e&&T.jsx("p",{className:"chat-repo-card-desc",children:e}),T.jsxs("div",{className:"chat-repo-card-meta",children:[T.jsx(_L,{language:a}),T.jsxs("span",{className:"chat-repo-stars",children:[T.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"chat-repo-meta-icon",children:T.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),rw(o)]}),T.jsxs("span",{className:"chat-repo-forks",children:[T.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"chat-repo-meta-icon",children:T.jsx("path",{d:"M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878z"})}),rw(u)]})]}),d&&d.length>0&&T.jsx("div",{className:"chat-repo-card-topics",children:d.map(h=>T.jsx("span",{className:"chat-repo-topic",children:h},h))}),i&&T.jsxs("a",{href:i,className:"chat-project-card-link",target:"_blank",rel:"noopener noreferrer",children:[T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-card-icon",children:[T.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Homepage"]})]})}function TL({title:t,image:e,description:n,tags:i,url:a}){return T.jsxs("div",{className:"chat-recipe-card",children:[e&&T.jsx("img",{className:"chat-recipe-card-image",src:e,alt:t,loading:"lazy"}),T.jsxs("div",{className:"chat-recipe-card-body",children:[T.jsx("h4",{className:"chat-recipe-card-title",children:t}),T.jsx("p",{className:"chat-recipe-card-desc",children:n}),i&&i.length>0&&T.jsx("div",{className:"chat-recipe-card-tags",children:i.map(o=>T.jsx("span",{className:"chat-recipe-tag",children:o},o))}),T.jsxs("a",{href:a,className:"chat-recipe-card-link",target:"_blank",rel:"noopener noreferrer",children:[T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-card-icon",children:[T.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Open recipe"]})]})]})}const wL={ProjectCard:xL,RepoCard:SL,RecipeCard:TL};function CL({component:t}){return null}const iw={en:{headerTitle:"Timo The Agent",headerDisclaimer:"Powered by AI \u2014 it may occasionally slip up",imprint:"Imprint",privacy:"Privacy",emptyState:"What do you want to know?",composerPlaceholder:"Type a message...",maximize:"Maximize",minimize:"Minimize",newConversation:"New conversation",close:"Close",errorTitle:"Hold up",errorFallback:"An error occurred",autoRetry:t=>`Auto-retrying in ${t}s\u2026`,retryNow:"Retry now",assistantTyping:"Assistant is typing"},de:{headerTitle:"Timo The Agent",headerDisclaimer:"KI-gest\xFCtzt \u2014 kann gelegentlich Fehler machen",imprint:"Impressum",privacy:"Datenschutz",emptyState:"Was m\xF6chtest du wissen?",composerPlaceholder:"Nachricht eingeben...",maximize:"Maximieren",minimize:"Minimieren",newConversation:"Neue Unterhaltung",close:"Schlie\xDFen",errorTitle:"Moment mal",errorFallback:"Ein Fehler ist aufgetreten",autoRetry:t=>`Automatischer Neuversuch in ${t}s\u2026`,retryNow:"Jetzt erneut versuchen",assistantTyping:"Assistent schreibt"}};function EL(t){return t!=null&&t.toLowerCase().startsWith("de")?"de":"en"}const sw=O.createContext(iw.en);function Hp(){return O.useContext(sw)}const AL={a:({href:t,children:e,...n})=>T.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...n,children:e})},aw=t=>T.jsx(vL,{components:AL,...t}),RL={Text:aw}
113,ML={Text:aw,generativeUI:{components:wL,Fallback:CL}};function kL({theme:t,isMaximized:e,onToggleMaximize:n,onClearSession:i,onClose:a}){const o=Hp();return T.jsxs(tp.Root,{className:"chat-thread","data-theme":t,children:[T.jsxs("div",{className:"chat-header",children:[T.jsxs("div",{className:"chat-header-text",children:[T.jsx("span",{className:"chat-header-title",children:o.headerTitle}),T.jsxs("span",{className:"chat-header-disclaimer",children:[o.headerDisclaimer,T.jsx("span",{className:"chat-header-sep",children:" \xB7 "}),T.jsx("a",{className:"chat-header-link",href:"https://imprint.timo-reymann.de/",target:"_blank",rel:"noopener noreferrer",children:o.imprint}),T.jsx("span",{className:"chat-header-sep",children:" \xB7 "}),T.jsx("a",{className:"chat-header-link",href:"https://timo-reymann.de/datenschutz/",target:"_blank",rel:"noopener noreferrer",children:o.privacy})]})]}),a&&T.jsxs("div",{className:"chat-tooltip chat-tooltip--below",children:[T.jsx("button",{className:"chat-close-btn",onClick:a,"aria-label":o.close,children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-icon",children:T.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),T.jsx("span",{className:"chat-tooltip-text",children:o.close})]})]}),T.jsxs(tp.Viewport,{className:"chat-viewport",children:[T.jsx(G0,{condition:u=>u.thread.isEmpty,children:T.jsx("div",{className:"chat-empty",children:T.jsx("p",{children:o.emptyState})})}),T.jsx(tp.Messages,{children:({message:u})=>{var d,f;return u.role==="user"?T.jsx(IL,{}):((d=u.status)==null?void 0:d.type)==="incomplete"&&((f=u.status)==null?void 0:f.reason)==="error"?T.jsx(NL,{}):T.jsx(OL,{message:u})}})]}),T.jsxs("div",{className:"chat-composer-bar",children:[T.jsxs("div",{className:"chat-tooltip chat-tooltip--left",children:[T.jsx("button",{className:"chat-maximize-btn",onClick:n,children:e?T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-icon",children:T.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}):T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-icon",children:T.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),T.jsx("span",{className:"chat-tooltip-text",children:e?o.minimize:o.maximize})]}),i&&T.jsxs("div",{className:"chat-tooltip chat-tooltip--left",children:[T.jsx("button",{className:"chat-clear-btn",onClick:i,children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-icon",children:T.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})})}),T.jsx("span",{className:"chat-tooltip-text",children:o.newConversation})]}),T.jsxs(Qh.Root,{className:"chat-composer",children:[T.jsx(Qh.Input,{placeholder:o.composerPlaceholder,className:"chat-composer-input",rows:1}),T.jsx(Qh.Send,{className:"chat-composer-send",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-icon",children:T.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})})]})]})]})}function IL(){return T.jsx(oo.Root,{className:"chat-message chat-message--user",children:T.jsx("div",{className:"chat-message-bubble chat-message-bubble--user",children:T.jsx(oo.Parts,{components:RL})})})}function OL({message:t}){var e;const n=((e=t.status)==null?void 0:e.type)==="running",i=t.content.some(o=>o.type==="text"&&o.text!=null&&o.text.length>0),a=t.content.some(o=>o.type==="generative-ui");return T.jsx(oo.Root,{className:"chat-message chat-message--assistant",children:T.jsx("div",{className:"chat-message-bubble chat-message-bubble--assistant",children:n&&!i&&!a?T.jsx(DL,{}):T.jsx(oo.Parts,{components:ML})})})}function DL(){const t=Hp();return T.jsxs("div",{className:"chat-loading-dots","aria-live":"polite","aria-label":t.assistantTyping,children:[T.jsx("span",{className:"chat-loading-dot"}),T.jsx("span",{className:"chat-loading-dot"}),T.jsx("span",{className:"chat-loading-dot"})]})}function NL(){return T.jsx(oo.Root,{className:"chat-message chat-message--error",children:T.jsx(zL,{})})}function zL(){var t,e;const n=Hp(),i=xI(),[a,o]=O.useState(null),u=i.getState(),d=((t=u.status)==null?void 0:t.type)==="incomplete"&&((e=u.status)==null?void 0:e.reason)==="error"?u.status.error:"",f=d||n.errorFallback;return O.useEffect(()=>{if(!d)return;const h=d.match(/Retry in (\d+)s/);if(!h)return;const m=parseInt(h[1],10);o(m);const v=setInterval(()=>{o(y=>y===null||y<=1?(clearInterval(v),i.reload(),null):y-1)},1e3);return()=>clearInterval(v)},[d,i]),T.jsxs("div",{className:"chat-error-bubble",children:[T.jsxs("div",{className:"chat-error-header",children:[T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-error-icon",children:[T.jsx("circle",{cx:"12",cy:"12",r:"10"}),T.jsx("path",{d:"M12 8v4M12 16h.01"})]}),T.jsx("span",{className:"chat-error-title",children:n.errorTitle})]}),T.jsx("p",{className:"chat-error-msg",children:f}),a!==null&&T.jsx("p",{className:"chat-error-countdown",children:n.autoRetry(a)}),T.jsx("div",{className:"chat-error-actions",children:T.jsxs(rO.Reload,{className:"chat-retr
113y-btn",children:[T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-retry-icon",children:T.jsx("path",{d:"M21 2v6h-6M3 12a9 9 0 0 1 15-6.7L21 8M3 22v-6h6M21 12a9 9 0 0 1-15 6.7L3 16"})}),n.retryNow]})})]})}function jL({language:t="en",...e}){return T.jsx(sw.Provider,{value:iw[t],children:T.jsx(BL,{...e})})}function BL({apiUrl:t,portalContainer:e,theme:n,turnstileSiteKey:i}){const[a,o]=O.useState(!1),[u,d]=O.useState(0),[f,h]=O.useState(!1),[m,v]=O.useState(!1);O.useEffect(()=>{const w=()=>v(window.innerWidth<=800);return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const y=O.useCallback(()=>{h(w=>!w)},[]),b=O.useCallback(()=>{o(!1)},[]),S=O.useCallback(()=>{try{sessionStorage.removeItem("chat-messages")}catch{}try{sessionStorage.removeItem("chat-conversation-token")}catch{}d(w=>w+1)},[]),_=f?"chat-modal-content chat-modal-content--maximized":"chat-modal-content";return T.jsxs(Pu.Root,{open:a,onOpenChange:o,children:[T.jsx(Pu.Anchor,{className:"chat-modal-anchor",children:T.jsx(Pu.Trigger,{className:"chat-modal-trigger",children:T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chat-modal-trigger-icon",children:[T.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),T.jsx("path",{d:"M8 10h.01"}),T.jsx("path",{d:"M12 10h.01"}),T.jsx("path",{d:"M16 10h.01"})]})})}),T.jsx(Pu.Content,{sideOffset:16,portalProps:{container:e},className:_,"data-hidden":m?"":void 0,children:!m&&T.jsx(ow,{apiUrl:t,theme:n,turnstileSiteKey:i,portalContainer:e,isMaximized:f,onToggleMaximize:y,onClearSession:S,onClose:b},u)}),m&&a&&T.jsx("div",{className:"chat-modal-mobile",children:T.jsx("div",{className:"chat-modal-content",children:T.jsx(ow,{apiUrl:t,theme:n,turnstileSiteKey:i,portalContainer:e,isMaximized:f,onToggleMaximize:y,onClearSession:S,onClose:b},u)})})]})}function ow({apiUrl:t,theme:e,turnstileSiteKey:n,isMaximized:i,onToggleMaximize:a,onClearSession:o,onClose:u,portalContainer:d}){const f=O.useMemo(()=>{try{const v=sessionStorage.getItem("chat-messages");return v?JSON.parse(v):void 0}catch{return}},[]),h=O.useMemo(()=>kS(t,n,d),[t,n,d]),m=fI(h,{initialMessages:f});return T.jsx(bI,{runtime:m,children:T.jsx(kL,{theme:e,isMaximized:i,onToggleMaximize:a,onClearSession:o,onClose:u})})}const PL=`/* ---- Font ---- */
114@font-face {
115  font-family: "Source Sans Pro";
116  src: url("https://cdn.timo-reymann.de/public/fonts/SourceSansPro.woff2") format("woff2");
117  font-display: swap;
118}
119
120/* ---- Reset ---- */
121.chat-scope {
122  all: initial;
123  display: block;
124  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
125    Roboto, "Helvetica Neue", Arial, sans-serif;
126  font-size: 1em;
127  line-height: 1.5;
128  color: #333;
129  box-sizing: border-box;
130}
131
132.chat-scope *,
133.chat-scope *::before,
134.chat-scope *::after {
135  box-sizing: border-box;
136}
137
138.chat-modal-root {
139  /* React mount point \u2014 styles inherited from .chat-scope */
140}
141
142/* ---- Theme: Light (timo-reymann.de inspired) ---- */
143.chat-scope {
144  --bg: #fff;
145  --text: #333;
146  --accent: #d65108;
147  --accent-hover: #bd4807;
148  --bubble-user-bg: #d65108;
149  --bubble-user-text: #fff;
150  --bubble-assistant-bg: #f4f6f7;
151  --bubble-assistant-text: #333;
152  --border: #e2e8f0;
153  --composer-bg: #f4f6f7;
154  --composer-border: #d1d5db;
155  --composer-focus: #d65108;
156  --input-placeholder: #9e9e9e;
157  --trigger-bg: #d65108;
158  --trigger-text: #fff;
159  --trigger-shadow: rgba(0, 0, 0, 0.25);
160  --empty-color: #9e9e9e;
161  --scrollbar-thumb: #cbd5e1;
162  --scrollbar-thumb-hover: #9e9e9e;
163  --error-bg: #fff5f5;
164  --error-border: #feb2b2;
165  --error-text: #c53030;
166  --error-btn-bg: #d65108;
167  --error-btn-text: #fff;
168}
169
170/* ---- Theme: Dark ---- */
171.chat-scope.theme-dark {
172  --bg: #282727;
173  --text: #fcfaf9;
174  --accent: #d65108;
175  --accent-hover: #e05a10;
176  --bubble-user-bg: #d65108;
177  --bubble-user-text: #fff;
178  --bubble-assistant-bg: #3a3939;
179  --bubble-assistant-text: #fcfaf9;
180  --border: #404040;
181  --composer-bg: #232222;
182  --composer-border: #404040;
183  --composer-focus: #d65108;
184  --input-placeholder: #666;
185  --trigger-bg: #d65108;
186  --trigger-text: #fff;
187  --trigger-shadow: rgba(0, 0, 0, 0.4);
188  --empty-color: #666;
189  --scrollbar-thumb: #555;
190  --scrollbar-thumb-hover: #666;
191  --error-bg: #451a1a;
192  --error-border: #7f1d1d;
193  --error-text: #fca5a5;
194  --error-btn-bg: #d65108;
195  --error-btn-text: #fff;
196}
197
198/* ---- Floating trigger button ---- */
199.chat-modal-anchor {
200  position: fixed;
201  right: 16px;
202  bottom: 16px;
203  z-index: 2147483647;
204}
205
206.chat-modal-trigger {
207  display: flex;
208  align-items: center;
209  justify-content: center;
210  width: 48px;
211  height: 48px;
212  border-radius: 50%;
213  background: var(--trigger-bg);
214  color: var(--trigger-text);
215  border: none;
216  cursor: pointer;
217  box-shadow: 0 2px 12px var(--trigger-shadow);
218  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
219  padding: 0;
220  outline: none;
221}
222
223.chat-modal-trigger:focus-visible {
224  outline: 2px solid var(--composer-focus);
225  outline-offset: 2px;
226}
227
228.chat-modal-trigger:hover {
229  background: var(--accent-hover);
230  transform: scale(1.1);
231  box-shadow: 0 4px 20px var(--trigger-shadow);
232}
233
234.chat-modal-trigger:active {
235  transform: scale(0.92);
236}
237
238.chat-modal-trigger-icon {
239  width: 22px;
240  height: 22px;
241}
242
243/* ---- Modal content panel ---- */
244.chat-modal-content {
245  position: relative;
246  width: 30vw;
247  min-width: 500px;
248  height: 70vh;
249  background: var(--bg);
250  border: 1px solid var(--border);
251  border-radius: 0;
252  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
253  display: flex;
254  flex-direction: column;
255  overflow: hidden;
256}
257
258.chat-modal-content--maximized {
259  width: 90vw !important;
260  height: 90vh !important;
261  max-width: none !important;
262  max-height: none !important;
263}
264
265/* ---- Header toolbar ---- */
266.chat-header {
267  display: flex;
268  align-items: center;
269  justify-content: space-between;
270  gap: 10px;
271  padding: 10px 12px;
272  border-bottom: 1px solid #404040;
273  background: #333;
274  flex-shrink: 0;
275}
276
277.chat-header-text {
278  display: flex;
279  flex-direction: column;
280  min-width: 0;
281}
282
283.chat-header-title {
284  font-size: 15px;
285  font-weight: 600;
286  color: #fcfaf9;
287}
288
289.chat-header-disclaimer {
290  font-size: 11px;
291  font-style: italic;
292  color: rgba(252, 250, 249, 0.65);
293  line-height: 1.3;
294}
295
296.chat-header-sep {
297  color: rgba(252, 250, 249, 0.4);
298}
299
300.chat-header-link {
301  color: rgba(252, 250, 249, 0.65);
302  text-decoration: underline;
303}
304
305.chat-header-link:hover {
306  color: #fcfaf9;
307}
308
309.chat-close-btn {
310  display: flex;
311  align-items: center;
312  justify-content: center;
313  width: 32px;
314  height: 32px;
315  border: none;
316  border-radius: 0;
317  background: #1f73af;
318  color: #fff;
319  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12) !important;
320  cursor: pointer;
321  flex-shrink: 0;
322  padding: 0;
323  transition: background 0.15s, border-color 0.15s;
324}
325
326.chat-close-btn:hover {
327  background: #1b6599;
328}
329
330.chat-modal-mobile {
331  display: none;
332  position: fixed;
333  inset: 0;
334  z-index: 2147483647;
335  background: var(--bg);
336}
337
338.chat-modal-mobile .chat-modal-content {
339  width: 100%;
340  min-width: 0;
341  height: 100%;
342  border-radius: 0;
343  border: none;
344}
345
346.chat-modal-content[data-hidden] {
347  display: none !important;
348}
349
350.chat-modal-content[data-state="open"] {
351  animation: chat-modal-in 0.15s ease-out;
352}
353
354.chat-modal-content[data-state="closed"] {
355  animation: chat-modal-out 0.12s ease-in;
356}
357
358@keyframes chat-modal-in {
359  from {
360    opacity: 0;
361    transform: scale(0.95) translateY(-8px);
362  }
363  to {
364    opacity: 1;
365    transform: scale(1) translateY(0);
366  }
367}
368
369@keyframes chat-modal-out {
370  from {
371    opacity: 1;
372    transform: scale(1) translateY(0);
373  }
374  to {
375    opacity: 0;
376    transform: scale(0.95) translateY(-8px);
377  }
378}
379
380/* ---- Thread ---- */
381.chat-thread {
382  display: flex;
383  flex-direction: column;
384  height: 100%;
385}
386
387.chat-viewport {
388  flex: 1;
389  overflow-y: auto;
390  padding-bottom: 12px;
391}
392
393.chat-viewport::-webkit-scrollbar {
394  width: 6px;
395}
396
397.chat-viewport::-webkit-scrollbar-track {
398  background: transparent;
399}
400
401.chat-viewport::-webkit-scrollbar-thumb {
402  background: var(--scrollbar-thumb);
403  border-radius: 3px;
404}
405
406.chat-viewport::-webkit-scrollbar-thumb:hover {
407  background: var(--scrollbar-thumb-hover);
408}
409
410/* ---- Empty state ---- */
411.chat-empty {
412  display: flex;
413  height: 100%;
414  align-items: center;
415  justify-content: center;
416  color: var(--empty-color);
417  font-size: 15px;
418  text-align: center;
419  padding: 32px;
420}
421
422/* ---- Messages ---- */
423.chat-message {
424  display: flex;
425  padding: 4px 16px;
426}
427
428.chat-message:first-child {
429  padding-top: 16px;
430}
431
432.chat-message--user {
433  justify-content: flex-end;
434}
435
436.chat-message--assistant {
437  justify-content: flex-start;
438}
439
440.chat-message-bubble {
441  position: relative;
442  max-width: 82%;
443  padding: 10px 14px;
444  border-radius: 0;
445  font-size: 1rem;
446  line-height: 1.5;
447  word-break: break-word;
448}
449
450.chat-message-bubble--user {
451  background: var(--bubble-user-bg);
452  color: var(--bubble-user-text);
453}
454
455.chat-message-bubble--user::after {
456  content: "";
457  position: absolute;
458  bottom: 0;
459  right: -8px;
460  width: 0;
461  height: 0;
462  border-right: 8px solid transparent;
463  border-bottom: 8px solid var(--bubble-user-bg);
464}
465
466.chat-message-bubble--assistant {
467  background: var(--bubble-assistant-bg);
468  color: var(--bubble-assistant-text);
469  max-width: 70%;
470}
471
472.chat-message-bubble--assistant::after {
473  content: "";
474  position: absolute;
475  bottom: 0;
476  left: -8px;
477  width: 0;
478  height: 0;
479  border-left: 8px solid transparent;
480  border-bottom: 8px solid var(--bubble-assistant-bg);
481}
482
483.chat-message-bubble p {
484  margin: 0;
485}
486
487.chat-message-bubble p + p {
488  margin-top: 8px;
489}
490
491.chat-message-bubble ul,
492.chat-message-bubble ol {
493  margin: 4px 0;
494  padding-left: 20px;
495}
496
497.chat-message-bubble li + li {
498  margin-top: 2px;
499}
500
501.chat-message-bubble code {
502  background: rgba(0, 0, 0, 0.06);
503  border-radius: 4px;
504  padding: 1px 4px;
505  font-size: 13px;
506  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
507}
508
509.chat-message-bubble--user code {
510  background: rgba(255, 255, 255, 0.15);
511}
512
513.chat-message-bubble pre {
514  background: rgba(0, 0, 0, 0.06);
515  border-radius: 6px;
516  padding: 10px 12px;
517  overflow-x: auto;
518  margin: 6px 0;
519  font-size: 13px;
520  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
521}
522
523.chat-message-bubble--user pre {
524  background: rgba(255, 255, 255, 0.1);
525}
526
527.chat-message-bubble pre code {
528  background: none;
529  padding: 0;
530  font-size: inherit;
531}
532
533.chat-message-bubble a {
534  color: inherit;
535  text-decoration: underline;
536  text-underline-offset: 2px;
537  opacity: 0.85;
538}
539
540.chat-message-bubble a:hover {
541  opacity: 1;
542}
543
544.chat-message-bubble hr {
545  border: none;
546  border-top: 1px solid var(--border);
547  margin: 8px 0;
548}
549
550.chat-message-bubble blockquote {
551  border-left: 3px solid var(--border);
552  margin: 4px 0;
553  padding-left: 10px;
554  opacity: 0.8;
555}
556
557.chat-message-bubble table {
558  border-collapse: collapse;
559  margin: 6px 0;
560  font-size: 13px;
561}
562
563.chat-message-bubble th,
564.chat-message-bubble td {
565  border: 1px solid var(--border);
566  padding: 4px 8px;
567  text-align: left;
568}
569
570.chat-message-bubble th {
571  font-weight: 600;
572}
573
574/* ---- Error message ---- */
575.chat-message--error {
576  justify-content: center;
577}
578
579.chat-error-bubble {
580  max-width: 90%;
581  background: var(--error-bg);
582  border: 1px solid var(--error-border);
583  border-radius: 0;
584  padding: 14px 16px;
585}
586
587.chat-error-header {
588  display: flex;
589  align-items: center;
590  gap: 6px;
591  margin-bottom: 6px;
592}
593
594.chat-error-icon {
595  width: 16px;
596  height: 16px;
597  color: var(--error-text);
598  flex-shrink: 0;
599}
600
601.chat-error-title {
602  font-weight: 600;
603  font-size: 13px;
604  color: var(--error-text);
605  text-transform: uppercase;
606  letter-spacing: 0.05em;
607}
608
609.chat-error-msg {
610  font-size: 13px;
611  color: var(--error-text);
612  margin: 0 0 10px 0;
613  line-height: 1.4;
614}
615
616.chat-error-countdown {
617  font-size: 12px;
618  color: var(--error-text);
619  margin: -6px 0 10px 0;
620  opacity: 0.8;
621  animation: chat-countdown-pulse 1s ease-in-out infinite;
622}
623
624@keyframes chat-countdown-pulse {
625  0%, 100% { opacity: 0.7; }
626  50% { opacity: 1; }
627}
628
629.chat-error-actions {
630  display: flex;
631  gap: 8px;
632}
633
634.chat-retry-btn {
635  display: inline-flex;
636  align-items: center;
637  gap: 6px;
638  padding: 7px 14px;
639  background: var(--error-btn-bg);
640  color: var(--error-btn-text);
641  border: none;
642  border-radius: 8px;
643  font-size: 13px;
644  font-weight: 500;
645  cursor: pointer;
646  font-family: inherit;
647  transition: background 0.15s, transform 0.1s;
648}
649
650.chat-retry-btn:hover {
651  background: var(--accent-hover);
652}
653
654.chat-retry-btn:active {
655  transform: scale(0.96);
656}
657
658.chat-retry-icon {
659  width: 14px;
660  height: 14px;
661}
662
663/* ---- Composer bar (always at bottom) ---- */
664.chat-composer-bar {
665  display: flex;
666  align-items: center;
667  gap: 8px;
668  padding: 8px 12px 12px;
669  border-top: 1px solid var(--border);
670  background: var(--bg);
671}
672
673.chat-maximize-btn,
674.chat-clear-btn {
675  display: flex;
676  align-items: center;
677  justify-content: center;
678  width: 28px;
679  height: 28px;
680  border-radius: 6px;
681  border: 1px solid var(--border);
682  background: transparent;
683  color: var(--text);
684  cursor: pointer;
685  flex-shrink: 0;
686  padding: 0;
687  transition: background 0.15s, border-color 0.15s;
688}
689
690.chat-maximize-btn:hover,
691.chat-clear-btn:hover {
692  background: var(--composer-bg);
693  border-color: var(--composer-focus);
694}
695
696.chat-clear-btn:hover {
697  border-color: var(--error-text);
698  color: var(--error-text);
699}
700
701.chat-composer {
702  flex: 1;
703  display: flex;
704  align-items: flex-end;
705  gap: 8px;
706  background: var(--composer-bg);
707  border: 1px solid var(--composer-border);
708  border-radius: 14px;
709  padding: 4px;
710  transition: border-color 0.15s;
711}
712
713.chat-composer:focus-within {
714  border-color: var(--composer-focus);
715}
716
717.chat-composer-input {
718  flex: 1;
719  border: none;
720  background: transparent;
721  padding: 7px 10px;
722  font-size: 14px;
723  line-height: 1.4;
724  resize: none;
725  outline: none;
726  font-family: inherit;
727  color: var(--text);
728  min-height: 22px;
729  max-height: 120px;
730}
731
732.chat-composer-input::placeholder {
733  color: var(--input-placeholder);
734}
735
736.chat-composer-send {
737  display: flex;
738  align-items: center;
739  justify-content: center;
740  width: 32px;
741  height: 32px;
742  border-radius: 50%;
743  background: var(--trigger-bg);
744  color: var(--trigger-text);
745  border: none;
746  cursor: pointer;
747  flex-shrink: 0;
748  transition: opacity 0.15s, background 0.15s;
749  padding: 0;
750}
751
752.chat-composer-send:disabled {
753  opacity: 0.3;
754  cursor: default;
755}
756
757.chat-composer-send:not(:disabled):hover {
758  background: var(--accent-hover);
759}
760
761.chat-icon {
762  width: 14px;
763  height: 14px;
764}
765
766/* ---- Portal container (Radix teleports content here) ---- */
767.chat-modal-portals {
768  position: static;
769}
770
771/* ---- Error banner inside modal ---- */
772.chat-error-banner {
773  display: flex;
774  align-items: center;
775  justify-content: space-between;
776  padding: 8px 12px;
777  background: var(--error-bg);
778  border-bottom: 1px solid var(--error-border);
779  font-size: 13px;
780  color: var(--error-text);
781}
782
783.chat-error-banner-btn {
784  background: none;
785  border: 1px solid var(--error-border);
786  border-radius: 4px;
787  padding: 2px 8px;
788  font-size: 12px;
789  color: var(--error-text);
790  cursor: pointer;
791  font-family: inherit;
792}
793
794.chat-error-banner-btn:hover {
795  background: var(--error-border);
796}
797
798/* ---- Loading dots ---- */
799.chat-loading-dots {
800  display: flex;
801  align-items: center;
802  gap: 4px;
803  padding: 4px 0;
804}
805
806.chat-loading-dot {
807  width: 7px;
808  height: 7px;
809  border-radius: 50%;
810  background: var(--bubble-assistant-text);
811  opacity: 0.4;
812  animation: chat-dot-bounce 1.4s ease-in-out infinite;
813}
814
815.chat-loading-dot:nth-child(1) {
816  animation-delay: 0s;
817}
818
819.chat-loading-dot:nth-child(2) {
820  animation-delay: 0.2s;
821}
822
823.chat-loading-dot:nth-child(3) {
824  animation-delay: 0.4s;
825}
826
827@keyframes chat-dot-bounce {
828  0%, 80%, 100% {
829    transform: translateY(0);
830    opacity: 0.4;
831  }
832  40% {
833    transform: translateY(-6px);
834    opacity: 1;
835  }
836}
837
838/* ---- Tooltips ---- */
839.chat-tooltip {
840  position: relative;
841  display: flex;
842}
843
844.chat-tooltip-text {
845  position: absolute;
846  bottom: calc(100% + 6px);
847  left: 50%;
848  transform: translateX(-50%);
849  white-space: nowrap;
850  background: #333;
851  color: #fff;
852  font-size: 12px;
853  padding: 4px 8px;
854  border-radius: 5px;
855  pointer-events: none;
856  opacity: 0;
857  transition: opacity 0.12s ease;
858}
859
860.chat-tooltip-text::after {
861  content: "";
862  position: absolute;
863  top: 100%;
864  left: 50%;
865  transform: translateX(-50%);
866  border: 4px solid transparent;
867  border-top-color: #333;
868}
869
870.chat-tooltip:hover .chat-tooltip-text {
871  opacity: 1;
872}
873
874/* Left-aligned variant: for buttons near the left edge, so long labels
875   (e.g. German) don't get clipped by the modal's overflow. */
876.chat-tooltip--left .chat-tooltip-text {
877  left: 0;
878  transform: none;
879}
880
881.chat-tooltip--left .chat-tooltip-text::after {
882  left: 14px;
883}
884
885/* Below variant: for buttons at the top edge (header close button),
886   where a tooltip above would be clipped. Right-aligned to stay inside. */
887.chat-tooltip--below .chat-tooltip-text {
888  bottom: auto;
889  top: calc(100% + 6px);
890  left: auto;
891  right: 0;
892  transform: none;
893}
894
895.chat-tooltip--below .chat-tooltip-text::after {
896  top: auto;
897  bottom: 100%;
898  left: auto;
899  right: 12px;
900  transform: none;
901  border-top-color: transparent;
902  border-bottom-color: #333;
903}
904
905/* ---- Cards grid ---- */
906.chat-message-bubble--assistant:has(.chat-project-card, .chat-repo-card, .chat-recipe-card) {
907  display: grid;
908  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
909  gap: 8px;
910}
911
912.chat-message-bubble--assistant > :not(.chat-project-card):not(.chat-repo-card):not(.chat-recipe-card) {
913  grid-column: 1 / -1;
914}
915
916/* ---- Project card ---- */
917.chat-project-card {
918  border: 1px solid var(--border);
919  border-radius: 10px;
920  overflow: hidden;
921  background: var(--bg);
922  display: flex;
923  flex-direction: column;
924}
925
926.chat-project-card-image {
927  width: 100%;
928  aspect-ratio: 16 / 9;
929  object-fit: contain;
930  display: block;
931  border-bottom: 1px solid var(--border);
932  background: var(--bubble-assistant-bg);
933}
934
935.chat-project-card-body {
936  padding: 11px 14px;
937  flex: 1;
938  display: flex;
939  flex-direction: column;
940}
941
942.chat-project-card-title {
943  margin: 0 0 6px 0;
944  font-size: 15px;
945  font-weight: 600;
946  color: var(--text);
947  line-height: 1.3;
948}
949
950.chat-project-card-meta {
951  display: flex;
952  align-items: center;
953  gap: 8px;
954  margin-bottom: 6px;
955  flex-wrap: wrap;
956}
957
958.chat-project-card-badge {
959  display: inline-block;
960  padding: 2px 8px;
961  border-radius: 8px;
962  font-size: 11px;
963  font-weight: 600;
964  letter-spacing: 0.02em;
965}
966
967.chat-project-card-badge--ongoing {
968  background: rgba(214, 81, 8, 0.12);
969  color: var(--accent);
970}
971
972.chat-project-card-badge--completed {
973  background: rgba(34, 197, 94, 0.12);
974  color: #16a34a;
975}
976
977.theme-dark .chat-project-card-badge--completed {
978  color: #4ade80;
979}
980
981.chat-project-card-date {
982  font-size: 12px;
983  color: var(--input-placeholder);
984}
985
986.chat-project-card-desc {
987  margin: 0 0 12px 0;
988  font-size: 13px;
989  line-height: 1.5;
990  color: var(--text);
991}
992
993.chat-project-card-techs {
994  display: flex;
995  flex-wrap: wrap;
996  gap: 5px;
997  margin-bottom: 12px;
998}
999
1000.chat-tech-tag {
1001  display: inline-block;
1002  padding: 2px 8px;
1003  background: var(--accent);
1004  color: #fff;
1005  border-radius: 10px;
1006  font-size: 11px;
1007  font-weight: 500;
1008  line-height: 1.4;
1009}
1010
1011.chat-project-card-link {
1012  display: inline-flex;
1013  align-items: center;
1014  gap: 5px;
1015  padding: 6px 12px;
1016  background: var(--accent);
1017  color: #fff;
1018  border-radius: 8px;
1019  font-size: 13px;
1020  font-weight: 500;
1021  text-decoration: none;
1022  transition: background 0.15s;
1023  margin-top: auto;
1024  align-self: flex-start;
1025}
1026
1027.chat-project-card-link:hover {
1028  background: var(--accent-hover);
1029}
1030
1031.chat-card-icon {
1032  width: 14px;
1033  height: 14px;
1034  flex-shrink: 0;
1035}
1036
1037/* ---- Recipe card ---- */
1038.chat-recipe-card {
1039  border: 1px solid var(--border);
1040  border-radius: 10px;
1041  overflow: hidden;
1042  background: var(--bg);
1043  display: flex;
1044  flex-direction: column;
1045}
1046
1047.chat-recipe-card-image {
1048  width: 100%;
1049  aspect-ratio: 16 / 9;
1050  object-fit: cover;
1051  display: block;
1052  border-bottom: 1px solid var(--border);
1053  background: var(--bubble-assistant-bg);
1054}
1055
1056.chat-recipe-card-body {
1057  padding: 11px 14px;
1058  flex: 1;
1059  display: flex;
1060  flex-direction: column;
1061}
1062
1063.chat-recipe-card-title {
1064  margin: 0 0 6px 0;
1065  font-size: 15px;
1066  font-weight: 600;
1067  color: var(--text);
1068  line-height: 1.3;
1069}
1070
1071.chat-recipe-card-desc {
1072  margin: 0 0 12px 0;
1073  font-size: 13px;
1074  line-height: 1.5;
1075  color: var(--text);
1076}
1077
1078.chat-recipe-card-tags {
1079  display: flex;
1080  flex-wrap: wrap;
1081  gap: 5px;
1082  margin-bottom: 12px;
1083}
1084
1085.chat-recipe-tag {
1086  display: inline-block;
1087  padding: 2px 8px;
1088  background: var(--bubble-assistant-bg);
1089  color: var(--text);
1090  border: 1px solid var(--border);
1091  border-radius: 10px;
1092  font-size: 11px;
1093  font-weight: 500;
1094  line-height: 1.4;
1095}
1096
1097.chat-recipe-card-link {
1098  display: inline-flex;
1099  align-items: center;
1100  gap: 5px;
1101  padding: 6px 12px;
1102  background: var(--accent);
1103  color: #fff;
1104  border-radius: 8px;
1105  font-size: 13px;
1106  font-weight: 500;
1107  text-decoration: none;
1108  transition: background 0.15s;
1109  margin-top: auto;
1110  align-self: flex-start;
1111}
1112
1113.chat-recipe-card-link:hover {
1114  background: var(--accent-hover);
1115}
1116
1117/* ---- Repo card ---- */
1118.chat-repo-card {
1119  border: 1px solid var(--border);
1120  border-radius: 10px;
1121  padding: 12px 14px;
1122  background: var(--bg);
1123}
1124
1125.chat-repo-card-header {
1126  display: flex;
1127  align-items: center;
1128  gap: 8px;
1129  margin-bottom: 4px;
1130}
1131
1132.chat-repo-card-name {
1133  display: inline-flex;
1134  align-items: center;
1135  gap: 5px;
1136  font-size: 14px;
1137  font-weight: 600;
1138  color: var(--accent);
1139  text-decoration: none;
1140}
1141
1142.chat-repo-card-name:hover {
1143  text-decoration: underline;
1144}
1145
1146.chat-repo-icon {
1147  width: 16px;
1148  height: 16px;
1149  flex-shrink: 0;
1150}
1151
1152.chat-repo-archived-badge {
1153  display: inline-block;
1154  padding: 1px 6px;
1155  border-radius: 6px;
1156  font-size: 10px;
1157  font-weight: 600;
1158  background: rgba(156, 163, 175, 0.2);
1159  color: var(--input-placeholder);
1160  text-transform: uppercase;
1161  letter-spacing: 0.04em;
1162}
1163
1164.chat-repo-card-desc {
1165  margin: 0 0 8px 0;
1166  font-size: 13px;
1167  line-height: 1.5;
1168  color: var(--text);
1169}
1170
1171.chat-repo-card-meta {
1172  display: flex;
1173  align-items: center;
1174  gap: 12px;
1175  margin-bottom: 8px;
1176  flex-wrap: wrap;
1177  font-size: 12px;
1178  color: var(--input-placeholder);
1179}
1180
1181.chat-repo-lang {
1182  display: inline-flex;
1183  align-items: center;
1184  gap: 4px;
1185}
1186
1187.chat-repo-lang-dot {
1188  width: 10px;
1189  height: 10px;
1190  border-radius: 50%;
1191  display: inline-block;
1192  flex-shrink: 0;
1193}
1194
1195.chat-repo-stars,
1196.chat-repo-forks {
1197  display: inline-flex;
1198  align-items: center;
1199  gap: 3px;
1200}
1201
1202.chat-repo-meta-icon {
1203  width: 14px;
1204  height: 14px;
1205  flex-shrink: 0;
1206}
1207
1208.chat-repo-card-topics {
1209  display: flex;
1210  flex-wrap: wrap;
1211  gap: 4px;
1212  margin-bottom: 8px;
1213}
1214
1215.chat-repo-topic {
1216  display: inline-block;
1217  padding: 2px 8px;
1218  background: var(--bubble-assistant-bg);
1219  color: var(--text);
1220  border: 1px solid var(--border);
1221  border-radius: 10px;
1222  font-size: 11px;
1223  line-height: 1.4;
1224}
1225
1226.chat-repo-card .chat-project-card-link {
1227  margin-top: 2px;
1228}
1229
1230/* ---- Mobile ----
1231   Must stay last: overrides base display rules of the same specificity. */
1232@media (max-width: 800px) {
1233  .chat-modal-mobile {
1234    display: flex;
1235    flex-direction: column;
1236  }
1237  .chat-maximize-btn {
1238    display: none;
1239  }
1240}
1241`;class qp extends HTMLElement{constructor(){super(),this._root=null,this._mediaQuery=null,this._mediaQueryHandler=null,this._shadow=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=PL,this._shadow.appendChild(e),this._wrapper=document.createElement("div"),this._wrapper.className="
1241chat-scope",this._shadow.appendChild(this._wrapper),this._appContainer=document.createElement("div"),this._appContainer.className="chat-modal-root",this._wrapper.appendChild(this._appContainer),this._portalContainer=document.createElement("div"),this._portalContainer.className="chat-modal-portals",this._wrapper.appendChild(this._portalContainer)}connectedCallback(){if(!this.getAttribute("api-url")){this._renderError("Missing required attribute: api-url");return}this._applyTheme(),this._render()}disconnectedCallback(){this._cleanupMediaQuery(),this._unmount()}static get observedAttributes(){return["api-url","theme","turnstile-site-key","language"]}attributeChangedCallback(e,n,i){this.isConnected&&(e==="api-url"&&i&&this._render(),e==="theme"&&this._applyTheme(),e==="turnstile-site-key"&&this._render(),e==="language"&&this._render())}_applyTheme(){const e=this.getAttribute("theme");e==="dark"||e==="light"?(this._wrapper.classList.toggle("theme-dark",e==="dark"),this._cleanupMediaQuery()):this._applyBrowserPreference()}_applyBrowserPreference(){this._cleanupMediaQuery();try{const e=window.matchMedia("(prefers-color-scheme: dark)");this._wrapper.classList.toggle("theme-dark",e.matches),this._mediaQuery=e,this._mediaQueryHandler=n=>{this._wrapper.classList.toggle("theme-dark",n.matches)},e.addEventListener("change",this._mediaQueryHandler)}catch{}}_cleanupMediaQuery(){if(this._mediaQuery&&this._mediaQueryHandler)try{this._mediaQuery.removeEventListener("change",this._mediaQueryHandler)}catch{}this._mediaQuery=null,this._mediaQueryHandler=null}_getEffectiveTheme(){const e=this.getAttribute("theme");if(e==="dark"||e==="light")return e;try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}_render(){this._unmount();const e=this.getAttribute("api-url")||"",n=this._getEffectiveTheme(),i=this.getAttribute("turnstile-site-key")||void 0,a=EL(this.getAttribute("language"));this._root=NE.createRoot(this._appContainer),this._root.render(T.jsx(O.StrictMode,{children:T.jsx(jL,{apiUrl:e,portalContainer:this._portalContainer,theme:n,turnstileSiteKey:i,language:a})}))}_unmount(){this._root&&(this._root.unmount(),this._root=null),this._appContainer.textContent=""}_renderError(e){this._appContainer.textContent="";const n=document.createElement("div");n.style.cssText=`
1242      padding: 16px;
1243      background: #fef2f2;
1244      color: #991b1b;
1245      border: 1px solid #fecaca;
1246      border-radius: 8px;
1247      font-family: Roboto, sans-serif;
1248      font-size: 14px;
1249    `,n.textContent=e,this._appContainer.appendChild(n)}}function LL(){customElements.get("chat-modal")||customElements.define("chat-modal",qp)}LL();export{qp as ChatModalElement,kS as createChatModelAdapter,qp as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.