@waniwani/sdk 0.18.1 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat/embed.js +60 -60
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +33 -4
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy/index.d.ts +22 -4
- package/dist/legacy/index.js +13 -13
- package/dist/legacy/index.js.map +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/react/skybridge.js +1 -1
- package/dist/mcp/react/skybridge.js.map +1 -1
- package/dist/mcp/react.js +5 -5
- package/dist/mcp/react.js.map +1 -1
- package/package.json +1 -1
package/dist/chat/embed.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var zD=Object.create;var Cu=Object.defineProperty;var qD=Object.getOwnPropertyDescriptor;var HD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,VD=Object.prototype.hasOwnProperty;var GD=(e,t,a)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ku=(e,t)=>{for(var a in t)Cu(e,a,{get:t[a],enumerable:!0})},WD=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of HD(t))!VD.call(e,r)&&r!==a&&Cu(e,r,{get:()=>t[r],enumerable:!(n=qD(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?zD(jD(e)):{},WD(t||!e||!e.__esModule?Cu(a,"default",{value:e,enumerable:!0}):a,e));var Y=(e,t,a)=>GD(e,typeof t!="symbol"?t+"":t,a);var Ax=Kt(de=>{"use strict";var ip=Symbol.for("react.transitional.element"),$D=Symbol.for("react.portal"),XD=Symbol.for("react.fragment"),KD=Symbol.for("react.strict_mode"),ZD=Symbol.for("react.profiler"),QD=Symbol.for("react.consumer"),YD=Symbol.for("react.context"),JD=Symbol.for("react.forward_ref"),e_=Symbol.for("react.suspense"),t_=Symbol.for("react.memo"),Cx=Symbol.for("react.lazy"),a_=Symbol.for("react.activity"),vx=Symbol.iterator;function n_(e){return e===null||typeof e!="object"?null:(e=vx&&e[vx]||e["@@iterator"],typeof e=="function"?e:null)}var kx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Lx=Object.assign,Tx={};function $o(e,t,a){this.props=e,this.context=t,this.refs=Tx,this.updater=a||kx}$o.prototype.isReactComponent={};$o.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};$o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ex(){}Ex.prototype=$o.prototype;function lp(e,t,a){this.props=e,this.context=t,this.refs=Tx,this.updater=a||kx}var sp=lp.prototype=new Ex;sp.constructor=lp;Lx(sp,$o.prototype);sp.isPureReactComponent=!0;var bx=Array.isArray;function op(){}var ot={H:null,A:null,T:null,S:null},Mx=Object.prototype.hasOwnProperty;function up(e,t,a){var n=a.ref;return{$$typeof:ip,type:e,key:t,ref:n!==void 0?n:null,props:a}}function r_(e,t){return up(e.type,t,e.props)}function cp(e){return typeof e=="object"&&e!==null&&e.$$typeof===ip}function o_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Sx=/\/+/g;function rp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?o_(""+e.key):t.toString(36)}function i_(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(op,op):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Wo(e,t,a,n,r){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case ip:case $D:i=!0;break;case Cx:return i=e._init,Wo(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+rp(e,0):n,bx(r)?(a="",i!=null&&(a=i.replace(Sx,"$&/")+"/"),Wo(r,t,a,"",function(u){return u})):r!=null&&(cp(r)&&(r=r_(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Sx,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(bx(e))for(var s=0;s<e.length;s++)n=e[s],o=l+rp(n,s),i+=Wo(n,t,a,o,r);else if(s=n_(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+rp(n,s++),i+=Wo(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return Wo(i_(e),t,a,n,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Lu(e,t,a){if(e==null)return e;var n=[],r=0;return Wo(e,n,"","",function(o){return t.call(a,o,r++)}),n}function l_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ix=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},s_={map:Lu,forEach:function(e,t,a){Lu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Lu(e,function(){t++}),t},toArray:function(e){return Lu(e,function(t){return t})||[]},only:function(e){if(!cp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=a_;de.Children=s_;de.Component=$o;de.Fragment=XD;de.Profiler=ZD;de.PureComponent=lp;de.StrictMode=KD;de.Suspense=e_;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ot;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ot.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Lx({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Mx.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(n[o]=t[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return up(e.type,r,n)};de.createContext=function(e){return e={$$typeof:YD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:QD,_context:e},e};de.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Mx.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return up(e,o,r)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:JD,render:e}};de.isValidElement=cp;de.lazy=function(e){return{$$typeof:Cx,_payload:{_status:-1,_result:e},_init:l_}};de.memo=function(e,t){return{$$typeof:t_,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=ot.T,a={};ot.T=a;try{var n=e(),r=ot.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(op,Ix)}catch(o){Ix(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),ot.T=t}};de.unstable_useCacheRefresh=function(){return ot.H.useCacheRefresh()};de.use=function(e){return ot.H.use(e)};de.useActionState=function(e,t,a){return ot.H.useActionState(e,t,a)};de.useCallback=function(e,t){return ot.H.useCallback(e,t)};de.useContext=function(e){return ot.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return ot.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return ot.H.useEffect(e,t)};de.useEffectEvent=function(e){return ot.H.useEffectEvent(e)};de.useId=function(){return ot.H.useId()};de.useImperativeHandle=function(e,t,a){return ot.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return ot.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return ot.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return ot.H.useMemo(e,t)};de.useOptimistic=function(e,t){return ot.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return ot.H.useReducer(e,t,a)};de.useRef=function(e){return ot.H.useRef(e)};de.useState=function(e){return ot.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return ot.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return ot.H.useTransition()};de.version="19.2.4"});var Le=Kt((Xj,Rx)=>{"use strict";Rx.exports=Ax()});var qx=Kt(pt=>{"use strict";function mp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<Tu(r,t))e[n]=t,e[a]=r,a=n;else break e}}function mn(e){return e.length===0?null:e[0]}function Mu(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,r=e.length,o=r>>>1;n<o;){var i=2*(n+1)-1,l=e[i],s=i+1,u=e[s];if(0>Tu(l,a))s<r&&0>Tu(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>Tu(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function Tu(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}pt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Dx=performance,pt.unstable_now=function(){return Dx.now()}):(dp=Date,_x=dp.now(),pt.unstable_now=function(){return dp.now()-_x});var Dx,dp,_x,Mn=[],ur=[],u_=1,Ba=null,Zt=3,hp=!1,fl=!1,pl=!1,gp=!1,Nx=typeof setTimeout=="function"?setTimeout:null,Bx=typeof clearTimeout=="function"?clearTimeout:null,Ox=typeof setImmediate<"u"?setImmediate:null;function Eu(e){for(var t=mn(ur);t!==null;){if(t.callback===null)Mu(ur);else if(t.startTime<=e)Mu(ur),t.sortIndex=t.expirationTime,mp(Mn,t);else break;t=mn(ur)}}function yp(e){if(pl=!1,Eu(e),!fl)if(mn(Mn)!==null)fl=!0,Ko||(Ko=!0,Xo());else{var t=mn(ur);t!==null&&wp(yp,t.startTime-e)}}var Ko=!1,ml=-1,Ux=5,Fx=-1;function zx(){return gp?!0:!(pt.unstable_now()-Fx<Ux)}function fp(){if(gp=!1,Ko){var e=pt.unstable_now();Fx=e;var t=!0;try{e:{fl=!1,pl&&(pl=!1,Bx(ml),ml=-1),hp=!0;var a=Zt;try{t:{for(Eu(e),Ba=mn(Mn);Ba!==null&&!(Ba.expirationTime>e&&zx());){var n=Ba.callback;if(typeof n=="function"){Ba.callback=null,Zt=Ba.priorityLevel;var r=n(Ba.expirationTime<=e);if(e=pt.unstable_now(),typeof r=="function"){Ba.callback=r,Eu(e),t=!0;break t}Ba===mn(Mn)&&Mu(Mn),Eu(e)}else Mu(Mn);Ba=mn(Mn)}if(Ba!==null)t=!0;else{var o=mn(ur);o!==null&&wp(yp,o.startTime-e),t=!1}}break e}finally{Ba=null,Zt=a,hp=!1}t=void 0}}finally{t?Xo():Ko=!1}}}var Xo;typeof Ox=="function"?Xo=function(){Ox(fp)}:typeof MessageChannel<"u"?(pp=new MessageChannel,Px=pp.port2,pp.port1.onmessage=fp,Xo=function(){Px.postMessage(null)}):Xo=function(){Nx(fp,0)};var pp,Px;function wp(e,t){ml=Nx(function(){e(pt.unstable_now())},t)}pt.unstable_IdlePriority=5;pt.unstable_ImmediatePriority=1;pt.unstable_LowPriority=4;pt.unstable_NormalPriority=3;pt.unstable_Profiling=null;pt.unstable_UserBlockingPriority=2;pt.unstable_cancelCallback=function(e){e.callback=null};pt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ux=0<e?Math.floor(1e3/e):5};pt.unstable_getCurrentPriorityLevel=function(){return Zt};pt.unstable_next=function(e){switch(Zt){case 1:case 2:case 3:var t=3;break;default:t=Zt}var a=Zt;Zt=t;try{return e()}finally{Zt=a}};pt.unstable_requestPaint=function(){gp=!0};pt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Zt;Zt=e;try{return t()}finally{Zt=a}};pt.unstable_scheduleCallback=function(e,t,a){var n=pt.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=a+r,e={id:u_++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,mp(ur,e),mn(Mn)===null&&e===mn(ur)&&(pl?(Bx(ml),ml=-1):pl=!0,wp(yp,a-n))):(e.sortIndex=r,mp(Mn,e),fl||hp||(fl=!0,Ko||(Ko=!0,Xo()))),e};pt.unstable_shouldYield=zx;pt.unstable_wrapCallback=function(e){var t=Zt;return function(){var a=Zt;Zt=t;try{return e.apply(this,arguments)}finally{Zt=a}}}});var jx=Kt((Zj,Hx)=>{"use strict";Hx.exports=qx()});var Gx=Kt(ta=>{"use strict";var c_=Le();function Vx(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function cr(){}var ea={d:{f:cr,r:function(){throw Error(Vx(522))},D:cr,C:cr,L:cr,m:cr,X:cr,S:cr,M:cr},p:0,findDOMNode:null},d_=Symbol.for("react.portal");function f_(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d_,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var hl=c_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Au(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ea;ta.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Vx(299));return f_(e,t,null,a)};ta.flushSync=function(e){var t=hl.T,a=ea.p;try{if(hl.T=null,ea.p=2,e)return e()}finally{hl.T=t,ea.p=a,ea.d.f()}};ta.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ea.d.C(e,t))};ta.prefetchDNS=function(e){typeof e=="string"&&ea.d.D(e)};ta.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=Au(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?ea.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&ea.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ta.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=Au(t.as,t.crossOrigin);ea.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&ea.d.M(e)};ta.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=Au(a,t.crossOrigin);ea.d.L(e,a,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ta.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=Au(t.as,t.crossOrigin);ea.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else ea.d.m(e)};ta.requestFormReset=function(e){ea.d.r(e)};ta.unstable_batchedUpdates=function(e,t){return e(t)};ta.useFormState=function(e,t,a){return hl.H.useFormState(e,t,a)};ta.useFormStatus=function(){return hl.H.useHostTransitionStatus()};ta.version="19.2.4"});var Xx=Kt((Yj,$x)=>{"use strict";function Wx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wx)}catch(e){console.error(e)}}Wx(),$x.exports=Gx()});var iI=Kt(td=>{"use strict";var Pt=jx(),vb=Le(),p_=Xx();function N(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function bb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ts(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Sb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ib(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Kx(e){if(ts(e)!==e)throw Error(N(188))}function m_(e){var t=e.alternate;if(!t){if(t=ts(e),t===null)throw Error(N(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return Kx(r),e;if(o===n)return Kx(r),t;o=o.sibling}throw Error(N(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,l=r.child;l;){if(l===a){i=!0,a=r,n=o;break}if(l===n){i=!0,n=r,a=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===a){i=!0,a=o,n=r;break}if(l===n){i=!0,n=o,a=r;break}l=l.sibling}if(!i)throw Error(N(189))}}if(a.alternate!==n)throw Error(N(190))}if(a.tag!==3)throw Error(N(188));return a.stateNode.current===a?e:t}function Cb(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Cb(e),t!==null)return t;e=e.sibling}return null}var st=Object.assign,h_=Symbol.for("react.element"),Ru=Symbol.for("react.transitional.element"),Il=Symbol.for("react.portal"),ti=Symbol.for("react.fragment"),kb=Symbol.for("react.strict_mode"),Yp=Symbol.for("react.profiler"),Lb=Symbol.for("react.consumer"),Bn=Symbol.for("react.context"),$m=Symbol.for("react.forward_ref"),Jp=Symbol.for("react.suspense"),em=Symbol.for("react.suspense_list"),Xm=Symbol.for("react.memo"),dr=Symbol.for("react.lazy"),tm=Symbol.for("react.activity"),g_=Symbol.for("react.memo_cache_sentinel"),Zx=Symbol.iterator;function gl(e){return e===null||typeof e!="object"?null:(e=Zx&&e[Zx]||e["@@iterator"],typeof e=="function"?e:null)}var y_=Symbol.for("react.client.reference");function am(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===y_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ti:return"Fragment";case Yp:return"Profiler";case kb:return"StrictMode";case Jp:return"Suspense";case em:return"SuspenseList";case tm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Il:return"Portal";case Bn:return e.displayName||"Context";case Lb:return(e._context.displayName||"Context")+".Consumer";case $m:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xm:return t=e.displayName||null,t!==null?t:am(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return am(e(t))}catch{}}return null}var Cl=Array.isArray,ie=vb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=p_.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lo={pending:!1,data:null,method:null,action:null},nm=[],ai=-1;function xn(e){return{current:e}}function Ht(e){0>ai||(e.current=nm[ai],nm[ai]=null,ai--)}function rt(e,t){ai++,nm[ai]=e.current,e.current=t}var wn=xn(null),ql=xn(null),Sr=xn(null),cc=xn(null);function dc(e,t){switch(rt(Sr,t),rt(ql,e),rt(wn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nb(t),e=W0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ht(wn),rt(wn,e)}function vi(){Ht(wn),Ht(ql),Ht(Sr)}function rm(e){e.memoizedState!==null&&rt(cc,e);var t=wn.current,a=W0(t,e.type);t!==a&&(rt(ql,e),rt(wn,a))}function fc(e){ql.current===e&&(Ht(wn),Ht(ql)),cc.current===e&&(Ht(cc),Yl._currentValue=lo)}var xp,Qx;function no(e){if(xp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);xp=t&&t[1]||"",Qx=-1<a.stack.indexOf(`
|
|
1
|
+
"use strict";var WaniWaniChatEmbed=(()=>{var QD=Object.create;var Tu=Object.defineProperty;var JD=Object.getOwnPropertyDescriptor;var e_=Object.getOwnPropertyNames;var t_=Object.getPrototypeOf,a_=Object.prototype.hasOwnProperty;var n_=(e,t,a)=>t in e?Tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Eu=(e,t)=>{for(var a in t)Tu(e,a,{get:t[a],enumerable:!0})},r_=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of e_(t))!a_.call(e,r)&&r!==a&&Tu(e,r,{get:()=>t[r],enumerable:!(n=JD(t,r))||n.enumerable});return e};var q=(e,t,a)=>(a=e!=null?QD(t_(e)):{},r_(t||!e||!e.__esModule?Tu(a,"default",{value:e,enumerable:!0}):a,e));var Q=(e,t,a)=>n_(e,typeof t!="symbol"?t+"":t,a);var Bx=Kt(de=>{"use strict";var dp=Symbol.for("react.transitional.element"),o_=Symbol.for("react.portal"),i_=Symbol.for("react.fragment"),l_=Symbol.for("react.strict_mode"),s_=Symbol.for("react.profiler"),u_=Symbol.for("react.consumer"),c_=Symbol.for("react.context"),d_=Symbol.for("react.forward_ref"),f_=Symbol.for("react.suspense"),p_=Symbol.for("react.memo"),Rx=Symbol.for("react.lazy"),m_=Symbol.for("react.activity"),Tx=Symbol.iterator;function h_(e){return e===null||typeof e!="object"?null:(e=Tx&&e[Tx]||e["@@iterator"],typeof e=="function"?e:null)}var Dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_x=Object.assign,Ox={};function Xo(e,t,a){this.props=e,this.context=t,this.refs=Ox,this.updater=a||Dx}Xo.prototype.isReactComponent={};Xo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Xo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Px(){}Px.prototype=Xo.prototype;function fp(e,t,a){this.props=e,this.context=t,this.refs=Ox,this.updater=a||Dx}var pp=fp.prototype=new Px;pp.constructor=fp;_x(pp,Xo.prototype);pp.isPureReactComponent=!0;var Ex=Array.isArray;function cp(){}var ot={H:null,A:null,T:null,S:null},Nx=Object.prototype.hasOwnProperty;function mp(e,t,a){var n=a.ref;return{$$typeof:dp,type:e,key:t,ref:n!==void 0?n:null,props:a}}function g_(e,t){return mp(e.type,t,e.props)}function hp(e){return typeof e=="object"&&e!==null&&e.$$typeof===dp}function y_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Mx=/\/+/g;function up(e,t){return typeof e=="object"&&e!==null&&e.key!=null?y_(""+e.key):t.toString(36)}function w_(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(cp,cp):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function $o(e,t,a,n,r){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case dp:case o_:i=!0;break;case Rx:return i=e._init,$o(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+up(e,0):n,Ex(r)?(a="",i!=null&&(a=i.replace(Mx,"$&/")+"/"),$o(r,t,a,"",function(u){return u})):r!=null&&(hp(r)&&(r=g_(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Mx,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(Ex(e))for(var s=0;s<e.length;s++)n=e[s],o=l+up(n,s),i+=$o(n,t,a,o,r);else if(s=h_(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+up(n,s++),i+=$o(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return $o(w_(e),t,a,n,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Mu(e,t,a){if(e==null)return e;var n=[],r=0;return $o(e,n,"","",function(o){return t.call(a,o,r++)}),n}function x_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ax=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},v_={map:Mu,forEach:function(e,t,a){Mu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Mu(e,function(){t++}),t},toArray:function(e){return Mu(e,function(t){return t})||[]},only:function(e){if(!hp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=m_;de.Children=v_;de.Component=Xo;de.Fragment=i_;de.Profiler=s_;de.PureComponent=fp;de.StrictMode=l_;de.Suspense=f_;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ot;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ot.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=_x({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Nx.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(n[o]=t[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return mp(e.type,r,n)};de.createContext=function(e){return e={$$typeof:c_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:u_,_context:e},e};de.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Nx.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return mp(e,o,r)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:d_,render:e}};de.isValidElement=hp;de.lazy=function(e){return{$$typeof:Rx,_payload:{_status:-1,_result:e},_init:x_}};de.memo=function(e,t){return{$$typeof:p_,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=ot.T,a={};ot.T=a;try{var n=e(),r=ot.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(cp,Ax)}catch(o){Ax(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),ot.T=t}};de.unstable_useCacheRefresh=function(){return ot.H.useCacheRefresh()};de.use=function(e){return ot.H.use(e)};de.useActionState=function(e,t,a){return ot.H.useActionState(e,t,a)};de.useCallback=function(e,t){return ot.H.useCallback(e,t)};de.useContext=function(e){return ot.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return ot.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return ot.H.useEffect(e,t)};de.useEffectEvent=function(e){return ot.H.useEffectEvent(e)};de.useId=function(){return ot.H.useId()};de.useImperativeHandle=function(e,t,a){return ot.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return ot.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return ot.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return ot.H.useMemo(e,t)};de.useOptimistic=function(e,t){return ot.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return ot.H.useReducer(e,t,a)};de.useRef=function(e){return ot.H.useRef(e)};de.useState=function(e){return ot.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return ot.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return ot.H.useTransition()};de.version="19.2.4"});var Ie=Kt((p8,Ux)=>{"use strict";Ux.exports=Bx()});var Xx=Kt(pt=>{"use strict";function xp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<Au(r,t))e[n]=t,e[a]=r,a=n;else break e}}function hn(e){return e.length===0?null:e[0]}function Du(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,r=e.length,o=r>>>1;n<o;){var i=2*(n+1)-1,l=e[i],s=i+1,u=e[s];if(0>Au(l,a))s<r&&0>Au(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>Au(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function Au(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}pt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Fx=performance,pt.unstable_now=function(){return Fx.now()}):(gp=Date,zx=gp.now(),pt.unstable_now=function(){return gp.now()-zx});var Fx,gp,zx,Mn=[],ur=[],b_=1,Ba=null,Zt=3,vp=!1,pl=!1,ml=!1,bp=!1,jx=typeof setTimeout=="function"?setTimeout:null,Vx=typeof clearTimeout=="function"?clearTimeout:null,qx=typeof setImmediate<"u"?setImmediate:null;function Ru(e){for(var t=hn(ur);t!==null;){if(t.callback===null)Du(ur);else if(t.startTime<=e)Du(ur),t.sortIndex=t.expirationTime,xp(Mn,t);else break;t=hn(ur)}}function Sp(e){if(ml=!1,Ru(e),!pl)if(hn(Mn)!==null)pl=!0,Zo||(Zo=!0,Ko());else{var t=hn(ur);t!==null&&Ip(Sp,t.startTime-e)}}var Zo=!1,hl=-1,Gx=5,Wx=-1;function $x(){return bp?!0:!(pt.unstable_now()-Wx<Gx)}function yp(){if(bp=!1,Zo){var e=pt.unstable_now();Wx=e;var t=!0;try{e:{pl=!1,ml&&(ml=!1,Vx(hl),hl=-1),vp=!0;var a=Zt;try{t:{for(Ru(e),Ba=hn(Mn);Ba!==null&&!(Ba.expirationTime>e&&$x());){var n=Ba.callback;if(typeof n=="function"){Ba.callback=null,Zt=Ba.priorityLevel;var r=n(Ba.expirationTime<=e);if(e=pt.unstable_now(),typeof r=="function"){Ba.callback=r,Ru(e),t=!0;break t}Ba===hn(Mn)&&Du(Mn),Ru(e)}else Du(Mn);Ba=hn(Mn)}if(Ba!==null)t=!0;else{var o=hn(ur);o!==null&&Ip(Sp,o.startTime-e),t=!1}}break e}finally{Ba=null,Zt=a,vp=!1}t=void 0}}finally{t?Ko():Zo=!1}}}var Ko;typeof qx=="function"?Ko=function(){qx(yp)}:typeof MessageChannel<"u"?(wp=new MessageChannel,Hx=wp.port2,wp.port1.onmessage=yp,Ko=function(){Hx.postMessage(null)}):Ko=function(){jx(yp,0)};var wp,Hx;function Ip(e,t){hl=jx(function(){e(pt.unstable_now())},t)}pt.unstable_IdlePriority=5;pt.unstable_ImmediatePriority=1;pt.unstable_LowPriority=4;pt.unstable_NormalPriority=3;pt.unstable_Profiling=null;pt.unstable_UserBlockingPriority=2;pt.unstable_cancelCallback=function(e){e.callback=null};pt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Gx=0<e?Math.floor(1e3/e):5};pt.unstable_getCurrentPriorityLevel=function(){return Zt};pt.unstable_next=function(e){switch(Zt){case 1:case 2:case 3:var t=3;break;default:t=Zt}var a=Zt;Zt=t;try{return e()}finally{Zt=a}};pt.unstable_requestPaint=function(){bp=!0};pt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Zt;Zt=e;try{return t()}finally{Zt=a}};pt.unstable_scheduleCallback=function(e,t,a){var n=pt.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=a+r,e={id:b_++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,xp(ur,e),hn(Mn)===null&&e===hn(ur)&&(ml?(Vx(hl),hl=-1):ml=!0,Ip(Sp,a-n))):(e.sortIndex=r,xp(Mn,e),pl||vp||(pl=!0,Zo||(Zo=!0,Ko()))),e};pt.unstable_shouldYield=$x;pt.unstable_wrapCallback=function(e){var t=Zt;return function(){var a=Zt;Zt=t;try{return e.apply(this,arguments)}finally{Zt=a}}}});var Zx=Kt((h8,Kx)=>{"use strict";Kx.exports=Xx()});var Qx=Kt(ta=>{"use strict";var S_=Ie();function Yx(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function cr(){}var ea={d:{f:cr,r:function(){throw Error(Yx(522))},D:cr,C:cr,L:cr,m:cr,X:cr,S:cr,M:cr},p:0,findDOMNode:null},I_=Symbol.for("react.portal");function C_(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I_,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var gl=S_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _u(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ea;ta.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Yx(299));return C_(e,t,null,a)};ta.flushSync=function(e){var t=gl.T,a=ea.p;try{if(gl.T=null,ea.p=2,e)return e()}finally{gl.T=t,ea.p=a,ea.d.f()}};ta.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ea.d.C(e,t))};ta.prefetchDNS=function(e){typeof e=="string"&&ea.d.D(e)};ta.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=_u(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?ea.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&ea.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ta.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=_u(t.as,t.crossOrigin);ea.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&ea.d.M(e)};ta.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=_u(a,t.crossOrigin);ea.d.L(e,a,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ta.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=_u(t.as,t.crossOrigin);ea.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else ea.d.m(e)};ta.requestFormReset=function(e){ea.d.r(e)};ta.unstable_batchedUpdates=function(e,t){return e(t)};ta.useFormState=function(e,t,a){return gl.H.useFormState(e,t,a)};ta.useFormStatus=function(){return gl.H.useHostTransitionStatus()};ta.version="19.2.4"});var tv=Kt((y8,ev)=>{"use strict";function Jx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jx)}catch(e){console.error(e)}}Jx(),ev.exports=Qx()});var pI=Kt(rd=>{"use strict";var Pt=Zx(),Tb=Ie(),k_=tv();function N(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Eb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function as(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Mb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ab(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function av(e){if(as(e)!==e)throw Error(N(188))}function L_(e){var t=e.alternate;if(!t){if(t=as(e),t===null)throw Error(N(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return av(r),e;if(o===n)return av(r),t;o=o.sibling}throw Error(N(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,l=r.child;l;){if(l===a){i=!0,a=r,n=o;break}if(l===n){i=!0,n=r,a=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===a){i=!0,a=o,n=r;break}if(l===n){i=!0,n=o,a=r;break}l=l.sibling}if(!i)throw Error(N(189))}}if(a.alternate!==n)throw Error(N(190))}if(a.tag!==3)throw Error(N(188));return a.stateNode.current===a?e:t}function Rb(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Rb(e),t!==null)return t;e=e.sibling}return null}var st=Object.assign,T_=Symbol.for("react.element"),Ou=Symbol.for("react.transitional.element"),Cl=Symbol.for("react.portal"),ai=Symbol.for("react.fragment"),Db=Symbol.for("react.strict_mode"),nm=Symbol.for("react.profiler"),_b=Symbol.for("react.consumer"),Bn=Symbol.for("react.context"),Qm=Symbol.for("react.forward_ref"),rm=Symbol.for("react.suspense"),om=Symbol.for("react.suspense_list"),Jm=Symbol.for("react.memo"),dr=Symbol.for("react.lazy"),im=Symbol.for("react.activity"),E_=Symbol.for("react.memo_cache_sentinel"),nv=Symbol.iterator;function yl(e){return e===null||typeof e!="object"?null:(e=nv&&e[nv]||e["@@iterator"],typeof e=="function"?e:null)}var M_=Symbol.for("react.client.reference");function lm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ai:return"Fragment";case nm:return"Profiler";case Db:return"StrictMode";case rm:return"Suspense";case om:return"SuspenseList";case im:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Cl:return"Portal";case Bn:return e.displayName||"Context";case _b:return(e._context.displayName||"Context")+".Consumer";case Qm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jm:return t=e.displayName||null,t!==null?t:lm(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return lm(e(t))}catch{}}return null}var kl=Array.isArray,ie=Tb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=k_.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,so={pending:!1,data:null,method:null,action:null},sm=[],ni=-1;function vn(e){return{current:e}}function Ht(e){0>ni||(e.current=sm[ni],sm[ni]=null,ni--)}function rt(e,t){ni++,sm[ni]=e.current,e.current=t}var xn=vn(null),Hl=vn(null),Sr=vn(null),pc=vn(null);function mc(e,t){switch(rt(Sr,t),rt(Hl,e),rt(xn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cb(t),e=J0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ht(xn),rt(xn,e)}function bi(){Ht(xn),Ht(Hl),Ht(Sr)}function um(e){e.memoizedState!==null&&rt(pc,e);var t=xn.current,a=J0(t,e.type);t!==a&&(rt(Hl,e),rt(xn,a))}function hc(e){Hl.current===e&&(Ht(xn),Ht(Hl)),pc.current===e&&(Ht(pc),Jl._currentValue=so)}var Cp,rv;function ro(e){if(Cp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Cp=t&&t[1]||"",rv=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+Cp+e+rv}var kp=!1;function Lp(e,t){if(!e||kp)return"";kp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(p){var f=p}Reflect.construct(e,[],d)}else{try{d.call()}catch(p){f=p}e.call(d.prototype)}}else{try{throw Error()}catch(p){f=p}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack=="string")return[p.stack,f.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=n.DetermineComponentFrameRoot(),i=o[0],l=o[1];if(i&&l){var s=i.split(`
|
|
4
4
|
`),u=l.split(`
|
|
5
5
|
`);for(r=n=0;n<s.length&&!s[n].includes("DetermineComponentFrameRoot");)n++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(n===s.length||r===u.length)for(n=s.length-1,r=u.length-1;1<=n&&0<=r&&s[n]!==u[r];)r--;for(;1<=n&&0<=r;n--,r--)if(s[n]!==u[r]){if(n!==1||r!==1)do if(n--,r--,0>r||s[n]!==u[r]){var c=`
|
|
6
|
-
`+s[n].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=n&&0<=r);break}}}finally{
|
|
6
|
+
`+s[n].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=n&&0<=r);break}}}finally{kp=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ro(a):""}function A_(e,t){switch(e.tag){case 26:case 27:case 5:return ro(e.type);case 16:return ro("Lazy");case 13:return e.child!==t&&t!==null?ro("Suspense Fallback"):ro("Suspense");case 19:return ro("SuspenseList");case 0:case 15:return Lp(e.type,!1);case 11:return Lp(e.type.render,!1);case 1:return Lp(e.type,!0);case 31:return ro("Activity");default:return""}}function ov(e){try{var t="",a=null;do t+=A_(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}var om=Object.prototype.hasOwnProperty,Km=Pt.unstable_scheduleCallback,Sp=Pt.unstable_cancelCallback,x_=Pt.unstable_shouldYield,v_=Pt.unstable_requestPaint,ka=Pt.unstable_now,b_=Pt.unstable_getCurrentPriorityLevel,Tb=Pt.unstable_ImmediatePriority,Eb=Pt.unstable_UserBlockingPriority,pc=Pt.unstable_NormalPriority,S_=Pt.unstable_LowPriority,Mb=Pt.unstable_IdlePriority,I_=Pt.log,C_=Pt.unstable_setDisableYieldValue,as=null,La=null;function yr(e){if(typeof I_=="function"&&C_(e),La&&typeof La.setStrictMode=="function")try{La.setStrictMode(as,e)}catch{}}var Ta=Math.clz32?Math.clz32:T_,k_=Math.log,L_=Math.LN2;function T_(e){return e>>>=0,e===0?32:31-(k_(e)/L_|0)|0}var Du=256,_u=262144,Ou=4194304;function ro(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fc(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=n&134217727;return l!==0?(n=l&~o,n!==0?r=ro(n):(i&=l,i!==0?r=ro(i):a||(a=l&~e,a!==0&&(r=ro(a))))):(l=n&~o,l!==0?r=ro(l):i!==0?r=ro(i):a||(a=n&~e,a!==0&&(r=ro(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function ns(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function E_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ab(){var e=Ou;return Ou<<=1,(Ou&62914560)===0&&(Ou=4194304),e}function Ip(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function rs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M_(e,t,a,n,r,o){var i=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-Ta(a),d=1<<c;l[c]=0,s[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}n!==0&&Rb(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function Rb(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ta(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Db(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ta(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function _b(e,t){var a=t&-t;return a=(a&42)!==0?1:Zm(a),(a&(e.suspendedLanes|t))!==0?0:a}function Zm(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qm(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ob(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:nI(e.type))}function Jx(e,t){var a=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=a}}var Pr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Pr,ma="__reactProps$"+Pr,Ri="__reactContainer$"+Pr,im="__reactEvents$"+Pr,A_="__reactListeners$"+Pr,R_="__reactHandles$"+Pr,ev="__reactResources$"+Pr,os="__reactMarker$"+Pr;function Ym(e){delete e[Gt],delete e[ma],delete e[im],delete e[A_],delete e[R_]}function ni(e){var t=e[Gt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ri]||a[Gt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sb(e);e!==null;){if(a=e[Gt])return a;e=sb(e)}return t}e=a,a=e.parentNode}return null}function Di(e){if(e=e[Gt]||e[Ri]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(N(33))}function pi(e){var t=e[ev];return t||(t=e[ev]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function qt(e){e[os]=!0}var Pb=new Set,Nb={};function wo(e,t){bi(e,t),bi(e+"Capture",t)}function bi(e,t){for(Nb[e]=t,e=0;e<t.length;e++)Pb.add(t[e])}var D_=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),tv={},av={};function __(e){return om.call(av,e)?!0:om.call(tv,e)?!1:D_.test(e)?av[e]=!0:(tv[e]=!0,!1)}function Ku(e,t,a){if(__(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Pu(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function An(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O_(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lm(e){if(!e._valueTracker){var t=Bb(e)?"checked":"value";e._valueTracker=O_(e,t,""+e[t])}}function Ub(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Bb(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function mc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var P_=/[\n"\\]/g;function Ha(e){return e.replace(P_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sm(e,t,a,n,r,o,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Fa(t)):e.value!==""+Fa(t)&&(e.value=""+Fa(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?um(e,i,Fa(t)):a!=null?um(e,i,Fa(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Fa(l):e.removeAttribute("name")}function Fb(e,t,a,n,r,o,i,l){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){lm(e);return}a=a!=null?""+Fa(a):"",t=t!=null?""+Fa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=l?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),lm(e)}function um(e,t,a){t==="number"&&mc(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function mi(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Fa(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function zb(e,t,a){if(t!=null&&(t=""+Fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Fa(a):""}function qb(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(N(92));if(Cl(n)){if(1<n.length)throw Error(N(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Fa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),lm(e)}function Si(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var N_=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 nv(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||N_.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Hb(e,t,a){if(t!=null&&typeof t!="object")throw Error(N(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&nv(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&nv(e,o,t[o])}function Jm(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var B_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),U_=/^[\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 Zu(e){return U_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Un(){}var cm=null;function eh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ri=null,hi=null;function rv(e){var t=Di(e);if(t&&(e=t.stateNode)){var a=e[ma]||null;e:switch(e=t.stateNode,t.type){case"input":if(sm(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[ma]||null;if(!r)throw Error(N(90));sm(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Ub(n)}break e;case"textarea":zb(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&mi(e,!!a.multiple,t,!1)}}}var Cp=!1;function jb(e,t,a){if(Cp)return e(t,a);Cp=!0;try{var n=e(t);return n}finally{if(Cp=!1,(ri!==null||hi!==null)&&(Qc(),ri&&(t=ri,e=hi,hi=ri=null,rv(t),e)))for(t=0;t<e.length;t++)rv(e[t])}}function Hl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ma]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(N(231,t,typeof a));return a}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dm=!1;if(jn)try{Zo={},Object.defineProperty(Zo,"passive",{get:function(){dm=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{dm=!1}var Zo,wr=null,th=null,Qu=null;function Vb(){if(Qu)return Qu;var e,t=th,a=t.length,n,r="value"in wr?wr.value:wr.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var i=a-e;for(n=1;n<=i&&t[a-n]===r[o-n];n++);return Qu=r.slice(e,1<n?1-n:void 0)}function Yu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Nu(){return!0}function ov(){return!1}function ha(e){function t(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Nu:ov,this.isPropagationStopped=ov,this}return st(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nu)},persist:function(){},isPersistent:Nu}),t}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zc=ha(xo),is=st({},xo,{view:0,detail:0}),F_=ha(is),kp,Lp,yl,qc=st({},is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yl&&(yl&&e.type==="mousemove"?(kp=e.screenX-yl.screenX,Lp=e.screenY-yl.screenY):Lp=kp=0,yl=e),kp)},movementY:function(e){return"movementY"in e?e.movementY:Lp}}),iv=ha(qc),z_=st({},qc,{dataTransfer:0}),q_=ha(z_),H_=st({},is,{relatedTarget:0}),Tp=ha(H_),j_=st({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),V_=ha(j_),G_=st({},xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W_=ha(G_),$_=st({},xo,{data:0}),lv=ha($_),X_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Z_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z_[e])?!!t[e]:!1}function ah(){return Q_}var Y_=st({},is,{key:function(e){if(e.key){var t=X_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?K_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(e){return e.type==="keypress"?Yu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J_=ha(Y_),eO=st({},qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sv=ha(eO),tO=st({},is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),aO=ha(tO),nO=st({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),rO=ha(nO),oO=st({},qc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iO=ha(oO),lO=st({},xo,{newState:0,oldState:0}),sO=ha(lO),uO=[9,13,27,32],nh=jn&&"CompositionEvent"in window,El=null;jn&&"documentMode"in document&&(El=document.documentMode);var cO=jn&&"TextEvent"in window&&!El,Gb=jn&&(!nh||El&&8<El&&11>=El),uv=" ",cv=!1;function Wb(e,t){switch(e){case"keyup":return uO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $b(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oi=!1;function dO(e,t){switch(e){case"compositionend":return $b(t);case"keypress":return t.which!==32?null:(cv=!0,uv);case"textInput":return e=t.data,e===uv&&cv?null:e;default:return null}}function fO(e,t){if(oi)return e==="compositionend"||!nh&&Wb(e,t)?(e=Vb(),Qu=th=wr=null,oi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gb&&t.locale!=="ko"?null:t.data;default:return null}}var pO={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 dv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pO[e.type]:t==="textarea"}function Xb(e,t,a,n){ri?hi?hi.push(n):hi=[n]:ri=n,t=Dc(t,"onChange"),0<t.length&&(a=new zc("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Ml=null,jl=null;function mO(e){j0(e,0)}function Hc(e){var t=kl(e);if(Ub(t))return e}function fv(e,t){if(e==="change")return t}var Kb=!1;jn&&(jn?(Uu="oninput"in document,Uu||(Ep=document.createElement("div"),Ep.setAttribute("oninput","return;"),Uu=typeof Ep.oninput=="function"),Bu=Uu):Bu=!1,Kb=Bu&&(!document.documentMode||9<document.documentMode));var Bu,Uu,Ep;function pv(){Ml&&(Ml.detachEvent("onpropertychange",Zb),jl=Ml=null)}function Zb(e){if(e.propertyName==="value"&&Hc(jl)){var t=[];Xb(t,jl,e,eh(e)),jb(mO,t)}}function hO(e,t,a){e==="focusin"?(pv(),Ml=t,jl=a,Ml.attachEvent("onpropertychange",Zb)):e==="focusout"&&pv()}function gO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hc(jl)}function yO(e,t){if(e==="click")return Hc(t)}function wO(e,t){if(e==="input"||e==="change")return Hc(t)}function xO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ma=typeof Object.is=="function"?Object.is:xO;function Vl(e,t){if(Ma(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!om.call(t,r)||!Ma(e[r],t[r]))return!1}return!0}function mv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hv(e,t){var a=mv(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=mv(a)}}function Qb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mc(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=mc(e.document)}return t}function rh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vO=jn&&"documentMode"in document&&11>=document.documentMode,ii=null,fm=null,Al=null,pm=!1;function gv(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pm||ii==null||ii!==mc(n)||(n=ii,"selectionStart"in n&&rh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Al&&Vl(Al,n)||(Al=n,n=Dc(fm,"onSelect"),0<n.length&&(t=new zc("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=ii)))}function ao(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var li={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionrun:ao("Transition","TransitionRun"),transitionstart:ao("Transition","TransitionStart"),transitioncancel:ao("Transition","TransitionCancel"),transitionend:ao("Transition","TransitionEnd")},Mp={},Jb={};jn&&(Jb=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function vo(e){if(Mp[e])return Mp[e];if(!li[e])return e;var t=li[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Jb)return Mp[e]=t[a];return e}var eS=vo("animationend"),tS=vo("animationiteration"),aS=vo("animationstart"),bO=vo("transitionrun"),SO=vo("transitionstart"),IO=vo("transitioncancel"),nS=vo("transitionend"),rS=new Map,mm="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(" ");mm.push("scrollEnd");function an(e,t){rS.set(e,t),wo(t,[e])}var hc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ua=[],si=0,oh=0;function jc(){for(var e=si,t=oh=si=0;t<e;){var a=Ua[t];Ua[t++]=null;var n=Ua[t];Ua[t++]=null;var r=Ua[t];Ua[t++]=null;var o=Ua[t];if(Ua[t++]=null,n!==null&&r!==null){var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}o!==0&&oS(a,r,o)}}function Vc(e,t,a,n){Ua[si++]=e,Ua[si++]=t,Ua[si++]=a,Ua[si++]=n,oh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function ih(e,t,a,n){return Vc(e,t,a,n),gc(e)}function bo(e,t){return Vc(e,null,null,t),gc(e)}function oS(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-Ta(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function gc(e){if(50<Fl)throw Fl=0,Pm=null,Error(N(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={};function CO(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ia(e,t,a,n){return new CO(e,t,a,n)}function lh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zn(e,t){var a=e.alternate;return a===null?(a=Ia(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function iS(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ju(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")lh(e)&&(i=1);else if(typeof e=="string")i=TP(e,a,wn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case tm:return e=Ia(31,a,t,r),e.elementType=tm,e.lanes=o,e;case ti:return so(a.children,r,o,t);case kb:i=8,r|=24;break;case Yp:return e=Ia(12,a,t,r|2),e.elementType=Yp,e.lanes=o,e;case Jp:return e=Ia(13,a,t,r),e.elementType=Jp,e.lanes=o,e;case em:return e=Ia(19,a,t,r),e.elementType=em,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bn:i=10;break e;case Lb:i=9;break e;case $m:i=11;break e;case Xm:i=14;break e;case dr:i=16,n=null;break e}i=29,a=Error(N(130,e===null?"null":typeof e,"")),n=null}return t=Ia(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function so(e,t,a,n){return e=Ia(7,e,n,t),e.lanes=a,e}function Ap(e,t,a){return e=Ia(6,e,null,t),e.lanes=a,e}function lS(e){var t=Ia(18,null,null,0);return t.stateNode=e,t}function Rp(e,t,a){return t=Ia(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yv=new WeakMap;function ja(e,t){if(typeof e=="object"&&e!==null){var a=yv.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Yx(t)},yv.set(e,t),t)}return{value:e,source:t,stack:Yx(t)}}var ci=[],di=0,yc=null,Gl=0,za=[],qa=0,Rr=null,hn=1,gn="";function Pn(e,t){ci[di++]=Gl,ci[di++]=yc,yc=e,Gl=t}function sS(e,t,a){za[qa++]=hn,za[qa++]=gn,za[qa++]=Rr,Rr=e;var n=hn;e=gn;var r=32-Ta(n)-1;n&=~(1<<r),a+=1;var o=32-Ta(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,hn=1<<32-Ta(t)+r|a<<r|n,gn=o+e}else hn=1<<o|a<<r|n,gn=e}function sh(e){e.return!==null&&(Pn(e,1),sS(e,1,0))}function uh(e){for(;e===yc;)yc=ci[--di],ci[di]=null,Gl=ci[--di],ci[di]=null;for(;e===Rr;)Rr=za[--qa],za[qa]=null,gn=za[--qa],za[qa]=null,hn=za[--qa],za[qa]=null}function uS(e,t){za[qa++]=hn,za[qa++]=gn,za[qa++]=Rr,hn=t.id,gn=t.overflow,Rr=e}var Wt=null,lt=null,Te=!1,Ir=null,Va=!1,hm=Error(N(519));function Dr(e){var t=Error(N(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wl(ja(t,e)),hm}function wv(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Gt]=e,t[ma]=n,a){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(a=0;a<Zl.length;a++)be(Zl[a],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),Fb(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),qb(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||G0(t.textContent,a)?(n.popover!=null&&(be("beforetoggle",t),be("toggle",t)),n.onScroll!=null&&be("scroll",t),n.onScrollEnd!=null&&be("scrollend",t),n.onClick!=null&&(t.onclick=Un),t=!0):t=!1,t||Dr(e,!0)}function xv(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Va=!1;return;case 27:case 3:Va=!0;return;default:Wt=Wt.return}}function Qo(e){if(e!==Wt)return!1;if(!Te)return xv(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||zm(e.type,e.memoizedProps)),a=!a),a&<&&Dr(e),xv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=lb(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=lb(e)}else t===27?(t=lt,Nr(e.type)?(e=Vm,Vm=null,lt=e):lt=t):lt=Wt?Wa(e.stateNode.nextSibling):null;return!0}function po(){lt=Wt=null,Te=!1}function Dp(){var e=Ir;return e!==null&&(fa===null?fa=e:fa.push.apply(fa,e),Ir=null),e}function Wl(e){Ir===null?Ir=[e]:Ir.push(e)}var gm=xn(null),So=null,Fn=null;function pr(e,t,a){rt(gm,t._currentValue),t._currentValue=a}function qn(e){e._currentValue=gm.current,Ht(gm)}function ym(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function wm(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var l=o;o=r;for(var s=0;s<t.length;s++)if(l.context===t[s]){o.lanes|=a,l=o.alternate,l!==null&&(l.lanes|=a),ym(o.return,a,e),n||(i=null);break e}o=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(N(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),ym(i,a,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function _i(e,t,a,n){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(N(387));if(i=i.memoizedProps,i!==null){var l=r.type;Ma(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===cc.current){if(i=r.alternate,i===null)throw Error(N(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Yl):e=[Yl])}r=r.return}e!==null&&wm(t,e,a,n),t.flags|=262144}function wc(e){for(e=e.firstContext;e!==null;){if(!Ma(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function mo(e){So=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return cS(So,e)}function Fu(e,t){return So===null&&mo(e),cS(e,t)}function cS(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Fn===null){if(e===null)throw Error(N(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return a}var kO=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},LO=Pt.unstable_scheduleCallback,TO=Pt.unstable_NormalPriority,Dt={$$typeof:Bn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ch(){return{controller:new kO,data:new Map,refCount:0}}function ls(e){e.refCount--,e.refCount===0&&LO(TO,function(){e.controller.abort()})}var Rl=null,xm=0,Ii=0,gi=null;function EO(e,t){if(Rl===null){var a=Rl=[];xm=0,Ii=Ph(),gi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return xm++,t.then(vv,vv),t}function vv(){if(--xm===0&&Rl!==null){gi!==null&&(gi.status="fulfilled");var e=Rl;Rl=null,Ii=0,gi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function MO(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var bv=ie.S;ie.S=function(e,t){C0=ka(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&EO(e,t),bv!==null&&bv(e,t)};var uo=xn(null);function dh(){var e=uo.current;return e!==null?e:tt.pooledCache}function ec(e,t){t===null?rt(uo,uo.current):rt(uo,t.pool)}function dS(){var e=dh();return e===null?null:{parent:Dt._currentValue,pool:e}}var Oi=Error(N(460)),fh=Error(N(474)),Gc=Error(N(542)),xc={then:function(){}};function Sv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fS(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Un,Un),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cv(e),e;default:if(typeof t.status=="string")t.then(Un,Un);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(N(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cv(e),e}throw co=t,Oi}}function oo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(co=a,Oi):a}}var co=null;function Iv(){if(co===null)throw Error(N(459));var e=co;return co=null,e}function Cv(e){if(e===Oi||e===Gc)throw Error(N(483))}var yi=null,$l=0;function zu(e){var t=$l;return $l+=1,yi===null&&(yi=[]),fS(yi,e,t)}function wl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qu(e,t){throw t.$$typeof===h_?Error(N(525)):(e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pS(e){function t(y,w){if(e){var g=y.deletions;g===null?(y.deletions=[w],y.flags|=16):g.push(w)}}function a(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function n(y){for(var w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function r(y,w){return y=zn(y,w),y.index=0,y.sibling=null,y}function o(y,w,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<w?(y.flags|=67108866,w):g):(y.flags|=67108866,w)):(y.flags|=1048576,w)}function i(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function l(y,w,g,b){return w===null||w.tag!==6?(w=Ap(g,y.mode,b),w.return=y,w):(w=r(w,g),w.return=y,w)}function s(y,w,g,b){var T=g.type;return T===ti?c(y,w,g.props.children,b,g.key):w!==null&&(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&oo(T)===w.type)?(w=r(w,g.props),wl(w,g),w.return=y,w):(w=Ju(g.type,g.key,g.props,null,y.mode,b),wl(w,g),w.return=y,w)}function u(y,w,g,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Rp(g,y.mode,b),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,b,T){return w===null||w.tag!==7?(w=so(g,y.mode,b,T),w.return=y,w):(w=r(w,g),w.return=y,w)}function d(y,w,g){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ap(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ru:return g=Ju(w.type,w.key,w.props,null,y.mode,g),wl(g,w),g.return=y,g;case Il:return w=Rp(w,y.mode,g),w.return=y,w;case dr:return w=oo(w),d(y,w,g)}if(Cl(w)||gl(w))return w=so(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,zu(w),g);if(w.$$typeof===Bn)return d(y,Fu(y,w),g);qu(y,w)}return null}function f(y,w,g,b){var T=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return T!==null?null:l(y,w,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ru:return g.key===T?s(y,w,g,b):null;case Il:return g.key===T?u(y,w,g,b):null;case dr:return g=oo(g),f(y,w,g,b)}if(Cl(g)||gl(g))return T!==null?null:c(y,w,g,b,null);if(typeof g.then=="function")return f(y,w,zu(g),b);if(g.$$typeof===Bn)return f(y,w,Fu(y,g),b);qu(y,g)}return null}function p(y,w,g,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return y=y.get(g)||null,l(w,y,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ru:return y=y.get(b.key===null?g:b.key)||null,s(w,y,b,T);case Il:return y=y.get(b.key===null?g:b.key)||null,u(w,y,b,T);case dr:return b=oo(b),p(y,w,g,b,T)}if(Cl(b)||gl(b))return y=y.get(g)||null,c(w,y,b,T,null);if(typeof b.then=="function")return p(y,w,g,zu(b),T);if(b.$$typeof===Bn)return p(y,w,g,Fu(w,b),T);qu(w,b)}return null}function m(y,w,g,b){for(var T=null,S=null,M=w,R=w=0,_=null;M!==null&&R<g.length;R++){M.index>R?(_=M,M=null):_=M.sibling;var k=f(y,M,g[R],b);if(k===null){M===null&&(M=_);break}e&&M&&k.alternate===null&&t(y,M),w=o(k,w,R),S===null?T=k:S.sibling=k,S=k,M=_}if(R===g.length)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;R<g.length;R++)M=d(y,g[R],b),M!==null&&(w=o(M,w,R),S===null?T=M:S.sibling=M,S=M);return Te&&Pn(y,R),T}for(M=n(M);R<g.length;R++)_=p(M,y,R,g[R],b),_!==null&&(e&&_.alternate!==null&&M.delete(_.key===null?R:_.key),w=o(_,w,R),S===null?T=_:S.sibling=_,S=_);return e&&M.forEach(function(G){return t(y,G)}),Te&&Pn(y,R),T}function x(y,w,g,b){if(g==null)throw Error(N(151));for(var T=null,S=null,M=w,R=w=0,_=null,k=g.next();M!==null&&!k.done;R++,k=g.next()){M.index>R?(_=M,M=null):_=M.sibling;var G=f(y,M,k.value,b);if(G===null){M===null&&(M=_);break}e&&M&&G.alternate===null&&t(y,M),w=o(G,w,R),S===null?T=G:S.sibling=G,S=G,M=_}if(k.done)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;!k.done;R++,k=g.next())k=d(y,k.value,b),k!==null&&(w=o(k,w,R),S===null?T=k:S.sibling=k,S=k);return Te&&Pn(y,R),T}for(M=n(M);!k.done;R++,k=g.next())k=p(M,y,R,k.value,b),k!==null&&(e&&k.alternate!==null&&M.delete(k.key===null?R:k.key),w=o(k,w,R),S===null?T=k:S.sibling=k,S=k);return e&&M.forEach(function(B){return t(y,B)}),Te&&Pn(y,R),T}function I(y,w,g,b){if(typeof g=="object"&&g!==null&&g.type===ti&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ru:e:{for(var T=g.key;w!==null;){if(w.key===T){if(T=g.type,T===ti){if(w.tag===7){a(y,w.sibling),b=r(w,g.props.children),b.return=y,y=b;break e}}else if(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&oo(T)===w.type){a(y,w.sibling),b=r(w,g.props),wl(b,g),b.return=y,y=b;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===ti?(b=so(g.props.children,y.mode,b,g.key),b.return=y,y=b):(b=Ju(g.type,g.key,g.props,null,y.mode,b),wl(b,g),b.return=y,y=b)}return i(y);case Il:e:{for(T=g.key;w!==null;){if(w.key===T)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),b=r(w,g.children||[]),b.return=y,y=b;break e}else{a(y,w);break}else t(y,w);w=w.sibling}b=Rp(g,y.mode,b),b.return=y,y=b}return i(y);case dr:return g=oo(g),I(y,w,g,b)}if(Cl(g))return m(y,w,g,b);if(gl(g)){if(T=gl(g),typeof T!="function")throw Error(N(150));return g=T.call(g),x(y,w,g,b)}if(typeof g.then=="function")return I(y,w,zu(g),b);if(g.$$typeof===Bn)return I(y,w,Fu(y,g),b);qu(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),b=r(w,g),b.return=y,y=b):(a(y,w),b=Ap(g,y.mode,b),b.return=y,y=b),i(y)):a(y,w)}return function(y,w,g,b){try{$l=0;var T=I(y,w,g,b);return yi=null,T}catch(M){if(M===Oi||M===Gc)throw M;var S=Ia(29,M,null,y.mode);return S.lanes=b,S.return=y,S}}}var ho=pS(!0),mS=pS(!1),fr=!1;function ph(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Cr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Be&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=gc(e),oS(e,null,a),t}return Vc(e,n,t,a),gc(e)}function Dl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Db(e,a)}}function _p(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var bm=!1;function _l(){if(bm){var e=gi;if(e!==null)throw e}}function Ol(e,t,a,n){bm=!1;var r=e.updateQueue;fr=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==i&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(o!==null){var d=r.baseState;i=0,c=u=s=null,l=o;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(Ie&f)===f:(n&f)===f){f!==0&&f===Ii&&(bm=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,x=l;f=t;var I=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(I,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(I,d,f):m,f==null)break e;d=st({},d,f);break e;case 2:fr=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,s=d):c=c.next=p,i|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);c===null&&(s=d),r.baseState=s,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),Or|=i,e.lanes=i,e.memoizedState=d}}function hS(e,t){if(typeof e!="function")throw Error(N(191,e));e.call(t)}function gS(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)hS(a[e],t)}var Ci=xn(null),vc=xn(0);function kv(e,t){e=$n,rt(vc,e),rt(Ci,t),$n=e|t.baseLanes}function Sm(){rt(vc,$n),rt(Ci,Ci.current)}function mh(){$n=vc.current,Ht(Ci),Ht(vc)}var Aa=xn(null),Ga=null;function mr(e){var t=e.alternate;rt(Ct,Ct.current&1),rt(Aa,e),Ga===null&&(t===null||Ci.current!==null||t.memoizedState!==null)&&(Ga=e)}function Im(e){rt(Ct,Ct.current),rt(Aa,e),Ga===null&&(Ga=e)}function yS(e){e.tag===22?(rt(Ct,Ct.current),rt(Aa,e),Ga===null&&(Ga=e)):hr(e)}function hr(){rt(Ct,Ct.current),rt(Aa,Aa.current)}function Sa(e){Ht(Aa),Ga===e&&(Ga=null),Ht(Ct)}var Ct=xn(0);function bc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Hm(a)||jm(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vn=0,me=null,Qe=null,At=null,Sc=!1,wi=!1,go=!1,Ic=0,Xl=0,xi=null,AO=0;function gt(){throw Error(N(321))}function hh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ma(e[a],t[a]))return!1;return!0}function gh(e,t,a,n,r,o){return Vn=o,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ie.H=e===null||e.memoizedState===null?XS:Th,go=!1,o=a(n,r),go=!1,wi&&(o=xS(t,a,n,r)),wS(e),o}function wS(e){ie.H=Kl;var t=Qe!==null&&Qe.next!==null;if(Vn=0,At=Qe=me=null,Sc=!1,Xl=0,xi=null,t)throw Error(N(300));e===null||_t||(e=e.dependencies,e!==null&&wc(e)&&(_t=!0))}function xS(e,t,a,n){me=e;var r=0;do{if(wi&&(xi=null),Xl=0,wi=!1,25<=r)throw Error(N(301));if(r+=1,At=Qe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ie.H=KS,o=t(a,n)}while(wi);return o}function RO(){var e=ie.H,t=e.useState()[0];return t=typeof t.then=="function"?ss(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(me.flags|=1024),t}function yh(){var e=Ic!==0;return Ic=0,e}function wh(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function xh(e){if(Sc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Sc=!1}Vn=0,At=Qe=me=null,wi=!1,Xl=Ic=0,xi=null}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?me.memoizedState=At=e:At=At.next=e,At}function kt(){if(Qe===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=At===null?me.memoizedState:At.next;if(t!==null)At=t,Qe=e;else{if(e===null)throw me.alternate===null?Error(N(467)):Error(N(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},At===null?me.memoizedState=At=e:At=At.next=e}return At}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Xl;return Xl+=1,xi===null&&(xi=[]),e=fS(xi,e,t),t=me,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,ie.H=t===null||t.memoizedState===null?XS:Th),e}function $c(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ss(e);if(e.$$typeof===Bn)return $t(e)}throw Error(N(438,String(e)))}function vh(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=me.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Wc(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=g_;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function tc(e){var t=kt();return bh(t,Qe,e)}function bh(e,t,a){var n=e.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=a;var r=e.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}t.baseQueue=r=o,n.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var l=i=null,s=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ie&d)===d:(Vn&d)===d){var f=u.revertLane;if(f===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Ii&&(c=!0);else if((Vn&f)===f){u=u.next,f===Ii&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=d,i=o):s=s.next=d,me.lanes|=f,Or|=f;d=u.action,go&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=f,i=o):s=s.next=f,me.lanes|=d,Or|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!Ma(o,e.memoizedState)&&(_t=!0,c&&(a=gi,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=s,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Op(e){var t=kt(),a=t.queue;if(a===null)throw Error(N(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var i=r=r.next;do o=e(o,i.action),i=i.next;while(i!==r);Ma(o,t.memoizedState)||(_t=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function vS(e,t,a){var n=me,r=kt(),o=Te;if(o){if(a===void 0)throw Error(N(407));a=a()}else a=t();var i=!Ma((Qe||r).memoizedState,a);if(i&&(r.memoizedState=a,_t=!0),r=r.queue,Sh(IS.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||At!==null&&At.memoizedState.tag&1){if(n.flags|=2048,ki(9,{destroy:void 0},SS.bind(null,n,r,a,t),null),tt===null)throw Error(N(349));o||(Vn&127)!==0||bS(n,t,a)}return a}function bS(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Wc(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function SS(e,t,a,n){t.value=a,t.getSnapshot=n,CS(t)&&kS(e)}function IS(e,t,a){return a(function(){CS(t)&&kS(e)})}function CS(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ma(e,a)}catch{return!0}}function kS(e){var t=bo(e,2);t!==null&&pa(t,e,2)}function Cm(e){var t=aa();if(typeof e=="function"){var a=e;if(e=a(),go){yr(!0);try{a()}finally{yr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function LS(e,t,a,n){return e.baseState=a,bh(e,Qe,typeof n=="function"?n:Gn)}function DO(e,t,a,n,r){if(Kc(e))throw Error(N(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ie.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,TS(t,o)):(o.next=a.next,t.pending=a.next=o)}}function TS(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=ie.T,i={};ie.T=i;try{var l=a(r,n),s=ie.S;s!==null&&s(i,l),Lv(e,t,l)}catch(u){km(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ie.T=o}}else try{o=a(r,n),Lv(e,t,o)}catch(u){km(e,t,u)}}function Lv(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Tv(e,t,n)},function(n){return km(e,t,n)}):Tv(e,t,a)}function Tv(e,t,a){t.status="fulfilled",t.value=a,ES(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,TS(e,a)))}function km(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,ES(t),t=t.next;while(t!==n)}e.action=null}function ES(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function MS(e,t){return t}function Ev(e,t){if(Te){var a=tt.formState;if(a!==null){e:{var n=me;if(Te){if(lt){t:{for(var r=lt,o=Va;r.nodeType!==8;){if(!o){r=null;break t}if(r=Wa(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){lt=Wa(r.nextSibling),n=r.data==="F!";break e}}Dr(n)}n=!1}n&&(t=a[0])}}return a=aa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:MS,lastRenderedState:t},a.queue=n,a=GS.bind(null,me,n),n.dispatch=a,n=Cm(!1),o=Lh.bind(null,me,!1,n.queue),n=aa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=DO.bind(null,me,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Mv(e){var t=kt();return AS(t,Qe,e)}function AS(e,t,a){if(t=bh(e,t,MS)[0],e=tc(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ss(t)}catch(i){throw i===Oi?Gc:i}else n=t;t=kt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(me.flags|=2048,ki(9,{destroy:void 0},_O.bind(null,r,a),null)),[n,o,e]}function _O(e,t){e.action=t}function Av(e){var t=kt(),a=Qe;if(a!==null)return AS(t,a,e);kt(),t=t.memoizedState,a=kt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function ki(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=me.updateQueue,t===null&&(t=Wc(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function RS(){return kt().memoizedState}function ac(e,t,a,n){var r=aa();me.flags|=e,r.memoizedState=ki(1|t,{destroy:void 0},a,n===void 0?null:n)}function Xc(e,t,a,n){var r=kt();n=n===void 0?null:n;var o=r.memoizedState.inst;Qe!==null&&n!==null&&hh(n,Qe.memoizedState.deps)?r.memoizedState=ki(t,o,a,n):(me.flags|=e,r.memoizedState=ki(1|t,o,a,n))}function Rv(e,t){ac(8390656,8,e,t)}function Sh(e,t){Xc(2048,8,e,t)}function OO(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Wc(),me.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function DS(e){var t=kt().memoizedState;return OO({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(N(440));return t.impl.apply(void 0,arguments)}}function _S(e,t){return Xc(4,2,e,t)}function OS(e,t){return Xc(4,4,e,t)}function PS(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function NS(e,t,a){a=a!=null?a.concat([e]):null,Xc(4,4,PS.bind(null,t,e),a)}function Ih(){}function BS(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&hh(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function US(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&hh(t,n[1]))return n[0];if(n=e(),go){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n}function Ch(e,t,a){return a===void 0||(Vn&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=L0(),me.lanes|=e,Or|=e,a)}function FS(e,t,a,n){return Ma(a,t)?a:Ci.current!==null?(e=Ch(e,a,n),Ma(e,t)||(_t=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Ie&261930)===0?(_t=!0,e.memoizedState=a):(e=L0(),me.lanes|=e,Or|=e,t)}function zS(e,t,a,n,r){var o=Ue.p;Ue.p=o!==0&&8>o?o:8;var i=ie.T,l={};ie.T=l,Lh(e,!1,t,a);try{var s=r(),u=ie.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=MO(s,n);Pl(e,t,c,Ea(e))}else Pl(e,t,n,Ea(e))}catch(d){Pl(e,t,{then:function(){},status:"rejected",reason:d},Ea())}finally{Ue.p=o,i!==null&&l.types!==null&&(i.types=l.types),ie.T=i}}function PO(){}function Lm(e,t,a,n){if(e.tag!==5)throw Error(N(476));var r=qS(e).queue;zS(e,r,t,lo,a===null?PO:function(){return HS(e),a(n)})}function qS(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:lo,baseState:lo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:lo},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function HS(e){var t=qS(e);t.next===null&&(t=e.alternate.memoizedState),Pl(e,t.next.queue,{},Ea())}function kh(){return $t(Yl)}function jS(){return kt().memoizedState}function VS(){return kt().memoizedState}function NO(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ea();e=Cr(a);var n=kr(t,e,a);n!==null&&(pa(n,t,a),Dl(n,t,a)),t={cache:ch()},e.payload=t;return}t=t.return}}function BO(e,t,a){var n=Ea();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kc(e)?WS(t,a):(a=ih(e,t,a,n),a!==null&&(pa(a,e,n),$S(a,t,n)))}function GS(e,t,a){var n=Ea();Pl(e,t,a,n)}function Pl(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kc(e))WS(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,a);if(r.hasEagerState=!0,r.eagerState=l,Ma(l,i))return Vc(e,t,r,0),tt===null&&jc(),!1}catch{}if(a=ih(e,t,r,n),a!==null)return pa(a,e,n),$S(a,t,n),!0}return!1}function Lh(e,t,a,n){if(n={lane:2,revertLane:Ph(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kc(e)){if(t)throw Error(N(479))}else t=ih(e,a,n,2),t!==null&&pa(t,e,2)}function Kc(e){var t=e.alternate;return e===me||t!==null&&t===me}function WS(e,t){wi=Sc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function $S(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Db(e,a)}}var Kl={readContext:$t,use:$c,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Kl.useEffectEvent=gt;var XS={readContext:$t,use:$c,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Rv,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ac(4194308,4,PS.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){ac(4,2,e,t)},useMemo:function(e,t){var a=aa();t=t===void 0?null:t;var n=e();if(go){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=aa();if(a!==void 0){var r=a(t);if(go){yr(!0);try{a(t)}finally{yr(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=BO.bind(null,me,e),[n.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:function(e){e=Cm(e);var t=e.queue,a=GS.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ih,useDeferredValue:function(e,t){var a=aa();return Ch(a,e,t)},useTransition:function(){var e=Cm(!1);return e=zS.bind(null,me,e.queue,!0,!1),aa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=me,r=aa();if(Te){if(a===void 0)throw Error(N(407));a=a()}else{if(a=t(),tt===null)throw Error(N(349));(Ie&127)!==0||bS(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Rv(IS.bind(null,n,o,e),[e]),n.flags|=2048,ki(9,{destroy:void 0},SS.bind(null,n,o,a,t),null),a},useId:function(){var e=aa(),t=tt.identifierPrefix;if(Te){var a=gn,n=hn;a=(n&~(1<<32-Ta(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ic++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=AO++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kh,useFormState:Ev,useActionState:Ev,useOptimistic:function(e){var t=aa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Lh.bind(null,me,!0,a),a.dispatch=t,[e,t]},useMemoCache:vh,useCacheRefresh:function(){return aa().memoizedState=NO.bind(null,me)},useEffectEvent:function(e){var t=aa(),a={impl:e};return t.memoizedState=a,function(){if((Be&2)!==0)throw Error(N(440));return a.impl.apply(void 0,arguments)}}},Th={readContext:$t,use:$c,useCallback:BS,useContext:$t,useEffect:Sh,useImperativeHandle:NS,useInsertionEffect:_S,useLayoutEffect:OS,useMemo:US,useReducer:tc,useRef:RS,useState:function(){return tc(Gn)},useDebugValue:Ih,useDeferredValue:function(e,t){var a=kt();return FS(a,Qe.memoizedState,e,t)},useTransition:function(){var e=tc(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vS,useId:jS,useHostTransitionStatus:kh,useFormState:Mv,useActionState:Mv,useOptimistic:function(e,t){var a=kt();return LS(a,Qe,e,t)},useMemoCache:vh,useCacheRefresh:VS};Th.useEffectEvent=DS;var KS={readContext:$t,use:$c,useCallback:BS,useContext:$t,useEffect:Sh,useImperativeHandle:NS,useInsertionEffect:_S,useLayoutEffect:OS,useMemo:US,useReducer:Op,useRef:RS,useState:function(){return Op(Gn)},useDebugValue:Ih,useDeferredValue:function(e,t){var a=kt();return Qe===null?Ch(a,e,t):FS(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Op(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vS,useId:jS,useHostTransitionStatus:kh,useFormState:Av,useActionState:Av,useOptimistic:function(e,t){var a=kt();return Qe!==null?LS(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:vh,useCacheRefresh:VS};KS.useEffectEvent=DS;function Pp(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:st({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Tm={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ea(),r=Cr(n);r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(pa(t,e,n),Dl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ea(),r=Cr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(pa(t,e,n),Dl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ea(),n=Cr(a);n.tag=2,t!=null&&(n.callback=t),t=kr(e,n,a),t!==null&&(pa(t,e,a),Dl(t,e,a))}};function Dv(e,t,a,n,r,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,i):t.prototype&&t.prototype.isPureReactComponent?!Vl(a,n)||!Vl(r,o):!0}function _v(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Tm.enqueueReplaceState(t,t.state,null)}function yo(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=st({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function ZS(e){hc(e)}function QS(e){console.error(e)}function YS(e){hc(e)}function Cc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ov(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Em(e,t,a){return a=Cr(a),a.tag=3,a.payload={element:null},a.callback=function(){Cc(e,t)},a}function JS(e){return e=Cr(e),e.tag=3,e}function e0(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;e.payload=function(){return r(o)},e.callback=function(){Ov(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Ov(t,a,n),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function UO(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&_i(t,a,r,!0),a=Aa.current,a!==null){switch(a.tag){case 31:case 13:return Ga===null?Mc():a.alternate===null&&yt===0&&(yt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===xc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Wp(e,n,r)),!1;case 22:return a.flags|=65536,n===xc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Wp(e,n,r)),!1}throw Error(N(435,a.tag))}return Wp(e,n,r),Mc(),!1}if(Te)return t=Aa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==hm&&(e=Error(N(422),{cause:n}),Wl(ja(e,a)))):(n!==hm&&(t=Error(N(423),{cause:n}),Wl(ja(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=ja(n,a),r=Em(e.stateNode,n,r),_p(e,r),yt!==4&&(yt=2)),!1;var o=Error(N(520),{cause:n});if(o=ja(o,a),Ul===null?Ul=[o]:Ul.push(o),yt!==4&&(yt=2),t===null)return!0;n=ja(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Em(a.stateNode,n,e),_p(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Lr===null||!Lr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=JS(r),e0(r,e,a,n),_p(a,r),!1}a=a.return}while(a!==null);return!1}var Eh=Error(N(461)),_t=!1;function Vt(e,t,a,n){t.child=e===null?mS(t,null,a,n):ho(t,e.child,a,n)}function Pv(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}else i=n;return mo(t),n=gh(e,t,a,i,o,r),l=yh(),e!==null&&!_t?(wh(e,t,r),Wn(e,t,r)):(Te&&l&&sh(t),t.flags|=1,Vt(e,t,n,r),t.child)}function Nv(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!lh(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,t0(e,t,o,n,r)):(e=Ju(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Mh(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Vl,a(i,n)&&e.ref===t.ref)return Wn(e,t,r)}return t.flags|=1,e=zn(o,n),e.ref=t.ref,e.return=t,t.child=e}function t0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Vl(o,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=o,Mh(e,r))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Wn(e,t,r)}return Mm(e,t,a,n,r)}function a0(e,t,a,n){var r=n.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,t.child=null;return Bv(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ec(t,o!==null?o.cachePool:null),o!==null?kv(t,o):Sm(),yS(t);else return n=t.lanes=536870912,Bv(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(ec(t,o.cachePool),kv(t,o),hr(t),t.memoizedState=null):(e!==null&&ec(t,null),Sm(),hr(t));return Vt(e,t,r,a),t.child}function Ll(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bv(e,t,a,n,r){var o=dh();return o=o===null?null:{parent:Dt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&ec(t,null),Sm(),yS(t),e!==null&&_i(e,t,n,!0),t.childLanes=r,null}function nc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uv(e,t,a){return ho(t,e.child,null,a),e=nc(t,t.pendingProps),e.flags|=2,Sa(t),t.memoizedState=null,e}function FO(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(n.mode==="hidden")return e=nc(t,n),t.lanes=536870912,Ll(null,e);if(Im(t),(e=lt)?(e=X0(e,Va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:hn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},a=lS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return t.lanes=536870912,null}return nc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(Im(t),r)if(t.flags&256)t.flags&=-257,t=Uv(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(N(558));else if(_t||_i(e,t,a,!1),r=(a&e.childLanes)!==0,_t||r){if(n=tt,n!==null&&(i=_b(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,bo(e,i),pa(n,e,i),Eh;Mc(),t=Uv(e,t,a)}else e=o.treeContext,lt=Wa(i.nextSibling),Wt=t,Te=!0,Ir=null,Va=!1,e!==null&&uS(t,e),t=nc(t,n),t.flags|=4096;return t}return e=zn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(N(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Mm(e,t,a,n,r){return mo(t),a=gh(e,t,a,n,void 0,r),n=yh(),e!==null&&!_t?(wh(e,t,r),Wn(e,t,r)):(Te&&n&&sh(t),t.flags|=1,Vt(e,t,a,r),t.child)}function Fv(e,t,a,n,r,o){return mo(t),t.updateQueue=null,a=xS(t,n,a,r),wS(e),n=yh(),e!==null&&!_t?(wh(e,t,o),Wn(e,t,o)):(Te&&n&&sh(t),t.flags|=1,Vt(e,t,a,o),t.child)}function zv(e,t,a,n,r){if(mo(t),t.stateNode===null){var o=ui,i=a.contextType;typeof i=="object"&&i!==null&&(o=$t(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Tm,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},ph(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?$t(i):ui,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Pp(t,a,i,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&Tm.enqueueReplaceState(o,o.state,null),Ol(t,n,o,r),_l(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var l=t.memoizedProps,s=yo(a,l);o.props=s;var u=o.context,c=a.contextType;i=ui,typeof c=="object"&&c!==null&&(i=$t(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l||u!==i)&&_v(t,o,n,i),fr=!1;var f=t.memoizedState;o.state=f,Ol(t,n,o,r),_l(),u=t.memoizedState,l||f!==u||fr?(typeof d=="function"&&(Pp(t,a,d,n),u=t.memoizedState),(s=fr||Dv(t,a,s,n,f,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=i,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,vm(e,t),i=t.memoizedProps,c=yo(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=ui,typeof u=="object"&&u!==null&&(s=$t(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==s)&&_v(t,o,n,s),fr=!1,f=t.memoizedState,o.state=f,Ol(t,n,o,r),_l();var p=t.memoizedState;i!==d||f!==p||fr||e!==null&&e.dependencies!==null&&wc(e.dependencies)?(typeof l=="function"&&(Pp(t,a,l,n),p=t.memoizedState),(c=fr||Dv(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&wc(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),o.props=n,o.state=p,o.context=s,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,rc(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=ho(t,e.child,null,r),t.child=ho(t,null,a,r)):Vt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=Wn(e,t,r),e}function qv(e,t,a,n){return po(),t.flags|=256,Vt(e,t,a,n),t.child}var Np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bp(e){return{baseLanes:e,cachePool:dS()}}function Up(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ca),e}function n0(e,t,a){var n=t.pendingProps,r=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(r?mr(t):hr(t),(e=lt)?(e=X0(e,Va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:hn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},a=lS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return jm(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(hr(t),r=t.mode,l=kc({mode:"hidden",children:l},r),n=so(n,r,a,null),l.return=t,n.return=t,l.sibling=n,t.child=l,n=t.child,n.memoizedState=Bp(a),n.childLanes=Up(e,i,a),t.memoizedState=Np,Ll(null,n)):(mr(t),Am(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(mr(t),t.flags&=-257,t=Fp(e,t,a)):t.memoizedState!==null?(hr(t),t.child=e.child,t.flags|=128,t=null):(hr(t),l=n.fallback,r=t.mode,n=kc({mode:"visible",children:n.children},r),l=so(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,ho(t,e.child,null,a),n=t.child,n.memoizedState=Bp(a),n.childLanes=Up(e,i,a),t.memoizedState=Np,t=Ll(null,n));else if(mr(t),jm(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(N(419)),n.stack="",n.digest=i,Wl({value:n,source:null,stack:null}),t=Fp(e,t,a)}else if(_t||_i(e,t,a,!1),i=(a&e.childLanes)!==0,_t||i){if(i=tt,i!==null&&(n=_b(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,bo(e,n),pa(i,e,n),Eh;Hm(l)||Mc(),t=Fp(e,t,a)}else Hm(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,lt=Wa(l.nextSibling),Wt=t,Te=!0,Ir=null,Va=!1,e!==null&&uS(t,e),t=Am(t,n.children),t.flags|=4096);return t}return r?(hr(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=zn(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=zn(u,l):(l=so(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,Ll(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Bp(a):(r=l.cachePool,r!==null?(s=Dt._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=dS(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Up(e,i,a),t.memoizedState=Np,Ll(e.child,n)):(mr(t),a=e.child,e=a.sibling,a=zn(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=a,t.memoizedState=null,a)}function Am(e,t){return t=kc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=Ia(22,e,null,t),e.lanes=0,e}function Fp(e,t,a){return ho(t,e.child,null,a),e=Am(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hv(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ym(e.return,t,a)}function zp(e,t,a,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=a,i.tailMode=r,i.treeForkCount=o)}function r0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Ct.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,rt(Ct,i),Vt(e,t,n,a),n=Te?Gl:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hv(e,a,t);else if(e.tag===19)Hv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&bc(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),zp(t,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&bc(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}zp(t,!0,a,null,o,n);break;case"together":zp(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Wn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(_i(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,a=zn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=zn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wc(e)))}function zO(e,t,a){switch(t.tag){case 3:dc(t,t.stateNode.containerInfo),pr(t,Dt,e.memoizedState.cache),po();break;case 27:case 5:rm(t);break;case 4:dc(t,t.stateNode.containerInfo);break;case 10:pr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Im(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?n0(e,t,a):(mr(t),e=Wn(e,t,a),e!==null?e.sibling:null);mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(_i(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return r0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),rt(Ct,Ct.current),n)break;return null;case 22:return t.lanes=0,a0(e,t,a,t.pendingProps);case 24:pr(t,Dt,e.memoizedState.cache)}return Wn(e,t,a)}function o0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Mh(e,a)&&(t.flags&128)===0)return _t=!1,zO(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Te&&(t.flags&1048576)!==0&&sS(t,Gl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e=="function")lh(e)?(n=yo(e,n),t.tag=1,t=zv(null,t,e,n,a)):(t.tag=0,t=Mm(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===$m){t.tag=11,t=Pv(null,t,e,n,a);break e}else if(r===Xm){t.tag=14,t=Nv(null,t,e,n,a);break e}}throw t=am(e)||e,Error(N(306,t,""))}}return t;case 0:return Mm(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=yo(n,t.pendingProps),zv(e,t,n,r,a);case 3:e:{if(dc(t,t.stateNode.containerInfo),e===null)throw Error(N(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,vm(e,t),Ol(t,n,null,a);var i=t.memoizedState;if(n=i.cache,pr(t,Dt,n),n!==o.cache&&wm(t,[Dt],a,!0),_l(),n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=qv(e,t,n,a);break e}else if(n!==r){r=ja(Error(N(424)),t),Wl(r),t=qv(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,lt=Wa(e.firstChild),Wt=t,Te=!0,Ir=null,Va=!0,a=mS(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(po(),n===r){t=Wn(e,t,a);break e}Vt(e,t,n,a)}t=t.child}return t;case 26:return rc(e,t),e===null?(a=cb(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,n=_c(Sr.current).createElement(a),n[Gt]=t,n[ma]=e,Xt(n,a,e),qt(n),t.stateNode=n):t.memoizedState=cb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return rm(t),e===null&&Te&&(n=t.stateNode=K0(t.type,t.pendingProps,Sr.current),Wt=t,Va=!0,r=lt,Nr(t.type)?(Vm=r,lt=Wa(n.firstChild)):lt=r),Vt(e,t,t.pendingProps.children,a),rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((r=n=lt)&&(n=mP(n,t.type,t.pendingProps,Va),n!==null?(t.stateNode=n,Wt=t,lt=Wa(n.firstChild),Va=!1,r=!0):r=!1),r||Dr(t)),rm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,zm(r,o)?n=null:i!==null&&zm(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=gh(e,t,RO,null,null,a),Yl._currentValue=r),rc(e,t),Vt(e,t,n,a),t.child;case 6:return e===null&&Te&&((e=a=lt)&&(a=hP(a,t.pendingProps,Va),a!==null?(t.stateNode=a,Wt=t,lt=null,e=!0):e=!1),e||Dr(t)),null;case 13:return n0(e,t,a);case 4:return dc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ho(t,null,n,a):Vt(e,t,n,a),t.child;case 11:return Pv(e,t,t.type,t.pendingProps,a);case 7:return Vt(e,t,t.pendingProps,a),t.child;case 8:return Vt(e,t,t.pendingProps.children,a),t.child;case 12:return Vt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pr(t,t.type,n.value),Vt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,mo(t),r=$t(r),n=n(r),t.flags|=1,Vt(e,t,n,a),t.child;case 14:return Nv(e,t,t.type,t.pendingProps,a);case 15:return t0(e,t,t.type,t.pendingProps,a);case 19:return r0(e,t,a);case 31:return FO(e,t,a);case 22:return a0(e,t,a,t.pendingProps);case 24:return mo(t),n=$t(Dt),e===null?(r=dh(),r===null&&(r=tt,o=ch(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},ph(t),pr(t,Dt,r)):((e.lanes&a)!==0&&(vm(e,t),Ol(t,null,null,a),_l()),r=e.memoizedState,o=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pr(t,Dt,n)):(n=o.cache,pr(t,Dt,n),n!==r.cache&&wm(t,[Dt],a,!0))),Vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(N(156,t.tag))}function Rn(e){e.flags|=4}function qp(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(M0())e.flags|=8192;else throw co=xc,fh}else e.flags&=-16777217}function jv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Y0(t))if(M0())e.flags|=8192;else throw co=xc,fh}function Hu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ab():536870912,e.lanes|=t,Li|=t)}function xl(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function qO(e,t,a){var n=t.pendingProps;switch(uh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qn(Dt),vi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dp())),it(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Rn(t),o!==null?(it(t),jv(t,o)):(it(t),qp(t,r,null,n,a))):o?o!==e.memoizedState?(Rn(t),it(t),jv(t,o)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Rn(t),it(t),qp(t,r,e,n,a)),null;case 27:if(fc(t),a=Sr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}e=wn.current,Qo(t)?wv(t,e):(e=K0(r,n,a),t.stateNode=e,Rn(t))}return it(t),null;case 5:if(fc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}if(o=wn.current,Qo(t))wv(t,o);else{var i=_c(Sr.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}o[Gt]=t,o[ma]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(Xt(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Rn(t)}}return it(t),qp(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(N(166));if(e=Sr.current,Qo(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Wt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Gt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||G0(e.nodeValue,a)),e||Dr(t,!0)}else e=_c(e).createTextNode(n),e[Gt]=t,t.stateNode=e}return it(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Qo(t),a!==null){if(e===null){if(!n)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[Gt]=t}else po(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else a=Dp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Sa(t),t):(Sa(t),null);if((t.flags&128)!==0)throw Error(N(558))}return it(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Qo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(N(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(N(317));r[Gt]=t}else po(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),r=!1}else r=Dp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Sa(t),t):(Sa(t),null)}return Sa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Hu(t,t.updateQueue),it(t),null);case 4:return vi(),e===null&&Nh(t.stateNode.containerInfo),it(t),null;case 10:return qn(t.type),it(t),null;case 19:if(Ht(Ct),n=t.memoizedState,n===null)return it(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)xl(n,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=bc(e),o!==null){for(t.flags|=128,xl(n,!1),e=o.updateQueue,t.updateQueue=e,Hu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)iS(a,e),a=a.sibling;return rt(Ct,Ct.current&1|2),Te&&Pn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ka()>Tc&&(t.flags|=128,r=!0,xl(n,!1),t.lanes=4194304)}else{if(!r)if(e=bc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hu(t,e),xl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Te)return it(t),null}else 2*ka()-n.renderingStartTime>Tc&&a!==536870912&&(t.flags|=128,r=!0,xl(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ka(),e.sibling=null,a=Ct.current,rt(Ct,r?a&1|2:a&1),Te&&Pn(t,n.treeForkCount),e):(it(t),null);case 22:case 23:return Sa(t),mh(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),a=t.updateQueue,a!==null&&Hu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&Ht(uo),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qn(Dt),it(t),null;case 25:return null;case 30:return null}throw Error(N(156,t.tag))}function HO(e,t){switch(uh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qn(Dt),vi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fc(t),null;case 31:if(t.memoizedState!==null){if(Sa(t),t.alternate===null)throw Error(N(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ht(Ct),null;case 4:return vi(),null;case 10:return qn(t.type),null;case 22:case 23:return Sa(t),mh(),e!==null&&Ht(uo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qn(Dt),null;case 25:return null;default:return null}}function i0(e,t){switch(uh(t),t.tag){case 3:qn(Dt),vi();break;case 26:case 27:case 5:fc(t);break;case 4:vi();break;case 31:t.memoizedState!==null&&Sa(t);break;case 13:Sa(t);break;case 19:Ht(Ct);break;case 10:qn(t.type);break;case 22:case 23:Sa(t),mh(),e!==null&&Ht(uo);break;case 24:qn(Dt)}}function us(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(l){qe(t,t.return,l)}}function _r(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){var i=n.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var s=a,u=l;try{u()}catch(c){qe(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){qe(t,t.return,c)}}function l0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{gS(t,a)}catch(n){qe(e,e.return,n)}}}function s0(e,t,a){a.props=yo(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){qe(e,t,n)}}function Nl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){qe(e,t,r)}}function yn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){qe(e,t,r)}else a.current=null}function u0(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){qe(e,e.return,r)}}function Hp(e,t,a){try{var n=e.stateNode;sP(n,e.type,a,t),n[ma]=t}catch(r){qe(e,e.return,r)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function jp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Nr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rm(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Un));else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Rm(e,t,a),e=e.sibling;e!==null;)Rm(e,t,a),e=e.sibling}function Lc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lc(e,t,a),e=e.sibling;e!==null;)Lc(e,t,a),e=e.sibling}function d0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Xt(t,n,a),t[Gt]=e,t[ma]=a}catch(o){qe(e,e.return,o)}}var Nn=!1,Rt=!1,Vp=!1,Vv=typeof WeakSet=="function"?WeakSet:Set,zt=null;function jO(e,t){if(e=e.containerInfo,Um=Bc,e=Yb(e),rh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,l=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==a||r!==0&&d.nodeType!==3||(l=i+r),d!==o||n!==0&&d.nodeType!==3||(s=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===a&&++u===r&&(l=i),f===o&&++c===n&&(s=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=l===-1||s===-1?null:{start:l,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(Fm={focusedElem:e,selectionRange:a},Bc=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var m=yo(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){qe(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)qm(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":qm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(N(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function f0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:_n(e,a),n&4&&us(5,a);break;case 1:if(_n(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){qe(a,a.return,i)}else{var r=yo(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){qe(a,a.return,i)}}n&64&&l0(a),n&512&&Nl(a,a.return);break;case 3:if(_n(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{gS(e,t)}catch(i){qe(a,a.return,i)}}break;case 27:t===null&&n&4&&d0(a);case 26:case 5:_n(e,a),t===null&&n&4&&u0(a),n&512&&Nl(a,a.return);break;case 12:_n(e,a);break;case 31:_n(e,a),n&4&&h0(e,a);break;case 13:_n(e,a),n&4&&g0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=YO.bind(null,a),gP(e,a))));break;case 22:if(n=a.memoizedState!==null||Nn,!n){t=t!==null&&t.memoizedState!==null||Rt,r=Nn;var o=Rt;Nn=n,(Rt=t)&&!o?On(e,a,(a.subtreeFlags&8772)!==0):_n(e,a),Nn=r,Rt=o}break;case 30:break;default:_n(e,a)}}function p0(e){var t=e.alternate;t!==null&&(e.alternate=null,p0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ym(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,da=!1;function Dn(e,t,a){for(a=a.child;a!==null;)m0(e,t,a),a=a.sibling}function m0(e,t,a){if(La&&typeof La.onCommitFiberUnmount=="function")try{La.onCommitFiberUnmount(as,a)}catch{}switch(a.tag){case 26:Rt||yn(a,t),Dn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||yn(a,t);var n=mt,r=da;Nr(a.type)&&(mt=a.stateNode,da=!1),Dn(e,t,a),zl(a.stateNode),mt=n,da=r;break;case 5:Rt||yn(a,t);case 6:if(n=mt,r=da,mt=null,Dn(e,t,a),mt=n,da=r,mt!==null)if(da)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(o){qe(a,t,o)}else try{mt.removeChild(a.stateNode)}catch(o){qe(a,t,o)}break;case 18:mt!==null&&(da?(e=mt,ob(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ai(e)):ob(mt,a.stateNode));break;case 4:n=mt,r=da,mt=a.stateNode.containerInfo,da=!0,Dn(e,t,a),mt=n,da=r;break;case 0:case 11:case 14:case 15:_r(2,a,t),Rt||_r(4,a,t),Dn(e,t,a);break;case 1:Rt||(yn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&s0(a,t,n)),Dn(e,t,a);break;case 21:Dn(e,t,a);break;case 22:Rt=(n=Rt)||a.memoizedState!==null,Dn(e,t,a),Rt=n;break;default:Dn(e,t,a)}}function h0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ai(e)}catch(a){qe(t,t.return,a)}}}function g0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ai(e)}catch(a){qe(t,t.return,a)}}function VO(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vv),t;default:throw Error(N(435,e.tag))}}function ju(e,t){var a=VO(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=JO.bind(null,e,n);n.then(r,r)}})}function ua(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Nr(l.type)){mt=l.stateNode,da=!1;break e}break;case 5:mt=l.stateNode,da=!1;break e;case 3:case 4:mt=l.stateNode.containerInfo,da=!0;break e}l=l.return}if(mt===null)throw Error(N(160));m0(o,i,r),mt=null,da=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)y0(t,e),t=t.sibling}var tn=null;function y0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ua(t,e),ca(e),n&4&&(_r(3,e,e.return),us(3,e),_r(5,e,e.return));break;case 1:ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),n&64&&Nn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=tn;if(ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[os]||o[Gt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),Xt(o,n,a),o[Gt]=e,qt(o),n=o;break e;case"link":var i=fb("link","href",r).get(n+(a.href||""));if(i){for(var l=0;l<i.length;l++)if(o=i[l],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;case"meta":if(i=fb("meta","content",r).get(n+(a.content||""))){for(l=0;l<i.length;l++)if(o=i[l],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;default:throw Error(N(468,n))}o[Gt]=e,qt(o),n=o}e.stateNode=n}else pb(r,e.type,e.stateNode);else e.stateNode=db(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?pb(r,e.type,e.stateNode):db(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Hp(e,e.memoizedProps,a.memoizedProps)}break;case 27:ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),a!==null&&n&4&&Hp(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ua(t,e),ca(e),n&512&&(Rt||a===null||yn(a,a.return)),e.flags&32){r=e.stateNode;try{Si(r,"")}catch(m){qe(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Hp(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Vp=!0);break;case 6:if(ua(t,e),ca(e),n&4){if(e.stateNode===null)throw Error(N(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){qe(e,e.return,m)}}break;case 3:if(lc=null,r=tn,tn=Oc(t.containerInfo),ua(t,e),tn=r,ca(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Ai(t.containerInfo)}catch(m){qe(e,e.return,m)}Vp&&(Vp=!1,w0(e));break;case 4:n=tn,tn=Oc(e.stateNode.containerInfo),ua(t,e),ca(e),tn=n;break;case 12:ua(t,e),ca(e);break;case 31:ua(t,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 13:ua(t,e),ca(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zc=ka()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Nn,c=Rt;if(Nn=u||r,Rt=c||s,ua(t,e),Rt=c,Nn=u,ca(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Nn||Rt||io(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){s=a=t;try{if(o=s.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=s.stateNode;var d=s.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(m){qe(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){qe(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?ib(p,!0):ib(s.stateNode,!1)}catch(m){qe(s,s.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,ju(e,a))));break;case 19:ua(t,e),ca(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ju(e,n)));break;case 30:break;case 21:break;default:ua(t,e),ca(e)}}function ca(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(c0(n)){a=n;break}n=n.return}if(a==null)throw Error(N(160));switch(a.tag){case 27:var r=a.stateNode,o=jp(e);Lc(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Si(i,""),a.flags&=-33);var l=jp(e);Lc(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=jp(e);Rm(e,u,s);break;default:throw Error(N(161))}}catch(c){qe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function w0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;w0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)f0(e,t.alternate,t),t=t.sibling}function io(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_r(4,t,t.return),io(t);break;case 1:yn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&s0(t,t.return,a),io(t);break;case 27:zl(t.stateNode);case 26:case 5:yn(t,t.return),io(t);break;case 22:t.memoizedState===null&&io(t);break;case 30:io(t);break;default:io(t)}e=e.sibling}}function On(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,o=t,i=o.flags;switch(o.tag){case 0:case 11:case 15:On(r,o,a),us(4,o);break;case 1:if(On(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){qe(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var l=n.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)hS(s[r],l)}catch(u){qe(n,n.return,u)}}a&&i&64&&l0(o),Nl(o,o.return);break;case 27:d0(o);case 26:case 5:On(r,o,a),a&&n===null&&i&4&&u0(o),Nl(o,o.return);break;case 12:On(r,o,a);break;case 31:On(r,o,a),a&&i&4&&h0(r,o);break;case 13:On(r,o,a),a&&i&4&&g0(r,o);break;case 22:o.memoizedState===null&&On(r,o,a),Nl(o,o.return);break;case 30:break;default:On(r,o,a)}t=t.sibling}}function Ah(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ls(a))}function Rh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e))}function en(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)x0(e,t,a,n),t=t.sibling}function x0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:en(e,t,a,n),r&2048&&us(9,t);break;case 1:en(e,t,a,n);break;case 3:en(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ls(e)));break;case 12:if(r&2048){en(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,l=o.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){qe(t,t.return,s)}}else en(e,t,a,n);break;case 31:en(e,t,a,n);break;case 13:en(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?en(e,t,a,n):Bl(e,t):o._visibility&2?en(e,t,a,n):(o._visibility|=2,Jo(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ah(i,t);break;case 24:en(e,t,a,n),r&2048&&Rh(t.alternate,t);break;default:en(e,t,a,n)}}function Jo(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,l=a,s=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:Jo(o,i,l,s,r),us(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Jo(o,i,l,s,r):Bl(o,i):(c._visibility|=2,Jo(o,i,l,s,r)),r&&u&2048&&Ah(i.alternate,i);break;case 24:Jo(o,i,l,s,r),r&&u&2048&&Rh(i.alternate,i);break;default:Jo(o,i,l,s,r)}t=t.sibling}}function Bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:Bl(a,n),r&2048&&Ah(n.alternate,n);break;case 24:Bl(a,n),r&2048&&Rh(n.alternate,n);break;default:Bl(a,n)}t=t.sibling}}var Tl=8192;function Yo(e,t,a){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)v0(e,t,a),e=e.sibling}function v0(e,t,a){switch(e.tag){case 26:Yo(e,t,a),e.flags&Tl&&e.memoizedState!==null&&EP(a,tn,e.memoizedState,e.memoizedProps);break;case 5:Yo(e,t,a);break;case 3:case 4:var n=tn;tn=Oc(e.stateNode.containerInfo),Yo(e,t,a),tn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Tl,Tl=16777216,Yo(e,t,a),Tl=n):Yo(e,t,a));break;default:Yo(e,t,a)}}function b0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function vl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,I0(n,e)}b0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)S0(e),e=e.sibling}function S0(e){switch(e.tag){case 0:case 11:case 15:vl(e),e.flags&2048&&_r(9,e,e.return);break;case 3:vl(e);break;case 12:vl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,oc(e)):vl(e);break;default:vl(e)}}function oc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,I0(n,e)}b0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_r(8,t,t.return),oc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,oc(t));break;default:oc(t)}e=e.sibling}}function I0(e,t){for(;zt!==null;){var a=zt;switch(a.tag){case 0:case 11:case 15:_r(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ls(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,zt=n;else e:for(a=e;zt!==null;){n=zt;var r=n.sibling,o=n.return;if(p0(n),n===a){zt=null;break e}if(r!==null){r.return=o,zt=r;break e}zt=o}}}var GO={getCacheForType:function(e){var t=$t(Dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return $t(Dt).controller.signal}},WO=typeof WeakMap=="function"?WeakMap:Map,Be=0,tt=null,Se=null,Ie=0,ze=0,ba=null,xr=!1,Pi=!1,Dh=!1,$n=0,yt=0,Or=0,fo=0,_h=0,Ca=0,Li=0,Ul=null,fa=null,Dm=!1,Zc=0,C0=0,Tc=1/0,Ec=null,Lr=null,Ot=0,Tr=null,Ti=null,Hn=0,_m=0,Om=null,k0=null,Fl=0,Pm=null;function Ea(){return(Be&2)!==0&&Ie!==0?Ie&-Ie:ie.T!==null?Ph():Ob()}function L0(){if(Ca===0)if((Ie&536870912)===0||Te){var e=_u;_u<<=1,(_u&3932160)===0&&(_u=262144),Ca=e}else Ca=536870912;return e=Aa.current,e!==null&&(e.flags|=32),Ca}function pa(e,t,a){(e===tt&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(Ei(e,0),vr(e,Ie,Ca,!1)),rs(e,a),((Be&2)===0||e!==tt)&&(e===tt&&((Be&2)===0&&(fo|=a),yt===4&&vr(e,Ie,Ca,!1)),vn(e))}function T0(e,t,a){if((Be&6)!==0)throw Error(N(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ns(e,t),r=n?KO(e,t):Gp(e,t,!0),o=n;do{if(r===0){Pi&&!n&&vr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!$O(a)){r=Gp(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Ul;var s=l.current.memoizedState.isDehydrated;if(s&&(Ei(l,i).flags|=256),i=Gp(l,i,!1),i!==2){if(Dh&&!s){l.errorRecoveryDisabledLanes|=o,fo|=o,r=4;break e}o=fa,fa=r,o!==null&&(fa===null?fa=o:fa.push.apply(fa,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Ei(e,0),vr(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(N(345));case 4:if((t&4194048)!==t)break;case 6:vr(n,t,Ca,!xr);break e;case 2:fa=null;break;case 3:case 5:break;default:throw Error(N(329))}if((t&62914560)===t&&(r=Zc+300-ka(),10<r)){if(vr(n,t,Ca,!xr),Fc(n,0,!0)!==0)break e;Hn=t,n.timeoutHandle=$0(Gv.bind(null,n,a,fa,Ec,Dm,t,Ca,fo,Li,xr,o,"Throttled",-0,0),r);break e}Gv(n,a,fa,Ec,Dm,t,Ca,fo,Li,xr,o,null,-0,0)}}break}while(!0);vn(e)}function Gv(e,t,a,n,r,o,i,l,s,u,c,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Un},v0(t,o,d);var m=(o&62914560)===o?Zc-ka():(o&4194048)===o?C0-ka():0;if(m=MP(d,m),m!==null){Hn=o,e.cancelPendingCommit=m($v.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),vr(e,o,i,!u);return}}$v(e,t,o,a,n,r,i,l,s)}function $O(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!Ma(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vr(e,t,a,n){t&=~_h,t&=~fo,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-Ta(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&Rb(e,a,t)}function Qc(){return(Be&6)===0?(cs(0,!1),!1):!0}function Oh(){if(Se!==null){if(ze===0)var e=Se.return;else e=Se,Fn=So=null,xh(e),yi=null,$l=0,e=Se;for(;e!==null;)i0(e.alternate,e),e=e.return;Se=null}}function Ei(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,dP(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Hn=0,Oh(),tt=e,Se=a=zn(e.current,null),Ie=t,ze=0,ba=null,xr=!1,Pi=ns(e,t),Dh=!1,Li=Ca=_h=fo=Or=yt=0,fa=Ul=null,Dm=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ta(n),o=1<<r;t|=e[r],n&=~o}return $n=t,jc(),a}function E0(e,t){me=null,ie.H=Kl,t===Oi||t===Gc?(t=Iv(),ze=3):t===fh?(t=Iv(),ze=4):ze=t===Eh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ba=t,Se===null&&(yt=1,Cc(e,ja(t,e.current)))}function M0(){var e=Aa.current;return e===null?!0:(Ie&4194048)===Ie?Ga===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===Ga:!1}function A0(){var e=ie.H;return ie.H=Kl,e===null?Kl:e}function R0(){var e=ie.A;return ie.A=GO,e}function Mc(){yt=4,xr||(Ie&4194048)!==Ie&&Aa.current!==null||(Pi=!0),(Or&134217727)===0&&(fo&134217727)===0||tt===null||vr(tt,Ie,Ca,!1)}function Gp(e,t,a){var n=Be;Be|=2;var r=A0(),o=R0();(tt!==e||Ie!==t)&&(Ec=null,Ei(e,t)),t=!1;var i=yt;e:do try{if(ze!==0&&Se!==null){var l=Se,s=ba;switch(ze){case 8:Oh(),i=6;break e;case 3:case 2:case 9:case 6:Aa.current===null&&(t=!0);var u=ze;if(ze=0,ba=null,fi(e,l,s,u),a&&Pi){i=0;break e}break;default:u=ze,ze=0,ba=null,fi(e,l,s,u)}}XO(),i=yt;break}catch(c){E0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Fn=So=null,Be=n,ie.H=r,ie.A=o,Se===null&&(tt=null,Ie=0,jc()),i}function XO(){for(;Se!==null;)D0(Se)}function KO(e,t){var a=Be;Be|=2;var n=A0(),r=R0();tt!==e||Ie!==t?(Ec=null,Tc=ka()+500,Ei(e,t)):Pi=ns(e,t);e:do try{if(ze!==0&&Se!==null){t=Se;var o=ba;t:switch(ze){case 1:ze=0,ba=null,fi(e,t,o,1);break;case 2:case 9:if(Sv(o)){ze=0,ba=null,Wv(t);break}t=function(){ze!==2&&ze!==9||tt!==e||(ze=7),vn(e)},o.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Sv(o)?(ze=0,ba=null,Wv(t)):(ze=0,ba=null,fi(e,t,o,7));break;case 5:var i=null;switch(Se.tag){case 26:i=Se.memoizedState;case 5:case 27:var l=Se;if(i?Y0(i):l.stateNode.complete){ze=0,ba=null;var s=l.sibling;if(s!==null)Se=s;else{var u=l.return;u!==null?(Se=u,Yc(u)):Se=null}break t}}ze=0,ba=null,fi(e,t,o,5);break;case 6:ze=0,ba=null,fi(e,t,o,6);break;case 8:Oh(),yt=6;break e;default:throw Error(N(462))}}ZO();break}catch(c){E0(e,c)}while(!0);return Fn=So=null,ie.H=n,ie.A=r,Be=a,Se!==null?0:(tt=null,Ie=0,jc(),yt)}function ZO(){for(;Se!==null&&!x_();)D0(Se)}function D0(e){var t=o0(e.alternate,e,$n);e.memoizedProps=e.pendingProps,t===null?Yc(e):Se=t}function Wv(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Fv(a,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Fv(a,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:xh(t);default:i0(a,t),t=Se=iS(t,$n),t=o0(a,t,$n)}e.memoizedProps=e.pendingProps,t===null?Yc(e):Se=t}function fi(e,t,a,n){Fn=So=null,xh(t),yi=null,$l=0;var r=t.return;try{if(UO(e,r,t,a,Ie)){yt=1,Cc(e,ja(a,e.current)),Se=null;return}}catch(o){if(r!==null)throw Se=r,o;yt=1,Cc(e,ja(a,e.current)),Se=null;return}t.flags&32768?(Te||n===1?e=!0:Pi||(Ie&536870912)!==0?e=!1:(xr=e=!0,(n===2||n===9||n===3||n===6)&&(n=Aa.current,n!==null&&n.tag===13&&(n.flags|=16384))),_0(t,e)):Yc(t)}function Yc(e){var t=e;do{if((t.flags&32768)!==0){_0(t,xr);return}e=t.return;var a=qO(t.alternate,t,$n);if(a!==null){Se=a;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);yt===0&&(yt=5)}function _0(e,t){do{var a=HO(e.alternate,e);if(a!==null){a.flags&=32767,Se=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Se=e;return}Se=e=a}while(e!==null);yt=6,Se=null}function $v(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do Jc();while(Ot!==0);if((Be&6)!==0)throw Error(N(327));if(t!==null){if(t===e.current)throw Error(N(177));if(o=t.lanes|t.childLanes,o|=oh,M_(e,a,o,i,l,s),e===tt&&(Se=tt=null,Ie=0),Ti=t,Tr=e,Hn=a,_m=o,Om=r,k0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eP(pc,function(){return U0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=ie.T,ie.T=null,r=Ue.p,Ue.p=2,i=Be,Be|=4;try{jO(e,t,a)}finally{Be=i,Ue.p=r,ie.T=n}}Ot=1,O0(),P0(),N0()}}function O0(){if(Ot===1){Ot=0;var e=Tr,t=Ti,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{y0(t,e);var o=Fm,i=Yb(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&Qb(l.ownerDocument.documentElement,l)){if(s!==null&&rh(l)){var u=s.start,c=s.end;if(c===void 0&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=l.textContent.length,x=Math.min(s.start,m),I=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>I&&(i=I,I=x,x=i);var y=hv(l,x),w=hv(l,I);if(y&&w&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==w.node||p.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),p.removeAllRanges(),x>I?(p.addRange(g),p.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),p.addRange(g))}}}}for(d=[],p=l;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var b=d[l];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Bc=!!Um,Fm=Um=null}finally{Be=r,Ue.p=n,ie.T=a}}e.current=t,Ot=2}}function P0(){if(Ot===2){Ot=0;var e=Tr,t=Ti,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{f0(e,t.alternate,t)}finally{Be=r,Ue.p=n,ie.T=a}}Ot=3}}function N0(){if(Ot===4||Ot===3){Ot=0,v_();var e=Tr,t=Ti,a=Hn,n=k0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Ti=Tr=null,B0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Lr=null),Qm(a),t=t.stateNode,La&&typeof La.onCommitFiberRoot=="function")try{La.onCommitFiberRoot(as,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=ie.T,r=Ue.p,Ue.p=2,ie.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var l=n[i];o(l.value,{componentStack:l.stack})}}finally{ie.T=t,Ue.p=r}}(Hn&3)!==0&&Jc(),vn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Pm?Fl++:(Fl=0,Pm=e):Fl=0,cs(0,!1)}}function B0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ls(t)))}function Jc(){return O0(),P0(),N0(),U0()}function U0(){if(Ot!==5)return!1;var e=Tr,t=_m;_m=0;var a=Qm(Hn),n=ie.T,r=Ue.p;try{Ue.p=32>a?32:a,ie.T=null,a=Om,Om=null;var o=Tr,i=Hn;if(Ot=0,Ti=Tr=null,Hn=0,(Be&6)!==0)throw Error(N(331));var l=Be;if(Be|=4,S0(o.current),x0(o,o.current,i,a),Be=l,cs(0,!1),La&&typeof La.onPostCommitFiberRoot=="function")try{La.onPostCommitFiberRoot(as,o)}catch{}return!0}finally{Ue.p=r,ie.T=n,B0(e,t)}}function Xv(e,t,a){t=ja(a,t),t=Em(e.stateNode,t,2),e=kr(e,t,2),e!==null&&(rs(e,2),vn(e))}function qe(e,t,a){if(e.tag===3)Xv(e,e,a);else for(;t!==null;){if(t.tag===3){Xv(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Lr===null||!Lr.has(n))){e=ja(a,e),a=JS(2),n=kr(t,a,2),n!==null&&(e0(a,n,t,e),rs(n,2),vn(n));break}}t=t.return}}function Wp(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new WO;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(Dh=!0,r.add(a),e=QO.bind(null,e,t,a),t.then(e,e))}function QO(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(Ie&a)===a&&(yt===4||yt===3&&(Ie&62914560)===Ie&&300>ka()-Zc?(Be&2)===0&&Ei(e,0):_h|=a,Li===Ie&&(Li=0)),vn(e)}function F0(e,t){t===0&&(t=Ab()),e=bo(e,t),e!==null&&(rs(e,t),vn(e))}function YO(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),F0(e,a)}function JO(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(N(314))}n!==null&&n.delete(t),F0(e,a)}function eP(e,t){return Km(e,t)}var Ac=null,ei=null,Nm=!1,Rc=!1,$p=!1,br=0;function vn(e){e!==ei&&e.next===null&&(ei===null?Ac=ei=e:ei=ei.next=e),Rc=!0,Nm||(Nm=!0,aP())}function cs(e,t){if(!$p&&Rc){$p=!0;do for(var a=!1,n=Ac;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,l=n.pingedLanes;o=(1<<31-Ta(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Kv(n,o))}else o=Ie,o=Fc(n,n===tt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||ns(n,o)||(a=!0,Kv(n,o));n=n.next}while(a);$p=!1}}function tP(){z0()}function z0(){Rc=Nm=!1;var e=0;br!==0&&cP()&&(e=br);for(var t=ka(),a=null,n=Ac;n!==null;){var r=n.next,o=q0(n,t);o===0?(n.next=null,a===null?Ac=r:a.next=r,r===null&&(ei=a)):(a=n,(e!==0||(o&3)!==0)&&(Rc=!0)),n=r}Ot!==0&&Ot!==5||cs(e,!1),br!==0&&(br=0)}function q0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-Ta(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=E_(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=tt,a=Ie,a=Fc(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Sp(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ns(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Sp(n),Qm(a)){case 2:case 8:a=Eb;break;case 32:a=pc;break;case 268435456:a=Mb;break;default:a=pc}return n=H0.bind(null,e),a=Km(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Sp(n),e.callbackPriority=2,e.callbackNode=null,2}function H0(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Jc()&&e.callbackNode!==a)return null;var n=Ie;return n=Fc(e,e===tt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(T0(e,n,t),q0(e,ka()),e.callbackNode!=null&&e.callbackNode===a?H0.bind(null,e):null)}function Kv(e,t){if(Jc())return null;T0(e,t,!0)}function aP(){fP(function(){(Be&6)!==0?Km(Tb,tP):z0()})}function Ph(){if(br===0){var e=Ii;e===0&&(e=Du,Du<<=1,(Du&261888)===0&&(Du=256)),br=e}return br}function Zv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zu(""+e)}function Qv(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function nP(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=Zv((r[ma]||null).action),i=n.submitter;i&&(t=(t=i[ma]||null)?Zv(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new zc("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(br!==0){var s=i?Qv(r,i):new FormData(r);Lm(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?Qv(r,i):new FormData(r),Lm(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Vu=0;Vu<mm.length;Vu++)Gu=mm[Vu],Yv=Gu.toLowerCase(),Jv=Gu[0].toUpperCase()+Gu.slice(1),an(Yv,"on"+Jv);var Gu,Yv,Jv,Vu;an(eS,"onAnimationEnd");an(tS,"onAnimationIteration");an(aS,"onAnimationStart");an("dblclick","onDoubleClick");an("focusin","onFocus");an("focusout","onBlur");an(bO,"onTransitionRun");an(SO,"onTransitionStart");an(IO,"onTransitionCancel");an(nS,"onTransitionEnd");bi("onMouseEnter",["mouseout","mouseover"]);bi("onMouseLeave",["mouseout","mouseover"]);bi("onPointerEnter",["pointerout","pointerover"]);bi("onPointerLeave",["pointerout","pointerover"]);wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wo("onBeforeInput",["compositionend","keypress","textInput","paste"]);wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zl="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(" "),rP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zl));function j0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){hc(c)}r.currentTarget=null,o=s}else for(i=0;i<n.length;i++){if(l=n[i],s=l.instance,u=l.currentTarget,l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){hc(c)}r.currentTarget=null,o=s}}}}function be(e,t){var a=t[im];a===void 0&&(a=t[im]=new Set);var n=e+"__bubble";a.has(n)||(V0(t,e,2,!1),a.add(n))}function Xp(e,t,a){var n=0;t&&(n|=4),V0(a,e,n,t)}var Wu="_reactListening"+Math.random().toString(36).slice(2);function Nh(e){if(!e[Wu]){e[Wu]=!0,Pb.forEach(function(a){a!=="selectionchange"&&(rP.has(a)||Xp(a,!1,e),Xp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wu]||(t[Wu]=!0,Xp("selectionchange",!1,t))}}function V0(e,t,a,n){switch(nI(t)){case 2:var r=DP;break;case 8:r=_P;break;default:r=zh}a=r.bind(null,t,a,e),r=void 0,!dm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Kp(e,t,a,n,r){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=n.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=ni(l),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){n=o=i;continue e}l=l.parentNode}}n=n.return}jb(function(){var u=o,c=eh(a),d=[];e:{var f=rS.get(e);if(f!==void 0){var p=zc,m=e;switch(e){case"keypress":if(Yu(a)===0)break e;case"keydown":case"keyup":p=J_;break;case"focusin":m="focus",p=Tp;break;case"focusout":m="blur",p=Tp;break;case"beforeblur":case"afterblur":p=Tp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=iv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=q_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=aO;break;case eS:case tS:case aS:p=V_;break;case nS:p=rO;break;case"scroll":case"scrollend":p=F_;break;case"wheel":p=iO;break;case"copy":case"cut":case"paste":p=W_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=sv;break;case"toggle":case"beforetoggle":p=sO}var x=(t&4)!==0,I=!x&&(e==="scroll"||e==="scrollend"),y=x?f!==null?f+"Capture":null:f;x=[];for(var w=u,g;w!==null;){var b=w;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||y===null||(b=Hl(w,y),b!=null&&x.push(Ql(w,b,g))),I)break;w=w.return}0<x.length&&(f=new p(f,m,null,a,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&a!==cm&&(m=a.relatedTarget||a.fromElement)&&(ni(m)||m[Ri]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=a.relatedTarget||a.toElement,p=u,m=m?ni(m):null,m!==null&&(I=ts(m),x=m.tag,m!==I||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=iv,b="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(x=sv,b="onPointerLeave",y="onPointerEnter",w="pointer"),I=p==null?f:kl(p),g=m==null?f:kl(m),f=new x(b,w+"leave",p,a,c),f.target=I,f.relatedTarget=g,b=null,ni(c)===u&&(x=new x(y,w+"enter",m,a,c),x.target=g,x.relatedTarget=I,b=x),I=b,p&&m)t:{for(x=oP,y=p,w=m,g=0,b=y;b;b=x(b))g++;b=0;for(var T=w;T;T=x(T))b++;for(;0<g-b;)y=x(y),g--;for(;0<b-g;)w=x(w),b--;for(;g--;){if(y===w||w!==null&&y===w.alternate){x=y;break t}y=x(y),w=x(w)}x=null}else x=null;p!==null&&eb(d,f,p,x,!1),m!==null&&I!==null&&eb(d,I,m,x,!0)}}e:{if(f=u?kl(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=fv;else if(dv(f))if(Kb)S=wO;else{S=gO;var M=hO}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Jm(u.elementType)&&(S=fv):S=yO;if(S&&(S=S(e,u))){Xb(d,S,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&um(f,"number",f.value)}switch(M=u?kl(u):window,e){case"focusin":(dv(M)||M.contentEditable==="true")&&(ii=M,fm=u,Al=null);break;case"focusout":Al=fm=ii=null;break;case"mousedown":pm=!0;break;case"contextmenu":case"mouseup":case"dragend":pm=!1,gv(d,a,c);break;case"selectionchange":if(vO)break;case"keydown":case"keyup":gv(d,a,c)}var R;if(nh)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else oi?Wb(e,a)&&(_="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(_="onCompositionStart");_&&(Gb&&a.locale!=="ko"&&(oi||_!=="onCompositionStart"?_==="onCompositionEnd"&&oi&&(R=Vb()):(wr=c,th="value"in wr?wr.value:wr.textContent,oi=!0)),M=Dc(u,_),0<M.length&&(_=new lv(_,e,null,a,c),d.push({event:_,listeners:M}),R?_.data=R:(R=$b(a),R!==null&&(_.data=R)))),(R=cO?dO(e,a):fO(e,a))&&(_=Dc(u,"onBeforeInput"),0<_.length&&(M=new lv("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:_}),M.data=R)),nP(d,e,u,a,c)}j0(d,t)})}function Ql(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Dc(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Hl(e,a),r!=null&&n.unshift(Ql(e,r,o)),r=Hl(e,t),r!=null&&n.push(Ql(e,r,o))),e.tag===3)return n;e=e.return}return[]}function oP(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function eb(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var l=a,s=l.alternate,u=l.stateNode;if(l=l.tag,s!==null&&s===n)break;l!==5&&l!==26&&l!==27||u===null||(s=u,r?(u=Hl(a,o),u!=null&&i.unshift(Ql(a,u,s))):r||(u=Hl(a,o),u!=null&&i.push(Ql(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var iP=/\r\n?/g,lP=/\u0000|\uFFFD/g;function tb(e){return(typeof e=="string"?e:""+e).replace(iP,`
|
|
9
|
-
`).replace(lP,"")}function G0(e,t){return t=tb(t),tb(e)===t}function Ze(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Si(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Si(e,""+n);break;case"className":Pu(e,"class",n);break;case"tabIndex":Pu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Pu(e,a,n);break;case"style":Hb(e,n,o);break;case"data":if(t!=="object"){Pu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Zu(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Ze(e,t,"name",r.name,r,null),Ze(e,t,"formEncType",r.formEncType,r,null),Ze(e,t,"formMethod",r.formMethod,r,null),Ze(e,t,"formTarget",r.formTarget,r,null)):(Ze(e,t,"encType",r.encType,r,null),Ze(e,t,"method",r.method,r,null),Ze(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Zu(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Un);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Zu(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":be("beforetoggle",e),be("toggle",e),Ku(e,"popover",n);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Ku(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=B_.get(a)||a,Ku(e,a,n))}}function Bm(e,t,a,n,r,o){switch(a){case"style":Hb(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Si(e,n):(typeof n=="number"||typeof n=="bigint")&&Si(e,""+n);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[ma]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Ku(e,a,n)}}}function Xt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,o,i,a,null)}}r&&Ze(e,t,"srcSet",a.srcSet,a,null),n&&Ze(e,t,"src",a.src,a,null);return;case"input":be("invalid",e);var l=o=i=r=null,s=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":i=c;break;case"checked":s=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(N(137,t));break;default:Ze(e,t,n,c,a,null)}}Fb(e,o,l,s,u,i,r,!1);return;case"select":be("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(l=a[r],l!=null))switch(r){case"value":o=l;break;case"defaultValue":i=l;break;case"multiple":n=l;default:Ze(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?mi(e,!!n,t,!1):a!=null&&mi(e,!!n,a,!0);return;case"textarea":be("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":r=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(N(91));break;default:Ze(e,t,i,l,a,null)}qb(e,n,r,o);return;case"option":for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null)&&(s==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Ze(e,t,s,n,a,null));return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(n=0;n<Zl.length;n++)be(Zl[n],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,u,n,a,null)}return;default:if(Jm(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Bm(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&Ze(e,t,l,n,a,null))}function sP(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,l=null,s=null,u=null,c=null;for(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=d;default:n.hasOwnProperty(p)||Ze(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=a[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(N(137,t));break;default:p!==d&&Ze(e,t,f,p,n,d)}}sm(e,i,l,s,u,c,o,r);return;case"select":p=i=l=f=null;for(o in a)if(s=a[o],a.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:n.hasOwnProperty(o)||Ze(e,t,o,null,n,s)}for(r in n)if(o=n[r],s=a[r],n.hasOwnProperty(r)&&(o!=null||s!=null))switch(r){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":i=o;default:o!==s&&Ze(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?mi(e,!!a,f,!1):!!n!=!!a&&(t!=null?mi(e,!!a,t,!0):mi(e,!!a,a?[]:"",!1));return;case"textarea":p=f=null;for(l in a)if(r=a[l],a.hasOwnProperty(l)&&r!=null&&!n.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ze(e,t,l,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(N(91));break;default:r!==o&&Ze(e,t,i,r,n,o)}zb(e,f,p);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:Ze(e,t,m,null,n,f));for(s in n)f=n[s],p=a[s],n.hasOwnProperty(s)&&f!==p&&(f!=null||p!=null)&&(s==="selected"?e.selected=f&&typeof f!="function"&&typeof f!="symbol":Ze(e,t,s,f,n,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&Ze(e,t,x,null,n,f);for(u in n)if(f=n[u],p=a[u],n.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(N(137,t));break;default:Ze(e,t,u,f,n,p)}return;default:if(Jm(t)){for(var I in a)f=a[I],a.hasOwnProperty(I)&&f!==void 0&&!n.hasOwnProperty(I)&&Bm(e,t,I,void 0,n,f);for(c in n)f=n[c],p=a[c],!n.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Bm(e,t,c,f,n,p);return}}for(var y in a)f=a[y],a.hasOwnProperty(y)&&f!=null&&!n.hasOwnProperty(y)&&Ze(e,t,y,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||Ze(e,t,d,f,n,p)}function ab(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uP(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,l=r.duration;if(o&&l&&ab(i)){for(i=0,l=r.responseEnd,n+=1;n<a.length;n++){var s=a[n],u=s.startTime;if(u>l)break;var c=s.transferSize,d=s.initiatorType;c&&ab(d)&&(s=s.responseEnd,i+=c*(s<l?1:(l-u)/(s-u)))}if(--n,t+=8*(o+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Um=null,Fm=null;function _c(e){return e.nodeType===9?e:e.ownerDocument}function nb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function W0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function zm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zp=null;function cP(){var e=window.event;return e&&e.type==="popstate"?e===Zp?!1:(Zp=e,!0):(Zp=null,!1)}var $0=typeof setTimeout=="function"?setTimeout:void 0,dP=typeof clearTimeout=="function"?clearTimeout:void 0,rb=typeof Promise=="function"?Promise:void 0,fP=typeof queueMicrotask=="function"?queueMicrotask:typeof rb<"u"?function(e){return rb.resolve(null).then(e).catch(pP)}:$0;function pP(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function ob(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),Ai(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")zl(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,zl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[os]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&zl(e.ownerDocument.body);a=r}while(a);Ai(t)}function ib(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function qm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qm(a),Ym(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function mP(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[os])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Wa(e.nextSibling),e===null)break}return null}function hP(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Wa(e.nextSibling),e===null))return null;return e}function X0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Wa(e.nextSibling),e===null))return null;return e}function Hm(e){return e.data==="$?"||e.data==="$~"}function jm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gP(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Wa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Vm=null;function lb(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Wa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function K0(e,t,a){switch(t=_c(a),e){case"html":if(e=t.documentElement,!e)throw Error(N(452));return e;case"head":if(e=t.head,!e)throw Error(N(453));return e;case"body":if(e=t.body,!e)throw Error(N(454));return e;default:throw Error(N(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ym(e)}var $a=new Map,ub=new Set;function Oc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xn=Ue.d;Ue.d={f:yP,r:wP,D:xP,C:vP,L:bP,m:SP,X:CP,S:IP,M:kP};function yP(){var e=Xn.f(),t=Qc();return e||t}function wP(e){var t=Di(e);t!==null&&t.tag===5&&t.type==="form"?HS(t):Xn.r(e)}var Ni=typeof document>"u"?null:document;function Z0(e,t,a){var n=Ni;if(n&&typeof t=="string"&&t){var r=Ha(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),ub.has(r)||(ub.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function xP(e){Xn.D(e),Z0("dns-prefetch",e,null)}function vP(e,t){Xn.C(e,t),Z0("preconnect",e,t)}function bP(e,t,a){Xn.L(e,t,a);var n=Ni;if(n&&e&&t){var r='link[rel="preload"][as="'+Ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Ha(a.imageSizes)+'"]')):r+='[href="'+Ha(e)+'"]';var o=r;switch(t){case"style":o=Mi(e);break;case"script":o=Bi(e)}$a.has(o)||(e=st({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$a.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(ds(o))||t==="script"&&n.querySelector(fs(o))||(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function SP(e,t){Xn.m(e,t);var a=Ni;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ha(n)+'"][href="'+Ha(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Bi(e)}if(!$a.has(o)&&(e=st({rel:"modulepreload",href:e},t),$a.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fs(o)))return}n=a.createElement("link"),Xt(n,"link",e),qt(n),a.head.appendChild(n)}}}function IP(e,t,a){Xn.S(e,t,a);var n=Ni;if(n&&e){var r=pi(n).hoistableStyles,o=Mi(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(ds(o)))l.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$a.get(o))&&Bh(e,a);var s=i=n.createElement("link");qt(s),Xt(s,"link",e),s._p=new Promise(function(u,c){s.onload=u,s.onerror=c}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,ic(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function CP(e,t){Xn.X(e,t);var a=Ni;if(a&&e){var n=pi(a).hoistableScripts,r=Bi(e),o=n.get(r);o||(o=a.querySelector(fs(r)),o||(e=st({src:e,async:!0},t),(t=$a.get(r))&&Uh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function kP(e,t){Xn.M(e,t);var a=Ni;if(a&&e){var n=pi(a).hoistableScripts,r=Bi(e),o=n.get(r);o||(o=a.querySelector(fs(r)),o||(e=st({src:e,async:!0,type:"module"},t),(t=$a.get(r))&&Uh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function cb(e,t,a,n){var r=(r=Sr.current)?Oc(r):null;if(!r)throw Error(N(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Mi(a.href),a=pi(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Mi(a.href);var o=pi(r).hoistableStyles,i=o.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=r.querySelector(ds(e)))&&!o._p&&(i.instance=o,i.state.loading=5),$a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},$a.set(e,a),o||LP(r,e,a,i.state))),t&&n===null)throw Error(N(528,""));return i}if(t&&n!==null)throw Error(N(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bi(a),a=pi(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Mi(e){return'href="'+Ha(e)+'"'}function ds(e){return'link[rel="stylesheet"]['+e+"]"}function Q0(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function LP(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Xt(t,"link",a),qt(t),e.head.appendChild(t))}function Bi(e){return'[src="'+Ha(e)+'"]'}function fs(e){return"script[async]"+e}function db(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ha(a.href)+'"]');if(n)return t.instance=n,qt(n),n;var r=st({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),qt(n),Xt(n,"style",r),ic(n,a.precedence,e),t.instance=n;case"stylesheet":r=Mi(a.href);var o=e.querySelector(ds(r));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;n=Q0(a),(r=$a.get(r))&&Bh(n,r),o=(e.ownerDocument||e).createElement("link"),qt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),t.state.loading|=4,ic(o,a.precedence,e),t.instance=o;case"script":return o=Bi(a.src),(r=e.querySelector(fs(o)))?(t.instance=r,qt(r),r):(n=a,(r=$a.get(o))&&(n=st({},a),Uh(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),qt(r),Xt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(N(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ic(n,a.precedence,e));return t.instance}function ic(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var l=n[i];if(l.dataset.precedence===t)o=l;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Bh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lc=null;function fb(e,t,a){if(lc===null){var n=new Map,r=lc=new Map;r.set(a,n)}else r=lc,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[os]||o[Gt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var l=n.get(i);l?l.push(o):n.set(i,[o])}}return n}function pb(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function TP(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Y0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function EP(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Mi(n.href),o=t.querySelector(ds(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,qt(o);return}o=t.ownerDocument||t,n=Q0(n),(r=$a.get(r))&&Bh(n,r),o=o.createElement("link"),qt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Pc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Qp=0;function MP(e,t){return e.stylesheets&&e.count===0&&sc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&sc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Qp===0&&(Qp=62500*uP());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Qp?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nc=null;function sc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nc=new Map,t.forEach(AP,e),Nc=null,Pc.call(e))}function AP(e,t){if(!(t.state.loading&4)){var a=Nc.get(e);if(a)var n=a.get(null);else{a=new Map,Nc.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var i=r[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),n=i)}n&&a.set(null,n)}r=t.instance,i=r.getAttribute("data-precedence"),o=a.get(i)||n,o===n&&a.set(null,r),a.set(i,r),this.count++,n=Pc.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Yl={$$typeof:Bn,Provider:null,Consumer:null,_currentValue:lo,_currentValue2:lo,_threadCount:0};function RP(e,t,a,n,r,o,i,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ip(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ip(0),this.hiddenUpdates=Ip(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function J0(e,t,a,n,r,o,i,l,s,u,c,d){return e=new RP(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ia(3,null,null,t),e.current=o,o.stateNode=e,t=ch(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},ph(o),e}function eI(e){return e?(e=ui,e):ui}function tI(e,t,a,n,r,o){r=eI(r),n.context===null?n.context=r:n.pendingContext=r,n=Cr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=kr(e,n,t),a!==null&&(pa(a,e,t),Dl(a,e,t))}function mb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fh(e,t){mb(e,t),(e=e.alternate)&&mb(e,t)}function aI(e){if(e.tag===13||e.tag===31){var t=bo(e,67108864);t!==null&&pa(t,e,67108864),Fh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Ea();t=Zm(t);var a=bo(e,t);a!==null&&pa(a,e,t),Fh(e,t)}}var Bc=!0;function DP(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=2,zh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function _P(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=8,zh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function zh(e,t,a,n){if(Bc){var r=Gm(n);if(r===null)Kp(e,t,n,Uc,a),gb(e,n);else if(PP(r,e,t,a,n))n.stopPropagation();else if(gb(e,n),t&4&&-1<OP.indexOf(e)){for(;r!==null;){var o=Di(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=ro(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-Ta(i);l.entanglements[1]|=s,i&=~s}vn(o),(Be&6)===0&&(Tc=ka()+500,cs(0,!1))}}break;case 31:case 13:l=bo(o,2),l!==null&&pa(l,o,2),Qc(),Fh(o,2)}if(o=Gm(n),o===null&&Kp(e,t,n,Uc,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Kp(e,t,n,null,a)}}function Gm(e){return e=eh(e),qh(e)}var Uc=null;function qh(e){if(Uc=null,e=ni(e),e!==null){var t=ts(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Sb(t),e!==null)return e;e=null}else if(a===31){if(e=Ib(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function nI(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(b_()){case Tb:return 2;case Eb:return 8;case pc:case S_:return 32;case Mb:return 268435456;default:return 32}default:return 32}}var Wm=!1,Er=null,Mr=null,Ar=null,Jl=new Map,es=new Map,gr=[],OP="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 gb(e,t){switch(e){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(t.pointerId)}}function bl(e,t,a,n,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Di(t),t!==null&&aI(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function PP(e,t,a,n,r){switch(t){case"focusin":return Er=bl(Er,e,t,a,n,r),!0;case"dragenter":return Mr=bl(Mr,e,t,a,n,r),!0;case"mouseover":return Ar=bl(Ar,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Jl.set(o,bl(Jl.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,es.set(o,bl(es.get(o)||null,e,t,a,n,r)),!0}return!1}function rI(e){var t=ni(e.target);if(t!==null){var a=ts(t);if(a!==null){if(t=a.tag,t===13){if(t=Sb(a),t!==null){e.blockedOn=t,Jx(e.priority,function(){hb(a)});return}}else if(t===31){if(t=Ib(a),t!==null){e.blockedOn=t,Jx(e.priority,function(){hb(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Gm(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);cm=n,a.target.dispatchEvent(n),cm=null}else return t=Di(a),t!==null&&aI(t),e.blockedOn=a,!1;t.shift()}return!0}function yb(e,t,a){uc(e)&&a.delete(t)}function NP(){Wm=!1,Er!==null&&uc(Er)&&(Er=null),Mr!==null&&uc(Mr)&&(Mr=null),Ar!==null&&uc(Ar)&&(Ar=null),Jl.forEach(yb),es.forEach(yb)}function $u(e,t){e.blockedOn===t&&(e.blockedOn=null,Wm||(Wm=!0,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,NP)))}var Xu=null;function wb(e){Xu!==e&&(Xu=e,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,function(){Xu===e&&(Xu=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(qh(n||a)===null)continue;break}var o=Di(a);o!==null&&(e.splice(t,3),t-=3,Lm(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Ai(e){function t(s){return $u(s,e)}Er!==null&&$u(Er,e),Mr!==null&&$u(Mr,e),Ar!==null&&$u(Ar,e),Jl.forEach(t),es.forEach(t);for(var a=0;a<gr.length;a++){var n=gr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<gr.length&&(a=gr[0],a.blockedOn===null);)rI(a),a.blockedOn===null&&gr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[ma]||null;if(typeof o=="function")i||wb(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[ma]||null)l=i.formAction;else if(qh(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),wb(a)}}}function oI(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Hh(e){this._internalRoot=e}ed.prototype.render=Hh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));var a=t.current,n=Ea();tI(a,n,e,t,null,null)};ed.prototype.unmount=Hh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tI(e.current,2,null,e,null,null),Qc(),t[Ri]=null}};function ed(e){this._internalRoot=e}ed.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ob();e={blockedOn:null,target:e,priority:t};for(var a=0;a<gr.length&&t!==0&&t<gr[a].priority;a++);gr.splice(a,0,e),a===0&&rI(e)}};var xb=vb.version;if(xb!=="19.2.4")throw Error(N(527,xb,"19.2.4"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=m_(t),e=e!==null?Cb(e):null,e=e===null?null:e.stateNode,e};var BP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ie,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Sl.isDisabled&&Sl.supportsFiber))try{as=Sl.inject(BP),La=Sl}catch{}var Sl;td.createRoot=function(e,t){if(!bb(e))throw Error(N(299));var a=!1,n="",r=ZS,o=QS,i=YS;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=J0(e,1,!1,null,null,a,n,null,r,o,i,oI),e[Ri]=t.current,Nh(e),new Hh(t)};td.hydrateRoot=function(e,t,a){if(!bb(e))throw Error(N(299));var n=!1,r="",o=ZS,i=QS,l=YS,s=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(s=a.formState)),t=J0(e,1,!0,t,a??null,n,r,s,o,i,l,oI),t.context=eI(null),a=t.current,n=Ea(),n=Zm(n),r=Cr(n),r.callback=null,kr(a,r,n),a=n,t.current.lanes=a,rs(t,a),vn(t),e[Ri]=t.current,Nh(e),new ed(t)};td.version="19.2.4"});var uI=Kt((e8,sI)=>{"use strict";function lI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lI)}catch(e){console.error(e)}}lI(),sI.exports=iI()});var PI=Kt(sd=>{"use strict";var zN=Symbol.for("react.transitional.element"),qN=Symbol.for("react.fragment");function OI(e,t,a){var n=null;if(a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),"key"in t){a={};for(var r in t)r!=="key"&&(a[r]=t[r])}else a=t;return t=a.ref,{$$typeof:zN,type:e,key:n,ref:t!==void 0?t:null,props:a}}sd.Fragment=qN;sd.jsx=OI;sd.jsxs=OI});var ne=Kt((_V,NI)=>{"use strict";NI.exports=PI()});function UI(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=UI(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function ud(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=UI(e))&&(n&&(n+=" "),n+=t);return n}var tg=C(()=>{"use strict"});function ag(...e){return e.filter(Boolean).join(" ")}function FI(){return ag}var ng=C(()=>{"use strict"});function aB(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Fr(e[a]);return md(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function nB(e){let t=e;return md(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function rB(e){return md(t);function t(a){return a&&a.type===e}}function md(e){return t;function t(a,n,r){return!!(iB(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function oB(){return!0}function iB(e){return e!==null&&typeof e=="object"&&"type"in e}var Fr,cC=C(()=>{"use strict";Fr=(function(e){if(e==null)return oB;if(typeof e=="function")return md(e);if(typeof e=="object")return Array.isArray(e)?aB(e):nB(e);if(typeof e=="string")return rB(e);throw new Error("Expected function, string, or object as test")})});var hd=C(()=>{"use strict";cC()});function Ds(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Fr(r),i=n?-1:1;l(e,void 0,[])();function l(s,u,c){let d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){let p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=dC,m,x,I;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=lB(a(s,c)),p[0]===Lo))return p;if("children"in s&&s.children){let y=s;if(y.children&&p[0]!==To)for(x=(n?y.children.length:-1)+i,I=c.concat(y);x>-1&&x<y.children.length;){let w=y.children[x];if(m=l(w,x,I)(),m[0]===Lo)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function lB(e){return Array.isArray(e)?e:typeof e=="number"?[Yn,e]:e==null?dC:[e]}var dC,Yn,Lo,To,fC=C(()=>{"use strict";hd();dC=[],Yn=!0,Lo=!1,To="skip"});var gd=C(()=>{"use strict";fC()});function Jn(e,t,a,n){let r,o,i;typeof t=="function"&&typeof a!="function"?(o=void 0,i=t,r=a):(o=t,i=a,r=n),Ds(e,o,l,r);function l(s,u){let c=u[u.length-1],d=c?c.children.indexOf(s):void 0;return i(s,d,c)}}var pC=C(()=>{"use strict";gd();gd()});var yd=C(()=>{"use strict";pC()});function gC({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:a=[],allowDataImages:n=!1,allowedProtocols:r=[],blockedImageClass:o="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:i="text-gray-500"}){let l=t.length&&!t.every(u=>u==="*"),s=a.length&&!a.every(u=>u==="*");if(!e&&(l||s))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=dB(e,t,a,n,r,o,i);Jn(u,c)}}function mC(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function sB(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function hC(e,t,a,n=!1,r=!1,o=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!r)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return r&&n&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){let c=e.substring(5);if(c&&c.length>0&&c!=="invalid")return e}}catch{return null}return null}let i=mC(e,a);if(!i||cB.has(i.protocol)||!(uB.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=sB(e);return i&&t.some(u=>{let c=mC(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?s?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:s?i.pathname+i.search+i.hash:i.href:null}var uB,cB,lg,dB,yC=C(()=>{"use strict";yd();uB=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),cB=new Set(["javascript:","data:","file:","vbscript:"]);lg=Symbol("node-seen"),dB=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[lg])return Yn;if(s.tagName==="a"){let d=hC(s.properties.href,t,e,!1,!1,r);return d===null?(s[lg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(s.properties.href),class:i},children:[...s.children,{type:"text",value:" [blocked]"}]}),To):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",Yn)}if(s.tagName==="img"){let d=hC(s.properties.src,a,e,n,!0,r);return d===null?(s[lg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(s.properties.alt||"No description")+"]"}]}),To):(s.properties.src=d,Yn)}return Yn};return l}});function fB(){return e=>e}var wC,xC=C(()=>{"use strict";wC=fB});var vC,gB,cg,kC=C(()=>{"use strict";vC=typeof self=="object"?self:globalThis,gB=(e,t)=>{let a=(r,o)=>(e.set(o,r),r),n=r=>{if(e.has(r))return e.get(r);let[o,i]=t[r];switch(o){case 0:case-1:return a(i,r);case 1:{let l=a([],r);for(let s of i)l.push(n(s));return l}case 2:{let l=a({},r);for(let[s,u]of i)l[n(s)]=n(u);return l}case 3:return a(new Date(i),r);case 4:{let{source:l,flags:s}=i;return a(new RegExp(l,s),r)}case 5:{let l=a(new Map,r);for(let[s,u]of i)l.set(n(s),n(u));return l}case 6:{let l=a(new Set,r);for(let s of i)l.add(n(s));return l}case 7:{let{name:l,message:s}=i;return a(new vC[l](s),r)}case 8:return a(BigInt(i),r);case"BigInt":return a(Object(BigInt(i)),r);case"ArrayBuffer":return a(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:l}=new Uint8Array(i);return a(new DataView(l),i)}}return a(new vC[o](i),r)};return n},cg=e=>gB(new Map,e)(0)});var ji,yB,wB,_s,xd,xB,dg,LC=C(()=>{"use strict";ji="",{toString:yB}={},{keys:wB}=Object,_s=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=yB.call(e).slice(8,-1);switch(a){case"Array":return[1,ji];case"Object":return[2,ji];case"Date":return[3,ji];case"RegExp":return[4,ji];case"Map":return[5,ji];case"Set":return[6,ji];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},xd=([e,t])=>e===0&&(t==="function"||t==="symbol"),xB=(e,t,a,n)=>{let r=(i,l)=>{let s=n.push(i)-1;return a.set(l,s),s},o=i=>{if(a.has(i))return a.get(i);let[l,s]=_s(i);switch(l){case 0:{let c=i;switch(s){case"bigint":l=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return r([-1],i)}return r([l,c],i)}case 1:{if(s){let f=i;return s==="DataView"?f=new Uint8Array(i.buffer):s==="ArrayBuffer"&&(f=new Uint8Array(i)),r([s,[...f]],i)}let c=[],d=r([l,c],i);for(let f of i)c.push(o(f));return d}case 2:{if(s)switch(s){case"BigInt":return r([s,i.toString()],i);case"Boolean":case"Number":case"String":return r([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([l,c],i);for(let f of wB(i))(e||!xd(_s(i[f])))&&c.push([o(f),o(i[f])]);return d}case 3:return r([l,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([l,{source:c,flags:d}],i)}case 5:{let c=[],d=r([l,c],i);for(let[f,p]of i)(e||!(xd(_s(f))||xd(_s(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!xd(_s(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},dg=(e,{json:t,lossy:a}={})=>{let n=[];return xB(!(t||a),!!t,new Map,n)(e),n}});var zr,vd=C(()=>{"use strict";kC();LC();zr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?cg(dg(e,t)):structuredClone(e):(e,t)=>cg(dg(e,t))});function TC(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Os(e){let t=Vi(e),a=bd(e);if(t&&a)return{start:t,end:a}}var bd,Vi,EC=C(()=>{"use strict";bd=TC("end"),Vi=TC("start")});var Ps=C(()=>{"use strict";EC()});var Eo,fg,MC=C(()=>{"use strict";Eo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],fg={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Eo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Eo],h2:[["className","sr-only"]],img:[...Eo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Eo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Eo],table:[...Eo],ul:[...Eo,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]}});function pg(e,t){let a={type:"root",children:[]},n={schema:t?{...fg,...t}:fg,stack:[]},r=DC(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function DC(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return vB(e,a);case"doctype":return bB(e,a);case"element":return SB(e,a);case"root":return IB(e,a);case"text":return CB(e,a);default:}}}function vB(e,t){if(e.schema.allowComments){let a=typeof t.value=="string"?t.value:"",n=a.indexOf("-->"),o={type:"comment",value:n<0?a:a.slice(0,n)};return Ns(o,t),o}}function bB(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return Ns(a,t),a}}function SB(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=_C(e,t.children),r=kB(e,t.properties);e.stack.pop();let o=!1;if(a&&a!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(a))&&(o=!0,e.schema.ancestors&&qr.call(e.schema.ancestors,a))){let l=e.schema.ancestors[a],s=-1;for(o=!1;++s<l.length;)e.stack.includes(l[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?n:void 0;let i={type:"element",tagName:a,properties:r,children:n};return Ns(i,t),i}function IB(e,t){let n={type:"root",children:_C(e,t.children)};return Ns(n,t),n}function CB(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return Ns(n,t),n}function _C(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=DC(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function kB(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&qr.call(n,a)?n[a]:void 0,i=n&&qr.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(qr.call(l,u)){let c=l[u],d=AC(e,RC(o,u),u,c);d==null&&(d=AC(e,RC(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&qr.call(r,a)){let c=r[a];for(u in c)qr.call(c,u)&&!qr.call(s,u)&&(s[u]=c[u])}return s}function AC(e,t,a,n){return t?Array.isArray(n)?LB(e,t,a,n):OC(e,t,a,n):void 0}function LB(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=OC(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function OC(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&TB(e,a,n)){if(typeof t=="object"&&t.length>1){let r=!1,o=0;for(;++o<t.length;){let i=t[o];if(i&&typeof i=="object"&&"flags"in i){if(i.test(String(n))){r=!0;break}}else if(i===n){r=!0;break}}if(!r)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(a)?e.schema.clobberPrefix+n:n}}function TB(e,t,a){let n=e.schema.protocols&&qr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!n||n.length===0)return!0;let r=String(a),o=r.indexOf(":"),i=r.indexOf("?"),l=r.indexOf("#"),s=r.indexOf("/");if(o<0||s>-1&&o>s||i>-1&&o>i||l>-1&&o>l)return!0;let u=-1;for(;++u<n.length;){let c=n[u];if(o===c.length&&r.slice(0,c.length)===c)return!0}return!1}function Ns(e,t){let a=Os(t);t.data&&(e.data=zr(t.data)),a&&(e.position=a)}function RC(e,t){let a,n=-1;if(e)for(;++n<e.length;){let r=e[n],o=typeof r=="string"?r:r[0];if(o===t)return r;o==="data*"&&(a=r)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return a}var qr,PC=C(()=>{"use strict";vd();Ps();MC();qr={}.hasOwnProperty});var NC=C(()=>{"use strict";PC()});function Sd(e){return function(t){return pg(t,e)}}var BC=C(()=>{"use strict";NC()});var UC=C(()=>{"use strict";BC()});function mg(e,t){let a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,r=a.indexOf(t);for(;r!==-1;)n++,r=a.indexOf(t,r+t.length);return n}var FC=C(()=>{"use strict"});function Mo(e){return e!==null&&(e<32||e===127)}function V(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}function Hr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var Nt,wt,zC,Bs,qC,HC,Ao,Sn,Ae=C(()=>{"use strict";Nt=Hr(/[A-Za-z]/),wt=Hr(/[\dA-Za-z]/),zC=Hr(/[#-'*+\--9=?A-Z^-~]/);Bs=Hr(/\d/),qC=Hr(/[\dA-Fa-f]/),HC=Hr(/[!-/:-@[-`{-~]/);Ao=Hr(/\p{P}|\p{S}/u),Sn=Hr(/\s/)});function hg(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var jC=C(()=>{"use strict"});function gg(e,t,a){let r=Fr((a||{}).ignore||[]),o=EB(t),i=-1;for(;++i<o.length;)Ds(e,"text",l);function l(u,c){let d=-1,f;for(;++d<c.length;){let p=c[d],m=f?f.children:void 0;if(r(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return s(u,c)}function s(u,c){let d=c[c.length-1],f=o[i][0],p=o[i][1],m=0,I=d.children.indexOf(u),y=!1,w=[];f.lastIndex=0;let g=f.exec(u.value);for(;g;){let b=g.index,T={index:g.index,input:g.input,stack:[...c,u]},S=p(...g,T);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=b+1:(m!==b&&w.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=b+g[0].length,y=!0),!f.global)break;g=f.exec(u.value)}return y?(m<u.value.length&&w.push({type:"text",value:u.value.slice(m)}),d.children.splice(I,1,...w)):w=[u],I+w.length}}function EB(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<a.length;){let r=a[n];t.push([MB(r[0]),AB(r[1])])}return t}function MB(e){return typeof e=="string"?new RegExp(hg(e),"g"):e}function AB(e){return typeof e=="function"?e:function(){return e}}var VC=C(()=>{"use strict";jC();gd();hd()});var GC=C(()=>{"use strict";VC()});function vg(){return{transforms:[NB],enter:{literalAutolink:RB,literalAutolinkEmail:xg,literalAutolinkHttp:xg,literalAutolinkWww:xg},exit:{literalAutolink:PB,literalAutolinkEmail:OB,literalAutolinkHttp:DB,literalAutolinkWww:_B}}}function bg(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yg,notInConstruct:wg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yg,notInConstruct:wg},{character:":",before:"[ps]",after:"\\/",inConstruct:yg,notInConstruct:wg}]}}function RB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xg(e){this.config.enter.autolinkProtocol.call(this,e)}function DB(e){this.config.exit.autolinkProtocol.call(this,e)}function _B(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function OB(e){this.config.exit.autolinkEmail.call(this,e)}function PB(e){this.exit(e)}function NB(e){gg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,UB]],{ignore:["link","linkReference"]})}function BB(e,t,a,n,r){let o="";if(!WC(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!FB(a)))return!1;let i=zB(a+n);if(!i[0])return!1;let l={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[l,{type:"text",value:i[1]}]:l}function UB(e,t,a,n){return!WC(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function FB(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],n=a.indexOf(")"),r=mg(e,"("),o=mg(e,")");for(;n!==-1&&r>o;)e+=a.slice(0,n+1),a=a.slice(n+1),n=a.indexOf(")"),o++;return[e,a]}function WC(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Sn(a)||Ao(a))&&(!t||a!==47)}var yg,wg,$C=C(()=>{"use strict";FC();Ae();GC();yg="phrasing",wg=["autolink","link","image","label"]});var XC=C(()=>{"use strict";$C()});function Qt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Gi=C(()=>{"use strict"});function qB(){this.buffer()}function HB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jB(){this.buffer()}function VB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function GB(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function WB(e){this.exit(e)}function $B(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function XB(e){this.exit(e)}function KB(){return"["}function KC(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),l=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),l(),i(),o+=r.move("]"),o}function Sg(){return{enter:{gfmFootnoteCallString:qB,gfmFootnoteCall:HB,gfmFootnoteDefinitionLabelString:jB,gfmFootnoteDefinition:VB},exit:{gfmFootnoteCallString:GB,gfmFootnoteCall:WB,gfmFootnoteDefinitionLabelString:$B,gfmFootnoteDefinition:XB}}}function Ig(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:KC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let l=o.createTracker(i),s=l.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return s+=l.move(o.safe(o.associationId(n),{before:s,after:"]"})),c(),s+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),s+=l.move((t?`
|
|
10
|
-
`:" ")+o.indentLines(o.containerFlow(n,l.current()),t?
|
|
11
|
-
`)}function
|
|
12
|
-
`&&
|
|
13
|
-
`}var
|
|
8
|
+
`+n.stack}}var cm=Object.prototype.hasOwnProperty,eh=Pt.unstable_scheduleCallback,Tp=Pt.unstable_cancelCallback,R_=Pt.unstable_shouldYield,D_=Pt.unstable_requestPaint,La=Pt.unstable_now,__=Pt.unstable_getCurrentPriorityLevel,Ob=Pt.unstable_ImmediatePriority,Pb=Pt.unstable_UserBlockingPriority,gc=Pt.unstable_NormalPriority,O_=Pt.unstable_LowPriority,Nb=Pt.unstable_IdlePriority,P_=Pt.log,N_=Pt.unstable_setDisableYieldValue,ns=null,Ta=null;function yr(e){if(typeof P_=="function"&&N_(e),Ta&&typeof Ta.setStrictMode=="function")try{Ta.setStrictMode(ns,e)}catch{}}var Ea=Math.clz32?Math.clz32:F_,B_=Math.log,U_=Math.LN2;function F_(e){return e>>>=0,e===0?32:31-(B_(e)/U_|0)|0}var Pu=256,Nu=262144,Bu=4194304;function oo(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Hc(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=n&134217727;return l!==0?(n=l&~o,n!==0?r=oo(n):(i&=l,i!==0?r=oo(i):a||(a=l&~e,a!==0&&(r=oo(a))))):(l=n&~o,l!==0?r=oo(l):i!==0?r=oo(i):a||(a=n&~e,a!==0&&(r=oo(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function rs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function z_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Bb(){var e=Bu;return Bu<<=1,(Bu&62914560)===0&&(Bu=4194304),e}function Ep(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function os(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function q_(e,t,a,n,r,o){var i=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-Ea(a),d=1<<c;l[c]=0,s[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}n!==0&&Ub(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function Ub(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ea(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Fb(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ea(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function zb(e,t){var a=t&-t;return a=(a&42)!==0?1:th(a),(a&(e.suspendedLanes|t))!==0?0:a}function th(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ah(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function qb(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:cI(e.type))}function iv(e,t){var a=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=a}}var Pr=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Pr,ha="__reactProps$"+Pr,Di="__reactContainer$"+Pr,dm="__reactEvents$"+Pr,H_="__reactListeners$"+Pr,j_="__reactHandles$"+Pr,lv="__reactResources$"+Pr,is="__reactMarker$"+Pr;function nh(e){delete e[Gt],delete e[ha],delete e[dm],delete e[H_],delete e[j_]}function ri(e){var t=e[Gt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Di]||a[Gt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=hb(e);e!==null;){if(a=e[Gt])return a;e=hb(e)}return t}e=a,a=e.parentNode}return null}function _i(e){if(e=e[Gt]||e[Di]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ll(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(N(33))}function mi(e){var t=e[lv];return t||(t=e[lv]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function qt(e){e[is]=!0}var Hb=new Set,jb={};function xo(e,t){Si(e,t),Si(e+"Capture",t)}function Si(e,t){for(jb[e]=t,e=0;e<t.length;e++)Hb.add(t[e])}var V_=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sv={},uv={};function G_(e){return cm.call(uv,e)?!0:cm.call(sv,e)?!1:V_.test(e)?uv[e]=!0:(sv[e]=!0,!1)}function Qu(e,t,a){if(G_(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Uu(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function An(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function W_(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fm(e){if(!e._valueTracker){var t=Vb(e)?"checked":"value";e._valueTracker=W_(e,t,""+e[t])}}function Gb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Vb(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function yc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var $_=/[\n"\\]/g;function Ha(e){return e.replace($_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function pm(e,t,a,n,r,o,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Fa(t)):e.value!==""+Fa(t)&&(e.value=""+Fa(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?mm(e,i,Fa(t)):a!=null?mm(e,i,Fa(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Fa(l):e.removeAttribute("name")}function Wb(e,t,a,n,r,o,i,l){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){fm(e);return}a=a!=null?""+Fa(a):"",t=t!=null?""+Fa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=l?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),fm(e)}function mm(e,t,a){t==="number"&&yc(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function hi(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Fa(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function $b(e,t,a){if(t!=null&&(t=""+Fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Fa(a):""}function Xb(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(N(92));if(kl(n)){if(1<n.length)throw Error(N(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Fa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),fm(e)}function Ii(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var X_=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 cv(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||X_.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Kb(e,t,a){if(t!=null&&typeof t!="object")throw Error(N(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&cv(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&cv(e,o,t[o])}function rh(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var K_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Z_=/^[\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 Ju(e){return Z_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Un(){}var hm=null;function oh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var oi=null,gi=null;function dv(e){var t=_i(e);if(t&&(e=t.stateNode)){var a=e[ha]||null;e:switch(e=t.stateNode,t.type){case"input":if(pm(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[ha]||null;if(!r)throw Error(N(90));pm(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Gb(n)}break e;case"textarea":$b(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&hi(e,!!a.multiple,t,!1)}}}var Mp=!1;function Zb(e,t,a){if(Mp)return e(t,a);Mp=!0;try{var n=e(t);return n}finally{if(Mp=!1,(oi!==null||gi!==null)&&(ed(),oi&&(t=oi,e=gi,gi=oi=null,dv(t),e)))for(t=0;t<e.length;t++)dv(e[t])}}function jl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ha]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(N(231,t,typeof a));return a}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gm=!1;if(jn)try{Yo={},Object.defineProperty(Yo,"passive",{get:function(){gm=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{gm=!1}var Yo,wr=null,ih=null,ec=null;function Yb(){if(ec)return ec;var e,t=ih,a=t.length,n,r="value"in wr?wr.value:wr.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var i=a-e;for(n=1;n<=i&&t[a-n]===r[o-n];n++);return ec=r.slice(e,1<n?1-n:void 0)}function tc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fu(){return!0}function fv(){return!1}function ga(e){function t(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Fu:fv,this.isPropagationStopped=fv,this}return st(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Fu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fu)},persist:function(){},isPersistent:Fu}),t}var vo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jc=ga(vo),ls=st({},vo,{view:0,detail:0}),Y_=ga(ls),Ap,Rp,wl,Vc=st({},ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wl&&(wl&&e.type==="mousemove"?(Ap=e.screenX-wl.screenX,Rp=e.screenY-wl.screenY):Rp=Ap=0,wl=e),Ap)},movementY:function(e){return"movementY"in e?e.movementY:Rp}}),pv=ga(Vc),Q_=st({},Vc,{dataTransfer:0}),J_=ga(Q_),eO=st({},ls,{relatedTarget:0}),Dp=ga(eO),tO=st({},vo,{animationName:0,elapsedTime:0,pseudoElement:0}),aO=ga(tO),nO=st({},vo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rO=ga(nO),oO=st({},vo,{data:0}),mv=ga(oO),iO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lO={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"},sO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sO[e])?!!t[e]:!1}function lh(){return uO}var cO=st({},ls,{key:function(e){if(e.key){var t=iO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=tc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lh,charCode:function(e){return e.type==="keypress"?tc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dO=ga(cO),fO=st({},Vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hv=ga(fO),pO=st({},ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lh}),mO=ga(pO),hO=st({},vo,{propertyName:0,elapsedTime:0,pseudoElement:0}),gO=ga(hO),yO=st({},Vc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wO=ga(yO),xO=st({},vo,{newState:0,oldState:0}),vO=ga(xO),bO=[9,13,27,32],sh=jn&&"CompositionEvent"in window,Ml=null;jn&&"documentMode"in document&&(Ml=document.documentMode);var SO=jn&&"TextEvent"in window&&!Ml,Qb=jn&&(!sh||Ml&&8<Ml&&11>=Ml),gv=" ",yv=!1;function Jb(e,t){switch(e){case"keyup":return bO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ii=!1;function IO(e,t){switch(e){case"compositionend":return eS(t);case"keypress":return t.which!==32?null:(yv=!0,gv);case"textInput":return e=t.data,e===gv&&yv?null:e;default:return null}}function CO(e,t){if(ii)return e==="compositionend"||!sh&&Jb(e,t)?(e=Yb(),ec=ih=wr=null,ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qb&&t.locale!=="ko"?null:t.data;default:return null}}var kO={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 wv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kO[e.type]:t==="textarea"}function tS(e,t,a,n){oi?gi?gi.push(n):gi=[n]:oi=n,t=Pc(t,"onChange"),0<t.length&&(a=new jc("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Al=null,Vl=null;function LO(e){Z0(e,0)}function Gc(e){var t=Ll(e);if(Gb(t))return e}function xv(e,t){if(e==="change")return t}var aS=!1;jn&&(jn?(qu="oninput"in document,qu||(_p=document.createElement("div"),_p.setAttribute("oninput","return;"),qu=typeof _p.oninput=="function"),zu=qu):zu=!1,aS=zu&&(!document.documentMode||9<document.documentMode));var zu,qu,_p;function vv(){Al&&(Al.detachEvent("onpropertychange",nS),Vl=Al=null)}function nS(e){if(e.propertyName==="value"&&Gc(Vl)){var t=[];tS(t,Vl,e,oh(e)),Zb(LO,t)}}function TO(e,t,a){e==="focusin"?(vv(),Al=t,Vl=a,Al.attachEvent("onpropertychange",nS)):e==="focusout"&&vv()}function EO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gc(Vl)}function MO(e,t){if(e==="click")return Gc(t)}function AO(e,t){if(e==="input"||e==="change")return Gc(t)}function RO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Aa=typeof Object.is=="function"?Object.is:RO;function Gl(e,t){if(Aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!cm.call(t,r)||!Aa(e[r],t[r]))return!1}return!0}function bv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sv(e,t){var a=bv(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=bv(a)}}function rS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yc(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=yc(e.document)}return t}function uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var DO=jn&&"documentMode"in document&&11>=document.documentMode,li=null,ym=null,Rl=null,wm=!1;function Iv(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wm||li==null||li!==yc(n)||(n=li,"selectionStart"in n&&uh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rl&&Gl(Rl,n)||(Rl=n,n=Pc(ym,"onSelect"),0<n.length&&(t=new jc("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=li)))}function no(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var si={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionrun:no("Transition","TransitionRun"),transitionstart:no("Transition","TransitionStart"),transitioncancel:no("Transition","TransitionCancel"),transitionend:no("Transition","TransitionEnd")},Op={},iS={};jn&&(iS=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);function bo(e){if(Op[e])return Op[e];if(!si[e])return e;var t=si[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in iS)return Op[e]=t[a];return e}var lS=bo("animationend"),sS=bo("animationiteration"),uS=bo("animationstart"),_O=bo("transitionrun"),OO=bo("transitionstart"),PO=bo("transitioncancel"),cS=bo("transitionend"),dS=new Map,xm="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(" ");xm.push("scrollEnd");function an(e,t){dS.set(e,t),xo(t,[e])}var wc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ua=[],ui=0,ch=0;function Wc(){for(var e=ui,t=ch=ui=0;t<e;){var a=Ua[t];Ua[t++]=null;var n=Ua[t];Ua[t++]=null;var r=Ua[t];Ua[t++]=null;var o=Ua[t];if(Ua[t++]=null,n!==null&&r!==null){var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}o!==0&&fS(a,r,o)}}function $c(e,t,a,n){Ua[ui++]=e,Ua[ui++]=t,Ua[ui++]=a,Ua[ui++]=n,ch|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function dh(e,t,a,n){return $c(e,t,a,n),xc(e)}function So(e,t){return $c(e,null,null,t),xc(e)}function fS(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-Ea(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function xc(e){if(50<zl)throw zl=0,zm=null,Error(N(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ci={};function NO(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ca(e,t,a,n){return new NO(e,t,a,n)}function fh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zn(e,t){var a=e.alternate;return a===null?(a=Ca(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function pS(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ac(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")fh(e)&&(i=1);else if(typeof e=="string")i=FP(e,a,xn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case im:return e=Ca(31,a,t,r),e.elementType=im,e.lanes=o,e;case ai:return uo(a.children,r,o,t);case Db:i=8,r|=24;break;case nm:return e=Ca(12,a,t,r|2),e.elementType=nm,e.lanes=o,e;case rm:return e=Ca(13,a,t,r),e.elementType=rm,e.lanes=o,e;case om:return e=Ca(19,a,t,r),e.elementType=om,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bn:i=10;break e;case _b:i=9;break e;case Qm:i=11;break e;case Jm:i=14;break e;case dr:i=16,n=null;break e}i=29,a=Error(N(130,e===null?"null":typeof e,"")),n=null}return t=Ca(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function uo(e,t,a,n){return e=Ca(7,e,n,t),e.lanes=a,e}function Pp(e,t,a){return e=Ca(6,e,null,t),e.lanes=a,e}function mS(e){var t=Ca(18,null,null,0);return t.stateNode=e,t}function Np(e,t,a){return t=Ca(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Cv=new WeakMap;function ja(e,t){if(typeof e=="object"&&e!==null){var a=Cv.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ov(t)},Cv.set(e,t),t)}return{value:e,source:t,stack:ov(t)}}var di=[],fi=0,vc=null,Wl=0,za=[],qa=0,Rr=null,gn=1,yn="";function Pn(e,t){di[fi++]=Wl,di[fi++]=vc,vc=e,Wl=t}function hS(e,t,a){za[qa++]=gn,za[qa++]=yn,za[qa++]=Rr,Rr=e;var n=gn;e=yn;var r=32-Ea(n)-1;n&=~(1<<r),a+=1;var o=32-Ea(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,gn=1<<32-Ea(t)+r|a<<r|n,yn=o+e}else gn=1<<o|a<<r|n,yn=e}function ph(e){e.return!==null&&(Pn(e,1),hS(e,1,0))}function mh(e){for(;e===vc;)vc=di[--fi],di[fi]=null,Wl=di[--fi],di[fi]=null;for(;e===Rr;)Rr=za[--qa],za[qa]=null,yn=za[--qa],za[qa]=null,gn=za[--qa],za[qa]=null}function gS(e,t){za[qa++]=gn,za[qa++]=yn,za[qa++]=Rr,gn=t.id,yn=t.overflow,Rr=e}var Wt=null,lt=null,Te=!1,Ir=null,Va=!1,vm=Error(N(519));function Dr(e){var t=Error(N(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $l(ja(t,e)),vm}function kv(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Gt]=e,t[ha]=n,a){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(a=0;a<Yl.length;a++)be(Yl[a],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),Wb(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),Xb(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Q0(t.textContent,a)?(n.popover!=null&&(be("beforetoggle",t),be("toggle",t)),n.onScroll!=null&&be("scroll",t),n.onScrollEnd!=null&&be("scrollend",t),n.onClick!=null&&(t.onclick=Un),t=!0):t=!1,t||Dr(e,!0)}function Lv(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Va=!1;return;case 27:case 3:Va=!0;return;default:Wt=Wt.return}}function Qo(e){if(e!==Wt)return!1;if(!Te)return Lv(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Gm(e.type,e.memoizedProps)),a=!a),a&<&&Dr(e),Lv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=mb(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));lt=mb(e)}else t===27?(t=lt,Nr(e.type)?(e=Km,Km=null,lt=e):lt=t):lt=Wt?Wa(e.stateNode.nextSibling):null;return!0}function mo(){lt=Wt=null,Te=!1}function Bp(){var e=Ir;return e!==null&&(pa===null?pa=e:pa.push.apply(pa,e),Ir=null),e}function $l(e){Ir===null?Ir=[e]:Ir.push(e)}var bm=vn(null),Io=null,Fn=null;function pr(e,t,a){rt(bm,t._currentValue),t._currentValue=a}function qn(e){e._currentValue=bm.current,Ht(bm)}function Sm(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Im(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var l=o;o=r;for(var s=0;s<t.length;s++)if(l.context===t[s]){o.lanes|=a,l=o.alternate,l!==null&&(l.lanes|=a),Sm(o.return,a,e),n||(i=null);break e}o=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(N(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Sm(i,a,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function Oi(e,t,a,n){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(N(387));if(i=i.memoizedProps,i!==null){var l=r.type;Aa(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===pc.current){if(i=r.alternate,i===null)throw Error(N(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Jl):e=[Jl])}r=r.return}e!==null&&Im(t,e,a,n),t.flags|=262144}function bc(e){for(e=e.firstContext;e!==null;){if(!Aa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ho(e){Io=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return yS(Io,e)}function Hu(e,t){return Io===null&&ho(e),yS(e,t)}function yS(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Fn===null){if(e===null)throw Error(N(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return a}var BO=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},UO=Pt.unstable_scheduleCallback,FO=Pt.unstable_NormalPriority,Dt={$$typeof:Bn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hh(){return{controller:new BO,data:new Map,refCount:0}}function ss(e){e.refCount--,e.refCount===0&&UO(FO,function(){e.controller.abort()})}var Dl=null,Cm=0,Ci=0,yi=null;function zO(e,t){if(Dl===null){var a=Dl=[];Cm=0,Ci=zh(),yi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Cm++,t.then(Tv,Tv),t}function Tv(){if(--Cm===0&&Dl!==null){yi!==null&&(yi.status="fulfilled");var e=Dl;Dl=null,Ci=0,yi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qO(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var Ev=ie.S;ie.S=function(e,t){R0=La(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zO(e,t),Ev!==null&&Ev(e,t)};var co=vn(null);function gh(){var e=co.current;return e!==null?e:tt.pooledCache}function nc(e,t){t===null?rt(co,co.current):rt(co,t.pool)}function wS(){var e=gh();return e===null?null:{parent:Dt._currentValue,pool:e}}var Pi=Error(N(460)),yh=Error(N(474)),Xc=Error(N(542)),Sc={then:function(){}};function Mv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xS(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Un,Un),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rv(e),e;default:if(typeof t.status=="string")t.then(Un,Un);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(N(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rv(e),e}throw fo=t,Pi}}function io(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fo=a,Pi):a}}var fo=null;function Av(){if(fo===null)throw Error(N(459));var e=fo;return fo=null,e}function Rv(e){if(e===Pi||e===Xc)throw Error(N(483))}var wi=null,Xl=0;function ju(e){var t=Xl;return Xl+=1,wi===null&&(wi=[]),xS(wi,e,t)}function xl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vu(e,t){throw t.$$typeof===T_?Error(N(525)):(e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vS(e){function t(y,w){if(e){var g=y.deletions;g===null?(y.deletions=[w],y.flags|=16):g.push(w)}}function a(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function n(y){for(var w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function r(y,w){return y=zn(y,w),y.index=0,y.sibling=null,y}function o(y,w,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<w?(y.flags|=67108866,w):g):(y.flags|=67108866,w)):(y.flags|=1048576,w)}function i(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function l(y,w,g,b){return w===null||w.tag!==6?(w=Pp(g,y.mode,b),w.return=y,w):(w=r(w,g),w.return=y,w)}function s(y,w,g,b){var T=g.type;return T===ai?c(y,w,g.props.children,b,g.key):w!==null&&(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&io(T)===w.type)?(w=r(w,g.props),xl(w,g),w.return=y,w):(w=ac(g.type,g.key,g.props,null,y.mode,b),xl(w,g),w.return=y,w)}function u(y,w,g,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Np(g,y.mode,b),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,b,T){return w===null||w.tag!==7?(w=uo(g,y.mode,b,T),w.return=y,w):(w=r(w,g),w.return=y,w)}function d(y,w,g){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Pp(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ou:return g=ac(w.type,w.key,w.props,null,y.mode,g),xl(g,w),g.return=y,g;case Cl:return w=Np(w,y.mode,g),w.return=y,w;case dr:return w=io(w),d(y,w,g)}if(kl(w)||yl(w))return w=uo(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,ju(w),g);if(w.$$typeof===Bn)return d(y,Hu(y,w),g);Vu(y,w)}return null}function f(y,w,g,b){var T=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return T!==null?null:l(y,w,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ou:return g.key===T?s(y,w,g,b):null;case Cl:return g.key===T?u(y,w,g,b):null;case dr:return g=io(g),f(y,w,g,b)}if(kl(g)||yl(g))return T!==null?null:c(y,w,g,b,null);if(typeof g.then=="function")return f(y,w,ju(g),b);if(g.$$typeof===Bn)return f(y,w,Hu(y,g),b);Vu(y,g)}return null}function p(y,w,g,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return y=y.get(g)||null,l(w,y,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ou:return y=y.get(b.key===null?g:b.key)||null,s(w,y,b,T);case Cl:return y=y.get(b.key===null?g:b.key)||null,u(w,y,b,T);case dr:return b=io(b),p(y,w,g,b,T)}if(kl(b)||yl(b))return y=y.get(g)||null,c(w,y,b,T,null);if(typeof b.then=="function")return p(y,w,g,ju(b),T);if(b.$$typeof===Bn)return p(y,w,g,Hu(w,b),T);Vu(w,b)}return null}function m(y,w,g,b){for(var T=null,S=null,M=w,R=w=0,_=null;M!==null&&R<g.length;R++){M.index>R?(_=M,M=null):_=M.sibling;var L=f(y,M,g[R],b);if(L===null){M===null&&(M=_);break}e&&M&&L.alternate===null&&t(y,M),w=o(L,w,R),S===null?T=L:S.sibling=L,S=L,M=_}if(R===g.length)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;R<g.length;R++)M=d(y,g[R],b),M!==null&&(w=o(M,w,R),S===null?T=M:S.sibling=M,S=M);return Te&&Pn(y,R),T}for(M=n(M);R<g.length;R++)_=p(M,y,R,g[R],b),_!==null&&(e&&_.alternate!==null&&M.delete(_.key===null?R:_.key),w=o(_,w,R),S===null?T=_:S.sibling=_,S=_);return e&&M.forEach(function(z){return t(y,z)}),Te&&Pn(y,R),T}function x(y,w,g,b){if(g==null)throw Error(N(151));for(var T=null,S=null,M=w,R=w=0,_=null,L=g.next();M!==null&&!L.done;R++,L=g.next()){M.index>R?(_=M,M=null):_=M.sibling;var z=f(y,M,L.value,b);if(z===null){M===null&&(M=_);break}e&&M&&z.alternate===null&&t(y,M),w=o(z,w,R),S===null?T=z:S.sibling=z,S=z,M=_}if(L.done)return a(y,M),Te&&Pn(y,R),T;if(M===null){for(;!L.done;R++,L=g.next())L=d(y,L.value,b),L!==null&&(w=o(L,w,R),S===null?T=L:S.sibling=L,S=L);return Te&&Pn(y,R),T}for(M=n(M);!L.done;R++,L=g.next())L=p(M,y,R,L.value,b),L!==null&&(e&&L.alternate!==null&&M.delete(L.key===null?R:L.key),w=o(L,w,R),S===null?T=L:S.sibling=L,S=L);return e&&M.forEach(function(U){return t(y,U)}),Te&&Pn(y,R),T}function I(y,w,g,b){if(typeof g=="object"&&g!==null&&g.type===ai&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ou:e:{for(var T=g.key;w!==null;){if(w.key===T){if(T=g.type,T===ai){if(w.tag===7){a(y,w.sibling),b=r(w,g.props.children),b.return=y,y=b;break e}}else if(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===dr&&io(T)===w.type){a(y,w.sibling),b=r(w,g.props),xl(b,g),b.return=y,y=b;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===ai?(b=uo(g.props.children,y.mode,b,g.key),b.return=y,y=b):(b=ac(g.type,g.key,g.props,null,y.mode,b),xl(b,g),b.return=y,y=b)}return i(y);case Cl:e:{for(T=g.key;w!==null;){if(w.key===T)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),b=r(w,g.children||[]),b.return=y,y=b;break e}else{a(y,w);break}else t(y,w);w=w.sibling}b=Np(g,y.mode,b),b.return=y,y=b}return i(y);case dr:return g=io(g),I(y,w,g,b)}if(kl(g))return m(y,w,g,b);if(yl(g)){if(T=yl(g),typeof T!="function")throw Error(N(150));return g=T.call(g),x(y,w,g,b)}if(typeof g.then=="function")return I(y,w,ju(g),b);if(g.$$typeof===Bn)return I(y,w,Hu(y,g),b);Vu(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),b=r(w,g),b.return=y,y=b):(a(y,w),b=Pp(g,y.mode,b),b.return=y,y=b),i(y)):a(y,w)}return function(y,w,g,b){try{Xl=0;var T=I(y,w,g,b);return wi=null,T}catch(M){if(M===Pi||M===Xc)throw M;var S=Ca(29,M,null,y.mode);return S.lanes=b,S.return=y,S}}}var go=vS(!0),bS=vS(!1),fr=!1;function wh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function km(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Cr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Be&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=xc(e),fS(e,null,a),t}return $c(e,n,t,a),xc(e)}function _l(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Fb(e,a)}}function Up(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Lm=!1;function Ol(){if(Lm){var e=yi;if(e!==null)throw e}}function Pl(e,t,a,n){Lm=!1;var r=e.updateQueue;fr=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==i&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(o!==null){var d=r.baseState;i=0,c=u=s=null,l=o;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(Ce&f)===f:(n&f)===f){f!==0&&f===Ci&&(Lm=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,x=l;f=t;var I=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(I,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(I,d,f):m,f==null)break e;d=st({},d,f);break e;case 2:fr=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,s=d):c=c.next=p,i|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);c===null&&(s=d),r.baseState=s,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),Or|=i,e.lanes=i,e.memoizedState=d}}function SS(e,t){if(typeof e!="function")throw Error(N(191,e));e.call(t)}function IS(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)SS(a[e],t)}var ki=vn(null),Ic=vn(0);function Dv(e,t){e=$n,rt(Ic,e),rt(ki,t),$n=e|t.baseLanes}function Tm(){rt(Ic,$n),rt(ki,ki.current)}function xh(){$n=Ic.current,Ht(ki),Ht(Ic)}var Ra=vn(null),Ga=null;function mr(e){var t=e.alternate;rt(Ct,Ct.current&1),rt(Ra,e),Ga===null&&(t===null||ki.current!==null||t.memoizedState!==null)&&(Ga=e)}function Em(e){rt(Ct,Ct.current),rt(Ra,e),Ga===null&&(Ga=e)}function CS(e){e.tag===22?(rt(Ct,Ct.current),rt(Ra,e),Ga===null&&(Ga=e)):hr(e)}function hr(){rt(Ct,Ct.current),rt(Ra,Ra.current)}function Ia(e){Ht(Ra),Ga===e&&(Ga=null),Ht(Ct)}var Ct=vn(0);function Cc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||$m(a)||Xm(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vn=0,me=null,Ye=null,At=null,kc=!1,xi=!1,yo=!1,Lc=0,Kl=0,vi=null,HO=0;function gt(){throw Error(N(321))}function vh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Aa(e[a],t[a]))return!1;return!0}function bh(e,t,a,n,r,o){return Vn=o,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ie.H=e===null||e.memoizedState===null?t0:Dh,yo=!1,o=a(n,r),yo=!1,xi&&(o=LS(t,a,n,r)),kS(e),o}function kS(e){ie.H=Zl;var t=Ye!==null&&Ye.next!==null;if(Vn=0,At=Ye=me=null,kc=!1,Kl=0,vi=null,t)throw Error(N(300));e===null||_t||(e=e.dependencies,e!==null&&bc(e)&&(_t=!0))}function LS(e,t,a,n){me=e;var r=0;do{if(xi&&(vi=null),Kl=0,xi=!1,25<=r)throw Error(N(301));if(r+=1,At=Ye=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ie.H=a0,o=t(a,n)}while(xi);return o}function jO(){var e=ie.H,t=e.useState()[0];return t=typeof t.then=="function"?us(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(me.flags|=1024),t}function Sh(){var e=Lc!==0;return Lc=0,e}function Ih(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ch(e){if(kc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}kc=!1}Vn=0,At=Ye=me=null,xi=!1,Kl=Lc=0,vi=null}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?me.memoizedState=At=e:At=At.next=e,At}function kt(){if(Ye===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=At===null?me.memoizedState:At.next;if(t!==null)At=t,Ye=e;else{if(e===null)throw me.alternate===null?Error(N(467)):Error(N(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},At===null?me.memoizedState=At=e:At=At.next=e}return At}function Kc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Kl;return Kl+=1,vi===null&&(vi=[]),e=xS(vi,e,t),t=me,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,ie.H=t===null||t.memoizedState===null?t0:Dh),e}function Zc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return us(e);if(e.$$typeof===Bn)return $t(e)}throw Error(N(438,String(e)))}function kh(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=me.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Kc(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=E_;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function rc(e){var t=kt();return Lh(t,Ye,e)}function Lh(e,t,a){var n=e.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=a;var r=e.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}t.baseQueue=r=o,n.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var l=i=null,s=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ce&d)===d:(Vn&d)===d){var f=u.revertLane;if(f===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Ci&&(c=!0);else if((Vn&f)===f){u=u.next,f===Ci&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=d,i=o):s=s.next=d,me.lanes|=f,Or|=f;d=u.action,yo&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=f,i=o):s=s.next=f,me.lanes|=d,Or|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!Aa(o,e.memoizedState)&&(_t=!0,c&&(a=yi,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=s,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Fp(e){var t=kt(),a=t.queue;if(a===null)throw Error(N(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var i=r=r.next;do o=e(o,i.action),i=i.next;while(i!==r);Aa(o,t.memoizedState)||(_t=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function TS(e,t,a){var n=me,r=kt(),o=Te;if(o){if(a===void 0)throw Error(N(407));a=a()}else a=t();var i=!Aa((Ye||r).memoizedState,a);if(i&&(r.memoizedState=a,_t=!0),r=r.queue,Th(AS.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||At!==null&&At.memoizedState.tag&1){if(n.flags|=2048,Li(9,{destroy:void 0},MS.bind(null,n,r,a,t),null),tt===null)throw Error(N(349));o||(Vn&127)!==0||ES(n,t,a)}return a}function ES(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Kc(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function MS(e,t,a,n){t.value=a,t.getSnapshot=n,RS(t)&&DS(e)}function AS(e,t,a){return a(function(){RS(t)&&DS(e)})}function RS(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Aa(e,a)}catch{return!0}}function DS(e){var t=So(e,2);t!==null&&ma(t,e,2)}function Mm(e){var t=aa();if(typeof e=="function"){var a=e;if(e=a(),yo){yr(!0);try{a()}finally{yr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function _S(e,t,a,n){return e.baseState=a,Lh(e,Ye,typeof n=="function"?n:Gn)}function VO(e,t,a,n,r){if(Qc(e))throw Error(N(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ie.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,OS(t,o)):(o.next=a.next,t.pending=a.next=o)}}function OS(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=ie.T,i={};ie.T=i;try{var l=a(r,n),s=ie.S;s!==null&&s(i,l),_v(e,t,l)}catch(u){Am(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ie.T=o}}else try{o=a(r,n),_v(e,t,o)}catch(u){Am(e,t,u)}}function _v(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Ov(e,t,n)},function(n){return Am(e,t,n)}):Ov(e,t,a)}function Ov(e,t,a){t.status="fulfilled",t.value=a,PS(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,OS(e,a)))}function Am(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,PS(t),t=t.next;while(t!==n)}e.action=null}function PS(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function NS(e,t){return t}function Pv(e,t){if(Te){var a=tt.formState;if(a!==null){e:{var n=me;if(Te){if(lt){t:{for(var r=lt,o=Va;r.nodeType!==8;){if(!o){r=null;break t}if(r=Wa(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){lt=Wa(r.nextSibling),n=r.data==="F!";break e}}Dr(n)}n=!1}n&&(t=a[0])}}return a=aa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:NS,lastRenderedState:t},a.queue=n,a=QS.bind(null,me,n),n.dispatch=a,n=Mm(!1),o=Rh.bind(null,me,!1,n.queue),n=aa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=VO.bind(null,me,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Nv(e){var t=kt();return BS(t,Ye,e)}function BS(e,t,a){if(t=Lh(e,t,NS)[0],e=rc(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=us(t)}catch(i){throw i===Pi?Xc:i}else n=t;t=kt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(me.flags|=2048,Li(9,{destroy:void 0},GO.bind(null,r,a),null)),[n,o,e]}function GO(e,t){e.action=t}function Bv(e){var t=kt(),a=Ye;if(a!==null)return BS(t,a,e);kt(),t=t.memoizedState,a=kt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Li(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=me.updateQueue,t===null&&(t=Kc(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function US(){return kt().memoizedState}function oc(e,t,a,n){var r=aa();me.flags|=e,r.memoizedState=Li(1|t,{destroy:void 0},a,n===void 0?null:n)}function Yc(e,t,a,n){var r=kt();n=n===void 0?null:n;var o=r.memoizedState.inst;Ye!==null&&n!==null&&vh(n,Ye.memoizedState.deps)?r.memoizedState=Li(t,o,a,n):(me.flags|=e,r.memoizedState=Li(1|t,o,a,n))}function Uv(e,t){oc(8390656,8,e,t)}function Th(e,t){Yc(2048,8,e,t)}function WO(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Kc(),me.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function FS(e){var t=kt().memoizedState;return WO({ref:t,nextImpl:e}),function(){if((Be&2)!==0)throw Error(N(440));return t.impl.apply(void 0,arguments)}}function zS(e,t){return Yc(4,2,e,t)}function qS(e,t){return Yc(4,4,e,t)}function HS(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jS(e,t,a){a=a!=null?a.concat([e]):null,Yc(4,4,HS.bind(null,t,e),a)}function Eh(){}function VS(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&vh(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function GS(e,t){var a=kt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&vh(t,n[1]))return n[0];if(n=e(),yo){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n}function Mh(e,t,a){return a===void 0||(Vn&1073741824)!==0&&(Ce&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=_0(),me.lanes|=e,Or|=e,a)}function WS(e,t,a,n){return Aa(a,t)?a:ki.current!==null?(e=Mh(e,a,n),Aa(e,t)||(_t=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Ce&261930)===0?(_t=!0,e.memoizedState=a):(e=_0(),me.lanes|=e,Or|=e,t)}function $S(e,t,a,n,r){var o=Ue.p;Ue.p=o!==0&&8>o?o:8;var i=ie.T,l={};ie.T=l,Rh(e,!1,t,a);try{var s=r(),u=ie.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=qO(s,n);Nl(e,t,c,Ma(e))}else Nl(e,t,n,Ma(e))}catch(d){Nl(e,t,{then:function(){},status:"rejected",reason:d},Ma())}finally{Ue.p=o,i!==null&&l.types!==null&&(i.types=l.types),ie.T=i}}function $O(){}function Rm(e,t,a,n){if(e.tag!==5)throw Error(N(476));var r=XS(e).queue;$S(e,r,t,so,a===null?$O:function(){return KS(e),a(n)})}function XS(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:so,baseState:so,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:so},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function KS(e){var t=XS(e);t.next===null&&(t=e.alternate.memoizedState),Nl(e,t.next.queue,{},Ma())}function Ah(){return $t(Jl)}function ZS(){return kt().memoizedState}function YS(){return kt().memoizedState}function XO(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ma();e=Cr(a);var n=kr(t,e,a);n!==null&&(ma(n,t,a),_l(n,t,a)),t={cache:hh()},e.payload=t;return}t=t.return}}function KO(e,t,a){var n=Ma();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Qc(e)?JS(t,a):(a=dh(e,t,a,n),a!==null&&(ma(a,e,n),e0(a,t,n)))}function QS(e,t,a){var n=Ma();Nl(e,t,a,n)}function Nl(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Qc(e))JS(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,a);if(r.hasEagerState=!0,r.eagerState=l,Aa(l,i))return $c(e,t,r,0),tt===null&&Wc(),!1}catch{}if(a=dh(e,t,r,n),a!==null)return ma(a,e,n),e0(a,t,n),!0}return!1}function Rh(e,t,a,n){if(n={lane:2,revertLane:zh(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qc(e)){if(t)throw Error(N(479))}else t=dh(e,a,n,2),t!==null&&ma(t,e,2)}function Qc(e){var t=e.alternate;return e===me||t!==null&&t===me}function JS(e,t){xi=kc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function e0(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Fb(e,a)}}var Zl={readContext:$t,use:Zc,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Zl.useEffectEvent=gt;var t0={readContext:$t,use:Zc,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Uv,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,oc(4194308,4,HS.bind(null,t,e),a)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var a=aa();t=t===void 0?null:t;var n=e();if(yo){yr(!0);try{e()}finally{yr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=aa();if(a!==void 0){var r=a(t);if(yo){yr(!0);try{a(t)}finally{yr(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=KO.bind(null,me,e),[n.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:function(e){e=Mm(e);var t=e.queue,a=QS.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Eh,useDeferredValue:function(e,t){var a=aa();return Mh(a,e,t)},useTransition:function(){var e=Mm(!1);return e=$S.bind(null,me,e.queue,!0,!1),aa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=me,r=aa();if(Te){if(a===void 0)throw Error(N(407));a=a()}else{if(a=t(),tt===null)throw Error(N(349));(Ce&127)!==0||ES(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Uv(AS.bind(null,n,o,e),[e]),n.flags|=2048,Li(9,{destroy:void 0},MS.bind(null,n,o,a,t),null),a},useId:function(){var e=aa(),t=tt.identifierPrefix;if(Te){var a=yn,n=gn;a=(n&~(1<<32-Ea(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Lc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=HO++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ah,useFormState:Pv,useActionState:Pv,useOptimistic:function(e){var t=aa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Rh.bind(null,me,!0,a),a.dispatch=t,[e,t]},useMemoCache:kh,useCacheRefresh:function(){return aa().memoizedState=XO.bind(null,me)},useEffectEvent:function(e){var t=aa(),a={impl:e};return t.memoizedState=a,function(){if((Be&2)!==0)throw Error(N(440));return a.impl.apply(void 0,arguments)}}},Dh={readContext:$t,use:Zc,useCallback:VS,useContext:$t,useEffect:Th,useImperativeHandle:jS,useInsertionEffect:zS,useLayoutEffect:qS,useMemo:GS,useReducer:rc,useRef:US,useState:function(){return rc(Gn)},useDebugValue:Eh,useDeferredValue:function(e,t){var a=kt();return WS(a,Ye.memoizedState,e,t)},useTransition:function(){var e=rc(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:us(e),t]},useSyncExternalStore:TS,useId:ZS,useHostTransitionStatus:Ah,useFormState:Nv,useActionState:Nv,useOptimistic:function(e,t){var a=kt();return _S(a,Ye,e,t)},useMemoCache:kh,useCacheRefresh:YS};Dh.useEffectEvent=FS;var a0={readContext:$t,use:Zc,useCallback:VS,useContext:$t,useEffect:Th,useImperativeHandle:jS,useInsertionEffect:zS,useLayoutEffect:qS,useMemo:GS,useReducer:Fp,useRef:US,useState:function(){return Fp(Gn)},useDebugValue:Eh,useDeferredValue:function(e,t){var a=kt();return Ye===null?Mh(a,e,t):WS(a,Ye.memoizedState,e,t)},useTransition:function(){var e=Fp(Gn)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:us(e),t]},useSyncExternalStore:TS,useId:ZS,useHostTransitionStatus:Ah,useFormState:Bv,useActionState:Bv,useOptimistic:function(e,t){var a=kt();return Ye!==null?_S(a,Ye,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:kh,useCacheRefresh:YS};a0.useEffectEvent=FS;function zp(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:st({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Dm={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ma(),r=Cr(n);r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(ma(t,e,n),_l(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ma(),r=Cr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=kr(e,r,n),t!==null&&(ma(t,e,n),_l(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ma(),n=Cr(a);n.tag=2,t!=null&&(n.callback=t),t=kr(e,n,a),t!==null&&(ma(t,e,a),_l(t,e,a))}};function Fv(e,t,a,n,r,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,i):t.prototype&&t.prototype.isPureReactComponent?!Gl(a,n)||!Gl(r,o):!0}function zv(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Dm.enqueueReplaceState(t,t.state,null)}function wo(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=st({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function n0(e){wc(e)}function r0(e){console.error(e)}function o0(e){wc(e)}function Tc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function qv(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function _m(e,t,a){return a=Cr(a),a.tag=3,a.payload={element:null},a.callback=function(){Tc(e,t)},a}function i0(e){return e=Cr(e),e.tag=3,e}function l0(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;e.payload=function(){return r(o)},e.callback=function(){qv(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){qv(t,a,n),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function ZO(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Oi(t,a,r,!0),a=Ra.current,a!==null){switch(a.tag){case 31:case 13:return Ga===null?Dc():a.alternate===null&&yt===0&&(yt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===Sc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Yp(e,n,r)),!1;case 22:return a.flags|=65536,n===Sc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Yp(e,n,r)),!1}throw Error(N(435,a.tag))}return Yp(e,n,r),Dc(),!1}if(Te)return t=Ra.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==vm&&(e=Error(N(422),{cause:n}),$l(ja(e,a)))):(n!==vm&&(t=Error(N(423),{cause:n}),$l(ja(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=ja(n,a),r=_m(e.stateNode,n,r),Up(e,r),yt!==4&&(yt=2)),!1;var o=Error(N(520),{cause:n});if(o=ja(o,a),Fl===null?Fl=[o]:Fl.push(o),yt!==4&&(yt=2),t===null)return!0;n=ja(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=_m(a.stateNode,n,e),Up(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Lr===null||!Lr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=i0(r),l0(r,e,a,n),Up(a,r),!1}a=a.return}while(a!==null);return!1}var _h=Error(N(461)),_t=!1;function Vt(e,t,a,n){t.child=e===null?bS(t,null,a,n):go(t,e.child,a,n)}function Hv(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}else i=n;return ho(t),n=bh(e,t,a,i,o,r),l=Sh(),e!==null&&!_t?(Ih(e,t,r),Wn(e,t,r)):(Te&&l&&ph(t),t.flags|=1,Vt(e,t,n,r),t.child)}function jv(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!fh(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,s0(e,t,o,n,r)):(e=ac(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Oh(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Gl,a(i,n)&&e.ref===t.ref)return Wn(e,t,r)}return t.flags|=1,e=zn(o,n),e.ref=t.ref,e.return=t,t.child=e}function s0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Gl(o,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=o,Oh(e,r))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Wn(e,t,r)}return Om(e,t,a,n,r)}function u0(e,t,a,n){var r=n.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,t.child=null;return Vv(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nc(t,o!==null?o.cachePool:null),o!==null?Dv(t,o):Tm(),CS(t);else return n=t.lanes=536870912,Vv(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(nc(t,o.cachePool),Dv(t,o),hr(t),t.memoizedState=null):(e!==null&&nc(t,null),Tm(),hr(t));return Vt(e,t,r,a),t.child}function Tl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vv(e,t,a,n,r){var o=gh();return o=o===null?null:{parent:Dt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&nc(t,null),Tm(),CS(t),e!==null&&Oi(e,t,n,!0),t.childLanes=r,null}function ic(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gv(e,t,a){return go(t,e.child,null,a),e=ic(t,t.pendingProps),e.flags|=2,Ia(t),t.memoizedState=null,e}function YO(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(n.mode==="hidden")return e=ic(t,n),t.lanes=536870912,Tl(null,e);if(Em(t),(e=lt)?(e=tI(e,Va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:gn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},a=mS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return t.lanes=536870912,null}return ic(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(Em(t),r)if(t.flags&256)t.flags&=-257,t=Gv(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(N(558));else if(_t||Oi(e,t,a,!1),r=(a&e.childLanes)!==0,_t||r){if(n=tt,n!==null&&(i=zb(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,So(e,i),ma(n,e,i),_h;Dc(),t=Gv(e,t,a)}else e=o.treeContext,lt=Wa(i.nextSibling),Wt=t,Te=!0,Ir=null,Va=!1,e!==null&&gS(t,e),t=ic(t,n),t.flags|=4096;return t}return e=zn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(N(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Om(e,t,a,n,r){return ho(t),a=bh(e,t,a,n,void 0,r),n=Sh(),e!==null&&!_t?(Ih(e,t,r),Wn(e,t,r)):(Te&&n&&ph(t),t.flags|=1,Vt(e,t,a,r),t.child)}function Wv(e,t,a,n,r,o){return ho(t),t.updateQueue=null,a=LS(t,n,a,r),kS(e),n=Sh(),e!==null&&!_t?(Ih(e,t,o),Wn(e,t,o)):(Te&&n&&ph(t),t.flags|=1,Vt(e,t,a,o),t.child)}function $v(e,t,a,n,r){if(ho(t),t.stateNode===null){var o=ci,i=a.contextType;typeof i=="object"&&i!==null&&(o=$t(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Dm,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},wh(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?$t(i):ci,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(zp(t,a,i,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&Dm.enqueueReplaceState(o,o.state,null),Pl(t,n,o,r),Ol(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var l=t.memoizedProps,s=wo(a,l);o.props=s;var u=o.context,c=a.contextType;i=ci,typeof c=="object"&&c!==null&&(i=$t(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l||u!==i)&&zv(t,o,n,i),fr=!1;var f=t.memoizedState;o.state=f,Pl(t,n,o,r),Ol(),u=t.memoizedState,l||f!==u||fr?(typeof d=="function"&&(zp(t,a,d,n),u=t.memoizedState),(s=fr||Fv(t,a,s,n,f,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=i,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,km(e,t),i=t.memoizedProps,c=wo(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=ci,typeof u=="object"&&u!==null&&(s=$t(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==s)&&zv(t,o,n,s),fr=!1,f=t.memoizedState,o.state=f,Pl(t,n,o,r),Ol();var p=t.memoizedState;i!==d||f!==p||fr||e!==null&&e.dependencies!==null&&bc(e.dependencies)?(typeof l=="function"&&(zp(t,a,l,n),p=t.memoizedState),(c=fr||Fv(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&bc(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),o.props=n,o.state=p,o.context=s,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,lc(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=go(t,e.child,null,r),t.child=go(t,null,a,r)):Vt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=Wn(e,t,r),e}function Xv(e,t,a,n){return mo(),t.flags|=256,Vt(e,t,a,n),t.child}var qp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hp(e){return{baseLanes:e,cachePool:wS()}}function jp(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ka),e}function c0(e,t,a){var n=t.pendingProps,r=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(r?mr(t):hr(t),(e=lt)?(e=tI(e,Va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rr!==null?{id:gn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},a=mS(e),a.return=t,t.child=a,Wt=t,lt=null)):e=null,e===null)throw Dr(t);return Xm(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(hr(t),r=t.mode,l=Ec({mode:"hidden",children:l},r),n=uo(n,r,a,null),l.return=t,n.return=t,l.sibling=n,t.child=l,n=t.child,n.memoizedState=Hp(a),n.childLanes=jp(e,i,a),t.memoizedState=qp,Tl(null,n)):(mr(t),Pm(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(mr(t),t.flags&=-257,t=Vp(e,t,a)):t.memoizedState!==null?(hr(t),t.child=e.child,t.flags|=128,t=null):(hr(t),l=n.fallback,r=t.mode,n=Ec({mode:"visible",children:n.children},r),l=uo(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,go(t,e.child,null,a),n=t.child,n.memoizedState=Hp(a),n.childLanes=jp(e,i,a),t.memoizedState=qp,t=Tl(null,n));else if(mr(t),Xm(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(N(419)),n.stack="",n.digest=i,$l({value:n,source:null,stack:null}),t=Vp(e,t,a)}else if(_t||Oi(e,t,a,!1),i=(a&e.childLanes)!==0,_t||i){if(i=tt,i!==null&&(n=zb(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,So(e,n),ma(i,e,n),_h;$m(l)||Dc(),t=Vp(e,t,a)}else $m(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,lt=Wa(l.nextSibling),Wt=t,Te=!0,Ir=null,Va=!1,e!==null&&gS(t,e),t=Pm(t,n.children),t.flags|=4096);return t}return r?(hr(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=zn(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=zn(u,l):(l=uo(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,Tl(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Hp(a):(r=l.cachePool,r!==null?(s=Dt._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=wS(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=jp(e,i,a),t.memoizedState=qp,Tl(e.child,n)):(mr(t),a=e.child,e=a.sibling,a=zn(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=a,t.memoizedState=null,a)}function Pm(e,t){return t=Ec({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=Ca(22,e,null,t),e.lanes=0,e}function Vp(e,t,a){return go(t,e.child,null,a),e=Pm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kv(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Sm(e.return,t,a)}function Gp(e,t,a,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=a,i.tailMode=r,i.treeForkCount=o)}function d0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Ct.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,rt(Ct,i),Vt(e,t,n,a),n=Te?Wl:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kv(e,a,t);else if(e.tag===19)Kv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&Cc(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Gp(t,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Cc(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Gp(t,!0,a,null,o,n);break;case"together":Gp(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Wn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Oi(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,a=zn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=zn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Oh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&bc(e)))}function QO(e,t,a){switch(t.tag){case 3:mc(t,t.stateNode.containerInfo),pr(t,Dt,e.memoizedState.cache),mo();break;case 27:case 5:um(t);break;case 4:mc(t,t.stateNode.containerInfo);break;case 10:pr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Em(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?c0(e,t,a):(mr(t),e=Wn(e,t,a),e!==null?e.sibling:null);mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Oi(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return d0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),rt(Ct,Ct.current),n)break;return null;case 22:return t.lanes=0,u0(e,t,a,t.pendingProps);case 24:pr(t,Dt,e.memoizedState.cache)}return Wn(e,t,a)}function f0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Oh(e,a)&&(t.flags&128)===0)return _t=!1,QO(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Te&&(t.flags&1048576)!==0&&hS(t,Wl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e=="function")fh(e)?(n=wo(e,n),t.tag=1,t=$v(null,t,e,n,a)):(t.tag=0,t=Om(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===Qm){t.tag=11,t=Hv(null,t,e,n,a);break e}else if(r===Jm){t.tag=14,t=jv(null,t,e,n,a);break e}}throw t=lm(e)||e,Error(N(306,t,""))}}return t;case 0:return Om(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=wo(n,t.pendingProps),$v(e,t,n,r,a);case 3:e:{if(mc(t,t.stateNode.containerInfo),e===null)throw Error(N(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,km(e,t),Pl(t,n,null,a);var i=t.memoizedState;if(n=i.cache,pr(t,Dt,n),n!==o.cache&&Im(t,[Dt],a,!0),Ol(),n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xv(e,t,n,a);break e}else if(n!==r){r=ja(Error(N(424)),t),$l(r),t=Xv(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,lt=Wa(e.firstChild),Wt=t,Te=!0,Ir=null,Va=!0,a=bS(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(mo(),n===r){t=Wn(e,t,a);break e}Vt(e,t,n,a)}t=t.child}return t;case 26:return lc(e,t),e===null?(a=yb(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,n=Nc(Sr.current).createElement(a),n[Gt]=t,n[ha]=e,Xt(n,a,e),qt(n),t.stateNode=n):t.memoizedState=yb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return um(t),e===null&&Te&&(n=t.stateNode=aI(t.type,t.pendingProps,Sr.current),Wt=t,Va=!0,r=lt,Nr(t.type)?(Km=r,lt=Wa(n.firstChild)):lt=r),Vt(e,t,t.pendingProps.children,a),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((r=n=lt)&&(n=LP(n,t.type,t.pendingProps,Va),n!==null?(t.stateNode=n,Wt=t,lt=Wa(n.firstChild),Va=!1,r=!0):r=!1),r||Dr(t)),um(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,Gm(r,o)?n=null:i!==null&&Gm(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=bh(e,t,jO,null,null,a),Jl._currentValue=r),lc(e,t),Vt(e,t,n,a),t.child;case 6:return e===null&&Te&&((e=a=lt)&&(a=TP(a,t.pendingProps,Va),a!==null?(t.stateNode=a,Wt=t,lt=null,e=!0):e=!1),e||Dr(t)),null;case 13:return c0(e,t,a);case 4:return mc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=go(t,null,n,a):Vt(e,t,n,a),t.child;case 11:return Hv(e,t,t.type,t.pendingProps,a);case 7:return Vt(e,t,t.pendingProps,a),t.child;case 8:return Vt(e,t,t.pendingProps.children,a),t.child;case 12:return Vt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pr(t,t.type,n.value),Vt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,ho(t),r=$t(r),n=n(r),t.flags|=1,Vt(e,t,n,a),t.child;case 14:return jv(e,t,t.type,t.pendingProps,a);case 15:return s0(e,t,t.type,t.pendingProps,a);case 19:return d0(e,t,a);case 31:return YO(e,t,a);case 22:return u0(e,t,a,t.pendingProps);case 24:return ho(t),n=$t(Dt),e===null?(r=gh(),r===null&&(r=tt,o=hh(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},wh(t),pr(t,Dt,r)):((e.lanes&a)!==0&&(km(e,t),Pl(t,null,null,a),Ol()),r=e.memoizedState,o=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pr(t,Dt,n)):(n=o.cache,pr(t,Dt,n),n!==r.cache&&Im(t,[Dt],a,!0))),Vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(N(156,t.tag))}function Rn(e){e.flags|=4}function Wp(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(N0())e.flags|=8192;else throw fo=Sc,yh}else e.flags&=-16777217}function Zv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!oI(t))if(N0())e.flags|=8192;else throw fo=Sc,yh}function Gu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Bb():536870912,e.lanes|=t,Ti|=t)}function vl(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function JO(e,t,a){var n=t.pendingProps;switch(mh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qn(Dt),bi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bp())),it(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Rn(t),o!==null?(it(t),Zv(t,o)):(it(t),Wp(t,r,null,n,a))):o?o!==e.memoizedState?(Rn(t),it(t),Zv(t,o)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Rn(t),it(t),Wp(t,r,e,n,a)),null;case 27:if(hc(t),a=Sr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}e=xn.current,Qo(t)?kv(t,e):(e=aI(r,n,a),t.stateNode=e,Rn(t))}return it(t),null;case 5:if(hc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return it(t),null}if(o=xn.current,Qo(t))kv(t,o);else{var i=Nc(Sr.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}o[Gt]=t,o[ha]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(Xt(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Rn(t)}}return it(t),Wp(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Rn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(N(166));if(e=Sr.current,Qo(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Wt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Gt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Q0(e.nodeValue,a)),e||Dr(t,!0)}else e=Nc(e).createTextNode(n),e[Gt]=t,t.stateNode=e}return it(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Qo(t),a!==null){if(e===null){if(!n)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[Gt]=t}else mo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else a=Bp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ia(t),t):(Ia(t),null);if((t.flags&128)!==0)throw Error(N(558))}return it(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Qo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(N(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(N(317));r[Gt]=t}else mo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),r=!1}else r=Bp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Ia(t),t):(Ia(t),null)}return Ia(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Gu(t,t.updateQueue),it(t),null);case 4:return bi(),e===null&&qh(t.stateNode.containerInfo),it(t),null;case 10:return qn(t.type),it(t),null;case 19:if(Ht(Ct),n=t.memoizedState,n===null)return it(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)vl(n,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Cc(e),o!==null){for(t.flags|=128,vl(n,!1),e=o.updateQueue,t.updateQueue=e,Gu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)pS(a,e),a=a.sibling;return rt(Ct,Ct.current&1|2),Te&&Pn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&La()>Ac&&(t.flags|=128,r=!0,vl(n,!1),t.lanes=4194304)}else{if(!r)if(e=Cc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Gu(t,e),vl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Te)return it(t),null}else 2*La()-n.renderingStartTime>Ac&&a!==536870912&&(t.flags|=128,r=!0,vl(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=La(),e.sibling=null,a=Ct.current,rt(Ct,r?a&1|2:a&1),Te&&Pn(t,n.treeForkCount),e):(it(t),null);case 22:case 23:return Ia(t),xh(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),a=t.updateQueue,a!==null&&Gu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&Ht(co),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qn(Dt),it(t),null;case 25:return null;case 30:return null}throw Error(N(156,t.tag))}function eP(e,t){switch(mh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qn(Dt),bi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hc(t),null;case 31:if(t.memoizedState!==null){if(Ia(t),t.alternate===null)throw Error(N(340));mo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ia(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));mo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ht(Ct),null;case 4:return bi(),null;case 10:return qn(t.type),null;case 22:case 23:return Ia(t),xh(),e!==null&&Ht(co),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qn(Dt),null;case 25:return null;default:return null}}function p0(e,t){switch(mh(t),t.tag){case 3:qn(Dt),bi();break;case 26:case 27:case 5:hc(t);break;case 4:bi();break;case 31:t.memoizedState!==null&&Ia(t);break;case 13:Ia(t);break;case 19:Ht(Ct);break;case 10:qn(t.type);break;case 22:case 23:Ia(t),xh(),e!==null&&Ht(co);break;case 24:qn(Dt)}}function cs(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(l){qe(t,t.return,l)}}function _r(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){var i=n.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var s=a,u=l;try{u()}catch(c){qe(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){qe(t,t.return,c)}}function m0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{IS(t,a)}catch(n){qe(e,e.return,n)}}}function h0(e,t,a){a.props=wo(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){qe(e,t,n)}}function Bl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){qe(e,t,r)}}function wn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){qe(e,t,r)}else a.current=null}function g0(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){qe(e,e.return,r)}}function $p(e,t,a){try{var n=e.stateNode;vP(n,e.type,a,t),n[ha]=t}catch(r){qe(e,e.return,r)}}function y0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function Xp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||y0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Nr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nm(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Un));else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Nm(e,t,a),e=e.sibling;e!==null;)Nm(e,t,a),e=e.sibling}function Mc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Nr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Mc(e,t,a),e=e.sibling;e!==null;)Mc(e,t,a),e=e.sibling}function w0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Xt(t,n,a),t[Gt]=e,t[ha]=a}catch(o){qe(e,e.return,o)}}var Nn=!1,Rt=!1,Kp=!1,Yv=typeof WeakSet=="function"?WeakSet:Set,zt=null;function tP(e,t){if(e=e.containerInfo,jm=zc,e=oS(e),uh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,l=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==a||r!==0&&d.nodeType!==3||(l=i+r),d!==o||n!==0&&d.nodeType!==3||(s=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===a&&++u===r&&(l=i),f===o&&++c===n&&(s=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=l===-1||s===-1?null:{start:l,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vm={focusedElem:e,selectionRange:a},zc=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var m=wo(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){qe(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Wm(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Wm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(N(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function x0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:_n(e,a),n&4&&cs(5,a);break;case 1:if(_n(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){qe(a,a.return,i)}else{var r=wo(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){qe(a,a.return,i)}}n&64&&m0(a),n&512&&Bl(a,a.return);break;case 3:if(_n(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{IS(e,t)}catch(i){qe(a,a.return,i)}}break;case 27:t===null&&n&4&&w0(a);case 26:case 5:_n(e,a),t===null&&n&4&&g0(a),n&512&&Bl(a,a.return);break;case 12:_n(e,a);break;case 31:_n(e,a),n&4&&S0(e,a);break;case 13:_n(e,a),n&4&&I0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=cP.bind(null,a),EP(e,a))));break;case 22:if(n=a.memoizedState!==null||Nn,!n){t=t!==null&&t.memoizedState!==null||Rt,r=Nn;var o=Rt;Nn=n,(Rt=t)&&!o?On(e,a,(a.subtreeFlags&8772)!==0):_n(e,a),Nn=r,Rt=o}break;case 30:break;default:_n(e,a)}}function v0(e){var t=e.alternate;t!==null&&(e.alternate=null,v0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nh(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,fa=!1;function Dn(e,t,a){for(a=a.child;a!==null;)b0(e,t,a),a=a.sibling}function b0(e,t,a){if(Ta&&typeof Ta.onCommitFiberUnmount=="function")try{Ta.onCommitFiberUnmount(ns,a)}catch{}switch(a.tag){case 26:Rt||wn(a,t),Dn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||wn(a,t);var n=mt,r=fa;Nr(a.type)&&(mt=a.stateNode,fa=!1),Dn(e,t,a),ql(a.stateNode),mt=n,fa=r;break;case 5:Rt||wn(a,t);case 6:if(n=mt,r=fa,mt=null,Dn(e,t,a),mt=n,fa=r,mt!==null)if(fa)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(o){qe(a,t,o)}else try{mt.removeChild(a.stateNode)}catch(o){qe(a,t,o)}break;case 18:mt!==null&&(fa?(e=mt,fb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ri(e)):fb(mt,a.stateNode));break;case 4:n=mt,r=fa,mt=a.stateNode.containerInfo,fa=!0,Dn(e,t,a),mt=n,fa=r;break;case 0:case 11:case 14:case 15:_r(2,a,t),Rt||_r(4,a,t),Dn(e,t,a);break;case 1:Rt||(wn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&h0(a,t,n)),Dn(e,t,a);break;case 21:Dn(e,t,a);break;case 22:Rt=(n=Rt)||a.memoizedState!==null,Dn(e,t,a),Rt=n;break;default:Dn(e,t,a)}}function S0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ri(e)}catch(a){qe(t,t.return,a)}}}function I0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ri(e)}catch(a){qe(t,t.return,a)}}function aP(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yv),t;default:throw Error(N(435,e.tag))}}function Wu(e,t){var a=aP(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=dP.bind(null,e,n);n.then(r,r)}})}function ca(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Nr(l.type)){mt=l.stateNode,fa=!1;break e}break;case 5:mt=l.stateNode,fa=!1;break e;case 3:case 4:mt=l.stateNode.containerInfo,fa=!0;break e}l=l.return}if(mt===null)throw Error(N(160));b0(o,i,r),mt=null,fa=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)C0(t,e),t=t.sibling}var tn=null;function C0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ca(t,e),da(e),n&4&&(_r(3,e,e.return),cs(3,e),_r(5,e,e.return));break;case 1:ca(t,e),da(e),n&512&&(Rt||a===null||wn(a,a.return)),n&64&&Nn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=tn;if(ca(t,e),da(e),n&512&&(Rt||a===null||wn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[is]||o[Gt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),Xt(o,n,a),o[Gt]=e,qt(o),n=o;break e;case"link":var i=xb("link","href",r).get(n+(a.href||""));if(i){for(var l=0;l<i.length;l++)if(o=i[l],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;case"meta":if(i=xb("meta","content",r).get(n+(a.content||""))){for(l=0;l<i.length;l++)if(o=i[l],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(l,1);break t}}o=r.createElement(n),Xt(o,n,a),r.head.appendChild(o);break;default:throw Error(N(468,n))}o[Gt]=e,qt(o),n=o}e.stateNode=n}else vb(r,e.type,e.stateNode);else e.stateNode=wb(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?vb(r,e.type,e.stateNode):wb(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&$p(e,e.memoizedProps,a.memoizedProps)}break;case 27:ca(t,e),da(e),n&512&&(Rt||a===null||wn(a,a.return)),a!==null&&n&4&&$p(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ca(t,e),da(e),n&512&&(Rt||a===null||wn(a,a.return)),e.flags&32){r=e.stateNode;try{Ii(r,"")}catch(m){qe(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,$p(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Kp=!0);break;case 6:if(ca(t,e),da(e),n&4){if(e.stateNode===null)throw Error(N(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){qe(e,e.return,m)}}break;case 3:if(cc=null,r=tn,tn=Bc(t.containerInfo),ca(t,e),tn=r,da(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Ri(t.containerInfo)}catch(m){qe(e,e.return,m)}Kp&&(Kp=!1,k0(e));break;case 4:n=tn,tn=Bc(e.stateNode.containerInfo),ca(t,e),da(e),tn=n;break;case 12:ca(t,e),da(e);break;case 31:ca(t,e),da(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wu(e,n)));break;case 13:ca(t,e),da(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Jc=La()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wu(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Nn,c=Rt;if(Nn=u||r,Rt=c||s,ca(t,e),Rt=c,Nn=u,da(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Nn||Rt||lo(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){s=a=t;try{if(o=s.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=s.stateNode;var d=s.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(m){qe(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){qe(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?pb(p,!0):pb(s.stateNode,!1)}catch(m){qe(s,s.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Wu(e,a))));break;case 19:ca(t,e),da(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wu(e,n)));break;case 30:break;case 21:break;default:ca(t,e),da(e)}}function da(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(y0(n)){a=n;break}n=n.return}if(a==null)throw Error(N(160));switch(a.tag){case 27:var r=a.stateNode,o=Xp(e);Mc(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Ii(i,""),a.flags&=-33);var l=Xp(e);Mc(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Xp(e);Nm(e,u,s);break;default:throw Error(N(161))}}catch(c){qe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function k0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;k0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)x0(e,t.alternate,t),t=t.sibling}function lo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_r(4,t,t.return),lo(t);break;case 1:wn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&h0(t,t.return,a),lo(t);break;case 27:ql(t.stateNode);case 26:case 5:wn(t,t.return),lo(t);break;case 22:t.memoizedState===null&&lo(t);break;case 30:lo(t);break;default:lo(t)}e=e.sibling}}function On(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,o=t,i=o.flags;switch(o.tag){case 0:case 11:case 15:On(r,o,a),cs(4,o);break;case 1:if(On(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){qe(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var l=n.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)SS(s[r],l)}catch(u){qe(n,n.return,u)}}a&&i&64&&m0(o),Bl(o,o.return);break;case 27:w0(o);case 26:case 5:On(r,o,a),a&&n===null&&i&4&&g0(o),Bl(o,o.return);break;case 12:On(r,o,a);break;case 31:On(r,o,a),a&&i&4&&S0(r,o);break;case 13:On(r,o,a),a&&i&4&&I0(r,o);break;case 22:o.memoizedState===null&&On(r,o,a),Bl(o,o.return);break;case 30:break;default:On(r,o,a)}t=t.sibling}}function Ph(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ss(a))}function Nh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e))}function en(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)L0(e,t,a,n),t=t.sibling}function L0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:en(e,t,a,n),r&2048&&cs(9,t);break;case 1:en(e,t,a,n);break;case 3:en(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e)));break;case 12:if(r&2048){en(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,l=o.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){qe(t,t.return,s)}}else en(e,t,a,n);break;case 31:en(e,t,a,n);break;case 13:en(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?en(e,t,a,n):Ul(e,t):o._visibility&2?en(e,t,a,n):(o._visibility|=2,ei(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ph(i,t);break;case 24:en(e,t,a,n),r&2048&&Nh(t.alternate,t);break;default:en(e,t,a,n)}}function ei(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,l=a,s=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:ei(o,i,l,s,r),cs(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?ei(o,i,l,s,r):Ul(o,i):(c._visibility|=2,ei(o,i,l,s,r)),r&&u&2048&&Ph(i.alternate,i);break;case 24:ei(o,i,l,s,r),r&&u&2048&&Nh(i.alternate,i);break;default:ei(o,i,l,s,r)}t=t.sibling}}function Ul(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:Ul(a,n),r&2048&&Ph(n.alternate,n);break;case 24:Ul(a,n),r&2048&&Nh(n.alternate,n);break;default:Ul(a,n)}t=t.sibling}}var El=8192;function Jo(e,t,a){if(e.subtreeFlags&El)for(e=e.child;e!==null;)T0(e,t,a),e=e.sibling}function T0(e,t,a){switch(e.tag){case 26:Jo(e,t,a),e.flags&El&&e.memoizedState!==null&&zP(a,tn,e.memoizedState,e.memoizedProps);break;case 5:Jo(e,t,a);break;case 3:case 4:var n=tn;tn=Bc(e.stateNode.containerInfo),Jo(e,t,a),tn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=El,El=16777216,Jo(e,t,a),El=n):Jo(e,t,a));break;default:Jo(e,t,a)}}function E0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,A0(n,e)}E0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)M0(e),e=e.sibling}function M0(e){switch(e.tag){case 0:case 11:case 15:bl(e),e.flags&2048&&_r(9,e,e.return);break;case 3:bl(e);break;case 12:bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sc(e)):bl(e);break;default:bl(e)}}function sc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,A0(n,e)}E0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_r(8,t,t.return),sc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,sc(t));break;default:sc(t)}e=e.sibling}}function A0(e,t){for(;zt!==null;){var a=zt;switch(a.tag){case 0:case 11:case 15:_r(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ss(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,zt=n;else e:for(a=e;zt!==null;){n=zt;var r=n.sibling,o=n.return;if(v0(n),n===a){zt=null;break e}if(r!==null){r.return=o,zt=r;break e}zt=o}}}var nP={getCacheForType:function(e){var t=$t(Dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return $t(Dt).controller.signal}},rP=typeof WeakMap=="function"?WeakMap:Map,Be=0,tt=null,Se=null,Ce=0,ze=0,Sa=null,xr=!1,Ni=!1,Bh=!1,$n=0,yt=0,Or=0,po=0,Uh=0,ka=0,Ti=0,Fl=null,pa=null,Bm=!1,Jc=0,R0=0,Ac=1/0,Rc=null,Lr=null,Ot=0,Tr=null,Ei=null,Hn=0,Um=0,Fm=null,D0=null,zl=0,zm=null;function Ma(){return(Be&2)!==0&&Ce!==0?Ce&-Ce:ie.T!==null?zh():qb()}function _0(){if(ka===0)if((Ce&536870912)===0||Te){var e=Nu;Nu<<=1,(Nu&3932160)===0&&(Nu=262144),ka=e}else ka=536870912;return e=Ra.current,e!==null&&(e.flags|=32),ka}function ma(e,t,a){(e===tt&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(Mi(e,0),vr(e,Ce,ka,!1)),os(e,a),((Be&2)===0||e!==tt)&&(e===tt&&((Be&2)===0&&(po|=a),yt===4&&vr(e,Ce,ka,!1)),bn(e))}function O0(e,t,a){if((Be&6)!==0)throw Error(N(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||rs(e,t),r=n?lP(e,t):Zp(e,t,!0),o=n;do{if(r===0){Ni&&!n&&vr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!oP(a)){r=Zp(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Fl;var s=l.current.memoizedState.isDehydrated;if(s&&(Mi(l,i).flags|=256),i=Zp(l,i,!1),i!==2){if(Bh&&!s){l.errorRecoveryDisabledLanes|=o,po|=o,r=4;break e}o=pa,pa=r,o!==null&&(pa===null?pa=o:pa.push.apply(pa,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Mi(e,0),vr(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(N(345));case 4:if((t&4194048)!==t)break;case 6:vr(n,t,ka,!xr);break e;case 2:pa=null;break;case 3:case 5:break;default:throw Error(N(329))}if((t&62914560)===t&&(r=Jc+300-La(),10<r)){if(vr(n,t,ka,!xr),Hc(n,0,!0)!==0)break e;Hn=t,n.timeoutHandle=eI(Qv.bind(null,n,a,pa,Rc,Bm,t,ka,po,Ti,xr,o,"Throttled",-0,0),r);break e}Qv(n,a,pa,Rc,Bm,t,ka,po,Ti,xr,o,null,-0,0)}}break}while(!0);bn(e)}function Qv(e,t,a,n,r,o,i,l,s,u,c,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Un},T0(t,o,d);var m=(o&62914560)===o?Jc-La():(o&4194048)===o?R0-La():0;if(m=qP(d,m),m!==null){Hn=o,e.cancelPendingCommit=m(eb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),vr(e,o,i,!u);return}}eb(e,t,o,a,n,r,i,l,s)}function oP(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!Aa(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vr(e,t,a,n){t&=~Uh,t&=~po,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-Ea(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&Ub(e,a,t)}function ed(){return(Be&6)===0?(ds(0,!1),!1):!0}function Fh(){if(Se!==null){if(ze===0)var e=Se.return;else e=Se,Fn=Io=null,Ch(e),wi=null,Xl=0,e=Se;for(;e!==null;)p0(e.alternate,e),e=e.return;Se=null}}function Mi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,IP(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Hn=0,Fh(),tt=e,Se=a=zn(e.current,null),Ce=t,ze=0,Sa=null,xr=!1,Ni=rs(e,t),Bh=!1,Ti=ka=Uh=po=Or=yt=0,pa=Fl=null,Bm=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ea(n),o=1<<r;t|=e[r],n&=~o}return $n=t,Wc(),a}function P0(e,t){me=null,ie.H=Zl,t===Pi||t===Xc?(t=Av(),ze=3):t===yh?(t=Av(),ze=4):ze=t===_h?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sa=t,Se===null&&(yt=1,Tc(e,ja(t,e.current)))}function N0(){var e=Ra.current;return e===null?!0:(Ce&4194048)===Ce?Ga===null:(Ce&62914560)===Ce||(Ce&536870912)!==0?e===Ga:!1}function B0(){var e=ie.H;return ie.H=Zl,e===null?Zl:e}function U0(){var e=ie.A;return ie.A=nP,e}function Dc(){yt=4,xr||(Ce&4194048)!==Ce&&Ra.current!==null||(Ni=!0),(Or&134217727)===0&&(po&134217727)===0||tt===null||vr(tt,Ce,ka,!1)}function Zp(e,t,a){var n=Be;Be|=2;var r=B0(),o=U0();(tt!==e||Ce!==t)&&(Rc=null,Mi(e,t)),t=!1;var i=yt;e:do try{if(ze!==0&&Se!==null){var l=Se,s=Sa;switch(ze){case 8:Fh(),i=6;break e;case 3:case 2:case 9:case 6:Ra.current===null&&(t=!0);var u=ze;if(ze=0,Sa=null,pi(e,l,s,u),a&&Ni){i=0;break e}break;default:u=ze,ze=0,Sa=null,pi(e,l,s,u)}}iP(),i=yt;break}catch(c){P0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Fn=Io=null,Be=n,ie.H=r,ie.A=o,Se===null&&(tt=null,Ce=0,Wc()),i}function iP(){for(;Se!==null;)F0(Se)}function lP(e,t){var a=Be;Be|=2;var n=B0(),r=U0();tt!==e||Ce!==t?(Rc=null,Ac=La()+500,Mi(e,t)):Ni=rs(e,t);e:do try{if(ze!==0&&Se!==null){t=Se;var o=Sa;t:switch(ze){case 1:ze=0,Sa=null,pi(e,t,o,1);break;case 2:case 9:if(Mv(o)){ze=0,Sa=null,Jv(t);break}t=function(){ze!==2&&ze!==9||tt!==e||(ze=7),bn(e)},o.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Mv(o)?(ze=0,Sa=null,Jv(t)):(ze=0,Sa=null,pi(e,t,o,7));break;case 5:var i=null;switch(Se.tag){case 26:i=Se.memoizedState;case 5:case 27:var l=Se;if(i?oI(i):l.stateNode.complete){ze=0,Sa=null;var s=l.sibling;if(s!==null)Se=s;else{var u=l.return;u!==null?(Se=u,td(u)):Se=null}break t}}ze=0,Sa=null,pi(e,t,o,5);break;case 6:ze=0,Sa=null,pi(e,t,o,6);break;case 8:Fh(),yt=6;break e;default:throw Error(N(462))}}sP();break}catch(c){P0(e,c)}while(!0);return Fn=Io=null,ie.H=n,ie.A=r,Be=a,Se!==null?0:(tt=null,Ce=0,Wc(),yt)}function sP(){for(;Se!==null&&!R_();)F0(Se)}function F0(e){var t=f0(e.alternate,e,$n);e.memoizedProps=e.pendingProps,t===null?td(e):Se=t}function Jv(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Wv(a,t,t.pendingProps,t.type,void 0,Ce);break;case 11:t=Wv(a,t,t.pendingProps,t.type.render,t.ref,Ce);break;case 5:Ch(t);default:p0(a,t),t=Se=pS(t,$n),t=f0(a,t,$n)}e.memoizedProps=e.pendingProps,t===null?td(e):Se=t}function pi(e,t,a,n){Fn=Io=null,Ch(t),wi=null,Xl=0;var r=t.return;try{if(ZO(e,r,t,a,Ce)){yt=1,Tc(e,ja(a,e.current)),Se=null;return}}catch(o){if(r!==null)throw Se=r,o;yt=1,Tc(e,ja(a,e.current)),Se=null;return}t.flags&32768?(Te||n===1?e=!0:Ni||(Ce&536870912)!==0?e=!1:(xr=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ra.current,n!==null&&n.tag===13&&(n.flags|=16384))),z0(t,e)):td(t)}function td(e){var t=e;do{if((t.flags&32768)!==0){z0(t,xr);return}e=t.return;var a=JO(t.alternate,t,$n);if(a!==null){Se=a;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);yt===0&&(yt=5)}function z0(e,t){do{var a=eP(e.alternate,e);if(a!==null){a.flags&=32767,Se=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Se=e;return}Se=e=a}while(e!==null);yt=6,Se=null}function eb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do ad();while(Ot!==0);if((Be&6)!==0)throw Error(N(327));if(t!==null){if(t===e.current)throw Error(N(177));if(o=t.lanes|t.childLanes,o|=ch,q_(e,a,o,i,l,s),e===tt&&(Se=tt=null,Ce=0),Ei=t,Tr=e,Hn=a,Um=o,Fm=r,D0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,fP(gc,function(){return G0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=ie.T,ie.T=null,r=Ue.p,Ue.p=2,i=Be,Be|=4;try{tP(e,t,a)}finally{Be=i,Ue.p=r,ie.T=n}}Ot=1,q0(),H0(),j0()}}function q0(){if(Ot===1){Ot=0;var e=Tr,t=Ei,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{C0(t,e);var o=Vm,i=oS(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&rS(l.ownerDocument.documentElement,l)){if(s!==null&&uh(l)){var u=s.start,c=s.end;if(c===void 0&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=l.textContent.length,x=Math.min(s.start,m),I=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>I&&(i=I,I=x,x=i);var y=Sv(l,x),w=Sv(l,I);if(y&&w&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==w.node||p.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),p.removeAllRanges(),x>I?(p.addRange(g),p.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),p.addRange(g))}}}}for(d=[],p=l;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var b=d[l];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}zc=!!jm,Vm=jm=null}finally{Be=r,Ue.p=n,ie.T=a}}e.current=t,Ot=2}}function H0(){if(Ot===2){Ot=0;var e=Tr,t=Ei,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ie.T,ie.T=null;var n=Ue.p;Ue.p=2;var r=Be;Be|=4;try{x0(e,t.alternate,t)}finally{Be=r,Ue.p=n,ie.T=a}}Ot=3}}function j0(){if(Ot===4||Ot===3){Ot=0,D_();var e=Tr,t=Ei,a=Hn,n=D0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Ei=Tr=null,V0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Lr=null),ah(a),t=t.stateNode,Ta&&typeof Ta.onCommitFiberRoot=="function")try{Ta.onCommitFiberRoot(ns,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=ie.T,r=Ue.p,Ue.p=2,ie.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var l=n[i];o(l.value,{componentStack:l.stack})}}finally{ie.T=t,Ue.p=r}}(Hn&3)!==0&&ad(),bn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===zm?zl++:(zl=0,zm=e):zl=0,ds(0,!1)}}function V0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ss(t)))}function ad(){return q0(),H0(),j0(),G0()}function G0(){if(Ot!==5)return!1;var e=Tr,t=Um;Um=0;var a=ah(Hn),n=ie.T,r=Ue.p;try{Ue.p=32>a?32:a,ie.T=null,a=Fm,Fm=null;var o=Tr,i=Hn;if(Ot=0,Ei=Tr=null,Hn=0,(Be&6)!==0)throw Error(N(331));var l=Be;if(Be|=4,M0(o.current),L0(o,o.current,i,a),Be=l,ds(0,!1),Ta&&typeof Ta.onPostCommitFiberRoot=="function")try{Ta.onPostCommitFiberRoot(ns,o)}catch{}return!0}finally{Ue.p=r,ie.T=n,V0(e,t)}}function tb(e,t,a){t=ja(a,t),t=_m(e.stateNode,t,2),e=kr(e,t,2),e!==null&&(os(e,2),bn(e))}function qe(e,t,a){if(e.tag===3)tb(e,e,a);else for(;t!==null;){if(t.tag===3){tb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Lr===null||!Lr.has(n))){e=ja(a,e),a=i0(2),n=kr(t,a,2),n!==null&&(l0(a,n,t,e),os(n,2),bn(n));break}}t=t.return}}function Yp(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new rP;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(Bh=!0,r.add(a),e=uP.bind(null,e,t,a),t.then(e,e))}function uP(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(Ce&a)===a&&(yt===4||yt===3&&(Ce&62914560)===Ce&&300>La()-Jc?(Be&2)===0&&Mi(e,0):Uh|=a,Ti===Ce&&(Ti=0)),bn(e)}function W0(e,t){t===0&&(t=Bb()),e=So(e,t),e!==null&&(os(e,t),bn(e))}function cP(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),W0(e,a)}function dP(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(N(314))}n!==null&&n.delete(t),W0(e,a)}function fP(e,t){return eh(e,t)}var _c=null,ti=null,qm=!1,Oc=!1,Qp=!1,br=0;function bn(e){e!==ti&&e.next===null&&(ti===null?_c=ti=e:ti=ti.next=e),Oc=!0,qm||(qm=!0,mP())}function ds(e,t){if(!Qp&&Oc){Qp=!0;do for(var a=!1,n=_c;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,l=n.pingedLanes;o=(1<<31-Ea(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,ab(n,o))}else o=Ce,o=Hc(n,n===tt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||rs(n,o)||(a=!0,ab(n,o));n=n.next}while(a);Qp=!1}}function pP(){$0()}function $0(){Oc=qm=!1;var e=0;br!==0&&SP()&&(e=br);for(var t=La(),a=null,n=_c;n!==null;){var r=n.next,o=X0(n,t);o===0?(n.next=null,a===null?_c=r:a.next=r,r===null&&(ti=a)):(a=n,(e!==0||(o&3)!==0)&&(Oc=!0)),n=r}Ot!==0&&Ot!==5||ds(e,!1),br!==0&&(br=0)}function X0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-Ea(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=z_(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=tt,a=Ce,a=Hc(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Tp(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||rs(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Tp(n),ah(a)){case 2:case 8:a=Pb;break;case 32:a=gc;break;case 268435456:a=Nb;break;default:a=gc}return n=K0.bind(null,e),a=eh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Tp(n),e.callbackPriority=2,e.callbackNode=null,2}function K0(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ad()&&e.callbackNode!==a)return null;var n=Ce;return n=Hc(e,e===tt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(O0(e,n,t),X0(e,La()),e.callbackNode!=null&&e.callbackNode===a?K0.bind(null,e):null)}function ab(e,t){if(ad())return null;O0(e,t,!0)}function mP(){CP(function(){(Be&6)!==0?eh(Ob,pP):$0()})}function zh(){if(br===0){var e=Ci;e===0&&(e=Pu,Pu<<=1,(Pu&261888)===0&&(Pu=256)),br=e}return br}function nb(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ju(""+e)}function rb(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function hP(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=nb((r[ha]||null).action),i=n.submitter;i&&(t=(t=i[ha]||null)?nb(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new jc("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(br!==0){var s=i?rb(r,i):new FormData(r);Rm(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?rb(r,i):new FormData(r),Rm(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for($u=0;$u<xm.length;$u++)Xu=xm[$u],ob=Xu.toLowerCase(),ib=Xu[0].toUpperCase()+Xu.slice(1),an(ob,"on"+ib);var Xu,ob,ib,$u;an(lS,"onAnimationEnd");an(sS,"onAnimationIteration");an(uS,"onAnimationStart");an("dblclick","onDoubleClick");an("focusin","onFocus");an("focusout","onBlur");an(_O,"onTransitionRun");an(OO,"onTransitionStart");an(PO,"onTransitionCancel");an(cS,"onTransitionEnd");Si("onMouseEnter",["mouseout","mouseover"]);Si("onMouseLeave",["mouseout","mouseover"]);Si("onPointerEnter",["pointerout","pointerover"]);Si("onPointerLeave",["pointerout","pointerover"]);xo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xo("onBeforeInput",["compositionend","keypress","textInput","paste"]);xo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yl="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(" "),gP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yl));function Z0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){wc(c)}r.currentTarget=null,o=s}else for(i=0;i<n.length;i++){if(l=n[i],s=l.instance,u=l.currentTarget,l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){wc(c)}r.currentTarget=null,o=s}}}}function be(e,t){var a=t[dm];a===void 0&&(a=t[dm]=new Set);var n=e+"__bubble";a.has(n)||(Y0(t,e,2,!1),a.add(n))}function Jp(e,t,a){var n=0;t&&(n|=4),Y0(a,e,n,t)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function qh(e){if(!e[Ku]){e[Ku]=!0,Hb.forEach(function(a){a!=="selectionchange"&&(gP.has(a)||Jp(a,!1,e),Jp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ku]||(t[Ku]=!0,Jp("selectionchange",!1,t))}}function Y0(e,t,a,n){switch(cI(t)){case 2:var r=VP;break;case 8:r=GP;break;default:r=Gh}a=r.bind(null,t,a,e),r=void 0,!gm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function em(e,t,a,n,r){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=n.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=ri(l),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){n=o=i;continue e}l=l.parentNode}}n=n.return}Zb(function(){var u=o,c=oh(a),d=[];e:{var f=dS.get(e);if(f!==void 0){var p=jc,m=e;switch(e){case"keypress":if(tc(a)===0)break e;case"keydown":case"keyup":p=dO;break;case"focusin":m="focus",p=Dp;break;case"focusout":m="blur",p=Dp;break;case"beforeblur":case"afterblur":p=Dp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=pv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=J_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=mO;break;case lS:case sS:case uS:p=aO;break;case cS:p=gO;break;case"scroll":case"scrollend":p=Y_;break;case"wheel":p=wO;break;case"copy":case"cut":case"paste":p=rO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=hv;break;case"toggle":case"beforetoggle":p=vO}var x=(t&4)!==0,I=!x&&(e==="scroll"||e==="scrollend"),y=x?f!==null?f+"Capture":null:f;x=[];for(var w=u,g;w!==null;){var b=w;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||y===null||(b=jl(w,y),b!=null&&x.push(Ql(w,b,g))),I)break;w=w.return}0<x.length&&(f=new p(f,m,null,a,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&a!==hm&&(m=a.relatedTarget||a.fromElement)&&(ri(m)||m[Di]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=a.relatedTarget||a.toElement,p=u,m=m?ri(m):null,m!==null&&(I=as(m),x=m.tag,m!==I||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=pv,b="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(x=hv,b="onPointerLeave",y="onPointerEnter",w="pointer"),I=p==null?f:Ll(p),g=m==null?f:Ll(m),f=new x(b,w+"leave",p,a,c),f.target=I,f.relatedTarget=g,b=null,ri(c)===u&&(x=new x(y,w+"enter",m,a,c),x.target=g,x.relatedTarget=I,b=x),I=b,p&&m)t:{for(x=yP,y=p,w=m,g=0,b=y;b;b=x(b))g++;b=0;for(var T=w;T;T=x(T))b++;for(;0<g-b;)y=x(y),g--;for(;0<b-g;)w=x(w),b--;for(;g--;){if(y===w||w!==null&&y===w.alternate){x=y;break t}y=x(y),w=x(w)}x=null}else x=null;p!==null&&lb(d,f,p,x,!1),m!==null&&I!==null&&lb(d,I,m,x,!0)}}e:{if(f=u?Ll(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=xv;else if(wv(f))if(aS)S=AO;else{S=EO;var M=TO}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&rh(u.elementType)&&(S=xv):S=MO;if(S&&(S=S(e,u))){tS(d,S,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&mm(f,"number",f.value)}switch(M=u?Ll(u):window,e){case"focusin":(wv(M)||M.contentEditable==="true")&&(li=M,ym=u,Rl=null);break;case"focusout":Rl=ym=li=null;break;case"mousedown":wm=!0;break;case"contextmenu":case"mouseup":case"dragend":wm=!1,Iv(d,a,c);break;case"selectionchange":if(DO)break;case"keydown":case"keyup":Iv(d,a,c)}var R;if(sh)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else ii?Jb(e,a)&&(_="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(_="onCompositionStart");_&&(Qb&&a.locale!=="ko"&&(ii||_!=="onCompositionStart"?_==="onCompositionEnd"&&ii&&(R=Yb()):(wr=c,ih="value"in wr?wr.value:wr.textContent,ii=!0)),M=Pc(u,_),0<M.length&&(_=new mv(_,e,null,a,c),d.push({event:_,listeners:M}),R?_.data=R:(R=eS(a),R!==null&&(_.data=R)))),(R=SO?IO(e,a):CO(e,a))&&(_=Pc(u,"onBeforeInput"),0<_.length&&(M=new mv("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:_}),M.data=R)),hP(d,e,u,a,c)}Z0(d,t)})}function Ql(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Pc(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=jl(e,a),r!=null&&n.unshift(Ql(e,r,o)),r=jl(e,t),r!=null&&n.push(Ql(e,r,o))),e.tag===3)return n;e=e.return}return[]}function yP(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function lb(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var l=a,s=l.alternate,u=l.stateNode;if(l=l.tag,s!==null&&s===n)break;l!==5&&l!==26&&l!==27||u===null||(s=u,r?(u=jl(a,o),u!=null&&i.unshift(Ql(a,u,s))):r||(u=jl(a,o),u!=null&&i.push(Ql(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var wP=/\r\n?/g,xP=/\u0000|\uFFFD/g;function sb(e){return(typeof e=="string"?e:""+e).replace(wP,`
|
|
9
|
+
`).replace(xP,"")}function Q0(e,t){return t=sb(t),sb(e)===t}function Ze(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Ii(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Ii(e,""+n);break;case"className":Uu(e,"class",n);break;case"tabIndex":Uu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Uu(e,a,n);break;case"style":Kb(e,n,o);break;case"data":if(t!=="object"){Uu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ju(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 o=="function"&&(a==="formAction"?(t!=="input"&&Ze(e,t,"name",r.name,r,null),Ze(e,t,"formEncType",r.formEncType,r,null),Ze(e,t,"formMethod",r.formMethod,r,null),Ze(e,t,"formTarget",r.formTarget,r,null)):(Ze(e,t,"encType",r.encType,r,null),Ze(e,t,"method",r.method,r,null),Ze(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ju(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Un);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Ju(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":be("beforetoggle",e),be("toggle",e),Qu(e,"popover",n);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Qu(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=K_.get(a)||a,Qu(e,a,n))}}function Hm(e,t,a,n,r,o){switch(a){case"style":Kb(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(N(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(N(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Ii(e,n):(typeof n=="number"||typeof n=="bigint")&&Ii(e,""+n);break;case"onScroll":n!=null&&be("scroll",e);break;case"onScrollEnd":n!=null&&be("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[ha]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Qu(e,a,n)}}}function Xt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,o,i,a,null)}}r&&Ze(e,t,"srcSet",a.srcSet,a,null),n&&Ze(e,t,"src",a.src,a,null);return;case"input":be("invalid",e);var l=o=i=r=null,s=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":i=c;break;case"checked":s=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(N(137,t));break;default:Ze(e,t,n,c,a,null)}}Wb(e,o,l,s,u,i,r,!1);return;case"select":be("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(l=a[r],l!=null))switch(r){case"value":o=l;break;case"defaultValue":i=l;break;case"multiple":n=l;default:Ze(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?hi(e,!!n,t,!1):a!=null&&hi(e,!!n,a,!0);return;case"textarea":be("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":r=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(N(91));break;default:Ze(e,t,i,l,a,null)}Xb(e,n,r,o);return;case"option":for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null)&&(s==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Ze(e,t,s,n,a,null));return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(n=0;n<Yl.length;n++)be(Yl[n],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ze(e,t,u,n,a,null)}return;default:if(rh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Hm(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&Ze(e,t,l,n,a,null))}function vP(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,l=null,s=null,u=null,c=null;for(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=d;default:n.hasOwnProperty(p)||Ze(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=a[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(N(137,t));break;default:p!==d&&Ze(e,t,f,p,n,d)}}pm(e,i,l,s,u,c,o,r);return;case"select":p=i=l=f=null;for(o in a)if(s=a[o],a.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:n.hasOwnProperty(o)||Ze(e,t,o,null,n,s)}for(r in n)if(o=n[r],s=a[r],n.hasOwnProperty(r)&&(o!=null||s!=null))switch(r){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":i=o;default:o!==s&&Ze(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?hi(e,!!a,f,!1):!!n!=!!a&&(t!=null?hi(e,!!a,t,!0):hi(e,!!a,a?[]:"",!1));return;case"textarea":p=f=null;for(l in a)if(r=a[l],a.hasOwnProperty(l)&&r!=null&&!n.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ze(e,t,l,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(N(91));break;default:r!==o&&Ze(e,t,i,r,n,o)}$b(e,f,p);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:Ze(e,t,m,null,n,f));for(s in n)f=n[s],p=a[s],n.hasOwnProperty(s)&&f!==p&&(f!=null||p!=null)&&(s==="selected"?e.selected=f&&typeof f!="function"&&typeof f!="symbol":Ze(e,t,s,f,n,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&Ze(e,t,x,null,n,f);for(u in n)if(f=n[u],p=a[u],n.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(N(137,t));break;default:Ze(e,t,u,f,n,p)}return;default:if(rh(t)){for(var I in a)f=a[I],a.hasOwnProperty(I)&&f!==void 0&&!n.hasOwnProperty(I)&&Hm(e,t,I,void 0,n,f);for(c in n)f=n[c],p=a[c],!n.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Hm(e,t,c,f,n,p);return}}for(var y in a)f=a[y],a.hasOwnProperty(y)&&f!=null&&!n.hasOwnProperty(y)&&Ze(e,t,y,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||Ze(e,t,d,f,n,p)}function ub(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bP(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,l=r.duration;if(o&&l&&ub(i)){for(i=0,l=r.responseEnd,n+=1;n<a.length;n++){var s=a[n],u=s.startTime;if(u>l)break;var c=s.transferSize,d=s.initiatorType;c&&ub(d)&&(s=s.responseEnd,i+=c*(s<l?1:(l-u)/(s-u)))}if(--n,t+=8*(o+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var jm=null,Vm=null;function Nc(e){return e.nodeType===9?e:e.ownerDocument}function cb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function J0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tm=null;function SP(){var e=window.event;return e&&e.type==="popstate"?e===tm?!1:(tm=e,!0):(tm=null,!1)}var eI=typeof setTimeout=="function"?setTimeout:void 0,IP=typeof clearTimeout=="function"?clearTimeout:void 0,db=typeof Promise=="function"?Promise:void 0,CP=typeof queueMicrotask=="function"?queueMicrotask:typeof db<"u"?function(e){return db.resolve(null).then(e).catch(kP)}:eI;function kP(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function fb(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),Ri(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")ql(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ql(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[is]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&ql(e.ownerDocument.body);a=r}while(a);Ri(t)}function pb(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Wm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Wm(a),nh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function LP(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[is])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Wa(e.nextSibling),e===null)break}return null}function TP(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Wa(e.nextSibling),e===null))return null;return e}function tI(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Wa(e.nextSibling),e===null))return null;return e}function $m(e){return e.data==="$?"||e.data==="$~"}function Xm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function EP(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Wa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Km=null;function mb(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Wa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function hb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function aI(e,t,a){switch(t=Nc(a),e){case"html":if(e=t.documentElement,!e)throw Error(N(452));return e;case"head":if(e=t.head,!e)throw Error(N(453));return e;case"body":if(e=t.body,!e)throw Error(N(454));return e;default:throw Error(N(451))}}function ql(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nh(e)}var $a=new Map,gb=new Set;function Bc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xn=Ue.d;Ue.d={f:MP,r:AP,D:RP,C:DP,L:_P,m:OP,X:NP,S:PP,M:BP};function MP(){var e=Xn.f(),t=ed();return e||t}function AP(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?KS(t):Xn.r(e)}var Bi=typeof document>"u"?null:document;function nI(e,t,a){var n=Bi;if(n&&typeof t=="string"&&t){var r=Ha(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),gb.has(r)||(gb.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function RP(e){Xn.D(e),nI("dns-prefetch",e,null)}function DP(e,t){Xn.C(e,t),nI("preconnect",e,t)}function _P(e,t,a){Xn.L(e,t,a);var n=Bi;if(n&&e&&t){var r='link[rel="preload"][as="'+Ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Ha(a.imageSizes)+'"]')):r+='[href="'+Ha(e)+'"]';var o=r;switch(t){case"style":o=Ai(e);break;case"script":o=Ui(e)}$a.has(o)||(e=st({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$a.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(fs(o))||t==="script"&&n.querySelector(ps(o))||(t=n.createElement("link"),Xt(t,"link",e),qt(t),n.head.appendChild(t)))}}function OP(e,t){Xn.m(e,t);var a=Bi;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ha(n)+'"][href="'+Ha(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ui(e)}if(!$a.has(o)&&(e=st({rel:"modulepreload",href:e},t),$a.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ps(o)))return}n=a.createElement("link"),Xt(n,"link",e),qt(n),a.head.appendChild(n)}}}function PP(e,t,a){Xn.S(e,t,a);var n=Bi;if(n&&e){var r=mi(n).hoistableStyles,o=Ai(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(fs(o)))l.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$a.get(o))&&Hh(e,a);var s=i=n.createElement("link");qt(s),Xt(s,"link",e),s._p=new Promise(function(u,c){s.onload=u,s.onerror=c}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,uc(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function NP(e,t){Xn.X(e,t);var a=Bi;if(a&&e){var n=mi(a).hoistableScripts,r=Ui(e),o=n.get(r);o||(o=a.querySelector(ps(r)),o||(e=st({src:e,async:!0},t),(t=$a.get(r))&&jh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function BP(e,t){Xn.M(e,t);var a=Bi;if(a&&e){var n=mi(a).hoistableScripts,r=Ui(e),o=n.get(r);o||(o=a.querySelector(ps(r)),o||(e=st({src:e,async:!0,type:"module"},t),(t=$a.get(r))&&jh(e,t),o=a.createElement("script"),qt(o),Xt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function yb(e,t,a,n){var r=(r=Sr.current)?Bc(r):null;if(!r)throw Error(N(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ai(a.href),a=mi(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ai(a.href);var o=mi(r).hoistableStyles,i=o.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=r.querySelector(fs(e)))&&!o._p&&(i.instance=o,i.state.loading=5),$a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},$a.set(e,a),o||UP(r,e,a,i.state))),t&&n===null)throw Error(N(528,""));return i}if(t&&n!==null)throw Error(N(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ui(a),a=mi(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Ai(e){return'href="'+Ha(e)+'"'}function fs(e){return'link[rel="stylesheet"]['+e+"]"}function rI(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function UP(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Xt(t,"link",a),qt(t),e.head.appendChild(t))}function Ui(e){return'[src="'+Ha(e)+'"]'}function ps(e){return"script[async]"+e}function wb(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ha(a.href)+'"]');if(n)return t.instance=n,qt(n),n;var r=st({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),qt(n),Xt(n,"style",r),uc(n,a.precedence,e),t.instance=n;case"stylesheet":r=Ai(a.href);var o=e.querySelector(fs(r));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;n=rI(a),(r=$a.get(r))&&Hh(n,r),o=(e.ownerDocument||e).createElement("link"),qt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),t.state.loading|=4,uc(o,a.precedence,e),t.instance=o;case"script":return o=Ui(a.src),(r=e.querySelector(ps(o)))?(t.instance=r,qt(r),r):(n=a,(r=$a.get(o))&&(n=st({},a),jh(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),qt(r),Xt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(N(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,uc(n,a.precedence,e));return t.instance}function uc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var l=n[i];if(l.dataset.precedence===t)o=l;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Hh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cc=null;function xb(e,t,a){if(cc===null){var n=new Map,r=cc=new Map;r.set(a,n)}else r=cc,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[is]||o[Gt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var l=n.get(i);l?l.push(o):n.set(i,[o])}}return n}function vb(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function FP(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function oI(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function zP(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Ai(n.href),o=t.querySelector(fs(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Uc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,qt(o);return}o=t.ownerDocument||t,n=rI(n),(r=$a.get(r))&&Hh(n,r),o=o.createElement("link"),qt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Xt(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Uc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var am=0;function qP(e,t){return e.stylesheets&&e.count===0&&dc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&am===0&&(am=62500*bP());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>am?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fc=null;function dc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fc=new Map,t.forEach(HP,e),Fc=null,Uc.call(e))}function HP(e,t){if(!(t.state.loading&4)){var a=Fc.get(e);if(a)var n=a.get(null);else{a=new Map,Fc.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var i=r[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),n=i)}n&&a.set(null,n)}r=t.instance,i=r.getAttribute("data-precedence"),o=a.get(i)||n,o===n&&a.set(null,r),a.set(i,r),this.count++,n=Uc.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Jl={$$typeof:Bn,Provider:null,Consumer:null,_currentValue:so,_currentValue2:so,_threadCount:0};function jP(e,t,a,n,r,o,i,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ep(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ep(0),this.hiddenUpdates=Ep(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function iI(e,t,a,n,r,o,i,l,s,u,c,d){return e=new jP(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ca(3,null,null,t),e.current=o,o.stateNode=e,t=hh(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},wh(o),e}function lI(e){return e?(e=ci,e):ci}function sI(e,t,a,n,r,o){r=lI(r),n.context===null?n.context=r:n.pendingContext=r,n=Cr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=kr(e,n,t),a!==null&&(ma(a,e,t),_l(a,e,t))}function bb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Vh(e,t){bb(e,t),(e=e.alternate)&&bb(e,t)}function uI(e){if(e.tag===13||e.tag===31){var t=So(e,67108864);t!==null&&ma(t,e,67108864),Vh(e,67108864)}}function Sb(e){if(e.tag===13||e.tag===31){var t=Ma();t=th(t);var a=So(e,t);a!==null&&ma(a,e,t),Vh(e,t)}}var zc=!0;function VP(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=2,Gh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function GP(e,t,a,n){var r=ie.T;ie.T=null;var o=Ue.p;try{Ue.p=8,Gh(e,t,a,n)}finally{Ue.p=o,ie.T=r}}function Gh(e,t,a,n){if(zc){var r=Zm(n);if(r===null)em(e,t,n,qc,a),Ib(e,n);else if($P(r,e,t,a,n))n.stopPropagation();else if(Ib(e,n),t&4&&-1<WP.indexOf(e)){for(;r!==null;){var o=_i(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=oo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-Ea(i);l.entanglements[1]|=s,i&=~s}bn(o),(Be&6)===0&&(Ac=La()+500,ds(0,!1))}}break;case 31:case 13:l=So(o,2),l!==null&&ma(l,o,2),ed(),Vh(o,2)}if(o=Zm(n),o===null&&em(e,t,n,qc,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else em(e,t,n,null,a)}}function Zm(e){return e=oh(e),Wh(e)}var qc=null;function Wh(e){if(qc=null,e=ri(e),e!==null){var t=as(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Mb(t),e!==null)return e;e=null}else if(a===31){if(e=Ab(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qc=e,null}function cI(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(__()){case Ob:return 2;case Pb:return 8;case gc:case O_:return 32;case Nb:return 268435456;default:return 32}default:return 32}}var Ym=!1,Er=null,Mr=null,Ar=null,es=new Map,ts=new Map,gr=[],WP="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 Ib(e,t){switch(e){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function Sl(e,t,a,n,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},t!==null&&(t=_i(t),t!==null&&uI(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function $P(e,t,a,n,r){switch(t){case"focusin":return Er=Sl(Er,e,t,a,n,r),!0;case"dragenter":return Mr=Sl(Mr,e,t,a,n,r),!0;case"mouseover":return Ar=Sl(Ar,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return es.set(o,Sl(es.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,ts.set(o,Sl(ts.get(o)||null,e,t,a,n,r)),!0}return!1}function dI(e){var t=ri(e.target);if(t!==null){var a=as(t);if(a!==null){if(t=a.tag,t===13){if(t=Mb(a),t!==null){e.blockedOn=t,iv(e.priority,function(){Sb(a)});return}}else if(t===31){if(t=Ab(a),t!==null){e.blockedOn=t,iv(e.priority,function(){Sb(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Zm(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);hm=n,a.target.dispatchEvent(n),hm=null}else return t=_i(a),t!==null&&uI(t),e.blockedOn=a,!1;t.shift()}return!0}function Cb(e,t,a){fc(e)&&a.delete(t)}function XP(){Ym=!1,Er!==null&&fc(Er)&&(Er=null),Mr!==null&&fc(Mr)&&(Mr=null),Ar!==null&&fc(Ar)&&(Ar=null),es.forEach(Cb),ts.forEach(Cb)}function Zu(e,t){e.blockedOn===t&&(e.blockedOn=null,Ym||(Ym=!0,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,XP)))}var Yu=null;function kb(e){Yu!==e&&(Yu=e,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,function(){Yu===e&&(Yu=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(Wh(n||a)===null)continue;break}var o=_i(a);o!==null&&(e.splice(t,3),t-=3,Rm(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Ri(e){function t(s){return Zu(s,e)}Er!==null&&Zu(Er,e),Mr!==null&&Zu(Mr,e),Ar!==null&&Zu(Ar,e),es.forEach(t),ts.forEach(t);for(var a=0;a<gr.length;a++){var n=gr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<gr.length&&(a=gr[0],a.blockedOn===null);)dI(a),a.blockedOn===null&&gr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[ha]||null;if(typeof o=="function")i||kb(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[ha]||null)l=i.formAction;else if(Wh(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),kb(a)}}}function fI(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function $h(e){this._internalRoot=e}nd.prototype.render=$h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));var a=t.current,n=Ma();sI(a,n,e,t,null,null)};nd.prototype.unmount=$h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sI(e.current,2,null,e,null,null),ed(),t[Di]=null}};function nd(e){this._internalRoot=e}nd.prototype.unstable_scheduleHydration=function(e){if(e){var t=qb();e={blockedOn:null,target:e,priority:t};for(var a=0;a<gr.length&&t!==0&&t<gr[a].priority;a++);gr.splice(a,0,e),a===0&&dI(e)}};var Lb=Tb.version;if(Lb!=="19.2.4")throw Error(N(527,Lb,"19.2.4"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=L_(t),e=e!==null?Rb(e):null,e=e===null?null:e.stateNode,e};var KP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ie,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Il=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Il.isDisabled&&Il.supportsFiber))try{ns=Il.inject(KP),Ta=Il}catch{}var Il;rd.createRoot=function(e,t){if(!Eb(e))throw Error(N(299));var a=!1,n="",r=n0,o=r0,i=o0;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=iI(e,1,!1,null,null,a,n,null,r,o,i,fI),e[Di]=t.current,qh(e),new $h(t)};rd.hydrateRoot=function(e,t,a){if(!Eb(e))throw Error(N(299));var n=!1,r="",o=n0,i=r0,l=o0,s=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(s=a.formState)),t=iI(e,1,!0,t,a??null,n,r,s,o,i,l,fI),t.context=lI(null),a=t.current,n=Ma(),n=th(n),r=Cr(n),r.callback=null,kr(a,r,n),a=n,t.current.lanes=a,os(t,a),bn(t),e[Di]=t.current,qh(e),new nd(t)};rd.version="19.2.4"});var gI=Kt((x8,hI)=>{"use strict";function mI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mI)}catch(e){console.error(e)}}mI(),hI.exports=pI()});var HI=Kt(dd=>{"use strict";var QN=Symbol.for("react.transitional.element"),JN=Symbol.for("react.fragment");function qI(e,t,a){var n=null;if(a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),"key"in t){a={};for(var r in t)r!=="key"&&(a[r]=t[r])}else a=t;return t=a.ref,{$$typeof:QN,type:e,key:n,ref:t!==void 0?t:null,props:a}}dd.Fragment=JN;dd.jsx=qI;dd.jsxs=qI});var ne=Kt((a7,jI)=>{"use strict";jI.exports=HI()});function GI(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=GI(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function fd(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=GI(e))&&(n&&(n+=" "),n+=t);return n}var lg=C(()=>{"use strict"});function sg(...e){return e.filter(Boolean).join(" ")}function WI(){return sg}var ug=C(()=>{"use strict"});function wB(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Fr(e[a]);return wd(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function xB(e){let t=e;return wd(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function vB(e){return wd(t);function t(a){return a&&a.type===e}}function wd(e){return t;function t(a,n,r){return!!(SB(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function bB(){return!0}function SB(e){return e!==null&&typeof e=="object"&&"type"in e}var Fr,bC=C(()=>{"use strict";Fr=(function(e){if(e==null)return bB;if(typeof e=="function")return wd(e);if(typeof e=="object")return Array.isArray(e)?wB(e):xB(e);if(typeof e=="string")return vB(e);throw new Error("Expected function, string, or object as test")})});var xd=C(()=>{"use strict";bC()});function Os(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Fr(r),i=n?-1:1;l(e,void 0,[])();function l(s,u,c){let d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){let p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=SC,m,x,I;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=IB(a(s,c)),p[0]===To))return p;if("children"in s&&s.children){let y=s;if(y.children&&p[0]!==Eo)for(x=(n?y.children.length:-1)+i,I=c.concat(y);x>-1&&x<y.children.length;){let w=y.children[x];if(m=l(w,x,I)(),m[0]===To)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function IB(e){return Array.isArray(e)?e:typeof e=="number"?[Qn,e]:e==null?SC:[e]}var SC,Qn,To,Eo,IC=C(()=>{"use strict";xd();SC=[],Qn=!0,To=!1,Eo="skip"});var vd=C(()=>{"use strict";IC()});function Jn(e,t,a,n){let r,o,i;typeof t=="function"&&typeof a!="function"?(o=void 0,i=t,r=a):(o=t,i=a,r=n),Os(e,o,l,r);function l(s,u){let c=u[u.length-1],d=c?c.children.indexOf(s):void 0;return i(s,d,c)}}var CC=C(()=>{"use strict";vd();vd()});var bd=C(()=>{"use strict";CC()});function TC({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:a=[],allowDataImages:n=!1,allowedProtocols:r=[],blockedImageClass:o="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:i="text-gray-500"}){let l=t.length&&!t.every(u=>u==="*"),s=a.length&&!a.every(u=>u==="*");if(!e&&(l||s))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=TB(e,t,a,n,r,o,i);Jn(u,c)}}function kC(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function CB(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function LC(e,t,a,n=!1,r=!1,o=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!r)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return r&&n&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){let c=e.substring(5);if(c&&c.length>0&&c!=="invalid")return e}}catch{return null}return null}let i=kC(e,a);if(!i||LB.has(i.protocol)||!(kB.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=CB(e);return i&&t.some(u=>{let c=kC(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?s?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:s?i.pathname+i.search+i.hash:i.href:null}var kB,LB,mg,TB,EC=C(()=>{"use strict";bd();kB=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),LB=new Set(["javascript:","data:","file:","vbscript:"]);mg=Symbol("node-seen"),TB=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[mg])return Qn;if(s.tagName==="a"){let d=LC(s.properties.href,t,e,!1,!1,r);return d===null?(s[mg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(s.properties.href),class:i},children:[...s.children,{type:"text",value:" [blocked]"}]}),Eo):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",Qn)}if(s.tagName==="img"){let d=LC(s.properties.src,a,e,n,!0,r);return d===null?(s[mg]=!0,Jn(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(s.properties.alt||"No description")+"]"}]}),Eo):(s.properties.src=d,Qn)}return Qn};return l}});function EB(){return e=>e}var MC,AC=C(()=>{"use strict";MC=EB});var RC,DB,yg,NC=C(()=>{"use strict";RC=typeof self=="object"?self:globalThis,DB=(e,t)=>{let a=(r,o)=>(e.set(o,r),r),n=r=>{if(e.has(r))return e.get(r);let[o,i]=t[r];switch(o){case 0:case-1:return a(i,r);case 1:{let l=a([],r);for(let s of i)l.push(n(s));return l}case 2:{let l=a({},r);for(let[s,u]of i)l[n(s)]=n(u);return l}case 3:return a(new Date(i),r);case 4:{let{source:l,flags:s}=i;return a(new RegExp(l,s),r)}case 5:{let l=a(new Map,r);for(let[s,u]of i)l.set(n(s),n(u));return l}case 6:{let l=a(new Set,r);for(let s of i)l.add(n(s));return l}case 7:{let{name:l,message:s}=i;return a(new RC[l](s),r)}case 8:return a(BigInt(i),r);case"BigInt":return a(Object(BigInt(i)),r);case"ArrayBuffer":return a(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:l}=new Uint8Array(i);return a(new DataView(l),i)}}return a(new RC[o](i),r)};return n},yg=e=>DB(new Map,e)(0)});var Gi,_B,OB,Ps,Id,PB,wg,BC=C(()=>{"use strict";Gi="",{toString:_B}={},{keys:OB}=Object,Ps=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=_B.call(e).slice(8,-1);switch(a){case"Array":return[1,Gi];case"Object":return[2,Gi];case"Date":return[3,Gi];case"RegExp":return[4,Gi];case"Map":return[5,Gi];case"Set":return[6,Gi];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},Id=([e,t])=>e===0&&(t==="function"||t==="symbol"),PB=(e,t,a,n)=>{let r=(i,l)=>{let s=n.push(i)-1;return a.set(l,s),s},o=i=>{if(a.has(i))return a.get(i);let[l,s]=Ps(i);switch(l){case 0:{let c=i;switch(s){case"bigint":l=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return r([-1],i)}return r([l,c],i)}case 1:{if(s){let f=i;return s==="DataView"?f=new Uint8Array(i.buffer):s==="ArrayBuffer"&&(f=new Uint8Array(i)),r([s,[...f]],i)}let c=[],d=r([l,c],i);for(let f of i)c.push(o(f));return d}case 2:{if(s)switch(s){case"BigInt":return r([s,i.toString()],i);case"Boolean":case"Number":case"String":return r([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([l,c],i);for(let f of OB(i))(e||!Id(Ps(i[f])))&&c.push([o(f),o(i[f])]);return d}case 3:return r([l,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([l,{source:c,flags:d}],i)}case 5:{let c=[],d=r([l,c],i);for(let[f,p]of i)(e||!(Id(Ps(f))||Id(Ps(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!Id(Ps(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},wg=(e,{json:t,lossy:a}={})=>{let n=[];return PB(!(t||a),!!t,new Map,n)(e),n}});var zr,Cd=C(()=>{"use strict";NC();BC();zr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yg(wg(e,t)):structuredClone(e):(e,t)=>yg(wg(e,t))});function UC(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Ns(e){let t=Wi(e),a=kd(e);if(t&&a)return{start:t,end:a}}var kd,Wi,FC=C(()=>{"use strict";kd=UC("end"),Wi=UC("start")});var Bs=C(()=>{"use strict";FC()});var Mo,xg,zC=C(()=>{"use strict";Mo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],xg={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Mo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Mo],h2:[["className","sr-only"]],img:[...Mo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Mo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Mo],table:[...Mo],ul:[...Mo,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]}});function vg(e,t){let a={type:"root",children:[]},n={schema:t?{...xg,...t}:xg,stack:[]},r=jC(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function jC(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return NB(e,a);case"doctype":return BB(e,a);case"element":return UB(e,a);case"root":return FB(e,a);case"text":return zB(e,a);default:}}}function NB(e,t){if(e.schema.allowComments){let a=typeof t.value=="string"?t.value:"",n=a.indexOf("-->"),o={type:"comment",value:n<0?a:a.slice(0,n)};return Us(o,t),o}}function BB(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return Us(a,t),a}}function UB(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=VC(e,t.children),r=qB(e,t.properties);e.stack.pop();let o=!1;if(a&&a!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(a))&&(o=!0,e.schema.ancestors&&qr.call(e.schema.ancestors,a))){let l=e.schema.ancestors[a],s=-1;for(o=!1;++s<l.length;)e.stack.includes(l[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?n:void 0;let i={type:"element",tagName:a,properties:r,children:n};return Us(i,t),i}function FB(e,t){let n={type:"root",children:VC(e,t.children)};return Us(n,t),n}function zB(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return Us(n,t),n}function VC(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=jC(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function qB(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&qr.call(n,a)?n[a]:void 0,i=n&&qr.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(qr.call(l,u)){let c=l[u],d=qC(e,HC(o,u),u,c);d==null&&(d=qC(e,HC(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&qr.call(r,a)){let c=r[a];for(u in c)qr.call(c,u)&&!qr.call(s,u)&&(s[u]=c[u])}return s}function qC(e,t,a,n){return t?Array.isArray(n)?HB(e,t,a,n):GC(e,t,a,n):void 0}function HB(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=GC(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function GC(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&jB(e,a,n)){if(typeof t=="object"&&t.length>1){let r=!1,o=0;for(;++o<t.length;){let i=t[o];if(i&&typeof i=="object"&&"flags"in i){if(i.test(String(n))){r=!0;break}}else if(i===n){r=!0;break}}if(!r)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(a)?e.schema.clobberPrefix+n:n}}function jB(e,t,a){let n=e.schema.protocols&&qr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!n||n.length===0)return!0;let r=String(a),o=r.indexOf(":"),i=r.indexOf("?"),l=r.indexOf("#"),s=r.indexOf("/");if(o<0||s>-1&&o>s||i>-1&&o>i||l>-1&&o>l)return!0;let u=-1;for(;++u<n.length;){let c=n[u];if(o===c.length&&r.slice(0,c.length)===c)return!0}return!1}function Us(e,t){let a=Ns(t);t.data&&(e.data=zr(t.data)),a&&(e.position=a)}function HC(e,t){let a,n=-1;if(e)for(;++n<e.length;){let r=e[n],o=typeof r=="string"?r:r[0];if(o===t)return r;o==="data*"&&(a=r)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return a}var qr,WC=C(()=>{"use strict";Cd();Bs();zC();qr={}.hasOwnProperty});var $C=C(()=>{"use strict";WC()});function Ld(e){return function(t){return vg(t,e)}}var XC=C(()=>{"use strict";$C()});var KC=C(()=>{"use strict";XC()});function bg(e,t){let a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,r=a.indexOf(t);for(;r!==-1;)n++,r=a.indexOf(t,r+t.length);return n}var ZC=C(()=>{"use strict"});function Ao(e){return e!==null&&(e<32||e===127)}function G(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}function Hr(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var Nt,wt,YC,Fs,QC,JC,Ro,In,Ae=C(()=>{"use strict";Nt=Hr(/[A-Za-z]/),wt=Hr(/[\dA-Za-z]/),YC=Hr(/[#-'*+\--9=?A-Z^-~]/);Fs=Hr(/\d/),QC=Hr(/[\dA-Fa-f]/),JC=Hr(/[!-/:-@[-`{-~]/);Ro=Hr(/\p{P}|\p{S}/u),In=Hr(/\s/)});function Sg(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ek=C(()=>{"use strict"});function Ig(e,t,a){let r=Fr((a||{}).ignore||[]),o=VB(t),i=-1;for(;++i<o.length;)Os(e,"text",l);function l(u,c){let d=-1,f;for(;++d<c.length;){let p=c[d],m=f?f.children:void 0;if(r(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return s(u,c)}function s(u,c){let d=c[c.length-1],f=o[i][0],p=o[i][1],m=0,I=d.children.indexOf(u),y=!1,w=[];f.lastIndex=0;let g=f.exec(u.value);for(;g;){let b=g.index,T={index:g.index,input:g.input,stack:[...c,u]},S=p(...g,T);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=b+1:(m!==b&&w.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=b+g[0].length,y=!0),!f.global)break;g=f.exec(u.value)}return y?(m<u.value.length&&w.push({type:"text",value:u.value.slice(m)}),d.children.splice(I,1,...w)):w=[u],I+w.length}}function VB(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<a.length;){let r=a[n];t.push([GB(r[0]),WB(r[1])])}return t}function GB(e){return typeof e=="string"?new RegExp(Sg(e),"g"):e}function WB(e){return typeof e=="function"?e:function(){return e}}var tk=C(()=>{"use strict";ek();vd();xd()});var ak=C(()=>{"use strict";tk()});function Tg(){return{transforms:[QB],enter:{literalAutolink:$B,literalAutolinkEmail:Lg,literalAutolinkHttp:Lg,literalAutolinkWww:Lg},exit:{literalAutolink:YB,literalAutolinkEmail:ZB,literalAutolinkHttp:XB,literalAutolinkWww:KB}}}function Eg(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Cg,notInConstruct:kg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Cg,notInConstruct:kg},{character:":",before:"[ps]",after:"\\/",inConstruct:Cg,notInConstruct:kg}]}}function $B(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lg(e){this.config.enter.autolinkProtocol.call(this,e)}function XB(e){this.config.exit.autolinkProtocol.call(this,e)}function KB(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ZB(e){this.config.exit.autolinkEmail.call(this,e)}function YB(e){this.exit(e)}function QB(e){Ig(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,e3]],{ignore:["link","linkReference"]})}function JB(e,t,a,n,r){let o="";if(!nk(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!t3(a)))return!1;let i=a3(a+n);if(!i[0])return!1;let l={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[l,{type:"text",value:i[1]}]:l}function e3(e,t,a,n){return!nk(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function t3(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function a3(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],n=a.indexOf(")"),r=bg(e,"("),o=bg(e,")");for(;n!==-1&&r>o;)e+=a.slice(0,n+1),a=a.slice(n+1),n=a.indexOf(")"),o++;return[e,a]}function nk(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||In(a)||Ro(a))&&(!t||a!==47)}var Cg,kg,rk=C(()=>{"use strict";ZC();Ae();ak();Cg="phrasing",kg=["autolink","link","image","label"]});var ok=C(()=>{"use strict";rk()});function Yt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var $i=C(()=>{"use strict"});function n3(){this.buffer()}function r3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function o3(){this.buffer()}function i3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function l3(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Yt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function s3(e){this.exit(e)}function u3(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Yt(this.sliceSerialize(e)).toLowerCase(),a.label=t}function c3(e){this.exit(e)}function d3(){return"["}function ik(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),l=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),l(),i(),o+=r.move("]"),o}function Mg(){return{enter:{gfmFootnoteCallString:n3,gfmFootnoteCall:r3,gfmFootnoteDefinitionLabelString:o3,gfmFootnoteDefinition:i3},exit:{gfmFootnoteCallString:l3,gfmFootnoteCall:s3,gfmFootnoteDefinitionLabelString:u3,gfmFootnoteDefinition:c3}}}function Ag(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:ik},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let l=o.createTracker(i),s=l.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return s+=l.move(o.safe(o.associationId(n),{before:s,after:"]"})),c(),s+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),s+=l.move((t?`
|
|
10
|
+
`:" ")+o.indentLines(o.containerFlow(n,l.current()),t?lk:f3))),u(),s}}function f3(e,t,a){return t===0?e:lk(e,t,a)}function lk(e,t,a){return(a?"":" ")+e}var sk=C(()=>{"use strict";$i();ik.peek=d3});var uk=C(()=>{"use strict";sk()});function Rg(){return{canContainEols:["delete"],enter:{strikethrough:m3},exit:{strikethrough:h3}}}function Dg(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p3}],handlers:{delete:ck}}}function m3(e){this.enter({type:"delete",children:[]},e)}function h3(e){this.exit(e)}function ck(e,t,a,n){let r=a.createTracker(n),o=a.enter("strikethrough"),i=r.move("~~");return i+=a.containerPhrasing(e,{...r.current(),before:i,after:"~"}),i+=r.move("~~"),o(),i}function g3(){return"~"}var p3,dk=C(()=>{"use strict";p3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ck.peek=g3});var fk=C(()=>{"use strict";dk()});function y3(e){return e.length}function mk(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||y3,o=[],i=[],l=[],s=[],u=0,c=-1;for(;++c<e.length;){let x=[],I=[],y=-1;for(e[c].length>u&&(u=e[c].length);++y<e[c].length;){let w=w3(e[c][y]);if(a.alignDelimiters!==!1){let g=r(w);I[y]=g,(s[y]===void 0||g>s[y])&&(s[y]=g)}x.push(w)}i[c]=x,l[c]=I}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)o[d]=pk(n[d]);else{let x=pk(n);for(;++d<u;)o[d]=x}d=-1;let f=[],p=[];for(;++d<u;){let x=o[d],I="",y="";x===99?(I=":",y=":"):x===108?I=":":x===114&&(y=":");let w=a.alignDelimiters===!1?1:Math.max(1,s[d]-I.length-y.length),g=I+"-".repeat(w)+y;a.alignDelimiters!==!1&&(w=I.length+w+y.length,w>s[d]&&(s[d]=w),p[d]=w),f[d]=g}i.splice(1,0,f),l.splice(1,0,p),c=-1;let m=[];for(;++c<i.length;){let x=i[c],I=l[c];d=-1;let y=[];for(;++d<u;){let w=x[d]||"",g="",b="";if(a.alignDelimiters!==!1){let T=s[d]-(I[d]||0),S=o[d];S===114?g=" ".repeat(T):S===99?T%2?(g=" ".repeat(T/2+.5),b=" ".repeat(T/2-.5)):(g=" ".repeat(T/2),b=g):b=" ".repeat(T)}a.delimiterStart!==!1&&!d&&y.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&w==="")&&(a.delimiterStart!==!1||d)&&y.push(" "),a.alignDelimiters!==!1&&y.push(g),y.push(w),a.alignDelimiters!==!1&&y.push(b),a.padding!==!1&&y.push(" "),(a.delimiterEnd!==!1||d!==u-1)&&y.push("|")}m.push(a.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
|
|
11
|
+
`)}function w3(e){return e==null?"":String(e)}function pk(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var hk=C(()=>{"use strict"});function gk(e,t,a,n){let r=a.enter("blockquote"),o=a.createTracker(n);o.move("> "),o.shift(2);let i=a.indentLines(a.containerFlow(e,o.current()),x3);return r(),i}function x3(e,t,a){return">"+(a?"":" ")+e}var yk=C(()=>{"use strict"});function xk(e,t){return wk(e,t.inConstruct,!0)&&!wk(e,t.notInConstruct,!1)}function wk(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}var vk=C(()=>{"use strict"});function _g(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&xk(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var bk=C(()=>{"use strict";vk()});function Sk(e,t){let a=String(e),n=a.indexOf(t),r=n,o=0,i=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===r?++o>i&&(i=o):o=1,r=n+t.length,n=a.indexOf(t,r);return i}var Ik=C(()=>{"use strict"});function Ck(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var kk=C(()=>{"use strict"});function Lk(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var Tk=C(()=>{"use strict"});function Ek(e,t,a,n){let r=Lk(a),o=e.value||"",i=r==="`"?"GraveAccent":"Tilde";if(Ck(e,a)){let d=a.enter("codeIndented"),f=a.indentLines(o,v3);return d(),f}let l=a.createTracker(n),s=r.repeat(Math.max(Sk(o,r)+1,3)),u=a.enter("codeFenced"),c=l.move(s);if(e.lang){let d=a.enter(`codeFencedLang${i}`);c+=l.move(a.safe(e.lang,{before:c,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){let d=a.enter(`codeFencedMeta${i}`);c+=l.move(" "),c+=l.move(a.safe(e.meta,{before:c,after:`
|
|
14
14
|
`,encode:["`"],...l.current()})),d()}return c+=l.move(`
|
|
15
15
|
`),o&&(c+=l.move(o+`
|
|
16
|
-
`)),c+=l.move(s),u(),c}function
|
|
17
|
-
`,...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),i(),u}var
|
|
16
|
+
`)),c+=l.move(s),u(),c}function v3(e,t,a){return(a?"":" ")+e}var Mk=C(()=>{"use strict";Ik();kk();Tk()});function Xi(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var Td=C(()=>{"use strict"});function Ak(e,t,a,n){let r=Xi(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("definition"),l=a.enter("label"),s=a.createTracker(n),u=s.move("[");return u+=s.move(a.safe(a.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":`
|
|
17
|
+
`,...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),i(),u}var Rk=C(()=>{"use strict";Td()});function Dk(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var _k=C(()=>{"use strict"});function jr(e){return"&#x"+e.toString(16).toUpperCase()+";"}var Ed=C(()=>{"use strict"});function er(e){if(e===null||we(e)||In(e))return 1;if(Ro(e))return 2}var Md=C(()=>{"use strict";Ae()});function Ki(e,t,a){let n=er(e),r=er(t);return n===void 0?r===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var Og=C(()=>{"use strict";Md()});function Pg(e,t,a,n){let r=Dk(a),o=a.enter("emphasis"),i=a.createTracker(n),l=i.move(r),s=i.move(a.containerPhrasing(e,{after:r,before:l,...i.current()})),u=s.charCodeAt(0),c=Ki(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=Ki(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=i.move(r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function b3(e,t,a){return a.options.emphasis||"*"}var Ok=C(()=>{"use strict";_k();Ed();Og();Pg.peek=b3});function Do(e,t){let a=t||S3,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Nk(e,n,r)}function Nk(e,t,a){if(I3(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Pk(e.children,t,a)}return Array.isArray(e)?Pk(e,t,a):""}function Pk(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=Nk(e[r],t,a);return n.join("")}function I3(e){return!!(e&&typeof e=="object")}var S3,Bk=C(()=>{"use strict";S3={}});var Ad=C(()=>{"use strict";Bk()});function Uk(e,t){let a=!1;return Jn(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,To}),!!((!e.depth||e.depth<3)&&Do(e)&&(t.options.setext||a))}var Fk=C(()=>{"use strict";bd();Ad()});function zk(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(Uk(e,a)){let c=a.enter("headingSetext"),d=a.enter("phrasing"),f=a.containerPhrasing(e,{...o.current(),before:`
|
|
18
18
|
`,after:`
|
|
19
19
|
`});return d(),c(),f+`
|
|
20
20
|
`+(r===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
21
21
|
`))+1))}let i="#".repeat(r),l=a.enter("headingAtx"),s=a.enter("phrasing");o.move(i+" ");let u=a.containerPhrasing(e,{before:"# ",after:`
|
|
22
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=jr(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var Ak=C(()=>{"use strict";Cd();Ek()});function Mg(e){return e.value||""}function s3(){return"<"}var Rk=C(()=>{"use strict";Mg.peek=s3});function Ag(e,t,a,n){let r=Wi(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),l=a.enter("label"),s=a.createTracker(n),u=s.move("![");return u+=s.move(a.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),u+=s.move(")"),i(),u}function u3(){return"!"}var Dk=C(()=>{"use strict";Id();Ag.peek=u3});function Rg(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("!["),u=a.safe(e.alt,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function c3(){return"!"}var _k=C(()=>{"use strict";Rg.peek=c3});function Dg(e,t,a){let n=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(n);)r+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<a.unsafe.length;){let i=a.unsafe[o],l=a.compilePattern(i),s;if(i.atBreak)for(;s=l.exec(n);){let u=s.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(s.index+1)}}return r+n+r}function d3(){return"`"}var Ok=C(()=>{"use strict";Dg.peek=d3});function _g(e,t){let a=Ro(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Pk=C(()=>{"use strict";Ld()});function Og(e,t,a,n){let r=Wi(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(_g(e,a)){let c=a.stack;a.stack=[],l=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),l(),a.stack=c,d}l=a.enter("link"),s=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(s=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),s(),e.title&&(s=a.enter(`title${o}`),u+=i.move(" "+r),u+=i.move(a.safe(e.title,{before:u,after:r,...i.current()})),u+=i.move(r),s()),u+=i.move(")"),l(),u}function f3(e,t,a){return _g(e,a)?"<":"["}var Nk=C(()=>{"use strict";Id();Pk();Og.peek=f3});function Pg(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("["),u=a.containerPhrasing(e,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function p3(){return"["}var Bk=C(()=>{"use strict";Pg.peek=p3});function Xi(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Td=C(()=>{"use strict"});function Uk(e){let t=Xi(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}var Fk=C(()=>{"use strict";Td()});function zk(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var qk=C(()=>{"use strict"});function Ed(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var Ng=C(()=>{"use strict"});function Hk(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?zk(a):Xi(a),l=e.ordered?i==="."?")":".":Uk(a),s=t&&a.bulletLastUsed?i===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(s=!0),Ed(a)===i&&c){let d=-1;for(;++d<e.children.length;){let f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(i=l),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var jk=C(()=>{"use strict";Td();Fk();qk();Ng()});function Vk(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var Gk=C(()=>{"use strict"});function Wk(e,t,a,n){let r=Vk(a),o=a.bulletCurrent||Xi(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let i=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);let l=a.createTracker(n);l.move(o+" ".repeat(i-o.length)),l.shift(i);let s=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,l.current()),c);return s(),u;function c(d,f,p){return f?(p?"":" ".repeat(i))+d:(p?o:o+" ".repeat(i-o.length))+d}}var $k=C(()=>{"use strict";Td();Gk()});function Xk(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var Kk=C(()=>{"use strict"});var Bg,Zk=C(()=>{"use strict";hd();Bg=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Qk=C(()=>{"use strict";Zk()});function Yk(e,t,a,n){return(e.children.some(function(i){return Bg(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var Jk=C(()=>{"use strict";Qk()});function e1(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var t1=C(()=>{"use strict"});function Ug(e,t,a,n){let r=e1(a),o=a.enter("strong"),i=a.createTracker(n),l=i.move(r+r),s=i.move(a.containerPhrasing(e,{after:r,before:l,...i.current()})),u=s.charCodeAt(0),c=$i(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=$i(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function m3(e,t,a){return a.options.strong||"*"}var a1=C(()=>{"use strict";t1();Cd();Tg();Ug.peek=m3});function n1(e,t,a,n){return a.safe(e.value,n)}var r1=C(()=>{"use strict"});function o1(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var i1=C(()=>{"use strict"});function l1(e,t,a){let n=(Ed(a)+(a.options.ruleSpaces?" ":"")).repeat(o1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var s1=C(()=>{"use strict";i1();Ng()});var Us,u1=C(()=>{"use strict";ik();ck();wk();vk();Ik();Ak();Rk();Dk();_k();Ok();Nk();Bk();jk();$k();Kk();Jk();a1();r1();s1();Us={blockquote:ok,break:Lg,code:yk,definition:xk,emphasis:Eg,hardBreak:Lg,heading:Mk,html:Mg,image:Ag,imageReference:Rg,inlineCode:Dg,link:Og,linkReference:Pg,list:Hk,listItem:Wk,paragraph:Xk,root:Yk,strong:Ug,text:n1,thematicBreak:l1}});function Ki(e){let t="&"+e+";";c1.innerHTML=t;let a=c1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var c1,Md=C(()=>{"use strict";c1=document.createElement("i")});function Ad(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}var Fg=C(()=>{"use strict"});function d1(e){return e.replace(h3,g3)}function g3(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Ad(a.slice(o?2:1),o?16:10)}return Ki(a)||e}var h3,f1=C(()=>{"use strict";Md();Fg();h3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var zg=C(()=>{"use strict";u1()});function Hg(){return{enter:{table:y3,tableData:p1,tableHeader:p1,tableRow:x3},exit:{codeText:v3,table:w3,tableData:qg,tableHeader:qg,tableRow:qg}}}function y3(e){let t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function w3(e){this.exit(e),this.data.inTable=void 0}function x3(e){this.enter({type:"tableRow",children:[]},e)}function qg(e){this.exit(e)}function p1(e){this.enter({type:"tableCell",children:[]},e)}function v3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b3));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function b3(e,t){return t==="|"?t:e}function jg(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
22
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=jr(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var qk=C(()=>{"use strict";Ed();Fk()});function Ng(e){return e.value||""}function C3(){return"<"}var Hk=C(()=>{"use strict";Ng.peek=C3});function Bg(e,t,a,n){let r=Xi(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),l=a.enter("label"),s=a.createTracker(n),u=s.move("![");return u+=s.move(a.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),u+=s.move(")"),i(),u}function k3(){return"!"}var jk=C(()=>{"use strict";Td();Bg.peek=k3});function Ug(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("!["),u=a.safe(e.alt,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function L3(){return"!"}var Vk=C(()=>{"use strict";Ug.peek=L3});function Fg(e,t,a){let n=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(n);)r+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<a.unsafe.length;){let i=a.unsafe[o],l=a.compilePattern(i),s;if(i.atBreak)for(;s=l.exec(n);){let u=s.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(s.index+1)}}return r+n+r}function T3(){return"`"}var Gk=C(()=>{"use strict";Fg.peek=T3});function zg(e,t){let a=Do(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Wk=C(()=>{"use strict";Ad()});function qg(e,t,a,n){let r=Xi(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(zg(e,a)){let c=a.stack;a.stack=[],l=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),l(),a.stack=c,d}l=a.enter("link"),s=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(s=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),s(),e.title&&(s=a.enter(`title${o}`),u+=i.move(" "+r),u+=i.move(a.safe(e.title,{before:u,after:r,...i.current()})),u+=i.move(r),s()),u+=i.move(")"),l(),u}function E3(e,t,a){return zg(e,a)?"<":"["}var $k=C(()=>{"use strict";Td();Wk();qg.peek=E3});function Hg(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("["),u=a.containerPhrasing(e,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function M3(){return"["}var Xk=C(()=>{"use strict";Hg.peek=M3});function Zi(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Rd=C(()=>{"use strict"});function Kk(e){let t=Zi(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}var Zk=C(()=>{"use strict";Rd()});function Yk(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var Qk=C(()=>{"use strict"});function Dd(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var jg=C(()=>{"use strict"});function Jk(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?Yk(a):Zi(a),l=e.ordered?i==="."?")":".":Kk(a),s=t&&a.bulletLastUsed?i===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(s=!0),Dd(a)===i&&c){let d=-1;for(;++d<e.children.length;){let f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(i=l),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var e1=C(()=>{"use strict";Rd();Zk();Qk();jg()});function t1(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var a1=C(()=>{"use strict"});function n1(e,t,a,n){let r=t1(a),o=a.bulletCurrent||Zi(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let i=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);let l=a.createTracker(n);l.move(o+" ".repeat(i-o.length)),l.shift(i);let s=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,l.current()),c);return s(),u;function c(d,f,p){return f?(p?"":" ".repeat(i))+d:(p?o:o+" ".repeat(i-o.length))+d}}var r1=C(()=>{"use strict";Rd();a1()});function o1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var i1=C(()=>{"use strict"});var Vg,l1=C(()=>{"use strict";xd();Vg=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var s1=C(()=>{"use strict";l1()});function u1(e,t,a,n){return(e.children.some(function(i){return Vg(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var c1=C(()=>{"use strict";s1()});function d1(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var f1=C(()=>{"use strict"});function Gg(e,t,a,n){let r=d1(a),o=a.enter("strong"),i=a.createTracker(n),l=i.move(r+r),s=i.move(a.containerPhrasing(e,{after:r,before:l,...i.current()})),u=s.charCodeAt(0),c=Ki(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=jr(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=Ki(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+jr(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function A3(e,t,a){return a.options.strong||"*"}var p1=C(()=>{"use strict";f1();Ed();Og();Gg.peek=A3});function m1(e,t,a,n){return a.safe(e.value,n)}var h1=C(()=>{"use strict"});function g1(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var y1=C(()=>{"use strict"});function w1(e,t,a){let n=(Dd(a)+(a.options.ruleSpaces?" ":"")).repeat(g1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var x1=C(()=>{"use strict";y1();jg()});var zs,v1=C(()=>{"use strict";yk();bk();Mk();Rk();Ok();qk();Hk();jk();Vk();Gk();$k();Xk();e1();r1();i1();c1();p1();h1();x1();zs={blockquote:gk,break:_g,code:Ek,definition:Ak,emphasis:Pg,hardBreak:_g,heading:zk,html:Ng,image:Bg,imageReference:Ug,inlineCode:Fg,link:qg,linkReference:Hg,list:Jk,listItem:n1,paragraph:o1,root:u1,strong:Gg,text:m1,thematicBreak:w1}});function Yi(e){let t="&"+e+";";b1.innerHTML=t;let a=b1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var b1,_d=C(()=>{"use strict";b1=document.createElement("i")});function Od(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}var Wg=C(()=>{"use strict"});function S1(e){return e.replace(R3,D3)}function D3(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Od(a.slice(o?2:1),o?16:10)}return Yi(a)||e}var R3,I1=C(()=>{"use strict";_d();Wg();R3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var $g=C(()=>{"use strict";v1()});function Kg(){return{enter:{table:_3,tableData:C1,tableHeader:C1,tableRow:P3},exit:{codeText:N3,table:O3,tableData:Xg,tableHeader:Xg,tableRow:Xg}}}function _3(e){let t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function O3(e){this.exit(e),this.data.inTable=void 0}function P3(e){this.enter({type:"tableRow",children:[]},e)}function Xg(e){this.exit(e)}function C1(e){this.enter({type:"tableCell",children:[]},e)}function N3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,B3));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function B3(e,t){return t==="|"?t:e}function Zg(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
23
23
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:i,tableCell:s,tableRow:l}};function i(p,m,x,I){return u(c(p,x,I),p.align)}function l(p,m,x,I){let y=d(p,x,I),w=u([y]);return w.slice(0,w.indexOf(`
|
|
24
|
-
`))}function s(p,m,x,I){let y=x.enter("tableCell"),w=x.enter("phrasing"),g=x.containerPhrasing(p,{...I,before:o,after:o});return w(),y(),g}function u(p,m){return nk(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("table");for(;++y<I.length;)w[y]=d(I[y],m,x);return g(),w}function d(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("tableRow");for(;++y<I.length;)w[y]=s(I[y],p,m,x);return g(),w}function f(p,m,x){let I=Us.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}var m1=C(()=>{"use strict";rk();zg()});var h1=C(()=>{"use strict";m1()});function Vg(){return{exit:{taskListCheckValueChecked:g1,taskListCheckValueUnchecked:g1,paragraph:S3}}}function Gg(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:I3}}}function g1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function S3(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let n=a.children[0];if(n&&n.type==="text"){let r=t.children,o=-1,i;for(;++o<r.length;){let l=r[o];if(l.type==="paragraph"){i=l;break}}i===a&&(n.value=n.value.slice(1),n.value.length===0?a.children.shift():a.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function I3(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",l=a.createTracker(n);o&&l.move(i);let s=Us.listItem(e,t,a,{...n,...l.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(c){return c+i}}var y1=C(()=>{"use strict";zg()});var w1=C(()=>{"use strict";y1()});function Wg(){return[vg(),Sg(),Cg(),Hg(),Vg()]}function $g(e){return{extensions:[bg(),Ig(e),kg(),jg(e),Gg()]}}var x1=C(()=>{"use strict";XC();YC();tk();h1();w1()});var v1=C(()=>{"use strict";x1()});function Lt(e,t,a,n){let r=e.length,o=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)i=Array.from(n),i.unshift(t,a),e.splice(...i);else for(a&&e.splice(t,a);o<n.length;)i=n.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Lt(e,e.length,0,t),e):t}var tr=C(()=>{"use strict"});function Rd(e){let t={},a=-1;for(;++a<e.length;)C3(t,e[a]);return t}function C3(e,t){let a;for(a in t){let r=(b1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){b1.call(r,i)||(r[i]=[]);let l=o[i];k3(r[i],Array.isArray(l)?l:l?[l]:[])}}}function k3(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Lt(e,0,0,n)}var b1,Xg=C(()=>{"use strict";tr();b1={}.hasOwnProperty});function Zg(){return{text:In}}function E3(e,t,a){let n=this,r,o;return i;function i(d){return!Kg(d)||!M1.call(n,n.previous)||Qg(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Kg(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(T3,c,u)(d):d===45||d===95||wt(d)?(o=!0,e.consume(d),s):c(d)}function u(d){return e.consume(d),r=!0,s}function c(d){return o&&r&&Nt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function M3(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!T1.call(n,n.previous)||Qg(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(L3,e.attempt(S1,e.attempt(I1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function A3(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&E1.call(n,n.previous)&&!Qg(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(Nt(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),l;if(d===58){let f=r.toLowerCase();if(f==="http"||f==="https")return e.consume(d),s}return a(d)}function s(d){return d===47?(e.consume(d),o?u:(o=!0,s)):a(d)}function u(d){return d===null||Mo(d)||we(d)||Sn(d)||Ao(d)?a(d):e.attempt(S1,e.attempt(I1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function R3(e,t,a){let n=0;return r;function r(i){return(i===87||i===119)&&n<3?(n++,e.consume(i),r):i===46&&n===3?(e.consume(i),o):a(i)}function o(i){return i===null?a(i):t(i)}}function D3(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(C1,s,l)(u):u===null||we(u)||Sn(u)||u!==45&&Ao(u)?s(u):(o=!0,e.consume(u),i)}function l(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function s(u){return r||n||!o?a(u):t(u)}}function _3(e,t){let a=0,n=0;return r;function r(i){return i===40?(a++,e.consume(i),r):i===41&&n<a?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(C1,t,o)(i):i===null||we(i)||Sn(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function O3(e,t,a){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),n):l===38?(e.consume(l),o):l===93?(e.consume(l),r):l===60||l===null||we(l)||Sn(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||we(l)||Sn(l)?t(l):n(l)}function o(l){return Nt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):Nt(l)?(e.consume(l),i):a(l)}}function P3(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return wt(o)?a(o):t(o)}}function T1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function E1(e){return!Nt(e)}function M1(e){return!(e===47||Kg(e))}function Kg(e){return e===43||e===45||e===46||e===95||wt(e)}function Qg(e){let t=e.length,a=!1;for(;t--;){let n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){a=!0;break}if(n._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}var L3,S1,I1,C1,T3,k1,L1,ar,In,Do,A1=C(()=>{"use strict";Ae();L3={tokenize:R3,partial:!0},S1={tokenize:D3,partial:!0},I1={tokenize:_3,partial:!0},C1={tokenize:O3,partial:!0},T3={tokenize:P3,partial:!0},k1={name:"wwwAutolink",tokenize:M3,previous:T1},L1={name:"protocolAutolink",tokenize:A3,previous:E1},ar={name:"emailAutolink",tokenize:E3,previous:M1},In={};Do=48;for(;Do<123;)In[Do]=ar,Do++,Do===58?Do=65:Do===91&&(Do=97);In[43]=ar;In[45]=ar;In[46]=ar;In[95]=ar;In[72]=[ar,L1];In[104]=[ar,L1];In[87]=[ar,k1];In[119]=[ar,k1]});function Ka(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&wt(e.charCodeAt(a+1))&&wt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}var _o=C(()=>{"use strict";Ae()});var R1=C(()=>{"use strict";A1()});function Vr(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var Fs=C(()=>{"use strict"});function N3(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[a][1].start};D1(d,-s),D1(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ra(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ra(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ra(u,Vr(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ra(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=ra(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Lt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function B3(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=er(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=er(s),d=!c||c===2&&r||a.includes(s),f=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!f)),u._close=!!(o===42?f:f&&(c||!d)),t(s)}}function D1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var zs,_1=C(()=>{"use strict";tr();kd();Fs();zs={name:"attention",resolveAll:N3,tokenize:B3}});function U3(e,t,a){let n=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Nt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||wt(p)?(n=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),n=0,s):(p===43||p===45||p===46||wt(p))&&n++<32?(e.consume(p),l):(n=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Mo(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):zC(p)?(e.consume(p),u):a(p)}function c(p){return wt(p)?d(p):a(p)}function d(p){return p===46?(e.consume(p),n=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||wt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Yg,O1=C(()=>{"use strict";Ae();Yg={name:"autolink",tokenize:U3}});function J(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return te(s)?(e.enter(a),l(s)):t(s)}function l(s){return te(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Tt=C(()=>{"use strict";Ae()});function F3(e,t,a){return n;function n(o){return te(o)?J(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||V(o)?t(o):a(o)}}var Cn,Dd=C(()=>{"use strict";Tt();Ae();Cn={partial:!0,tokenize:F3}});function z3(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return te(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function q3(e,t,a){let n=this;return r;function r(i){return te(i)?J(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(_d,t,a)(i)}}function H3(e){e.exit("blockQuote")}var _d,P1=C(()=>{"use strict";Tt();Ae();_d={continuation:{tokenize:q3},exit:H3,name:"blockQuote",tokenize:z3}});function j3(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return HC(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Od,N1=C(()=>{"use strict";Ae();Od={name:"characterEscape",tokenize:j3}});function V3(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=wt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=qC,c):(e.enter("characterReferenceValue"),o=7,i=Bs,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===wt&&!Ki(n.sliceSerialize(f))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var Pd,B1=C(()=>{"use strict";Md();Ae();Pd={name:"characterReference",tokenize:V3}});function G3(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(S){return u(S)}function u(S){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===l?(i++,e.consume(S),c):i<3?a(S):(e.exit("codeFencedFenceSequence"),te(S)?J(e,d,"whitespace")(S):d(S))}function d(S){return S===null||V(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(U1,x,b)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):te(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),J(e,p,"whitespace")(S)):S===96&&S===l?a(S):(e.consume(S),f)}function p(S){return S===null||V(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||V(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?a(S):(e.consume(S),m)}function x(S){return e.attempt(r,b,I)(S)}function I(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return o>0&&te(S)?J(e,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||V(S)?e.check(U1,x,b)(S):(e.enter("codeFlowValue"),g(S))}function g(S){return S===null||V(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),g)}function b(S){return e.exit("codeFenced"),t(S)}function T(S,M,R){let _=0;return k;function k(A){return S.enter("lineEnding"),S.consume(A),S.exit("lineEnding"),G}function G(A){return S.enter("codeFencedFence"),te(A)?J(S,B,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):B(A)}function B(A){return A===l?(S.enter("codeFencedFenceSequence"),U(A)):R(A)}function U(A){return A===l?(_++,S.consume(A),U):_>=i?(S.exit("codeFencedFenceSequence"),te(A)?J(S,W,"whitespace")(A):W(A)):R(A)}function W(A){return A===null||V(A)?(S.exit("codeFencedFence"),M(A)):R(A)}}}function W3(e,t,a){let n=this;return r;function r(i){return i===null?a(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}var U1,Nd,F1=C(()=>{"use strict";Tt();Ae();U1={partial:!0,tokenize:W3},Nd={concrete:!0,name:"codeFenced",tokenize:G3}});function X3(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),J(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):V(u)?e.attempt($3,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||V(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function K3(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):J(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):V(i)?r(i):a(i)}}var qs,$3,z1=C(()=>{"use strict";Tt();Ae();qs={name:"codeIndented",tokenize:X3},$3={partial:!0,tokenize:K3}});function Z3(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function Q3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Y3(e,t,a){let n=this,r=0,o,i;return l;function l(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?a(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||V(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}var Jg,q1=C(()=>{"use strict";Ae();Jg={name:"codeText",previous:Q3,resolve:Z3,tokenize:Y3}});function Hs(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}var Bd,H1=C(()=>{"use strict";Bd=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Hs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let a=this.left.splice(t,Number.POSITIVE_INFINITY);Hs(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hs(this.left,a.reverse())}}}});function Ud(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Bd(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,J3(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return Lt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function J3(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,f=-1,p=a,m=0,x=0,I=[x];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(c=n.sliceStream(p),p.next||c.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=a;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(x=f+1,I.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):I.pop(),f=I.length;f--;){let y=l.slice(I[f],I[f+1]),w=o.pop();s.push([w,w+y.length-1]),e.splice(w,2,y)}for(s.reverse(),f=-1;++f<s.length;)u[m+s[f][0]]=m+s[f][1],m+=s[f][1]-s[f][0]-1;return u}var ey=C(()=>{"use strict";tr();H1()});function tU(e){return Ud(e),e}function aU(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):V(l)?e.check(eU,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function nU(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),J(e,o,"linePrefix")}function o(i){if(i===null||V(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var ty,eU,j1=C(()=>{"use strict";Tt();Ae();ey();ty={resolve:tU,tokenize:aU},eU={partial:!0,tokenize:nU}});function Fd(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(y){return y===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||Mo(y)?a(y):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||V(y)?a(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!c&&(y===null||y===41||we(y))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||Mo(y)?a(y):(e.consume(y),y===92?I:x)}function I(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}var ay=C(()=>{"use strict";Ae()});function zd(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(p){return e.enter(n),e.enter(r),e.consume(p),e.exit(r),e.enter(o),c}function c(p){return l>999||p===null||p===91||p===93&&!s||p===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):V(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||V(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!te(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var ny=C(()=>{"use strict";Ae()});function qd(e,t,a,n,r,o){let i;return l;function l(f){return f===34||f===39||f===40?(e.enter(n),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,s):a(f)}function s(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):(e.enter(o),u(f))}function u(f){return f===i?(e.exit(o),s(i)):f===null?a(f):V(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),J(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||V(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}var ry=C(()=>{"use strict";Tt();Ae()});function Oo(e,t){let a;return n;function n(r){return V(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):te(r)?J(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var oy=C(()=>{"use strict";Tt();Ae()});function oU(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return zd.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):a(p)}function s(p){return we(p)?Oo(e,u)(p):u(p)}function u(p){return Fd(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(rU,d,d)(p)}function d(p){return te(p)?J(e,f,"whitespace")(p):f(p)}function f(p){return p===null||V(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function iU(e,t,a){return n;function n(l){return we(l)?Oo(e,r)(l):a(l)}function r(l){return qd(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return te(l)?J(e,i,"whitespace")(l):i(l)}function i(l){return l===null||V(l)?t(l):a(l)}}var iy,rU,V1=C(()=>{"use strict";ay();ny();Tt();ry();oy();Ae();Gi();iy={name:"definition",tokenize:oU},rU={partial:!0,tokenize:iU}});function lU(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return V(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ly,G1=C(()=>{"use strict";Ae();ly={name:"hardBreakEscape",tokenize:lU}});function sU(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},Lt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function uU(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&n++<6?(e.consume(c),i):c===null||we(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||V(c)?(e.exit("atxHeading"),t(c)):te(c)?J(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||we(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var sy,W1=C(()=>{"use strict";Tt();Ae();tr();sy={name:"headingAtx",resolve:sU,tokenize:uU}});var $1,uy,X1=C(()=>{"use strict";$1=["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"],uy=["pre","script","style","textarea"]});function fU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pU(e,t,a){let n=this,r,o,i,l,s;return u;function u(L){return c(L)}function c(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),o=!0,x):L===63?(e.consume(L),r=3,n.interrupt?t:v):Nt(L)?(e.consume(L),i=String.fromCharCode(L),I):a(L)}function f(L){return L===45?(e.consume(L),r=2,p):L===91?(e.consume(L),r=5,l=0,m):Nt(L)?(e.consume(L),r=4,n.interrupt?t:v):a(L)}function p(L){return L===45?(e.consume(L),n.interrupt?t:v):a(L)}function m(L){let ke="CDATA[";return L===ke.charCodeAt(l++)?(e.consume(L),l===ke.length?n.interrupt?t:B:m):a(L)}function x(L){return Nt(L)?(e.consume(L),i=String.fromCharCode(L),I):a(L)}function I(L){if(L===null||L===47||L===62||we(L)){let ke=L===47,St=i.toLowerCase();return!ke&&!o&&uy.includes(St)?(r=1,n.interrupt?t(L):B(L)):$1.includes(i.toLowerCase())?(r=6,ke?(e.consume(L),y):n.interrupt?t(L):B(L)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(L):o?w(L):g(L))}return L===45||wt(L)?(e.consume(L),i+=String.fromCharCode(L),I):a(L)}function y(L){return L===62?(e.consume(L),n.interrupt?t:B):a(L)}function w(L){return te(L)?(e.consume(L),w):k(L)}function g(L){return L===47?(e.consume(L),k):L===58||L===95||Nt(L)?(e.consume(L),b):te(L)?(e.consume(L),g):k(L)}function b(L){return L===45||L===46||L===58||L===95||wt(L)?(e.consume(L),b):T(L)}function T(L){return L===61?(e.consume(L),S):te(L)?(e.consume(L),T):g(L)}function S(L){return L===null||L===60||L===61||L===62||L===96?a(L):L===34||L===39?(e.consume(L),s=L,M):te(L)?(e.consume(L),S):R(L)}function M(L){return L===s?(e.consume(L),s=null,_):L===null||V(L)?a(L):(e.consume(L),M)}function R(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||we(L)?T(L):(e.consume(L),R)}function _(L){return L===47||L===62||te(L)?g(L):a(L)}function k(L){return L===62?(e.consume(L),G):a(L)}function G(L){return L===null||V(L)?B(L):te(L)?(e.consume(L),G):a(L)}function B(L){return L===45&&r===2?(e.consume(L),H):L===60&&r===1?(e.consume(L),$):L===62&&r===4?(e.consume(L),De):L===63&&r===3?(e.consume(L),v):L===93&&r===5?(e.consume(L),$e):V(L)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(cU,_e,U)(L)):L===null||V(L)?(e.exit("htmlFlowData"),U(L)):(e.consume(L),B)}function U(L){return e.check(dU,W,_e)(L)}function W(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),A}function A(L){return L===null||V(L)?U(L):(e.enter("htmlFlowData"),B(L))}function H(L){return L===45?(e.consume(L),v):B(L)}function $(L){return L===47?(e.consume(L),i="",We):B(L)}function We(L){if(L===62){let ke=i.toLowerCase();return uy.includes(ke)?(e.consume(L),De):B(L)}return Nt(L)&&i.length<8?(e.consume(L),i+=String.fromCharCode(L),We):B(L)}function $e(L){return L===93?(e.consume(L),v):B(L)}function v(L){return L===62?(e.consume(L),De):L===45&&r===2?(e.consume(L),v):B(L)}function De(L){return L===null||V(L)?(e.exit("htmlFlowData"),_e(L)):(e.consume(L),De)}function _e(L){return e.exit("htmlFlow"),t(L)}}function mU(e,t,a){let n=this;return r;function r(i){return V(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):a(i)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}function hU(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Cn,t,a)}}var cy,cU,dU,K1=C(()=>{"use strict";Ae();X1();Dd();cy={concrete:!0,name:"htmlFlow",resolveTo:fU,tokenize:pU},cU={partial:!0,tokenize:hU},dU={partial:!0,tokenize:mU}});function gU(e,t,a){let n=this,r,o,i;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),s}function s(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),T):v===63?(e.consume(v),g):Nt(v)?(e.consume(v),R):a(v)}function u(v){return v===45?(e.consume(v),c):v===91?(e.consume(v),o=0,m):Nt(v)?(e.consume(v),w):a(v)}function c(v){return v===45?(e.consume(v),p):a(v)}function d(v){return v===null?a(v):v===45?(e.consume(v),f):V(v)?(i=d,$(v)):(e.consume(v),d)}function f(v){return v===45?(e.consume(v),p):d(v)}function p(v){return v===62?H(v):v===45?f(v):d(v)}function m(v){let De="CDATA[";return v===De.charCodeAt(o++)?(e.consume(v),o===De.length?x:m):a(v)}function x(v){return v===null?a(v):v===93?(e.consume(v),I):V(v)?(i=x,$(v)):(e.consume(v),x)}function I(v){return v===93?(e.consume(v),y):x(v)}function y(v){return v===62?H(v):v===93?(e.consume(v),y):x(v)}function w(v){return v===null||v===62?H(v):V(v)?(i=w,$(v)):(e.consume(v),w)}function g(v){return v===null?a(v):v===63?(e.consume(v),b):V(v)?(i=g,$(v)):(e.consume(v),g)}function b(v){return v===62?H(v):g(v)}function T(v){return Nt(v)?(e.consume(v),S):a(v)}function S(v){return v===45||wt(v)?(e.consume(v),S):M(v)}function M(v){return V(v)?(i=M,$(v)):te(v)?(e.consume(v),M):H(v)}function R(v){return v===45||wt(v)?(e.consume(v),R):v===47||v===62||we(v)?_(v):a(v)}function _(v){return v===47?(e.consume(v),H):v===58||v===95||Nt(v)?(e.consume(v),k):V(v)?(i=_,$(v)):te(v)?(e.consume(v),_):H(v)}function k(v){return v===45||v===46||v===58||v===95||wt(v)?(e.consume(v),k):G(v)}function G(v){return v===61?(e.consume(v),B):V(v)?(i=G,$(v)):te(v)?(e.consume(v),G):_(v)}function B(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),r=v,U):V(v)?(i=B,$(v)):te(v)?(e.consume(v),B):(e.consume(v),W)}function U(v){return v===r?(e.consume(v),r=void 0,A):v===null?a(v):V(v)?(i=U,$(v)):(e.consume(v),U)}function W(v){return v===null||v===34||v===39||v===60||v===61||v===96?a(v):v===47||v===62||we(v)?_(v):(e.consume(v),W)}function A(v){return v===47||v===62||we(v)?_(v):a(v)}function H(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):a(v)}function $(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),We}function We(v){return te(v)?J(e,$e,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):$e(v)}function $e(v){return e.enter("htmlTextData"),i(v)}}var dy,Z1=C(()=>{"use strict";Tt();Ae();dy={name:"htmlText",tokenize:gU}});function vU(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&Lt(e,0,e.length,a),e}function bU(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=ra(l,e.slice(o+1,o+n+3)),l=ra(l,[["enter",c,t]]),l=ra(l,Vr(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ra(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ra(l,e.slice(i+1)),l=ra(l,[["exit",s,t]]),Lt(e,o,e.length,l),e}function SU(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(f){return o?o._inactive?d(f):(i=n.parser.defined.includes(Qt(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),s):a(f)}function s(f){return f===40?e.attempt(yU,c,i?c:d)(f):f===91?e.attempt(wU,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(xU,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function IU(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return we(d)?Oo(e,o)(d):o(d)}function o(d){return d===41?c(d):Fd(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return we(d)?Oo(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?qd(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return we(d)?Oo(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function CU(e,t,a){let n=this;return r;function r(l){return zd.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(Qt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function kU(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var Po,yU,wU,xU,Hd=C(()=>{"use strict";ay();ny();ry();oy();Ae();tr();Gi();Fs();Po={name:"labelEnd",resolveAll:vU,resolveTo:bU,tokenize:SU},yU={tokenize:IU},wU={tokenize:CU},xU={tokenize:kU}});function LU(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var fy,Q1=C(()=>{"use strict";Hd();fy={name:"labelStartImage",resolveAll:Po.resolveAll,tokenize:LU}});function TU(e,t,a){let n=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var py,Y1=C(()=>{"use strict";Hd();py={name:"labelStartLink",resolveAll:Po.resolveAll,tokenize:TU}});function EU(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),J(e,t,"linePrefix")}}var js,J1=C(()=>{"use strict";Tt();js={name:"lineEnding",tokenize:EU}});function MU(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||V(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),te(u)?J(e,l,"whitespace")(u):l(u))}}var No,my=C(()=>{"use strict";Tt();Ae();No={name:"thematicBreak",tokenize:MU}});function DU(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(p){let m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Bs(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(No,a,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return a(p)}function s(p){return Bs(p)&&++i<10?(e.consume(p),s):(!n.interrupt||i<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):a(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(Cn,n.interrupt?a:c,e.attempt(AU,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return te(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):a(p)}function f(p){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function _U(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Cn,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,J(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!te(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(RU,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,J(e,e.attempt(Yt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function OU(e,t,a){let n=this;return J(e,r,"listItemIndent",n.containerState.size+1);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(o):a(o)}}function PU(e){e.exit(this.containerState.type)}function NU(e,t,a){let n=this;return J(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let i=n.events[n.events.length-1];return!te(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Yt,AU,RU,eL=C(()=>{"use strict";Tt();Ae();Dd();my();Yt={continuation:{tokenize:_U},exit:PU,name:"list",tokenize:DU},AU={partial:!0,tokenize:NU},RU={partial:!0,tokenize:OU}});function BU(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function UU(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),te(u)?J(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||V(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var jd,tL=C(()=>{"use strict";Tt();Ae();jd={name:"setextUnderline",resolveTo:BU,tokenize:UU}});var Vd=C(()=>{"use strict";_1();O1();Dd();P1();N1();B1();F1();z1();q1();j1();V1();G1();W1();K1();Z1();Hd();Q1();Y1();J1();eL();tL();my()});function hy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jU,continuation:{tokenize:VU},exit:GU}},text:{91:{name:"gfmFootnoteCall",tokenize:HU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zU,resolveTo:qU}}}}function zU(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let s=n.events[r][1];if(s.type==="labelImage"){i=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return l;function l(s){if(!i||!i._balanced)return a(s);let u=Qt(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function qU(e,t){let a=e.length,n;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...s),e}function HU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?a(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!i||d===null||d===91||we(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(Qt(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return we(d)||(i=!0),o++,e.consume(d),d===92?c:u}function c(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function jU(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,l;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(m)}function c(m){if(i>999||m===93&&!l||m===null||m===91||we(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Qt(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return we(m)||(l=!0),i++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),i++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(o)||r.push(o),J(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function VU(e,t,a){return e.check(Cn,t,e.attempt(FU,t,a))}function GU(e){e.exit("gfmFootnoteDefinition")}function WU(e,t,a){let n=this;return J(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(o):a(o)}}var FU,aL=C(()=>{"use strict";Vd();Tt();Ae();Gi();FU={tokenize:WU,partial:!0}});var nL=C(()=>{"use strict";aL()});function gy(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:r};return a==null&&(a=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(i,l){let s=-1;for(;++s<i.length;)if(i[s][0]==="enter"&&i[s][1].type==="strikethroughSequenceTemporary"&&i[s][1]._close){let u=s;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[s][1].end.offset-i[s][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[s][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[s][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[s][1].start)},f=[["enter",c,l],["enter",i[u][1],l],["exit",i[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&Lt(f,f.length,0,Vr(p,i.slice(u+1,s),l)),Lt(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),Lt(i,u-1,s-u+3,f),s=u+f.length-2;break}}for(s=-1;++s<i.length;)i[s][1].type==="strikethroughSequenceTemporary"&&(i[s][1].type="data");return i}function o(i,l,s){let u=this.previous,c=this.events,d=0;return f;function f(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?s(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){let x=er(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let I=i.exit("strikethroughSequenceTemporary"),y=er(m);return I._open=!y||y===2&&!!x,I._close=!x||x===2&&!!y,l(m)}}}var rL=C(()=>{"use strict";tr();kd();Fs()});var oL=C(()=>{"use strict";rL()});function $U(e,t,a,n){let r=0;if(!(a===0&&n.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=a,e.map[r][2].push(...n);return}r+=1}e.map.push([t,a,n])}}var Gd,iL=C(()=>{"use strict";Gd=class{constructor(){this.map=[]}add(t,a,n){$U(this,t,a,n)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let a=this.map.length,n=[];for(;a>0;)a-=1,n.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];n.push(t.slice()),t.length=0;let r=n.pop();for(;r;){for(let o of r)t.push(o);r=n.pop()}this.map.length=0}}});function lL(e,t){let a=!1,n=[];for(;t<e.length;){let r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return n}var sL=C(()=>{"use strict"});function yy(){return{flow:{null:{name:"table",tokenize:XU,resolveAll:KU}}}}function XU(e,t,a){let n=this,r=0,o=0,i;return l;function l(k){let G=n.events.length-1;for(;G>-1;){let W=n.events[G][1].type;if(W==="lineEnding"||W==="linePrefix")G--;else break}let B=G>-1?n.events[G][1].type:null,U=B==="tableHead"||B==="tableRow"?S:s;return U===S&&n.parser.lazy[n.now().line]?a(k):U(k)}function s(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(i=!0,o+=1),c(k)}function c(k){return k===null?a(k):V(k)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):a(k):te(k)?J(e,c,"whitespace")(k):(o+=1,i&&(i=!1,r+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(k)))}function d(k){return k===null||k===124||we(k)?(e.exit("data"),c(k)):(e.consume(k),k===92?f:d)}function f(k){return k===92||k===124?(e.consume(k),d):d(k)}function p(k){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(k):(e.enter("tableDelimiterRow"),i=!1,te(k)?J(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):m(k))}function m(k){return k===45||k===58?I(k):k===124?(i=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):T(k)}function x(k){return te(k)?J(e,I,"whitespace")(k):I(k)}function I(k){return k===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||V(k)?b(k):T(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),w(k)):T(k)}function w(k){return k===45?(e.consume(k),w):k===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(k))}function g(k){return te(k)?J(e,b,"whitespace")(k):b(k)}function b(k){return k===124?m(k):k===null||V(k)?!i||r!==o?T(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):T(k)}function T(k){return a(k)}function S(k){return e.enter("tableRow"),M(k)}function M(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),M):k===null||V(k)?(e.exit("tableRow"),t(k)):te(k)?J(e,M,"whitespace")(k):(e.enter("data"),R(k))}function R(k){return k===null||k===124||we(k)?(e.exit("data"),M(k)):(e.consume(k),k===92?_:R)}function _(k){return k===92||k===124?(e.consume(k),R):R(k)}}function KU(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],l=!1,s=0,u,c,d,f=new Gd;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(uL(f,t,s,u,c),c=void 0,s=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],l&&(l=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",c,t]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=Wd(f,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=Wd(f,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):m.type==="tableHead"?(l=!0,s=a):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=a,o[1]!==0?(i[0]=i[1],d=Wd(f,t,o,r,a,d)):i[1]!==0&&(d=Wd(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&uL(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=lL(t.events,a))}return e}function Wd(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Zi(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Zi(t.events,a[1]);if(o={type:i,start:Object.assign({},s),end:Object.assign({},s)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Zi(t.events,a[2]),c=Zi(t.events,a[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let f=t.events[a[2]],p=t.events[a[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",a[3]>a[2]+1){let m=a[2]+1,x=a[3]-a[2]-1;e.add(m,x,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Zi(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function uL(e,t,a,n,r){let o=[],i=Zi(t.events,a);r&&(r.end=Object.assign({},i),o.push(["exit",r,t])),n.end=Object.assign({},i),o.push(["exit",n,t]),e.add(a+1,0,o)}function Zi(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var cL=C(()=>{"use strict";Tt();Ae();iL();sL()});var dL=C(()=>{"use strict";cL()});function wy(){return{text:{91:ZU}}}function QU(e,t,a){let n=this;return r;function r(s){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return we(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),i):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),i):a(s)}function i(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):a(s)}function l(s){return V(s)?t(s):te(s)?e.check({tokenize:YU},t,a)(s):a(s)}}function YU(e,t,a){return J(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var ZU,fL=C(()=>{"use strict";Tt();Ae();ZU={name:"tasklistCheck",tokenize:QU}});var pL=C(()=>{"use strict";fL()});function mL(e){return Rd([Zg(),hy(),gy(e),yy(),wy()])}var hL=C(()=>{"use strict";Xg();R1();nL();oL();dL();pL()});function $d(e){let t=this,a=e||JU,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(mL(a)),o.push(Wg()),i.push($g(a))}var JU,gL=C(()=>{"use strict";v1();hL();JU={}});var yL=C(()=>{"use strict";gL()});var e4,t4,a4,wL,n4,r4,xL,SL,IL,o4,i4,l4,s4,u4,c4,d4,Bo,CL,f4,p4,m4,h4,g4,y4,vL,Gr,Qi,w4,kL,Kd,x4,LL,vy,v4,b4,TL,S4,I4,C4,k4,L4,T4,E4,M4,A4,EL,R4,D4,_4,O4,P4,N4,Xd,B4,U4,F4,z4,q4,H4,j4,V4,G4,W4,bL,$4,ML,X4,K4,Z4,Q4,Y4,J4,xy,Da,eF,tF,aF,AL,RL=C(()=>{"use strict";e4=Object.defineProperty,t4=Object.defineProperties,a4=Object.getOwnPropertyDescriptors,wL=Object.getOwnPropertySymbols,n4=Object.prototype.hasOwnProperty,r4=Object.prototype.propertyIsEnumerable,xL=(e,t,a)=>t in e?e4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,SL=(e,t)=>{for(var a in t||(t={}))n4.call(t,a)&&xL(e,a,t[a]);if(wL)for(var a of wL(t))r4.call(t,a)&&xL(e,a,t[a]);return e},IL=(e,t)=>t4(e,a4(t)),o4=/(\*\*)([^*]*\*?)$/,i4=/(__)([^_]*?)$/,l4=/(\*\*\*)([^*]*?)$/,s4=/(\*)([^*]*?)$/,u4=/(_)([^_]*?)$/,c4=/(`)([^`]*?)$/,d4=/(~~)([^~]*?)$/,Bo=/^[\s_~*`]*$/,CL=/^[\s]*[-*+][\s]+$/,f4=/[\p{L}\p{N}_]/u,p4=/^```[^`\n]*```?$/,m4=/^\*{4,}$/,h4=/(__)([^_]+)_$/,g4=/(~~)([^~]+)~$/,y4=/__/g,vL=/~~/g,Gr=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:f4.test(e)},Qi=(e,t)=>{let a=!1;for(let n=0;n<t;n+=1)e[n]==="`"&&e[n+1]==="`"&&e[n+2]==="`"&&(a=!a,n+=2);return a},w4=(e,t)=>{let a=1;for(let n=t-1;n>=0;n-=1)if(e[n]==="]")a+=1;else if(e[n]==="["&&(a-=1,a===0))return n;return-1},kL=(e,t)=>{let a=1;for(let n=t+1;n<e.length;n+=1)if(e[n]==="[")a+=1;else if(e[n]==="]"&&(a-=1,a===0))return n;return-1},Kd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]==="\\"&&e[r+1]==="$"){r+=1;continue}e[r]==="$"&&(e[r+1]==="$"?(n=!n,r+=1,a=!1):n||(a=!a))}return a||n},x4=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
-
`)return!1}return!1},
|
|
26
|
-
`)return!1}return!1},
|
|
24
|
+
`))}function s(p,m,x,I){let y=x.enter("tableCell"),w=x.enter("phrasing"),g=x.containerPhrasing(p,{...I,before:o,after:o});return w(),y(),g}function u(p,m){return mk(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("table");for(;++y<I.length;)w[y]=d(I[y],m,x);return g(),w}function d(p,m,x){let I=p.children,y=-1,w=[],g=m.enter("tableRow");for(;++y<I.length;)w[y]=s(I[y],p,m,x);return g(),w}function f(p,m,x){let I=zs.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}var k1=C(()=>{"use strict";hk();$g()});var L1=C(()=>{"use strict";k1()});function Yg(){return{exit:{taskListCheckValueChecked:T1,taskListCheckValueUnchecked:T1,paragraph:U3}}}function Qg(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:F3}}}function T1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function U3(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let n=a.children[0];if(n&&n.type==="text"){let r=t.children,o=-1,i;for(;++o<r.length;){let l=r[o];if(l.type==="paragraph"){i=l;break}}i===a&&(n.value=n.value.slice(1),n.value.length===0?a.children.shift():a.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function F3(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",l=a.createTracker(n);o&&l.move(i);let s=zs.listItem(e,t,a,{...n,...l.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(c){return c+i}}var E1=C(()=>{"use strict";$g()});var M1=C(()=>{"use strict";E1()});function Jg(){return[Tg(),Mg(),Rg(),Kg(),Yg()]}function ey(e){return{extensions:[Eg(),Ag(e),Dg(),Zg(e),Qg()]}}var A1=C(()=>{"use strict";ok();uk();fk();L1();M1()});var R1=C(()=>{"use strict";A1()});function Lt(e,t,a,n){let r=e.length,o=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)i=Array.from(n),i.unshift(t,a),e.splice(...i);else for(a&&e.splice(t,a);o<n.length;)i=n.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Lt(e,e.length,0,t),e):t}var tr=C(()=>{"use strict"});function Pd(e){let t={},a=-1;for(;++a<e.length;)z3(t,e[a]);return t}function z3(e,t){let a;for(a in t){let r=(D1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){D1.call(r,i)||(r[i]=[]);let l=o[i];q3(r[i],Array.isArray(l)?l:l?[l]:[])}}}function q3(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Lt(e,0,0,n)}var D1,ty=C(()=>{"use strict";tr();D1={}.hasOwnProperty});function ny(){return{text:Cn}}function V3(e,t,a){let n=this,r,o;return i;function i(d){return!ay(d)||!z1.call(n,n.previous)||ry(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return ay(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(j3,c,u)(d):d===45||d===95||wt(d)?(o=!0,e.consume(d),s):c(d)}function u(d){return e.consume(d),r=!0,s}function c(d){return o&&r&&Nt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function G3(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!U1.call(n,n.previous)||ry(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(H3,e.attempt(_1,e.attempt(O1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function W3(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&F1.call(n,n.previous)&&!ry(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(Nt(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),l;if(d===58){let f=r.toLowerCase();if(f==="http"||f==="https")return e.consume(d),s}return a(d)}function s(d){return d===47?(e.consume(d),o?u:(o=!0,s)):a(d)}function u(d){return d===null||Ao(d)||we(d)||In(d)||Ro(d)?a(d):e.attempt(_1,e.attempt(O1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function $3(e,t,a){let n=0;return r;function r(i){return(i===87||i===119)&&n<3?(n++,e.consume(i),r):i===46&&n===3?(e.consume(i),o):a(i)}function o(i){return i===null?a(i):t(i)}}function X3(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(P1,s,l)(u):u===null||we(u)||In(u)||u!==45&&Ro(u)?s(u):(o=!0,e.consume(u),i)}function l(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function s(u){return r||n||!o?a(u):t(u)}}function K3(e,t){let a=0,n=0;return r;function r(i){return i===40?(a++,e.consume(i),r):i===41&&n<a?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(P1,t,o)(i):i===null||we(i)||In(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function Z3(e,t,a){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),n):l===38?(e.consume(l),o):l===93?(e.consume(l),r):l===60||l===null||we(l)||In(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||we(l)||In(l)?t(l):n(l)}function o(l){return Nt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):Nt(l)?(e.consume(l),i):a(l)}}function Y3(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return wt(o)?a(o):t(o)}}function U1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function F1(e){return!Nt(e)}function z1(e){return!(e===47||ay(e))}function ay(e){return e===43||e===45||e===46||e===95||wt(e)}function ry(e){let t=e.length,a=!1;for(;t--;){let n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){a=!0;break}if(n._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}var H3,_1,O1,P1,j3,N1,B1,ar,Cn,_o,q1=C(()=>{"use strict";Ae();H3={tokenize:$3,partial:!0},_1={tokenize:X3,partial:!0},O1={tokenize:K3,partial:!0},P1={tokenize:Z3,partial:!0},j3={tokenize:Y3,partial:!0},N1={name:"wwwAutolink",tokenize:G3,previous:U1},B1={name:"protocolAutolink",tokenize:W3,previous:F1},ar={name:"emailAutolink",tokenize:V3,previous:z1},Cn={};_o=48;for(;_o<123;)Cn[_o]=ar,_o++,_o===58?_o=65:_o===91&&(_o=97);Cn[43]=ar;Cn[45]=ar;Cn[46]=ar;Cn[95]=ar;Cn[72]=[ar,B1];Cn[104]=[ar,B1];Cn[87]=[ar,N1];Cn[119]=[ar,N1]});function Ka(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&wt(e.charCodeAt(a+1))&&wt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}var Oo=C(()=>{"use strict";Ae()});var H1=C(()=>{"use strict";q1()});function Vr(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var qs=C(()=>{"use strict"});function Q3(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[a][1].start};j1(d,-s),j1(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ra(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ra(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ra(u,Vr(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ra(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=ra(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Lt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function J3(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=er(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=er(s),d=!c||c===2&&r||a.includes(s),f=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!f)),u._close=!!(o===42?f:f&&(c||!d)),t(s)}}function j1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Hs,V1=C(()=>{"use strict";tr();Md();qs();Hs={name:"attention",resolveAll:Q3,tokenize:J3}});function eU(e,t,a){let n=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Nt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||wt(p)?(n=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),n=0,s):(p===43||p===45||p===46||wt(p))&&n++<32?(e.consume(p),l):(n=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ao(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):YC(p)?(e.consume(p),u):a(p)}function c(p){return wt(p)?d(p):a(p)}function d(p){return p===46?(e.consume(p),n=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||wt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var oy,G1=C(()=>{"use strict";Ae();oy={name:"autolink",tokenize:eU}});function J(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return te(s)?(e.enter(a),l(s)):t(s)}function l(s){return te(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Tt=C(()=>{"use strict";Ae()});function tU(e,t,a){return n;function n(o){return te(o)?J(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||G(o)?t(o):a(o)}}var kn,Nd=C(()=>{"use strict";Tt();Ae();kn={partial:!0,tokenize:tU}});function aU(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return te(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function nU(e,t,a){let n=this;return r;function r(i){return te(i)?J(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Bd,t,a)(i)}}function rU(e){e.exit("blockQuote")}var Bd,W1=C(()=>{"use strict";Tt();Ae();Bd={continuation:{tokenize:nU},exit:rU,name:"blockQuote",tokenize:aU}});function oU(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return JC(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Ud,$1=C(()=>{"use strict";Ae();Ud={name:"characterEscape",tokenize:oU}});function iU(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=wt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=QC,c):(e.enter("characterReferenceValue"),o=7,i=Fs,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===wt&&!Yi(n.sliceSerialize(f))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var Fd,X1=C(()=>{"use strict";_d();Ae();Fd={name:"characterReference",tokenize:iU}});function lU(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(S){return u(S)}function u(S){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===l?(i++,e.consume(S),c):i<3?a(S):(e.exit("codeFencedFenceSequence"),te(S)?J(e,d,"whitespace")(S):d(S))}function d(S){return S===null||G(S)?(e.exit("codeFencedFence"),n.interrupt?t(S):e.check(K1,x,b)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||G(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):te(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),J(e,p,"whitespace")(S)):S===96&&S===l?a(S):(e.consume(S),f)}function p(S){return S===null||G(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||G(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?a(S):(e.consume(S),m)}function x(S){return e.attempt(r,b,I)(S)}function I(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return o>0&&te(S)?J(e,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||G(S)?e.check(K1,x,b)(S):(e.enter("codeFlowValue"),g(S))}function g(S){return S===null||G(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),g)}function b(S){return e.exit("codeFenced"),t(S)}function T(S,M,R){let _=0;return L;function L(A){return S.enter("lineEnding"),S.consume(A),S.exit("lineEnding"),z}function z(A){return S.enter("codeFencedFence"),te(A)?J(S,U,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):U(A)}function U(A){return A===l?(S.enter("codeFencedFenceSequence"),B(A)):R(A)}function B(A){return A===l?(_++,S.consume(A),B):_>=i?(S.exit("codeFencedFenceSequence"),te(A)?J(S,W,"whitespace")(A):W(A)):R(A)}function W(A){return A===null||G(A)?(S.exit("codeFencedFence"),M(A)):R(A)}}}function sU(e,t,a){let n=this;return r;function r(i){return i===null?a(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}var K1,zd,Z1=C(()=>{"use strict";Tt();Ae();K1={partial:!0,tokenize:sU},zd={concrete:!0,name:"codeFenced",tokenize:lU}});function cU(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),J(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):G(u)?e.attempt(uU,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||G(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function dU(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):J(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):G(i)?r(i):a(i)}}var js,uU,Y1=C(()=>{"use strict";Tt();Ae();js={name:"codeIndented",tokenize:cU},uU={partial:!0,tokenize:dU}});function fU(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function pU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mU(e,t,a){let n=this,r=0,o,i;return l;function l(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?a(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||G(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}var iy,Q1=C(()=>{"use strict";Ae();iy={name:"codeText",previous:pU,resolve:fU,tokenize:mU}});function Vs(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}var qd,J1=C(()=>{"use strict";qd=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Vs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let a=this.left.splice(t,Number.POSITIVE_INFINITY);Vs(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vs(this.left,a.reverse())}}}});function Hd(e){let t={},a=-1,n,r,o,i,l,s,u,c=new qd(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,hU(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return Lt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function hU(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,f=-1,p=a,m=0,x=0,I=[x];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(c=n.sliceStream(p),p.next||c.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=a;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(x=f+1,I.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):I.pop(),f=I.length;f--;){let y=l.slice(I[f],I[f+1]),w=o.pop();s.push([w,w+y.length-1]),e.splice(w,2,y)}for(s.reverse(),f=-1;++f<s.length;)u[m+s[f][0]]=m+s[f][1],m+=s[f][1]-s[f][0]-1;return u}var ly=C(()=>{"use strict";tr();J1()});function yU(e){return Hd(e),e}function wU(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):G(l)?e.check(gU,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function xU(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),J(e,o,"linePrefix")}function o(i){if(i===null||G(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var sy,gU,eL=C(()=>{"use strict";Tt();Ae();ly();sy={resolve:yU,tokenize:wU},gU={partial:!0,tokenize:xU}});function jd(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(y){return y===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||Ao(y)?a(y):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||G(y)?a(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!c&&(y===null||y===41||we(y))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||Ao(y)?a(y):(e.consume(y),y===92?I:x)}function I(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}var uy=C(()=>{"use strict";Ae()});function Vd(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(p){return e.enter(n),e.enter(r),e.consume(p),e.exit(r),e.enter(o),c}function c(p){return l>999||p===null||p===91||p===93&&!s||p===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):G(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||G(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!te(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var cy=C(()=>{"use strict";Ae()});function Gd(e,t,a,n,r,o){let i;return l;function l(f){return f===34||f===39||f===40?(e.enter(n),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,s):a(f)}function s(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):(e.enter(o),u(f))}function u(f){return f===i?(e.exit(o),s(i)):f===null?a(f):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),J(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||G(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}var dy=C(()=>{"use strict";Tt();Ae()});function Po(e,t){let a;return n;function n(r){return G(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):te(r)?J(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var fy=C(()=>{"use strict";Tt();Ae()});function bU(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return Vd.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=Yt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):a(p)}function s(p){return we(p)?Po(e,u)(p):u(p)}function u(p){return jd(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(vU,d,d)(p)}function d(p){return te(p)?J(e,f,"whitespace")(p):f(p)}function f(p){return p===null||G(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function SU(e,t,a){return n;function n(l){return we(l)?Po(e,r)(l):a(l)}function r(l){return Gd(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return te(l)?J(e,i,"whitespace")(l):i(l)}function i(l){return l===null||G(l)?t(l):a(l)}}var py,vU,tL=C(()=>{"use strict";uy();cy();Tt();dy();fy();Ae();$i();py={name:"definition",tokenize:bU},vU={partial:!0,tokenize:SU}});function IU(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return G(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var my,aL=C(()=>{"use strict";Ae();my={name:"hardBreakEscape",tokenize:IU}});function CU(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},Lt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function kU(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&n++<6?(e.consume(c),i):c===null||we(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||G(c)?(e.exit("atxHeading"),t(c)):te(c)?J(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||we(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var hy,nL=C(()=>{"use strict";Tt();Ae();tr();hy={name:"headingAtx",resolve:CU,tokenize:kU}});var rL,gy,oL=C(()=>{"use strict";rL=["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"],gy=["pre","script","style","textarea"]});function EU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function MU(e,t,a){let n=this,r,o,i,l,s;return u;function u(k){return c(k)}function c(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),f):k===47?(e.consume(k),o=!0,x):k===63?(e.consume(k),r=3,n.interrupt?t:v):Nt(k)?(e.consume(k),i=String.fromCharCode(k),I):a(k)}function f(k){return k===45?(e.consume(k),r=2,p):k===91?(e.consume(k),r=5,l=0,m):Nt(k)?(e.consume(k),r=4,n.interrupt?t:v):a(k)}function p(k){return k===45?(e.consume(k),n.interrupt?t:v):a(k)}function m(k){let Le="CDATA[";return k===Le.charCodeAt(l++)?(e.consume(k),l===Le.length?n.interrupt?t:U:m):a(k)}function x(k){return Nt(k)?(e.consume(k),i=String.fromCharCode(k),I):a(k)}function I(k){if(k===null||k===47||k===62||we(k)){let Le=k===47,St=i.toLowerCase();return!Le&&!o&&gy.includes(St)?(r=1,n.interrupt?t(k):U(k)):rL.includes(i.toLowerCase())?(r=6,Le?(e.consume(k),y):n.interrupt?t(k):U(k)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(k):o?w(k):g(k))}return k===45||wt(k)?(e.consume(k),i+=String.fromCharCode(k),I):a(k)}function y(k){return k===62?(e.consume(k),n.interrupt?t:U):a(k)}function w(k){return te(k)?(e.consume(k),w):L(k)}function g(k){return k===47?(e.consume(k),L):k===58||k===95||Nt(k)?(e.consume(k),b):te(k)?(e.consume(k),g):L(k)}function b(k){return k===45||k===46||k===58||k===95||wt(k)?(e.consume(k),b):T(k)}function T(k){return k===61?(e.consume(k),S):te(k)?(e.consume(k),T):g(k)}function S(k){return k===null||k===60||k===61||k===62||k===96?a(k):k===34||k===39?(e.consume(k),s=k,M):te(k)?(e.consume(k),S):R(k)}function M(k){return k===s?(e.consume(k),s=null,_):k===null||G(k)?a(k):(e.consume(k),M)}function R(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||we(k)?T(k):(e.consume(k),R)}function _(k){return k===47||k===62||te(k)?g(k):a(k)}function L(k){return k===62?(e.consume(k),z):a(k)}function z(k){return k===null||G(k)?U(k):te(k)?(e.consume(k),z):a(k)}function U(k){return k===45&&r===2?(e.consume(k),j):k===60&&r===1?(e.consume(k),$):k===62&&r===4?(e.consume(k),De):k===63&&r===3?(e.consume(k),v):k===93&&r===5?(e.consume(k),$e):G(k)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(LU,_e,B)(k)):k===null||G(k)?(e.exit("htmlFlowData"),B(k)):(e.consume(k),U)}function B(k){return e.check(TU,W,_e)(k)}function W(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),A}function A(k){return k===null||G(k)?B(k):(e.enter("htmlFlowData"),U(k))}function j(k){return k===45?(e.consume(k),v):U(k)}function $(k){return k===47?(e.consume(k),i="",We):U(k)}function We(k){if(k===62){let Le=i.toLowerCase();return gy.includes(Le)?(e.consume(k),De):U(k)}return Nt(k)&&i.length<8?(e.consume(k),i+=String.fromCharCode(k),We):U(k)}function $e(k){return k===93?(e.consume(k),v):U(k)}function v(k){return k===62?(e.consume(k),De):k===45&&r===2?(e.consume(k),v):U(k)}function De(k){return k===null||G(k)?(e.exit("htmlFlowData"),_e(k)):(e.consume(k),De)}function _e(k){return e.exit("htmlFlow"),t(k)}}function AU(e,t,a){let n=this;return r;function r(i){return G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):a(i)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}function RU(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(kn,t,a)}}var yy,LU,TU,iL=C(()=>{"use strict";Ae();oL();Nd();yy={concrete:!0,name:"htmlFlow",resolveTo:EU,tokenize:MU},LU={partial:!0,tokenize:RU},TU={partial:!0,tokenize:AU}});function DU(e,t,a){let n=this,r,o,i;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),s}function s(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),T):v===63?(e.consume(v),g):Nt(v)?(e.consume(v),R):a(v)}function u(v){return v===45?(e.consume(v),c):v===91?(e.consume(v),o=0,m):Nt(v)?(e.consume(v),w):a(v)}function c(v){return v===45?(e.consume(v),p):a(v)}function d(v){return v===null?a(v):v===45?(e.consume(v),f):G(v)?(i=d,$(v)):(e.consume(v),d)}function f(v){return v===45?(e.consume(v),p):d(v)}function p(v){return v===62?j(v):v===45?f(v):d(v)}function m(v){let De="CDATA[";return v===De.charCodeAt(o++)?(e.consume(v),o===De.length?x:m):a(v)}function x(v){return v===null?a(v):v===93?(e.consume(v),I):G(v)?(i=x,$(v)):(e.consume(v),x)}function I(v){return v===93?(e.consume(v),y):x(v)}function y(v){return v===62?j(v):v===93?(e.consume(v),y):x(v)}function w(v){return v===null||v===62?j(v):G(v)?(i=w,$(v)):(e.consume(v),w)}function g(v){return v===null?a(v):v===63?(e.consume(v),b):G(v)?(i=g,$(v)):(e.consume(v),g)}function b(v){return v===62?j(v):g(v)}function T(v){return Nt(v)?(e.consume(v),S):a(v)}function S(v){return v===45||wt(v)?(e.consume(v),S):M(v)}function M(v){return G(v)?(i=M,$(v)):te(v)?(e.consume(v),M):j(v)}function R(v){return v===45||wt(v)?(e.consume(v),R):v===47||v===62||we(v)?_(v):a(v)}function _(v){return v===47?(e.consume(v),j):v===58||v===95||Nt(v)?(e.consume(v),L):G(v)?(i=_,$(v)):te(v)?(e.consume(v),_):j(v)}function L(v){return v===45||v===46||v===58||v===95||wt(v)?(e.consume(v),L):z(v)}function z(v){return v===61?(e.consume(v),U):G(v)?(i=z,$(v)):te(v)?(e.consume(v),z):_(v)}function U(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),r=v,B):G(v)?(i=U,$(v)):te(v)?(e.consume(v),U):(e.consume(v),W)}function B(v){return v===r?(e.consume(v),r=void 0,A):v===null?a(v):G(v)?(i=B,$(v)):(e.consume(v),B)}function W(v){return v===null||v===34||v===39||v===60||v===61||v===96?a(v):v===47||v===62||we(v)?_(v):(e.consume(v),W)}function A(v){return v===47||v===62||we(v)?_(v):a(v)}function j(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):a(v)}function $(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),We}function We(v){return te(v)?J(e,$e,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):$e(v)}function $e(v){return e.enter("htmlTextData"),i(v)}}var wy,lL=C(()=>{"use strict";Tt();Ae();wy={name:"htmlText",tokenize:DU}});function NU(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&Lt(e,0,e.length,a),e}function BU(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=ra(l,e.slice(o+1,o+n+3)),l=ra(l,[["enter",c,t]]),l=ra(l,Vr(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ra(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ra(l,e.slice(i+1)),l=ra(l,[["exit",s,t]]),Lt(e,o,e.length,l),e}function UU(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(f){return o?o._inactive?d(f):(i=n.parser.defined.includes(Yt(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),s):a(f)}function s(f){return f===40?e.attempt(_U,c,i?c:d)(f):f===91?e.attempt(OU,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(PU,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function FU(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return we(d)?Po(e,o)(d):o(d)}function o(d){return d===41?c(d):jd(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return we(d)?Po(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Gd(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return we(d)?Po(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function zU(e,t,a){let n=this;return r;function r(l){return Vd.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(Yt(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function qU(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var No,_U,OU,PU,Wd=C(()=>{"use strict";uy();cy();dy();fy();Ae();tr();$i();qs();No={name:"labelEnd",resolveAll:NU,resolveTo:BU,tokenize:UU},_U={tokenize:FU},OU={tokenize:zU},PU={tokenize:qU}});function HU(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var xy,sL=C(()=>{"use strict";Wd();xy={name:"labelStartImage",resolveAll:No.resolveAll,tokenize:HU}});function jU(e,t,a){let n=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var vy,uL=C(()=>{"use strict";Wd();vy={name:"labelStartLink",resolveAll:No.resolveAll,tokenize:jU}});function VU(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),J(e,t,"linePrefix")}}var Gs,cL=C(()=>{"use strict";Tt();Gs={name:"lineEnding",tokenize:VU}});function GU(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||G(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),te(u)?J(e,l,"whitespace")(u):l(u))}}var Bo,by=C(()=>{"use strict";Tt();Ae();Bo={name:"thematicBreak",tokenize:GU}});function XU(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(p){let m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Fs(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Bo,a,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return a(p)}function s(p){return Fs(p)&&++i<10?(e.consume(p),s):(!n.interrupt||i<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):a(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(kn,n.interrupt?a:c,e.attempt(WU,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return te(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):a(p)}function f(p){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function KU(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(kn,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,J(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!te(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt($U,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,J(e,e.attempt(Qt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ZU(e,t,a){let n=this;return J(e,r,"listItemIndent",n.containerState.size+1);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(o):a(o)}}function YU(e){e.exit(this.containerState.type)}function QU(e,t,a){let n=this;return J(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let i=n.events[n.events.length-1];return!te(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Qt,WU,$U,dL=C(()=>{"use strict";Tt();Ae();Nd();by();Qt={continuation:{tokenize:KU},exit:YU,name:"list",tokenize:XU},WU={partial:!0,tokenize:QU},$U={partial:!0,tokenize:ZU}});function JU(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function eF(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),te(u)?J(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||G(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var $d,fL=C(()=>{"use strict";Tt();Ae();$d={name:"setextUnderline",resolveTo:JU,tokenize:eF}});var Xd=C(()=>{"use strict";V1();G1();Nd();W1();$1();X1();Z1();Y1();Q1();eL();tL();aL();nL();iL();lL();Wd();sL();uL();cL();dL();fL();by()});function Sy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oF,continuation:{tokenize:iF},exit:lF}},text:{91:{name:"gfmFootnoteCall",tokenize:rF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aF,resolveTo:nF}}}}function aF(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let s=n.events[r][1];if(s.type==="labelImage"){i=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return l;function l(s){if(!i||!i._balanced)return a(s);let u=Yt(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function nF(e,t){let a=e.length,n;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...s),e}function rF(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?a(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!i||d===null||d===91||we(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(Yt(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return we(d)||(i=!0),o++,e.consume(d),d===92?c:u}function c(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function oF(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,l;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(m)}function c(m){if(i>999||m===93&&!l||m===null||m===91||we(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Yt(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return we(m)||(l=!0),i++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),i++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(o)||r.push(o),J(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function iF(e,t,a){return e.check(kn,t,e.attempt(tF,t,a))}function lF(e){e.exit("gfmFootnoteDefinition")}function sF(e,t,a){let n=this;return J(e,r,"gfmFootnoteDefinitionIndent",5);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(o):a(o)}}var tF,pL=C(()=>{"use strict";Xd();Tt();Ae();$i();tF={tokenize:sF,partial:!0}});var mL=C(()=>{"use strict";pL()});function Iy(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:r};return a==null&&(a=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(i,l){let s=-1;for(;++s<i.length;)if(i[s][0]==="enter"&&i[s][1].type==="strikethroughSequenceTemporary"&&i[s][1]._close){let u=s;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[s][1].end.offset-i[s][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[s][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[s][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[s][1].start)},f=[["enter",c,l],["enter",i[u][1],l],["exit",i[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&Lt(f,f.length,0,Vr(p,i.slice(u+1,s),l)),Lt(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),Lt(i,u-1,s-u+3,f),s=u+f.length-2;break}}for(s=-1;++s<i.length;)i[s][1].type==="strikethroughSequenceTemporary"&&(i[s][1].type="data");return i}function o(i,l,s){let u=this.previous,c=this.events,d=0;return f;function f(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?s(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){let x=er(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let I=i.exit("strikethroughSequenceTemporary"),y=er(m);return I._open=!y||y===2&&!!x,I._close=!x||x===2&&!!y,l(m)}}}var hL=C(()=>{"use strict";tr();Md();qs()});var gL=C(()=>{"use strict";hL()});function uF(e,t,a,n){let r=0;if(!(a===0&&n.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=a,e.map[r][2].push(...n);return}r+=1}e.map.push([t,a,n])}}var Kd,yL=C(()=>{"use strict";Kd=class{constructor(){this.map=[]}add(t,a,n){uF(this,t,a,n)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let a=this.map.length,n=[];for(;a>0;)a-=1,n.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];n.push(t.slice()),t.length=0;let r=n.pop();for(;r;){for(let o of r)t.push(o);r=n.pop()}this.map.length=0}}});function wL(e,t){let a=!1,n=[];for(;t<e.length;){let r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return n}var xL=C(()=>{"use strict"});function Cy(){return{flow:{null:{name:"table",tokenize:cF,resolveAll:dF}}}}function cF(e,t,a){let n=this,r=0,o=0,i;return l;function l(L){let z=n.events.length-1;for(;z>-1;){let W=n.events[z][1].type;if(W==="lineEnding"||W==="linePrefix")z--;else break}let U=z>-1?n.events[z][1].type:null,B=U==="tableHead"||U==="tableRow"?S:s;return B===S&&n.parser.lazy[n.now().line]?a(L):B(L)}function s(L){return e.enter("tableHead"),e.enter("tableRow"),u(L)}function u(L){return L===124||(i=!0,o+=1),c(L)}function c(L){return L===null?a(L):G(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):te(L)?J(e,c,"whitespace")(L):(o+=1,i&&(i=!1,r+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(L)))}function d(L){return L===null||L===124||we(L)?(e.exit("data"),c(L)):(e.consume(L),L===92?f:d)}function f(L){return L===92||L===124?(e.consume(L),d):d(L)}function p(L){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(L):(e.enter("tableDelimiterRow"),i=!1,te(L)?J(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?I(L):L===124?(i=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):T(L)}function x(L){return te(L)?J(e,I,"whitespace")(L):I(L)}function I(L){return L===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),y):L===45?(o+=1,y(L)):L===null||G(L)?b(L):T(L)}function y(L){return L===45?(e.enter("tableDelimiterFiller"),w(L)):T(L)}function w(L){return L===45?(e.consume(L),w):L===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(L))}function g(L){return te(L)?J(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||G(L)?!i||r!==o?T(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):T(L)}function T(L){return a(L)}function S(L){return e.enter("tableRow"),M(L)}function M(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):L===null||G(L)?(e.exit("tableRow"),t(L)):te(L)?J(e,M,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||we(L)?(e.exit("data"),M(L)):(e.consume(L),L===92?_:R)}function _(L){return L===92||L===124?(e.consume(L),R):R(L)}}function dF(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],l=!1,s=0,u,c,d,f=new Kd;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(vL(f,t,s,u,c),c=void 0,s=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],l&&(l=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",c,t]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=Zd(f,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=Zd(f,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):m.type==="tableHead"?(l=!0,s=a):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=a,o[1]!==0?(i[0]=i[1],d=Zd(f,t,o,r,a,d)):i[1]!==0&&(d=Zd(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&vL(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=wL(t.events,a))}return e}function Zd(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Qi(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Qi(t.events,a[1]);if(o={type:i,start:Object.assign({},s),end:Object.assign({},s)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Qi(t.events,a[2]),c=Qi(t.events,a[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let f=t.events[a[2]],p=t.events[a[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",a[3]>a[2]+1){let m=a[2]+1,x=a[3]-a[2]-1;e.add(m,x,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Qi(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function vL(e,t,a,n,r){let o=[],i=Qi(t.events,a);r&&(r.end=Object.assign({},i),o.push(["exit",r,t])),n.end=Object.assign({},i),o.push(["exit",n,t]),e.add(a+1,0,o)}function Qi(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var bL=C(()=>{"use strict";Tt();Ae();yL();xL()});var SL=C(()=>{"use strict";bL()});function ky(){return{text:{91:fF}}}function pF(e,t,a){let n=this;return r;function r(s){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return we(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),i):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),i):a(s)}function i(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):a(s)}function l(s){return G(s)?t(s):te(s)?e.check({tokenize:mF},t,a)(s):a(s)}}function mF(e,t,a){return J(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var fF,IL=C(()=>{"use strict";Tt();Ae();fF={name:"tasklistCheck",tokenize:pF}});var CL=C(()=>{"use strict";IL()});function kL(e){return Pd([ny(),Sy(),Iy(e),Cy(),ky()])}var LL=C(()=>{"use strict";ty();H1();mL();gL();SL();CL()});function Yd(e){let t=this,a=e||hF,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(kL(a)),o.push(Jg()),i.push(ey(a))}var hF,TL=C(()=>{"use strict";R1();LL();hF={}});var EL=C(()=>{"use strict";TL()});var gF,yF,wF,ML,xF,vF,AL,_L,OL,bF,SF,IF,CF,kF,LF,TF,Uo,PL,EF,MF,AF,RF,DF,_F,RL,Gr,Ji,OF,NL,Jd,PF,BL,Ty,NF,BF,UL,UF,FF,zF,qF,HF,jF,VF,GF,WF,FL,$F,XF,KF,ZF,YF,QF,Qd,JF,e4,t4,a4,n4,r4,o4,i4,l4,s4,DL,u4,zL,c4,d4,f4,p4,m4,h4,Ly,_a,g4,y4,w4,qL,HL=C(()=>{"use strict";gF=Object.defineProperty,yF=Object.defineProperties,wF=Object.getOwnPropertyDescriptors,ML=Object.getOwnPropertySymbols,xF=Object.prototype.hasOwnProperty,vF=Object.prototype.propertyIsEnumerable,AL=(e,t,a)=>t in e?gF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,_L=(e,t)=>{for(var a in t||(t={}))xF.call(t,a)&&AL(e,a,t[a]);if(ML)for(var a of ML(t))vF.call(t,a)&&AL(e,a,t[a]);return e},OL=(e,t)=>yF(e,wF(t)),bF=/(\*\*)([^*]*\*?)$/,SF=/(__)([^_]*?)$/,IF=/(\*\*\*)([^*]*?)$/,CF=/(\*)([^*]*?)$/,kF=/(_)([^_]*?)$/,LF=/(`)([^`]*?)$/,TF=/(~~)([^~]*?)$/,Uo=/^[\s_~*`]*$/,PL=/^[\s]*[-*+][\s]+$/,EF=/[\p{L}\p{N}_]/u,MF=/^```[^`\n]*```?$/,AF=/^\*{4,}$/,RF=/(__)([^_]+)_$/,DF=/(~~)([^~]+)~$/,_F=/__/g,RL=/~~/g,Gr=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:EF.test(e)},Ji=(e,t)=>{let a=!1;for(let n=0;n<t;n+=1)e[n]==="`"&&e[n+1]==="`"&&e[n+2]==="`"&&(a=!a,n+=2);return a},OF=(e,t)=>{let a=1;for(let n=t-1;n>=0;n-=1)if(e[n]==="]")a+=1;else if(e[n]==="["&&(a-=1,a===0))return n;return-1},NL=(e,t)=>{let a=1;for(let n=t+1;n<e.length;n+=1)if(e[n]==="[")a+=1;else if(e[n]==="]"&&(a-=1,a===0))return n;return-1},Jd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]==="\\"&&e[r+1]==="$"){r+=1;continue}e[r]==="$"&&(e[r+1]==="$"?(n=!n,r+=1,a=!1):n||(a=!a))}return a||n},PF=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
+
`)return!1}return!1},BL=(e,t)=>{for(let a=t-1;a>=0;a-=1){if(e[a]===")")return!1;if(e[a]==="(")return a>0&&e[a-1]==="]"?PF(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},Ty=(e,t,a)=>{let n=0;for(let s=t-1;s>=0;s-=1)if(e[s]===`
|
|
27
27
|
`){n=s+1;break}let r=e.length;for(let s=t;s<e.length;s+=1)if(e[s]===`
|
|
28
|
-
`){r=s;break}let o=e.substring(n,r),i=0,l=!1;for(let s of o)if(s===a)i+=1;else if(s!==" "&&s!==" "){l=!0;break}return i>=3&&!l},
|
|
29
|
-
`){n=r+1;break}for(let r=n;r<t;r+=1)if(e[r]!==" "&&e[r]!==" ")return!1;return!0},
|
|
30
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
31
|
-
`)?!0:
|
|
32
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
33
|
-
`)?!0:
|
|
34
|
-
`;)t-=1;if(t<e.length){let a=e.slice(0,t),n=e.slice(t);return`${a}_${n}`}return`${e}_`},
|
|
35
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,
|
|
28
|
+
`){r=s;break}let o=e.substring(n,r),i=0,l=!1;for(let s of o)if(s===a)i+=1;else if(s!==" "&&s!==" "){l=!0;break}return i>=3&&!l},NF=(e,t,a)=>{if(a!==" "&&a!==" ")return!1;let n=0;for(let r=t-1;r>=0;r-=1)if(e[r]===`
|
|
29
|
+
`){n=r+1;break}for(let r=n;r<t;r+=1)if(e[r]!==" "&&e[r]!==" ")return!1;return!0},BF=(e,t,a,n)=>a==="\\"||e.includes("$")&&Jd(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&Gr(a)&&Gr(n)||NF(e,t,n)),UL=e=>{let t=0,a=e.length;for(let n=0;n<a;n+=1){if(e[n]!=="*")continue;let r=n>0?e[n-1]:"",o=n<a-1?e[n+1]:"";BF(e,n,r,o)||(t+=1)}return t},UF=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&Jd(e,t)||BL(e,t)||a==="_"||n==="_"||a&&n&&Gr(a)&&Gr(n)),FF=e=>{let t=0,a=e.length;for(let n=0;n<a;n+=1){if(e[n]!=="_")continue;let r=n>0?e[n-1]:"",o=n<a-1?e[n+1]:"";UF(e,n,r,o)||(t+=1)}return t},zF=e=>{let t=0,a=0;for(let n=0;n<e.length;n+=1)e[n]==="*"?a+=1:(a>=3&&(t+=Math.floor(a/3)),a=0);return a>=3&&(t+=Math.floor(a/3)),t},qF=(e,t,a)=>{if(!t||Uo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
30
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return PL.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:Ty(e,a,"*")},HF=e=>{let t=e.match(bF);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return Ji(e,n)||qF(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},jF=(e,t,a)=>{if(!t||Uo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
32
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return PL.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:Ty(e,a,"_")},VF=e=>{let t=e.match(SF);if(!t){let r=e.match(RF);if(r){let o=e.lastIndexOf(r[1]);if(!Ji(e,o)&&(e.match(_F)||[]).length%2===1)return`${e}_`}return e}let a=t[2],n=e.lastIndexOf(t[1]);return Ji(e,n)||jF(e,a,n)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},GF=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!Jd(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&Gr(a)&&Gr(n))continue;return t}return-1},WF=e=>{if(!e.match(CF))return e;let t=GF(e);if(t===-1||Ji(e,t))return e;let a=e.substring(t+1);return!a||Uo.test(a)?e:UL(e)%2===1?`${e}*`:e},FL=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!Jd(e,t)&&!BL(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&Gr(a)&&Gr(n))continue;return t}return-1},$F=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
34
|
+
`;)t-=1;if(t<e.length){let a=e.slice(0,t),n=e.slice(t);return`${a}_${n}`}return`${e}_`},XF=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!==1)return null;let a=t.indexOf("**"),n=FL(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},KF=e=>{if(!e.match(kF))return e;let t=FL(e);if(t===-1||Ji(e,t))return e;let a=e.substring(t+1);if(!a||Uo.test(a))return e;if(FF(e)%2===1){let n=XF(e);return n!==null?n:$F(e)}return e},ZF=e=>{let t=(e.match(/\*\*/g)||[]).length,a=UL(e);return t%2===0&&a%2===0},YF=(e,t,a)=>!t||Uo.test(t)||Ji(e,a)?!0:Ty(e,a,"*"),QF=e=>{if(AF.test(e))return e;let t=e.match(IF);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return YF(e,a,n)?e:zF(e)%2===1?ZF(e)?e:`${e}***`:e},Qd=(e,t)=>{let a=!1,n=!1;for(let r=0;r<t;r+=1){if(e.substring(r,r+3)==="```"){n=!n,r+=2;continue}!n&&e[r]==="`"&&(a=!a)}return a||n},JF=(e,t)=>{let a=e.substring(t,t+3)==="```",n=t>0&&e.substring(t-1,t+2)==="```",r=t>1&&e.substring(t-2,t+1)==="```";return a||n||r},e4=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!JF(e,a)&&(t+=1);return t},t4=e=>!e.match(MF)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,a4=e=>(e.match(/```/g)||[]).length%2===1,n4=e=>{let t=t4(e);if(t!==null)return t;let a=e.match(LF);if(a&&!a4(e)){let n=a[2];if(!n||Uo.test(n))return e;if(e4(e)%2===1)return`${e}\``}return e},r4=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",o4=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!r4(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},i4=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
36
36
|
`,t)!==-1&&!e.endsWith(`
|
|
37
37
|
`)?`${e}
|
|
38
|
-
$$`:`${e}$$`},
|
|
39
|
-
`);if(t===-1)return e;let a=e.substring(t+1),n=e.substring(0,t),r=a.trim();if(
|
|
40
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(
|
|
41
|
-
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},J4=e=>{let t=e.match(d4);if(t){let a=t[2];if(!a||Bo.test(a))return e;if((e.match(vL)||[]).length%2===1)return`${e}~~`}else if(e.match(g4)&&(e.match(vL)||[]).length%2===1)return`${e}~`;return e},xy=e=>e!==!1,Da={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},eF=[{handler:{name:"setextHeadings",handle:Y4,priority:Da.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ML,priority:Da.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:N4,priority:Da.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:L4,priority:Da.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:E4,priority:Da.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:A4,priority:Da.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:_4,priority:Da.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:q4,priority:Da.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:J4,priority:Da.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:G4,priority:Da.KATEX},optionKey:"katex"}],tF=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return eF.filter(({handler:n,optionKey:r})=>n.name==="links"?xy(e?.links)||xy(e?.images):xy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:IL(SL({},n),{handle:o=>ML(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},aF=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=tF(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:IL(SL({},l),{priority:(s=l.priority)!=null?s:Da.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:Da.DEFAULT)-((c=s.handler.priority)!=null?c:Da.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},AL=aF});function DL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var _L=C(()=>{"use strict"});function Zd(e,t){return((t||oF).jsx?rF:nF).test(e)}var nF,rF,oF,OL=C(()=>{"use strict";nF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oF={}});var PL=C(()=>{"use strict";OL()});function by(e){return typeof e=="object"?e.type==="text"?NL(e.value):!1:NL(e)}function NL(e){return e.replace(iF,"")===""}var iF,BL=C(()=>{"use strict";iF=/[ \t\n\f\r]/g});var UL=C(()=>{"use strict";BL()});var nr,Sy=C(()=>{"use strict";nr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};nr.prototype.normal={};nr.prototype.property={};nr.prototype.space=void 0});function Iy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new nr(a,n,t)}var FL=C(()=>{"use strict";Sy()});function Vs(e){return e.toLowerCase()}var Cy=C(()=>{"use strict"});var jt,ky=C(()=>{"use strict";jt=class{constructor(t,a){this.attribute=a,this.property=t}};jt.prototype.attribute="";jt.prototype.booleanish=!1;jt.prototype.boolean=!1;jt.prototype.commaOrSpaceSeparated=!1;jt.prototype.commaSeparated=!1;jt.prototype.defined=!1;jt.prototype.mustUseProperty=!1;jt.prototype.number=!1;jt.prototype.overloadedBoolean=!1;jt.prototype.property="";jt.prototype.spaceSeparated=!1;jt.prototype.space=void 0});var Gs={};ku(Gs,{boolean:()=>fe,booleanish:()=>xt,commaOrSpaceSeparated:()=>ga,commaSeparated:()=>Wr,number:()=>F,overloadedBoolean:()=>Qd,spaceSeparated:()=>He});function Uo(){return 2**++lF}var lF,fe,xt,Qd,F,He,Wr,ga,Ws=C(()=>{"use strict";lF=0,fe=Uo(),xt=Uo(),Qd=Uo(),F=Uo(),He=Uo(),Wr=Uo(),ga=Uo()});function zL(e,t,a){a&&(e[t]=a)}var Ly,Fo,Ty=C(()=>{"use strict";ky();Ws();Ly=Object.keys(Gs),Fo=class extends jt{constructor(t,a,n,r){let o=-1;if(super(t,a),zL(this,"space",r),typeof n=="number")for(;++o<Ly.length;){let i=Ly[o];zL(this,Ly[o],(n&Gs[i])===Gs[i])}}};Fo.prototype.defined=!0});function Za(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new Fo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Vs(n)]=n,a[Vs(o.attribute)]=n}return new nr(t,a,e.space)}var zo=C(()=>{"use strict";Cy();Ty();Sy()});var Ey,qL=C(()=>{"use strict";zo();Ws();Ey=Za({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:He,ariaCurrent:null,ariaDescribedBy:He,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:He,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:He,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:He,ariaLevel:F,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:He,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:He,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:xt,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Yd(e,t){return t in e?e[t]:t}var My=C(()=>{"use strict"});function Jd(e,t){return Yd(e,t.toLowerCase())}var Ay=C(()=>{"use strict";My()});var HL,jL=C(()=>{"use strict";Ay();zo();Ws();HL=Za({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:He,accessKey:He,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:He,autoFocus:fe,autoPlay:fe,blocking:He,capture:null,charSet:null,checked:fe,cite:null,className:He,cols:F,colSpan:null,content:null,contentEditable:xt,controls:fe,controlsList:He,coords:F|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Qd,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:He,height:F,hidden:Qd,high:F,href:null,hrefLang:null,htmlFor:He,httpEquiv:He,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:He,itemRef:He,itemScope:fe,itemType:He,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,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:fe,optimum:F,pattern:null,ping:He,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:He,required:fe,reversed:fe,rows:F,rowSpan:F,sandbox:He,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:xt,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:He,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Jd})});var VL,GL=C(()=>{"use strict";My();zo();Ws();VL=Za({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ga,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:He,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:ga,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:He,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ga,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ga,rev:ga,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ga,requiredFeatures:ga,requiredFonts:ga,requiredFormats:ga,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:ga,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ga,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ga,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yd})});var Ry,WL=C(()=>{"use strict";zo();Ry=Za({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}})});var Dy,$L=C(()=>{"use strict";zo();Ay();Dy=Za({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jd})});var _y,XL=C(()=>{"use strict";zo();_y=Za({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Oy,KL=C(()=>{"use strict";Oy={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"}});function Py(e,t){let a=Vs(t),n=t,r=jt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&uF.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(ZL,dF);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!ZL.test(o)){let i=o.replace(sF,cF);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Fo}return new r(n,t)}function cF(e){return"-"+e.toLowerCase()}function dF(e){return e.charAt(1).toUpperCase()}var sF,ZL,uF,QL=C(()=>{"use strict";Ty();ky();Cy();sF=/[A-Z]/g,ZL=/-[a-z]/g,uF=/^data[-\w.:]+$/i});var YL,ef,JL=C(()=>{"use strict";FL();qL();jL();GL();WL();$L();XL();KL();QL();YL=Iy([Ey,HL,Ry,Dy,_y],"html"),ef=Iy([Ey,VL,Ry,Dy,_y],"svg")});function eT(e){return e.join(" ").trim()}var tT=C(()=>{"use strict"});var lT=Kt((fY,iT)=>{"use strict";var aT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,fF=/\n/g,pF=/^\s*/,mF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hF=/^:\s*/,gF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yF=/^[;\s]*/,wF=/^\s+|\s+$/g,xF=`
|
|
42
|
-
`,nT="/",rT="*",qo="",vF="comment",bF="declaration";function SF(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function r(m){var x=m.match(fF);x&&(a+=x.length);var I=m.lastIndexOf(xF);n=~I?m.length-I:n+m.length}function o(){var m={line:a,column:n};return function(x){return x.position=new i(m),u(),x}}function i(m){this.start=m,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function l(m){var x=new Error(t.source+":"+a+":"+n+": "+m);if(x.reason=m,x.filename=t.source,x.line=a,x.column=n,x.source=e,!t.silent)throw x}function s(m){var x=m.exec(e);if(x){var I=x[0];return r(I),e=e.slice(I.length),x}}function u(){s(pF)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(nT!=e.charAt(0)||rT!=e.charAt(1))){for(var x=2;qo!=e.charAt(x)&&(rT!=e.charAt(x)||nT!=e.charAt(x+1));)++x;if(x+=2,qo===e.charAt(x-1))return l("End of comment missing");var I=e.slice(2,x-2);return n+=2,r(I),e=e.slice(x),n+=2,m({type:vF,comment:I})}}function f(){var m=o(),x=s(mF);if(x){if(d(),!s(hF))return l("property missing ':'");var I=s(gF),y=m({type:bF,property:oT(x[0].replace(aT,qo)),value:I?oT(I[0].replace(aT,qo)):qo});return s(yF),y}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function oT(e){return e?e.replace(wF,qo):qo}iT.exports=SF});var sT=Kt($s=>{"use strict";var IF=$s&&$s.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($s,"__esModule",{value:!0});$s.default=kF;var CF=IF(lT());function kF(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,CF.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:l}=o;r?t(i,l,o):l&&(a=a||{},a[i]=l)}),a}});var cT=Kt(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.camelCase=void 0;var LF=/^--[a-zA-Z0-9_-]+$/,TF=/-([a-z])/g,EF=/^[^-]+$/,MF=/^-(webkit|moz|ms|o|khtml)-/,AF=/^-(ms)-/,RF=function(e){return!e||EF.test(e)||LF.test(e)},DF=function(e,t){return t.toUpperCase()},uT=function(e,t){return"".concat(t,"-")},_F=function(e,t){return t===void 0&&(t={}),RF(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(AF,uT):e=e.replace(MF,uT),e.replace(TF,DF))};tf.camelCase=_F});var fT=Kt((By,dT)=>{"use strict";var OF=By&&By.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},PF=OF(sT()),NF=cT();function Ny(e,t){var a={};return!e||typeof e!="string"||(0,PF.default)(e,function(n,r){n&&r&&(a[(0,NF.camelCase)(n,t)]=r)}),a}Ny.default=Ny;dT.exports=Ny});function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pT(e.position):"start"in e||"end"in e?pT(e):"line"in e||"column"in e?Uy(e):""}function Uy(e){return mT(e&&e.line)+":"+mT(e&&e.column)}function pT(e){return Uy(e&&e.start)+"-"+Uy(e&&e.end)}function mT(e){return e&&typeof e=="number"?e:1}var hT=C(()=>{"use strict"});var Fy=C(()=>{"use strict";hT()});var Et,gT=C(()=>{"use strict";Fy();Et=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=$r(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=i&&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}};Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0});var zy=C(()=>{"use strict";gT()});function Hy(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=XF(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=$F(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ef:YL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=xT(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function xT(e,t,a){if(t.type==="element")return qF(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VF(e,t,a);if(t.type==="mdxjsEsm")return jF(e,t);if(t.type==="root")return GF(e,t,a);if(t.type==="text")return WF(e,t)}function qF(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ef,e.schema=r),e.ancestors.push(t);let o=bT(e,t.tagName,!1),i=KF(e,t),l=Vy(e,t);return FF.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!by(s):!0})),vT(e,i,o,t),jy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function HF(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Xs(e,t.position)}function jF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xs(e,t.position)}function VF(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=ef,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:bT(e,t.name,!0),i=ZF(e,t),l=Vy(e,t);return vT(e,i,o,t),jy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function GF(e,t,a){let n={};return jy(n,Vy(e,t)),e.create(t,e.Fragment,n,a)}function WF(e,t){return t.value}function vT(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function jy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function $F(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function XF(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=Vi(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function KF(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&qy.call(t.properties,r)){let o=QF(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&zF.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function ZF(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else Xs(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Xs(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Vy(e,t){let a=[],n=-1,r=e.passKeys?new Map:BF;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=xT(e,o,i);l!==void 0&&a.push(l)}return a}function QF(e,t,a){let n=Py(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?DL(a):eT(a)),n.property==="style"){let r=typeof a=="object"?a:YF(e,String(a));return e.stylePropertyNameCase==="css"&&(r=JF(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Oy[n.property]||n.property:n.attribute,a]}}function YF(e,t){try{return(0,yT.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=wT+"#cannot-parse-style-attribute",r}}function bT(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=Zd(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=Zd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return qy.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Xs(e)}function Xs(e,t){let a=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=wT+"#cannot-handle-mdx-estrees-without-createevaluater",a}function JF(e){let t={},a;for(a in e)qy.call(e,a)&&(t[ez(a)]=e[a]);return t}function ez(e){let t=e.replace(UF,tz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function tz(e){return"-"+e.toLowerCase()}var yT,qy,BF,UF,FF,zF,wT,ST=C(()=>{"use strict";_L();PL();UL();JL();tT();yT=z(fT(),1);Ps();zy();qy={}.hasOwnProperty,BF=new Map,UF=/[A-Z]/g,FF=new Set(["table","tbody","thead","tfoot","tr"]),zF=new Set(["td","th"]),wT="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var IT=C(()=>{"use strict";ST()});function az(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),J(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return V(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var CT,kT=C(()=>{"use strict";Tt();Ae();CT={tokenize:az}});function nz(e){let t=this,a=[],n=0,r,o,i;return l;function l(g){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let b=t.events.length,T=b,S;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){S=t.events[T][1].end;break}y(n);let M=b;for(;M<t.events.length;)t.events[M][1].end={...S},M++;return Lt(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(g)}return l(g)}function u(g){if(n===a.length){if(!r)return f(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LT,c,d)(g)}function c(g){return r&&w(),y(n),f(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(g)}function f(g){return t.containerState={},e.attempt(LT,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&w(),y(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return V(g)?(e.consume(g),I(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function I(g,b){let T=t.sliceStream(g);if(b&&T.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(T),t.parser.lazy[g.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<i&&(!r.events[S][1].end||r.events[S][1].end.offset>i))return;let M=t.events.length,R=M,_,k;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){k=t.events[R][1].end;break}_=!0}for(y(n),S=M;S<t.events.length;)t.events[S][1].end={...k},S++;Lt(t.events,R+1,0,t.events.slice(M)),t.events.length=S}}function y(g){let b=a.length;for(;b-- >g;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function rz(e,t,a){return J(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var TT,LT,ET=C(()=>{"use strict";Tt();Ae();tr();TT={tokenize:nz},LT={tokenize:rz}});function oz(e){let t=this,a=e.attempt(Cn,n,e.attempt(this.parser.constructs.flowInitial,r,J(e,e.attempt(this.parser.constructs.flow,r,e.attempt(ty,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var MT,AT=C(()=>{"use strict";Vd();Tt();MT={tokenize:oz}});function OT(e){return{resolveAll:PT(e==="text"?iz:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],f=-1;if(d)for(;++f<d.length;){let p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function PT(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function iz(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var RT,DT,_T,Gy=C(()=>{"use strict";RT={resolveAll:PT()},DT=OT("string"),_T=OT("text")});var Wy={};ku(Wy,{attentionMarkers:()=>mz,contentInitial:()=>sz,disable:()=>hz,document:()=>lz,flow:()=>cz,flowInitial:()=>uz,insideSpan:()=>pz,string:()=>dz,text:()=>fz});var lz,sz,uz,cz,dz,fz,pz,mz,hz,NT=C(()=>{"use strict";Vd();Gy();lz={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:_d},sz={91:iy},uz={[-2]:qs,[-1]:qs,32:qs},cz={35:sy,42:No,45:[jd,No],60:cy,61:jd,95:No,96:Nd,126:Nd},dz={38:Pd,92:Od},fz={[-5]:js,[-4]:js,[-3]:js,33:fy,38:Pd,42:zs,60:[Yg,dy],91:py,92:[ly,Od],93:Po,95:zs,96:Jg},pz={null:[zs,RT]},mz={null:[42,95]},hz={null:[]}});function BT(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:_(M),check:_(R),consume:b,enter:T,exit:S,interrupt:_(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:I,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p},d=t.tokenize.call(c,u),f;return t.resolveAll&&o.push(t),c;function p(U){return i=ra(i,U),w(),i[i.length-1]!==null?[]:(k(t,0),c.events=Vr(o,c.events,c),c.events)}function m(U,W){return yz(x(U),W)}function x(U){return gz(i,U)}function I(){let{_bufferIndex:U,_index:W,line:A,column:H,offset:$}=n;return{_bufferIndex:U,_index:W,line:A,column:H,offset:$}}function y(U){r[U.line]=U.column,B()}function w(){let U;for(;n._index<i.length;){let W=i[n._index];if(typeof W=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<W.length;)g(W.charCodeAt(n._bufferIndex));else g(W)}}function g(U){s=void 0,f=U,d=d(U)}function b(U){V(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,B()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=U,s=!0}function T(U,W){let A=W||{};return A.type=U,A.start=I(),c.events.push(["enter",A,c]),l.push(A),A}function S(U){let W=l.pop();return W.end=I(),c.events.push(["exit",W,c]),W}function M(U,W){k(U,W.from)}function R(U,W){W.restore()}function _(U,W){return A;function A(H,$,We){let $e,v,De,_e;return Array.isArray(H)?ke(H):"tokenize"in H?ke([H]):L(H);function L(ve){return X;function X(pe){let ue=pe!==null&&ve[pe],oe=pe!==null&&ve.null,ye=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ke(ye)(pe)}}function ke(ve){return $e=ve,v=0,ve.length===0?We:St(ve[v])}function St(ve){return X;function X(pe){return _e=G(),De=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?Ut(pe):ve.tokenize.call(W?Object.assign(Object.create(c),W):c,u,et,Ut)(pe)}}function et(ve){return s=!0,U(De,_e),$}function Ut(ve){return s=!0,_e.restore(),++v<$e.length?St($e[v]):We}}}function k(U,W){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&Lt(c.events,W,c.events.length-W,U.resolve(c.events.slice(W),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function G(){let U=I(),W=c.previous,A=c.currentConstruct,H=c.events.length,$=Array.from(l);return{from:H,restore:We};function We(){n=U,c.previous=W,c.currentConstruct=A,c.events.length=H,l=$,B()}}function B(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function gz(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function yz(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
38
|
+
$$`:`${e}$$`},l4=e=>o4(e)%2===0?e:i4(e),s4=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=OF(e,t);if(n===-1||Qd(e,n))return null;let r=n>0&&e[n-1]==="!",o=r?n-1:n,i=e.substring(0,o);if(r)return i;let l=e.substring(n+1,t);return a==="text-only"?`${i}${l}`:`${i}[${l}](streamdown:incomplete-link)`},DL=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!Qd(e,a)){if(a>0&&e[a-1]==="!")continue;let n=NL(e,a);if(n===-1)return a;if(n+1<e.length&&e[n+1]==="("){let r=e.indexOf(")",n+2);r!==-1&&(a=r)}}return-1},u4=(e,t,a)=>{let n=t>0&&e[t-1]==="!",r=n?t-1:t,o=e.substring(t+1);if(!o.includes("]")){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let l=DL(e,t);return l!==-1?e.substring(0,l)+e.substring(l+1):`${i}${o}`}return`${e}](streamdown:incomplete-link)`}if(NL(e,t)===-1){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let l=DL(e,t);if(l!==-1)return e.substring(0,l)+e.substring(l+1);let s=e.substring(t+1);return`${i}${s}`}return`${e}](streamdown:incomplete-link)`}return null},zL=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!Qd(e,a)){let n=s4(e,a,t);if(n!==null)return n}for(let n=e.length-1;n>=0;n-=1)if(e[n]==="["&&!Qd(e,n)){let r=u4(e,n,t);if(r!==null)return r}return e},c4=/^-{1,2}$/,d4=/^[\s]*-{1,2}[\s]+$/,f4=/^={1,2}$/,p4=/^[\s]*={1,2}[\s]+$/,m4=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
39
|
+
`);if(t===-1)return e;let a=e.substring(t+1),n=e.substring(0,t),r=a.trim();if(c4.test(r)&&!a.match(d4)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(f4.test(r)&&!a.match(p4)){let o=n.split(`
|
|
41
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},h4=e=>{let t=e.match(TF);if(t){let a=t[2];if(!a||Uo.test(a))return e;if((e.match(RL)||[]).length%2===1)return`${e}~~`}else if(e.match(DF)&&(e.match(RL)||[]).length%2===1)return`${e}~`;return e},Ly=e=>e!==!1,_a={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},g4=[{handler:{name:"setextHeadings",handle:m4,priority:_a.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:zL,priority:_a.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:QF,priority:_a.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:HF,priority:_a.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:VF,priority:_a.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:WF,priority:_a.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:KF,priority:_a.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:n4,priority:_a.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:h4,priority:_a.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:l4,priority:_a.KATEX},optionKey:"katex"}],y4=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return g4.filter(({handler:n,optionKey:r})=>n.name==="links"?Ly(e?.links)||Ly(e?.images):Ly(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:OL(_L({},n),{handle:o=>zL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},w4=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=y4(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:OL(_L({},l),{priority:(s=l.priority)!=null?s:_a.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:_a.DEFAULT)-((c=s.handler.priority)!=null?c:_a.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},qL=w4});function jL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var VL=C(()=>{"use strict"});function ef(e,t){return((t||b4).jsx?v4:x4).test(e)}var x4,v4,b4,GL=C(()=>{"use strict";x4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b4={}});var WL=C(()=>{"use strict";GL()});function Ey(e){return typeof e=="object"?e.type==="text"?$L(e.value):!1:$L(e)}function $L(e){return e.replace(S4,"")===""}var S4,XL=C(()=>{"use strict";S4=/[ \t\n\f\r]/g});var KL=C(()=>{"use strict";XL()});var nr,My=C(()=>{"use strict";nr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};nr.prototype.normal={};nr.prototype.property={};nr.prototype.space=void 0});function Ay(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new nr(a,n,t)}var ZL=C(()=>{"use strict";My()});function Ws(e){return e.toLowerCase()}var Ry=C(()=>{"use strict"});var jt,Dy=C(()=>{"use strict";jt=class{constructor(t,a){this.attribute=a,this.property=t}};jt.prototype.attribute="";jt.prototype.booleanish=!1;jt.prototype.boolean=!1;jt.prototype.commaOrSpaceSeparated=!1;jt.prototype.commaSeparated=!1;jt.prototype.defined=!1;jt.prototype.mustUseProperty=!1;jt.prototype.number=!1;jt.prototype.overloadedBoolean=!1;jt.prototype.property="";jt.prototype.spaceSeparated=!1;jt.prototype.space=void 0});var $s={};Eu($s,{boolean:()=>fe,booleanish:()=>xt,commaOrSpaceSeparated:()=>ya,commaSeparated:()=>Wr,number:()=>F,overloadedBoolean:()=>tf,spaceSeparated:()=>He});function Fo(){return 2**++I4}var I4,fe,xt,tf,F,He,Wr,ya,Xs=C(()=>{"use strict";I4=0,fe=Fo(),xt=Fo(),tf=Fo(),F=Fo(),He=Fo(),Wr=Fo(),ya=Fo()});function YL(e,t,a){a&&(e[t]=a)}var _y,zo,Oy=C(()=>{"use strict";Dy();Xs();_y=Object.keys($s),zo=class extends jt{constructor(t,a,n,r){let o=-1;if(super(t,a),YL(this,"space",r),typeof n=="number")for(;++o<_y.length;){let i=_y[o];YL(this,_y[o],(n&$s[i])===$s[i])}}};zo.prototype.defined=!0});function Za(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new zo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Ws(n)]=n,a[Ws(o.attribute)]=n}return new nr(t,a,e.space)}var qo=C(()=>{"use strict";Ry();Oy();My()});var Py,QL=C(()=>{"use strict";qo();Xs();Py=Za({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:He,ariaCurrent:null,ariaDescribedBy:He,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:He,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:He,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:He,ariaLevel:F,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:He,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:He,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:xt,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function af(e,t){return t in e?e[t]:t}var Ny=C(()=>{"use strict"});function nf(e,t){return af(e,t.toLowerCase())}var By=C(()=>{"use strict";Ny()});var JL,eT=C(()=>{"use strict";By();qo();Xs();JL=Za({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:He,accessKey:He,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:He,autoFocus:fe,autoPlay:fe,blocking:He,capture:null,charSet:null,checked:fe,cite:null,className:He,cols:F,colSpan:null,content:null,contentEditable:xt,controls:fe,controlsList:He,coords:F|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:tf,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:He,height:F,hidden:tf,high:F,href:null,hrefLang:null,htmlFor:He,httpEquiv:He,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:He,itemRef:He,itemScope:fe,itemType:He,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,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:fe,optimum:F,pattern:null,ping:He,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:He,required:fe,reversed:fe,rows:F,rowSpan:F,sandbox:He,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:xt,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:He,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:nf})});var tT,aT=C(()=>{"use strict";Ny();qo();Xs();tT=Za({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ya,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:He,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:ya,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:He,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ya,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ya,rev:ya,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ya,requiredFeatures:ya,requiredFonts:ya,requiredFormats:ya,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:ya,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ya,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ya,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:af})});var Uy,nT=C(()=>{"use strict";qo();Uy=Za({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}})});var Fy,rT=C(()=>{"use strict";qo();By();Fy=Za({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nf})});var zy,oT=C(()=>{"use strict";qo();zy=Za({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var qy,iT=C(()=>{"use strict";qy={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"}});function Hy(e,t){let a=Ws(t),n=t,r=jt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&k4.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(lT,T4);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!lT.test(o)){let i=o.replace(C4,L4);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=zo}return new r(n,t)}function L4(e){return"-"+e.toLowerCase()}function T4(e){return e.charAt(1).toUpperCase()}var C4,lT,k4,sT=C(()=>{"use strict";Oy();Dy();Ry();C4=/[A-Z]/g,lT=/-[a-z]/g,k4=/^data[-\w.:]+$/i});var uT,rf,cT=C(()=>{"use strict";ZL();QL();eT();aT();nT();rT();oT();iT();sT();uT=Ay([Py,JL,Uy,Fy,zy],"html"),rf=Ay([Py,tT,Uy,Fy,zy],"svg")});function dT(e){return e.join(" ").trim()}var fT=C(()=>{"use strict"});var wT=Kt((zQ,yT)=>{"use strict";var pT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,E4=/\n/g,M4=/^\s*/,A4=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,R4=/^:\s*/,D4=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_4=/^[;\s]*/,O4=/^\s+|\s+$/g,P4=`
|
|
42
|
+
`,mT="/",hT="*",Ho="",N4="comment",B4="declaration";function U4(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function r(m){var x=m.match(E4);x&&(a+=x.length);var I=m.lastIndexOf(P4);n=~I?m.length-I:n+m.length}function o(){var m={line:a,column:n};return function(x){return x.position=new i(m),u(),x}}function i(m){this.start=m,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function l(m){var x=new Error(t.source+":"+a+":"+n+": "+m);if(x.reason=m,x.filename=t.source,x.line=a,x.column=n,x.source=e,!t.silent)throw x}function s(m){var x=m.exec(e);if(x){var I=x[0];return r(I),e=e.slice(I.length),x}}function u(){s(M4)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(mT!=e.charAt(0)||hT!=e.charAt(1))){for(var x=2;Ho!=e.charAt(x)&&(hT!=e.charAt(x)||mT!=e.charAt(x+1));)++x;if(x+=2,Ho===e.charAt(x-1))return l("End of comment missing");var I=e.slice(2,x-2);return n+=2,r(I),e=e.slice(x),n+=2,m({type:N4,comment:I})}}function f(){var m=o(),x=s(A4);if(x){if(d(),!s(R4))return l("property missing ':'");var I=s(D4),y=m({type:B4,property:gT(x[0].replace(pT,Ho)),value:I?gT(I[0].replace(pT,Ho)):Ho});return s(_4),y}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function gT(e){return e?e.replace(O4,Ho):Ho}yT.exports=U4});var xT=Kt(Ks=>{"use strict";var F4=Ks&&Ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default=q4;var z4=F4(wT());function q4(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,z4.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:l}=o;r?t(i,l,o):l&&(a=a||{},a[i]=l)}),a}});var bT=Kt(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.camelCase=void 0;var H4=/^--[a-zA-Z0-9_-]+$/,j4=/-([a-z])/g,V4=/^[^-]+$/,G4=/^-(webkit|moz|ms|o|khtml)-/,W4=/^-(ms)-/,$4=function(e){return!e||V4.test(e)||H4.test(e)},X4=function(e,t){return t.toUpperCase()},vT=function(e,t){return"".concat(t,"-")},K4=function(e,t){return t===void 0&&(t={}),$4(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(W4,vT):e=e.replace(G4,vT),e.replace(j4,X4))};of.camelCase=K4});var IT=Kt((Vy,ST)=>{"use strict";var Z4=Vy&&Vy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Y4=Z4(xT()),Q4=bT();function jy(e,t){var a={};return!e||typeof e!="string"||(0,Y4.default)(e,function(n,r){n&&r&&(a[(0,Q4.camelCase)(n,t)]=r)}),a}jy.default=jy;ST.exports=jy});function $r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?CT(e.position):"start"in e||"end"in e?CT(e):"line"in e||"column"in e?Gy(e):""}function Gy(e){return kT(e&&e.line)+":"+kT(e&&e.column)}function CT(e){return Gy(e&&e.start)+"-"+Gy(e&&e.end)}function kT(e){return e&&typeof e=="number"?e:1}var LT=C(()=>{"use strict"});var Wy=C(()=>{"use strict";LT()});var Et,TT=C(()=>{"use strict";Wy();Et=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=$r(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=i&&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}};Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0});var $y=C(()=>{"use strict";TT()});function Ky(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=cz(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=uz(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?rf:uT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=AT(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function AT(e,t,a){if(t.type==="element")return nz(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return iz(e,t,a);if(t.type==="mdxjsEsm")return oz(e,t);if(t.type==="root")return lz(e,t,a);if(t.type==="text")return sz(e,t)}function nz(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=rf,e.schema=r),e.ancestors.push(t);let o=DT(e,t.tagName,!1),i=dz(e,t),l=Yy(e,t);return tz.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!Ey(s):!0})),RT(e,i,o,t),Zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function rz(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Zs(e,t.position)}function oz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zs(e,t.position)}function iz(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=rf,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:DT(e,t.name,!0),i=fz(e,t),l=Yy(e,t);return RT(e,i,o,t),Zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function lz(e,t,a){let n={};return Zy(n,Yy(e,t)),e.create(t,e.Fragment,n,a)}function sz(e,t){return t.value}function RT(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Zy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function uz(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function cz(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=Wi(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function dz(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Xy.call(t.properties,r)){let o=pz(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&az.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function fz(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else Zs(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Zs(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Yy(e,t){let a=[],n=-1,r=e.passKeys?new Map:J4;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=AT(e,o,i);l!==void 0&&a.push(l)}return a}function pz(e,t,a){let n=Hy(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?jL(a):dT(a)),n.property==="style"){let r=typeof a=="object"?a:mz(e,String(a));return e.stylePropertyNameCase==="css"&&(r=hz(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?qy[n.property]||n.property:n.attribute,a]}}function mz(e,t){try{return(0,ET.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=MT+"#cannot-parse-style-attribute",r}}function DT(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=ef(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=ef(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Xy.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Zs(e)}function Zs(e,t){let a=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=MT+"#cannot-handle-mdx-estrees-without-createevaluater",a}function hz(e){let t={},a;for(a in e)Xy.call(e,a)&&(t[gz(a)]=e[a]);return t}function gz(e){let t=e.replace(ez,yz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yz(e){return"-"+e.toLowerCase()}var ET,Xy,J4,ez,tz,az,MT,_T=C(()=>{"use strict";VL();WL();KL();cT();fT();ET=q(IT(),1);Bs();$y();Xy={}.hasOwnProperty,J4=new Map,ez=/[A-Z]/g,tz=new Set(["table","tbody","thead","tfoot","tr"]),az=new Set(["td","th"]),MT="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var OT=C(()=>{"use strict";_T()});function wz(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),J(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return G(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var PT,NT=C(()=>{"use strict";Tt();Ae();PT={tokenize:wz}});function xz(e){let t=this,a=[],n=0,r,o,i;return l;function l(g){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let b=t.events.length,T=b,S;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){S=t.events[T][1].end;break}y(n);let M=b;for(;M<t.events.length;)t.events[M][1].end={...S},M++;return Lt(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(g)}return l(g)}function u(g){if(n===a.length){if(!r)return f(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(BT,c,d)(g)}function c(g){return r&&w(),y(n),f(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(g)}function f(g){return t.containerState={},e.attempt(BT,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&w(),y(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return G(g)?(e.consume(g),I(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function I(g,b){let T=t.sliceStream(g);if(b&&T.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(T),t.parser.lazy[g.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<i&&(!r.events[S][1].end||r.events[S][1].end.offset>i))return;let M=t.events.length,R=M,_,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(_){L=t.events[R][1].end;break}_=!0}for(y(n),S=M;S<t.events.length;)t.events[S][1].end={...L},S++;Lt(t.events,R+1,0,t.events.slice(M)),t.events.length=S}}function y(g){let b=a.length;for(;b-- >g;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=g}function w(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function vz(e,t,a){return J(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var UT,BT,FT=C(()=>{"use strict";Tt();Ae();tr();UT={tokenize:xz},BT={tokenize:vz}});function bz(e){let t=this,a=e.attempt(kn,n,e.attempt(this.parser.constructs.flowInitial,r,J(e,e.attempt(this.parser.constructs.flow,r,e.attempt(sy,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var zT,qT=C(()=>{"use strict";Xd();Tt();zT={tokenize:bz}});function GT(e){return{resolveAll:WT(e==="text"?Sz:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],f=-1;if(d)for(;++f<d.length;){let p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function WT(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function Sz(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var HT,jT,VT,Qy=C(()=>{"use strict";HT={resolveAll:WT()},jT=GT("string"),VT=GT("text")});var Jy={};Eu(Jy,{attentionMarkers:()=>Az,contentInitial:()=>Cz,disable:()=>Rz,document:()=>Iz,flow:()=>Lz,flowInitial:()=>kz,insideSpan:()=>Mz,string:()=>Tz,text:()=>Ez});var Iz,Cz,kz,Lz,Tz,Ez,Mz,Az,Rz,$T=C(()=>{"use strict";Xd();Qy();Iz={42:Qt,43:Qt,45:Qt,48:Qt,49:Qt,50:Qt,51:Qt,52:Qt,53:Qt,54:Qt,55:Qt,56:Qt,57:Qt,62:Bd},Cz={91:py},kz={[-2]:js,[-1]:js,32:js},Lz={35:hy,42:Bo,45:[$d,Bo],60:yy,61:$d,95:Bo,96:zd,126:zd},Tz={38:Fd,92:Ud},Ez={[-5]:Gs,[-4]:Gs,[-3]:Gs,33:xy,38:Fd,42:Hs,60:[oy,wy],91:vy,92:[my,Ud],93:No,95:Hs,96:iy},Mz={null:[Hs,HT]},Az={null:[42,95]},Rz={null:[]}});function XT(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:_(M),check:_(R),consume:b,enter:T,exit:S,interrupt:_(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:I,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p},d=t.tokenize.call(c,u),f;return t.resolveAll&&o.push(t),c;function p(B){return i=ra(i,B),w(),i[i.length-1]!==null?[]:(L(t,0),c.events=Vr(o,c.events,c),c.events)}function m(B,W){return _z(x(B),W)}function x(B){return Dz(i,B)}function I(){let{_bufferIndex:B,_index:W,line:A,column:j,offset:$}=n;return{_bufferIndex:B,_index:W,line:A,column:j,offset:$}}function y(B){r[B.line]=B.column,U()}function w(){let B;for(;n._index<i.length;){let W=i[n._index];if(typeof W=="string")for(B=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===B&&n._bufferIndex<W.length;)g(W.charCodeAt(n._bufferIndex));else g(W)}}function g(B){s=void 0,f=B,d=d(B)}function b(B){G(B)?(n.line++,n.column=1,n.offset+=B===-3?2:1,U()):B!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=B,s=!0}function T(B,W){let A=W||{};return A.type=B,A.start=I(),c.events.push(["enter",A,c]),l.push(A),A}function S(B){let W=l.pop();return W.end=I(),c.events.push(["exit",W,c]),W}function M(B,W){L(B,W.from)}function R(B,W){W.restore()}function _(B,W){return A;function A(j,$,We){let $e,v,De,_e;return Array.isArray(j)?Le(j):"tokenize"in j?Le([j]):k(j);function k(ve){return X;function X(pe){let ce=pe!==null&&ve[pe],oe=pe!==null&&ve.null,he=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return Le(he)(pe)}}function Le(ve){return $e=ve,v=0,ve.length===0?We:St(ve[v])}function St(ve){return X;function X(pe){return _e=z(),De=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?Ut(pe):ve.tokenize.call(W?Object.assign(Object.create(c),W):c,u,et,Ut)(pe)}}function et(ve){return s=!0,B(De,_e),$}function Ut(ve){return s=!0,_e.restore(),++v<$e.length?St($e[v]):We}}}function L(B,W){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Lt(c.events,W,c.events.length-W,B.resolve(c.events.slice(W),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function z(){let B=I(),W=c.previous,A=c.currentConstruct,j=c.events.length,$=Array.from(l);return{from:j,restore:We};function We(){n=B,c.previous=W,c.currentConstruct=A,c.events.length=j,l=$,U()}}function U(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function Dz(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function _z(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
43
43
|
`;break}case-3:{i=`\r
|
|
44
|
-
`;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(o)}r=o===-2,n.push(i)}return n.join("")}var UT=C(()=>{"use strict";Ae();tr();Fs()});function $y(e){let n={constructs:Rd([Wy,...(e||{}).extensions||[]]),content:r(CT),defined:[],document:r(TT),flow:r(MT),lazy:{},string:r(DT),text:r(_T)};return n;function r(o){return i;function i(l){return BT(n,o,l)}}}var FT=C(()=>{"use strict";Xg();kT();ET();AT();Gy();NT();UT()});function Xy(e){for(;!Ud(e););return e}var zT=C(()=>{"use strict";ey()});function Ky(){let e=1,t="",a=!0,n;return r;function r(o,i,l){let s=[],u,c,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(qT.lastIndex=d,u=qT.exec(o),f=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(f),!u){t=o.slice(d);break}if(p===10&&d===f&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<f&&(s.push(o.slice(d,f)),e+=f-d),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var qT,HT=C(()=>{"use strict";qT=/[\0\t\n\r]/g});var jT=C(()=>{"use strict";FT();zT();HT()});function Zy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),wz(a)(Xy($y(a).document().write(Ky()(e,t,!0))))}function wz(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ce),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(dt),blockQuote:o(pe),characterEscape:_,characterReference:_,codeFenced:o(ue),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(ue,i),codeText:o(oe,i),codeTextData:_,data:_,codeFlowValue:_,definition:o(ye),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(Xe),hardBreakEscape:o(nt),hardBreakTrailing:o(nt),htmlFlow:o(Mt,i),htmlFlowData:_,htmlText:o(Mt,i),htmlTextData:_,image:o(K),label:i,link:o(ce),listItem:o(Pa),listItemValue:f,listOrdered:o(Ke,d),listUnordered:o(Ke),paragraph:o(fn),reference:L,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(dt),strong:o(sr),thematicBreak:o(Go)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:X,autolinkProtocol:ve,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:St,characterReferenceMarkerNumeric:St,characterReferenceValue:et,characterReference:Ut,codeFenced:s(I),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:k,codeIndented:s(y),codeText:s(A),codeTextData:k,data:k,definition:s(),definitionDestinationString:b,definitionLabelString:w,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(B),hardBreakTrailing:s(B),htmlFlow:s(U),htmlFlowData:k,htmlText:s(W),htmlTextData:k,image:s($),label:$e,labelText:We,lineEnding:G,link:s(H),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ke,resourceDestinationString:v,resourceTitleString:De,resource:_e,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:S,strong:s(),thematicBreak:s()}};WT(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(P){let q={type:"root",children:[]},le={stack:[q],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},he=[],Fe=-1;for(;++Fe<P.length;)if(P[Fe][1].type==="listOrdered"||P[Fe][1].type==="listUnordered")if(P[Fe][0]==="enter")he.push(Fe);else{let va=he.pop();Fe=r(P,va,Fe)}for(Fe=-1;++Fe<P.length;){let va=t[P[Fe][0]];GT.call(va,P[Fe][1].type)&&va[P[Fe][1].type].call(Object.assign({sliceSerialize:P[Fe][2].sliceSerialize},le),P[Fe][1])}if(le.tokenStack.length>0){let va=le.tokenStack[le.tokenStack.length-1];(va[1]||VT).call(le,void 0,va[0])}for(q.position={start:Xr(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Xr(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)q=t.transforms[Fe](q)||q;return q}function r(P,q,le){let he=q-1,Fe=-1,va=!1,pn,Na,eo,to;for(;++he<=le;){let O=P[he];switch(O[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{O[0]==="enter"?Fe++:Fe--,to=void 0;break}case"lineEndingBlank":{O[0]==="enter"&&(pn&&!to&&!Fe&&!eo&&(eo=he),to=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:to=void 0}if(!Fe&&O[0]==="enter"&&O[1].type==="listItemPrefix"||Fe===-1&&O[0]==="exit"&&(O[1].type==="listUnordered"||O[1].type==="listOrdered")){if(pn){let ee=he;for(Na=void 0;ee--;){let ae=P[ee];if(ae[1].type==="lineEnding"||ae[1].type==="lineEndingBlank"){if(ae[0]==="exit")continue;Na&&(P[Na][1].type="lineEndingBlank",va=!0),ae[1].type="lineEnding",Na=ee}else if(!(ae[1].type==="linePrefix"||ae[1].type==="blockQuotePrefix"||ae[1].type==="blockQuotePrefixWhitespace"||ae[1].type==="blockQuoteMarker"||ae[1].type==="listItemIndent"))break}eo&&(!Na||eo<Na)&&(pn._spread=!0),pn.end=Object.assign({},Na?P[Na][1].start:O[1].end),P.splice(Na||he,0,["exit",pn,O[2]]),he++,le++}if(O[1].type==="listItemPrefix"){let ee={type:"listItem",_spread:!1,start:Object.assign({},O[1].start),end:void 0};pn=ee,P.splice(he,0,["enter",ee,O[2]]),he++,le++,eo=void 0,to=!0}}}return P[q][1]._spread=va,le}function o(P,q){return le;function le(he){l.call(this,P(he),he),q&&q.call(this,he)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(P,q,le){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([q,le||void 0]),P.position={start:Xr(q.start),end:void 0}}function s(P){return q;function q(le){P&&P.call(this,le),u.call(this,le)}}function u(P,q){let le=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==P.type&&(q?q.call(this,P,he[0]):(he[1]||VT).call(this,P,he[0]));else throw new Error("Cannot close `"+P.type+"` ("+$r({start:P.start,end:P.end})+"): it\u2019s not open");le.position.end=Xr(P.end)}function c(){return Ro(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(P){if(this.data.expectingFirstListItemValue){let q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function p(){let P=this.resume(),q=this.stack[this.stack.length-1];q.lang=P}function m(){let P=this.resume(),q=this.stack[this.stack.length-1];q.meta=P}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P.replace(/(\r?\n|\r)$/g,"")}function w(P){let q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=Qt(this.sliceSerialize(P)).toLowerCase()}function g(){let P=this.resume(),q=this.stack[this.stack.length-1];q.title=P}function b(){let P=this.resume(),q=this.stack[this.stack.length-1];q.url=P}function T(P){let q=this.stack[this.stack.length-1];if(!q.depth){let le=this.sliceSerialize(P).length;q.depth=le}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function M(P){let q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(P){let le=this.stack[this.stack.length-1].children,he=le[le.length-1];(!he||he.type!=="text")&&(he=dl(),he.position={start:Xr(P.start),end:void 0},le.push(he)),this.stack.push(he)}function k(P){let q=this.stack.pop();q.value+=this.sliceSerialize(P),q.position.end=Xr(P.end)}function G(P){let q=this.stack[this.stack.length-1];if(this.data.atHardBreak){let le=q.children[q.children.length-1];le.position.end=Xr(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(_.call(this,P),k.call(this,P))}function B(){this.data.atHardBreak=!0}function U(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function W(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function A(){let P=this.resume(),q=this.stack[this.stack.length-1];q.value=P}function H(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function $(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function We(P){let q=this.sliceSerialize(P),le=this.stack[this.stack.length-2];le.label=d1(q),le.identifier=Qt(q).toLowerCase()}function $e(){let P=this.stack[this.stack.length-1],q=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){let he=P.children;le.children=he}else le.alt=q}function v(){let P=this.resume(),q=this.stack[this.stack.length-1];q.url=P}function De(){let P=this.resume(),q=this.stack[this.stack.length-1];q.title=P}function _e(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ke(P){let q=this.resume(),le=this.stack[this.stack.length-1];le.label=q,le.identifier=Qt(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function St(P){this.data.characterReferenceType=P.type}function et(P){let q=this.sliceSerialize(P),le=this.data.characterReferenceType,he;le?(he=Ad(q,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=Ki(q);let Fe=this.stack[this.stack.length-1];Fe.value+=he}function Ut(P){let q=this.stack.pop();q.position.end=Xr(P.end)}function ve(P){k.call(this,P);let q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(P)}function X(P){k.call(this,P);let q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(P)}function pe(){return{type:"blockquote",children:[]}}function ue(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function dt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Mt(){return{type:"html",value:""}}function K(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function Ke(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[]}}function Pa(P){return{type:"listItem",spread:P._spread,checked:null,children:[]}}function fn(){return{type:"paragraph",children:[]}}function sr(){return{type:"strong",children:[]}}function dl(){return{type:"text",value:""}}function Go(){return{type:"thematicBreak"}}}function Xr(e){return{line:e.line,column:e.column,offset:e.offset}}function WT(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?WT(e,n):xz(e,n)}}function xz(e,t){let a;for(a in t)if(GT.call(t,a))switch(a){case"canContainEols":{let n=t[a];n&&e[a].push(...n);break}case"transforms":{let n=t[a];n&&e[a].push(...n);break}case"enter":case"exit":{let n=t[a];n&&Object.assign(e[a],n);break}}}function VT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}var GT,$T=C(()=>{"use strict";Ld();jT();Fg();f1();Gi();Md();Fy();GT={}.hasOwnProperty});var XT=C(()=>{"use strict";$T()});function af(e){let t=this;t.parser=a;function a(n){return Zy(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var KT=C(()=>{"use strict";XT()});var ZT=C(()=>{"use strict";KT()});function QT(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}var YT=C(()=>{"use strict"});function JT(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
-
`}]}var
|
|
46
|
-
`:"",n={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}var
|
|
44
|
+
`;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(o)}r=o===-2,n.push(i)}return n.join("")}var KT=C(()=>{"use strict";Ae();tr();qs()});function ew(e){let n={constructs:Pd([Jy,...(e||{}).extensions||[]]),content:r(PT),defined:[],document:r(UT),flow:r(zT),lazy:{},string:r(jT),text:r(VT)};return n;function r(o){return i;function i(l){return XT(n,o,l)}}}var ZT=C(()=>{"use strict";ty();NT();FT();qT();Qy();$T();KT()});function tw(e){for(;!Hd(e););return e}var YT=C(()=>{"use strict";ly()});function aw(){let e=1,t="",a=!0,n;return r;function r(o,i,l){let s=[],u,c,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(QT.lastIndex=d,u=QT.exec(o),f=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(f),!u){t=o.slice(d);break}if(p===10&&d===f&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<f&&(s.push(o.slice(d,f)),e+=f-d),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var QT,JT=C(()=>{"use strict";QT=/[\0\t\n\r]/g});var eE=C(()=>{"use strict";ZT();YT();JT()});function nw(e,t,a){return typeof t!="string"&&(a=t,t=void 0),Oz(a)(tw(ew(a).document().write(aw()(e,t,!0))))}function Oz(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(se),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(dt),blockQuote:o(pe),characterEscape:_,characterReference:_,codeFenced:o(ce),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(ce,i),codeText:o(oe,i),codeTextData:_,data:_,codeFlowValue:_,definition:o(he),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(Xe),hardBreakEscape:o(nt),hardBreakTrailing:o(nt),htmlFlow:o(Mt,i),htmlFlowData:_,htmlText:o(Mt,i),htmlTextData:_,image:o(K),label:i,link:o(se),listItem:o(ua),listItemValue:f,listOrdered:o(Ke,d),listUnordered:o(Ke),paragraph:o(pn),reference:k,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(dt),strong:o(sr),thematicBreak:o(Wo)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:X,autolinkProtocol:ve,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:St,characterReferenceMarkerNumeric:St,characterReferenceValue:et,characterReference:Ut,codeFenced:s(I),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:s(y),codeText:s(A),codeTextData:L,data:L,definition:s(),definitionDestinationString:b,definitionLabelString:w,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(U),hardBreakTrailing:s(U),htmlFlow:s(B),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s($),label:$e,labelText:We,lineEnding:z,link:s(j),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:Le,resourceDestinationString:v,resourceTitleString:De,resource:_e,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:S,strong:s(),thematicBreak:s()}};nE(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(P){let H={type:"root",children:[]},le={stack:[H],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},ge=[],Fe=-1;for(;++Fe<P.length;)if(P[Fe][1].type==="listOrdered"||P[Fe][1].type==="listUnordered")if(P[Fe][0]==="enter")ge.push(Fe);else{let ba=ge.pop();Fe=r(P,ba,Fe)}for(Fe=-1;++Fe<P.length;){let ba=t[P[Fe][0]];aE.call(ba,P[Fe][1].type)&&ba[P[Fe][1].type].call(Object.assign({sliceSerialize:P[Fe][2].sliceSerialize},le),P[Fe][1])}if(le.tokenStack.length>0){let ba=le.tokenStack[le.tokenStack.length-1];(ba[1]||tE).call(le,void 0,ba[0])}for(H.position={start:Xr(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Xr(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)H=t.transforms[Fe](H)||H;return H}function r(P,H,le){let ge=H-1,Fe=-1,ba=!1,mn,Na,to,ao;for(;++ge<=le;){let O=P[ge];switch(O[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{O[0]==="enter"?Fe++:Fe--,ao=void 0;break}case"lineEndingBlank":{O[0]==="enter"&&(mn&&!ao&&!Fe&&!to&&(to=ge),ao=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ao=void 0}if(!Fe&&O[0]==="enter"&&O[1].type==="listItemPrefix"||Fe===-1&&O[0]==="exit"&&(O[1].type==="listUnordered"||O[1].type==="listOrdered")){if(mn){let ee=ge;for(Na=void 0;ee--;){let ae=P[ee];if(ae[1].type==="lineEnding"||ae[1].type==="lineEndingBlank"){if(ae[0]==="exit")continue;Na&&(P[Na][1].type="lineEndingBlank",ba=!0),ae[1].type="lineEnding",Na=ee}else if(!(ae[1].type==="linePrefix"||ae[1].type==="blockQuotePrefix"||ae[1].type==="blockQuotePrefixWhitespace"||ae[1].type==="blockQuoteMarker"||ae[1].type==="listItemIndent"))break}to&&(!Na||to<Na)&&(mn._spread=!0),mn.end=Object.assign({},Na?P[Na][1].start:O[1].end),P.splice(Na||ge,0,["exit",mn,O[2]]),ge++,le++}if(O[1].type==="listItemPrefix"){let ee={type:"listItem",_spread:!1,start:Object.assign({},O[1].start),end:void 0};mn=ee,P.splice(ge,0,["enter",ee,O[2]]),ge++,le++,to=void 0,ao=!0}}}return P[H][1]._spread=ba,le}function o(P,H){return le;function le(ge){l.call(this,P(ge),ge),H&&H.call(this,ge)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(P,H,le){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([H,le||void 0]),P.position={start:Xr(H.start),end:void 0}}function s(P){return H;function H(le){P&&P.call(this,le),u.call(this,le)}}function u(P,H){let le=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==P.type&&(H?H.call(this,P,ge[0]):(ge[1]||tE).call(this,P,ge[0]));else throw new Error("Cannot close `"+P.type+"` ("+$r({start:P.start,end:P.end})+"): it\u2019s not open");le.position.end=Xr(P.end)}function c(){return Do(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(P){if(this.data.expectingFirstListItemValue){let H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function p(){let P=this.resume(),H=this.stack[this.stack.length-1];H.lang=P}function m(){let P=this.resume(),H=this.stack[this.stack.length-1];H.meta=P}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){let P=this.resume(),H=this.stack[this.stack.length-1];H.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let P=this.resume(),H=this.stack[this.stack.length-1];H.value=P.replace(/(\r?\n|\r)$/g,"")}function w(P){let H=this.resume(),le=this.stack[this.stack.length-1];le.label=H,le.identifier=Yt(this.sliceSerialize(P)).toLowerCase()}function g(){let P=this.resume(),H=this.stack[this.stack.length-1];H.title=P}function b(){let P=this.resume(),H=this.stack[this.stack.length-1];H.url=P}function T(P){let H=this.stack[this.stack.length-1];if(!H.depth){let le=this.sliceSerialize(P).length;H.depth=le}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function M(P){let H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function _(P){let le=this.stack[this.stack.length-1].children,ge=le[le.length-1];(!ge||ge.type!=="text")&&(ge=fl(),ge.position={start:Xr(P.start),end:void 0},le.push(ge)),this.stack.push(ge)}function L(P){let H=this.stack.pop();H.value+=this.sliceSerialize(P),H.position.end=Xr(P.end)}function z(P){let H=this.stack[this.stack.length-1];if(this.data.atHardBreak){let le=H.children[H.children.length-1];le.position.end=Xr(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(_.call(this,P),L.call(this,P))}function U(){this.data.atHardBreak=!0}function B(){let P=this.resume(),H=this.stack[this.stack.length-1];H.value=P}function W(){let P=this.resume(),H=this.stack[this.stack.length-1];H.value=P}function A(){let P=this.resume(),H=this.stack[this.stack.length-1];H.value=P}function j(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let H=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=H,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function $(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let H=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=H,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function We(P){let H=this.sliceSerialize(P),le=this.stack[this.stack.length-2];le.label=S1(H),le.identifier=Yt(H).toLowerCase()}function $e(){let P=this.stack[this.stack.length-1],H=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){let ge=P.children;le.children=ge}else le.alt=H}function v(){let P=this.resume(),H=this.stack[this.stack.length-1];H.url=P}function De(){let P=this.resume(),H=this.stack[this.stack.length-1];H.title=P}function _e(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function Le(P){let H=this.resume(),le=this.stack[this.stack.length-1];le.label=H,le.identifier=Yt(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function St(P){this.data.characterReferenceType=P.type}function et(P){let H=this.sliceSerialize(P),le=this.data.characterReferenceType,ge;le?(ge=Od(H,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=Yi(H);let Fe=this.stack[this.stack.length-1];Fe.value+=ge}function Ut(P){let H=this.stack.pop();H.position.end=Xr(P.end)}function ve(P){L.call(this,P);let H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(P)}function X(P){L.call(this,P);let H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(P)}function pe(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function dt(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Mt(){return{type:"html",value:""}}function K(){return{type:"image",title:null,url:"",alt:null}}function se(){return{type:"link",title:null,url:"",children:[]}}function Ke(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[]}}function ua(P){return{type:"listItem",spread:P._spread,checked:null,children:[]}}function pn(){return{type:"paragraph",children:[]}}function sr(){return{type:"strong",children:[]}}function fl(){return{type:"text",value:""}}function Wo(){return{type:"thematicBreak"}}}function Xr(e){return{line:e.line,column:e.column,offset:e.offset}}function nE(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?nE(e,n):Pz(e,n)}}function Pz(e,t){let a;for(a in t)if(aE.call(t,a))switch(a){case"canContainEols":{let n=t[a];n&&e[a].push(...n);break}case"transforms":{let n=t[a];n&&e[a].push(...n);break}case"enter":case"exit":{let n=t[a];n&&Object.assign(e[a],n);break}}}function tE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$r({start:t.start,end:t.end})+") is still open")}var aE,rE=C(()=>{"use strict";Ad();eE();Wg();I1();$i();_d();Wy();aE={}.hasOwnProperty});var oE=C(()=>{"use strict";rE()});function lf(e){let t=this;t.parser=a;function a(n){return nw(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var iE=C(()=>{"use strict";oE()});var lE=C(()=>{"use strict";iE()});function sE(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}var uE=C(()=>{"use strict"});function cE(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
+
`}]}var dE=C(()=>{"use strict"});function fE(e,t){let a=t.value?t.value+`
|
|
46
|
+
`:"",n={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}var pE=C(()=>{"use strict"});function mE(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var hE=C(()=>{"use strict"});function gE(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var yE=C(()=>{"use strict"});function wE(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=Ka(n.toLowerCase()),o=e.footnoteOrder.indexOf(n),i,l=e.footnoteCounts.get(n);l===void 0?(l=0,e.footnoteOrder.push(n),i=e.footnoteOrder.length):i=o+1,l+=1,e.footnoteCounts.set(n,l);let s={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+r,id:a+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}var xE=C(()=>{"use strict";Oo()});function vE(e,t){let a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var bE=C(()=>{"use strict"});function SE(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var IE=C(()=>{"use strict"});function sf(e,t){let a=t.referenceType,n="]";if(a==="collapsed"?n+="[]":a==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];let r=e.all(t),o=r[0];o&&o.type==="text"?o.value="["+o.value:r.unshift({type:"text",value:"["});let i=r[r.length-1];return i&&i.type==="text"?i.value+=n:r.push({type:"text",value:n}),r}var rw=C(()=>{"use strict"});function CE(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return sf(e,t);let r={src:Ka(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);let o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)}var kE=C(()=>{"use strict";Oo();rw()});function LE(e,t){let a={src:Ka(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);let n={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,n),e.applyData(t,n)}var TE=C(()=>{"use strict";Oo()});function EE(e,t){let a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);let n={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,n),e.applyData(t,n)}var ME=C(()=>{"use strict"});function AE(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return sf(e,t);let r={href:Ka(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);let o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}var RE=C(()=>{"use strict";Oo();rw()});function DE(e,t){let a={href:Ka(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);let n={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var _E=C(()=>{"use strict";Oo()});function OE(e,t,a){let n=e.all(t),r=a?Nz(a):PE(t),o={},i=[];if(typeof t.checked=="boolean"){let c=n[0],d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<n.length;){let c=n[l];(r||l!==0||c.type!=="element"||c.tagName!=="p")&&i.push({type:"text",value:`
|
|
47
47
|
`}),c.type==="element"&&c.tagName==="p"&&!r?i.push(...c.children):i.push(c)}let s=n[n.length-1];s&&(r||s.type!=="element"||s.tagName!=="p")&&i.push({type:"text",value:`
|
|
48
|
-
`});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)}function
|
|
48
|
+
`});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)}function Nz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=PE(a[n])}return t}function PE(e){let t=e.spread;return t??e.children.length>1}var NE=C(()=>{"use strict"});function BE(e,t){let a={},n=e.all(t),r=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++r<n.length;){let i=n[r];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}let o={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(n,!0)};return e.patch(t,o),e.applyData(t,o)}var UE=C(()=>{"use strict"});function FE(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var zE=C(()=>{"use strict"});function qE(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var HE=C(()=>{"use strict"});function jE(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var VE=C(()=>{"use strict"});function GE(e,t){let a=e.all(t),n=a.shift(),r=[];if(n){let i={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],i),r.push(i)}if(a.length>0){let i={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},l=Wi(t.children[1]),s=kd(t.children[t.children.length-1]);l&&s&&(i.position={start:l,end:s}),r.push(i)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}var WE=C(()=>{"use strict";Bs()});function $E(e,t,a){let n=a?a.children:void 0,o=(n?n.indexOf(t):1)===0?"th":"td",i=a&&a.type==="table"?a.align:void 0,l=i?i.length:t.children.length,s=-1,u=[];for(;++s<l;){let d=t.children[s],f={},p=i?i[s]:void 0;p&&(f.align=p);let m={type:"element",tagName:o,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}var XE=C(()=>{"use strict"});function KE(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var ZE=C(()=>{"use strict"});function QE(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(YE(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(YE(t.slice(r),r>0,!1)),o.join("")}function YE(e,t,a){let n=0,r=e.length;if(t){let o=e.codePointAt(n);for(;o===9||o===32;)n++,o=e.codePointAt(n)}if(a){let o=e.codePointAt(r-1);for(;o===9||o===32;)r--,o=e.codePointAt(r-1)}return r>n?e.slice(n,r):""}var JE=C(()=>{"use strict"});function eM(e,t){let a={type:"text",value:QE(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var tM=C(()=>{"use strict";JE()});function aM(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var nM=C(()=>{"use strict"});function uf(){}var rM,oM=C(()=>{"use strict";uE();dE();pE();hE();yE();xE();bE();IE();kE();TE();ME();RE();_E();NE();UE();zE();HE();VE();WE();XE();ZE();tM();nM();rM={blockquote:sE,break:cE,code:fE,delete:mE,emphasis:gE,footnoteReference:wE,heading:vE,html:SE,imageReference:CE,image:LE,inlineCode:EE,linkReference:AE,link:DE,listItem:OE,list:BE,paragraph:FE,root:qE,strong:jE,table:GE,tableCell:KE,tableRow:$E,text:eM,thematicBreak:aM,toml:uf,yaml:uf,definition:uf,footnoteDefinition:uf}});function Bz(e,t){let a=[{type:"text",value:"\u21A9"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function Uz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iM(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||Bz,n=e.options.footnoteBackLabel||Uz,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],s=-1;for(;++s<e.footnoteOrder.length;){let u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;let c=e.all(u),d=String(u.identifier).toUpperCase(),f=Ka(d.toLowerCase()),p=0,m=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++p<=x;){m.length>0&&m.push({type:"text",value:" "});let w=typeof a=="string"?a:a(s,p);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(s,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}let I=c[c.length-1];if(I&&I.type==="element"&&I.tagName==="p"){let w=I.children[I.children.length-1];w&&w.type==="text"?w.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...m)}else c.push(...m);let y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zr(i),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
49
49
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
50
|
-
`}]}}var
|
|
50
|
+
`}]}}var lM=C(()=>{"use strict";Cd();Oo()});function uM(e,t){let a=t||Fz,n=new Map,r=new Map,o=new Map,i={...rM,...a.handlers},l={all:u,applyData:qz,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:i,one:s,options:a,patch:zz,wrap:jz};return Jn(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let d=c.type==="definition"?n:r,f=String(c.identifier).toUpperCase();d.has(f)||d.set(f,c)}}),l;function s(c,d){let f=c.type,p=l.handlers[f];if(ow.call(l.handlers,f)&&p)return p(l,c,d);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in c){let{children:x,...I}=c,y=zr(I);return y.children=l.all(c),y}return zr(c)}return(l.options.unknownHandler||Hz)(l,c,d)}function u(c){let d=[];if("children"in c){let f=c.children,p=-1;for(;++p<f.length;){let m=l.one(f[p],c);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=sM(m.value)),!Array.isArray(m)&&m.type==="element")){let x=m.children[0];x&&x.type==="text"&&(x.value=sM(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function zz(e,t){e.position&&(t.position=Ns(e))}function qz(e,t){let a=t;if(e&&e.data){let n=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if(typeof n=="string")if(a.type==="element")a.tagName=n;else{let i="children"in a?a.children:[a];a={type:"element",tagName:n,properties:{},children:i}}a.type==="element"&&o&&Object.assign(a.properties,zr(o)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function Hz(e,t){let a=t.data||{},n="value"in t&&!(ow.call(a,"hProperties")||ow.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jz(e,t){let a=[],n=-1;for(t&&a.push({type:"text",value:`
|
|
51
51
|
`});++n<e.length;)n&&a.push({type:"text",value:`
|
|
52
52
|
`}),a.push(e[n]);return t&&e.length>0&&a.push({type:"text",value:`
|
|
53
|
-
`}),a}function
|
|
54
|
-
`},r)),o}var eM=C(()=>{"use strict";ZE();JE()});var tM=C(()=>{"use strict";eM()});function lf(e,t){return e&&"run"in e?async function(a,n){let r=of(a,{file:n,...t});await e.run(r,n)}:function(a,n){return of(a,{file:n,...e||t})}}var aM=C(()=>{"use strict";tM()});var nM=C(()=>{"use strict";aM()});function Jy(e){if(e)throw e}var rM=C(()=>{"use strict"});var pM=Kt((Gee,fM)=>{"use strict";var sf=Object.prototype.hasOwnProperty,dM=Object.prototype.toString,oM=Object.defineProperty,iM=Object.getOwnPropertyDescriptor,lM=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dM.call(t)==="[object Array]"},sM=function(t){if(!t||dM.call(t)!=="[object Object]")return!1;var a=sf.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&sf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||sf.call(t,r)},uM=function(t,a){oM&&a.name==="__proto__"?oM(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},cM=function(t,a){if(a==="__proto__")if(sf.call(t,a)){if(iM)return iM(t,a).value}else return;return t[a]};fM.exports=function e(){var t,a,n,r,o,i,l=arguments[0],s=1,u=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},s=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});s<u;++s)if(t=arguments[s],t!=null)for(a in t)n=cM(l,a),r=cM(t,a),l!==r&&(c&&r&&(sM(r)||(o=lM(r)))?(o?(o=!1,i=n&&lM(n)?n:[]):i=n&&sM(n)?n:{},uM(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&uM(l,{name:a,newValue:r}));return l}});function Ks(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var mM=C(()=>{"use strict"});function ew(){let e=[],t={run:a,use:n};return t;function a(...r){let o=-1,i=r.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);l(null,...r);function l(s,...u){let c=e[++o],d=-1;if(s){i(s);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?hM(c,l)(...u):i(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function hM(e,t){let a;return n;function n(...i){let l=e.length>i.length,s;l&&i.push(r);try{s=e.apply(this,i)}catch(u){let c=u;if(l&&a)throw c;return r(c)}l||(s&&s.then&&typeof s.then=="function"?s.then(o,r):s instanceof Error?r(s):o(s))}function r(i,...l){a||(a=!0,t(i,...l))}function o(i){r(null,i)}}var gM=C(()=>{"use strict"});var yM=C(()=>{"use strict";gM()});function Ez(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zs(e);let a=0,n=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else n<0&&(o=!0,n=r+1);return n<0?"":e.slice(a,n)}if(t===e)return"";let i=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(n=r):(l=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function Mz(e){if(Zs(e),e.length===0)return".";let t=-1,a=e.length,n;for(;--a;)if(e.codePointAt(a)===47){if(n){t=a;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Az(e){Zs(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let l=e.codePointAt(t);if(l===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),l===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===n+1?"":e.slice(r,a)}function Rz(...e){let t=-1,a;for(;++t<e.length;)Zs(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":Dz(a)}function Dz(e){Zs(e);let t=e.codePointAt(0)===47,a=_z(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function _z(e,t){let a="",n=0,r=-1,o=0,i=-1,l,s;for(;++i<=e.length;){if(i<e.length)l=e.codePointAt(i);else{if(l===47)break;l=47}if(l===47){if(!(r===i-1||o===1))if(r!==i-1&&o===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(s=a.lastIndexOf("/"),s!==a.length-1){s<0?(a="",n=0):(a=a.slice(0,s),n=a.length-1-a.lastIndexOf("/")),r=i,o=0;continue}}else if(a.length>0){a="",n=0,r=i,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",n=2)}else a.length>0?a+="/"+e.slice(r+1,i):a=e.slice(r+1,i),n=i-r-1;r=i,o=0}else l===46&&o>-1?o++:o=-1}return a}function Zs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var on,wM=C(()=>{"use strict";on={basename:Ez,dirname:Mz,extname:Az,join:Rz,sep:"/"}});function Oz(){return"/"}var xM,vM=C(()=>{"use strict";xM={cwd:Oz}});function Yi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var tw=C(()=>{"use strict"});function bM(e){if(typeof e=="string")e=new URL(e);else if(!Yi(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Pz(e)}function Pz(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let n=t.codePointAt(a+2);if(n===70||n===102){let r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}var SM=C(()=>{"use strict";tw();tw()});function nw(e,t){if(e&&e.includes(on.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+on.sep+"`")}function rw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function IM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Nz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var aw,Qs,CM=C(()=>{"use strict";zy();wM();vM();SM();aw=["history","path","basename","stem","extname","dirname"],Qs=class{constructor(t){let a;t?Yi(t)?a={path:t}:typeof t=="string"||Nz(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":xM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<aw.length;){let o=aw[n];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let r;for(r in a)aw.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?on.basename(this.path):void 0}set basename(t){rw(t,"basename"),nw(t,"basename"),this.path=on.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?on.dirname(this.path):void 0}set dirname(t){IM(this.basename,"dirname"),this.path=on.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?on.extname(this.path):void 0}set extname(t){if(nw(t,"extname"),IM(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=on.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yi(t)&&(t=bM(t)),rw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?on.basename(this.path,this.extname):void 0}set stem(t){rw(t,"stem"),nw(t,"stem"),this.path=on.join(this.dirname||"",t+(this.extname||""))}fail(t,a,n){let r=this.message(t,a,n);throw r.fatal=!0,r}info(t,a,n){let r=this.message(t,a,n);return r.fatal=void 0,r}message(t,a,n){let r=new Et(t,a,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var kM=C(()=>{"use strict";CM()});var LM,TM=C(()=>{"use strict";LM=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function ow(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EM(e){if(!Ks(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function MM(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function uf(e){return Uz(e)?e:new Qs(e)}function Uz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fz(e){return typeof e=="string"||zz(e)}function zz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var cf,Bz,sw,uw,AM=C(()=>{"use strict";rM();cf=z(pM(),1);mM();yM();kM();TM();Bz={}.hasOwnProperty,sw=class e extends LM{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=ew()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,cf.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(lw("data",this.frozen),this.namespace[t]=a,this):Bz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[a,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=a.call(t,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let a=uf(t),n=this.parser||this.Parser;return ow("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),ow("process",this.parser||this.Parser),iw("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=uf(t),s=n.parse(l);n.run(s,l,function(c,d,f){if(c||!d||!f)return u(c);let p=d,m=n.stringify(p,f);Fz(m)?f.value=m:f.result=m,u(c,f)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),ow("processSync",this.parser||this.Parser),iw("processSync",this.compiler||this.Compiler),this.process(t,r),MM("processSync","process",a),n;function r(o,i){a=!0,Jy(o),n=i}}run(t,a,n){EM(t),this.freeze();let r=this.transformers;return!n&&typeof a=="function"&&(n=a,a=void 0),n?o(void 0,n):new Promise(o);function o(i,l){let s=uf(a);r.run(t,s,u);function u(c,d,f){let p=d||t;c?l(c):i?i(p):n(void 0,p,f)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),MM("runSync","run",n),r;function o(i,l){Jy(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=uf(a),r=this.compiler||this.Compiler;return iw("stringify",r),EM(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(lw("use",this.frozen),t!=null)if(typeof t=="function")s(t,a);else if(typeof t=="object")Array.isArray(t)?l(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;s(c,d)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))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");l(u.plugins),u.settings&&(r.settings=(0,cf.default)(!0,r.settings,u.settings))}function l(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let d=u[c];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===u){f=d;break}if(f===-1)n.push([u,...c]);else if(c.length>0){let[p,...m]=c,x=n[f][1];Ks(x)&&Ks(p)&&(p=(0,cf.default)(!0,x,p)),n[f]=[u,p,...m]}}}},uw=new sw().freeze()});var RM=C(()=>{"use strict";AM()});function pw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function UM(e){jo=e}function Pe(e,t=""){let a=typeof e=="string"?e:e.source,n={replace:(r,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(oa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function rr(e,t){if(t){if(oa.escapeTest.test(e))return e.replace(oa.escapeReplace,OM)}else if(oa.escapeTestNoEncode.test(e))return e.replace(oa.escapeReplaceNoEncode,OM);return e}function PM(e){try{e=encodeURI(e).replace(oa.percentDecode,"%")}catch{return null}return e}function NM(e,t){let a=e.replace(oa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(oa.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(oa.slashPipe,"|");return n}function Js(e,t,a){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let o=e.charAt(n-r-1);if(o===t&&!a)r++;else if(o!==t&&a)r++;else break}return e.slice(0,n-r)}function bq(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])a++;else if(e[n]===t[1]&&(a--,a<0))return n;return a>0?-2:-1}function BM(e,t,a,n,r){let o=t.href,i=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,s}function Sq(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
53
|
+
`}),a}function sM(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var ow,Fz,cM=C(()=>{"use strict";Cd();bd();Bs();oM();ow={}.hasOwnProperty,Fz={}});function cf(e,t){let a=uM(e,t),n=a.one(e,void 0),r=iM(a),o=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return r&&("children"in o,o.children.push({type:"text",value:`
|
|
54
|
+
`},r)),o}var dM=C(()=>{"use strict";lM();cM()});var fM=C(()=>{"use strict";dM()});function df(e,t){return e&&"run"in e?async function(a,n){let r=cf(a,{file:n,...t});await e.run(r,n)}:function(a,n){return cf(a,{file:n,...e||t})}}var pM=C(()=>{"use strict";fM()});var mM=C(()=>{"use strict";pM()});function iw(e){if(e)throw e}var hM=C(()=>{"use strict"});var CM=Kt((xte,IM)=>{"use strict";var ff=Object.prototype.hasOwnProperty,SM=Object.prototype.toString,gM=Object.defineProperty,yM=Object.getOwnPropertyDescriptor,wM=function(t){return typeof Array.isArray=="function"?Array.isArray(t):SM.call(t)==="[object Array]"},xM=function(t){if(!t||SM.call(t)!=="[object Object]")return!1;var a=ff.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&ff.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||ff.call(t,r)},vM=function(t,a){gM&&a.name==="__proto__"?gM(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},bM=function(t,a){if(a==="__proto__")if(ff.call(t,a)){if(yM)return yM(t,a).value}else return;return t[a]};IM.exports=function e(){var t,a,n,r,o,i,l=arguments[0],s=1,u=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},s=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});s<u;++s)if(t=arguments[s],t!=null)for(a in t)n=bM(l,a),r=bM(t,a),l!==r&&(c&&r&&(xM(r)||(o=wM(r)))?(o?(o=!1,i=n&&wM(n)?n:[]):i=n&&xM(n)?n:{},vM(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&vM(l,{name:a,newValue:r}));return l}});function Ys(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var kM=C(()=>{"use strict"});function lw(){let e=[],t={run:a,use:n};return t;function a(...r){let o=-1,i=r.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);l(null,...r);function l(s,...u){let c=e[++o],d=-1;if(s){i(s);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?LM(c,l)(...u):i(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function LM(e,t){let a;return n;function n(...i){let l=e.length>i.length,s;l&&i.push(r);try{s=e.apply(this,i)}catch(u){let c=u;if(l&&a)throw c;return r(c)}l||(s&&s.then&&typeof s.then=="function"?s.then(o,r):s instanceof Error?r(s):o(s))}function r(i,...l){a||(a=!0,t(i,...l))}function o(i){r(null,i)}}var TM=C(()=>{"use strict"});var EM=C(()=>{"use strict";TM()});function Vz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qs(e);let a=0,n=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else n<0&&(o=!0,n=r+1);return n<0?"":e.slice(a,n)}if(t===e)return"";let i=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(n=r):(l=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function Gz(e){if(Qs(e),e.length===0)return".";let t=-1,a=e.length,n;for(;--a;)if(e.codePointAt(a)===47){if(n){t=a;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Wz(e){Qs(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let l=e.codePointAt(t);if(l===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),l===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===n+1?"":e.slice(r,a)}function $z(...e){let t=-1,a;for(;++t<e.length;)Qs(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":Xz(a)}function Xz(e){Qs(e);let t=e.codePointAt(0)===47,a=Kz(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function Kz(e,t){let a="",n=0,r=-1,o=0,i=-1,l,s;for(;++i<=e.length;){if(i<e.length)l=e.codePointAt(i);else{if(l===47)break;l=47}if(l===47){if(!(r===i-1||o===1))if(r!==i-1&&o===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(s=a.lastIndexOf("/"),s!==a.length-1){s<0?(a="",n=0):(a=a.slice(0,s),n=a.length-1-a.lastIndexOf("/")),r=i,o=0;continue}}else if(a.length>0){a="",n=0,r=i,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",n=2)}else a.length>0?a+="/"+e.slice(r+1,i):a=e.slice(r+1,i),n=i-r-1;r=i,o=0}else l===46&&o>-1?o++:o=-1}return a}function Qs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var ln,MM=C(()=>{"use strict";ln={basename:Vz,dirname:Gz,extname:Wz,join:$z,sep:"/"}});function Zz(){return"/"}var AM,RM=C(()=>{"use strict";AM={cwd:Zz}});function el(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var sw=C(()=>{"use strict"});function DM(e){if(typeof e=="string")e=new URL(e);else if(!el(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Yz(e)}function Yz(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let n=t.codePointAt(a+2);if(n===70||n===102){let r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}var _M=C(()=>{"use strict";sw();sw()});function cw(e,t){if(e&&e.includes(ln.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ln.sep+"`")}function dw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function OM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Qz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var uw,Js,PM=C(()=>{"use strict";$y();MM();RM();_M();uw=["history","path","basename","stem","extname","dirname"],Js=class{constructor(t){let a;t?el(t)?a={path:t}:typeof t=="string"||Qz(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":AM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<uw.length;){let o=uw[n];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let r;for(r in a)uw.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?ln.basename(this.path):void 0}set basename(t){dw(t,"basename"),cw(t,"basename"),this.path=ln.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ln.dirname(this.path):void 0}set dirname(t){OM(this.basename,"dirname"),this.path=ln.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ln.extname(this.path):void 0}set extname(t){if(cw(t,"extname"),OM(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ln.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){el(t)&&(t=DM(t)),dw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ln.basename(this.path,this.extname):void 0}set stem(t){dw(t,"stem"),cw(t,"stem"),this.path=ln.join(this.dirname||"",t+(this.extname||""))}fail(t,a,n){let r=this.message(t,a,n);throw r.fatal=!0,r}info(t,a,n){let r=this.message(t,a,n);return r.fatal=void 0,r}message(t,a,n){let r=new Et(t,a,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var NM=C(()=>{"use strict";PM()});var BM,UM=C(()=>{"use strict";BM=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function fw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function FM(e){if(!Ys(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zM(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pf(e){return eq(e)?e:new Js(e)}function eq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tq(e){return typeof e=="string"||aq(e)}function aq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var mf,Jz,hw,gw,qM=C(()=>{"use strict";hM();mf=q(CM(),1);kM();EM();NM();UM();Jz={}.hasOwnProperty,hw=class e extends BM{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=lw()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,mf.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(mw("data",this.frozen),this.namespace[t]=a,this):Jz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[a,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=a.call(t,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let a=pf(t),n=this.parser||this.Parser;return fw("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),fw("process",this.parser||this.Parser),pw("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=pf(t),s=n.parse(l);n.run(s,l,function(c,d,f){if(c||!d||!f)return u(c);let p=d,m=n.stringify(p,f);tq(m)?f.value=m:f.result=m,u(c,f)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),fw("processSync",this.parser||this.Parser),pw("processSync",this.compiler||this.Compiler),this.process(t,r),zM("processSync","process",a),n;function r(o,i){a=!0,iw(o),n=i}}run(t,a,n){FM(t),this.freeze();let r=this.transformers;return!n&&typeof a=="function"&&(n=a,a=void 0),n?o(void 0,n):new Promise(o);function o(i,l){let s=pf(a);r.run(t,s,u);function u(c,d,f){let p=d||t;c?l(c):i?i(p):n(void 0,p,f)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),zM("runSync","run",n),r;function o(i,l){iw(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=pf(a),r=this.compiler||this.Compiler;return pw("stringify",r),FM(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(mw("use",this.frozen),t!=null)if(typeof t=="function")s(t,a);else if(typeof t=="object")Array.isArray(t)?l(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;s(c,d)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))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");l(u.plugins),u.settings&&(r.settings=(0,mf.default)(!0,r.settings,u.settings))}function l(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let d=u[c];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===u){f=d;break}if(f===-1)n.push([u,...c]);else if(c.length>0){let[p,...m]=c,x=n[f][1];Ys(x)&&Ys(p)&&(p=(0,mf.default)(!0,x,p)),n[f]=[u,p,...m]}}}},gw=new hw().freeze()});var HM=C(()=>{"use strict";qM()});function vw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function KM(e){Vo=e}function Pe(e,t=""){let a=typeof e=="string"?e:e.source,n={replace:(r,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(oa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function rr(e,t){if(t){if(oa.escapeTest.test(e))return e.replace(oa.escapeReplace,GM)}else if(oa.escapeTestNoEncode.test(e))return e.replace(oa.escapeReplaceNoEncode,GM);return e}function WM(e){try{e=encodeURI(e).replace(oa.percentDecode,"%")}catch{return null}return e}function $M(e,t){let a=e.replace(oa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(oa.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(oa.slashPipe,"|");return n}function tu(e,t,a){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let o=e.charAt(n-r-1);if(o===t&&!a)r++;else if(o!==t&&a)r++;else break}return e.slice(0,n-r)}function Bq(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])a++;else if(e[n]===t[1]&&(a--,a<0))return n;return a>0?-2:-1}function XM(e,t,a,n,r){let o=t.href,i=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,s}function Uq(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
55
|
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[l]=i;return l.length>=r.length?o.slice(r.length):o}).join(`
|
|
56
|
-
`)}function
|
|
57
|
-
]`).replace("lheading",
|
|
58
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=
|
|
59
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=
|
|
56
|
+
`)}function Qe(e,t){return jo.parse(e,t)}var Vo,nu,nq,oa,rq,oq,iq,ru,lq,bw,ZM,YM,sq,Sw,uq,Iw,cq,dq,vf,Cw,fq,QM,pq,kw,jM,mq,hq,gq,yq,JM,wq,bf,Lw,eA,xq,tA,vq,bq,Sq,aA,Iq,Cq,nA,kq,Lq,Tq,Eq,Mq,Aq,Rq,yf,Dq,rA,oA,_q,VM,Tw,Oq,yw,Pq,hf,eu,Nq,GM,wf,Oa,xf,Ew,sn,gf,au,Fq,jo,Wte,$te,Xte,Kte,Zte,Yte,Qte,iA=C(()=>{"use strict";Vo=vw();nu={exec:()=>null};nq=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),oa={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},rq=/^(?:[ \t]*(?:\n|$))+/,oq=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,iq=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ru=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lq=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bw=/(?:[*+-]|\d{1,9}[.)])/,ZM=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,YM=Pe(ZM).replace(/bull/g,bw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sq=Pe(ZM).replace(/bull/g,bw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uq=/^[^\n]+/,Iw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cq=Pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Iw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dq=Pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bw).getRegex(),vf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Cw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fq=Pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Cw).replace("tag",vf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),QM=Pe(Sw).replace("hr",ru).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex(),pq=Pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",QM).getRegex(),kw={blockquote:pq,code:oq,def:cq,fences:iq,heading:lq,hr:ru,html:fq,lheading:YM,list:dq,newline:rq,paragraph:QM,table:nu,text:uq},jM=Pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ru).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex(),mq={...kw,lheading:sq,table:jM,paragraph:Pe(Sw).replace("hr",ru).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jM).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex()},hq={...kw,html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cw).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:nu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pe(Sw).replace("hr",ru).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",YM).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gq=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yq=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,JM=/^( {2,}|\\)\n(?!\s*$)/,wq=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bf=/[\p{P}\p{S}]/u,Lw=/[\s\p{P}\p{S}]/u,eA=/[^\s\p{P}\p{S}]/u,xq=Pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Lw).getRegex(),tA=/(?!~)[\p{P}\p{S}]/u,vq=/(?!~)[\s\p{P}\p{S}]/u,bq=/(?:[^\s\p{P}\p{S}]|~)/u,Sq=Pe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",nq?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),aA=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Iq=Pe(aA,"u").replace(/punct/g,bf).getRegex(),Cq=Pe(aA,"u").replace(/punct/g,tA).getRegex(),nA="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kq=Pe(nA,"gu").replace(/notPunctSpace/g,eA).replace(/punctSpace/g,Lw).replace(/punct/g,bf).getRegex(),Lq=Pe(nA,"gu").replace(/notPunctSpace/g,bq).replace(/punctSpace/g,vq).replace(/punct/g,tA).getRegex(),Tq=Pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eA).replace(/punctSpace/g,Lw).replace(/punct/g,bf).getRegex(),Eq=Pe(/\\(punct)/,"gu").replace(/punct/g,bf).getRegex(),Mq=Pe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Aq=Pe(Cw).replace("(?:-->|$)","-->").getRegex(),Rq=Pe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Aq).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Dq=Pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rA=Pe(/^!?\[(label)\]\[(ref)\]/).replace("label",yf).replace("ref",Iw).getRegex(),oA=Pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Iw).getRegex(),_q=Pe("reflink|nolink(?!\\()","g").replace("reflink",rA).replace("nolink",oA).getRegex(),VM=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Tw={_backpedal:nu,anyPunctuation:Eq,autolink:Mq,blockSkip:Sq,br:JM,code:yq,del:nu,emStrongLDelim:Iq,emStrongRDelimAst:kq,emStrongRDelimUnd:Tq,escape:gq,link:Dq,nolink:oA,punctuation:xq,reflink:rA,reflinkSearch:_q,tag:Rq,text:wq,url:nu},Oq={...Tw,link:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",yf).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yf).getRegex()},yw={...Tw,emStrongRDelimAst:Lq,emStrongLDelim:Cq,url:Pe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",VM).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Pe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",VM).getRegex()},Pq={...yw,br:Pe(JM).replace("{2,}","*").getRegex(),text:Pe(yw.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},hf={normal:kw,gfm:mq,pedantic:hq},eu={normal:Tw,gfm:yw,breaks:Pq,pedantic:Oq},Nq={"&":"&","<":"<",">":">",'"':""","'":"'"},GM=e=>Nq[e];wf=class{constructor(e){Q(this,"options");Q(this,"rules");Q(this,"lexer");this.options=e||Vo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let a=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?a:tu(a,`
|
|
58
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=Uq(a,t[3]||"",this.rules);return{type:"code",raw:a,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let a=t[2].trim();if(this.rules.other.endingHash.test(a)){let n=tu(a,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(a=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:tu(t[0],`
|
|
59
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=tu(t[0],`
|
|
60
60
|
`).split(`
|
|
61
61
|
`),n="",r="",o=[];for(;a.length>0;){let i=!1,l=[],s;for(s=0;s<a.length;s++)if(this.rules.other.blockquoteStart.test(a[s]))l.push(a[s]),i=!0;else if(!i)l.push(a[s]);else break;a=a.slice(s);let u=l.join(`
|
|
62
62
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -74,9 +74,9 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
74
74
|
`,1)[0],T;if(f=b,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),y.test(f)||w.test(f)||g.test(f)||x.test(f)||I.test(f))break;if(T.search(this.rules.other.nonSpaceChar)>=m||!f.trim())c+=`
|
|
75
75
|
`+T.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||w.test(d)||I.test(d))break;c+=`
|
|
76
76
|
`+f}!p&&!f.trim()&&(p=!0),u+=b+`
|
|
77
|
-
`,e=e.substring(b.length+1),d=T.slice(m)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=u}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let s of r.items){if(this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]),s.task){if(s.text=s.text.replace(this.rules.other.listReplaceTask,""),s.tokens[0]?.type==="text"||s.tokens[0]?.type==="paragraph"){s.tokens[0].raw=s.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),s.tokens[0].text=s.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(s.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};s.checked=c.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=c.raw+s.tokens[0].raw,s.tokens[0].text=c.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(c)):s.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):s.tokens.unshift(c)}}if(!r.loose){let u=s.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}}if(r.loose)for(let s of r.items){s.loose=!0;for(let u of s.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:a,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let a
|
|
78
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of r)o.rows.push(
|
|
79
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=
|
|
77
|
+
`,e=e.substring(b.length+1),d=T.slice(m)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=u}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let s of r.items){if(this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]),s.task){if(s.text=s.text.replace(this.rules.other.listReplaceTask,""),s.tokens[0]?.type==="text"||s.tokens[0]?.type==="paragraph"){s.tokens[0].raw=s.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),s.tokens[0].text=s.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(s.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};s.checked=c.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=c.raw+s.tokens[0].raw,s.tokens[0].text=c.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(c)):s.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):s.tokens.unshift(c)}}if(!r.loose){let u=s.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}}if(r.loose)for(let s of r.items){s.loose=!0;for(let u of s.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:a,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let a=$M(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of r)o.rows.push($M(i,o.header.length).map((l,s)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[s]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let a=t[1].charAt(t[1].length-1)===`
|
|
79
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=tu(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=Bq(t[2],"()");if(o===-2)return;if(o>-1){let i=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?n=n.slice(1):n=n.slice(1,-1)),XM(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){let n=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[n.toLowerCase()];if(!r){let o=a[0].charAt(0);return{type:"text",raw:o,text:o}}return XM(a,r,a[0],this.lexer,this.rules)}}emStrong(e,t,a=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!a||this.rules.inline.punctuation.exec(a))){let r=[...n[0]].length-1,o,i,l=r,s=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(n=u.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(i=[...o].length,n[3]||n[4]){l+=i;continue}else if((n[5]||n[6])&&r%3&&!((r+i)%3)){s+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+s);let c=[...n[0]][0].length,d=e.slice(0,r+n.index+c+i);if(Math.min(r,i)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let a=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(a),r=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return n&&r&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:t[0],text:a}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let a,n;return t[2]==="@"?(a=t[1],n="mailto:"+a):(a=t[1],n=a),{type:"link",raw:t[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let a,n;if(t[2]==="@")a=t[0],n="mailto:"+a;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);a=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let a=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:a}}}},Oa=class ww{constructor(t){Q(this,"tokens");Q(this,"options");Q(this,"state");Q(this,"inlineQueue");Q(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Vo,this.options.tokenizer=this.options.tokenizer||new wf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let a={other:oa,block:hf.normal,inline:eu.normal};this.options.pedantic?(a.block=hf.pedantic,a.inline=eu.pedantic):this.options.gfm&&(a.block=hf.gfm,this.options.breaks?a.inline=eu.breaks:a.inline=eu.gfm),this.tokenizer.rules=a}static get rules(){return{block:hf,inline:eu}}static lex(t,a){return new ww(a).lex(t)}static lexInline(t,a){return new ww(a).inlineTokens(t)}lex(t){t=t.replace(oa.carriageReturn,`
|
|
80
80
|
`),this.blockTokens(t,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let n=this.inlineQueue[a];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,a=[],n=!1){for(this.options.pedantic&&(t=t.replace(oa.tabCharGlobal," ").replace(oa.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(i=>(r=i.call({lexer:this},t,a))?(t=t.substring(r.raw.length),a.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let i=a.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
|
|
81
81
|
`:a.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
82
82
|
`)?"":`
|
|
@@ -90,7 +90,7 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
90
90
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r),n=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let i=a.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
91
91
|
`)?"":`
|
|
92
92
|
`)+r.raw,i.text+=`
|
|
93
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,a}inline(t,a=[]){return this.inlineQueue.push({src:t,tokens:a}),a}inlineTokens(t,a=[]){let n=t,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)o=r[2]?r[2].length:0,n=n.slice(0,r.index+o)+"["+"a".repeat(r[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,l="";for(;t;){i||(l=""),i=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},t,a))?(t=t.substring(s.raw.length),a.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);let c=a.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(s=this.tokenizer.emStrong(t,n,l)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),a.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),a.push(s);continue}let u=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(u=t.substring(0,c+1))}if(s=this.tokenizer.inlineText(u)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(l=s.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return a}},
|
|
93
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,a}inline(t,a=[]){return this.inlineQueue.push({src:t,tokens:a}),a}inlineTokens(t,a=[]){let n=t,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)o=r[2]?r[2].length:0,n=n.slice(0,r.index+o)+"["+"a".repeat(r[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,l="";for(;t;){i||(l=""),i=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},t,a))?(t=t.substring(s.raw.length),a.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);let c=a.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(s=this.tokenizer.emStrong(t,n,l)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),a.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),a.push(s);continue}let u=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(u=t.substring(0,c+1))}if(s=this.tokenizer.inlineText(u)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(l=s.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):a.push(s);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return a}},xf=class{constructor(e){Q(this,"options");Q(this,"parser");this.options=e||Vo}space(e){return""}code({text:e,lang:t,escaped:a}){let n=(t||"").match(oa.notSpaceStart)?.[0],r=e.replace(oa.endingNewline,"")+`
|
|
94
94
|
`;return n?'<pre><code class="language-'+rr(n)+'">'+(a?r:rr(r,!0))+`</code></pre>
|
|
95
95
|
`:"<pre><code>"+(a?r:rr(r,!0))+`</code></pre>
|
|
96
96
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -108,34 +108,34 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
108
108
|
`}tablerow({text:e}){return`<tr>
|
|
109
109
|
${e}</tr>
|
|
110
110
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),a=e.header?"th":"td";return(e.align?`<${a} align="${e.align}">`:`<${a}>`)+t+`</${a}>
|
|
111
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${rr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){let n=this.parser.parseInline(a),r=
|
|
112
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+rr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},
|
|
113
|
-
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,sn.useState)(l);return(0,sn.useEffect)(()=>{if(!i){u(l);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(l)},[e,t,o,i,l]),(0,ya.jsx)(Sw.Provider,{value:{code:e},children:(0,ya.jsxs)(Lq,{language:t,children:[(0,ya.jsx)(Tq,{language:t,children:n}),(0,ya.jsx)(kq,{className:a,language:t,result:s,...r})]})})}});var JM={};ku(JM,{Mermaid:()=>Iw});var eA=C(()=>{"use strict";"use client";wf()});function Dq(e={}){let{immediate:t=!1,debounceDelay:a=Mq,rootMargin:n=Aq,idleTimeout:r=Rq}=e,[o,i]=(0,D.useState)(!1),l=(0,D.useRef)(null),s=(0,D.useRef)(null),u=(0,D.useRef)(null),c=(0,D.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,D.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,D.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,D.useEffect)(()=>{if(t){i(!0);return}let p=l.current;if(!p)return;s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null);let m=()=>{s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null)},x=g=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),g.disconnect()):u.current=d(()=>{i(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},I=g=>{m(),s.current=window.setTimeout(()=>{var b,T;let S=g.takeRecords();(S.length===0||(T=(b=S.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(g)},a)},y=(g,b)=>{g.isIntersecting?I(b):m()},w=new IntersectionObserver(g=>{for(let b of g)y(b,w)},{rootMargin:n,threshold:0});return w.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),w.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function Sf(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let a=e.position.start,n=t.position.start,r=e.position.end,o=t.position.end;return a?.line===n?.line&&a?.column===n?.column&&r?.line===o?.line&&r?.column===o?.column}function vt(e,t){return e.className===t.className&&Sf(e.node,t.node)}var D,E,Mq,Aq,Rq,Mw,Aw,bf,_q,Oq,Pq,sA,tA,Nq,Bq,re,Ji,Sw,uA,aA,nA,Uq,rA,Fq,zq,nu,qq,Hq,jq,Tw,cA,YM,Rw,Vq,Gq,ru,Wq,$q,Xq,dA,fA,Kq,Cw,Zq,Qq,Yq,Jq,e5,t5,a5,Ew,xf,Dw,pA,mA,hA,gA,n5,yA,wA,xA,vA,bA,SA,IA,CA,kA,LA,TA,EA,MA,AA,RA,DA,_A,r5,OA,PA,NA,o5,oA,iA,vf,i5,lA,BA,l5,s5,u5,c5,d5,f5,p5,kw,m5,Lw,UA,FA,zA,h5,g5,y5,w5,ia,_w,x5,el,v5,Iw,wf=C(()=>{"use strict";"use client";D=z(Le(),1);yC();xC();UC();yL();RL();E=z(ne(),1);tg();ng();IT();ZT();nM();RM();KM();Mq=300,Aq="300px",Rq=500;Mw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Aw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),bf=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),_q=e=>(0,E.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,E.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Oq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Pq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),sA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),tA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Nq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Bq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),re=(...e)=>ag(ud(e)),Ji=(e,t,a)=>{let n=typeof t=="string"?new Blob([t],{type:a}):t,r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},Sw=(0,D.createContext)({code:""}),uA=()=>(0,D.useContext)(Sw),aA=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(0),{code:c}=uA(),{isAnimating:d}=(0,D.useContext)(ia),f=o??c,p=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(f),s(!0),e?.(),u.current=window.setTimeout(()=>s(!1),a))}catch(I){t?.(I)}};(0,D.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?Mw:Aw;return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-copy-button",disabled:d,onClick:p,title:"Copy Code",type:"button",...i,children:n??(0,E.jsx)(m,{size:14})})},nA={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",\u6587\u8A00:"wy"},Uq=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=uA(),{isAnimating:s}=(0,D.useContext)(ia),u=o??l,c=`file.${a&&a in nA?nA[a]:"txt"}`,d="text/plain",f=()=>{try{Ji(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-download-button",disabled:s,onClick:f,title:"Download file",type:"button",...i,children:n??(0,E.jsx)(bf,{size:14})})},rA=()=>(0,E.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,E.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,E.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,E.jsx)(_q,{className:"size-4 animate-spin"})})]}),Fq=/\.[^/.]+$/,zq=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),l=new URL(a,window.location.origin).pathname.split("/").pop()||"",s=l.split(".").pop(),u=l.includes(".")&&s!==void 0&&s.length<=4,c="";if(u)c=l;else{let d=i.type,f="png";d.includes("jpeg")||d.includes("jpg")?f="jpg":d.includes("png")?f="png":d.includes("svg")?f="svg":d.includes("gif")?f="gif":d.includes("webp")&&(f="webp"),c=`${(n||l||"image").replace(Fq,"")}.${f}`}Ji(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,E.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,E.jsx)("img",{alt:n,className:re("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,E.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,E.jsx)("button",{className:re("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:o,title:"Download image",type:"button",children:(0,E.jsx)(bf,{size:14})})]}):null},nu=0,qq=()=>{nu+=1,nu===1&&(document.body.style.overflow="hidden")},Hq=()=>{nu=Math.max(0,nu-1),nu===0&&(document.body.style.overflow="")},jq=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,D.useCallback)(()=>{n(),a()},[n,a]);return(0,D.useEffect)(()=>{if(t){qq();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),Hq()}}},[t,a]),t?(0,E.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:a,onKeyDown:s=>{s.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,E.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),role:"presentation",children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:a,title:"Close",type:"button",children:(0,E.jsx)(sA,{size:16})}),(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,E.jsx)(tA,{size:20}),(0,E.jsx)("span",{children:"Open external link?"})]}),(0,E.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,E.jsx)("div",{className:re("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,E.jsxs)("div",{className:"flex gap-2",children:[(0,E.jsx)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:i,type:"button",children:r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Mw,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Aw,{size:14}),(0,E.jsx)("span",{children:"Copy link"})]})}),(0,E.jsxs)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:l,type:"button",children:[(0,E.jsx)(tA,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Tw=(0,D.createContext)(null),cA=()=>(0,D.useContext)(Tw),YM=()=>{var e;let t=cA();return(e=t?.code)!=null?e:null},Rw=()=>{var e;let t=cA();return(e=t?.mermaid)!=null?e:null},Vq=(e,t)=>{var a;let n=(a=void 0)!=null?a:5;return new Promise((r,o)=>{let i="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{let s=document.createElement("canvas"),u=l.width*n,c=l.height*n;s.width=u,s.height=c;let d=s.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(l,0,0,u,c),s.toBlob(f=>{if(!f){o(new Error("Failed to create PNG blob"));return}r(f)},"image/png")},l.onerror=()=>o(new Error("Failed to load SVG image")),l.src=i})},Gq=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,D.useState)(!1),s=(0,D.useRef)(null),{isAnimating:u}=(0,D.useContext)(ia),c=Rw(),d=async f=>{try{if(f==="mmd"){Ji("diagram.mmd",e,"text/plain"),l(!1),n?.(f);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let p=c.getMermaid(r),m=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await p.render(x,e);if(!I){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Ji("diagram.svg",I,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let y=await Vq(I);Ji("diagram.png",y,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,D.useEffect)(()=>{let f=p=>{let m=p.composedPath();s.current&&!m.includes(s.current)&&l(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,E.jsxs)("div",{className:"relative",ref:s,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>l(!i),title:"Download diagram",type:"button",children:t??(0,E.jsx)(bf,{size:14})}),i?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},ru=0,Wq=()=>{ru+=1,ru===1&&(document.body.style.overflow="hidden")},$q=()=>{ru=Math.max(0,ru-1),ru===0&&(document.body.style.overflow="")},Xq=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,D.useState)(!1),{isAnimating:s,controls:u}=(0,D.useContext)(ia),c=(()=>{if(typeof u=="boolean")return u;let f=u.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),d=()=>{l(!i)};return(0,D.useEffect)(()=>{if(i){Wq();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),$q()}}},[i]),(0,D.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:s,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,E.jsx)(Oq,{size:14})}),i?(0,E.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:f=>{f.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:d,title:"Exit fullscreen",type:"button",children:(0,E.jsx)(sA,{size:20})}),(0,E.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:(0,E.jsx)(Iw,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},dA=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let l of o)n.push(((t=l.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let l of i){let s=[],u=l.querySelectorAll("td");for(let c of u)s.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(s)}return{headers:n,rows:r}},fA=e=>{let{headers:t,rows:a}=e,n=l=>{let s=!1,u=!1;for(let c of l){if(c==='"'){s=!0,u=!0;break}(c===","||c===`
|
|
111
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${rr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){let n=this.parser.parseInline(a),r=WM(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+rr(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:a,tokens:n}){n&&(a=this.parser.parseInline(n,this.parser.textRenderer));let r=WM(e);if(r===null)return rr(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${rr(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:rr(e.text)}},Ew=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},sn=class xw{constructor(t){Q(this,"options");Q(this,"renderer");Q(this,"textRenderer");this.options=t||Vo,this.options.renderer=this.options.renderer||new xf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ew}static parse(t,a){return new xw(a).parse(t)}static parseInline(t,a){return new xw(a).parseInline(t)}parse(t){let a="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let i=r,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){a+=l||"";continue}}let o=r;switch(o.type){case"space":{a+=this.renderer.space(o);break}case"hr":{a+=this.renderer.hr(o);break}case"heading":{a+=this.renderer.heading(o);break}case"code":{a+=this.renderer.code(o);break}case"table":{a+=this.renderer.table(o);break}case"blockquote":{a+=this.renderer.blockquote(o);break}case"list":{a+=this.renderer.list(o);break}case"checkbox":{a+=this.renderer.checkbox(o);break}case"html":{a+=this.renderer.html(o);break}case"def":{a+=this.renderer.def(o);break}case"paragraph":{a+=this.renderer.paragraph(o);break}case"text":{a+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return a}parseInline(t,a=this.renderer){let n="";for(let r=0;r<t.length;r++){let o=t[r];if(this.options.extensions?.renderers?.[o.type]){let l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=l||"";continue}}let i=o;switch(i.type){case"escape":{n+=a.text(i);break}case"html":{n+=a.html(i);break}case"link":{n+=a.link(i);break}case"image":{n+=a.image(i);break}case"checkbox":{n+=a.checkbox(i);break}case"strong":{n+=a.strong(i);break}case"em":{n+=a.em(i);break}case"codespan":{n+=a.codespan(i);break}case"br":{n+=a.br(i);break}case"del":{n+=a.del(i);break}case"text":{n+=a.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},au=(gf=class{constructor(e){Q(this,"options");Q(this,"block");this.options=e||Vo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Oa.lex:Oa.lexInline}provideParser(){return this.block?sn.parse:sn.parseInline}},Q(gf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Q(gf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),gf),Fq=class{constructor(...e){Q(this,"defaults",vw());Q(this,"options",this.setOptions);Q(this,"parse",this.parseMarkdown(!0));Q(this,"parseInline",this.parseMarkdown(!1));Q(this,"Parser",sn);Q(this,"Renderer",xf);Q(this,"TextRenderer",Ew);Q(this,"Lexer",Oa);Q(this,"Tokenizer",wf);Q(this,"Hooks",au);this.use(...e)}walkTokens(e,t){let a=[];for(let n of e)switch(a=a.concat(t.call(this,n)),n.type){case"table":{let r=n;for(let o of r.header)a=a.concat(this.walkTokens(o.tokens,t));for(let o of r.rows)for(let i of o)a=a.concat(this.walkTokens(i.tokens,t));break}case"list":{let r=n;a=a.concat(this.walkTokens(r.items,t));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let i=r[o].flat(1/0);a=a.concat(this.walkTokens(i,t))}):r.tokens&&(a=a.concat(this.walkTokens(r.tokens,t)))}}return a}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(a=>{let n={...a};if(n.async=this.defaults.async||n.async||!1,a.extensions&&(a.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let o=t.renderers[r.name];o?t.renderers[r.name]=function(...i){let l=r.renderer.apply(this,i);return l===!1&&(l=o.apply(this,i)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),n.extensions=t),a.renderer){let r=this.defaults.renderer||new xf(this.defaults);for(let o in a.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,l=a.renderer[i],s=r[i];r[i]=(...u)=>{let c=l.apply(r,u);return c===!1&&(c=s.apply(r,u)),c||""}}n.renderer=r}if(a.tokenizer){let r=this.defaults.tokenizer||new wf(this.defaults);for(let o in a.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,l=a.tokenizer[i],s=r[i];r[i]=(...u)=>{let c=l.apply(r,u);return c===!1&&(c=s.apply(r,u)),c}}n.tokenizer=r}if(a.hooks){let r=this.defaults.hooks||new au;for(let o in a.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,l=a.hooks[i],s=r[i];au.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async&&au.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await l.call(r,u);return s.call(r,d)})();let c=l.call(r,u);return s.call(r,c)}:r[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(r,u);return d===!1&&(d=await s.apply(r,u)),d})();let c=l.apply(r,u);return c===!1&&(c=s.apply(r,u)),c}}n.hooks=r}if(a.walkTokens){let r=this.defaults.walkTokens,o=a.walkTokens;n.walkTokens=function(i){let l=[];return l.push(o.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Oa.lex(e,t??this.defaults)}parser(e,t){return sn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,a)=>{let n={...a},r={...this.defaults,...n},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let i=r.hooks?await r.hooks.preprocess(t):t,l=await(r.hooks?await r.hooks.provideLexer():e?Oa.lex:Oa.lexInline)(i,r),s=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(s,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():e?sn.parse:sn.parseInline)(s,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let i=(r.hooks?r.hooks.provideLexer():e?Oa.lex:Oa.lexInline)(t,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let l=(r.hooks?r.hooks.provideParser():e?sn.parse:sn.parseInline)(i,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(i){return o(i)}}}onError(e,t){return a=>{if(a.message+=`
|
|
112
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+rr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},jo=new Fq;Qe.options=Qe.setOptions=function(e){return jo.setOptions(e),Qe.defaults=jo.defaults,KM(Qe.defaults),Qe};Qe.getDefaults=vw;Qe.defaults=Vo;Qe.use=function(...e){return jo.use(...e),Qe.defaults=jo.defaults,KM(Qe.defaults),Qe};Qe.walkTokens=function(e,t){return jo.walkTokens(e,t)};Qe.parseInline=jo.parseInline;Qe.Parser=sn;Qe.parser=sn.parse;Qe.Renderer=xf;Qe.TextRenderer=Ew;Qe.Lexer=Oa;Qe.lexer=Oa.lex;Qe.Tokenizer=wf;Qe.Hooks=au;Qe.parse=Qe;Wte=Qe.options,$te=Qe.setOptions,Xte=Qe.use,Kte=Qe.walkTokens,Zte=Qe.parseInline,Yte=sn.parse,Qte=Oa.lex});var lA={};Eu(lA,{CodeBlock:()=>Vq});var un,wa,zq,qq,Hq,jq,Vq,sA=C(()=>{"use strict";"use client";Sf();un=q(Ie(),1),wa=q(ne(),1),zq=re("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),qq=(0,un.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,un.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,wa.jsx)("pre",{className:re(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":a,"data-streamdown":"code-block-body",style:o,...r,children:(0,wa.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((i,l)=>(0,wa.jsx)("span",{className:zq,children:i.map((s,u)=>(0,wa.jsx)("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:s.color,backgroundColor:s.bgColor,...s.htmlStyle},...s.htmlAttrs,children:s.content},u))},l))})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),Hq=({className:e,language:t,style:a,...n})=>(0,wa.jsx)("div",{className:re("my-4 w-full overflow-hidden rounded-xl border border-border",e),"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...a},...n}),jq=({language:e,children:t})=>(0,wa.jsxs)("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":e,"data-streamdown":"code-block-header",children:[(0,wa.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,wa.jsx)("div",{className:"flex items-center gap-2",children:t})]}),Vq=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,un.useContext)(ia),i=uA(),l=(0,un.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
113
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,un.useState)(l);return(0,un.useEffect)(()=>{if(!i){u(l);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(l)},[e,t,o,i,l]),(0,wa.jsx)(Mw.Provider,{value:{code:e},children:(0,wa.jsxs)(Hq,{language:t,children:[(0,wa.jsx)(jq,{language:t,children:n}),(0,wa.jsx)(qq,{className:a,language:t,result:s,...r})]})})}});var cA={};Eu(cA,{Mermaid:()=>Aw});var dA=C(()=>{"use strict";"use client";Sf()});function Xq(e={}){let{immediate:t=!1,debounceDelay:a=Gq,rootMargin:n=Wq,idleTimeout:r=$q}=e,[o,i]=(0,D.useState)(!1),l=(0,D.useRef)(null),s=(0,D.useRef)(null),u=(0,D.useRef)(null),c=(0,D.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,D.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,D.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,D.useEffect)(()=>{if(t){i(!0);return}let p=l.current;if(!p)return;s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null);let m=()=>{s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null)},x=g=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),g.disconnect()):u.current=d(()=>{i(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},I=g=>{m(),s.current=window.setTimeout(()=>{var b,T;let S=g.takeRecords();(S.length===0||(T=(b=S.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(g)},a)},y=(g,b)=>{g.isIntersecting?I(b):m()},w=new IntersectionObserver(g=>{for(let b of g)y(b,w)},{rootMargin:n,threshold:0});return w.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),w.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function Lf(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let a=e.position.start,n=t.position.start,r=e.position.end,o=t.position.end;return a?.line===n?.line&&a?.column===n?.column&&r?.line===o?.line&&r?.column===o?.column}function vt(e,t){return e.className===t.className&&Lf(e.node,t.node)}var D,E,Gq,Wq,$q,Nw,Bw,kf,Kq,Zq,Yq,xA,fA,Qq,Jq,re,tl,Mw,vA,pA,mA,e5,hA,t5,a5,ou,n5,r5,o5,Ow,bA,uA,Uw,i5,l5,iu,s5,u5,c5,SA,IA,d5,Rw,f5,p5,m5,h5,g5,y5,w5,Pw,If,Fw,CA,kA,LA,TA,x5,EA,MA,AA,RA,DA,_A,OA,PA,NA,BA,UA,FA,zA,qA,HA,jA,VA,v5,GA,WA,$A,b5,gA,yA,Cf,S5,wA,XA,I5,C5,k5,L5,T5,E5,M5,Dw,A5,_w,KA,ZA,YA,R5,D5,_5,O5,ia,zw,P5,al,N5,Aw,Sf=C(()=>{"use strict";"use client";D=q(Ie(),1);EC();AC();KC();EL();HL();E=q(ne(),1);lg();ug();OT();lE();mM();HM();iA();Gq=300,Wq="300px",$q=500;Nw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Bw=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),kf=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Kq=e=>(0,E.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,E.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Zq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Yq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),xA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),fA=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Qq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Jq=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),re=(...e)=>sg(fd(e)),tl=(e,t,a)=>{let n=typeof t=="string"?new Blob([t],{type:a}):t,r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},Mw=(0,D.createContext)({code:""}),vA=()=>(0,D.useContext)(Mw),pA=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(0),{code:c}=vA(),{isAnimating:d}=(0,D.useContext)(ia),f=o??c,p=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(f),s(!0),e?.(),u.current=window.setTimeout(()=>s(!1),a))}catch(I){t?.(I)}};(0,D.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?Nw:Bw;return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-copy-button",disabled:d,onClick:p,title:"Copy Code",type:"button",...i,children:n??(0,E.jsx)(m,{size:14})})},mA={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",\u6587\u8A00:"wy"},e5=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=vA(),{isAnimating:s}=(0,D.useContext)(ia),u=o??l,c=`file.${a&&a in mA?mA[a]:"txt"}`,d="text/plain",f=()=>{try{tl(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),"data-streamdown":"code-block-download-button",disabled:s,onClick:f,title:"Download file",type:"button",...i,children:n??(0,E.jsx)(kf,{size:14})})},hA=()=>(0,E.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,E.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,E.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,E.jsx)(Kq,{className:"size-4 animate-spin"})})]}),t5=/\.[^/.]+$/,a5=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),l=new URL(a,window.location.origin).pathname.split("/").pop()||"",s=l.split(".").pop(),u=l.includes(".")&&s!==void 0&&s.length<=4,c="";if(u)c=l;else{let d=i.type,f="png";d.includes("jpeg")||d.includes("jpg")?f="jpg":d.includes("png")?f="png":d.includes("svg")?f="svg":d.includes("gif")?f="gif":d.includes("webp")&&(f="webp"),c=`${(n||l||"image").replace(t5,"")}.${f}`}tl(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,E.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,E.jsx)("img",{alt:n,className:re("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,E.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,E.jsx)("button",{className:re("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:o,title:"Download image",type:"button",children:(0,E.jsx)(kf,{size:14})})]}):null},ou=0,n5=()=>{ou+=1,ou===1&&(document.body.style.overflow="hidden")},r5=()=>{ou=Math.max(0,ou-1),ou===0&&(document.body.style.overflow="")},o5=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,D.useCallback)(()=>{n(),a()},[n,a]);return(0,D.useEffect)(()=>{if(t){n5();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),r5()}}},[t,a]),t?(0,E.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:a,onKeyDown:s=>{s.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,E.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),role:"presentation",children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:a,title:"Close",type:"button",children:(0,E.jsx)(xA,{size:16})}),(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,E.jsx)(fA,{size:20}),(0,E.jsx)("span",{children:"Open external link?"})]}),(0,E.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,E.jsx)("div",{className:re("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,E.jsxs)("div",{className:"flex gap-2",children:[(0,E.jsx)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:i,type:"button",children:r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Nw,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Bw,{size:14}),(0,E.jsx)("span",{children:"Copy link"})]})}),(0,E.jsxs)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:l,type:"button",children:[(0,E.jsx)(fA,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Ow=(0,D.createContext)(null),bA=()=>(0,D.useContext)(Ow),uA=()=>{var e;let t=bA();return(e=t?.code)!=null?e:null},Uw=()=>{var e;let t=bA();return(e=t?.mermaid)!=null?e:null},i5=(e,t)=>{var a;let n=(a=void 0)!=null?a:5;return new Promise((r,o)=>{let i="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{let s=document.createElement("canvas"),u=l.width*n,c=l.height*n;s.width=u,s.height=c;let d=s.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(l,0,0,u,c),s.toBlob(f=>{if(!f){o(new Error("Failed to create PNG blob"));return}r(f)},"image/png")},l.onerror=()=>o(new Error("Failed to load SVG image")),l.src=i})},l5=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,D.useState)(!1),s=(0,D.useRef)(null),{isAnimating:u}=(0,D.useContext)(ia),c=Uw(),d=async f=>{try{if(f==="mmd"){tl("diagram.mmd",e,"text/plain"),l(!1),n?.(f);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let p=c.getMermaid(r),m=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await p.render(x,e);if(!I){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){tl("diagram.svg",I,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let y=await i5(I);tl("diagram.png",y,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,D.useEffect)(()=>{let f=p=>{let m=p.composedPath();s.current&&!m.includes(s.current)&&l(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,E.jsxs)("div",{className:"relative",ref:s,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>l(!i),title:"Download diagram",type:"button",children:t??(0,E.jsx)(kf,{size:14})}),i?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},iu=0,s5=()=>{iu+=1,iu===1&&(document.body.style.overflow="hidden")},u5=()=>{iu=Math.max(0,iu-1),iu===0&&(document.body.style.overflow="")},c5=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,D.useState)(!1),{isAnimating:s,controls:u}=(0,D.useContext)(ia),c=(()=>{if(typeof u=="boolean")return u;let f=u.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),d=()=>{l(!i)};return(0,D.useEffect)(()=>{if(i){s5();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),u5()}}},[i]),(0,D.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:s,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,E.jsx)(Zq,{size:14})}),i?(0,E.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:f=>{f.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:d,title:"Exit fullscreen",type:"button",children:(0,E.jsx)(xA,{size:20})}),(0,E.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:(0,E.jsx)(Aw,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},SA=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let l of o)n.push(((t=l.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let l of i){let s=[],u=l.querySelectorAll("td");for(let c of u)s.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(s)}return{headers:n,rows:r}},IA=e=>{let{headers:t,rows:a}=e,n=l=>{let s=!1,u=!1;for(let c of l){if(c==='"'){s=!0,u=!0;break}(c===","||c===`
|
|
114
114
|
`)&&(s=!0)}return s?u?`"${l.replace(/"/g,'""')}"`:`"${l}"`:l},r=t.length>0?a.length+1:a.length,o=new Array(r),i=0;t.length>0&&(o[i]=t.map(n).join(","),i+=1);for(let l of a)o[i]=l.map(n).join(","),i+=1;return o.join(`
|
|
115
|
-
`)},
|
|
115
|
+
`)},d5=e=>{let{headers:t,rows:a}=e,n=l=>{let s=!1;for(let c of l)if(c===" "||c===`
|
|
116
116
|
`||c==="\r"){s=!0;break}if(!s)return l;let u=[];for(let c of l)c===" "?u.push("\\t"):c===`
|
|
117
117
|
`?u.push("\\n"):c==="\r"?u.push("\\r"):u.push(c);return u.join("")},r=t.length>0?a.length+1:a.length,o=new Array(r),i=0;t.length>0&&(o[i]=t.map(n).join(" "),i+=1);for(let l of a)o[i]=l.map(n).join(" "),i+=1;return o.join(`
|
|
118
|
-
`)},
|
|
119
|
-
`)},Qq=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,D.useState)(!1),[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(null),c=(0,D.useRef)(0),{isAnimating:d}=(0,D.useContext)(ia),f=async m=>{var x,I;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let y=(I=u.current)==null?void 0:I.closest('[data-streamdown="table-wrapper"]'),w=y?.querySelector("table");if(!w){n?.(new Error("Table not found"));return}let g=dA(w),b=m==="csv"?fA(g):Kq(g),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(y){n?.(y)}};(0,D.useEffect)(()=>{let m=x=>{let I=x.composedPath();u.current&&!I.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?Mw:Aw;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>i(!o),title:"Copy table",type:"button",children:e??(0,E.jsx)(p,{size:14})}),o?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},Yq=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useRef)(null),{isAnimating:l}=(0,D.useContext)(ia),s=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){n?.(new Error("Table not found"));return}let p=dA(f),m=u==="csv"?fA(p):Zq(p);Ji(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,D.useEffect)(()=>{let u=c=>{let d=c.composedPath();i.current&&!d.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]),(0,E.jsxs)("div",{className:"relative",ref:i,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,E.jsx)(bf,{size:14})}),r?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},Jq=({children:e,className:t,showControls:a,...n})=>(0,E.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,E.jsx)(Qq,{}),(0,E.jsx)(Yq,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:re("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),e5=(0,D.lazy)(()=>Promise.resolve().then(()=>(QM(),ZM)).then(e=>({default:e.CodeBlock}))),t5=(0,D.lazy)(()=>Promise.resolve().then(()=>(eA(),JM)).then(e=>({default:e.Mermaid}))),a5=/language-([^\s]+)/;Ew=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,xf=(e,t)=>{if(typeof e=="boolean")return e;let a=e.mermaid;return a===!1?!1:a===!0||a===void 0?!0:a[t]!==!1},Dw=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:re("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>vt(e,t));Dw.displayName="MarkdownOl";pA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:re("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Sf(e.node,t.node));pA.displayName="MarkdownLi";mA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:re("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>vt(e,t));mA.displayName="MarkdownUl";hA=(0,D.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:re("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>vt(e,t));hA.displayName="MarkdownHr";gA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:re("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>vt(e,t));gA.displayName="MarkdownStrong";n5=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,D.useContext)(ia),[i,l]=(0,D.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,D.useCallback)(async p=>{if(!(!(o!=null&&o.enabled&&a)||s)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}l(!0)}},[o,a,s]),c=(0,D.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,D.useCallback)(()=>{l(!1)},[]),f={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,E.jsx)(jq,{...f})]}):(0,E.jsx)("a",{className:re("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},yA=(0,D.memo)(n5,(e,t)=>vt(e,t)&&e.href===t.href);yA.displayName="MarkdownA";wA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:re("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>vt(e,t));wA.displayName="MarkdownH1";xA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:re("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>vt(e,t));xA.displayName="MarkdownH2";vA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:re("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>vt(e,t));vA.displayName="MarkdownH3";bA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:re("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>vt(e,t));bA.displayName="MarkdownH4";SA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:re("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>vt(e,t));SA.displayName="MarkdownH5";IA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:re("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>vt(e,t));IA.displayName="MarkdownH6";CA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,D.useContext)(ia),o=Ew(r,"table");return(0,E.jsx)(Jq,{className:t,showControls:o,...n,children:e})},(e,t)=>vt(e,t));CA.displayName="MarkdownTable";kA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:re("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>vt(e,t));kA.displayName="MarkdownThead";LA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:re("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>vt(e,t));LA.displayName="MarkdownTbody";TA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:re("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>vt(e,t));TA.displayName="MarkdownTr";EA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("th",{className:re("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>vt(e,t));EA.displayName="MarkdownTh";MA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:re("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>vt(e,t));MA.displayName="MarkdownTd";AA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("blockquote",{className:re("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>vt(e,t));AA.displayName="MarkdownBlockquote";RA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:re("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>vt(e,t));RA.displayName="MarkdownSup";DA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:re("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>vt(e,t));DA.displayName="MarkdownSub";_A=(0,D.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,D.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if((0,D.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of p){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if((0,D.isValidElement)(m)&&((s=m.props)==null?void 0:s["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,D.isValidElement)(i))return i;if(i.type===Dw){let l=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(s=>!r(s));return l.length===0?null:{...i,props:{...i.props,children:l}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,E.jsx)("section",{className:t,...n,children:o}):null}return(0,E.jsx)("section",{className:t,...n,children:e})},(e,t)=>vt(e,t));_A.displayName="MarkdownSection";r5=({node:e,className:t,children:a,...n})=>{var r,o,i;let l=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:s,controls:u}=(0,D.useContext)(ia),c=Rw();if(l)return(0,E.jsx)("code",{className:re("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:a});let d=t?.match(a5),f=(i=d?.at(1))!=null?i:"",p="";if((0,D.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?p=a.props.children:typeof a=="string"&&(p=a),f==="mermaid"&&c){let x=Ew(u,"mermaid"),I=xf(u,"download"),y=xf(u,"copy"),w=xf(u,"fullscreen"),g=xf(u,"panZoom"),b=x&&(I||y||w);return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(rA,{}),children:(0,E.jsxs)("div",{className:re("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[b?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[I?(0,E.jsx)(Gq,{chart:p,config:s?.config}):null,y?(0,E.jsx)(aA,{code:p}):null,w?(0,E.jsx)(Xq,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(t5,{chart:p,config:s?.config,showControls:g})]})})}let m=Ew(u,"code");return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(rA,{}),children:(0,E.jsx)(e5,{className:re("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Uq,{code:p,language:f}),(0,E.jsx)(aA,{})]}):null})})},OA=(0,D.memo)(r5,(e,t)=>e.className===t.className&&Sf(e.node,t.node));OA.displayName="MarkdownCode";PA=(0,D.memo)(zq,(e,t)=>e.className===t.className&&Sf(e.node,t.node));PA.displayName="MarkdownImg";NA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(i.length===1&&(0,D.isValidElement)(i[0])){let l=i[0].props.node,s=l?.tagName;if(s==="img")return(0,E.jsx)(E.Fragment,{children:e});if(s==="code"&&((r=l?.position)==null?void 0:r.start.line)!==((o=l?.position)==null?void 0:o.end.line))return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)("p",{className:t,...n,children:e})},(e,t)=>vt(e,t));NA.displayName="MarkdownParagraph";o5={ol:Dw,li:pA,ul:mA,hr:hA,strong:gA,a:yA,h1:wA,h2:xA,h3:vA,h4:bA,h5:SA,h6:IA,table:CA,thead:kA,tbody:LA,tr:TA,th:EA,td:MA,blockquote:AA,code:OA,img:PA,pre:({children:e})=>e,sup:RA,sub:DA,p:NA,section:_A},oA=[],iA={allowDangerousHtml:!0},vf=new WeakMap,i5=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let a=e.rehypePlugins,n=e.remarkPlugins,r=e.remarkRehypeOptions;if(!(a||n||r)){let c="default";return this.keyCache.set(e,c),c}let o=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let p=c[f];if(f>0&&(d+=","),Array.isArray(p)){let[m,x]=p;if(typeof m=="function"){let I=vf.get(m);I||(I=m.name,vf.set(m,I)),d+=I}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=vf.get(p);m||(m=p.name,vf.set(p,m)),d+=m}else d+=String(p)}return d},i=o(a),l=o(n),s=r?JSON.stringify(r):"",u=`${l}::${i}::${s}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),a=this.cache.get(t);return a&&(this.cache.delete(t),this.cache.set(t,a)),a}set(e,t){let a=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(a,t)}clear(){this.cache.clear()}},lA=new i5,BA=e=>{let t=l5(e),a=e.children||"";return u5(t.runSync(t.parse(a),a),e)},l5=e=>{let t=lA.get(e);if(t)return t;let a=s5(e);return lA.set(e,a),a},s5=e=>{let t=e.rehypePlugins||oA,a=e.remarkPlugins||oA,n=e.remarkRehypeOptions?{...iA,...e.remarkRehypeOptions}:iA;return uw().use(af).use(a).use(lf,n).use(t)},u5=(e,t)=>Hy(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),c5=/\[\^[^\]\s]{1,200}\](?!:)/,d5=/\[\^[^\]\s]{1,200}\]:/,f5=/<\/(\w+)>/,p5=/<(\w+)[\s>]/,kw=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
120
|
-
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},
|
|
121
|
-
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},Lw=e=>{let t=0;for(let a=0;a<e.length-1;a+=1)e[a]==="$"&&e[a+1]==="$"&&(t+=1,a+=1);return t},UA=e=>{let t=c5.test(e),a=d5.test(e);if(t||a)return[e];let n=_a.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let l=i.raw,s=r.length;if(o.length>0){if(r[s-1]+=l,i.type==="html"){let u=l.match(f5);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(p5);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=kw(u),d=Lw(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&m5(l)){let u=r[s-1],c=kw(u),d=Lw(u),f=Lw(l);if(c&&d%2===1&&!kw(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},FA={raw:wC,sanitize:[Sd,{}],harden:[gC,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},zA={gfm:[$d,{}]},h5=Object.values(FA),g5=Object.values(zA),y5={block:" \u258B",circle:" \u25CF"},w5={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ia=(0,D.createContext)(w5),_w=(0,D.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(BA,{...n,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let a=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(a.length!==n.length||a.some(r=>{var o,i;return((o=e.components)==null?void 0:o[r])!==((i=t.components)==null?void 0:i[r])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});_w.displayName="Block";x5=["github-light","github-dark"],el=(0,D.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=h5,remarkPlugins:o=g5,className:i,shikiTheme:l=x5,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=_w,parseMarkdownIntoBlocksFn:f=UA,caret:p,plugins:m,remend:x,linkSafety:I={enabled:!0},...y})=>{let w=(0,D.useId)(),[g,b]=(0,D.useTransition)(),T=(0,D.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?AL(e,x):e,[e,t,a,x]),S=(0,D.useMemo)(()=>f(T),[T,f]),[M,R]=(0,D.useState)(S);(0,D.useEffect)(()=>{t==="streaming"?b(()=>{R(S)}):R(S)},[S,t]);let _=t==="streaming"?M:S,k=(0,D.useMemo)(()=>_.map((H,$)=>`${w}-${$}`),[_.length,w]),G=(0,D.useMemo)(()=>{var H,$;return{shikiTheme:($=(H=m?.code)==null?void 0:H.getThemes())!=null?$:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:I}},[l,u,c,t,s,I,m?.code]),B=(0,D.useMemo)(()=>({...o5,...n}),[n]),U=(0,D.useMemo)(()=>{let H=[];return m!=null&&m.cjk&&(H=[...H,...m.cjk.remarkPluginsBefore]),H=[...H,...o],m!=null&&m.cjk&&(H=[...H,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(H=[...H,m.math.remarkPlugin]),H},[o,m?.math,m?.cjk]),W=(0,D.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),A=(0,D.useMemo)(()=>p&&c?{"--streamdown-caret":`"${y5[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Tw.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:G,children:(0,E.jsx)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(BA,{components:B,rehypePlugins:W,remarkPlugins:U,...y,children:e})})})}):(0,E.jsx)(Tw.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:G,children:(0,E.jsxs)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:A,children:[_.length===0&&p&&c&&(0,E.jsx)("span",{}),_.map((H,$)=>(0,E.jsx)(d,{components:B,content:H,index:$,rehypePlugins:W,remarkPlugins:U,shouldParseIncompleteMarkdown:a,...y},k[$]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);el.displayName="Streamdown";v5=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:l=!1})=>{let s=(0,D.useRef)(null),u=(0,D.useRef)(null),[c,d]=(0,D.useState)(i),[f,p]=(0,D.useState)({x:0,y:0}),[m,x]=(0,D.useState)(!1),[I,y]=(0,D.useState)({x:0,y:0}),[w,g]=(0,D.useState)({x:0,y:0}),b=(0,D.useCallback)(B=>{d(U=>Math.max(a,Math.min(n,U+B)))},[a,n]),T=(0,D.useCallback)(()=>{b(r)},[b,r]),S=(0,D.useCallback)(()=>{b(-r)},[b,r]),M=(0,D.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),R=(0,D.useCallback)(B=>{B.preventDefault();let U=B.deltaY>0?-r:r;b(U)},[b,r]),_=(0,D.useCallback)(B=>{if(B.button!==0||B.isPrimary===!1)return;x(!0),y({x:B.clientX,y:B.clientY}),g(f);let U=B.currentTarget;U instanceof HTMLElement&&U.setPointerCapture(B.pointerId)},[f]),k=(0,D.useCallback)(B=>{if(!m)return;B.preventDefault();let U=B.clientX-I.x,W=B.clientY-I.y;p({x:w.x+U,y:w.y+W})},[m,I,w]),G=(0,D.useCallback)(B=>{x(!1);let U=B.currentTarget;U instanceof HTMLElement&&U.releasePointerCapture(B.pointerId)},[]);return(0,D.useEffect)(()=>{let B=s.current;if(B)return B.addEventListener("wheel",R,{passive:!1}),()=>{B.removeEventListener("wheel",R)}},[R]),(0,D.useEffect)(()=>{let B=u.current;if(B&&m)return document.body.style.userSelect="none",B.addEventListener("pointermove",k,{passive:!1}),B.addEventListener("pointerup",G),B.addEventListener("pointercancel",G),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",k),B.removeEventListener("pointerup",G),B.removeEventListener("pointercancel",G)}},[m,k,G]),(0,E.jsxs)("div",{className:re("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:s,style:{cursor:m?"grabbing":"grab"},children:[o?(0,E.jsxs)("div",{className:re("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c>=n,onClick:T,title:"Zoom in",type:"button",children:(0,E.jsx)(Nq,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c<=a,onClick:S,title:"Zoom out",type:"button",children:(0,E.jsx)(Bq,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:(0,E.jsx)(Pq,{size:16})})]}):null,(0,E.jsx)("div",{className:re("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:_,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},Iw=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,D.useState)(null),[l,s]=(0,D.useState)(!1),[u,c]=(0,D.useState)(""),[d,f]=(0,D.useState)(""),[p,m]=(0,D.useState)(0),{mermaid:x}=(0,D.useContext)(ia),I=Rw(),y=x?.errorComponent,{shouldRender:w,containerRef:g}=Dq({immediate:n});if((0,D.useEffect)(()=>{if(w){if(!I){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=I.getMermaid(a),S=e.split("").reduce((_,k)=>(_<<5)-_+k.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await T.render(M,e);c(R),f(R)}catch(T){if(!(d||u)){let S=T instanceof Error?T.message:"Failed to render Mermaid chart";i(S)}}finally{s(!1)}})()}},[e,a,p,w,I]),!(w||u||d))return(0,E.jsx)("div",{className:re("my-4 min-h-[200px]",t),ref:g});if(l&&!u&&!d)return(0,E.jsx)("div",{className:re("my-4 flex justify-center p-4",t),ref:g,children:(0,E.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,E.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,E.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,E.jsx)("div",{ref:g,children:(0,E.jsx)(y,{chart:e,error:o,retry:()=>m(S=>S+1)})}):(0,E.jsxs)("div",{className:re("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,E.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,E.jsxs)("details",{className:"mt-2",children:[(0,E.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,E.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let b=u||d;return(0,E.jsx)("div",{className:re("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,E.jsx)(v5,{className:re(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,E.jsx)("div",{"aria-label":"Mermaid chart",className:re("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var dD=Kt((Bre,cD)=>{"use strict";function aj(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,n=0;return function(...o){clearTimeout(a);let i=Date.now(),l=i-n,s=t-l;s<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},s)}}cD.exports=aj});var bu=z(Le(),1),gx=z(uI(),1);function Ui(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var UP=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],FP=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],zP=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],qP=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],HP=["waniwani/visitorId","visitorId"],jP=["correlationId","openai/requestId"];function cI(e){return e?Ui(e,UP):void 0}function dI(e){return e?Ui(e,FP):void 0}function fI(e){return e?Ui(e,zP):void 0}function pI(e){return e?Ui(e,qP):void 0}function mI(e){return e?Ui(e,HP):void 0}function hI(e){return e?Ui(e,jP):void 0}var VP=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],GP=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function gI(e,t){if(e){let n=e["waniwani/source"];if(typeof n=="string"&&n.length>0)return n;for(let{key:r,source:o}of VP){let i=e[r];if(typeof i=="string"&&i.length>0)return o}}let a=t?.name;if(typeof a=="string"&&a.length>0){let n=a.toLowerCase();for(let{needle:r,source:o}of GP)if(n.includes(r))return o}}var WP="@waniwani/sdk";function yI(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??$P,r=ZP(e),o=ad(e.meta),i=ad(e.metadata),l=QP(e,o),s=nn(e.eventId)??n(),u=YP(e.timestamp,a),c=nn(e.source)??gI(o)??t.source??WP,d=jh(e)?{...e}:void 0,f={...i};return Object.keys(o).length>0&&(f.meta=o),d&&(f.rawLegacy=d),{id:s,type:"mcp.event",name:r,source:c,timestamp:u,correlation:l,properties:XP(e,r),metadata:f,rawLegacy:d}}function $P(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function XP(e,t){if(!jh(e))return ad(e.properties);let a=KP(e,t),n=ad(e.properties);return{...a,...n}}function KP(e,t){switch(t){case"tool.called":{let a={};return nn(e.toolName)&&(a.name=e.toolName),nn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return nn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function ZP(e){return jh(e)?e.eventType:e.event}function QP(e,t){let a=nn(e.requestId)??dI(t),n=nn(e.sessionId)??cI(t),r=nn(e.traceId)??fI(t),o=nn(e.externalUserId)??pI(t),i=nn(e.visitorId)??mI(t),l=nn(e.correlationId)??hI(t)??a,s={};return n&&(s.sessionId=n),r&&(s.traceId=r),a&&(s.requestId=a),l&&(s.correlationId=l),o&&(s.externalUserId=o),i&&(s.visitorId=i),s}function YP(e,t){if(e instanceof Date)return e.toISOString();if(typeof e=="string"){let a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return t().toISOString()}function ad(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function nn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function jh(e){return"eventType"in e}function wI(e){return{priceShown:({amount:t,currency:a,itemId:n,label:r,...o})=>e({event:"price_shown",properties:{amount:t,currency:a,itemId:n,label:r},...o}),pricesCompared:({options:t,...a})=>e({event:"prices_compared",properties:{options:t},...a}),optionSelected:({id:t,amount:a,currency:n,...r})=>e({event:"option_selected",properties:{id:t,amount:a,currency:n},...r}),leadQualified:t=>{let{externalId:a,email:n,name:r,...o}=t??{};return e({event:"lead_qualified",properties:{externalId:a,email:n,name:r},...o})},converted:({amount:t,currency:a,occurredAt:n,...r})=>e({event:"converted",properties:{amount:t,currency:a,occurredAt:n},...r})}}var JP="/api/mcp/events/v2/batch";var xI="@waniwani/sdk";var eN=new Set([401,403]),tN=new Set([408,425,429,500,502,503,504]);function vI(e){return new Vh(e)}var Vh=class{constructor(t){Y(this,"endpointUrl");Y(this,"flushIntervalMs");Y(this,"maxBatchSize");Y(this,"maxBufferSize");Y(this,"maxRetries");Y(this,"retryBaseDelayMs");Y(this,"retryMaxDelayMs");Y(this,"shutdownTimeoutMs");Y(this,"sdkVersion");Y(this,"fetchFn");Y(this,"logger");Y(this,"now");Y(this,"sleep");Y(this,"apiKey");Y(this,"buffer",[]);Y(this,"flushTimer");Y(this,"flushScheduled",!1);Y(this,"flushScheduledTimer");Y(this,"flushInFlight");Y(this,"inFlightCount",0);Y(this,"isStopped",!1);Y(this,"isShuttingDown",!1);this.endpointUrl=rN(t.apiUrl,t.endpointPath??JP),this.flushIntervalMs=t.flushIntervalMs??1e3,this.maxBatchSize=t.maxBatchSize??20,this.maxBufferSize=t.maxBufferSize??1e3,this.maxRetries=t.maxRetries??3,this.retryBaseDelayMs=t.retryBaseDelayMs??200,this.retryMaxDelayMs=t.retryMaxDelayMs??2e3,this.shutdownTimeoutMs=t.shutdownTimeoutMs??2e3,this.fetchFn=t.fetchFn??fetch,this.logger=t.logger??console,this.now=t.now??(()=>new Date),this.sleep=t.sleep??(a=>new Promise(n=>setTimeout(n,a))),this.apiKey=t.apiKey,this.sdkVersion=t.sdkVersion,this.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.flushIntervalMs)),this.registerBrowserTeardown()}enqueue(t){if(this.isStopped||this.isShuttingDown){this.logger.warn("[Waniwani] Tracking transport is stopped, dropping event %s",t.id);return}if(this.buffer.length>=this.maxBufferSize){let a=this.buffer.length-this.maxBufferSize+1;this.buffer.splice(0,a),this.logger.warn("[Waniwani] Tracking buffer overflow, dropped %d oldest event(s)",a)}if(this.buffer.push(t),this.buffer.length>=this.maxBatchSize){this.flush();return}this.scheduleMicroFlush()}pendingEvents(){return this.buffer.length+this.inFlightCount}async flush(){return this.flushInFlight?this.flushInFlight:(this.flushInFlight=this.flushLoop().finally(()=>{this.flushInFlight=void 0}),this.flushInFlight)}async shutdown(t){this.isShuttingDown=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.flushScheduledTimer&&(clearTimeout(this.flushScheduledTimer),this.flushScheduledTimer=void 0,this.flushScheduled=!1);let a=t?.timeoutMs??this.shutdownTimeoutMs,n=this.flush();if(!Number.isFinite(a)||a<=0)return await n,this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()};let r=Symbol("shutdown-timeout");return await Promise.race([n.then(()=>"flushed"),this.sleep(a).then(()=>r)])===r?(this.isStopped=!0,{timedOut:!0,pendingEvents:this.pendingEvents()}):(this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()})}registerBrowserTeardown(){if(typeof document>"u"||typeof window>"u")return;let t=()=>{document.visibilityState==="hidden"&&this.keepaliveFlush()};document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",()=>this.keepaliveFlush())}keepaliveFlush(){if(this.isStopped||this.buffer.length===0)return;let t=this.buffer.splice(0,this.buffer.length);this.sendKeepaliveChunk(t)}sendKeepaliveChunk(t){let a=JSON.stringify(this.makeBatchRequest(t));if(a.length>6e4&&t.length>1){let n=Math.ceil(t.length/2);this.sendKeepaliveChunk(t.slice(0,n)),this.sendKeepaliveChunk(t.slice(n));return}try{this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:a,keepalive:!0}).catch(()=>{})}catch{}}requestHeaders(){let t={"Content-Type":"application/json","X-WaniWani-SDK":xI};return this.apiKey&&(t.Authorization=`Bearer ${this.apiKey}`),t}scheduleMicroFlush(){this.flushScheduled||(this.flushScheduled=!0,this.flushScheduledTimer=setTimeout(()=>{this.flushScheduledTimer=void 0,this.flushScheduled=!1,this.flush()},0))}async flushLoop(){for(;this.buffer.length>0&&!this.isStopped;){let t=this.buffer.splice(0,this.maxBatchSize);await this.sendBatchWithRetry(t)}}async sendBatchWithRetry(t){let a=0,n=t;for(;n.length>0&&!this.isStopped;){this.inFlightCount=n.length;let r=await this.sendBatchOnce(n);switch(this.inFlightCount=0,r.kind){case"success":return;case"auth":this.stopTransportForAuthFailure(r.status,n.length);return;case"permanent":this.logger.error("[Waniwani] Dropping %d event(s) after permanent failure: %s",n.length,r.reason);return;case"retryable":if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d event(s) after retry exhaustion: %s",n.length,r.reason);return}await this.sleep(this.backoffDelayMs(a)),a+=1;continue;case"partial":if(r.permanent.length>0&&this.logger.error("[Waniwani] Dropping %d event(s) rejected as permanent",r.permanent.length),r.retryable.length===0)return;if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d retryable event(s) after retry exhaustion",r.retryable.length);return}n=r.retryable,await this.sleep(this.backoffDelayMs(a)),a+=1;continue}}}async sendBatchOnce(t){let a;try{a=await this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:JSON.stringify(this.makeBatchRequest(t))})}catch(o){return{kind:"retryable",reason:oN(o)}}if(eN.has(a.status))return{kind:"auth",status:a.status};if(tN.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await nN(a);if(!n?.rejected||n.rejected.length===0)return{kind:"success"};let r=this.classifyRejectedEvents(t,n.rejected);return r.retryable.length===0&&r.permanent.length===0?{kind:"success"}:{kind:"partial",retryable:r.retryable,permanent:r.permanent}}makeBatchRequest(t){return{sentAt:this.now().toISOString(),source:{sdk:xI,version:this.sdkVersion??"0.0.0"},events:t}}classifyRejectedEvents(t,a){let n=new Map(t.map(i=>[i.id,i])),r=[],o=[];for(let i of a){let l=n.get(i.eventId);if(l){if(aN(i)){r.push(l);continue}o.push(l)}}return{retryable:r,permanent:o}}backoffDelayMs(t){let a=this.retryBaseDelayMs*2**t;return Math.min(a,this.retryMaxDelayMs)}stopTransportForAuthFailure(t,a){this.isStopped=!0;let n=this.buffer.length;this.buffer.splice(0,n),this.logger.error("[Waniwani] Auth failure (HTTP %d). Stopping tracking transport and dropping %d queued event(s)",t,a+n)}};function aN(e){if(e.retryable===!0)return!0;let t=e.code.toLowerCase();return t.includes("timeout")||t.includes("temporary")||t.includes("unavailable")||t.includes("rate_limit")||t.includes("transient")||t.includes("server")}async function nN(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function rN(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function oN(e){return e instanceof Error?e.message:String(e)}function bI(e){let{apiUrl:t,endpointPath:a}=iN(e.endpoint),n=vI({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=l=>typeof l=="function"?l():l,i=async l=>{let s=e.identity?.()??{},u=o(e.channelId),c=u===void 0?l.properties:{channelId:u,...l.properties},d=yI({sessionId:s.sessionId,visitorId:s.visitorId,externalUserId:s.externalUserId??r,traceId:s.traceId,...l,properties:c,metadata:{...e.metadata,...l.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,wI(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function iN(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}var lN="waniwani-memory";var Ra="threads",nd="by_memoryUserId",sN="by_updatedAt";var II="memoryUserId",SI="waniwani-memory-user-id",Gh=null;function Wh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function uN(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Ra)){let a=e.createObjectStore(Ra,{keyPath:"threadId"});a.createIndex(nd,"memoryUserId",{unique:!1}),a.createIndex(sN,"updatedAt",{unique:!1})}}async function $h(){return new Promise((e,t)=>{let a=indexedDB.open(lN,2);a.onupgradeneeded=n=>{uN(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function cN(){return $h()}async function dN(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(II);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function fN(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,II);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function pN(){if(typeof indexedDB>"u")return null;try{let e=await cN();try{let t=await dN(e);if(t)return t;let a=Wh();return await fN(e,a),a}finally{e.close()}}catch{return null}}function mN(){try{let e=localStorage.getItem(SI);if(e)return e;let t=Wh();return localStorage.setItem(SI,t),t}catch{return null}}async function CI(){let e=await pN();if(e)return e;let t=mN();return t||(Gh||(Gh=Wh()),Gh)}var Xh="waniwani-visitor-id";function kI(e,t){return e.match(t)?.[1]??null}function hN(e){let t=[["Edge",/Edg(?:e|A|iOS)?\/(\S+)/],["Opera",/(?:OPR|Opera)\/(\S+)/],["Samsung Internet",/SamsungBrowser\/(\S+)/],["Firefox",/Firefox\/(\S+)/],["Chrome",/Chrome\/(\S+)/],["Safari",/Version\/(\S+).*Safari/]];for(let[a,n]of t){let r=kI(e,n);if(r)return{name:a,version:r}}return null}function gN(e){let t=[["iOS",/(?:iPhone|iPad|iPod).+?OS (\d+[_.\d]*)/],["Android",/Android (\d+[.\d]*)/],["macOS",/Mac OS X (\d+[_.\d]*)/],["Windows",/Windows NT (\d+[.\d]*)/],["ChromeOS",/CrOS \S+ (\d+[.\d]*)/],["Linux",/Linux/]];for(let[a,n]of t){let r=kI(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function yN(e){return typeof navigator<"u"&&"userAgentData"in navigator&&navigator.userAgentData?.mobile?"mobile":/iPad|tablet|PlayBook/i.test(e)?"tablet":/Mobi|Android.*Mobile|iPhone|iPod/i.test(e)?"mobile":"desktop"}function wN(){try{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,a=>a.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}}}catch{}return`v-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Kn(){try{let t=localStorage.getItem(Xh);if(t)return t}catch{}let e=wN();try{localStorage.setItem(Xh,e)}catch{}return e}function ps(e){let t=typeof e=="string"?e.trim():"";if(!t)return Kn();try{localStorage.setItem(Xh,t)}catch{}return t}function xN(e){return e!=null&&typeof e.then=="function"}function rd(e){let t=!1,a=()=>{t=!0};if(e==null)return a;let n;try{n=typeof e=="function"?e():e}catch{return a}return xN(n)?n.then(r=>{t||ps(r??"")},()=>{}):ps(n??""),a}async function ms(){let e=navigator.userAgent,t=Kn(),a=await CI();return{userAgent:e,browser:hN(e),os:gN(e),deviceType:yN(e),language:navigator.language,languages:[...navigator.languages],timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio??1,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,connectionType:navigator.connection?.effectiveType??"unknown",referrer:document.referrer,visitorId:t,memoryUserId:a}}var Kh=new Set;function vN(e,t,a){return`${e}|${t}|${a??""}`}function Zh(e){try{return`${new URL(e).origin}/api/mcp/events/v2/batch`}catch{return e.replace(/\/$/,"").replace(/\/chat$/,"/events/v2/batch")}}async function LI(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=vN(t,a,n);if(!Kh.has(i)){Kh.add(i);try{let l=await ms(),s=new Date().toISOString(),u=JSON.stringify({sentAt:s,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:s,correlation:{visitorId:l.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:l.referrer,deviceType:l.deviceType,language:l.language,timezone:l.timezone},metadata:{}}]});await fetch(Zh(t),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{Kh.delete(i)}}}function TI(e){return bI({endpoint:Zh(e.api),token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Kn()})})}function Qh(e){let t=!1,a=async()=>(t||(t=!0,console.warn(`[Waniwani] track() is disabled: ${e}`)),{eventId:""});return{track:Object.assign(a,{priceShown:a,pricesCompared:a,optionSelected:a,leadQualified:a,converted:a}),identify:a,flush:async()=>{},shutdown:async()=>({timedOut:!1,pendingEvents:0})}}var EI="500px",bN="https://app.waniwani.ai/api/mcp/chat",SN={api:bN};function Jh(){if(typeof document>"u")return null;if(document.currentScript instanceof HTMLScriptElement)return document.currentScript;let e=document.querySelector("script[src][data-token]");if(e instanceof HTMLScriptElement)return e;let t=document.querySelectorAll("script[src]");for(let a of t)if(a instanceof HTMLScriptElement&&/embed/i.test(a.src))return a;return null}function od(){let e=Jh();if(!e)return{};let t=k=>e.getAttribute(k)??void 0,a=k=>{let G=e.getAttribute(k);if(G==null)return;let B=G.trim().toLowerCase();if(B==="true"||B==="1"||B==="")return!0;if(B==="false"||B==="0")return!1},n={},r=t("data-api");r&&(n.api=r);let o=t("data-token");o&&(n.token=o);let i=t("data-visitor-id");i&&(n.visitorId=i);let l=t("data-title");l&&(n.title=l);let s=t("data-welcome-message");s&&(n.welcomeMessage=s);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-channel-id");if(d&&(n.channelId=d),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let k=a("data-show-tool-calls");k!==void 0&&(n.showToolCalls=k)}let p=t("data-css");p&&(n.css=p);let m=t("data-suggestions");m&&(n.suggestions=m.split(",").map(k=>k.trim()).filter(Boolean));let x=a("data-enable-thread-history");x!==void 0&&(n.enableThreadHistory=x);let I=a("data-disable-page-view");I!==void 0&&(n.disablePageView=I);let y=a("data-hide-header");y!==void 0&&(n.hideHeader=y);let w=t("data-theme");(w==="light"||w==="dark"||w==="auto")&&(n.appearance={...n.appearance,theme:w});let g=a("data-assistant-bubble");g!==void 0&&(n.appearance={...n.appearance,assistantBubble:g});let b=t("data-locale");(b==="en"||b==="fr"||b==="es")&&(n.locale=b);let T=t("data-mode");(T==="inline"||T==="floating")&&(n.mode=T);let S=t("data-height");S&&(n.height=S);let M=t("data-launcher-text");M&&(n.launcherText=M);let R=t("data-appear-delay");if(R!==void 0){let k=Number.parseInt(R.trim(),10);Number.isFinite(k)&&k>=0&&(n.appearDelay=k)}let _=t("data-disclaimer");if(_!==void 0){let k=_.trim(),G=k.toLowerCase();G==="false"||G==="0"?n.disclaimer=!1:k&&(n.disclaimer=k)}return n}function Yh(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function hs(e,t,a){let n=a??od(),r=IN(t,n,e),o={token:"",...SN,...Yh(t),...Yh(n),...Yh(e),...r?{appearance:r}:{}};if(!o.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return o}function IN(e,t,a){let n=a?.appearance?.theme??t.appearance?.theme??e?.appearance?.theme,r={...e?.appearance?.variables??{},...t.appearance?.variables??{},...a?.appearance?.variables??{}},o=Object.keys(r).length>0,i=a?.appearance?.assistantBubble??t.appearance?.assistantBubble??e?.appearance?.assistantBubble;if(!n&&!o&&i===void 0)return;let l={};return n&&(l.theme=n),o&&(l.variables=r),i!==void 0&&(l.assistantBubble=i),l}var ld=z(Le());var id=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var MI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var AI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var eg=e=>{let t=AI(e);return t.charAt(0).toUpperCase()+t.slice(1)};var gs=z(Le());var RI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var DI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var _I=(0,gs.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,gs.createElement)("svg",{ref:s,...RI,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:id("lucide",r),...!o&&!DI(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,gs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Oe=(e,t)=>{let a=(0,ld.forwardRef)(({className:n,...r},o)=>(0,ld.createElement)(_I,{ref:o,iconNode:t,className:id(`lucide-${MI(eg(e))}`,`lucide-${e}`,n),...r}));return a.displayName=eg(e),a};var CN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ys=Oe("arrow-down",CN);var kN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Io=Oe("arrow-up",kN);var LN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ws=Oe("check",LN);var TN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Br=Oe("chevron-down",TN);var EN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xs=Oe("chevron-right",EN);var MN=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],vs=Oe("clipboard-copy",MN);var AN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Zn=Oe("clock",AN);var RN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],bs=Oe("file",RN);var DN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ss=Oe("globe",DN);var _N=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Is=Oe("loader",_N);var ON=[["path",{d:"M5 12h14",key:"1ays0h"}]],Cs=Oe("minus",ON);var PN=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ks=Oe("paperclip",PN);var NN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ls=Oe("square",NN);var BN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Co=Oe("wrench",BN);var UN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qn=Oe("x",UN);var FN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ts=Oe("zap",FN);var Me=z(Le(),1);var Fi=z(Le(),1),Es=z(ne(),1);function HN(e){return 1-(1-e)**3}function jN({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=HN,onUpdate:o,onEnd:i}){let l=performance.now()+n;function s(){let u=performance.now()-l,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),n)}var VN=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],GN=[0,1,2,0,1,2,1];function WN(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(GN[a],e.length-1)];t.push(`radial-gradient(at ${VN[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var $N=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:l=!1,colors:s=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,Fi.useState)(110),[d,f]=(0,Fi.useState)(0),[p,m]=(0,Fi.useState)(!1);(0,Fi.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),jN({ease:S=>S,duration:2e3,onUpdate:S=>{let M=S/100;c(T+360*M);let R=Math.min(M/.1,1),_=M>.85?(1-M)/.15:1;f(Math.min(R,_))},onEnd:()=>m(!1)})},[l]);let x=n+20,I=p?Math.max(0,(d*100-x)/(100-x)):0,w=WN(s).map(T=>`${T} border-box`),b=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,Es.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:`${o}px`,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,Es.jsx)("div",{className:"ww:absolute ww:inset-0 ww:rounded-[inherit] ww:-z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${r} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...w].join(", "),opacity:I,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,Es.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},BI=$N;tg();ng();var XN=FI({prefix:"ww"});function j(...e){return XN(ud(e))}var Ms=z(ne(),1);function cd({suggestions:e,isLoading:t,onSelect:a,className:n,...r}){return e.length===0&&!t?null:(0,Ms.jsx)("div",{className:j("ww:px-4 ww:py-2",n),...r,children:(0,Ms.jsx)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",children:t?[0,1,2].map(o=>(0,Ms.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+o*20}px`}},o)):e.map((o,i)=>(0,Ms.jsx)("button",{type:"button",onClick:()=>a(o),className:j("ww:rounded-full ww:border ww:border-border ww:bg-background ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})})}var zi=z(Le(),1),KN=80,ZN=50,QN=15e3,zI=500;function dd(e,t=!0){let[a,n]=(0,zi.useState)(""),r=(0,zi.useRef)(void 0);return(0,zi.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,l=!1,s=()=>{l||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(s,zI)):r.current=setTimeout(s,ZN)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,QN)):r.current=setTimeout(s,KN)))};return r.current=setTimeout(s,zI),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var rn=z(Le(),1);var qI=["en","fr","es"];function qi(e){return qI.includes(e)}function rg(e){if(e&&qi(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&qi(a))return a}let t=[];if(typeof navigator<"u"&&(navigator.language&&t.push(navigator.language),navigator.languages&&t.push(...navigator.languages)),typeof document<"u"){let a=document.documentElement.getAttribute("lang");a&&t.push(a)}for(let a of t){let n=a.toLowerCase();if(qi(n))return n;let r=n.split("-")[0];if(r&&qi(r))return r}return"en"}var fd={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments"},workingIndicator:{default:"On it\u2026"},reasoning:{thinking:"Thinking\u2026",thoughtBrief:"Thought for a few seconds",thoughtForSeconds:e=>`Thought for ${e} second${e===1?"":"s"}`},chainOfThought:{working:"Working on it\u2026",done:"Thought process"},tool:{copy:"Copy",copied:"Copied",request:"Request",response:"Response",error:"Error"},attachments:{attachmentFallback:"attachment",fileFallback:"file"},threadMenu:{newChat:"New chat",threadHistory:"Thread history",deleteThread:"Delete thread",noPreviousChats:"No previous chats yet.",hiddenThreads:e=>`${e} older thread${e===1?"":"s"} hidden`},chatQueue:{attachmentFallback:"(attachment)",removeFromQueue:"Remove from queue",queued:e=>`${e} queued`},poweredBy:{label:"AI agent powered by"},aiDisclaimer:{default:"can make mistakes"},exportSession:{saving:"saving...",saved:"saved",error:"error",export:"export",tooltip:"Save scenario to Waniwani"},widgetErrorBoundary:{failedToLoad:"Widget failed to load",retry:"Retry"},launcher:{prompt:"Ask anything\u2026",open:"Open chat",close:"Close chat",minimize:"Minimize"}};var HI={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos"},workingIndicator:{default:"Un momento\u2026"},reasoning:{thinking:"Pensando\u2026",thoughtBrief:"Pensado durante unos segundos",thoughtForSeconds:e=>`Pensado durante ${e} segundo${e===1?"":"s"}`},chainOfThought:{working:"Estoy en ello\u2026",done:"Razonamiento"},tool:{copy:"Copiar",copied:"Copiado",request:"Solicitud",response:"Respuesta",error:"Error"},attachments:{attachmentFallback:"adjunto",fileFallback:"archivo"},threadMenu:{newChat:"Nueva conversaci\xF3n",threadHistory:"Historial",deleteThread:"Eliminar conversaci\xF3n",noPreviousChats:"A\xFAn no hay conversaciones anteriores.",hiddenThreads:e=>`${e} conversaci\xF3n${e===1?"":"es"} anterior${e===1?"":"es"} oculta${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(adjunto)",removeFromQueue:"Quitar de la cola",queued:e=>`${e} en cola`},poweredBy:{label:"Agente IA con tecnolog\xEDa de"},aiDisclaimer:{default:"puede cometer errores"},exportSession:{saving:"guardando...",saved:"guardado",error:"error",export:"exportar",tooltip:"Guardar escenario en Waniwani"},widgetErrorBoundary:{failedToLoad:"No se pudo cargar el widget",retry:"Reintentar"},launcher:{prompt:"Pregunta lo que quieras\u2026",open:"Abrir chat",close:"Cerrar chat",minimize:"Minimizar"}};var jI={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes"},workingIndicator:{default:"Un instant\u2026"},reasoning:{thinking:"R\xE9flexion\u2026",thoughtBrief:"R\xE9flexion pendant quelques secondes",thoughtForSeconds:e=>`R\xE9flexion pendant ${e} seconde${e===1?"":"s"}`},chainOfThought:{working:"Je m'en occupe\u2026",done:"Raisonnement"},tool:{copy:"Copier",copied:"Copi\xE9",request:"Requ\xEAte",response:"R\xE9ponse",error:"Erreur"},attachments:{attachmentFallback:"pi\xE8ce jointe",fileFallback:"fichier"},threadMenu:{newChat:"Nouvelle conversation",threadHistory:"Historique",deleteThread:"Supprimer la conversation",noPreviousChats:"Aucune conversation pr\xE9c\xE9dente.",hiddenThreads:e=>`${e} conversation${e===1?"":"s"} plus ancienne${e===1?"":"s"} masqu\xE9e${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(pi\xE8ce jointe)",removeFromQueue:"Retirer de la file",queued:e=>`${e} en attente`},poweredBy:{label:"Agent IA propuls\xE9 par"},aiDisclaimer:{default:"peut faire des erreurs"},exportSession:{saving:"enregistrement...",saved:"enregistr\xE9",error:"erreur",export:"exporter",tooltip:"Enregistrer le sc\xE9nario dans Waniwani"},widgetErrorBoundary:{failedToLoad:"\xC9chec du chargement du widget",retry:"R\xE9essayer"},launcher:{prompt:"Posez votre question\u2026",open:"Ouvrir le chat",close:"Fermer le chat",minimize:"R\xE9duire"}};var og={en:fd,fr:jI,es:HI};var GI=z(ne(),1),VI=(0,rn.createContext)(null);function YN(e,t){if(!t)return e;let a={...e};for(let n of Object.keys(e)){let r=e[n],o=t[n];o&&typeof r=="object"&&(a[n]={...r,...o})}return a}function As({children:e,locale:t,messages:a}){let n=!!(t&&JN(t)),r=n?t:"en",[o,i]=(0,rn.useState)(r),[l,s]=(0,rn.useState)(n);(0,rn.useEffect)(()=>{i(rg(t)),s(!0)},[t]);let u=(0,rn.useMemo)(()=>{let c=og[o]??og["en"];return{locale:o,t:YN(c,a),ready:l}},[o,a,l]);return(0,GI.jsx)(VI.Provider,{value:u,children:e})}function JN(e){return e==="en"||e==="fr"||e==="es"}function Re(){let e=(0,rn.useContext)(VI);return e||{locale:"en",t:fd,ready:!0}}function ig(e,t){let a=Date.now()-e;if(a<6e4)try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"narrow"}).format(0,"second")}catch{return"just now"}let n,r;a<60*6e4?(n=-Math.floor(a/6e4),r="minute"):a<1440*6e4?(n=-Math.floor(a/(60*6e4)),r="hour"):(n=-Math.floor(a/(1440*6e4)),r="day");try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"short"}).format(n,r)}catch{return`${Math.abs(n)}${r==="minute"?"m":r==="hour"?"h":"d"} ago`}}var Ge=z(Le(),1);var Rs=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,a)=>(a&=63,a<36?t+=a.toString(36):a<62?t+=(a-26).toString(36).toUpperCase():a>62?t+="-":t+="_",t),"");var at=z(Le(),1);var WI=z(ne(),1),bn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,WI.jsx)("button",{type:n,className:j("ww:inline-flex ww:cursor-pointer ww:items-center ww:justify-center ww:rounded-md ww:font-medium ww:transition-colors ww:disabled:pointer-events-none ww:disabled:opacity-50",t==="default"&&"ww:bg-primary ww:text-primary-foreground ww:hover:bg-primary/90",t==="outline"&&"ww:border ww:border-border ww:bg-background ww:hover:bg-accent ww:hover:text-accent-foreground",t==="ghost"&&"ww:hover:bg-accent ww:hover:text-accent-foreground",a==="default"&&"ww:h-9 ww:px-4 ww:py-2 ww:text-sm",a==="sm"&&"ww:h-8 ww:px-3 ww:text-xs",a==="icon"&&"ww:size-9 ww:!rounded-full",a==="icon-sm"&&"ww:size-7 ww:!rounded-full",e),...r});var na=z(ne(),1),eB=async e=>{try{let a=await(await fetch(e)).blob();return new Promise(n=>{let r=new FileReader;r.onloadend=()=>n(r.result),r.onerror=()=>n(null),r.readAsDataURL(a)})}catch{return null}},$I=(0,at.createContext)(null),XI=()=>{let e=(0,at.useContext)($I);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},KI=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,onSubmit:i,children:l,...s})=>{let{t:u}=Re(),c=(0,at.useRef)(null),d=(0,at.useRef)(null),[f,p]=(0,at.useState)([]),m=(0,at.useRef)(f);(0,at.useEffect)(()=>{m.current=f},[f]);let x=(0,at.useCallback)(()=>{c.current?.click()},[]),I=(0,at.useCallback)(S=>{let M=[...S];if(M.length===0)return;let R=k=>o?k.size<=o:!0,_=M.filter(R);p(k=>{let G=typeof r=="number"?Math.max(0,r-k.length):void 0,B=typeof G=="number"?_.slice(0,G):_;return[...k,...B.map(U=>({filename:U.name,id:Rs(),mediaType:U.type,type:"file",url:URL.createObjectURL(U)}))]})},[r,o]),y=(0,at.useCallback)(S=>{p(M=>{let R=M.find(_=>_.id===S);return R?.url&&URL.revokeObjectURL(R.url),M.filter(_=>_.id!==S)})},[]),w=(0,at.useCallback)(()=>{p(S=>{for(let M of S)M.url&&URL.revokeObjectURL(M.url);return[]})},[]);(0,at.useEffect)(()=>()=>{for(let S of m.current)S.url&&URL.revokeObjectURL(S.url)},[]);let g=(0,at.useCallback)(S=>{S.currentTarget.files&&I(S.currentTarget.files),S.currentTarget.value=""},[I]);(0,at.useEffect)(()=>{if(!n)return;let S=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault()},M=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault(),R.dataTransfer?.files&&R.dataTransfer.files.length>0&&I(R.dataTransfer.files)};return document.addEventListener("dragover",S),document.addEventListener("drop",M),()=>{document.removeEventListener("dragover",S),document.removeEventListener("drop",M)}},[I,n]);let b=(0,at.useCallback)(async S=>{S.preventDefault();let M=S.currentTarget,_=new FormData(M).get("message")||"";M.reset();let k=await Promise.all(f.map(async({id:G,...B})=>{if(B.url?.startsWith("blob:")){let U=await eB(B.url);return{...B,url:U??B.url}}return B}));try{let G=i({files:k,text:_},S);G instanceof Promise&&await G,w()}catch{}},[f,i,w]),T=(0,at.useMemo)(()=>({add:I,clear:w,files:f,openFileDialog:x,remove:y}),[f,I,y,w,x]);return(0,na.jsxs)($I.Provider,{value:T,children:[(0,na.jsx)("input",{accept:t,"aria-label":u.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:g,ref:c,title:u.promptInput.uploadFiles,type:"file"}),(0,na.jsx)("form",{className:j("ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:b,ref:d,...s,children:l})]})};var ZI=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Re(),i=XI(),[l,s]=(0,at.useState)(!1),u=n??o.promptInput.placeholder,c=(0,at.useCallback)(f=>{if(t?.(f),!f.defaultPrevented){if(f.key==="Enter"){if(l||f.nativeEvent.isComposing||f.shiftKey)return;f.preventDefault();let{form:p}=f.currentTarget;if(p?.querySelector('button[type="submit"]')?.disabled)return;p?.requestSubmit()}if(f.key==="Backspace"&&f.currentTarget.value===""&&i.files.length>0){f.preventDefault();let p=i.files.at(-1);p&&i.remove(p.id)}}},[t,l,i]),d=(0,at.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let I=x.getAsFile();I&&m.push(I)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,na.jsx)("textarea",{className:j("ww:field-sizing-content ww:max-h-48 ww:min-h-0 ww:w-full ww:resize-none ww:border-0 ww:bg-transparent ww:px-3 ww:py-2 ww:text-base ww:sm:text-sm ww:outline-none ww:placeholder:text-muted-foreground",a),name:"message",onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},QI=({className:e,status:t,onStop:a,onClick:n,children:r,...o})=>{let{t:i}=Re(),l=t==="submitted"||t==="streaming",s=(0,na.jsx)(Io,{className:"ww:size-4"});t==="submitted"?s=(0,na.jsx)(Is,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(s=(0,na.jsx)(Ls,{className:"ww:size-4"}));let u=(0,at.useCallback)(c=>{if(l&&a){c.preventDefault(),a();return}n?.(c)},[l,a,n]);return(0,na.jsx)(bn,{"aria-label":l?i.promptInput.stop:i.promptInput.submit,className:j("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),onClick:u,size:"icon-sm",type:l&&a?"button":"submit",variant:"ghost",...o,children:r??s})},YI=({className:e,children:t,...a})=>{let{t:n}=Re(),r=XI();return r.files.length>0?(0,na.jsxs)(bn,{className:j("ww:group ww:relative",e),onClick:()=>r.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,na.jsx)("span",{className:"ww:flex ww:size-5 ww:items-center ww:justify-center ww:rounded-full ww:bg-primary ww:text-[10px] ww:font-medium ww:text-primary-foreground ww:transition-opacity ww:group-hover:opacity-0",children:r.files.length}),(0,na.jsx)(Qn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]}):(0,na.jsx)(bn,{className:j(e),onClick:()=>r.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,na.jsx)(ks,{className:"ww:size-4"})})};var eC=z(ne(),1);function JI({text:e}){let{t}=Re();return e===!1?null:(0,eC.jsx)("span",{className:"ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70",children:e||t.aiDisclaimer.default})}var pd=z(Le(),1);var ko=z(ne(),1),tC=({className:e,...t})=>(0,ko.jsx)("div",{className:j("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),aC=({className:e,...t})=>(0,ko.jsx)("li",{className:j("ww:group ww:flex ww:items-center ww:gap-2 ww:rounded-md ww:px-2 ww:py-1 ww:text-sm ww:transition-colors ww:hover:bg-muted",e),...t}),nC=({className:e,...t})=>(0,ko.jsx)("span",{className:j("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),rC=({className:e,...t})=>(0,ko.jsx)("span",{className:j("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),oC=({className:e,...t})=>(0,ko.jsx)("div",{className:j("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),iC=({className:e,...t})=>(0,ko.jsx)(bn,{className:j("ww:size-auto ww:rounded ww:p-1 ww:text-muted-foreground ww:hover:bg-muted-foreground/10 ww:hover:text-foreground",e),size:"icon",type:"button",variant:"ghost",...t});var Xa=z(ne(),1),lC=(0,pd.memo)(({message:e,onRemove:t})=>{let{t:a}=Re(),n=(0,pd.useCallback)(()=>t(e.id),[t,e.id]);return(0,Xa.jsxs)(aC,{children:[(0,Xa.jsx)(nC,{}),(0,Xa.jsx)(rC,{children:e.text||a.chatQueue.attachmentFallback}),(0,Xa.jsx)(oC,{children:(0,Xa.jsx)(iC,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,Xa.jsx)(Qn,{className:"ww:size-3"})})})]})});lC.displayName="ChatQueueItem";function sC({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Re();return e.length===0?null:(0,Xa.jsxs)(tC,{className:j("ww:border-t ww:border-border",a),children:[(0,Xa.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,Xa.jsx)("ul",{children:e.map(r=>(0,Xa.jsx)(lC,{message:r,onRemove:t},r.id))})]})}var Ur=z(ne(),1),uC=({files:e,className:t,...a})=>e.length===0?null:(0,Ur.jsx)("div",{className:j("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,Ur.jsx)(tB,{file:n},r))});function tB({file:e}){let{t}=Re();return e.mediaType?.startsWith("image/")&&e.url?(0,Ur.jsx)("img",{src:e.url,alt:e.filename??t.attachments.attachmentFallback,className:"ww:h-16 ww:max-w-32 ww:rounded ww:object-cover"}):(0,Ur.jsxs)("span",{className:"ww:inline-flex ww:items-center ww:gap-1.5 ww:rounded ww:bg-background/20 ww:px-2 ww:py-1 ww:text-xs",children:[(0,Ur.jsx)(bs,{className:"ww:size-3 ww:shrink-0"}),(0,Ur.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}var wa=z(Le(),1);var ht=z(Le(),1);wf();var qA=z(Le(),1);var HA=z(ne(),1),b5=({as:e="span",className:t,duration:a=2,style:n,children:r,...o})=>{let i={backgroundImage:"linear-gradient(90deg, var(--ww-color-muted-foreground) 0%, var(--ww-color-muted-foreground) 40%, var(--ww-color-foreground) 50%, var(--ww-color-muted-foreground) 60%, var(--ww-color-muted-foreground) 100%)",backgroundSize:"250% 100%",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",animation:`ww-shimmer ${a}s linear infinite`,...n};return(0,HA.jsx)(e,{"data-waniwani-shimmer":"",className:j("ww:inline-block",t),style:i,...o,children:r})},un=(0,qA.memo)(b5);un.displayName="Shimmer";var Jt=z(ne(),1),jA=(0,ht.createContext)(null);function VA(){let e=(0,ht.useContext)(jA);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var S5=1e3,I5=1e3,ou=(0,ht.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...l})=>{let s=n??t,u=n===!1,c=a!==void 0,[d,f]=(0,ht.useState)(s),p=c?a:d,m=(0,ht.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,I]=(0,ht.useState)(void 0),y=o??x,w=(0,ht.useRef)(t),[g,b]=(0,ht.useState)(!1),T=(0,ht.useRef)(null);(0,ht.useEffect)(()=>{t?(w.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(I(Math.ceil((Date.now()-T.current)/I5)),T.current=null)},[t]),(0,ht.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,ht.useEffect)(()=>{if(w.current&&!t&&p&&!g){let M=setTimeout(()=>{m(!1),b(!0)},S5);return()=>clearTimeout(M)}},[t,p,g,m]);let S=(0,ht.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:y}),[t,p,m,y]);return(0,Jt.jsx)(jA.Provider,{value:S,children:(0,Jt.jsx)("div",{className:j("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":p?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})});ou.displayName="Reasoning";var iu=(0,ht.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Re(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=VA(),f=a??((p,m)=>p||m===0?(0,Jt.jsx)(un,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,Jt.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,Jt.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,Jt.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:j("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),...o,children:t??(0,Jt.jsxs)(Jt.Fragment,{children:[!n&&(0,Jt.jsx)(Zn,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});iu.displayName="ReasoningTrigger";var lu=(0,ht.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=VA();return(0,Jt.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Jt.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Jt.jsx)("div",{className:j("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Jt.jsx)(el,{children:t})})})})});lu.displayName="ReasoningContent";var Ce=z(ne(),1),C5=500,GA=(0,wa.createContext)(null);function WA(){let e=(0,wa.useContext)(GA);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function $A({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...l}){let s=n!==void 0,[u,c]=(0,wa.useState)(r),d=s?n:u,f=(0,wa.useCallback)(I=>{s||c(I),o?.(I)},[s,o]),[p,m]=(0,wa.useState)(!t);(0,wa.useEffect)(()=>{if(t){m(!1);return}let I=setTimeout(()=>m(!0),C5);return()=>clearTimeout(I)},[t]);let x=(0,wa.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ce.jsx)(GA.Provider,{value:x,children:(0,Ce.jsx)("div",{className:j("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":d?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})}function XA({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=WA();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ce.jsx)("div",{className:j("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground",e),children:(0,Ce.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:items-center ww:gap-1.5",style:{animation:"ww-fade-in 0.25s ease-out"},children:[c&&(0,Ce.jsx)(c,{className:j("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ce.jsx)("span",{className:"ww:truncate",children:l?(0,Ce.jsx)(un,{duration:2.6,children:d}):d})]},d)})}return(0,Ce.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:j("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),style:{animation:"ww-fade-in 0.25s ease-out"},...r,children:[(0,Ce.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ce.jsx)(Br,{className:j("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function KA({className:e,children:t,...a}){let{open:n}=WA();return(0,Ce.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:j("ww:flex ww:flex-col",e),...a,children:t})})})}function ZA({icon:e,isLast:t,running:a,error:n}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ce.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ce.jsx)(e,{className:j("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ce.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Ow({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let l=n==="input-available"||n==="input-streaming",s=n==="output-error",u=o!=null,[c,d]=(0,wa.useState)(!1),f=a??"",p=l?(0,Ce.jsx)(un,{duration:1.6,children:f}):(0,Ce.jsx)("span",{className:"ww:truncate",children:f});return(0,Ce.jsxs)("div",{className:j("ww:flex ww:gap-2",e),...i,children:[(0,Ce.jsx)(ZA,{icon:t,isLast:r,running:l,error:s}),(0,Ce.jsxs)("div",{className:j("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ce.jsxs)("button",{type:"button",onClick:()=>d(m=>!m),"aria-expanded":c,className:"ww:flex ww:w-full ww:items-center ww:gap-1.5 ww:text-left ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",children:[p,(0,Ce.jsx)(Br,{className:j("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ce.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Ce.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",c?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Ce.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ce.jsx)("div",{className:"ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",children:o})})})]})]})}function QA({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ce.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ce.jsx)(ZA,{icon:Zn,isLast:t,running:e}),(0,Ce.jsx)("div",{className:j("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ce.jsxs)(ou,{isStreaming:e,className:"ww:mb-0",children:[(0,Ce.jsx)(iu,{hideIcon:!0}),(0,Ce.jsx)(lu,{children:a})]})})]})}var Pw={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var YA={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var tR=z(Le(),1);var or=z(Le(),1),k5=5,JA=400;function eR(e,t,a={}){let{msPerChar:n=k5}=a,[r,o]=(0,or.useState)(t?"":e),i=(0,or.useRef)(e),l=(0,or.useRef)(t?0:e.length),s=(0,or.useRef)(0),u=(0,or.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,or.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),l.current=e.length,o(e);return}if(i.current.length-l.current>JA&&(l.current=i.current.length-JA),u.current!==null)return;let d=f=>{let p=i.current;if(l.current>=p.length){u.current=null;return}s.current===0&&(s.current=f);let m=f-s.current;if(m>=n){let x=Math.min(Math.floor(m/n),p.length-l.current);l.current+=x,o(p.slice(0,l.current)),s.current=f}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var su=z(ne(),1),Nw=({className:e,from:t,children:a,...n})=>(0,su.jsx)("div",{className:j("ww-message ww:group ww:flex ww:w-full",t==="user"?"ww-message-user is-user ww:ml-auto ww:flex-col ww:items-end ww:[max-width:var(--ww-msg-max-width,80%)]":"ww-message-assistant is-assistant ww:flex-col",e),...n,children:(0,su.jsx)("div",{className:j("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Bw=({children:e,className:t,...a})=>(0,su.jsx)("div",{className:j("ww-bubble ww:flex ww:w-fit ww:min-w-0 ww:max-w-full ww:flex-col ww:gap-2 ww:overflow-hidden","ww:[font-size:var(--ww-font-size,1rem)] ww:[line-height:var(--ww-line-height,1.5)]","ww:group-[.is-user]:ml-auto ww:group-[.is-user]:bg-user-bubble ww:group-[.is-user]:[color:var(--ww-color-user-bubble-text)] ww:group-[.is-user]:[border-radius:var(--ww-msg-radius,8px)] ww:group-[.is-user]:[padding:var(--ww-msg-pad-y,12px)_var(--ww-msg-pad-x,16px)]","ww:group-[.is-assistant]:text-foreground",t),...a,children:e}),L5={cjk:Pw,code:YA},T5={cjk:Pw},E5={enabled:!1};function M5({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=eR(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,su.jsx)(el,{className:j("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??E5,plugins:a?T5:L5,...r,children:l})}var If=(0,tR.memo)(M5,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);If.displayName="MessageResponse";var Bt=z(Le(),1);var ge=z(ne(),1);function A5(e,t=80){if(e==null)return String(e);if(typeof e!="object")return String(e).slice(0,t);if(Array.isArray(e))return`Array(${e.length})`;let a=JSON.stringify(e);if(a.length<=t)return a;let n=Object.entries(e),r=[],o=t-2;for(let[i,l]of n){if(o<=8)break;let s=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof l=="string"?u=l.length>2?`'${l.slice(0,1)}\u2026`:`'${l}'`:Array.isArray(l)?u=`Array(${l.length})`:typeof l=="object"&&l!==null?u="{\u2026}":u=String(l);let c=`${s}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function R5({text:e,className:t}){let{t:a}=Re(),[n,r]=(0,Bt.useState)(!1),o=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Bt.useCallback)(async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,ge.jsx)(bn,{variant:"ghost",size:"sm",onClick:i,className:j("ww:h-auto ww:gap-1 ww:px-1.5 ww:py-0.5 ww:text-xs ww:text-muted-foreground ww:hover:text-foreground",t),children:n?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(ws,{className:"ww:size-3.5"}),(0,ge.jsx)("span",{children:a.tool.copied})]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(vs,{className:"ww:size-3.5"}),(0,ge.jsx)("span",{children:a.tool.copy})]})})}function rR({data:e,label:t,className:a,...n}){let[r,o]=(0,Bt.useState)(!1),i=(0,Bt.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=A5(e);return(0,ge.jsxs)("div",{className:j("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,ge.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,ge.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,ge.jsx)(R5,{text:i})]}),(0,ge.jsxs)("button",{type:"button",onClick:()=>o(s=>!s),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,ge.jsx)(xs,{className:j("ww:mt-0.5 ww:size-3.5 ww:shrink-0 ww:text-muted-foreground ww:transition-transform ww:duration-150",r&&"ww:rotate-90")}),r?(0,ge.jsx)("pre",{className:"ww:overflow-x-auto ww:text-xs ww:font-mono ww:text-foreground ww:whitespace-pre-wrap ww:break-all",children:(0,ge.jsx)("code",{children:i})}):(0,ge.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Fw=(0,Bt.createContext)({open:!1,toggle:()=>{}});function oR({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Bt.useState)(t);return(0,ge.jsx)(Fw.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,ge.jsx)("div",{className:j("ww:mb-4 ww:w-full",e),"data-state":r?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:a})})}function iR({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Bt.useContext)(Fw),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,ge.jsxs)("button",{type:"button",onClick:o,className:j("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),"aria-expanded":r,...n,children:[(0,ge.jsx)(Co,{className:"ww:size-4 ww:shrink-0"}),(0,ge.jsx)("span",{className:"ww:truncate",children:i?(0,ge.jsx)(un,{duration:1.6,children:l}):l}),(0,ge.jsx)(Br,{className:j("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function lR({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,ge.jsx)("div",{className:j("ww:mb-4 ww:flex ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:(0,ge.jsx)("span",{className:"ww:truncate",children:r?(0,ge.jsx)(un,{duration:1.6,children:o}):o})})}function sR({className:e,children:t,...a}){let{open:n}=(0,Bt.useContext)(Fw);return(0,ge.jsx)("div",{className:j("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ge.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ge.jsx)("div",{className:j("ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",e),...a,children:t})})})}function zw({className:e,input:t,debug:a,...n}){let{t:r}=Re(),o=(0,Bt.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,ge.jsx)(rR,{data:o,label:r.tool.request,className:e,...n})}function Uw(e){if(!(typeof e!="object"||e===null))return e}function uR(e){return Uw(e?.ui)}function cR(e){return Uw(Uw(e)?._meta)}function aR(e){if(!e)return;let t=uR(e)?.resourceUri;if(typeof t=="string"&&t.length>0)return t;let a=e["ui/resourceUri"];if(typeof a=="string"&&a.length>0)return a;let n=e["openai/outputTemplate"];if(typeof n=="string"&&n.length>0)return n}function nR(e){return uR(e)?.autoHeight===!0}function uu(e,t,a){if(e){let n=aR(a?.[e]?._meta);if(n)return n}return aR(cR(t))}function dR(e,t,a){return e&&nR(a?.[e]?._meta)?!0:nR(cR(t))}function qw({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Re(),i=(0,Bt.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:l,...s}=t;return s}return t},[t,n]);return t||a?a?(0,ge.jsxs)("div",{className:j("ww:space-y-2",e),...r,children:[(0,ge.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,ge.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,ge.jsx)(rR,{data:i,label:o.tool.response,className:e,...r}):null}var cu=z(ne(),1);function fR(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function pR(e){return e.parts.some(fR)}function mR(e,t,a){if(t!=="submitted"&&t!=="streaming")return!1;let n=e[e.length-1];return!n||n.role!=="assistant"?!0:!n.parts.some(o=>!(!fR(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function hR({className:e,...t}){let{t:a}=Re();return(0,cu.jsxs)("div",{"aria-live":"polite",className:j("ww:mb-4 ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...t,children:[(0,cu.jsx)(Ts,{className:"ww:size-4 ww:shrink-0"}),(0,cu.jsx)(un,{duration:1.6,children:a.workingIndicator.default})]})}var Je=z(Le(),1);function tl(e){if(!e)return!1;let t=Array.isArray(e.content)&&e.content.length>0,a=typeof e.structuredContent=="object"&&e.structuredContent!==null&&Object.keys(e.structuredContent).length>0;return t||a}function gR(e,t){return!tl(e)&&!tl(t)?null:tl(e)?tl(t)?{...e.content||t.content?{content:[...e.content??[],...t.content??[]]}:{},...e.structuredContent||t.structuredContent?{structuredContent:{...e.structuredContent??{},...t.structuredContent??{}}}:{}}:{...e.content?{content:[...e.content]}:{},...e.structuredContent?{structuredContent:{...e.structuredContent}}:{}}:{...t?.content?{content:[...t.content]}:{},...t?.structuredContent?{structuredContent:{...t.structuredContent}}:{}}}var wR=z(ne(),1),D5="/api/mcp/resource",_5=500,O5=0,P5=16,N5="2026-01-26",B5=300,U5=3e3,F5=3;function z5(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function q5(e,t,a){return uu(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function yR({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=D5,chatSessionId:r,isDark:o=!1,className:i,autoHeight:l=!1,onOpenLink:s,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:f=!1,toolDefinitions:p}){let m=(0,Je.useRef)(null),x=(0,Je.useRef)(t),I=(0,Je.useRef)(a),y=(0,Je.useRef)({width:0,height:0}),w=(0,Je.useRef)(null),g=(0,Je.useRef)(!1),b=(0,Je.useRef)(0),T=(0,Je.useRef)("inline"),[S,M]=(0,Je.useState)(O5),[R,_]=(0,Je.useState)(void 0),k=(0,Je.useRef)(s),G=(0,Je.useRef)(u),B=(0,Je.useRef)(c),U=(0,Je.useRef)(d),W=(0,Je.useRef)(r),A=(0,Je.useRef)(p);x.current=t,I.current=a,k.current=s,G.current=u,B.current=c,U.current=d,W.current=r,A.current=p;let H=(0,Je.useCallback)(v=>l?Math.max(v+P5,0):Math.min(Math.max(v,50),_5),[l]),$=(0,Je.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),We=(0,Je.useRef)(o);We.current=o;let $e=(0,Je.useRef)(f);return(0,Je.useEffect)(()=>{$e.current=f,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[f]),(0,Je.useEffect)(()=>{if(!g.current)return;let v=m.current;v?.contentWindow&&v.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,Je.useEffect)(()=>{let v=m.current;if(!v)return;let De=!1,_e=!1,L=null,ke=null,St=setTimeout(()=>{if(De||_e||b.current>=F5)return;b.current+=1;let ve=new URL(v.src);ve.searchParams.set("_retry",String(b.current)),v.src=ve.toString()},U5),et=ve=>{v.contentWindow?.postMessage(ve,"*")},Ut=ve=>{if(De||ve.source!==v.contentWindow)return;let X=ve.data;if(!X||typeof X!="object"||X.jsonrpc!=="2.0")return;let pe=X.method,ue=X.id;if(pe==="ui/initialize"&&ue!=null){_e=!0,clearTimeout(St),et({jsonrpc:"2.0",id:ue,result:{protocolVersion:X.params?.protocolVersion??N5,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:We.current?"dark":"light",displayMode:T.current}}});return}if(pe==="ui/notifications/initialized"){g.current=!0;let oe=x.current,ye=I.current,Xe=ye._meta&&typeof ye._meta=="object"?ye._meta:null,dt=z5(W.current),nt=Xe&&typeof Xe.waniwani=="object"&&Xe.waniwani!==null?Xe.waniwani:null,Mt=nt||dt?{...nt??{},...dt?{sessionId:dt}:{}}:void 0,K=Xe||Mt?{...Xe??{},...Mt?{waniwani:Mt}:{}}:void 0;et({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:oe}});let ce=ye.content??[{type:"text",text:JSON.stringify(ye)}];et({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:ce,structuredContent:ye.structuredContent,_meta:K,meta:K}});return}if(pe==="ui/notifications/size-changed"){let oe=X.params,ye=typeof oe?.height=="number"?oe.height:void 0,Xe=typeof oe?.width=="number"?oe.width:void 0,dt=y.current,nt=ye!==void 0&&ye!==dt.height,Mt=Xe!==void 0&&Xe!==dt.width;if(!nt&&!Mt)return;if(nt&&ye!==void 0){if(dt.height=ye,$e.current)return;let K=H(ye),ce=v.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),M(K),v.animate&&Math.abs(ce-K)>2){let Ke=v.animate([{height:`${ce}px`},{height:`${K}px`}],{duration:B5,easing:"ease-out",fill:"forwards"});w.current=Ke,Ke.onfinish=()=>{w.current===Ke&&(Ke.cancel(),w.current=null)}}}Mt&&l&&Xe!==void 0&&(dt.width=Xe,_(Xe));return}if(pe==="ui/open-link"&&ue!=null){let oe=X.params?.url;typeof oe=="string"&&(k.current?k.current(oe):window.open(oe,"_blank","noopener,noreferrer")),et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="ui/message"&&ue!=null){if(G.current&&X.params){let oe=X.params,ye=L;if(L=null,ke){clearTimeout(ke.timer);let Xe=ke.text;ke=null;let dt=(oe.content??[]).map(nt=>nt.text??"").join("").trim();oe={...oe,content:[{type:"text",text:`${dt}
|
|
118
|
+
`)},Rw=e=>{let t=!1;for(let n of e)if(n==="\\"||n==="|"){t=!0;break}if(!t)return e;let a=[];for(let n of e)n==="\\"?a.push("\\\\"):n==="|"?a.push("\\|"):a.push(n);return a.join("")},f5=e=>{let{headers:t,rows:a}=e;if(t.length===0)return"";let n=new Array(a.length+2),r=0,o=t.map(l=>Rw(l));n[r]=`| ${o.join(" | ")} |`,r+=1;let i=new Array(t.length);for(let l=0;l<t.length;l+=1)i[l]="---";n[r]=`| ${i.join(" | ")} |`,r+=1;for(let l of a)if(l.length<t.length){let s=new Array(t.length);for(let u=0;u<t.length;u+=1)s[u]=u<l.length?Rw(l[u]):"";n[r]=`| ${s.join(" | ")} |`,r+=1}else{let s=l.map(u=>Rw(u));n[r]=`| ${s.join(" | ")} |`,r+=1}return n.join(`
|
|
119
|
+
`)},p5=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,D.useState)(!1),[l,s]=(0,D.useState)(!1),u=(0,D.useRef)(null),c=(0,D.useRef)(0),{isAnimating:d}=(0,D.useContext)(ia),f=async m=>{var x,I;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let y=(I=u.current)==null?void 0:I.closest('[data-streamdown="table-wrapper"]'),w=y?.querySelector("table");if(!w){n?.(new Error("Table not found"));return}let g=SA(w),b=m==="csv"?IA(g):d5(g),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(y){n?.(y)}};(0,D.useEffect)(()=>{let m=x=>{let I=x.composedPath();u.current&&!I.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?Nw:Bw;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>i(!o),title:"Copy table",type:"button",children:e??(0,E.jsx)(p,{size:14})}),o?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},m5=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,D.useState)(!1),i=(0,D.useRef)(null),{isAnimating:l}=(0,D.useContext)(ia),s=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){n?.(new Error("Table not found"));return}let p=SA(f),m=u==="csv"?IA(p):f5(p);tl(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,D.useEffect)(()=>{let u=c=>{let d=c.composedPath();i.current&&!d.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]),(0,E.jsxs)("div",{className:"relative",ref:i,children:[(0,E.jsx)("button",{className:re("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,E.jsx)(kf,{size:14})}),r?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},h5=({children:e,className:t,showControls:a,...n})=>(0,E.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,E.jsx)(p5,{}),(0,E.jsx)(m5,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:re("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),g5=(0,D.lazy)(()=>Promise.resolve().then(()=>(sA(),lA)).then(e=>({default:e.CodeBlock}))),y5=(0,D.lazy)(()=>Promise.resolve().then(()=>(dA(),cA)).then(e=>({default:e.Mermaid}))),w5=/language-([^\s]+)/;Pw=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,If=(e,t)=>{if(typeof e=="boolean")return e;let a=e.mermaid;return a===!1?!1:a===!0||a===void 0?!0:a[t]!==!1},Fw=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:re("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>vt(e,t));Fw.displayName="MarkdownOl";CA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:re("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Lf(e.node,t.node));CA.displayName="MarkdownLi";kA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:re("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>vt(e,t));kA.displayName="MarkdownUl";LA=(0,D.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:re("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>vt(e,t));LA.displayName="MarkdownHr";TA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:re("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>vt(e,t));TA.displayName="MarkdownStrong";x5=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,D.useContext)(ia),[i,l]=(0,D.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,D.useCallback)(async p=>{if(!(!(o!=null&&o.enabled&&a)||s)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}l(!0)}},[o,a,s]),c=(0,D.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,D.useCallback)(()=>{l(!1)},[]),f={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:re("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,E.jsx)(o5,{...f})]}):(0,E.jsx)("a",{className:re("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},EA=(0,D.memo)(x5,(e,t)=>vt(e,t)&&e.href===t.href);EA.displayName="MarkdownA";MA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:re("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>vt(e,t));MA.displayName="MarkdownH1";AA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:re("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>vt(e,t));AA.displayName="MarkdownH2";RA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:re("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>vt(e,t));RA.displayName="MarkdownH3";DA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:re("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>vt(e,t));DA.displayName="MarkdownH4";_A=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:re("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>vt(e,t));_A.displayName="MarkdownH5";OA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:re("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>vt(e,t));OA.displayName="MarkdownH6";PA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,D.useContext)(ia),o=Pw(r,"table");return(0,E.jsx)(h5,{className:t,showControls:o,...n,children:e})},(e,t)=>vt(e,t));PA.displayName="MarkdownTable";NA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:re("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>vt(e,t));NA.displayName="MarkdownThead";BA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:re("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>vt(e,t));BA.displayName="MarkdownTbody";UA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:re("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>vt(e,t));UA.displayName="MarkdownTr";FA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("th",{className:re("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>vt(e,t));FA.displayName="MarkdownTh";zA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:re("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>vt(e,t));zA.displayName="MarkdownTd";qA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("blockquote",{className:re("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>vt(e,t));qA.displayName="MarkdownBlockquote";HA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:re("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>vt(e,t));HA.displayName="MarkdownSup";jA=(0,D.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:re("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>vt(e,t));jA.displayName="MarkdownSub";VA=(0,D.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,D.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if((0,D.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of p){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if((0,D.isValidElement)(m)&&((s=m.props)==null?void 0:s["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,D.isValidElement)(i))return i;if(i.type===Fw){let l=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(s=>!r(s));return l.length===0?null:{...i,props:{...i.props,children:l}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,E.jsx)("section",{className:t,...n,children:o}):null}return(0,E.jsx)("section",{className:t,...n,children:e})},(e,t)=>vt(e,t));VA.displayName="MarkdownSection";v5=({node:e,className:t,children:a,...n})=>{var r,o,i;let l=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:s,controls:u}=(0,D.useContext)(ia),c=Uw();if(l)return(0,E.jsx)("code",{className:re("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:a});let d=t?.match(w5),f=(i=d?.at(1))!=null?i:"",p="";if((0,D.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?p=a.props.children:typeof a=="string"&&(p=a),f==="mermaid"&&c){let x=Pw(u,"mermaid"),I=If(u,"download"),y=If(u,"copy"),w=If(u,"fullscreen"),g=If(u,"panZoom"),b=x&&(I||y||w);return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(hA,{}),children:(0,E.jsxs)("div",{className:re("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[b?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[I?(0,E.jsx)(l5,{chart:p,config:s?.config}):null,y?(0,E.jsx)(pA,{code:p}):null,w?(0,E.jsx)(c5,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(y5,{chart:p,config:s?.config,showControls:g})]})})}let m=Pw(u,"code");return(0,E.jsx)(D.Suspense,{fallback:(0,E.jsx)(hA,{}),children:(0,E.jsx)(g5,{className:re("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(e5,{code:p,language:f}),(0,E.jsx)(pA,{})]}):null})})},GA=(0,D.memo)(v5,(e,t)=>e.className===t.className&&Lf(e.node,t.node));GA.displayName="MarkdownCode";WA=(0,D.memo)(a5,(e,t)=>e.className===t.className&&Lf(e.node,t.node));WA.displayName="MarkdownImg";$A=(0,D.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(i.length===1&&(0,D.isValidElement)(i[0])){let l=i[0].props.node,s=l?.tagName;if(s==="img")return(0,E.jsx)(E.Fragment,{children:e});if(s==="code"&&((r=l?.position)==null?void 0:r.start.line)!==((o=l?.position)==null?void 0:o.end.line))return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)("p",{className:t,...n,children:e})},(e,t)=>vt(e,t));$A.displayName="MarkdownParagraph";b5={ol:Fw,li:CA,ul:kA,hr:LA,strong:TA,a:EA,h1:MA,h2:AA,h3:RA,h4:DA,h5:_A,h6:OA,table:PA,thead:NA,tbody:BA,tr:UA,th:FA,td:zA,blockquote:qA,code:GA,img:WA,pre:({children:e})=>e,sup:HA,sub:jA,p:$A,section:VA},gA=[],yA={allowDangerousHtml:!0},Cf=new WeakMap,S5=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let a=e.rehypePlugins,n=e.remarkPlugins,r=e.remarkRehypeOptions;if(!(a||n||r)){let c="default";return this.keyCache.set(e,c),c}let o=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let p=c[f];if(f>0&&(d+=","),Array.isArray(p)){let[m,x]=p;if(typeof m=="function"){let I=Cf.get(m);I||(I=m.name,Cf.set(m,I)),d+=I}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=Cf.get(p);m||(m=p.name,Cf.set(p,m)),d+=m}else d+=String(p)}return d},i=o(a),l=o(n),s=r?JSON.stringify(r):"",u=`${l}::${i}::${s}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),a=this.cache.get(t);return a&&(this.cache.delete(t),this.cache.set(t,a)),a}set(e,t){let a=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(a,t)}clear(){this.cache.clear()}},wA=new S5,XA=e=>{let t=I5(e),a=e.children||"";return k5(t.runSync(t.parse(a),a),e)},I5=e=>{let t=wA.get(e);if(t)return t;let a=C5(e);return wA.set(e,a),a},C5=e=>{let t=e.rehypePlugins||gA,a=e.remarkPlugins||gA,n=e.remarkRehypeOptions?{...yA,...e.remarkRehypeOptions}:yA;return gw().use(lf).use(a).use(df,n).use(t)},k5=(e,t)=>Ky(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),L5=/\[\^[^\]\s]{1,200}\](?!:)/,T5=/\[\^[^\]\s]{1,200}\]:/,E5=/<\/(\w+)>/,M5=/<(\w+)[\s>]/,Dw=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
120
|
+
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},A5=e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
121
|
+
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},_w=e=>{let t=0;for(let a=0;a<e.length-1;a+=1)e[a]==="$"&&e[a+1]==="$"&&(t+=1,a+=1);return t},KA=e=>{let t=L5.test(e),a=T5.test(e);if(t||a)return[e];let n=Oa.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let l=i.raw,s=r.length;if(o.length>0){if(r[s-1]+=l,i.type==="html"){let u=l.match(E5);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(M5);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=Dw(u),d=_w(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&A5(l)){let u=r[s-1],c=Dw(u),d=_w(u),f=_w(l);if(c&&d%2===1&&!Dw(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},ZA={raw:MC,sanitize:[Ld,{}],harden:[TC,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},YA={gfm:[Yd,{}]},R5=Object.values(ZA),D5=Object.values(YA),_5={block:" \u258B",circle:" \u25CF"},O5={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ia=(0,D.createContext)(O5),zw=(0,D.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(XA,{...n,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let a=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(a.length!==n.length||a.some(r=>{var o,i;return((o=e.components)==null?void 0:o[r])!==((i=t.components)==null?void 0:i[r])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});zw.displayName="Block";P5=["github-light","github-dark"],al=(0,D.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=R5,remarkPlugins:o=D5,className:i,shikiTheme:l=P5,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=zw,parseMarkdownIntoBlocksFn:f=KA,caret:p,plugins:m,remend:x,linkSafety:I={enabled:!0},...y})=>{let w=(0,D.useId)(),[g,b]=(0,D.useTransition)(),T=(0,D.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?qL(e,x):e,[e,t,a,x]),S=(0,D.useMemo)(()=>f(T),[T,f]),[M,R]=(0,D.useState)(S);(0,D.useEffect)(()=>{t==="streaming"?b(()=>{R(S)}):R(S)},[S,t]);let _=t==="streaming"?M:S,L=(0,D.useMemo)(()=>_.map((j,$)=>`${w}-${$}`),[_.length,w]),z=(0,D.useMemo)(()=>{var j,$;return{shikiTheme:($=(j=m?.code)==null?void 0:j.getThemes())!=null?$:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:I}},[l,u,c,t,s,I,m?.code]),U=(0,D.useMemo)(()=>({...b5,...n}),[n]),B=(0,D.useMemo)(()=>{let j=[];return m!=null&&m.cjk&&(j=[...j,...m.cjk.remarkPluginsBefore]),j=[...j,...o],m!=null&&m.cjk&&(j=[...j,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(j=[...j,m.math.remarkPlugin]),j},[o,m?.math,m?.cjk]),W=(0,D.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),A=(0,D.useMemo)(()=>p&&c?{"--streamdown-caret":`"${_5[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Ow.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:z,children:(0,E.jsx)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(XA,{components:U,rehypePlugins:W,remarkPlugins:B,...y,children:e})})})}):(0,E.jsx)(Ow.Provider,{value:m??null,children:(0,E.jsx)(ia.Provider,{value:z,children:(0,E.jsxs)("div",{className:re("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:A,children:[_.length===0&&p&&c&&(0,E.jsx)("span",{}),_.map((j,$)=>(0,E.jsx)(d,{components:U,content:j,index:$,rehypePlugins:W,remarkPlugins:B,shouldParseIncompleteMarkdown:a,...y},L[$]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);al.displayName="Streamdown";N5=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:l=!1})=>{let s=(0,D.useRef)(null),u=(0,D.useRef)(null),[c,d]=(0,D.useState)(i),[f,p]=(0,D.useState)({x:0,y:0}),[m,x]=(0,D.useState)(!1),[I,y]=(0,D.useState)({x:0,y:0}),[w,g]=(0,D.useState)({x:0,y:0}),b=(0,D.useCallback)(U=>{d(B=>Math.max(a,Math.min(n,B+U)))},[a,n]),T=(0,D.useCallback)(()=>{b(r)},[b,r]),S=(0,D.useCallback)(()=>{b(-r)},[b,r]),M=(0,D.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),R=(0,D.useCallback)(U=>{U.preventDefault();let B=U.deltaY>0?-r:r;b(B)},[b,r]),_=(0,D.useCallback)(U=>{if(U.button!==0||U.isPrimary===!1)return;x(!0),y({x:U.clientX,y:U.clientY}),g(f);let B=U.currentTarget;B instanceof HTMLElement&&B.setPointerCapture(U.pointerId)},[f]),L=(0,D.useCallback)(U=>{if(!m)return;U.preventDefault();let B=U.clientX-I.x,W=U.clientY-I.y;p({x:w.x+B,y:w.y+W})},[m,I,w]),z=(0,D.useCallback)(U=>{x(!1);let B=U.currentTarget;B instanceof HTMLElement&&B.releasePointerCapture(U.pointerId)},[]);return(0,D.useEffect)(()=>{let U=s.current;if(U)return U.addEventListener("wheel",R,{passive:!1}),()=>{U.removeEventListener("wheel",R)}},[R]),(0,D.useEffect)(()=>{let U=u.current;if(U&&m)return document.body.style.userSelect="none",U.addEventListener("pointermove",L,{passive:!1}),U.addEventListener("pointerup",z),U.addEventListener("pointercancel",z),()=>{document.body.style.userSelect="",U.removeEventListener("pointermove",L),U.removeEventListener("pointerup",z),U.removeEventListener("pointercancel",z)}},[m,L,z]),(0,E.jsxs)("div",{className:re("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:s,style:{cursor:m?"grabbing":"grab"},children:[o?(0,E.jsxs)("div",{className:re("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c>=n,onClick:T,title:"Zoom in",type:"button",children:(0,E.jsx)(Qq,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c<=a,onClick:S,title:"Zoom out",type:"button",children:(0,E.jsx)(Jq,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:(0,E.jsx)(Yq,{size:16})})]}):null,(0,E.jsx)("div",{className:re("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:_,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},Aw=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,D.useState)(null),[l,s]=(0,D.useState)(!1),[u,c]=(0,D.useState)(""),[d,f]=(0,D.useState)(""),[p,m]=(0,D.useState)(0),{mermaid:x}=(0,D.useContext)(ia),I=Uw(),y=x?.errorComponent,{shouldRender:w,containerRef:g}=Xq({immediate:n});if((0,D.useEffect)(()=>{if(w){if(!I){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=I.getMermaid(a),S=e.split("").reduce((_,L)=>(_<<5)-_+L.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await T.render(M,e);c(R),f(R)}catch(T){if(!(d||u)){let S=T instanceof Error?T.message:"Failed to render Mermaid chart";i(S)}}finally{s(!1)}})()}},[e,a,p,w,I]),!(w||u||d))return(0,E.jsx)("div",{className:re("my-4 min-h-[200px]",t),ref:g});if(l&&!u&&!d)return(0,E.jsx)("div",{className:re("my-4 flex justify-center p-4",t),ref:g,children:(0,E.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,E.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,E.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,E.jsx)("div",{ref:g,children:(0,E.jsx)(y,{chart:e,error:o,retry:()=>m(S=>S+1)})}):(0,E.jsxs)("div",{className:re("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,E.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,E.jsxs)("details",{className:"mt-2",children:[(0,E.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,E.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let b=u||d;return(0,E.jsx)("div",{className:re("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,E.jsx)(N5,{className:re(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,E.jsx)("div",{"aria-label":"Mermaid chart",className:re("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var SD=Kt((doe,bD)=>{"use strict";function wj(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,n=0;return function(...o){clearTimeout(a);let i=Date.now(),l=i-n,s=t-l;s<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},s)}}bD.exports=wj});var Cu=q(Ie(),1),Ix=q(gI(),1);var Xh="waniwani/suggestions";function Fi(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var ZP=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],YP=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],QP=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],JP=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],eN=["waniwani/visitorId","visitorId"],tN=["correlationId","openai/requestId"];function yI(e){return e?Fi(e,ZP):void 0}function wI(e){return e?Fi(e,YP):void 0}function xI(e){return e?Fi(e,QP):void 0}function vI(e){return e?Fi(e,JP):void 0}function bI(e){return e?Fi(e,eN):void 0}function SI(e){return e?Fi(e,tN):void 0}var aN=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],nN=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function II(e,t){if(e){let n=e["waniwani/source"];if(typeof n=="string"&&n.length>0)return n;for(let{key:r,source:o}of aN){let i=e[r];if(typeof i=="string"&&i.length>0)return o}}let a=t?.name;if(typeof a=="string"&&a.length>0){let n=a.toLowerCase();for(let{needle:r,source:o}of nN)if(n.includes(r))return o}}var rN="@waniwani/sdk";function CI(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??oN,r=sN(e),o=od(e.meta),i=od(e.metadata),l=uN(e,o),s=nn(e.eventId)??n(),u=cN(e.timestamp,a),c=nn(e.source)??II(o)??t.source??rN,d=Kh(e)?{...e}:void 0,f={...i};return Object.keys(o).length>0&&(f.meta=o),d&&(f.rawLegacy=d),{id:s,type:"mcp.event",name:r,source:c,timestamp:u,correlation:l,properties:iN(e,r),metadata:f,rawLegacy:d}}function oN(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function iN(e,t){if(!Kh(e))return od(e.properties);let a=lN(e,t),n=od(e.properties);return{...a,...n}}function lN(e,t){switch(t){case"tool.called":{let a={};return nn(e.toolName)&&(a.name=e.toolName),nn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return nn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function sN(e){return Kh(e)?e.eventType:e.event}function uN(e,t){let a=nn(e.requestId)??wI(t),n=nn(e.sessionId)??yI(t),r=nn(e.traceId)??xI(t),o=nn(e.externalUserId)??vI(t),i=nn(e.visitorId)??bI(t),l=nn(e.correlationId)??SI(t)??a,s={};return n&&(s.sessionId=n),r&&(s.traceId=r),a&&(s.requestId=a),l&&(s.correlationId=l),o&&(s.externalUserId=o),i&&(s.visitorId=i),s}function cN(e,t){if(e instanceof Date)return e.toISOString();if(typeof e=="string"){let a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return t().toISOString()}function od(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function nn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Kh(e){return"eventType"in e}function kI(e){return{priceShown:({amount:t,currency:a,itemId:n,label:r,...o})=>e({event:"price_shown",properties:{amount:t,currency:a,itemId:n,label:r},...o}),pricesCompared:({options:t,...a})=>e({event:"prices_compared",properties:{options:t},...a}),optionSelected:({id:t,amount:a,currency:n,...r})=>e({event:"option_selected",properties:{id:t,amount:a,currency:n},...r}),leadQualified:t=>{let{externalId:a,email:n,name:r,...o}=t??{};return e({event:"lead_qualified",properties:{externalId:a,email:n,name:r},...o})},converted:({amount:t,currency:a,occurredAt:n,...r})=>e({event:"converted",properties:{amount:t,currency:a,occurredAt:n},...r})}}var dN="/api/mcp/events/v2/batch";var LI="@waniwani/sdk";var fN=new Set([401,403]),pN=new Set([408,425,429,500,502,503,504]);function TI(e){return new Zh(e)}var Zh=class{constructor(t){Q(this,"endpointUrl");Q(this,"flushIntervalMs");Q(this,"maxBatchSize");Q(this,"maxBufferSize");Q(this,"maxRetries");Q(this,"retryBaseDelayMs");Q(this,"retryMaxDelayMs");Q(this,"shutdownTimeoutMs");Q(this,"sdkVersion");Q(this,"fetchFn");Q(this,"logger");Q(this,"now");Q(this,"sleep");Q(this,"apiKey");Q(this,"buffer",[]);Q(this,"flushTimer");Q(this,"flushScheduled",!1);Q(this,"flushScheduledTimer");Q(this,"flushInFlight");Q(this,"inFlightCount",0);Q(this,"isStopped",!1);Q(this,"isShuttingDown",!1);this.endpointUrl=gN(t.apiUrl,t.endpointPath??dN),this.flushIntervalMs=t.flushIntervalMs??1e3,this.maxBatchSize=t.maxBatchSize??20,this.maxBufferSize=t.maxBufferSize??1e3,this.maxRetries=t.maxRetries??3,this.retryBaseDelayMs=t.retryBaseDelayMs??200,this.retryMaxDelayMs=t.retryMaxDelayMs??2e3,this.shutdownTimeoutMs=t.shutdownTimeoutMs??2e3,this.fetchFn=t.fetchFn??fetch,this.logger=t.logger??console,this.now=t.now??(()=>new Date),this.sleep=t.sleep??(a=>new Promise(n=>setTimeout(n,a))),this.apiKey=t.apiKey,this.sdkVersion=t.sdkVersion,this.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.flushIntervalMs)),this.registerBrowserTeardown()}enqueue(t){if(this.isStopped||this.isShuttingDown){this.logger.warn("[Waniwani] Tracking transport is stopped, dropping event %s",t.id);return}if(this.buffer.length>=this.maxBufferSize){let a=this.buffer.length-this.maxBufferSize+1;this.buffer.splice(0,a),this.logger.warn("[Waniwani] Tracking buffer overflow, dropped %d oldest event(s)",a)}if(this.buffer.push(t),this.buffer.length>=this.maxBatchSize){this.flush();return}this.scheduleMicroFlush()}pendingEvents(){return this.buffer.length+this.inFlightCount}async flush(){return this.flushInFlight?this.flushInFlight:(this.flushInFlight=this.flushLoop().finally(()=>{this.flushInFlight=void 0}),this.flushInFlight)}async shutdown(t){this.isShuttingDown=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.flushScheduledTimer&&(clearTimeout(this.flushScheduledTimer),this.flushScheduledTimer=void 0,this.flushScheduled=!1);let a=t?.timeoutMs??this.shutdownTimeoutMs,n=this.flush();if(!Number.isFinite(a)||a<=0)return await n,this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()};let r=Symbol("shutdown-timeout");return await Promise.race([n.then(()=>"flushed"),this.sleep(a).then(()=>r)])===r?(this.isStopped=!0,{timedOut:!0,pendingEvents:this.pendingEvents()}):(this.isStopped=!0,{timedOut:!1,pendingEvents:this.pendingEvents()})}registerBrowserTeardown(){if(typeof document>"u"||typeof window>"u")return;let t=()=>{document.visibilityState==="hidden"&&this.keepaliveFlush()};document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",()=>this.keepaliveFlush())}keepaliveFlush(){if(this.isStopped||this.buffer.length===0)return;let t=this.buffer.splice(0,this.buffer.length);this.sendKeepaliveChunk(t)}sendKeepaliveChunk(t){let a=JSON.stringify(this.makeBatchRequest(t));if(a.length>6e4&&t.length>1){let n=Math.ceil(t.length/2);this.sendKeepaliveChunk(t.slice(0,n)),this.sendKeepaliveChunk(t.slice(n));return}try{this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:a,keepalive:!0}).catch(()=>{})}catch{}}requestHeaders(){let t={"Content-Type":"application/json","X-WaniWani-SDK":LI};return this.apiKey&&(t.Authorization=`Bearer ${this.apiKey}`),t}scheduleMicroFlush(){this.flushScheduled||(this.flushScheduled=!0,this.flushScheduledTimer=setTimeout(()=>{this.flushScheduledTimer=void 0,this.flushScheduled=!1,this.flush()},0))}async flushLoop(){for(;this.buffer.length>0&&!this.isStopped;){let t=this.buffer.splice(0,this.maxBatchSize);await this.sendBatchWithRetry(t)}}async sendBatchWithRetry(t){let a=0,n=t;for(;n.length>0&&!this.isStopped;){this.inFlightCount=n.length;let r=await this.sendBatchOnce(n);switch(this.inFlightCount=0,r.kind){case"success":return;case"auth":this.stopTransportForAuthFailure(r.status,n.length);return;case"permanent":this.logger.error("[Waniwani] Dropping %d event(s) after permanent failure: %s",n.length,r.reason);return;case"retryable":if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d event(s) after retry exhaustion: %s",n.length,r.reason);return}await this.sleep(this.backoffDelayMs(a)),a+=1;continue;case"partial":if(r.permanent.length>0&&this.logger.error("[Waniwani] Dropping %d event(s) rejected as permanent",r.permanent.length),r.retryable.length===0)return;if(a>=this.maxRetries){this.logger.error("[Waniwani] Dropping %d retryable event(s) after retry exhaustion",r.retryable.length);return}n=r.retryable,await this.sleep(this.backoffDelayMs(a)),a+=1;continue}}}async sendBatchOnce(t){let a;try{a=await this.fetchFn(this.endpointUrl,{method:"POST",headers:this.requestHeaders(),body:JSON.stringify(this.makeBatchRequest(t))})}catch(o){return{kind:"retryable",reason:yN(o)}}if(fN.has(a.status))return{kind:"auth",status:a.status};if(pN.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await hN(a);if(!n?.rejected||n.rejected.length===0)return{kind:"success"};let r=this.classifyRejectedEvents(t,n.rejected);return r.retryable.length===0&&r.permanent.length===0?{kind:"success"}:{kind:"partial",retryable:r.retryable,permanent:r.permanent}}makeBatchRequest(t){return{sentAt:this.now().toISOString(),source:{sdk:LI,version:this.sdkVersion??"0.0.0"},events:t}}classifyRejectedEvents(t,a){let n=new Map(t.map(i=>[i.id,i])),r=[],o=[];for(let i of a){let l=n.get(i.eventId);if(l){if(mN(i)){r.push(l);continue}o.push(l)}}return{retryable:r,permanent:o}}backoffDelayMs(t){let a=this.retryBaseDelayMs*2**t;return Math.min(a,this.retryMaxDelayMs)}stopTransportForAuthFailure(t,a){this.isStopped=!0;let n=this.buffer.length;this.buffer.splice(0,n),this.logger.error("[Waniwani] Auth failure (HTTP %d). Stopping tracking transport and dropping %d queued event(s)",t,a+n)}};function mN(e){if(e.retryable===!0)return!0;let t=e.code.toLowerCase();return t.includes("timeout")||t.includes("temporary")||t.includes("unavailable")||t.includes("rate_limit")||t.includes("transient")||t.includes("server")}async function hN(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function gN(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function yN(e){return e instanceof Error?e.message:String(e)}function EI(e){let{apiUrl:t,endpointPath:a}=wN(e.endpoint),n=TI({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=l=>typeof l=="function"?l():l,i=async l=>{let s=e.identity?.()??{},u=o(e.channelId),c=u===void 0?l.properties:{channelId:u,...l.properties},d=CI({sessionId:s.sessionId,visitorId:s.visitorId,externalUserId:s.externalUserId??r,traceId:s.traceId,...l,properties:c,metadata:{...e.metadata,...l.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,kI(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function wN(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}var xN="waniwani-memory";var Da="threads",id="by_memoryUserId",vN="by_updatedAt";var AI="memoryUserId",MI="waniwani-memory-user-id",Yh=null;function Qh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function bN(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Da)){let a=e.createObjectStore(Da,{keyPath:"threadId"});a.createIndex(id,"memoryUserId",{unique:!1}),a.createIndex(vN,"updatedAt",{unique:!1})}}async function Jh(){return new Promise((e,t)=>{let a=indexedDB.open(xN,2);a.onupgradeneeded=n=>{bN(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function SN(){return Jh()}async function IN(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(AI);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function CN(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,AI);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function kN(){if(typeof indexedDB>"u")return null;try{let e=await SN();try{let t=await IN(e);if(t)return t;let a=Qh();return await CN(e,a),a}finally{e.close()}}catch{return null}}function LN(){try{let e=localStorage.getItem(MI);if(e)return e;let t=Qh();return localStorage.setItem(MI,t),t}catch{return null}}async function RI(){let e=await kN();if(e)return e;let t=LN();return t||(Yh||(Yh=Qh()),Yh)}var eg="waniwani-visitor-id";function DI(e,t){return e.match(t)?.[1]??null}function TN(e){let t=[["Edge",/Edg(?:e|A|iOS)?\/(\S+)/],["Opera",/(?:OPR|Opera)\/(\S+)/],["Samsung Internet",/SamsungBrowser\/(\S+)/],["Firefox",/Firefox\/(\S+)/],["Chrome",/Chrome\/(\S+)/],["Safari",/Version\/(\S+).*Safari/]];for(let[a,n]of t){let r=DI(e,n);if(r)return{name:a,version:r}}return null}function EN(e){let t=[["iOS",/(?:iPhone|iPad|iPod).+?OS (\d+[_.\d]*)/],["Android",/Android (\d+[.\d]*)/],["macOS",/Mac OS X (\d+[_.\d]*)/],["Windows",/Windows NT (\d+[.\d]*)/],["ChromeOS",/CrOS \S+ (\d+[.\d]*)/],["Linux",/Linux/]];for(let[a,n]of t){let r=DI(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function MN(e){return typeof navigator<"u"&&"userAgentData"in navigator&&navigator.userAgentData?.mobile?"mobile":/iPad|tablet|PlayBook/i.test(e)?"tablet":/Mobi|Android.*Mobile|iPhone|iPod/i.test(e)?"mobile":"desktop"}function AN(){try{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,a=>a.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}}}catch{}return`v-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Kn(){try{let t=localStorage.getItem(eg);if(t)return t}catch{}let e=AN();try{localStorage.setItem(eg,e)}catch{}return e}function ms(e){let t=typeof e=="string"?e.trim():"";if(!t)return Kn();try{localStorage.setItem(eg,t)}catch{}return t}function RN(e){return e!=null&&typeof e.then=="function"}function ld(e){let t=!1,a=()=>{t=!0};if(e==null)return a;let n;try{n=typeof e=="function"?e():e}catch{return a}return RN(n)?n.then(r=>{t||ms(r??"")},()=>{}):ms(n??""),a}async function hs(){let e=navigator.userAgent,t=Kn(),a=await RI();return{userAgent:e,browser:TN(e),os:EN(e),deviceType:MN(e),language:navigator.language,languages:[...navigator.languages],timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio??1,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,connectionType:navigator.connection?.effectiveType??"unknown",referrer:document.referrer,visitorId:t,memoryUserId:a}}var tg=new Set;function DN(e,t,a){return`${e}|${t}|${a??""}`}function ag(e){try{return`${new URL(e).origin}/api/mcp/events/v2/batch`}catch{return e.replace(/\/$/,"").replace(/\/chat$/,"/events/v2/batch")}}async function _I(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=DN(t,a,n);if(!tg.has(i)){tg.add(i);try{let l=await hs(),s=new Date().toISOString(),u=JSON.stringify({sentAt:s,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:s,correlation:{visitorId:l.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:l.referrer,deviceType:l.deviceType,language:l.language,timezone:l.timezone},metadata:{}}]});await fetch(ag(t),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{tg.delete(i)}}}function OI(e){return EI({endpoint:ag(e.api),token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Kn()})})}function ng(e){let t=!1,a=async()=>(t||(t=!0,console.warn(`[Waniwani] track() is disabled: ${e}`)),{eventId:""});return{track:Object.assign(a,{priceShown:a,pricesCompared:a,optionSelected:a,leadQualified:a,converted:a}),identify:a,flush:async()=>{},shutdown:async()=>({timedOut:!1,pendingEvents:0})}}var gs=["channel","page","flow","followup"];var PI="500px",_N="https://app.waniwani.ai/api/mcp/chat",ON={api:_N};function og(){if(typeof document>"u")return null;if(document.currentScript instanceof HTMLScriptElement)return document.currentScript;let e=document.querySelector("script[src][data-token]");if(e instanceof HTMLScriptElement)return e;let t=document.querySelectorAll("script[src]");for(let a of t)if(a instanceof HTMLScriptElement&&/embed/i.test(a.src))return a;return null}function sd(){let e=og();if(!e)return{};let t=z=>e.getAttribute(z)??void 0,a=z=>{let U=e.getAttribute(z);if(U==null)return;let B=U.trim().toLowerCase();if(B==="true"||B==="1"||B==="")return!0;if(B==="false"||B==="0")return!1},n={},r=t("data-api");r&&(n.api=r);let o=t("data-token");o&&(n.token=o);let i=t("data-visitor-id");i&&(n.visitorId=i);let l=t("data-title");l&&(n.title=l);let s=t("data-welcome-message");s&&(n.welcomeMessage=s);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-channel-id");if(d&&(n.channelId=d),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let z=a("data-show-tool-calls");z!==void 0&&(n.showToolCalls=z)}let p=t("data-css");p&&(n.css=p);let m=t("data-suggestions");m&&(n.suggestions=m.split(",").map(z=>z.trim()).filter(Boolean));let x=a("data-enable-thread-history");x!==void 0&&(n.enableThreadHistory=x);let I=e.getAttribute("data-suggestion-origins");I!==null&&(n.suggestionOrigins=I.split(",").map(z=>z.trim()).filter(z=>gs.includes(z)));let y=a("data-disable-page-view");y!==void 0&&(n.disablePageView=y);let w=a("data-hide-header");w!==void 0&&(n.hideHeader=w);let g=t("data-theme");(g==="light"||g==="dark"||g==="auto")&&(n.appearance={...n.appearance,theme:g});let b=a("data-assistant-bubble");b!==void 0&&(n.appearance={...n.appearance,assistantBubble:b});let T=t("data-locale");(T==="en"||T==="fr"||T==="es")&&(n.locale=T);let S=t("data-mode");(S==="inline"||S==="floating")&&(n.mode=S);let M=t("data-height");M&&(n.height=M);let R=t("data-launcher-text");R&&(n.launcherText=R);let _=t("data-appear-delay");if(_!==void 0){let z=Number.parseInt(_.trim(),10);Number.isFinite(z)&&z>=0&&(n.appearDelay=z)}let L=t("data-disclaimer");if(L!==void 0){let z=L.trim(),U=z.toLowerCase();U==="false"||U==="0"?n.disclaimer=!1:z&&(n.disclaimer=z)}return n}function rg(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function ys(e,t,a){let n=a??sd(),r=PN(t,n,e),o={token:"",...ON,...rg(t),...rg(n),...rg(e),...r?{appearance:r}:{}};if(!o.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return o}function PN(e,t,a){let n=a?.appearance?.theme??t.appearance?.theme??e?.appearance?.theme,r={...e?.appearance?.variables??{},...t.appearance?.variables??{},...a?.appearance?.variables??{}},o=Object.keys(r).length>0,i=a?.appearance?.assistantBubble??t.appearance?.assistantBubble??e?.appearance?.assistantBubble;if(!n&&!o&&i===void 0)return;let l={};return n&&(l.theme=n),o&&(l.variables=r),i!==void 0&&(l.assistantBubble=i),l}var cd=q(Ie());var ud=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var NI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var BI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var ig=e=>{let t=BI(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ws=q(Ie());var UI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var FI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var zI=(0,ws.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,ws.createElement)("svg",{ref:s,...UI,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:ud("lucide",r),...!o&&!FI(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,ws.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Oe=(e,t)=>{let a=(0,cd.forwardRef)(({className:n,...r},o)=>(0,cd.createElement)(zI,{ref:o,iconNode:t,className:ud(`lucide-${NI(ig(e))}`,`lucide-${e}`,n),...r}));return a.displayName=ig(e),a};var NN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],xs=Oe("arrow-down",NN);var BN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Co=Oe("arrow-up",BN);var UN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vs=Oe("check",UN);var FN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Br=Oe("chevron-down",FN);var zN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bs=Oe("chevron-right",zN);var qN=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Ss=Oe("clipboard-copy",qN);var HN=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Zn=Oe("clock",HN);var jN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Is=Oe("file",jN);var VN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Cs=Oe("globe",VN);var GN=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],ks=Oe("loader",GN);var WN=[["path",{d:"M5 12h14",key:"1ays0h"}]],Ls=Oe("minus",WN);var $N=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Ts=Oe("paperclip",$N);var XN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Es=Oe("square",XN);var KN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ko=Oe("wrench",KN);var ZN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yn=Oe("x",ZN);var YN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ms=Oe("zap",YN);var Me=q(Ie(),1);var zi=q(Ie(),1),As=q(ne(),1);function eB(e){return 1-(1-e)**3}function tB({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=eB,onUpdate:o,onEnd:i}){let l=performance.now()+n;function s(){let u=performance.now()-l,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),n)}var aB=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],nB=[0,1,2,0,1,2,1];function rB(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(nB[a],e.length-1)];t.push(`radial-gradient(at ${aB[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var oB=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:l=!1,colors:s=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,zi.useState)(110),[d,f]=(0,zi.useState)(0),[p,m]=(0,zi.useState)(!1);(0,zi.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),tB({ease:S=>S,duration:2e3,onUpdate:S=>{let M=S/100;c(T+360*M);let R=Math.min(M/.1,1),_=M>.85?(1-M)/.15:1;f(Math.min(R,_))},onEnd:()=>m(!1)})},[l]);let x=n+20,I=p?Math.max(0,(d*100-x)/(100-x)):0,w=rB(s).map(T=>`${T} border-box`),b=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,As.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:`${o}px`,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,As.jsx)("div",{className:"ww:absolute ww:inset-0 ww:rounded-[inherit] ww:-z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${r} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...w].join(", "),opacity:I,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,As.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},VI=oB;lg();ug();var iB=WI({prefix:"ww"});function V(...e){return iB(fd(e))}var Rs=q(ne(),1);function pd({suggestions:e,isLoading:t,onSelect:a,className:n,...r}){return e.length===0&&!t?null:(0,Rs.jsx)("div",{className:V("ww:px-4 ww:py-2",n),...r,children:(0,Rs.jsx)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",children:t?[0,1,2].map(o=>(0,Rs.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+o*20}px`}},o)):e.map((o,i)=>(0,Rs.jsx)("button",{type:"button",onClick:()=>a(o),className:V("ww:rounded-full ww:border ww:border-border ww:bg-background ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})})}var rn=q(Ie(),1);function qi(e){return typeof e=="object"&&e!==null}function $I(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function lB(e){if(!qi(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!qi(t)||!qi(t._meta))return null;let a=t._meta[Xh];return!qi(a)||!$I(a.suggestions)?null:a.suggestions}function sB(e){let t=null;for(let a of e.parts){let n=lB(a);n!==null&&(t=n.length>0?n:null)}return t}function uB(e){for(let t of e.parts){if(!qi(t)||t.type!=="data-suggestions")continue;let a=t.data;if(qi(a)&&$I(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function XI(e,t={}){let{includeFlow:a=!0}=t,n=a?sB(e):null;if(n)return{suggestions:n,source:"flow"};let r=uB(e);return r?{suggestions:r,source:"followup"}:null}function KI(e){return typeof e=="object"&&e!==null}var cg=["channel","page","followup"];function cB(e){if(e===!1)return[];if(e===!0)return[...gs];if(KI(e)){if(e.origins!==void 0)return e.origins;if(e.dynamic===!0)return[...gs];if(e.dynamic===!1)return[]}return[...cg]}function md(e){let{suggestions:t,suggestionOrigins:a}=e;if(!(!t&&a===void 0))return{initial:t,origins:a}}function ZI(e){let{messages:t,status:a,config:n}=e,r=KI(n)&&n.initial?n.initial:void 0,[o,i]=(0,rn.useState)(r??[]),[l,s]=(0,rn.useState)("channel"),u=(0,rn.useRef)(a),c=cB(n),d=c.includes("flow"),f=c.includes("followup"),p=(0,rn.useCallback)(()=>{i([])},[]),m=t.length>0;(0,rn.useEffect)(()=>{m||(i(r??[]),s("channel"))},[r,m]);let x=t[t.length-1];return(0,rn.useEffect)(()=>{x?.role==="user"&&p()},[x,p]),(0,rn.useEffect)(()=>{let I=u.current;if(u.current=a,I==="streaming"&&a==="ready"&&(d||f)){let y=[...t].reverse().find(b=>b.role==="assistant");if(!y)return;let w=XI(y,{includeFlow:d}),g=w&&(w.source==="flow"&&d||w.source==="followup"&&f);i(g?w.suggestions:[]),s(g?w.source:"channel")}},[a,d,f,t]),{suggestions:o,source:l,isLoading:!1,clear:p}}var Hi=q(Ie(),1),dB=80,fB=50,pB=15e3,YI=500;function hd(e,t=!0){let[a,n]=(0,Hi.useState)(""),r=(0,Hi.useRef)(void 0);return(0,Hi.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,l=!1,s=()=>{l||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(s,YI)):r.current=setTimeout(s,fB)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,pB)):r.current=setTimeout(s,dB)))};return r.current=setTimeout(s,YI),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var on=q(Ie(),1);var QI=["en","fr","es"];function ji(e){return QI.includes(e)}function dg(e){if(e&&ji(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&ji(a))return a}let t=[];if(typeof navigator<"u"&&(navigator.language&&t.push(navigator.language),navigator.languages&&t.push(...navigator.languages)),typeof document<"u"){let a=document.documentElement.getAttribute("lang");a&&t.push(a)}for(let a of t){let n=a.toLowerCase();if(ji(n))return n;let r=n.split("-")[0];if(r&&ji(r))return r}return"en"}var gd={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments"},workingIndicator:{default:"On it\u2026"},reasoning:{thinking:"Thinking\u2026",thoughtBrief:"Thought for a few seconds",thoughtForSeconds:e=>`Thought for ${e} second${e===1?"":"s"}`},chainOfThought:{working:"Working on it\u2026",done:"Thought process"},tool:{copy:"Copy",copied:"Copied",request:"Request",response:"Response",error:"Error"},attachments:{attachmentFallback:"attachment",fileFallback:"file"},threadMenu:{newChat:"New chat",threadHistory:"Thread history",deleteThread:"Delete thread",noPreviousChats:"No previous chats yet.",hiddenThreads:e=>`${e} older thread${e===1?"":"s"} hidden`},chatQueue:{attachmentFallback:"(attachment)",removeFromQueue:"Remove from queue",queued:e=>`${e} queued`},poweredBy:{label:"AI agent powered by"},aiDisclaimer:{default:"can make mistakes"},exportSession:{saving:"saving...",saved:"saved",error:"error",export:"export",tooltip:"Save scenario to Waniwani"},widgetErrorBoundary:{failedToLoad:"Widget failed to load",retry:"Retry"},launcher:{prompt:"Ask anything\u2026",open:"Open chat",close:"Close chat",minimize:"Minimize"}};var JI={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos"},workingIndicator:{default:"Un momento\u2026"},reasoning:{thinking:"Pensando\u2026",thoughtBrief:"Pensado durante unos segundos",thoughtForSeconds:e=>`Pensado durante ${e} segundo${e===1?"":"s"}`},chainOfThought:{working:"Estoy en ello\u2026",done:"Razonamiento"},tool:{copy:"Copiar",copied:"Copiado",request:"Solicitud",response:"Respuesta",error:"Error"},attachments:{attachmentFallback:"adjunto",fileFallback:"archivo"},threadMenu:{newChat:"Nueva conversaci\xF3n",threadHistory:"Historial",deleteThread:"Eliminar conversaci\xF3n",noPreviousChats:"A\xFAn no hay conversaciones anteriores.",hiddenThreads:e=>`${e} conversaci\xF3n${e===1?"":"es"} anterior${e===1?"":"es"} oculta${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(adjunto)",removeFromQueue:"Quitar de la cola",queued:e=>`${e} en cola`},poweredBy:{label:"Agente IA con tecnolog\xEDa de"},aiDisclaimer:{default:"puede cometer errores"},exportSession:{saving:"guardando...",saved:"guardado",error:"error",export:"exportar",tooltip:"Guardar escenario en Waniwani"},widgetErrorBoundary:{failedToLoad:"No se pudo cargar el widget",retry:"Reintentar"},launcher:{prompt:"Pregunta lo que quieras\u2026",open:"Abrir chat",close:"Cerrar chat",minimize:"Minimizar"}};var eC={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes"},workingIndicator:{default:"Un instant\u2026"},reasoning:{thinking:"R\xE9flexion\u2026",thoughtBrief:"R\xE9flexion pendant quelques secondes",thoughtForSeconds:e=>`R\xE9flexion pendant ${e} seconde${e===1?"":"s"}`},chainOfThought:{working:"Je m'en occupe\u2026",done:"Raisonnement"},tool:{copy:"Copier",copied:"Copi\xE9",request:"Requ\xEAte",response:"R\xE9ponse",error:"Erreur"},attachments:{attachmentFallback:"pi\xE8ce jointe",fileFallback:"fichier"},threadMenu:{newChat:"Nouvelle conversation",threadHistory:"Historique",deleteThread:"Supprimer la conversation",noPreviousChats:"Aucune conversation pr\xE9c\xE9dente.",hiddenThreads:e=>`${e} conversation${e===1?"":"s"} plus ancienne${e===1?"":"s"} masqu\xE9e${e===1?"":"s"}`},chatQueue:{attachmentFallback:"(pi\xE8ce jointe)",removeFromQueue:"Retirer de la file",queued:e=>`${e} en attente`},poweredBy:{label:"Agent IA propuls\xE9 par"},aiDisclaimer:{default:"peut faire des erreurs"},exportSession:{saving:"enregistrement...",saved:"enregistr\xE9",error:"erreur",export:"exporter",tooltip:"Enregistrer le sc\xE9nario dans Waniwani"},widgetErrorBoundary:{failedToLoad:"\xC9chec du chargement du widget",retry:"R\xE9essayer"},launcher:{prompt:"Posez votre question\u2026",open:"Ouvrir le chat",close:"Fermer le chat",minimize:"R\xE9duire"}};var fg={en:gd,fr:eC,es:JI};var aC=q(ne(),1),tC=(0,on.createContext)(null);function mB(e,t){if(!t)return e;let a={...e};for(let n of Object.keys(e)){let r=e[n],o=t[n];o&&typeof r=="object"&&(a[n]={...r,...o})}return a}function Ds({children:e,locale:t,messages:a}){let n=!!(t&&hB(t)),r=n?t:"en",[o,i]=(0,on.useState)(r),[l,s]=(0,on.useState)(n);(0,on.useEffect)(()=>{i(dg(t)),s(!0)},[t]);let u=(0,on.useMemo)(()=>{let c=fg[o]??fg["en"];return{locale:o,t:mB(c,a),ready:l}},[o,a,l]);return(0,aC.jsx)(tC.Provider,{value:u,children:e})}function hB(e){return e==="en"||e==="fr"||e==="es"}function Re(){let e=(0,on.useContext)(tC);return e||{locale:"en",t:gd,ready:!0}}function pg(e,t){let a=Date.now()-e;if(a<6e4)try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"narrow"}).format(0,"second")}catch{return"just now"}let n,r;a<60*6e4?(n=-Math.floor(a/6e4),r="minute"):a<1440*6e4?(n=-Math.floor(a/(60*6e4)),r="hour"):(n=-Math.floor(a/(1440*6e4)),r="day");try{return new Intl.RelativeTimeFormat(t,{numeric:"auto",style:"short"}).format(n,r)}catch{return`${Math.abs(n)}${r==="minute"?"m":r==="hour"?"h":"d"} ago`}}var Ge=q(Ie(),1);var _s=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,a)=>(a&=63,a<36?t+=a.toString(36):a<62?t+=(a-26).toString(36).toUpperCase():a>62?t+="-":t+="_",t),"");var at=q(Ie(),1);var nC=q(ne(),1),Sn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,nC.jsx)("button",{type:n,className:V("ww:inline-flex ww:cursor-pointer ww:items-center ww:justify-center ww:rounded-md ww:font-medium ww:transition-colors ww:disabled:pointer-events-none ww:disabled:opacity-50",t==="default"&&"ww:bg-primary ww:text-primary-foreground ww:hover:bg-primary/90",t==="outline"&&"ww:border ww:border-border ww:bg-background ww:hover:bg-accent ww:hover:text-accent-foreground",t==="ghost"&&"ww:hover:bg-accent ww:hover:text-accent-foreground",a==="default"&&"ww:h-9 ww:px-4 ww:py-2 ww:text-sm",a==="sm"&&"ww:h-8 ww:px-3 ww:text-xs",a==="icon"&&"ww:size-9 ww:!rounded-full",a==="icon-sm"&&"ww:size-7 ww:!rounded-full",e),...r});var na=q(ne(),1),gB=async e=>{try{let a=await(await fetch(e)).blob();return new Promise(n=>{let r=new FileReader;r.onloadend=()=>n(r.result),r.onerror=()=>n(null),r.readAsDataURL(a)})}catch{return null}},rC=(0,at.createContext)(null),oC=()=>{let e=(0,at.useContext)(rC);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},iC=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,onSubmit:i,children:l,...s})=>{let{t:u}=Re(),c=(0,at.useRef)(null),d=(0,at.useRef)(null),[f,p]=(0,at.useState)([]),m=(0,at.useRef)(f);(0,at.useEffect)(()=>{m.current=f},[f]);let x=(0,at.useCallback)(()=>{c.current?.click()},[]),I=(0,at.useCallback)(S=>{let M=[...S];if(M.length===0)return;let R=L=>o?L.size<=o:!0,_=M.filter(R);p(L=>{let z=typeof r=="number"?Math.max(0,r-L.length):void 0,U=typeof z=="number"?_.slice(0,z):_;return[...L,...U.map(B=>({filename:B.name,id:_s(),mediaType:B.type,type:"file",url:URL.createObjectURL(B)}))]})},[r,o]),y=(0,at.useCallback)(S=>{p(M=>{let R=M.find(_=>_.id===S);return R?.url&&URL.revokeObjectURL(R.url),M.filter(_=>_.id!==S)})},[]),w=(0,at.useCallback)(()=>{p(S=>{for(let M of S)M.url&&URL.revokeObjectURL(M.url);return[]})},[]);(0,at.useEffect)(()=>()=>{for(let S of m.current)S.url&&URL.revokeObjectURL(S.url)},[]);let g=(0,at.useCallback)(S=>{S.currentTarget.files&&I(S.currentTarget.files),S.currentTarget.value=""},[I]);(0,at.useEffect)(()=>{if(!n)return;let S=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault()},M=R=>{R.dataTransfer?.types?.includes("Files")&&R.preventDefault(),R.dataTransfer?.files&&R.dataTransfer.files.length>0&&I(R.dataTransfer.files)};return document.addEventListener("dragover",S),document.addEventListener("drop",M),()=>{document.removeEventListener("dragover",S),document.removeEventListener("drop",M)}},[I,n]);let b=(0,at.useCallback)(async S=>{S.preventDefault();let M=S.currentTarget,_=new FormData(M).get("message")||"";M.reset();let L=await Promise.all(f.map(async({id:z,...U})=>{if(U.url?.startsWith("blob:")){let B=await gB(U.url);return{...U,url:B??U.url}}return U}));try{let z=i({files:L,text:_},S);z instanceof Promise&&await z,w()}catch{}},[f,i,w]),T=(0,at.useMemo)(()=>({add:I,clear:w,files:f,openFileDialog:x,remove:y}),[f,I,y,w,x]);return(0,na.jsxs)(rC.Provider,{value:T,children:[(0,na.jsx)("input",{accept:t,"aria-label":u.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:g,ref:c,title:u.promptInput.uploadFiles,type:"file"}),(0,na.jsx)("form",{className:V("ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:b,ref:d,...s,children:l})]})};var lC=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Re(),i=oC(),[l,s]=(0,at.useState)(!1),u=n??o.promptInput.placeholder,c=(0,at.useCallback)(f=>{if(t?.(f),!f.defaultPrevented){if(f.key==="Enter"){if(l||f.nativeEvent.isComposing||f.shiftKey)return;f.preventDefault();let{form:p}=f.currentTarget;if(p?.querySelector('button[type="submit"]')?.disabled)return;p?.requestSubmit()}if(f.key==="Backspace"&&f.currentTarget.value===""&&i.files.length>0){f.preventDefault();let p=i.files.at(-1);p&&i.remove(p.id)}}},[t,l,i]),d=(0,at.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let I=x.getAsFile();I&&m.push(I)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,na.jsx)("textarea",{className:V("ww:field-sizing-content ww:max-h-48 ww:min-h-0 ww:w-full ww:resize-none ww:border-0 ww:bg-transparent ww:px-3 ww:py-2 ww:text-base ww:sm:text-sm ww:outline-none ww:placeholder:text-muted-foreground",a),name:"message",onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},sC=({className:e,status:t,onStop:a,onClick:n,children:r,...o})=>{let{t:i}=Re(),l=t==="submitted"||t==="streaming",s=(0,na.jsx)(Co,{className:"ww:size-4"});t==="submitted"?s=(0,na.jsx)(ks,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(s=(0,na.jsx)(Es,{className:"ww:size-4"}));let u=(0,at.useCallback)(c=>{if(l&&a){c.preventDefault(),a();return}n?.(c)},[l,a,n]);return(0,na.jsx)(Sn,{"aria-label":l?i.promptInput.stop:i.promptInput.submit,className:V("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),onClick:u,size:"icon-sm",type:l&&a?"button":"submit",variant:"ghost",...o,children:r??s})},uC=({className:e,children:t,...a})=>{let{t:n}=Re(),r=oC();return r.files.length>0?(0,na.jsxs)(Sn,{className:V("ww:group ww:relative",e),onClick:()=>r.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,na.jsx)("span",{className:"ww:flex ww:size-5 ww:items-center ww:justify-center ww:rounded-full ww:bg-primary ww:text-[10px] ww:font-medium ww:text-primary-foreground ww:transition-opacity ww:group-hover:opacity-0",children:r.files.length}),(0,na.jsx)(Yn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]}):(0,na.jsx)(Sn,{className:V(e),onClick:()=>r.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,na.jsx)(Ts,{className:"ww:size-4"})})};var dC=q(ne(),1);function cC({text:e}){let{t}=Re();return e===!1?null:(0,dC.jsx)("span",{className:"ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70",children:e||t.aiDisclaimer.default})}var yd=q(Ie(),1);var Lo=q(ne(),1),fC=({className:e,...t})=>(0,Lo.jsx)("div",{className:V("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),pC=({className:e,...t})=>(0,Lo.jsx)("li",{className:V("ww:group ww:flex ww:items-center ww:gap-2 ww:rounded-md ww:px-2 ww:py-1 ww:text-sm ww:transition-colors ww:hover:bg-muted",e),...t}),mC=({className:e,...t})=>(0,Lo.jsx)("span",{className:V("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),hC=({className:e,...t})=>(0,Lo.jsx)("span",{className:V("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),gC=({className:e,...t})=>(0,Lo.jsx)("div",{className:V("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),yC=({className:e,...t})=>(0,Lo.jsx)(Sn,{className:V("ww:size-auto ww:rounded ww:p-1 ww:text-muted-foreground ww:hover:bg-muted-foreground/10 ww:hover:text-foreground",e),size:"icon",type:"button",variant:"ghost",...t});var Xa=q(ne(),1),wC=(0,yd.memo)(({message:e,onRemove:t})=>{let{t:a}=Re(),n=(0,yd.useCallback)(()=>t(e.id),[t,e.id]);return(0,Xa.jsxs)(pC,{children:[(0,Xa.jsx)(mC,{}),(0,Xa.jsx)(hC,{children:e.text||a.chatQueue.attachmentFallback}),(0,Xa.jsx)(gC,{children:(0,Xa.jsx)(yC,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,Xa.jsx)(Yn,{className:"ww:size-3"})})})]})});wC.displayName="ChatQueueItem";function xC({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Re();return e.length===0?null:(0,Xa.jsxs)(fC,{className:V("ww:border-t ww:border-border",a),children:[(0,Xa.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,Xa.jsx)("ul",{children:e.map(r=>(0,Xa.jsx)(wC,{message:r,onRemove:t},r.id))})]})}var Ur=q(ne(),1),vC=({files:e,className:t,...a})=>e.length===0?null:(0,Ur.jsx)("div",{className:V("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,Ur.jsx)(yB,{file:n},r))});function yB({file:e}){let{t}=Re();return e.mediaType?.startsWith("image/")&&e.url?(0,Ur.jsx)("img",{src:e.url,alt:e.filename??t.attachments.attachmentFallback,className:"ww:h-16 ww:max-w-32 ww:rounded ww:object-cover"}):(0,Ur.jsxs)("span",{className:"ww:inline-flex ww:items-center ww:gap-1.5 ww:rounded ww:bg-background/20 ww:px-2 ww:py-1 ww:text-xs",children:[(0,Ur.jsx)(Is,{className:"ww:size-3 ww:shrink-0"}),(0,Ur.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}var xa=q(Ie(),1);var ht=q(Ie(),1);Sf();var QA=q(Ie(),1);var JA=q(ne(),1),B5=({as:e="span",className:t,duration:a=2,style:n,children:r,...o})=>{let i={backgroundImage:"linear-gradient(90deg, var(--ww-color-muted-foreground) 0%, var(--ww-color-muted-foreground) 40%, var(--ww-color-foreground) 50%, var(--ww-color-muted-foreground) 60%, var(--ww-color-muted-foreground) 100%)",backgroundSize:"250% 100%",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",animation:`ww-shimmer ${a}s linear infinite`,...n};return(0,JA.jsx)(e,{"data-waniwani-shimmer":"",className:V("ww:inline-block",t),style:i,...o,children:r})},cn=(0,QA.memo)(B5);cn.displayName="Shimmer";var Jt=q(ne(),1),eR=(0,ht.createContext)(null);function tR(){let e=(0,ht.useContext)(eR);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var U5=1e3,F5=1e3,lu=(0,ht.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...l})=>{let s=n??t,u=n===!1,c=a!==void 0,[d,f]=(0,ht.useState)(s),p=c?a:d,m=(0,ht.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,I]=(0,ht.useState)(void 0),y=o??x,w=(0,ht.useRef)(t),[g,b]=(0,ht.useState)(!1),T=(0,ht.useRef)(null);(0,ht.useEffect)(()=>{t?(w.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(I(Math.ceil((Date.now()-T.current)/F5)),T.current=null)},[t]),(0,ht.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,ht.useEffect)(()=>{if(w.current&&!t&&p&&!g){let M=setTimeout(()=>{m(!1),b(!0)},U5);return()=>clearTimeout(M)}},[t,p,g,m]);let S=(0,ht.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:y}),[t,p,m,y]);return(0,Jt.jsx)(eR.Provider,{value:S,children:(0,Jt.jsx)("div",{className:V("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":p?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})});lu.displayName="Reasoning";var su=(0,ht.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Re(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=tR(),f=a??((p,m)=>p||m===0?(0,Jt.jsx)(cn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,Jt.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,Jt.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,Jt.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:V("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),...o,children:t??(0,Jt.jsxs)(Jt.Fragment,{children:[!n&&(0,Jt.jsx)(Zn,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});su.displayName="ReasoningTrigger";var uu=(0,ht.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=tR();return(0,Jt.jsx)("div",{className:V("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Jt.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Jt.jsx)("div",{className:V("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Jt.jsx)(al,{children:t})})})})});uu.displayName="ReasoningContent";var ke=q(ne(),1),z5=500,aR=(0,xa.createContext)(null);function nR(){let e=(0,xa.useContext)(aR);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function rR({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...l}){let s=n!==void 0,[u,c]=(0,xa.useState)(r),d=s?n:u,f=(0,xa.useCallback)(I=>{s||c(I),o?.(I)},[s,o]),[p,m]=(0,xa.useState)(!t);(0,xa.useEffect)(()=>{if(t){m(!1);return}let I=setTimeout(()=>m(!0),z5);return()=>clearTimeout(I)},[t]);let x=(0,xa.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,ke.jsx)(aR.Provider,{value:x,children:(0,ke.jsx)("div",{className:V("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":d?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})}function oR({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=nR();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,ke.jsx)("div",{className:V("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground",e),children:(0,ke.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:items-center ww:gap-1.5",style:{animation:"ww-fade-in 0.25s ease-out"},children:[c&&(0,ke.jsx)(c,{className:V("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,ke.jsx)("span",{className:"ww:truncate",children:l?(0,ke.jsx)(cn,{duration:2.6,children:d}):d})]},d)})}return(0,ke.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:V("ww:flex ww:min-h-5 ww:w-full ww:items-center ww:gap-1.5 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),style:{animation:"ww-fade-in 0.25s ease-out"},...r,children:[(0,ke.jsx)("span",{className:"ww:truncate",children:n??t}),(0,ke.jsx)(Br,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function iR({className:e,children:t,...a}){let{open:n}=nR();return(0,ke.jsx)("div",{className:V("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ke.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ke.jsx)("div",{className:V("ww:flex ww:flex-col",e),...a,children:t})})})}function lR({icon:e,isLast:t,running:a,error:n}){return(0,ke.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,ke.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,ke.jsx)(e,{className:V("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,ke.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function qw({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let l=n==="input-available"||n==="input-streaming",s=n==="output-error",u=o!=null,[c,d]=(0,xa.useState)(!1),f=a??"",p=l?(0,ke.jsx)(cn,{duration:1.6,children:f}):(0,ke.jsx)("span",{className:"ww:truncate",children:f});return(0,ke.jsxs)("div",{className:V("ww:flex ww:gap-2",e),...i,children:[(0,ke.jsx)(lR,{icon:t,isLast:r,running:l,error:s}),(0,ke.jsxs)("div",{className:V("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,ke.jsxs)("button",{type:"button",onClick:()=>d(m=>!m),"aria-expanded":c,className:"ww:flex ww:w-full ww:items-center ww:gap-1.5 ww:text-left ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",children:[p,(0,ke.jsx)(Br,{className:V("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,ke.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,ke.jsx)("div",{className:V("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",c?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ke.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ke.jsx)("div",{className:"ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",children:o})})})]})]})}function sR({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,ke.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,ke.jsx)(lR,{icon:Zn,isLast:t,running:e}),(0,ke.jsx)("div",{className:V("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,ke.jsxs)(lu,{isStreaming:e,className:"ww:mb-0",children:[(0,ke.jsx)(su,{hideIcon:!0}),(0,ke.jsx)(uu,{children:a})]})})]})}var Hw={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var uR={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var fR=q(Ie(),1);var or=q(Ie(),1),q5=5,cR=400;function dR(e,t,a={}){let{msPerChar:n=q5}=a,[r,o]=(0,or.useState)(t?"":e),i=(0,or.useRef)(e),l=(0,or.useRef)(t?0:e.length),s=(0,or.useRef)(0),u=(0,or.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,or.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),l.current=e.length,o(e);return}if(i.current.length-l.current>cR&&(l.current=i.current.length-cR),u.current!==null)return;let d=f=>{let p=i.current;if(l.current>=p.length){u.current=null;return}s.current===0&&(s.current=f);let m=f-s.current;if(m>=n){let x=Math.min(Math.floor(m/n),p.length-l.current);l.current+=x,o(p.slice(0,l.current)),s.current=f}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var cu=q(ne(),1),jw=({className:e,from:t,children:a,...n})=>(0,cu.jsx)("div",{className:V("ww-message ww:group ww:flex ww:w-full",t==="user"?"ww-message-user is-user ww:ml-auto ww:flex-col ww:items-end ww:[max-width:var(--ww-msg-max-width,80%)]":"ww-message-assistant is-assistant ww:flex-col",e),...n,children:(0,cu.jsx)("div",{className:V("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Vw=({children:e,className:t,...a})=>(0,cu.jsx)("div",{className:V("ww-bubble ww:flex ww:w-fit ww:min-w-0 ww:max-w-full ww:flex-col ww:gap-2 ww:overflow-hidden","ww:[font-size:var(--ww-font-size,1rem)] ww:[line-height:var(--ww-line-height,1.5)]","ww:group-[.is-user]:ml-auto ww:group-[.is-user]:bg-user-bubble ww:group-[.is-user]:[color:var(--ww-color-user-bubble-text)] ww:group-[.is-user]:[border-radius:var(--ww-msg-radius,8px)] ww:group-[.is-user]:[padding:var(--ww-msg-pad-y,12px)_var(--ww-msg-pad-x,16px)]","ww:group-[.is-assistant]:text-foreground",t),...a,children:e}),H5={cjk:Hw,code:uR},j5={cjk:Hw},V5={enabled:!1};function G5({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=dR(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,cu.jsx)(al,{className:V("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??V5,plugins:a?j5:H5,...r,children:l})}var Tf=(0,fR.memo)(G5,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);Tf.displayName="MessageResponse";var Bt=q(Ie(),1);var ye=q(ne(),1);function W5(e,t=80){if(e==null)return String(e);if(typeof e!="object")return String(e).slice(0,t);if(Array.isArray(e))return`Array(${e.length})`;let a=JSON.stringify(e);if(a.length<=t)return a;let n=Object.entries(e),r=[],o=t-2;for(let[i,l]of n){if(o<=8)break;let s=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof l=="string"?u=l.length>2?`'${l.slice(0,1)}\u2026`:`'${l}'`:Array.isArray(l)?u=`Array(${l.length})`:typeof l=="object"&&l!==null?u="{\u2026}":u=String(l);let c=`${s}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function $5({text:e,className:t}){let{t:a}=Re(),[n,r]=(0,Bt.useState)(!1),o=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Bt.useCallback)(async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,ye.jsx)(Sn,{variant:"ghost",size:"sm",onClick:i,className:V("ww:h-auto ww:gap-1 ww:px-1.5 ww:py-0.5 ww:text-xs ww:text-muted-foreground ww:hover:text-foreground",t),children:n?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(vs,{className:"ww:size-3.5"}),(0,ye.jsx)("span",{children:a.tool.copied})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Ss,{className:"ww:size-3.5"}),(0,ye.jsx)("span",{children:a.tool.copy})]})})}function hR({data:e,label:t,className:a,...n}){let[r,o]=(0,Bt.useState)(!1),i=(0,Bt.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=W5(e);return(0,ye.jsxs)("div",{className:V("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,ye.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,ye.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,ye.jsx)($5,{text:i})]}),(0,ye.jsxs)("button",{type:"button",onClick:()=>o(s=>!s),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,ye.jsx)(bs,{className:V("ww:mt-0.5 ww:size-3.5 ww:shrink-0 ww:text-muted-foreground ww:transition-transform ww:duration-150",r&&"ww:rotate-90")}),r?(0,ye.jsx)("pre",{className:"ww:overflow-x-auto ww:text-xs ww:font-mono ww:text-foreground ww:whitespace-pre-wrap ww:break-all",children:(0,ye.jsx)("code",{children:i})}):(0,ye.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Ww=(0,Bt.createContext)({open:!1,toggle:()=>{}});function gR({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Bt.useState)(t);return(0,ye.jsx)(Ww.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,ye.jsx)("div",{className:V("ww:mb-4 ww:w-full",e),"data-state":r?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:a})})}function yR({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Bt.useContext)(Ww),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,ye.jsxs)("button",{type:"button",onClick:o,className:V("ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",e),"aria-expanded":r,...n,children:[(0,ye.jsx)(ko,{className:"ww:size-4 ww:shrink-0"}),(0,ye.jsx)("span",{className:"ww:truncate",children:i?(0,ye.jsx)(cn,{duration:1.6,children:l}):l}),(0,ye.jsx)(Br,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function wR({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,ye.jsx)("div",{className:V("ww:mb-4 ww:flex ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...n,children:(0,ye.jsx)("span",{className:"ww:truncate",children:r?(0,ye.jsx)(cn,{duration:1.6,children:o}):o})})}function xR({className:e,children:t,...a}){let{open:n}=(0,Bt.useContext)(Ww);return(0,ye.jsx)("div",{className:V("ww:grid ww:transition-[grid-template-rows,opacity] ww:duration-200 ww:ease-out",n?"ww:grid-rows-[1fr] ww:opacity-100":"ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ye.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ye.jsx)("div",{className:V("ww:mt-2 ww:space-y-3 ww:rounded-lg ww:border ww:border-border ww:bg-background ww:p-3",e),...a,children:t})})})}function $w({className:e,input:t,debug:a,...n}){let{t:r}=Re(),o=(0,Bt.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,ye.jsx)(hR,{data:o,label:r.tool.request,className:e,...n})}function Gw(e){if(!(typeof e!="object"||e===null))return e}function vR(e){return Gw(e?.ui)}function bR(e){return Gw(Gw(e)?._meta)}function pR(e){if(!e)return;let t=vR(e)?.resourceUri;if(typeof t=="string"&&t.length>0)return t;let a=e["ui/resourceUri"];if(typeof a=="string"&&a.length>0)return a;let n=e["openai/outputTemplate"];if(typeof n=="string"&&n.length>0)return n}function mR(e){return vR(e)?.autoHeight===!0}function du(e,t,a){if(e){let n=pR(a?.[e]?._meta);if(n)return n}return pR(bR(t))}function SR(e,t,a){return e&&mR(a?.[e]?._meta)?!0:mR(bR(t))}function Xw({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Re(),i=(0,Bt.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:l,...s}=t;return s}return t},[t,n]);return t||a?a?(0,ye.jsxs)("div",{className:V("ww:space-y-2",e),...r,children:[(0,ye.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,ye.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,ye.jsx)(hR,{data:i,label:o.tool.response,className:e,...r}):null}var fu=q(ne(),1);function IR(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function CR(e){return e.parts.some(IR)}function kR(e,t,a){if(t!=="submitted"&&t!=="streaming")return!1;let n=e[e.length-1];return!n||n.role!=="assistant"?!0:!n.parts.some(o=>!(!IR(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function LR({className:e,...t}){let{t:a}=Re();return(0,fu.jsxs)("div",{"aria-live":"polite",className:V("ww:mb-4 ww:flex ww:w-full ww:items-center ww:gap-2 ww:text-sm ww:text-muted-foreground",e),style:{animation:"ww-fade-in 0.2s ease-out"},...t,children:[(0,fu.jsx)(Ms,{className:"ww:size-4 ww:shrink-0"}),(0,fu.jsx)(cn,{duration:1.6,children:a.workingIndicator.default})]})}var Je=q(Ie(),1);function nl(e){if(!e)return!1;let t=Array.isArray(e.content)&&e.content.length>0,a=typeof e.structuredContent=="object"&&e.structuredContent!==null&&Object.keys(e.structuredContent).length>0;return t||a}function TR(e,t){return!nl(e)&&!nl(t)?null:nl(e)?nl(t)?{...e.content||t.content?{content:[...e.content??[],...t.content??[]]}:{},...e.structuredContent||t.structuredContent?{structuredContent:{...e.structuredContent??{},...t.structuredContent??{}}}:{}}:{...e.content?{content:[...e.content]}:{},...e.structuredContent?{structuredContent:{...e.structuredContent}}:{}}:{...t?.content?{content:[...t.content]}:{},...t?.structuredContent?{structuredContent:{...t.structuredContent}}:{}}}var MR=q(ne(),1),X5="/api/mcp/resource",K5=500,Z5=0,Y5=16,Q5="2026-01-26",J5=300,e6=3e3,t6=3;function a6(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function n6(e,t,a){return du(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function ER({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=X5,chatSessionId:r,isDark:o=!1,className:i,autoHeight:l=!1,onOpenLink:s,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:f=!1,toolDefinitions:p}){let m=(0,Je.useRef)(null),x=(0,Je.useRef)(t),I=(0,Je.useRef)(a),y=(0,Je.useRef)({width:0,height:0}),w=(0,Je.useRef)(null),g=(0,Je.useRef)(!1),b=(0,Je.useRef)(0),T=(0,Je.useRef)("inline"),[S,M]=(0,Je.useState)(Z5),[R,_]=(0,Je.useState)(void 0),L=(0,Je.useRef)(s),z=(0,Je.useRef)(u),U=(0,Je.useRef)(c),B=(0,Je.useRef)(d),W=(0,Je.useRef)(r),A=(0,Je.useRef)(p);x.current=t,I.current=a,L.current=s,z.current=u,U.current=c,B.current=d,W.current=r,A.current=p;let j=(0,Je.useCallback)(v=>l?Math.max(v+Y5,0):Math.min(Math.max(v,50),K5),[l]),$=(0,Je.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),We=(0,Je.useRef)(o);We.current=o;let $e=(0,Je.useRef)(f);return(0,Je.useEffect)(()=>{$e.current=f,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[f]),(0,Je.useEffect)(()=>{if(!g.current)return;let v=m.current;v?.contentWindow&&v.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,Je.useEffect)(()=>{let v=m.current;if(!v)return;let De=!1,_e=!1,k=null,Le=null,St=setTimeout(()=>{if(De||_e||b.current>=t6)return;b.current+=1;let ve=new URL(v.src);ve.searchParams.set("_retry",String(b.current)),v.src=ve.toString()},e6),et=ve=>{v.contentWindow?.postMessage(ve,"*")},Ut=ve=>{if(De||ve.source!==v.contentWindow)return;let X=ve.data;if(!X||typeof X!="object"||X.jsonrpc!=="2.0")return;let pe=X.method,ce=X.id;if(pe==="ui/initialize"&&ce!=null){_e=!0,clearTimeout(St),et({jsonrpc:"2.0",id:ce,result:{protocolVersion:X.params?.protocolVersion??Q5,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:We.current?"dark":"light",displayMode:T.current}}});return}if(pe==="ui/notifications/initialized"){g.current=!0;let oe=x.current,he=I.current,Xe=he._meta&&typeof he._meta=="object"?he._meta:null,dt=a6(W.current),nt=Xe&&typeof Xe.waniwani=="object"&&Xe.waniwani!==null?Xe.waniwani:null,Mt=nt||dt?{...nt??{},...dt?{sessionId:dt}:{}}:void 0,K=Xe||Mt?{...Xe??{},...Mt?{waniwani:Mt}:{}}:void 0;et({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:oe}});let se=he.content??[{type:"text",text:JSON.stringify(he)}];et({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:se,structuredContent:he.structuredContent,_meta:K,meta:K}});return}if(pe==="ui/notifications/size-changed"){let oe=X.params,he=typeof oe?.height=="number"?oe.height:void 0,Xe=typeof oe?.width=="number"?oe.width:void 0,dt=y.current,nt=he!==void 0&&he!==dt.height,Mt=Xe!==void 0&&Xe!==dt.width;if(!nt&&!Mt)return;if(nt&&he!==void 0){if(dt.height=he,$e.current)return;let K=j(he),se=v.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),M(K),v.animate&&Math.abs(se-K)>2){let Ke=v.animate([{height:`${se}px`},{height:`${K}px`}],{duration:J5,easing:"ease-out",fill:"forwards"});w.current=Ke,Ke.onfinish=()=>{w.current===Ke&&(Ke.cancel(),w.current=null)}}}Mt&&l&&Xe!==void 0&&(dt.width=Xe,_(Xe));return}if(pe==="ui/open-link"&&ce!=null){let oe=X.params?.url;typeof oe=="string"&&(L.current?L.current(oe):window.open(oe,"_blank","noopener,noreferrer")),et({jsonrpc:"2.0",id:ce,result:{}});return}if(pe==="ui/message"&&ce!=null){if(z.current&&X.params){let oe=X.params,he=k;if(k=null,Le){clearTimeout(Le.timer);let Xe=Le.text;Le=null;let dt=(oe.content??[]).map(nt=>nt.text??"").join("").trim();oe={...oe,content:[{type:"text",text:`${dt}
|
|
122
122
|
|
|
123
|
-
${Xe}`}]}}G.current({...oe,...ye?{modelContext:ye}:{}})}et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="ui/update-model-context"&&ue!=null){L=gR(L,X.params),et({jsonrpc:"2.0",id:ue,result:{}});return}if(pe==="tools/call"&&ue!=null){let oe=B.current;if(!oe){et({jsonrpc:"2.0",id:ue,error:{code:-32601,message:"tools/call not supported"}});return}let ye=X.params?.name;oe({name:ye,arguments:X.params?.arguments??{}}).then(Xe=>{et({jsonrpc:"2.0",id:ue,result:Xe});let dt=Xe.content?.map(nt=>nt.text??"").join("").trim();dt&&q5(ye,Xe,A.current)&&(ke&&clearTimeout(ke.timer),ke={text:dt,timer:setTimeout(()=>{if(De)return;let nt=L;L=null,ke=null,G.current?.({role:"user",content:[{type:"text",text:dt}],...nt?{modelContext:nt}:{}})},500)})}).catch(Xe=>{let dt=Xe instanceof Error?Xe.message:"Tool call failed";et({jsonrpc:"2.0",id:ue,error:{code:-32e3,message:dt}})});return}if(pe==="ui/request-display-mode"&&ue!=null){let oe=X.params?.mode,ye=oe==="fullscreen"||oe==="inline"||oe==="pip"?oe:"inline";T.current=ye,et({jsonrpc:"2.0",id:ue,result:{mode:ye}}),et({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ye}}),U.current?.(ye);return}if(pe==="ui/resource-teardown"&&ue!=null){et({jsonrpc:"2.0",id:ue,result:{}});return}pe==="ping"&&ue!=null&&et({jsonrpc:"2.0",id:ue,result:{}})};return window.addEventListener("message",Ut),()=>{De=!0,clearTimeout(St),ke&&clearTimeout(ke.timer),window.removeEventListener("message",Ut)}},[l,H]),(0,wR.jsx)("iframe",{ref:m,src:$,sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:j(!f&&"ww:rounded-md ww:border ww:border-border",i),style:{height:f?"100%":S,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var Kr=z(ne(),1);function xR({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,Kr.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:justify-center ww:py-12 ww:px-6 ww:text-center ww:min-h-full",children:[e&&(0,Kr.jsx)("div",{className:"ww:mb-4 ww:flex ww:items-center ww:justify-center ww:size-12 ww:rounded-xl ww:bg-foreground ww:text-background",children:e}),(0,Kr.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,Kr.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,Kr.jsx)("div",{className:"ww:mt-6 ww:w-full ww:max-w-md ww:flex ww:flex-col ww:gap-2",children:n.map((o,i)=>(0,Kr.jsx)("button",{type:"button",onClick:()=>r?.(o),className:j("ww:w-full ww:text-left ww:rounded-xl ww:border ww:border-border ww:bg-background ww:px-4 ww:py-3 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})]})}var vR=z(Le(),1);var al=z(ne(),1);function H5({onRetry:e}){let{t}=Re();return(0,al.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:rounded-md ww:border ww:border-border ww:bg-muted/50 ww:px-4 ww:py-3 ww:text-sm ww:text-muted-foreground",children:[(0,al.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,al.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var Cf=class extends vR.Component{constructor(){super(...arguments);Y(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){console.warn("[Waniwani] Widget failed to render:",a.message)}render(){return this.state.hasError?(0,al.jsx)(H5,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var xe=z(ne(),1);function Hw(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function bR(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?Ss:Co}function SR({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:l,onFollowUp:s,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:f,showToolCalls:p=!0,toolDefinitions:m,messageClassNames:x}){let{t:I}=Re(),y=e[e.length-1],w=e.length>0,g=d!=null,b=!g&&mR(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,xe.jsxs)(xe.Fragment,{children:[!g&&(!w&&n?(0,xe.jsx)(xR,{...n,onSuggestionSelect:r}):a&&(0,xe.jsx)(Nw,{from:"assistant",children:(0,xe.jsx)(Bw,{children:(0,xe.jsx)(If,{children:a})})})),e.map(T=>{let S=T.parts.filter(A=>A.type==="text"),M=T.parts.filter(A=>A.type==="reasoning"),R=T.parts.filter(A=>A.type==="file"),_=T.parts.filter(A=>"toolCallId"in A),k=T.parts.filter(A=>A.type==="reasoning"||"toolCallId"in A),G=T===y&&T.role==="assistant",B=S.length>0,U=g?_.some(A=>A.toolCallId===d):!1,W=p!==!1&&!U&&k.length>=2;return g&&!U?(0,xe.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!pR(T)?(0,xe.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!B&&R.length===0&&_.every(A=>{let H="output"in A?A.output:void 0;return H===void 0||!o||!uu(A.toolName,H,m)})?(0,xe.jsx)("div",{style:{display:"none"}},T.id):(0,xe.jsxs)(Nw,{from:T.role,className:x?.message,children:[p!==!1&&!U&&!W&&M.map((A,H)=>(0,xe.jsxs)(ou,{isStreaming:A.state==="streaming",children:[(0,xe.jsx)(iu,{}),(0,xe.jsx)(lu,{children:A.text})]},`reasoning-${T.id}-${H}`)),W&&(()=>{let A=k[k.length-1],H=A.type==="reasoning"?{icon:Zn,label:I.reasoning.thinking}:{icon:bR(A.toolName),label:A.title??Hw(A.toolName)};return(0,xe.jsxs)($A,{isWorking:G&&(t==="streaming"||t==="submitted"),activeStep:H,children:[(0,xe.jsx)(XA,{workingLabel:I.chainOfThought.working,label:I.chainOfThought.done}),(0,xe.jsx)(KA,{children:k.map(($,We)=>{let $e=We===k.length-1;if($.type==="reasoning")return(0,xe.jsx)(QA,{isStreaming:$.state==="streaming",isLast:$e,children:$.text},`reasoning-${T.id}-${We}`);let v=$.title??Hw($.toolName),De=bR($.toolName);if(p==="titles-only")return(0,xe.jsx)(Ow,{icon:De,title:v,state:$.state,isLast:$e},$.toolCallId);let _e="output"in $?$.output:void 0;return(0,xe.jsxs)(Ow,{icon:De,title:v,state:$.state,isLast:$e,children:[(0,xe.jsx)(zw,{input:$.input,debug:f}),_e!==void 0&&(0,xe.jsx)(qw,{output:_e,errorText:"errorText"in $?$.errorText:void 0,debug:f})]},$.toolCallId)})})]})})(),p!==!1&&!U&&!W&&_.length===1&&(()=>{let A=_[0],H=A.title??Hw(A.toolName);if(p==="titles-only")return(0,xe.jsx)(lR,{title:H,state:A.state});let $="output"in A?A.output:void 0;return(0,xe.jsxs)(oR,{children:[(0,xe.jsx)(iR,{title:H,state:A.state}),(0,xe.jsxs)(sR,{children:[(0,xe.jsx)(zw,{input:A.input,debug:f}),$!==void 0&&(0,xe.jsx)(qw,{output:$,errorText:"errorText"in A?A.errorText:void 0,debug:f})]})]})})(),_.map(A=>{let H="output"in A?A.output:void 0,$=uu(A.toolName,H,m),We=dR(A.toolName,H,m),$e=A.toolCallId===d;return $&&o&&H!==void 0?(0,xe.jsx)("div",{style:$e?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:$&&o&&H!==void 0&&(0,xe.jsx)(Cf,{children:(0,xe.jsx)(yR,{isFullscreen:$e,resourceUri:$,toolInput:A.input??{},toolResult:{content:H.content,structuredContent:H.structuredContent,_meta:H._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:We,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?v=>c(v,{toolCallId:A.toolCallId,resourceUri:$,toolInput:A.input??{},toolResult:{content:H.content,structuredContent:H.structuredContent,_meta:H._meta},autoHeight:We}):void 0})})},A.toolCallId):null}),!U&&(0,xe.jsx)("div",{children:(0,xe.jsxs)(Bw,{className:j(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,xe.jsx)(uC,{files:R}),B?S.map((A,H)=>{let $=G&&t==="streaming"&&H===S.length-1;return(0,xe.jsx)(If,{isStreaming:$,children:A.type==="text"?A.text:""},`${T.id}-${H}`)}):null]})})]},T.id)}),b&&(0,xe.jsx)(hR,{})]})}var du=z(ne(),1),j5="https://app.waniwani.ai/assets/waniwani-logo.svg",V5="https://waniwani.ai";function IR(){let{t:e}=Re();return(0,du.jsxs)("a",{href:V5,target:"_blank",rel:"noopener noreferrer",className:"ww:flex ww:items-center ww:gap-1.5 ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70 hover:ww:opacity-100 ww:transition-opacity",children:[(0,du.jsx)("span",{children:e.poweredBy.label}),(0,du.jsx)("img",{src:j5,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var nl=z(Le(),1);var Ne=z(ne(),1),CR=20;function G5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ne.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function W5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,Ne.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,Ne.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,Ne.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function $5({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,Ne.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,Ne.jsx)("path",{d:"M10 11v6"}),(0,Ne.jsx)("path",{d:"M14 11v6"})]})}function kR({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Re(),[l,s]=(0,nl.useState)(!1),u=(0,nl.useRef)(null);(0,nl.useEffect)(()=>{if(!l)return;let f=p=>{let m=u.current;m&&(p.composedPath().includes(m)||s(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);let c=e.slice(0,CR),d=Math.max(0,e.length-CR);return(0,Ne.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,Ne.jsx)("button",{type:"button",onClick:a,title:i.threadMenu.newChat,"aria-label":i.threadMenu.newChat,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(G5,{label:i.threadMenu.newChat})}),(0,Ne.jsx)("button",{type:"button",onClick:()=>s(f=>!f),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":l,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(W5,{label:i.threadMenu.threadHistory})}),l&&(0,Ne.jsxs)("div",{role:"menu",className:"ww:absolute ww:right-0 ww:top-full ww:mt-1 ww:w-72 ww:max-h-80 ww:overflow-y-auto ww:rounded-lg ww:border ww:border-border ww:bg-background ww:shadow-lg ww:z-50",children:[c.length===0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(f=>{let p=f.threadId===t,m=Date.parse(f.updatedAt);return(0,Ne.jsxs)("div",{className:`ww:flex ww:items-center ww:gap-2 ww:px-3 ww:py-2 ww:text-xs hover:ww:bg-foreground/5 ${p?"ww:bg-foreground/5":""}`,children:[(0,Ne.jsxs)("button",{type:"button",onClick:()=>{n(f.threadId),s(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,Ne.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,Ne.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":ig(m,o)})]}),(0,Ne.jsx)("button",{type:"button",onClick:x=>{x.stopPropagation(),r(f.threadId)},title:i.threadMenu.deleteThread,"aria-label":i.threadMenu.deleteThread,className:"ww:p-1 ww:rounded ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/10 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)($5,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-2 ww:text-[10px] ww:text-muted-foreground ww:border-t ww:border-border",children:i.threadMenu.hiddenThreads(d)})]})]})}var Lf=z(Le(),1);function kf(e){let t=new Set;return{subscribe(a){return t.add(a),()=>{t.delete(a)}},emit(a){let{sessionId:n,...r}=a,o=a.name==="session.started"?a.properties.sessionId:void 0,i={...r,mode:e.mode,sessionId:Object.hasOwn(a,"sessionId")?n:o??e.getSessionId?.(),timestamp:Date.now()};for(let l of[...t])try{l(i)}catch(s){console.warn("[Waniwani] onEvent subscriber threw:",s)}}}}function LR(){return{subscribe(){return()=>{}},emit(){}}}var TR=(0,Lf.createContext)(LR());function Tf(){return(0,Lf.useContext)(TR)}var Ef=TR.Provider;var Mf=z(Le(),1);function ER(e){let t=(0,Mf.useRef)(e);return t.current=e,(0,Mf.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=`${n??"/api/waniwani"}/tool`,s=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...s?{"X-Session-Id":s}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var Ja=z(Le(),1);var n2="vercel.ai.error",X5=Symbol.for(n2),MR,AR,Ee=class r2 extends(AR=Error,MR=X5,AR){constructor({name:t,message:a,cause:n}){super(a),this[MR]=!0,this.name=t,this.cause=n}static isInstance(t){return r2.hasMarker(t,n2)}static hasMarker(t,a){let n=Symbol.for(a);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}},o2="AI_APICallError",i2=`vercel.ai.error.${o2}`,K5=Symbol.for(i2),RR,DR,lne=class extends(DR=Ee,RR=K5,DR){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:l=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:o2,message:e,cause:i}),this[RR]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=l,this.data=s}static isInstance(e){return Ee.hasMarker(e,i2)}},l2="AI_EmptyResponseBodyError",s2=`vercel.ai.error.${l2}`,Z5=Symbol.for(s2),_R,OR,sne=class extends(OR=Ee,_R=Z5,OR){constructor({message:e="Empty response body"}={}){super({name:l2,message:e}),this[_R]=!0}static isInstance(e){return Ee.hasMarker(e,s2)}};function u2(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var c2="AI_InvalidArgumentError",d2=`vercel.ai.error.${c2}`,Q5=Symbol.for(d2),PR,NR,f2=class extends(NR=Ee,PR=Q5,NR){constructor({message:e,cause:t,argument:a}){super({name:c2,message:e,cause:t}),this[PR]=!0,this.argument=a}static isInstance(e){return Ee.hasMarker(e,d2)}},p2="AI_InvalidPromptError",m2=`vercel.ai.error.${p2}`,Y5=Symbol.for(m2),BR,UR,une=class extends(UR=Ee,BR=Y5,UR){constructor({prompt:e,message:t,cause:a}){super({name:p2,message:`Invalid prompt: ${t}`,cause:a}),this[BR]=!0,this.prompt=e}static isInstance(e){return Ee.hasMarker(e,m2)}},h2="AI_InvalidResponseDataError",g2=`vercel.ai.error.${h2}`,J5=Symbol.for(g2),FR,zR,cne=class extends(zR=Ee,FR=J5,zR){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:h2,message:t}),this[FR]=!0,this.data=e}static isInstance(e){return Ee.hasMarker(e,g2)}},y2="AI_JSONParseError",w2=`vercel.ai.error.${y2}`,e6=Symbol.for(w2),qR,HR,Vw=class extends(HR=Ee,qR=e6,HR){constructor({text:e,cause:t}){super({name:y2,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
-
Error message: ${
|
|
125
|
-
Error message: ${
|
|
126
|
-
`;break;case"id":l=I.includes("\0")?void 0:I;break;case"retry":/^\d+$/.test(I)?n(parseInt(I,10)):a(new
|
|
127
|
-
`)?s.slice(0,-1):s}),l=void 0,s="",u=""}function m(x={}){o&&x.consume&&d(o),i=!0,l=void 0,s="",u="",o=""}return{feed:c,reset:m}}function
|
|
123
|
+
${Xe}`}]}}z.current({...oe,...he?{modelContext:he}:{}})}et({jsonrpc:"2.0",id:ce,result:{}});return}if(pe==="ui/update-model-context"&&ce!=null){k=TR(k,X.params),et({jsonrpc:"2.0",id:ce,result:{}});return}if(pe==="tools/call"&&ce!=null){let oe=U.current;if(!oe){et({jsonrpc:"2.0",id:ce,error:{code:-32601,message:"tools/call not supported"}});return}let he=X.params?.name;oe({name:he,arguments:X.params?.arguments??{}}).then(Xe=>{et({jsonrpc:"2.0",id:ce,result:Xe});let dt=Xe.content?.map(nt=>nt.text??"").join("").trim();dt&&n6(he,Xe,A.current)&&(Le&&clearTimeout(Le.timer),Le={text:dt,timer:setTimeout(()=>{if(De)return;let nt=k;k=null,Le=null,z.current?.({role:"user",content:[{type:"text",text:dt}],...nt?{modelContext:nt}:{}})},500)})}).catch(Xe=>{let dt=Xe instanceof Error?Xe.message:"Tool call failed";et({jsonrpc:"2.0",id:ce,error:{code:-32e3,message:dt}})});return}if(pe==="ui/request-display-mode"&&ce!=null){let oe=X.params?.mode,he=oe==="fullscreen"||oe==="inline"||oe==="pip"?oe:"inline";T.current=he,et({jsonrpc:"2.0",id:ce,result:{mode:he}}),et({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:he}}),B.current?.(he);return}if(pe==="ui/resource-teardown"&&ce!=null){et({jsonrpc:"2.0",id:ce,result:{}});return}pe==="ping"&&ce!=null&&et({jsonrpc:"2.0",id:ce,result:{}})};return window.addEventListener("message",Ut),()=>{De=!0,clearTimeout(St),Le&&clearTimeout(Le.timer),window.removeEventListener("message",Ut)}},[l,j]),(0,MR.jsx)("iframe",{ref:m,src:$,sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:V(!f&&"ww:rounded-md ww:border ww:border-border",i),style:{height:f?"100%":S,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var Kr=q(ne(),1);function AR({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,Kr.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:justify-center ww:py-12 ww:px-6 ww:text-center ww:min-h-full",children:[e&&(0,Kr.jsx)("div",{className:"ww:mb-4 ww:flex ww:items-center ww:justify-center ww:size-12 ww:rounded-xl ww:bg-foreground ww:text-background",children:e}),(0,Kr.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,Kr.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,Kr.jsx)("div",{className:"ww:mt-6 ww:w-full ww:max-w-md ww:flex ww:flex-col ww:gap-2",children:n.map((o,i)=>(0,Kr.jsx)("button",{type:"button",onClick:()=>r?.(o),className:V("ww:w-full ww:text-left ww:rounded-xl ww:border ww:border-border ww:bg-background ww:px-4 ww:py-3 ww:text-sm","ww:text-foreground ww:hover:bg-accent ww:hover:border-primary/30","ww:transition-all ww:duration-200 ww:ease-out ww:cursor-pointer","ww:animate-[ww-fade-in_0.2s_ease-out_both]"),style:{animationDelay:`${i*50}ms`},children:o},o))})]})}var RR=q(Ie(),1);var rl=q(ne(),1);function r6({onRetry:e}){let{t}=Re();return(0,rl.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:rounded-md ww:border ww:border-border ww:bg-muted/50 ww:px-4 ww:py-3 ww:text-sm ww:text-muted-foreground",children:[(0,rl.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,rl.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var Ef=class extends RR.Component{constructor(){super(...arguments);Q(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){console.warn("[Waniwani] Widget failed to render:",a.message)}render(){return this.state.hasError?(0,rl.jsx)(r6,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var xe=q(ne(),1);function Kw(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function DR(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?Cs:ko}function _R({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:l,onFollowUp:s,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:f,showToolCalls:p=!0,toolDefinitions:m,messageClassNames:x}){let{t:I}=Re(),y=e[e.length-1],w=e.length>0,g=d!=null,b=!g&&kR(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,xe.jsxs)(xe.Fragment,{children:[!g&&(!w&&n?(0,xe.jsx)(AR,{...n,onSuggestionSelect:r}):a&&(0,xe.jsx)(jw,{from:"assistant",children:(0,xe.jsx)(Vw,{children:(0,xe.jsx)(Tf,{children:a})})})),e.map(T=>{let S=T.parts.filter(A=>A.type==="text"),M=T.parts.filter(A=>A.type==="reasoning"),R=T.parts.filter(A=>A.type==="file"),_=T.parts.filter(A=>"toolCallId"in A),L=T.parts.filter(A=>A.type==="reasoning"||"toolCallId"in A),z=T===y&&T.role==="assistant",U=S.length>0,B=g?_.some(A=>A.toolCallId===d):!1,W=p!==!1&&!B&&L.length>=2;return g&&!B?(0,xe.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!CR(T)?(0,xe.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!U&&R.length===0&&_.every(A=>{let j="output"in A?A.output:void 0;return j===void 0||!o||!du(A.toolName,j,m)})?(0,xe.jsx)("div",{style:{display:"none"}},T.id):(0,xe.jsxs)(jw,{from:T.role,className:x?.message,children:[p!==!1&&!B&&!W&&M.map((A,j)=>(0,xe.jsxs)(lu,{isStreaming:A.state==="streaming",children:[(0,xe.jsx)(su,{}),(0,xe.jsx)(uu,{children:A.text})]},`reasoning-${T.id}-${j}`)),W&&(()=>{let A=L[L.length-1],j=A.type==="reasoning"?{icon:Zn,label:I.reasoning.thinking}:{icon:DR(A.toolName),label:A.title??Kw(A.toolName)};return(0,xe.jsxs)(rR,{isWorking:z&&(t==="streaming"||t==="submitted"),activeStep:j,children:[(0,xe.jsx)(oR,{workingLabel:I.chainOfThought.working,label:I.chainOfThought.done}),(0,xe.jsx)(iR,{children:L.map(($,We)=>{let $e=We===L.length-1;if($.type==="reasoning")return(0,xe.jsx)(sR,{isStreaming:$.state==="streaming",isLast:$e,children:$.text},`reasoning-${T.id}-${We}`);let v=$.title??Kw($.toolName),De=DR($.toolName);if(p==="titles-only")return(0,xe.jsx)(qw,{icon:De,title:v,state:$.state,isLast:$e},$.toolCallId);let _e="output"in $?$.output:void 0;return(0,xe.jsxs)(qw,{icon:De,title:v,state:$.state,isLast:$e,children:[(0,xe.jsx)($w,{input:$.input,debug:f}),_e!==void 0&&(0,xe.jsx)(Xw,{output:_e,errorText:"errorText"in $?$.errorText:void 0,debug:f})]},$.toolCallId)})})]})})(),p!==!1&&!B&&!W&&_.length===1&&(()=>{let A=_[0],j=A.title??Kw(A.toolName);if(p==="titles-only")return(0,xe.jsx)(wR,{title:j,state:A.state});let $="output"in A?A.output:void 0;return(0,xe.jsxs)(gR,{children:[(0,xe.jsx)(yR,{title:j,state:A.state}),(0,xe.jsxs)(xR,{children:[(0,xe.jsx)($w,{input:A.input,debug:f}),$!==void 0&&(0,xe.jsx)(Xw,{output:$,errorText:"errorText"in A?A.errorText:void 0,debug:f})]})]})})(),_.map(A=>{let j="output"in A?A.output:void 0,$=du(A.toolName,j,m),We=SR(A.toolName,j,m),$e=A.toolCallId===d;return $&&o&&j!==void 0?(0,xe.jsx)("div",{style:$e?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:$&&o&&j!==void 0&&(0,xe.jsx)(Ef,{children:(0,xe.jsx)(ER,{isFullscreen:$e,resourceUri:$,toolInput:A.input??{},toolResult:{content:j.content,structuredContent:j.structuredContent,_meta:j._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:We,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?v=>c(v,{toolCallId:A.toolCallId,resourceUri:$,toolInput:A.input??{},toolResult:{content:j.content,structuredContent:j.structuredContent,_meta:j._meta},autoHeight:We}):void 0})})},A.toolCallId):null}),!B&&(0,xe.jsx)("div",{children:(0,xe.jsxs)(Vw,{className:V(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,xe.jsx)(vC,{files:R}),U?S.map((A,j)=>{let $=z&&t==="streaming"&&j===S.length-1;return(0,xe.jsx)(Tf,{isStreaming:$,children:A.type==="text"?A.text:""},`${T.id}-${j}`)}):null]})})]},T.id)}),b&&(0,xe.jsx)(LR,{})]})}var pu=q(ne(),1),o6="https://app.waniwani.ai/assets/waniwani-logo.svg",i6="https://waniwani.ai";function OR(){let{t:e}=Re();return(0,pu.jsxs)("a",{href:i6,target:"_blank",rel:"noopener noreferrer",className:"ww:flex ww:items-center ww:gap-1.5 ww:whitespace-nowrap ww:text-[10px] ww:sm:text-[11px] ww:text-muted-foreground ww:opacity-70 hover:ww:opacity-100 ww:transition-opacity",children:[(0,pu.jsx)("span",{children:e.poweredBy.label}),(0,pu.jsx)("img",{src:o6,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var ol=q(Ie(),1);var Ne=q(ne(),1),PR=20;function l6({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ne.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function s6({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,Ne.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,Ne.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,Ne.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function u6({label:e}){return(0,Ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":e,children:[(0,Ne.jsx)("title",{children:e}),(0,Ne.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,Ne.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,Ne.jsx)("path",{d:"M10 11v6"}),(0,Ne.jsx)("path",{d:"M14 11v6"})]})}function NR({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Re(),[l,s]=(0,ol.useState)(!1),u=(0,ol.useRef)(null);(0,ol.useEffect)(()=>{if(!l)return;let f=p=>{let m=u.current;m&&(p.composedPath().includes(m)||s(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);let c=e.slice(0,PR),d=Math.max(0,e.length-PR);return(0,Ne.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,Ne.jsx)("button",{type:"button",onClick:a,title:i.threadMenu.newChat,"aria-label":i.threadMenu.newChat,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(l6,{label:i.threadMenu.newChat})}),(0,Ne.jsx)("button",{type:"button",onClick:()=>s(f=>!f),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":l,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(s6,{label:i.threadMenu.threadHistory})}),l&&(0,Ne.jsxs)("div",{role:"menu",className:"ww:absolute ww:right-0 ww:top-full ww:mt-1 ww:w-72 ww:max-h-80 ww:overflow-y-auto ww:rounded-lg ww:border ww:border-border ww:bg-background ww:shadow-lg ww:z-50",children:[c.length===0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(f=>{let p=f.threadId===t,m=Date.parse(f.updatedAt);return(0,Ne.jsxs)("div",{className:`ww:flex ww:items-center ww:gap-2 ww:px-3 ww:py-2 ww:text-xs hover:ww:bg-foreground/5 ${p?"ww:bg-foreground/5":""}`,children:[(0,Ne.jsxs)("button",{type:"button",onClick:()=>{n(f.threadId),s(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,Ne.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,Ne.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":pg(m,o)})]}),(0,Ne.jsx)("button",{type:"button",onClick:x=>{x.stopPropagation(),r(f.threadId)},title:i.threadMenu.deleteThread,"aria-label":i.threadMenu.deleteThread,className:"ww:p-1 ww:rounded ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/10 ww:transition-colors ww:cursor-pointer",children:(0,Ne.jsx)(u6,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,Ne.jsx)("div",{className:"ww:px-3 ww:py-2 ww:text-[10px] ww:text-muted-foreground ww:border-t ww:border-border",children:i.threadMenu.hiddenThreads(d)})]})]})}var Af=q(Ie(),1);function Mf(e){let t=new Set;return{subscribe(a){return t.add(a),()=>{t.delete(a)}},emit(a){let{sessionId:n,...r}=a,o=a.name==="session.started"?a.properties.sessionId:void 0,i={...r,mode:e.mode,sessionId:Object.hasOwn(a,"sessionId")?n:o??e.getSessionId?.(),timestamp:Date.now()};for(let l of[...t])try{l(i)}catch(s){console.warn("[Waniwani] onEvent subscriber threw:",s)}}}}function BR(){return{subscribe(){return()=>{}},emit(){}}}var UR=(0,Af.createContext)(BR());function Rf(){return(0,Af.useContext)(UR)}var Df=UR.Provider;var _f=q(Ie(),1);function FR(e){let t=(0,_f.useRef)(e);return t.current=e,(0,_f.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=`${n??"/api/waniwani"}/tool`,s=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...s?{"X-Session-Id":s}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var Ja=q(Ie(),1);var m2="vercel.ai.error",c6=Symbol.for(m2),zR,qR,Ee=class h2 extends(qR=Error,zR=c6,qR){constructor({name:t,message:a,cause:n}){super(a),this[zR]=!0,this.name=t,this.cause=n}static isInstance(t){return h2.hasMarker(t,m2)}static hasMarker(t,a){let n=Symbol.for(a);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}},g2="AI_APICallError",y2=`vercel.ai.error.${g2}`,d6=Symbol.for(y2),HR,jR,Pne=class extends(jR=Ee,HR=d6,jR){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:l=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:g2,message:e,cause:i}),this[HR]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=l,this.data=s}static isInstance(e){return Ee.hasMarker(e,y2)}},w2="AI_EmptyResponseBodyError",x2=`vercel.ai.error.${w2}`,f6=Symbol.for(x2),VR,GR,Nne=class extends(GR=Ee,VR=f6,GR){constructor({message:e="Empty response body"}={}){super({name:w2,message:e}),this[VR]=!0}static isInstance(e){return Ee.hasMarker(e,x2)}};function v2(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var b2="AI_InvalidArgumentError",S2=`vercel.ai.error.${b2}`,p6=Symbol.for(S2),WR,$R,I2=class extends($R=Ee,WR=p6,$R){constructor({message:e,cause:t,argument:a}){super({name:b2,message:e,cause:t}),this[WR]=!0,this.argument=a}static isInstance(e){return Ee.hasMarker(e,S2)}},C2="AI_InvalidPromptError",k2=`vercel.ai.error.${C2}`,m6=Symbol.for(k2),XR,KR,Bne=class extends(KR=Ee,XR=m6,KR){constructor({prompt:e,message:t,cause:a}){super({name:C2,message:`Invalid prompt: ${t}`,cause:a}),this[XR]=!0,this.prompt=e}static isInstance(e){return Ee.hasMarker(e,k2)}},L2="AI_InvalidResponseDataError",T2=`vercel.ai.error.${L2}`,h6=Symbol.for(T2),ZR,YR,Une=class extends(YR=Ee,ZR=h6,YR){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:L2,message:t}),this[ZR]=!0,this.data=e}static isInstance(e){return Ee.hasMarker(e,T2)}},E2="AI_JSONParseError",M2=`vercel.ai.error.${E2}`,g6=Symbol.for(M2),QR,JR,Yw=class extends(JR=Ee,QR=g6,JR){constructor({text:e,cause:t}){super({name:E2,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
+
Error message: ${v2(t)}`,cause:t}),this[QR]=!0,this.text=e}static isInstance(e){return Ee.hasMarker(e,M2)}},A2="AI_LoadAPIKeyError",R2=`vercel.ai.error.${A2}`,y6=Symbol.for(R2),e2,t2,Fne=class extends(t2=Ee,e2=y6,t2){constructor({message:e}){super({name:A2,message:e}),this[e2]=!0}static isInstance(e){return Ee.hasMarker(e,R2)}},D2="AI_LoadSettingError",_2=`vercel.ai.error.${D2}`,w6=Symbol.for(_2),a2,n2,zne=class extends(n2=Ee,a2=w6,n2){constructor({message:e}){super({name:D2,message:e}),this[a2]=!0}static isInstance(e){return Ee.hasMarker(e,_2)}},O2="AI_NoContentGeneratedError",P2=`vercel.ai.error.${O2}`,x6=Symbol.for(P2),r2,o2,qne=class extends(o2=Ee,r2=x6,o2){constructor({message:e="No content generated."}={}){super({name:O2,message:e}),this[r2]=!0}static isInstance(e){return Ee.hasMarker(e,P2)}},N2="AI_NoSuchModelError",B2=`vercel.ai.error.${N2}`,v6=Symbol.for(B2),i2,l2,Hne=class extends(l2=Ee,i2=v6,l2){constructor({errorName:e=N2,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[i2]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return Ee.hasMarker(e,B2)}},U2="AI_TooManyEmbeddingValuesForCallError",F2=`vercel.ai.error.${U2}`,b6=Symbol.for(F2),s2,u2,jne=class extends(u2=Ee,s2=b6,u2){constructor(e){super({name:U2,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[s2]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Ee.hasMarker(e,F2)}},z2="AI_TypeValidationError",q2=`vercel.ai.error.${z2}`,S6=Symbol.for(q2),c2,d2,Ln=class Zw extends(d2=Ee,c2=S6,d2){constructor({value:t,cause:a,context:n}){let r="Type validation failed";if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=" (";let o=[];n.entityName&&o.push(n.entityName),n.entityId&&o.push(`id: "${n.entityId}"`),r+=o.join(", "),r+=")"}super({name:z2,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
125
|
+
Error message: ${v2(a)}`,cause:a}),this[c2]=!0,this.value=t,this.context=n}static isInstance(t){return Ee.hasMarker(t,q2)}static wrap({value:t,cause:a,context:n}){var r,o,i;return Zw.isInstance(a)&&a.value===t&&((r=a.context)==null?void 0:r.field)===n?.field&&((o=a.context)==null?void 0:o.entityName)===n?.entityName&&((i=a.context)==null?void 0:i.entityId)===n?.entityId?a:new Zw({value:t,cause:a,context:n})}},H2="AI_UnsupportedFunctionalityError",j2=`vercel.ai.error.${H2}`,I6=Symbol.for(j2),f2,p2,Vne=class extends(p2=Ee,f2=I6,p2){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:H2,message:t}),this[f2]=!0,this.functionality=e}static isInstance(e){return Ee.hasMarker(e,j2)}};var Of=()=>Jw,Jw=new Proxy(Of,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Of},apply(){return Jw}}),Qw=class extends Error{constructor(){super(...arguments);Q(this,"issues",[])}},h=new Proxy(Of,{get(e,t){return t==="ZodError"?Qw:t==="NEVER"?Symbol("NEVER"):Of},apply(){return Jw}});var ue={};var Pf=class extends Error{constructor(t,a){super(t),this.name="ParseError",this.type=a.type,this.field=a.field,this.value=a.value,this.line=a.line}};function ex(e){}function V2(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=ex,onError:a=ex,onRetry:n=ex,onComment:r}=e,o="",i=!0,l,s="",u="";function c(x){let I=i?x.replace(/^\xEF\xBB\xBF/,""):x,[y,w]=C6(`${o}${I}`);for(let g of y)d(g);o=w,i=!1}function d(x){if(x===""){p();return}if(x.startsWith(":")){r&&r(x.slice(x.startsWith(": ")?2:1));return}let I=x.indexOf(":");if(I!==-1){let y=x.slice(0,I),w=x[I+1]===" "?2:1,g=x.slice(I+w);f(y,g,x);return}f(x,"",x)}function f(x,I,y){switch(x){case"event":u=I;break;case"data":s=`${s}${I}
|
|
126
|
+
`;break;case"id":l=I.includes("\0")?void 0:I;break;case"retry":/^\d+$/.test(I)?n(parseInt(I,10)):a(new Pf(`Invalid \`retry\` value: "${I}"`,{type:"invalid-retry",value:I,line:y}));break;default:a(new Pf(`Unknown field "${x.length>20?`${x.slice(0,20)}\u2026`:x}"`,{type:"unknown-field",field:x,value:I,line:y}));break}}function p(){s.length>0&&t({id:l,event:u||void 0,data:s.endsWith(`
|
|
127
|
+
`)?s.slice(0,-1):s}),l=void 0,s="",u=""}function m(x={}){o&&x.consume&&d(o),i=!0,l=void 0,s="",u="",o=""}return{feed:c,reset:m}}function C6(e){let t=[],a="",n=0;for(;n<e.length;){let r=e.indexOf("\r",n),o=e.indexOf(`
|
|
128
128
|
`,n),i=-1;if(r!==-1&&o!==-1?i=Math.min(r,o):r!==-1?r===e.length-1?i=-1:i=r:o!==-1&&(i=o),i===-1){a=e.slice(n);break}else{let l=e.slice(n,i);t.push(l),n=i+1,e[n-1]==="\r"&&e[n]===`
|
|
129
|
-
`&&n++}}return[t,a]}var Df=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=_2({onEvent:i=>{o.enqueue(i)},onError(i){t==="terminate"?o.error(i):typeof t=="function"&&t(i)},onRetry:a,onComment:n})},transform(o){r.feed(o)}})}};var{btoa:One,atob:Pne}=globalThis;var F2="AI_DownloadError",z2=`vercel.ai.error.${F2}`,u6=Symbol.for(z2),O2,P2,Qa=class extends(P2=Ee,O2=u6,P2){constructor({url:e,statusCode:t,statusText:a,cause:n,message:r=n==null?`Failed to download ${e}: ${t} ${a}`:`Failed to download ${e}: ${n}`}){super({name:F2,message:r,cause:n}),this[O2]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Ee.hasMarker(e,z2)}},Jw=2*1024*1024*1024;async function q2({response:e,url:t,maxBytes:a=Jw}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new Qa({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes (Content-Length: ${c}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let o=r.getReader(),i=[],l=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(l+=d.length,l>a)throw new Qa({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let s=new Uint8Array(l),u=0;for(let c of i)s.set(c,u),u+=c.length;return s}function ex(e){let t;try{t=new URL(e)}catch{throw new Qa({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Qa({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new Qa({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new Qa({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(c6(n))throw new Qa({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(H2(a)){if(Zw(a))throw new Qa({url:e,message:`URL with IP address ${a} is not allowed`});return}}function H2(e){let t=e.split(".");return t.length!==4?!1:t.every(a=>{let n=Number(a);return Number.isInteger(n)&&n>=0&&n<=255&&String(n)===a})}function Zw(e){let t=e.split(".").map(Number),[a,n]=t;return a===0||a===10||a===127||a===169&&n===254||a===172&&n>=16&&n<=31||a===192&&n===168}function c6(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(H2(a))return Zw(a);let n=a.split(":");if(n.length===2){let r=parseInt(n[0],16),o=parseInt(n[1],16);if(!isNaN(r)&&!isNaN(o)){let i=r>>8&255,l=r&255,s=o>>8&255,u=o&255;return Zw(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var ir=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let l=0;l<t;l++)i[l]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new f2({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},j2=ir();function V2(e=globalThis){var t,a,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(a=e.process)==null?void 0:a.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Zr(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((a,n)=>{t[n.toLowerCase()]=a});else{Array.isArray(e)||(e=Object.entries(e));for(let[a,n]of e)n!=null&&(t[a.toLowerCase()]=n)}return t}function _f(e,...t){let a=new Headers(Zr(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var d6=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,f6=/"(?: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 N2(e){let t=JSON.parse(e);return t===null||typeof t!="object"||d6.test(e)===!1&&f6.test(e)===!1?t:p6(t)}function p6(e){let t=[e];for(;t.length;){let a=t;t=[];for(let n of a){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in n){let o=n[r];o&&typeof o=="object"&&t.push(o)}}}return e}function m6(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return N2(e)}try{return N2(e)}finally{Error.stackTraceLimit=t}}function tx(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:a}=e;if(a!=null)for(let n of Object.keys(a))a[n]=Vo(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Vo):Vo(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Vo)),e.allOf!=null&&(e.allOf=e.allOf.map(Vo)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Vo));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Vo(t[a]);return e}function Vo(e){return typeof e=="boolean"?e:tx(e)}var h6=Symbol("Let zodToJsonSchema decide on which parser to use"),B2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},g6=e=>typeof e=="string"?{...B2,name:e}:{...B2,...e};function Oa(){return{}}function y6(e,t){var a,n,r;let o={type:"array"};return(a=e.type)!=null&&a._def&&((r=(n=e.type)==null?void 0:n._def)==null?void 0:r.typeName)!==se.ZodAny&&(o.items=je(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function w6(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function x6(){return{type:"boolean"}}function G2(e,t){return je(e.type._def,t)}var v6=(e,t)=>je(e.innerType._def,t);function W2(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>W2(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return b6(e)}}var b6=e=>{let t={type:"integer",format:"unix-time"};for(let a of e.checks)switch(a.kind){case"min":t.minimum=a.value;break;case"max":t.maximum=a.value;break}return t};function S6(e,t){return{...je(e.innerType._def,t),default:e.defaultValue()}}function I6(e,t){return t.effectStrategy==="input"?je(e.schema._def,t):Oa()}function C6(e){return{type:"string",enum:Array.from(e.values)}}var k6=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function L6(e,t){let a=[je(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),je(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(k6(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...l}=r;o=l}n.push(o)}}),n.length?{allOf:n}:void 0}function T6(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Xw=void 0,cn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Xw===void 0&&(Xw=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Xw),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function $2(e,t){let a={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":dn(a,"email",n.message,t);break;case"format:idn-email":dn(a,"idn-email",n.message,t);break;case"pattern:zod":la(a,cn.email,n.message,t);break}break;case"url":dn(a,"uri",n.message,t);break;case"uuid":dn(a,"uuid",n.message,t);break;case"regex":la(a,n.regex,n.message,t);break;case"cuid":la(a,cn.cuid,n.message,t);break;case"cuid2":la(a,cn.cuid2,n.message,t);break;case"startsWith":la(a,RegExp(`^${Kw(n.value,t)}`),n.message,t);break;case"endsWith":la(a,RegExp(`${Kw(n.value,t)}$`),n.message,t);break;case"datetime":dn(a,"date-time",n.message,t);break;case"date":dn(a,"date",n.message,t);break;case"time":dn(a,"time",n.message,t);break;case"duration":dn(a,"duration",n.message,t);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"includes":{la(a,RegExp(Kw(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&dn(a,"ipv4",n.message,t),n.version!=="v4"&&dn(a,"ipv6",n.message,t);break}case"base64url":la(a,cn.base64url,n.message,t);break;case"jwt":la(a,cn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&la(a,cn.ipv4Cidr,n.message,t),n.version!=="v4"&&la(a,cn.ipv6Cidr,n.message,t);break}case"emoji":la(a,cn.emoji(),n.message,t);break;case"ulid":{la(a,cn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{dn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{la(a,cn.base64,n.message,t);break}}break}case"nanoid":la(a,cn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Kw(e,t){return t.patternStrategy==="escape"?M6(e):e}var E6=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function M6(e){let t="";for(let a=0;a<e.length;a++)E6.has(e[a])||(t+="\\"),t+=e[a];return t}function dn(e,t,a,n){var r;e.format||(r=e.anyOf)!=null&&r.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):e.format=t}function la(e,t,a,n){var r;e.pattern||(r=e.allOf)!=null&&r.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:U2(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=U2(t,n)}function U2(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",i=!1,l=!1,s=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(l){if(r[u].match(/[a-z]/)){s?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),s=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],s=!0):o+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){o+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(n.m){if(r[u]==="^"){o+=`(^|(?<=[\r
|
|
129
|
+
`&&n++}}return[t,a]}var Nf=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=V2({onEvent:i=>{o.enqueue(i)},onError(i){t==="terminate"?o.error(i):typeof t=="function"&&t(i)},onRetry:a,onComment:n})},transform(o){r.feed(o)}})}};var{btoa:sre,atob:ure}=globalThis;var Z2="AI_DownloadError",Y2=`vercel.ai.error.${Z2}`,k6=Symbol.for(Y2),G2,W2,Ya=class extends(W2=Ee,G2=k6,W2){constructor({url:e,statusCode:t,statusText:a,cause:n,message:r=n==null?`Failed to download ${e}: ${t} ${a}`:`Failed to download ${e}: ${n}`}){super({name:Z2,message:r,cause:n}),this[G2]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Ee.hasMarker(e,Y2)}},ix=2*1024*1024*1024;async function Q2({response:e,url:t,maxBytes:a=ix}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new Ya({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes (Content-Length: ${c}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let o=r.getReader(),i=[],l=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(l+=d.length,l>a)throw new Ya({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let s=new Uint8Array(l),u=0;for(let c of i)s.set(c,u),u+=c.length;return s}function lx(e){let t;try{t=new URL(e)}catch{throw new Ya({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Ya({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new Ya({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new Ya({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(L6(n))throw new Ya({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(J2(a)){if(nx(a))throw new Ya({url:e,message:`URL with IP address ${a} is not allowed`});return}}function J2(e){let t=e.split(".");return t.length!==4?!1:t.every(a=>{let n=Number(a);return Number.isInteger(n)&&n>=0&&n<=255&&String(n)===a})}function nx(e){let t=e.split(".").map(Number),[a,n]=t;return a===0||a===10||a===127||a===169&&n===254||a===172&&n>=16&&n<=31||a===192&&n===168}function L6(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(J2(a))return nx(a);let n=a.split(":");if(n.length===2){let r=parseInt(n[0],16),o=parseInt(n[1],16);if(!isNaN(r)&&!isNaN(o)){let i=r>>8&255,l=r&255,s=o>>8&255,u=o&255;return nx(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var ir=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let l=0;l<t;l++)i[l]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new I2({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},eD=ir();function tD(e=globalThis){var t,a,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(a=e.process)==null?void 0:a.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Zr(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((a,n)=>{t[n.toLowerCase()]=a});else{Array.isArray(e)||(e=Object.entries(e));for(let[a,n]of e)n!=null&&(t[a.toLowerCase()]=n)}return t}function Bf(e,...t){let a=new Headers(Zr(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var T6=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,E6=/"(?: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 $2(e){let t=JSON.parse(e);return t===null||typeof t!="object"||T6.test(e)===!1&&E6.test(e)===!1?t:M6(t)}function M6(e){let t=[e];for(;t.length;){let a=t;t=[];for(let n of a){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in n){let o=n[r];o&&typeof o=="object"&&t.push(o)}}}return e}function A6(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return $2(e)}try{return $2(e)}finally{Error.stackTraceLimit=t}}function sx(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:a}=e;if(a!=null)for(let n of Object.keys(a))a[n]=Go(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Go):Go(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Go)),e.allOf!=null&&(e.allOf=e.allOf.map(Go)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Go));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Go(t[a]);return e}function Go(e){return typeof e=="boolean"?e:sx(e)}var R6=Symbol("Let zodToJsonSchema decide on which parser to use"),X2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},D6=e=>typeof e=="string"?{...X2,name:e}:{...X2,...e};function Pa(){return{}}function _6(e,t){var a,n,r;let o={type:"array"};return(a=e.type)!=null&&a._def&&((r=(n=e.type)==null?void 0:n._def)==null?void 0:r.typeName)!==ue.ZodAny&&(o.items=je(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function O6(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function P6(){return{type:"boolean"}}function aD(e,t){return je(e.type._def,t)}var N6=(e,t)=>je(e.innerType._def,t);function nD(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>nD(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return B6(e)}}var B6=e=>{let t={type:"integer",format:"unix-time"};for(let a of e.checks)switch(a.kind){case"min":t.minimum=a.value;break;case"max":t.maximum=a.value;break}return t};function U6(e,t){return{...je(e.innerType._def,t),default:e.defaultValue()}}function F6(e,t){return t.effectStrategy==="input"?je(e.schema._def,t):Pa()}function z6(e){return{type:"string",enum:Array.from(e.values)}}var q6=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function H6(e,t){let a=[je(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),je(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(q6(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...l}=r;o=l}n.push(o)}}),n.length?{allOf:n}:void 0}function j6(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var tx=void 0,dn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(tx===void 0&&(tx=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tx),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function rD(e,t){let a={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":fn(a,"email",n.message,t);break;case"format:idn-email":fn(a,"idn-email",n.message,t);break;case"pattern:zod":la(a,dn.email,n.message,t);break}break;case"url":fn(a,"uri",n.message,t);break;case"uuid":fn(a,"uuid",n.message,t);break;case"regex":la(a,n.regex,n.message,t);break;case"cuid":la(a,dn.cuid,n.message,t);break;case"cuid2":la(a,dn.cuid2,n.message,t);break;case"startsWith":la(a,RegExp(`^${ax(n.value,t)}`),n.message,t);break;case"endsWith":la(a,RegExp(`${ax(n.value,t)}$`),n.message,t);break;case"datetime":fn(a,"date-time",n.message,t);break;case"date":fn(a,"date",n.message,t);break;case"time":fn(a,"time",n.message,t);break;case"duration":fn(a,"duration",n.message,t);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value;break;case"includes":{la(a,RegExp(ax(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&fn(a,"ipv4",n.message,t),n.version!=="v4"&&fn(a,"ipv6",n.message,t);break}case"base64url":la(a,dn.base64url,n.message,t);break;case"jwt":la(a,dn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&la(a,dn.ipv4Cidr,n.message,t),n.version!=="v4"&&la(a,dn.ipv6Cidr,n.message,t);break}case"emoji":la(a,dn.emoji(),n.message,t);break;case"ulid":{la(a,dn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{fn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{la(a,dn.base64,n.message,t);break}}break}case"nanoid":la(a,dn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function ax(e,t){return t.patternStrategy==="escape"?G6(e):e}var V6=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function G6(e){let t="";for(let a=0;a<e.length;a++)V6.has(e[a])||(t+="\\"),t+=e[a];return t}function fn(e,t,a,n){var r;e.format||(r=e.anyOf)!=null&&r.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):e.format=t}function la(e,t,a,n){var r;e.pattern||(r=e.allOf)!=null&&r.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:K2(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=K2(t,n)}function K2(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",i=!1,l=!1,s=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(l){if(r[u].match(/[a-z]/)){s?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),s=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],s=!0):o+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){o+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(n.m){if(r[u]==="^"){o+=`(^|(?<=[\r
|
|
130
130
|
]))`;continue}else if(r[u]==="$"){o+=`($|(?=[\r
|
|
131
131
|
]))`;continue}}if(n.s&&r[u]==="."){o+=l?`${r[u]}\r
|
|
132
132
|
`:`[${r[u]}\r
|
|
133
|
-
]`;continue}o+=r[u],r[u]==="\\"?i=!0:l&&r[u]==="]"?l=!1:!l&&r[u]==="["&&(l=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function X2(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===se.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=$2(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===se.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===se.ZodBranded&&e.keyType._def.type._def.typeName===se.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=G2(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function A6(e,t){if(t.mapStrategy==="record")return X2(e,t);let a=je(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Oa(),n=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Oa();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function R6(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function D6(){return{not:Oa()}}function _6(){return{type:"null"}}var Qw={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function O6(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Qw&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Qw[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return P6(e,t)}var P6=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>je(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function N6(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Qw[e.innerType._def.typeName],"null"]};let a=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function B6(e){let t={type:"number"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"int":t.type="integer";break;case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function U6(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let l=r[i];if(l===void 0||l._def===void 0)continue;let s=z6(l),u=je(l._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,s||n.push(i))}n.length&&(a.required=n);let o=F6(e,t);return o!==void 0&&(a.additionalProperties=o),a}function F6(e,t){if(e.catchall._def.typeName!=="ZodNever")return je(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function z6(e){try{return e.isOptional()}catch{return!0}}var q6=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return je(e.innerType._def,t);let n=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Oa()},n]}:Oa()},H6=(e,t)=>{if(t.pipeStrategy==="input")return je(e.in._def,t);if(t.pipeStrategy==="output")return je(e.out._def,t);let a=je(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=je(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function j6(e,t){return je(e.type._def,t)}function V6(e,t){let n={type:"array",uniqueItems:!0,items:je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function G6(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:je(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function W6(){return{not:Oa()}}function $6(){return Oa()}var X6=(e,t)=>je(e.innerType._def,t),K6=(e,t,a)=>{switch(t){case se.ZodString:return $2(e,a);case se.ZodNumber:return B6(e);case se.ZodObject:return U6(e,a);case se.ZodBigInt:return w6(e);case se.ZodBoolean:return x6();case se.ZodDate:return W2(e,a);case se.ZodUndefined:return W6();case se.ZodNull:return _6();case se.ZodArray:return y6(e,a);case se.ZodUnion:case se.ZodDiscriminatedUnion:return O6(e,a);case se.ZodIntersection:return L6(e,a);case se.ZodTuple:return G6(e,a);case se.ZodRecord:return X2(e,a);case se.ZodLiteral:return T6(e);case se.ZodEnum:return C6(e);case se.ZodNativeEnum:return R6(e);case se.ZodNullable:return N6(e,a);case se.ZodOptional:return q6(e,a);case se.ZodMap:return A6(e,a);case se.ZodSet:return V6(e,a);case se.ZodLazy:return()=>e.getter()._def;case se.ZodPromise:return j6(e,a);case se.ZodNaN:case se.ZodNever:return D6();case se.ZodEffects:return I6(e,a);case se.ZodAny:return Oa();case se.ZodUnknown:return $6();case se.ZodDefault:return S6(e,a);case se.ZodBranded:return G2(e,a);case se.ZodReadonly:return X6(e,a);case se.ZodCatch:return v6(e,a);case se.ZodPipeline:return H6(e,a);case se.ZodFunction:case se.ZodVoid:case se.ZodSymbol:return;default:return(n=>{})(t)}},Z6=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function je(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let s=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(s!==h6)return s}if(r&&!a){let s=Q6(r,t);if(s!==void 0)return s}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=K6(e,e.typeName,t),l=typeof i=="function"?je(i(),t):i;if(l&&Y6(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var Q6=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Z6(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Oa()):t.$refStrategy==="seen"?Oa():void 0}},Y6=(e,t,a)=>(e.description&&(a.description=e.description),a),J6=e=>{let t=g6(e),a=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},eH=(e,t)=>{var a;let n=J6(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=je(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Oa()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=je(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Oa(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(i.title=l);let s=o===void 0?r?{...i,[n.definitionPath]:r}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s},Yw=Symbol.for("vercel.ai.schema");function Of(e){let t;return()=>(t==null&&(t=e()),t)}function Pf(e,{validate:t}={}){return{[Yw]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function tH(e){return typeof e=="object"&&e!==null&&Yw in e&&e[Yw]===!0&&"jsonSchema"in e&&"validate"in e}function Nf(e){return e==null?Pf({properties:{},additionalProperties:!1}):tH(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?pu(e):aH(e):e()}function aH(e){return Pf(()=>tx(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let a=await e["~standard"].validate(t);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new kn({value:t,cause:a.issues})}}})}function nH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Pf(()=>eH(e,{$refStrategy:n?"root":"none"}),{validate:async r=>{let o=await e.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function rH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Pf(()=>tx((void 0)(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async r=>{let o=await(void 0)(e,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function oH(e){return"_zod"in e}function pu(e,t){return oH(e)?rH(e,t):nH(e,t)}async function Bf({value:e,schema:t,context:a}){let n=await rl({value:e,schema:t,context:a});if(!n.success)throw kn.wrap({value:e,cause:n.error,context:a});return n.value}async function rl({value:e,schema:t,context:a}){let n=Nf(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:kn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:kn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function lr({text:e,schema:t}){try{let a=m6(e);return t==null?{success:!0,value:a,rawValue:a}:await rl({value:a,schema:t})}catch(a){return{success:!1,error:Vw.isInstance(a)?a:new Vw({text:e,cause:a}),rawValue:void 0}}}function K2({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Df).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await lr({text:a,schema:t}))}}))}async function Ln(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var lH=Object.defineProperty,sH=(e,t)=>{for(var a in t)lH(e,a,{get:t[a],enumerable:!0})},uH="AI_InvalidArgumentError",cH=`vercel.ai.error.${uH}`,dH=Symbol.for(cH),fH;fH=dH;var pH="AI_InvalidStreamPartError",mH=`vercel.ai.error.${pH}`,hH=Symbol.for(mH),gH;gH=hH;var yH="AI_InvalidToolApprovalError",wH=`vercel.ai.error.${yH}`,xH=Symbol.for(wH),vH;vH=xH;var bH="AI_InvalidToolInputError",SH=`vercel.ai.error.${bH}`,IH=Symbol.for(SH),CH;CH=IH;var kH="AI_ToolCallNotFoundForApprovalError",LH=`vercel.ai.error.${kH}`,TH=Symbol.for(LH),EH;EH=TH;var MH="AI_MissingToolResultsError",AH=`vercel.ai.error.${MH}`,RH=Symbol.for(AH),DH;DH=RH;var _H="AI_NoImageGeneratedError",OH=`vercel.ai.error.${_H}`,PH=Symbol.for(OH),NH;NH=PH;var Q2="AI_NoObjectGeneratedError",Y2=`vercel.ai.error.${Q2}`,BH=Symbol.for(Y2),J2,Qr=class extends Ee{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:Q2,message:e,cause:t}),this[J2]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Ee.hasMarker(e,Y2)}};J2=BH;var UH="AI_NoOutputGeneratedError",FH=`vercel.ai.error.${UH}`,zH=Symbol.for(FH),qH;qH=zH;var HH="AI_NoSpeechGeneratedError",jH=`vercel.ai.error.${HH}`,VH=Symbol.for(jH),GH;GH=VH;var WH="AI_NoTranscriptGeneratedError",$H=`vercel.ai.error.${WH}`,XH=Symbol.for($H),KH;KH=XH;var ZH="AI_NoVideoGeneratedError",QH=`vercel.ai.error.${ZH}`,YH=Symbol.for(QH),JH;JH=YH;var e9="AI_NoSuchToolError",t9=`vercel.ai.error.${e9}`,a9=Symbol.for(t9),n9;n9=a9;var r9="AI_ToolCallRepairError",o9=`vercel.ai.error.${r9}`,i9=Symbol.for(o9),l9;l9=i9;var eD="AI_UIMessageStreamError",tD=`vercel.ai.error.${eD}`,s9=Symbol.for(tD),aD,ol=class extends Ee{constructor({chunkType:e,chunkId:t,message:a}){super({name:eD,message:a}),this[aD]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Ee.hasMarker(e,tD)}};aD=s9;var u9="AI_InvalidDataContentError",c9=`vercel.ai.error.${u9}`,d9=Symbol.for(c9),f9;f9=d9;var p9="AI_InvalidMessageRoleError",m9=`vercel.ai.error.${p9}`,h9=Symbol.for(m9),g9;g9=h9;var y9="AI_MessageConversionError",w9=`vercel.ai.error.${y9}`,x9=Symbol.for(w9),v9;v9=x9;var b9="AI_RetryError",S9=`vercel.ai.error.${b9}`,I9=Symbol.for(S9),C9;C9=I9;var k9="6.0.141",L9=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();ex(r);try{let o=await fetch(r,{headers:_f({},`ai-sdk/${k9}`,V2()),signal:a});if(o.redirected&&ex(o.url),!o.ok)throw new Qa({url:r,statusCode:o.status,statusText:o.statusText});return{data:await q2({response:o,url:r,maxBytes:t??Jw}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw Qa.isInstance(o)?o:new Qa({url:r,cause:o})}};var nD=h.union([h.string(),h.instanceof(Uint8Array),h.instanceof(ArrayBuffer),h.custom(e=>{var t,a;return(a=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?a:!1},{message:"Must be a Buffer"})]);var mu=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),mu.optional()),h.array(mu)])),Z=h.record(h.string(),h.record(h.string(),mu.optional())),rD=h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),T9=h.object({type:h.literal("image"),image:h.union([nD,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:Z.optional()}),oD=h.object({type:h.literal("file"),data:h.union([nD,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:Z.optional()}),E9=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:Z.optional()}),M9=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:Z.optional(),providerExecuted:h.boolean().optional()}),A9=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("json"),value:mu,providerOptions:Z.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("error-json"),value:mu,providerOptions:Z.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("media"),data:h.string(),mediaType:h.string()}),h.object({type:h.literal("file-data"),data:h.string(),mediaType:h.string(),filename:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("custom"),providerOptions:Z.optional()})]))})]),iD=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:A9,providerOptions:Z.optional()}),R9=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),D9=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),_9=h.object({role:h.literal("system"),content:h.string(),providerOptions:Z.optional()}),O9=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([rD,T9,oD]))]),providerOptions:Z.optional()}),P9=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([rD,oD,E9,M9,iD,R9]))]),providerOptions:Z.optional()}),N9=h.object({role:h.literal("tool"),content:h.array(h.union([iD,D9])),providerOptions:Z.optional()}),ire=h.union([_9,O9,P9,N9]);function lD(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let a={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(r===void 0)continue;let o=n in e?e[n]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&l?a[n]=lD(o,r):a[n]=r}return a}var B9={};sH(B9,{array:()=>q9,choice:()=>H9,json:()=>j9,object:()=>z9,text:()=>F9});function U9(e){let t=["ROOT"],a=-1,n=null;function r(s,u,c){switch(s){case'"':{a=u,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=u,n=u,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=u,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{a=u,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{a=u,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function o(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let s=0;s<e.length;s++){let u=e[s];switch(t[t.length-1]){case"ROOT":r(u,s,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=s,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,s,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,s);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=s;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=s}break}case"INSIDE_ARRAY_START":{u==="]"?(a=s,t.pop()):(a=s,r(u,s,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=s,t.pop();break}default:{a=s;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,s,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=s;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=s;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,s+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,s):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s)):a=s;break}}}let l=e.slice(0,a+1);for(let s=t.length-1;s>=0;s--)switch(t[s]){case"INSIDE_STRING":{l+='"';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":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?l+="true".slice(c.length):"false".startsWith(c)?l+="false".slice(c.length):"null".startsWith(c)&&(l+="null".slice(c.length))}}return l}async function hu(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await lr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await lr({text:U9(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var F9=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),z9=({schema:e,name:t,description:a})=>{let n=Nf(e);return{name:"object",responseFormat:Ln(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Qr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=await rl({value:i.value,schema:n});if(!l.success)throw new Qr({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return l.value},async parsePartialOutput({text:r}){let o=await hu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},q9=({element:e,name:t,description:a})=>{let n=Nf(e);return{name:"array",responseFormat:Ln(n.jsonSchema).then(r=>{let{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Qr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=i.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new Qr({message:"No object generated: response did not match schema.",cause:new kn({value:l,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let s of l.elements){let u=await rl({value:s,schema:n});if(!u.success)throw new Qr({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return l.elements},async parsePartialOutput({text:r}){let o=await hu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;let l=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,s=[];for(let u of l){let c=await rl({value:u,schema:n});c.success&&s.push(c.value)}return{partial:s}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},H9=({options:e,name:t,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}),async parseCompleteOutput({text:n},r){let o=await lr({text:n});if(!o.success)throw new Qr({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});let i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!e.includes(i.result))throw new Qr({message:"No object generated: response did not match schema.",cause:new kn({value:i,cause:"response must be an object that contains a choice value."}),text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:n}){let r=await hu(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;let i=e.filter(l=>l.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),j9=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:a},n){let r=await lr({text:a});if(!r.success)throw new Qr({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.value},async parsePartialOutput({text:a}){let n=await hu(a);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});var cre=ir({prefix:"aitxt",size:24});var fre=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
133
|
+
]`;continue}o+=r[u],r[u]==="\\"?i=!0:l&&r[u]==="]"?l=!1:!l&&r[u]==="["&&(l=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function oD(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ue.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=rD(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ue.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ue.ZodBranded&&e.keyType._def.type._def.typeName===ue.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=aD(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function W6(e,t){if(t.mapStrategy==="record")return oD(e,t);let a=je(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Pa(),n=je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Pa();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function $6(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function X6(){return{not:Pa()}}function K6(){return{type:"null"}}var rx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Z6(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in rx&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=rx[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return Y6(e,t)}var Y6=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>je(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function Q6(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[rx[e.innerType._def.typeName],"null"]};let a=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function J6(e){let t={type:"number"};if(!e.checks)return t;for(let a of e.checks)switch(a.kind){case"int":t.type="integer";break;case"min":a.inclusive?t.minimum=a.value:t.exclusiveMinimum=a.value;break;case"max":a.inclusive?t.maximum=a.value:t.exclusiveMaximum=a.value;break;case"multipleOf":t.multipleOf=a.value;break}return t}function eH(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let l=r[i];if(l===void 0||l._def===void 0)continue;let s=aH(l),u=je(l._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,s||n.push(i))}n.length&&(a.required=n);let o=tH(e,t);return o!==void 0&&(a.additionalProperties=o),a}function tH(e,t){if(e.catchall._def.typeName!=="ZodNever")return je(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function aH(e){try{return e.isOptional()}catch{return!0}}var nH=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return je(e.innerType._def,t);let n=je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Pa()},n]}:Pa()},rH=(e,t)=>{if(t.pipeStrategy==="input")return je(e.in._def,t);if(t.pipeStrategy==="output")return je(e.out._def,t);let a=je(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=je(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function oH(e,t){return je(e.type._def,t)}function iH(e,t){let n={type:"array",uniqueItems:!0,items:je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function lH(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:je(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>je(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function sH(){return{not:Pa()}}function uH(){return Pa()}var cH=(e,t)=>je(e.innerType._def,t),dH=(e,t,a)=>{switch(t){case ue.ZodString:return rD(e,a);case ue.ZodNumber:return J6(e);case ue.ZodObject:return eH(e,a);case ue.ZodBigInt:return O6(e);case ue.ZodBoolean:return P6();case ue.ZodDate:return nD(e,a);case ue.ZodUndefined:return sH();case ue.ZodNull:return K6();case ue.ZodArray:return _6(e,a);case ue.ZodUnion:case ue.ZodDiscriminatedUnion:return Z6(e,a);case ue.ZodIntersection:return H6(e,a);case ue.ZodTuple:return lH(e,a);case ue.ZodRecord:return oD(e,a);case ue.ZodLiteral:return j6(e);case ue.ZodEnum:return z6(e);case ue.ZodNativeEnum:return $6(e);case ue.ZodNullable:return Q6(e,a);case ue.ZodOptional:return nH(e,a);case ue.ZodMap:return W6(e,a);case ue.ZodSet:return iH(e,a);case ue.ZodLazy:return()=>e.getter()._def;case ue.ZodPromise:return oH(e,a);case ue.ZodNaN:case ue.ZodNever:return X6();case ue.ZodEffects:return F6(e,a);case ue.ZodAny:return Pa();case ue.ZodUnknown:return uH();case ue.ZodDefault:return U6(e,a);case ue.ZodBranded:return aD(e,a);case ue.ZodReadonly:return cH(e,a);case ue.ZodCatch:return N6(e,a);case ue.ZodPipeline:return rH(e,a);case ue.ZodFunction:case ue.ZodVoid:case ue.ZodSymbol:return;default:return(n=>{})(t)}},fH=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function je(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let s=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(s!==R6)return s}if(r&&!a){let s=pH(r,t);if(s!==void 0)return s}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=dH(e,e.typeName,t),l=typeof i=="function"?je(i(),t):i;if(l&&mH(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var pH=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:fH(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Pa()):t.$refStrategy==="seen"?Pa():void 0}},mH=(e,t,a)=>(e.description&&(a.description=e.description),a),hH=e=>{let t=D6(e),a=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},gH=(e,t)=>{var a;let n=hH(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=je(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Pa()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=je(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Pa(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(i.title=l);let s=o===void 0?r?{...i,[n.definitionPath]:r}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s},ox=Symbol.for("vercel.ai.schema");function Uf(e){let t;return()=>(t==null&&(t=e()),t)}function Ff(e,{validate:t}={}){return{[ox]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function yH(e){return typeof e=="object"&&e!==null&&ox in e&&e[ox]===!0&&"jsonSchema"in e&&"validate"in e}function zf(e){return e==null?Ff({properties:{},additionalProperties:!1}):yH(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?hu(e):wH(e):e()}function wH(e){return Ff(()=>sx(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let a=await e["~standard"].validate(t);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new Ln({value:t,cause:a.issues})}}})}function xH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ff(()=>gH(e,{$refStrategy:n?"root":"none"}),{validate:async r=>{let o=await e.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function vH(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ff(()=>sx((void 0)(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async r=>{let o=await(void 0)(e,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function bH(e){return"_zod"in e}function hu(e,t){return bH(e)?vH(e,t):xH(e,t)}async function qf({value:e,schema:t,context:a}){let n=await il({value:e,schema:t,context:a});if(!n.success)throw Ln.wrap({value:e,cause:n.error,context:a});return n.value}async function il({value:e,schema:t,context:a}){let n=zf(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:Ln.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:Ln.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function lr({text:e,schema:t}){try{let a=A6(e);return t==null?{success:!0,value:a,rawValue:a}:await il({value:a,schema:t})}catch(a){return{success:!1,error:Yw.isInstance(a)?a:new Yw({text:e,cause:a}),rawValue:void 0}}}function iD({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Nf).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await lr({text:a,schema:t}))}}))}async function Tn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var IH=Object.defineProperty,CH=(e,t)=>{for(var a in t)IH(e,a,{get:t[a],enumerable:!0})},kH="AI_InvalidArgumentError",LH=`vercel.ai.error.${kH}`,TH=Symbol.for(LH),EH;EH=TH;var MH="AI_InvalidStreamPartError",AH=`vercel.ai.error.${MH}`,RH=Symbol.for(AH),DH;DH=RH;var _H="AI_InvalidToolApprovalError",OH=`vercel.ai.error.${_H}`,PH=Symbol.for(OH),NH;NH=PH;var BH="AI_InvalidToolInputError",UH=`vercel.ai.error.${BH}`,FH=Symbol.for(UH),zH;zH=FH;var qH="AI_ToolCallNotFoundForApprovalError",HH=`vercel.ai.error.${qH}`,jH=Symbol.for(HH),VH;VH=jH;var GH="AI_MissingToolResultsError",WH=`vercel.ai.error.${GH}`,$H=Symbol.for(WH),XH;XH=$H;var KH="AI_NoImageGeneratedError",ZH=`vercel.ai.error.${KH}`,YH=Symbol.for(ZH),QH;QH=YH;var sD="AI_NoObjectGeneratedError",uD=`vercel.ai.error.${sD}`,JH=Symbol.for(uD),cD,Yr=class extends Ee{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:sD,message:e,cause:t}),this[cD]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Ee.hasMarker(e,uD)}};cD=JH;var e9="AI_NoOutputGeneratedError",t9=`vercel.ai.error.${e9}`,a9=Symbol.for(t9),n9;n9=a9;var r9="AI_NoSpeechGeneratedError",o9=`vercel.ai.error.${r9}`,i9=Symbol.for(o9),l9;l9=i9;var s9="AI_NoTranscriptGeneratedError",u9=`vercel.ai.error.${s9}`,c9=Symbol.for(u9),d9;d9=c9;var f9="AI_NoVideoGeneratedError",p9=`vercel.ai.error.${f9}`,m9=Symbol.for(p9),h9;h9=m9;var g9="AI_NoSuchToolError",y9=`vercel.ai.error.${g9}`,w9=Symbol.for(y9),x9;x9=w9;var v9="AI_ToolCallRepairError",b9=`vercel.ai.error.${v9}`,S9=Symbol.for(b9),I9;I9=S9;var dD="AI_UIMessageStreamError",fD=`vercel.ai.error.${dD}`,C9=Symbol.for(fD),pD,ll=class extends Ee{constructor({chunkType:e,chunkId:t,message:a}){super({name:dD,message:a}),this[pD]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Ee.hasMarker(e,fD)}};pD=C9;var k9="AI_InvalidDataContentError",L9=`vercel.ai.error.${k9}`,T9=Symbol.for(L9),E9;E9=T9;var M9="AI_InvalidMessageRoleError",A9=`vercel.ai.error.${M9}`,R9=Symbol.for(A9),D9;D9=R9;var _9="AI_MessageConversionError",O9=`vercel.ai.error.${_9}`,P9=Symbol.for(O9),N9;N9=P9;var B9="AI_RetryError",U9=`vercel.ai.error.${B9}`,F9=Symbol.for(U9),z9;z9=F9;var q9="6.0.141",H9=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();lx(r);try{let o=await fetch(r,{headers:Bf({},`ai-sdk/${q9}`,tD()),signal:a});if(o.redirected&&lx(o.url),!o.ok)throw new Ya({url:r,statusCode:o.status,statusText:o.statusText});return{data:await Q2({response:o,url:r,maxBytes:t??ix}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw Ya.isInstance(o)?o:new Ya({url:r,cause:o})}};var mD=h.union([h.string(),h.instanceof(Uint8Array),h.instanceof(ArrayBuffer),h.custom(e=>{var t,a;return(a=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?a:!1},{message:"Must be a Buffer"})]);var gu=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),gu.optional()),h.array(gu)])),Z=h.record(h.string(),h.record(h.string(),gu.optional())),hD=h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),j9=h.object({type:h.literal("image"),image:h.union([mD,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:Z.optional()}),gD=h.object({type:h.literal("file"),data:h.union([mD,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:Z.optional()}),V9=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:Z.optional()}),G9=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:Z.optional(),providerExecuted:h.boolean().optional()}),W9=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("json"),value:gu,providerOptions:Z.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("error-json"),value:gu,providerOptions:Z.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("media"),data:h.string(),mediaType:h.string()}),h.object({type:h.literal("file-data"),data:h.string(),mediaType:h.string(),filename:h.string().optional(),providerOptions:Z.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:Z.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:Z.optional()}),h.object({type:h.literal("custom"),providerOptions:Z.optional()})]))})]),yD=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:W9,providerOptions:Z.optional()}),$9=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),X9=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),K9=h.object({role:h.literal("system"),content:h.string(),providerOptions:Z.optional()}),Z9=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([hD,j9,gD]))]),providerOptions:Z.optional()}),Y9=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([hD,gD,V9,G9,yD,$9]))]),providerOptions:Z.optional()}),Q9=h.object({role:h.literal("tool"),content:h.array(h.union([yD,X9])),providerOptions:Z.optional()}),Ore=h.union([K9,Z9,Y9,Q9]);function wD(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let a={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(r===void 0)continue;let o=n in e?e[n]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&l?a[n]=wD(o,r):a[n]=r}return a}var J9={};CH(J9,{array:()=>nj,choice:()=>rj,json:()=>oj,object:()=>aj,text:()=>tj});function ej(e){let t=["ROOT"],a=-1,n=null;function r(s,u,c){switch(s){case'"':{a=u,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=u,n=u,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=u,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{a=u,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{a=u,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function o(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let s=0;s<e.length;s++){let u=e[s];switch(t[t.length-1]){case"ROOT":r(u,s,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=s,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,s,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,s);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=s;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=s}break}case"INSIDE_ARRAY_START":{u==="]"?(a=s,t.pop()):(a=s,r(u,s,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=s,t.pop();break}default:{a=s;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,s,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=s;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=s;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,s+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,s):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s)):a=s;break}}}let l=e.slice(0,a+1);for(let s=t.length-1;s>=0;s--)switch(t[s]){case"INSIDE_STRING":{l+='"';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":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?l+="true".slice(c.length):"false".startsWith(c)?l+="false".slice(c.length):"null".startsWith(c)&&(l+="null".slice(c.length))}}return l}async function yu(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await lr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await lr({text:ej(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var tj=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),aj=({schema:e,name:t,description:a})=>{let n=zf(e);return{name:"object",responseFormat:Tn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Yr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=await il({value:i.value,schema:n});if(!l.success)throw new Yr({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return l.value},async parsePartialOutput({text:r}){let o=await yu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},nj=({element:e,name:t,description:a})=>{let n=zf(e);return{name:"array",responseFormat:Tn(n.jsonSchema).then(r=>{let{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){let i=await lr({text:r});if(!i.success)throw new Yr({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=i.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new Yr({message:"No object generated: response did not match schema.",cause:new Ln({value:l,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let s of l.elements){let u=await il({value:s,schema:n});if(!u.success)throw new Yr({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return l.elements},async parsePartialOutput({text:r}){let o=await yu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;let l=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,s=[];for(let u of l){let c=await il({value:u,schema:n});c.success&&s.push(c.value)}return{partial:s}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},rj=({options:e,name:t,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...a!=null&&{description:a}}),async parseCompleteOutput({text:n},r){let o=await lr({text:n});if(!o.success)throw new Yr({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});let i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!e.includes(i.result))throw new Yr({message:"No object generated: response did not match schema.",cause:new Ln({value:i,cause:"response must be an object that contains a choice value."}),text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:n}){let r=await yu(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;let i=e.filter(l=>l.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),oj=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:a},n){let r=await lr({text:a});if(!r.success)throw new Yr({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.value},async parsePartialOutput({text:a}){let n=await yu(a);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});var Ure=ir({prefix:"aitxt",size:24});var zre=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
134
134
|
|
|
135
135
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
136
136
|
|
|
137
|
-
`)}})}};var nx=Of(()=>pu(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("error"),errorText:h.string()}),h.strictObject({type:h.literal("tool-input-start"),toolCallId:h.string(),toolName:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-delta"),toolCallId:h.string(),inputTextDelta:h.string()}),h.strictObject({type:h.literal("tool-input-available"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-error"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),errorText:h.string(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),h.strictObject({type:h.literal("tool-output-available"),toolCallId:h.string(),output:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),preliminary:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-error"),toolCallId:h.string(),errorText:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-denied"),toolCallId:h.string()}),h.strictObject({type:h.literal("reasoning-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:h.string().optional(),data:h.unknown(),transient:h.boolean().optional()}),h.strictObject({type:h.literal("start-step")}),h.strictObject({type:h.literal("finish-step")}),h.strictObject({type:h.literal("start"),messageId:h.string().optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("finish"),finishReason:h.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("abort"),reason:h.string().optional()}),h.strictObject({type:h.literal("message-metadata"),messageMetadata:h.unknown()})])));function V9(e){return e.type.startsWith("data-")}function ax(e){return e.type.startsWith("tool-")}function G9(e){return e.type==="dynamic-tool"}function Uf(e){return ax(e)||G9(e)}function Z2(e){return e.type.split("-").slice(1).join("-")}function W9({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function $9({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(l,s){await n(async({state:u,write:c})=>{var d,f,p,m;function x(g){let T=u.message.parts.filter(Uf).find(S=>S.toolCallId===g);if(T==null)throw new ol({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return T}function I(g){var b;let T=u.message.parts.find(R=>ax(R)&&R.toolCallId===g.toolCallId),S=g,M=T;if(T!=null){T.state=g.state,M.input=S.input,M.output=S.output,M.errorText=S.errorText,M.rawInput=S.rawInput,M.preliminary=S.preliminary,g.title!==void 0&&(M.title=g.title),M.providerExecuted=(b=S.providerExecuted)!=null?b:T.providerExecuted;let R=S.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let _=T;_.resultProviderMetadata=R}else T.callProviderMetadata=R}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:S.providerMetadata}:{},...S.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:S.providerMetadata}:{}})}function y(g){var b,T;let S=u.message.parts.find(_=>_.type==="dynamic-tool"&&_.toolCallId===g.toolCallId),M=g,R=S;if(S!=null){S.state=g.state,R.toolName=g.toolName,R.input=M.input,R.output=M.output,R.errorText=M.errorText,R.rawInput=(b=M.rawInput)!=null?b:R.rawInput,R.preliminary=M.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(T=M.providerExecuted)!=null?T:S.providerExecuted;let _=M.providerMetadata;if(_!=null)if(g.state==="output-available"||g.state==="output-error"){let k=S;k.resultProviderMetadata=_}else S.callProviderMetadata=_}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:g.title,...M.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function w(g){if(g!=null){let b=u.message.metadata!=null?lD(u.message.metadata,g):g;t!=null&&await Bf({value:b,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=b}}switch(l.type){case"text-start":{let g={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[l.id];if(g==null)throw new ol({chunkType:"text-delta",chunkId:l.id,message:`Received text-delta for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(d=l.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[l.id];if(g==null)throw new ol({chunkType:"text-end",chunkId:l.id,message:`Received text-end for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(f=l.providerMetadata)!=null?f:g.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ol({chunkType:"reasoning-delta",chunkId:l.id,message:`Received reasoning-delta for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(p=l.providerMetadata)!=null?p:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ol({chunkType:"reasoning-end",chunkId:l.id,message:`Received reasoning-end for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(m=l.providerMetadata)!=null?m:g.providerMetadata,g.state="done",delete u.activeReasoningParts[l.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:l.mediaType,url:l.url,...l.providerMetadata!=null?{providerMetadata:l.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:l.sourceId,url:l.url,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:l.sourceId,mediaType:l.mediaType,title:l.title,filename:l.filename,providerMetadata:l.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter(ax);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:g.length,dynamic:l.dynamic,title:l.title},l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[l.toolCallId];if(g==null)throw new ol({chunkType:"tool-input-delta",chunkId:l.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${l.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=l.inputTextDelta;let{value:b}=await hu(g.text);g.dynamic?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}):I({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}),c();break}case"tool-input-available":{l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}),c(),o&&!l.providerExecuted&&await o({toolCall:l});break}case"tool-input-error":{let g=u.message.parts.filter(Uf).find(T=>T.toolCallId===l.toolCallId);(g!=null?g.type==="dynamic-tool":!!l.dynamic)?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:void 0,rawInput:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),c();break}case"tool-approval-request":{let g=x(l.toolCallId);g.state="approval-requested",g.approval={id:l.approvalId},c();break}case"tool-output-denied":{let g=x(l.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:Z2(g),state:"output-available",input:g.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:Z2(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{l.messageId!=null&&(u.message.id=l.messageId),await w(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(V9(l)){if(a?.[l.type]!=null){let T=u.message.parts.findIndex(M=>"id"in M&&"data"in M&&M.id===l.id&&M.type===l.type),S=T>=0?T:u.message.parts.length;await Bf({value:l.data,schema:a[l.type],context:{field:`message.parts[${S}].data`,entityName:l.type,entityId:l.id}})}let g=l;if(g.transient){i?.(g);break}let b=g.id!=null?u.message.parts.find(T=>g.type===T.type&&g.id===T.id):void 0;b!=null?b.data=g.data:u.message.parts.push(g),i?.(g),c()}}s.enqueue(l)})}}))}async function X9({stream:e,onError:t}){let a=e.getReader();try{for(;;){let{done:n}=await a.read();if(n)break}}catch(n){t?.(n)}finally{a.releaseLock()}}var gre=ir({prefix:"aitxt",size:24});var xre=Of(()=>pu(h.array(h.object({id:h.string(),role:h.enum(["system","user","assistant"]),metadata:h.unknown().optional(),parts:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:Z.optional()}),h.object({type:h.literal("step-start")}),h.object({type:h.string().startsWith("data-"),id:h.string().optional(),data:h.unknown()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-streaming"),input:h.unknown().optional(),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-error"),input:h.unknown(),rawInput:h.unknown().optional(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-denied"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-streaming"),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),input:h.unknown().optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-error"),providerExecuted:h.boolean().optional(),input:h.unknown(),rawInput:h.unknown().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-denied"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var bre=ir({prefix:"aiobj",size:24});function sD(e){return({url:t,abortSignal:a})=>L9({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var K9=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,a)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){a(n)}}),this.processQueue()})}};var Ire=ir({prefix:"aiobj",size:24});var Cre=sD();var Z9="AI_NoSuchProviderError",Q9=`vercel.ai.error.${Z9}`,Y9=Symbol.for(Q9),J9;J9=Y9;var kre=sD();async function ej(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:a,type:n}=t,r=await new Promise((o,i)=>{let l=new FileReader;l.onload=s=>{var u;o((u=s.target)==null?void 0:u.result)},l.onerror=s=>i(s),l.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var tj=class{constructor({api:e="/api/chat",credentials:t,headers:a,body:n,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=a,this.body=n,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var a,n,r,o,i;let l=await Ln(this.body),s=await Ln(this.headers),u=await Ln(this.credentials),c={...Zr(s),...Zr(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...l,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d?.api)!=null?n:this.api,p=d?.headers!==void 0?Zr(d.headers):c,m=d?.body!==void 0?d.body:{...l,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:x,signal:e});if(!y.ok)throw new Error((i=await y.text())!=null?i:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await Ln(this.body),l=await Ln(this.headers),s=await Ln(this.credentials),u={...Zr(l),...Zr(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:s,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?Zr(c.headers):u,p=(n=c?.credentials)!=null?n:s,x=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:f,credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((o=await x.text())!=null?o:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},rx=class extends tj{constructor(e={}){super(e)}processResponseStream(e){return K2({stream:e,schema:nx}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},uD=class{constructor({generateId:e=j2,id:t=e(),transport:a=new rx,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new K9,this.sendMessage=async(d,f)=>{var p,m,x,I;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await ej(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:y=d,d.messageId!=null){let w=this.state.messages.findIndex(g=>g.id===d.messageId);if(w===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[w].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,w+1),this.state.replaceMessage(w,{...y,id:d.messageId,role:(m=y.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(x=y.id)!=null?x:this.generateId(),role:(I=y.role)!=null?I:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{let p=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:p,options:m})=>this.jobExecutor.run(async()=>{let x=this.state.messages,I=x[x.length-1],y=w=>Uf(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:w;this.state.replaceMessage(x.length-1,{...I,parts:I.parts.map(y)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(y)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(w=>{var g;w&&this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m})})}),this.addToolOutput=async({state:d="output-available",toolCallId:f,output:p,errorText:m,options:x})=>this.jobExecutor.run(async()=>{let I=this.state.messages,y=I[I.length-1],w=g=>Uf(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(I.length-1,{...y,parts:y.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(g=>{var b;g&&this.makeRequest({trigger:"submit-message",messageId:(b=this.lastMessage)==null?void 0:b.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=a,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=r,this.state=o,this.onError=i,this.onToolCall=l,this.onFinish=s,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:a,body:n,messageId:r}){var o,i,l;let s;if(e==="resume-stream")try{let p=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(p==null)return;s=p}catch(p){this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,f=!1;try{let p={state:W9({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=p;let m;e==="resume-stream"?m=s:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let x=I=>this.jobExecutor.run(()=>I({state:p.state,write:()=>{var y;this.setStatus({status:"streaming"}),p.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await X9({stream:$9({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:I=>{throw I}}),onError:I=>{throw I}}),this.setStatus({status:"ready"})}catch(p){if(c||p.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:t,headers:a,body:n})}};var mD=z(dD(),1);var xu=z(Le(),1);var qf=z(Le(),1);var pD=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},ut=(e,t,a)=>(pD(e,t,"read from private field"),a?a.call(e):t.get(e)),Tn=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},Yr=(e,t,a,n)=>(pD(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function nj(e,t){return t!=null?(0,mD.default)(e,t):e}var Ya,Ff,zf,gu,yu,wu,il,ox,ix,rj=class{constructor(e=[]){Tn(this,Ya,void 0),Tn(this,Ff,"ready"),Tn(this,zf,void 0),Tn(this,gu,new Set),Tn(this,yu,new Set),Tn(this,wu,new Set),this.pushMessage=t=>{Yr(this,Ya,ut(this,Ya).concat(t)),ut(this,il).call(this)},this.popMessage=()=>{Yr(this,Ya,ut(this,Ya).slice(0,-1)),ut(this,il).call(this)},this.replaceMessage=(t,a)=>{Yr(this,Ya,[...ut(this,Ya).slice(0,t),this.snapshot(a),...ut(this,Ya).slice(t+1)]),ut(this,il).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?nj(t,a):t;return ut(this,gu).add(n),()=>{ut(this,gu).delete(n)}},this["~registerStatusCallback"]=t=>(ut(this,yu).add(t),()=>{ut(this,yu).delete(t)}),this["~registerErrorCallback"]=t=>(ut(this,wu).add(t),()=>{ut(this,wu).delete(t)}),Tn(this,il,()=>{ut(this,gu).forEach(t=>t())}),Tn(this,ox,()=>{ut(this,yu).forEach(t=>t())}),Tn(this,ix,()=>{ut(this,wu).forEach(t=>t())}),Yr(this,Ya,e)}get status(){return ut(this,Ff)}set status(e){Yr(this,Ff,e),ut(this,ox).call(this)}get error(){return ut(this,zf)}set error(e){Yr(this,zf,e),ut(this,ix).call(this)}get messages(){return ut(this,Ya)}set messages(e){Yr(this,Ya,[...e]),ut(this,il).call(this)}};Ya=new WeakMap;Ff=new WeakMap;zf=new WeakMap;gu=new WeakMap;yu=new WeakMap;wu=new WeakMap;il=new WeakMap;ox=new WeakMap;ix=new WeakMap;var ll,fD=class extends uD{constructor({messages:e,...t}){let a=new rj(e);super({...t,state:a}),Tn(this,ll,void 0),this["~registerMessagesCallback"]=(n,r)=>ut(this,ll)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>ut(this,ll)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>ut(this,ll)["~registerErrorCallback"](n),Yr(this,ll,a)}};ll=new WeakMap;function hD({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,Ja.useRef)("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(n.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});let r={...a,onToolCall:f=>{var p,m;return(m=(p=n.current).onToolCall)==null?void 0:m.call(p,f)},onData:f=>{var p,m;return(m=(p=n.current).onData)==null?void 0:m.call(p,f)},onFinish:f=>{var p,m;return(m=(p=n.current).onFinish)==null?void 0:m.call(p,f)},onError:f=>{var p,m;return(m=(p=n.current).onError)==null?void 0:m.call(p,f)},sendAutomaticallyWhen:f=>{var p,m,x;return(x=(m=(p=n.current).sendAutomaticallyWhen)==null?void 0:m.call(p,f))!=null?x:!1}},o=(0,Ja.useRef)("chat"in a?a.chat:new fD(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new fD(r));let l=(0,Ja.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,Ja.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,Ja.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,Ja.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,Ja.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,Ja.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:s,setMessages:d,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:c,resumeStream:o.current.resumeStream,status:u,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}var Q=z(Le(),1);function sl(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[s,u]of Object.entries(a))i.set(s,u);let l=i.toString();return`${o}${t}${l?`?${l}`:""}`}function oj(e){let t=e?.cause,a=t?.issues??t?.errors;if(!Array.isArray(a))return null;let n=a.find(r=>r.code==="invalid_union");if(!n?.errors)return null;for(let r of n.errors){if(!Array.isArray(r)||r.some(l=>(l.code==="invalid_value"||l.code==="invalid_literal")&&l.path?.[0]==="type"))continue;let i=r.filter(l=>l.code==="unrecognized_keys").flatMap(l=>l.keys??[]);if(i.length>0)return i}return null}var Hf=class extends rx{processResponseStream(t){let a="",n=nx(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let l=a.split(`
|
|
138
|
-
`);a=l.pop()??"";for(let s of l){let u=s.trim();if(!u.startsWith("data:"))continue;let c=u.slice(5).trim();if(c!=="[DONE]")try{let d=JSON.parse(c);if(!r){i.enqueue(d);continue}let f=await r(d);if(f.success){i.enqueue(f.value);continue}let p=oj(f.error);if(p?.length){let m={...d};for(let I of p)delete m[I];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var gD=50,yD=1e3;function jf(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.threadId=="string"&&typeof t.memoryUserId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}async function Vf(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await $h(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function lx(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function sx(e){return await Vf(async a=>{let o=a.transaction(Ra,"readonly").objectStore(Ra).index(nd),l=(await lx(o.getAll(e))??[]).filter(jf);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Gf(e){return await Vf(async a=>{let r=a.transaction(Ra,"readonly").objectStore(Ra),o=await lx(r.get(e));return jf(o)?o:null})??null}async function ux(e){if(!jf(e))return;let t=e.messages.length>yD?{...e,messages:e.messages.slice(e.messages.length-yD)}:e;await Vf(async a=>{await new Promise((s,u)=>{let c=a.transaction(Ra,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Ra).put(t)});let n=a.transaction(Ra,"readwrite"),r=n.objectStore(Ra),o=r.index(nd),l=(await lx(o.getAll(t.memoryUserId))??[]).filter(jf);if(l.length>gD){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-gD);for(let u of s)r.delete(u.threadId)}return await new Promise((s,u)=>{n.oncomplete=()=>s(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function wD(e){await Vf(async t=>(await new Promise((a,n)=>{let r=t.transaction(Ra,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Ra).delete(e)}),null))}async function cx(e){return(await sx(e))[0]?.threadId??null}function xD(e){let t=e.trim();if(!t)return`Conversation on ${new Date().toISOString().slice(0,10)}`;let a=t.split(/\r?\n/,1)[0]??t;return a.length<=60?a:`${a.slice(0,60).trimEnd()}\u2026`}var ij="x-session-id",lj=250,sj=200;function vD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Rs()}function Wf(){return new Date().toISOString()}function bD(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function uj(e,t){let a=sl(e,"/tools"),n=await fetch(a,{method:"GET",headers:t?{...t}:void 0});if(!n.ok)throw new Error(`[Waniwani] Failed to fetch /tools: ${n.status} ${n.statusText}`);let r=await n.json();if(!r||!Array.isArray(r.tools))return{};let o={};for(let i of r.tools)i&&typeof i.name=="string"&&(o[i.name]=i);return o}function SD(e){let{api:t="/api/waniwani",headers:a,body:n,onMessageSent:r,onResponseReceived:o,enableThreadHistory:i=!1,activeThreadId:l,onThreadChange:s}=e,u=e.visitorId;(0,Q.useEffect)(()=>rd(u),[u]);let c=Tf(),d=(0,Q.useRef)(a),f=(0,Q.useRef)(n),p=(0,Q.useRef)(i);(0,Q.useEffect)(()=>{p.current=i},[i]);let m=(0,Q.useRef)(void 0),x=(0,Q.useRef)(null),[I,y]=(0,Q.useState)(void 0),w=(0,Q.useRef)(I),[g,b]=(0,Q.useState)(l),T=(0,Q.useRef)(g),[S,M]=(0,Q.useState)([]),[R,_]=(0,Q.useState)(!i),k=(0,Q.useRef)(void 0),G=(0,Q.useRef)(void 0),B=(0,Q.useRef)(void 0),U=(0,Q.useRef)(void 0),W=(0,Q.useRef)(0),A=(0,Q.useRef)(s);(0,Q.useEffect)(()=>{A.current=s},[s]);let H=(0,Q.useCallback)(O=>{T.current=O,b(O),O&&(A.current?.(O),c.emit({name:"thread.changed",sessionId:w.current,properties:{threadId:O}}))},[c]),$=(0,Q.useCallback)(async()=>{if(!i)return;let O=x.current?.memoryUserId;if(!O)return;let ee=await sx(O);M(ee)},[i]),We=(0,Q.useCallback)(()=>w.current,[]),$e=(0,Q.useCallback)(O=>{let ee=bD(O);if(!ee||w.current===ee)return;let ae=w.current===void 0;w.current=ee,y(ee),ae&&c.emit({name:"session.started",properties:{sessionId:ee}})},[c]),v=(0,Q.useCallback)(()=>{w.current=void 0,y(void 0)},[]);(0,Q.useEffect)(()=>{d.current=a},[a]),(0,Q.useEffect)(()=>{f.current=n},[n]),(0,Q.useEffect)(()=>{let O=!1,ee=W.current;return(async()=>{try{let ft=await ms();if(O)return;x.current=ft}catch{}if(!i)return;let ae=x.current?.memoryUserId;if(!ae){_(!0);return}try{let ft=l??await cx(ae);if(O||ee!==W.current)return;if(ft){let Ft=await Gf(ft);if(O||ee!==W.current)return;Ft&&Ft.memoryUserId===ae&&(T.current=Ft.threadId,b(Ft.threadId),k.current=Ft.createdAt,G.current=Ft.title,Ft.sessionId&&(w.current=Ft.sessionId,y(Ft.sessionId)),ue(Ft.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[]);let De=(0,Q.useRef)(new Hf({api:t,headers:()=>({...d.current}),body:()=>{let O={...f.current??{}},ee=Object.hasOwn(O,"sessionId"),ae=bD(O.sessionId);if(ae)$e(ae),O.sessionId=ae;else if(ee)v(),delete O.sessionId;else{let np=We();np&&(O.sessionId=np)}tl(m.current)&&(O.modelContext=m.current);let ft=x.current,Ft=Kn();ft&&(O.visitorContext={timezone:ft.timezone,language:ft.language,languages:ft.languages,deviceType:ft.deviceType,referrer:ft.referrer,visitorId:Ft});let It=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},FD=typeof It.client=="object"&&It.client!==null?It.client:{};O.visitor={...It,id:Ft,client:{...FD,...ft&&{memoryUserId:ft.memoryUserId}}};let yx=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,wx=x.current?.memoryUserId,xx=x.current?.language,Su={};if(wx&&(Su.memoryUserId=wx),xx&&(Su.locale=xx),(Object.keys(Su).length>0||yx)&&(O.extra={...Su,...yx??{}}),p.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(T.current=O.threadId);else{let Iu=T.current;Iu||(Iu=vD(),k.current=Wf(),G.current=void 0,H(Iu)),O.threadId=Iu}return O},fetch:(async(O,ee)=>{let ae=await fetch(O,ee);return m.current=void 0,$e(ae.headers.get(ij)),ae})})),_e=(0,Q.useRef)(null),L=(0,Q.useRef)(null),ke=(0,Q.useRef)({}),[St,et]=(0,Q.useState)(0),Ut=e.skipRemoteConfig===!0,ve=(0,Q.useCallback)(async()=>{if(!Ut)try{let O=await uj(t,d.current);ke.current=O,et(ee=>ee+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,Ut]);(0,Q.useEffect)(()=>{ve()},[ve]);let{messages:X,sendMessage:pe,setMessages:ue,status:oe}=hD({messages:e.initialMessages,transport:De.current,onFinish({message:O,isAbort:ee,isDisconnect:ae,isError:ft}){o?.(),!ee&&!ae&&!ft&&c.emit({name:"message.received"}),_e.current&&(L.current=O)},onError(O){console.warn("[Waniwani] Chat error:",O.message),c.emit({name:"chat.error",properties:{message:O.message.slice(0,sj)}}),_e.current&&(_e.current.reject(O),_e.current=null)}}),ye=(0,Q.useRef)(X);(0,Q.useEffect)(()=>{ye.current=X},[X]);let Xe=(0,Q.useRef)(i);(0,Q.useEffect)(()=>{if(!i||Xe.current||(Xe.current=!0,ye.current.length>0))return;let O=!1,ee=W.current;return _(!1),(async()=>{try{let ae=x.current;if(!ae)try{ae=await ms(),x.current=ae}catch{}let ft=ae?.memoryUserId;if(!ft||O||ee!==W.current){O||_(!0);return}let Ft=l??await cx(ft);if(O||ee!==W.current)return;if(Ft){let It=await Gf(Ft);if(O||ee!==W.current)return;It&&It.memoryUserId===ft&&(T.current=It.threadId,b(It.threadId),k.current=It.createdAt,G.current=It.title,It.sessionId&&(w.current=It.sessionId,y(It.sessionId)),ue(It.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[i]),(0,Q.useEffect)(()=>{if(oe==="ready"&&_e.current&&L.current){let O=_e.current,ee=L.current;_e.current=null,L.current=null,O.resolve(ee)}},[oe]);let[dt,nt]=(0,Q.useState)(""),[Mt,K]=(0,Q.useState)([]),ce=oe==="submitted"||oe==="streaming",Ke=(0,Q.useCallback)(O=>{K(ee=>ee.filter(ae=>ae.id!==O))},[]),Pa=ce&&Mt.length>0,fn=(0,Q.useCallback)(O=>{let ee=!!O.text?.trim(),ae=!!O.files?.length;if(ee||ae){if(ce){if(Mt.length>0)return;K(ft=>[...ft,{id:Rs(),text:O.text||"",files:O.files??[],modelContext:O.modelContext}]),nt("");return}m.current=O.modelContext,pe({text:O.text||"",files:O.files}),r?.(O.text||""),c.emit({name:"message.sent"}),nt("")}},[pe,r,ce,Mt.length,c]),sr=(0,Q.useCallback)(O=>new Promise((ee,ae)=>{_e.current={resolve:ee,reject:ae},pe({text:O}),r?.(O),c.emit({name:"message.sent"})}),[pe,r,c]);(0,Q.useEffect)(()=>{if(oe!=="ready"||Mt.length===0)return;let[O,...ee]=Mt;K(ee),m.current=O.modelContext,pe({text:O.text,files:O.files.length>0?O.files:void 0}),r?.(O.text),c.emit({name:"message.sent"})},[oe,pe,r,Mt,c]);let dl=(0,Q.useCallback)(()=>{ue([]),K([]),v(),nt(""),ke.current={},et(O=>O+1),ve()},[ue,v,ve]),Go=(0,Q.useCallback)(()=>{if(!p.current)return;let O=x.current?.memoryUserId,ee=T.current,ae=ye.current;if(!(!O||!ee||ae.length===0)){if(k.current||(k.current=Wf()),!G.current){let ft=ae.find(It=>It.role==="user"),Ft=ft?ft.parts.map(It=>"text"in It&&typeof It.text=="string"?It.text:"").join(" "):"";G.current=xD(Ft)}return{threadId:ee,memoryUserId:O,title:G.current,messages:ae,sessionId:w.current,createdAt:k.current,updatedAt:Wf()}}},[]),P=(0,Q.useCallback)(async()=>{let O=Go();O&&(await ux(O),await $())},[Go,$]);(0,Q.useEffect)(()=>{if(i&&R&&!(oe==="submitted"||oe==="streaming")&&X.length!==0)return B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{B.current=void 0;let O=P().finally(()=>{U.current===O&&(U.current=void 0)});U.current=O},lj),()=>{B.current&&clearTimeout(B.current)}},[i,R,X,oe,P]);let q=(0,Q.useCallback)(()=>{let O=U.current,ee=B.current,ae=ee?Go():void 0;return ee&&(clearTimeout(ee),B.current=void 0),(async()=>{O&&await O,ae&&(await ux(ae),await $())})()},[Go,$]),le=(0,Q.useCallback)(()=>{W.current+=1,q(),ue([]),K([]),v(),nt("");let O=vD();return k.current=Wf(),G.current=void 0,H(O),$(),O},[ue,v,H,$,q]),he=(0,Q.useCallback)(async O=>{W.current+=1;let ee=W.current;if(await q(),ee!==W.current)return;let ae=await Gf(O);ee===W.current&&ae&&(ae.sessionId?(w.current=ae.sessionId,y(ae.sessionId)):v(),H(ae.threadId),k.current=ae.createdAt,G.current=ae.title,ue(ae.messages),K([]),nt(""))},[ue,v,H,q]),Fe=(0,Q.useCallback)(async O=>{if(T.current===O){W.current+=1,B.current&&(clearTimeout(B.current),B.current=void 0);let ee=U.current;ee&&await ee}await wD(O),await $(),T.current===O&&(ue([]),K([]),v(),nt(""),T.current=void 0,b(void 0),k.current=void 0,G.current=void 0)},[ue,v,$]);(0,Q.useEffect)(()=>{i&&R&&l!==void 0&&l!==T.current&&he(l)},[l,i,R,he]);let va=(0,Q.useCallback)(O=>{nt(O.target.value)},[]),pn=X[X.length-1],Na=X.length>0,eo=ce&&(!Na||pn.role==="user"),to=ke.current;return{messages:X,status:oe,text:dt,setText:nt,handleSubmit:fn,handleTextChange:va,isLoading:ce,showLoaderBubble:eo,lastMessage:pn,hasMessages:Na,sendMessage:pe,sendMessageAndWait:sr,reset:dl,queuedMessages:Mt,queueFull:Pa,removeQueuedMessage:Ke,sessionId:I,toolDefinitions:to,refreshToolDefinitions:ve,threads:S,activeThreadId:g,isThreadHistoryReady:R,startNewThread:le,switchThread:he,deleteThread:Fe}}var En=z(Le(),1);function cj(e){for(let t of e.parts){let a=t;if(a.type==="data"||a.type==="data-suggestions"){let n=a.data;if(n&&Array.isArray(n.suggestions))return n.suggestions}}return null}function ID(e){return typeof e=="object"&&e!==null&&"initial"in e}function CD(e){let{messages:t,status:a,config:n}=e,r=ID(n)&&n.initial?n.initial:void 0,[o,i]=(0,En.useState)(r??[]),l=(0,En.useRef)(a),s=n===!0||ID(n)&&n.dynamic!==!1,u=(0,En.useCallback)(()=>{i([])},[]),c=t.length>0;(0,En.useEffect)(()=>{!c&&r&&r.length>0&&i(r)},[r,c]);let d=t[t.length-1];return(0,En.useEffect)(()=>{d?.role==="user"&&u()},[d,u]),(0,En.useEffect)(()=>{let f=l.current;if(l.current=a,f==="streaming"&&a==="ready"&&s){let p=[...t].reverse().find(x=>x.role==="assistant");if(!p)return;let m=cj(p);m&&i(m)}},[a,s,t]),{suggestions:o,isLoading:!1,clear:u}}function kD(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return sl(e,"/resource",n?{token:n}:void 0)}var dj={primaryColor:["--ww-primary","--ww-color-primary"],primaryForeground:["--ww-primary-fg","--ww-color-primary-foreground"],backgroundColor:["--ww-bg","--ww-color-background"],textColor:["--ww-text","--ww-color-foreground","--ww-color-accent-foreground"],mutedColor:["--ww-muted","--ww-color-muted-foreground"],borderColor:["--ww-border","--ww-color-border"],borderWidth:["--ww-border-width"],boxShadow:["--ww-shadow"],assistantBubbleColor:["--ww-assistant-bubble","--ww-color-accent"],userBubbleColor:["--ww-user-bubble"],inputBackgroundColor:["--ww-input-bg","--ww-color-input"],borderRadius:["--ww-radius"],messageBorderRadius:["--ww-msg-radius"],fontFamily:["--ww-font"],headerBackgroundColor:["--ww-header-bg"],headerTextColor:["--ww-header-text"],statusColor:["--ww-status"],toolCardColor:["--ww-tool-card","--ww-color-tool-card"],userBubbleTextColor:["--ww-user-bubble-text"],assistantBubbleTextColor:["--ww-assistant-bubble-text"],messagePaddingX:["--ww-msg-pad-x"],messagePaddingY:["--ww-msg-pad-y"],messageMaxWidth:["--ww-msg-max-width"],fontSize:["--ww-font-size"],lineHeight:["--ww-line-height"]};function $f(e){let t={};for(let[a,n]of Object.entries(dj)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let i of n)t[i]=o}return t}var Ve=z(ne(),1),Xf=(0,Ge.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ve.jsx)(As,{locale:n,messages:r,children:(0,Ve.jsx)(fj,{...t,ref:a})})}),fj=(0,Ge.forwardRef)(function(t,a){let{t:n,ready:r}=Re(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,welcomeMessage:u,welcome:c,placeholder:d=n.promptInput.placeholder,triggerEvent:f="triggerDemoRequest",api:p,mcp:m,debug:x=!1,readOnly:I=!1,title:y,headerActions:w,hideHeader:g=!1,enableThreadHistory:b=!1,showToolCalls:T=!0,initializing:S=!1,disclaimer:M}=t,R=o?.theme,_=o?.variables,k=o?.assistantBubble??!1,G=_?$f(_):{},[B,U]=(0,Ge.useState)(!1);(0,Ge.useEffect)(()=>{if(R!=="auto"||typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");U(K.matches);let ce=()=>U(K.matches);return K.addEventListener("change",ce),()=>K.removeEventListener("change",ce)},[R]);let W=R==="dark"||R==="auto"&&B,A=SD({...t,api:p}),H=Tf(),$=ER({...t,api:p,sessionId:A.sessionId,onCallTool:m?.onCallTool}),We=m?.resourceEndpoint??kD(p,t.headers),$e=dd(d,!A.text),[v,De]=(0,Ge.useState)(null),[_e,L]=(0,Ge.useState)(null),ke=(0,Ge.useRef)(null),St=(0,Ge.useRef)(null),et=(0,Ge.useRef)(null),Ut=(0,Ge.useRef)(null),[ve,X]=(0,Ge.useState)(!0),pe=(0,Ge.useRef)(ve);pe.current=ve;let ue=(0,Ge.useCallback)(()=>{let K=ke.current;if(!K)return;let ce=K.querySelector("textarea");ce&&ce.focus()},[]),oe=(0,Ge.useCallback)((K="smooth")=>{let ce=St.current;ce&&ce.scrollTo({top:ce.scrollHeight,behavior:K})},[]);(0,Ge.useEffect)(()=>{let K=Ut.current,ce=St.current;if(!K||!ce)return;let Ke=new IntersectionObserver(([Pa])=>X(Pa.isIntersecting),{root:ce,rootMargin:"0px 0px 200px 0px",threshold:0});return Ke.observe(K),()=>Ke.disconnect()},[]),(0,Ge.useEffect)(()=>{let K=St.current;if(!K)return;let ce=Ke=>{let fn=(Ke.target instanceof Element?Ke.target:null)?.closest("a");fn?.href&&H.emit({name:"link.clicked",properties:{url:fn.href}})};return K.addEventListener("click",ce),()=>K.removeEventListener("click",ce)},[H]),(0,Ge.useEffect)(()=>{(A.messages[A.messages.length-1]?.role==="user"||pe.current)&&oe("smooth")},[A.messages.length,A.messages[A.messages.length-1]]),(0,Ge.useEffect)(()=>{oe("auto")},[oe]),(0,Ge.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let K=St.current,ce=et.current;if(!K&&!ce)return;let Ke=K?.scrollHeight??0,Pa=K?.clientHeight??0,fn=new ResizeObserver(()=>{let sr=St.current;if(!sr)return;let dl=sr.scrollTop+Pa>=Ke-5;Ke=sr.scrollHeight,Pa=sr.clientHeight,dl&&oe("auto")});return K&&fn.observe(K),ce&&fn.observe(ce),()=>fn.disconnect()},[oe]);let ye=CD({messages:A.messages,status:A.status,config:t.suggestions}),Xe=(0,Ge.useCallback)(K=>{let ce=K.content.map(Ke=>Ke.text??"").join("").trim();ce&&A.handleSubmit({text:ce,files:[],modelContext:K.modelContext})},[A.handleSubmit]),dt=(0,Ge.useCallback)(K=>{let ce=ye.suggestions.indexOf(K),Ke=ce>=0?ce:c?.suggestions?.indexOf(K)??-1;H.emit({name:"suggestion.clicked",properties:{text:K,index:Ke}}),ye.clear(),A.handleSubmit({text:K,files:[]})},[ye.suggestions,ye.clear,A.handleSubmit,c,H]);(0,Ge.useImperativeHandle)(a,()=>({sendMessage:K=>{A.handleSubmit({text:K,files:[]}),ue()},sendMessageAndWait:K=>A.sendMessageAndWait(K),reset:A.reset,focus:ue,get messages(){return A.messages},get sessionId(){return A.sessionId}}),[A.handleSubmit,A.sendMessageAndWait,A.reset,A.messages,A.sessionId,ue]),(0,Ge.useEffect)(()=>{if(!f)return;let K=ce=>{let Ke=ce.detail,Pa=typeof Ke?.message=="string"?Ke.message:void 0;Pa&&A.handleSubmit({text:Pa,files:[]}),ue()};return window.addEventListener(f,K),()=>window.removeEventListener(f,K)},[f,A.handleSubmit,ue]);let nt=!g&&!!(y||b||w),Mt=S||!r;return(0,Ve.jsxs)("div",{ref:ke,style:{...G,maxHeight:"inherit",...v&&_e?{height:_e}:{},opacity:Mt?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":k?"true":void 0,"data-color-scheme":R==="auto"?"auto":void 0,...Mt?{"data-waniwani-initializing":""}:{},...W?{"data-waniwani-dark":""}:{},className:j("ww:relative ww:w-full ww:h-full ww:flex ww:flex-col ww:bg-background ww:text-foreground ww:font-[family-name:var(--ww-font)] ww:overflow-hidden",R==="dark"&&"dark",i,l?.root),children:[nt&&(0,Ve.jsxs)("div",{className:j("ww-header ww:shrink-0 ww:flex ww:items-center ww:gap-2 ww:pl-4 ww:pr-3 ww:py-3 ww:border-b ww:border-border",l?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[y&&(0,Ve.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ve.jsx)("div",{className:"ww:flex-1"}),b&&(0,Ve.jsx)(kR,{threads:A.threads,activeThreadId:A.activeThreadId,onNewThread:A.startNewThread,onSelectThread:K=>{A.switchThread(K)},onDeleteThread:K=>{A.deleteThread(K)}}),w]}),(0,Ve.jsxs)("div",{ref:St,className:j("ww:relative ww:flex-1 ww:min-h-0",v?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ve.jsxs)("div",{ref:et,className:j("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",v&&"ww:!py-0"),children:[(0,Ve.jsx)(SR,{messages:A.messages,status:A.status,welcomeMessage:u,welcome:c,onSuggestionSelect:dt,resourceEndpoint:We,chatSessionId:A.sessionId,isDark:W,onFollowUp:Xe,onCallTool:$,fullscreenToolCallId:v,debug:x,showToolCalls:T,toolDefinitions:A.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(K,ce)=>{if(K==="fullscreen"){let Ke=ke.current?.getBoundingClientRect().height??0;L(Ke>0?Ke:null),De(ce.toolCallId)}else L(null),De(null)}}),(0,Ve.jsx)("div",{ref:Ut,"aria-hidden":!0,style:{height:1}})]}),!ve&&!v&&(0,Ve.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ve.jsx)(bn,{type:"button",onClick:()=>oe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ve.jsx)(ys,{className:"ww:size-4"})})})]}),!I&&(0,Ve.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:v?{display:"none"}:void 0,children:[(0,Ve.jsx)(cd,{suggestions:ye.suggestions,isLoading:ye.isLoading,onSelect:dt}),(0,Ve.jsx)(sC,{queuedMessages:A.queuedMessages,onRemove:A.removeQueuedMessage}),(0,Ve.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ve.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ve.jsx)(KI,{onSubmit:A.handleSubmit,globalDrop:s,multiple:s,className:j("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:(0,Ve.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[s&&(0,Ve.jsx)(YI,{}),(0,Ve.jsx)(ZI,{onChange:A.handleTextChange,value:A.text,placeholder:$e,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ve.jsx)(QI,{status:A.status,disabled:A.queueFull})]})}),(0,Ve.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Ve.jsx)(IR,{}),(0,Ve.jsx)(JI,{text:M})]})]})})]})]})});var vu=z(Le(),1);function pj(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ul(...e){pj()&&console.log("[Waniwani]",...e)}var mj="waniwani:config:";function LD(e,t,a){return`${mj}${e}|${t}|${a??""}`}function Kf(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(LD(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function hj(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(LD(e,t,a),JSON.stringify(n))}catch{}}var gj=600;async function yj(e,t,a,n){try{let r=sl(e,"/config",n?{channel:n}:void 0),o=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`},signal:a});if(!o.ok)return{};let i=await o.json(),l=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return l?wj(l):{}}catch{return{}}}function wj(e){let t={};return e.source!=null&&(t.source=e.source),e.title!=null&&(t.title=e.title),e.welcomeMessage!=null&&(t.welcomeMessage=e.welcomeMessage),e.placeholder!=null&&(t.placeholder=e.placeholder),e.suggestions!=null&&e.suggestions.length>0&&(t.suggestions=e.suggestions),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),e.toolCallDisplay==="full"?t.showToolCalls=!0:e.toolCallDisplay==="titles-only"?t.showToolCalls="titles-only":e.toolCallDisplay==="hidden"&&(t.showToolCalls=!1),e.visibility&&(t.visibility=e.visibility),t}function Zf(e,t,a){let[n,r]=(0,vu.useState)(e),[o,i]=(0,vu.useState)(!1);return(0,vu.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||LI({api:l,token:s,channelId:u,mode:e.mode,source:m})},d=Kf(l,s,u);if(d)try{let m=hs(t,d,a);r(m),i(!0),ul("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d.source)}catch{}let f=new AbortController,p=setTimeout(()=>i(!0),gj);return yj(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ul("remote /config response",m),Object.keys(m).length>0){hj(l,s,u,m);try{let x=hs(t,m,a);r(x),ul("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}i(!0),c(m.source)}}).catch(m=>{console.error("[Waniwani] Remote config fetch failed:",m),i(!0)}).finally(()=>clearTimeout(p)),()=>{f.abort(),clearTimeout(p)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Yf=z(Le(),1);function xj(e){return e?.patterns??e?.rules??[]}var TD="\0\0";function vj(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,TD).replace(/\\\*/g,"[^/]*").split(TD).join(".*");return new RegExp(`^${a}$`)}function ED(e,t){try{return vj(e).test(t)}catch{return!1}}function Qf(e,t){if(!e)return!0;let a=!1;for(let n of xj(e))if(ED(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function MD(e,t){for(let a of e?.appearRules??[])if(ED(a.glob,t))return a.appearAfter;return null}var dx="waniwani:locationchange",AD=!1;function bj(){if(!(AD||typeof history>"u")){AD=!0;for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...n){let r=t.apply(this,n);return window.dispatchEvent(new Event(dx)),r}}}}function Sj(e){return bj(),window.addEventListener(dx,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(dx,e),window.removeEventListener("popstate",e)}}function Ij(){return window.location.pathname}function Cj(){return"/"}function fx(){return(0,Yf.useSyncExternalStore)(Sj,Ij,Cj)}function Jf(e,t){let a=fx(),n=t&&Qf(e,a);return(0,Yf.useEffect)(()=>{ul("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var ep=z(Le(),1),kj=3e3,Lj=120,Tj=24;function RD(e){let[t,a]=(0,ep.useState)(!1);return(0,ep.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,l=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${Tj}px 0px`,threshold:0}),r.observe(u)},s=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){l(u);return}o=setTimeout(s,Lj)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},kj),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var ct=z(ne(),1),Ej=2e3,Mj=90,Aj=1e3,DD=(0,Me.forwardRef)(function(t,a){return(0,ct.jsx)(As,{locale:t.config.locale,children:(0,ct.jsx)(Rj,{...t,ref:a})})}),Rj=(0,Me.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Re(),{config:i,ready:l}=Zf(t,a,n),s=Jf(i.visibility,l),u=fx(),c=s?MD(i.visibility,u):null,d=RD(c),f=(0,Me.useRef)(null),p=(0,Me.useMemo)(()=>kf({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Me.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Me.useRef)(null),I=(0,Me.useRef)(null),y=(0,Me.useRef)(!1),[w,g]=(0,Me.useState)("input"),[b,T]=(0,Me.useState)(""),[S,M]=(0,Me.useState)(!1),[R,_]=(0,Me.useState)(!1),[k,G]=(0,Me.useState)(0),B=i.appearance?.theme,U=i.appearance?.variables,W=(0,Me.useMemo)(()=>U?$f(U):{},[U]),A=i.suggestions??[],H=i.launcherText??i.placeholder??o.launcher.prompt,$=dd(H,b.length===0),We="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Me.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let X=i.appearDelay??Ej,pe=setTimeout(()=>M(!0),Math.max(0,X));return()=>clearTimeout(pe)},[s,i.appearDelay,c,d]),(0,Me.useEffect)(()=>{if(!S||A.length===0)return;let X=setTimeout(()=>{y.current||g(pe=>pe==="input"?"expanded":pe)},Aj);return()=>clearTimeout(X)},[S,A.length]),(0,Me.useEffect)(()=>{k>0&&w==="open"&&f.current?.focus()},[k,w]);let $e=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{l&&!$e.current&&($e.current=!0,p.emit({name:"chat.ready"}))},[l,p]);let v=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{let X=s&&w==="open";X!==v.current&&(v.current=X,p.emit({name:X?"chat.opened":"chat.closed"}))},[s,w,p]);let De=(0,Me.useCallback)(()=>{g("open")},[]),_e=(0,Me.useCallback)(()=>{y.current=!0,g("input")},[]);(0,Me.useEffect)(()=>{if(w!=="expanded"){_(!1);return}let X=setTimeout(()=>_(!0),Mj);return()=>clearTimeout(X)},[w]);let L=(0,Me.useCallback)(X=>{De();let pe=X.trim();pe&&f.current?.sendMessage(pe)},[De]);(0,Me.useImperativeHandle)(r,()=>({open:()=>De(),close:()=>_e(),toggle:()=>{g(X=>X==="open"?"input":"open")},sendMessage:X=>L(X),sendMessageAndWait:async X=>{De();let pe=f.current;if(pe)return await pe.sendMessageAndWait(X)},reset:()=>f.current?.reset(),focus:()=>{De(),G(X=>X+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[L,De,_e]);let ke=(0,Me.useCallback)(()=>{b.trim()&&(L(b),T(""))},[b,L]),St=(0,Me.useCallback)(()=>{(f.current?.messages.length??0)>0?(g("open"),G(X=>X+1)):(y.current=!1,g(X=>X==="input"?"expanded":X))},[]),et={mode:"floating"};i.mcpServerUrl&&(et.mcpServerUrl=i.mcpServerUrl),i.channelId&&(et.channelId=i.channelId);let Ut=A.length>0&&w!=="input",ve=(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Cs,{className:"ww:size-4"})});return(0,ct.jsx)(Ef,{value:p,children:(0,ct.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":B==="auto"?"auto":void 0,className:j("ww:contents ww:font-[family-name:var(--ww-font-sans)]",B==="dark"&&"dark"),style:W,children:s&&(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)("div",{ref:I,"data-waniwani-floating":"dock","data-state":w==="open"?"hidden":"shown","data-appeared":S?"true":"false",className:j("ww:fixed ww:bottom-3 ww:sm:bottom-4 ww:left-0 ww:right-0 ww:mx-auto ww:z-[2147483002] ww:flex ww:flex-col","ww:w-[calc(100vw-2rem)] ww:transition-[max-width] ww:duration-300 ww:ease-out",Ut?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,ct.jsxs)("div",{className:j("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",Ut?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:Ut?{boxShadow:We,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[Ut&&w!=="open"&&(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:absolute ww:right-2 ww:top-2 ww:z-10 ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Qn,{className:"ww:size-4"})}),A.length>0&&(0,ct.jsx)("div",{className:j("ww:grid ww:transition-all ww:duration-300 ww:ease-out",R?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ct.jsx)("div",{className:"ww:overflow-hidden",children:(0,ct.jsx)(cd,{suggestions:A,onSelect:X=>{p.emit({name:"suggestion.clicked",properties:{text:X,index:A.indexOf(X)}}),L(X)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,ct.jsx)(BI,{animated:S,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:We},children:(0,ct.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-3.5 ww:pr-1.5 ww:py-1.5 ww:sm:pl-4 ww:sm:pr-2 ww:sm:py-2",children:[(0,ct.jsx)("input",{ref:x,type:"text",value:b,placeholder:$,onChange:X=>T(X.target.value),onFocus:St,onKeyDown:X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),ke())},className:"ww:min-w-0 ww:flex-1 ww:bg-transparent ww:py-1 ww:text-base ww:sm:text-sm ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground"}),(0,ct.jsx)("button",{type:"button",onClick:ke,disabled:!b.trim(),"aria-label":o.promptInput.submit,className:"ww:relative ww:flex ww:size-8 ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:bg-foreground ww:text-background ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",children:(0,ct.jsx)(Io,{className:"ww:size-4"})})]})})]})}),(0,ct.jsx)("div",{role:"dialog","aria-label":i.title??H,"data-waniwani-floating":"panel","data-state":w==="open"?"shown":"hidden",style:{boxShadow:We},className:j("ww:fixed ww:z-[2147483002] ww:flex ww:flex-col ww:overflow-hidden ww:bg-background","ww:inset-0 ww:w-full ww:rounded-none","ww:sm:inset-auto ww:sm:bottom-4 ww:sm:left-0 ww:sm:right-0 ww:sm:mx-auto ww:sm:h-[720px] ww:sm:max-h-[calc(100dvh-2rem)] ww:sm:w-[calc(100vw-2rem)] ww:sm:max-w-[1000px] ww:sm:rounded-2xl ww:sm:border ww:sm:border-border"),children:(0,ct.jsx)(Xf,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:et,appearance:i.appearance,title:i.title,headerActions:ve,hideHeader:!1,welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:i.suggestions?{initial:i.suggestions}:void 0,enableThreadHistory:i.enableThreadHistory,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var xa=z(Le(),1);var px=z(ne(),1),_D=(0,xa.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Zf(t,a,n),u=(0,xa.useRef)(null),c=(0,xa.useMemo)(()=>kf({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,xa.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,xa.useRef)(!1);(0,xa.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,xa.useEffect)(()=>{r?.()},[]);let p=Jf(l.visibility,s);(0,xa.useEffect)(()=>{o?.(p)},[p,o]),(0,xa.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m={mode:"inline"};return l.mcpServerUrl&&(m.mcpServerUrl=l.mcpServerUrl),l.channelId&&(m.channelId=l.channelId),(0,px.jsx)(Ef,{value:c,children:(0,px.jsx)(Xf,{ref:u,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:m,appearance:l.appearance,title:l.title,hideHeader:l.hideHeader,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:l.suggestions?{initial:l.suggestions}:void 0,enableThreadHistory:l.enableThreadHistory,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var mx="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--ww-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--ww-color-blue-400:oklch(70.7% .165 254.624);--ww-spacing:.25rem;--ww-container-sm:24rem;--ww-container-md:28rem;--ww-container-3xl:48rem;--ww-text-xs:.75rem;--ww-text-xs--line-height:calc(1/.75);--ww-text-sm:.875rem;--ww-text-sm--line-height:calc(1.25/.875);--ww-text-base:1rem;--ww-text-base--line-height:calc(1.5/1);--ww-text-lg:1.125rem;--ww-text-lg--line-height:calc(1.75/1.125);--ww-font-weight-medium:500;--ww-font-weight-semibold:600;--ww-tracking-wide:.025em;--ww-tracking-wider:.05em;--ww-radius-md:.375rem;--ww-radius-lg:.5rem;--ww-radius-xl:.75rem;--ww-radius-2xl:1rem;--ww-ease-out:cubic-bezier(0,0,.2,1);--ww-animate-spin:spin 1s linear infinite;--ww-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--ww-blur-xl:24px;--ww-default-transition-duration:.15s;--ww-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--ww-default-font-family:var(--ww-font-sans,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-default-mono-font-family:var(--ww-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--ww-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--ww-default-font-feature-settings,normal);font-variation-settings:var(--ww-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--ww-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--ww-default-mono-font-feature-settings,normal);font-variation-settings:var(--ww-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.ww\\:pointer-events-auto{pointer-events:auto}.ww\\:pointer-events-none{pointer-events:none}.ww\\:\\!relative{position:relative!important}.ww\\:absolute{position:absolute}.ww\\:fixed{position:fixed}.ww\\:relative{position:relative}.ww\\:sticky{position:sticky}.ww\\:inset-0{inset:calc(var(--ww-spacing)*0)}.ww\\:top-2{top:calc(var(--ww-spacing)*2)}.ww\\:top-full{top:100%}.ww\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:right-2{right:calc(var(--ww-spacing)*2)}.ww\\:bottom-2{bottom:calc(var(--ww-spacing)*2)}.ww\\:bottom-3{bottom:calc(var(--ww-spacing)*3)}.ww\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:left-\\[50\\%\\]{left:50%}.ww\\:isolate{isolation:isolate}.ww\\:-z-\\[1\\]{z-index:calc(1*-1)}.ww\\:z-10{z-index:10}.ww\\:z-50{z-index:50}.ww\\:z-\\[1\\]{z-index:1}.ww\\:z-\\[2147483002\\]{z-index:2147483002}.ww\\:mx-auto{margin-inline:auto}.ww\\:mt-0\\.5{margin-top:calc(var(--ww-spacing)*.5)}.ww\\:mt-1{margin-top:calc(var(--ww-spacing)*1)}.ww\\:mt-2{margin-top:calc(var(--ww-spacing)*2)}.ww\\:mt-6{margin-top:calc(var(--ww-spacing)*6)}.ww\\:mb-0{margin-bottom:calc(var(--ww-spacing)*0)}.ww\\:mb-4{margin-bottom:calc(var(--ww-spacing)*4)}.ww\\:mb-6{margin-bottom:calc(var(--ww-spacing)*6)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:contents{display:contents}.ww\\:flex{display:flex}.ww\\:grid{display:grid}.ww\\:hidden{display:none}.ww\\:inline-block{display:inline-block}.ww\\:inline-flex{display:inline-flex}.ww\\:field-sizing-content{field-sizing:content}.ww\\:size-2{width:calc(var(--ww-spacing)*2);height:calc(var(--ww-spacing)*2)}.ww\\:size-3{width:calc(var(--ww-spacing)*3);height:calc(var(--ww-spacing)*3)}.ww\\:size-3\\.5{width:calc(var(--ww-spacing)*3.5);height:calc(var(--ww-spacing)*3.5)}.ww\\:size-4{width:calc(var(--ww-spacing)*4);height:calc(var(--ww-spacing)*4)}.ww\\:size-5{width:calc(var(--ww-spacing)*5);height:calc(var(--ww-spacing)*5)}.ww\\:size-7{width:calc(var(--ww-spacing)*7);height:calc(var(--ww-spacing)*7)}.ww\\:size-8{width:calc(var(--ww-spacing)*8);height:calc(var(--ww-spacing)*8)}.ww\\:size-9{width:calc(var(--ww-spacing)*9);height:calc(var(--ww-spacing)*9)}.ww\\:size-12{width:calc(var(--ww-spacing)*12);height:calc(var(--ww-spacing)*12)}.ww\\:size-auto{width:auto;height:auto}.ww\\:size-full{width:100%;height:100%}.ww\\:h-2\\.5{height:calc(var(--ww-spacing)*2.5)}.ww\\:h-5{height:calc(var(--ww-spacing)*5)}.ww\\:h-8{height:calc(var(--ww-spacing)*8)}.ww\\:h-9{height:calc(var(--ww-spacing)*9)}.ww\\:h-16{height:calc(var(--ww-spacing)*16)}.ww\\:h-auto{height:auto}.ww\\:h-full{height:100%}.ww\\:max-h-48{max-height:calc(var(--ww-spacing)*48)}.ww\\:max-h-80{max-height:calc(var(--ww-spacing)*80)}.ww\\:min-h-0{min-height:calc(var(--ww-spacing)*0)}.ww\\:min-h-5{min-height:calc(var(--ww-spacing)*5)}.ww\\:min-h-full{min-height:100%}.ww\\:w-72{width:calc(var(--ww-spacing)*72)}.ww\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:w-auto{width:auto}.ww\\:w-fit{width:fit-content}.ww\\:w-full{width:100%}.ww\\:w-px{width:1px}.ww\\:\\[max-width\\:var\\(--ww-msg-max-width\\,80\\%\\)\\]{max-width:var(--ww-msg-max-width,80%)}.ww\\:max-w-3xl{max-width:var(--ww-container-3xl)}.ww\\:max-w-24{max-width:calc(var(--ww-spacing)*24)}.ww\\:max-w-32{max-width:calc(var(--ww-spacing)*32)}.ww\\:max-w-\\[440px\\]{max-width:440px}.ww\\:max-w-\\[720px\\]{max-width:720px}.ww\\:max-w-full{max-width:100%}.ww\\:max-w-md{max-width:var(--ww-container-md)}.ww\\:max-w-sm{max-width:var(--ww-container-sm)}.ww\\:min-w-0{min-width:calc(var(--ww-spacing)*0)}.ww\\:flex-1{flex:1}.ww\\:shrink-0{flex-shrink:0}.ww\\:grow{flex-grow:1}.ww\\:translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.ww\\:rotate-90{rotate:90deg}.ww\\:rotate-180{rotate:180deg}.ww\\:animate-\\[ww-fade-in_0\\.2s_ease-out_both\\]{animation:.2s ease-out both ww-fade-in}.ww\\:animate-pulse{animation:var(--ww-animate-pulse)}.ww\\:animate-spin{animation:var(--ww-animate-spin)}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:grid-rows-\\[0fr\\]{grid-template-rows:0fr}.ww\\:grid-rows-\\[1fr\\]{grid-template-rows:1fr}.ww\\:flex-col{flex-direction:column}.ww\\:flex-nowrap{flex-wrap:nowrap}.ww\\:flex-wrap{flex-wrap:wrap}.ww\\:items-center{align-items:center}.ww\\:items-end{align-items:flex-end}.ww\\:items-start{align-items:flex-start}.ww\\:justify-between{justify-content:space-between}.ww\\:justify-center{justify-content:center}.ww\\:gap-1{gap:calc(var(--ww-spacing)*1)}.ww\\:gap-1\\.5{gap:calc(var(--ww-spacing)*1.5)}.ww\\:gap-2{gap:calc(var(--ww-spacing)*2)}.ww\\:gap-3{gap:calc(var(--ww-spacing)*3)}.ww\\:gap-6{gap:calc(var(--ww-spacing)*6)}:where(.ww\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.ww\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.ww\\:self-stretch{align-self:stretch}.ww\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ww\\:\\!overflow-hidden{overflow:hidden!important}.ww\\:overflow-auto{overflow:auto}.ww\\:overflow-hidden{overflow:hidden}.ww\\:overflow-x-auto{overflow-x:auto}.ww\\:overflow-y-auto{overflow-y:auto}.ww\\:overflow-y-hidden{overflow-y:hidden}.ww\\:\\!rounded-full{border-radius:3.40282e38px!important}.ww\\:rounded{border-radius:var(--ww-radius,16px)}.ww\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:rounded-\\[20px\\]{border-radius:20px}.ww\\:rounded-\\[inherit\\]{border-radius:inherit}.ww\\:rounded-\\[var\\(--ww-radius\\)\\]{border-radius:var(--ww-radius)}.ww\\:rounded-full{border-radius:3.40282e38px}.ww\\:rounded-lg{border-radius:var(--ww-radius-lg)}.ww\\:rounded-md{border-radius:var(--ww-radius-md)}.ww\\:rounded-none{border-radius:0}.ww\\:rounded-xl{border-radius:var(--ww-radius-xl)}.ww\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:border-0{border-style:var(--tw-border-style);border-width:0}.ww\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ww\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ww\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:border-muted-foreground\\/50{border-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:border-muted-foreground\\/50{border-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)50%,transparent)}}.ww\\:border-transparent{border-color:#0000}.ww\\:bg-accent{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:bg-background,.ww\\:bg-background\\/20{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/20{background-color:color-mix(in oklab,var(--ww-color-background,#fff)20%,transparent)}}.ww\\:bg-border{background-color:var(--ww-color-border,#e5e7eb)}.ww\\:bg-foreground,.ww\\:bg-foreground\\/5{background-color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-foreground\\/5{background-color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)5%,transparent)}}.ww\\:bg-input{background-color:var(--ww-color-input,#f9fafb)}.ww\\:bg-muted{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:bg-muted-foreground\\/60{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted-foreground\\/60{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)60%,transparent)}}.ww\\:bg-muted\\/50{background-color:var(--ww-color-muted,#f1f5f9)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted\\/50{background-color:color-mix(in oklab,var(--ww-color-muted,#f1f5f9)50%,transparent)}}.ww\\:bg-primary{background-color:var(--ww-color-primary,#6366f1)}.ww\\:bg-tool-card{background-color:var(--ww-color-tool-card,#f4f4f5)}.ww\\:bg-transparent{background-color:#0000}.ww\\:object-cover{object-fit:cover}.ww\\:p-0{padding:calc(var(--ww-spacing)*0)}.ww\\:p-1{padding:calc(var(--ww-spacing)*1)}.ww\\:p-1\\.5{padding:calc(var(--ww-spacing)*1.5)}.ww\\:p-2{padding:calc(var(--ww-spacing)*2)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-1\\.5{padding-inline:calc(var(--ww-spacing)*1.5)}.ww\\:px-2{padding-inline:calc(var(--ww-spacing)*2)}.ww\\:px-3{padding-inline:calc(var(--ww-spacing)*3)}.ww\\:px-3\\.5{padding-inline:calc(var(--ww-spacing)*3.5)}.ww\\:px-4{padding-inline:calc(var(--ww-spacing)*4)}.ww\\:px-6{padding-inline:calc(var(--ww-spacing)*6)}.ww\\:\\!py-0{padding-block:calc(var(--ww-spacing)*0)!important}.ww\\:py-0\\.5{padding-block:calc(var(--ww-spacing)*.5)}.ww\\:py-1{padding-block:calc(var(--ww-spacing)*1)}.ww\\:py-1\\.5{padding-block:calc(var(--ww-spacing)*1.5)}.ww\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:py-2\\.5{padding-block:calc(var(--ww-spacing)*2.5)}.ww\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:py-6{padding-block:calc(var(--ww-spacing)*6)}.ww\\:py-12{padding-block:calc(var(--ww-spacing)*12)}.ww\\:pt-1{padding-top:calc(var(--ww-spacing)*1)}.ww\\:pt-2{padding-top:calc(var(--ww-spacing)*2)}.ww\\:pt-2\\.5{padding-top:calc(var(--ww-spacing)*2.5)}.ww\\:pt-3{padding-top:calc(var(--ww-spacing)*3)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-1{padding-bottom:calc(var(--ww-spacing)*1)}.ww\\:pb-1\\.5{padding-bottom:calc(var(--ww-spacing)*1.5)}.ww\\:pb-2{padding-bottom:calc(var(--ww-spacing)*2)}.ww\\:pb-2\\.5{padding-bottom:calc(var(--ww-spacing)*2.5)}.ww\\:pb-3{padding-bottom:calc(var(--ww-spacing)*3)}.ww\\:pb-8{padding-bottom:calc(var(--ww-spacing)*8)}.ww\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:text-center{text-align:center}.ww\\:text-left{text-align:left}.ww\\:font-\\[family-name\\:var\\(--ww-font\\)\\]{font-family:var(--ww-font)}.ww\\:font-\\[family-name\\:var\\(--ww-font-sans\\)\\]{font-family:var(--ww-font-sans)}.ww\\:font-mono{font-family:var(--ww-font-mono)}.ww\\:text-base{font-size:var(--ww-text-base);line-height:var(--tw-leading,var(--ww-text-base--line-height))}.ww\\:text-lg{font-size:var(--ww-text-lg);line-height:var(--tw-leading,var(--ww-text-lg--line-height))}.ww\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:text-xs{font-size:var(--ww-text-xs);line-height:var(--tw-leading,var(--ww-text-xs--line-height))}.ww\\:\\[font-size\\:var\\(--ww-font-size\\,1rem\\)\\]{font-size:var(--ww-font-size,1rem)}.ww\\:text-\\[10px\\]{font-size:10px}.ww\\:text-\\[11px\\]{font-size:11px}.ww\\:\\[line-height\\:var\\(--ww-line-height\\,1\\.5\\)\\]{line-height:var(--ww-line-height,1.5)}.ww\\:font-medium{--tw-font-weight:var(--ww-font-weight-medium);font-weight:var(--ww-font-weight-medium)}.ww\\:font-semibold{--tw-font-weight:var(--ww-font-weight-semibold);font-weight:var(--ww-font-weight-semibold)}.ww\\:tracking-wide{--tw-tracking:var(--ww-tracking-wide);letter-spacing:var(--ww-tracking-wide)}.ww\\:tracking-wider{--tw-tracking:var(--ww-tracking-wider);letter-spacing:var(--ww-tracking-wider)}.ww\\:break-words{overflow-wrap:break-word}.ww\\:break-all{word-break:break-all}.ww\\:whitespace-nowrap{white-space:nowrap}.ww\\:whitespace-pre-wrap{white-space:pre-wrap}.ww\\:text-background{color:var(--ww-color-background,#fff)}.ww\\:text-foreground,.ww\\:text-foreground\\/80{color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:text-foreground\\/80{color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)80%,transparent)}}.ww\\:text-muted-foreground{color:var(--ww-color-muted-foreground,#6b7280)}.ww\\:text-primary{color:var(--ww-color-primary,#6366f1)}.ww\\:text-primary-foreground{color:var(--ww-color-primary-foreground,#1f2937)}.ww\\:uppercase{text-transform:uppercase}.ww\\:italic{font-style:italic}.ww\\:opacity-0{opacity:0}.ww\\:opacity-70{opacity:.7}.ww\\:opacity-100{opacity:1}.ww\\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-\\[\\#0a6c74\\]{--tw-ring-color:#0a6c74}.ww\\:ring-blue-400\\/70{--tw-ring-color:var(--ww-color-blue-400)}@supports (color:color-mix(in lab, red, red)){.ww\\:ring-blue-400\\/70{--tw-ring-color:color-mix(in oklab,var(--ww-color-blue-400)70%,transparent)}}.ww\\:ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ww\\:ring-offset-background{--tw-ring-offset-color:var(--ww-color-background,#fff)}.ww\\:backdrop-blur-xl{--tw-backdrop-blur:blur(var(--ww-blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-\\[max-width\\]{transition-property:max-width;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.ww\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.ww\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.ww\\:ease-out{--tw-ease:var(--ww-ease-out);transition-timing-function:var(--ww-ease-out)}.ww\\:outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.ww\\:group-hover\\:opacity-0:is(:where(.ww\\:group):hover *){opacity:0}.ww\\:group-hover\\:opacity-100:is(:where(.ww\\:group):hover *){opacity:1}}.ww\\:group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.ww\\:group).is-assistant *){color:var(--ww-color-foreground,#1f2937)}.ww\\:group-\\[\\.is-user\\]\\:ml-auto:is(:where(.ww\\:group).is-user *){margin-left:auto}.ww\\:group-\\[\\.is-user\\]\\:\\[border-radius\\:var\\(--ww-msg-radius\\,8px\\)\\]:is(:where(.ww\\:group).is-user *){border-radius:var(--ww-msg-radius,8px)}.ww\\:group-\\[\\.is-user\\]\\:bg-user-bubble:is(:where(.ww\\:group).is-user *){background-color:var(--ww-color-user-bubble,#f4f4f4)}.ww\\:group-\\[\\.is-user\\]\\:\\[padding\\:var\\(--ww-msg-pad-y\\,12px\\)_var\\(--ww-msg-pad-x\\,16px\\)\\]:is(:where(.ww\\:group).is-user *){padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px)}.ww\\:group-\\[\\.is-user\\]\\:\\[color\\:var\\(--ww-color-user-bubble-text\\)\\]:is(:where(.ww\\:group).is-user *){color:var(--ww-color-user-bubble-text)}.ww\\:placeholder\\:text-muted-foreground::placeholder{color:var(--ww-color-muted-foreground,#6b7280)}@media (hover:hover){.ww\\:hover\\:border-primary\\/30:hover{border-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)30%,transparent)}}.ww\\:hover\\:bg-accent:hover{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:hover\\:bg-foreground:hover{background-color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:bg-muted:hover{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)10%,transparent)}}.ww\\:hover\\:bg-primary\\/90:hover{background-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)90%,transparent)}}.ww\\:hover\\:text-accent-foreground:hover{color:var(--ww-color-accent-foreground,#1f2937)}.ww\\:hover\\:text-foreground:hover{color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:underline:hover{text-decoration-line:underline}}.ww\\:disabled\\:pointer-events-none:disabled{pointer-events:none}.ww\\:disabled\\:opacity-40:disabled{opacity:.4}.ww\\:disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.ww\\:sm\\:inset-auto{inset:auto}.ww\\:sm\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:sm\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:sm\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:sm\\:mx-auto{margin-inline:auto}.ww\\:sm\\:h-\\[720px\\]{height:720px}.ww\\:sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.ww\\:sm\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:sm\\:max-w-\\[1000px\\]{max-width:1000px}.ww\\:sm\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:sm\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:sm\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:sm\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:sm\\:text-\\[11px\\]{font-size:11px}}.ww\\:\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--ww-spacing)*0)}.ww\\:\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--ww-spacing)*0)}}@keyframes ww-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes ww-fade-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes ww-pulse{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes ww-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){[data-waniwani-chat] [data-waniwani-shimmer]{color:var(--ww-color-muted-foreground)!important;animation:none!important}}[data-waniwani-floating=dock]{transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility 0s linear .42s}[data-waniwani-floating=dock][data-appeared=true][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility;transform:translateY(0)}[data-waniwani-floating=dock][data-appeared=false],[data-waniwani-floating=dock][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(1rem)}[data-waniwani-floating=panel]{transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility 0s linear .44s}[data-waniwani-floating=panel][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;clip-path:inset(-40px round 18px);transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility}[data-waniwani-floating=panel][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;clip-path:inset(calc(100% - 60px) 12% 0 round 24px)}@media (max-width:639px){[data-waniwani-floating=panel][data-state=shown]{clip-path:inset(0)}[data-waniwani-floating=panel][data-state=hidden]{clip-path:inset(calc(100% - 72px) 6% 0 round 22px)}}@media (prefers-reduced-motion:reduce){[data-waniwani-floating=dock],[data-waniwani-floating=panel]{clip-path:none;transition:visibility 0s linear 10ms}[data-waniwani-floating=dock][data-appeared=true][data-state=shown],[data-waniwani-floating=panel][data-state=shown]{transition:visibility}}[data-waniwani-chat] ::-webkit-scrollbar{width:8px}[data-waniwani-chat] ::-webkit-scrollbar-track{background:0 0}[data-waniwani-chat] ::-webkit-scrollbar-thumb{background:var(--ww-color-border);border-radius:9999px}[data-waniwani-chat] ::-webkit-scrollbar-thumb:hover{background:var(--ww-color-muted-foreground)}[data-waniwani-chat] *{scrollbar-width:thin;scrollbar-color:var(--ww-color-border)transparent}[data-waniwani-chat]{--ww-color-background:var(--ww-bg,#fff);--ww-color-foreground:var(--ww-text,#1f2937);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#1f2937);--ww-color-muted-foreground:var(--ww-muted,#6b7280);--ww-color-border:var(--ww-border,#e5e7eb);--ww-color-input:var(--ww-input-bg,#f9fafb);--ww-color-accent:var(--ww-assistant-bubble,#f3f4f6);--ww-color-accent-foreground:var(--ww-text,#1f2937);--ww-color-user-bubble:var(--ww-user-bubble,#f4f4f4);--ww-color-card:var(--ww-bg,#fff);--ww-color-card-foreground:var(--ww-text,#1f2937);--ww-color-card-header:var(--ww-header-bg,#fff);--ww-color-card-header-foreground:var(--ww-header-text,#1f2937);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#f4f4f5);--ww-radius:var(--ww-radius,16px);--ww-font-sans:var(--ww-font,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-color-user-bubble-text:var(--ww-user-bubble-text,var(--ww-color-primary-foreground));--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#eceef499;--ww-glass-border:#0000000f;border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-color-border);box-shadow:var(--ww-shadow,none)}[data-waniwani-chat][data-assistant-bubble=true] .ww-message-assistant .ww-bubble{background:var(--ww-color-accent);color:var(--ww-color-assistant-bubble-text);border-radius:var(--ww-msg-radius,8px);padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px);width:fit-content;max-width:var(--ww-msg-max-width,80%)}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto]{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}}[data-waniwani-chat] [data-streamdown=table-wrapper]{flex-direction:column;gap:.5rem;margin-top:1rem;margin-bottom:1rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:first-child:has(button){justify-content:flex-end;align-items:center;gap:.25rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:last-child{overflow-x:auto}[data-waniwani-chat] [data-streamdown=table]{border-collapse:collapse;border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;overflow:hidden}[data-waniwani-chat] [data-streamdown=table-header]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-body]{background-color:color-mix(in srgb,var(--ww-color-accent)40%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]>tr+tr{border-top:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-row]{border-bottom:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-header-cell]{white-space:nowrap;text-align:left;padding:.5rem 1rem;font-size:.875rem;font-weight:600}[data-waniwani-chat] [data-streamdown=table-cell]{padding:.5rem 1rem;font-size:.875rem}[data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary);overflow-wrap:anywhere;cursor:pointer;font-weight:500;text-decoration:underline}[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}}[data-waniwani-chat].dark [data-waniwani-logo],.dark [data-waniwani-chat] [data-waniwani-logo]{filter:invert()}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-waniwani-logo]{filter:invert()}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{z-index:50;background-color:var(--ww-color-background);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=link-safety-modal]{background-color:color-mix(in srgb,var(--ww-color-background)50%,transparent)}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);width:100%;max-width:28rem;color:var(--ww-color-foreground);border-radius:.75rem;flex-direction:column;gap:1rem;margin:0 1rem;padding:1.5rem;display:flex;position:relative;box-shadow:0 10px 25px #0000001a}[data-waniwani-chat] [data-streamdown=link-safety-modal] button{cursor:pointer}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child{color:var(--ww-color-muted-foreground);background:0 0;border:none;border-radius:.375rem;padding:.25rem;transition:background-color .15s,color .15s;position:absolute;top:1rem;right:1rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child:hover{background-color:var(--ww-color-accent);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type{flex-direction:column;gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>div{align-items:center;gap:.5rem;font-size:1.125rem;font-weight:600;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>p{color:var(--ww-color-muted-foreground);font-size:.875rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:nth-child(3){word-break:break-all;background-color:var(--ww-color-accent);border-radius:.375rem;max-height:8rem;padding:.75rem;font-family:ui-monospace,monospace;font-size:.875rem;overflow-y:auto}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child{gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button{border:none;border-radius:.375rem;flex:1;justify-content:center;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:background-color .15s;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child:hover{background-color:var(--ww-color-accent)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child{background-color:var(--ww-color-primary);color:#fff}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child:hover{opacity:.9}[data-waniwani-chat] [data-streamdown=ordered-list]{white-space:normal;list-style-type:decimal;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=ordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=unordered-list]{white-space:normal;list-style-type:disc;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=unordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=list-item]{padding-top:.25rem;padding-bottom:.25rem}[data-waniwani-chat] [data-streamdown=list-item]>p{display:inline}[data-waniwani-chat] [data-streamdown=inline-code]{background-color:var(--ww-color-accent);border-radius:.25rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:.875rem}[data-waniwani-chat] [data-streamdown=heading-1]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.875rem;font-weight:600;line-height:2.25rem}[data-waniwani-chat] [data-streamdown=heading-2]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.5rem;font-weight:600;line-height:2rem}[data-waniwani-chat] [data-streamdown=heading-3]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-4]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.125rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-5]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;font-weight:600;line-height:1.5rem}[data-waniwani-chat] [data-streamdown=heading-6]{margin-top:1.5rem;margin-bottom:.5rem;font-size:.875rem;font-weight:600;line-height:1.25rem}[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid var(--ww-color-muted-foreground);margin-top:1rem;margin-bottom:1rem}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid color-mix(in srgb,var(--ww-color-muted-foreground)30%,transparent)}}[data-waniwani-chat] [data-streamdown=blockquote]{color:var(--ww-color-muted-foreground);padding-left:1rem;font-style:italic}[data-waniwani-chat] [data-streamdown=horizontal-rule]{border-color:var(--ww-color-border);margin-top:1.5rem;margin-bottom:1.5rem}[data-waniwani-chat] [data-streamdown=strong]{font-weight:600}[data-waniwani-chat] [data-streamdown=image-wrapper]{margin-top:1rem;margin-bottom:1rem;display:inline-block;position:relative}[data-waniwani-chat] [data-streamdown=image]{border-radius:.5rem;max-width:100%}[data-waniwani-chat] [data-streamdown=code-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;margin-top:1rem;margin-bottom:1rem;overflow:hidden}[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:var(--ww-color-accent);justify-content:space-between;align-items:center;display:flex}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=code-block-header]{color:var(--ww-color-muted-foreground);padding:.75rem;font-size:.75rem}[data-waniwani-chat] [data-streamdown=code-block-body]{padding:1rem;font-size:.875rem;overflow-x:auto}[data-waniwani-chat] [data-streamdown=code-block-copy-button],[data-waniwani-chat] [data-streamdown=code-block-download-button]{cursor:pointer;color:var(--ww-color-muted-foreground);background:0 0;border:none;padding:.25rem;transition:color .15s}[data-waniwani-chat] [data-streamdown=code-block-copy-button]:hover,[data-waniwani-chat] [data-streamdown=code-block-download-button]:hover{color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=mermaid-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;height:auto;margin-top:1rem;margin-bottom:1rem;padding:1rem;position:relative}[data-waniwani-chat] [data-streamdown=mermaid]{width:100%;height:100%}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}",bt=null,Jr=null,sa=null,tp=null,Dj="waniwani-chat-sizing",_j="waniwani-chat-defaults",Oj="waniwani-chat-chrome",Pj="waniwani-chat-auto-card",Nj=`:where([data-waniwani-embed]){height:${EI}}`,Bj=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",Uj=":where([data-waniwani-embed]){border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-border,transparent);box-shadow:var(--ww-shadow,none)}",Fj=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:28rem;margin-inline:auto;border-radius:16px;overflow:hidden;border-style:solid;border-width:var(--ww-border-width,1px);border-color:var(--ww-border,rgba(0,0,0,0.1));box-shadow:var(--ww-shadow,0 10px 30px rgba(0,0,0,0.08))}";function ap(e,t){if(typeof document>"u"||document.getElementById(e))return;let a=document.createElement("style");a.id=e,a.textContent=t,document.head.appendChild(a)}function zj(e,t){let a=t.appearance?.variables;!a||!(e instanceof HTMLElement)||(typeof a.borderWidth=="number"&&e.style.setProperty("--ww-border-width",`${a.borderWidth}px`),a.borderColor&&e.style.setProperty("--ww-border",a.borderColor),a.boxShadow&&e.style.setProperty("--ww-shadow",a.boxShadow))}function ND(e,t){if(mx&&mx!=="__WANIWANI_EMBED_CSS__"){let n=document.createElement("style");n.textContent=mx,e.appendChild(n)}let a=document.createElement("style");if(a.textContent="[data-waniwani-chat]{border-width:0;box-shadow:none}",e.appendChild(a),t.css)try{let n=new URL(t.css,window.location.href);if(n.protocol==="https:"||n.protocol==="http:"){let r=document.createElement("link");r.rel="stylesheet",r.href=n.href,e.appendChild(r)}else console.warn("[Waniwani] Custom CSS URL must use http or https protocol.")}catch{console.warn("[Waniwani] Invalid custom CSS URL:",t.css)}}var OD="data-waniwani-embed",hx="data-waniwani-auto";function qj(e){let t=document.querySelector(`[${OD}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(OD,""),a.setAttribute(hx,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function Hj(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function jj(e,t,a,n){let r=qj(n);ap(Dj,Nj),e.height&&r instanceof HTMLElement&&(r.style.height=Hj(e.height)),e.appearance?.theme&&ap(_j,Bj),ap(Oj,Uj),r.hasAttribute(hx)&&ap(Pj,Fj),zj(r,e),sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(sa);let o=sa,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let f=Number.parseFloat(d.maxHeight);if(!Number.isFinite(f)){o.style.removeProperty("max-height");return}let p=f;d.boxSizing==="border-box"&&(p-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),p>0?o.style.maxHeight=`${p}px`:o.style.removeProperty("max-height")};i(),tp=new ResizeObserver(i),tp.observe(r);let l=sa.attachShadow({mode:"open"});ND(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=bu.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=Kf(e.api??"",e.token,e.channelId);d?.visibility&&!Qf(d.visibility,window.location.pathname)&&c(!1)}return Jr=gx.default.createRoot(s),Jr.render(bu.default.createElement(_D,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{tp?.disconnect(),tp=null,Jr?.unmount(),Jr=null,sa?.remove(),sa=null,r.hasAttribute(hx)&&r.remove(),bt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let f=u.current?.chat;if(f)return await f.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function Vj(e,t,a){sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(sa);let n=sa.attachShadow({mode:"open"});ND(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=bu.default.createRef();return Jr=gx.default.createRoot(r),Jr.render(bu.default.createElement(DD,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{Jr?.unmount(),Jr=null,sa?.remove(),sa=null,bt=null},open:()=>o.current?.open(),close:()=>o.current?.close(),toggle:()=>o.current?.toggle(),sendMessage:i=>o.current?.sendMessage(i),sendMessageAndWait:async i=>{if(o.current)return o.current.sendMessageAndWait(i)},reset:()=>o.current?.reset(),focus:()=>o.current?.focus(),getMessages:()=>o.current?.getMessages()??[],getSessionId:()=>o.current?.getSessionId()}}function BD(e){if(bt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),bt;let t=Jh(),a=od(),n=hs(e,void 0,a);rd(n.visitorId);let r=n.mode==="floating"?Vj(n,e,a):jj(n,e,a,t),o=n.api??"",i=n.token?TI({api:o,token:n.token,channelId:n.channelId,getSource:()=>Kf(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):Qh("no public token configured (set data-token or pass token to init())");return bt={...r,track:i.track,identify:(l,s)=>i.identify(l,s),setVisitorId:l=>ps(l),getVisitorId:()=>Kn(),destroy:()=>{i.shutdown(),r.destroy()}},bt}function Gj(){bt&&bt.destroy()}var UD=Qh("chat widget is not initialized (call WaniWani.chat.init() first)"),cl=()=>bt?bt.track:UD.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:BD,destroy:Gj,open:()=>bt?.open(),close:()=>bt?.close(),toggle:()=>bt?.toggle(),sendMessage:e=>bt?.sendMessage(e),sendMessageAndWait:async e=>{if(bt)return bt.sendMessageAndWait(e)},reset:()=>bt?.reset(),focus:()=>bt?.focus(),getMessages:()=>bt?.getMessages()??[],getSessionId:()=>bt?.getSessionId(),track:Object.assign(e=>cl()(e),{priceShown:e=>cl().priceShown(e),pricesCompared:e=>cl().pricesCompared(e),optionSelected:e=>cl().optionSelected(e),leadQualified:e=>cl().leadQualified(e),converted:e=>cl().converted(e)}),identify:(e,t)=>bt?bt.identify(e,t):UD.identify(e,t),setVisitorId:e=>ps(e),getVisitorId:()=>Kn()};function PD(){if(od().token)try{BD()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",PD):PD();})();
|
|
137
|
+
`)}})}};var cx=Uf(()=>hu(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("error"),errorText:h.string()}),h.strictObject({type:h.literal("tool-input-start"),toolCallId:h.string(),toolName:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-delta"),toolCallId:h.string(),inputTextDelta:h.string()}),h.strictObject({type:h.literal("tool-input-available"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-input-error"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),errorText:h.string(),title:h.string().optional()}),h.strictObject({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),h.strictObject({type:h.literal("tool-output-available"),toolCallId:h.string(),output:h.unknown(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional(),preliminary:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-error"),toolCallId:h.string(),errorText:h.string(),providerExecuted:h.boolean().optional(),providerMetadata:Z.optional(),dynamic:h.boolean().optional()}),h.strictObject({type:h.literal("tool-output-denied"),toolCallId:h.string()}),h.strictObject({type:h.literal("reasoning-start"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:Z.optional()}),h.strictObject({type:h.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:h.string().optional(),data:h.unknown(),transient:h.boolean().optional()}),h.strictObject({type:h.literal("start-step")}),h.strictObject({type:h.literal("finish-step")}),h.strictObject({type:h.literal("start"),messageId:h.string().optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("finish"),finishReason:h.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:h.unknown().optional()}),h.strictObject({type:h.literal("abort"),reason:h.string().optional()}),h.strictObject({type:h.literal("message-metadata"),messageMetadata:h.unknown()})])));function ij(e){return e.type.startsWith("data-")}function ux(e){return e.type.startsWith("tool-")}function lj(e){return e.type==="dynamic-tool"}function Hf(e){return ux(e)||lj(e)}function lD(e){return e.type.split("-").slice(1).join("-")}function sj({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function uj({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(l,s){await n(async({state:u,write:c})=>{var d,f,p,m;function x(g){let T=u.message.parts.filter(Hf).find(S=>S.toolCallId===g);if(T==null)throw new ll({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return T}function I(g){var b;let T=u.message.parts.find(R=>ux(R)&&R.toolCallId===g.toolCallId),S=g,M=T;if(T!=null){T.state=g.state,M.input=S.input,M.output=S.output,M.errorText=S.errorText,M.rawInput=S.rawInput,M.preliminary=S.preliminary,g.title!==void 0&&(M.title=g.title),M.providerExecuted=(b=S.providerExecuted)!=null?b:T.providerExecuted;let R=S.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let _=T;_.resultProviderMetadata=R}else T.callProviderMetadata=R}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:S.providerMetadata}:{},...S.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:S.providerMetadata}:{}})}function y(g){var b,T;let S=u.message.parts.find(_=>_.type==="dynamic-tool"&&_.toolCallId===g.toolCallId),M=g,R=S;if(S!=null){S.state=g.state,R.toolName=g.toolName,R.input=M.input,R.output=M.output,R.errorText=M.errorText,R.rawInput=(b=M.rawInput)!=null?b:R.rawInput,R.preliminary=M.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(T=M.providerExecuted)!=null?T:S.providerExecuted;let _=M.providerMetadata;if(_!=null)if(g.state==="output-available"||g.state==="output-error"){let L=S;L.resultProviderMetadata=_}else S.callProviderMetadata=_}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:g.title,...M.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function w(g){if(g!=null){let b=u.message.metadata!=null?wD(u.message.metadata,g):g;t!=null&&await qf({value:b,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=b}}switch(l.type){case"text-start":{let g={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[l.id];if(g==null)throw new ll({chunkType:"text-delta",chunkId:l.id,message:`Received text-delta for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(d=l.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[l.id];if(g==null)throw new ll({chunkType:"text-end",chunkId:l.id,message:`Received text-end for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(f=l.providerMetadata)!=null?f:g.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ll({chunkType:"reasoning-delta",chunkId:l.id,message:`Received reasoning-delta for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=l.delta,g.providerMetadata=(p=l.providerMetadata)!=null?p:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[l.id];if(g==null)throw new ll({chunkType:"reasoning-end",chunkId:l.id,message:`Received reasoning-end for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(m=l.providerMetadata)!=null?m:g.providerMetadata,g.state="done",delete u.activeReasoningParts[l.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:l.mediaType,url:l.url,...l.providerMetadata!=null?{providerMetadata:l.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:l.sourceId,url:l.url,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:l.sourceId,mediaType:l.mediaType,title:l.title,filename:l.filename,providerMetadata:l.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter(ux);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:g.length,dynamic:l.dynamic,title:l.title},l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[l.toolCallId];if(g==null)throw new ll({chunkType:"tool-input-delta",chunkId:l.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${l.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=l.inputTextDelta;let{value:b}=await yu(g.text);g.dynamic?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}):I({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}),c();break}case"tool-input-available":{l.dynamic?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}),c(),o&&!l.providerExecuted&&await o({toolCall:l});break}case"tool-input-error":{let g=u.message.parts.filter(Hf).find(T=>T.toolCallId===l.toolCallId);(g!=null?g.type==="dynamic-tool":!!l.dynamic)?y({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):I({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:void 0,rawInput:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),c();break}case"tool-approval-request":{let g=x(l.toolCallId);g.state="approval-requested",g.approval={id:l.approvalId},c();break}case"tool-output-denied":{let g=x(l.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:lD(g),state:"output-available",input:g.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=x(l.toolCallId);g.type==="dynamic-tool"?y({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):I({toolCallId:l.toolCallId,toolName:lD(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}),c();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{l.messageId!=null&&(u.message.id=l.messageId),await w(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await w(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(ij(l)){if(a?.[l.type]!=null){let T=u.message.parts.findIndex(M=>"id"in M&&"data"in M&&M.id===l.id&&M.type===l.type),S=T>=0?T:u.message.parts.length;await qf({value:l.data,schema:a[l.type],context:{field:`message.parts[${S}].data`,entityName:l.type,entityId:l.id}})}let g=l;if(g.transient){i?.(g);break}let b=g.id!=null?u.message.parts.find(T=>g.type===T.type&&g.id===T.id):void 0;b!=null?b.data=g.data:u.message.parts.push(g),i?.(g),c()}}s.enqueue(l)})}}))}async function cj({stream:e,onError:t}){let a=e.getReader();try{for(;;){let{done:n}=await a.read();if(n)break}}catch(n){t?.(n)}finally{a.releaseLock()}}var Vre=ir({prefix:"aitxt",size:24});var $re=Uf(()=>hu(h.array(h.object({id:h.string(),role:h.enum(["system","user","assistant"]),metadata:h.unknown().optional(),parts:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:Z.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:Z.optional()}),h.object({type:h.literal("step-start")}),h.object({type:h.string().startsWith("data-"),id:h.string().optional(),data:h.unknown()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-streaming"),input:h.unknown().optional(),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("input-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-available"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-error"),input:h.unknown(),rawInput:h.unknown().optional(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.literal("dynamic-tool"),toolName:h.string(),toolCallId:h.string(),state:h.literal("output-denied"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-streaming"),providerExecuted:h.boolean().optional(),callProviderMetadata:Z.optional(),input:h.unknown().optional(),output:h.never().optional(),errorText:h.never().optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("input-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.never().optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-requested"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.never().optional(),reason:h.never().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("approval-responded"),input:h.unknown(),providerExecuted:h.boolean().optional(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.boolean(),reason:h.string().optional()})}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-available"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.unknown(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),preliminary:h.boolean().optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-error"),providerExecuted:h.boolean().optional(),input:h.unknown(),rawInput:h.unknown().optional(),output:h.never().optional(),errorText:h.string(),callProviderMetadata:Z.optional(),resultProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!0),reason:h.string().optional()}).optional()}),h.object({type:h.string().startsWith("tool-"),toolCallId:h.string(),state:h.literal("output-denied"),providerExecuted:h.boolean().optional(),input:h.unknown(),output:h.never().optional(),errorText:h.never().optional(),callProviderMetadata:Z.optional(),approval:h.object({id:h.string(),approved:h.literal(!1),reason:h.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var Kre=ir({prefix:"aiobj",size:24});function xD(e){return({url:t,abortSignal:a})=>H9({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var dj=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,a)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){a(n)}}),this.processQueue()})}};var Yre=ir({prefix:"aiobj",size:24});var Qre=xD();var fj="AI_NoSuchProviderError",pj=`vercel.ai.error.${fj}`,mj=Symbol.for(pj),hj;hj=mj;var Jre=xD();async function gj(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:a,type:n}=t,r=await new Promise((o,i)=>{let l=new FileReader;l.onload=s=>{var u;o((u=s.target)==null?void 0:u.result)},l.onerror=s=>i(s),l.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var yj=class{constructor({api:e="/api/chat",credentials:t,headers:a,body:n,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=a,this.body=n,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var a,n,r,o,i;let l=await Tn(this.body),s=await Tn(this.headers),u=await Tn(this.credentials),c={...Zr(s),...Zr(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...l,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d?.api)!=null?n:this.api,p=d?.headers!==void 0?Zr(d.headers):c,m=d?.body!==void 0?d.body:{...l,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:x,signal:e});if(!y.ok)throw new Error((i=await y.text())!=null?i:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await Tn(this.body),l=await Tn(this.headers),s=await Tn(this.credentials),u={...Zr(l),...Zr(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:s,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?Zr(c.headers):u,p=(n=c?.credentials)!=null?n:s,x=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:f,credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((o=await x.text())!=null?o:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},dx=class extends yj{constructor(e={}){super(e)}processResponseStream(e){return iD({stream:e,schema:cx}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},vD=class{constructor({generateId:e=eD,id:t=e(),transport:a=new dx,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new dj,this.sendMessage=async(d,f)=>{var p,m,x,I;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await gj(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:y=d,d.messageId!=null){let w=this.state.messages.findIndex(g=>g.id===d.messageId);if(w===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[w].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,w+1),this.state.replaceMessage(w,{...y,id:d.messageId,role:(m=y.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(x=y.id)!=null?x:this.generateId(),role:(I=y.role)!=null?I:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{let p=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:p,options:m})=>this.jobExecutor.run(async()=>{let x=this.state.messages,I=x[x.length-1],y=w=>Hf(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:w;this.state.replaceMessage(x.length-1,{...I,parts:I.parts.map(y)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(y)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(w=>{var g;w&&this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m})})}),this.addToolOutput=async({state:d="output-available",toolCallId:f,output:p,errorText:m,options:x})=>this.jobExecutor.run(async()=>{let I=this.state.messages,y=I[I.length-1],w=g=>Hf(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(I.length-1,{...y,parts:y.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(g=>{var b;g&&this.makeRequest({trigger:"submit-message",messageId:(b=this.lastMessage)==null?void 0:b.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=a,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=r,this.state=o,this.onError=i,this.onToolCall=l,this.onFinish=s,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:a,body:n,messageId:r}){var o,i,l;let s;if(e==="resume-stream")try{let p=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(p==null)return;s=p}catch(p){this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,f=!1;try{let p={state:sj({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=p;let m;e==="resume-stream"?m=s:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let x=I=>this.jobExecutor.run(()=>I({state:p.state,write:()=>{var y;this.setStatus({status:"streaming"}),p.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await cj({stream:uj({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:I=>{throw I}}),onError:I=>{throw I}}),this.setStatus({status:"ready"})}catch(p){if(c||p.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:t,headers:a,body:n})}};var kD=q(SD(),1);var bu=q(Ie(),1);var Gf=q(Ie(),1);var CD=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},ut=(e,t,a)=>(CD(e,t,"read from private field"),a?a.call(e):t.get(e)),En=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},Qr=(e,t,a,n)=>(CD(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function xj(e,t){return t!=null?(0,kD.default)(e,t):e}var Qa,jf,Vf,wu,xu,vu,sl,fx,px,vj=class{constructor(e=[]){En(this,Qa,void 0),En(this,jf,"ready"),En(this,Vf,void 0),En(this,wu,new Set),En(this,xu,new Set),En(this,vu,new Set),this.pushMessage=t=>{Qr(this,Qa,ut(this,Qa).concat(t)),ut(this,sl).call(this)},this.popMessage=()=>{Qr(this,Qa,ut(this,Qa).slice(0,-1)),ut(this,sl).call(this)},this.replaceMessage=(t,a)=>{Qr(this,Qa,[...ut(this,Qa).slice(0,t),this.snapshot(a),...ut(this,Qa).slice(t+1)]),ut(this,sl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?xj(t,a):t;return ut(this,wu).add(n),()=>{ut(this,wu).delete(n)}},this["~registerStatusCallback"]=t=>(ut(this,xu).add(t),()=>{ut(this,xu).delete(t)}),this["~registerErrorCallback"]=t=>(ut(this,vu).add(t),()=>{ut(this,vu).delete(t)}),En(this,sl,()=>{ut(this,wu).forEach(t=>t())}),En(this,fx,()=>{ut(this,xu).forEach(t=>t())}),En(this,px,()=>{ut(this,vu).forEach(t=>t())}),Qr(this,Qa,e)}get status(){return ut(this,jf)}set status(e){Qr(this,jf,e),ut(this,fx).call(this)}get error(){return ut(this,Vf)}set error(e){Qr(this,Vf,e),ut(this,px).call(this)}get messages(){return ut(this,Qa)}set messages(e){Qr(this,Qa,[...e]),ut(this,sl).call(this)}};Qa=new WeakMap;jf=new WeakMap;Vf=new WeakMap;wu=new WeakMap;xu=new WeakMap;vu=new WeakMap;sl=new WeakMap;fx=new WeakMap;px=new WeakMap;var ul,ID=class extends vD{constructor({messages:e,...t}){let a=new vj(e);super({...t,state:a}),En(this,ul,void 0),this["~registerMessagesCallback"]=(n,r)=>ut(this,ul)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>ut(this,ul)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>ut(this,ul)["~registerErrorCallback"](n),Qr(this,ul,a)}};ul=new WeakMap;function LD({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,Ja.useRef)("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(n.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});let r={...a,onToolCall:f=>{var p,m;return(m=(p=n.current).onToolCall)==null?void 0:m.call(p,f)},onData:f=>{var p,m;return(m=(p=n.current).onData)==null?void 0:m.call(p,f)},onFinish:f=>{var p,m;return(m=(p=n.current).onFinish)==null?void 0:m.call(p,f)},onError:f=>{var p,m;return(m=(p=n.current).onError)==null?void 0:m.call(p,f)},sendAutomaticallyWhen:f=>{var p,m,x;return(x=(m=(p=n.current).sendAutomaticallyWhen)==null?void 0:m.call(p,f))!=null?x:!1}},o=(0,Ja.useRef)("chat"in a?a.chat:new ID(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new ID(r));let l=(0,Ja.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,Ja.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,Ja.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,Ja.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,Ja.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,Ja.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:s,setMessages:d,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:c,resumeStream:o.current.resumeStream,status:u,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}var Y=q(Ie(),1);function cl(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[s,u]of Object.entries(a))i.set(s,u);let l=i.toString();return`${o}${t}${l?`?${l}`:""}`}function bj(e){let t=e?.cause,a=t?.issues??t?.errors;if(!Array.isArray(a))return null;let n=a.find(r=>r.code==="invalid_union");if(!n?.errors)return null;for(let r of n.errors){if(!Array.isArray(r)||r.some(l=>(l.code==="invalid_value"||l.code==="invalid_literal")&&l.path?.[0]==="type"))continue;let i=r.filter(l=>l.code==="unrecognized_keys").flatMap(l=>l.keys??[]);if(i.length>0)return i}return null}var Wf=class extends dx{processResponseStream(t){let a="",n=cx(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let l=a.split(`
|
|
138
|
+
`);a=l.pop()??"";for(let s of l){let u=s.trim();if(!u.startsWith("data:"))continue;let c=u.slice(5).trim();if(c!=="[DONE]")try{let d=JSON.parse(c);if(!r){i.enqueue(d);continue}let f=await r(d);if(f.success){i.enqueue(f.value);continue}let p=bj(f.error);if(p?.length){let m={...d};for(let I of p)delete m[I];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var TD=50,ED=1e3;function $f(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.threadId=="string"&&typeof t.memoryUserId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}async function Xf(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await Jh(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function mx(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function hx(e){return await Xf(async a=>{let o=a.transaction(Da,"readonly").objectStore(Da).index(id),l=(await mx(o.getAll(e))??[]).filter($f);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Kf(e){return await Xf(async a=>{let r=a.transaction(Da,"readonly").objectStore(Da),o=await mx(r.get(e));return $f(o)?o:null})??null}async function gx(e){if(!$f(e))return;let t=e.messages.length>ED?{...e,messages:e.messages.slice(e.messages.length-ED)}:e;await Xf(async a=>{await new Promise((s,u)=>{let c=a.transaction(Da,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Da).put(t)});let n=a.transaction(Da,"readwrite"),r=n.objectStore(Da),o=r.index(id),l=(await mx(o.getAll(t.memoryUserId))??[]).filter($f);if(l.length>TD){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-TD);for(let u of s)r.delete(u.threadId)}return await new Promise((s,u)=>{n.oncomplete=()=>s(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function MD(e){await Xf(async t=>(await new Promise((a,n)=>{let r=t.transaction(Da,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Da).delete(e)}),null))}async function yx(e){return(await hx(e))[0]?.threadId??null}function AD(e){let t=e.trim();if(!t)return`Conversation on ${new Date().toISOString().slice(0,10)}`;let a=t.split(/\r?\n/,1)[0]??t;return a.length<=60?a:`${a.slice(0,60).trimEnd()}\u2026`}var Sj="x-session-id",Ij=250,Cj=200;function RD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():_s()}function Zf(){return new Date().toISOString()}function DD(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function kj(e,t){let a=cl(e,"/tools"),n=await fetch(a,{method:"GET",headers:t?{...t}:void 0});if(!n.ok)throw new Error(`[Waniwani] Failed to fetch /tools: ${n.status} ${n.statusText}`);let r=await n.json();if(!r||!Array.isArray(r.tools))return{};let o={};for(let i of r.tools)i&&typeof i.name=="string"&&(o[i.name]=i);return o}function _D(e){let{api:t="/api/waniwani",headers:a,body:n,onMessageSent:r,onResponseReceived:o,enableThreadHistory:i=!1,activeThreadId:l,onThreadChange:s}=e,u=e.visitorId;(0,Y.useEffect)(()=>ld(u),[u]);let c=Rf(),d=(0,Y.useRef)(a),f=(0,Y.useRef)(n),p=(0,Y.useRef)(i);(0,Y.useEffect)(()=>{p.current=i},[i]);let m=(0,Y.useRef)(void 0),x=(0,Y.useRef)(null),[I,y]=(0,Y.useState)(void 0),w=(0,Y.useRef)(I),[g,b]=(0,Y.useState)(l),T=(0,Y.useRef)(g),[S,M]=(0,Y.useState)([]),[R,_]=(0,Y.useState)(!i),L=(0,Y.useRef)(void 0),z=(0,Y.useRef)(void 0),U=(0,Y.useRef)(void 0),B=(0,Y.useRef)(void 0),W=(0,Y.useRef)(0),A=(0,Y.useRef)(s);(0,Y.useEffect)(()=>{A.current=s},[s]);let j=(0,Y.useCallback)(O=>{T.current=O,b(O),O&&(A.current?.(O),c.emit({name:"thread.changed",sessionId:w.current,properties:{threadId:O}}))},[c]),$=(0,Y.useCallback)(async()=>{if(!i)return;let O=x.current?.memoryUserId;if(!O)return;let ee=await hx(O);M(ee)},[i]),We=(0,Y.useCallback)(()=>w.current,[]),$e=(0,Y.useCallback)(O=>{let ee=DD(O);if(!ee||w.current===ee)return;let ae=w.current===void 0;w.current=ee,y(ee),ae&&c.emit({name:"session.started",properties:{sessionId:ee}})},[c]),v=(0,Y.useCallback)(()=>{w.current=void 0,y(void 0)},[]);(0,Y.useEffect)(()=>{d.current=a},[a]),(0,Y.useEffect)(()=>{f.current=n},[n]),(0,Y.useEffect)(()=>{let O=!1,ee=W.current;return(async()=>{try{let ft=await hs();if(O)return;x.current=ft}catch{}if(!i)return;let ae=x.current?.memoryUserId;if(!ae){_(!0);return}try{let ft=l??await yx(ae);if(O||ee!==W.current)return;if(ft){let Ft=await Kf(ft);if(O||ee!==W.current)return;Ft&&Ft.memoryUserId===ae&&(T.current=Ft.threadId,b(Ft.threadId),L.current=Ft.createdAt,z.current=Ft.title,Ft.sessionId&&(w.current=Ft.sessionId,y(Ft.sessionId)),ce(Ft.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[]);let De=(0,Y.useRef)(new Wf({api:t,headers:()=>({...d.current}),body:()=>{let O={...f.current??{}},ee=Object.hasOwn(O,"sessionId"),ae=DD(O.sessionId);if(ae)$e(ae),O.sessionId=ae;else if(ee)v(),delete O.sessionId;else{let sp=We();sp&&(O.sessionId=sp)}nl(m.current)&&(O.modelContext=m.current);let ft=x.current,Ft=Kn();ft&&(O.visitorContext={timezone:ft.timezone,language:ft.language,languages:ft.languages,deviceType:ft.deviceType,referrer:ft.referrer,visitorId:Ft});let It=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},YD=typeof It.client=="object"&&It.client!==null?It.client:{};O.visitor={...It,id:Ft,client:{...YD,...ft&&{memoryUserId:ft.memoryUserId}}};let Cx=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,kx=x.current?.memoryUserId,Lx=x.current?.language,ku={};if(kx&&(ku.memoryUserId=kx),Lx&&(ku.locale=Lx),(Object.keys(ku).length>0||Cx)&&(O.extra={...ku,...Cx??{}}),p.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(T.current=O.threadId);else{let Lu=T.current;Lu||(Lu=RD(),L.current=Zf(),z.current=void 0,j(Lu)),O.threadId=Lu}return O},fetch:(async(O,ee)=>{let ae=await fetch(O,ee);return m.current=void 0,$e(ae.headers.get(Sj)),ae})})),_e=(0,Y.useRef)(null),k=(0,Y.useRef)(null),Le=(0,Y.useRef)({}),[St,et]=(0,Y.useState)(0),Ut=e.skipRemoteConfig===!0,ve=(0,Y.useCallback)(async()=>{if(!Ut)try{let O=await kj(t,d.current);Le.current=O,et(ee=>ee+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,Ut]);(0,Y.useEffect)(()=>{ve()},[ve]);let{messages:X,sendMessage:pe,setMessages:ce,status:oe}=LD({messages:e.initialMessages,transport:De.current,onFinish({message:O,isAbort:ee,isDisconnect:ae,isError:ft}){o?.(),!ee&&!ae&&!ft&&c.emit({name:"message.received"}),_e.current&&(k.current=O)},onError(O){console.warn("[Waniwani] Chat error:",O.message),c.emit({name:"chat.error",properties:{message:O.message.slice(0,Cj)}}),_e.current&&(_e.current.reject(O),_e.current=null)}}),he=(0,Y.useRef)(X);(0,Y.useEffect)(()=>{he.current=X},[X]);let Xe=(0,Y.useRef)(i);(0,Y.useEffect)(()=>{if(!i||Xe.current||(Xe.current=!0,he.current.length>0))return;let O=!1,ee=W.current;return _(!1),(async()=>{try{let ae=x.current;if(!ae)try{ae=await hs(),x.current=ae}catch{}let ft=ae?.memoryUserId;if(!ft||O||ee!==W.current){O||_(!0);return}let Ft=l??await yx(ft);if(O||ee!==W.current)return;if(Ft){let It=await Kf(Ft);if(O||ee!==W.current)return;It&&It.memoryUserId===ft&&(T.current=It.threadId,b(It.threadId),L.current=It.createdAt,z.current=It.title,It.sessionId&&(w.current=It.sessionId,y(It.sessionId)),ce(It.messages))}await $()}finally{O||_(!0)}})(),()=>{O=!0}},[i]),(0,Y.useEffect)(()=>{if(oe==="ready"&&_e.current&&k.current){let O=_e.current,ee=k.current;_e.current=null,k.current=null,O.resolve(ee)}},[oe]);let[dt,nt]=(0,Y.useState)(""),[Mt,K]=(0,Y.useState)([]),se=oe==="submitted"||oe==="streaming",Ke=(0,Y.useCallback)(O=>{K(ee=>ee.filter(ae=>ae.id!==O))},[]),ua=se&&Mt.length>0,pn=(0,Y.useCallback)(O=>{let ee=!!O.text?.trim(),ae=!!O.files?.length;if(ee||ae){if(se){if(Mt.length>0)return;K(ft=>[...ft,{id:_s(),text:O.text||"",files:O.files??[],modelContext:O.modelContext}]),nt("");return}m.current=O.modelContext,pe({text:O.text||"",files:O.files}),r?.(O.text||""),c.emit({name:"message.sent"}),nt("")}},[pe,r,se,Mt.length,c]),sr=(0,Y.useCallback)(O=>new Promise((ee,ae)=>{_e.current={resolve:ee,reject:ae},pe({text:O}),r?.(O),c.emit({name:"message.sent"})}),[pe,r,c]);(0,Y.useEffect)(()=>{if(oe!=="ready"||Mt.length===0)return;let[O,...ee]=Mt;K(ee),m.current=O.modelContext,pe({text:O.text,files:O.files.length>0?O.files:void 0}),r?.(O.text),c.emit({name:"message.sent"})},[oe,pe,r,Mt,c]);let fl=(0,Y.useCallback)(()=>{ce([]),K([]),v(),nt(""),Le.current={},et(O=>O+1),ve()},[ce,v,ve]),Wo=(0,Y.useCallback)(()=>{if(!p.current)return;let O=x.current?.memoryUserId,ee=T.current,ae=he.current;if(!(!O||!ee||ae.length===0)){if(L.current||(L.current=Zf()),!z.current){let ft=ae.find(It=>It.role==="user"),Ft=ft?ft.parts.map(It=>"text"in It&&typeof It.text=="string"?It.text:"").join(" "):"";z.current=AD(Ft)}return{threadId:ee,memoryUserId:O,title:z.current,messages:ae,sessionId:w.current,createdAt:L.current,updatedAt:Zf()}}},[]),P=(0,Y.useCallback)(async()=>{let O=Wo();O&&(await gx(O),await $())},[Wo,$]);(0,Y.useEffect)(()=>{if(i&&R&&!(oe==="submitted"||oe==="streaming")&&X.length!==0)return U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{U.current=void 0;let O=P().finally(()=>{B.current===O&&(B.current=void 0)});B.current=O},Ij),()=>{U.current&&clearTimeout(U.current)}},[i,R,X,oe,P]);let H=(0,Y.useCallback)(()=>{let O=B.current,ee=U.current,ae=ee?Wo():void 0;return ee&&(clearTimeout(ee),U.current=void 0),(async()=>{O&&await O,ae&&(await gx(ae),await $())})()},[Wo,$]),le=(0,Y.useCallback)(()=>{W.current+=1,H(),ce([]),K([]),v(),nt("");let O=RD();return L.current=Zf(),z.current=void 0,j(O),$(),O},[ce,v,j,$,H]),ge=(0,Y.useCallback)(async O=>{W.current+=1;let ee=W.current;if(await H(),ee!==W.current)return;let ae=await Kf(O);ee===W.current&&ae&&(ae.sessionId?(w.current=ae.sessionId,y(ae.sessionId)):v(),j(ae.threadId),L.current=ae.createdAt,z.current=ae.title,ce(ae.messages),K([]),nt(""))},[ce,v,j,H]),Fe=(0,Y.useCallback)(async O=>{if(T.current===O){W.current+=1,U.current&&(clearTimeout(U.current),U.current=void 0);let ee=B.current;ee&&await ee}await MD(O),await $(),T.current===O&&(ce([]),K([]),v(),nt(""),T.current=void 0,b(void 0),L.current=void 0,z.current=void 0)},[ce,v,$]);(0,Y.useEffect)(()=>{i&&R&&l!==void 0&&l!==T.current&&ge(l)},[l,i,R,ge]);let ba=(0,Y.useCallback)(O=>{nt(O.target.value)},[]),mn=X[X.length-1],Na=X.length>0,to=se&&(!Na||mn.role==="user"),ao=Le.current;return{messages:X,status:oe,text:dt,setText:nt,handleSubmit:pn,handleTextChange:ba,isLoading:se,showLoaderBubble:to,lastMessage:mn,hasMessages:Na,sendMessage:pe,sendMessageAndWait:sr,reset:fl,queuedMessages:Mt,queueFull:ua,removeQueuedMessage:Ke,sessionId:I,toolDefinitions:ao,refreshToolDefinitions:ve,threads:S,activeThreadId:g,isThreadHistoryReady:R,startNewThread:le,switchThread:ge,deleteThread:Fe}}function OD(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return cl(e,"/resource",n?{token:n}:void 0)}var Lj={primaryColor:["--ww-primary","--ww-color-primary"],primaryForeground:["--ww-primary-fg","--ww-color-primary-foreground"],backgroundColor:["--ww-bg","--ww-color-background"],textColor:["--ww-text","--ww-color-foreground","--ww-color-accent-foreground"],mutedColor:["--ww-muted","--ww-color-muted-foreground"],borderColor:["--ww-border","--ww-color-border"],borderWidth:["--ww-border-width"],boxShadow:["--ww-shadow"],assistantBubbleColor:["--ww-assistant-bubble","--ww-color-accent"],userBubbleColor:["--ww-user-bubble"],inputBackgroundColor:["--ww-input-bg","--ww-color-input"],borderRadius:["--ww-radius"],messageBorderRadius:["--ww-msg-radius"],fontFamily:["--ww-font"],headerBackgroundColor:["--ww-header-bg"],headerTextColor:["--ww-header-text"],statusColor:["--ww-status"],toolCardColor:["--ww-tool-card","--ww-color-tool-card"],userBubbleTextColor:["--ww-user-bubble-text"],assistantBubbleTextColor:["--ww-assistant-bubble-text"],messagePaddingX:["--ww-msg-pad-x"],messagePaddingY:["--ww-msg-pad-y"],messageMaxWidth:["--ww-msg-max-width"],fontSize:["--ww-font-size"],lineHeight:["--ww-line-height"]};function Yf(e){let t={};for(let[a,n]of Object.entries(Lj)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let i of n)t[i]=o}return t}var Ve=q(ne(),1),Qf=(0,Ge.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ve.jsx)(Ds,{locale:n,messages:r,children:(0,Ve.jsx)(Tj,{...t,ref:a})})}),Tj=(0,Ge.forwardRef)(function(t,a){let{t:n,ready:r}=Re(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,welcomeMessage:u,welcome:c,placeholder:d=n.promptInput.placeholder,triggerEvent:f="triggerDemoRequest",api:p,mcp:m,debug:x=!1,readOnly:I=!1,title:y,headerActions:w,hideHeader:g=!1,enableThreadHistory:b=!1,showToolCalls:T=!0,initializing:S=!1,disclaimer:M}=t,R=o?.theme,_=o?.variables,L=o?.assistantBubble??!1,z=_?Yf(_):{},[U,B]=(0,Ge.useState)(!1);(0,Ge.useEffect)(()=>{if(R!=="auto"||typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");B(K.matches);let se=()=>B(K.matches);return K.addEventListener("change",se),()=>K.removeEventListener("change",se)},[R]);let W=R==="dark"||R==="auto"&&U,A=_D({...t,api:p}),j=Rf(),$=FR({...t,api:p,sessionId:A.sessionId,onCallTool:m?.onCallTool}),We=m?.resourceEndpoint??OD(p,t.headers),$e=hd(d,!A.text),[v,De]=(0,Ge.useState)(null),[_e,k]=(0,Ge.useState)(null),Le=(0,Ge.useRef)(null),St=(0,Ge.useRef)(null),et=(0,Ge.useRef)(null),Ut=(0,Ge.useRef)(null),[ve,X]=(0,Ge.useState)(!0),pe=(0,Ge.useRef)(ve);pe.current=ve;let ce=(0,Ge.useCallback)(()=>{let K=Le.current;if(!K)return;let se=K.querySelector("textarea");se&&se.focus()},[]),oe=(0,Ge.useCallback)((K="smooth")=>{let se=St.current;se&&se.scrollTo({top:se.scrollHeight,behavior:K})},[]);(0,Ge.useEffect)(()=>{let K=Ut.current,se=St.current;if(!K||!se)return;let Ke=new IntersectionObserver(([ua])=>X(ua.isIntersecting),{root:se,rootMargin:"0px 0px 200px 0px",threshold:0});return Ke.observe(K),()=>Ke.disconnect()},[]),(0,Ge.useEffect)(()=>{let K=St.current;if(!K)return;let se=Ke=>{let pn=(Ke.target instanceof Element?Ke.target:null)?.closest("a");pn?.href&&j.emit({name:"link.clicked",properties:{url:pn.href}})};return K.addEventListener("click",se),()=>K.removeEventListener("click",se)},[j]),(0,Ge.useEffect)(()=>{(A.messages[A.messages.length-1]?.role==="user"||pe.current)&&oe("smooth")},[A.messages.length,A.messages[A.messages.length-1]]),(0,Ge.useEffect)(()=>{oe("auto")},[oe]),(0,Ge.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let K=St.current,se=et.current;if(!K&&!se)return;let Ke=K?.scrollHeight??0,ua=K?.clientHeight??0,pn=new ResizeObserver(()=>{let sr=St.current;if(!sr)return;let fl=sr.scrollTop+ua>=Ke-5;Ke=sr.scrollHeight,ua=sr.clientHeight,fl&&oe("auto")});return K&&pn.observe(K),se&&pn.observe(se),()=>pn.disconnect()},[oe]);let he=ZI({messages:A.messages,status:A.status,config:t.suggestions}),Xe=(0,Ge.useCallback)(K=>{let se=K.content.map(Ke=>Ke.text??"").join("").trim();se&&A.handleSubmit({text:se,files:[],modelContext:K.modelContext})},[A.handleSubmit]),dt=(0,Ge.useCallback)(K=>{let se=he.suggestions.indexOf(K),Ke=se>=0?se:c?.suggestions?.indexOf(K)??-1,ua=se>=0?he.source:"channel";j.emit({name:"suggestion.clicked",properties:{text:K,index:Ke,origin:ua}}),he.clear(),A.handleSubmit({text:K,files:[]})},[he.suggestions,he.source,he.clear,A.handleSubmit,c,j]);(0,Ge.useImperativeHandle)(a,()=>({sendMessage:K=>{A.handleSubmit({text:K,files:[]}),ce()},sendMessageAndWait:K=>A.sendMessageAndWait(K),reset:A.reset,focus:ce,get messages(){return A.messages},get sessionId(){return A.sessionId}}),[A.handleSubmit,A.sendMessageAndWait,A.reset,A.messages,A.sessionId,ce]),(0,Ge.useEffect)(()=>{if(!f)return;let K=se=>{let Ke=se.detail,ua=typeof Ke?.message=="string"?Ke.message:void 0;ua&&A.handleSubmit({text:ua,files:[]}),ce()};return window.addEventListener(f,K),()=>window.removeEventListener(f,K)},[f,A.handleSubmit,ce]);let nt=!g&&!!(y||b||w),Mt=S||!r;return(0,Ve.jsxs)("div",{ref:Le,style:{...z,maxHeight:"inherit",...v&&_e?{height:_e}:{},opacity:Mt?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":L?"true":void 0,"data-color-scheme":R==="auto"?"auto":void 0,...Mt?{"data-waniwani-initializing":""}:{},...W?{"data-waniwani-dark":""}:{},className:V("ww:relative ww:w-full ww:h-full ww:flex ww:flex-col ww:bg-background ww:text-foreground ww:font-[family-name:var(--ww-font)] ww:overflow-hidden",R==="dark"&&"dark",i,l?.root),children:[nt&&(0,Ve.jsxs)("div",{className:V("ww-header ww:shrink-0 ww:flex ww:items-center ww:gap-2 ww:pl-4 ww:pr-3 ww:py-3 ww:border-b ww:border-border",l?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[y&&(0,Ve.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ve.jsx)("div",{className:"ww:flex-1"}),b&&(0,Ve.jsx)(NR,{threads:A.threads,activeThreadId:A.activeThreadId,onNewThread:A.startNewThread,onSelectThread:K=>{A.switchThread(K)},onDeleteThread:K=>{A.deleteThread(K)}}),w]}),(0,Ve.jsxs)("div",{ref:St,className:V("ww:relative ww:flex-1 ww:min-h-0",v?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ve.jsxs)("div",{ref:et,className:V("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",v&&"ww:!py-0"),children:[(0,Ve.jsx)(_R,{messages:A.messages,status:A.status,welcomeMessage:u,welcome:c,onSuggestionSelect:dt,resourceEndpoint:We,chatSessionId:A.sessionId,isDark:W,onFollowUp:Xe,onCallTool:$,fullscreenToolCallId:v,debug:x,showToolCalls:T,toolDefinitions:A.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(K,se)=>{if(K==="fullscreen"){let Ke=Le.current?.getBoundingClientRect().height??0;k(Ke>0?Ke:null),De(se.toolCallId)}else k(null),De(null)}}),(0,Ve.jsx)("div",{ref:Ut,"aria-hidden":!0,style:{height:1}})]}),!ve&&!v&&(0,Ve.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ve.jsx)(Sn,{type:"button",onClick:()=>oe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ve.jsx)(xs,{className:"ww:size-4"})})})]}),!I&&(0,Ve.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:v?{display:"none"}:void 0,children:[(0,Ve.jsx)(pd,{suggestions:he.suggestions,isLoading:he.isLoading,onSelect:dt}),(0,Ve.jsx)(xC,{queuedMessages:A.queuedMessages,onRemove:A.removeQueuedMessage}),(0,Ve.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ve.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ve.jsx)(iC,{onSubmit:A.handleSubmit,globalDrop:s,multiple:s,className:V("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:(0,Ve.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[s&&(0,Ve.jsx)(uC,{}),(0,Ve.jsx)(lC,{onChange:A.handleTextChange,value:A.text,placeholder:$e,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ve.jsx)(sC,{status:A.status,disabled:A.queueFull})]})}),(0,Ve.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Ve.jsx)(OR,{}),(0,Ve.jsx)(cC,{text:M})]})]})})]})]})});var Iu=q(Ie(),1);function Ej(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function Jr(...e){Ej()&&console.log("[Waniwani]",...e)}var zD=q(Ie(),1);var ep=q(Ie(),1);function Mj(e){return e?.patterns??e?.rules??[]}var PD="\0\0";function Aj(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,PD).replace(/\\\*/g,"[^/]*").split(PD).join(".*");return new RegExp(`^${a}$`)}function ND(e,t){try{return Aj(e).test(t)}catch{return!1}}function Jf(e,t){if(!e)return!0;let a=!1;for(let n of Mj(e))if(ND(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function BD(e,t){for(let a of e?.appearRules??[])if(ND(a.glob,t))return a.appearAfter;return null}var wx="waniwani:locationchange",UD=!1;function Rj(){if(!(UD||typeof history>"u")){UD=!0;for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...n){let r=t.apply(this,n);return window.dispatchEvent(new Event(wx)),r}}}}function Dj(e){return Rj(),window.addEventListener(wx,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(wx,e),window.removeEventListener("popstate",e)}}function _j(){return window.location.pathname}function Oj(){return"/"}function Su(){return(0,ep.useSyncExternalStore)(Dj,_j,Oj)}function tp(e,t){let a=Su(),n=t&&Jf(e,a);return(0,ep.useEffect)(()=>{Jr("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var Pj=3,Nj=["low","medium","high"];function xx(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function Bj(e){let t=new Map,a=[];for(let o of e)if(o.tier){let i=t.get(o.tier)??[];i.push(o),t.set(o.tier,i)}else a.push(o);let n=[];for(let o of Nj){let i=xx(t.get(o)??[])??xx(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(Pj,e.length);){let o=xx(r);if(!o)break;n.push(o)}return n}function FD(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function qD(e){return Array.isArray(e)?e.flatMap(t=>{let a=t;if(typeof a?.url!="string"||a.url.length===0||!Array.isArray(a.prompts))return[];let n=a.prompts.flatMap(r=>{let o=r;return typeof o?.text!="string"||o.text.length===0?[]:[{id:typeof o.id=="string"?o.id:null,text:o.text,tier:o.tier==="low"||o.tier==="medium"||o.tier==="high"?o.tier:void 0}]});return n.length>0?[{url:a.url,prompts:n}]:[]}):[]}function Uj(e,t){return e&&e.length>0?e:(t??[]).map(a=>({id:null,text:a}))}function ap(e){let{pageSuggestions:t,suggestions:a,suggestionOrigins:n}=e,r=Su(),o=(n??cg).includes("page");return(0,zD.useMemo)(()=>{let i=FD(r),l=o?t?.find(u=>FD(u.url)===i):void 0,s=l?Bj(l.prompts).map(({id:u,text:c})=>({id:u,text:c})):null;return Jr("page suggestions resolve",{pathname:i,matched:!!l,count:s?.length??0}),Uj(s,a).map(u=>u.text)},[r,o,t,a])}var Fj="waniwani:config:";function HD(e,t,a){return`${Fj}${e}|${t}|${a??""}`}function np(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(HD(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function zj(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(HD(e,t,a),JSON.stringify(n))}catch{}}var qj=600;async function Hj(e,t,a,n){try{let r=cl(e,"/config",n?{channel:n}:void 0),o=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`},signal:a});if(!o.ok)return{};let i=await o.json(),l=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return l?jj(l):{}}catch{return{}}}function jj(e){let t={};e.source!=null&&(t.source=e.source),e.title!=null&&(t.title=e.title),e.welcomeMessage!=null&&(t.welcomeMessage=e.welcomeMessage),e.placeholder!=null&&(t.placeholder=e.placeholder),e.suggestions!=null&&e.suggestions.length>0&&(t.suggestions=e.suggestions);let a=qD(e.pageSuggestions);return a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),e.toolCallDisplay==="full"?t.showToolCalls=!0:e.toolCallDisplay==="titles-only"?t.showToolCalls="titles-only":e.toolCallDisplay==="hidden"&&(t.showToolCalls=!1),e.visibility&&(t.visibility=e.visibility),t}function rp(e,t,a){let[n,r]=(0,Iu.useState)(e),[o,i]=(0,Iu.useState)(!1);return(0,Iu.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||_I({api:l,token:s,channelId:u,mode:e.mode,source:m})},d=np(l,s,u);if(d)try{let m=ys(t,d,a);r(m),i(!0),Jr("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d.source)}catch{}let f=new AbortController,p=setTimeout(()=>i(!0),qj);return Hj(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(Jr("remote /config response",m),Object.keys(m).length>0){zj(l,s,u,m);try{let x=ys(t,m,a);r(x),Jr("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}i(!0),c(m.source)}}).catch(m=>{console.error("[Waniwani] Remote config fetch failed:",m),i(!0)}).finally(()=>clearTimeout(p)),()=>{f.abort(),clearTimeout(p)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var op=q(Ie(),1),Vj=3e3,Gj=120,Wj=24;function jD(e){let[t,a]=(0,op.useState)(!1);return(0,op.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,l=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${Wj}px 0px`,threshold:0}),r.observe(u)},s=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){l(u);return}o=setTimeout(s,Gj)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},Vj),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var ct=q(ne(),1),$j=2e3,Xj=90,Kj=1e3,VD=(0,Me.forwardRef)(function(t,a){return(0,ct.jsx)(Ds,{locale:t.config.locale,children:(0,ct.jsx)(Zj,{...t,ref:a})})}),Zj=(0,Me.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Re(),{config:i,ready:l}=rp(t,a,n),s=tp(i.visibility,l),u=Su(),c=s?BD(i.visibility,u):null,d=jD(c),f=(0,Me.useRef)(null),p=(0,Me.useMemo)(()=>Mf({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Me.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Me.useRef)(null),I=(0,Me.useRef)(null),y=(0,Me.useRef)(!1),[w,g]=(0,Me.useState)("input"),[b,T]=(0,Me.useState)(""),[S,M]=(0,Me.useState)(!1),[R,_]=(0,Me.useState)(!1),[L,z]=(0,Me.useState)(0),U=i.appearance?.theme,B=i.appearance?.variables,W=(0,Me.useMemo)(()=>B?Yf(B):{},[B]),A=ap(i),j=i.launcherText??i.placeholder??o.launcher.prompt,$=hd(j,b.length===0),We="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Me.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let X=i.appearDelay??$j,pe=setTimeout(()=>M(!0),Math.max(0,X));return()=>clearTimeout(pe)},[s,i.appearDelay,c,d]),(0,Me.useEffect)(()=>{if(!S||A.length===0)return;let X=setTimeout(()=>{y.current||g(pe=>pe==="input"?"expanded":pe)},Kj);return()=>clearTimeout(X)},[S,A.length]),(0,Me.useEffect)(()=>{L>0&&w==="open"&&f.current?.focus()},[L,w]);let $e=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{l&&!$e.current&&($e.current=!0,p.emit({name:"chat.ready"}))},[l,p]);let v=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{let X=s&&w==="open";X!==v.current&&(v.current=X,p.emit({name:X?"chat.opened":"chat.closed"}))},[s,w,p]);let De=(0,Me.useCallback)(()=>{g("open")},[]),_e=(0,Me.useCallback)(()=>{y.current=!0,g("input")},[]);(0,Me.useEffect)(()=>{if(w!=="expanded"){_(!1);return}let X=setTimeout(()=>_(!0),Xj);return()=>clearTimeout(X)},[w]);let k=(0,Me.useCallback)(X=>{De();let pe=X.trim();pe&&f.current?.sendMessage(pe)},[De]);(0,Me.useImperativeHandle)(r,()=>({open:()=>De(),close:()=>_e(),toggle:()=>{g(X=>X==="open"?"input":"open")},sendMessage:X=>k(X),sendMessageAndWait:async X=>{De();let pe=f.current;if(pe)return await pe.sendMessageAndWait(X)},reset:()=>f.current?.reset(),focus:()=>{De(),z(X=>X+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[k,De,_e]);let Le=(0,Me.useCallback)(()=>{b.trim()&&(k(b),T(""))},[b,k]),St=(0,Me.useCallback)(()=>{(f.current?.messages.length??0)>0?(g("open"),z(X=>X+1)):(y.current=!1,g(X=>X==="input"?"expanded":X))},[]),et={mode:"floating"};i.mcpServerUrl&&(et.mcpServerUrl=i.mcpServerUrl),i.channelId&&(et.channelId=i.channelId);let Ut=A.length>0&&w!=="input",ve=(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Ls,{className:"ww:size-4"})});return(0,ct.jsx)(Df,{value:p,children:(0,ct.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":U==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",U==="dark"&&"dark"),style:W,children:s&&(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)("div",{ref:I,"data-waniwani-floating":"dock","data-state":w==="open"?"hidden":"shown","data-appeared":S?"true":"false",className:V("ww:fixed ww:bottom-3 ww:sm:bottom-4 ww:left-0 ww:right-0 ww:mx-auto ww:z-[2147483002] ww:flex ww:flex-col","ww:w-[calc(100vw-2rem)] ww:transition-[max-width] ww:duration-300 ww:ease-out",Ut?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,ct.jsxs)("div",{className:V("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",Ut?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:Ut?{boxShadow:We,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[Ut&&w!=="open"&&(0,ct.jsx)("button",{type:"button",onClick:_e,"aria-label":o.launcher.close,className:"ww:absolute ww:right-2 ww:top-2 ww:z-10 ww:flex ww:size-7 ww:items-center ww:justify-center ww:rounded-md ww:text-muted-foreground ww:transition-colors hover:ww:bg-accent hover:ww:text-foreground ww:cursor-pointer",children:(0,ct.jsx)(Yn,{className:"ww:size-4"})}),A.length>0&&(0,ct.jsx)("div",{className:V("ww:grid ww:transition-all ww:duration-300 ww:ease-out",R?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,ct.jsx)("div",{className:"ww:overflow-hidden",children:(0,ct.jsx)(pd,{suggestions:A,onSelect:X=>{p.emit({name:"suggestion.clicked",properties:{text:X,index:A.indexOf(X),origin:"channel"}}),k(X)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,ct.jsx)(VI,{animated:S,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:We},children:(0,ct.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-3.5 ww:pr-1.5 ww:py-1.5 ww:sm:pl-4 ww:sm:pr-2 ww:sm:py-2",children:[(0,ct.jsx)("input",{ref:x,type:"text",value:b,placeholder:$,onChange:X=>T(X.target.value),onFocus:St,onKeyDown:X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),Le())},className:"ww:min-w-0 ww:flex-1 ww:bg-transparent ww:py-1 ww:text-base ww:sm:text-sm ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground"}),(0,ct.jsx)("button",{type:"button",onClick:Le,disabled:!b.trim(),"aria-label":o.promptInput.submit,className:"ww:relative ww:flex ww:size-8 ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:bg-foreground ww:text-background ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",children:(0,ct.jsx)(Co,{className:"ww:size-4"})})]})})]})}),(0,ct.jsx)("div",{role:"dialog","aria-label":i.title??j,"data-waniwani-floating":"panel","data-state":w==="open"?"shown":"hidden",style:{boxShadow:We},className:V("ww:fixed ww:z-[2147483002] ww:flex ww:flex-col ww:overflow-hidden ww:bg-background","ww:inset-0 ww:w-full ww:rounded-none","ww:sm:inset-auto ww:sm:bottom-4 ww:sm:left-0 ww:sm:right-0 ww:sm:mx-auto ww:sm:h-[720px] ww:sm:max-h-[calc(100dvh-2rem)] ww:sm:w-[calc(100vw-2rem)] ww:sm:max-w-[1000px] ww:sm:rounded-2xl ww:sm:border ww:sm:border-border"),children:(0,ct.jsx)(Qf,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:et,appearance:i.appearance,title:i.title,headerActions:ve,hideHeader:!1,welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:md({suggestions:i.suggestions||A.length>0?A:void 0,suggestionOrigins:i.suggestionOrigins}),enableThreadHistory:i.enableThreadHistory,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var va=q(Ie(),1);var vx=q(ne(),1),GD=(0,va.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=rp(t,a,n),u=(0,va.useRef)(null),c=(0,va.useMemo)(()=>Mf({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,va.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,va.useRef)(!1);(0,va.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,va.useEffect)(()=>{r?.()},[]);let p=tp(l.visibility,s);(0,va.useEffect)(()=>{o?.(p)},[p,o]),(0,va.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=ap(l),x={mode:"inline"};return l.mcpServerUrl&&(x.mcpServerUrl=l.mcpServerUrl),l.channelId&&(x.channelId=l.channelId),(0,vx.jsx)(Df,{value:c,children:(0,vx.jsx)(Qf,{ref:u,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:x,appearance:l.appearance,title:l.title,hideHeader:l.hideHeader,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:md({suggestions:l.suggestions||m.length>0?m:void 0,suggestionOrigins:l.suggestionOrigins}),enableThreadHistory:l.enableThreadHistory,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var bx="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--ww-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--ww-color-blue-400:oklch(70.7% .165 254.624);--ww-spacing:.25rem;--ww-container-sm:24rem;--ww-container-md:28rem;--ww-container-3xl:48rem;--ww-text-xs:.75rem;--ww-text-xs--line-height:calc(1/.75);--ww-text-sm:.875rem;--ww-text-sm--line-height:calc(1.25/.875);--ww-text-base:1rem;--ww-text-base--line-height:calc(1.5/1);--ww-text-lg:1.125rem;--ww-text-lg--line-height:calc(1.75/1.125);--ww-font-weight-medium:500;--ww-font-weight-semibold:600;--ww-tracking-wide:.025em;--ww-tracking-wider:.05em;--ww-radius-md:.375rem;--ww-radius-lg:.5rem;--ww-radius-xl:.75rem;--ww-radius-2xl:1rem;--ww-ease-out:cubic-bezier(0,0,.2,1);--ww-animate-spin:spin 1s linear infinite;--ww-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--ww-blur-xl:24px;--ww-default-transition-duration:.15s;--ww-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--ww-default-font-family:var(--ww-font-sans,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-default-mono-font-family:var(--ww-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--ww-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--ww-default-font-feature-settings,normal);font-variation-settings:var(--ww-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--ww-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--ww-default-mono-font-feature-settings,normal);font-variation-settings:var(--ww-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.ww\\:pointer-events-auto{pointer-events:auto}.ww\\:pointer-events-none{pointer-events:none}.ww\\:\\!relative{position:relative!important}.ww\\:absolute{position:absolute}.ww\\:fixed{position:fixed}.ww\\:relative{position:relative}.ww\\:sticky{position:sticky}.ww\\:inset-0{inset:calc(var(--ww-spacing)*0)}.ww\\:top-2{top:calc(var(--ww-spacing)*2)}.ww\\:top-full{top:100%}.ww\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:right-2{right:calc(var(--ww-spacing)*2)}.ww\\:bottom-2{bottom:calc(var(--ww-spacing)*2)}.ww\\:bottom-3{bottom:calc(var(--ww-spacing)*3)}.ww\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:left-\\[50\\%\\]{left:50%}.ww\\:isolate{isolation:isolate}.ww\\:-z-\\[1\\]{z-index:calc(1*-1)}.ww\\:z-10{z-index:10}.ww\\:z-50{z-index:50}.ww\\:z-\\[1\\]{z-index:1}.ww\\:z-\\[2147483002\\]{z-index:2147483002}.ww\\:mx-auto{margin-inline:auto}.ww\\:mt-0\\.5{margin-top:calc(var(--ww-spacing)*.5)}.ww\\:mt-1{margin-top:calc(var(--ww-spacing)*1)}.ww\\:mt-2{margin-top:calc(var(--ww-spacing)*2)}.ww\\:mt-6{margin-top:calc(var(--ww-spacing)*6)}.ww\\:mb-0{margin-bottom:calc(var(--ww-spacing)*0)}.ww\\:mb-4{margin-bottom:calc(var(--ww-spacing)*4)}.ww\\:mb-6{margin-bottom:calc(var(--ww-spacing)*6)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:contents{display:contents}.ww\\:flex{display:flex}.ww\\:grid{display:grid}.ww\\:hidden{display:none}.ww\\:inline-block{display:inline-block}.ww\\:inline-flex{display:inline-flex}.ww\\:field-sizing-content{field-sizing:content}.ww\\:size-2{width:calc(var(--ww-spacing)*2);height:calc(var(--ww-spacing)*2)}.ww\\:size-3{width:calc(var(--ww-spacing)*3);height:calc(var(--ww-spacing)*3)}.ww\\:size-3\\.5{width:calc(var(--ww-spacing)*3.5);height:calc(var(--ww-spacing)*3.5)}.ww\\:size-4{width:calc(var(--ww-spacing)*4);height:calc(var(--ww-spacing)*4)}.ww\\:size-5{width:calc(var(--ww-spacing)*5);height:calc(var(--ww-spacing)*5)}.ww\\:size-7{width:calc(var(--ww-spacing)*7);height:calc(var(--ww-spacing)*7)}.ww\\:size-8{width:calc(var(--ww-spacing)*8);height:calc(var(--ww-spacing)*8)}.ww\\:size-9{width:calc(var(--ww-spacing)*9);height:calc(var(--ww-spacing)*9)}.ww\\:size-12{width:calc(var(--ww-spacing)*12);height:calc(var(--ww-spacing)*12)}.ww\\:size-auto{width:auto;height:auto}.ww\\:size-full{width:100%;height:100%}.ww\\:h-2\\.5{height:calc(var(--ww-spacing)*2.5)}.ww\\:h-5{height:calc(var(--ww-spacing)*5)}.ww\\:h-8{height:calc(var(--ww-spacing)*8)}.ww\\:h-9{height:calc(var(--ww-spacing)*9)}.ww\\:h-16{height:calc(var(--ww-spacing)*16)}.ww\\:h-auto{height:auto}.ww\\:h-full{height:100%}.ww\\:max-h-48{max-height:calc(var(--ww-spacing)*48)}.ww\\:max-h-80{max-height:calc(var(--ww-spacing)*80)}.ww\\:min-h-0{min-height:calc(var(--ww-spacing)*0)}.ww\\:min-h-5{min-height:calc(var(--ww-spacing)*5)}.ww\\:min-h-full{min-height:100%}.ww\\:w-72{width:calc(var(--ww-spacing)*72)}.ww\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:w-auto{width:auto}.ww\\:w-fit{width:fit-content}.ww\\:w-full{width:100%}.ww\\:w-px{width:1px}.ww\\:\\[max-width\\:var\\(--ww-msg-max-width\\,80\\%\\)\\]{max-width:var(--ww-msg-max-width,80%)}.ww\\:max-w-3xl{max-width:var(--ww-container-3xl)}.ww\\:max-w-24{max-width:calc(var(--ww-spacing)*24)}.ww\\:max-w-32{max-width:calc(var(--ww-spacing)*32)}.ww\\:max-w-\\[440px\\]{max-width:440px}.ww\\:max-w-\\[720px\\]{max-width:720px}.ww\\:max-w-full{max-width:100%}.ww\\:max-w-md{max-width:var(--ww-container-md)}.ww\\:max-w-sm{max-width:var(--ww-container-sm)}.ww\\:min-w-0{min-width:calc(var(--ww-spacing)*0)}.ww\\:flex-1{flex:1}.ww\\:shrink-0{flex-shrink:0}.ww\\:grow{flex-grow:1}.ww\\:translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.ww\\:rotate-90{rotate:90deg}.ww\\:rotate-180{rotate:180deg}.ww\\:animate-\\[ww-fade-in_0\\.2s_ease-out_both\\]{animation:.2s ease-out both ww-fade-in}.ww\\:animate-pulse{animation:var(--ww-animate-pulse)}.ww\\:animate-spin{animation:var(--ww-animate-spin)}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:grid-rows-\\[0fr\\]{grid-template-rows:0fr}.ww\\:grid-rows-\\[1fr\\]{grid-template-rows:1fr}.ww\\:flex-col{flex-direction:column}.ww\\:flex-nowrap{flex-wrap:nowrap}.ww\\:flex-wrap{flex-wrap:wrap}.ww\\:items-center{align-items:center}.ww\\:items-end{align-items:flex-end}.ww\\:items-start{align-items:flex-start}.ww\\:justify-between{justify-content:space-between}.ww\\:justify-center{justify-content:center}.ww\\:gap-1{gap:calc(var(--ww-spacing)*1)}.ww\\:gap-1\\.5{gap:calc(var(--ww-spacing)*1.5)}.ww\\:gap-2{gap:calc(var(--ww-spacing)*2)}.ww\\:gap-3{gap:calc(var(--ww-spacing)*3)}.ww\\:gap-6{gap:calc(var(--ww-spacing)*6)}:where(.ww\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.ww\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--ww-spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--ww-spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.ww\\:self-stretch{align-self:stretch}.ww\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ww\\:\\!overflow-hidden{overflow:hidden!important}.ww\\:overflow-auto{overflow:auto}.ww\\:overflow-hidden{overflow:hidden}.ww\\:overflow-x-auto{overflow-x:auto}.ww\\:overflow-y-auto{overflow-y:auto}.ww\\:overflow-y-hidden{overflow-y:hidden}.ww\\:\\!rounded-full{border-radius:3.40282e38px!important}.ww\\:rounded{border-radius:var(--ww-radius,16px)}.ww\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:rounded-\\[20px\\]{border-radius:20px}.ww\\:rounded-\\[inherit\\]{border-radius:inherit}.ww\\:rounded-\\[var\\(--ww-radius\\)\\]{border-radius:var(--ww-radius)}.ww\\:rounded-full{border-radius:3.40282e38px}.ww\\:rounded-lg{border-radius:var(--ww-radius-lg)}.ww\\:rounded-md{border-radius:var(--ww-radius-md)}.ww\\:rounded-none{border-radius:0}.ww\\:rounded-xl{border-radius:var(--ww-radius-xl)}.ww\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:border-0{border-style:var(--tw-border-style);border-width:0}.ww\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ww\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ww\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:border-muted-foreground\\/50{border-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:border-muted-foreground\\/50{border-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)50%,transparent)}}.ww\\:border-transparent{border-color:#0000}.ww\\:bg-accent{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:bg-background,.ww\\:bg-background\\/20{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/20{background-color:color-mix(in oklab,var(--ww-color-background,#fff)20%,transparent)}}.ww\\:bg-border{background-color:var(--ww-color-border,#e5e7eb)}.ww\\:bg-foreground,.ww\\:bg-foreground\\/5{background-color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-foreground\\/5{background-color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)5%,transparent)}}.ww\\:bg-input{background-color:var(--ww-color-input,#f9fafb)}.ww\\:bg-muted{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:bg-muted-foreground\\/60{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted-foreground\\/60{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)60%,transparent)}}.ww\\:bg-muted\\/50{background-color:var(--ww-color-muted,#f1f5f9)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-muted\\/50{background-color:color-mix(in oklab,var(--ww-color-muted,#f1f5f9)50%,transparent)}}.ww\\:bg-primary{background-color:var(--ww-color-primary,#6366f1)}.ww\\:bg-tool-card{background-color:var(--ww-color-tool-card,#f4f4f5)}.ww\\:bg-transparent{background-color:#0000}.ww\\:object-cover{object-fit:cover}.ww\\:p-0{padding:calc(var(--ww-spacing)*0)}.ww\\:p-1{padding:calc(var(--ww-spacing)*1)}.ww\\:p-1\\.5{padding:calc(var(--ww-spacing)*1.5)}.ww\\:p-2{padding:calc(var(--ww-spacing)*2)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-1\\.5{padding-inline:calc(var(--ww-spacing)*1.5)}.ww\\:px-2{padding-inline:calc(var(--ww-spacing)*2)}.ww\\:px-3{padding-inline:calc(var(--ww-spacing)*3)}.ww\\:px-3\\.5{padding-inline:calc(var(--ww-spacing)*3.5)}.ww\\:px-4{padding-inline:calc(var(--ww-spacing)*4)}.ww\\:px-6{padding-inline:calc(var(--ww-spacing)*6)}.ww\\:\\!py-0{padding-block:calc(var(--ww-spacing)*0)!important}.ww\\:py-0\\.5{padding-block:calc(var(--ww-spacing)*.5)}.ww\\:py-1{padding-block:calc(var(--ww-spacing)*1)}.ww\\:py-1\\.5{padding-block:calc(var(--ww-spacing)*1.5)}.ww\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:py-2\\.5{padding-block:calc(var(--ww-spacing)*2.5)}.ww\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:py-6{padding-block:calc(var(--ww-spacing)*6)}.ww\\:py-12{padding-block:calc(var(--ww-spacing)*12)}.ww\\:pt-1{padding-top:calc(var(--ww-spacing)*1)}.ww\\:pt-2{padding-top:calc(var(--ww-spacing)*2)}.ww\\:pt-2\\.5{padding-top:calc(var(--ww-spacing)*2.5)}.ww\\:pt-3{padding-top:calc(var(--ww-spacing)*3)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-1{padding-bottom:calc(var(--ww-spacing)*1)}.ww\\:pb-1\\.5{padding-bottom:calc(var(--ww-spacing)*1.5)}.ww\\:pb-2{padding-bottom:calc(var(--ww-spacing)*2)}.ww\\:pb-2\\.5{padding-bottom:calc(var(--ww-spacing)*2.5)}.ww\\:pb-3{padding-bottom:calc(var(--ww-spacing)*3)}.ww\\:pb-8{padding-bottom:calc(var(--ww-spacing)*8)}.ww\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:text-center{text-align:center}.ww\\:text-left{text-align:left}.ww\\:font-\\[family-name\\:var\\(--ww-font\\)\\]{font-family:var(--ww-font)}.ww\\:font-\\[family-name\\:var\\(--ww-font-sans\\)\\]{font-family:var(--ww-font-sans)}.ww\\:font-mono{font-family:var(--ww-font-mono)}.ww\\:text-base{font-size:var(--ww-text-base);line-height:var(--tw-leading,var(--ww-text-base--line-height))}.ww\\:text-lg{font-size:var(--ww-text-lg);line-height:var(--tw-leading,var(--ww-text-lg--line-height))}.ww\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:text-xs{font-size:var(--ww-text-xs);line-height:var(--tw-leading,var(--ww-text-xs--line-height))}.ww\\:\\[font-size\\:var\\(--ww-font-size\\,1rem\\)\\]{font-size:var(--ww-font-size,1rem)}.ww\\:text-\\[10px\\]{font-size:10px}.ww\\:text-\\[11px\\]{font-size:11px}.ww\\:\\[line-height\\:var\\(--ww-line-height\\,1\\.5\\)\\]{line-height:var(--ww-line-height,1.5)}.ww\\:font-medium{--tw-font-weight:var(--ww-font-weight-medium);font-weight:var(--ww-font-weight-medium)}.ww\\:font-semibold{--tw-font-weight:var(--ww-font-weight-semibold);font-weight:var(--ww-font-weight-semibold)}.ww\\:tracking-wide{--tw-tracking:var(--ww-tracking-wide);letter-spacing:var(--ww-tracking-wide)}.ww\\:tracking-wider{--tw-tracking:var(--ww-tracking-wider);letter-spacing:var(--ww-tracking-wider)}.ww\\:break-words{overflow-wrap:break-word}.ww\\:break-all{word-break:break-all}.ww\\:whitespace-nowrap{white-space:nowrap}.ww\\:whitespace-pre-wrap{white-space:pre-wrap}.ww\\:text-background{color:var(--ww-color-background,#fff)}.ww\\:text-foreground,.ww\\:text-foreground\\/80{color:var(--ww-color-foreground,#1f2937)}@supports (color:color-mix(in lab, red, red)){.ww\\:text-foreground\\/80{color:color-mix(in oklab,var(--ww-color-foreground,#1f2937)80%,transparent)}}.ww\\:text-muted-foreground{color:var(--ww-color-muted-foreground,#6b7280)}.ww\\:text-primary{color:var(--ww-color-primary,#6366f1)}.ww\\:text-primary-foreground{color:var(--ww-color-primary-foreground,#1f2937)}.ww\\:uppercase{text-transform:uppercase}.ww\\:italic{font-style:italic}.ww\\:opacity-0{opacity:0}.ww\\:opacity-70{opacity:.7}.ww\\:opacity-100{opacity:1}.ww\\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ww\\:ring-\\[\\#0a6c74\\]{--tw-ring-color:#0a6c74}.ww\\:ring-blue-400\\/70{--tw-ring-color:var(--ww-color-blue-400)}@supports (color:color-mix(in lab, red, red)){.ww\\:ring-blue-400\\/70{--tw-ring-color:color-mix(in oklab,var(--ww-color-blue-400)70%,transparent)}}.ww\\:ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ww\\:ring-offset-background{--tw-ring-offset-color:var(--ww-color-background,#fff)}.ww\\:backdrop-blur-xl{--tw-backdrop-blur:blur(var(--ww-blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.ww\\:transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-\\[max-width\\]{transition-property:max-width;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ww-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ww-default-transition-duration))}.ww\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.ww\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.ww\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.ww\\:ease-out{--tw-ease:var(--ww-ease-out);transition-timing-function:var(--ww-ease-out)}.ww\\:outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.ww\\:group-hover\\:opacity-0:is(:where(.ww\\:group):hover *){opacity:0}.ww\\:group-hover\\:opacity-100:is(:where(.ww\\:group):hover *){opacity:1}}.ww\\:group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.ww\\:group).is-assistant *){color:var(--ww-color-foreground,#1f2937)}.ww\\:group-\\[\\.is-user\\]\\:ml-auto:is(:where(.ww\\:group).is-user *){margin-left:auto}.ww\\:group-\\[\\.is-user\\]\\:\\[border-radius\\:var\\(--ww-msg-radius\\,8px\\)\\]:is(:where(.ww\\:group).is-user *){border-radius:var(--ww-msg-radius,8px)}.ww\\:group-\\[\\.is-user\\]\\:bg-user-bubble:is(:where(.ww\\:group).is-user *){background-color:var(--ww-color-user-bubble,#f4f4f4)}.ww\\:group-\\[\\.is-user\\]\\:\\[padding\\:var\\(--ww-msg-pad-y\\,12px\\)_var\\(--ww-msg-pad-x\\,16px\\)\\]:is(:where(.ww\\:group).is-user *){padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px)}.ww\\:group-\\[\\.is-user\\]\\:\\[color\\:var\\(--ww-color-user-bubble-text\\)\\]:is(:where(.ww\\:group).is-user *){color:var(--ww-color-user-bubble-text)}.ww\\:placeholder\\:text-muted-foreground::placeholder{color:var(--ww-color-muted-foreground,#6b7280)}@media (hover:hover){.ww\\:hover\\:border-primary\\/30:hover{border-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)30%,transparent)}}.ww\\:hover\\:bg-accent:hover{background-color:var(--ww-color-accent,#f3f4f6)}.ww\\:hover\\:bg-foreground:hover{background-color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:bg-muted:hover{background-color:var(--ww-color-muted,#f1f5f9)}.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:var(--ww-color-muted-foreground,#6b7280)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-muted-foreground\\/10:hover{background-color:color-mix(in oklab,var(--ww-color-muted-foreground,#6b7280)10%,transparent)}}.ww\\:hover\\:bg-primary\\/90:hover{background-color:var(--ww-color-primary,#6366f1)}@supports (color:color-mix(in lab, red, red)){.ww\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--ww-color-primary,#6366f1)90%,transparent)}}.ww\\:hover\\:text-accent-foreground:hover{color:var(--ww-color-accent-foreground,#1f2937)}.ww\\:hover\\:text-foreground:hover{color:var(--ww-color-foreground,#1f2937)}.ww\\:hover\\:underline:hover{text-decoration-line:underline}}.ww\\:disabled\\:pointer-events-none:disabled{pointer-events:none}.ww\\:disabled\\:opacity-40:disabled{opacity:.4}.ww\\:disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.ww\\:sm\\:inset-auto{inset:auto}.ww\\:sm\\:right-0{right:calc(var(--ww-spacing)*0)}.ww\\:sm\\:bottom-4{bottom:calc(var(--ww-spacing)*4)}.ww\\:sm\\:left-0{left:calc(var(--ww-spacing)*0)}.ww\\:sm\\:mx-auto{margin-inline:auto}.ww\\:sm\\:h-\\[720px\\]{height:720px}.ww\\:sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.ww\\:sm\\:w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.ww\\:sm\\:max-w-\\[1000px\\]{max-width:1000px}.ww\\:sm\\:rounded-2xl{border-radius:var(--ww-radius-2xl)}.ww\\:sm\\:border{border-style:var(--tw-border-style);border-width:1px}.ww\\:sm\\:border-border{border-color:var(--ww-color-border,#e5e7eb)}.ww\\:sm\\:py-2{padding-block:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:text-sm{font-size:var(--ww-text-sm);line-height:var(--tw-leading,var(--ww-text-sm--line-height))}.ww\\:sm\\:text-\\[11px\\]{font-size:11px}}.ww\\:\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--ww-spacing)*0)}.ww\\:\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--ww-spacing)*0)}}@keyframes ww-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes ww-fade-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes ww-pulse{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes ww-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){[data-waniwani-chat] [data-waniwani-shimmer]{color:var(--ww-color-muted-foreground)!important;animation:none!important}}[data-waniwani-floating=dock]{transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility 0s linear .42s}[data-waniwani-floating=dock][data-appeared=true][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .32s,transform .42s cubic-bezier(.22,1,.36,1),max-width .3s,visibility;transform:translateY(0)}[data-waniwani-floating=dock][data-appeared=false],[data-waniwani-floating=dock][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(1rem)}[data-waniwani-floating=panel]{transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility 0s linear .44s}[data-waniwani-floating=panel][data-state=shown]{visibility:visible;opacity:1;pointer-events:auto;clip-path:inset(-40px round 18px);transition:clip-path .44s cubic-bezier(.22,1,.36,1),opacity .26s,visibility}[data-waniwani-floating=panel][data-state=hidden]{opacity:0;visibility:hidden;pointer-events:none;clip-path:inset(calc(100% - 60px) 12% 0 round 24px)}@media (max-width:639px){[data-waniwani-floating=panel][data-state=shown]{clip-path:inset(0)}[data-waniwani-floating=panel][data-state=hidden]{clip-path:inset(calc(100% - 72px) 6% 0 round 22px)}}@media (prefers-reduced-motion:reduce){[data-waniwani-floating=dock],[data-waniwani-floating=panel]{clip-path:none;transition:visibility 0s linear 10ms}[data-waniwani-floating=dock][data-appeared=true][data-state=shown],[data-waniwani-floating=panel][data-state=shown]{transition:visibility}}[data-waniwani-chat] ::-webkit-scrollbar{width:8px}[data-waniwani-chat] ::-webkit-scrollbar-track{background:0 0}[data-waniwani-chat] ::-webkit-scrollbar-thumb{background:var(--ww-color-border);border-radius:9999px}[data-waniwani-chat] ::-webkit-scrollbar-thumb:hover{background:var(--ww-color-muted-foreground)}[data-waniwani-chat] *{scrollbar-width:thin;scrollbar-color:var(--ww-color-border)transparent}[data-waniwani-chat]{--ww-color-background:var(--ww-bg,#fff);--ww-color-foreground:var(--ww-text,#1f2937);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#1f2937);--ww-color-muted-foreground:var(--ww-muted,#6b7280);--ww-color-border:var(--ww-border,#e5e7eb);--ww-color-input:var(--ww-input-bg,#f9fafb);--ww-color-accent:var(--ww-assistant-bubble,#f3f4f6);--ww-color-accent-foreground:var(--ww-text,#1f2937);--ww-color-user-bubble:var(--ww-user-bubble,#f4f4f4);--ww-color-card:var(--ww-bg,#fff);--ww-color-card-foreground:var(--ww-text,#1f2937);--ww-color-card-header:var(--ww-header-bg,#fff);--ww-color-card-header-foreground:var(--ww-header-text,#1f2937);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#f4f4f5);--ww-radius:var(--ww-radius,16px);--ww-font-sans:var(--ww-font,system-ui,-apple-system,\"Segoe UI\",sans-serif);--ww-color-user-bubble-text:var(--ww-user-bubble-text,var(--ww-color-primary-foreground));--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#eceef499;--ww-glass-border:#0000000f;border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-color-border);box-shadow:var(--ww-shadow,none)}[data-waniwani-chat][data-assistant-bubble=true] .ww-message-assistant .ww-bubble{background:var(--ww-color-accent);color:var(--ww-color-assistant-bubble-text);border-radius:var(--ww-msg-radius,8px);padding:var(--ww-msg-pad-y,12px)var(--ww-msg-pad-x,16px);width:fit-content;max-width:var(--ww-msg-max-width,80%)}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto]{--ww-color-background:var(--ww-bg,#212121);--ww-color-foreground:var(--ww-text,#ececec);--ww-color-primary:var(--ww-primary,#6366f1);--ww-color-primary-foreground:var(--ww-primary-fg,#fff);--ww-color-muted-foreground:var(--ww-muted,#8e8ea0);--ww-color-border:var(--ww-border,#444);--ww-color-input:var(--ww-input-bg,#2f2f2f);--ww-color-accent:var(--ww-assistant-bubble,#2f2f2f);--ww-color-accent-foreground:var(--ww-text,#ececec);--ww-color-user-bubble:var(--ww-user-bubble,#303030);--ww-color-card:var(--ww-bg,#212121);--ww-color-card-foreground:var(--ww-text,#ececec);--ww-color-card-header:var(--ww-header-bg,#1e1e1e);--ww-color-card-header-foreground:var(--ww-header-text,#ececec);--ww-color-status:var(--ww-status,#22c55e);--ww-color-tool-card:var(--ww-tool-card,#262626);--ww-color-user-bubble-text:var(--ww-user-bubble-text,#fff);--ww-color-assistant-bubble-text:var(--ww-assistant-bubble-text,var(--ww-color-foreground));--ww-glass:#282a3480;--ww-glass-border:#ffffff1f}}[data-waniwani-chat] [data-streamdown=table-wrapper]{flex-direction:column;gap:.5rem;margin-top:1rem;margin-bottom:1rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:first-child:has(button){justify-content:flex-end;align-items:center;gap:.25rem;display:flex}[data-waniwani-chat] [data-streamdown=table-wrapper]>div:last-child{overflow-x:auto}[data-waniwani-chat] [data-streamdown=table]{border-collapse:collapse;border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;overflow:hidden}[data-waniwani-chat] [data-streamdown=table-header]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]{background-color:var(--ww-color-accent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=table-body]{background-color:color-mix(in srgb,var(--ww-color-accent)40%,transparent)}}[data-waniwani-chat] [data-streamdown=table-body]>tr+tr{border-top:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-row]{border-bottom:1px solid var(--ww-color-border)}[data-waniwani-chat] [data-streamdown=table-header-cell]{white-space:nowrap;text-align:left;padding:.5rem 1rem;font-size:.875rem;font-weight:600}[data-waniwani-chat] [data-streamdown=table-cell]{padding:.5rem 1rem;font-size:.875rem}[data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary);overflow-wrap:anywhere;cursor:pointer;font-weight:500;text-decoration:underline}[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat].dark [data-streamdown=link],.dark [data-waniwani-chat] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:var(--ww-color-primary)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto] [data-streamdown=link]{color:color-mix(in oklab,var(--ww-color-primary)55%,white)}}}[data-waniwani-chat].dark [data-waniwani-logo],.dark [data-waniwani-chat] [data-waniwani-logo]{filter:invert()}@media (prefers-color-scheme:dark){[data-waniwani-chat][data-color-scheme=auto] [data-waniwani-logo]{filter:invert()}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{z-index:50;background-color:var(--ww-color-background);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=link-safety-modal]{background-color:color-mix(in srgb,var(--ww-color-background)50%,transparent)}}[data-waniwani-chat] [data-streamdown=link-safety-modal]{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);width:100%;max-width:28rem;color:var(--ww-color-foreground);border-radius:.75rem;flex-direction:column;gap:1rem;margin:0 1rem;padding:1.5rem;display:flex;position:relative;box-shadow:0 10px 25px #0000001a}[data-waniwani-chat] [data-streamdown=link-safety-modal] button{cursor:pointer}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child{color:var(--ww-color-muted-foreground);background:0 0;border:none;border-radius:.375rem;padding:.25rem;transition:background-color .15s,color .15s;position:absolute;top:1rem;right:1rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>button:first-child:hover{background-color:var(--ww-color-accent);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type{flex-direction:column;gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>div{align-items:center;gap:.5rem;font-size:1.125rem;font-weight:600;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:first-of-type>p{color:var(--ww-color-muted-foreground);font-size:.875rem}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:nth-child(3){word-break:break-all;background-color:var(--ww-color-accent);border-radius:.375rem;max-height:8rem;padding:.75rem;font-family:ui-monospace,monospace;font-size:.875rem;overflow-y:auto}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child{gap:.5rem;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button{border:none;border-radius:.375rem;flex:1;justify-content:center;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:background-color .15s;display:flex}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child{border:1px solid var(--ww-color-border);background-color:var(--ww-color-background);color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:first-child:hover{background-color:var(--ww-color-accent)}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child{background-color:var(--ww-color-primary);color:#fff}[data-waniwani-chat] [data-streamdown=link-safety-modal]>div>div:last-child>button:last-child:hover{opacity:.9}[data-waniwani-chat] [data-streamdown=ordered-list]{white-space:normal;list-style-type:decimal;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=ordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=unordered-list]{white-space:normal;list-style-type:disc;list-style-position:inside}[data-waniwani-chat] li [data-streamdown=unordered-list]{padding-left:1.5rem}[data-waniwani-chat] [data-streamdown=list-item]{padding-top:.25rem;padding-bottom:.25rem}[data-waniwani-chat] [data-streamdown=list-item]>p{display:inline}[data-waniwani-chat] [data-streamdown=inline-code]{background-color:var(--ww-color-accent);border-radius:.25rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:.875rem}[data-waniwani-chat] [data-streamdown=heading-1]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.875rem;font-weight:600;line-height:2.25rem}[data-waniwani-chat] [data-streamdown=heading-2]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.5rem;font-weight:600;line-height:2rem}[data-waniwani-chat] [data-streamdown=heading-3]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-4]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.125rem;font-weight:600;line-height:1.75rem}[data-waniwani-chat] [data-streamdown=heading-5]{margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;font-weight:600;line-height:1.5rem}[data-waniwani-chat] [data-streamdown=heading-6]{margin-top:1.5rem;margin-bottom:.5rem;font-size:.875rem;font-weight:600;line-height:1.25rem}[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid var(--ww-color-muted-foreground);margin-top:1rem;margin-bottom:1rem}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=blockquote]{border-left:4px solid color-mix(in srgb,var(--ww-color-muted-foreground)30%,transparent)}}[data-waniwani-chat] [data-streamdown=blockquote]{color:var(--ww-color-muted-foreground);padding-left:1rem;font-style:italic}[data-waniwani-chat] [data-streamdown=horizontal-rule]{border-color:var(--ww-color-border);margin-top:1.5rem;margin-bottom:1.5rem}[data-waniwani-chat] [data-streamdown=strong]{font-weight:600}[data-waniwani-chat] [data-streamdown=image-wrapper]{margin-top:1rem;margin-bottom:1rem;display:inline-block;position:relative}[data-waniwani-chat] [data-streamdown=image]{border-radius:.5rem;max-width:100%}[data-waniwani-chat] [data-streamdown=code-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;width:100%;margin-top:1rem;margin-bottom:1rem;overflow:hidden}[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:var(--ww-color-accent);justify-content:space-between;align-items:center;display:flex}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat] [data-streamdown=code-block-header]{background-color:color-mix(in srgb,var(--ww-color-accent)80%,transparent)}}[data-waniwani-chat] [data-streamdown=code-block-header]{color:var(--ww-color-muted-foreground);padding:.75rem;font-size:.75rem}[data-waniwani-chat] [data-streamdown=code-block-body]{padding:1rem;font-size:.875rem;overflow-x:auto}[data-waniwani-chat] [data-streamdown=code-block-copy-button],[data-waniwani-chat] [data-streamdown=code-block-download-button]{cursor:pointer;color:var(--ww-color-muted-foreground);background:0 0;border:none;padding:.25rem;transition:color .15s}[data-waniwani-chat] [data-streamdown=code-block-copy-button]:hover,[data-waniwani-chat] [data-streamdown=code-block-download-button]:hover{color:var(--ww-color-foreground)}[data-waniwani-chat] [data-streamdown=mermaid-block]{border:1px solid var(--ww-color-border);border-radius:.75rem;height:auto;margin-top:1rem;margin-bottom:1rem;padding:1rem;position:relative}[data-waniwani-chat] [data-streamdown=mermaid]{width:100%;height:100%}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}",bt=null,eo=null,sa=null,ip=null,Yj="waniwani-chat-sizing",Qj="waniwani-chat-defaults",Jj="waniwani-chat-chrome",e8="waniwani-chat-auto-card",t8=`:where([data-waniwani-embed]){height:${PI}}`,a8=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",n8=":where([data-waniwani-embed]){border-style:solid;border-width:var(--ww-border-width,0);border-color:var(--ww-border,transparent);box-shadow:var(--ww-shadow,none)}",r8=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:28rem;margin-inline:auto;border-radius:16px;overflow:hidden;border-style:solid;border-width:var(--ww-border-width,1px);border-color:var(--ww-border,rgba(0,0,0,0.1));box-shadow:var(--ww-shadow,0 10px 30px rgba(0,0,0,0.08))}";function lp(e,t){if(typeof document>"u"||document.getElementById(e))return;let a=document.createElement("style");a.id=e,a.textContent=t,document.head.appendChild(a)}function o8(e,t){let a=t.appearance?.variables;!a||!(e instanceof HTMLElement)||(typeof a.borderWidth=="number"&&e.style.setProperty("--ww-border-width",`${a.borderWidth}px`),a.borderColor&&e.style.setProperty("--ww-border",a.borderColor),a.boxShadow&&e.style.setProperty("--ww-shadow",a.boxShadow))}function XD(e,t){if(bx&&bx!=="__WANIWANI_EMBED_CSS__"){let n=document.createElement("style");n.textContent=bx,e.appendChild(n)}let a=document.createElement("style");if(a.textContent="[data-waniwani-chat]{border-width:0;box-shadow:none}",e.appendChild(a),t.css)try{let n=new URL(t.css,window.location.href);if(n.protocol==="https:"||n.protocol==="http:"){let r=document.createElement("link");r.rel="stylesheet",r.href=n.href,e.appendChild(r)}else console.warn("[Waniwani] Custom CSS URL must use http or https protocol.")}catch{console.warn("[Waniwani] Invalid custom CSS URL:",t.css)}}var WD="data-waniwani-embed",Sx="data-waniwani-auto";function i8(e){let t=document.querySelector(`[${WD}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(WD,""),a.setAttribute(Sx,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function l8(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function s8(e,t,a,n){let r=i8(n);lp(Yj,t8),e.height&&r instanceof HTMLElement&&(r.style.height=l8(e.height)),e.appearance?.theme&&lp(Qj,a8),lp(Jj,n8),r.hasAttribute(Sx)&&lp(e8,r8),o8(r,e),sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(sa);let o=sa,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let f=Number.parseFloat(d.maxHeight);if(!Number.isFinite(f)){o.style.removeProperty("max-height");return}let p=f;d.boxSizing==="border-box"&&(p-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),p>0?o.style.maxHeight=`${p}px`:o.style.removeProperty("max-height")};i(),ip=new ResizeObserver(i),ip.observe(r);let l=sa.attachShadow({mode:"open"});XD(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=Cu.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=np(e.api??"",e.token,e.channelId);d?.visibility&&!Jf(d.visibility,window.location.pathname)&&c(!1)}return eo=Ix.default.createRoot(s),eo.render(Cu.default.createElement(GD,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{ip?.disconnect(),ip=null,eo?.unmount(),eo=null,sa?.remove(),sa=null,r.hasAttribute(Sx)&&r.remove(),bt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let f=u.current?.chat;if(f)return await f.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function u8(e,t,a){sa=document.createElement("div"),sa.id="waniwani-chat-embed",sa.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(sa);let n=sa.attachShadow({mode:"open"});XD(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=Cu.default.createRef();return eo=Ix.default.createRoot(r),eo.render(Cu.default.createElement(VD,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{eo?.unmount(),eo=null,sa?.remove(),sa=null,bt=null},open:()=>o.current?.open(),close:()=>o.current?.close(),toggle:()=>o.current?.toggle(),sendMessage:i=>o.current?.sendMessage(i),sendMessageAndWait:async i=>{if(o.current)return o.current.sendMessageAndWait(i)},reset:()=>o.current?.reset(),focus:()=>o.current?.focus(),getMessages:()=>o.current?.getMessages()??[],getSessionId:()=>o.current?.getSessionId()}}function KD(e){if(bt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),bt;let t=og(),a=sd(),n=ys(e,void 0,a);ld(n.visitorId);let r=n.mode==="floating"?u8(n,e,a):s8(n,e,a,t),o=n.api??"",i=n.token?OI({api:o,token:n.token,channelId:n.channelId,getSource:()=>np(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):ng("no public token configured (set data-token or pass token to init())");return bt={...r,track:i.track,identify:(l,s)=>i.identify(l,s),setVisitorId:l=>ms(l),getVisitorId:()=>Kn(),destroy:()=>{i.shutdown(),r.destroy()}},bt}function c8(){bt&&bt.destroy()}var ZD=ng("chat widget is not initialized (call WaniWani.chat.init() first)"),dl=()=>bt?bt.track:ZD.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:KD,destroy:c8,open:()=>bt?.open(),close:()=>bt?.close(),toggle:()=>bt?.toggle(),sendMessage:e=>bt?.sendMessage(e),sendMessageAndWait:async e=>{if(bt)return bt.sendMessageAndWait(e)},reset:()=>bt?.reset(),focus:()=>bt?.focus(),getMessages:()=>bt?.getMessages()??[],getSessionId:()=>bt?.getSessionId(),track:Object.assign(e=>dl()(e),{priceShown:e=>dl().priceShown(e),pricesCompared:e=>dl().pricesCompared(e),optionSelected:e=>dl().optionSelected(e),leadQualified:e=>dl().leadQualified(e),converted:e=>dl().converted(e)}),identify:(e,t)=>bt?bt.identify(e,t):ZD.identify(e,t),setVisitorId:e=>ms(e),getVisitorId:()=>Kn()};function $D(){if(sd().token)try{KD()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$D):$D();})();
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
react/cjs/react.production.js:
|