@waniwani/sdk 0.21.2 → 0.21.3
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 +59 -59
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/styles.css +1 -1
- package/package.json +1 -1
package/dist/chat/embed.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var AO=Object.create;var dc=Object.defineProperty;var RO=Object.getOwnPropertyDescriptor;var DO=Object.getOwnPropertyNames;var _O=Object.getPrototypeOf,OO=Object.prototype.hasOwnProperty;var PO=(e,t,a)=>t in e?dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fc=(e,t)=>{for(var a in t)dc(e,a,{get:t[a],enumerable:!0})},NO=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of DO(t))!OO.call(e,r)&&r!==a&&dc(e,r,{get:()=>t[r],enumerable:!(n=RO(t,r))||n.enumerable});return e};var q=(e,t,a)=>(a=e!=null?AO(_O(e)):{},NO(t||!e||!e.__esModule?dc(a,"default",{value:e,enumerable:!0}):a,e));var te=(e,t,a)=>PO(e,typeof t!="symbol"?t+"":t,a);var Pv=na(me=>{"use strict";var Yp=Symbol.for("react.transitional.element"),BO=Symbol.for("react.portal"),UO=Symbol.for("react.fragment"),FO=Symbol.for("react.strict_mode"),zO=Symbol.for("react.profiler"),qO=Symbol.for("react.consumer"),HO=Symbol.for("react.context"),jO=Symbol.for("react.forward_ref"),VO=Symbol.for("react.suspense"),WO=Symbol.for("react.memo"),Mv=Symbol.for("react.lazy"),GO=Symbol.for("react.activity"),kv=Symbol.iterator;function $O(e){return e===null||typeof e!="object"?null:(e=kv&&e[kv]||e["@@iterator"],typeof e=="function"?e:null)}var Av={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rv=Object.assign,Dv={};function mi(e,t,a){this.props=e,this.context=t,this.refs=Dv,this.updater=a||Av}mi.prototype.isReactComponent={};mi.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")};mi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _v(){}_v.prototype=mi.prototype;function Zp(e,t,a){this.props=e,this.context=t,this.refs=Dv,this.updater=a||Av}var Qp=Zp.prototype=new _v;Qp.constructor=Zp;Rv(Qp,mi.prototype);Qp.isPureReactComponent=!0;var Tv=Array.isArray;function Kp(){}var ct={H:null,A:null,T:null,S:null},Ov=Object.prototype.hasOwnProperty;function Jp(e,t,a){var n=a.ref;return{$$typeof:Yp,type:e,key:t,ref:n!==void 0?n:null,props:a}}function XO(e,t){return Jp(e.type,t,e.props)}function em(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yp}function KO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Lv=/\/+/g;function Xp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?KO(""+e.key):t.toString(36)}function YO(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Kp,Kp):(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 pi(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 Yp:case BO:i=!0;break;case Mv:return i=e._init,pi(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Xp(e,0):n,Tv(r)?(a="",i!=null&&(a=i.replace(Lv,"$&/")+"/"),pi(r,t,a,"",function(u){return u})):r!=null&&(em(r)&&(r=XO(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Lv,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(Tv(e))for(var s=0;s<e.length;s++)n=e[s],o=l+Xp(n,s),i+=pi(n,t,a,o,r);else if(s=$O(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+Xp(n,s++),i+=pi(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return pi(YO(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 pc(e,t,a){if(e==null)return e;var n=[],r=0;return pi(e,n,"","",function(o){return t.call(a,o,r++)}),n}function ZO(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 Ev=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)},QO={map:pc,forEach:function(e,t,a){pc(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return pc(e,function(){t++}),t},toArray:function(e){return pc(e,function(t){return t})||[]},only:function(e){if(!em(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Activity=GO;me.Children=QO;me.Component=mi;me.Fragment=UO;me.Profiler=zO;me.PureComponent=Zp;me.StrictMode=FO;me.Suspense=VO;me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ct;me.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ct.H.useMemoCache(e)}};me.cache=function(e){return function(){return e.apply(null,arguments)}};me.cacheSignal=function(){return null};me.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Rv({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Ov.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 Jp(e.type,r,n)};me.createContext=function(e){return e={$$typeof:HO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:qO,_context:e},e};me.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Ov.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 Jp(e,o,r)};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:jO,render:e}};me.isValidElement=em;me.lazy=function(e){return{$$typeof:Mv,_payload:{_status:-1,_result:e},_init:ZO}};me.memo=function(e,t){return{$$typeof:WO,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=ct.T,a={};ct.T=a;try{var n=e(),r=ct.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Kp,Ev)}catch(o){Ev(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),ct.T=t}};me.unstable_useCacheRefresh=function(){return ct.H.useCacheRefresh()};me.use=function(e){return ct.H.use(e)};me.useActionState=function(e,t,a){return ct.H.useActionState(e,t,a)};me.useCallback=function(e,t){return ct.H.useCallback(e,t)};me.useContext=function(e){return ct.H.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e,t){return ct.H.useDeferredValue(e,t)};me.useEffect=function(e,t){return ct.H.useEffect(e,t)};me.useEffectEvent=function(e){return ct.H.useEffectEvent(e)};me.useId=function(){return ct.H.useId()};me.useImperativeHandle=function(e,t,a){return ct.H.useImperativeHandle(e,t,a)};me.useInsertionEffect=function(e,t){return ct.H.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return ct.H.useLayoutEffect(e,t)};me.useMemo=function(e,t){return ct.H.useMemo(e,t)};me.useOptimistic=function(e,t){return ct.H.useOptimistic(e,t)};me.useReducer=function(e,t,a){return ct.H.useReducer(e,t,a)};me.useRef=function(e){return ct.H.useRef(e)};me.useState=function(e){return ct.H.useState(e)};me.useSyncExternalStore=function(e,t,a){return ct.H.useSyncExternalStore(e,t,a)};me.useTransition=function(){return ct.H.useTransition()};me.version="19.2.4"});var he=na((O7,Nv)=>{"use strict";Nv.exports=Pv()});var Gv=na(wt=>{"use strict";function rm(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<mc(r,t))e[n]=t,e[a]=r,a=n;else break e}}function Ln(e){return e.length===0?null:e[0]}function gc(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>mc(l,a))s<r&&0>mc(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>mc(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function mc(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}wt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Bv=performance,wt.unstable_now=function(){return Bv.now()}):(tm=Date,Uv=tm.now(),wt.unstable_now=function(){return tm.now()-Uv});var Bv,tm,Uv,Hn=[],Ir=[],JO=1,Ka=null,ra=3,om=!1,$l=!1,Xl=!1,im=!1,qv=typeof setTimeout=="function"?setTimeout:null,Hv=typeof clearTimeout=="function"?clearTimeout:null,Fv=typeof setImmediate<"u"?setImmediate:null;function hc(e){for(var t=Ln(Ir);t!==null;){if(t.callback===null)gc(Ir);else if(t.startTime<=e)gc(Ir),t.sortIndex=t.expirationTime,rm(Hn,t);else break;t=Ln(Ir)}}function lm(e){if(Xl=!1,hc(e),!$l)if(Ln(Hn)!==null)$l=!0,gi||(gi=!0,hi());else{var t=Ln(Ir);t!==null&&sm(lm,t.startTime-e)}}var gi=!1,Kl=-1,jv=5,Vv=-1;function Wv(){return im?!0:!(wt.unstable_now()-Vv<jv)}function am(){if(im=!1,gi){var e=wt.unstable_now();Vv=e;var t=!0;try{e:{$l=!1,Xl&&(Xl=!1,Hv(Kl),Kl=-1),om=!0;var a=ra;try{t:{for(hc(e),Ka=Ln(Hn);Ka!==null&&!(Ka.expirationTime>e&&Wv());){var n=Ka.callback;if(typeof n=="function"){Ka.callback=null,ra=Ka.priorityLevel;var r=n(Ka.expirationTime<=e);if(e=wt.unstable_now(),typeof r=="function"){Ka.callback=r,hc(e),t=!0;break t}Ka===Ln(Hn)&&gc(Hn),hc(e)}else gc(Hn);Ka=Ln(Hn)}if(Ka!==null)t=!0;else{var o=Ln(Ir);o!==null&&sm(lm,o.startTime-e),t=!1}}break e}finally{Ka=null,ra=a,om=!1}t=void 0}}finally{t?hi():gi=!1}}}var hi;typeof Fv=="function"?hi=function(){Fv(am)}:typeof MessageChannel<"u"?(nm=new MessageChannel,zv=nm.port2,nm.port1.onmessage=am,hi=function(){zv.postMessage(null)}):hi=function(){qv(am,0)};var nm,zv;function sm(e,t){Kl=qv(function(){e(wt.unstable_now())},t)}wt.unstable_IdlePriority=5;wt.unstable_ImmediatePriority=1;wt.unstable_LowPriority=4;wt.unstable_NormalPriority=3;wt.unstable_Profiling=null;wt.unstable_UserBlockingPriority=2;wt.unstable_cancelCallback=function(e){e.callback=null};wt.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"):jv=0<e?Math.floor(1e3/e):5};wt.unstable_getCurrentPriorityLevel=function(){return ra};wt.unstable_next=function(e){switch(ra){case 1:case 2:case 3:var t=3;break;default:t=ra}var a=ra;ra=t;try{return e()}finally{ra=a}};wt.unstable_requestPaint=function(){im=!0};wt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ra;ra=e;try{return t()}finally{ra=a}};wt.unstable_scheduleCallback=function(e,t,a){var n=wt.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:JO++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,rm(Ir,e),Ln(Hn)===null&&e===Ln(Ir)&&(Xl?(Hv(Kl),Kl=-1):Xl=!0,sm(lm,a-n))):(e.sortIndex=r,rm(Hn,e),$l||om||($l=!0,gi||(gi=!0,hi()))),e};wt.unstable_shouldYield=Wv;wt.unstable_wrapCallback=function(e){var t=ra;return function(){var a=ra;ra=t;try{return e.apply(this,arguments)}finally{ra=a}}}});var Xv=na((N7,$v)=>{"use strict";$v.exports=Gv()});var Yv=na(fa=>{"use strict";var eP=he();function Kv(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 da={d:{f:Cr,r:function(){throw Error(Kv(522))},D:Cr,C:Cr,L:Cr,m:Cr,X:Cr,S:Cr,M:Cr},p:0,findDOMNode:null},tP=Symbol.for("react.portal");function aP(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:tP,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Yl=eP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function wc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=da;fa.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(Kv(299));return aP(e,t,null,a)};fa.flushSync=function(e){var t=Yl.T,a=da.p;try{if(Yl.T=null,da.p=2,e)return e()}finally{Yl.T=t,da.p=a,da.d.f()}};fa.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,da.d.C(e,t))};fa.prefetchDNS=function(e){typeof e=="string"&&da.d.D(e)};fa.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=wc(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?da.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&da.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fa.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=wc(t.as,t.crossOrigin);da.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&&da.d.M(e)};fa.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=wc(a,t.crossOrigin);da.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})}};fa.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=wc(t.as,t.crossOrigin);da.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 da.d.m(e)};fa.requestFormReset=function(e){da.d.r(e)};fa.unstable_batchedUpdates=function(e,t){return e(t)};fa.useFormState=function(e,t,a){return Yl.H.useFormState(e,t,a)};fa.useFormStatus=function(){return Yl.H.useHostTransitionStatus()};fa.version="19.2.4"});var um=na((U7,Qv)=>{"use strict";function Zv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zv)}catch(e){console.error(e)}}Zv(),Qv.exports=Yv()});var cC=na(Hd=>{"use strict";var zt=Xv(),CS=he(),nP=um();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 kS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ns(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 TS(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 LS(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 Jv(e){if(Ns(e)!==e)throw Error(N(188))}function rP(e){var t=e.alternate;if(!t){if(t=Ns(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 Jv(r),e;if(o===n)return Jv(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 ES(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ES(e),t!==null)return t;e=e.sibling}return null}var pt=Object.assign,oP=Symbol.for("react.element"),yc=Symbol.for("react.transitional.element"),rs=Symbol.for("react.portal"),Si=Symbol.for("react.fragment"),MS=Symbol.for("react.strict_mode"),jm=Symbol.for("react.profiler"),AS=Symbol.for("react.consumer"),Yn=Symbol.for("react.context"),Uh=Symbol.for("react.forward_ref"),Vm=Symbol.for("react.suspense"),Wm=Symbol.for("react.suspense_list"),Fh=Symbol.for("react.memo"),kr=Symbol.for("react.lazy"),Gm=Symbol.for("react.activity"),iP=Symbol.for("react.memo_cache_sentinel"),eb=Symbol.iterator;function Zl(e){return e===null||typeof e!="object"?null:(e=eb&&e[eb]||e["@@iterator"],typeof e=="function"?e:null)}var lP=Symbol.for("react.client.reference");function $m(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===lP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Si:return"Fragment";case jm:return"Profiler";case MS:return"StrictMode";case Vm:return"Suspense";case Wm:return"SuspenseList";case Gm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case rs:return"Portal";case Yn:return e.displayName||"Context";case AS:return(e._context.displayName||"Context")+".Consumer";case Uh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fh:return t=e.displayName||null,t!==null?t:$m(e.type)||"Memo";case kr:t=e._payload,e=e._init;try{return $m(e(t))}catch{}}return null}var os=Array.isArray,se=CS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ze=nP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bo={pending:!1,data:null,method:null,action:null},Xm=[],Ii=-1;function Dn(e){return{current:e}}function $t(e){0>Ii||(e.current=Xm[Ii],Xm[Ii]=null,Ii--)}function ut(e,t){Ii++,Xm[Ii]=e.current,e.current=t}var Rn=Dn(null),Ss=Dn(null),Nr=Dn(null),Zc=Dn(null);function Qc(e,t){switch(ut(Nr,t),ut(Ss,e),ut(Rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lS(t),e=Y0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$t(Rn),ut(Rn,e)}function qi(){$t(Rn),$t(Ss),$t(Nr)}function Km(e){e.memoizedState!==null&&ut(Zc,e);var t=Rn.current,a=Y0(t,e.type);t!==a&&(ut(Ss,e),ut(Rn,a))}function Jc(e){Ss.current===e&&($t(Rn),$t(Ss)),Zc.current===e&&($t(Zc),_s._currentValue=bo)}var cm,tb;function wo(e){if(cm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);cm=t&&t[1]||"",tb=-1<a.stack.indexOf(`
|
|
1
|
+
"use strict";var WaniWaniChatEmbed=(()=>{var NO=Object.create;var fc=Object.defineProperty;var BO=Object.getOwnPropertyDescriptor;var UO=Object.getOwnPropertyNames;var FO=Object.getPrototypeOf,zO=Object.prototype.hasOwnProperty;var qO=(e,t,a)=>t in e?fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pc=(e,t)=>{for(var a in t)fc(e,a,{get:t[a],enumerable:!0})},HO=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of UO(t))!zO.call(e,r)&&r!==a&&fc(e,r,{get:()=>t[r],enumerable:!(n=BO(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?NO(FO(e)):{},HO(t||!e||!e.__esModule?fc(a,"default",{value:e,enumerable:!0}):a,e));var ae=(e,t,a)=>qO(e,typeof t!="symbol"?t+"":t,a);var Pv=na(ve=>{"use strict";var Zp=Symbol.for("react.transitional.element"),jO=Symbol.for("react.portal"),VO=Symbol.for("react.fragment"),WO=Symbol.for("react.strict_mode"),GO=Symbol.for("react.profiler"),$O=Symbol.for("react.consumer"),XO=Symbol.for("react.context"),KO=Symbol.for("react.forward_ref"),YO=Symbol.for("react.suspense"),ZO=Symbol.for("react.memo"),Mv=Symbol.for("react.lazy"),QO=Symbol.for("react.activity"),kv=Symbol.iterator;function JO(e){return e===null||typeof e!="object"?null:(e=kv&&e[kv]||e["@@iterator"],typeof e=="function"?e:null)}var Av={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rv=Object.assign,Dv={};function mi(e,t,a){this.props=e,this.context=t,this.refs=Dv,this.updater=a||Av}mi.prototype.isReactComponent={};mi.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")};mi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _v(){}_v.prototype=mi.prototype;function Qp(e,t,a){this.props=e,this.context=t,this.refs=Dv,this.updater=a||Av}var Jp=Qp.prototype=new _v;Jp.constructor=Qp;Rv(Jp,mi.prototype);Jp.isPureReactComponent=!0;var Tv=Array.isArray;function Yp(){}var ct={H:null,A:null,T:null,S:null},Ov=Object.prototype.hasOwnProperty;function em(e,t,a){var n=a.ref;return{$$typeof:Zp,type:e,key:t,ref:n!==void 0?n:null,props:a}}function eP(e,t){return em(e.type,t,e.props)}function tm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zp}function tP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Lv=/\/+/g;function Kp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tP(""+e.key):t.toString(36)}function aP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Yp,Yp):(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 pi(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 Zp:case jO:i=!0;break;case Mv:return i=e._init,pi(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Kp(e,0):n,Tv(r)?(a="",i!=null&&(a=i.replace(Lv,"$&/")+"/"),pi(r,t,a,"",function(u){return u})):r!=null&&(tm(r)&&(r=eP(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Lv,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(Tv(e))for(var s=0;s<e.length;s++)n=e[s],o=l+Kp(n,s),i+=pi(n,t,a,o,r);else if(s=JO(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+Kp(n,s++),i+=pi(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return pi(aP(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 mc(e,t,a){if(e==null)return e;var n=[],r=0;return pi(e,n,"","",function(o){return t.call(a,o,r++)}),n}function nP(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 Ev=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)},rP={map:mc,forEach:function(e,t,a){mc(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return mc(e,function(){t++}),t},toArray:function(e){return mc(e,function(t){return t})||[]},only:function(e){if(!tm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Activity=QO;ve.Children=rP;ve.Component=mi;ve.Fragment=VO;ve.Profiler=GO;ve.PureComponent=Qp;ve.StrictMode=WO;ve.Suspense=YO;ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ct;ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ct.H.useMemoCache(e)}};ve.cache=function(e){return function(){return e.apply(null,arguments)}};ve.cacheSignal=function(){return null};ve.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Rv({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Ov.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 em(e.type,r,n)};ve.createContext=function(e){return e={$$typeof:XO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:$O,_context:e},e};ve.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Ov.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 em(e,o,r)};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:KO,render:e}};ve.isValidElement=tm;ve.lazy=function(e){return{$$typeof:Mv,_payload:{_status:-1,_result:e},_init:nP}};ve.memo=function(e,t){return{$$typeof:ZO,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=ct.T,a={};ct.T=a;try{var n=e(),r=ct.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Yp,Ev)}catch(o){Ev(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),ct.T=t}};ve.unstable_useCacheRefresh=function(){return ct.H.useCacheRefresh()};ve.use=function(e){return ct.H.use(e)};ve.useActionState=function(e,t,a){return ct.H.useActionState(e,t,a)};ve.useCallback=function(e,t){return ct.H.useCallback(e,t)};ve.useContext=function(e){return ct.H.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e,t){return ct.H.useDeferredValue(e,t)};ve.useEffect=function(e,t){return ct.H.useEffect(e,t)};ve.useEffectEvent=function(e){return ct.H.useEffectEvent(e)};ve.useId=function(){return ct.H.useId()};ve.useImperativeHandle=function(e,t,a){return ct.H.useImperativeHandle(e,t,a)};ve.useInsertionEffect=function(e,t){return ct.H.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return ct.H.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return ct.H.useMemo(e,t)};ve.useOptimistic=function(e,t){return ct.H.useOptimistic(e,t)};ve.useReducer=function(e,t,a){return ct.H.useReducer(e,t,a)};ve.useRef=function(e){return ct.H.useRef(e)};ve.useState=function(e){return ct.H.useState(e)};ve.useSyncExternalStore=function(e,t,a){return ct.H.useSyncExternalStore(e,t,a)};ve.useTransition=function(){return ct.H.useTransition()};ve.version="19.2.4"});var we=na((G7,Nv)=>{"use strict";Nv.exports=Pv()});var Gv=na(wt=>{"use strict";function om(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<hc(r,t))e[n]=t,e[a]=r,a=n;else break e}}function Ln(e){return e.length===0?null:e[0]}function wc(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>hc(l,a))s<r&&0>hc(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>hc(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function hc(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}wt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Bv=performance,wt.unstable_now=function(){return Bv.now()}):(am=Date,Uv=am.now(),wt.unstable_now=function(){return am.now()-Uv});var Bv,am,Uv,jn=[],Ir=[],oP=1,Ka=null,ra=3,im=!1,$l=!1,Xl=!1,lm=!1,qv=typeof setTimeout=="function"?setTimeout:null,Hv=typeof clearTimeout=="function"?clearTimeout:null,Fv=typeof setImmediate<"u"?setImmediate:null;function gc(e){for(var t=Ln(Ir);t!==null;){if(t.callback===null)wc(Ir);else if(t.startTime<=e)wc(Ir),t.sortIndex=t.expirationTime,om(jn,t);else break;t=Ln(Ir)}}function sm(e){if(Xl=!1,gc(e),!$l)if(Ln(jn)!==null)$l=!0,gi||(gi=!0,hi());else{var t=Ln(Ir);t!==null&&um(sm,t.startTime-e)}}var gi=!1,Kl=-1,jv=5,Vv=-1;function Wv(){return lm?!0:!(wt.unstable_now()-Vv<jv)}function nm(){if(lm=!1,gi){var e=wt.unstable_now();Vv=e;var t=!0;try{e:{$l=!1,Xl&&(Xl=!1,Hv(Kl),Kl=-1),im=!0;var a=ra;try{t:{for(gc(e),Ka=Ln(jn);Ka!==null&&!(Ka.expirationTime>e&&Wv());){var n=Ka.callback;if(typeof n=="function"){Ka.callback=null,ra=Ka.priorityLevel;var r=n(Ka.expirationTime<=e);if(e=wt.unstable_now(),typeof r=="function"){Ka.callback=r,gc(e),t=!0;break t}Ka===Ln(jn)&&wc(jn),gc(e)}else wc(jn);Ka=Ln(jn)}if(Ka!==null)t=!0;else{var o=Ln(Ir);o!==null&&um(sm,o.startTime-e),t=!1}}break e}finally{Ka=null,ra=a,im=!1}t=void 0}}finally{t?hi():gi=!1}}}var hi;typeof Fv=="function"?hi=function(){Fv(nm)}:typeof MessageChannel<"u"?(rm=new MessageChannel,zv=rm.port2,rm.port1.onmessage=nm,hi=function(){zv.postMessage(null)}):hi=function(){qv(nm,0)};var rm,zv;function um(e,t){Kl=qv(function(){e(wt.unstable_now())},t)}wt.unstable_IdlePriority=5;wt.unstable_ImmediatePriority=1;wt.unstable_LowPriority=4;wt.unstable_NormalPriority=3;wt.unstable_Profiling=null;wt.unstable_UserBlockingPriority=2;wt.unstable_cancelCallback=function(e){e.callback=null};wt.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"):jv=0<e?Math.floor(1e3/e):5};wt.unstable_getCurrentPriorityLevel=function(){return ra};wt.unstable_next=function(e){switch(ra){case 1:case 2:case 3:var t=3;break;default:t=ra}var a=ra;ra=t;try{return e()}finally{ra=a}};wt.unstable_requestPaint=function(){lm=!0};wt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ra;ra=e;try{return t()}finally{ra=a}};wt.unstable_scheduleCallback=function(e,t,a){var n=wt.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:oP++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,om(Ir,e),Ln(jn)===null&&e===Ln(Ir)&&(Xl?(Hv(Kl),Kl=-1):Xl=!0,um(sm,a-n))):(e.sortIndex=r,om(jn,e),$l||im||($l=!0,gi||(gi=!0,hi()))),e};wt.unstable_shouldYield=Wv;wt.unstable_wrapCallback=function(e){var t=ra;return function(){var a=ra;ra=t;try{return e.apply(this,arguments)}finally{ra=a}}}});var Xv=na((X7,$v)=>{"use strict";$v.exports=Gv()});var Yv=na(fa=>{"use strict";var iP=we();function Kv(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 da={d:{f:Cr,r:function(){throw Error(Kv(522))},D:Cr,C:Cr,L:Cr,m:Cr,X:Cr,S:Cr,M:Cr},p:0,findDOMNode:null},lP=Symbol.for("react.portal");function sP(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:lP,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Yl=iP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function yc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=da;fa.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(Kv(299));return sP(e,t,null,a)};fa.flushSync=function(e){var t=Yl.T,a=da.p;try{if(Yl.T=null,da.p=2,e)return e()}finally{Yl.T=t,da.p=a,da.d.f()}};fa.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,da.d.C(e,t))};fa.prefetchDNS=function(e){typeof e=="string"&&da.d.D(e)};fa.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=yc(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?da.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&da.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fa.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=yc(t.as,t.crossOrigin);da.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&&da.d.M(e)};fa.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=yc(a,t.crossOrigin);da.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})}};fa.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=yc(t.as,t.crossOrigin);da.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 da.d.m(e)};fa.requestFormReset=function(e){da.d.r(e)};fa.unstable_batchedUpdates=function(e,t){return e(t)};fa.useFormState=function(e,t,a){return Yl.H.useFormState(e,t,a)};fa.useFormStatus=function(){return Yl.H.useHostTransitionStatus()};fa.version="19.2.4"});var cm=na((Y7,Qv)=>{"use strict";function Zv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zv)}catch(e){console.error(e)}}Zv(),Qv.exports=Yv()});var cC=na(jd=>{"use strict";var Ht=Xv(),CS=we(),uP=cm();function B(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 kS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ns(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 TS(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 LS(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 Jv(e){if(Ns(e)!==e)throw Error(B(188))}function cP(e){var t=e.alternate;if(!t){if(t=Ns(e),t===null)throw Error(B(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 Jv(r),e;if(o===n)return Jv(r),t;o=o.sibling}throw Error(B(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(B(189))}}if(a.alternate!==n)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function ES(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ES(e),t!==null)return t;e=e.sibling}return null}var pt=Object.assign,dP=Symbol.for("react.element"),xc=Symbol.for("react.transitional.element"),rs=Symbol.for("react.portal"),Si=Symbol.for("react.fragment"),MS=Symbol.for("react.strict_mode"),Vm=Symbol.for("react.profiler"),AS=Symbol.for("react.consumer"),Zn=Symbol.for("react.context"),Fh=Symbol.for("react.forward_ref"),Wm=Symbol.for("react.suspense"),Gm=Symbol.for("react.suspense_list"),zh=Symbol.for("react.memo"),kr=Symbol.for("react.lazy"),$m=Symbol.for("react.activity"),fP=Symbol.for("react.memo_cache_sentinel"),eb=Symbol.iterator;function Zl(e){return e===null||typeof e!="object"?null:(e=eb&&e[eb]||e["@@iterator"],typeof e=="function"?e:null)}var pP=Symbol.for("react.client.reference");function Xm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Si:return"Fragment";case Vm:return"Profiler";case MS:return"StrictMode";case Wm:return"Suspense";case Gm:return"SuspenseList";case $m:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case rs:return"Portal";case Zn:return e.displayName||"Context";case AS:return(e._context.displayName||"Context")+".Consumer";case Fh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zh:return t=e.displayName||null,t!==null?t:Xm(e.type)||"Memo";case kr:t=e._payload,e=e._init;try{return Xm(e(t))}catch{}}return null}var os=Array.isArray,de=CS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qe=uP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bo={pending:!1,data:null,method:null,action:null},Km=[],Ii=-1;function Dn(e){return{current:e}}function Xt(e){0>Ii||(e.current=Km[Ii],Km[Ii]=null,Ii--)}function ut(e,t){Ii++,Km[Ii]=e.current,e.current=t}var Rn=Dn(null),Ss=Dn(null),Nr=Dn(null),Qc=Dn(null);function Jc(e,t){switch(ut(Nr,t),ut(Ss,e),ut(Rn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lS(t),e=Y0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Xt(Rn),ut(Rn,e)}function qi(){Xt(Rn),Xt(Ss),Xt(Nr)}function Ym(e){e.memoizedState!==null&&ut(Qc,e);var t=Rn.current,a=Y0(t,e.type);t!==a&&(ut(Ss,e),ut(Rn,a))}function ed(e){Ss.current===e&&(Xt(Rn),Xt(Ss)),Qc.current===e&&(Xt(Qc),_s._currentValue=bo)}var dm,tb;function wo(e){if(dm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);dm=t&&t[1]||"",tb=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+dm+e+tb}var fm=!1;function pm(e,t){if(!e||fm)return"";fm=!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{fm=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?wo(a):""}function mP(e,t){switch(e.tag){case 26:case 27:case 5:return wo(e.type);case 16:return wo("Lazy");case 13:return e.child!==t&&t!==null?wo("Suspense Fallback"):wo("Suspense");case 19:return wo("SuspenseList");case 0:case 15:return pm(e.type,!1);case 11:return pm(e.type.render,!1);case 1:return pm(e.type,!0);case 31:return wo("Activity");default:return""}}function ab(e){try{var t="",a=null;do t+=mP(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 Ym=Object.prototype.hasOwnProperty,zh=zt.unstable_scheduleCallback,pm=zt.unstable_cancelCallback,uP=zt.unstable_shouldYield,cP=zt.unstable_requestPaint,Ua=zt.unstable_now,dP=zt.unstable_getCurrentPriorityLevel,RS=zt.unstable_ImmediatePriority,DS=zt.unstable_UserBlockingPriority,ed=zt.unstable_NormalPriority,fP=zt.unstable_LowPriority,_S=zt.unstable_IdlePriority,pP=zt.log,mP=zt.unstable_setDisableYieldValue,Bs=null,Fa=null;function Rr(e){if(typeof pP=="function"&&mP(e),Fa&&typeof Fa.setStrictMode=="function")try{Fa.setStrictMode(Bs,e)}catch{}}var za=Math.clz32?Math.clz32:wP,hP=Math.log,gP=Math.LN2;function wP(e){return e>>>=0,e===0?32:31-(hP(e)/gP|0)|0}var xc=256,vc=262144,bc=4194304;function yo(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 Td(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=yo(n):(i&=l,i!==0?r=yo(i):a||(a=l&~e,a!==0&&(r=yo(a))))):(l=n&~o,l!==0?r=yo(l):i!==0?r=yo(i):a||(a=n&~e,a!==0&&(r=yo(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 Us(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yP(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 OS(){var e=bc;return bc<<=1,(bc&62914560)===0&&(bc=4194304),e}function mm(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Fs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xP(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-za(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&&PS(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function PS(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-za(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function NS(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-za(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function BS(e,t){var a=t&-t;return a=(a&42)!==0?1:qh(a),(a&(e.suspendedLanes|t))!==0?0:a}function qh(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 Hh(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function US(){var e=Ze.p;return e!==0?e:(e=window.event,e===void 0?32:lC(e.type))}function nb(e,t){var a=Ze.p;try{return Ze.p=e,t()}finally{Ze.p=a}}var Kr=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Kr,La="__reactProps$"+Kr,Qi="__reactContainer$"+Kr,Zm="__reactEvents$"+Kr,vP="__reactListeners$"+Kr,bP="__reactHandles$"+Kr,rb="__reactResources$"+Kr,zs="__reactMarker$"+Kr;function jh(e){delete e[Yt],delete e[La],delete e[Zm],delete e[vP],delete e[bP]}function Ci(e){var t=e[Yt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Qi]||a[Yt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=fS(e);e!==null;){if(a=e[Yt])return a;e=fS(e)}return t}e=a,a=e.parentNode}return null}function Ji(e){if(e=e[Yt]||e[Qi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function is(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(N(33))}function Oi(e){var t=e[rb];return t||(t=e[rb]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[zs]=!0}var FS=new Set,zS={};function Ro(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(zS[e]=t,e=0;e<t.length;e++)FS.add(t[e])}var SP=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]*$"),ob={},ib={};function IP(e){return Ym.call(ib,e)?!0:Ym.call(ob,e)?!1:SP.test(e)?ib[e]=!0:(ob[e]=!0,!1)}function Nc(e,t,a){if(IP(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 Sc(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 jn(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 Za(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CP(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 Qm(e){if(!e._valueTracker){var t=qS(e)?"checked":"value";e._valueTracker=CP(e,t,""+e[t])}}function HS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=qS(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function td(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 kP=/[\n"\\]/g;function en(e){return e.replace(kP,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jm(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=""+Za(t)):e.value!==""+Za(t)&&(e.value=""+Za(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?eh(e,i,Za(t)):a!=null?eh(e,i,Za(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=""+Za(l):e.removeAttribute("name")}function jS(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)){Qm(e);return}a=a!=null?""+Za(a):"",t=t!=null?""+Za(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),Qm(e)}function eh(e,t,a){t==="number"&&td(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Pi(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=""+Za(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 VS(e,t,a){if(t!=null&&(t=""+Za(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Za(a):""}function WS(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(N(92));if(os(n)){if(1<n.length)throw Error(N(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Za(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Qm(e)}function ji(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var TP=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 lb(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||TP.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function GS(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&&lb(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&lb(e,o,t[o])}function Vh(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 LP=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"]]),EP=/^[\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 Bc(e){return EP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var th=null;function Wh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ki=null,Ni=null;function sb(e){var t=Ji(e);if(t&&(e=t.stateNode)){var a=e[La]||null;e:switch(e=t.stateNode,t.type){case"input":if(Jm(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="'+en(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[La]||null;if(!r)throw Error(N(90));Jm(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&&HS(n)}break e;case"textarea":VS(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Pi(e,!!a.multiple,t,!1)}}}var hm=!1;function $S(e,t,a){if(hm)return e(t,a);hm=!0;try{var n=e(t);return n}finally{if(hm=!1,(ki!==null||Ni!==null)&&(Ud(),ki&&(t=ki,e=Ni,Ni=ki=null,sb(t),e)))for(t=0;t<e.length;t++)sb(e[t])}}function Is(e,t){var a=e.stateNode;if(a===null)return null;var n=a[La]||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 ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ah=!1;if(ar)try{wi={},Object.defineProperty(wi,"passive",{get:function(){ah=!0}}),window.addEventListener("test",wi,wi),window.removeEventListener("test",wi,wi)}catch{ah=!1}var wi,Dr=null,Gh=null,Uc=null;function XS(){if(Uc)return Uc;var e,t=Gh,a=t.length,n,r="value"in Dr?Dr.value:Dr.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 Uc=r.slice(e,1<n?1-n:void 0)}function Fc(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 Ic(){return!0}function ub(){return!1}function Ea(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)?Ic:ub,this.isPropagationStopped=ub,this}return pt(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=Ic)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),t}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ld=Ea(Do),qs=pt({},Do,{view:0,detail:0}),MP=Ea(qs),gm,wm,Ql,Ed=pt({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$h,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!==Ql&&(Ql&&e.type==="mousemove"?(gm=e.screenX-Ql.screenX,wm=e.screenY-Ql.screenY):wm=gm=0,Ql=e),gm)},movementY:function(e){return"movementY"in e?e.movementY:wm}}),cb=Ea(Ed),AP=pt({},Ed,{dataTransfer:0}),RP=Ea(AP),DP=pt({},qs,{relatedTarget:0}),ym=Ea(DP),_P=pt({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),OP=Ea(_P),PP=pt({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NP=Ea(PP),BP=pt({},Do,{data:0}),db=Ea(BP),UP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FP={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"},zP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zP[e])?!!t[e]:!1}function $h(){return qP}var HP=pt({},qs,{key:function(e){if(e.key){var t=UP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?FP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$h,charCode:function(e){return e.type==="keypress"?Fc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jP=Ea(HP),VP=pt({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fb=Ea(VP),WP=pt({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$h}),GP=Ea(WP),$P=pt({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),XP=Ea($P),KP=pt({},Ed,{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}),YP=Ea(KP),ZP=pt({},Do,{newState:0,oldState:0}),QP=Ea(ZP),JP=[9,13,27,32],Xh=ar&&"CompositionEvent"in window,us=null;ar&&"documentMode"in document&&(us=document.documentMode);var eN=ar&&"TextEvent"in window&&!us,KS=ar&&(!Xh||us&&8<us&&11>=us),pb=" ",mb=!1;function YS(e,t){switch(e){case"keyup":return JP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ti=!1;function tN(e,t){switch(e){case"compositionend":return ZS(t);case"keypress":return t.which!==32?null:(mb=!0,pb);case"textInput":return e=t.data,e===pb&&mb?null:e;default:return null}}function aN(e,t){if(Ti)return e==="compositionend"||!Xh&&YS(e,t)?(e=XS(),Uc=Gh=Dr=null,Ti=!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 KS&&t.locale!=="ko"?null:t.data;default:return null}}var nN={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 hb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nN[e.type]:t==="textarea"}function QS(e,t,a,n){ki?Ni?Ni.push(n):Ni=[n]:ki=n,t=xd(t,"onChange"),0<t.length&&(a=new Ld("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var cs=null,Cs=null;function rN(e){$0(e,0)}function Md(e){var t=is(e);if(HS(t))return e}function gb(e,t){if(e==="change")return t}var JS=!1;ar&&(ar?(kc="oninput"in document,kc||(xm=document.createElement("div"),xm.setAttribute("oninput","return;"),kc=typeof xm.oninput=="function"),Cc=kc):Cc=!1,JS=Cc&&(!document.documentMode||9<document.documentMode));var Cc,kc,xm;function wb(){cs&&(cs.detachEvent("onpropertychange",eI),Cs=cs=null)}function eI(e){if(e.propertyName==="value"&&Md(Cs)){var t=[];QS(t,Cs,e,Wh(e)),$S(rN,t)}}function oN(e,t,a){e==="focusin"?(wb(),cs=t,Cs=a,cs.attachEvent("onpropertychange",eI)):e==="focusout"&&wb()}function iN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Md(Cs)}function lN(e,t){if(e==="click")return Md(t)}function sN(e,t){if(e==="input"||e==="change")return Md(t)}function uN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ha=typeof Object.is=="function"?Object.is:uN;function ks(e,t){if(Ha(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(!Ym.call(t,r)||!Ha(e[r],t[r]))return!1}return!0}function yb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xb(e,t){var a=yb(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=yb(a)}}function tI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aI(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=td(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=td(e.document)}return t}function Kh(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 cN=ar&&"documentMode"in document&&11>=document.documentMode,Li=null,nh=null,ds=null,rh=!1;function vb(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;rh||Li==null||Li!==td(n)||(n=Li,"selectionStart"in n&&Kh(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}),ds&&ks(ds,n)||(ds=n,n=xd(nh,"onSelect"),0<n.length&&(t=new Ld("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Li)))}function go(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ei={animationend:go("Animation","AnimationEnd"),animationiteration:go("Animation","AnimationIteration"),animationstart:go("Animation","AnimationStart"),transitionrun:go("Transition","TransitionRun"),transitionstart:go("Transition","TransitionStart"),transitioncancel:go("Transition","TransitionCancel"),transitionend:go("Transition","TransitionEnd")},vm={},nI={};ar&&(nI=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function _o(e){if(vm[e])return vm[e];if(!Ei[e])return e;var t=Ei[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in nI)return vm[e]=t[a];return e}var rI=_o("animationend"),oI=_o("animationiteration"),iI=_o("animationstart"),dN=_o("transitionrun"),fN=_o("transitionstart"),pN=_o("transitioncancel"),lI=_o("transitionend"),sI=new Map,oh="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(" ");oh.push("scrollEnd");function yn(e,t){sI.set(e,t),Ro(t,[e])}var ad=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)},Ya=[],Mi=0,Yh=0;function Ad(){for(var e=Mi,t=Yh=Mi=0;t<e;){var a=Ya[t];Ya[t++]=null;var n=Ya[t];Ya[t++]=null;var r=Ya[t];Ya[t++]=null;var o=Ya[t];if(Ya[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&&uI(a,r,o)}}function Rd(e,t,a,n){Ya[Mi++]=e,Ya[Mi++]=t,Ya[Mi++]=a,Ya[Mi++]=n,Yh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Zh(e,t,a,n){return Rd(e,t,a,n),nd(e)}function Oo(e,t){return Rd(e,null,null,t),nd(e)}function uI(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-za(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function nd(e){if(50<vs)throw vs=0,Th=null,Error(N(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function mN(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 Na(e,t,a,n){return new mN(e,t,a,n)}function Qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var a=e.alternate;return a===null?(a=Na(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 cI(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 zc(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")Qh(e)&&(i=1);else if(typeof e=="string")i=wB(e,a,Rn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Gm:return e=Na(31,a,t,r),e.elementType=Gm,e.lanes=o,e;case Si:return So(a.children,r,o,t);case MS:i=8,r|=24;break;case jm:return e=Na(12,a,t,r|2),e.elementType=jm,e.lanes=o,e;case Vm:return e=Na(13,a,t,r),e.elementType=Vm,e.lanes=o,e;case Wm:return e=Na(19,a,t,r),e.elementType=Wm,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yn:i=10;break e;case AS:i=9;break e;case Uh:i=11;break e;case Fh:i=14;break e;case kr:i=16,n=null;break e}i=29,a=Error(N(130,e===null?"null":typeof e,"")),n=null}return t=Na(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function So(e,t,a,n){return e=Na(7,e,n,t),e.lanes=a,e}function bm(e,t,a){return e=Na(6,e,null,t),e.lanes=a,e}function dI(e){var t=Na(18,null,null,0);return t.stateNode=e,t}function Sm(e,t,a){return t=Na(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bb=new WeakMap;function tn(e,t){if(typeof e=="object"&&e!==null){var a=bb.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ab(t)},bb.set(e,t),t)}return{value:e,source:t,stack:ab(t)}}var Ri=[],Di=0,rd=null,Ts=0,Qa=[],Ja=0,Wr=null,En=1,Mn="";function Xn(e,t){Ri[Di++]=Ts,Ri[Di++]=rd,rd=e,Ts=t}function fI(e,t,a){Qa[Ja++]=En,Qa[Ja++]=Mn,Qa[Ja++]=Wr,Wr=e;var n=En;e=Mn;var r=32-za(n)-1;n&=~(1<<r),a+=1;var o=32-za(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,En=1<<32-za(t)+r|a<<r|n,Mn=o+e}else En=1<<o|a<<r|n,Mn=e}function Jh(e){e.return!==null&&(Xn(e,1),fI(e,1,0))}function eg(e){for(;e===rd;)rd=Ri[--Di],Ri[Di]=null,Ts=Ri[--Di],Ri[Di]=null;for(;e===Wr;)Wr=Qa[--Ja],Qa[Ja]=null,Mn=Qa[--Ja],Qa[Ja]=null,En=Qa[--Ja],Qa[Ja]=null}function pI(e,t){Qa[Ja++]=En,Qa[Ja++]=Mn,Qa[Ja++]=Wr,En=t.id,Mn=t.overflow,Wr=e}var Zt=null,ft=null,Be=!1,Br=null,an=!1,ih=Error(N(519));function Gr(e){var t=Error(N(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(tn(t,e)),ih}function Sb(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Yt]=e,t[La]=n,a){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(a=0;a<Rs.length;a++)De(Rs[a],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),jS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),WS(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||K0(t.textContent,a)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=Zn),t=!0):t=!1,t||Gr(e,!0)}function Ib(e){for(Zt=e.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:an=!1;return;case 27:case 3:an=!0;return;default:Zt=Zt.return}}function yi(e){if(e!==Zt)return!1;if(!Be)return Ib(e),Be=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Rh(e.type,e.memoizedProps)),a=!a),a&&ft&&Gr(e),Ib(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));ft=dS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));ft=dS(e)}else t===27?(t=ft,Yr(e.type)?(e=Ph,Ph=null,ft=e):ft=t):ft=Zt?rn(e.stateNode.nextSibling):null;return!0}function To(){ft=Zt=null,Be=!1}function Im(){var e=Br;return e!==null&&(ka===null?ka=e:ka.push.apply(ka,e),Br=null),e}function Ls(e){Br===null?Br=[e]:Br.push(e)}var lh=Dn(null),Po=null,Qn=null;function Lr(e,t,a){ut(lh,t._currentValue),t._currentValue=a}function er(e){e._currentValue=lh.current,$t(lh)}function sh(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 uh(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),sh(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),sh(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 el(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;Ha(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===Zc.current){if(i=r.alternate,i===null)throw Error(N(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}r=r.return}e!==null&&uh(t,e,a,n),t.flags|=262144}function od(e){for(e=e.firstContext;e!==null;){if(!Ha(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Lo(e){Po=e,Qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return mI(Po,e)}function Tc(e,t){return Po===null&&Lo(e),mI(e,t)}function mI(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Qn===null){if(e===null)throw Error(N(308));Qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qn=Qn.next=t;return a}var hN=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()})}},gN=zt.unstable_scheduleCallback,wN=zt.unstable_NormalPriority,Bt={$$typeof:Yn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tg(){return{controller:new hN,data:new Map,refCount:0}}function Hs(e){e.refCount--,e.refCount===0&&gN(wN,function(){e.controller.abort()})}var fs=null,ch=0,Vi=0,Bi=null;function yN(e,t){if(fs===null){var a=fs=[];ch=0,Vi=Tg(),Bi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return ch++,t.then(Cb,Cb),t}function Cb(){if(--ch===0&&fs!==null){Bi!==null&&(Bi.status="fulfilled");var e=fs;fs=null,Vi=0,Bi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xN(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 kb=se.S;se.S=function(e,t){E0=Ua(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yN(e,t),kb!==null&&kb(e,t)};var Io=Dn(null);function ag(){var e=Io.current;return e!==null?e:st.pooledCache}function qc(e,t){t===null?ut(Io,Io.current):ut(Io,t.pool)}function hI(){var e=ag();return e===null?null:{parent:Bt._currentValue,pool:e}}var tl=Error(N(460)),ng=Error(N(474)),Dd=Error(N(542)),id={then:function(){}};function Tb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gI(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Zn,Zn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Eb(e),e;default:if(typeof t.status=="string")t.then(Zn,Zn);else{if(e=st,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,Eb(e),e}throw Co=t,tl}}function xo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Co=a,tl):a}}var Co=null;function Lb(){if(Co===null)throw Error(N(459));var e=Co;return Co=null,e}function Eb(e){if(e===tl||e===Dd)throw Error(N(483))}var Ui=null,Es=0;function Lc(e){var t=Es;return Es+=1,Ui===null&&(Ui=[]),gI(Ui,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ec(e,t){throw t.$$typeof===oP?Error(N(525)):(e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wI(e){function t(w,y){if(e){var g=w.deletions;g===null?(w.deletions=[y],w.flags|=16):g.push(y)}}function a(w,y){if(!e)return null;for(;y!==null;)t(w,y),y=y.sibling;return null}function n(w){for(var y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function r(w,y){return w=Jn(w,y),w.index=0,w.sibling=null,w}function o(w,y,g){return w.index=g,e?(g=w.alternate,g!==null?(g=g.index,g<y?(w.flags|=67108866,y):g):(w.flags|=67108866,y)):(w.flags|=1048576,y)}function i(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function l(w,y,g,b){return y===null||y.tag!==6?(y=bm(g,w.mode,b),y.return=w,y):(y=r(y,g),y.return=w,y)}function s(w,y,g,b){var T=g.type;return T===Si?c(w,y,g.props.children,b,g.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&xo(T)===y.type)?(y=r(y,g.props),Jl(y,g),y.return=w,y):(y=zc(g.type,g.key,g.props,null,w.mode,b),Jl(y,g),y.return=w,y)}function u(w,y,g,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Sm(g,w.mode,b),y.return=w,y):(y=r(y,g.children||[]),y.return=w,y)}function c(w,y,g,b,T){return y===null||y.tag!==7?(y=So(g,w.mode,b,T),y.return=w,y):(y=r(y,g),y.return=w,y)}function d(w,y,g){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=bm(""+y,w.mode,g),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yc:return g=zc(y.type,y.key,y.props,null,w.mode,g),Jl(g,y),g.return=w,g;case rs:return y=Sm(y,w.mode,g),y.return=w,y;case kr:return y=xo(y),d(w,y,g)}if(os(y)||Zl(y))return y=So(y,w.mode,g,null),y.return=w,y;if(typeof y.then=="function")return d(w,Lc(y),g);if(y.$$typeof===Yn)return d(w,Tc(w,y),g);Ec(w,y)}return null}function f(w,y,g,b){var T=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return T!==null?null:l(w,y,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case yc:return g.key===T?s(w,y,g,b):null;case rs:return g.key===T?u(w,y,g,b):null;case kr:return g=xo(g),f(w,y,g,b)}if(os(g)||Zl(g))return T!==null?null:c(w,y,g,b,null);if(typeof g.then=="function")return f(w,y,Lc(g),b);if(g.$$typeof===Yn)return f(w,y,Tc(w,g),b);Ec(w,g)}return null}function p(w,y,g,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w=w.get(g)||null,l(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yc:return w=w.get(b.key===null?g:b.key)||null,s(y,w,b,T);case rs:return w=w.get(b.key===null?g:b.key)||null,u(y,w,b,T);case kr:return b=xo(b),p(w,y,g,b,T)}if(os(b)||Zl(b))return w=w.get(g)||null,c(y,w,b,T,null);if(typeof b.then=="function")return p(w,y,g,Lc(b),T);if(b.$$typeof===Yn)return p(w,y,g,Tc(y,b),T);Ec(y,b)}return null}function m(w,y,g,b){for(var T=null,C=null,A=y,R=y=0,P=null;A!==null&&R<g.length;R++){A.index>R?(P=A,A=null):P=A.sibling;var L=f(w,A,g[R],b);if(L===null){A===null&&(A=P);break}e&&A&&L.alternate===null&&t(w,A),y=o(L,y,R),C===null?T=L:C.sibling=L,C=L,A=P}if(R===g.length)return a(w,A),Be&&Xn(w,R),T;if(A===null){for(;R<g.length;R++)A=d(w,g[R],b),A!==null&&(y=o(A,y,R),C===null?T=A:C.sibling=A,C=A);return Be&&Xn(w,R),T}for(A=n(A);R<g.length;R++)P=p(A,w,R,g[R],b),P!==null&&(e&&P.alternate!==null&&A.delete(P.key===null?R:P.key),y=o(P,y,R),C===null?T=P:C.sibling=P,C=P);return e&&A.forEach(function(W){return t(w,W)}),Be&&Xn(w,R),T}function x(w,y,g,b){if(g==null)throw Error(N(151));for(var T=null,C=null,A=y,R=y=0,P=null,L=g.next();A!==null&&!L.done;R++,L=g.next()){A.index>R?(P=A,A=null):P=A.sibling;var W=f(w,A,L.value,b);if(W===null){A===null&&(A=P);break}e&&A&&W.alternate===null&&t(w,A),y=o(W,y,R),C===null?T=W:C.sibling=W,C=W,A=P}if(L.done)return a(w,A),Be&&Xn(w,R),T;if(A===null){for(;!L.done;R++,L=g.next())L=d(w,L.value,b),L!==null&&(y=o(L,y,R),C===null?T=L:C.sibling=L,C=L);return Be&&Xn(w,R),T}for(A=n(A);!L.done;R++,L=g.next())L=p(A,w,R,L.value,b),L!==null&&(e&&L.alternate!==null&&A.delete(L.key===null?R:L.key),y=o(L,y,R),C===null?T=L:C.sibling=L,C=L);return e&&A.forEach(function(H){return t(w,H)}),Be&&Xn(w,R),T}function S(w,y,g,b){if(typeof g=="object"&&g!==null&&g.type===Si&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case yc:e:{for(var T=g.key;y!==null;){if(y.key===T){if(T=g.type,T===Si){if(y.tag===7){a(w,y.sibling),b=r(y,g.props.children),b.return=w,w=b;break e}}else if(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&xo(T)===y.type){a(w,y.sibling),b=r(y,g.props),Jl(b,g),b.return=w,w=b;break e}a(w,y);break}else t(w,y);y=y.sibling}g.type===Si?(b=So(g.props.children,w.mode,b,g.key),b.return=w,w=b):(b=zc(g.type,g.key,g.props,null,w.mode,b),Jl(b,g),b.return=w,w=b)}return i(w);case rs:e:{for(T=g.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){a(w,y.sibling),b=r(y,g.children||[]),b.return=w,w=b;break e}else{a(w,y);break}else t(w,y);y=y.sibling}b=Sm(g,w.mode,b),b.return=w,w=b}return i(w);case kr:return g=xo(g),S(w,y,g,b)}if(os(g))return m(w,y,g,b);if(Zl(g)){if(T=Zl(g),typeof T!="function")throw Error(N(150));return g=T.call(g),x(w,y,g,b)}if(typeof g.then=="function")return S(w,y,Lc(g),b);if(g.$$typeof===Yn)return S(w,y,Tc(w,g),b);Ec(w,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,y!==null&&y.tag===6?(a(w,y.sibling),b=r(y,g),b.return=w,w=b):(a(w,y),b=bm(g,w.mode,b),b.return=w,w=b),i(w)):a(w,y)}return function(w,y,g,b){try{Es=0;var T=S(w,y,g,b);return Ui=null,T}catch(A){if(A===tl||A===Dd)throw A;var C=Na(29,A,null,w.mode);return C.lanes=b,C.return=w,C}}}var Eo=wI(!0),yI=wI(!1),Tr=!1;function rg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dh(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 Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ye&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=nd(e),uI(e,null,a),t}return Rd(e,n,t,a),nd(e)}function ps(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,NS(e,a)}}function Cm(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 fh=!1;function ms(){if(fh){var e=Bi;if(e!==null)throw e}}function hs(e,t,a,n){fh=!1;var r=e.updateQueue;Tr=!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?(Oe&f)===f:(n&f)===f){f!==0&&f===Vi&&(fh=!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 S=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(S,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(S,d,f):m,f==null)break e;d=pt({},d,f);break e;case 2:Tr=!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),Xr|=i,e.lanes=i,e.memoizedState=d}}function xI(e,t){if(typeof e!="function")throw Error(N(191,e));e.call(t)}function vI(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)xI(a[e],t)}var Wi=Dn(null),ld=Dn(0);function Mb(e,t){e=ir,ut(ld,e),ut(Wi,t),ir=e|t.baseLanes}function ph(){ut(ld,ir),ut(Wi,Wi.current)}function og(){ir=ld.current,$t(Wi),$t(ld)}var ja=Dn(null),nn=null;function Er(e){var t=e.alternate;ut(Mt,Mt.current&1),ut(ja,e),nn===null&&(t===null||Wi.current!==null||t.memoizedState!==null)&&(nn=e)}function mh(e){ut(Mt,Mt.current),ut(ja,e),nn===null&&(nn=e)}function bI(e){e.tag===22?(ut(Mt,Mt.current),ut(ja,e),nn===null&&(nn=e)):Mr(e)}function Mr(){ut(Mt,Mt.current),ut(ja,ja.current)}function Pa(e){$t(ja),nn===e&&(nn=null),$t(Mt)}var Mt=Dn(0);function sd(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||_h(a)||Oh(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 nr=0,ve=null,ot=null,Pt=null,ud=!1,Fi=!1,Mo=!1,cd=0,Ms=0,zi=null,vN=0;function St(){throw Error(N(321))}function ig(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ha(e[a],t[a]))return!1;return!0}function lg(e,t,a,n,r,o){return nr=o,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,se.H=e===null||e.memoizedState===null?QI:yg,Mo=!1,o=a(n,r),Mo=!1,Fi&&(o=II(t,a,n,r)),SI(e),o}function SI(e){se.H=As;var t=ot!==null&&ot.next!==null;if(nr=0,Pt=ot=ve=null,ud=!1,Ms=0,zi=null,t)throw Error(N(300));e===null||Ut||(e=e.dependencies,e!==null&&od(e)&&(Ut=!0))}function II(e,t,a,n){ve=e;var r=0;do{if(Fi&&(zi=null),Ms=0,Fi=!1,25<=r)throw Error(N(301));if(r+=1,Pt=ot=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}se.H=JI,o=t(a,n)}while(Fi);return o}function bN(){var e=se.H,t=e.useState()[0];return t=typeof t.then=="function"?js(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(ve.flags|=1024),t}function sg(){var e=cd!==0;return cd=0,e}function ug(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function cg(e){if(ud){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ud=!1}nr=0,Pt=ot=ve=null,Fi=!1,Ms=cd=0,zi=null}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?ve.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function At(){if(ot===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Pt===null?ve.memoizedState:Pt.next;if(t!==null)Pt=t,ot=e;else{if(e===null)throw ve.alternate===null?Error(N(467)):Error(N(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Pt===null?ve.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function _d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function js(e){var t=Ms;return Ms+=1,zi===null&&(zi=[]),e=gI(zi,e,t),t=ve,(Pt===null?t.memoizedState:Pt.next)===null&&(t=t.alternate,se.H=t===null||t.memoizedState===null?QI:yg),e}function Od(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return js(e);if(e.$$typeof===Yn)return Qt(e)}throw Error(N(438,String(e)))}function dg(e){var t=null,a=ve.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ve.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=_d(),ve.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]=iP;return t.index++,a}function rr(e,t){return typeof t=="function"?t(e):t}function Hc(e){var t=At();return fg(t,ot,e)}function fg(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?(Oe&d)===d:(nr&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===Vi&&(c=!0);else if((nr&f)===f){u=u.next,f===Vi&&(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,ve.lanes|=f,Xr|=f;d=u.action,Mo&&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,ve.lanes|=d,Xr|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!Ha(o,e.memoizedState)&&(Ut=!0,c&&(a=Bi,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 km(e){var t=At(),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);Ha(o,t.memoizedState)||(Ut=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function CI(e,t,a){var n=ve,r=At(),o=Be;if(o){if(a===void 0)throw Error(N(407));a=a()}else a=t();var i=!Ha((ot||r).memoizedState,a);if(i&&(r.memoizedState=a,Ut=!0),r=r.queue,pg(LI.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pt!==null&&Pt.memoizedState.tag&1){if(n.flags|=2048,Gi(9,{destroy:void 0},TI.bind(null,n,r,a,t),null),st===null)throw Error(N(349));o||(nr&127)!==0||kI(n,t,a)}return a}function kI(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ve.updateQueue,t===null?(t=_d(),ve.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function TI(e,t,a,n){t.value=a,t.getSnapshot=n,EI(t)&&MI(e)}function LI(e,t,a){return a(function(){EI(t)&&MI(e)})}function EI(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ha(e,a)}catch{return!0}}function MI(e){var t=Oo(e,2);t!==null&&Ta(t,e,2)}function hh(e){var t=pa();if(typeof e=="function"){var a=e;if(e=a(),Mo){Rr(!0);try{a()}finally{Rr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:e},t}function AI(e,t,a,n){return e.baseState=a,fg(e,ot,typeof n=="function"?n:rr)}function SN(e,t,a,n,r){if(Nd(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)}};se.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,RI(t,o)):(o.next=a.next,t.pending=a.next=o)}}function RI(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=se.T,i={};se.T=i;try{var l=a(r,n),s=se.S;s!==null&&s(i,l),Ab(e,t,l)}catch(u){gh(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),se.T=o}}else try{o=a(r,n),Ab(e,t,o)}catch(u){gh(e,t,u)}}function Ab(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Rb(e,t,n)},function(n){return gh(e,t,n)}):Rb(e,t,a)}function Rb(e,t,a){t.status="fulfilled",t.value=a,DI(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,RI(e,a)))}function gh(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,DI(t),t=t.next;while(t!==n)}e.action=null}function DI(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _I(e,t){return t}function Db(e,t){if(Be){var a=st.formState;if(a!==null){e:{var n=ve;if(Be){if(ft){t:{for(var r=ft,o=an;r.nodeType!==8;){if(!o){r=null;break t}if(r=rn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){ft=rn(r.nextSibling),n=r.data==="F!";break e}}Gr(n)}n=!1}n&&(t=a[0])}}return a=pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_I,lastRenderedState:t},a.queue=n,a=KI.bind(null,ve,n),n.dispatch=a,n=hh(!1),o=wg.bind(null,ve,!1,n.queue),n=pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=SN.bind(null,ve,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function _b(e){var t=At();return OI(t,ot,e)}function OI(e,t,a){if(t=fg(e,t,_I)[0],e=Hc(rr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=js(t)}catch(i){throw i===tl?Dd:i}else n=t;t=At();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(ve.flags|=2048,Gi(9,{destroy:void 0},IN.bind(null,r,a),null)),[n,o,e]}function IN(e,t){e.action=t}function Ob(e){var t=At(),a=ot;if(a!==null)return OI(t,a,e);At(),t=t.memoizedState,a=At();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Gi(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ve.updateQueue,t===null&&(t=_d(),ve.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 PI(){return At().memoizedState}function jc(e,t,a,n){var r=pa();ve.flags|=e,r.memoizedState=Gi(1|t,{destroy:void 0},a,n===void 0?null:n)}function Pd(e,t,a,n){var r=At();n=n===void 0?null:n;var o=r.memoizedState.inst;ot!==null&&n!==null&&ig(n,ot.memoizedState.deps)?r.memoizedState=Gi(t,o,a,n):(ve.flags|=e,r.memoizedState=Gi(1|t,o,a,n))}function Pb(e,t){jc(8390656,8,e,t)}function pg(e,t){Pd(2048,8,e,t)}function CN(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=_d(),ve.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function NI(e){var t=At().memoizedState;return CN({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(N(440));return t.impl.apply(void 0,arguments)}}function BI(e,t){return Pd(4,2,e,t)}function UI(e,t){return Pd(4,4,e,t)}function FI(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 zI(e,t,a){a=a!=null?a.concat([e]):null,Pd(4,4,FI.bind(null,t,e),a)}function mg(){}function qI(e,t){var a=At();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&ig(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function HI(e,t){var a=At();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&ig(t,n[1]))return n[0];if(n=e(),Mo){Rr(!0);try{e()}finally{Rr(!1)}}return a.memoizedState=[n,t],n}function hg(e,t,a){return a===void 0||(nr&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=A0(),ve.lanes|=e,Xr|=e,a)}function jI(e,t,a,n){return Ha(a,t)?a:Wi.current!==null?(e=hg(e,a,n),Ha(e,t)||(Ut=!0),e):(nr&42)===0||(nr&1073741824)!==0&&(Oe&261930)===0?(Ut=!0,e.memoizedState=a):(e=A0(),ve.lanes|=e,Xr|=e,t)}function VI(e,t,a,n,r){var o=Ze.p;Ze.p=o!==0&&8>o?o:8;var i=se.T,l={};se.T=l,wg(e,!1,t,a);try{var s=r(),u=se.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=xN(s,n);gs(e,t,c,qa(e))}else gs(e,t,n,qa(e))}catch(d){gs(e,t,{then:function(){},status:"rejected",reason:d},qa())}finally{Ze.p=o,i!==null&&l.types!==null&&(i.types=l.types),se.T=i}}function kN(){}function wh(e,t,a,n){if(e.tag!==5)throw Error(N(476));var r=WI(e).queue;VI(e,r,t,bo,a===null?kN:function(){return GI(e),a(n)})}function WI(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:bo,baseState:bo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:bo},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function GI(e){var t=WI(e);t.next===null&&(t=e.alternate.memoizedState),gs(e,t.next.queue,{},qa())}function gg(){return Qt(_s)}function $I(){return At().memoizedState}function XI(){return At().memoizedState}function TN(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=qa();e=Ur(a);var n=Fr(t,e,a);n!==null&&(Ta(n,t,a),ps(n,t,a)),t={cache:tg()},e.payload=t;return}t=t.return}}function LN(e,t,a){var n=qa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Nd(e)?YI(t,a):(a=Zh(e,t,a,n),a!==null&&(Ta(a,e,n),ZI(a,t,n)))}function KI(e,t,a){var n=qa();gs(e,t,a,n)}function gs(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Nd(e))YI(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,Ha(l,i))return Rd(e,t,r,0),st===null&&Ad(),!1}catch{}if(a=Zh(e,t,r,n),a!==null)return Ta(a,e,n),ZI(a,t,n),!0}return!1}function wg(e,t,a,n){if(n={lane:2,revertLane:Tg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Nd(e)){if(t)throw Error(N(479))}else t=Zh(e,a,n,2),t!==null&&Ta(t,e,2)}function Nd(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function YI(e,t){Fi=ud=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ZI(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,NS(e,a)}}var As={readContext:Qt,use:Od,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};As.useEffectEvent=St;var QI={readContext:Qt,use:Od,useCallback:function(e,t){return pa().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:Pb,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,jc(4194308,4,FI.bind(null,t,e),a)},useLayoutEffect:function(e,t){return jc(4194308,4,e,t)},useInsertionEffect:function(e,t){jc(4,2,e,t)},useMemo:function(e,t){var a=pa();t=t===void 0?null:t;var n=e();if(Mo){Rr(!0);try{e()}finally{Rr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=pa();if(a!==void 0){var r=a(t);if(Mo){Rr(!0);try{a(t)}finally{Rr(!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=LN.bind(null,ve,e),[n.memoizedState,e]},useRef:function(e){var t=pa();return e={current:e},t.memoizedState=e},useState:function(e){e=hh(e);var t=e.queue,a=KI.bind(null,ve,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:mg,useDeferredValue:function(e,t){var a=pa();return hg(a,e,t)},useTransition:function(){var e=hh(!1);return e=VI.bind(null,ve,e.queue,!0,!1),pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ve,r=pa();if(Be){if(a===void 0)throw Error(N(407));a=a()}else{if(a=t(),st===null)throw Error(N(349));(Oe&127)!==0||kI(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Pb(LI.bind(null,n,o,e),[e]),n.flags|=2048,Gi(9,{destroy:void 0},TI.bind(null,n,o,a,t),null),a},useId:function(){var e=pa(),t=st.identifierPrefix;if(Be){var a=Mn,n=En;a=(n&~(1<<32-za(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cd++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=vN++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gg,useFormState:Db,useActionState:Db,useOptimistic:function(e){var t=pa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=wg.bind(null,ve,!0,a),a.dispatch=t,[e,t]},useMemoCache:dg,useCacheRefresh:function(){return pa().memoizedState=TN.bind(null,ve)},useEffectEvent:function(e){var t=pa(),a={impl:e};return t.memoizedState=a,function(){if((Ye&2)!==0)throw Error(N(440));return a.impl.apply(void 0,arguments)}}},yg={readContext:Qt,use:Od,useCallback:qI,useContext:Qt,useEffect:pg,useImperativeHandle:zI,useInsertionEffect:BI,useLayoutEffect:UI,useMemo:HI,useReducer:Hc,useRef:PI,useState:function(){return Hc(rr)},useDebugValue:mg,useDeferredValue:function(e,t){var a=At();return jI(a,ot.memoizedState,e,t)},useTransition:function(){var e=Hc(rr)[0],t=At().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:CI,useId:$I,useHostTransitionStatus:gg,useFormState:_b,useActionState:_b,useOptimistic:function(e,t){var a=At();return AI(a,ot,e,t)},useMemoCache:dg,useCacheRefresh:XI};yg.useEffectEvent=NI;var JI={readContext:Qt,use:Od,useCallback:qI,useContext:Qt,useEffect:pg,useImperativeHandle:zI,useInsertionEffect:BI,useLayoutEffect:UI,useMemo:HI,useReducer:km,useRef:PI,useState:function(){return km(rr)},useDebugValue:mg,useDeferredValue:function(e,t){var a=At();return ot===null?hg(a,e,t):jI(a,ot.memoizedState,e,t)},useTransition:function(){var e=km(rr)[0],t=At().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:CI,useId:$I,useHostTransitionStatus:gg,useFormState:Ob,useActionState:Ob,useOptimistic:function(e,t){var a=At();return ot!==null?AI(a,ot,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:dg,useCacheRefresh:XI};JI.useEffectEvent=NI;function Tm(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:pt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var yh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=qa(),r=Ur(n);r.payload=t,a!=null&&(r.callback=a),t=Fr(e,r,n),t!==null&&(Ta(t,e,n),ps(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=qa(),r=Ur(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Fr(e,r,n),t!==null&&(Ta(t,e,n),ps(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=qa(),n=Ur(a);n.tag=2,t!=null&&(n.callback=t),t=Fr(e,n,a),t!==null&&(Ta(t,e,a),ps(t,e,a))}};function Nb(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?!ks(a,n)||!ks(r,o):!0}function Bb(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&&yh.enqueueReplaceState(t,t.state,null)}function Ao(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=pt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function e0(e){ad(e)}function t0(e){console.error(e)}function a0(e){ad(e)}function dd(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ub(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 xh(e,t,a){return a=Ur(a),a.tag=3,a.payload={element:null},a.callback=function(){dd(e,t)},a}function n0(e){return e=Ur(e),e.tag=3,e}function r0(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(){Ub(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Ub(t,a,n),typeof r!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function EN(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&el(t,a,r,!0),a=ja.current,a!==null){switch(a.tag){case 31:case 13:return nn===null?gd():a.alternate===null&&It===0&&(It=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===id?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Bm(e,n,r)),!1;case 22:return a.flags|=65536,n===id?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)),Bm(e,n,r)),!1}throw Error(N(435,a.tag))}return Bm(e,n,r),gd(),!1}if(Be)return t=ja.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==ih&&(e=Error(N(422),{cause:n}),Ls(tn(e,a)))):(n!==ih&&(t=Error(N(423),{cause:n}),Ls(tn(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=tn(n,a),r=xh(e.stateNode,n,r),Cm(e,r),It!==4&&(It=2)),!1;var o=Error(N(520),{cause:n});if(o=tn(o,a),xs===null?xs=[o]:xs.push(o),It!==4&&(It=2),t===null)return!0;n=tn(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=xh(a.stateNode,n,e),Cm(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"&&(zr===null||!zr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=n0(r),r0(r,e,a,n),Cm(a,r),!1}a=a.return}while(a!==null);return!1}var xg=Error(N(461)),Ut=!1;function Kt(e,t,a,n){t.child=e===null?yI(t,null,a,n):Eo(t,e.child,a,n)}function Fb(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 Lo(t),n=lg(e,t,a,i,o,r),l=sg(),e!==null&&!Ut?(ug(e,t,r),or(e,t,r)):(Be&&l&&Jh(t),t.flags|=1,Kt(e,t,n,r),t.child)}function zb(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!Qh(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,o0(e,t,o,n,r)):(e=zc(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!vg(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:ks,a(i,n)&&e.ref===t.ref)return or(e,t,r)}return t.flags|=1,e=Jn(o,n),e.ref=t.ref,e.return=t,t.child=e}function o0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(ks(o,n)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=n=o,vg(e,r))(e.flags&131072)!==0&&(Ut=!0);else return t.lanes=e.lanes,or(e,t,r)}return vh(e,t,a,n,r)}function i0(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 qb(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qc(t,o!==null?o.cachePool:null),o!==null?Mb(t,o):ph(),bI(t);else return n=t.lanes=536870912,qb(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(qc(t,o.cachePool),Mb(t,o),Mr(t),t.memoizedState=null):(e!==null&&qc(t,null),ph(),Mr(t));return Kt(e,t,r,a),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qb(e,t,a,n,r){var o=ag();return o=o===null?null:{parent:Bt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&qc(t,null),ph(),bI(t),e!==null&&el(e,t,n,!0),t.childLanes=r,null}function Vc(e,t){return t=fd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hb(e,t,a){return Eo(t,e.child,null,a),e=Vc(t,t.pendingProps),e.flags|=2,Pa(t),t.memoizedState=null,e}function MN(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(n.mode==="hidden")return e=Vc(t,n),t.lanes=536870912,ls(null,e);if(mh(t),(e=ft)?(e=Q0(e,an),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wr!==null?{id:En,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},a=dI(e),a.return=t,t.child=a,Zt=t,ft=null)):e=null,e===null)throw Gr(t);return t.lanes=536870912,null}return Vc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(mh(t),r)if(t.flags&256)t.flags&=-257,t=Hb(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(N(558));else if(Ut||el(e,t,a,!1),r=(a&e.childLanes)!==0,Ut||r){if(n=st,n!==null&&(i=BS(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Oo(e,i),Ta(n,e,i),xg;gd(),t=Hb(e,t,a)}else e=o.treeContext,ft=rn(i.nextSibling),Zt=t,Be=!0,Br=null,an=!1,e!==null&&pI(t,e),t=Vc(t,n),t.flags|=4096;return t}return e=Jn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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 vh(e,t,a,n,r){return Lo(t),a=lg(e,t,a,n,void 0,r),n=sg(),e!==null&&!Ut?(ug(e,t,r),or(e,t,r)):(Be&&n&&Jh(t),t.flags|=1,Kt(e,t,a,r),t.child)}function jb(e,t,a,n,r,o){return Lo(t),t.updateQueue=null,a=II(t,n,a,r),SI(e),n=sg(),e!==null&&!Ut?(ug(e,t,o),or(e,t,o)):(Be&&n&&Jh(t),t.flags|=1,Kt(e,t,a,o),t.child)}function Vb(e,t,a,n,r){if(Lo(t),t.stateNode===null){var o=Ai,i=a.contextType;typeof i=="object"&&i!==null&&(o=Qt(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=yh,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},rg(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?Qt(i):Ai,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Tm(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&&yh.enqueueReplaceState(o,o.state,null),hs(t,n,o,r),ms(),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=Ao(a,l);o.props=s;var u=o.context,c=a.contextType;i=Ai,typeof c=="object"&&c!==null&&(i=Qt(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)&&Bb(t,o,n,i),Tr=!1;var f=t.memoizedState;o.state=f,hs(t,n,o,r),ms(),u=t.memoizedState,l||f!==u||Tr?(typeof d=="function"&&(Tm(t,a,d,n),u=t.memoizedState),(s=Tr||Nb(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,dh(e,t),i=t.memoizedProps,c=Ao(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=Ai,typeof u=="object"&&u!==null&&(s=Qt(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)&&Bb(t,o,n,s),Tr=!1,f=t.memoizedState,o.state=f,hs(t,n,o,r),ms();var p=t.memoizedState;i!==d||f!==p||Tr||e!==null&&e.dependencies!==null&&od(e.dependencies)?(typeof l=="function"&&(Tm(t,a,l,n),p=t.memoizedState),(c=Tr||Nb(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&od(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,Wc(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=Eo(t,e.child,null,r),t.child=Eo(t,null,a,r)):Kt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=or(e,t,r),e}function Wb(e,t,a,n){return To(),t.flags|=256,Kt(e,t,a,n),t.child}var Lm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Em(e){return{baseLanes:e,cachePool:hI()}}function Mm(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ba),e}function l0(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:(Mt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(r?Er(t):Mr(t),(e=ft)?(e=Q0(e,an),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wr!==null?{id:En,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},a=dI(e),a.return=t,t.child=a,Zt=t,ft=null)):e=null,e===null)throw Gr(t);return Oh(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(Mr(t),r=t.mode,l=fd({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=Em(a),n.childLanes=Mm(e,i,a),t.memoizedState=Lm,ls(null,n)):(Er(t),bh(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(Er(t),t.flags&=-257,t=Am(e,t,a)):t.memoizedState!==null?(Mr(t),t.child=e.child,t.flags|=128,t=null):(Mr(t),l=n.fallback,r=t.mode,n=fd({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,Eo(t,e.child,null,a),n=t.child,n.memoizedState=Em(a),n.childLanes=Mm(e,i,a),t.memoizedState=Lm,t=ls(null,n));else if(Er(t),Oh(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(N(419)),n.stack="",n.digest=i,Ls({value:n,source:null,stack:null}),t=Am(e,t,a)}else if(Ut||el(e,t,a,!1),i=(a&e.childLanes)!==0,Ut||i){if(i=st,i!==null&&(n=BS(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,Oo(e,n),Ta(i,e,n),xg;_h(l)||gd(),t=Am(e,t,a)}else _h(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,ft=rn(l.nextSibling),Zt=t,Be=!0,Br=null,an=!1,e!==null&&pI(t,e),t=bh(t,n.children),t.flags|=4096);return t}return r?(Mr(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=Jn(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=Jn(u,l):(l=So(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,ls(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Em(a):(r=l.cachePool,r!==null?(s=Bt._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=hI(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Mm(e,i,a),t.memoizedState=Lm,ls(e.child,n)):(Er(t),a=e.child,e=a.sibling,a=Jn(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 bh(e,t){return t=fd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fd(e,t){return e=Na(22,e,null,t),e.lanes=0,e}function Am(e,t,a){return Eo(t,e.child,null,a),e=bh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gb(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),sh(e.return,t,a)}function Rm(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 s0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Mt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,ut(Mt,i),Kt(e,t,n,a),n=Be?Ts:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gb(e,a,t);else if(e.tag===19)Gb(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&&sd(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Rm(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&&sd(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Rm(t,!0,a,null,o,n);break;case"together":Rm(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function or(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Xr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(el(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=Jn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Jn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function vg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&od(e)))}function AN(e,t,a){switch(t.tag){case 3:Qc(t,t.stateNode.containerInfo),Lr(t,Bt,e.memoizedState.cache),To();break;case 27:case 5:Km(t);break;case 4:Qc(t,t.stateNode.containerInfo);break;case 10:Lr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mh(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Er(t),t.flags|=128,null):(a&t.child.childLanes)!==0?l0(e,t,a):(Er(t),e=or(e,t,a),e!==null?e.sibling:null);Er(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(el(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return s0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ut(Mt,Mt.current),n)break;return null;case 22:return t.lanes=0,i0(e,t,a,t.pendingProps);case 24:Lr(t,Bt,e.memoizedState.cache)}return or(e,t,a)}function u0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ut=!0;else{if(!vg(e,a)&&(t.flags&128)===0)return Ut=!1,AN(e,t,a);Ut=(e.flags&131072)!==0}else Ut=!1,Be&&(t.flags&1048576)!==0&&fI(t,Ts,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=xo(t.elementType),t.type=e,typeof e=="function")Qh(e)?(n=Ao(e,n),t.tag=1,t=Vb(null,t,e,n,a)):(t.tag=0,t=vh(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===Uh){t.tag=11,t=Fb(null,t,e,n,a);break e}else if(r===Fh){t.tag=14,t=zb(null,t,e,n,a);break e}}throw t=$m(e)||e,Error(N(306,t,""))}}return t;case 0:return vh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Ao(n,t.pendingProps),Vb(e,t,n,r,a);case 3:e:{if(Qc(t,t.stateNode.containerInfo),e===null)throw Error(N(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,dh(e,t),hs(t,n,null,a);var i=t.memoizedState;if(n=i.cache,Lr(t,Bt,n),n!==o.cache&&uh(t,[Bt],a,!0),ms(),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=Wb(e,t,n,a);break e}else if(n!==r){r=tn(Error(N(424)),t),Ls(r),t=Wb(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,ft=rn(e.firstChild),Zt=t,Be=!0,Br=null,an=!0,a=yI(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(To(),n===r){t=or(e,t,a);break e}Kt(e,t,n,a)}t=t.child}return t;case 26:return Wc(e,t),e===null?(a=mS(t.type,null,t.pendingProps,null))?t.memoizedState=a:Be||(a=t.type,e=t.pendingProps,n=vd(Nr.current).createElement(a),n[Yt]=t,n[La]=e,Jt(n,a,e),Gt(n),t.stateNode=n):t.memoizedState=mS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Km(t),e===null&&Be&&(n=t.stateNode=J0(t.type,t.pendingProps,Nr.current),Zt=t,an=!0,r=ft,Yr(t.type)?(Ph=r,ft=rn(n.firstChild)):ft=r),Kt(e,t,t.pendingProps.children,a),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((r=n=ft)&&(n=rB(n,t.type,t.pendingProps,an),n!==null?(t.stateNode=n,Zt=t,ft=rn(n.firstChild),an=!1,r=!0):r=!1),r||Gr(t)),Km(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,Rh(r,o)?n=null:i!==null&&Rh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=lg(e,t,bN,null,null,a),_s._currentValue=r),Wc(e,t),Kt(e,t,n,a),t.child;case 6:return e===null&&Be&&((e=a=ft)&&(a=oB(a,t.pendingProps,an),a!==null?(t.stateNode=a,Zt=t,ft=null,e=!0):e=!1),e||Gr(t)),null;case 13:return l0(e,t,a);case 4:return Qc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Eo(t,null,n,a):Kt(e,t,n,a),t.child;case 11:return Fb(e,t,t.type,t.pendingProps,a);case 7:return Kt(e,t,t.pendingProps,a),t.child;case 8:return Kt(e,t,t.pendingProps.children,a),t.child;case 12:return Kt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Lr(t,t.type,n.value),Kt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Lo(t),r=Qt(r),n=n(r),t.flags|=1,Kt(e,t,n,a),t.child;case 14:return zb(e,t,t.type,t.pendingProps,a);case 15:return o0(e,t,t.type,t.pendingProps,a);case 19:return s0(e,t,a);case 31:return MN(e,t,a);case 22:return i0(e,t,a,t.pendingProps);case 24:return Lo(t),n=Qt(Bt),e===null?(r=ag(),r===null&&(r=st,o=tg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},rg(t),Lr(t,Bt,r)):((e.lanes&a)!==0&&(dh(e,t),hs(t,null,null,a),ms()),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),Lr(t,Bt,n)):(n=o.cache,Lr(t,Bt,n),n!==r.cache&&uh(t,[Bt],a,!0))),Kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(N(156,t.tag))}function Vn(e){e.flags|=4}function Dm(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(_0())e.flags|=8192;else throw Co=id,ng}else e.flags&=-16777217}function $b(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!aC(t))if(_0())e.flags|=8192;else throw Co=id,ng}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?OS():536870912,e.lanes|=t,$i|=t)}function es(e,t){if(!Be)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 dt(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 RN(e,t,a){var n=t.pendingProps;switch(eg(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),er(Bt),qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(yi(t)?Vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Im())),dt(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Vn(t),o!==null?(dt(t),$b(t,o)):(dt(t),Dm(t,r,null,n,a))):o?o!==e.memoizedState?(Vn(t),dt(t),$b(t,o)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Vn(t),dt(t),Dm(t,r,e,n,a)),null;case 27:if(Jc(t),a=Nr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Vn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return dt(t),null}e=Rn.current,yi(t)?Sb(t,e):(e=J0(r,n,a),t.stateNode=e,Vn(t))}return dt(t),null;case 5:if(Jc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Vn(t);else{if(!n){if(t.stateNode===null)throw Error(N(166));return dt(t),null}if(o=Rn.current,yi(t))Sb(t,o);else{var i=vd(Nr.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[Yt]=t,o[La]=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(Jt(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&&Vn(t)}}return dt(t),Dm(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Vn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(N(166));if(e=Nr.current,yi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Zt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Yt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||K0(e.nodeValue,a)),e||Gr(t,!0)}else e=vd(e).createTextNode(n),e[Yt]=t,t.stateNode=e}return dt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=yi(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[Yt]=t}else To(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else a=Im(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Pa(t),t):(Pa(t),null);if((t.flags&128)!==0)throw Error(N(558))}return dt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=yi(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[Yt]=t}else To(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),r=!1}else r=Im(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Pa(t),t):(Pa(t),null)}return Pa(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),Mc(t,t.updateQueue),dt(t),null);case 4:return qi(),e===null&&Lg(t.stateNode.containerInfo),dt(t),null;case 10:return er(t.type),dt(t),null;case 19:if($t(Mt),n=t.memoizedState,n===null)return dt(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)es(n,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=sd(e),o!==null){for(t.flags|=128,es(n,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cI(a,e),a=a.sibling;return ut(Mt,Mt.current&1|2),Be&&Xn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ua()>md&&(t.flags|=128,r=!0,es(n,!1),t.lanes=4194304)}else{if(!r)if(e=sd(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),es(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Be)return dt(t),null}else 2*Ua()-n.renderingStartTime>md&&a!==536870912&&(t.flags|=128,r=!0,es(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=Ua(),e.sibling=null,a=Mt.current,ut(Mt,r?a&1|2:a&1),Be&&Xn(t,n.treeForkCount),e):(dt(t),null);case 22:case 23:return Pa(t),og(),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&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),a=t.updateQueue,a!==null&&Mc(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&&$t(Io),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),er(Bt),dt(t),null;case 25:return null;case 30:return null}throw Error(N(156,t.tag))}function DN(e,t){switch(eg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Bt),qi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jc(t),null;case 31:if(t.memoizedState!==null){if(Pa(t),t.alternate===null)throw Error(N(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(Mt),null;case 4:return qi(),null;case 10:return er(t.type),null;case 22:case 23:return Pa(t),og(),e!==null&&$t(Io),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Bt),null;case 25:return null;default:return null}}function c0(e,t){switch(eg(t),t.tag){case 3:er(Bt),qi();break;case 26:case 27:case 5:Jc(t);break;case 4:qi();break;case 31:t.memoizedState!==null&&Pa(t);break;case 13:Pa(t);break;case 19:$t(Mt);break;case 10:er(t.type);break;case 22:case 23:Pa(t),og(),e!==null&&$t(Io);break;case 24:er(Bt)}}function Vs(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){tt(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){tt(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){tt(t,t.return,c)}}function d0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{vI(t,a)}catch(n){tt(e,e.return,n)}}}function f0(e,t,a){a.props=Ao(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){tt(e,t,n)}}function ws(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){tt(e,t,r)}}function An(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){tt(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){tt(e,t,r)}else a.current=null}function p0(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){tt(e,e.return,r)}}function _m(e,t,a){try{var n=e.stateNode;QN(n,e.type,a,t),n[La]=t}catch(r){tt(e,e.return,r)}}function m0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function Om(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m0(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&&Yr(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 Sh(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=Zn));else if(n!==4&&(n===27&&Yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Sh(e,t,a),e=e.sibling;e!==null;)Sh(e,t,a),e=e.sibling}function pd(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&&Yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(pd(e,t,a),e=e.sibling;e!==null;)pd(e,t,a),e=e.sibling}function h0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Jt(t,n,a),t[Yt]=e,t[La]=a}catch(o){tt(e,e.return,o)}}var Kn=!1,Nt=!1,Pm=!1,Xb=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function _N(e,t){if(e=e.containerInfo,Mh=Cd,e=aI(e),Kh(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(Ah={focusedElem:e,selectionRange:a},Cd=!1,Wt=t;Wt!==null;)if(t=Wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Wt=e;else for(;Wt!==null;){switch(t=Wt,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=Ao(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){tt(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Dh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Dh(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,Wt=e;break}Wt=t.return}}function g0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Gn(e,a),n&4&&Vs(5,a);break;case 1:if(Gn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){tt(a,a.return,i)}else{var r=Ao(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){tt(a,a.return,i)}}n&64&&d0(a),n&512&&ws(a,a.return);break;case 3:if(Gn(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{vI(e,t)}catch(i){tt(a,a.return,i)}}break;case 27:t===null&&n&4&&h0(a);case 26:case 5:Gn(e,a),t===null&&n&4&&p0(a),n&512&&ws(a,a.return);break;case 12:Gn(e,a);break;case 31:Gn(e,a),n&4&&x0(e,a);break;case 13:Gn(e,a),n&4&&v0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=HN.bind(null,a),iB(e,a))));break;case 22:if(n=a.memoizedState!==null||Kn,!n){t=t!==null&&t.memoizedState!==null||Nt,r=Kn;var o=Nt;Kn=n,(Nt=t)&&!o?$n(e,a,(a.subtreeFlags&8772)!==0):Gn(e,a),Kn=r,Nt=o}break;case 30:break;default:Gn(e,a)}}function w0(e){var t=e.alternate;t!==null&&(e.alternate=null,w0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jh(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 yt=null,Ca=!1;function Wn(e,t,a){for(a=a.child;a!==null;)y0(e,t,a),a=a.sibling}function y0(e,t,a){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Bs,a)}catch{}switch(a.tag){case 26:Nt||An(a,t),Wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Nt||An(a,t);var n=yt,r=Ca;Yr(a.type)&&(yt=a.stateNode,Ca=!1),Wn(e,t,a),bs(a.stateNode),yt=n,Ca=r;break;case 5:Nt||An(a,t);case 6:if(n=yt,r=Ca,yt=null,Wn(e,t,a),yt=n,Ca=r,yt!==null)if(Ca)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(a.stateNode)}catch(o){tt(a,t,o)}else try{yt.removeChild(a.stateNode)}catch(o){tt(a,t,o)}break;case 18:yt!==null&&(Ca?(e=yt,uS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Zi(e)):uS(yt,a.stateNode));break;case 4:n=yt,r=Ca,yt=a.stateNode.containerInfo,Ca=!0,Wn(e,t,a),yt=n,Ca=r;break;case 0:case 11:case 14:case 15:$r(2,a,t),Nt||$r(4,a,t),Wn(e,t,a);break;case 1:Nt||(An(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&f0(a,t,n)),Wn(e,t,a);break;case 21:Wn(e,t,a);break;case 22:Nt=(n=Nt)||a.memoizedState!==null,Wn(e,t,a),Nt=n;break;default:Wn(e,t,a)}}function x0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zi(e)}catch(a){tt(t,t.return,a)}}}function v0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zi(e)}catch(a){tt(t,t.return,a)}}function ON(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xb),t;default:throw Error(N(435,e.tag))}}function Ac(e,t){var a=ON(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=jN.bind(null,e,n);n.then(r,r)}})}function Sa(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(Yr(l.type)){yt=l.stateNode,Ca=!1;break e}break;case 5:yt=l.stateNode,Ca=!1;break e;case 3:case 4:yt=l.stateNode.containerInfo,Ca=!0;break e}l=l.return}if(yt===null)throw Error(N(160));y0(o,i,r),yt=null,Ca=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)b0(t,e),t=t.sibling}var wn=null;function b0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sa(t,e),Ia(e),n&4&&($r(3,e,e.return),Vs(3,e),$r(5,e,e.return));break;case 1:Sa(t,e),Ia(e),n&512&&(Nt||a===null||An(a,a.return)),n&64&&Kn&&(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=wn;if(Sa(t,e),Ia(e),n&512&&(Nt||a===null||An(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[zs]||o[Yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),Jt(o,n,a),o[Yt]=e,Gt(o),n=o;break e;case"link":var i=gS("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),Jt(o,n,a),r.head.appendChild(o);break;case"meta":if(i=gS("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),Jt(o,n,a),r.head.appendChild(o);break;default:throw Error(N(468,n))}o[Yt]=e,Gt(o),n=o}e.stateNode=n}else wS(r,e.type,e.stateNode);else e.stateNode=hS(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?wS(r,e.type,e.stateNode):hS(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&_m(e,e.memoizedProps,a.memoizedProps)}break;case 27:Sa(t,e),Ia(e),n&512&&(Nt||a===null||An(a,a.return)),a!==null&&n&4&&_m(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Sa(t,e),Ia(e),n&512&&(Nt||a===null||An(a,a.return)),e.flags&32){r=e.stateNode;try{ji(r,"")}catch(m){tt(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,_m(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Pm=!0);break;case 6:if(Sa(t,e),Ia(e),n&4){if(e.stateNode===null)throw Error(N(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){tt(e,e.return,m)}}break;case 3:if(Xc=null,r=wn,wn=bd(t.containerInfo),Sa(t,e),wn=r,Ia(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(m){tt(e,e.return,m)}Pm&&(Pm=!1,S0(e));break;case 4:n=wn,wn=bd(e.stateNode.containerInfo),Sa(t,e),Ia(e),wn=n;break;case 12:Sa(t,e),Ia(e);break;case 31:Sa(t,e),Ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ac(e,n)));break;case 13:Sa(t,e),Ia(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bd=Ua()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ac(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Kn,c=Nt;if(Kn=u||r,Nt=c||s,Sa(t,e),Nt=c,Kn=u,Ia(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Kn||Nt||vo(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){tt(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){tt(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?cS(p,!0):cS(s.stateNode,!1)}catch(m){tt(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,Ac(e,a))));break;case 19:Sa(t,e),Ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ac(e,n)));break;case 30:break;case 21:break;default:Sa(t,e),Ia(e)}}function Ia(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(m0(n)){a=n;break}n=n.return}if(a==null)throw Error(N(160));switch(a.tag){case 27:var r=a.stateNode,o=Om(e);pd(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(ji(i,""),a.flags&=-33);var l=Om(e);pd(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Om(e);Sh(e,u,s);break;default:throw Error(N(161))}}catch(c){tt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function S0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;S0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Gn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)g0(e,t.alternate,t),t=t.sibling}function vo(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),vo(t);break;case 1:An(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&f0(t,t.return,a),vo(t);break;case 27:bs(t.stateNode);case 26:case 5:An(t,t.return),vo(t);break;case 22:t.memoizedState===null&&vo(t);break;case 30:vo(t);break;default:vo(t)}e=e.sibling}}function $n(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:$n(r,o,a),Vs(4,o);break;case 1:if($n(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){tt(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++)xI(s[r],l)}catch(u){tt(n,n.return,u)}}a&&i&64&&d0(o),ws(o,o.return);break;case 27:h0(o);case 26:case 5:$n(r,o,a),a&&n===null&&i&4&&p0(o),ws(o,o.return);break;case 12:$n(r,o,a);break;case 31:$n(r,o,a),a&&i&4&&x0(r,o);break;case 13:$n(r,o,a),a&&i&4&&v0(r,o);break;case 22:o.memoizedState===null&&$n(r,o,a),ws(o,o.return);break;case 30:break;default:$n(r,o,a)}t=t.sibling}}function bg(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&&Hs(a))}function Sg(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hs(e))}function gn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)I0(e,t,a,n),t=t.sibling}function I0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:gn(e,t,a,n),r&2048&&Vs(9,t);break;case 1:gn(e,t,a,n);break;case 3:gn(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&&Hs(e)));break;case 12:if(r&2048){gn(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){tt(t,t.return,s)}}else gn(e,t,a,n);break;case 31:gn(e,t,a,n);break;case 13:gn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?gn(e,t,a,n):ys(e,t):o._visibility&2?gn(e,t,a,n):(o._visibility|=2,vi(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&bg(i,t);break;case 24:gn(e,t,a,n),r&2048&&Sg(t.alternate,t);break;default:gn(e,t,a,n)}}function vi(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:vi(o,i,l,s,r),Vs(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?vi(o,i,l,s,r):ys(o,i):(c._visibility|=2,vi(o,i,l,s,r)),r&&u&2048&&bg(i.alternate,i);break;case 24:vi(o,i,l,s,r),r&&u&2048&&Sg(i.alternate,i);break;default:vi(o,i,l,s,r)}t=t.sibling}}function ys(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:ys(a,n),r&2048&&bg(n.alternate,n);break;case 24:ys(a,n),r&2048&&Sg(n.alternate,n);break;default:ys(a,n)}t=t.sibling}}var ss=8192;function xi(e,t,a){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)C0(e,t,a),e=e.sibling}function C0(e,t,a){switch(e.tag){case 26:xi(e,t,a),e.flags&ss&&e.memoizedState!==null&&yB(a,wn,e.memoizedState,e.memoizedProps);break;case 5:xi(e,t,a);break;case 3:case 4:var n=wn;wn=bd(e.stateNode.containerInfo),xi(e,t,a),wn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ss,ss=16777216,xi(e,t,a),ss=n):xi(e,t,a));break;default:xi(e,t,a)}}function k0(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 ts(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];Wt=n,L0(n,e)}k0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)T0(e),e=e.sibling}function T0(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&$r(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gc(e)):ts(e);break;default:ts(e)}}function Gc(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];Wt=n,L0(n,e)}k0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$r(8,t,t.return),Gc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Gc(t));break;default:Gc(t)}e=e.sibling}}function L0(e,t){for(;Wt!==null;){var a=Wt;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:Hs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Wt=n;else e:for(a=e;Wt!==null;){n=Wt;var r=n.sibling,o=n.return;if(w0(n),n===a){Wt=null;break e}if(r!==null){r.return=o,Wt=r;break e}Wt=o}}}var PN={getCacheForType:function(e){var t=Qt(Bt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Qt(Bt).controller.signal}},NN=typeof WeakMap=="function"?WeakMap:Map,Ye=0,st=null,_e=null,Oe=0,et=0,Oa=null,_r=!1,al=!1,Ig=!1,ir=0,It=0,Xr=0,ko=0,Cg=0,Ba=0,$i=0,xs=null,ka=null,Ih=!1,Bd=0,E0=0,md=1/0,hd=null,zr=null,Ft=0,qr=null,Xi=null,tr=0,Ch=0,kh=null,M0=null,vs=0,Th=null;function qa(){return(Ye&2)!==0&&Oe!==0?Oe&-Oe:se.T!==null?Tg():US()}function A0(){if(Ba===0)if((Oe&536870912)===0||Be){var e=vc;vc<<=1,(vc&3932160)===0&&(vc=262144),Ba=e}else Ba=536870912;return e=ja.current,e!==null&&(e.flags|=32),Ba}function Ta(e,t,a){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Ki(e,0),Or(e,Oe,Ba,!1)),Fs(e,a),((Ye&2)===0||e!==st)&&(e===st&&((Ye&2)===0&&(ko|=a),It===4&&Or(e,Oe,Ba,!1)),_n(e))}function R0(e,t,a){if((Ye&6)!==0)throw Error(N(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Us(e,t),r=n?FN(e,t):Nm(e,t,!0),o=n;do{if(r===0){al&&!n&&Or(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!BN(a)){r=Nm(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=xs;var s=l.current.memoizedState.isDehydrated;if(s&&(Ki(l,i).flags|=256),i=Nm(l,i,!1),i!==2){if(Ig&&!s){l.errorRecoveryDisabledLanes|=o,ko|=o,r=4;break e}o=ka,ka=r,o!==null&&(ka===null?ka=o:ka.push.apply(ka,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Ki(e,0),Or(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:Or(n,t,Ba,!_r);break e;case 2:ka=null;break;case 3:case 5:break;default:throw Error(N(329))}if((t&62914560)===t&&(r=Bd+300-Ua(),10<r)){if(Or(n,t,Ba,!_r),Td(n,0,!0)!==0)break e;tr=t,n.timeoutHandle=Z0(Kb.bind(null,n,a,ka,hd,Ih,t,Ba,ko,$i,_r,o,"Throttled",-0,0),r);break e}Kb(n,a,ka,hd,Ih,t,Ba,ko,$i,_r,o,null,-0,0)}}break}while(!0);_n(e)}function Kb(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:Zn},C0(t,o,d);var m=(o&62914560)===o?Bd-Ua():(o&4194048)===o?E0-Ua():0;if(m=xB(d,m),m!==null){tr=o,e.cancelPendingCommit=m(Zb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),Or(e,o,i,!u);return}}Zb(e,t,o,a,n,r,i,l,s)}function BN(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(!Ha(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 Or(e,t,a,n){t&=~Cg,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-za(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&PS(e,a,t)}function Ud(){return(Ye&6)===0?(Ws(0,!1),!1):!0}function kg(){if(_e!==null){if(et===0)var e=_e.return;else e=_e,Qn=Po=null,cg(e),Ui=null,Es=0,e=_e;for(;e!==null;)c0(e.alternate,e),e=e.return;_e=null}}function Ki(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,tB(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),tr=0,kg(),st=e,_e=a=Jn(e.current,null),Oe=t,et=0,Oa=null,_r=!1,al=Us(e,t),Ig=!1,$i=Ba=Cg=ko=Xr=It=0,ka=xs=null,Ih=!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-za(n),o=1<<r;t|=e[r],n&=~o}return ir=t,Ad(),a}function D0(e,t){ve=null,se.H=As,t===tl||t===Dd?(t=Lb(),et=3):t===ng?(t=Lb(),et=4):et=t===xg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Oa=t,_e===null&&(It=1,dd(e,tn(t,e.current)))}function _0(){var e=ja.current;return e===null?!0:(Oe&4194048)===Oe?nn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===nn:!1}function O0(){var e=se.H;return se.H=As,e===null?As:e}function P0(){var e=se.A;return se.A=PN,e}function gd(){It=4,_r||(Oe&4194048)!==Oe&&ja.current!==null||(al=!0),(Xr&134217727)===0&&(ko&134217727)===0||st===null||Or(st,Oe,Ba,!1)}function Nm(e,t,a){var n=Ye;Ye|=2;var r=O0(),o=P0();(st!==e||Oe!==t)&&(hd=null,Ki(e,t)),t=!1;var i=It;e:do try{if(et!==0&&_e!==null){var l=_e,s=Oa;switch(et){case 8:kg(),i=6;break e;case 3:case 2:case 9:case 6:ja.current===null&&(t=!0);var u=et;if(et=0,Oa=null,_i(e,l,s,u),a&&al){i=0;break e}break;default:u=et,et=0,Oa=null,_i(e,l,s,u)}}UN(),i=It;break}catch(c){D0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Qn=Po=null,Ye=n,se.H=r,se.A=o,_e===null&&(st=null,Oe=0,Ad()),i}function UN(){for(;_e!==null;)N0(_e)}function FN(e,t){var a=Ye;Ye|=2;var n=O0(),r=P0();st!==e||Oe!==t?(hd=null,md=Ua()+500,Ki(e,t)):al=Us(e,t);e:do try{if(et!==0&&_e!==null){t=_e;var o=Oa;t:switch(et){case 1:et=0,Oa=null,_i(e,t,o,1);break;case 2:case 9:if(Tb(o)){et=0,Oa=null,Yb(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),_n(e)},o.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Tb(o)?(et=0,Oa=null,Yb(t)):(et=0,Oa=null,_i(e,t,o,7));break;case 5:var i=null;switch(_e.tag){case 26:i=_e.memoizedState;case 5:case 27:var l=_e;if(i?aC(i):l.stateNode.complete){et=0,Oa=null;var s=l.sibling;if(s!==null)_e=s;else{var u=l.return;u!==null?(_e=u,Fd(u)):_e=null}break t}}et=0,Oa=null,_i(e,t,o,5);break;case 6:et=0,Oa=null,_i(e,t,o,6);break;case 8:kg(),It=6;break e;default:throw Error(N(462))}}zN();break}catch(c){D0(e,c)}while(!0);return Qn=Po=null,se.H=n,se.A=r,Ye=a,_e!==null?0:(st=null,Oe=0,Ad(),It)}function zN(){for(;_e!==null&&!uP();)N0(_e)}function N0(e){var t=u0(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?Fd(e):_e=t}function Yb(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=jb(a,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=jb(a,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:cg(t);default:c0(a,t),t=_e=cI(t,ir),t=u0(a,t,ir)}e.memoizedProps=e.pendingProps,t===null?Fd(e):_e=t}function _i(e,t,a,n){Qn=Po=null,cg(t),Ui=null,Es=0;var r=t.return;try{if(EN(e,r,t,a,Oe)){It=1,dd(e,tn(a,e.current)),_e=null;return}}catch(o){if(r!==null)throw _e=r,o;It=1,dd(e,tn(a,e.current)),_e=null;return}t.flags&32768?(Be||n===1?e=!0:al||(Oe&536870912)!==0?e=!1:(_r=e=!0,(n===2||n===9||n===3||n===6)&&(n=ja.current,n!==null&&n.tag===13&&(n.flags|=16384))),B0(t,e)):Fd(t)}function Fd(e){var t=e;do{if((t.flags&32768)!==0){B0(t,_r);return}e=t.return;var a=RN(t.alternate,t,ir);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);It===0&&(It=5)}function B0(e,t){do{var a=DN(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);It=6,_e=null}function Zb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do zd();while(Ft!==0);if((Ye&6)!==0)throw Error(N(327));if(t!==null){if(t===e.current)throw Error(N(177));if(o=t.lanes|t.childLanes,o|=Yh,xP(e,a,o,i,l,s),e===st&&(_e=st=null,Oe=0),Xi=t,qr=e,tr=a,Ch=o,kh=r,M0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,VN(ed,function(){return H0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=se.T,se.T=null,r=Ze.p,Ze.p=2,i=Ye,Ye|=4;try{_N(e,t,a)}finally{Ye=i,Ze.p=r,se.T=n}}Ft=1,U0(),F0(),z0()}}function U0(){if(Ft===1){Ft=0;var e=qr,t=Xi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=se.T,se.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{b0(t,e);var o=Ah,i=aI(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&tI(l.ownerDocument.documentElement,l)){if(s!==null&&Kh(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),S=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>S&&(i=S,S=x,x=i);var w=xb(l,x),y=xb(l,S);if(w&&y&&(p.rangeCount!==1||p.anchorNode!==w.node||p.anchorOffset!==w.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var g=d.createRange();g.setStart(w.node,w.offset),p.removeAllRanges(),x>S?(p.addRange(g),p.extend(y.node,y.offset)):(g.setEnd(y.node,y.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}}Cd=!!Mh,Ah=Mh=null}finally{Ye=r,Ze.p=n,se.T=a}}e.current=t,Ft=2}}function F0(){if(Ft===2){Ft=0;var e=qr,t=Xi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=se.T,se.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{g0(e,t.alternate,t)}finally{Ye=r,Ze.p=n,se.T=a}}Ft=3}}function z0(){if(Ft===4||Ft===3){Ft=0,cP();var e=qr,t=Xi,a=tr,n=M0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ft=5:(Ft=0,Xi=qr=null,q0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(zr=null),Hh(a),t=t.stateNode,Fa&&typeof Fa.onCommitFiberRoot=="function")try{Fa.onCommitFiberRoot(Bs,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=se.T,r=Ze.p,Ze.p=2,se.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{se.T=t,Ze.p=r}}(tr&3)!==0&&zd(),_n(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Th?vs++:(vs=0,Th=e):vs=0,Ws(0,!1)}}function q0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hs(t)))}function zd(){return U0(),F0(),z0(),H0()}function H0(){if(Ft!==5)return!1;var e=qr,t=Ch;Ch=0;var a=Hh(tr),n=se.T,r=Ze.p;try{Ze.p=32>a?32:a,se.T=null,a=kh,kh=null;var o=qr,i=tr;if(Ft=0,Xi=qr=null,tr=0,(Ye&6)!==0)throw Error(N(331));var l=Ye;if(Ye|=4,T0(o.current),I0(o,o.current,i,a),Ye=l,Ws(0,!1),Fa&&typeof Fa.onPostCommitFiberRoot=="function")try{Fa.onPostCommitFiberRoot(Bs,o)}catch{}return!0}finally{Ze.p=r,se.T=n,q0(e,t)}}function Qb(e,t,a){t=tn(a,t),t=xh(e.stateNode,t,2),e=Fr(e,t,2),e!==null&&(Fs(e,2),_n(e))}function tt(e,t,a){if(e.tag===3)Qb(e,e,a);else for(;t!==null;){if(t.tag===3){Qb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(zr===null||!zr.has(n))){e=tn(a,e),a=n0(2),n=Fr(t,a,2),n!==null&&(r0(a,n,t,e),Fs(n,2),_n(n));break}}t=t.return}}function Bm(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new NN;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)||(Ig=!0,r.add(a),e=qN.bind(null,e,t,a),t.then(e,e))}function qN(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,st===e&&(Oe&a)===a&&(It===4||It===3&&(Oe&62914560)===Oe&&300>Ua()-Bd?(Ye&2)===0&&Ki(e,0):Cg|=a,$i===Oe&&($i=0)),_n(e)}function j0(e,t){t===0&&(t=OS()),e=Oo(e,t),e!==null&&(Fs(e,t),_n(e))}function HN(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),j0(e,a)}function jN(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),j0(e,a)}function VN(e,t){return zh(e,t)}var wd=null,bi=null,Lh=!1,yd=!1,Um=!1,Pr=0;function _n(e){e!==bi&&e.next===null&&(bi===null?wd=bi=e:bi=bi.next=e),yd=!0,Lh||(Lh=!0,GN())}function Ws(e,t){if(!Um&&yd){Um=!0;do for(var a=!1,n=wd;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-za(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Jb(n,o))}else o=Oe,o=Td(n,n===st?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||Us(n,o)||(a=!0,Jb(n,o));n=n.next}while(a);Um=!1}}function WN(){V0()}function V0(){yd=Lh=!1;var e=0;Pr!==0&&eB()&&(e=Pr);for(var t=Ua(),a=null,n=wd;n!==null;){var r=n.next,o=W0(n,t);o===0?(n.next=null,a===null?wd=r:a.next=r,r===null&&(bi=a)):(a=n,(e!==0||(o&3)!==0)&&(yd=!0)),n=r}Ft!==0&&Ft!==5||Ws(e,!1),Pr!==0&&(Pr=0)}function W0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-za(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=yP(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=st,a=Oe,a=Td(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pm(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Us(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&pm(n),Hh(a)){case 2:case 8:a=DS;break;case 32:a=ed;break;case 268435456:a=_S;break;default:a=ed}return n=G0.bind(null,e),a=zh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&pm(n),e.callbackPriority=2,e.callbackNode=null,2}function G0(e,t){if(Ft!==0&&Ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(zd()&&e.callbackNode!==a)return null;var n=Oe;return n=Td(e,e===st?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(R0(e,n,t),W0(e,Ua()),e.callbackNode!=null&&e.callbackNode===a?G0.bind(null,e):null)}function Jb(e,t){if(zd())return null;R0(e,t,!0)}function GN(){aB(function(){(Ye&6)!==0?zh(RS,WN):V0()})}function Tg(){if(Pr===0){var e=Vi;e===0&&(e=xc,xc<<=1,(xc&261888)===0&&(xc=256)),Pr=e}return Pr}function eS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bc(""+e)}function tS(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 $N(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=eS((r[La]||null).action),i=n.submitter;i&&(t=(t=i[La]||null)?eS(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new Ld("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Pr!==0){var s=i?tS(r,i):new FormData(r);wh(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?tS(r,i):new FormData(r),wh(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Rc=0;Rc<oh.length;Rc++)Dc=oh[Rc],aS=Dc.toLowerCase(),nS=Dc[0].toUpperCase()+Dc.slice(1),yn(aS,"on"+nS);var Dc,aS,nS,Rc;yn(rI,"onAnimationEnd");yn(oI,"onAnimationIteration");yn(iI,"onAnimationStart");yn("dblclick","onDoubleClick");yn("focusin","onFocus");yn("focusout","onBlur");yn(dN,"onTransitionRun");yn(fN,"onTransitionStart");yn(pN,"onTransitionCancel");yn(lI,"onTransitionEnd");Hi("onMouseEnter",["mouseout","mouseover"]);Hi("onMouseLeave",["mouseout","mouseover"]);Hi("onPointerEnter",["pointerout","pointerover"]);Hi("onPointerLeave",["pointerout","pointerover"]);Ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rs="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(" "),XN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rs));function $0(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){ad(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){ad(c)}r.currentTarget=null,o=s}}}}function De(e,t){var a=t[Zm];a===void 0&&(a=t[Zm]=new Set);var n=e+"__bubble";a.has(n)||(X0(t,e,2,!1),a.add(n))}function Fm(e,t,a){var n=0;t&&(n|=4),X0(a,e,n,t)}var _c="_reactListening"+Math.random().toString(36).slice(2);function Lg(e){if(!e[_c]){e[_c]=!0,FS.forEach(function(a){a!=="selectionchange"&&(XN.has(a)||Fm(a,!1,e),Fm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_c]||(t[_c]=!0,Fm("selectionchange",!1,t))}}function X0(e,t,a,n){switch(lC(t)){case 2:var r=SB;break;case 8:r=IB;break;default:r=Rg}a=r.bind(null,t,a,e),r=void 0,!ah||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 zm(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=Ci(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}$S(function(){var u=o,c=Wh(a),d=[];e:{var f=sI.get(e);if(f!==void 0){var p=Ld,m=e;switch(e){case"keypress":if(Fc(a)===0)break e;case"keydown":case"keyup":p=jP;break;case"focusin":m="focus",p=ym;break;case"focusout":m="blur",p=ym;break;case"beforeblur":case"afterblur":p=ym;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=cb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=RP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=GP;break;case rI:case oI:case iI:p=OP;break;case lI:p=XP;break;case"scroll":case"scrollend":p=MP;break;case"wheel":p=YP;break;case"copy":case"cut":case"paste":p=NP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=fb;break;case"toggle":case"beforetoggle":p=QP}var x=(t&4)!==0,S=!x&&(e==="scroll"||e==="scrollend"),w=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,g;y!==null;){var b=y;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||w===null||(b=Is(y,w),b!=null&&x.push(Ds(y,b,g))),S)break;y=y.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!==th&&(m=a.relatedTarget||a.fromElement)&&(Ci(m)||m[Qi]))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?Ci(m):null,m!==null&&(S=Ns(m),x=m.tag,m!==S||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=cb,b="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=fb,b="onPointerLeave",w="onPointerEnter",y="pointer"),S=p==null?f:is(p),g=m==null?f:is(m),f=new x(b,y+"leave",p,a,c),f.target=S,f.relatedTarget=g,b=null,Ci(c)===u&&(x=new x(w,y+"enter",m,a,c),x.target=g,x.relatedTarget=S,b=x),S=b,p&&m)t:{for(x=KN,w=p,y=m,g=0,b=w;b;b=x(b))g++;b=0;for(var T=y;T;T=x(T))b++;for(;0<g-b;)w=x(w),g--;for(;0<b-g;)y=x(y),b--;for(;g--;){if(w===y||y!==null&&w===y.alternate){x=w;break t}w=x(w),y=x(y)}x=null}else x=null;p!==null&&rS(d,f,p,x,!1),m!==null&&S!==null&&rS(d,S,m,x,!0)}}e:{if(f=u?is(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=gb;else if(hb(f))if(JS)C=sN;else{C=iN;var A=oN}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Vh(u.elementType)&&(C=gb):C=lN;if(C&&(C=C(e,u))){QS(d,C,a,c);break e}A&&A(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&eh(f,"number",f.value)}switch(A=u?is(u):window,e){case"focusin":(hb(A)||A.contentEditable==="true")&&(Li=A,nh=u,ds=null);break;case"focusout":ds=nh=Li=null;break;case"mousedown":rh=!0;break;case"contextmenu":case"mouseup":case"dragend":rh=!1,vb(d,a,c);break;case"selectionchange":if(cN)break;case"keydown":case"keyup":vb(d,a,c)}var R;if(Xh)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Ti?YS(e,a)&&(P="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(P="onCompositionStart");P&&(KS&&a.locale!=="ko"&&(Ti||P!=="onCompositionStart"?P==="onCompositionEnd"&&Ti&&(R=XS()):(Dr=c,Gh="value"in Dr?Dr.value:Dr.textContent,Ti=!0)),A=xd(u,P),0<A.length&&(P=new db(P,e,null,a,c),d.push({event:P,listeners:A}),R?P.data=R:(R=ZS(a),R!==null&&(P.data=R)))),(R=eN?tN(e,a):aN(e,a))&&(P=xd(u,"onBeforeInput"),0<P.length&&(A=new db("onBeforeInput","beforeinput",null,a,c),d.push({event:A,listeners:P}),A.data=R)),$N(d,e,u,a,c)}$0(d,t)})}function Ds(e,t,a){return{instance:e,listener:t,currentTarget:a}}function xd(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=Is(e,a),r!=null&&n.unshift(Ds(e,r,o)),r=Is(e,t),r!=null&&n.push(Ds(e,r,o))),e.tag===3)return n;e=e.return}return[]}function KN(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rS(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=Is(a,o),u!=null&&i.unshift(Ds(a,u,s))):r||(u=Is(a,o),u!=null&&i.push(Ds(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var YN=/\r\n?/g,ZN=/\u0000|\uFFFD/g;function oS(e){return(typeof e=="string"?e:""+e).replace(YN,`
|
|
9
|
-
`).replace(ZN,"")}function K0(e,t){return t=oS(t),oS(e)===t}function rt(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||ji(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&ji(e,""+n);break;case"className":Sc(e,"class",n);break;case"tabIndex":Sc(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Sc(e,a,n);break;case"style":GS(e,n,o);break;case"data":if(t!=="object"){Sc(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=Bc(""+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"&&rt(e,t,"name",r.name,r,null),rt(e,t,"formEncType",r.formEncType,r,null),rt(e,t,"formMethod",r.formMethod,r,null),rt(e,t,"formTarget",r.formTarget,r,null)):(rt(e,t,"encType",r.encType,r,null),rt(e,t,"method",r.method,r,null),rt(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Bc(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Zn);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("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=Bc(""+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":De("beforetoggle",e),De("toggle",e),Nc(e,"popover",n);break;case"xlinkActuate":jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":jn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":jn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":jn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":jn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Nc(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=LP.get(a)||a,Nc(e,a,n))}}function Eh(e,t,a,n,r,o){switch(a){case"style":GS(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"?ji(e,n):(typeof n=="number"||typeof n=="bigint")&&ji(e,""+n);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zS.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[La]||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,""):Nc(e,a,n)}}}function Jt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var 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:rt(e,t,o,i,a,null)}}r&&rt(e,t,"srcSet",a.srcSet,a,null),n&&rt(e,t,"src",a.src,a,null);return;case"input":De("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:rt(e,t,n,c,a,null)}}jS(e,o,l,s,u,i,r,!1);return;case"select":De("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:rt(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?Pi(e,!!n,t,!1):a!=null&&Pi(e,!!n,a,!0);return;case"textarea":De("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:rt(e,t,i,l,a,null)}WS(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":rt(e,t,s,n,a,null));return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(n=0;n<Rs.length;n++)De(Rs[n],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:rt(e,t,u,n,a,null)}return;default:if(Vh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Eh(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&rt(e,t,l,n,a,null))}function QN(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)||rt(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&&rt(e,t,f,p,n,d)}}Jm(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)||rt(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&&rt(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?Pi(e,!!a,f,!1):!!n!=!!a&&(t!=null?Pi(e,!!a,t,!0):Pi(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:rt(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&&rt(e,t,i,r,n,o)}VS(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:rt(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":rt(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)&&rt(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:rt(e,t,u,f,n,p)}return;default:if(Vh(t)){for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!==void 0&&!n.hasOwnProperty(S)&&Eh(e,t,S,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||Eh(e,t,c,f,n,p);return}}for(var w in a)f=a[w],a.hasOwnProperty(w)&&f!=null&&!n.hasOwnProperty(w)&&rt(e,t,w,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||rt(e,t,d,f,n,p)}function iS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JN(){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&&iS(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&&iS(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 Mh=null,Ah=null;function vd(e){return e.nodeType===9?e:e.ownerDocument}function lS(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 Y0(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 Rh(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 qm=null;function eB(){var e=window.event;return e&&e.type==="popstate"?e===qm?!1:(qm=e,!0):(qm=null,!1)}var Z0=typeof setTimeout=="function"?setTimeout:void 0,tB=typeof clearTimeout=="function"?clearTimeout:void 0,sS=typeof Promise=="function"?Promise:void 0,aB=typeof queueMicrotask=="function"?queueMicrotask:typeof sS<"u"?function(e){return sS.resolve(null).then(e).catch(nB)}:Z0;function nB(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function uS(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),Zi(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")bs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,bs(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[zs]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&bs(e.ownerDocument.body);a=r}while(a);Zi(t)}function cS(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 Dh(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":Dh(a),jh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function rB(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[zs])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=rn(e.nextSibling),e===null)break}return null}function oB(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=rn(e.nextSibling),e===null))return null;return e}function Q0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rn(e.nextSibling),e===null))return null;return e}function _h(e){return e.data==="$?"||e.data==="$~"}function Oh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function iB(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 rn(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 Ph=null;function dS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return rn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function fS(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 J0(e,t,a){switch(t=vd(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 bs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jh(e)}var on=new Map,pS=new Set;function bd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var lr=Ze.d;Ze.d={f:lB,r:sB,D:uB,C:cB,L:dB,m:fB,X:mB,S:pB,M:hB};function lB(){var e=lr.f(),t=Ud();return e||t}function sB(e){var t=Ji(e);t!==null&&t.tag===5&&t.type==="form"?GI(t):lr.r(e)}var nl=typeof document>"u"?null:document;function eC(e,t,a){var n=nl;if(n&&typeof t=="string"&&t){var r=en(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),pS.has(r)||(pS.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Jt(t,"link",e),Gt(t),n.head.appendChild(t)))}}function uB(e){lr.D(e),eC("dns-prefetch",e,null)}function cB(e,t){lr.C(e,t),eC("preconnect",e,t)}function dB(e,t,a){lr.L(e,t,a);var n=nl;if(n&&e&&t){var r='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+en(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+en(a.imageSizes)+'"]')):r+='[href="'+en(e)+'"]';var o=r;switch(t){case"style":o=Yi(e);break;case"script":o=rl(e)}on.has(o)||(e=pt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),on.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Gs(o))||t==="script"&&n.querySelector($s(o))||(t=n.createElement("link"),Jt(t,"link",e),Gt(t),n.head.appendChild(t)))}}function fB(e,t){lr.m(e,t);var a=nl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+en(n)+'"][href="'+en(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=rl(e)}if(!on.has(o)&&(e=pt({rel:"modulepreload",href:e},t),on.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($s(o)))return}n=a.createElement("link"),Jt(n,"link",e),Gt(n),a.head.appendChild(n)}}}function pB(e,t,a){lr.S(e,t,a);var n=nl;if(n&&e){var r=Oi(n).hoistableStyles,o=Yi(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(Gs(o)))l.loading=5;else{e=pt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=on.get(o))&&Eg(e,a);var s=i=n.createElement("link");Gt(s),Jt(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,$c(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function mB(e,t){lr.X(e,t);var a=nl;if(a&&e){var n=Oi(a).hoistableScripts,r=rl(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=pt({src:e,async:!0},t),(t=on.get(r))&&Mg(e,t),o=a.createElement("script"),Gt(o),Jt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function hB(e,t){lr.M(e,t);var a=nl;if(a&&e){var n=Oi(a).hoistableScripts,r=rl(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=pt({src:e,async:!0,type:"module"},t),(t=on.get(r))&&Mg(e,t),o=a.createElement("script"),Gt(o),Jt(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function mS(e,t,a,n){var r=(r=Nr.current)?bd(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=Yi(a.href),a=Oi(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=Yi(a.href);var o=Oi(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(Gs(e)))&&!o._p&&(i.instance=o,i.state.loading=5),on.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},on.set(e,a),o||gB(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=rl(a),a=Oi(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 Yi(e){return'href="'+en(e)+'"'}function Gs(e){return'link[rel="stylesheet"]['+e+"]"}function tC(e){return pt({},e,{"data-precedence":e.precedence,precedence:null})}function gB(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}),Jt(t,"link",a),Gt(t),e.head.appendChild(t))}function rl(e){return'[src="'+en(e)+'"]'}function $s(e){return"script[async]"+e}function hS(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+en(a.href)+'"]');if(n)return t.instance=n,Gt(n),n;var r=pt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Gt(n),Jt(n,"style",r),$c(n,a.precedence,e),t.instance=n;case"stylesheet":r=Yi(a.href);var o=e.querySelector(Gs(r));if(o)return t.state.loading|=4,t.instance=o,Gt(o),o;n=tC(a),(r=on.get(r))&&Eg(n,r),o=(e.ownerDocument||e).createElement("link"),Gt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Jt(o,"link",n),t.state.loading|=4,$c(o,a.precedence,e),t.instance=o;case"script":return o=rl(a.src),(r=e.querySelector($s(o)))?(t.instance=r,Gt(r),r):(n=a,(r=on.get(o))&&(n=pt({},a),Mg(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),Gt(r),Jt(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,$c(n,a.precedence,e));return t.instance}function $c(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 Eg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Mg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xc=null;function gS(e,t,a){if(Xc===null){var n=new Map,r=Xc=new Map;r.set(a,n)}else r=Xc,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[zs]||o[Yt]||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 wS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function wB(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 aC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yB(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=Yi(n.href),o=t.querySelector(Gs(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Sd.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Gt(o);return}o=t.ownerDocument||t,n=tC(n),(r=on.get(r))&&Eg(n,r),o=o.createElement("link"),Gt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),Jt(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=Sd.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Hm=0;function xB(e,t){return e.stylesheets&&e.count===0&&Kc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Kc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Hm===0&&(Hm=62500*JN());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Hm?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Id=null;function Kc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Id=new Map,t.forEach(vB,e),Id=null,Sd.call(e))}function vB(e,t){if(!(t.state.loading&4)){var a=Id.get(e);if(a)var n=a.get(null);else{a=new Map,Id.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=Sd.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 _s={$$typeof:Yn,Provider:null,Consumer:null,_currentValue:bo,_currentValue2:bo,_threadCount:0};function bB(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=mm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mm(0),this.hiddenUpdates=mm(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 nC(e,t,a,n,r,o,i,l,s,u,c,d){return e=new bB(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Na(3,null,null,t),e.current=o,o.stateNode=e,t=tg(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},rg(o),e}function rC(e){return e?(e=Ai,e):Ai}function oC(e,t,a,n,r,o){r=rC(r),n.context===null?n.context=r:n.pendingContext=r,n=Ur(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Fr(e,n,t),a!==null&&(Ta(a,e,t),ps(a,e,t))}function yS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ag(e,t){yS(e,t),(e=e.alternate)&&yS(e,t)}function iC(e){if(e.tag===13||e.tag===31){var t=Oo(e,67108864);t!==null&&Ta(t,e,67108864),Ag(e,67108864)}}function xS(e){if(e.tag===13||e.tag===31){var t=qa();t=qh(t);var a=Oo(e,t);a!==null&&Ta(a,e,t),Ag(e,t)}}var Cd=!0;function SB(e,t,a,n){var r=se.T;se.T=null;var o=Ze.p;try{Ze.p=2,Rg(e,t,a,n)}finally{Ze.p=o,se.T=r}}function IB(e,t,a,n){var r=se.T;se.T=null;var o=Ze.p;try{Ze.p=8,Rg(e,t,a,n)}finally{Ze.p=o,se.T=r}}function Rg(e,t,a,n){if(Cd){var r=Nh(n);if(r===null)zm(e,t,n,kd,a),vS(e,n);else if(kB(r,e,t,a,n))n.stopPropagation();else if(vS(e,n),t&4&&-1<CB.indexOf(e)){for(;r!==null;){var o=Ji(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=yo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-za(i);l.entanglements[1]|=s,i&=~s}_n(o),(Ye&6)===0&&(md=Ua()+500,Ws(0,!1))}}break;case 31:case 13:l=Oo(o,2),l!==null&&Ta(l,o,2),Ud(),Ag(o,2)}if(o=Nh(n),o===null&&zm(e,t,n,kd,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else zm(e,t,n,null,a)}}function Nh(e){return e=Wh(e),Dg(e)}var kd=null;function Dg(e){if(kd=null,e=Ci(e),e!==null){var t=Ns(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=TS(t),e!==null)return e;e=null}else if(a===31){if(e=LS(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 kd=e,null}function lC(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(dP()){case RS:return 2;case DS:return 8;case ed:case fP:return 32;case _S:return 268435456;default:return 32}default:return 32}}var Bh=!1,Hr=null,jr=null,Vr=null,Os=new Map,Ps=new Map,Ar=[],CB="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 vS(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ps.delete(t.pointerId)}}function as(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=Ji(t),t!==null&&iC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function kB(e,t,a,n,r){switch(t){case"focusin":return Hr=as(Hr,e,t,a,n,r),!0;case"dragenter":return jr=as(jr,e,t,a,n,r),!0;case"mouseover":return Vr=as(Vr,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Os.set(o,as(Os.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Ps.set(o,as(Ps.get(o)||null,e,t,a,n,r)),!0}return!1}function sC(e){var t=Ci(e.target);if(t!==null){var a=Ns(t);if(a!==null){if(t=a.tag,t===13){if(t=TS(a),t!==null){e.blockedOn=t,nb(e.priority,function(){xS(a)});return}}else if(t===31){if(t=LS(a),t!==null){e.blockedOn=t,nb(e.priority,function(){xS(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 Yc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Nh(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);th=n,a.target.dispatchEvent(n),th=null}else return t=Ji(a),t!==null&&iC(t),e.blockedOn=a,!1;t.shift()}return!0}function bS(e,t,a){Yc(e)&&a.delete(t)}function TB(){Bh=!1,Hr!==null&&Yc(Hr)&&(Hr=null),jr!==null&&Yc(jr)&&(jr=null),Vr!==null&&Yc(Vr)&&(Vr=null),Os.forEach(bS),Ps.forEach(bS)}function Oc(e,t){e.blockedOn===t&&(e.blockedOn=null,Bh||(Bh=!0,zt.unstable_scheduleCallback(zt.unstable_NormalPriority,TB)))}var Pc=null;function SS(e){Pc!==e&&(Pc=e,zt.unstable_scheduleCallback(zt.unstable_NormalPriority,function(){Pc===e&&(Pc=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(Dg(n||a)===null)continue;break}var o=Ji(a);o!==null&&(e.splice(t,3),t-=3,wh(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Zi(e){function t(s){return Oc(s,e)}Hr!==null&&Oc(Hr,e),jr!==null&&Oc(jr,e),Vr!==null&&Oc(Vr,e),Os.forEach(t),Ps.forEach(t);for(var a=0;a<Ar.length;a++){var n=Ar[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ar.length&&(a=Ar[0],a.blockedOn===null);)sC(a),a.blockedOn===null&&Ar.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[La]||null;if(typeof o=="function")i||SS(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[La]||null)l=i.formAction;else if(Dg(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),SS(a)}}}function uC(){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 _g(e){this._internalRoot=e}qd.prototype.render=_g.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));var a=t.current,n=qa();oC(a,n,e,t,null,null)};qd.prototype.unmount=_g.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oC(e.current,2,null,e,null,null),Ud(),t[Qi]=null}};function qd(e){this._internalRoot=e}qd.prototype.unstable_scheduleHydration=function(e){if(e){var t=US();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ar.length&&t!==0&&t<Ar[a].priority;a++);Ar.splice(a,0,e),a===0&&sC(e)}};var IS=CS.version;if(IS!=="19.2.4")throw Error(N(527,IS,"19.2.4"));Ze.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=rP(t),e=e!==null?ES(e):null,e=e===null?null:e.stateNode,e};var LB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ns.isDisabled&&ns.supportsFiber))try{Bs=ns.inject(LB),Fa=ns}catch{}var ns;Hd.createRoot=function(e,t){if(!kS(e))throw Error(N(299));var a=!1,n="",r=e0,o=t0,i=a0;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=nC(e,1,!1,null,null,a,n,null,r,o,i,uC),e[Qi]=t.current,Lg(e),new _g(t)};Hd.hydrateRoot=function(e,t,a){if(!kS(e))throw Error(N(299));var n=!1,r="",o=e0,i=t0,l=a0,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=nC(e,1,!0,t,a??null,n,r,s,o,i,l,uC),t.context=rC(null),a=t.current,n=qa(),n=qh(n),r=Ur(n),r.callback=null,Fr(a,r,n),a=n,t.current.lanes=a,Fs(t,a),_n(t),e[Qi]=t.current,Lg(e),new qd(t)};Hd.version="19.2.4"});var Og=na((z7,fC)=>{"use strict";function dC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dC)}catch(e){console.error(e)}}dC(),fC.exports=cC()});var qC=na(Jd=>{"use strict";var $U=Symbol.for("react.transitional.element"),XU=Symbol.for("react.fragment");function zC(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:$U,type:e,key:n,ref:t!==void 0?t:null,props:a}}Jd.Fragment=XU;Jd.jsx=zC;Jd.jsxs=zC});var ae=na((HG,HC)=>{"use strict";HC.exports=qC()});function jC(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=jC(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function tf(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=jC(e))&&(n&&(n+=" "),n+=t);return n}var Xg=k(()=>{"use strict"});function Kg(...e){return e.filter(Boolean).join(" ")}function VC(){return Kg}var Yg=k(()=>{"use strict"});function p3(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Qr(e[a]);return lf(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function m3(e){let t=e;return lf(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function h3(e){return lf(t);function t(a){return a&&a.type===e}}function lf(e){return t;function t(a,n,r){return!!(w3(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function g3(){return!0}function w3(e){return e!==null&&typeof e=="object"&&"type"in e}var Qr,Ek=k(()=>{"use strict";Qr=(function(e){if(e==null)return g3;if(typeof e=="function")return lf(e);if(typeof e=="object")return Array.isArray(e)?p3(e):m3(e);if(typeof e=="string")return h3(e);throw new Error("Expected function, string, or object as test")})});var sf=k(()=>{"use strict";Ek()});function du(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Qr(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=Mk,m,x,S;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=y3(a(s,c)),p[0]===Ho))return p;if("children"in s&&s.children){let w=s;if(w.children&&p[0]!==jo)for(x=(n?w.children.length:-1)+i,S=c.concat(w);x>-1&&x<w.children.length;){let y=w.children[x];if(m=l(y,x,S)(),m[0]===Ho)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function y3(e){return Array.isArray(e)?e:typeof e=="number"?[dr,e]:e==null?Mk:[e]}var Mk,dr,Ho,jo,Ak=k(()=>{"use strict";sf();Mk=[],dr=!0,Ho=!1,jo="skip"});var uf=k(()=>{"use strict";Ak()});function fr(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),du(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 Rk=k(()=>{"use strict";uf();uf()});var cf=k(()=>{"use strict";Rk()});function Ok({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=S3(e,t,a,n,r,o,i);fr(u,c)}}function Dk(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 x3(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function _k(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=Dk(e,a);if(!i||b3.has(i.protocol)||!(v3.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=x3(e);return i&&t.some(u=>{let c=Dk(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 v3,b3,aw,S3,Pk=k(()=>{"use strict";cf();v3=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),b3=new Set(["javascript:","data:","file:","vbscript:"]);aw=Symbol("node-seen"),S3=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[aw])return dr;if(s.tagName==="a"){let d=_k(s.properties.href,t,e,!1,!1,r);return d===null?(s[aw]=!0,fr(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]"}]}),jo):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",dr)}if(s.tagName==="img"){let d=_k(s.properties.src,a,e,n,!0,r);return d===null?(s[aw]=!0,fr(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")+"]"}]}),jo):(s.properties.src=d,dr)}return dr};return l}});function I3(){return e=>e}var Nk,Bk=k(()=>{"use strict";Nk=I3});var Uk,L3,ow,jk=k(()=>{"use strict";Uk=typeof self=="object"?self:globalThis,L3=(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 Uk[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 Uk[o](i),r)};return n},ow=e=>L3(new Map,e)(0)});var gl,E3,M3,fu,ff,A3,iw,Vk=k(()=>{"use strict";gl="",{toString:E3}={},{keys:M3}=Object,fu=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=E3.call(e).slice(8,-1);switch(a){case"Array":return[1,gl];case"Object":return[2,gl];case"Date":return[3,gl];case"RegExp":return[4,gl];case"Map":return[5,gl];case"Set":return[6,gl];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},ff=([e,t])=>e===0&&(t==="function"||t==="symbol"),A3=(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]=fu(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 M3(i))(e||!ff(fu(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||!(ff(fu(f))||ff(fu(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!ff(fu(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},iw=(e,{json:t,lossy:a}={})=>{let n=[];return A3(!(t||a),!!t,new Map,n)(e),n}});var Jr,pf=k(()=>{"use strict";jk();Vk();Jr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ow(iw(e,t)):structuredClone(e):(e,t)=>ow(iw(e,t))});function Wk(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 pu(e){let t=wl(e),a=mf(e);if(t&&a)return{start:t,end:a}}var mf,wl,Gk=k(()=>{"use strict";mf=Wk("end"),wl=Wk("start")});var mu=k(()=>{"use strict";Gk()});var Vo,lw,$k=k(()=>{"use strict";Vo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],lw={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Vo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Vo],h2:[["className","sr-only"]],img:[...Vo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Vo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Vo],table:[...Vo],ul:[...Vo,["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 sw(e,t){let a={type:"root",children:[]},n={schema:t?{...lw,...t}:lw,stack:[]},r=Yk(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function Yk(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return R3(e,a);case"doctype":return D3(e,a);case"element":return _3(e,a);case"root":return O3(e,a);case"text":return P3(e,a);default:}}}function R3(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 hu(o,t),o}}function D3(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return hu(a,t),a}}function _3(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=Zk(e,t.children),r=N3(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&&eo.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 hu(i,t),i}function O3(e,t){let n={type:"root",children:Zk(e,t.children)};return hu(n,t),n}function P3(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return hu(n,t),n}function Zk(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=Yk(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function N3(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&eo.call(n,a)?n[a]:void 0,i=n&&eo.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(eo.call(l,u)){let c=l[u],d=Xk(e,Kk(o,u),u,c);d==null&&(d=Xk(e,Kk(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&eo.call(r,a)){let c=r[a];for(u in c)eo.call(c,u)&&!eo.call(s,u)&&(s[u]=c[u])}return s}function Xk(e,t,a,n){return t?Array.isArray(n)?B3(e,t,a,n):Qk(e,t,a,n):void 0}function B3(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=Qk(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function Qk(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&U3(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 U3(e,t,a){let n=e.schema.protocols&&eo.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 hu(e,t){let a=pu(t);t.data&&(e.data=Jr(t.data)),a&&(e.position=a)}function Kk(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 eo,Jk=k(()=>{"use strict";pf();mu();$k();eo={}.hasOwnProperty});var eT=k(()=>{"use strict";Jk()});function hf(e){return function(t){return sw(t,e)}}var tT=k(()=>{"use strict";eT()});var aT=k(()=>{"use strict";tT()});function uw(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 nT=k(()=>{"use strict"});function Wo(e){return e!==null&&(e<32||e===127)}function X(e){return e!==null&&e<-2}function Ae(e){return e!==null&&(e<0||e===32)}function ie(e){return e===-2||e===-1||e===32}function to(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var qt,Ct,rT,gu,oT,iT,Go,Nn,ze=k(()=>{"use strict";qt=to(/[A-Za-z]/),Ct=to(/[\dA-Za-z]/),rT=to(/[#-'*+\--9=?A-Z^-~]/);gu=to(/\d/),oT=to(/[\dA-Fa-f]/),iT=to(/[!-/:-@[-`{-~]/);Go=to(/\p{P}|\p{S}/u),Nn=to(/\s/)});function cw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var lT=k(()=>{"use strict"});function dw(e,t,a){let r=Qr((a||{}).ignore||[]),o=F3(t),i=-1;for(;++i<o.length;)du(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,S=d.children.indexOf(u),w=!1,y=[];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]},C=p(...g,T);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=b+1:(m!==b&&y.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(C)?y.push(...C):C&&y.push(C),m=b+g[0].length,w=!0),!f.global)break;g=f.exec(u.value)}return w?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),d.children.splice(S,1,...y)):y=[u],S+y.length}}function F3(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([z3(r[0]),q3(r[1])])}return t}function z3(e){return typeof e=="string"?new RegExp(cw(e),"g"):e}function q3(e){return typeof e=="function"?e:function(){return e}}var sT=k(()=>{"use strict";lT();uf();sf()});var uT=k(()=>{"use strict";sT()});function hw(){return{transforms:[$3],enter:{literalAutolink:H3,literalAutolinkEmail:mw,literalAutolinkHttp:mw,literalAutolinkWww:mw},exit:{literalAutolink:G3,literalAutolinkEmail:W3,literalAutolinkHttp:j3,literalAutolinkWww:V3}}}function gw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fw,notInConstruct:pw},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fw,notInConstruct:pw},{character:":",before:"[ps]",after:"\\/",inConstruct:fw,notInConstruct:pw}]}}function H3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mw(e){this.config.enter.autolinkProtocol.call(this,e)}function j3(e){this.config.exit.autolinkProtocol.call(this,e)}function V3(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 W3(e){this.config.exit.autolinkEmail.call(this,e)}function G3(e){this.exit(e)}function $3(e){dw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,X3],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,K3]],{ignore:["link","linkReference"]})}function X3(e,t,a,n,r){let o="";if(!cT(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!Y3(a)))return!1;let i=Z3(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 K3(e,t,a,n){return!cT(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function Y3(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 Z3(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=uw(e,"("),o=uw(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 cT(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Nn(a)||Go(a))&&(!t||a!==47)}var fw,pw,dT=k(()=>{"use strict";nT();ze();uT();fw="phrasing",pw=["autolink","link","image","label"]});var fT=k(()=>{"use strict";dT()});function oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var yl=k(()=>{"use strict"});function Q3(){this.buffer()}function J3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eF(){this.buffer()}function tF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=oa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function nF(e){this.exit(e)}function rF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=oa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function oF(e){this.exit(e)}function iF(){return"["}function pT(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 ww(){return{enter:{gfmFootnoteCallString:Q3,gfmFootnoteCall:J3,gfmFootnoteDefinitionLabelString:eF,gfmFootnoteDefinition:tF},exit:{gfmFootnoteCallString:aF,gfmFootnoteCall:nF,gfmFootnoteDefinitionLabelString:rF,gfmFootnoteDefinition:oF}}}function yw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:pT},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 Zm=Object.prototype.hasOwnProperty,qh=Ht.unstable_scheduleCallback,mm=Ht.unstable_cancelCallback,hP=Ht.unstable_shouldYield,gP=Ht.unstable_requestPaint,Ua=Ht.unstable_now,wP=Ht.unstable_getCurrentPriorityLevel,RS=Ht.unstable_ImmediatePriority,DS=Ht.unstable_UserBlockingPriority,td=Ht.unstable_NormalPriority,yP=Ht.unstable_LowPriority,_S=Ht.unstable_IdlePriority,xP=Ht.log,vP=Ht.unstable_setDisableYieldValue,Bs=null,Fa=null;function Rr(e){if(typeof xP=="function"&&vP(e),Fa&&typeof Fa.setStrictMode=="function")try{Fa.setStrictMode(Bs,e)}catch{}}var za=Math.clz32?Math.clz32:IP,bP=Math.log,SP=Math.LN2;function IP(e){return e>>>=0,e===0?32:31-(bP(e)/SP|0)|0}var vc=256,bc=262144,Sc=4194304;function yo(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 Ld(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=yo(n):(i&=l,i!==0?r=yo(i):a||(a=l&~e,a!==0&&(r=yo(a))))):(l=n&~o,l!==0?r=yo(l):i!==0?r=yo(i):a||(a=n&~e,a!==0&&(r=yo(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 Us(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function CP(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 OS(){var e=Sc;return Sc<<=1,(Sc&62914560)===0&&(Sc=4194304),e}function hm(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Fs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function kP(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-za(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&&PS(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function PS(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-za(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function NS(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-za(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function BS(e,t){var a=t&-t;return a=(a&42)!==0?1:Hh(a),(a&(e.suspendedLanes|t))!==0?0:a}function Hh(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 jh(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function US(){var e=Qe.p;return e!==0?e:(e=window.event,e===void 0?32:lC(e.type))}function nb(e,t){var a=Qe.p;try{return Qe.p=e,t()}finally{Qe.p=a}}var Kr=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Kr,La="__reactProps$"+Kr,Qi="__reactContainer$"+Kr,Qm="__reactEvents$"+Kr,TP="__reactListeners$"+Kr,LP="__reactHandles$"+Kr,rb="__reactResources$"+Kr,zs="__reactMarker$"+Kr;function Vh(e){delete e[Zt],delete e[La],delete e[Qm],delete e[TP],delete e[LP]}function Ci(e){var t=e[Zt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Qi]||a[Zt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=fS(e);e!==null;){if(a=e[Zt])return a;e=fS(e)}return t}e=a,a=e.parentNode}return null}function Ji(e){if(e=e[Zt]||e[Qi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function is(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Oi(e){var t=e[rb];return t||(t=e[rb]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $t(e){e[zs]=!0}var FS=new Set,zS={};function Ro(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(zS[e]=t,e=0;e<t.length;e++)FS.add(t[e])}var EP=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]*$"),ob={},ib={};function MP(e){return Zm.call(ib,e)?!0:Zm.call(ob,e)?!1:EP.test(e)?ib[e]=!0:(ob[e]=!0,!1)}function Bc(e,t,a){if(MP(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 Ic(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 Vn(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 Za(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function AP(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 Jm(e){if(!e._valueTracker){var t=qS(e)?"checked":"value";e._valueTracker=AP(e,t,""+e[t])}}function HS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=qS(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ad(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 RP=/[\n"\\]/g;function en(e){return e.replace(RP,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function eh(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=""+Za(t)):e.value!==""+Za(t)&&(e.value=""+Za(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?th(e,i,Za(t)):a!=null?th(e,i,Za(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=""+Za(l):e.removeAttribute("name")}function jS(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)){Jm(e);return}a=a!=null?""+Za(a):"",t=t!=null?""+Za(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),Jm(e)}function th(e,t,a){t==="number"&&ad(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Pi(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=""+Za(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 VS(e,t,a){if(t!=null&&(t=""+Za(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Za(a):""}function WS(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(B(92));if(os(n)){if(1<n.length)throw Error(B(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Za(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Jm(e)}function ji(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var DP=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 lb(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||DP.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function GS(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(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&&lb(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&lb(e,o,t[o])}function Wh(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 _P=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"]]),OP=/^[\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 Uc(e){return OP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qn(){}var ah=null;function Gh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ki=null,Ni=null;function sb(e){var t=Ji(e);if(t&&(e=t.stateNode)){var a=e[La]||null;e:switch(e=t.stateNode,t.type){case"input":if(eh(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="'+en(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[La]||null;if(!r)throw Error(B(90));eh(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&&HS(n)}break e;case"textarea":VS(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Pi(e,!!a.multiple,t,!1)}}}var gm=!1;function $S(e,t,a){if(gm)return e(t,a);gm=!0;try{var n=e(t);return n}finally{if(gm=!1,(ki!==null||Ni!==null)&&(Fd(),ki&&(t=ki,e=Ni,Ni=ki=null,sb(t),e)))for(t=0;t<e.length;t++)sb(e[t])}}function Is(e,t){var a=e.stateNode;if(a===null)return null;var n=a[La]||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(B(231,t,typeof a));return a}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nh=!1;if(nr)try{wi={},Object.defineProperty(wi,"passive",{get:function(){nh=!0}}),window.addEventListener("test",wi,wi),window.removeEventListener("test",wi,wi)}catch{nh=!1}var wi,Dr=null,$h=null,Fc=null;function XS(){if(Fc)return Fc;var e,t=$h,a=t.length,n,r="value"in Dr?Dr.value:Dr.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 Fc=r.slice(e,1<n?1-n:void 0)}function zc(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 Cc(){return!0}function ub(){return!1}function Ea(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)?Cc:ub,this.isPropagationStopped=ub,this}return pt(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=Cc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cc)},persist:function(){},isPersistent:Cc}),t}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=Ea(Do),qs=pt({},Do,{view:0,detail:0}),PP=Ea(qs),wm,ym,Ql,Md=pt({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xh,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!==Ql&&(Ql&&e.type==="mousemove"?(wm=e.screenX-Ql.screenX,ym=e.screenY-Ql.screenY):ym=wm=0,Ql=e),wm)},movementY:function(e){return"movementY"in e?e.movementY:ym}}),cb=Ea(Md),NP=pt({},Md,{dataTransfer:0}),BP=Ea(NP),UP=pt({},qs,{relatedTarget:0}),xm=Ea(UP),FP=pt({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),zP=Ea(FP),qP=pt({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),HP=Ea(qP),jP=pt({},Do,{data:0}),db=Ea(jP),VP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WP={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"},GP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $P(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=GP[e])?!!t[e]:!1}function Xh(){return $P}var XP=pt({},qs,{key:function(e){if(e.key){var t=VP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?WP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xh,charCode:function(e){return e.type==="keypress"?zc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),KP=Ea(XP),YP=pt({},Md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fb=Ea(YP),ZP=pt({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xh}),QP=Ea(ZP),JP=pt({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),eN=Ea(JP),tN=pt({},Md,{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}),aN=Ea(tN),nN=pt({},Do,{newState:0,oldState:0}),rN=Ea(nN),oN=[9,13,27,32],Kh=nr&&"CompositionEvent"in window,us=null;nr&&"documentMode"in document&&(us=document.documentMode);var iN=nr&&"TextEvent"in window&&!us,KS=nr&&(!Kh||us&&8<us&&11>=us),pb=" ",mb=!1;function YS(e,t){switch(e){case"keyup":return oN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ti=!1;function lN(e,t){switch(e){case"compositionend":return ZS(t);case"keypress":return t.which!==32?null:(mb=!0,pb);case"textInput":return e=t.data,e===pb&&mb?null:e;default:return null}}function sN(e,t){if(Ti)return e==="compositionend"||!Kh&&YS(e,t)?(e=XS(),Fc=$h=Dr=null,Ti=!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 KS&&t.locale!=="ko"?null:t.data;default:return null}}var uN={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 hb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uN[e.type]:t==="textarea"}function QS(e,t,a,n){ki?Ni?Ni.push(n):Ni=[n]:ki=n,t=vd(t,"onChange"),0<t.length&&(a=new Ed("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var cs=null,Cs=null;function cN(e){$0(e,0)}function Ad(e){var t=is(e);if(HS(t))return e}function gb(e,t){if(e==="change")return t}var JS=!1;nr&&(nr?(Tc="oninput"in document,Tc||(vm=document.createElement("div"),vm.setAttribute("oninput","return;"),Tc=typeof vm.oninput=="function"),kc=Tc):kc=!1,JS=kc&&(!document.documentMode||9<document.documentMode));var kc,Tc,vm;function wb(){cs&&(cs.detachEvent("onpropertychange",eI),Cs=cs=null)}function eI(e){if(e.propertyName==="value"&&Ad(Cs)){var t=[];QS(t,Cs,e,Gh(e)),$S(cN,t)}}function dN(e,t,a){e==="focusin"?(wb(),cs=t,Cs=a,cs.attachEvent("onpropertychange",eI)):e==="focusout"&&wb()}function fN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ad(Cs)}function pN(e,t){if(e==="click")return Ad(t)}function mN(e,t){if(e==="input"||e==="change")return Ad(t)}function hN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ha=typeof Object.is=="function"?Object.is:hN;function ks(e,t){if(Ha(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(!Zm.call(t,r)||!Ha(e[r],t[r]))return!1}return!0}function yb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xb(e,t){var a=yb(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=yb(a)}}function tI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aI(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ad(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=ad(e.document)}return t}function Yh(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 gN=nr&&"documentMode"in document&&11>=document.documentMode,Li=null,rh=null,ds=null,oh=!1;function vb(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;oh||Li==null||Li!==ad(n)||(n=Li,"selectionStart"in n&&Yh(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}),ds&&ks(ds,n)||(ds=n,n=vd(rh,"onSelect"),0<n.length&&(t=new Ed("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Li)))}function go(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ei={animationend:go("Animation","AnimationEnd"),animationiteration:go("Animation","AnimationIteration"),animationstart:go("Animation","AnimationStart"),transitionrun:go("Transition","TransitionRun"),transitionstart:go("Transition","TransitionStart"),transitioncancel:go("Transition","TransitionCancel"),transitionend:go("Transition","TransitionEnd")},bm={},nI={};nr&&(nI=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function _o(e){if(bm[e])return bm[e];if(!Ei[e])return e;var t=Ei[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in nI)return bm[e]=t[a];return e}var rI=_o("animationend"),oI=_o("animationiteration"),iI=_o("animationstart"),wN=_o("transitionrun"),yN=_o("transitionstart"),xN=_o("transitioncancel"),lI=_o("transitionend"),sI=new Map,ih="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(" ");ih.push("scrollEnd");function yn(e,t){sI.set(e,t),Ro(t,[e])}var nd=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)},Ya=[],Mi=0,Zh=0;function Rd(){for(var e=Mi,t=Zh=Mi=0;t<e;){var a=Ya[t];Ya[t++]=null;var n=Ya[t];Ya[t++]=null;var r=Ya[t];Ya[t++]=null;var o=Ya[t];if(Ya[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&&uI(a,r,o)}}function Dd(e,t,a,n){Ya[Mi++]=e,Ya[Mi++]=t,Ya[Mi++]=a,Ya[Mi++]=n,Zh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Qh(e,t,a,n){return Dd(e,t,a,n),rd(e)}function Oo(e,t){return Dd(e,null,null,t),rd(e)}function uI(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-za(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function rd(e){if(50<vs)throw vs=0,Lh=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function vN(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 Na(e,t,a,n){return new vN(e,t,a,n)}function Jh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function er(e,t){var a=e.alternate;return a===null?(a=Na(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 cI(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 qc(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")Jh(e)&&(i=1);else if(typeof e=="string")i=IB(e,a,Rn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $m:return e=Na(31,a,t,r),e.elementType=$m,e.lanes=o,e;case Si:return So(a.children,r,o,t);case MS:i=8,r|=24;break;case Vm:return e=Na(12,a,t,r|2),e.elementType=Vm,e.lanes=o,e;case Wm:return e=Na(13,a,t,r),e.elementType=Wm,e.lanes=o,e;case Gm:return e=Na(19,a,t,r),e.elementType=Gm,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zn:i=10;break e;case AS:i=9;break e;case Fh:i=11;break e;case zh:i=14;break e;case kr:i=16,n=null;break e}i=29,a=Error(B(130,e===null?"null":typeof e,"")),n=null}return t=Na(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function So(e,t,a,n){return e=Na(7,e,n,t),e.lanes=a,e}function Sm(e,t,a){return e=Na(6,e,null,t),e.lanes=a,e}function dI(e){var t=Na(18,null,null,0);return t.stateNode=e,t}function Im(e,t,a){return t=Na(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bb=new WeakMap;function tn(e,t){if(typeof e=="object"&&e!==null){var a=bb.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ab(t)},bb.set(e,t),t)}return{value:e,source:t,stack:ab(t)}}var Ri=[],Di=0,od=null,Ts=0,Qa=[],Ja=0,Wr=null,En=1,Mn="";function Kn(e,t){Ri[Di++]=Ts,Ri[Di++]=od,od=e,Ts=t}function fI(e,t,a){Qa[Ja++]=En,Qa[Ja++]=Mn,Qa[Ja++]=Wr,Wr=e;var n=En;e=Mn;var r=32-za(n)-1;n&=~(1<<r),a+=1;var o=32-za(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,En=1<<32-za(t)+r|a<<r|n,Mn=o+e}else En=1<<o|a<<r|n,Mn=e}function eg(e){e.return!==null&&(Kn(e,1),fI(e,1,0))}function tg(e){for(;e===od;)od=Ri[--Di],Ri[Di]=null,Ts=Ri[--Di],Ri[Di]=null;for(;e===Wr;)Wr=Qa[--Ja],Qa[Ja]=null,Mn=Qa[--Ja],Qa[Ja]=null,En=Qa[--Ja],Qa[Ja]=null}function pI(e,t){Qa[Ja++]=En,Qa[Ja++]=Mn,Qa[Ja++]=Wr,En=t.id,Mn=t.overflow,Wr=e}var Qt=null,ft=null,Fe=!1,Br=null,an=!1,lh=Error(B(519));function Gr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(tn(t,e)),lh}function Sb(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Zt]=e,t[La]=n,a){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(a=0;a<Rs.length;a++)De(Rs[a],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),jS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),WS(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||K0(t.textContent,a)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=Qn),t=!0):t=!1,t||Gr(e,!0)}function Ib(e){for(Qt=e.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:an=!1;return;case 27:case 3:an=!0;return;default:Qt=Qt.return}}function yi(e){if(e!==Qt)return!1;if(!Fe)return Ib(e),Fe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Dh(e.type,e.memoizedProps)),a=!a),a&&ft&&Gr(e),Ib(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));ft=dS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));ft=dS(e)}else t===27?(t=ft,Yr(e.type)?(e=Nh,Nh=null,ft=e):ft=t):ft=Qt?rn(e.stateNode.nextSibling):null;return!0}function To(){ft=Qt=null,Fe=!1}function Cm(){var e=Br;return e!==null&&(ka===null?ka=e:ka.push.apply(ka,e),Br=null),e}function Ls(e){Br===null?Br=[e]:Br.push(e)}var sh=Dn(null),Po=null,Jn=null;function Lr(e,t,a){ut(sh,t._currentValue),t._currentValue=a}function tr(e){e._currentValue=sh.current,Xt(sh)}function uh(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 ch(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),uh(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(B(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),uh(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 el(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(B(387));if(i=i.memoizedProps,i!==null){var l=r.type;Ha(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===Qc.current){if(i=r.alternate,i===null)throw Error(B(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}r=r.return}e!==null&&ch(t,e,a,n),t.flags|=262144}function id(e){for(e=e.firstContext;e!==null;){if(!Ha(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Lo(e){Po=e,Jn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return mI(Po,e)}function Lc(e,t){return Po===null&&Lo(e),mI(e,t)}function mI(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Jn===null){if(e===null)throw Error(B(308));Jn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jn=Jn.next=t;return a}var bN=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()})}},SN=Ht.unstable_scheduleCallback,IN=Ht.unstable_NormalPriority,Ft={$$typeof:Zn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ag(){return{controller:new bN,data:new Map,refCount:0}}function Hs(e){e.refCount--,e.refCount===0&&SN(IN,function(){e.controller.abort()})}var fs=null,dh=0,Vi=0,Bi=null;function CN(e,t){if(fs===null){var a=fs=[];dh=0,Vi=Lg(),Bi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return dh++,t.then(Cb,Cb),t}function Cb(){if(--dh===0&&fs!==null){Bi!==null&&(Bi.status="fulfilled");var e=fs;fs=null,Vi=0,Bi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kN(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 kb=de.S;de.S=function(e,t){E0=Ua(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&CN(e,t),kb!==null&&kb(e,t)};var Io=Dn(null);function ng(){var e=Io.current;return e!==null?e:st.pooledCache}function Hc(e,t){t===null?ut(Io,Io.current):ut(Io,t.pool)}function hI(){var e=ng();return e===null?null:{parent:Ft._currentValue,pool:e}}var tl=Error(B(460)),rg=Error(B(474)),_d=Error(B(542)),ld={then:function(){}};function Tb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gI(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Qn,Qn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Eb(e),e;default:if(typeof t.status=="string")t.then(Qn,Qn);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(B(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,Eb(e),e}throw Co=t,tl}}function xo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Co=a,tl):a}}var Co=null;function Lb(){if(Co===null)throw Error(B(459));var e=Co;return Co=null,e}function Eb(e){if(e===tl||e===_d)throw Error(B(483))}var Ui=null,Es=0;function Ec(e){var t=Es;return Es+=1,Ui===null&&(Ui=[]),gI(Ui,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mc(e,t){throw t.$$typeof===dP?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wI(e){function t(w,y){if(e){var g=w.deletions;g===null?(w.deletions=[y],w.flags|=16):g.push(y)}}function a(w,y){if(!e)return null;for(;y!==null;)t(w,y),y=y.sibling;return null}function n(w){for(var y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function r(w,y){return w=er(w,y),w.index=0,w.sibling=null,w}function o(w,y,g){return w.index=g,e?(g=w.alternate,g!==null?(g=g.index,g<y?(w.flags|=67108866,y):g):(w.flags|=67108866,y)):(w.flags|=1048576,y)}function i(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function l(w,y,g,b){return y===null||y.tag!==6?(y=Sm(g,w.mode,b),y.return=w,y):(y=r(y,g),y.return=w,y)}function s(w,y,g,b){var T=g.type;return T===Si?c(w,y,g.props.children,b,g.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&xo(T)===y.type)?(y=r(y,g.props),Jl(y,g),y.return=w,y):(y=qc(g.type,g.key,g.props,null,w.mode,b),Jl(y,g),y.return=w,y)}function u(w,y,g,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Im(g,w.mode,b),y.return=w,y):(y=r(y,g.children||[]),y.return=w,y)}function c(w,y,g,b,T){return y===null||y.tag!==7?(y=So(g,w.mode,b,T),y.return=w,y):(y=r(y,g),y.return=w,y)}function d(w,y,g){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Sm(""+y,w.mode,g),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xc:return g=qc(y.type,y.key,y.props,null,w.mode,g),Jl(g,y),g.return=w,g;case rs:return y=Im(y,w.mode,g),y.return=w,y;case kr:return y=xo(y),d(w,y,g)}if(os(y)||Zl(y))return y=So(y,w.mode,g,null),y.return=w,y;if(typeof y.then=="function")return d(w,Ec(y),g);if(y.$$typeof===Zn)return d(w,Lc(w,y),g);Mc(w,y)}return null}function f(w,y,g,b){var T=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return T!==null?null:l(w,y,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case xc:return g.key===T?s(w,y,g,b):null;case rs:return g.key===T?u(w,y,g,b):null;case kr:return g=xo(g),f(w,y,g,b)}if(os(g)||Zl(g))return T!==null?null:c(w,y,g,b,null);if(typeof g.then=="function")return f(w,y,Ec(g),b);if(g.$$typeof===Zn)return f(w,y,Lc(w,g),b);Mc(w,g)}return null}function p(w,y,g,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w=w.get(g)||null,l(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case xc:return w=w.get(b.key===null?g:b.key)||null,s(y,w,b,T);case rs:return w=w.get(b.key===null?g:b.key)||null,u(y,w,b,T);case kr:return b=xo(b),p(w,y,g,b,T)}if(os(b)||Zl(b))return w=w.get(g)||null,c(y,w,b,T,null);if(typeof b.then=="function")return p(w,y,g,Ec(b),T);if(b.$$typeof===Zn)return p(w,y,g,Lc(y,b),T);Mc(y,b)}return null}function m(w,y,g,b){for(var T=null,C=null,M=y,R=y=0,P=null;M!==null&&R<g.length;R++){M.index>R?(P=M,M=null):P=M.sibling;var L=f(w,M,g[R],b);if(L===null){M===null&&(M=P);break}e&&M&&L.alternate===null&&t(w,M),y=o(L,y,R),C===null?T=L:C.sibling=L,C=L,M=P}if(R===g.length)return a(w,M),Fe&&Kn(w,R),T;if(M===null){for(;R<g.length;R++)M=d(w,g[R],b),M!==null&&(y=o(M,y,R),C===null?T=M:C.sibling=M,C=M);return Fe&&Kn(w,R),T}for(M=n(M);R<g.length;R++)P=p(M,w,R,g[R],b),P!==null&&(e&&P.alternate!==null&&M.delete(P.key===null?R:P.key),y=o(P,y,R),C===null?T=P:C.sibling=P,C=P);return e&&M.forEach(function($){return t(w,$)}),Fe&&Kn(w,R),T}function x(w,y,g,b){if(g==null)throw Error(B(151));for(var T=null,C=null,M=y,R=y=0,P=null,L=g.next();M!==null&&!L.done;R++,L=g.next()){M.index>R?(P=M,M=null):P=M.sibling;var $=f(w,M,L.value,b);if($===null){M===null&&(M=P);break}e&&M&&$.alternate===null&&t(w,M),y=o($,y,R),C===null?T=$:C.sibling=$,C=$,M=P}if(L.done)return a(w,M),Fe&&Kn(w,R),T;if(M===null){for(;!L.done;R++,L=g.next())L=d(w,L.value,b),L!==null&&(y=o(L,y,R),C===null?T=L:C.sibling=L,C=L);return Fe&&Kn(w,R),T}for(M=n(M);!L.done;R++,L=g.next())L=p(M,w,R,L.value,b),L!==null&&(e&&L.alternate!==null&&M.delete(L.key===null?R:L.key),y=o(L,y,R),C===null?T=L:C.sibling=L,C=L);return e&&M.forEach(function(H){return t(w,H)}),Fe&&Kn(w,R),T}function S(w,y,g,b){if(typeof g=="object"&&g!==null&&g.type===Si&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case xc:e:{for(var T=g.key;y!==null;){if(y.key===T){if(T=g.type,T===Si){if(y.tag===7){a(w,y.sibling),b=r(y,g.props.children),b.return=w,w=b;break e}}else if(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&xo(T)===y.type){a(w,y.sibling),b=r(y,g.props),Jl(b,g),b.return=w,w=b;break e}a(w,y);break}else t(w,y);y=y.sibling}g.type===Si?(b=So(g.props.children,w.mode,b,g.key),b.return=w,w=b):(b=qc(g.type,g.key,g.props,null,w.mode,b),Jl(b,g),b.return=w,w=b)}return i(w);case rs:e:{for(T=g.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){a(w,y.sibling),b=r(y,g.children||[]),b.return=w,w=b;break e}else{a(w,y);break}else t(w,y);y=y.sibling}b=Im(g,w.mode,b),b.return=w,w=b}return i(w);case kr:return g=xo(g),S(w,y,g,b)}if(os(g))return m(w,y,g,b);if(Zl(g)){if(T=Zl(g),typeof T!="function")throw Error(B(150));return g=T.call(g),x(w,y,g,b)}if(typeof g.then=="function")return S(w,y,Ec(g),b);if(g.$$typeof===Zn)return S(w,y,Lc(w,g),b);Mc(w,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,y!==null&&y.tag===6?(a(w,y.sibling),b=r(y,g),b.return=w,w=b):(a(w,y),b=Sm(g,w.mode,b),b.return=w,w=b),i(w)):a(w,y)}return function(w,y,g,b){try{Es=0;var T=S(w,y,g,b);return Ui=null,T}catch(M){if(M===tl||M===_d)throw M;var C=Na(29,M,null,w.mode);return C.lanes=b,C.return=w,C}}}var Eo=wI(!0),yI=wI(!1),Tr=!1;function og(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fh(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 Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ze&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=rd(e),uI(e,null,a),t}return Dd(e,n,t,a),rd(e)}function ps(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,NS(e,a)}}function km(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 ph=!1;function ms(){if(ph){var e=Bi;if(e!==null)throw e}}function hs(e,t,a,n){ph=!1;var r=e.updateQueue;Tr=!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?(Pe&f)===f:(n&f)===f){f!==0&&f===Vi&&(ph=!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 S=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(S,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(S,d,f):m,f==null)break e;d=pt({},d,f);break e;case 2:Tr=!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),Xr|=i,e.lanes=i,e.memoizedState=d}}function xI(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function vI(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)xI(a[e],t)}var Wi=Dn(null),sd=Dn(0);function Mb(e,t){e=lr,ut(sd,e),ut(Wi,t),lr=e|t.baseLanes}function mh(){ut(sd,lr),ut(Wi,Wi.current)}function ig(){lr=sd.current,Xt(Wi),Xt(sd)}var ja=Dn(null),nn=null;function Er(e){var t=e.alternate;ut(At,At.current&1),ut(ja,e),nn===null&&(t===null||Wi.current!==null||t.memoizedState!==null)&&(nn=e)}function hh(e){ut(At,At.current),ut(ja,e),nn===null&&(nn=e)}function bI(e){e.tag===22?(ut(At,At.current),ut(ja,e),nn===null&&(nn=e)):Mr(e)}function Mr(){ut(At,At.current),ut(ja,ja.current)}function Pa(e){Xt(ja),nn===e&&(nn=null),Xt(At)}var At=Dn(0);function ud(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Oh(a)||Ph(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 rr=0,Se=null,it=null,Bt=null,cd=!1,Fi=!1,Mo=!1,dd=0,Ms=0,zi=null,TN=0;function St(){throw Error(B(321))}function lg(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ha(e[a],t[a]))return!1;return!0}function sg(e,t,a,n,r,o){return rr=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?QI:xg,Mo=!1,o=a(n,r),Mo=!1,Fi&&(o=II(t,a,n,r)),SI(e),o}function SI(e){de.H=As;var t=it!==null&&it.next!==null;if(rr=0,Bt=it=Se=null,cd=!1,Ms=0,zi=null,t)throw Error(B(300));e===null||zt||(e=e.dependencies,e!==null&&id(e)&&(zt=!0))}function II(e,t,a,n){Se=e;var r=0;do{if(Fi&&(zi=null),Ms=0,Fi=!1,25<=r)throw Error(B(301));if(r+=1,Bt=it=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}de.H=JI,o=t(a,n)}while(Fi);return o}function LN(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?js(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Se.flags|=1024),t}function ug(){var e=dd!==0;return dd=0,e}function cg(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function dg(e){if(cd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cd=!1}rr=0,Bt=it=Se=null,Fi=!1,Ms=dd=0,zi=null}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Se.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Rt(){if(it===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Bt===null?Se.memoizedState:Bt.next;if(t!==null)Bt=t,it=e;else{if(e===null)throw Se.alternate===null?Error(B(467)):Error(B(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Bt===null?Se.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function js(e){var t=Ms;return Ms+=1,zi===null&&(zi=[]),e=gI(zi,e,t),t=Se,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?QI:xg),e}function Pd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return js(e);if(e.$$typeof===Zn)return Jt(e)}throw Error(B(438,String(e)))}function fg(e){var t=null,a=Se.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Se.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=Od(),Se.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]=fP;return t.index++,a}function or(e,t){return typeof t=="function"?t(e):t}function jc(e){var t=Rt();return pg(t,it,e)}function pg(e,t,a){var n=e.queue;if(n===null)throw Error(B(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?(Pe&d)===d:(rr&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===Vi&&(c=!0);else if((rr&f)===f){u=u.next,f===Vi&&(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,Se.lanes|=f,Xr|=f;d=u.action,Mo&&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,Se.lanes|=d,Xr|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!Ha(o,e.memoizedState)&&(zt=!0,c&&(a=Bi,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 Tm(e){var t=Rt(),a=t.queue;if(a===null)throw Error(B(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);Ha(o,t.memoizedState)||(zt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function CI(e,t,a){var n=Se,r=Rt(),o=Fe;if(o){if(a===void 0)throw Error(B(407));a=a()}else a=t();var i=!Ha((it||r).memoizedState,a);if(i&&(r.memoizedState=a,zt=!0),r=r.queue,mg(LI.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Bt!==null&&Bt.memoizedState.tag&1){if(n.flags|=2048,Gi(9,{destroy:void 0},TI.bind(null,n,r,a,t),null),st===null)throw Error(B(349));o||(rr&127)!==0||kI(n,t,a)}return a}function kI(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Se.updateQueue,t===null?(t=Od(),Se.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function TI(e,t,a,n){t.value=a,t.getSnapshot=n,EI(t)&&MI(e)}function LI(e,t,a){return a(function(){EI(t)&&MI(e)})}function EI(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ha(e,a)}catch{return!0}}function MI(e){var t=Oo(e,2);t!==null&&Ta(t,e,2)}function gh(e){var t=pa();if(typeof e=="function"){var a=e;if(e=a(),Mo){Rr(!0);try{a()}finally{Rr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:e},t}function AI(e,t,a,n){return e.baseState=a,pg(e,it,typeof n=="function"?n:or)}function EN(e,t,a,n,r){if(Bd(e))throw Error(B(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)}};de.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,RI(t,o)):(o.next=a.next,t.pending=a.next=o)}}function RI(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=de.T,i={};de.T=i;try{var l=a(r,n),s=de.S;s!==null&&s(i,l),Ab(e,t,l)}catch(u){wh(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),de.T=o}}else try{o=a(r,n),Ab(e,t,o)}catch(u){wh(e,t,u)}}function Ab(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Rb(e,t,n)},function(n){return wh(e,t,n)}):Rb(e,t,a)}function Rb(e,t,a){t.status="fulfilled",t.value=a,DI(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,RI(e,a)))}function wh(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,DI(t),t=t.next;while(t!==n)}e.action=null}function DI(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _I(e,t){return t}function Db(e,t){if(Fe){var a=st.formState;if(a!==null){e:{var n=Se;if(Fe){if(ft){t:{for(var r=ft,o=an;r.nodeType!==8;){if(!o){r=null;break t}if(r=rn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){ft=rn(r.nextSibling),n=r.data==="F!";break e}}Gr(n)}n=!1}n&&(t=a[0])}}return a=pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_I,lastRenderedState:t},a.queue=n,a=KI.bind(null,Se,n),n.dispatch=a,n=gh(!1),o=yg.bind(null,Se,!1,n.queue),n=pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=EN.bind(null,Se,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function _b(e){var t=Rt();return OI(t,it,e)}function OI(e,t,a){if(t=pg(e,t,_I)[0],e=jc(or)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=js(t)}catch(i){throw i===tl?_d:i}else n=t;t=Rt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Se.flags|=2048,Gi(9,{destroy:void 0},MN.bind(null,r,a),null)),[n,o,e]}function MN(e,t){e.action=t}function Ob(e){var t=Rt(),a=it;if(a!==null)return OI(t,a,e);Rt(),t=t.memoizedState,a=Rt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Gi(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Se.updateQueue,t===null&&(t=Od(),Se.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 PI(){return Rt().memoizedState}function Vc(e,t,a,n){var r=pa();Se.flags|=e,r.memoizedState=Gi(1|t,{destroy:void 0},a,n===void 0?null:n)}function Nd(e,t,a,n){var r=Rt();n=n===void 0?null:n;var o=r.memoizedState.inst;it!==null&&n!==null&&lg(n,it.memoizedState.deps)?r.memoizedState=Gi(t,o,a,n):(Se.flags|=e,r.memoizedState=Gi(1|t,o,a,n))}function Pb(e,t){Vc(8390656,8,e,t)}function mg(e,t){Nd(2048,8,e,t)}function AN(e){Se.flags|=4;var t=Se.updateQueue;if(t===null)t=Od(),Se.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function NI(e){var t=Rt().memoizedState;return AN({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function BI(e,t){return Nd(4,2,e,t)}function UI(e,t){return Nd(4,4,e,t)}function FI(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 zI(e,t,a){a=a!=null?a.concat([e]):null,Nd(4,4,FI.bind(null,t,e),a)}function hg(){}function qI(e,t){var a=Rt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&lg(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function HI(e,t){var a=Rt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&lg(t,n[1]))return n[0];if(n=e(),Mo){Rr(!0);try{e()}finally{Rr(!1)}}return a.memoizedState=[n,t],n}function gg(e,t,a){return a===void 0||(rr&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=A0(),Se.lanes|=e,Xr|=e,a)}function jI(e,t,a,n){return Ha(a,t)?a:Wi.current!==null?(e=gg(e,a,n),Ha(e,t)||(zt=!0),e):(rr&42)===0||(rr&1073741824)!==0&&(Pe&261930)===0?(zt=!0,e.memoizedState=a):(e=A0(),Se.lanes|=e,Xr|=e,t)}function VI(e,t,a,n,r){var o=Qe.p;Qe.p=o!==0&&8>o?o:8;var i=de.T,l={};de.T=l,yg(e,!1,t,a);try{var s=r(),u=de.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=kN(s,n);gs(e,t,c,qa(e))}else gs(e,t,n,qa(e))}catch(d){gs(e,t,{then:function(){},status:"rejected",reason:d},qa())}finally{Qe.p=o,i!==null&&l.types!==null&&(i.types=l.types),de.T=i}}function RN(){}function yh(e,t,a,n){if(e.tag!==5)throw Error(B(476));var r=WI(e).queue;VI(e,r,t,bo,a===null?RN:function(){return GI(e),a(n)})}function WI(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:bo,baseState:bo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:bo},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function GI(e){var t=WI(e);t.next===null&&(t=e.alternate.memoizedState),gs(e,t.next.queue,{},qa())}function wg(){return Jt(_s)}function $I(){return Rt().memoizedState}function XI(){return Rt().memoizedState}function DN(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=qa();e=Ur(a);var n=Fr(t,e,a);n!==null&&(Ta(n,t,a),ps(n,t,a)),t={cache:ag()},e.payload=t;return}t=t.return}}function _N(e,t,a){var n=qa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bd(e)?YI(t,a):(a=Qh(e,t,a,n),a!==null&&(Ta(a,e,n),ZI(a,t,n)))}function KI(e,t,a){var n=qa();gs(e,t,a,n)}function gs(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bd(e))YI(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,Ha(l,i))return Dd(e,t,r,0),st===null&&Rd(),!1}catch{}if(a=Qh(e,t,r,n),a!==null)return Ta(a,e,n),ZI(a,t,n),!0}return!1}function yg(e,t,a,n){if(n={lane:2,revertLane:Lg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bd(e)){if(t)throw Error(B(479))}else t=Qh(e,a,n,2),t!==null&&Ta(t,e,2)}function Bd(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function YI(e,t){Fi=cd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ZI(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,NS(e,a)}}var As={readContext:Jt,use:Pd,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};As.useEffectEvent=St;var QI={readContext:Jt,use:Pd,useCallback:function(e,t){return pa().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:Pb,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Vc(4194308,4,FI.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Vc(4194308,4,e,t)},useInsertionEffect:function(e,t){Vc(4,2,e,t)},useMemo:function(e,t){var a=pa();t=t===void 0?null:t;var n=e();if(Mo){Rr(!0);try{e()}finally{Rr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=pa();if(a!==void 0){var r=a(t);if(Mo){Rr(!0);try{a(t)}finally{Rr(!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=_N.bind(null,Se,e),[n.memoizedState,e]},useRef:function(e){var t=pa();return e={current:e},t.memoizedState=e},useState:function(e){e=gh(e);var t=e.queue,a=KI.bind(null,Se,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:hg,useDeferredValue:function(e,t){var a=pa();return gg(a,e,t)},useTransition:function(){var e=gh(!1);return e=VI.bind(null,Se,e.queue,!0,!1),pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Se,r=pa();if(Fe){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),st===null)throw Error(B(349));(Pe&127)!==0||kI(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Pb(LI.bind(null,n,o,e),[e]),n.flags|=2048,Gi(9,{destroy:void 0},TI.bind(null,n,o,a,t),null),a},useId:function(){var e=pa(),t=st.identifierPrefix;if(Fe){var a=Mn,n=En;a=(n&~(1<<32-za(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=dd++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=TN++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wg,useFormState:Db,useActionState:Db,useOptimistic:function(e){var t=pa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=yg.bind(null,Se,!0,a),a.dispatch=t,[e,t]},useMemoCache:fg,useCacheRefresh:function(){return pa().memoizedState=DN.bind(null,Se)},useEffectEvent:function(e){var t=pa(),a={impl:e};return t.memoizedState=a,function(){if((Ze&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},xg={readContext:Jt,use:Pd,useCallback:qI,useContext:Jt,useEffect:mg,useImperativeHandle:zI,useInsertionEffect:BI,useLayoutEffect:UI,useMemo:HI,useReducer:jc,useRef:PI,useState:function(){return jc(or)},useDebugValue:hg,useDeferredValue:function(e,t){var a=Rt();return jI(a,it.memoizedState,e,t)},useTransition:function(){var e=jc(or)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:CI,useId:$I,useHostTransitionStatus:wg,useFormState:_b,useActionState:_b,useOptimistic:function(e,t){var a=Rt();return AI(a,it,e,t)},useMemoCache:fg,useCacheRefresh:XI};xg.useEffectEvent=NI;var JI={readContext:Jt,use:Pd,useCallback:qI,useContext:Jt,useEffect:mg,useImperativeHandle:zI,useInsertionEffect:BI,useLayoutEffect:UI,useMemo:HI,useReducer:Tm,useRef:PI,useState:function(){return Tm(or)},useDebugValue:hg,useDeferredValue:function(e,t){var a=Rt();return it===null?gg(a,e,t):jI(a,it.memoizedState,e,t)},useTransition:function(){var e=Tm(or)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:CI,useId:$I,useHostTransitionStatus:wg,useFormState:Ob,useActionState:Ob,useOptimistic:function(e,t){var a=Rt();return it!==null?AI(a,it,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:fg,useCacheRefresh:XI};JI.useEffectEvent=NI;function Lm(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:pt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var xh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=qa(),r=Ur(n);r.payload=t,a!=null&&(r.callback=a),t=Fr(e,r,n),t!==null&&(Ta(t,e,n),ps(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=qa(),r=Ur(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Fr(e,r,n),t!==null&&(Ta(t,e,n),ps(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=qa(),n=Ur(a);n.tag=2,t!=null&&(n.callback=t),t=Fr(e,n,a),t!==null&&(Ta(t,e,a),ps(t,e,a))}};function Nb(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?!ks(a,n)||!ks(r,o):!0}function Bb(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&&xh.enqueueReplaceState(t,t.state,null)}function Ao(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=pt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function e0(e){nd(e)}function t0(e){console.error(e)}function a0(e){nd(e)}function fd(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ub(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 vh(e,t,a){return a=Ur(a),a.tag=3,a.payload={element:null},a.callback=function(){fd(e,t)},a}function n0(e){return e=Ur(e),e.tag=3,e}function r0(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(){Ub(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Ub(t,a,n),typeof r!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function ON(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&el(t,a,r,!0),a=ja.current,a!==null){switch(a.tag){case 31:case 13:return nn===null?wd():a.alternate===null&&It===0&&(It=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===ld?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Um(e,n,r)),!1;case 22:return a.flags|=65536,n===ld?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)),Um(e,n,r)),!1}throw Error(B(435,a.tag))}return Um(e,n,r),wd(),!1}if(Fe)return t=ja.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==lh&&(e=Error(B(422),{cause:n}),Ls(tn(e,a)))):(n!==lh&&(t=Error(B(423),{cause:n}),Ls(tn(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=tn(n,a),r=vh(e.stateNode,n,r),km(e,r),It!==4&&(It=2)),!1;var o=Error(B(520),{cause:n});if(o=tn(o,a),xs===null?xs=[o]:xs.push(o),It!==4&&(It=2),t===null)return!0;n=tn(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=vh(a.stateNode,n,e),km(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"&&(zr===null||!zr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=n0(r),r0(r,e,a,n),km(a,r),!1}a=a.return}while(a!==null);return!1}var vg=Error(B(461)),zt=!1;function Yt(e,t,a,n){t.child=e===null?yI(t,null,a,n):Eo(t,e.child,a,n)}function Fb(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 Lo(t),n=sg(e,t,a,i,o,r),l=ug(),e!==null&&!zt?(cg(e,t,r),ir(e,t,r)):(Fe&&l&&eg(t),t.flags|=1,Yt(e,t,n,r),t.child)}function zb(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!Jh(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,o0(e,t,o,n,r)):(e=qc(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!bg(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:ks,a(i,n)&&e.ref===t.ref)return ir(e,t,r)}return t.flags|=1,e=er(o,n),e.ref=t.ref,e.return=t,t.child=e}function o0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(ks(o,n)&&e.ref===t.ref)if(zt=!1,t.pendingProps=n=o,bg(e,r))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,ir(e,t,r)}return bh(e,t,a,n,r)}function i0(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 qb(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hc(t,o!==null?o.cachePool:null),o!==null?Mb(t,o):mh(),bI(t);else return n=t.lanes=536870912,qb(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Hc(t,o.cachePool),Mb(t,o),Mr(t),t.memoizedState=null):(e!==null&&Hc(t,null),mh(),Mr(t));return Yt(e,t,r,a),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qb(e,t,a,n,r){var o=ng();return o=o===null?null:{parent:Ft._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Hc(t,null),mh(),bI(t),e!==null&&el(e,t,n,!0),t.childLanes=r,null}function Wc(e,t){return t=pd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hb(e,t,a){return Eo(t,e.child,null,a),e=Wc(t,t.pendingProps),e.flags|=2,Pa(t),t.memoizedState=null,e}function PN(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Fe){if(n.mode==="hidden")return e=Wc(t,n),t.lanes=536870912,ls(null,e);if(hh(t),(e=ft)?(e=Q0(e,an),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wr!==null?{id:En,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},a=dI(e),a.return=t,t.child=a,Qt=t,ft=null)):e=null,e===null)throw Gr(t);return t.lanes=536870912,null}return Wc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(hh(t),r)if(t.flags&256)t.flags&=-257,t=Hb(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(zt||el(e,t,a,!1),r=(a&e.childLanes)!==0,zt||r){if(n=st,n!==null&&(i=BS(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Oo(e,i),Ta(n,e,i),vg;wd(),t=Hb(e,t,a)}else e=o.treeContext,ft=rn(i.nextSibling),Qt=t,Fe=!0,Br=null,an=!1,e!==null&&pI(t,e),t=Wc(t,n),t.flags|=4096;return t}return e=er(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function bh(e,t,a,n,r){return Lo(t),a=sg(e,t,a,n,void 0,r),n=ug(),e!==null&&!zt?(cg(e,t,r),ir(e,t,r)):(Fe&&n&&eg(t),t.flags|=1,Yt(e,t,a,r),t.child)}function jb(e,t,a,n,r,o){return Lo(t),t.updateQueue=null,a=II(t,n,a,r),SI(e),n=ug(),e!==null&&!zt?(cg(e,t,o),ir(e,t,o)):(Fe&&n&&eg(t),t.flags|=1,Yt(e,t,a,o),t.child)}function Vb(e,t,a,n,r){if(Lo(t),t.stateNode===null){var o=Ai,i=a.contextType;typeof i=="object"&&i!==null&&(o=Jt(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=xh,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},og(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?Jt(i):Ai,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Lm(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&&xh.enqueueReplaceState(o,o.state,null),hs(t,n,o,r),ms(),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=Ao(a,l);o.props=s;var u=o.context,c=a.contextType;i=Ai,typeof c=="object"&&c!==null&&(i=Jt(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)&&Bb(t,o,n,i),Tr=!1;var f=t.memoizedState;o.state=f,hs(t,n,o,r),ms(),u=t.memoizedState,l||f!==u||Tr?(typeof d=="function"&&(Lm(t,a,d,n),u=t.memoizedState),(s=Tr||Nb(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,fh(e,t),i=t.memoizedProps,c=Ao(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=Ai,typeof u=="object"&&u!==null&&(s=Jt(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)&&Bb(t,o,n,s),Tr=!1,f=t.memoizedState,o.state=f,hs(t,n,o,r),ms();var p=t.memoizedState;i!==d||f!==p||Tr||e!==null&&e.dependencies!==null&&id(e.dependencies)?(typeof l=="function"&&(Lm(t,a,l,n),p=t.memoizedState),(c=Tr||Nb(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&id(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,Gc(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=Eo(t,e.child,null,r),t.child=Eo(t,null,a,r)):Yt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=ir(e,t,r),e}function Wb(e,t,a,n){return To(),t.flags|=256,Yt(e,t,a,n),t.child}var Em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mm(e){return{baseLanes:e,cachePool:hI()}}function Am(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ba),e}function l0(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:(At.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(r?Er(t):Mr(t),(e=ft)?(e=Q0(e,an),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wr!==null?{id:En,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},a=dI(e),a.return=t,t.child=a,Qt=t,ft=null)):e=null,e===null)throw Gr(t);return Ph(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(Mr(t),r=t.mode,l=pd({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=Mm(a),n.childLanes=Am(e,i,a),t.memoizedState=Em,ls(null,n)):(Er(t),Sh(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(Er(t),t.flags&=-257,t=Rm(e,t,a)):t.memoizedState!==null?(Mr(t),t.child=e.child,t.flags|=128,t=null):(Mr(t),l=n.fallback,r=t.mode,n=pd({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,Eo(t,e.child,null,a),n=t.child,n.memoizedState=Mm(a),n.childLanes=Am(e,i,a),t.memoizedState=Em,t=ls(null,n));else if(Er(t),Ph(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(B(419)),n.stack="",n.digest=i,Ls({value:n,source:null,stack:null}),t=Rm(e,t,a)}else if(zt||el(e,t,a,!1),i=(a&e.childLanes)!==0,zt||i){if(i=st,i!==null&&(n=BS(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,Oo(e,n),Ta(i,e,n),vg;Oh(l)||wd(),t=Rm(e,t,a)}else Oh(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,ft=rn(l.nextSibling),Qt=t,Fe=!0,Br=null,an=!1,e!==null&&pI(t,e),t=Sh(t,n.children),t.flags|=4096);return t}return r?(Mr(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=er(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=er(u,l):(l=So(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,ls(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Mm(a):(r=l.cachePool,r!==null?(s=Ft._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=hI(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Am(e,i,a),t.memoizedState=Em,ls(e.child,n)):(Er(t),a=e.child,e=a.sibling,a=er(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 Sh(e,t){return t=pd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pd(e,t){return e=Na(22,e,null,t),e.lanes=0,e}function Rm(e,t,a){return Eo(t,e.child,null,a),e=Sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gb(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),uh(e.return,t,a)}function Dm(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 s0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=At.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,ut(At,i),Yt(e,t,n,a),n=Fe?Ts:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gb(e,a,t);else if(e.tag===19)Gb(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&&ud(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Dm(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&&ud(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Dm(t,!0,a,null,o,n);break;case"together":Dm(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function ir(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Xr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(el(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=er(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=er(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function bg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&id(e)))}function NN(e,t,a){switch(t.tag){case 3:Jc(t,t.stateNode.containerInfo),Lr(t,Ft,e.memoizedState.cache),To();break;case 27:case 5:Ym(t);break;case 4:Jc(t,t.stateNode.containerInfo);break;case 10:Lr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hh(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Er(t),t.flags|=128,null):(a&t.child.childLanes)!==0?l0(e,t,a):(Er(t),e=ir(e,t,a),e!==null?e.sibling:null);Er(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(el(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return s0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ut(At,At.current),n)break;return null;case 22:return t.lanes=0,i0(e,t,a,t.pendingProps);case 24:Lr(t,Ft,e.memoizedState.cache)}return ir(e,t,a)}function u0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!bg(e,a)&&(t.flags&128)===0)return zt=!1,NN(e,t,a);zt=(e.flags&131072)!==0}else zt=!1,Fe&&(t.flags&1048576)!==0&&fI(t,Ts,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=xo(t.elementType),t.type=e,typeof e=="function")Jh(e)?(n=Ao(e,n),t.tag=1,t=Vb(null,t,e,n,a)):(t.tag=0,t=bh(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===Fh){t.tag=11,t=Fb(null,t,e,n,a);break e}else if(r===zh){t.tag=14,t=zb(null,t,e,n,a);break e}}throw t=Xm(e)||e,Error(B(306,t,""))}}return t;case 0:return bh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Ao(n,t.pendingProps),Vb(e,t,n,r,a);case 3:e:{if(Jc(t,t.stateNode.containerInfo),e===null)throw Error(B(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,fh(e,t),hs(t,n,null,a);var i=t.memoizedState;if(n=i.cache,Lr(t,Ft,n),n!==o.cache&&ch(t,[Ft],a,!0),ms(),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=Wb(e,t,n,a);break e}else if(n!==r){r=tn(Error(B(424)),t),Ls(r),t=Wb(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,ft=rn(e.firstChild),Qt=t,Fe=!0,Br=null,an=!0,a=yI(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(To(),n===r){t=ir(e,t,a);break e}Yt(e,t,n,a)}t=t.child}return t;case 26:return Gc(e,t),e===null?(a=mS(t.type,null,t.pendingProps,null))?t.memoizedState=a:Fe||(a=t.type,e=t.pendingProps,n=bd(Nr.current).createElement(a),n[Zt]=t,n[La]=e,ea(n,a,e),$t(n),t.stateNode=n):t.memoizedState=mS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ym(t),e===null&&Fe&&(n=t.stateNode=J0(t.type,t.pendingProps,Nr.current),Qt=t,an=!0,r=ft,Yr(t.type)?(Nh=r,ft=rn(n.firstChild)):ft=r),Yt(e,t,t.pendingProps.children,a),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((r=n=ft)&&(n=cB(n,t.type,t.pendingProps,an),n!==null?(t.stateNode=n,Qt=t,ft=rn(n.firstChild),an=!1,r=!0):r=!1),r||Gr(t)),Ym(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,Dh(r,o)?n=null:i!==null&&Dh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=sg(e,t,LN,null,null,a),_s._currentValue=r),Gc(e,t),Yt(e,t,n,a),t.child;case 6:return e===null&&Fe&&((e=a=ft)&&(a=dB(a,t.pendingProps,an),a!==null?(t.stateNode=a,Qt=t,ft=null,e=!0):e=!1),e||Gr(t)),null;case 13:return l0(e,t,a);case 4:return Jc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Eo(t,null,n,a):Yt(e,t,n,a),t.child;case 11:return Fb(e,t,t.type,t.pendingProps,a);case 7:return Yt(e,t,t.pendingProps,a),t.child;case 8:return Yt(e,t,t.pendingProps.children,a),t.child;case 12:return Yt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Lr(t,t.type,n.value),Yt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Lo(t),r=Jt(r),n=n(r),t.flags|=1,Yt(e,t,n,a),t.child;case 14:return zb(e,t,t.type,t.pendingProps,a);case 15:return o0(e,t,t.type,t.pendingProps,a);case 19:return s0(e,t,a);case 31:return PN(e,t,a);case 22:return i0(e,t,a,t.pendingProps);case 24:return Lo(t),n=Jt(Ft),e===null?(r=ng(),r===null&&(r=st,o=ag(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},og(t),Lr(t,Ft,r)):((e.lanes&a)!==0&&(fh(e,t),hs(t,null,null,a),ms()),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),Lr(t,Ft,n)):(n=o.cache,Lr(t,Ft,n),n!==r.cache&&ch(t,[Ft],a,!0))),Yt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Wn(e){e.flags|=4}function _m(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(_0())e.flags|=8192;else throw Co=ld,rg}else e.flags&=-16777217}function $b(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!aC(t))if(_0())e.flags|=8192;else throw Co=ld,rg}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?OS():536870912,e.lanes|=t,$i|=t)}function es(e,t){if(!Fe)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 dt(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 BN(e,t,a){var n=t.pendingProps;switch(tg(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),tr(Ft),qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(yi(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cm())),dt(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Wn(t),o!==null?(dt(t),$b(t,o)):(dt(t),_m(t,r,null,n,a))):o?o!==e.memoizedState?(Wn(t),dt(t),$b(t,o)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Wn(t),dt(t),_m(t,r,e,n,a)),null;case 27:if(ed(t),a=Nr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Wn(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return dt(t),null}e=Rn.current,yi(t)?Sb(t,e):(e=J0(r,n,a),t.stateNode=e,Wn(t))}return dt(t),null;case 5:if(ed(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Wn(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return dt(t),null}if(o=Rn.current,yi(t))Sb(t,o);else{var i=bd(Nr.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[Zt]=t,o[La]=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(ea(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&&Wn(t)}}return dt(t),_m(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Wn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(e=Nr.current,yi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=Qt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||K0(e.nodeValue,a)),e||Gr(t,!0)}else e=bd(e).createTextNode(n),e[Zt]=t,t.stateNode=e}return dt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=yi(t),a!==null){if(e===null){if(!n)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[Zt]=t}else To(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else a=Cm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Pa(t),t):(Pa(t),null);if((t.flags&128)!==0)throw Error(B(558))}return dt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=yi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(B(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(B(317));r[Zt]=t}else To(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),r=!1}else r=Cm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Pa(t),t):(Pa(t),null)}return Pa(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),Ac(t,t.updateQueue),dt(t),null);case 4:return qi(),e===null&&Eg(t.stateNode.containerInfo),dt(t),null;case 10:return tr(t.type),dt(t),null;case 19:if(Xt(At),n=t.memoizedState,n===null)return dt(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)es(n,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ud(e),o!==null){for(t.flags|=128,es(n,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cI(a,e),a=a.sibling;return ut(At,At.current&1|2),Fe&&Kn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ua()>hd&&(t.flags|=128,r=!0,es(n,!1),t.lanes=4194304)}else{if(!r)if(e=ud(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),es(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Fe)return dt(t),null}else 2*Ua()-n.renderingStartTime>hd&&a!==536870912&&(t.flags|=128,r=!0,es(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=Ua(),e.sibling=null,a=At.current,ut(At,r?a&1|2:a&1),Fe&&Kn(t,n.treeForkCount),e):(dt(t),null);case 22:case 23:return Pa(t),ig(),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&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),a=t.updateQueue,a!==null&&Ac(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&&Xt(Io),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),tr(Ft),dt(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function UN(e,t){switch(tg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tr(Ft),qi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ed(t),null;case 31:if(t.memoizedState!==null){if(Pa(t),t.alternate===null)throw Error(B(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xt(At),null;case 4:return qi(),null;case 10:return tr(t.type),null;case 22:case 23:return Pa(t),ig(),e!==null&&Xt(Io),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return tr(Ft),null;case 25:return null;default:return null}}function c0(e,t){switch(tg(t),t.tag){case 3:tr(Ft),qi();break;case 26:case 27:case 5:ed(t);break;case 4:qi();break;case 31:t.memoizedState!==null&&Pa(t);break;case 13:Pa(t);break;case 19:Xt(At);break;case 10:tr(t.type);break;case 22:case 23:Pa(t),ig(),e!==null&&Xt(Io);break;case 24:tr(Ft)}}function Vs(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){tt(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){tt(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){tt(t,t.return,c)}}function d0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{vI(t,a)}catch(n){tt(e,e.return,n)}}}function f0(e,t,a){a.props=Ao(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){tt(e,t,n)}}function ws(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){tt(e,t,r)}}function An(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){tt(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){tt(e,t,r)}else a.current=null}function p0(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){tt(e,e.return,r)}}function Om(e,t,a){try{var n=e.stateNode;rB(n,e.type,a,t),n[La]=t}catch(r){tt(e,e.return,r)}}function m0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function Pm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m0(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&&Yr(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 Ih(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=Qn));else if(n!==4&&(n===27&&Yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ih(e,t,a),e=e.sibling;e!==null;)Ih(e,t,a),e=e.sibling}function md(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&&Yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(md(e,t,a),e=e.sibling;e!==null;)md(e,t,a),e=e.sibling}function h0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ea(t,n,a),t[Zt]=e,t[La]=a}catch(o){tt(e,e.return,o)}}var Yn=!1,Ut=!1,Nm=!1,Xb=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function FN(e,t){if(e=e.containerInfo,Ah=kd,e=aI(e),Yh(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(Rh={focusedElem:e,selectionRange:a},kd=!1,Gt=t;Gt!==null;)if(t=Gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Gt=e;else for(;Gt!==null;){switch(t=Gt,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=Ao(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){tt(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)_h(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_h(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,Gt=e;break}Gt=t.return}}function g0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:$n(e,a),n&4&&Vs(5,a);break;case 1:if($n(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){tt(a,a.return,i)}else{var r=Ao(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){tt(a,a.return,i)}}n&64&&d0(a),n&512&&ws(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{vI(e,t)}catch(i){tt(a,a.return,i)}}break;case 27:t===null&&n&4&&h0(a);case 26:case 5:$n(e,a),t===null&&n&4&&p0(a),n&512&&ws(a,a.return);break;case 12:$n(e,a);break;case 31:$n(e,a),n&4&&x0(e,a);break;case 13:$n(e,a),n&4&&v0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=XN.bind(null,a),fB(e,a))));break;case 22:if(n=a.memoizedState!==null||Yn,!n){t=t!==null&&t.memoizedState!==null||Ut,r=Yn;var o=Ut;Yn=n,(Ut=t)&&!o?Xn(e,a,(a.subtreeFlags&8772)!==0):$n(e,a),Yn=r,Ut=o}break;case 30:break;default:$n(e,a)}}function w0(e){var t=e.alternate;t!==null&&(e.alternate=null,w0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vh(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 yt=null,Ca=!1;function Gn(e,t,a){for(a=a.child;a!==null;)y0(e,t,a),a=a.sibling}function y0(e,t,a){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Bs,a)}catch{}switch(a.tag){case 26:Ut||An(a,t),Gn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ut||An(a,t);var n=yt,r=Ca;Yr(a.type)&&(yt=a.stateNode,Ca=!1),Gn(e,t,a),bs(a.stateNode),yt=n,Ca=r;break;case 5:Ut||An(a,t);case 6:if(n=yt,r=Ca,yt=null,Gn(e,t,a),yt=n,Ca=r,yt!==null)if(Ca)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(a.stateNode)}catch(o){tt(a,t,o)}else try{yt.removeChild(a.stateNode)}catch(o){tt(a,t,o)}break;case 18:yt!==null&&(Ca?(e=yt,uS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Zi(e)):uS(yt,a.stateNode));break;case 4:n=yt,r=Ca,yt=a.stateNode.containerInfo,Ca=!0,Gn(e,t,a),yt=n,Ca=r;break;case 0:case 11:case 14:case 15:$r(2,a,t),Ut||$r(4,a,t),Gn(e,t,a);break;case 1:Ut||(An(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&f0(a,t,n)),Gn(e,t,a);break;case 21:Gn(e,t,a);break;case 22:Ut=(n=Ut)||a.memoizedState!==null,Gn(e,t,a),Ut=n;break;default:Gn(e,t,a)}}function x0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zi(e)}catch(a){tt(t,t.return,a)}}}function v0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zi(e)}catch(a){tt(t,t.return,a)}}function zN(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xb),t;default:throw Error(B(435,e.tag))}}function Rc(e,t){var a=zN(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=KN.bind(null,e,n);n.then(r,r)}})}function Sa(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(Yr(l.type)){yt=l.stateNode,Ca=!1;break e}break;case 5:yt=l.stateNode,Ca=!1;break e;case 3:case 4:yt=l.stateNode.containerInfo,Ca=!0;break e}l=l.return}if(yt===null)throw Error(B(160));y0(o,i,r),yt=null,Ca=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)b0(t,e),t=t.sibling}var wn=null;function b0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sa(t,e),Ia(e),n&4&&($r(3,e,e.return),Vs(3,e),$r(5,e,e.return));break;case 1:Sa(t,e),Ia(e),n&512&&(Ut||a===null||An(a,a.return)),n&64&&Yn&&(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=wn;if(Sa(t,e),Ia(e),n&512&&(Ut||a===null||An(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[zs]||o[Zt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),ea(o,n,a),o[Zt]=e,$t(o),n=o;break e;case"link":var i=gS("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),ea(o,n,a),r.head.appendChild(o);break;case"meta":if(i=gS("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),ea(o,n,a),r.head.appendChild(o);break;default:throw Error(B(468,n))}o[Zt]=e,$t(o),n=o}e.stateNode=n}else wS(r,e.type,e.stateNode);else e.stateNode=hS(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?wS(r,e.type,e.stateNode):hS(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Om(e,e.memoizedProps,a.memoizedProps)}break;case 27:Sa(t,e),Ia(e),n&512&&(Ut||a===null||An(a,a.return)),a!==null&&n&4&&Om(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Sa(t,e),Ia(e),n&512&&(Ut||a===null||An(a,a.return)),e.flags&32){r=e.stateNode;try{ji(r,"")}catch(m){tt(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Om(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Nm=!0);break;case 6:if(Sa(t,e),Ia(e),n&4){if(e.stateNode===null)throw Error(B(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){tt(e,e.return,m)}}break;case 3:if(Kc=null,r=wn,wn=Sd(t.containerInfo),Sa(t,e),wn=r,Ia(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(m){tt(e,e.return,m)}Nm&&(Nm=!1,S0(e));break;case 4:n=wn,wn=Sd(e.stateNode.containerInfo),Sa(t,e),Ia(e),wn=n;break;case 12:Sa(t,e),Ia(e);break;case 31:Sa(t,e),Ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 13:Sa(t,e),Ia(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ud=Ua()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Yn,c=Ut;if(Yn=u||r,Ut=c||s,Sa(t,e),Ut=c,Yn=u,Ia(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Yn||Ut||vo(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){tt(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){tt(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?cS(p,!0):cS(s.stateNode,!1)}catch(m){tt(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,Rc(e,a))));break;case 19:Sa(t,e),Ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 30:break;case 21:break;default:Sa(t,e),Ia(e)}}function Ia(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(m0(n)){a=n;break}n=n.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var r=a.stateNode,o=Pm(e);md(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(ji(i,""),a.flags&=-33);var l=Pm(e);md(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Pm(e);Ih(e,u,s);break;default:throw Error(B(161))}}catch(c){tt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function S0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;S0(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;)g0(e,t.alternate,t),t=t.sibling}function vo(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),vo(t);break;case 1:An(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&f0(t,t.return,a),vo(t);break;case 27:bs(t.stateNode);case 26:case 5:An(t,t.return),vo(t);break;case 22:t.memoizedState===null&&vo(t);break;case 30:vo(t);break;default:vo(t)}e=e.sibling}}function Xn(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:Xn(r,o,a),Vs(4,o);break;case 1:if(Xn(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){tt(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++)xI(s[r],l)}catch(u){tt(n,n.return,u)}}a&&i&64&&d0(o),ws(o,o.return);break;case 27:h0(o);case 26:case 5:Xn(r,o,a),a&&n===null&&i&4&&p0(o),ws(o,o.return);break;case 12:Xn(r,o,a);break;case 31:Xn(r,o,a),a&&i&4&&x0(r,o);break;case 13:Xn(r,o,a),a&&i&4&&v0(r,o);break;case 22:o.memoizedState===null&&Xn(r,o,a),ws(o,o.return);break;case 30:break;default:Xn(r,o,a)}t=t.sibling}}function Sg(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&&Hs(a))}function Ig(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hs(e))}function gn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)I0(e,t,a,n),t=t.sibling}function I0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:gn(e,t,a,n),r&2048&&Vs(9,t);break;case 1:gn(e,t,a,n);break;case 3:gn(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&&Hs(e)));break;case 12:if(r&2048){gn(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){tt(t,t.return,s)}}else gn(e,t,a,n);break;case 31:gn(e,t,a,n);break;case 13:gn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?gn(e,t,a,n):ys(e,t):o._visibility&2?gn(e,t,a,n):(o._visibility|=2,vi(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Sg(i,t);break;case 24:gn(e,t,a,n),r&2048&&Ig(t.alternate,t);break;default:gn(e,t,a,n)}}function vi(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:vi(o,i,l,s,r),Vs(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?vi(o,i,l,s,r):ys(o,i):(c._visibility|=2,vi(o,i,l,s,r)),r&&u&2048&&Sg(i.alternate,i);break;case 24:vi(o,i,l,s,r),r&&u&2048&&Ig(i.alternate,i);break;default:vi(o,i,l,s,r)}t=t.sibling}}function ys(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:ys(a,n),r&2048&&Sg(n.alternate,n);break;case 24:ys(a,n),r&2048&&Ig(n.alternate,n);break;default:ys(a,n)}t=t.sibling}}var ss=8192;function xi(e,t,a){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)C0(e,t,a),e=e.sibling}function C0(e,t,a){switch(e.tag){case 26:xi(e,t,a),e.flags&ss&&e.memoizedState!==null&&CB(a,wn,e.memoizedState,e.memoizedProps);break;case 5:xi(e,t,a);break;case 3:case 4:var n=wn;wn=Sd(e.stateNode.containerInfo),xi(e,t,a),wn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ss,ss=16777216,xi(e,t,a),ss=n):xi(e,t,a));break;default:xi(e,t,a)}}function k0(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 ts(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];Gt=n,L0(n,e)}k0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)T0(e),e=e.sibling}function T0(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&$r(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$c(e)):ts(e);break;default:ts(e)}}function $c(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];Gt=n,L0(n,e)}k0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$r(8,t,t.return),$c(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,$c(t));break;default:$c(t)}e=e.sibling}}function L0(e,t){for(;Gt!==null;){var a=Gt;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:Hs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Gt=n;else e:for(a=e;Gt!==null;){n=Gt;var r=n.sibling,o=n.return;if(w0(n),n===a){Gt=null;break e}if(r!==null){r.return=o,Gt=r;break e}Gt=o}}}var qN={getCacheForType:function(e){var t=Jt(Ft),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Jt(Ft).controller.signal}},HN=typeof WeakMap=="function"?WeakMap:Map,Ze=0,st=null,_e=null,Pe=0,et=0,Oa=null,_r=!1,al=!1,Cg=!1,lr=0,It=0,Xr=0,ko=0,kg=0,Ba=0,$i=0,xs=null,ka=null,Ch=!1,Ud=0,E0=0,hd=1/0,gd=null,zr=null,qt=0,qr=null,Xi=null,ar=0,kh=0,Th=null,M0=null,vs=0,Lh=null;function qa(){return(Ze&2)!==0&&Pe!==0?Pe&-Pe:de.T!==null?Lg():US()}function A0(){if(Ba===0)if((Pe&536870912)===0||Fe){var e=bc;bc<<=1,(bc&3932160)===0&&(bc=262144),Ba=e}else Ba=536870912;return e=ja.current,e!==null&&(e.flags|=32),Ba}function Ta(e,t,a){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Ki(e,0),Or(e,Pe,Ba,!1)),Fs(e,a),((Ze&2)===0||e!==st)&&(e===st&&((Ze&2)===0&&(ko|=a),It===4&&Or(e,Pe,Ba,!1)),_n(e))}function R0(e,t,a){if((Ze&6)!==0)throw Error(B(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Us(e,t),r=n?WN(e,t):Bm(e,t,!0),o=n;do{if(r===0){al&&!n&&Or(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!jN(a)){r=Bm(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=xs;var s=l.current.memoizedState.isDehydrated;if(s&&(Ki(l,i).flags|=256),i=Bm(l,i,!1),i!==2){if(Cg&&!s){l.errorRecoveryDisabledLanes|=o,ko|=o,r=4;break e}o=ka,ka=r,o!==null&&(ka===null?ka=o:ka.push.apply(ka,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Ki(e,0),Or(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:Or(n,t,Ba,!_r);break e;case 2:ka=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(r=Ud+300-Ua(),10<r)){if(Or(n,t,Ba,!_r),Ld(n,0,!0)!==0)break e;ar=t,n.timeoutHandle=Z0(Kb.bind(null,n,a,ka,gd,Ch,t,Ba,ko,$i,_r,o,"Throttled",-0,0),r);break e}Kb(n,a,ka,gd,Ch,t,Ba,ko,$i,_r,o,null,-0,0)}}break}while(!0);_n(e)}function Kb(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:Qn},C0(t,o,d);var m=(o&62914560)===o?Ud-Ua():(o&4194048)===o?E0-Ua():0;if(m=kB(d,m),m!==null){ar=o,e.cancelPendingCommit=m(Zb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),Or(e,o,i,!u);return}}Zb(e,t,o,a,n,r,i,l,s)}function jN(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(!Ha(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 Or(e,t,a,n){t&=~kg,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-za(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&PS(e,a,t)}function Fd(){return(Ze&6)===0?(Ws(0,!1),!1):!0}function Tg(){if(_e!==null){if(et===0)var e=_e.return;else e=_e,Jn=Po=null,dg(e),Ui=null,Es=0,e=_e;for(;e!==null;)c0(e.alternate,e),e=e.return;_e=null}}function Ki(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,lB(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ar=0,Tg(),st=e,_e=a=er(e.current,null),Pe=t,et=0,Oa=null,_r=!1,al=Us(e,t),Cg=!1,$i=Ba=kg=ko=Xr=It=0,ka=xs=null,Ch=!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-za(n),o=1<<r;t|=e[r],n&=~o}return lr=t,Rd(),a}function D0(e,t){Se=null,de.H=As,t===tl||t===_d?(t=Lb(),et=3):t===rg?(t=Lb(),et=4):et=t===vg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Oa=t,_e===null&&(It=1,fd(e,tn(t,e.current)))}function _0(){var e=ja.current;return e===null?!0:(Pe&4194048)===Pe?nn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===nn:!1}function O0(){var e=de.H;return de.H=As,e===null?As:e}function P0(){var e=de.A;return de.A=qN,e}function wd(){It=4,_r||(Pe&4194048)!==Pe&&ja.current!==null||(al=!0),(Xr&134217727)===0&&(ko&134217727)===0||st===null||Or(st,Pe,Ba,!1)}function Bm(e,t,a){var n=Ze;Ze|=2;var r=O0(),o=P0();(st!==e||Pe!==t)&&(gd=null,Ki(e,t)),t=!1;var i=It;e:do try{if(et!==0&&_e!==null){var l=_e,s=Oa;switch(et){case 8:Tg(),i=6;break e;case 3:case 2:case 9:case 6:ja.current===null&&(t=!0);var u=et;if(et=0,Oa=null,_i(e,l,s,u),a&&al){i=0;break e}break;default:u=et,et=0,Oa=null,_i(e,l,s,u)}}VN(),i=It;break}catch(c){D0(e,c)}while(!0);return t&&e.shellSuspendCounter++,Jn=Po=null,Ze=n,de.H=r,de.A=o,_e===null&&(st=null,Pe=0,Rd()),i}function VN(){for(;_e!==null;)N0(_e)}function WN(e,t){var a=Ze;Ze|=2;var n=O0(),r=P0();st!==e||Pe!==t?(gd=null,hd=Ua()+500,Ki(e,t)):al=Us(e,t);e:do try{if(et!==0&&_e!==null){t=_e;var o=Oa;t:switch(et){case 1:et=0,Oa=null,_i(e,t,o,1);break;case 2:case 9:if(Tb(o)){et=0,Oa=null,Yb(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),_n(e)},o.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Tb(o)?(et=0,Oa=null,Yb(t)):(et=0,Oa=null,_i(e,t,o,7));break;case 5:var i=null;switch(_e.tag){case 26:i=_e.memoizedState;case 5:case 27:var l=_e;if(i?aC(i):l.stateNode.complete){et=0,Oa=null;var s=l.sibling;if(s!==null)_e=s;else{var u=l.return;u!==null?(_e=u,zd(u)):_e=null}break t}}et=0,Oa=null,_i(e,t,o,5);break;case 6:et=0,Oa=null,_i(e,t,o,6);break;case 8:Tg(),It=6;break e;default:throw Error(B(462))}}GN();break}catch(c){D0(e,c)}while(!0);return Jn=Po=null,de.H=n,de.A=r,Ze=a,_e!==null?0:(st=null,Pe=0,Rd(),It)}function GN(){for(;_e!==null&&!hP();)N0(_e)}function N0(e){var t=u0(e.alternate,e,lr);e.memoizedProps=e.pendingProps,t===null?zd(e):_e=t}function Yb(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=jb(a,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=jb(a,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:dg(t);default:c0(a,t),t=_e=cI(t,lr),t=u0(a,t,lr)}e.memoizedProps=e.pendingProps,t===null?zd(e):_e=t}function _i(e,t,a,n){Jn=Po=null,dg(t),Ui=null,Es=0;var r=t.return;try{if(ON(e,r,t,a,Pe)){It=1,fd(e,tn(a,e.current)),_e=null;return}}catch(o){if(r!==null)throw _e=r,o;It=1,fd(e,tn(a,e.current)),_e=null;return}t.flags&32768?(Fe||n===1?e=!0:al||(Pe&536870912)!==0?e=!1:(_r=e=!0,(n===2||n===9||n===3||n===6)&&(n=ja.current,n!==null&&n.tag===13&&(n.flags|=16384))),B0(t,e)):zd(t)}function zd(e){var t=e;do{if((t.flags&32768)!==0){B0(t,_r);return}e=t.return;var a=BN(t.alternate,t,lr);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);It===0&&(It=5)}function B0(e,t){do{var a=UN(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);It=6,_e=null}function Zb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do qd();while(qt!==0);if((Ze&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(o=t.lanes|t.childLanes,o|=Zh,kP(e,a,o,i,l,s),e===st&&(_e=st=null,Pe=0),Xi=t,qr=e,ar=a,kh=o,Th=r,M0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,YN(td,function(){return H0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=de.T,de.T=null,r=Qe.p,Qe.p=2,i=Ze,Ze|=4;try{FN(e,t,a)}finally{Ze=i,Qe.p=r,de.T=n}}qt=1,U0(),F0(),z0()}}function U0(){if(qt===1){qt=0;var e=qr,t=Xi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=de.T,de.T=null;var n=Qe.p;Qe.p=2;var r=Ze;Ze|=4;try{b0(t,e);var o=Rh,i=aI(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&tI(l.ownerDocument.documentElement,l)){if(s!==null&&Yh(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),S=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>S&&(i=S,S=x,x=i);var w=xb(l,x),y=xb(l,S);if(w&&y&&(p.rangeCount!==1||p.anchorNode!==w.node||p.anchorOffset!==w.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var g=d.createRange();g.setStart(w.node,w.offset),p.removeAllRanges(),x>S?(p.addRange(g),p.extend(y.node,y.offset)):(g.setEnd(y.node,y.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}}kd=!!Ah,Rh=Ah=null}finally{Ze=r,Qe.p=n,de.T=a}}e.current=t,qt=2}}function F0(){if(qt===2){qt=0;var e=qr,t=Xi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=de.T,de.T=null;var n=Qe.p;Qe.p=2;var r=Ze;Ze|=4;try{g0(e,t.alternate,t)}finally{Ze=r,Qe.p=n,de.T=a}}qt=3}}function z0(){if(qt===4||qt===3){qt=0,gP();var e=qr,t=Xi,a=ar,n=M0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?qt=5:(qt=0,Xi=qr=null,q0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(zr=null),jh(a),t=t.stateNode,Fa&&typeof Fa.onCommitFiberRoot=="function")try{Fa.onCommitFiberRoot(Bs,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=de.T,r=Qe.p,Qe.p=2,de.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{de.T=t,Qe.p=r}}(ar&3)!==0&&qd(),_n(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Lh?vs++:(vs=0,Lh=e):vs=0,Ws(0,!1)}}function q0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hs(t)))}function qd(){return U0(),F0(),z0(),H0()}function H0(){if(qt!==5)return!1;var e=qr,t=kh;kh=0;var a=jh(ar),n=de.T,r=Qe.p;try{Qe.p=32>a?32:a,de.T=null,a=Th,Th=null;var o=qr,i=ar;if(qt=0,Xi=qr=null,ar=0,(Ze&6)!==0)throw Error(B(331));var l=Ze;if(Ze|=4,T0(o.current),I0(o,o.current,i,a),Ze=l,Ws(0,!1),Fa&&typeof Fa.onPostCommitFiberRoot=="function")try{Fa.onPostCommitFiberRoot(Bs,o)}catch{}return!0}finally{Qe.p=r,de.T=n,q0(e,t)}}function Qb(e,t,a){t=tn(a,t),t=vh(e.stateNode,t,2),e=Fr(e,t,2),e!==null&&(Fs(e,2),_n(e))}function tt(e,t,a){if(e.tag===3)Qb(e,e,a);else for(;t!==null;){if(t.tag===3){Qb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(zr===null||!zr.has(n))){e=tn(a,e),a=n0(2),n=Fr(t,a,2),n!==null&&(r0(a,n,t,e),Fs(n,2),_n(n));break}}t=t.return}}function Um(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new HN;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)||(Cg=!0,r.add(a),e=$N.bind(null,e,t,a),t.then(e,e))}function $N(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,st===e&&(Pe&a)===a&&(It===4||It===3&&(Pe&62914560)===Pe&&300>Ua()-Ud?(Ze&2)===0&&Ki(e,0):kg|=a,$i===Pe&&($i=0)),_n(e)}function j0(e,t){t===0&&(t=OS()),e=Oo(e,t),e!==null&&(Fs(e,t),_n(e))}function XN(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),j0(e,a)}function KN(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(B(314))}n!==null&&n.delete(t),j0(e,a)}function YN(e,t){return qh(e,t)}var yd=null,bi=null,Eh=!1,xd=!1,Fm=!1,Pr=0;function _n(e){e!==bi&&e.next===null&&(bi===null?yd=bi=e:bi=bi.next=e),xd=!0,Eh||(Eh=!0,QN())}function Ws(e,t){if(!Fm&&xd){Fm=!0;do for(var a=!1,n=yd;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-za(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Jb(n,o))}else o=Pe,o=Ld(n,n===st?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||Us(n,o)||(a=!0,Jb(n,o));n=n.next}while(a);Fm=!1}}function ZN(){V0()}function V0(){xd=Eh=!1;var e=0;Pr!==0&&iB()&&(e=Pr);for(var t=Ua(),a=null,n=yd;n!==null;){var r=n.next,o=W0(n,t);o===0?(n.next=null,a===null?yd=r:a.next=r,r===null&&(bi=a)):(a=n,(e!==0||(o&3)!==0)&&(xd=!0)),n=r}qt!==0&&qt!==5||Ws(e,!1),Pr!==0&&(Pr=0)}function W0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-za(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=CP(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=st,a=Pe,a=Ld(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&mm(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Us(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&mm(n),jh(a)){case 2:case 8:a=DS;break;case 32:a=td;break;case 268435456:a=_S;break;default:a=td}return n=G0.bind(null,e),a=qh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&mm(n),e.callbackPriority=2,e.callbackNode=null,2}function G0(e,t){if(qt!==0&&qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(qd()&&e.callbackNode!==a)return null;var n=Pe;return n=Ld(e,e===st?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(R0(e,n,t),W0(e,Ua()),e.callbackNode!=null&&e.callbackNode===a?G0.bind(null,e):null)}function Jb(e,t){if(qd())return null;R0(e,t,!0)}function QN(){sB(function(){(Ze&6)!==0?qh(RS,ZN):V0()})}function Lg(){if(Pr===0){var e=Vi;e===0&&(e=vc,vc<<=1,(vc&261888)===0&&(vc=256)),Pr=e}return Pr}function eS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uc(""+e)}function tS(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 JN(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=eS((r[La]||null).action),i=n.submitter;i&&(t=(t=i[La]||null)?eS(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new Ed("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Pr!==0){var s=i?tS(r,i):new FormData(r);yh(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?tS(r,i):new FormData(r),yh(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Dc=0;Dc<ih.length;Dc++)_c=ih[Dc],aS=_c.toLowerCase(),nS=_c[0].toUpperCase()+_c.slice(1),yn(aS,"on"+nS);var _c,aS,nS,Dc;yn(rI,"onAnimationEnd");yn(oI,"onAnimationIteration");yn(iI,"onAnimationStart");yn("dblclick","onDoubleClick");yn("focusin","onFocus");yn("focusout","onBlur");yn(wN,"onTransitionRun");yn(yN,"onTransitionStart");yn(xN,"onTransitionCancel");yn(lI,"onTransitionEnd");Hi("onMouseEnter",["mouseout","mouseover"]);Hi("onMouseLeave",["mouseout","mouseover"]);Hi("onPointerEnter",["pointerout","pointerover"]);Hi("onPointerLeave",["pointerout","pointerover"]);Ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rs="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(" "),eB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rs));function $0(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){nd(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){nd(c)}r.currentTarget=null,o=s}}}}function De(e,t){var a=t[Qm];a===void 0&&(a=t[Qm]=new Set);var n=e+"__bubble";a.has(n)||(X0(t,e,2,!1),a.add(n))}function zm(e,t,a){var n=0;t&&(n|=4),X0(a,e,n,t)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function Eg(e){if(!e[Oc]){e[Oc]=!0,FS.forEach(function(a){a!=="selectionchange"&&(eB.has(a)||zm(a,!1,e),zm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oc]||(t[Oc]=!0,zm("selectionchange",!1,t))}}function X0(e,t,a,n){switch(lC(t)){case 2:var r=EB;break;case 8:r=MB;break;default:r=Dg}a=r.bind(null,t,a,e),r=void 0,!nh||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 qm(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=Ci(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}$S(function(){var u=o,c=Gh(a),d=[];e:{var f=sI.get(e);if(f!==void 0){var p=Ed,m=e;switch(e){case"keypress":if(zc(a)===0)break e;case"keydown":case"keyup":p=KP;break;case"focusin":m="focus",p=xm;break;case"focusout":m="blur",p=xm;break;case"beforeblur":case"afterblur":p=xm;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=cb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=BP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=QP;break;case rI:case oI:case iI:p=zP;break;case lI:p=eN;break;case"scroll":case"scrollend":p=PP;break;case"wheel":p=aN;break;case"copy":case"cut":case"paste":p=HP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=fb;break;case"toggle":case"beforetoggle":p=rN}var x=(t&4)!==0,S=!x&&(e==="scroll"||e==="scrollend"),w=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,g;y!==null;){var b=y;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||w===null||(b=Is(y,w),b!=null&&x.push(Ds(y,b,g))),S)break;y=y.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!==ah&&(m=a.relatedTarget||a.fromElement)&&(Ci(m)||m[Qi]))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?Ci(m):null,m!==null&&(S=Ns(m),x=m.tag,m!==S||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=cb,b="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=fb,b="onPointerLeave",w="onPointerEnter",y="pointer"),S=p==null?f:is(p),g=m==null?f:is(m),f=new x(b,y+"leave",p,a,c),f.target=S,f.relatedTarget=g,b=null,Ci(c)===u&&(x=new x(w,y+"enter",m,a,c),x.target=g,x.relatedTarget=S,b=x),S=b,p&&m)t:{for(x=tB,w=p,y=m,g=0,b=w;b;b=x(b))g++;b=0;for(var T=y;T;T=x(T))b++;for(;0<g-b;)w=x(w),g--;for(;0<b-g;)y=x(y),b--;for(;g--;){if(w===y||y!==null&&w===y.alternate){x=w;break t}w=x(w),y=x(y)}x=null}else x=null;p!==null&&rS(d,f,p,x,!1),m!==null&&S!==null&&rS(d,S,m,x,!0)}}e:{if(f=u?is(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=gb;else if(hb(f))if(JS)C=mN;else{C=fN;var M=dN}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Wh(u.elementType)&&(C=gb):C=pN;if(C&&(C=C(e,u))){QS(d,C,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&th(f,"number",f.value)}switch(M=u?is(u):window,e){case"focusin":(hb(M)||M.contentEditable==="true")&&(Li=M,rh=u,ds=null);break;case"focusout":ds=rh=Li=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,vb(d,a,c);break;case"selectionchange":if(gN)break;case"keydown":case"keyup":vb(d,a,c)}var R;if(Kh)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Ti?YS(e,a)&&(P="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(P="onCompositionStart");P&&(KS&&a.locale!=="ko"&&(Ti||P!=="onCompositionStart"?P==="onCompositionEnd"&&Ti&&(R=XS()):(Dr=c,$h="value"in Dr?Dr.value:Dr.textContent,Ti=!0)),M=vd(u,P),0<M.length&&(P=new db(P,e,null,a,c),d.push({event:P,listeners:M}),R?P.data=R:(R=ZS(a),R!==null&&(P.data=R)))),(R=iN?lN(e,a):sN(e,a))&&(P=vd(u,"onBeforeInput"),0<P.length&&(M=new db("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:P}),M.data=R)),JN(d,e,u,a,c)}$0(d,t)})}function Ds(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vd(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=Is(e,a),r!=null&&n.unshift(Ds(e,r,o)),r=Is(e,t),r!=null&&n.push(Ds(e,r,o))),e.tag===3)return n;e=e.return}return[]}function tB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rS(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=Is(a,o),u!=null&&i.unshift(Ds(a,u,s))):r||(u=Is(a,o),u!=null&&i.push(Ds(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var aB=/\r\n?/g,nB=/\u0000|\uFFFD/g;function oS(e){return(typeof e=="string"?e:""+e).replace(aB,`
|
|
9
|
+
`).replace(nB,"")}function K0(e,t){return t=oS(t),oS(e)===t}function ot(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||ji(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&ji(e,""+n);break;case"className":Ic(e,"class",n);break;case"tabIndex":Ic(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ic(e,a,n);break;case"style":GS(e,n,o);break;case"data":if(t!=="object"){Ic(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=Uc(""+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"&&ot(e,t,"name",r.name,r,null),ot(e,t,"formEncType",r.formEncType,r,null),ot(e,t,"formMethod",r.formMethod,r,null),ot(e,t,"formTarget",r.formTarget,r,null)):(ot(e,t,"encType",r.encType,r,null),ot(e,t,"method",r.method,r,null),ot(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Uc(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Qn);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(B(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=Uc(""+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":De("beforetoggle",e),De("toggle",e),Bc(e,"popover",n);break;case"xlinkActuate":Vn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Vn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Vn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Vn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Vn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Vn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Bc(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=_P.get(a)||a,Bc(e,a,n))}}function Mh(e,t,a,n,r,o){switch(a){case"style":GS(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof n=="string"?ji(e,n):(typeof n=="number"||typeof n=="bigint")&&ji(e,""+n);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zS.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[La]||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,""):Bc(e,a,n)}}}function ea(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var 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(B(137,t));default:ot(e,t,o,i,a,null)}}r&&ot(e,t,"srcSet",a.srcSet,a,null),n&&ot(e,t,"src",a.src,a,null);return;case"input":De("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(B(137,t));break;default:ot(e,t,n,c,a,null)}}jS(e,o,l,s,u,i,r,!1);return;case"select":De("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:ot(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?Pi(e,!!n,t,!1):a!=null&&Pi(e,!!n,a,!0);return;case"textarea":De("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(B(91));break;default:ot(e,t,i,l,a,null)}WS(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":ot(e,t,s,n,a,null));return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(n=0;n<Rs.length;n++)De(Rs[n],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:ot(e,t,u,n,a,null)}return;default:if(Wh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Mh(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&ot(e,t,l,n,a,null))}function rB(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)||ot(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(B(137,t));break;default:p!==d&&ot(e,t,f,p,n,d)}}eh(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)||ot(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&&ot(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?Pi(e,!!a,f,!1):!!n!=!!a&&(t!=null?Pi(e,!!a,t,!0):Pi(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:ot(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(B(91));break;default:r!==o&&ot(e,t,i,r,n,o)}VS(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:ot(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":ot(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)&&ot(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(B(137,t));break;default:ot(e,t,u,f,n,p)}return;default:if(Wh(t)){for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!==void 0&&!n.hasOwnProperty(S)&&Mh(e,t,S,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||Mh(e,t,c,f,n,p);return}}for(var w in a)f=a[w],a.hasOwnProperty(w)&&f!=null&&!n.hasOwnProperty(w)&&ot(e,t,w,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||ot(e,t,d,f,n,p)}function iS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oB(){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&&iS(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&&iS(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 Ah=null,Rh=null;function bd(e){return e.nodeType===9?e:e.ownerDocument}function lS(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 Y0(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 Dh(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 Hm=null;function iB(){var e=window.event;return e&&e.type==="popstate"?e===Hm?!1:(Hm=e,!0):(Hm=null,!1)}var Z0=typeof setTimeout=="function"?setTimeout:void 0,lB=typeof clearTimeout=="function"?clearTimeout:void 0,sS=typeof Promise=="function"?Promise:void 0,sB=typeof queueMicrotask=="function"?queueMicrotask:typeof sS<"u"?function(e){return sS.resolve(null).then(e).catch(uB)}:Z0;function uB(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function uS(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),Zi(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")bs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,bs(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[zs]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&bs(e.ownerDocument.body);a=r}while(a);Zi(t)}function cS(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 _h(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":_h(a),Vh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cB(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[zs])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=rn(e.nextSibling),e===null)break}return null}function dB(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=rn(e.nextSibling),e===null))return null;return e}function Q0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rn(e.nextSibling),e===null))return null;return e}function Oh(e){return e.data==="$?"||e.data==="$~"}function Ph(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function fB(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 rn(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 Nh=null;function dS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return rn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function fS(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 J0(e,t,a){switch(t=bd(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function bs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vh(e)}var on=new Map,pS=new Set;function Sd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var sr=Qe.d;Qe.d={f:pB,r:mB,D:hB,C:gB,L:wB,m:yB,X:vB,S:xB,M:bB};function pB(){var e=sr.f(),t=Fd();return e||t}function mB(e){var t=Ji(e);t!==null&&t.tag===5&&t.type==="form"?GI(t):sr.r(e)}var nl=typeof document>"u"?null:document;function eC(e,t,a){var n=nl;if(n&&typeof t=="string"&&t){var r=en(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),pS.has(r)||(pS.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),ea(t,"link",e),$t(t),n.head.appendChild(t)))}}function hB(e){sr.D(e),eC("dns-prefetch",e,null)}function gB(e,t){sr.C(e,t),eC("preconnect",e,t)}function wB(e,t,a){sr.L(e,t,a);var n=nl;if(n&&e&&t){var r='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+en(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+en(a.imageSizes)+'"]')):r+='[href="'+en(e)+'"]';var o=r;switch(t){case"style":o=Yi(e);break;case"script":o=rl(e)}on.has(o)||(e=pt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),on.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Gs(o))||t==="script"&&n.querySelector($s(o))||(t=n.createElement("link"),ea(t,"link",e),$t(t),n.head.appendChild(t)))}}function yB(e,t){sr.m(e,t);var a=nl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+en(n)+'"][href="'+en(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=rl(e)}if(!on.has(o)&&(e=pt({rel:"modulepreload",href:e},t),on.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($s(o)))return}n=a.createElement("link"),ea(n,"link",e),$t(n),a.head.appendChild(n)}}}function xB(e,t,a){sr.S(e,t,a);var n=nl;if(n&&e){var r=Oi(n).hoistableStyles,o=Yi(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(Gs(o)))l.loading=5;else{e=pt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=on.get(o))&&Mg(e,a);var s=i=n.createElement("link");$t(s),ea(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,Xc(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function vB(e,t){sr.X(e,t);var a=nl;if(a&&e){var n=Oi(a).hoistableScripts,r=rl(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=pt({src:e,async:!0},t),(t=on.get(r))&&Ag(e,t),o=a.createElement("script"),$t(o),ea(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function bB(e,t){sr.M(e,t);var a=nl;if(a&&e){var n=Oi(a).hoistableScripts,r=rl(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=pt({src:e,async:!0,type:"module"},t),(t=on.get(r))&&Ag(e,t),o=a.createElement("script"),$t(o),ea(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function mS(e,t,a,n){var r=(r=Nr.current)?Sd(r):null;if(!r)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yi(a.href),a=Oi(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=Yi(a.href);var o=Oi(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(Gs(e)))&&!o._p&&(i.instance=o,i.state.loading=5),on.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},on.set(e,a),o||SB(r,e,a,i.state))),t&&n===null)throw Error(B(528,""));return i}if(t&&n!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rl(a),a=Oi(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(B(444,e))}}function Yi(e){return'href="'+en(e)+'"'}function Gs(e){return'link[rel="stylesheet"]['+e+"]"}function tC(e){return pt({},e,{"data-precedence":e.precedence,precedence:null})}function SB(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}),ea(t,"link",a),$t(t),e.head.appendChild(t))}function rl(e){return'[src="'+en(e)+'"]'}function $s(e){return"script[async]"+e}function hS(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+en(a.href)+'"]');if(n)return t.instance=n,$t(n),n;var r=pt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),$t(n),ea(n,"style",r),Xc(n,a.precedence,e),t.instance=n;case"stylesheet":r=Yi(a.href);var o=e.querySelector(Gs(r));if(o)return t.state.loading|=4,t.instance=o,$t(o),o;n=tC(a),(r=on.get(r))&&Mg(n,r),o=(e.ownerDocument||e).createElement("link"),$t(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),ea(o,"link",n),t.state.loading|=4,Xc(o,a.precedence,e),t.instance=o;case"script":return o=rl(a.src),(r=e.querySelector($s(o)))?(t.instance=r,$t(r),r):(n=a,(r=on.get(o))&&(n=pt({},a),Ag(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),$t(r),ea(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Xc(n,a.precedence,e));return t.instance}function Xc(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 Mg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ag(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kc=null;function gS(e,t,a){if(Kc===null){var n=new Map,r=Kc=new Map;r.set(a,n)}else r=Kc,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[zs]||o[Zt]||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 wS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function IB(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 aC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function CB(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=Yi(n.href),o=t.querySelector(Gs(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Id.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,$t(o);return}o=t.ownerDocument||t,n=tC(n),(r=on.get(r))&&Mg(n,r),o=o.createElement("link"),$t(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),ea(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=Id.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var jm=0;function kB(e,t){return e.stylesheets&&e.count===0&&Yc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&jm===0&&(jm=62500*oB());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>jm?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Id(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cd=null;function Yc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cd=new Map,t.forEach(TB,e),Cd=null,Id.call(e))}function TB(e,t){if(!(t.state.loading&4)){var a=Cd.get(e);if(a)var n=a.get(null);else{a=new Map,Cd.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=Id.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 _s={$$typeof:Zn,Provider:null,Consumer:null,_currentValue:bo,_currentValue2:bo,_threadCount:0};function LB(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=hm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hm(0),this.hiddenUpdates=hm(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 nC(e,t,a,n,r,o,i,l,s,u,c,d){return e=new LB(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Na(3,null,null,t),e.current=o,o.stateNode=e,t=ag(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},og(o),e}function rC(e){return e?(e=Ai,e):Ai}function oC(e,t,a,n,r,o){r=rC(r),n.context===null?n.context=r:n.pendingContext=r,n=Ur(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Fr(e,n,t),a!==null&&(Ta(a,e,t),ps(a,e,t))}function yS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rg(e,t){yS(e,t),(e=e.alternate)&&yS(e,t)}function iC(e){if(e.tag===13||e.tag===31){var t=Oo(e,67108864);t!==null&&Ta(t,e,67108864),Rg(e,67108864)}}function xS(e){if(e.tag===13||e.tag===31){var t=qa();t=Hh(t);var a=Oo(e,t);a!==null&&Ta(a,e,t),Rg(e,t)}}var kd=!0;function EB(e,t,a,n){var r=de.T;de.T=null;var o=Qe.p;try{Qe.p=2,Dg(e,t,a,n)}finally{Qe.p=o,de.T=r}}function MB(e,t,a,n){var r=de.T;de.T=null;var o=Qe.p;try{Qe.p=8,Dg(e,t,a,n)}finally{Qe.p=o,de.T=r}}function Dg(e,t,a,n){if(kd){var r=Bh(n);if(r===null)qm(e,t,n,Td,a),vS(e,n);else if(RB(r,e,t,a,n))n.stopPropagation();else if(vS(e,n),t&4&&-1<AB.indexOf(e)){for(;r!==null;){var o=Ji(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=yo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-za(i);l.entanglements[1]|=s,i&=~s}_n(o),(Ze&6)===0&&(hd=Ua()+500,Ws(0,!1))}}break;case 31:case 13:l=Oo(o,2),l!==null&&Ta(l,o,2),Fd(),Rg(o,2)}if(o=Bh(n),o===null&&qm(e,t,n,Td,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else qm(e,t,n,null,a)}}function Bh(e){return e=Gh(e),_g(e)}var Td=null;function _g(e){if(Td=null,e=Ci(e),e!==null){var t=Ns(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=TS(t),e!==null)return e;e=null}else if(a===31){if(e=LS(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 Td=e,null}function lC(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(wP()){case RS:return 2;case DS:return 8;case td:case yP:return 32;case _S:return 268435456;default:return 32}default:return 32}}var Uh=!1,Hr=null,jr=null,Vr=null,Os=new Map,Ps=new Map,Ar=[],AB="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 vS(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ps.delete(t.pointerId)}}function as(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=Ji(t),t!==null&&iC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function RB(e,t,a,n,r){switch(t){case"focusin":return Hr=as(Hr,e,t,a,n,r),!0;case"dragenter":return jr=as(jr,e,t,a,n,r),!0;case"mouseover":return Vr=as(Vr,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Os.set(o,as(Os.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Ps.set(o,as(Ps.get(o)||null,e,t,a,n,r)),!0}return!1}function sC(e){var t=Ci(e.target);if(t!==null){var a=Ns(t);if(a!==null){if(t=a.tag,t===13){if(t=TS(a),t!==null){e.blockedOn=t,nb(e.priority,function(){xS(a)});return}}else if(t===31){if(t=LS(a),t!==null){e.blockedOn=t,nb(e.priority,function(){xS(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 Zc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Bh(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);ah=n,a.target.dispatchEvent(n),ah=null}else return t=Ji(a),t!==null&&iC(t),e.blockedOn=a,!1;t.shift()}return!0}function bS(e,t,a){Zc(e)&&a.delete(t)}function DB(){Uh=!1,Hr!==null&&Zc(Hr)&&(Hr=null),jr!==null&&Zc(jr)&&(jr=null),Vr!==null&&Zc(Vr)&&(Vr=null),Os.forEach(bS),Ps.forEach(bS)}function Pc(e,t){e.blockedOn===t&&(e.blockedOn=null,Uh||(Uh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,DB)))}var Nc=null;function SS(e){Nc!==e&&(Nc=e,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,function(){Nc===e&&(Nc=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(_g(n||a)===null)continue;break}var o=Ji(a);o!==null&&(e.splice(t,3),t-=3,yh(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Zi(e){function t(s){return Pc(s,e)}Hr!==null&&Pc(Hr,e),jr!==null&&Pc(jr,e),Vr!==null&&Pc(Vr,e),Os.forEach(t),Ps.forEach(t);for(var a=0;a<Ar.length;a++){var n=Ar[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ar.length&&(a=Ar[0],a.blockedOn===null);)sC(a),a.blockedOn===null&&Ar.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[La]||null;if(typeof o=="function")i||SS(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[La]||null)l=i.formAction;else if(_g(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),SS(a)}}}function uC(){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 Og(e){this._internalRoot=e}Hd.prototype.render=Og.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,n=qa();oC(a,n,e,t,null,null)};Hd.prototype.unmount=Og.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oC(e.current,2,null,e,null,null),Fd(),t[Qi]=null}};function Hd(e){this._internalRoot=e}Hd.prototype.unstable_scheduleHydration=function(e){if(e){var t=US();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ar.length&&t!==0&&t<Ar[a].priority;a++);Ar.splice(a,0,e),a===0&&sC(e)}};var IS=CS.version;if(IS!=="19.2.4")throw Error(B(527,IS,"19.2.4"));Qe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=cP(t),e=e!==null?ES(e):null,e=e===null?null:e.stateNode,e};var _B={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ns.isDisabled&&ns.supportsFiber))try{Bs=ns.inject(_B),Fa=ns}catch{}var ns;jd.createRoot=function(e,t){if(!kS(e))throw Error(B(299));var a=!1,n="",r=e0,o=t0,i=a0;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=nC(e,1,!1,null,null,a,n,null,r,o,i,uC),e[Qi]=t.current,Eg(e),new Og(t)};jd.hydrateRoot=function(e,t,a){if(!kS(e))throw Error(B(299));var n=!1,r="",o=e0,i=t0,l=a0,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=nC(e,1,!0,t,a??null,n,r,s,o,i,l,uC),t.context=rC(null),a=t.current,n=qa(),n=Hh(n),r=Ur(n),r.callback=null,Fr(a,r,n),a=n,t.current.lanes=a,Fs(t,a),_n(t),e[Qi]=t.current,Eg(e),new Hd(t)};jd.version="19.2.4"});var Pg=na((Q7,fC)=>{"use strict";function dC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dC)}catch(e){console.error(e)}}dC(),fC.exports=cC()});var qC=na(ef=>{"use strict";var JU=Symbol.for("react.transitional.element"),e3=Symbol.for("react.fragment");function zC(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:JU,type:e,key:n,ref:t!==void 0?t:null,props:a}}ef.Fragment=e3;ef.jsx=zC;ef.jsxs=zC});var ne=na((e$,HC)=>{"use strict";HC.exports=qC()});function jC(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=jC(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function af(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=jC(e))&&(n&&(n+=" "),n+=t);return n}var Kg=k(()=>{"use strict"});function Yg(...e){return e.filter(Boolean).join(" ")}function VC(){return Yg}var Zg=k(()=>{"use strict"});function S3(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Qr(e[a]);return sf(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function I3(e){let t=e;return sf(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function C3(e){return sf(t);function t(a){return a&&a.type===e}}function sf(e){return t;function t(a,n,r){return!!(T3(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function k3(){return!0}function T3(e){return e!==null&&typeof e=="object"&&"type"in e}var Qr,Rk=k(()=>{"use strict";Qr=(function(e){if(e==null)return k3;if(typeof e=="function")return sf(e);if(typeof e=="object")return Array.isArray(e)?S3(e):I3(e);if(typeof e=="string")return C3(e);throw new Error("Expected function, string, or object as test")})});var uf=k(()=>{"use strict";Rk()});function du(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Qr(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=Dk,m,x,S;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=L3(a(s,c)),p[0]===Ho))return p;if("children"in s&&s.children){let w=s;if(w.children&&p[0]!==jo)for(x=(n?w.children.length:-1)+i,S=c.concat(w);x>-1&&x<w.children.length;){let y=w.children[x];if(m=l(y,x,S)(),m[0]===Ho)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function L3(e){return Array.isArray(e)?e:typeof e=="number"?[dr,e]:e==null?Dk:[e]}var Dk,dr,Ho,jo,_k=k(()=>{"use strict";uf();Dk=[],dr=!0,Ho=!1,jo="skip"});var cf=k(()=>{"use strict";_k()});function fr(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),du(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 Ok=k(()=>{"use strict";cf();cf()});var df=k(()=>{"use strict";Ok()});function Bk({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=R3(e,t,a,n,r,o,i);fr(u,c)}}function Pk(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 E3(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function Nk(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=Pk(e,a);if(!i||A3.has(i.protocol)||!(M3.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=E3(e);return i&&t.some(u=>{let c=Pk(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 M3,A3,nw,R3,Uk=k(()=>{"use strict";df();M3=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),A3=new Set(["javascript:","data:","file:","vbscript:"]);nw=Symbol("node-seen"),R3=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[nw])return dr;if(s.tagName==="a"){let d=Nk(s.properties.href,t,e,!1,!1,r);return d===null?(s[nw]=!0,fr(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]"}]}),jo):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",dr)}if(s.tagName==="img"){let d=Nk(s.properties.src,a,e,n,!0,r);return d===null?(s[nw]=!0,fr(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")+"]"}]}),jo):(s.properties.src=d,dr)}return dr};return l}});function D3(){return e=>e}var Fk,zk=k(()=>{"use strict";Fk=D3});var qk,N3,iw,Gk=k(()=>{"use strict";qk=typeof self=="object"?self:globalThis,N3=(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 qk[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 qk[o](i),r)};return n},iw=e=>N3(new Map,e)(0)});var gl,B3,U3,fu,pf,F3,lw,$k=k(()=>{"use strict";gl="",{toString:B3}={},{keys:U3}=Object,fu=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=B3.call(e).slice(8,-1);switch(a){case"Array":return[1,gl];case"Object":return[2,gl];case"Date":return[3,gl];case"RegExp":return[4,gl];case"Map":return[5,gl];case"Set":return[6,gl];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},pf=([e,t])=>e===0&&(t==="function"||t==="symbol"),F3=(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]=fu(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 U3(i))(e||!pf(fu(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||!(pf(fu(f))||pf(fu(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!pf(fu(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},lw=(e,{json:t,lossy:a}={})=>{let n=[];return F3(!(t||a),!!t,new Map,n)(e),n}});var Jr,mf=k(()=>{"use strict";Gk();$k();Jr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?iw(lw(e,t)):structuredClone(e):(e,t)=>iw(lw(e,t))});function Xk(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 pu(e){let t=wl(e),a=hf(e);if(t&&a)return{start:t,end:a}}var hf,wl,Kk=k(()=>{"use strict";hf=Xk("end"),wl=Xk("start")});var mu=k(()=>{"use strict";Kk()});var Vo,sw,Yk=k(()=>{"use strict";Vo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],sw={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Vo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Vo],h2:[["className","sr-only"]],img:[...Vo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Vo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Vo],table:[...Vo],ul:[...Vo,["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 uw(e,t){let a={type:"root",children:[]},n={schema:t?{...sw,...t}:sw,stack:[]},r=Jk(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function Jk(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return z3(e,a);case"doctype":return q3(e,a);case"element":return H3(e,a);case"root":return j3(e,a);case"text":return V3(e,a);default:}}}function z3(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 hu(o,t),o}}function q3(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return hu(a,t),a}}function H3(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=eT(e,t.children),r=W3(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&&eo.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 hu(i,t),i}function j3(e,t){let n={type:"root",children:eT(e,t.children)};return hu(n,t),n}function V3(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return hu(n,t),n}function eT(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=Jk(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function W3(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&eo.call(n,a)?n[a]:void 0,i=n&&eo.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(eo.call(l,u)){let c=l[u],d=Zk(e,Qk(o,u),u,c);d==null&&(d=Zk(e,Qk(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&eo.call(r,a)){let c=r[a];for(u in c)eo.call(c,u)&&!eo.call(s,u)&&(s[u]=c[u])}return s}function Zk(e,t,a,n){return t?Array.isArray(n)?G3(e,t,a,n):tT(e,t,a,n):void 0}function G3(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=tT(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function tT(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&$3(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 $3(e,t,a){let n=e.schema.protocols&&eo.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 hu(e,t){let a=pu(t);t.data&&(e.data=Jr(t.data)),a&&(e.position=a)}function Qk(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 eo,aT=k(()=>{"use strict";mf();mu();Yk();eo={}.hasOwnProperty});var nT=k(()=>{"use strict";aT()});function gf(e){return function(t){return uw(t,e)}}var rT=k(()=>{"use strict";nT()});var oT=k(()=>{"use strict";rT()});function cw(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 iT=k(()=>{"use strict"});function Wo(e){return e!==null&&(e<32||e===127)}function Y(e){return e!==null&&e<-2}function Re(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}function to(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var jt,Ct,lT,gu,sT,uT,Go,Bn,je=k(()=>{"use strict";jt=to(/[A-Za-z]/),Ct=to(/[\dA-Za-z]/),lT=to(/[#-'*+\--9=?A-Z^-~]/);gu=to(/\d/),sT=to(/[\dA-Fa-f]/),uT=to(/[!-/:-@[-`{-~]/);Go=to(/\p{P}|\p{S}/u),Bn=to(/\s/)});function dw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var cT=k(()=>{"use strict"});function fw(e,t,a){let r=Qr((a||{}).ignore||[]),o=X3(t),i=-1;for(;++i<o.length;)du(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,S=d.children.indexOf(u),w=!1,y=[];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]},C=p(...g,T);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=b+1:(m!==b&&y.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(C)?y.push(...C):C&&y.push(C),m=b+g[0].length,w=!0),!f.global)break;g=f.exec(u.value)}return w?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),d.children.splice(S,1,...y)):y=[u],S+y.length}}function X3(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([K3(r[0]),Y3(r[1])])}return t}function K3(e){return typeof e=="string"?new RegExp(dw(e),"g"):e}function Y3(e){return typeof e=="function"?e:function(){return e}}var dT=k(()=>{"use strict";cT();cf();uf()});var fT=k(()=>{"use strict";dT()});function gw(){return{transforms:[aF],enter:{literalAutolink:Z3,literalAutolinkEmail:hw,literalAutolinkHttp:hw,literalAutolinkWww:hw},exit:{literalAutolink:tF,literalAutolinkEmail:eF,literalAutolinkHttp:Q3,literalAutolinkWww:J3}}}function ww(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pw,notInConstruct:mw},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pw,notInConstruct:mw},{character:":",before:"[ps]",after:"\\/",inConstruct:pw,notInConstruct:mw}]}}function Z3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function hw(e){this.config.enter.autolinkProtocol.call(this,e)}function Q3(e){this.config.exit.autolinkProtocol.call(this,e)}function J3(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 eF(e){this.config.exit.autolinkEmail.call(this,e)}function tF(e){this.exit(e)}function aF(e){fw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,rF]],{ignore:["link","linkReference"]})}function nF(e,t,a,n,r){let o="";if(!pT(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!oF(a)))return!1;let i=iF(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 rF(e,t,a,n){return!pT(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function oF(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 iF(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=cw(e,"("),o=cw(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 pT(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Bn(a)||Go(a))&&(!t||a!==47)}var pw,mw,mT=k(()=>{"use strict";iT();je();fT();pw="phrasing",mw=["autolink","link","image","label"]});var hT=k(()=>{"use strict";mT()});function oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var yl=k(()=>{"use strict"});function lF(){this.buffer()}function sF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uF(){this.buffer()}function cF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=oa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function fF(e){this.exit(e)}function pF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=oa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function mF(e){this.exit(e)}function hF(){return"["}function gT(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 yw(){return{enter:{gfmFootnoteCallString:lF,gfmFootnoteCall:sF,gfmFootnoteDefinitionLabelString:uF,gfmFootnoteDefinition:cF},exit:{gfmFootnoteCallString:dF,gfmFootnoteCall:fF,gfmFootnoteDefinitionLabelString:pF,gfmFootnoteDefinition:mF}}}function xw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:gT},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?wT:gF))),u(),s}}function gF(e,t,a){return t===0?e:wT(e,t,a)}function wT(e,t,a){return(a?"":" ")+e}var yT=k(()=>{"use strict";yl();gT.peek=hF});var xT=k(()=>{"use strict";yT()});function vw(){return{canContainEols:["delete"],enter:{strikethrough:yF},exit:{strikethrough:xF}}}function bw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wF}],handlers:{delete:vT}}}function yF(e){this.enter({type:"delete",children:[]},e)}function xF(e){this.exit(e)}function vT(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 vF(){return"~"}var wF,bT=k(()=>{"use strict";wF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vT.peek=vF});var ST=k(()=>{"use strict";bT()});function bF(e){return e.length}function CT(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||bF,o=[],i=[],l=[],s=[],u=0,c=-1;for(;++c<e.length;){let x=[],S=[],w=-1;for(e[c].length>u&&(u=e[c].length);++w<e[c].length;){let y=SF(e[c][w]);if(a.alignDelimiters!==!1){let g=r(y);S[w]=g,(s[w]===void 0||g>s[w])&&(s[w]=g)}x.push(y)}i[c]=x,l[c]=S}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)o[d]=IT(n[d]);else{let x=IT(n);for(;++d<u;)o[d]=x}d=-1;let f=[],p=[];for(;++d<u;){let x=o[d],S="",w="";x===99?(S=":",w=":"):x===108?S=":":x===114&&(w=":");let y=a.alignDelimiters===!1?1:Math.max(1,s[d]-S.length-w.length),g=S+"-".repeat(y)+w;a.alignDelimiters!==!1&&(y=S.length+y+w.length,y>s[d]&&(s[d]=y),p[d]=y),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],S=l[c];d=-1;let w=[];for(;++d<u;){let y=x[d]||"",g="",b="";if(a.alignDelimiters!==!1){let T=s[d]-(S[d]||0),C=o[d];C===114?g=" ".repeat(T):C===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&&w.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&y==="")&&(a.delimiterStart!==!1||d)&&w.push(" "),a.alignDelimiters!==!1&&w.push(g),w.push(y),a.alignDelimiters!==!1&&w.push(b),a.padding!==!1&&w.push(" "),(a.delimiterEnd!==!1||d!==u-1)&&w.push("|")}m.push(a.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return m.join(`
|
|
11
|
+
`)}function SF(e){return e==null?"":String(e)}function IT(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 kT=k(()=>{"use strict"});function TT(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()),IF);return r(),i}function IF(e,t,a){return">"+(a?"":" ")+e}var LT=k(()=>{"use strict"});function MT(e,t){return ET(e,t.inConstruct,!0)&&!ET(e,t.notInConstruct,!1)}function ET(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 AT=k(()=>{"use strict"});function Sw(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&MT(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var RT=k(()=>{"use strict";AT()});function DT(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 _T=k(()=>{"use strict"});function OT(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 PT=k(()=>{"use strict"});function NT(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 BT=k(()=>{"use strict"});function UT(e,t,a,n){let r=NT(a),o=e.value||"",i=r==="`"?"GraveAccent":"Tilde";if(OT(e,a)){let d=a.enter("codeIndented"),f=a.indentLines(o,CF);return d(),f}let l=a.createTracker(n),s=r.repeat(Math.max(DT(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 CF(e,t,a){return(a?"":" ")+e}var FT=k(()=>{"use strict";_T();PT();BT()});function xl(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 wf=k(()=>{"use strict"});function zT(e,t,a,n){let r=xl(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 qT=k(()=>{"use strict";wf()});function HT(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 jT=k(()=>{"use strict"});function ao(e){return"&#x"+e.toString(16).toUpperCase()+";"}var yf=k(()=>{"use strict"});function pr(e){if(e===null||Re(e)||Bn(e))return 1;if(Go(e))return 2}var xf=k(()=>{"use strict";je()});function vl(e,t,a){let n=pr(e),r=pr(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 Iw=k(()=>{"use strict";xf()});function Cw(e,t,a,n){let r=HT(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=vl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=ao(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=vl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+ao(d));let p=i.move(r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function kF(e,t,a){return a.options.emphasis||"*"}var VT=k(()=>{"use strict";jT();yf();Iw();Cw.peek=kF});function $o(e,t){let a=t||TF,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return GT(e,n,r)}function GT(e,t,a){if(LF(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 WT(e.children,t,a)}return Array.isArray(e)?WT(e,t,a):""}function WT(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=GT(e[r],t,a);return n.join("")}function LF(e){return!!(e&&typeof e=="object")}var TF,$T=k(()=>{"use strict";TF={}});var vf=k(()=>{"use strict";$T()});function XT(e,t){let a=!1;return fr(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,Ho}),!!((!e.depth||e.depth<3)&&$o(e)&&(t.options.setext||a))}var KT=k(()=>{"use strict";df();vf()});function YT(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(XT(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=ao(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var XT=k(()=>{"use strict";wf();GT()});function Cw(e){return e.value||""}function xF(){return"<"}var KT=k(()=>{"use strict";Cw.peek=xF});function kw(e,t,a,n){let r=xl(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 vF(){return"!"}var YT=k(()=>{"use strict";gf();kw.peek=vF});function Tw(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 bF(){return"!"}var ZT=k(()=>{"use strict";Tw.peek=bF});function Lw(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 SF(){return"`"}var QT=k(()=>{"use strict";Lw.peek=SF});function Ew(e,t){let a=$o(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 JT=k(()=>{"use strict";xf()});function Mw(e,t,a,n){let r=xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(Ew(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 IF(e,t,a){return Ew(e,a)?"<":"["}var e1=k(()=>{"use strict";gf();JT();Mw.peek=IF});function Aw(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 CF(){return"["}var t1=k(()=>{"use strict";Aw.peek=CF});function bl(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 vf=k(()=>{"use strict"});function a1(e){let t=bl(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 n1=k(()=>{"use strict";vf()});function r1(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 o1=k(()=>{"use strict"});function bf(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 Rw=k(()=>{"use strict"});function i1(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?r1(a):bl(a),l=e.ordered?i==="."?")":".":a1(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),bf(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 l1=k(()=>{"use strict";vf();n1();o1();Rw()});function s1(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 u1=k(()=>{"use strict"});function c1(e,t,a,n){let r=s1(a),o=a.bulletCurrent||bl(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 d1=k(()=>{"use strict";vf();u1()});function f1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var p1=k(()=>{"use strict"});var Dw,m1=k(()=>{"use strict";sf();Dw=Qr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var h1=k(()=>{"use strict";m1()});function g1(e,t,a,n){return(e.children.some(function(i){return Dw(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var w1=k(()=>{"use strict";h1()});function y1(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 x1=k(()=>{"use strict"});function _w(e,t,a,n){let r=y1(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=vl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=ao(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=vl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+ao(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function kF(e,t,a){return a.options.strong||"*"}var v1=k(()=>{"use strict";x1();wf();Sw();_w.peek=kF});function b1(e,t,a,n){return a.safe(e.value,n)}var S1=k(()=>{"use strict"});function I1(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 C1=k(()=>{"use strict"});function k1(e,t,a){let n=(bf(a)+(a.options.ruleSpaces?" ":"")).repeat(I1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var T1=k(()=>{"use strict";C1();Rw()});var wu,L1=k(()=>{"use strict";CT();ET();NT();UT();qT();XT();KT();YT();ZT();QT();e1();t1();l1();d1();p1();w1();v1();S1();T1();wu={blockquote:IT,break:bw,code:PT,definition:BT,emphasis:Iw,hardBreak:bw,heading:$T,html:Cw,image:kw,imageReference:Tw,inlineCode:Lw,link:Mw,linkReference:Aw,list:i1,listItem:c1,paragraph:f1,root:g1,strong:_w,text:b1,thematicBreak:k1}});function Sl(e){let t="&"+e+";";E1.innerHTML=t;let a=E1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var E1,Sf=k(()=>{"use strict";E1=document.createElement("i")});function If(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 Ow=k(()=>{"use strict"});function M1(e){return e.replace(TF,LF)}function LF(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return If(a.slice(o?2:1),o?16:10)}return Sl(a)||e}var TF,A1=k(()=>{"use strict";Sf();Ow();TF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Pw=k(()=>{"use strict";L1()});function Bw(){return{enter:{table:EF,tableData:R1,tableHeader:R1,tableRow:AF},exit:{codeText:RF,table:MF,tableData:Nw,tableHeader:Nw,tableRow:Nw}}}function EF(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 MF(e){this.exit(e),this.data.inTable=void 0}function AF(e){this.enter({type:"tableRow",children:[]},e)}function Nw(e){this.exit(e)}function R1(e){this.enter({type:"tableCell",children:[]},e)}function RF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,DF));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function DF(e,t){return t==="|"?t:e}function Uw(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=ao(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var ZT=k(()=>{"use strict";yf();KT()});function kw(e){return e.value||""}function EF(){return"<"}var QT=k(()=>{"use strict";kw.peek=EF});function Tw(e,t,a,n){let r=xl(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 MF(){return"!"}var JT=k(()=>{"use strict";wf();Tw.peek=MF});function Lw(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 AF(){return"!"}var e1=k(()=>{"use strict";Lw.peek=AF});function Ew(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 RF(){return"`"}var t1=k(()=>{"use strict";Ew.peek=RF});function Mw(e,t){let a=$o(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 a1=k(()=>{"use strict";vf()});function Aw(e,t,a,n){let r=xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(Mw(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 DF(e,t,a){return Mw(e,a)?"<":"["}var n1=k(()=>{"use strict";wf();a1();Aw.peek=DF});function Rw(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 _F(){return"["}var r1=k(()=>{"use strict";Rw.peek=_F});function bl(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 bf=k(()=>{"use strict"});function o1(e){let t=bl(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 i1=k(()=>{"use strict";bf()});function l1(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 s1=k(()=>{"use strict"});function Sf(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 Dw=k(()=>{"use strict"});function u1(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?l1(a):bl(a),l=e.ordered?i==="."?")":".":o1(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),Sf(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 c1=k(()=>{"use strict";bf();i1();s1();Dw()});function d1(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 f1=k(()=>{"use strict"});function p1(e,t,a,n){let r=d1(a),o=a.bulletCurrent||bl(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 m1=k(()=>{"use strict";bf();f1()});function h1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var g1=k(()=>{"use strict"});var _w,w1=k(()=>{"use strict";uf();_w=Qr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var y1=k(()=>{"use strict";w1()});function x1(e,t,a,n){return(e.children.some(function(i){return _w(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var v1=k(()=>{"use strict";y1()});function b1(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 S1=k(()=>{"use strict"});function Ow(e,t,a,n){let r=b1(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=vl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=ao(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=vl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+ao(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function OF(e,t,a){return a.options.strong||"*"}var I1=k(()=>{"use strict";S1();yf();Iw();Ow.peek=OF});function C1(e,t,a,n){return a.safe(e.value,n)}var k1=k(()=>{"use strict"});function T1(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 L1=k(()=>{"use strict"});function E1(e,t,a){let n=(Sf(a)+(a.options.ruleSpaces?" ":"")).repeat(T1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var M1=k(()=>{"use strict";L1();Dw()});var wu,A1=k(()=>{"use strict";LT();RT();FT();qT();VT();ZT();QT();JT();e1();t1();n1();r1();c1();m1();g1();v1();I1();k1();M1();wu={blockquote:TT,break:Sw,code:UT,definition:zT,emphasis:Cw,hardBreak:Sw,heading:YT,html:kw,image:Tw,imageReference:Lw,inlineCode:Ew,link:Aw,linkReference:Rw,list:u1,listItem:p1,paragraph:h1,root:x1,strong:Ow,text:C1,thematicBreak:E1}});function Sl(e){let t="&"+e+";";R1.innerHTML=t;let a=R1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var R1,If=k(()=>{"use strict";R1=document.createElement("i")});function Cf(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 Pw=k(()=>{"use strict"});function D1(e){return e.replace(PF,NF)}function NF(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Cf(a.slice(o?2:1),o?16:10)}return Sl(a)||e}var PF,_1=k(()=>{"use strict";If();Pw();PF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Nw=k(()=>{"use strict";A1()});function Uw(){return{enter:{table:BF,tableData:O1,tableHeader:O1,tableRow:FF},exit:{codeText:zF,table:UF,tableData:Bw,tableHeader:Bw,tableRow:Bw}}}function BF(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 UF(e){this.exit(e),this.data.inTable=void 0}function FF(e){this.enter({type:"tableRow",children:[]},e)}function Bw(e){this.exit(e)}function O1(e){this.enter({type:"tableCell",children:[]},e)}function zF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qF));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function qF(e,t){return t==="|"?t:e}function Fw(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,S){return u(c(p,x,S),p.align)}function l(p,m,x,S){let w=d(p,x,S),y=u([w]);return y.slice(0,y.indexOf(`
|
|
24
|
-
`))}function s(p,m,x,S){let w=x.enter("tableCell"),y=x.enter("phrasing"),g=x.containerPhrasing(p,{...S,before:o,after:o});return y(),w(),g}function u(p,m){return bT(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let S=p.children,w=-1,y=[],g=m.enter("table");for(;++w<S.length;)y[w]=d(S[w],m,x);return g(),y}function d(p,m,x){let S=p.children,w=-1,y=[],g=m.enter("tableRow");for(;++w<S.length;)y[w]=s(S[w],p,m,x);return g(),y}function f(p,m,x){let S=wu.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}var D1=k(()=>{"use strict";ST();Pw()});var _1=k(()=>{"use strict";D1()});function Fw(){return{exit:{taskListCheckValueChecked:O1,taskListCheckValueUnchecked:O1,paragraph:_F}}}function zw(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OF}}}function O1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function _F(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 OF(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=wu.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 P1=k(()=>{"use strict";Pw()});var N1=k(()=>{"use strict";P1()});function qw(){return[hw(),ww(),xw(),Bw(),Fw()]}function Hw(e){return{extensions:[gw(),yw(e),vw(),Uw(e),zw()]}}var B1=k(()=>{"use strict";fT();gT();xT();_1();N1()});var U1=k(()=>{"use strict";B1()});function Rt(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 ha(e,t){return e.length>0?(Rt(e,e.length,0,t),e):t}var mr=k(()=>{"use strict"});function Cf(e){let t={},a=-1;for(;++a<e.length;)PF(t,e[a]);return t}function PF(e,t){let a;for(a in t){let r=(F1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){F1.call(r,i)||(r[i]=[]);let l=o[i];NF(r[i],Array.isArray(l)?l:l?[l]:[])}}}function NF(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Rt(e,0,0,n)}var F1,jw=k(()=>{"use strict";mr();F1={}.hasOwnProperty});function Ww(){return{text:Bn}}function FF(e,t,a){let n=this,r,o;return i;function i(d){return!Vw(d)||!$1.call(n,n.previous)||Gw(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Vw(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(UF,c,u)(d):d===45||d===95||Ct(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&&qt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function zF(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!W1.call(n,n.previous)||Gw(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BF,e.attempt(z1,e.attempt(q1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function qF(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&G1.call(n,n.previous)&&!Gw(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(qt(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||Wo(d)||Ae(d)||Nn(d)||Go(d)?a(d):e.attempt(z1,e.attempt(q1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function HF(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 jF(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(H1,s,l)(u):u===null||Ae(u)||Nn(u)||u!==45&&Go(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 VF(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(H1,t,o)(i):i===null||Ae(i)||Nn(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function WF(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||Ae(l)||Nn(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||Ae(l)||Nn(l)?t(l):n(l)}function o(l){return qt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):qt(l)?(e.consume(l),i):a(l)}}function GF(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return Ct(o)?a(o):t(o)}}function W1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ae(e)}function G1(e){return!qt(e)}function $1(e){return!(e===47||Vw(e))}function Vw(e){return e===43||e===45||e===46||e===95||Ct(e)}function Gw(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 BF,z1,q1,H1,UF,j1,V1,hr,Bn,Xo,X1=k(()=>{"use strict";ze();BF={tokenize:HF,partial:!0},z1={tokenize:jF,partial:!0},q1={tokenize:VF,partial:!0},H1={tokenize:WF,partial:!0},UF={tokenize:GF,partial:!0},j1={name:"wwwAutolink",tokenize:zF,previous:W1},V1={name:"protocolAutolink",tokenize:qF,previous:G1},hr={name:"emailAutolink",tokenize:FF,previous:$1},Bn={};Xo=48;for(;Xo<123;)Bn[Xo]=hr,Xo++,Xo===58?Xo=65:Xo===91&&(Xo=97);Bn[43]=hr;Bn[45]=hr;Bn[46]=hr;Bn[95]=hr;Bn[72]=[hr,V1];Bn[104]=[hr,V1];Bn[87]=[hr,j1];Bn[119]=[hr,j1]});function sn(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&Ct(e.charCodeAt(a+1))&&Ct(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 Ko=k(()=>{"use strict";ze()});var K1=k(()=>{"use strict";X1()});function no(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 yu=k(()=>{"use strict"});function $F(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};Y1(d,-s),Y1(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=ha(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ha(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ha(u,no(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ha(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=ha(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Rt(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 XF(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=pr(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=pr(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 Y1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var xu,Z1=k(()=>{"use strict";mr();yf();yu();xu={name:"attention",resolveAll:$F,tokenize:XF}});function KF(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 qt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||Ct(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||Ct(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||Wo(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):rT(p)?(e.consume(p),u):a(p)}function c(p){return Ct(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||Ct(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var $w,Q1=k(()=>{"use strict";ze();$w={name:"autolink",tokenize:KF}});function oe(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return ie(s)?(e.enter(a),l(s)):t(s)}function l(s){return ie(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Dt=k(()=>{"use strict";ze()});function YF(e,t,a){return n;function n(o){return ie(o)?oe(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||X(o)?t(o):a(o)}}var Un,kf=k(()=>{"use strict";Dt();ze();Un={partial:!0,tokenize:YF}});function ZF(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 ie(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function QF(e,t,a){let n=this;return r;function r(i){return ie(i)?oe(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Tf,t,a)(i)}}function JF(e){e.exit("blockQuote")}var Tf,J1=k(()=>{"use strict";Dt();ze();Tf={continuation:{tokenize:QF},exit:JF,name:"blockQuote",tokenize:ZF}});function ez(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 iT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Lf,eL=k(()=>{"use strict";ze();Lf={name:"characterEscape",tokenize:ez}});function tz(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=Ct,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=oT,c):(e.enter("characterReferenceValue"),o=7,i=gu,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===Ct&&!Sl(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 Ef,tL=k(()=>{"use strict";Sf();ze();Ef={name:"characterReference",tokenize:tz}});function az(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(C){return u(C)}function u(C){let A=n.events[n.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(C)}function c(C){return C===l?(i++,e.consume(C),c):i<3?a(C):(e.exit("codeFencedFenceSequence"),ie(C)?oe(e,d,"whitespace")(C):d(C))}function d(C){return C===null||X(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(aL,x,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||X(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),oe(e,p,"whitespace")(C)):C===96&&C===l?a(C):(e.consume(C),f)}function p(C){return C===null||X(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||X(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===l?a(C):(e.consume(C),m)}function x(C){return e.attempt(r,b,S)(C)}function S(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),w}function w(C){return o>0&&ie(C)?oe(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||X(C)?e.check(aL,x,b)(C):(e.enter("codeFlowValue"),g(C))}function g(C){return C===null||X(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),g)}function b(C){return e.exit("codeFenced"),t(C)}function T(C,A,R){let P=0;return L;function L(G){return C.enter("lineEnding"),C.consume(G),C.exit("lineEnding"),W}function W(G){return C.enter("codeFencedFence"),ie(G)?oe(C,H,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):H(G)}function H(G){return G===l?(C.enter("codeFencedFenceSequence"),F(G)):R(G)}function F(G){return G===l?(P++,C.consume(G),F):P>=i?(C.exit("codeFencedFenceSequence"),ie(G)?oe(C,$,"whitespace")(G):$(G)):R(G)}function $(G){return G===null||X(G)?(C.exit("codeFencedFence"),A(G)):R(G)}}}function nz(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 aL,Mf,nL=k(()=>{"use strict";Dt();ze();aL={partial:!0,tokenize:nz},Mf={concrete:!0,name:"codeFenced",tokenize:az}});function oz(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),oe(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):X(u)?e.attempt(rz,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||X(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function iz(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):oe(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):X(i)?r(i):a(i)}}var vu,rz,rL=k(()=>{"use strict";Dt();ze();vu={name:"codeIndented",tokenize:oz},rz={partial:!0,tokenize:iz}});function lz(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 sz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uz(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)):X(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||X(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 Xw,oL=k(()=>{"use strict";ze();Xw={name:"codeText",previous:sz,resolve:lz,tokenize:uz}});function bu(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 Af,iL=k(()=>{"use strict";Af=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&&bu(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),bu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bu(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);bu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bu(this.left,a.reverse())}}}});function Rf(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Af(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,cz(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 Rt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function cz(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,S=[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,S.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):S.pop(),f=S.length;f--;){let w=l.slice(S[f],S[f+1]),y=o.pop();s.push([y,y+w.length-1]),e.splice(y,2,w)}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 Kw=k(()=>{"use strict";mr();iL()});function fz(e){return Rf(e),e}function pz(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):X(l)?e.check(dz,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 mz(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),oe(e,o,"linePrefix")}function o(i){if(i===null||X(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 Yw,dz,lL=k(()=>{"use strict";Dt();ze();Kw();Yw={resolve:fz,tokenize:pz},dz={partial:!0,tokenize:mz}});function Df(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(w){return w===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(w),e.exit(o),f):w===null||w===32||w===41||Wo(w)?a(w):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(w))}function f(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(l),f(w)):w===null||w===60||X(w)?a(w):(e.consume(w),w===92?m:p)}function m(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!c&&(w===null||w===41||Ae(w))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(w)):c<u&&w===40?(e.consume(w),c++,x):w===41?(e.consume(w),c--,x):w===null||w===32||w===40||Wo(w)?a(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}var Zw=k(()=>{"use strict";ze()});function _f(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):X(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||X(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!ie(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var Qw=k(()=>{"use strict";ze()});function Of(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):X(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||X(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 Jw=k(()=>{"use strict";Dt();ze()});function Yo(e,t){let a;return n;function n(r){return X(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):ie(r)?oe(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var ey=k(()=>{"use strict";Dt();ze()});function gz(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return _f.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=oa(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 Ae(p)?Yo(e,u)(p):u(p)}function u(p){return Df(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(hz,d,d)(p)}function d(p){return ie(p)?oe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||X(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function wz(e,t,a){return n;function n(l){return Ae(l)?Yo(e,r)(l):a(l)}function r(l){return Of(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return ie(l)?oe(e,i,"whitespace")(l):i(l)}function i(l){return l===null||X(l)?t(l):a(l)}}var ty,hz,sL=k(()=>{"use strict";Zw();Qw();Dt();Jw();ey();ze();yl();ty={name:"definition",tokenize:gz},hz={partial:!0,tokenize:wz}});function yz(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return X(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ay,uL=k(()=>{"use strict";ze();ay={name:"hardBreakEscape",tokenize:yz}});function xz(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"},Rt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function vz(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||Ae(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||X(c)?(e.exit("atxHeading"),t(c)):ie(c)?oe(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||Ae(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var ny,cL=k(()=>{"use strict";Dt();ze();mr();ny={name:"headingAtx",resolve:xz,tokenize:vz}});var dL,ry,fL=k(()=>{"use strict";dL=["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"],ry=["pre","script","style","textarea"]});function Iz(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 Cz(e,t,a){let n=this,r,o,i,l,s;return u;function u(v){return c(v)}function c(v){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(v),d}function d(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),o=!0,x):v===63?(e.consume(v),r=3,n.interrupt?t:I):qt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function f(v){return v===45?(e.consume(v),r=2,p):v===91?(e.consume(v),r=5,l=0,m):qt(v)?(e.consume(v),r=4,n.interrupt?t:I):a(v)}function p(v){return v===45?(e.consume(v),n.interrupt?t:I):a(v)}function m(v){let z="CDATA[";return v===z.charCodeAt(l++)?(e.consume(v),l===z.length?n.interrupt?t:H:m):a(v)}function x(v){return qt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function S(v){if(v===null||v===47||v===62||Ae(v)){let z=v===47,J=i.toLowerCase();return!z&&!o&&ry.includes(J)?(r=1,n.interrupt?t(v):H(v)):dL.includes(i.toLowerCase())?(r=6,z?(e.consume(v),w):n.interrupt?t(v):H(v)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(v):o?y(v):g(v))}return v===45||Ct(v)?(e.consume(v),i+=String.fromCharCode(v),S):a(v)}function w(v){return v===62?(e.consume(v),n.interrupt?t:H):a(v)}function y(v){return ie(v)?(e.consume(v),y):L(v)}function g(v){return v===47?(e.consume(v),L):v===58||v===95||qt(v)?(e.consume(v),b):ie(v)?(e.consume(v),g):L(v)}function b(v){return v===45||v===46||v===58||v===95||Ct(v)?(e.consume(v),b):T(v)}function T(v){return v===61?(e.consume(v),C):ie(v)?(e.consume(v),T):g(v)}function C(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),s=v,A):ie(v)?(e.consume(v),C):R(v)}function A(v){return v===s?(e.consume(v),s=null,P):v===null||X(v)?a(v):(e.consume(v),A)}function R(v){return v===null||v===34||v===39||v===47||v===60||v===61||v===62||v===96||Ae(v)?T(v):(e.consume(v),R)}function P(v){return v===47||v===62||ie(v)?g(v):a(v)}function L(v){return v===62?(e.consume(v),W):a(v)}function W(v){return v===null||X(v)?H(v):ie(v)?(e.consume(v),W):a(v)}function H(v){return v===45&&r===2?(e.consume(v),B):v===60&&r===1?(e.consume(v),D):v===62&&r===4?(e.consume(v),qe):v===63&&r===3?(e.consume(v),I):v===93&&r===5?(e.consume(v),be):X(v)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(bz,lt,F)(v)):v===null||X(v)?(e.exit("htmlFlowData"),F(v)):(e.consume(v),H)}function F(v){return e.check(Sz,$,lt)(v)}function $(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),G}function G(v){return v===null||X(v)?F(v):(e.enter("htmlFlowData"),H(v))}function B(v){return v===45?(e.consume(v),I):H(v)}function D(v){return v===47?(e.consume(v),i="",Q):H(v)}function Q(v){if(v===62){let z=i.toLowerCase();return ry.includes(z)?(e.consume(v),qe):H(v)}return qt(v)&&i.length<8?(e.consume(v),i+=String.fromCharCode(v),Q):H(v)}function be(v){return v===93?(e.consume(v),I):H(v)}function I(v){return v===62?(e.consume(v),qe):v===45&&r===2?(e.consume(v),I):H(v)}function qe(v){return v===null||X(v)?(e.exit("htmlFlowData"),lt(v)):(e.consume(v),qe)}function lt(v){return e.exit("htmlFlow"),t(v)}}function kz(e,t,a){let n=this;return r;function r(i){return X(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 Tz(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Un,t,a)}}var oy,bz,Sz,pL=k(()=>{"use strict";ze();fL();kf();oy={concrete:!0,name:"htmlFlow",resolveTo:Iz,tokenize:Cz},bz={partial:!0,tokenize:Tz},Sz={partial:!0,tokenize:kz}});function Lz(e,t,a){let n=this,r,o,i;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),s}function s(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),T):I===63?(e.consume(I),g):qt(I)?(e.consume(I),R):a(I)}function u(I){return I===45?(e.consume(I),c):I===91?(e.consume(I),o=0,m):qt(I)?(e.consume(I),y):a(I)}function c(I){return I===45?(e.consume(I),p):a(I)}function d(I){return I===null?a(I):I===45?(e.consume(I),f):X(I)?(i=d,D(I)):(e.consume(I),d)}function f(I){return I===45?(e.consume(I),p):d(I)}function p(I){return I===62?B(I):I===45?f(I):d(I)}function m(I){let qe="CDATA[";return I===qe.charCodeAt(o++)?(e.consume(I),o===qe.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),S):X(I)?(i=x,D(I)):(e.consume(I),x)}function S(I){return I===93?(e.consume(I),w):x(I)}function w(I){return I===62?B(I):I===93?(e.consume(I),w):x(I)}function y(I){return I===null||I===62?B(I):X(I)?(i=y,D(I)):(e.consume(I),y)}function g(I){return I===null?a(I):I===63?(e.consume(I),b):X(I)?(i=g,D(I)):(e.consume(I),g)}function b(I){return I===62?B(I):g(I)}function T(I){return qt(I)?(e.consume(I),C):a(I)}function C(I){return I===45||Ct(I)?(e.consume(I),C):A(I)}function A(I){return X(I)?(i=A,D(I)):ie(I)?(e.consume(I),A):B(I)}function R(I){return I===45||Ct(I)?(e.consume(I),R):I===47||I===62||Ae(I)?P(I):a(I)}function P(I){return I===47?(e.consume(I),B):I===58||I===95||qt(I)?(e.consume(I),L):X(I)?(i=P,D(I)):ie(I)?(e.consume(I),P):B(I)}function L(I){return I===45||I===46||I===58||I===95||Ct(I)?(e.consume(I),L):W(I)}function W(I){return I===61?(e.consume(I),H):X(I)?(i=W,D(I)):ie(I)?(e.consume(I),W):P(I)}function H(I){return I===null||I===60||I===61||I===62||I===96?a(I):I===34||I===39?(e.consume(I),r=I,F):X(I)?(i=H,D(I)):ie(I)?(e.consume(I),H):(e.consume(I),$)}function F(I){return I===r?(e.consume(I),r=void 0,G):I===null?a(I):X(I)?(i=F,D(I)):(e.consume(I),F)}function $(I){return I===null||I===34||I===39||I===60||I===61||I===96?a(I):I===47||I===62||Ae(I)?P(I):(e.consume(I),$)}function G(I){return I===47||I===62||Ae(I)?P(I):a(I)}function B(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function D(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Q}function Q(I){return ie(I)?oe(e,be,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):be(I)}function be(I){return e.enter("htmlTextData"),i(I)}}var iy,mL=k(()=>{"use strict";Dt();ze();iy={name:"htmlText",tokenize:Lz}});function Rz(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&&Rt(e,0,e.length,a),e}function Dz(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=ha(l,e.slice(o+1,o+n+3)),l=ha(l,[["enter",c,t]]),l=ha(l,no(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ha(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ha(l,e.slice(i+1)),l=ha(l,[["exit",s,t]]),Rt(e,o,e.length,l),e}function _z(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(oa(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(Ez,c,i?c:d)(f):f===91?e.attempt(Mz,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(Az,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function Oz(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 Ae(d)?Yo(e,o)(d):o(d)}function o(d){return d===41?c(d):Df(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Ae(d)?Yo(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Of(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return Ae(d)?Yo(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 Pz(e,t,a){let n=this;return r;function r(l){return _f.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(oa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function Nz(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 Zo,Ez,Mz,Az,Pf=k(()=>{"use strict";Zw();Qw();Jw();ey();ze();mr();yl();yu();Zo={name:"labelEnd",resolveAll:Rz,resolveTo:Dz,tokenize:_z},Ez={tokenize:Oz},Mz={tokenize:Pz},Az={tokenize:Nz}});function Bz(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 ly,hL=k(()=>{"use strict";Pf();ly={name:"labelStartImage",resolveAll:Zo.resolveAll,tokenize:Bz}});function Uz(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 sy,gL=k(()=>{"use strict";Pf();sy={name:"labelStartLink",resolveAll:Zo.resolveAll,tokenize:Uz}});function Fz(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),oe(e,t,"linePrefix")}}var Su,wL=k(()=>{"use strict";Dt();Su={name:"lineEnding",tokenize:Fz}});function zz(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||X(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),ie(u)?oe(e,l,"whitespace")(u):l(u))}}var Qo,uy=k(()=>{"use strict";Dt();ze();Qo={name:"thematicBreak",tokenize:zz}});function jz(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:gu(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(Qo,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 gu(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(Un,n.interrupt?a:c,e.attempt(qz,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return ie(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 Vz(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Un,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,oe(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!ie(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(Hz,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,oe(e,e.attempt(ia,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Wz(e,t,a){let n=this;return oe(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 Gz(e){e.exit(this.containerState.type)}function $z(e,t,a){let n=this;return oe(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!ie(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var ia,qz,Hz,yL=k(()=>{"use strict";Dt();ze();kf();uy();ia={continuation:{tokenize:Vz},exit:Gz,name:"list",tokenize:jz},qz={partial:!0,tokenize:$z},Hz={partial:!0,tokenize:Wz}});function Xz(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 Kz(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"),ie(u)?oe(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Nf,xL=k(()=>{"use strict";Dt();ze();Nf={name:"setextUnderline",resolveTo:Xz,tokenize:Kz}});var Bf=k(()=>{"use strict";Z1();Q1();kf();J1();eL();tL();nL();rL();oL();lL();sL();uL();cL();pL();mL();Pf();hL();gL();wL();yL();xL();uy()});function cy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:e4,continuation:{tokenize:t4},exit:a4}},text:{91:{name:"gfmFootnoteCall",tokenize:Jz},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Zz,resolveTo:Qz}}}}function Zz(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=oa(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 Qz(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 Jz(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||Ae(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(oa(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return Ae(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 e4(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||Ae(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=oa(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Ae(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),oe(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function t4(e,t,a){return e.check(Un,t,e.attempt(Yz,t,a))}function a4(e){e.exit("gfmFootnoteDefinition")}function n4(e,t,a){let n=this;return oe(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 Yz,vL=k(()=>{"use strict";Bf();Dt();ze();yl();Yz={tokenize:n4,partial:!0}});var bL=k(()=>{"use strict";vL()});function dy(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&&Rt(f,f.length,0,no(p,i.slice(u+1,s),l)),Rt(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),Rt(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=pr(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let S=i.exit("strikethroughSequenceTemporary"),w=pr(m);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,l(m)}}}var SL=k(()=>{"use strict";mr();yf();yu()});var IL=k(()=>{"use strict";SL()});function r4(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 Uf,CL=k(()=>{"use strict";Uf=class{constructor(){this.map=[]}add(t,a,n){r4(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 kL(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 TL=k(()=>{"use strict"});function fy(){return{flow:{null:{name:"table",tokenize:o4,resolveAll:i4}}}}function o4(e,t,a){let n=this,r=0,o=0,i;return l;function l(L){let W=n.events.length-1;for(;W>-1;){let $=n.events[W][1].type;if($==="lineEnding"||$==="linePrefix")W--;else break}let H=W>-1?n.events[W][1].type:null,F=H==="tableHead"||H==="tableRow"?C:s;return F===C&&n.parser.lazy[n.now().line]?a(L):F(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):X(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):ie(L)?oe(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||Ae(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,ie(L)?oe(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?S(L):L===124?(i=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):T(L)}function x(L){return ie(L)?oe(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),w):L===45?(o+=1,w(L)):L===null||X(L)?b(L):T(L)}function w(L){return L===45?(e.enter("tableDelimiterFiller"),y(L)):T(L)}function y(L){return L===45?(e.consume(L),y):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 ie(L)?oe(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||X(L)?!i||r!==o?T(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):T(L)}function T(L){return a(L)}function C(L){return e.enter("tableRow"),A(L)}function A(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),A):L===null||X(L)?(e.exit("tableRow"),t(L)):ie(L)?oe(e,A,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||Ae(L)?(e.exit("data"),A(L)):(e.consume(L),L===92?P:R)}function P(L){return L===92||L===124?(e.consume(L),R):R(L)}}function i4(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 Uf;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(LL(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=Ff(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=Ff(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=Ff(f,t,o,r,a,d)):i[1]!==0&&(d=Ff(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&LL(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=kL(t.events,a))}return e}function Ff(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Il(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Il(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=Il(t.events,a[2]),c=Il(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({},Il(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function LL(e,t,a,n,r){let o=[],i=Il(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 Il(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var EL=k(()=>{"use strict";Dt();ze();CL();TL()});var ML=k(()=>{"use strict";EL()});function py(){return{text:{91:l4}}}function s4(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 Ae(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 X(s)?t(s):ie(s)?e.check({tokenize:u4},t,a)(s):a(s)}}function u4(e,t,a){return oe(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var l4,AL=k(()=>{"use strict";Dt();ze();l4={name:"tasklistCheck",tokenize:s4}});var RL=k(()=>{"use strict";AL()});function DL(e){return Cf([Ww(),cy(),dy(e),fy(),py()])}var _L=k(()=>{"use strict";jw();K1();bL();IL();ML();RL()});function zf(e){let t=this,a=e||c4,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(DL(a)),o.push(qw()),i.push(Hw(a))}var c4,OL=k(()=>{"use strict";U1();_L();c4={}});var PL=k(()=>{"use strict";OL()});var d4,f4,p4,NL,m4,h4,BL,zL,qL,g4,w4,y4,x4,v4,b4,S4,Jo,HL,I4,C4,k4,T4,L4,E4,UL,ro,Cl,M4,jL,Hf,A4,VL,hy,R4,D4,WL,_4,O4,P4,N4,B4,U4,F4,z4,q4,GL,H4,j4,V4,W4,G4,$4,qf,X4,K4,Y4,Z4,Q4,J4,eq,tq,aq,nq,FL,rq,$L,oq,iq,lq,sq,uq,cq,my,Wa,dq,fq,pq,XL,KL=k(()=>{"use strict";d4=Object.defineProperty,f4=Object.defineProperties,p4=Object.getOwnPropertyDescriptors,NL=Object.getOwnPropertySymbols,m4=Object.prototype.hasOwnProperty,h4=Object.prototype.propertyIsEnumerable,BL=(e,t,a)=>t in e?d4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,zL=(e,t)=>{for(var a in t||(t={}))m4.call(t,a)&&BL(e,a,t[a]);if(NL)for(var a of NL(t))h4.call(t,a)&&BL(e,a,t[a]);return e},qL=(e,t)=>f4(e,p4(t)),g4=/(\*\*)([^*]*\*?)$/,w4=/(__)([^_]*?)$/,y4=/(\*\*\*)([^*]*?)$/,x4=/(\*)([^*]*?)$/,v4=/(_)([^_]*?)$/,b4=/(`)([^`]*?)$/,S4=/(~~)([^~]*?)$/,Jo=/^[\s_~*`]*$/,HL=/^[\s]*[-*+][\s]+$/,I4=/[\p{L}\p{N}_]/u,C4=/^```[^`\n]*```?$/,k4=/^\*{4,}$/,T4=/(__)([^_]+)_$/,L4=/(~~)([^~]+)~$/,E4=/__/g,UL=/~~/g,ro=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:I4.test(e)},Cl=(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},M4=(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},jL=(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},Hf=(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},A4=(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,S){let w=x.enter("tableCell"),y=x.enter("phrasing"),g=x.containerPhrasing(p,{...S,before:o,after:o});return y(),w(),g}function u(p,m){return CT(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let S=p.children,w=-1,y=[],g=m.enter("table");for(;++w<S.length;)y[w]=d(S[w],m,x);return g(),y}function d(p,m,x){let S=p.children,w=-1,y=[],g=m.enter("tableRow");for(;++w<S.length;)y[w]=s(S[w],p,m,x);return g(),y}function f(p,m,x){let S=wu.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}var P1=k(()=>{"use strict";kT();Nw()});var N1=k(()=>{"use strict";P1()});function zw(){return{exit:{taskListCheckValueChecked:B1,taskListCheckValueUnchecked:B1,paragraph:HF}}}function qw(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jF}}}function B1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function HF(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 jF(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=wu.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 U1=k(()=>{"use strict";Nw()});var F1=k(()=>{"use strict";U1()});function Hw(){return[gw(),yw(),vw(),Uw(),zw()]}function jw(e){return{extensions:[ww(),xw(e),bw(),Fw(e),qw()]}}var z1=k(()=>{"use strict";hT();xT();ST();N1();F1()});var q1=k(()=>{"use strict";z1()});function Dt(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 ha(e,t){return e.length>0?(Dt(e,e.length,0,t),e):t}var mr=k(()=>{"use strict"});function kf(e){let t={},a=-1;for(;++a<e.length;)VF(t,e[a]);return t}function VF(e,t){let a;for(a in t){let r=(H1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){H1.call(r,i)||(r[i]=[]);let l=o[i];WF(r[i],Array.isArray(l)?l:l?[l]:[])}}}function WF(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Dt(e,0,0,n)}var H1,Vw=k(()=>{"use strict";mr();H1={}.hasOwnProperty});function Gw(){return{text:Un}}function XF(e,t,a){let n=this,r,o;return i;function i(d){return!Ww(d)||!Y1.call(n,n.previous)||$w(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Ww(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check($F,c,u)(d):d===45||d===95||Ct(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&&jt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function KF(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!X1.call(n,n.previous)||$w(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GF,e.attempt(j1,e.attempt(V1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function YF(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&K1.call(n,n.previous)&&!$w(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(jt(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||Wo(d)||Re(d)||Bn(d)||Go(d)?a(d):e.attempt(j1,e.attempt(V1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function ZF(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 QF(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(W1,s,l)(u):u===null||Re(u)||Bn(u)||u!==45&&Go(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 JF(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(W1,t,o)(i):i===null||Re(i)||Bn(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function ez(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||Re(l)||Bn(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||Re(l)||Bn(l)?t(l):n(l)}function o(l){return jt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):jt(l)?(e.consume(l),i):a(l)}}function tz(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return Ct(o)?a(o):t(o)}}function X1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Re(e)}function K1(e){return!jt(e)}function Y1(e){return!(e===47||Ww(e))}function Ww(e){return e===43||e===45||e===46||e===95||Ct(e)}function $w(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 GF,j1,V1,W1,$F,G1,$1,hr,Un,Xo,Z1=k(()=>{"use strict";je();GF={tokenize:ZF,partial:!0},j1={tokenize:QF,partial:!0},V1={tokenize:JF,partial:!0},W1={tokenize:ez,partial:!0},$F={tokenize:tz,partial:!0},G1={name:"wwwAutolink",tokenize:KF,previous:X1},$1={name:"protocolAutolink",tokenize:YF,previous:K1},hr={name:"emailAutolink",tokenize:XF,previous:Y1},Un={};Xo=48;for(;Xo<123;)Un[Xo]=hr,Xo++,Xo===58?Xo=65:Xo===91&&(Xo=97);Un[43]=hr;Un[45]=hr;Un[46]=hr;Un[95]=hr;Un[72]=[hr,$1];Un[104]=[hr,$1];Un[87]=[hr,G1];Un[119]=[hr,G1]});function sn(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&Ct(e.charCodeAt(a+1))&&Ct(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 Ko=k(()=>{"use strict";je()});var Q1=k(()=>{"use strict";Z1()});function no(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 yu=k(()=>{"use strict"});function az(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=ha(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ha(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ha(u,no(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ha(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=ha(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Dt(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 nz(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=pr(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=pr(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 xu,eL=k(()=>{"use strict";mr();xf();yu();xu={name:"attention",resolveAll:az,tokenize:nz}});function rz(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 jt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||Ct(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||Ct(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||Wo(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):lT(p)?(e.consume(p),u):a(p)}function c(p){return Ct(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||Ct(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Xw,tL=k(()=>{"use strict";je();Xw={name:"autolink",tokenize:rz}});function ie(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return le(s)?(e.enter(a),l(s)):t(s)}function l(s){return le(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var _t=k(()=>{"use strict";je()});function oz(e,t,a){return n;function n(o){return le(o)?ie(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||Y(o)?t(o):a(o)}}var Fn,Tf=k(()=>{"use strict";_t();je();Fn={partial:!0,tokenize:oz}});function iz(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 le(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function lz(e,t,a){let n=this;return r;function r(i){return le(i)?ie(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Lf,t,a)(i)}}function sz(e){e.exit("blockQuote")}var Lf,aL=k(()=>{"use strict";_t();je();Lf={continuation:{tokenize:lz},exit:sz,name:"blockQuote",tokenize:iz}});function uz(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 uT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Ef,nL=k(()=>{"use strict";je();Ef={name:"characterEscape",tokenize:uz}});function cz(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=Ct,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=sT,c):(e.enter("characterReferenceValue"),o=7,i=gu,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===Ct&&!Sl(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 Mf,rL=k(()=>{"use strict";If();je();Mf={name:"characterReference",tokenize:cz}});function dz(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(C){return u(C)}function u(C){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(C)}function c(C){return C===l?(i++,e.consume(C),c):i<3?a(C):(e.exit("codeFencedFenceSequence"),le(C)?ie(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Y(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(oL,x,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||Y(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):le(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ie(e,p,"whitespace")(C)):C===96&&C===l?a(C):(e.consume(C),f)}function p(C){return C===null||Y(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Y(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===l?a(C):(e.consume(C),m)}function x(C){return e.attempt(r,b,S)(C)}function S(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),w}function w(C){return o>0&&le(C)?ie(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||Y(C)?e.check(oL,x,b)(C):(e.enter("codeFlowValue"),g(C))}function g(C){return C===null||Y(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),g)}function b(C){return e.exit("codeFenced"),t(C)}function T(C,M,R){let P=0;return L;function L(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),$}function $(V){return C.enter("codeFencedFence"),le(V)?ie(C,H,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):H(V)}function H(V){return V===l?(C.enter("codeFencedFenceSequence"),F(V)):R(V)}function F(V){return V===l?(P++,C.consume(V),F):P>=i?(C.exit("codeFencedFenceSequence"),le(V)?ie(C,W,"whitespace")(V):W(V)):R(V)}function W(V){return V===null||Y(V)?(C.exit("codeFencedFence"),M(V)):R(V)}}}function fz(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 oL,Af,iL=k(()=>{"use strict";_t();je();oL={partial:!0,tokenize:fz},Af={concrete:!0,name:"codeFenced",tokenize:dz}});function mz(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),ie(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):Y(u)?e.attempt(pz,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Y(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function hz(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):Y(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):ie(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):Y(i)?r(i):a(i)}}var vu,pz,lL=k(()=>{"use strict";_t();je();vu={name:"codeIndented",tokenize:mz},pz={partial:!0,tokenize:hz}});function gz(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 wz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yz(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)):Y(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||Y(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 Kw,sL=k(()=>{"use strict";je();Kw={name:"codeText",previous:wz,resolve:gz,tokenize:yz}});function bu(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 Rf,uL=k(()=>{"use strict";Rf=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&&bu(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),bu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bu(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);bu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bu(this.left,a.reverse())}}}});function Df(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Rf(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,xz(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 Dt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function xz(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,S=[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,S.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):S.pop(),f=S.length;f--;){let w=l.slice(S[f],S[f+1]),y=o.pop();s.push([y,y+w.length-1]),e.splice(y,2,w)}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 Yw=k(()=>{"use strict";mr();uL()});function bz(e){return Df(e),e}function Sz(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):Y(l)?e.check(vz,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 Iz(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ie(e,o,"linePrefix")}function o(i){if(i===null||Y(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 Zw,vz,cL=k(()=>{"use strict";_t();je();Yw();Zw={resolve:bz,tokenize:Sz},vz={partial:!0,tokenize:Iz}});function _f(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(w){return w===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(w),e.exit(o),f):w===null||w===32||w===41||Wo(w)?a(w):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(w))}function f(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(l),f(w)):w===null||w===60||Y(w)?a(w):(e.consume(w),w===92?m:p)}function m(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!c&&(w===null||w===41||Re(w))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(w)):c<u&&w===40?(e.consume(w),c++,x):w===41?(e.consume(w),c--,x):w===null||w===32||w===40||Wo(w)?a(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}var Qw=k(()=>{"use strict";je()});function Of(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):Y(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||Y(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!le(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var Jw=k(()=>{"use strict";je()});function Pf(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):Y(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ie(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||Y(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 ey=k(()=>{"use strict";_t();je()});function Yo(e,t){let a;return n;function n(r){return Y(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):le(r)?ie(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var ty=k(()=>{"use strict";_t();je()});function kz(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return Of.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=oa(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 Re(p)?Yo(e,u)(p):u(p)}function u(p){return _f(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(Cz,d,d)(p)}function d(p){return le(p)?ie(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Y(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function Tz(e,t,a){return n;function n(l){return Re(l)?Yo(e,r)(l):a(l)}function r(l){return Pf(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return le(l)?ie(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Y(l)?t(l):a(l)}}var ay,Cz,dL=k(()=>{"use strict";Qw();Jw();_t();ey();ty();je();yl();ay={name:"definition",tokenize:kz},Cz={partial:!0,tokenize:Tz}});function Lz(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return Y(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ny,fL=k(()=>{"use strict";je();ny={name:"hardBreakEscape",tokenize:Lz}});function Ez(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"},Dt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function Mz(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||Re(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||Y(c)?(e.exit("atxHeading"),t(c)):le(c)?ie(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||Re(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var ry,pL=k(()=>{"use strict";_t();je();mr();ry={name:"headingAtx",resolve:Ez,tokenize:Mz}});var mL,oy,hL=k(()=>{"use strict";mL=["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"],oy=["pre","script","style","textarea"]});function Dz(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 _z(e,t,a){let n=this,r,o,i,l,s;return u;function u(v){return c(v)}function c(v){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(v),d}function d(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),o=!0,x):v===63?(e.consume(v),r=3,n.interrupt?t:I):jt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function f(v){return v===45?(e.consume(v),r=2,p):v===91?(e.consume(v),r=5,l=0,m):jt(v)?(e.consume(v),r=4,n.interrupt?t:I):a(v)}function p(v){return v===45?(e.consume(v),n.interrupt?t:I):a(v)}function m(v){let K="CDATA[";return v===K.charCodeAt(l++)?(e.consume(v),l===K.length?n.interrupt?t:H:m):a(v)}function x(v){return jt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function S(v){if(v===null||v===47||v===62||Re(v)){let K=v===47,ee=i.toLowerCase();return!K&&!o&&oy.includes(ee)?(r=1,n.interrupt?t(v):H(v)):mL.includes(i.toLowerCase())?(r=6,K?(e.consume(v),w):n.interrupt?t(v):H(v)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(v):o?y(v):g(v))}return v===45||Ct(v)?(e.consume(v),i+=String.fromCharCode(v),S):a(v)}function w(v){return v===62?(e.consume(v),n.interrupt?t:H):a(v)}function y(v){return le(v)?(e.consume(v),y):L(v)}function g(v){return v===47?(e.consume(v),L):v===58||v===95||jt(v)?(e.consume(v),b):le(v)?(e.consume(v),g):L(v)}function b(v){return v===45||v===46||v===58||v===95||Ct(v)?(e.consume(v),b):T(v)}function T(v){return v===61?(e.consume(v),C):le(v)?(e.consume(v),T):g(v)}function C(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),s=v,M):le(v)?(e.consume(v),C):R(v)}function M(v){return v===s?(e.consume(v),s=null,P):v===null||Y(v)?a(v):(e.consume(v),M)}function R(v){return v===null||v===34||v===39||v===47||v===60||v===61||v===62||v===96||Re(v)?T(v):(e.consume(v),R)}function P(v){return v===47||v===62||le(v)?g(v):a(v)}function L(v){return v===62?(e.consume(v),$):a(v)}function $(v){return v===null||Y(v)?H(v):le(v)?(e.consume(v),$):a(v)}function H(v){return v===45&&r===2?(e.consume(v),N):v===60&&r===1?(e.consume(v),D):v===62&&r===4?(e.consume(v),Ve):v===63&&r===3?(e.consume(v),I):v===93&&r===5?(e.consume(v),se):Y(v)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Az,rt,F)(v)):v===null||Y(v)?(e.exit("htmlFlowData"),F(v)):(e.consume(v),H)}function F(v){return e.check(Rz,W,rt)(v)}function W(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),V}function V(v){return v===null||Y(v)?F(v):(e.enter("htmlFlowData"),H(v))}function N(v){return v===45?(e.consume(v),I):H(v)}function D(v){return v===47?(e.consume(v),i="",G):H(v)}function G(v){if(v===62){let K=i.toLowerCase();return oy.includes(K)?(e.consume(v),Ve):H(v)}return jt(v)&&i.length<8?(e.consume(v),i+=String.fromCharCode(v),G):H(v)}function se(v){return v===93?(e.consume(v),I):H(v)}function I(v){return v===62?(e.consume(v),Ve):v===45&&r===2?(e.consume(v),I):H(v)}function Ve(v){return v===null||Y(v)?(e.exit("htmlFlowData"),rt(v)):(e.consume(v),Ve)}function rt(v){return e.exit("htmlFlow"),t(v)}}function Oz(e,t,a){let n=this;return r;function r(i){return Y(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 Pz(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Fn,t,a)}}var iy,Az,Rz,gL=k(()=>{"use strict";je();hL();Tf();iy={concrete:!0,name:"htmlFlow",resolveTo:Dz,tokenize:_z},Az={partial:!0,tokenize:Pz},Rz={partial:!0,tokenize:Oz}});function Nz(e,t,a){let n=this,r,o,i;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),s}function s(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),T):I===63?(e.consume(I),g):jt(I)?(e.consume(I),R):a(I)}function u(I){return I===45?(e.consume(I),c):I===91?(e.consume(I),o=0,m):jt(I)?(e.consume(I),y):a(I)}function c(I){return I===45?(e.consume(I),p):a(I)}function d(I){return I===null?a(I):I===45?(e.consume(I),f):Y(I)?(i=d,D(I)):(e.consume(I),d)}function f(I){return I===45?(e.consume(I),p):d(I)}function p(I){return I===62?N(I):I===45?f(I):d(I)}function m(I){let Ve="CDATA[";return I===Ve.charCodeAt(o++)?(e.consume(I),o===Ve.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),S):Y(I)?(i=x,D(I)):(e.consume(I),x)}function S(I){return I===93?(e.consume(I),w):x(I)}function w(I){return I===62?N(I):I===93?(e.consume(I),w):x(I)}function y(I){return I===null||I===62?N(I):Y(I)?(i=y,D(I)):(e.consume(I),y)}function g(I){return I===null?a(I):I===63?(e.consume(I),b):Y(I)?(i=g,D(I)):(e.consume(I),g)}function b(I){return I===62?N(I):g(I)}function T(I){return jt(I)?(e.consume(I),C):a(I)}function C(I){return I===45||Ct(I)?(e.consume(I),C):M(I)}function M(I){return Y(I)?(i=M,D(I)):le(I)?(e.consume(I),M):N(I)}function R(I){return I===45||Ct(I)?(e.consume(I),R):I===47||I===62||Re(I)?P(I):a(I)}function P(I){return I===47?(e.consume(I),N):I===58||I===95||jt(I)?(e.consume(I),L):Y(I)?(i=P,D(I)):le(I)?(e.consume(I),P):N(I)}function L(I){return I===45||I===46||I===58||I===95||Ct(I)?(e.consume(I),L):$(I)}function $(I){return I===61?(e.consume(I),H):Y(I)?(i=$,D(I)):le(I)?(e.consume(I),$):P(I)}function H(I){return I===null||I===60||I===61||I===62||I===96?a(I):I===34||I===39?(e.consume(I),r=I,F):Y(I)?(i=H,D(I)):le(I)?(e.consume(I),H):(e.consume(I),W)}function F(I){return I===r?(e.consume(I),r=void 0,V):I===null?a(I):Y(I)?(i=F,D(I)):(e.consume(I),F)}function W(I){return I===null||I===34||I===39||I===60||I===61||I===96?a(I):I===47||I===62||Re(I)?P(I):(e.consume(I),W)}function V(I){return I===47||I===62||Re(I)?P(I):a(I)}function N(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function D(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return le(I)?ie(e,se,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):se(I)}function se(I){return e.enter("htmlTextData"),i(I)}}var ly,wL=k(()=>{"use strict";_t();je();ly={name:"htmlText",tokenize:Nz}});function zz(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&&Dt(e,0,e.length,a),e}function qz(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=ha(l,e.slice(o+1,o+n+3)),l=ha(l,[["enter",c,t]]),l=ha(l,no(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ha(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ha(l,e.slice(i+1)),l=ha(l,[["exit",s,t]]),Dt(e,o,e.length,l),e}function Hz(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(oa(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(Bz,c,i?c:d)(f):f===91?e.attempt(Uz,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(Fz,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function jz(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 Re(d)?Yo(e,o)(d):o(d)}function o(d){return d===41?c(d):_f(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Re(d)?Yo(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Pf(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return Re(d)?Yo(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 Vz(e,t,a){let n=this;return r;function r(l){return Of.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(oa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function Wz(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 Zo,Bz,Uz,Fz,Nf=k(()=>{"use strict";Qw();Jw();ey();ty();je();mr();yl();yu();Zo={name:"labelEnd",resolveAll:zz,resolveTo:qz,tokenize:Hz},Bz={tokenize:jz},Uz={tokenize:Vz},Fz={tokenize:Wz}});function Gz(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 sy,yL=k(()=>{"use strict";Nf();sy={name:"labelStartImage",resolveAll:Zo.resolveAll,tokenize:Gz}});function $z(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 uy,xL=k(()=>{"use strict";Nf();uy={name:"labelStartLink",resolveAll:Zo.resolveAll,tokenize:$z}});function Xz(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ie(e,t,"linePrefix")}}var Su,vL=k(()=>{"use strict";_t();Su={name:"lineEnding",tokenize:Xz}});function Kz(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||Y(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),le(u)?ie(e,l,"whitespace")(u):l(u))}}var Qo,cy=k(()=>{"use strict";_t();je();Qo={name:"thematicBreak",tokenize:Kz}});function Qz(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:gu(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(Qo,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 gu(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(Fn,n.interrupt?a:c,e.attempt(Yz,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return le(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 Jz(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Fn,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!le(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(Zz,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(e,e.attempt(ia,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function e4(e,t,a){let n=this;return ie(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 t4(e){e.exit(this.containerState.type)}function a4(e,t,a){let n=this;return ie(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!le(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var ia,Yz,Zz,bL=k(()=>{"use strict";_t();je();Tf();cy();ia={continuation:{tokenize:Jz},exit:t4,name:"list",tokenize:Qz},Yz={partial:!0,tokenize:a4},Zz={partial:!0,tokenize:e4}});function n4(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 r4(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"),le(u)?ie(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Bf,SL=k(()=>{"use strict";_t();je();Bf={name:"setextUnderline",resolveTo:n4,tokenize:r4}});var Uf=k(()=>{"use strict";eL();tL();Tf();aL();nL();rL();iL();lL();sL();cL();dL();fL();pL();gL();wL();Nf();yL();xL();vL();bL();SL();cy()});function dy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:u4,continuation:{tokenize:c4},exit:d4}},text:{91:{name:"gfmFootnoteCall",tokenize:s4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:i4,resolveTo:l4}}}}function i4(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=oa(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 l4(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 s4(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||Re(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(oa(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return Re(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 u4(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||Re(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=oa(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Re(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),ie(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function c4(e,t,a){return e.check(Fn,t,e.attempt(o4,t,a))}function d4(e){e.exit("gfmFootnoteDefinition")}function f4(e,t,a){let n=this;return ie(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 o4,IL=k(()=>{"use strict";Uf();_t();je();yl();o4={tokenize:f4,partial:!0}});var CL=k(()=>{"use strict";IL()});function fy(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&&Dt(f,f.length,0,no(p,i.slice(u+1,s),l)),Dt(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),Dt(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=pr(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let S=i.exit("strikethroughSequenceTemporary"),w=pr(m);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,l(m)}}}var kL=k(()=>{"use strict";mr();xf();yu()});var TL=k(()=>{"use strict";kL()});function p4(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 Ff,LL=k(()=>{"use strict";Ff=class{constructor(){this.map=[]}add(t,a,n){p4(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 EL(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 ML=k(()=>{"use strict"});function py(){return{flow:{null:{name:"table",tokenize:m4,resolveAll:h4}}}}function m4(e,t,a){let n=this,r=0,o=0,i;return l;function l(L){let $=n.events.length-1;for(;$>-1;){let W=n.events[$][1].type;if(W==="lineEnding"||W==="linePrefix")$--;else break}let H=$>-1?n.events[$][1].type:null,F=H==="tableHead"||H==="tableRow"?C:s;return F===C&&n.parser.lazy[n.now().line]?a(L):F(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):Y(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):le(L)?ie(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||Re(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,le(L)?ie(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?S(L):L===124?(i=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):T(L)}function x(L){return le(L)?ie(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),w):L===45?(o+=1,w(L)):L===null||Y(L)?b(L):T(L)}function w(L){return L===45?(e.enter("tableDelimiterFiller"),y(L)):T(L)}function y(L){return L===45?(e.consume(L),y):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 le(L)?ie(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||Y(L)?!i||r!==o?T(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):T(L)}function T(L){return a(L)}function C(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||Y(L)?(e.exit("tableRow"),t(L)):le(L)?ie(e,M,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||Re(L)?(e.exit("data"),M(L)):(e.consume(L),L===92?P:R)}function P(L){return L===92||L===124?(e.consume(L),R):R(L)}}function h4(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 Ff;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(AL(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=zf(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=zf(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=zf(f,t,o,r,a,d)):i[1]!==0&&(d=zf(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&AL(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=EL(t.events,a))}return e}function zf(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Il(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Il(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=Il(t.events,a[2]),c=Il(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({},Il(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function AL(e,t,a,n,r){let o=[],i=Il(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 Il(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var RL=k(()=>{"use strict";_t();je();LL();ML()});var DL=k(()=>{"use strict";RL()});function my(){return{text:{91:g4}}}function w4(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 Re(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 Y(s)?t(s):le(s)?e.check({tokenize:y4},t,a)(s):a(s)}}function y4(e,t,a){return ie(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var g4,_L=k(()=>{"use strict";_t();je();g4={name:"tasklistCheck",tokenize:w4}});var OL=k(()=>{"use strict";_L()});function PL(e){return kf([Gw(),dy(),fy(e),py(),my()])}var NL=k(()=>{"use strict";Vw();Q1();CL();TL();DL();OL()});function qf(e){let t=this,a=e||x4,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(PL(a)),o.push(Hw()),i.push(jw(a))}var x4,BL=k(()=>{"use strict";q1();NL();x4={}});var UL=k(()=>{"use strict";BL()});var v4,b4,S4,FL,I4,C4,zL,jL,VL,k4,T4,L4,E4,M4,A4,R4,Jo,WL,D4,_4,O4,P4,N4,B4,qL,ro,Cl,U4,GL,jf,F4,$L,gy,z4,q4,XL,H4,j4,V4,W4,G4,$4,X4,K4,Y4,KL,Z4,Q4,J4,eq,tq,aq,Hf,nq,rq,oq,iq,lq,sq,uq,cq,dq,fq,HL,pq,YL,mq,hq,gq,wq,yq,xq,hy,Wa,vq,bq,Sq,ZL,QL=k(()=>{"use strict";v4=Object.defineProperty,b4=Object.defineProperties,S4=Object.getOwnPropertyDescriptors,FL=Object.getOwnPropertySymbols,I4=Object.prototype.hasOwnProperty,C4=Object.prototype.propertyIsEnumerable,zL=(e,t,a)=>t in e?v4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,jL=(e,t)=>{for(var a in t||(t={}))I4.call(t,a)&&zL(e,a,t[a]);if(FL)for(var a of FL(t))C4.call(t,a)&&zL(e,a,t[a]);return e},VL=(e,t)=>b4(e,S4(t)),k4=/(\*\*)([^*]*\*?)$/,T4=/(__)([^_]*?)$/,L4=/(\*\*\*)([^*]*?)$/,E4=/(\*)([^*]*?)$/,M4=/(_)([^_]*?)$/,A4=/(`)([^`]*?)$/,R4=/(~~)([^~]*?)$/,Jo=/^[\s_~*`]*$/,WL=/^[\s]*[-*+][\s]+$/,D4=/[\p{L}\p{N}_]/u,_4=/^```[^`\n]*```?$/,O4=/^\*{4,}$/,P4=/(__)([^_]+)_$/,N4=/(~~)([^~]+)~$/,B4=/__/g,qL=/~~/g,ro=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:D4.test(e)},Cl=(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},U4=(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},GL=(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},jf=(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},F4=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
+
`)return!1}return!1},$L=(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]==="]"?F4(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},gy=(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},z4=(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},q4=(e,t,a,n)=>a==="\\"||e.includes("$")&&jf(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&ro(a)&&ro(n)||z4(e,t,n)),XL=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]:"";q4(e,n,r,o)||(t+=1)}return t},H4=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&jf(e,t)||$L(e,t)||a==="_"||n==="_"||a&&n&&ro(a)&&ro(n)),j4=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]:"";H4(e,n,r,o)||(t+=1)}return t},V4=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},W4=(e,t,a)=>{if(!t||Jo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
30
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return WL.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:gy(e,a,"*")},G4=e=>{let t=e.match(k4);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return Cl(e,n)||W4(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},$4=(e,t,a)=>{if(!t||Jo.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
32
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return WL.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:gy(e,a,"_")},X4=e=>{let t=e.match(T4);if(!t){let r=e.match(P4);if(r){let o=e.lastIndexOf(r[1]);if(!Cl(e,o)&&(e.match(B4)||[]).length%2===1)return`${e}_`}return e}let a=t[2],n=e.lastIndexOf(t[1]);return Cl(e,n)||$4(e,a,n)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},K4=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!jf(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&ro(a)&&ro(n))continue;return t}return-1},Y4=e=>{if(!e.match(E4))return e;let t=K4(e);if(t===-1||Cl(e,t))return e;let a=e.substring(t+1);return!a||Jo.test(a)?e:XL(e)%2===1?`${e}*`:e},KL=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!jf(e,t)&&!$L(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&ro(a)&&ro(n))continue;return t}return-1},Z4=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}_`},Q4=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=KL(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},J4=e=>{if(!e.match(M4))return e;let t=KL(e);if(t===-1||Cl(e,t))return e;let a=e.substring(t+1);if(!a||Jo.test(a))return e;if(j4(e)%2===1){let n=Q4(e);return n!==null?n:Z4(e)}return e},eq=e=>{let t=(e.match(/\*\*/g)||[]).length,a=XL(e);return t%2===0&&a%2===0},tq=(e,t,a)=>!t||Jo.test(t)||Cl(e,a)?!0:gy(e,a,"*"),aq=e=>{if(O4.test(e))return e;let t=e.match(L4);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return tq(e,a,n)?e:V4(e)%2===1?eq(e)?e:`${e}***`:e},Hf=(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},nq=(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},rq=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!nq(e,a)&&(t+=1);return t},oq=e=>!e.match(_4)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,iq=e=>(e.match(/```/g)||[]).length%2===1,lq=e=>{let t=oq(e);if(t!==null)return t;let a=e.match(A4);if(a&&!iq(e)){let n=a[2];if(!n||Jo.test(n))return e;if(rq(e)%2===1)return`${e}\``}return e},sq=(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)==="```",uq=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!sq(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},cq=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},cq=e=>{let t=e.match(S4);if(t){let a=t[2];if(!a||Jo.test(a))return e;if((e.match(UL)||[]).length%2===1)return`${e}~~`}else if(e.match(L4)&&(e.match(UL)||[]).length%2===1)return`${e}~`;return e},my=e=>e!==!1,Wa={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},dq=[{handler:{name:"setextHeadings",handle:uq,priority:Wa.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:$L,priority:Wa.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:$4,priority:Wa.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:B4,priority:Wa.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:F4,priority:Wa.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:q4,priority:Wa.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:V4,priority:Wa.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:Q4,priority:Wa.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:cq,priority:Wa.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:aq,priority:Wa.KATEX},optionKey:"katex"}],fq=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return dq.filter(({handler:n,optionKey:r})=>n.name==="links"?my(e?.links)||my(e?.images):my(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:qL(zL({},n),{handle:o=>$L(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},pq=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=fq(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:qL(zL({},l),{priority:(s=l.priority)!=null?s:Wa.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:Wa.DEFAULT)-((c=s.handler.priority)!=null?c:Wa.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},XL=pq});function YL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var ZL=k(()=>{"use strict"});function jf(e,t){return((t||gq).jsx?hq:mq).test(e)}var mq,hq,gq,QL=k(()=>{"use strict";mq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gq={}});var JL=k(()=>{"use strict";QL()});function gy(e){return typeof e=="object"?e.type==="text"?eE(e.value):!1:eE(e)}function eE(e){return e.replace(wq,"")===""}var wq,tE=k(()=>{"use strict";wq=/[ \t\n\f\r]/g});var aE=k(()=>{"use strict";tE()});var gr,wy=k(()=>{"use strict";gr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};gr.prototype.normal={};gr.prototype.property={};gr.prototype.space=void 0});function yy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new gr(a,n,t)}var nE=k(()=>{"use strict";wy()});function Iu(e){return e.toLowerCase()}var xy=k(()=>{"use strict"});var Xt,vy=k(()=>{"use strict";Xt=class{constructor(t,a){this.attribute=a,this.property=t}};Xt.prototype.attribute="";Xt.prototype.booleanish=!1;Xt.prototype.boolean=!1;Xt.prototype.commaOrSpaceSeparated=!1;Xt.prototype.commaSeparated=!1;Xt.prototype.defined=!1;Xt.prototype.mustUseProperty=!1;Xt.prototype.number=!1;Xt.prototype.overloadedBoolean=!1;Xt.prototype.property="";Xt.prototype.spaceSeparated=!1;Xt.prototype.space=void 0});var Cu={};fc(Cu,{boolean:()=>ge,booleanish:()=>kt,commaOrSpaceSeparated:()=>Aa,commaSeparated:()=>oo,number:()=>j,overloadedBoolean:()=>Vf,spaceSeparated:()=>at});function ei(){return 2**++yq}var yq,ge,kt,Vf,j,at,oo,Aa,ku=k(()=>{"use strict";yq=0,ge=ei(),kt=ei(),Vf=ei(),j=ei(),at=ei(),oo=ei(),Aa=ei()});function rE(e,t,a){a&&(e[t]=a)}var by,ti,Sy=k(()=>{"use strict";vy();ku();by=Object.keys(Cu),ti=class extends Xt{constructor(t,a,n,r){let o=-1;if(super(t,a),rE(this,"space",r),typeof n=="number")for(;++o<by.length;){let i=by[o];rE(this,by[o],(n&Cu[i])===Cu[i])}}};ti.prototype.defined=!0});function un(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new ti(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Iu(n)]=n,a[Iu(o.attribute)]=n}return new gr(t,a,e.space)}var ai=k(()=>{"use strict";xy();Sy();wy()});var Iy,oE=k(()=>{"use strict";ai();ku();Iy=un({properties:{ariaActiveDescendant:null,ariaAtomic:kt,ariaAutoComplete:null,ariaBusy:kt,ariaChecked:kt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:kt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:kt,ariaFlowTo:at,ariaGrabbed:kt,ariaHasPopup:null,ariaHidden:kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:j,ariaLive:null,ariaModal:kt,ariaMultiLine:kt,ariaMultiSelectable:kt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:kt,ariaReadOnly:kt,ariaRelevant:null,ariaRequired:kt,ariaRoleDescription:at,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:kt,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Wf(e,t){return t in e?e[t]:t}var Cy=k(()=>{"use strict"});function Gf(e,t){return Wf(e,t.toLowerCase())}var ky=k(()=>{"use strict";Cy()});var iE,lE=k(()=>{"use strict";ky();ai();ku();iE=un({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:at,autoFocus:ge,autoPlay:ge,blocking:at,capture:null,charSet:null,checked:ge,cite:null,className:at,cols:j,colSpan:null,content:null,contentEditable:kt,controls:ge,controlsList:at,coords:j|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Vf,draggable:kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:at,height:j,hidden:Vf,high:j,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:at,itemRef:at,itemScope:ge,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,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:ge,optimum:j,pattern:null,ping:at,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:at,required:ge,reversed:ge,rows:j,rowSpan:j,sandbox:at,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:kt,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:kt,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:Gf})});var sE,uE=k(()=>{"use strict";Cy();ai();ku();sE=un({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:Aa,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:at,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:Aa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Aa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Aa,rev:Aa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Aa,requiredFeatures:Aa,requiredFonts:Aa,requiredFormats:Aa,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:Aa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Aa,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Aa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wf})});var Ty,cE=k(()=>{"use strict";ai();Ty=un({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 Ly,dE=k(()=>{"use strict";ai();ky();Ly=un({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gf})});var Ey,fE=k(()=>{"use strict";ai();Ey=un({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var My,pE=k(()=>{"use strict";My={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 Ay(e,t){let a=Iu(t),n=t,r=Xt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&vq.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(mE,Sq);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!mE.test(o)){let i=o.replace(xq,bq);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=ti}return new r(n,t)}function bq(e){return"-"+e.toLowerCase()}function Sq(e){return e.charAt(1).toUpperCase()}var xq,mE,vq,hE=k(()=>{"use strict";Sy();vy();xy();xq=/[A-Z]/g,mE=/-[a-z]/g,vq=/^data[-\w.:]+$/i});var gE,$f,wE=k(()=>{"use strict";nE();oE();lE();uE();cE();dE();fE();pE();hE();gE=yy([Iy,iE,Ty,Ly,Ey],"html"),$f=yy([Iy,sE,Ty,Ly,Ey],"svg")});function yE(e){return e.join(" ").trim()}var xE=k(()=>{"use strict"});var kE=na((Ate,CE)=>{"use strict";var vE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Iq=/\n/g,Cq=/^\s*/,kq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Tq=/^:\s*/,Lq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Eq=/^[;\s]*/,Mq=/^\s+|\s+$/g,Aq=`
|
|
42
|
-
`,bE="/",SE="*",ni="",Rq="comment",Dq="declaration";function _q(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(Iq);x&&(a+=x.length);var S=m.lastIndexOf(Aq);n=~S?m.length-S: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 S=x[0];return r(S),e=e.slice(S.length),x}}function u(){s(Cq)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(bE!=e.charAt(0)||SE!=e.charAt(1))){for(var x=2;ni!=e.charAt(x)&&(SE!=e.charAt(x)||bE!=e.charAt(x+1));)++x;if(x+=2,ni===e.charAt(x-1))return l("End of comment missing");var S=e.slice(2,x-2);return n+=2,r(S),e=e.slice(x),n+=2,m({type:Rq,comment:S})}}function f(){var m=o(),x=s(kq);if(x){if(d(),!s(Tq))return l("property missing ':'");var S=s(Lq),w=m({type:Dq,property:IE(x[0].replace(vE,ni)),value:S?IE(S[0].replace(vE,ni)):ni});return s(Eq),w}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function IE(e){return e?e.replace(Mq,ni):ni}CE.exports=_q});var TE=na(Tu=>{"use strict";var Oq=Tu&&Tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=Nq;var Pq=Oq(kE());function Nq(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,Pq.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 EE=na(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.camelCase=void 0;var Bq=/^--[a-zA-Z0-9_-]+$/,Uq=/-([a-z])/g,Fq=/^[^-]+$/,zq=/^-(webkit|moz|ms|o|khtml)-/,qq=/^-(ms)-/,Hq=function(e){return!e||Fq.test(e)||Bq.test(e)},jq=function(e,t){return t.toUpperCase()},LE=function(e,t){return"".concat(t,"-")},Vq=function(e,t){return t===void 0&&(t={}),Hq(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qq,LE):e=e.replace(zq,LE),e.replace(Uq,jq))};Xf.camelCase=Vq});var AE=na((Dy,ME)=>{"use strict";var Wq=Dy&&Dy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gq=Wq(TE()),$q=EE();function Ry(e,t){var a={};return!e||typeof e!="string"||(0,Gq.default)(e,function(n,r){n&&r&&(a[(0,$q.camelCase)(n,t)]=r)}),a}Ry.default=Ry;ME.exports=Ry});function io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?RE(e.position):"start"in e||"end"in e?RE(e):"line"in e||"column"in e?_y(e):""}function _y(e){return DE(e&&e.line)+":"+DE(e&&e.column)}function RE(e){return _y(e&&e.start)+"-"+_y(e&&e.end)}function DE(e){return e&&typeof e=="number"?e:1}var _E=k(()=>{"use strict"});var Oy=k(()=>{"use strict";_E()});var _t,OE=k(()=>{"use strict";Oy();_t=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=io(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}};_t.prototype.file="";_t.prototype.name="";_t.prototype.reason="";_t.prototype.message="";_t.prototype.stack="";_t.prototype.column=void 0;_t.prototype.line=void 0;_t.prototype.ancestors=void 0;_t.prototype.cause=void 0;_t.prototype.fatal=void 0;_t.prototype.place=void 0;_t.prototype.ruleId=void 0;_t.prototype.source=void 0});var Py=k(()=>{"use strict";OE()});function By(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=o5(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=r5(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"?$f:gE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=BE(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function BE(e,t,a){if(t.type==="element")return Qq(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return t5(e,t,a);if(t.type==="mdxjsEsm")return e5(e,t);if(t.type==="root")return a5(e,t,a);if(t.type==="text")return n5(e,t)}function Qq(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=$f,e.schema=r),e.ancestors.push(t);let o=FE(e,t.tagName,!1),i=i5(e,t),l=Fy(e,t);return Yq.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!gy(s):!0})),UE(e,i,o,t),Uy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function Jq(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)}Lu(e,t.position)}function e5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function t5(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=$f,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:FE(e,t.name,!0),i=l5(e,t),l=Fy(e,t);return UE(e,i,o,t),Uy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function a5(e,t,a){let n={};return Uy(n,Fy(e,t)),e.create(t,e.Fragment,n,a)}function n5(e,t){return t.value}function UE(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Uy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function r5(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 o5(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=wl(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 i5(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Ny.call(t.properties,r)){let o=s5(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&Zq.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 l5(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 Lu(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 Lu(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Fy(e,t){let a=[],n=-1,r=e.passKeys?new Map:Xq;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=BE(e,o,i);l!==void 0&&a.push(l)}return a}function s5(e,t,a){let n=Ay(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?YL(a):yE(a)),n.property==="style"){let r=typeof a=="object"?a:u5(e,String(a));return e.stylePropertyNameCase==="css"&&(r=c5(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?My[n.property]||n.property:n.attribute,a]}}function u5(e,t){try{return(0,PE.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new _t("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=NE+"#cannot-parse-style-attribute",r}}function FE(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=jf(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=jf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Ny.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Lu(e)}function Lu(e,t){let a=new _t("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=NE+"#cannot-handle-mdx-estrees-without-createevaluater",a}function c5(e){let t={},a;for(a in e)Ny.call(e,a)&&(t[d5(a)]=e[a]);return t}function d5(e){let t=e.replace(Kq,f5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function f5(e){return"-"+e.toLowerCase()}var PE,Ny,Xq,Kq,Yq,Zq,NE,zE=k(()=>{"use strict";ZL();JL();aE();wE();xE();PE=q(AE(),1);mu();Py();Ny={}.hasOwnProperty,Xq=new Map,Kq=/[A-Z]/g,Yq=new Set(["table","tbody","thead","tfoot","tr"]),Zq=new Set(["td","th"]),NE="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var qE=k(()=>{"use strict";zE()});function p5(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"),oe(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 X(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var HE,jE=k(()=>{"use strict";Dt();ze();HE={tokenize:p5}});function m5(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&&y();let b=t.events.length,T=b,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}w(n);let A=b;for(;A<t.events.length;)t.events[A][1].end={...C},A++;return Rt(t.events,T+1,0,t.events.slice(b)),t.events.length=A,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(VE,c,d)(g)}function c(g){return r&&y(),w(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(VE,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&y(),w(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){S(e.exit("chunkFlow"),!0),w(0),e.consume(g);return}return X(g)?(e.consume(g),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function S(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 C=r.events.length;for(;C--;)if(r.events[C][1].start.offset<i&&(!r.events[C][1].end||r.events[C][1].end.offset>i))return;let A=t.events.length,R=A,P,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(P){L=t.events[R][1].end;break}P=!0}for(w(n),C=A;C<t.events.length;)t.events[C][1].end={...L},C++;Rt(t.events,R+1,0,t.events.slice(A)),t.events.length=C}}function w(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 y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function h5(e,t,a){return oe(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var WE,VE,GE=k(()=>{"use strict";Dt();ze();mr();WE={tokenize:m5},VE={tokenize:h5}});function g5(e){let t=this,a=e.attempt(Un,n,e.attempt(this.parser.constructs.flowInitial,r,oe(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Yw,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 $E,XE=k(()=>{"use strict";Bf();Dt();$E={tokenize:g5}});function QE(e){return{resolveAll:JE(e==="text"?w5: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 JE(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 w5(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 KE,YE,ZE,zy=k(()=>{"use strict";KE={resolveAll:JE()},YE=QE("string"),ZE=QE("text")});var qy={};fc(qy,{attentionMarkers:()=>k5,contentInitial:()=>x5,disable:()=>T5,document:()=>y5,flow:()=>b5,flowInitial:()=>v5,insideSpan:()=>C5,string:()=>S5,text:()=>I5});var y5,x5,v5,b5,S5,I5,C5,k5,T5,eM=k(()=>{"use strict";Bf();zy();y5={42:ia,43:ia,45:ia,48:ia,49:ia,50:ia,51:ia,52:ia,53:ia,54:ia,55:ia,56:ia,57:ia,62:Tf},x5={91:ty},v5={[-2]:vu,[-1]:vu,32:vu},b5={35:ny,42:Qo,45:[Nf,Qo],60:oy,61:Nf,95:Qo,96:Mf,126:Mf},S5={38:Ef,92:Lf},I5={[-5]:Su,[-4]:Su,[-3]:Su,33:ly,38:Ef,42:xu,60:[$w,iy],91:sy,92:[ay,Lf],93:Zo,95:xu,96:Xw},C5={null:[xu,KE]},k5={null:[42,95]},T5={null:[]}});function tM(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:P(A),check:P(R),consume:b,enter:T,exit:C,interrupt:P(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:S,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(F){return i=ha(i,F),y(),i[i.length-1]!==null?[]:(L(t,0),c.events=no(o,c.events,c),c.events)}function m(F,$){return E5(x(F),$)}function x(F){return L5(i,F)}function S(){let{_bufferIndex:F,_index:$,line:G,column:B,offset:D}=n;return{_bufferIndex:F,_index:$,line:G,column:B,offset:D}}function w(F){r[F.line]=F.column,H()}function y(){let F;for(;n._index<i.length;){let $=i[n._index];if(typeof $=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<$.length;)g($.charCodeAt(n._bufferIndex));else g($)}}function g(F){s=void 0,f=F,d=d(F)}function b(F){X(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,H()):F!==-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=F,s=!0}function T(F,$){let G=$||{};return G.type=F,G.start=S(),c.events.push(["enter",G,c]),l.push(G),G}function C(F){let $=l.pop();return $.end=S(),c.events.push(["exit",$,c]),$}function A(F,$){L(F,$.from)}function R(F,$){$.restore()}function P(F,$){return G;function G(B,D,Q){let be,I,qe,lt;return Array.isArray(B)?z(B):"tokenize"in B?z([B]):v(B);function v(Se){return pe;function pe(ue){let de=ue!==null&&Se[ue],Z=ue!==null&&Se.null,He=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return z(He)(ue)}}function z(Se){return be=Se,I=0,Se.length===0?Q:J(Se[I])}function J(Se){return pe;function pe(ue){return lt=W(),qe=Se,Se.partial||(c.currentConstruct=Se),Se.name&&c.parser.constructs.disable.null.includes(Se.name)?$e(ue):Se.tokenize.call($?Object.assign(Object.create(c),$):c,u,we,$e)(ue)}}function we(Se){return s=!0,F(qe,lt),D}function $e(Se){return s=!0,lt.restore(),++I<be.length?J(be[I]):Q}}}function L(F,$){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&Rt(c.events,$,c.events.length-$,F.resolve(c.events.slice($),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function W(){let F=S(),$=c.previous,G=c.currentConstruct,B=c.events.length,D=Array.from(l);return{from:B,restore:Q};function Q(){n=F,c.previous=$,c.currentConstruct=G,c.events.length=B,l=D,H()}}function H(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function L5(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 E5(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}$$`},dq=e=>uq(e)%2===0?e:cq(e),fq=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=U4(e,t);if(n===-1||Hf(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)`},HL=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!Hf(e,a)){if(a>0&&e[a-1]==="!")continue;let n=GL(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},pq=(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=HL(e,t);return l!==-1?e.substring(0,l)+e.substring(l+1):`${i}${o}`}return`${e}](streamdown:incomplete-link)`}if(GL(e,t)===-1){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let l=HL(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},YL=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!Hf(e,a)){let n=fq(e,a,t);if(n!==null)return n}for(let n=e.length-1;n>=0;n-=1)if(e[n]==="["&&!Hf(e,n)){let r=pq(e,n,t);if(r!==null)return r}return e},mq=/^-{1,2}$/,hq=/^[\s]*-{1,2}[\s]+$/,gq=/^={1,2}$/,wq=/^[\s]*={1,2}[\s]+$/,yq=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(mq.test(r)&&!a.match(hq)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(gq.test(r)&&!a.match(wq)){let o=n.split(`
|
|
41
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},xq=e=>{let t=e.match(R4);if(t){let a=t[2];if(!a||Jo.test(a))return e;if((e.match(qL)||[]).length%2===1)return`${e}~~`}else if(e.match(N4)&&(e.match(qL)||[]).length%2===1)return`${e}~`;return e},hy=e=>e!==!1,Wa={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},vq=[{handler:{name:"setextHeadings",handle:yq,priority:Wa.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:YL,priority:Wa.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:aq,priority:Wa.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:G4,priority:Wa.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:X4,priority:Wa.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:Y4,priority:Wa.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:J4,priority:Wa.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:lq,priority:Wa.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:xq,priority:Wa.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:dq,priority:Wa.KATEX},optionKey:"katex"}],bq=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return vq.filter(({handler:n,optionKey:r})=>n.name==="links"?hy(e?.links)||hy(e?.images):hy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:VL(jL({},n),{handle:o=>YL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},Sq=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=bq(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:VL(jL({},l),{priority:(s=l.priority)!=null?s:Wa.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:Wa.DEFAULT)-((c=s.handler.priority)!=null?c:Wa.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},ZL=Sq});function JL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var eE=k(()=>{"use strict"});function Vf(e,t){return((t||kq).jsx?Cq:Iq).test(e)}var Iq,Cq,kq,tE=k(()=>{"use strict";Iq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kq={}});var aE=k(()=>{"use strict";tE()});function wy(e){return typeof e=="object"?e.type==="text"?nE(e.value):!1:nE(e)}function nE(e){return e.replace(Tq,"")===""}var Tq,rE=k(()=>{"use strict";Tq=/[ \t\n\f\r]/g});var oE=k(()=>{"use strict";rE()});var gr,yy=k(()=>{"use strict";gr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};gr.prototype.normal={};gr.prototype.property={};gr.prototype.space=void 0});function xy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new gr(a,n,t)}var iE=k(()=>{"use strict";yy()});function Iu(e){return e.toLowerCase()}var vy=k(()=>{"use strict"});var Kt,by=k(()=>{"use strict";Kt=class{constructor(t,a){this.attribute=a,this.property=t}};Kt.prototype.attribute="";Kt.prototype.booleanish=!1;Kt.prototype.boolean=!1;Kt.prototype.commaOrSpaceSeparated=!1;Kt.prototype.commaSeparated=!1;Kt.prototype.defined=!1;Kt.prototype.mustUseProperty=!1;Kt.prototype.number=!1;Kt.prototype.overloadedBoolean=!1;Kt.prototype.property="";Kt.prototype.spaceSeparated=!1;Kt.prototype.space=void 0});var Cu={};pc(Cu,{boolean:()=>be,booleanish:()=>kt,commaOrSpaceSeparated:()=>Aa,commaSeparated:()=>oo,number:()=>j,overloadedBoolean:()=>Wf,spaceSeparated:()=>at});function ei(){return 2**++Lq}var Lq,be,kt,Wf,j,at,oo,Aa,ku=k(()=>{"use strict";Lq=0,be=ei(),kt=ei(),Wf=ei(),j=ei(),at=ei(),oo=ei(),Aa=ei()});function lE(e,t,a){a&&(e[t]=a)}var Sy,ti,Iy=k(()=>{"use strict";by();ku();Sy=Object.keys(Cu),ti=class extends Kt{constructor(t,a,n,r){let o=-1;if(super(t,a),lE(this,"space",r),typeof n=="number")for(;++o<Sy.length;){let i=Sy[o];lE(this,Sy[o],(n&Cu[i])===Cu[i])}}};ti.prototype.defined=!0});function un(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new ti(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Iu(n)]=n,a[Iu(o.attribute)]=n}return new gr(t,a,e.space)}var ai=k(()=>{"use strict";vy();Iy();yy()});var Cy,sE=k(()=>{"use strict";ai();ku();Cy=un({properties:{ariaActiveDescendant:null,ariaAtomic:kt,ariaAutoComplete:null,ariaBusy:kt,ariaChecked:kt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:kt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:kt,ariaFlowTo:at,ariaGrabbed:kt,ariaHasPopup:null,ariaHidden:kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:j,ariaLive:null,ariaModal:kt,ariaMultiLine:kt,ariaMultiSelectable:kt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:kt,ariaReadOnly:kt,ariaRelevant:null,ariaRequired:kt,ariaRoleDescription:at,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:kt,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Gf(e,t){return t in e?e[t]:t}var ky=k(()=>{"use strict"});function $f(e,t){return Gf(e,t.toLowerCase())}var Ty=k(()=>{"use strict";ky()});var uE,cE=k(()=>{"use strict";Ty();ai();ku();uE=un({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:at,autoFocus:be,autoPlay:be,blocking:at,capture:null,charSet:null,checked:be,cite:null,className:at,cols:j,colSpan:null,content:null,contentEditable:kt,controls:be,controlsList:at,coords:j|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Wf,draggable:kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:at,height:j,hidden:Wf,high:j,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:at,itemRef:at,itemScope:be,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:j,pattern:null,ping:at,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:at,required:be,reversed:be,rows:j,rowSpan:j,sandbox:at,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:kt,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:kt,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:$f})});var dE,fE=k(()=>{"use strict";ky();ai();ku();dE=un({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:Aa,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:at,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:Aa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Aa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Aa,rev:Aa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Aa,requiredFeatures:Aa,requiredFonts:Aa,requiredFormats:Aa,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:Aa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Aa,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Aa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gf})});var Ly,pE=k(()=>{"use strict";ai();Ly=un({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 Ey,mE=k(()=>{"use strict";ai();Ty();Ey=un({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$f})});var My,hE=k(()=>{"use strict";ai();My=un({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Ay,gE=k(()=>{"use strict";Ay={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 Ry(e,t){let a=Iu(t),n=t,r=Kt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Mq.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(wE,Rq);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!wE.test(o)){let i=o.replace(Eq,Aq);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=ti}return new r(n,t)}function Aq(e){return"-"+e.toLowerCase()}function Rq(e){return e.charAt(1).toUpperCase()}var Eq,wE,Mq,yE=k(()=>{"use strict";Iy();by();vy();Eq=/[A-Z]/g,wE=/-[a-z]/g,Mq=/^data[-\w.:]+$/i});var xE,Xf,vE=k(()=>{"use strict";iE();sE();cE();fE();pE();mE();hE();gE();yE();xE=xy([Cy,uE,Ly,Ey,My],"html"),Xf=xy([Cy,dE,Ly,Ey,My],"svg")});function bE(e){return e.join(" ").trim()}var SE=k(()=>{"use strict"});var EE=na((jte,LE)=>{"use strict";var IE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Dq=/\n/g,_q=/^\s*/,Oq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Pq=/^:\s*/,Nq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Bq=/^[;\s]*/,Uq=/^\s+|\s+$/g,Fq=`
|
|
42
|
+
`,CE="/",kE="*",ni="",zq="comment",qq="declaration";function Hq(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(Dq);x&&(a+=x.length);var S=m.lastIndexOf(Fq);n=~S?m.length-S: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 S=x[0];return r(S),e=e.slice(S.length),x}}function u(){s(_q)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(CE!=e.charAt(0)||kE!=e.charAt(1))){for(var x=2;ni!=e.charAt(x)&&(kE!=e.charAt(x)||CE!=e.charAt(x+1));)++x;if(x+=2,ni===e.charAt(x-1))return l("End of comment missing");var S=e.slice(2,x-2);return n+=2,r(S),e=e.slice(x),n+=2,m({type:zq,comment:S})}}function f(){var m=o(),x=s(Oq);if(x){if(d(),!s(Pq))return l("property missing ':'");var S=s(Nq),w=m({type:qq,property:TE(x[0].replace(IE,ni)),value:S?TE(S[0].replace(IE,ni)):ni});return s(Bq),w}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function TE(e){return e?e.replace(Uq,ni):ni}LE.exports=Hq});var ME=na(Tu=>{"use strict";var jq=Tu&&Tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=Wq;var Vq=jq(EE());function Wq(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,Vq.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 RE=na(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.camelCase=void 0;var Gq=/^--[a-zA-Z0-9_-]+$/,$q=/-([a-z])/g,Xq=/^[^-]+$/,Kq=/^-(webkit|moz|ms|o|khtml)-/,Yq=/^-(ms)-/,Zq=function(e){return!e||Xq.test(e)||Gq.test(e)},Qq=function(e,t){return t.toUpperCase()},AE=function(e,t){return"".concat(t,"-")},Jq=function(e,t){return t===void 0&&(t={}),Zq(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Yq,AE):e=e.replace(Kq,AE),e.replace($q,Qq))};Kf.camelCase=Jq});var _E=na((_y,DE)=>{"use strict";var e5=_y&&_y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},t5=e5(ME()),a5=RE();function Dy(e,t){var a={};return!e||typeof e!="string"||(0,t5.default)(e,function(n,r){n&&r&&(a[(0,a5.camelCase)(n,t)]=r)}),a}Dy.default=Dy;DE.exports=Dy});function io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OE(e.position):"start"in e||"end"in e?OE(e):"line"in e||"column"in e?Oy(e):""}function Oy(e){return PE(e&&e.line)+":"+PE(e&&e.column)}function OE(e){return Oy(e&&e.start)+"-"+Oy(e&&e.end)}function PE(e){return e&&typeof e=="number"?e:1}var NE=k(()=>{"use strict"});var Py=k(()=>{"use strict";NE()});var Ot,BE=k(()=>{"use strict";Py();Ot=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=io(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}};Ot.prototype.file="";Ot.prototype.name="";Ot.prototype.reason="";Ot.prototype.message="";Ot.prototype.stack="";Ot.prototype.column=void 0;Ot.prototype.line=void 0;Ot.prototype.ancestors=void 0;Ot.prototype.cause=void 0;Ot.prototype.fatal=void 0;Ot.prototype.place=void 0;Ot.prototype.ruleId=void 0;Ot.prototype.source=void 0});var Ny=k(()=>{"use strict";BE()});function Uy(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=m5(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=p5(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"?Xf:xE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=zE(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function zE(e,t,a){if(t.type==="element")return l5(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return s5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return c5(e,t,a);if(t.type==="mdxjsEsm")return u5(e,t);if(t.type==="root")return d5(e,t,a);if(t.type==="text")return f5(e,t)}function l5(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Xf,e.schema=r),e.ancestors.push(t);let o=HE(e,t.tagName,!1),i=h5(e,t),l=zy(e,t);return o5.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!wy(s):!0})),qE(e,i,o,t),Fy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function s5(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)}Lu(e,t.position)}function u5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function c5(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=Xf,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:HE(e,t.name,!0),i=g5(e,t),l=zy(e,t);return qE(e,i,o,t),Fy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function d5(e,t,a){let n={};return Fy(n,zy(e,t)),e.create(t,e.Fragment,n,a)}function f5(e,t){return t.value}function qE(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Fy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function p5(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 m5(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=wl(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 h5(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&By.call(t.properties,r)){let o=w5(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&i5.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 g5(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 Lu(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 Lu(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function zy(e,t){let a=[],n=-1,r=e.passKeys?new Map:n5;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=zE(e,o,i);l!==void 0&&a.push(l)}return a}function w5(e,t,a){let n=Ry(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?JL(a):bE(a)),n.property==="style"){let r=typeof a=="object"?a:y5(e,String(a));return e.stylePropertyNameCase==="css"&&(r=x5(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Ay[n.property]||n.property:n.attribute,a]}}function y5(e,t){try{return(0,UE.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Ot("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=FE+"#cannot-parse-style-attribute",r}}function HE(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=Vf(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=Vf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return By.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Lu(e)}function Lu(e,t){let a=new Ot("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=FE+"#cannot-handle-mdx-estrees-without-createevaluater",a}function x5(e){let t={},a;for(a in e)By.call(e,a)&&(t[v5(a)]=e[a]);return t}function v5(e){let t=e.replace(r5,b5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function b5(e){return"-"+e.toLowerCase()}var UE,By,n5,r5,o5,i5,FE,jE=k(()=>{"use strict";eE();aE();oE();vE();SE();UE=z(_E(),1);mu();Ny();By={}.hasOwnProperty,n5=new Map,r5=/[A-Z]/g,o5=new Set(["table","tbody","thead","tfoot","tr"]),i5=new Set(["td","th"]),FE="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var VE=k(()=>{"use strict";jE()});function S5(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"),ie(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 Y(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var WE,GE=k(()=>{"use strict";_t();je();WE={tokenize:S5}});function I5(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&&y();let b=t.events.length,T=b,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}w(n);let M=b;for(;M<t.events.length;)t.events[M][1].end={...C},M++;return Dt(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($E,c,d)(g)}function c(g){return r&&y(),w(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($E,p,m)(g)}function p(g){return n++,a.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){r&&y(),w(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){S(e.exit("chunkFlow"),!0),w(0),e.consume(g);return}return Y(g)?(e.consume(g),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function S(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 C=r.events.length;for(;C--;)if(r.events[C][1].start.offset<i&&(!r.events[C][1].end||r.events[C][1].end.offset>i))return;let M=t.events.length,R=M,P,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(P){L=t.events[R][1].end;break}P=!0}for(w(n),C=M;C<t.events.length;)t.events[C][1].end={...L},C++;Dt(t.events,R+1,0,t.events.slice(M)),t.events.length=C}}function w(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 y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function C5(e,t,a){return ie(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var XE,$E,KE=k(()=>{"use strict";_t();je();mr();XE={tokenize:I5},$E={tokenize:C5}});function k5(e){let t=this,a=e.attempt(Fn,n,e.attempt(this.parser.constructs.flowInitial,r,ie(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Zw,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 YE,ZE=k(()=>{"use strict";Uf();_t();YE={tokenize:k5}});function tM(e){return{resolveAll:aM(e==="text"?T5: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 aM(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 T5(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 QE,JE,eM,qy=k(()=>{"use strict";QE={resolveAll:aM()},JE=tM("string"),eM=tM("text")});var Hy={};pc(Hy,{attentionMarkers:()=>O5,contentInitial:()=>E5,disable:()=>P5,document:()=>L5,flow:()=>A5,flowInitial:()=>M5,insideSpan:()=>_5,string:()=>R5,text:()=>D5});var L5,E5,M5,A5,R5,D5,_5,O5,P5,nM=k(()=>{"use strict";Uf();qy();L5={42:ia,43:ia,45:ia,48:ia,49:ia,50:ia,51:ia,52:ia,53:ia,54:ia,55:ia,56:ia,57:ia,62:Lf},E5={91:ay},M5={[-2]:vu,[-1]:vu,32:vu},A5={35:ry,42:Qo,45:[Bf,Qo],60:iy,61:Bf,95:Qo,96:Af,126:Af},R5={38:Mf,92:Ef},D5={[-5]:Su,[-4]:Su,[-3]:Su,33:sy,38:Mf,42:xu,60:[Xw,ly],91:uy,92:[ny,Ef],93:Zo,95:xu,96:Kw},_5={null:[xu,QE]},O5={null:[42,95]},P5={null:[]}});function rM(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:P(M),check:P(R),consume:b,enter:T,exit:C,interrupt:P(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:S,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(F){return i=ha(i,F),y(),i[i.length-1]!==null?[]:(L(t,0),c.events=no(o,c.events,c),c.events)}function m(F,W){return B5(x(F),W)}function x(F){return N5(i,F)}function S(){let{_bufferIndex:F,_index:W,line:V,column:N,offset:D}=n;return{_bufferIndex:F,_index:W,line:V,column:N,offset:D}}function w(F){r[F.line]=F.column,H()}function y(){let F;for(;n._index<i.length;){let W=i[n._index];if(typeof W=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<W.length;)g(W.charCodeAt(n._bufferIndex));else g(W)}}function g(F){s=void 0,f=F,d=d(F)}function b(F){Y(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,H()):F!==-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=F,s=!0}function T(F,W){let V=W||{};return V.type=F,V.start=S(),c.events.push(["enter",V,c]),l.push(V),V}function C(F){let W=l.pop();return W.end=S(),c.events.push(["exit",W,c]),W}function M(F,W){L(F,W.from)}function R(F,W){W.restore()}function P(F,W){return V;function V(N,D,G){let se,I,Ve,rt;return Array.isArray(N)?K(N):"tokenize"in N?K([N]):v(N);function v(me){return he;function he(ue){let fe=ue!==null&&me[ue],J=ue!==null&&me.null,Oe=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(J)?J:J?[J]:[]];return K(Oe)(ue)}}function K(me){return se=me,I=0,me.length===0?G:ee(me[I])}function ee(me){return he;function he(ue){return rt=$(),Ve=me,me.partial||(c.currentConstruct=me),me.name&&c.parser.constructs.disable.null.includes(me.name)?We(ue):me.tokenize.call(W?Object.assign(Object.create(c),W):c,u,xe,We)(ue)}}function xe(me){return s=!0,F(Ve,rt),D}function We(me){return s=!0,rt.restore(),++I<se.length?ee(se[I]):G}}}function L(F,W){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&Dt(c.events,W,c.events.length-W,F.resolve(c.events.slice(W),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function $(){let F=S(),W=c.previous,V=c.currentConstruct,N=c.events.length,D=Array.from(l);return{from:N,restore:G};function G(){n=F,c.previous=W,c.currentConstruct=V,c.events.length=N,l=D,H()}}function H(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function N5(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 B5(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 aM=k(()=>{"use strict";ze();mr();yu()});function Hy(e){let n={constructs:Cf([qy,...(e||{}).extensions||[]]),content:r(HE),defined:[],document:r(WE),flow:r($E),lazy:{},string:r(YE),text:r(ZE)};return n;function r(o){return i;function i(l){return tM(n,o,l)}}}var nM=k(()=>{"use strict";jw();jE();GE();XE();zy();eM();aM()});function jy(e){for(;!Rf(e););return e}var rM=k(()=>{"use strict";Kw()});function Vy(){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(oM.lastIndex=d,u=oM.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 oM,iM=k(()=>{"use strict";oM=/[\0\t\n\r]/g});var lM=k(()=>{"use strict";nM();rM();iM()});function Wy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),M5(a)(jy(Hy(a).document().write(Vy()(e,t,!0))))}function M5(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Je),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Re),blockQuote:o(ue),characterEscape:P,characterReference:P,codeFenced:o(de),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(de,i),codeText:o(Z,i),codeTextData:P,data:P,codeFlowValue:P,definition:o(He),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(Xe),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(Ce,i),htmlFlowData:P,htmlText:o(Ce,i),htmlTextData:P,image:o(xe),label:i,link:o(Je),listItem:o(aa),listItemValue:f,listOrdered:o(jt,d),listUnordered:o(jt),paragraph:o(sa),reference:v,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(Re),strong:o(Xa),thematicBreak:o(fi)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:pe,autolinkProtocol:Se,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:we,characterReference:$e,codeFenced:s(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:s(w),codeText:s(G),codeTextData:L,data:L,definition:s(),definitionDestinationString:b,definitionLabelString:y,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(H),hardBreakTrailing:s(H),htmlFlow:s(F),htmlFlowData:L,htmlText:s($),htmlTextData:L,image:s(D),label:be,labelText:Q,lineEnding:W,link:s(B),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:z,resourceDestinationString:I,resourceTitleString:qe,resource:lt,setextHeading:s(R),setextHeadingLineSequence:A,setextHeadingText:C,strong:s(),thematicBreak:s()}};cM(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(M){let U={type:"root",children:[]},Y={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},ne=[],ke=-1;for(;++ke<M.length;)if(M[ke][1].type==="listOrdered"||M[ke][1].type==="listUnordered")if(M[ke][0]==="enter")ne.push(ke);else{let Ot=ne.pop();ke=r(M,Ot,ke)}for(ke=-1;++ke<M.length;){let Ot=t[M[ke][0]];uM.call(Ot,M[ke][1].type)&&Ot[M[ke][1].type].call(Object.assign({sliceSerialize:M[ke][2].sliceSerialize},Y),M[ke][1])}if(Y.tokenStack.length>0){let Ot=Y.tokenStack[Y.tokenStack.length-1];(Ot[1]||sM).call(Y,void 0,Ot[0])}for(U.position={start:lo(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:lo(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)U=t.transforms[ke](U)||U;return U}function r(M,U,Y){let ne=U-1,ke=-1,Ot=!1,ua,va,ba,ho;for(;++ne<=Y;){let ca=M[ne];switch(ca[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ca[0]==="enter"?ke++:ke--,ho=void 0;break}case"lineEndingBlank":{ca[0]==="enter"&&(ua&&!ho&&!ke&&!ba&&(ba=ne),ho=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ho=void 0}if(!ke&&ca[0]==="enter"&&ca[1].type==="listItemPrefix"||ke===-1&&ca[0]==="exit"&&(ca[1].type==="listUnordered"||ca[1].type==="listOrdered")){if(ua){let Sr=ne;for(va=void 0;Sr--;){let hn=M[Sr];if(hn[1].type==="lineEnding"||hn[1].type==="lineEndingBlank"){if(hn[0]==="exit")continue;va&&(M[va][1].type="lineEndingBlank",Ot=!0),hn[1].type="lineEnding",va=Sr}else if(!(hn[1].type==="linePrefix"||hn[1].type==="blockQuotePrefix"||hn[1].type==="blockQuotePrefixWhitespace"||hn[1].type==="blockQuoteMarker"||hn[1].type==="listItemIndent"))break}ba&&(!va||ba<va)&&(ua._spread=!0),ua.end=Object.assign({},va?M[va][1].start:ca[1].end),M.splice(va||ne,0,["exit",ua,ca[2]]),ne++,Y++}if(ca[1].type==="listItemPrefix"){let Sr={type:"listItem",_spread:!1,start:Object.assign({},ca[1].start),end:void 0};ua=Sr,M.splice(ne,0,["enter",Sr,ca[2]]),ne++,Y++,ba=void 0,ho=!0}}}return M[U][1]._spread=Ot,Y}function o(M,U){return Y;function Y(ne){l.call(this,M(ne),ne),U&&U.call(this,ne)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(M,U,Y){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([U,Y||void 0]),M.position={start:lo(U.start),end:void 0}}function s(M){return U;function U(Y){M&&M.call(this,Y),u.call(this,Y)}}function u(M,U){let Y=this.stack.pop(),ne=this.tokenStack.pop();if(ne)ne[0].type!==M.type&&(U?U.call(this,M,ne[0]):(ne[1]||sM).call(this,M,ne[0]));else throw new Error("Cannot close `"+M.type+"` ("+io({start:M.start,end:M.end})+"): it\u2019s not open");Y.position.end=lo(M.end)}function c(){return $o(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(M){if(this.data.expectingFirstListItemValue){let U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function p(){let M=this.resume(),U=this.stack[this.stack.length-1];U.lang=M}function m(){let M=this.resume(),U=this.stack[this.stack.length-1];U.meta=M}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let M=this.resume(),U=this.stack[this.stack.length-1];U.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let M=this.resume(),U=this.stack[this.stack.length-1];U.value=M.replace(/(\r?\n|\r)$/g,"")}function y(M){let U=this.resume(),Y=this.stack[this.stack.length-1];Y.label=U,Y.identifier=oa(this.sliceSerialize(M)).toLowerCase()}function g(){let M=this.resume(),U=this.stack[this.stack.length-1];U.title=M}function b(){let M=this.resume(),U=this.stack[this.stack.length-1];U.url=M}function T(M){let U=this.stack[this.stack.length-1];if(!U.depth){let Y=this.sliceSerialize(M).length;U.depth=Y}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function A(M){let U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function P(M){let Y=this.stack[this.stack.length-1].children,ne=Y[Y.length-1];(!ne||ne.type!=="text")&&(ne=di(),ne.position={start:lo(M.start),end:void 0},Y.push(ne)),this.stack.push(ne)}function L(M){let U=this.stack.pop();U.value+=this.sliceSerialize(M),U.position.end=lo(M.end)}function W(M){let U=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Y=U.children[U.children.length-1];Y.position.end=lo(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(P.call(this,M),L.call(this,M))}function H(){this.data.atHardBreak=!0}function F(){let M=this.resume(),U=this.stack[this.stack.length-1];U.value=M}function $(){let M=this.resume(),U=this.stack[this.stack.length-1];U.value=M}function G(){let M=this.resume(),U=this.stack[this.stack.length-1];U.value=M}function B(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=U,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function D(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=U,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function Q(M){let U=this.sliceSerialize(M),Y=this.stack[this.stack.length-2];Y.label=M1(U),Y.identifier=oa(U).toLowerCase()}function be(){let M=this.stack[this.stack.length-1],U=this.resume(),Y=this.stack[this.stack.length-1];if(this.data.inReference=!0,Y.type==="link"){let ne=M.children;Y.children=ne}else Y.alt=U}function I(){let M=this.resume(),U=this.stack[this.stack.length-1];U.url=M}function qe(){let M=this.resume(),U=this.stack[this.stack.length-1];U.title=M}function lt(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function z(M){let U=this.resume(),Y=this.stack[this.stack.length-1];Y.label=U,Y.identifier=oa(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function J(M){this.data.characterReferenceType=M.type}function we(M){let U=this.sliceSerialize(M),Y=this.data.characterReferenceType,ne;Y?(ne=If(U,Y==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ne=Sl(U);let ke=this.stack[this.stack.length-1];ke.value+=ne}function $e(M){let U=this.stack.pop();U.position.end=lo(M.end)}function Se(M){L.call(this,M);let U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(M)}function pe(M){L.call(this,M);let U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(M)}function ue(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function jt(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function aa(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function sa(){return{type:"paragraph",children:[]}}function Xa(){return{type:"strong",children:[]}}function di(){return{type:"text",value:""}}function fi(){return{type:"thematicBreak"}}}function lo(e){return{line:e.line,column:e.column,offset:e.offset}}function cM(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?cM(e,n):A5(e,n)}}function A5(e,t){let a;for(a in t)if(uM.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 sM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+io({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is still open")}var uM,dM=k(()=>{"use strict";xf();lM();Ow();A1();yl();Sf();Oy();uM={}.hasOwnProperty});var fM=k(()=>{"use strict";dM()});function Kf(e){let t=this;t.parser=a;function a(n){return Wy(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var pM=k(()=>{"use strict";fM()});var mM=k(()=>{"use strict";pM()});function hM(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 gM=k(()=>{"use strict"});function wM(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 oM=k(()=>{"use strict";je();mr();yu()});function jy(e){let n={constructs:kf([Hy,...(e||{}).extensions||[]]),content:r(WE),defined:[],document:r(XE),flow:r(YE),lazy:{},string:r(JE),text:r(eM)};return n;function r(o){return i;function i(l){return rM(n,o,l)}}}var iM=k(()=>{"use strict";Vw();GE();KE();ZE();qy();nM();oM()});function Vy(e){for(;!Df(e););return e}var lM=k(()=>{"use strict";Yw()});function Wy(){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(sM.lastIndex=d,u=sM.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 sM,uM=k(()=>{"use strict";sM=/[\0\t\n\r]/g});var cM=k(()=>{"use strict";iM();lM();uM()});function Gy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),U5(a)(Vy(jy(a).document().write(Wy()(e,t,!0))))}function U5(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ue),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(ke),blockQuote:o(ue),characterEscape:P,characterReference:P,codeFenced:o(fe),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(fe,i),codeText:o(J,i),codeTextData:P,data:P,codeFlowValue:P,definition:o(Oe),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(He),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(Ie,i),htmlFlowData:P,htmlText:o(Ie,i),htmlTextData:P,image:o(X),label:i,link:o(Ue),listItem:o(aa),listItemValue:f,listOrdered:o(Pt,d),listUnordered:o(Pt),paragraph:o(sa),reference:v,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(ke),strong:o(Xa),thematicBreak:o(fi)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:he,autolinkProtocol:me,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:xe,characterReference:We,codeFenced:s(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:s(w),codeText:s(V),codeTextData:L,data:L,definition:s(),definitionDestinationString:b,definitionLabelString:y,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(H),hardBreakTrailing:s(H),htmlFlow:s(F),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s(D),label:se,labelText:G,lineEnding:$,link:s(N),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:K,resourceDestinationString:I,resourceTitleString:Ve,resource:rt,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:C,strong:s(),thematicBreak:s()}};pM(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(A){let U={type:"root",children:[]},Q={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},re=[],Te=-1;for(;++Te<A.length;)if(A[Te][1].type==="listOrdered"||A[Te][1].type==="listUnordered")if(A[Te][0]==="enter")re.push(Te);else{let Nt=re.pop();Te=r(A,Nt,Te)}for(Te=-1;++Te<A.length;){let Nt=t[A[Te][0]];fM.call(Nt,A[Te][1].type)&&Nt[A[Te][1].type].call(Object.assign({sliceSerialize:A[Te][2].sliceSerialize},Q),A[Te][1])}if(Q.tokenStack.length>0){let Nt=Q.tokenStack[Q.tokenStack.length-1];(Nt[1]||dM).call(Q,void 0,Nt[0])}for(U.position={start:lo(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:lo(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te<t.transforms.length;)U=t.transforms[Te](U)||U;return U}function r(A,U,Q){let re=U-1,Te=-1,Nt=!1,ua,va,ba,ho;for(;++re<=Q;){let ca=A[re];switch(ca[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ca[0]==="enter"?Te++:Te--,ho=void 0;break}case"lineEndingBlank":{ca[0]==="enter"&&(ua&&!ho&&!Te&&!ba&&(ba=re),ho=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ho=void 0}if(!Te&&ca[0]==="enter"&&ca[1].type==="listItemPrefix"||Te===-1&&ca[0]==="exit"&&(ca[1].type==="listUnordered"||ca[1].type==="listOrdered")){if(ua){let Sr=re;for(va=void 0;Sr--;){let hn=A[Sr];if(hn[1].type==="lineEnding"||hn[1].type==="lineEndingBlank"){if(hn[0]==="exit")continue;va&&(A[va][1].type="lineEndingBlank",Nt=!0),hn[1].type="lineEnding",va=Sr}else if(!(hn[1].type==="linePrefix"||hn[1].type==="blockQuotePrefix"||hn[1].type==="blockQuotePrefixWhitespace"||hn[1].type==="blockQuoteMarker"||hn[1].type==="listItemIndent"))break}ba&&(!va||ba<va)&&(ua._spread=!0),ua.end=Object.assign({},va?A[va][1].start:ca[1].end),A.splice(va||re,0,["exit",ua,ca[2]]),re++,Q++}if(ca[1].type==="listItemPrefix"){let Sr={type:"listItem",_spread:!1,start:Object.assign({},ca[1].start),end:void 0};ua=Sr,A.splice(re,0,["enter",Sr,ca[2]]),re++,Q++,ba=void 0,ho=!0}}}return A[U][1]._spread=Nt,Q}function o(A,U){return Q;function Q(re){l.call(this,A(re),re),U&&U.call(this,re)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(A,U,Q){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([U,Q||void 0]),A.position={start:lo(U.start),end:void 0}}function s(A){return U;function U(Q){A&&A.call(this,Q),u.call(this,Q)}}function u(A,U){let Q=this.stack.pop(),re=this.tokenStack.pop();if(re)re[0].type!==A.type&&(U?U.call(this,A,re[0]):(re[1]||dM).call(this,A,re[0]));else throw new Error("Cannot close `"+A.type+"` ("+io({start:A.start,end:A.end})+"): it\u2019s not open");Q.position.end=lo(A.end)}function c(){return $o(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(A){if(this.data.expectingFirstListItemValue){let U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){let A=this.resume(),U=this.stack[this.stack.length-1];U.lang=A}function m(){let A=this.resume(),U=this.stack[this.stack.length-1];U.meta=A}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A.replace(/(\r?\n|\r)$/g,"")}function y(A){let U=this.resume(),Q=this.stack[this.stack.length-1];Q.label=U,Q.identifier=oa(this.sliceSerialize(A)).toLowerCase()}function g(){let A=this.resume(),U=this.stack[this.stack.length-1];U.title=A}function b(){let A=this.resume(),U=this.stack[this.stack.length-1];U.url=A}function T(A){let U=this.stack[this.stack.length-1];if(!U.depth){let Q=this.sliceSerialize(A).length;U.depth=Q}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function M(A){let U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function P(A){let Q=this.stack[this.stack.length-1].children,re=Q[Q.length-1];(!re||re.type!=="text")&&(re=di(),re.position={start:lo(A.start),end:void 0},Q.push(re)),this.stack.push(re)}function L(A){let U=this.stack.pop();U.value+=this.sliceSerialize(A),U.position.end=lo(A.end)}function $(A){let U=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Q=U.children[U.children.length-1];Q.position.end=lo(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(P.call(this,A),L.call(this,A))}function H(){this.data.atHardBreak=!0}function F(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function W(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function V(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function N(){let A=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=U,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function D(){let A=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=U,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function G(A){let U=this.sliceSerialize(A),Q=this.stack[this.stack.length-2];Q.label=D1(U),Q.identifier=oa(U).toLowerCase()}function se(){let A=this.stack[this.stack.length-1],U=this.resume(),Q=this.stack[this.stack.length-1];if(this.data.inReference=!0,Q.type==="link"){let re=A.children;Q.children=re}else Q.alt=U}function I(){let A=this.resume(),U=this.stack[this.stack.length-1];U.url=A}function Ve(){let A=this.resume(),U=this.stack[this.stack.length-1];U.title=A}function rt(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function K(A){let U=this.resume(),Q=this.stack[this.stack.length-1];Q.label=U,Q.identifier=oa(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function ee(A){this.data.characterReferenceType=A.type}function xe(A){let U=this.sliceSerialize(A),Q=this.data.characterReferenceType,re;Q?(re=Cf(U,Q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):re=Sl(U);let Te=this.stack[this.stack.length-1];Te.value+=re}function We(A){let U=this.stack.pop();U.position.end=lo(A.end)}function me(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(A)}function he(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(A)}function ue(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function J(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function He(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function Ie(){return{type:"html",value:""}}function X(){return{type:"image",title:null,url:"",alt:null}}function Ue(){return{type:"link",title:null,url:"",children:[]}}function Pt(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function aa(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function sa(){return{type:"paragraph",children:[]}}function Xa(){return{type:"strong",children:[]}}function di(){return{type:"text",value:""}}function fi(){return{type:"thematicBreak"}}}function lo(e){return{line:e.line,column:e.column,offset:e.offset}}function pM(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?pM(e,n):F5(e,n)}}function F5(e,t){let a;for(a in t)if(fM.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 dM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+io({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is still open")}var fM,mM=k(()=>{"use strict";vf();cM();Pw();_1();yl();If();Py();fM={}.hasOwnProperty});var hM=k(()=>{"use strict";mM()});function Yf(e){let t=this;t.parser=a;function a(n){return Gy(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var gM=k(()=>{"use strict";hM()});var wM=k(()=>{"use strict";gM()});function yM(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 xM=k(()=>{"use strict"});function vM(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
+
`}]}var bM=k(()=>{"use strict"});function SM(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 IM=k(()=>{"use strict"});function CM(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var kM=k(()=>{"use strict"});function TM(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var LM=k(()=>{"use strict"});function EM(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=sn(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 MM=k(()=>{"use strict";Ko()});function AM(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 RM=k(()=>{"use strict"});function DM(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var _M=k(()=>{"use strict"});function Zf(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 $y=k(()=>{"use strict"});function OM(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Zf(e,t);let r={src:sn(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 PM=k(()=>{"use strict";Ko();$y()});function NM(e,t){let a={src:sn(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 BM=k(()=>{"use strict";Ko()});function UM(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 FM=k(()=>{"use strict"});function zM(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Zf(e,t);let r={href:sn(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 qM=k(()=>{"use strict";Ko();$y()});function HM(e,t){let a={href:sn(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 jM=k(()=>{"use strict";Ko()});function VM(e,t,a){let n=e.all(t),r=a?z5(a):WM(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 z5(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=WM(a[n])}return t}function WM(e){let t=e.spread;return t??e.children.length>1}var GM=k(()=>{"use strict"});function $M(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 XM=k(()=>{"use strict"});function KM(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var YM=k(()=>{"use strict"});function ZM(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var QM=k(()=>{"use strict"});function JM(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var eA=k(()=>{"use strict"});function tA(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=wl(t.children[1]),s=hf(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 aA=k(()=>{"use strict";mu()});function nA(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 rA=k(()=>{"use strict"});function oA(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var iA=k(()=>{"use strict"});function sA(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(lA(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(lA(t.slice(r),r>0,!1)),o.join("")}function lA(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 uA=k(()=>{"use strict"});function cA(e,t){let a={type:"text",value:sA(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var dA=k(()=>{"use strict";uA()});function fA(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var pA=k(()=>{"use strict"});function Qf(){}var mA,hA=k(()=>{"use strict";xM();bM();IM();kM();LM();MM();RM();_M();PM();BM();FM();qM();jM();GM();XM();YM();QM();eA();aA();rA();iA();dA();pA();mA={blockquote:yM,break:vM,code:SM,delete:CM,emphasis:TM,footnoteReference:EM,heading:AM,html:DM,imageReference:OM,image:NM,inlineCode:UM,linkReference:zM,link:HM,listItem:VM,list:$M,paragraph:KM,root:ZM,strong:JM,table:tA,tableCell:oA,tableRow:nA,text:cA,thematicBreak:fA,toml:Qf,yaml:Qf,definition:Qf,footnoteDefinition:Qf}});function q5(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 H5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gA(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||q5,n=e.options.footnoteBackLabel||H5,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=sn(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 y=typeof a=="string"?a:a(s,p);typeof y=="string"&&(y={type:"text",value:y}),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(y)?y:[y]})}let S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){let y=S.children[S.children.length-1];y&&y.type==="text"?y.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...m)}else c.push(...m);let w={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(u,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Jr(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 wA=k(()=>{"use strict";mf();Ko()});function xA(e,t){let a=t||j5,n=new Map,r=new Map,o=new Map,i={...mA,...a.handlers},l={all:u,applyData:W5,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:i,one:s,options:a,patch:V5,wrap:$5};return fr(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(Xy.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,...S}=c,w=Jr(S);return w.children=l.all(c),w}return Jr(c)}return(l.options.unknownHandler||G5)(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=yA(m.value)),!Array.isArray(m)&&m.type==="element")){let x=m.children[0];x&&x.type==="text"&&(x.value=yA(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function V5(e,t){e.position&&(t.position=pu(e))}function W5(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,Jr(o)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function G5(e,t){let a=t.data||{},n="value"in t&&!(Xy.call(a,"hProperties")||Xy.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 $5(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 yA=k(()=>{"use strict";mA();wA()});var xA=k(()=>{"use strict";yA()});function Jf(e,t){return e&&"run"in e?async function(a,n){let r=Qf(a,{file:n,...t});await e.run(r,n)}:function(a,n){return Qf(a,{file:n,...e||t})}}var vA=k(()=>{"use strict";xA()});var bA=k(()=>{"use strict";vA()});function Xy(e){if(e)throw e}var SA=k(()=>{"use strict"});var RA=na((ure,AA)=>{"use strict";var ep=Object.prototype.hasOwnProperty,MA=Object.prototype.toString,IA=Object.defineProperty,CA=Object.getOwnPropertyDescriptor,kA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):MA.call(t)==="[object Array]"},TA=function(t){if(!t||MA.call(t)!=="[object Object]")return!1;var a=ep.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&ep.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||ep.call(t,r)},LA=function(t,a){IA&&a.name==="__proto__"?IA(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},EA=function(t,a){if(a==="__proto__")if(ep.call(t,a)){if(CA)return CA(t,a).value}else return;return t[a]};AA.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=EA(l,a),r=EA(t,a),l!==r&&(c&&r&&(TA(r)||(o=kA(r)))?(o?(o=!1,i=n&&kA(n)?n:[]):i=n&&TA(n)?n:{},LA(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&LA(l,{name:a,newValue:r}));return l}});function Eu(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 DA=k(()=>{"use strict"});function Ky(){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?_A(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 _A(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 OA=k(()=>{"use strict"});var PA=k(()=>{"use strict";OA()});function F5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(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 z5(e){if(Mu(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 q5(e){Mu(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 H5(...e){let t=-1,a;for(;++t<e.length;)Mu(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":j5(a)}function j5(e){Mu(e);let t=e.codePointAt(0)===47,a=V5(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function V5(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 Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var bn,NA=k(()=>{"use strict";bn={basename:F5,dirname:z5,extname:q5,join:H5,sep:"/"}});function W5(){return"/"}var BA,UA=k(()=>{"use strict";BA={cwd:W5}});function kl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Yy=k(()=>{"use strict"});function FA(e){if(typeof e=="string")e=new URL(e);else if(!kl(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 G5(e)}function G5(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 zA=k(()=>{"use strict";Yy();Yy()});function Qy(e,t){if(e&&e.includes(bn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bn.sep+"`")}function Jy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Zy,Au,HA=k(()=>{"use strict";Py();NA();UA();zA();Zy=["history","path","basename","stem","extname","dirname"],Au=class{constructor(t){let a;t?kl(t)?a={path:t}:typeof t=="string"||$5(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":BA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Zy.length;){let o=Zy[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)Zy.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?bn.basename(this.path):void 0}set basename(t){Jy(t,"basename"),Qy(t,"basename"),this.path=bn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bn.dirname(this.path):void 0}set dirname(t){qA(this.basename,"dirname"),this.path=bn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bn.extname(this.path):void 0}set extname(t){if(Qy(t,"extname"),qA(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=bn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){kl(t)&&(t=FA(t)),Jy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bn.basename(this.path,this.extname):void 0}set stem(t){Jy(t,"stem"),Qy(t,"stem"),this.path=bn.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 _t(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 jA=k(()=>{"use strict";HA()});var VA,WA=k(()=>{"use strict";VA=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function ex(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ax(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 GA(e){if(!Eu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $A(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tp(e){return K5(e)?e:new Au(e)}function K5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Y5(e){return typeof e=="string"||Z5(e)}function Z5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ap,X5,nx,rx,XA=k(()=>{"use strict";SA();ap=q(RA(),1);DA();PA();jA();WA();X5={}.hasOwnProperty,nx=class e extends VA{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=Ky()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,ap.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(ax("data",this.frozen),this.namespace[t]=a,this):X5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ax("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=tp(t),n=this.parser||this.Parser;return ex("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),ex("process",this.parser||this.Parser),tx("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=tp(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);Y5(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(),ex("processSync",this.parser||this.Parser),tx("processSync",this.compiler||this.Compiler),this.process(t,r),$A("processSync","process",a),n;function r(o,i){a=!0,Xy(o),n=i}}run(t,a,n){GA(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=tp(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),$A("runSync","run",n),r;function o(i,l){Xy(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=tp(a),r=this.compiler||this.Compiler;return tx("stringify",r),GA(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(ax("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,ap.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];Eu(x)&&Eu(p)&&(p=(0,ap.default)(!0,x,p)),n[f]=[u,p,...m]}}}},rx=new nx().freeze()});var KA=k(()=>{"use strict";XA()});function sx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function aR(e){oi=e}function Ve(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(ga.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function wr(e,t){if(t){if(ga.escapeTest.test(e))return e.replace(ga.escapeReplace,QA)}else if(ga.escapeTestNoEncode.test(e))return e.replace(ga.escapeReplaceNoEncode,QA);return e}function JA(e){try{e=encodeURI(e).replace(ga.percentDecode,"%")}catch{return null}return e}function eR(e,t){let a=e.replace(ga.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(ga.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(ga.slashPipe,"|");return n}function Du(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 DH(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 tR(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 _H(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 yA(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var Xy,j5,vA=k(()=>{"use strict";mf();df();mu();hA();Xy={}.hasOwnProperty,j5={}});function Jf(e,t){let a=xA(e,t),n=a.one(e,void 0),r=gA(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 bA=k(()=>{"use strict";wA();vA()});var SA=k(()=>{"use strict";bA()});function ep(e,t){return e&&"run"in e?async function(a,n){let r=Jf(a,{file:n,...t});await e.run(r,n)}:function(a,n){return Jf(a,{file:n,...e||t})}}var IA=k(()=>{"use strict";SA()});var CA=k(()=>{"use strict";IA()});function Ky(e){if(e)throw e}var kA=k(()=>{"use strict"});var OA=na((Sre,_A)=>{"use strict";var tp=Object.prototype.hasOwnProperty,DA=Object.prototype.toString,TA=Object.defineProperty,LA=Object.getOwnPropertyDescriptor,EA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):DA.call(t)==="[object Array]"},MA=function(t){if(!t||DA.call(t)!=="[object Object]")return!1;var a=tp.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&tp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||tp.call(t,r)},AA=function(t,a){TA&&a.name==="__proto__"?TA(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},RA=function(t,a){if(a==="__proto__")if(tp.call(t,a)){if(LA)return LA(t,a).value}else return;return t[a]};_A.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=RA(l,a),r=RA(t,a),l!==r&&(c&&r&&(MA(r)||(o=EA(r)))?(o?(o=!1,i=n&&EA(n)?n:[]):i=n&&MA(n)?n:{},AA(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&AA(l,{name:a,newValue:r}));return l}});function Eu(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 PA=k(()=>{"use strict"});function Yy(){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?NA(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 NA(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 BA=k(()=>{"use strict"});var UA=k(()=>{"use strict";BA()});function X5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(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 K5(e){if(Mu(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 Y5(e){Mu(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 Z5(...e){let t=-1,a;for(;++t<e.length;)Mu(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":Q5(a)}function Q5(e){Mu(e);let t=e.codePointAt(0)===47,a=J5(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function J5(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 Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var bn,FA=k(()=>{"use strict";bn={basename:X5,dirname:K5,extname:Y5,join:Z5,sep:"/"}});function eH(){return"/"}var zA,qA=k(()=>{"use strict";zA={cwd:eH}});function kl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Zy=k(()=>{"use strict"});function HA(e){if(typeof e=="string")e=new URL(e);else if(!kl(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 tH(e)}function tH(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 jA=k(()=>{"use strict";Zy();Zy()});function Jy(e,t){if(e&&e.includes(bn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bn.sep+"`")}function ex(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function VA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Qy,Au,WA=k(()=>{"use strict";Ny();FA();qA();jA();Qy=["history","path","basename","stem","extname","dirname"],Au=class{constructor(t){let a;t?kl(t)?a={path:t}:typeof t=="string"||aH(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":zA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Qy.length;){let o=Qy[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)Qy.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?bn.basename(this.path):void 0}set basename(t){ex(t,"basename"),Jy(t,"basename"),this.path=bn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bn.dirname(this.path):void 0}set dirname(t){VA(this.basename,"dirname"),this.path=bn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bn.extname(this.path):void 0}set extname(t){if(Jy(t,"extname"),VA(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=bn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){kl(t)&&(t=HA(t)),ex(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bn.basename(this.path,this.extname):void 0}set stem(t){ex(t,"stem"),Jy(t,"stem"),this.path=bn.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 Ot(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 GA=k(()=>{"use strict";WA()});var $A,XA=k(()=>{"use strict";$A=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function tx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ax(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nx(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 KA(e){if(!Eu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function YA(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ap(e){return rH(e)?e:new Au(e)}function rH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oH(e){return typeof e=="string"||iH(e)}function iH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var np,nH,rx,ox,ZA=k(()=>{"use strict";kA();np=z(OA(),1);PA();UA();GA();XA();nH={}.hasOwnProperty,rx=class e extends $A{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=Yy()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,np.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(nx("data",this.frozen),this.namespace[t]=a,this):nH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nx("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=ap(t),n=this.parser||this.Parser;return tx("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),tx("process",this.parser||this.Parser),ax("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=ap(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);oH(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(),tx("processSync",this.parser||this.Parser),ax("processSync",this.compiler||this.Compiler),this.process(t,r),YA("processSync","process",a),n;function r(o,i){a=!0,Ky(o),n=i}}run(t,a,n){KA(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=ap(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),YA("runSync","run",n),r;function o(i,l){Ky(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=ap(a),r=this.compiler||this.Compiler;return ax("stringify",r),KA(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(nx("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,np.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];Eu(x)&&Eu(p)&&(p=(0,np.default)(!0,x,p)),n[f]=[u,p,...m]}}}},ox=new rx().freeze()});var QA=k(()=>{"use strict";ZA()});function ux(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function oR(e){oi=e}function Xe(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(ga.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function wr(e,t){if(t){if(ga.escapeTest.test(e))return e.replace(ga.escapeReplace,tR)}else if(ga.escapeTestNoEncode.test(e))return e.replace(ga.escapeReplaceNoEncode,tR);return e}function aR(e){try{e=encodeURI(e).replace(ga.percentDecode,"%")}catch{return null}return e}function nR(e,t){let a=e.replace(ga.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(ga.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(ga.slashPipe,"|");return n}function Du(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 qH(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 rR(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 HH(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=
|
|
56
|
+
`)}function lt(e,t){return ri.parse(e,t)}var oi,Ou,lH,ga,sH,uH,cH,Pu,dH,cx,iR,lR,fH,dx,pH,fx,mH,hH,up,px,gH,sR,wH,mx,JA,yH,xH,vH,bH,uR,SH,cp,hx,cR,IH,dR,CH,kH,TH,fR,LH,EH,pR,MH,AH,RH,DH,_H,OH,PH,ip,NH,mR,hR,BH,eR,gx,UH,ix,FH,rp,Ru,zH,tR,lp,Ga,sp,wx,Sn,op,_u,jH,ri,Kre,Yre,Zre,Qre,Jre,eoe,toe,gR=k(()=>{"use strict";oi=ux();Ou={exec:()=>null};lH=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ga={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")},sH=/^(?:[ \t]*(?:\n|$))+/,uH=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cH=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dH=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cx=/(?:[*+-]|\d{1,9}[.)])/,iR=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lR=Xe(iR).replace(/bull/g,cx).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(),fH=Xe(iR).replace(/bull/g,cx).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(),dx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pH=/^[^\n]+/,fx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mH=Xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fx).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hH=Xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cx).getRegex(),up="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",px=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gH=Xe("^ {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",px).replace("tag",up).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sR=Xe(dx).replace("hr",Pu).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",up).getRegex(),wH=Xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sR).getRegex(),mx={blockquote:wH,code:uH,def:mH,fences:cH,heading:dH,hr:Pu,html:gH,lheading:lR,list:hH,newline:sH,paragraph:sR,table:Ou,text:pH},JA=Xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pu).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",up).getRegex(),yH={...mx,lheading:fH,table:JA,paragraph:Xe(dx).replace("hr",Pu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",JA).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",up).getRegex()},xH={...mx,html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",px).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:Ou,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Xe(dx).replace("hr",Pu).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",lR).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vH=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bH=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uR=/^( {2,}|\\)\n(?!\s*$)/,SH=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cp=/[\p{P}\p{S}]/u,hx=/[\s\p{P}\p{S}]/u,cR=/[^\s\p{P}\p{S}]/u,IH=Xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hx).getRegex(),dR=/(?!~)[\p{P}\p{S}]/u,CH=/(?!~)[\s\p{P}\p{S}]/u,kH=/(?:[^\s\p{P}\p{S}]|~)/u,TH=Xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lH?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fR=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LH=Xe(fR,"u").replace(/punct/g,cp).getRegex(),EH=Xe(fR,"u").replace(/punct/g,dR).getRegex(),pR="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",MH=Xe(pR,"gu").replace(/notPunctSpace/g,cR).replace(/punctSpace/g,hx).replace(/punct/g,cp).getRegex(),AH=Xe(pR,"gu").replace(/notPunctSpace/g,kH).replace(/punctSpace/g,CH).replace(/punct/g,dR).getRegex(),RH=Xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cR).replace(/punctSpace/g,hx).replace(/punct/g,cp).getRegex(),DH=Xe(/\\(punct)/,"gu").replace(/punct/g,cp).getRegex(),_H=Xe(/^<(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(),OH=Xe(px).replace("(?:-->|$)","-->").getRegex(),PH=Xe("^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",OH).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ip=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,NH=Xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ip).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mR=Xe(/^!?\[(label)\]\[(ref)\]/).replace("label",ip).replace("ref",fx).getRegex(),hR=Xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",fx).getRegex(),BH=Xe("reflink|nolink(?!\\()","g").replace("reflink",mR).replace("nolink",hR).getRegex(),eR=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gx={_backpedal:Ou,anyPunctuation:DH,autolink:_H,blockSkip:TH,br:uR,code:bH,del:Ou,emStrongLDelim:LH,emStrongRDelimAst:MH,emStrongRDelimUnd:RH,escape:vH,link:NH,nolink:hR,punctuation:IH,reflink:mR,reflinkSearch:BH,tag:PH,text:SH,url:Ou},UH={...gx,link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",ip).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ip).getRegex()},ix={...gx,emStrongRDelimAst:AH,emStrongLDelim:EH,url:Xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",eR).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:Xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",eR).getRegex()},FH={...ix,br:Xe(uR).replace("{2,}","*").getRegex(),text:Xe(ix.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},rp={normal:mx,gfm:yH,pedantic:xH},Ru={normal:gx,gfm:ix,breaks:FH,pedantic:UH},zH={"&":"&","<":"<",">":">",'"':""","'":"'"},tR=e=>zH[e];lp=class{constructor(e){ae(this,"options");ae(this,"rules");ae(this,"lexer");this.options=e||oi}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:Du(a,`
|
|
58
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=HH(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=Du(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:Du(t[0],`
|
|
59
59
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=Du(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(`
|
|
@@ -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," "),w.test(f)||y.test(f)||g.test(f)||x.test(f)||S.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||w.test(d)||y.test(d)||S.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=Du(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{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=nR(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(nR(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=Du(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=qH(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)),rR(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 rR(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}}}},Ga=class lx{constructor(t){ae(this,"tokens");ae(this,"options");ae(this,"state");ae(this,"inlineQueue");ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||oi,this.options.tokenizer=this.options.tokenizer||new lp,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:ga,block:rp.normal,inline:Ru.normal};this.options.pedantic?(a.block=rp.pedantic,a.inline=Ru.pedantic):this.options.gfm&&(a.block=rp.gfm,this.options.breaks?a.inline=Ru.breaks:a.inline=Ru.gfm),this.tokenizer.rules=a}static get rules(){return{block:rp,inline:Ru}}static lex(t,a){return new lx(a).lex(t)}static lexInline(t,a){return new lx(a).inlineTokens(t)}lex(t){t=t.replace(ga.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(ga.tabCharGlobal," ").replace(ga.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}},sp=class{constructor(e){ae(this,"options");ae(this,"parser");this.options=e||oi}space(e){return""}code({text:e,lang:t,escaped:a}){let n=(t||"").match(ga.notSpaceStart)?.[0],r=e.replace(ga.endingNewline,"")+`
|
|
94
94
|
`;return n?'<pre><code class="language-'+wr(n)+'">'+(a?r:wr(r,!0))+`</code></pre>
|
|
95
95
|
`:"<pre><code>"+(a?r:wr(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>${wr(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>"+wr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},ri=new
|
|
113
|
-
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,In.useState)(l);return(0,In.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,Ra.jsx)(wx.Provider,{value:{code:e},children:(0,Ra.jsxs)(BH,{language:t,children:[(0,Ra.jsx)(UH,{language:t,children:n}),(0,Ra.jsx)(NH,{className:a,language:t,result:s,...r})]})})}});var wR={};fc(wR,{Mermaid:()=>yx});var yR=k(()=>{"use strict";"use client";cp()});function jH(e={}){let{immediate:t=!1,debounceDelay:a=zH,rootMargin:n=qH,idleTimeout:r=HH}=e,[o,i]=(0,_.useState)(!1),l=(0,_.useRef)(null),s=(0,_.useRef)(null),u=(0,_.useRef)(null),c=(0,_.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,_.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,_.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,_.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})},S=g=>{m(),s.current=window.setTimeout(()=>{var b,T;let C=g.takeRecords();(C.length===0||(T=(b=C.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(g)},a)},w=(g,b)=>{g.isIntersecting?S(b):m()},y=new IntersectionObserver(g=>{for(let b of g)w(b,y)},{rootMargin:n,threshold:0});return y.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),y.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function mp(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 Tt(e,t){return e.className===t.className&&mp(e.node,t.node)}var _,E,zH,qH,HH,Cx,kx,pp,VH,WH,GH,TR,xR,$H,XH,le,Tl,wx,LR,vR,bR,KH,SR,YH,ZH,Nu,QH,JH,e6,Sx,ER,gR,Tx,t6,a6,Bu,n6,r6,o6,MR,AR,i6,xx,l6,s6,u6,c6,d6,f6,p6,Ix,dp,Lx,RR,DR,_R,OR,m6,PR,NR,BR,UR,FR,zR,qR,HR,jR,VR,WR,GR,$R,XR,KR,YR,ZR,h6,QR,JR,e2,g6,IR,CR,fp,w6,kR,t2,y6,x6,v6,b6,S6,I6,C6,vx,k6,bx,a2,n2,r2,T6,L6,E6,M6,wa,Ex,A6,Ll,R6,yx,cp=k(()=>{"use strict";"use client";_=q(he(),1);Pk();Bk();aT();PL();KL();E=q(ae(),1);Xg();Yg();qE();mM();bA();KA();pR();zH=300,qH="300px",HH=500;Cx=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"})}),kx=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"})}),pp=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"})}),VH=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"})]}),WH=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"})}),GH=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"})}),TR=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"})}),xR=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"})}),$H=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"})}),XH=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"})}),le=(...e)=>Kg(tf(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)},wx=(0,_.createContext)({code:""}),LR=()=>(0,_.useContext)(wx),vR=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(0),{code:c}=LR(),{isAnimating:d}=(0,_.useContext)(wa),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(S){t?.(S)}};(0,_.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?Cx:kx;return(0,E.jsx)("button",{className:le("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})})},bR={"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"},KH=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=LR(),{isAnimating:s}=(0,_.useContext)(wa),u=o??l,c=`file.${a&&a in bR?bR[a]:"txt"}`,d="text/plain",f=()=>{try{Tl(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.jsx)("button",{className:le("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)(pp,{size:14})})},SR=()=>(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)(VH,{className:"size-4 animate-spin"})})]}),YH=/\.[^/.]+$/,ZH=({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(YH,"")}.${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:le("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:le("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)(pp,{size:14})})]}):null},Nu=0,QH=()=>{Nu+=1,Nu===1&&(document.body.style.overflow="hidden")},JH=()=>{Nu=Math.max(0,Nu-1),Nu===0&&(document.body.style.overflow="")},e6=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,_.useCallback)(()=>{n(),a()},[n,a]);return(0,_.useEffect)(()=>{if(t){QH();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),JH()}}},[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)(TR,{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)(xR,{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:le("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)(Cx,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(kx,{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)(xR,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Sx=(0,_.createContext)(null),ER=()=>(0,_.useContext)(Sx),gR=()=>{var e;let t=ER();return(e=t?.code)!=null?e:null},Tx=()=>{var e;let t=ER();return(e=t?.mermaid)!=null?e:null},t6=(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})},a6=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,_.useState)(!1),s=(0,_.useRef)(null),{isAnimating:u}=(0,_.useContext)(wa),c=Tx(),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((w,y)=>(w<<5)-w+y.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await p.render(x,e);if(!S){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Tl("diagram.svg",S,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let w=await t6(S);Tl("diagram.png",w,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,_.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:le("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)(pp,{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]})},Bu=0,n6=()=>{Bu+=1,Bu===1&&(document.body.style.overflow="hidden")},r6=()=>{Bu=Math.max(0,Bu-1),Bu===0&&(document.body.style.overflow="")},o6=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(wa),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,_.useEffect)(()=>{if(i){n6();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),r6()}}},[i]),(0,_.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:le("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)(WH,{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)(TR,{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)(yx,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},MR=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}},AR=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>${wr(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=aR(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+wr(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=aR(e);if(r===null)return wr(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${wr(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:wr(e.text)}},wx=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 sx{constructor(t){ae(this,"options");ae(this,"renderer");ae(this,"textRenderer");this.options=t||oi,this.options.renderer=this.options.renderer||new sp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wx}static parse(t,a){return new sx(a).parse(t)}static parseInline(t,a){return new sx(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}},_u=(op=class{constructor(e){ae(this,"options");ae(this,"block");this.options=e||oi}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Ga.lex:Ga.lexInline}provideParser(){return this.block?Sn.parse:Sn.parseInline}},ae(op,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ae(op,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),op),jH=class{constructor(...e){ae(this,"defaults",ux());ae(this,"options",this.setOptions);ae(this,"parse",this.parseMarkdown(!0));ae(this,"parseInline",this.parseMarkdown(!1));ae(this,"Parser",Sn);ae(this,"Renderer",sp);ae(this,"TextRenderer",wx);ae(this,"Lexer",Ga);ae(this,"Tokenizer",lp);ae(this,"Hooks",_u);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 sp(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 lp(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 _u;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];_u.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async&&_u.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 Ga.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?Ga.lex:Ga.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?Ga.lex:Ga.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>"+wr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},ri=new jH;lt.options=lt.setOptions=function(e){return ri.setOptions(e),lt.defaults=ri.defaults,oR(lt.defaults),lt};lt.getDefaults=ux;lt.defaults=oi;lt.use=function(...e){return ri.use(...e),lt.defaults=ri.defaults,oR(lt.defaults),lt};lt.walkTokens=function(e,t){return ri.walkTokens(e,t)};lt.parseInline=ri.parseInline;lt.Parser=Sn;lt.parser=Sn.parse;lt.Renderer=sp;lt.TextRenderer=wx;lt.Lexer=Ga;lt.lexer=Ga.lex;lt.Tokenizer=lp;lt.Hooks=_u;lt.parse=lt;Kre=lt.options,Yre=lt.setOptions,Zre=lt.use,Qre=lt.walkTokens,Jre=lt.parseInline,eoe=Sn.parse,toe=Ga.lex});var wR={};pc(wR,{CodeBlock:()=>XH});var In,Ra,VH,WH,GH,$H,XH,yR=k(()=>{"use strict";"use client";dp();In=z(we(),1),Ra=z(ne(),1),VH=ce("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"),WH=(0,In.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,In.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,Ra.jsx)("pre",{className:ce(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":a,"data-streamdown":"code-block-body",style:o,...r,children:(0,Ra.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((i,l)=>(0,Ra.jsx)("span",{className:VH,children:i.map((s,u)=>(0,Ra.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),GH=({className:e,language:t,style:a,...n})=>(0,Ra.jsx)("div",{className:ce("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}),$H=({language:e,children:t})=>(0,Ra.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,Ra.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,Ra.jsx)("div",{className:"flex items-center gap-2",children:t})]}),XH=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,In.useContext)(wa),i=xR(),l=(0,In.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
113
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,In.useState)(l);return(0,In.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,Ra.jsx)(yx.Provider,{value:{code:e},children:(0,Ra.jsxs)(GH,{language:t,children:[(0,Ra.jsx)($H,{language:t,children:n}),(0,Ra.jsx)(WH,{className:a,language:t,result:s,...r})]})})}});var vR={};pc(vR,{Mermaid:()=>xx});var bR=k(()=>{"use strict";"use client";dp()});function QH(e={}){let{immediate:t=!1,debounceDelay:a=KH,rootMargin:n=YH,idleTimeout:r=ZH}=e,[o,i]=(0,_.useState)(!1),l=(0,_.useRef)(null),s=(0,_.useRef)(null),u=(0,_.useRef)(null),c=(0,_.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,_.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,_.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,_.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})},S=g=>{m(),s.current=window.setTimeout(()=>{var b,T;let C=g.takeRecords();(C.length===0||(T=(b=C.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(g)},a)},w=(g,b)=>{g.isIntersecting?S(b):m()},y=new IntersectionObserver(g=>{for(let b of g)w(b,y)},{rootMargin:n,threshold:0});return y.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),y.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function hp(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 Tt(e,t){return e.className===t.className&&hp(e.node,t.node)}var _,E,KH,YH,ZH,kx,Tx,mp,JH,e6,t6,MR,SR,a6,n6,ce,Tl,yx,AR,IR,CR,r6,kR,o6,i6,Nu,l6,s6,u6,Ix,RR,xR,Lx,c6,d6,Bu,f6,p6,m6,DR,_R,h6,vx,g6,w6,y6,x6,v6,b6,S6,Cx,fp,Ex,OR,PR,NR,BR,I6,UR,FR,zR,qR,HR,jR,VR,WR,GR,$R,XR,KR,YR,ZR,QR,JR,e2,C6,t2,a2,n2,k6,TR,LR,pp,T6,ER,r2,L6,E6,M6,A6,R6,D6,_6,bx,O6,Sx,o2,i2,l2,P6,N6,B6,U6,wa,Mx,F6,Ll,z6,xx,dp=k(()=>{"use strict";"use client";_=z(we(),1);Uk();zk();oT();UL();QL();E=z(ne(),1);Kg();Zg();VE();wM();CA();QA();gR();KH=300,YH="300px",ZH=500;kx=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"})}),Tx=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"})}),mp=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"})}),JH=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"})]}),e6=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"})}),t6=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"})}),MR=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"})}),SR=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"})}),a6=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"})}),n6=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"})}),ce=(...e)=>Yg(af(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)},yx=(0,_.createContext)({code:""}),AR=()=>(0,_.useContext)(yx),IR=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(0),{code:c}=AR(),{isAnimating:d}=(0,_.useContext)(wa),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(S){t?.(S)}};(0,_.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?kx:Tx;return(0,E.jsx)("button",{className:ce("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})})},CR={"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"},r6=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=AR(),{isAnimating:s}=(0,_.useContext)(wa),u=o??l,c=`file.${a&&a in CR?CR[a]:"txt"}`,d="text/plain",f=()=>{try{Tl(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.jsx)("button",{className:ce("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)(mp,{size:14})})},kR=()=>(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)(JH,{className:"size-4 animate-spin"})})]}),o6=/\.[^/.]+$/,i6=({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(o6,"")}.${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:ce("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:ce("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)(mp,{size:14})})]}):null},Nu=0,l6=()=>{Nu+=1,Nu===1&&(document.body.style.overflow="hidden")},s6=()=>{Nu=Math.max(0,Nu-1),Nu===0&&(document.body.style.overflow="")},u6=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,_.useCallback)(()=>{n(),a()},[n,a]);return(0,_.useEffect)(()=>{if(t){l6();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),s6()}}},[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)(MR,{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)(SR,{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:ce("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)(kx,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Tx,{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)(SR,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Ix=(0,_.createContext)(null),RR=()=>(0,_.useContext)(Ix),xR=()=>{var e;let t=RR();return(e=t?.code)!=null?e:null},Lx=()=>{var e;let t=RR();return(e=t?.mermaid)!=null?e:null},c6=(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})},d6=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,_.useState)(!1),s=(0,_.useRef)(null),{isAnimating:u}=(0,_.useContext)(wa),c=Lx(),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((w,y)=>(w<<5)-w+y.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await p.render(x,e);if(!S){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Tl("diagram.svg",S,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let w=await c6(S);Tl("diagram.png",w,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,_.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:ce("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)(mp,{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]})},Bu=0,f6=()=>{Bu+=1,Bu===1&&(document.body.style.overflow="hidden")},p6=()=>{Bu=Math.max(0,Bu-1),Bu===0&&(document.body.style.overflow="")},m6=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(wa),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,_.useEffect)(()=>{if(i){f6();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),p6()}}},[i]),(0,_.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:ce("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)(e6,{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)(MR,{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)(xx,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},DR=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}},_R=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
|
+
`)},h6=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
|
-
`)},s6=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,_.useState)(!1),[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(null),c=(0,_.useRef)(0),{isAnimating:d}=(0,_.useContext)(wa),f=async m=>{var x,S;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let w=(S=u.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),y=w?.querySelector("table");if(!y){n?.(new Error("Table not found"));return}let g=MR(y),b=m==="csv"?AR(g):i6(g),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([y.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(w){n?.(w)}};(0,_.useEffect)(()=>{let m=x=>{let S=x.composedPath();u.current&&!S.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?Cx:kx;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.jsx)("button",{className:le("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]})},u6=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useRef)(null),{isAnimating:l}=(0,_.useContext)(wa),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=MR(f),m=u==="csv"?AR(p):l6(p);Tl(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,_.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:le("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)(pp,{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]})},c6=({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)(s6,{}),(0,E.jsx)(u6,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:le("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),d6=(0,_.lazy)(()=>Promise.resolve().then(()=>(hR(),mR)).then(e=>({default:e.CodeBlock}))),f6=(0,_.lazy)(()=>Promise.resolve().then(()=>(yR(),wR)).then(e=>({default:e.Mermaid}))),p6=/language-([^\s]+)/;Ix=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,dp=(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},Lx=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:le("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Tt(e,t));Lx.displayName="MarkdownOl";RR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:le("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&mp(e.node,t.node));RR.displayName="MarkdownLi";DR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:le("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Tt(e,t));DR.displayName="MarkdownUl";_R=(0,_.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:le("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>Tt(e,t));_R.displayName="MarkdownHr";OR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:le("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Tt(e,t));OR.displayName="MarkdownStrong";m6=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(wa),[i,l]=(0,_.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,_.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,_.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,_.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:le("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)(e6,{...f})]}):(0,E.jsx)("a",{className:le("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},PR=(0,_.memo)(m6,(e,t)=>Tt(e,t)&&e.href===t.href);PR.displayName="MarkdownA";NR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:le("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Tt(e,t));NR.displayName="MarkdownH1";BR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:le("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Tt(e,t));BR.displayName="MarkdownH2";UR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:le("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Tt(e,t));UR.displayName="MarkdownH3";FR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:le("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Tt(e,t));FR.displayName="MarkdownH4";zR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:le("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Tt(e,t));zR.displayName="MarkdownH5";qR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:le("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Tt(e,t));qR.displayName="MarkdownH6";HR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(wa),o=Ix(r,"table");return(0,E.jsx)(c6,{className:t,showControls:o,...n,children:e})},(e,t)=>Tt(e,t));HR.displayName="MarkdownTable";jR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:le("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Tt(e,t));jR.displayName="MarkdownThead";VR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:le("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Tt(e,t));VR.displayName="MarkdownTbody";WR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:le("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Tt(e,t));WR.displayName="MarkdownTr";GR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("th",{className:le("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Tt(e,t));GR.displayName="MarkdownTh";$R=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:le("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Tt(e,t));$R.displayName="MarkdownTd";XR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("blockquote",{className:le("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Tt(e,t));XR.displayName="MarkdownBlockquote";KR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:le("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Tt(e,t));KR.displayName="MarkdownSup";YR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:le("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Tt(e,t));YR.displayName="MarkdownSub";ZR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,_.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,_.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,_.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,_.isValidElement)(i))return i;if(i.type===Lx){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)=>Tt(e,t));ZR.displayName="MarkdownSection";h6=({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,_.useContext)(wa),c=Tx();if(l)return(0,E.jsx)("code",{className:le("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(p6),f=(i=d?.at(1))!=null?i:"",p="";if((0,_.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=Ix(u,"mermaid"),S=dp(u,"download"),w=dp(u,"copy"),y=dp(u,"fullscreen"),g=dp(u,"panZoom"),b=x&&(S||w||y);return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(SR,{}),children:(0,E.jsxs)("div",{className:le("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:[S?(0,E.jsx)(a6,{chart:p,config:s?.config}):null,w?(0,E.jsx)(vR,{code:p}):null,y?(0,E.jsx)(o6,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(f6,{chart:p,config:s?.config,showControls:g})]})})}let m=Ix(u,"code");return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(SR,{}),children:(0,E.jsx)(d6,{className:le("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(KH,{code:p,language:f}),(0,E.jsx)(vR,{})]}):null})})},QR=(0,_.memo)(h6,(e,t)=>e.className===t.className&&mp(e.node,t.node));QR.displayName="MarkdownCode";JR=(0,_.memo)(ZH,(e,t)=>e.className===t.className&&mp(e.node,t.node));JR.displayName="MarkdownImg";e2=(0,_.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,_.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)=>Tt(e,t));e2.displayName="MarkdownParagraph";g6={ol:Lx,li:RR,ul:DR,hr:_R,strong:OR,a:PR,h1:NR,h2:BR,h3:UR,h4:FR,h5:zR,h6:qR,table:HR,thead:jR,tbody:VR,tr:WR,th:GR,td:$R,blockquote:XR,code:QR,img:JR,pre:({children:e})=>e,sup:KR,sub:YR,p:e2,section:ZR},IR=[],CR={allowDangerousHtml:!0},fp=new WeakMap,w6=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 S=fp.get(m);S||(S=m.name,fp.set(m,S)),d+=S}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=fp.get(p);m||(m=p.name,fp.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()}},kR=new w6,t2=e=>{let t=y6(e),a=e.children||"";return v6(t.runSync(t.parse(a),a),e)},y6=e=>{let t=kR.get(e);if(t)return t;let a=x6(e);return kR.set(e,a),a},x6=e=>{let t=e.rehypePlugins||IR,a=e.remarkPlugins||IR,n=e.remarkRehypeOptions?{...CR,...e.remarkRehypeOptions}:CR;return rx().use(Kf).use(a).use(Jf,n).use(t)},v6=(e,t)=>By(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),b6=/\[\^[^\]\s]{1,200}\](?!:)/,S6=/\[\^[^\]\s]{1,200}\]:/,I6=/<\/(\w+)>/,C6=/<(\w+)[\s>]/,vx=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]==="$"},bx=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},a2=e=>{let t=b6.test(e),a=S6.test(e);if(t||a)return[e];let n=Ga.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(I6);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(C6);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=vx(u),d=bx(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&k6(l)){let u=r[s-1],c=vx(u),d=bx(u),f=bx(l);if(c&&d%2===1&&!vx(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},n2={raw:Nk,sanitize:[hf,{}],harden:[Ok,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},r2={gfm:[zf,{}]},T6=Object.values(n2),L6=Object.values(r2),E6={block:" \u258B",circle:" \u25CF"},M6={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},wa=(0,_.createContext)(M6),Ex=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(t2,{...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)});Ex.displayName="Block";A6=["github-light","github-dark"],Ll=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=T6,remarkPlugins:o=L6,className:i,shikiTheme:l=A6,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Ex,parseMarkdownIntoBlocksFn:f=a2,caret:p,plugins:m,remend:x,linkSafety:S={enabled:!0},...w})=>{let y=(0,_.useId)(),[g,b]=(0,_.useTransition)(),T=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?XL(e,x):e,[e,t,a,x]),C=(0,_.useMemo)(()=>f(T),[T,f]),[A,R]=(0,_.useState)(C);(0,_.useEffect)(()=>{t==="streaming"?b(()=>{R(C)}):R(C)},[C,t]);let P=t==="streaming"?A:C,L=(0,_.useMemo)(()=>P.map((B,D)=>`${y}-${D}`),[P.length,y]),W=(0,_.useMemo)(()=>{var B,D;return{shikiTheme:(D=(B=m?.code)==null?void 0:B.getThemes())!=null?D:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:S}},[l,u,c,t,s,S,m?.code]),H=(0,_.useMemo)(()=>({...g6,...n}),[n]),F=(0,_.useMemo)(()=>{let B=[];return m!=null&&m.cjk&&(B=[...B,...m.cjk.remarkPluginsBefore]),B=[...B,...o],m!=null&&m.cjk&&(B=[...B,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(B=[...B,m.math.remarkPlugin]),B},[o,m?.math,m?.cjk]),$=(0,_.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),G=(0,_.useMemo)(()=>p&&c?{"--streamdown-caret":`"${E6[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Sx.Provider,{value:m??null,children:(0,E.jsx)(wa.Provider,{value:W,children:(0,E.jsx)("div",{className:le("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(t2,{components:H,rehypePlugins:$,remarkPlugins:F,...w,children:e})})})}):(0,E.jsx)(Sx.Provider,{value:m??null,children:(0,E.jsx)(wa.Provider,{value:W,children:(0,E.jsxs)("div",{className:le("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:G,children:[P.length===0&&p&&c&&(0,E.jsx)("span",{}),P.map((B,D)=>(0,E.jsx)(d,{components:H,content:B,index:D,rehypePlugins:$,remarkPlugins:F,shouldParseIncompleteMarkdown:a,...w},L[D]))]})})})},(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);Ll.displayName="Streamdown";R6=({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,_.useRef)(null),u=(0,_.useRef)(null),[c,d]=(0,_.useState)(i),[f,p]=(0,_.useState)({x:0,y:0}),[m,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)({x:0,y:0}),[y,g]=(0,_.useState)({x:0,y:0}),b=(0,_.useCallback)(H=>{d(F=>Math.max(a,Math.min(n,F+H)))},[a,n]),T=(0,_.useCallback)(()=>{b(r)},[b,r]),C=(0,_.useCallback)(()=>{b(-r)},[b,r]),A=(0,_.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),R=(0,_.useCallback)(H=>{H.preventDefault();let F=H.deltaY>0?-r:r;b(F)},[b,r]),P=(0,_.useCallback)(H=>{if(H.button!==0||H.isPrimary===!1)return;x(!0),w({x:H.clientX,y:H.clientY}),g(f);let F=H.currentTarget;F instanceof HTMLElement&&F.setPointerCapture(H.pointerId)},[f]),L=(0,_.useCallback)(H=>{if(!m)return;H.preventDefault();let F=H.clientX-S.x,$=H.clientY-S.y;p({x:y.x+F,y:y.y+$})},[m,S,y]),W=(0,_.useCallback)(H=>{x(!1);let F=H.currentTarget;F instanceof HTMLElement&&F.releasePointerCapture(H.pointerId)},[]);return(0,_.useEffect)(()=>{let H=s.current;if(H)return H.addEventListener("wheel",R,{passive:!1}),()=>{H.removeEventListener("wheel",R)}},[R]),(0,_.useEffect)(()=>{let H=u.current;if(H&&m)return document.body.style.userSelect="none",H.addEventListener("pointermove",L,{passive:!1}),H.addEventListener("pointerup",W),H.addEventListener("pointercancel",W),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",L),H.removeEventListener("pointerup",W),H.removeEventListener("pointercancel",W)}},[m,L,W]),(0,E.jsxs)("div",{className:le("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:le("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)($H,{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:C,title:"Zoom out",type:"button",children:(0,E.jsx)(XH,{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:A,title:"Reset zoom and pan",type:"button",children:(0,E.jsx)(GH,{size:16})})]}):null,(0,E.jsx)("div",{className:le("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:P,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},yx=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,_.useState)(null),[l,s]=(0,_.useState)(!1),[u,c]=(0,_.useState)(""),[d,f]=(0,_.useState)(""),[p,m]=(0,_.useState)(0),{mermaid:x}=(0,_.useContext)(wa),S=Tx(),w=x?.errorComponent,{shouldRender:y,containerRef:g}=jH({immediate:n});if((0,_.useEffect)(()=>{if(y){if(!S){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=S.getMermaid(a),C=e.split("").reduce((P,L)=>(P<<5)-P+L.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await T.render(A,e);c(R),f(R)}catch(T){if(!(d||u)){let C=T instanceof Error?T.message:"Failed to render Mermaid chart";i(C)}}finally{s(!1)}})()}},[e,a,p,y,S]),!(y||u||d))return(0,E.jsx)("div",{className:le("my-4 min-h-[200px]",t),ref:g});if(l&&!u&&!d)return(0,E.jsx)("div",{className:le("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 w?(0,E.jsx)("div",{ref:g,children:(0,E.jsx)(w,{chart:e,error:o,retry:()=>m(C=>C+1)})}):(0,E.jsxs)("div",{className:le("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:le("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,E.jsx)(R6,{className:le(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:le("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var E_=na((sse,L_)=>{"use strict";function hV(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)}}L_.exports=hV});var Iv=typeof performance>"u"?0:performance.now(),Cv=typeof window<"u"&&!!window.WaniWani?.chat;var ci=q(he(),1),Wp=q(Og(),1);var Pg="waniwani/suggestions";function ol(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var EB=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],MB=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],AB=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],RB=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],DB=["waniwani/visitorId","visitorId"],_B=["correlationId","openai/requestId"];function pC(e){return e?ol(e,EB):void 0}function mC(e){return e?ol(e,MB):void 0}function hC(e){return e?ol(e,AB):void 0}function gC(e){return e?ol(e,RB):void 0}function wC(e){return e?ol(e,DB):void 0}function yC(e){return e?ol(e,_B):void 0}var OB=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],PB=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function xC(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 OB){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 PB)if(n.includes(r))return o}}var NB="@waniwani/sdk";function vC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??BB,r=zB(e),o=jd(e.meta),i=jd(e.metadata),l=qB(e,o),s=xn(e.eventId)??n(),u=HB(e.timestamp,a),c=xn(e.source)??xC(o)??t.source??NB,d=Ng(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:UB(e,r),metadata:f,rawLegacy:d}}function BB(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function UB(e,t){if(!Ng(e))return jd(e.properties);let a=FB(e,t),n=jd(e.properties);return{...a,...n}}function FB(e,t){switch(t){case"tool.called":{let a={};return xn(e.toolName)&&(a.name=e.toolName),xn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return xn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function zB(e){return Ng(e)?e.eventType:e.event}function qB(e,t){let a=xn(e.requestId)??mC(t),n=xn(e.sessionId)??pC(t),r=xn(e.traceId)??hC(t),o=xn(e.externalUserId)??gC(t),i=xn(e.visitorId)??wC(t),l=xn(e.correlationId)??yC(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 HB(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 jd(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function xn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Ng(e){return"eventType"in e}function bC(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 jB="/api/mcp/events/v2/batch";var SC="@waniwani/sdk";var VB=new Set([401,403]),WB=new Set([408,425,429,500,502,503,504]),GB=(e,t)=>globalThis.fetch(e,t);function IC(e){return new Bg(e)}var Bg=class{constructor(t){te(this,"endpointUrl");te(this,"flushIntervalMs");te(this,"maxBatchSize");te(this,"maxBufferSize");te(this,"maxRetries");te(this,"retryBaseDelayMs");te(this,"retryMaxDelayMs");te(this,"shutdownTimeoutMs");te(this,"sdkVersion");te(this,"fetchFn");te(this,"logger");te(this,"now");te(this,"sleep");te(this,"apiKey");te(this,"buffer",[]);te(this,"flushTimer");te(this,"flushScheduled",!1);te(this,"flushScheduledTimer");te(this,"flushInFlight");te(this,"inFlightCount",0);te(this,"isStopped",!1);te(this,"isShuttingDown",!1);this.endpointUrl=KB(t.apiUrl,t.endpointPath??jB),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??GB,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":SC};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:YB(o)}}if(VB.has(a.status))return{kind:"auth",status:a.status};if(WB.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await XB(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:SC,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($B(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 $B(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 XB(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function KB(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function YB(e){return e instanceof Error?e.message:String(e)}function CC(e){let{apiUrl:t,endpointPath:a}=ZB(e.endpoint),n=IC({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=vC({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,bC(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function ZB(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}function Ma(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}`:""}`}var QB="/api/mcp/";function Vd(e,t){let[a=""]=e.split("?"),n="",r=a;try{let o=new URL(a);n=o.origin,r=o.pathname}catch{if(!a.startsWith("/"))return null}return r.startsWith(QB)?`${n}${t}`:null}function JB(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ma(...e){JB()&&console.log("[Waniwani]",...e)}var Ug="waniwani-visitor-id";function eU(){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 ea(){try{let t=localStorage.getItem(Ug);if(t)return t}catch{}let e=eU();try{localStorage.setItem(Ug,e)}catch{}return e}function il(e){let t=typeof e=="string"?e.trim():"";if(!t)return ea();try{localStorage.setItem(Ug,t)}catch{}return t}function tU(e){return e!=null&&typeof e.then=="function"}function Xs(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 tU(n)?n.then(r=>{t||il(r??"")},()=>{}):il(n??""),a}var aU="waniwani-memory";var Va="threads",Wd="by_memoryUserId",nU="by_updatedAt";var TC="memoryUserId",kC="waniwani-memory-user-id",Fg=null;function zg(){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 rU(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Va)){let a=e.createObjectStore(Va,{keyPath:"threadId"});a.createIndex(Wd,"memoryUserId",{unique:!1}),a.createIndex(nU,"updatedAt",{unique:!1})}}async function qg(){return new Promise((e,t)=>{let a=indexedDB.open(aU,2);a.onupgradeneeded=n=>{rU(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function oU(){return qg()}async function iU(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(TC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function lU(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,TC);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function sU(){if(typeof indexedDB>"u")return null;try{let e=await oU();try{let t=await iU(e);if(t)return t;let a=zg();return await lU(e,a),a}finally{e.close()}}catch{return null}}function uU(){try{let e=localStorage.getItem(kC);if(e)return e;let t=zg();return localStorage.setItem(kC,t),t}catch{return null}}async function LC(){let e=await sU();if(e)return e;let t=uU();return t||(Fg||(Fg=zg()),Fg)}function EC(e,t){return e.match(t)?.[1]??null}function cU(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=EC(e,n);if(r)return{name:a,version:r}}return null}function dU(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=EC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function fU(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"}async function Ks(){let e=navigator.userAgent,t=ea(),a=await LC();return{userAgent:e,browser:cU(e),os:dU(e),deviceType:fU(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 pU="0.21.2",mU=40,hU=10,gU=6e5;function jg(){return typeof performance>"u"?0:performance.now()}function Vg(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=jg()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function wU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=mU)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>gU||(t[a]=r)}return t}function yU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=hU)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function xU(){let e=navigator.connection;if(e)return{effectiveType:e.effectiveType,rtt:e.rtt,downlink:e.downlink,saveData:e.saveData}}function $d(e){let t=e?.Authorization;return typeof t=="string"&&t.startsWith("Bearer ")?t.slice(7):void 0}function vU(e,t,a,n){return{kind:e,sdkVersion:pU,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:ea(),pageHost:window.location.hostname,connection:xU(),tags:yU(a),metrics:wU(n)}}var Hg,Gd=[];function Wg(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";Hg=t;let a=Gd;if(Gd=[],t)for(let n of a)n()}function Xd(e,t,a,n){let{api:r,token:o}=t;if(!(typeof window>"u"||!r||!o||Hg===!1))try{let i=vU(e,t,a,n),l=()=>{ma("timing",i),fetch(Ma(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};Hg?l():Gd.length<20&&Gd.push(l)}catch{}}var sr=Vg("boot",0),MC;function No(e,t){sr.mark(e,t)}function Kd(e){MC??(MC=e)}var bU=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,SU=/\/embed\.js(\?|$)/;function IU(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&sr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&sr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)bU.test(a.name)?(sr.mark("bundleStart",a.startTime),sr.mark("bundleEnd",a.responseEnd)):SU.test(a.name)&&(sr.mark("loaderStart",a.startTime),sr.mark("loaderEnd",a.responseEnd))}function CU(){if(Cv)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function AC(e){IU(),sr.mark("bundleExecuted",Iv),Xd("boot",e,{configSource:MC,mode:e.mode,secondSdk:CU()},sr.metrics)}var kU=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function RC(e){let t=Vg("turn",jg());t.set("turnIndex",e);let a=!1;return{mark:n=>t.mark(n),instrument(n){if(!n.ok||!n.body||typeof TransformStream>"u")return n;try{let r=new TextDecoder,o=n.body.pipeThrough(new TransformStream({transform(i,l){t.mark("firstChunk");let s=r.decode(i,{stream:!0});for(let[u,c]of kU)!t.has(c)&&s.includes(u)&&t.mark(c);l.enqueue(i)}}));return new Response(o,{status:n.status,statusText:n.statusText,headers:n.headers})}catch{return n}},report(n,r){a||(a=!0,Xd("turn",n,r,t.metrics))}}}function TU(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function DC(e,t){let a=Vg("widget",jg()),n=!1;return{mark:r=>a.mark(r),has:r=>a.has(r),report(r,o){n||(n=!0,a.set("retries",o),t({widget:TU(e),outcome:r,metrics:a.metrics}))}}}var LU="/api/mcp/events/v2/batch",Gg=new Set;function EU(e,t,a){return`${e}|${t}|${a??""}`}function Ys(e){return Vd(e,LU)}async function _C(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Ys(t);if(!i){ma("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){ma("page.viewed skipped: no channelId or source to attribute it");return}let l=EU(t,a,n);if(!Gg.has(l)){Gg.add(l);try{let s=await Ks(),u=new Date().toISOString(),c=JSON.stringify({sentAt:u,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:u,correlation:{visitorId:s.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:s.referrer,deviceType:s.deviceType,language:s.language,timezone:s.timezone},metadata:{}}]}),d=fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:c,keepalive:!0});No("pageViewSent"),await d}catch{Gg.delete(l)}}}function OC(e){let t=Ys(e.api);return t?CC({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:ea()})}):Yd("the chat api does not point at a Waniwani event ingest")}function Yd(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 Qd=q(he());var Zd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var PC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var NC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var $g=e=>{let t=NC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Zs=q(he());var BC={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 UC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var FC=(0,Zs.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,Zs.createElement)("svg",{ref:s,...BC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Zd("lucide",r),...!o&&!UC(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,Zs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Pe=(e,t)=>{let a=(0,Qd.forwardRef)(({className:n,...r},o)=>(0,Qd.createElement)(FC,{ref:o,iconNode:t,className:Zd(`lucide-${PC($g(e))}`,`lucide-${e}`,n),...r}));return a.displayName=$g(e),a};var MU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=Pe("arrow-down",MU);var AU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ur=Pe("arrow-up",AU);var RU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=Pe("check",RU);var DU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zr=Pe("chevron-down",DU);var _U=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eu=Pe("chevron-right",_U);var OU=[["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"}]],tu=Pe("clipboard-copy",OU);var PU=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cr=Pe("clock",PU);var NU=[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],au=Pe("file-text",NU);var BU=[["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"}]],ll=Pe("file",BU);var UU=[["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"}]],nu=Pe("globe",UU);var FU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ru=Pe("image",FU);var zU=[["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"}]],ou=Pe("loader",zU);var qU=[["path",{d:"M5 12h14",key:"1ays0h"}]],Bo=Pe("minus",qU);var HU=[["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"}]],sl=Pe("paperclip",HU);var jU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],iu=Pe("square",jU);var VU=[["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"}]],Uo=Pe("wrench",VU);var WU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],On=Pe("x",WU);var GU=[["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"}]],lu=Pe("zap",GU);var Ge=q(he(),1),rO=q(um(),1);var ul=q(he(),1),su=q(ae(),1);function KU(e){return 1-(1-e)**3}function YU({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=KU,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 ZU=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],QU=[0,1,2,0,1,2,1];function JU(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(QU[a],e.length-1)];t.push(`radial-gradient(at ${ZU[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var e3=({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,ul.useState)(110),[d,f]=(0,ul.useState)(0),[p,m]=(0,ul.useState)(!1);(0,ul.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),YU({ease:C=>C,duration:2e3,onUpdate:C=>{let A=C/100;c(T+360*A);let R=Math.min(A/.1,1),P=A>.85?(1-A)/.15:1;f(Math.min(R,P))},onEnd:()=>m(!1)})},[l]);let x=n+20,S=p?Math.max(0,(d*100-x)/(100-x)):0,y=JU(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,su.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,su.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",...y].join(", "),opacity:S,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,su.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},ef=e3;Xg();Yg();var t3=VC({prefix:"ww"});function V(...e){return t3(tf(e))}var uu=q(ae(),1);function cl({suggestions:e,isLoading:t,onSelect:a,className:n,...r}){return e.length===0&&!t?null:(0,uu.jsx)("div",{className:V("ww:px-4 ww:py-2",n),...r,children:(0,uu.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,uu.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,uu.jsx)("button",{type:"button",onClick:()=>a(o),className:V("ww:rounded-full ww:border ww:border-border ww:bg-accent ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-border 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 af=q(he(),1);function Zg(e,t){return e.find(a=>a.text===t)?.id??null}async function WC(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let l=Ys(t);if(l)try{let 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:n,source:r,timestamp:s,correlation:{visitorId:ea(),sessionId:o},properties:{...i,url:window.location.href},metadata:{}}]});await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{}}async function GC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:l,origin:s,text:u,index:c}=e;await WC({api:t,token:a,name:"suggestion.clicked",source:o,sessionId:i,properties:{promptId:l,origin:s,text:u,index:c,channelId:n,mode:r}})}function $C(e,t){return t.map(a=>({id:Zg(e,a),text:a}))}async function XC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:l,origin:s}=e;l.length!==0&&await WC({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:l,count:l.length,origin:s,channelId:n,mode:r}})}function dl(e){let{widgetEvents:t,api:a,token:n,channelId:r,source:o,mode:i,pagePrompts:l}=e,s=(0,af.useRef)(e.getSessionId);s.current=e.getSessionId,(0,af.useEffect)(()=>{if(!(!a||!n))return t.subscribe(u=>{if(u.name==="suggestion.clicked"){let{text:c,origin:d,index:f}=u.properties;GC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),promptId:Zg(l??[],c),origin:d,text:c,index:f});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;XC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),prompts:$C(l??[],c),origin:d})}})},[t,a,n,r,o,i,l])}var fl=q(he(),1),a3=80,n3=50,r3=15e3,KC=500;function pl(e,t=!0){let[a,n]=(0,fl.useState)(""),r=(0,fl.useRef)(void 0);return(0,fl.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,KC)):r.current=setTimeout(s,n3)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,r3)):r.current=setTimeout(s,a3)))};return r.current=setTimeout(s,KC),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var vn=q(he(),1);var YC=["en","fr","es"];function ml(e){return YC.includes(e)}function Qg(e){if(e&&ml(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&ml(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(ml(n))return n;let r=n.split("-")[0];if(r&&ml(r))return r}return"en"}var nf={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",uploadFilesUpTo:"Upload a document, up to {limit}",uploadFilesUpToWithPages:"Upload a document, up to {limit} and {pages} pages",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments",removeAttachment:"Remove attachment",uploading:"Uploading\u2026",retry:"Retry",retryUpload:"Retry the upload",uploadFailed:"The upload did not finish.",dropToAttach:"Drop to attach",errorAccept:"{name} is not a file type this chat accepts.",errorTooLarge:"{name} is larger than {limit}.",errorTooMany:"You can attach up to {limit} files."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"File",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 ZC={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",uploadFilesUpTo:"Subir un documento, hasta {limit}",uploadFilesUpToWithPages:"Subir un documento, hasta {limit} y {pages} p\xE1ginas",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos",removeAttachment:"Quitar archivo",uploading:"Subiendo\u2026",retry:"Reintentar",retryUpload:"Reintentar la subida",uploadFailed:"La subida no se complet\xF3.",dropToAttach:"Suelta para adjuntar",errorAccept:"{name} no es un tipo de archivo que acepte este chat.",errorTooLarge:"{name} supera {limit}.",errorTooMany:"Puedes adjuntar hasta {limit} archivos."},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",kindPdf:"PDF",kindImage:"Imagen",kindFile:"Archivo",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 QC={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",uploadFilesUpTo:"Joindre un document, jusqu'\xE0 {limit}",uploadFilesUpToWithPages:"Envoyer un document, jusqu'\xE0 {limit} et {pages} pages",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes",removeAttachment:"Retirer la pi\xE8ce jointe",uploading:"Envoi en cours\u2026",retry:"R\xE9essayer",retryUpload:"R\xE9essayer l'envoi",uploadFailed:"L'envoi ne s'est pas termin\xE9.",dropToAttach:"D\xE9posez pour joindre",errorAccept:"{name} n'est pas un type de fichier accept\xE9 par ce chat.",errorTooLarge:"{name} d\xE9passe {limit}.",errorTooMany:"Vous pouvez joindre jusqu'\xE0 {limit} fichiers."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"Fichier",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 Jg={en:nf,fr:QC,es:ZC};var ek=q(ae(),1),JC=(0,vn.createContext)(null);function o3(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 Fo({children:e,locale:t,messages:a}){let n=!!(t&&i3(t)),r=n?t:"en",[o,i]=(0,vn.useState)(r),[l,s]=(0,vn.useState)(n);(0,vn.useEffect)(()=>{i(Qg(t)),s(!0)},[t]);let u=(0,vn.useMemo)(()=>{let c=Jg[o]??Jg["en"];return{locale:o,t:o3(c,a),ready:l}},[o,a,l]);return(0,ek.jsx)(JC.Provider,{value:u,children:e})}function i3(e){return e==="en"||e==="fr"||e==="es"}function Te(){let e=(0,vn.useContext)(JC);return e||{locale:"en",t:nf,ready:!0}}function ew(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 Fe=q(he(),1);var cu=(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 Ie=q(he(),1);var zo=new Map;function tk(e,t){if(zo.has(e)){URL.revokeObjectURL(t);return}for(zo.set(e,t);zo.size>20;){let a=zo.keys().next();if(a.done)return;let n=zo.get(a.value);zo.delete(a.value),n&&URL.revokeObjectURL(n)}}function ak(e){return zo.get(e)}var nk=q(ae(),1),Pn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,nk.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 rk=q(he(),1);var vt=q(ae(),1),ok=({files:e,className:t,...a})=>e.length===0?null:(0,vt.jsx)("div",{className:V("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,vt.jsx)(l3,{file:n},r))});function l3({file:e}){let{t}=Te();return e.mediaType?.startsWith("image/")&&e.url?(0,vt.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,vt.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,vt.jsx)(ll,{className:"ww:size-3 ww:shrink-0"}),(0,vt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function ik(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function s3({mediaType:e}){return e.startsWith("image/")?(0,vt.jsx)(ru,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,vt.jsx)(au,{className:"ww:size-5 ww:text-muted-foreground"}):(0,vt.jsx)(ll,{className:"ww:size-5 ww:text-muted-foreground"})}function tw({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:l}=Te(),s=ik(t,l);return(0,vt.jsxs)("li",{"aria-label":`${e}, ${s}`,className:V("ww:relative ww:flex ww:w-60 ww:max-w-full ww:cursor-default ww:items-center ww:gap-2.5 ww:overflow-hidden ww:rounded-xl ww:border ww:bg-background ww:p-2.5",r==="error"?"ww:border-destructive/50":"ww:border-border",i),children:[(0,vt.jsx)("span",{className:"ww:flex ww:size-10 ww:shrink-0 ww:items-center ww:justify-center ww:overflow-hidden ww:rounded-xl ww:bg-muted",children:a?(0,vt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,vt.jsx)(s3,{mediaType:t})}),(0,vt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,vt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,vt.jsx)("span",{className:V("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??s})]}),o]})}function lk(e){if(typeof e!="object"||e===null)return[];let t=e.documents;return Array.isArray(t)?t.filter(a=>typeof a=="object"&&a!==null&&typeof a.documentId=="string"&&typeof a.filename=="string"&&typeof a.mediaType=="string"):[]}var sk=({documents:e,className:t,...a})=>e.length===0?null:(0,vt.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:items-end ww:justify-end ww:gap-2 ww:p-0",t),...a,children:e.map((n,r)=>(0,vt.jsx)(u3,{document:n},`${n.documentId}-${r}`))});function u3({document:e}){let{t}=Te(),[a,n]=(0,rk.useState)(!1),r=e.mediaType.startsWith("image/")?ak(e.documentId):void 0;return r&&!a?(0,vt.jsx)("li",{children:(0,vt.jsx)("img",{alt:`${e.filename}, ${ik(e.mediaType,t)}`,className:"ww:max-h-80 ww:max-w-72 ww:rounded-xl ww:border ww:border-border ww:object-contain",onError:()=>n(!0),src:r,title:e.filename})}):(0,vt.jsx)(tw,{filename:e.filename,mediaType:e.mediaType})}var mt=q(ae(),1),c3=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}},d3=(e,t)=>{if(!t)return!0;let a=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(a.length===0)return!0;let n=e.type.toLowerCase(),r=e.name.toLowerCase();return a.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?n.startsWith(o.slice(0,-1)):n===o)},ck=(0,Ie.createContext)(null),rf=()=>{let e=(0,Ie.useContext)(ck);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},dk=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,maxPdfPages:i,attachmentsEnabled:l=!0,upload:s,onDiscard:u,onError:c,onSubmit:d,children:f,...p})=>{let{t:m,locale:x}=Te(),S=(0,Ie.useRef)(null),w=(0,Ie.useRef)(null),[y,g]=(0,Ie.useState)([]),b=(0,Ie.useRef)(y),T=(0,Ie.useRef)(new Map),C=(0,Ie.useRef)(s),A=(0,Ie.useRef)(c),R=(0,Ie.useRef)(u);(0,Ie.useEffect)(()=>{C.current=s,A.current=c,R.current=u},[s,c,u]);let P=(0,Ie.useCallback)(v=>{b.current=v,g(v)},[]),L=(0,Ie.useCallback)(()=>{S.current?.click()},[]),W=(0,Ie.useCallback)((v,z)=>{P(b.current.map(J=>J.id===v?{...J,...z}:J))},[P]),H=(0,Ie.useCallback)((v,z)=>{let J=C.current;if(!J)return;let we=new AbortController,$e=J(z,we.signal,Se=>{W(v,{progress:Se})}).then(Se=>(W(v,{status:"ready",progress:1,documentId:Se.documentId,error:void 0}),Se)).catch(Se=>{if(we.signal.aborted)return null;let pe=Se instanceof Error?Se.message:m.promptInput.uploadFailed;return W(v,{status:"failed",error:pe}),A.current?.({code:"upload_failed",message:pe}),null});T.current.set(v,{file:z,controller:we,done:$e})},[W,m]),F=(0,Ie.useCallback)(v=>{let z=[...v];if(!l||z.length===0)return;let J=(de,Z)=>A.current?.({code:de,message:Z}),we=[];for(let de of z){if(!d3(de,t)){J("accept",m.promptInput.errorAccept.replace("{name}",de.name));continue}if(o&&de.size>o){J("max_file_size",m.promptInput.errorTooLarge.replace("{name}",de.name).replace("{limit}",fk(o,x)));continue}we.push(de)}if(we.length===0)return;let $e=typeof r=="number"?Math.max(0,r-b.current.length):void 0,Se=typeof $e=="number"?we.slice(0,$e):we;if(Se.length<we.length&&J("max_files",m.promptInput.errorTooMany.replace("{limit}",String(r))),Se.length===0)return;let pe=!!C.current,ue=Se.map(de=>({file:de,item:{filename:de.name,id:cu(),mediaType:de.type,type:"file",url:URL.createObjectURL(de),status:pe?"uploading":"ready",progress:0}}));P([...b.current,...ue.map(de=>de.item)]);for(let de of ue)H(de.item.id,de.file)},[r,o,t,l,H,P,m,x]),$=(0,Ie.useCallback)(v=>{let z=T.current.get(v);z&&(W(v,{status:"uploading",progress:0,error:void 0}),H(v,z.file))},[W,H]),G=(0,Ie.useCallback)((v,z)=>{T.current.get(v.id)?.controller.abort(),T.current.delete(v.id),v.url&&(!z&&!!v.documentId&&!!v.mediaType?.startsWith("image/")&&v.documentId?tk(v.documentId,v.url):URL.revokeObjectURL(v.url)),z&&v.documentId&&R.current?.({documentId:v.documentId,filename:v.filename??"",mediaType:v.mediaType??""})},[]),B=(0,Ie.useCallback)(v=>{let z=b.current.find(J=>J.id===v);z&&G(z,!0),P(b.current.filter(J=>J.id!==v))},[G,P]),D=(0,Ie.useCallback)(()=>{for(let v of b.current)G(v,!0);P([])},[G,P]),Q=(0,Ie.useRef)(l);(0,Ie.useEffect)(()=>{let v=Q.current;Q.current=l,v&&!l&&D()},[l,D]);let be=(0,Ie.useCallback)(()=>{for(let v of b.current)G(v,!1);P([])},[G,P]);(0,Ie.useEffect)(()=>()=>{for(let v of b.current)T.current.get(v.id)?.controller.abort(),v.url&&URL.revokeObjectURL(v.url)},[]);let I=(0,Ie.useCallback)(v=>{v.currentTarget.files&&F(v.currentTarget.files),v.currentTarget.value=""},[F]);(0,Ie.useEffect)(()=>{if(!n)return;let v=J=>{J.dataTransfer?.types?.includes("Files")&&J.preventDefault()},z=J=>{J.dataTransfer?.types?.includes("Files")&&J.preventDefault(),J.dataTransfer?.files&&J.dataTransfer.files.length>0&&F(J.dataTransfer.files)};return document.addEventListener("dragover",v),document.addEventListener("drop",z),()=>{document.removeEventListener("dragover",v),document.removeEventListener("drop",z)}},[F,n]);let qe=(0,Ie.useCallback)(async v=>{v.preventDefault();let z=v.currentTarget,J=new FormData(z).get("message")||"",we=new Map;for(;we.size<T.current.size;)await Promise.all([...T.current.entries()].filter(([ue])=>!we.has(ue)).map(async([ue,de])=>{we.set(ue,await de.done)}));for(let ue of we.keys())T.current.has(ue)||we.delete(ue);if([...we.values()].some(ue=>ue===null)){A.current?.({code:"upload_failed",message:m.promptInput.uploadFailed});return}let $e=[...we.values()].filter(ue=>ue!==null),Se=C.current?[]:b.current,pe=await Promise.all(Se.map(async({id:ue,status:de,progress:Z,error:He,...Xe})=>{if(Xe.url?.startsWith("blob:")){let Re=await c3(Xe.url);return{...Xe,url:Re??Xe.url}}return Xe}));try{let ue=d({documents:$e,files:pe,text:J},v);ue instanceof Promise&&await ue,z.reset(),be()}catch{}},[d,be,m]),lt=(0,Ie.useMemo)(()=>({add:F,clear:D,files:y,openFileDialog:L,remove:B,retry:$,maxFileSize:o,maxPdfPages:i}),[y,F,B,$,D,L,o,i]);return(0,mt.jsxs)(ck.Provider,{value:lt,children:[(0,mt.jsx)("input",{accept:t,"aria-label":m.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:I,ref:S,title:m.promptInput.uploadFiles,type:"file"}),(0,mt.jsx)("form",{className:V("ww:relative ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:qe,ref:w,...p,children:f})]})},uk=1024*1024;function fk(e,t){let a=e>=uk;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/uk:Math.max(1,e/1024))}var pk=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Te(),i=rf(),[l,s]=(0,Ie.useState)(!1),u=n??o.promptInput.placeholder,c=(0,Ie.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('[data-submit-blocked="true"]')||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,Ie.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let S=x.getAsFile();S&&m.push(S)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,mt.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})},mk=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:l}=Te(),s=t==="submitted"||t==="streaming",u=s&&a!==void 0,c=(0,mt.jsx)(ur,{className:"ww:size-4"});t==="submitted"?c=(0,mt.jsx)(ou,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,mt.jsx)(iu,{className:"ww:size-4"}));let d=(0,Ie.useCallback)(f=>{if(s&&a){f.preventDefault(),a();return}n?.(f)},[s,a,n]);return(0,mt.jsx)(Pn,{"aria-label":s?l.promptInput.stop:l.promptInput.submit,className:V("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),"data-submit-blocked":o?"true":void 0,disabled:u?!1:o,onClick:d,size:"icon-sm",type:u?"button":"submit",variant:"ghost",...i,children:r??c})},hk=({className:e,children:t,...a})=>{let{t:n,locale:r}=Te(),o=rf();if(o.files.length>0)return(0,mt.jsxs)(Pn,{className:V("ww:group ww:relative",e),onClick:()=>o.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,mt.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:o.files.length}),(0,mt.jsx)(On,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]});let l=o.maxFileSize?(o.maxPdfPages?n.promptInput.uploadFilesUpToWithPages.replace("{pages}",String(o.maxPdfPages)):n.promptInput.uploadFilesUpTo).replace("{limit}",fk(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,mt.jsx)(Pn,{"aria-label":l,className:V(e),title:l,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,mt.jsx)(sl,{className:"ww:size-4"})})},gk=({className:e,...t})=>{let a=rf();return a.files.length===0?null:(0,mt.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:gap-2 ww:p-0",e),...t,children:a.files.map(n=>(0,mt.jsx)(f3,{file:n},n.id))})};function f3({file:e}){let{t}=Te(),a=rf(),n=e.status==="failed",r=e.status==="uploading";return(0,mt.jsxs)(tw,{filename:e.filename??t.attachments.fileFallback,mediaType:e.mediaType??"",previewUrl:e.mediaType?.startsWith("image/")?e.url:void 0,subtitle:n?e.error:r?t.promptInput.uploading:void 0,tone:n?"error":"default",children:[n?(0,mt.jsx)("button",{"aria-label":t.promptInput.retryUpload,className:"ww:ml-auto ww:shrink-0 ww:text-destructive ww:text-xs ww:underline ww:underline-offset-2",onClick:()=>a.retry(e.id),type:"button",children:t.promptInput.retry}):null,(0,mt.jsx)("button",{"aria-label":t.promptInput.removeAttachment,className:V("ww:shrink-0 ww:rounded-full ww:p-1 ww:opacity-60 ww:transition-opacity hover:ww:bg-muted hover:ww:opacity-100",n?null:"ww:ml-auto"),onClick:()=>a.remove(e.id),type:"button",children:(0,mt.jsx)(On,{className:"ww:size-3.5"})}),r?(0,mt.jsx)("span",{"aria-hidden":!0,className:"ww:absolute ww:bottom-0 ww:left-0 ww:h-0.5 ww:bg-primary ww:transition-[width] ww:duration-200",style:{width:`${Math.round(e.progress*100)}%`}}):null]})}var wk=({enabled:e=!0})=>{let{t}=Te(),[a,n]=(0,Ie.useState)(!1);return(0,Ie.useEffect)(()=>{if(!e)return;let r=0,o=u=>!!u.dataTransfer?.types?.includes("Files"),i=u=>{o(u)&&(r+=1,n(!0))},l=u=>{o(u)&&(r=Math.max(0,r-1),r===0&&n(!1))},s=()=>{r=0,n(!1)};return document.addEventListener("dragenter",i),document.addEventListener("dragleave",l),document.addEventListener("drop",s),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",l),document.removeEventListener("drop",s)}},[e]),e&&a?(0,mt.jsx)("div",{className:"ww:pointer-events-none ww:absolute ww:inset-0 ww:z-50 ww:flex ww:items-center ww:justify-center ww:rounded-2xl ww:border-2 ww:border-primary ww:border-dashed ww:bg-background/85",children:(0,mt.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,mt.jsx)(sl,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var xk=q(ae(),1);function yk({text:e}){let{t}=Te();return e===!1?null:(0,xk.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 of=q(he(),1);var qo=q(ae(),1),vk=({className:e,...t})=>(0,qo.jsx)("div",{className:V("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),bk=({className:e,...t})=>(0,qo.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}),Sk=({className:e,...t})=>(0,qo.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}),Ik=({className:e,...t})=>(0,qo.jsx)("span",{className:V("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),Ck=({className:e,...t})=>(0,qo.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}),kk=({className:e,...t})=>(0,qo.jsx)(Pn,{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 ln=q(ae(),1),Tk=(0,of.memo)(({message:e,onRemove:t})=>{let{t:a}=Te(),n=(0,of.useCallback)(()=>t(e.id),[t,e.id]);return(0,ln.jsxs)(bk,{children:[(0,ln.jsx)(Sk,{}),(0,ln.jsx)(Ik,{children:e.text||a.chatQueue.attachmentFallback}),(0,ln.jsx)(Ck,{children:(0,ln.jsx)(kk,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,ln.jsx)(On,{className:"ww:size-3"})})})]})});Tk.displayName="ChatQueueItem";function Lk({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Te();return e.length===0?null:(0,ln.jsxs)(vk,{className:V("ww:border-t ww:border-border",a),children:[(0,ln.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,ln.jsx)("ul",{children:e.map(r=>(0,ln.jsx)(Tk,{message:r,onRemove:t},r.id))})]})}var Da=q(he(),1);var bt=q(he(),1);cp();var o2=q(he(),1);var i2=q(ae(),1),D6=({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,i2.jsx)(e,{"data-waniwani-shimmer":"",className:V("ww:inline-block",t),style:i,...o,children:r})},Cn=(0,o2.memo)(D6);Cn.displayName="Shimmer";var la=q(ae(),1),l2=(0,bt.createContext)(null);function s2(){let e=(0,bt.useContext)(l2);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var _6=1e3,O6=1e3,Uu=(0,bt.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,bt.useState)(s),p=c?a:d,m=(0,bt.useCallback)(A=>{c||f(A),r?.(A)},[c,r]),[x,S]=(0,bt.useState)(void 0),w=o??x,y=(0,bt.useRef)(t),[g,b]=(0,bt.useState)(!1),T=(0,bt.useRef)(null);(0,bt.useEffect)(()=>{t?(y.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(S(Math.ceil((Date.now()-T.current)/O6)),T.current=null)},[t]),(0,bt.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,bt.useEffect)(()=>{if(y.current&&!t&&p&&!g){let A=setTimeout(()=>{m(!1),b(!0)},_6);return()=>clearTimeout(A)}},[t,p,g,m]);let C=(0,bt.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:w}),[t,p,m,w]);return(0,la.jsx)(l2.Provider,{value:C,children:(0,la.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})})});Uu.displayName="Reasoning";var Fu=(0,bt.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Te(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=s2(),f=a??((p,m)=>p||m===0?(0,la.jsx)(Cn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,la.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,la.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,la.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,la.jsxs)(la.Fragment,{children:[!n&&(0,la.jsx)(cr,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});Fu.displayName="ReasoningTrigger";var zu=(0,bt.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=s2();return(0,la.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,la.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,la.jsx)("div",{className:V("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,la.jsx)(Ll,{children:t})})})})});zu.displayName="ReasoningContent";var Ne=q(ae(),1),P6=500,u2=(0,Da.createContext)(null);function c2(){let e=(0,Da.useContext)(u2);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function d2({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,Da.useState)(r),d=s?n:u,f=(0,Da.useCallback)(S=>{s||c(S),o?.(S)},[s,o]),[p,m]=(0,Da.useState)(!t);(0,Da.useEffect)(()=>{if(t){m(!1);return}let S=setTimeout(()=>m(!0),P6);return()=>clearTimeout(S)},[t]);let x=(0,Da.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ne.jsx)(u2.Provider,{value:x,children:(0,Ne.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 f2({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=c2();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ne.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,Ne.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,Ne.jsx)(c,{className:V("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ne.jsx)("span",{className:"ww:truncate",children:l?(0,Ne.jsx)(Cn,{duration:2.6,children:d}):d})]},d)})}return(0,Ne.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,Ne.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ne.jsx)(Zr,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function p2({className:e,children:t,...a}){let{open:n}=c2();return(0,Ne.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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.jsx)("div",{className:V("ww:flex ww:flex-col",e),...a,children:t})})})}function m2({icon:e,isLast:t,running:a,error:n}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ne.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ne.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,Ne.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Mx({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,Da.useState)(!1),f=a??"",p=l?(0,Ne.jsx)(Cn,{duration:1.6,children:f}):(0,Ne.jsx)("span",{className:"ww:truncate",children:f});return(0,Ne.jsxs)("div",{className:V("ww:flex ww:gap-2",e),...i,children:[(0,Ne.jsx)(m2,{icon:t,isLast:r,running:l,error:s}),(0,Ne.jsxs)("div",{className:V("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ne.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,Ne.jsx)(Zr,{className:V("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ne.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Ne.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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.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 h2({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ne.jsx)(m2,{icon:cr,isLast:t,running:e}),(0,Ne.jsx)("div",{className:V("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ne.jsxs)(Uu,{isStreaming:e,className:"ww:mb-0",children:[(0,Ne.jsx)(Fu,{hideIcon:!0}),(0,Ne.jsx)(zu,{children:a})]})})]})}var Ax={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var g2={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var x2=q(he(),1);var yr=q(he(),1),N6=5,w2=400;function y2(e,t,a={}){let{msPerChar:n=N6}=a,[r,o]=(0,yr.useState)(t?"":e),i=(0,yr.useRef)(e),l=(0,yr.useRef)(t?0:e.length),s=(0,yr.useRef)(0),u=(0,yr.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,yr.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>w2&&(l.current=i.current.length-w2),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 qu=q(ae(),1),Rx=({className:e,from:t,children:a,...n})=>(0,qu.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,qu.jsx)("div",{className:V("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Dx=({children:e,className:t,...a})=>(0,qu.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}),B6={cjk:Ax,code:g2},U6={cjk:Ax},F6={enabled:!1};function z6({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=y2(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,qu.jsx)(Ll,{className:V("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??F6,plugins:a?U6:B6,...r,children:l})}var hp=(0,x2.memo)(z6,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);hp.displayName="MessageResponse";var Ht=q(he(),1);function _x(e){if(!(typeof e!="object"||e===null))return e}function v2(e){return _x(e?.ui)}function Ox(e){if(!e)return;let t=v2(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 Hu(e){return v2(e)?.autoHeight===!0}function Px(e){return _x(_x(e)?._meta)}var Le=q(ae(),1);function q6(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 H6({text:e,className:t}){let{t:a}=Te(),[n,r]=(0,Ht.useState)(!1),o=(0,Ht.useRef)(null);(0,Ht.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Ht.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,Le.jsx)(Pn,{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,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(Js,{className:"ww:size-3.5"}),(0,Le.jsx)("span",{children:a.tool.copied})]}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(tu,{className:"ww:size-3.5"}),(0,Le.jsx)("span",{children:a.tool.copy})]})})}function b2({data:e,label:t,className:a,...n}){let[r,o]=(0,Ht.useState)(!1),i=(0,Ht.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=q6(e);return(0,Le.jsxs)("div",{className:V("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,Le.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,Le.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,Le.jsx)(H6,{text:i})]}),(0,Le.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,Le.jsx)(eu,{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,Le.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,Le.jsx)("code",{children:i})}):(0,Le.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Nx=(0,Ht.createContext)({open:!1,toggle:()=>{}});function S2({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Ht.useState)(t);return(0,Le.jsx)(Nx.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,Le.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 I2({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Ht.useContext)(Nx),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,Le.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,Le.jsx)(Uo,{className:"ww:size-4 ww:shrink-0"}),(0,Le.jsx)("span",{className:"ww:truncate",children:i?(0,Le.jsx)(Cn,{duration:1.6,children:l}):l}),(0,Le.jsx)(Zr,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function C2({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,Le.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,Le.jsx)("span",{className:"ww:truncate",children:r?(0,Le.jsx)(Cn,{duration:1.6,children:o}):o})})}function k2({className:e,children:t,...a}){let{open:n}=(0,Ht.useContext)(Nx);return(0,Le.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,Le.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Le.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 Bx({className:e,input:t,debug:a,...n}){let{t:r}=Te(),o=(0,Ht.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,Le.jsx)(b2,{data:o,label:r.tool.request,className:e,...n})}function ju(e,t,a){if(e){let n=Ox(a?.[e]?._meta);if(n)return n}return Ox(Px(t))}function T2(e,t,a){return e&&Hu(a?.[e]?._meta)?!0:Hu(Px(t))}function Ux({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Te(),i=(0,Ht.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,Le.jsxs)("div",{className:V("ww:space-y-2",e),...r,children:[(0,Le.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,Le.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,Le.jsx)(b2,{data:i,label:o.tool.response,className:e,...r}):null}var Vu=q(ae(),1);function L2(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function E2(e){return e.parts.some(L2)}function M2(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=>!(!L2(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function A2({className:e,...t}){let{t:a}=Te();return(0,Vu.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,Vu.jsx)(lu,{className:"ww:size-4 ww:shrink-0"}),(0,Vu.jsx)(Cn,{duration:1.6,children:a.workingIndicator.default})]})}var Qe=q(he(),1);function El(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 R2(e,t){return!El(e)&&!El(t)?null:El(e)?El(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 xr=q(he(),1);var D2=(0,xr.createContext)(()=>{});function _2(){return(0,xr.useContext)(D2)}var O2=D2.Provider;function j6(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function Ml(e){let t=(0,xr.useRef)(e);t.current=e;let a=(0,xr.useRef)(!1);(0,xr.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;No(r.paintMark),j6(()=>AC(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var P2=q(ae(),1),V6="/api/mcp/resource",W6=500,G6=0,$6=16,X6="2026-01-26",K6=300,Y6=3e3,Z6=3,Q6=2e3;function J6(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function e9(e,t,a){return ju(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function gp({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=V6,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,Qe.useRef)(null),x=(0,Qe.useRef)(t),S=(0,Qe.useRef)(a),w=(0,Qe.useRef)({width:0,height:0}),y=(0,Qe.useRef)(null),g=(0,Qe.useRef)(!1),b=(0,Qe.useRef)(0),T=(0,Qe.useRef)("inline"),[C,A]=(0,Qe.useState)(G6),[R,P]=(0,Qe.useState)(void 0),L=(0,Qe.useRef)(s),W=(0,Qe.useRef)(u),H=(0,Qe.useRef)(c),F=(0,Qe.useRef)(d),$=(0,Qe.useRef)(r),G=(0,Qe.useRef)(p);x.current=t,S.current=a,L.current=s,W.current=u,H.current=c,F.current=d,$.current=r,G.current=p;let B=(0,Qe.useCallback)(v=>l?Math.max(v+$6,0):Math.min(Math.max(v,50),W6),[l]),D=(0,Qe.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),Q=_2(),be=(0,Qe.useRef)(null),I=(0,Qe.useRef)(void 0);(0,Qe.useEffect)(()=>{let v=DC(e,Q);return be.current=v,()=>{clearTimeout(I.current),v.has("initialized")||v.report("timeout",b.current),be.current=null}},[e,Q]);let qe=(0,Qe.useRef)(o);qe.current=o;let lt=(0,Qe.useRef)(f);return(0,Qe.useEffect)(()=>{lt.current=f,w.current.height=-1,y.current&&(y.current.cancel(),y.current=null)},[f]),(0,Qe.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,Qe.useEffect)(()=>{let v=m.current;if(!v)return;let z=!1,J=!1,we=null,$e=null,Se=setTimeout(()=>{if(z||J||b.current>=Z6)return;b.current+=1;let de=new URL(v.src);de.searchParams.set("_retry",String(b.current)),v.src=de.toString()},Y6),pe=de=>{v.contentWindow?.postMessage(de,"*")},ue=de=>{if(z||de.source!==v.contentWindow)return;let Z=de.data;if(!Z||typeof Z!="object"||Z.jsonrpc!=="2.0")return;let He=Z.method,Xe=Z.id;if(He==="ui/initialize"&&Xe!=null){J=!0,be.current?.mark("initialize"),clearTimeout(Se),pe({jsonrpc:"2.0",id:Xe,result:{protocolVersion:Z.params?.protocolVersion??X6,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:qe.current?"dark":"light",displayMode:T.current}}});return}if(He==="ui/notifications/initialized"){g.current=!0,be.current?.mark("initialized"),I.current=setTimeout(()=>be.current?.report("ok",b.current),Q6);let Re=x.current,ye=S.current,Ce=ye._meta&&typeof ye._meta=="object"?ye._meta:null,xe=J6($.current),Je=Ce&&typeof Ce.waniwani=="object"&&Ce.waniwani!==null?Ce.waniwani:null,jt=Je||xe?{...Je??{},...xe?{sessionId:xe}:{}}:void 0,aa=Ce||jt?{...Ce??{},...jt?{waniwani:jt}:{}}:void 0;pe({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:Re}});let sa=ye.content??[{type:"text",text:JSON.stringify(ye)}];pe({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:sa,structuredContent:ye.structuredContent,_meta:aa,meta:aa}});return}if(He==="ui/notifications/size-changed"){clearTimeout(I.current),be.current?.mark("firstSize"),be.current?.report("ok",b.current);let Re=Z.params,ye=typeof Re?.height=="number"?Re.height:void 0,Ce=typeof Re?.width=="number"?Re.width:void 0,xe=w.current,Je=ye!==void 0&&ye!==xe.height,jt=Ce!==void 0&&Ce!==xe.width;if(!Je&&!jt)return;if(Je&&ye!==void 0){if(xe.height=ye,lt.current)return;let aa=B(ye),sa=v.getBoundingClientRect().height;if(y.current&&(y.current.cancel(),y.current=null),A(aa),v.animate&&Math.abs(sa-aa)>2){let Xa=v.animate([{height:`${sa}px`},{height:`${aa}px`}],{duration:K6,easing:"ease-out",fill:"forwards"});y.current=Xa,Xa.onfinish=()=>{y.current===Xa&&(Xa.cancel(),y.current=null)}}}jt&&l&&Ce!==void 0&&(xe.width=Ce,P(Ce));return}if(He==="ui/open-link"&&Xe!=null){let Re=Z.params?.url;typeof Re=="string"&&(L.current?L.current(Re):window.open(Re,"_blank","noopener,noreferrer")),pe({jsonrpc:"2.0",id:Xe,result:{}});return}if(He==="ui/message"&&Xe!=null){if(W.current&&Z.params){let Re=Z.params,ye=we;if(we=null,$e){clearTimeout($e.timer);let Ce=$e.text;$e=null;let xe=(Re.content??[]).map(Je=>Je.text??"").join("").trim();Re={...Re,content:[{type:"text",text:`${xe}
|
|
118
|
+
`)},vx=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("")},g6=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=>vx(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?vx(l[u]):"";n[r]=`| ${s.join(" | ")} |`,r+=1}else{let s=l.map(u=>vx(u));n[r]=`| ${s.join(" | ")} |`,r+=1}return n.join(`
|
|
119
|
+
`)},w6=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,_.useState)(!1),[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(null),c=(0,_.useRef)(0),{isAnimating:d}=(0,_.useContext)(wa),f=async m=>{var x,S;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let w=(S=u.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),y=w?.querySelector("table");if(!y){n?.(new Error("Table not found"));return}let g=DR(y),b=m==="csv"?_R(g):h6(g),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([y.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(w){n?.(w)}};(0,_.useEffect)(()=>{let m=x=>{let S=x.composedPath();u.current&&!S.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?kx:Tx;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.jsx)("button",{className:ce("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]})},y6=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useRef)(null),{isAnimating:l}=(0,_.useContext)(wa),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=DR(f),m=u==="csv"?_R(p):g6(p);Tl(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,_.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:ce("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)(mp,{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]})},x6=({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)(w6,{}),(0,E.jsx)(y6,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:ce("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),v6=(0,_.lazy)(()=>Promise.resolve().then(()=>(yR(),wR)).then(e=>({default:e.CodeBlock}))),b6=(0,_.lazy)(()=>Promise.resolve().then(()=>(bR(),vR)).then(e=>({default:e.Mermaid}))),S6=/language-([^\s]+)/;Cx=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,fp=(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},Ex=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:ce("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Tt(e,t));Ex.displayName="MarkdownOl";OR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:ce("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&hp(e.node,t.node));OR.displayName="MarkdownLi";PR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:ce("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Tt(e,t));PR.displayName="MarkdownUl";NR=(0,_.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:ce("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>Tt(e,t));NR.displayName="MarkdownHr";BR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:ce("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Tt(e,t));BR.displayName="MarkdownStrong";I6=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(wa),[i,l]=(0,_.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,_.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,_.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,_.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:ce("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)(u6,{...f})]}):(0,E.jsx)("a",{className:ce("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},UR=(0,_.memo)(I6,(e,t)=>Tt(e,t)&&e.href===t.href);UR.displayName="MarkdownA";FR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:ce("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Tt(e,t));FR.displayName="MarkdownH1";zR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:ce("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Tt(e,t));zR.displayName="MarkdownH2";qR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:ce("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Tt(e,t));qR.displayName="MarkdownH3";HR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:ce("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Tt(e,t));HR.displayName="MarkdownH4";jR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:ce("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Tt(e,t));jR.displayName="MarkdownH5";VR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:ce("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Tt(e,t));VR.displayName="MarkdownH6";WR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(wa),o=Cx(r,"table");return(0,E.jsx)(x6,{className:t,showControls:o,...n,children:e})},(e,t)=>Tt(e,t));WR.displayName="MarkdownTable";GR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:ce("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Tt(e,t));GR.displayName="MarkdownThead";$R=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:ce("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Tt(e,t));$R.displayName="MarkdownTbody";XR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:ce("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Tt(e,t));XR.displayName="MarkdownTr";KR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("th",{className:ce("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Tt(e,t));KR.displayName="MarkdownTh";YR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:ce("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Tt(e,t));YR.displayName="MarkdownTd";ZR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("blockquote",{className:ce("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Tt(e,t));ZR.displayName="MarkdownBlockquote";QR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:ce("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Tt(e,t));QR.displayName="MarkdownSup";JR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:ce("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Tt(e,t));JR.displayName="MarkdownSub";e2=(0,_.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,_.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,_.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,_.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,_.isValidElement)(i))return i;if(i.type===Ex){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)=>Tt(e,t));e2.displayName="MarkdownSection";C6=({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,_.useContext)(wa),c=Lx();if(l)return(0,E.jsx)("code",{className:ce("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(S6),f=(i=d?.at(1))!=null?i:"",p="";if((0,_.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=Cx(u,"mermaid"),S=fp(u,"download"),w=fp(u,"copy"),y=fp(u,"fullscreen"),g=fp(u,"panZoom"),b=x&&(S||w||y);return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(kR,{}),children:(0,E.jsxs)("div",{className:ce("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:[S?(0,E.jsx)(d6,{chart:p,config:s?.config}):null,w?(0,E.jsx)(IR,{code:p}):null,y?(0,E.jsx)(m6,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(b6,{chart:p,config:s?.config,showControls:g})]})})}let m=Cx(u,"code");return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(kR,{}),children:(0,E.jsx)(v6,{className:ce("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(r6,{code:p,language:f}),(0,E.jsx)(IR,{})]}):null})})},t2=(0,_.memo)(C6,(e,t)=>e.className===t.className&&hp(e.node,t.node));t2.displayName="MarkdownCode";a2=(0,_.memo)(i6,(e,t)=>e.className===t.className&&hp(e.node,t.node));a2.displayName="MarkdownImg";n2=(0,_.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,_.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)=>Tt(e,t));n2.displayName="MarkdownParagraph";k6={ol:Ex,li:OR,ul:PR,hr:NR,strong:BR,a:UR,h1:FR,h2:zR,h3:qR,h4:HR,h5:jR,h6:VR,table:WR,thead:GR,tbody:$R,tr:XR,th:KR,td:YR,blockquote:ZR,code:t2,img:a2,pre:({children:e})=>e,sup:QR,sub:JR,p:n2,section:e2},TR=[],LR={allowDangerousHtml:!0},pp=new WeakMap,T6=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 S=pp.get(m);S||(S=m.name,pp.set(m,S)),d+=S}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=pp.get(p);m||(m=p.name,pp.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()}},ER=new T6,r2=e=>{let t=L6(e),a=e.children||"";return M6(t.runSync(t.parse(a),a),e)},L6=e=>{let t=ER.get(e);if(t)return t;let a=E6(e);return ER.set(e,a),a},E6=e=>{let t=e.rehypePlugins||TR,a=e.remarkPlugins||TR,n=e.remarkRehypeOptions?{...LR,...e.remarkRehypeOptions}:LR;return ox().use(Yf).use(a).use(ep,n).use(t)},M6=(e,t)=>Uy(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),A6=/\[\^[^\]\s]{1,200}\](?!:)/,R6=/\[\^[^\]\s]{1,200}\]:/,D6=/<\/(\w+)>/,_6=/<(\w+)[\s>]/,bx=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]==="$"},O6=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]==="$"},Sx=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},o2=e=>{let t=A6.test(e),a=R6.test(e);if(t||a)return[e];let n=Ga.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(D6);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(_6);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=bx(u),d=Sx(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&O6(l)){let u=r[s-1],c=bx(u),d=Sx(u),f=Sx(l);if(c&&d%2===1&&!bx(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},i2={raw:Fk,sanitize:[gf,{}],harden:[Bk,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},l2={gfm:[qf,{}]},P6=Object.values(i2),N6=Object.values(l2),B6={block:" \u258B",circle:" \u25CF"},U6={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},wa=(0,_.createContext)(U6),Mx=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(r2,{...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)});Mx.displayName="Block";F6=["github-light","github-dark"],Ll=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=P6,remarkPlugins:o=N6,className:i,shikiTheme:l=F6,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Mx,parseMarkdownIntoBlocksFn:f=o2,caret:p,plugins:m,remend:x,linkSafety:S={enabled:!0},...w})=>{let y=(0,_.useId)(),[g,b]=(0,_.useTransition)(),T=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?ZL(e,x):e,[e,t,a,x]),C=(0,_.useMemo)(()=>f(T),[T,f]),[M,R]=(0,_.useState)(C);(0,_.useEffect)(()=>{t==="streaming"?b(()=>{R(C)}):R(C)},[C,t]);let P=t==="streaming"?M:C,L=(0,_.useMemo)(()=>P.map((N,D)=>`${y}-${D}`),[P.length,y]),$=(0,_.useMemo)(()=>{var N,D;return{shikiTheme:(D=(N=m?.code)==null?void 0:N.getThemes())!=null?D:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:S}},[l,u,c,t,s,S,m?.code]),H=(0,_.useMemo)(()=>({...k6,...n}),[n]),F=(0,_.useMemo)(()=>{let N=[];return m!=null&&m.cjk&&(N=[...N,...m.cjk.remarkPluginsBefore]),N=[...N,...o],m!=null&&m.cjk&&(N=[...N,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(N=[...N,m.math.remarkPlugin]),N},[o,m?.math,m?.cjk]),W=(0,_.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),V=(0,_.useMemo)(()=>p&&c?{"--streamdown-caret":`"${B6[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Ix.Provider,{value:m??null,children:(0,E.jsx)(wa.Provider,{value:$,children:(0,E.jsx)("div",{className:ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(r2,{components:H,rehypePlugins:W,remarkPlugins:F,...w,children:e})})})}):(0,E.jsx)(Ix.Provider,{value:m??null,children:(0,E.jsx)(wa.Provider,{value:$,children:(0,E.jsxs)("div",{className:ce("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:V,children:[P.length===0&&p&&c&&(0,E.jsx)("span",{}),P.map((N,D)=>(0,E.jsx)(d,{components:H,content:N,index:D,rehypePlugins:W,remarkPlugins:F,shouldParseIncompleteMarkdown:a,...w},L[D]))]})})})},(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);Ll.displayName="Streamdown";z6=({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,_.useRef)(null),u=(0,_.useRef)(null),[c,d]=(0,_.useState)(i),[f,p]=(0,_.useState)({x:0,y:0}),[m,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)({x:0,y:0}),[y,g]=(0,_.useState)({x:0,y:0}),b=(0,_.useCallback)(H=>{d(F=>Math.max(a,Math.min(n,F+H)))},[a,n]),T=(0,_.useCallback)(()=>{b(r)},[b,r]),C=(0,_.useCallback)(()=>{b(-r)},[b,r]),M=(0,_.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),R=(0,_.useCallback)(H=>{H.preventDefault();let F=H.deltaY>0?-r:r;b(F)},[b,r]),P=(0,_.useCallback)(H=>{if(H.button!==0||H.isPrimary===!1)return;x(!0),w({x:H.clientX,y:H.clientY}),g(f);let F=H.currentTarget;F instanceof HTMLElement&&F.setPointerCapture(H.pointerId)},[f]),L=(0,_.useCallback)(H=>{if(!m)return;H.preventDefault();let F=H.clientX-S.x,W=H.clientY-S.y;p({x:y.x+F,y:y.y+W})},[m,S,y]),$=(0,_.useCallback)(H=>{x(!1);let F=H.currentTarget;F instanceof HTMLElement&&F.releasePointerCapture(H.pointerId)},[]);return(0,_.useEffect)(()=>{let H=s.current;if(H)return H.addEventListener("wheel",R,{passive:!1}),()=>{H.removeEventListener("wheel",R)}},[R]),(0,_.useEffect)(()=>{let H=u.current;if(H&&m)return document.body.style.userSelect="none",H.addEventListener("pointermove",L,{passive:!1}),H.addEventListener("pointerup",$),H.addEventListener("pointercancel",$),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",L),H.removeEventListener("pointerup",$),H.removeEventListener("pointercancel",$)}},[m,L,$]),(0,E.jsxs)("div",{className:ce("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:ce("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)(a6,{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:C,title:"Zoom out",type:"button",children:(0,E.jsx)(n6,{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)(t6,{size:16})})]}):null,(0,E.jsx)("div",{className:ce("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:P,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},xx=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,_.useState)(null),[l,s]=(0,_.useState)(!1),[u,c]=(0,_.useState)(""),[d,f]=(0,_.useState)(""),[p,m]=(0,_.useState)(0),{mermaid:x}=(0,_.useContext)(wa),S=Lx(),w=x?.errorComponent,{shouldRender:y,containerRef:g}=QH({immediate:n});if((0,_.useEffect)(()=>{if(y){if(!S){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=S.getMermaid(a),C=e.split("").reduce((P,L)=>(P<<5)-P+L.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(C)}-${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 C=T instanceof Error?T.message:"Failed to render Mermaid chart";i(C)}}finally{s(!1)}})()}},[e,a,p,y,S]),!(y||u||d))return(0,E.jsx)("div",{className:ce("my-4 min-h-[200px]",t),ref:g});if(l&&!u&&!d)return(0,E.jsx)("div",{className:ce("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 w?(0,E.jsx)("div",{ref:g,children:(0,E.jsx)(w,{chart:e,error:o,retry:()=>m(C=>C+1)})}):(0,E.jsxs)("div",{className:ce("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:ce("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,E.jsx)(z6,{className:ce(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:ce("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var R_=na((bse,A_)=>{"use strict";function CV(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)}}A_.exports=CV});var Iv=typeof performance>"u"?0:performance.now(),Cv=typeof window<"u"&&!!window.WaniWani?.chat;var ci=z(we(),1),Gp=z(Pg(),1);var Ng="waniwani/suggestions";function ol(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var OB=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],PB=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],NB=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],BB=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],UB=["waniwani/visitorId","visitorId"],FB=["correlationId","openai/requestId"];function pC(e){return e?ol(e,OB):void 0}function mC(e){return e?ol(e,PB):void 0}function hC(e){return e?ol(e,NB):void 0}function gC(e){return e?ol(e,BB):void 0}function wC(e){return e?ol(e,UB):void 0}function yC(e){return e?ol(e,FB):void 0}var zB=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],qB=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function xC(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 zB){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 qB)if(n.includes(r))return o}}var HB="@waniwani/sdk";function vC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??jB,r=GB(e),o=Vd(e.meta),i=Vd(e.metadata),l=$B(e,o),s=xn(e.eventId)??n(),u=XB(e.timestamp,a),c=xn(e.source)??xC(o)??t.source??HB,d=Bg(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:VB(e,r),metadata:f,rawLegacy:d}}function jB(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function VB(e,t){if(!Bg(e))return Vd(e.properties);let a=WB(e,t),n=Vd(e.properties);return{...a,...n}}function WB(e,t){switch(t){case"tool.called":{let a={};return xn(e.toolName)&&(a.name=e.toolName),xn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return xn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function GB(e){return Bg(e)?e.eventType:e.event}function $B(e,t){let a=xn(e.requestId)??mC(t),n=xn(e.sessionId)??pC(t),r=xn(e.traceId)??hC(t),o=xn(e.externalUserId)??gC(t),i=xn(e.visitorId)??wC(t),l=xn(e.correlationId)??yC(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 XB(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 Vd(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function xn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Bg(e){return"eventType"in e}function bC(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 KB="/api/mcp/events/v2/batch";var SC="@waniwani/sdk";var YB=new Set([401,403]),ZB=new Set([408,425,429,500,502,503,504]),QB=(e,t)=>globalThis.fetch(e,t);function IC(e){return new Ug(e)}var Ug=class{constructor(t){ae(this,"endpointUrl");ae(this,"flushIntervalMs");ae(this,"maxBatchSize");ae(this,"maxBufferSize");ae(this,"maxRetries");ae(this,"retryBaseDelayMs");ae(this,"retryMaxDelayMs");ae(this,"shutdownTimeoutMs");ae(this,"sdkVersion");ae(this,"fetchFn");ae(this,"logger");ae(this,"now");ae(this,"sleep");ae(this,"apiKey");ae(this,"buffer",[]);ae(this,"flushTimer");ae(this,"flushScheduled",!1);ae(this,"flushScheduledTimer");ae(this,"flushInFlight");ae(this,"inFlightCount",0);ae(this,"isStopped",!1);ae(this,"isShuttingDown",!1);this.endpointUrl=tU(t.apiUrl,t.endpointPath??KB),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??QB,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":SC};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:aU(o)}}if(YB.has(a.status))return{kind:"auth",status:a.status};if(ZB.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await eU(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:SC,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(JB(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 JB(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 eU(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function tU(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function aU(e){return e instanceof Error?e.message:String(e)}function CC(e){let{apiUrl:t,endpointPath:a}=nU(e.endpoint),n=IC({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=vC({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,bC(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function nU(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}function Ma(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}`:""}`}var rU="/api/mcp/";function Wd(e,t){let[a=""]=e.split("?"),n="",r=a;try{let o=new URL(a);n=o.origin,r=o.pathname}catch{if(!a.startsWith("/"))return null}return r.startsWith(rU)?`${n}${t}`:null}function oU(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ma(...e){oU()&&console.log("[Waniwani]",...e)}var Fg="waniwani-visitor-id";function iU(){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 ta(){try{let t=localStorage.getItem(Fg);if(t)return t}catch{}let e=iU();try{localStorage.setItem(Fg,e)}catch{}return e}function il(e){let t=typeof e=="string"?e.trim():"";if(!t)return ta();try{localStorage.setItem(Fg,t)}catch{}return t}function lU(e){return e!=null&&typeof e.then=="function"}function Xs(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 lU(n)?n.then(r=>{t||il(r??"")},()=>{}):il(n??""),a}var sU="waniwani-memory";var Va="threads",Gd="by_memoryUserId",uU="by_updatedAt";var TC="memoryUserId",kC="waniwani-memory-user-id",zg=null;function qg(){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 cU(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Va)){let a=e.createObjectStore(Va,{keyPath:"threadId"});a.createIndex(Gd,"memoryUserId",{unique:!1}),a.createIndex(uU,"updatedAt",{unique:!1})}}async function Hg(){return new Promise((e,t)=>{let a=indexedDB.open(sU,2);a.onupgradeneeded=n=>{cU(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function dU(){return Hg()}async function fU(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(TC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function pU(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,TC);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function mU(){if(typeof indexedDB>"u")return null;try{let e=await dU();try{let t=await fU(e);if(t)return t;let a=qg();return await pU(e,a),a}finally{e.close()}}catch{return null}}function hU(){try{let e=localStorage.getItem(kC);if(e)return e;let t=qg();return localStorage.setItem(kC,t),t}catch{return null}}async function LC(){let e=await mU();if(e)return e;let t=hU();return t||(zg||(zg=qg()),zg)}function EC(e,t){return e.match(t)?.[1]??null}function gU(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=EC(e,n);if(r)return{name:a,version:r}}return null}function wU(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=EC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function yU(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"}async function Ks(){let e=navigator.userAgent,t=ta(),a=await LC();return{userAgent:e,browser:gU(e),os:wU(e),deviceType:yU(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 xU="0.21.3",vU=40,bU=10,SU=6e5;function Vg(){return typeof performance>"u"?0:performance.now()}function Wg(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=Vg()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function IU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=vU)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>SU||(t[a]=r)}return t}function CU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=bU)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function kU(){let e=navigator.connection;if(e)return{effectiveType:e.effectiveType,rtt:e.rtt,downlink:e.downlink,saveData:e.saveData}}function Xd(e){let t=e?.Authorization;return typeof t=="string"&&t.startsWith("Bearer ")?t.slice(7):void 0}function TU(e,t,a,n){return{kind:e,sdkVersion:xU,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:ta(),pageHost:window.location.hostname,connection:kU(),tags:CU(a),metrics:IU(n)}}var jg,$d=[];function Gg(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";jg=t;let a=$d;if($d=[],t)for(let n of a)n()}function Kd(e,t,a,n){let{api:r,token:o}=t;if(!(typeof window>"u"||!r||!o||jg===!1))try{let i=TU(e,t,a,n),l=()=>{ma("timing",i),fetch(Ma(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};jg?l():$d.length<20&&$d.push(l)}catch{}}var ur=Wg("boot",0),MC;function No(e,t){ur.mark(e,t)}function Yd(e){MC??(MC=e)}var LU=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,EU=/\/embed\.js(\?|$)/;function MU(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&ur.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&ur.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)LU.test(a.name)?(ur.mark("bundleStart",a.startTime),ur.mark("bundleEnd",a.responseEnd)):EU.test(a.name)&&(ur.mark("loaderStart",a.startTime),ur.mark("loaderEnd",a.responseEnd))}function AU(){if(Cv)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function AC(e){MU(),ur.mark("bundleExecuted",Iv),Kd("boot",e,{configSource:MC,mode:e.mode,secondSdk:AU()},ur.metrics)}var RU=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function RC(e){let t=Wg("turn",Vg());t.set("turnIndex",e);let a=!1;return{mark:n=>t.mark(n),instrument(n){if(!n.ok||!n.body||typeof TransformStream>"u")return n;try{let r=new TextDecoder,o=n.body.pipeThrough(new TransformStream({transform(i,l){t.mark("firstChunk");let s=r.decode(i,{stream:!0});for(let[u,c]of RU)!t.has(c)&&s.includes(u)&&t.mark(c);l.enqueue(i)}}));return new Response(o,{status:n.status,statusText:n.statusText,headers:n.headers})}catch{return n}},report(n,r){a||(a=!0,Kd("turn",n,r,t.metrics))}}}function DU(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function DC(e,t){let a=Wg("widget",Vg()),n=!1;return{mark:r=>a.mark(r),has:r=>a.has(r),report(r,o){n||(n=!0,a.set("retries",o),t({widget:DU(e),outcome:r,metrics:a.metrics}))}}}var _U="/api/mcp/events/v2/batch",$g=new Set;function OU(e,t,a){return`${e}|${t}|${a??""}`}function Ys(e){return Wd(e,_U)}async function _C(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Ys(t);if(!i){ma("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){ma("page.viewed skipped: no channelId or source to attribute it");return}let l=OU(t,a,n);if(!$g.has(l)){$g.add(l);try{let s=await Ks(),u=new Date().toISOString(),c=JSON.stringify({sentAt:u,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:u,correlation:{visitorId:s.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:s.referrer,deviceType:s.deviceType,language:s.language,timezone:s.timezone},metadata:{}}]}),d=fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:c,keepalive:!0});No("pageViewSent"),await d}catch{$g.delete(l)}}}function OC(e){let t=Ys(e.api);return t?CC({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:ta()})}):Zd("the chat api does not point at a Waniwani event ingest")}function Zd(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 Jd=z(we());var Qd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var PC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var NC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Xg=e=>{let t=NC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Zs=z(we());var BC={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 UC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var FC=(0,Zs.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,Zs.createElement)("svg",{ref:s,...BC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Qd("lucide",r),...!o&&!UC(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,Zs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Ne=(e,t)=>{let a=(0,Jd.forwardRef)(({className:n,...r},o)=>(0,Jd.createElement)(FC,{ref:o,iconNode:t,className:Qd(`lucide-${PC(Xg(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Xg(e),a};var PU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=Ne("arrow-down",PU);var NU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],On=Ne("arrow-up",NU);var BU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=Ne("check",BU);var UU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zr=Ne("chevron-down",UU);var FU=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eu=Ne("chevron-right",FU);var zU=[["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"}]],tu=Ne("clipboard-copy",zU);var qU=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cr=Ne("clock",qU);var HU=[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],au=Ne("file-text",HU);var jU=[["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"}]],ll=Ne("file",jU);var VU=[["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"}]],nu=Ne("globe",VU);var WU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ru=Ne("image",WU);var GU=[["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"}]],ou=Ne("loader",GU);var $U=[["path",{d:"M5 12h14",key:"1ays0h"}]],Bo=Ne("minus",$U);var XU=[["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"}]],sl=Ne("paperclip",XU);var KU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],iu=Ne("square",KU);var YU=[["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"}]],Uo=Ne("wrench",YU);var ZU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Pn=Ne("x",ZU);var QU=[["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"}]],lu=Ne("zap",QU);var $e=z(we(),1),cO=z(cm(),1);var ul=z(we(),1),su=z(ne(),1);function t3(e){return 1-(1-e)**3}function a3({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=t3,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 n3=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],r3=[0,1,2,0,1,2,1];function o3(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(r3[a],e.length-1)];t.push(`radial-gradient(at ${n3[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var i3=({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,ul.useState)(110),[d,f]=(0,ul.useState)(0),[p,m]=(0,ul.useState)(!1);(0,ul.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),a3({ease:C=>C,duration:2e3,onUpdate:C=>{let M=C/100;c(T+360*M);let R=Math.min(M/.1,1),P=M>.85?(1-M)/.15:1;f(Math.min(R,P))},onEnd:()=>m(!1)})},[l]);let x=n+20,S=p?Math.max(0,(d*100-x)/(100-x)):0,y=o3(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,su.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:typeof o=="number"?`${o}px`:o,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,su.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",...y].join(", "),opacity:S,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,su.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},tf=i3;Kg();Zg();var l3=VC({prefix:"ww"});function q(...e){return l3(af(e))}var uu=z(ne(),1);function cl({suggestions:e,isLoading:t,onSelect:a,align:n="start",className:r,...o}){return e.length===0&&!t?null:(0,uu.jsx)("div",{className:q("ww:px-4 ww:py-2",r),...o,children:(0,uu.jsx)("div",{className:q("ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",n==="center"&&"ww:justify-center"),children:t?[0,1,2].map(i=>(0,uu.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+i*20}px`}},i)):e.map((i,l)=>(0,uu.jsx)("button",{type:"button",onClick:()=>a(i),className:q("ww:rounded-full ww:border ww:border-border ww:bg-accent ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-border 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:`${l*50}ms`},children:i},i))})})}var WC=z(we(),1),GC="(max-width: 639px)";function s3(e){let t=window.matchMedia(GC);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function u3(){return window.matchMedia(GC).matches}function c3(){return!1}function $C(){return(0,WC.useSyncExternalStore)(s3,u3,c3)}var nf=z(we(),1);function Qg(e,t){return e.find(a=>a.text===t)?.id??null}async function XC(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let l=Ys(t);if(l)try{let 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:n,source:r,timestamp:s,correlation:{visitorId:ta(),sessionId:o},properties:{...i,url:window.location.href},metadata:{}}]});await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{}}async function KC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:l,origin:s,text:u,index:c}=e;await XC({api:t,token:a,name:"suggestion.clicked",source:o,sessionId:i,properties:{promptId:l,origin:s,text:u,index:c,channelId:n,mode:r}})}function YC(e,t){return t.map(a=>({id:Qg(e,a),text:a}))}async function ZC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:l,origin:s}=e;l.length!==0&&await XC({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:l,count:l.length,origin:s,channelId:n,mode:r}})}function dl(e){let{widgetEvents:t,api:a,token:n,channelId:r,source:o,mode:i,pagePrompts:l}=e,s=(0,nf.useRef)(e.getSessionId);s.current=e.getSessionId,(0,nf.useEffect)(()=>{if(!(!a||!n))return t.subscribe(u=>{if(u.name==="suggestion.clicked"){let{text:c,origin:d,index:f}=u.properties;KC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),promptId:Qg(l??[],c),origin:d,text:c,index:f});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;ZC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),prompts:YC(l??[],c),origin:d})}})},[t,a,n,r,o,i,l])}var fl=z(we(),1),d3=80,f3=50,p3=15e3,QC=500;function pl(e,t=!0){let[a,n]=(0,fl.useState)(""),r=(0,fl.useRef)(void 0);return(0,fl.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,QC)):r.current=setTimeout(s,f3)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,p3)):r.current=setTimeout(s,d3)))};return r.current=setTimeout(s,QC),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var vn=z(we(),1);var JC=["en","fr","es"];function ml(e){return JC.includes(e)}function Jg(e){if(e&&ml(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&ml(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(ml(n))return n;let r=n.split("-")[0];if(r&&ml(r))return r}return"en"}var rf={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",uploadFilesUpTo:"Upload a document, up to {limit}",uploadFilesUpToWithPages:"Upload a document, up to {limit} and {pages} pages",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments",removeAttachment:"Remove attachment",uploading:"Uploading\u2026",retry:"Retry",retryUpload:"Retry the upload",uploadFailed:"The upload did not finish.",dropToAttach:"Drop to attach",errorAccept:"{name} is not a file type this chat accepts.",errorTooLarge:"{name} is larger than {limit}.",errorTooMany:"You can attach up to {limit} files."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"File",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 ek={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",uploadFilesUpTo:"Subir un documento, hasta {limit}",uploadFilesUpToWithPages:"Subir un documento, hasta {limit} y {pages} p\xE1ginas",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos",removeAttachment:"Quitar archivo",uploading:"Subiendo\u2026",retry:"Reintentar",retryUpload:"Reintentar la subida",uploadFailed:"La subida no se complet\xF3.",dropToAttach:"Suelta para adjuntar",errorAccept:"{name} no es un tipo de archivo que acepte este chat.",errorTooLarge:"{name} supera {limit}.",errorTooMany:"Puedes adjuntar hasta {limit} archivos."},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",kindPdf:"PDF",kindImage:"Imagen",kindFile:"Archivo",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 tk={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",uploadFilesUpTo:"Joindre un document, jusqu'\xE0 {limit}",uploadFilesUpToWithPages:"Envoyer un document, jusqu'\xE0 {limit} et {pages} pages",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes",removeAttachment:"Retirer la pi\xE8ce jointe",uploading:"Envoi en cours\u2026",retry:"R\xE9essayer",retryUpload:"R\xE9essayer l'envoi",uploadFailed:"L'envoi ne s'est pas termin\xE9.",dropToAttach:"D\xE9posez pour joindre",errorAccept:"{name} n'est pas un type de fichier accept\xE9 par ce chat.",errorTooLarge:"{name} d\xE9passe {limit}.",errorTooMany:"Vous pouvez joindre jusqu'\xE0 {limit} fichiers."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"Fichier",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 ew={en:rf,fr:tk,es:ek};var nk=z(ne(),1),ak=(0,vn.createContext)(null);function m3(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 Fo({children:e,locale:t,messages:a}){let n=!!(t&&h3(t)),r=n?t:"en",[o,i]=(0,vn.useState)(r),[l,s]=(0,vn.useState)(n);(0,vn.useEffect)(()=>{i(Jg(t)),s(!0)},[t]);let u=(0,vn.useMemo)(()=>{let c=ew[o]??ew["en"];return{locale:o,t:m3(c,a),ready:l}},[o,a,l]);return(0,nk.jsx)(ak.Provider,{value:u,children:e})}function h3(e){return e==="en"||e==="fr"||e==="es"}function Le(){let e=(0,vn.useContext)(ak);return e||{locale:"en",t:rf,ready:!0}}function tw(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 qe=z(we(),1);var cu=(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 Ce=z(we(),1);var zo=new Map;function rk(e,t){if(zo.has(e)){URL.revokeObjectURL(t);return}for(zo.set(e,t);zo.size>20;){let a=zo.keys().next();if(a.done)return;let n=zo.get(a.value);zo.delete(a.value),n&&URL.revokeObjectURL(n)}}function ok(e){return zo.get(e)}var ik=z(ne(),1),Nn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,ik.jsx)("button",{type:n,className:q("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 lk=z(we(),1);var vt=z(ne(),1),sk=({files:e,className:t,...a})=>e.length===0?null:(0,vt.jsx)("div",{className:q("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,vt.jsx)(g3,{file:n},r))});function g3({file:e}){let{t}=Le();return e.mediaType?.startsWith("image/")&&e.url?(0,vt.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,vt.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,vt.jsx)(ll,{className:"ww:size-3 ww:shrink-0"}),(0,vt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function uk(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function w3({mediaType:e}){return e.startsWith("image/")?(0,vt.jsx)(ru,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,vt.jsx)(au,{className:"ww:size-5 ww:text-muted-foreground"}):(0,vt.jsx)(ll,{className:"ww:size-5 ww:text-muted-foreground"})}function aw({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:l}=Le(),s=uk(t,l);return(0,vt.jsxs)("li",{"aria-label":`${e}, ${s}`,className:q("ww:relative ww:flex ww:w-60 ww:max-w-full ww:cursor-default ww:items-center ww:gap-2.5 ww:overflow-hidden ww:rounded-xl ww:border ww:bg-background ww:p-2.5",r==="error"?"ww:border-destructive/50":"ww:border-border",i),children:[(0,vt.jsx)("span",{className:"ww:flex ww:size-10 ww:shrink-0 ww:items-center ww:justify-center ww:overflow-hidden ww:rounded-xl ww:bg-muted",children:a?(0,vt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,vt.jsx)(w3,{mediaType:t})}),(0,vt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,vt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,vt.jsx)("span",{className:q("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??s})]}),o]})}function ck(e){if(typeof e!="object"||e===null)return[];let t=e.documents;return Array.isArray(t)?t.filter(a=>typeof a=="object"&&a!==null&&typeof a.documentId=="string"&&typeof a.filename=="string"&&typeof a.mediaType=="string"):[]}var dk=({documents:e,className:t,...a})=>e.length===0?null:(0,vt.jsx)("ul",{className:q("ww:flex ww:list-none ww:flex-wrap ww:items-end ww:justify-end ww:gap-2 ww:p-0",t),...a,children:e.map((n,r)=>(0,vt.jsx)(y3,{document:n},`${n.documentId}-${r}`))});function y3({document:e}){let{t}=Le(),[a,n]=(0,lk.useState)(!1),r=e.mediaType.startsWith("image/")?ok(e.documentId):void 0;return r&&!a?(0,vt.jsx)("li",{children:(0,vt.jsx)("img",{alt:`${e.filename}, ${uk(e.mediaType,t)}`,className:"ww:max-h-80 ww:max-w-72 ww:rounded-xl ww:border ww:border-border ww:object-contain",onError:()=>n(!0),src:r,title:e.filename})}):(0,vt.jsx)(aw,{filename:e.filename,mediaType:e.mediaType})}var mt=z(ne(),1),x3=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}},v3=(e,t)=>{if(!t)return!0;let a=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(a.length===0)return!0;let n=e.type.toLowerCase(),r=e.name.toLowerCase();return a.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?n.startsWith(o.slice(0,-1)):n===o)},pk=(0,Ce.createContext)(null),of=()=>{let e=(0,Ce.useContext)(pk);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},mk=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,maxPdfPages:i,attachmentsEnabled:l=!0,upload:s,onDiscard:u,onError:c,onSubmit:d,children:f,...p})=>{let{t:m,locale:x}=Le(),S=(0,Ce.useRef)(null),w=(0,Ce.useRef)(null),[y,g]=(0,Ce.useState)([]),b=(0,Ce.useRef)(y),T=(0,Ce.useRef)(new Map),C=(0,Ce.useRef)(s),M=(0,Ce.useRef)(c),R=(0,Ce.useRef)(u);(0,Ce.useEffect)(()=>{C.current=s,M.current=c,R.current=u},[s,c,u]);let P=(0,Ce.useCallback)(v=>{b.current=v,g(v)},[]),L=(0,Ce.useCallback)(()=>{S.current?.click()},[]),$=(0,Ce.useCallback)((v,K)=>{P(b.current.map(ee=>ee.id===v?{...ee,...K}:ee))},[P]),H=(0,Ce.useCallback)((v,K)=>{let ee=C.current;if(!ee)return;let xe=new AbortController,We=ee(K,xe.signal,me=>{$(v,{progress:me})}).then(me=>($(v,{status:"ready",progress:1,documentId:me.documentId,error:void 0}),me)).catch(me=>{if(xe.signal.aborted)return null;let he=me instanceof Error?me.message:m.promptInput.uploadFailed;return $(v,{status:"failed",error:he}),M.current?.({code:"upload_failed",message:he}),null});T.current.set(v,{file:K,controller:xe,done:We})},[$,m]),F=(0,Ce.useCallback)(v=>{let K=[...v];if(!l||K.length===0)return;let ee=(fe,J)=>M.current?.({code:fe,message:J}),xe=[];for(let fe of K){if(!v3(fe,t)){ee("accept",m.promptInput.errorAccept.replace("{name}",fe.name));continue}if(o&&fe.size>o){ee("max_file_size",m.promptInput.errorTooLarge.replace("{name}",fe.name).replace("{limit}",hk(o,x)));continue}xe.push(fe)}if(xe.length===0)return;let We=typeof r=="number"?Math.max(0,r-b.current.length):void 0,me=typeof We=="number"?xe.slice(0,We):xe;if(me.length<xe.length&&ee("max_files",m.promptInput.errorTooMany.replace("{limit}",String(r))),me.length===0)return;let he=!!C.current,ue=me.map(fe=>({file:fe,item:{filename:fe.name,id:cu(),mediaType:fe.type,type:"file",url:URL.createObjectURL(fe),status:he?"uploading":"ready",progress:0}}));P([...b.current,...ue.map(fe=>fe.item)]);for(let fe of ue)H(fe.item.id,fe.file)},[r,o,t,l,H,P,m,x]),W=(0,Ce.useCallback)(v=>{let K=T.current.get(v);K&&($(v,{status:"uploading",progress:0,error:void 0}),H(v,K.file))},[$,H]),V=(0,Ce.useCallback)((v,K)=>{T.current.get(v.id)?.controller.abort(),T.current.delete(v.id),v.url&&(!K&&!!v.documentId&&!!v.mediaType?.startsWith("image/")&&v.documentId?rk(v.documentId,v.url):URL.revokeObjectURL(v.url)),K&&v.documentId&&R.current?.({documentId:v.documentId,filename:v.filename??"",mediaType:v.mediaType??""})},[]),N=(0,Ce.useCallback)(v=>{let K=b.current.find(ee=>ee.id===v);K&&V(K,!0),P(b.current.filter(ee=>ee.id!==v))},[V,P]),D=(0,Ce.useCallback)(()=>{for(let v of b.current)V(v,!0);P([])},[V,P]),G=(0,Ce.useRef)(l);(0,Ce.useEffect)(()=>{let v=G.current;G.current=l,v&&!l&&D()},[l,D]);let se=(0,Ce.useCallback)(()=>{for(let v of b.current)V(v,!1);P([])},[V,P]);(0,Ce.useEffect)(()=>()=>{for(let v of b.current)T.current.get(v.id)?.controller.abort(),v.url&&URL.revokeObjectURL(v.url)},[]);let I=(0,Ce.useCallback)(v=>{v.currentTarget.files&&F(v.currentTarget.files),v.currentTarget.value=""},[F]);(0,Ce.useEffect)(()=>{if(!n)return;let v=ee=>{ee.dataTransfer?.types?.includes("Files")&&ee.preventDefault()},K=ee=>{ee.dataTransfer?.types?.includes("Files")&&ee.preventDefault(),ee.dataTransfer?.files&&ee.dataTransfer.files.length>0&&F(ee.dataTransfer.files)};return document.addEventListener("dragover",v),document.addEventListener("drop",K),()=>{document.removeEventListener("dragover",v),document.removeEventListener("drop",K)}},[F,n]);let Ve=(0,Ce.useCallback)(async v=>{v.preventDefault();let K=v.currentTarget,ee=new FormData(K).get("message")||"",xe=new Map;for(;xe.size<T.current.size;)await Promise.all([...T.current.entries()].filter(([ue])=>!xe.has(ue)).map(async([ue,fe])=>{xe.set(ue,await fe.done)}));for(let ue of xe.keys())T.current.has(ue)||xe.delete(ue);if([...xe.values()].some(ue=>ue===null)){M.current?.({code:"upload_failed",message:m.promptInput.uploadFailed});return}let We=[...xe.values()].filter(ue=>ue!==null),me=C.current?[]:b.current,he=await Promise.all(me.map(async({id:ue,status:fe,progress:J,error:Oe,...He})=>{if(He.url?.startsWith("blob:")){let ke=await x3(He.url);return{...He,url:ke??He.url}}return He}));try{let ue=d({documents:We,files:he,text:ee},v);ue instanceof Promise&&await ue,K.reset(),se()}catch{}},[d,se,m]),rt=(0,Ce.useMemo)(()=>({add:F,clear:D,files:y,openFileDialog:L,remove:N,retry:W,maxFileSize:o,maxPdfPages:i}),[y,F,N,W,D,L,o,i]);return(0,mt.jsxs)(pk.Provider,{value:rt,children:[(0,mt.jsx)("input",{accept:t,"aria-label":m.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:I,ref:S,title:m.promptInput.uploadFiles,type:"file"}),(0,mt.jsx)("form",{className:q("ww:relative ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:Ve,ref:w,...p,children:f})]})},fk=1024*1024;function hk(e,t){let a=e>=fk;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/fk:Math.max(1,e/1024))}var gk=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Le(),i=of(),[l,s]=(0,Ce.useState)(!1),u=n??o.promptInput.placeholder,c=(0,Ce.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('[data-submit-blocked="true"]')||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,Ce.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let S=x.getAsFile();S&&m.push(S)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,mt.jsx)("textarea",{className:q("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})},wk=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:l}=Le(),s=t==="submitted"||t==="streaming",u=s&&a!==void 0,c=(0,mt.jsx)(On,{className:"ww:size-4"});t==="submitted"?c=(0,mt.jsx)(ou,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,mt.jsx)(iu,{className:"ww:size-4"}));let d=(0,Ce.useCallback)(f=>{if(s&&a){f.preventDefault(),a();return}n?.(f)},[s,a,n]);return(0,mt.jsx)(Nn,{"aria-label":s?l.promptInput.stop:l.promptInput.submit,className:q("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),"data-submit-blocked":o?"true":void 0,disabled:u?!1:o,onClick:d,size:"icon-sm",type:u?"button":"submit",variant:"ghost",...i,children:r??c})},yk=({className:e,children:t,...a})=>{let{t:n,locale:r}=Le(),o=of();if(o.files.length>0)return(0,mt.jsxs)(Nn,{className:q("ww:group ww:relative",e),onClick:()=>o.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,mt.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:o.files.length}),(0,mt.jsx)(Pn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]});let l=o.maxFileSize?(o.maxPdfPages?n.promptInput.uploadFilesUpToWithPages.replace("{pages}",String(o.maxPdfPages)):n.promptInput.uploadFilesUpTo).replace("{limit}",hk(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,mt.jsx)(Nn,{"aria-label":l,className:q(e),title:l,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,mt.jsx)(sl,{className:"ww:size-4"})})},xk=({className:e,...t})=>{let a=of();return a.files.length===0?null:(0,mt.jsx)("ul",{className:q("ww:flex ww:list-none ww:flex-wrap ww:gap-2 ww:p-0",e),...t,children:a.files.map(n=>(0,mt.jsx)(b3,{file:n},n.id))})};function b3({file:e}){let{t}=Le(),a=of(),n=e.status==="failed",r=e.status==="uploading";return(0,mt.jsxs)(aw,{filename:e.filename??t.attachments.fileFallback,mediaType:e.mediaType??"",previewUrl:e.mediaType?.startsWith("image/")?e.url:void 0,subtitle:n?e.error:r?t.promptInput.uploading:void 0,tone:n?"error":"default",children:[n?(0,mt.jsx)("button",{"aria-label":t.promptInput.retryUpload,className:"ww:ml-auto ww:shrink-0 ww:text-destructive ww:text-xs ww:underline ww:underline-offset-2",onClick:()=>a.retry(e.id),type:"button",children:t.promptInput.retry}):null,(0,mt.jsx)("button",{"aria-label":t.promptInput.removeAttachment,className:q("ww:shrink-0 ww:rounded-full ww:p-1 ww:opacity-60 ww:transition-opacity hover:ww:bg-muted hover:ww:opacity-100",n?null:"ww:ml-auto"),onClick:()=>a.remove(e.id),type:"button",children:(0,mt.jsx)(Pn,{className:"ww:size-3.5"})}),r?(0,mt.jsx)("span",{"aria-hidden":!0,className:"ww:absolute ww:bottom-0 ww:left-0 ww:h-0.5 ww:bg-primary ww:transition-[width] ww:duration-200",style:{width:`${Math.round(e.progress*100)}%`}}):null]})}var vk=({enabled:e=!0})=>{let{t}=Le(),[a,n]=(0,Ce.useState)(!1);return(0,Ce.useEffect)(()=>{if(!e)return;let r=0,o=u=>!!u.dataTransfer?.types?.includes("Files"),i=u=>{o(u)&&(r+=1,n(!0))},l=u=>{o(u)&&(r=Math.max(0,r-1),r===0&&n(!1))},s=()=>{r=0,n(!1)};return document.addEventListener("dragenter",i),document.addEventListener("dragleave",l),document.addEventListener("drop",s),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",l),document.removeEventListener("drop",s)}},[e]),e&&a?(0,mt.jsx)("div",{className:"ww:pointer-events-none ww:absolute ww:inset-0 ww:z-50 ww:flex ww:items-center ww:justify-center ww:rounded-2xl ww:border-2 ww:border-primary ww:border-dashed ww:bg-background/85",children:(0,mt.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,mt.jsx)(sl,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var Sk=z(ne(),1);function bk({text:e}){let{t}=Le();return e===!1?null:(0,Sk.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 lf=z(we(),1);var qo=z(ne(),1),Ik=({className:e,...t})=>(0,qo.jsx)("div",{className:q("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),Ck=({className:e,...t})=>(0,qo.jsx)("li",{className:q("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}),kk=({className:e,...t})=>(0,qo.jsx)("span",{className:q("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),Tk=({className:e,...t})=>(0,qo.jsx)("span",{className:q("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),Lk=({className:e,...t})=>(0,qo.jsx)("div",{className:q("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),Ek=({className:e,...t})=>(0,qo.jsx)(Nn,{className:q("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 ln=z(ne(),1),Mk=(0,lf.memo)(({message:e,onRemove:t})=>{let{t:a}=Le(),n=(0,lf.useCallback)(()=>t(e.id),[t,e.id]);return(0,ln.jsxs)(Ck,{children:[(0,ln.jsx)(kk,{}),(0,ln.jsx)(Tk,{children:e.text||a.chatQueue.attachmentFallback}),(0,ln.jsx)(Lk,{children:(0,ln.jsx)(Ek,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,ln.jsx)(Pn,{className:"ww:size-3"})})})]})});Mk.displayName="ChatQueueItem";function Ak({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Le();return e.length===0?null:(0,ln.jsxs)(Ik,{className:q("ww:border-t ww:border-border",a),children:[(0,ln.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,ln.jsx)("ul",{children:e.map(r=>(0,ln.jsx)(Mk,{message:r,onRemove:t},r.id))})]})}var Da=z(we(),1);var bt=z(we(),1);dp();var s2=z(we(),1);var u2=z(ne(),1),q6=({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,u2.jsx)(e,{"data-waniwani-shimmer":"",className:q("ww:inline-block",t),style:i,...o,children:r})},Cn=(0,s2.memo)(q6);Cn.displayName="Shimmer";var la=z(ne(),1),c2=(0,bt.createContext)(null);function d2(){let e=(0,bt.useContext)(c2);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var H6=1e3,j6=1e3,Uu=(0,bt.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,bt.useState)(s),p=c?a:d,m=(0,bt.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,S]=(0,bt.useState)(void 0),w=o??x,y=(0,bt.useRef)(t),[g,b]=(0,bt.useState)(!1),T=(0,bt.useRef)(null);(0,bt.useEffect)(()=>{t?(y.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(S(Math.ceil((Date.now()-T.current)/j6)),T.current=null)},[t]),(0,bt.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,bt.useEffect)(()=>{if(y.current&&!t&&p&&!g){let M=setTimeout(()=>{m(!1),b(!0)},H6);return()=>clearTimeout(M)}},[t,p,g,m]);let C=(0,bt.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:w}),[t,p,m,w]);return(0,la.jsx)(c2.Provider,{value:C,children:(0,la.jsx)("div",{className:q("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})})});Uu.displayName="Reasoning";var Fu=(0,bt.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Le(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=d2(),f=a??((p,m)=>p||m===0?(0,la.jsx)(Cn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,la.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,la.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,la.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:q("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,la.jsxs)(la.Fragment,{children:[!n&&(0,la.jsx)(cr,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});Fu.displayName="ReasoningTrigger";var zu=(0,bt.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=d2();return(0,la.jsx)("div",{className:q("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,la.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,la.jsx)("div",{className:q("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,la.jsx)(Ll,{children:t})})})})});zu.displayName="ReasoningContent";var Be=z(ne(),1),V6=500,f2=(0,Da.createContext)(null);function p2(){let e=(0,Da.useContext)(f2);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function m2({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,Da.useState)(r),d=s?n:u,f=(0,Da.useCallback)(S=>{s||c(S),o?.(S)},[s,o]),[p,m]=(0,Da.useState)(!t);(0,Da.useEffect)(()=>{if(t){m(!1);return}let S=setTimeout(()=>m(!0),V6);return()=>clearTimeout(S)},[t]);let x=(0,Da.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Be.jsx)(f2.Provider,{value:x,children:(0,Be.jsx)("div",{className:q("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 h2({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=p2();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Be.jsx)("div",{className:q("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,Be.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,Be.jsx)(c,{className:q("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Be.jsx)("span",{className:"ww:truncate",children:l?(0,Be.jsx)(Cn,{duration:2.6,children:d}):d})]},d)})}return(0,Be.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:q("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,Be.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Be.jsx)(Zr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function g2({className:e,children:t,...a}){let{open:n}=p2();return(0,Be.jsx)("div",{className:q("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,Be.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Be.jsx)("div",{className:q("ww:flex ww:flex-col",e),...a,children:t})})})}function w2({icon:e,isLast:t,running:a,error:n}){return(0,Be.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Be.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Be.jsx)(e,{className:q("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Be.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Ax({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,Da.useState)(!1),f=a??"",p=l?(0,Be.jsx)(Cn,{duration:1.6,children:f}):(0,Be.jsx)("span",{className:"ww:truncate",children:f});return(0,Be.jsxs)("div",{className:q("ww:flex ww:gap-2",e),...i,children:[(0,Be.jsx)(w2,{icon:t,isLast:r,running:l,error:s}),(0,Be.jsxs)("div",{className:q("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Be.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,Be.jsx)(Zr,{className:q("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Be.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Be.jsx)("div",{className:q("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,Be.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Be.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 y2({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Be.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Be.jsx)(w2,{icon:cr,isLast:t,running:e}),(0,Be.jsx)("div",{className:q("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Be.jsxs)(Uu,{isStreaming:e,className:"ww:mb-0",children:[(0,Be.jsx)(Fu,{hideIcon:!0}),(0,Be.jsx)(zu,{children:a})]})})]})}var Rx={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var x2={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var S2=z(we(),1);var yr=z(we(),1),W6=5,v2=400;function b2(e,t,a={}){let{msPerChar:n=W6}=a,[r,o]=(0,yr.useState)(t?"":e),i=(0,yr.useRef)(e),l=(0,yr.useRef)(t?0:e.length),s=(0,yr.useRef)(0),u=(0,yr.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,yr.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>v2&&(l.current=i.current.length-v2),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 qu=z(ne(),1),Dx=({className:e,from:t,children:a,...n})=>(0,qu.jsx)("div",{className:q("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,qu.jsx)("div",{className:q("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),_x=({children:e,className:t,...a})=>(0,qu.jsx)("div",{className:q("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}),G6={cjk:Rx,code:x2},$6={cjk:Rx},X6={enabled:!1};function K6({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=b2(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,qu.jsx)(Ll,{className:q("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??X6,plugins:a?$6:G6,...r,children:l})}var gp=(0,S2.memo)(K6,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);gp.displayName="MessageResponse";var Vt=z(we(),1);function Ox(e){if(!(typeof e!="object"||e===null))return e}function I2(e){return Ox(e?.ui)}function Px(e){if(!e)return;let t=I2(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 Hu(e){return I2(e)?.autoHeight===!0}function Nx(e){return Ox(Ox(e)?._meta)}var Ee=z(ne(),1);function Y6(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 Z6({text:e,className:t}){let{t:a}=Le(),[n,r]=(0,Vt.useState)(!1),o=(0,Vt.useRef)(null);(0,Vt.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Vt.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,Ee.jsx)(Nn,{variant:"ghost",size:"sm",onClick:i,className:q("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,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(Js,{className:"ww:size-3.5"}),(0,Ee.jsx)("span",{children:a.tool.copied})]}):(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(tu,{className:"ww:size-3.5"}),(0,Ee.jsx)("span",{children:a.tool.copy})]})})}function C2({data:e,label:t,className:a,...n}){let[r,o]=(0,Vt.useState)(!1),i=(0,Vt.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=Y6(e);return(0,Ee.jsxs)("div",{className:q("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,Ee.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,Ee.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,Ee.jsx)(Z6,{text:i})]}),(0,Ee.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,Ee.jsx)(eu,{className:q("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,Ee.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,Ee.jsx)("code",{children:i})}):(0,Ee.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Bx=(0,Vt.createContext)({open:!1,toggle:()=>{}});function k2({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Vt.useState)(t);return(0,Ee.jsx)(Bx.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,Ee.jsx)("div",{className:q("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 T2({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Vt.useContext)(Bx),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,Ee.jsxs)("button",{type:"button",onClick:o,className:q("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,Ee.jsx)(Uo,{className:"ww:size-4 ww:shrink-0"}),(0,Ee.jsx)("span",{className:"ww:truncate",children:i?(0,Ee.jsx)(Cn,{duration:1.6,children:l}):l}),(0,Ee.jsx)(Zr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function L2({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,Ee.jsx)("div",{className:q("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,Ee.jsx)("span",{className:"ww:truncate",children:r?(0,Ee.jsx)(Cn,{duration:1.6,children:o}):o})})}function E2({className:e,children:t,...a}){let{open:n}=(0,Vt.useContext)(Bx);return(0,Ee.jsx)("div",{className:q("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,Ee.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ee.jsx)("div",{className:q("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 Ux({className:e,input:t,debug:a,...n}){let{t:r}=Le(),o=(0,Vt.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,Ee.jsx)(C2,{data:o,label:r.tool.request,className:e,...n})}function ju(e,t,a){if(e){let n=Px(a?.[e]?._meta);if(n)return n}return Px(Nx(t))}function M2(e,t,a){return e&&Hu(a?.[e]?._meta)?!0:Hu(Nx(t))}function Fx({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Le(),i=(0,Vt.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,Ee.jsxs)("div",{className:q("ww:space-y-2",e),...r,children:[(0,Ee.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,Ee.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,Ee.jsx)(C2,{data:i,label:o.tool.response,className:e,...r}):null}var Vu=z(ne(),1);function A2(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function R2(e){return e.parts.some(A2)}function D2(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=>!(!A2(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function _2({className:e,...t}){let{t:a}=Le();return(0,Vu.jsxs)("div",{"aria-live":"polite",className:q("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,Vu.jsx)(lu,{className:"ww:size-4 ww:shrink-0"}),(0,Vu.jsx)(Cn,{duration:1.6,children:a.workingIndicator.default})]})}var Je=z(we(),1);function El(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 O2(e,t){return!El(e)&&!El(t)?null:El(e)?El(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 xr=z(we(),1);var P2=(0,xr.createContext)(()=>{});function N2(){return(0,xr.useContext)(P2)}var B2=P2.Provider;function Q6(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function Ml(e){let t=(0,xr.useRef)(e);t.current=e;let a=(0,xr.useRef)(!1);(0,xr.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;No(r.paintMark),Q6(()=>AC(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var U2=z(ne(),1),J6="/api/mcp/resource",e9=500,t9=0,a9=16,n9="2026-01-26",r9=300,o9=3e3,i9=3,l9=2e3;function s9(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function u9(e,t,a){return ju(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function wp({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=J6,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),S=(0,Je.useRef)(a),w=(0,Je.useRef)({width:0,height:0}),y=(0,Je.useRef)(null),g=(0,Je.useRef)(!1),b=(0,Je.useRef)(0),T=(0,Je.useRef)("inline"),[C,M]=(0,Je.useState)(t9),[R,P]=(0,Je.useState)(void 0),L=(0,Je.useRef)(s),$=(0,Je.useRef)(u),H=(0,Je.useRef)(c),F=(0,Je.useRef)(d),W=(0,Je.useRef)(r),V=(0,Je.useRef)(p);x.current=t,S.current=a,L.current=s,$.current=u,H.current=c,F.current=d,W.current=r,V.current=p;let N=(0,Je.useCallback)(v=>l?Math.max(v+a9,0):Math.min(Math.max(v,50),e9),[l]),D=(0,Je.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),G=N2(),se=(0,Je.useRef)(null),I=(0,Je.useRef)(void 0);(0,Je.useEffect)(()=>{let v=DC(e,G);return se.current=v,()=>{clearTimeout(I.current),v.has("initialized")||v.report("timeout",b.current),se.current=null}},[e,G]);let Ve=(0,Je.useRef)(o);Ve.current=o;let rt=(0,Je.useRef)(f);return(0,Je.useEffect)(()=>{rt.current=f,w.current.height=-1,y.current&&(y.current.cancel(),y.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 K=!1,ee=!1,xe=null,We=null,me=setTimeout(()=>{if(K||ee||b.current>=i9)return;b.current+=1;let fe=new URL(v.src);fe.searchParams.set("_retry",String(b.current)),v.src=fe.toString()},o9),he=fe=>{v.contentWindow?.postMessage(fe,"*")},ue=fe=>{if(K||fe.source!==v.contentWindow)return;let J=fe.data;if(!J||typeof J!="object"||J.jsonrpc!=="2.0")return;let Oe=J.method,He=J.id;if(Oe==="ui/initialize"&&He!=null){ee=!0,se.current?.mark("initialize"),clearTimeout(me),he({jsonrpc:"2.0",id:He,result:{protocolVersion:J.params?.protocolVersion??n9,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:Ve.current?"dark":"light",displayMode:T.current}}});return}if(Oe==="ui/notifications/initialized"){g.current=!0,se.current?.mark("initialized"),I.current=setTimeout(()=>se.current?.report("ok",b.current),l9);let ke=x.current,ge=S.current,Ie=ge._meta&&typeof ge._meta=="object"?ge._meta:null,X=s9(W.current),Ue=Ie&&typeof Ie.waniwani=="object"&&Ie.waniwani!==null?Ie.waniwani:null,Pt=Ue||X?{...Ue??{},...X?{sessionId:X}:{}}:void 0,aa=Ie||Pt?{...Ie??{},...Pt?{waniwani:Pt}:{}}:void 0;he({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:ke}});let sa=ge.content??[{type:"text",text:JSON.stringify(ge)}];he({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:sa,structuredContent:ge.structuredContent,_meta:aa,meta:aa}});return}if(Oe==="ui/notifications/size-changed"){clearTimeout(I.current),se.current?.mark("firstSize"),se.current?.report("ok",b.current);let ke=J.params,ge=typeof ke?.height=="number"?ke.height:void 0,Ie=typeof ke?.width=="number"?ke.width:void 0,X=w.current,Ue=ge!==void 0&&ge!==X.height,Pt=Ie!==void 0&&Ie!==X.width;if(!Ue&&!Pt)return;if(Ue&&ge!==void 0){if(X.height=ge,rt.current)return;let aa=N(ge),sa=v.getBoundingClientRect().height;if(y.current&&(y.current.cancel(),y.current=null),M(aa),v.animate&&Math.abs(sa-aa)>2){let Xa=v.animate([{height:`${sa}px`},{height:`${aa}px`}],{duration:r9,easing:"ease-out",fill:"forwards"});y.current=Xa,Xa.onfinish=()=>{y.current===Xa&&(Xa.cancel(),y.current=null)}}}Pt&&l&&Ie!==void 0&&(X.width=Ie,P(Ie));return}if(Oe==="ui/open-link"&&He!=null){let ke=J.params?.url;typeof ke=="string"&&(L.current?L.current(ke):window.open(ke,"_blank","noopener,noreferrer")),he({jsonrpc:"2.0",id:He,result:{}});return}if(Oe==="ui/message"&&He!=null){if($.current&&J.params){let ke=J.params,ge=xe;if(xe=null,We){clearTimeout(We.timer);let Ie=We.text;We=null;let X=(ke.content??[]).map(Ue=>Ue.text??"").join("").trim();ke={...ke,content:[{type:"text",text:`${X}
|
|
122
122
|
|
|
123
|
-
${Ce}`}]}}W.current({...Re,...ye?{modelContext:ye}:{}})}pe({jsonrpc:"2.0",id:Xe,result:{}});return}if(He==="ui/update-model-context"&&Xe!=null){we=R2(we,Z.params),pe({jsonrpc:"2.0",id:Xe,result:{}});return}if(He==="tools/call"&&Xe!=null){let Re=H.current;if(!Re){pe({jsonrpc:"2.0",id:Xe,error:{code:-32601,message:"tools/call not supported"}});return}let ye=Z.params?.name;Re({name:ye,arguments:Z.params?.arguments??{}}).then(Ce=>{pe({jsonrpc:"2.0",id:Xe,result:Ce});let xe=Ce.content?.map(Je=>Je.text??"").join("").trim();xe&&e9(ye,Ce,G.current)&&($e&&clearTimeout($e.timer),$e={text:xe,timer:setTimeout(()=>{if(z)return;let Je=we;we=null,$e=null,W.current?.({role:"user",content:[{type:"text",text:xe}],...Je?{modelContext:Je}:{}})},500)})}).catch(Ce=>{let xe=Ce instanceof Error?Ce.message:"Tool call failed";pe({jsonrpc:"2.0",id:Xe,error:{code:-32e3,message:xe}})});return}if(He==="ui/request-display-mode"&&Xe!=null){let Re=Z.params?.mode,ye=Re==="fullscreen"||Re==="inline"||Re==="pip"?Re:"inline";T.current=ye,pe({jsonrpc:"2.0",id:Xe,result:{mode:ye}}),pe({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ye}}),F.current?.(ye);return}if(He==="ui/resource-teardown"&&Xe!=null){pe({jsonrpc:"2.0",id:Xe,result:{}});return}He==="ping"&&Xe!=null&&pe({jsonrpc:"2.0",id:Xe,result:{}})};return window.addEventListener("message",ue),()=>{z=!0,clearTimeout(Se),$e&&clearTimeout($e.timer),window.removeEventListener("message",ue)}},[l,B]),(0,P2.jsx)("iframe",{ref:m,src:D,onLoad:()=>be.current?.mark("iframeLoad"),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%":C,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var so=q(ae(),1);function N2({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,so.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,so.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,so.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,so.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,so.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,so.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 B2=q(he(),1);var Al=q(ae(),1);function t9({onRetry:e}){let{t}=Te();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 wp=class extends B2.Component{constructor(){super(...arguments);te(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)(t9,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var Ee=q(ae(),1);function Fx(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function U2(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?nu:Uo}function F2({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:S}=Te(),w=e[e.length-1],y=e.length>0,g=d!=null,b=!g&&M2(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,Ee.jsxs)(Ee.Fragment,{children:[!g&&(!y&&n?(0,Ee.jsx)(N2,{...n,onSuggestionSelect:r}):a&&(0,Ee.jsx)(Rx,{from:"assistant",children:(0,Ee.jsx)(Dx,{children:(0,Ee.jsx)(hp,{children:a})})})),e.map(T=>{let C=T.parts.filter(B=>B.type==="text"),A=T.parts.filter(B=>B.type==="reasoning"),R=T.parts.filter(B=>B.type==="file"),P=lk(T.metadata),L=T.parts.filter(B=>"toolCallId"in B),W=T.parts.filter(B=>B.type==="reasoning"||"toolCallId"in B),H=T===w&&T.role==="assistant",F=C.length>0,$=g?L.some(B=>B.toolCallId===d):!1,G=p!==!1&&!$&&W.length>=2;return g&&!$?(0,Ee.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!E2(T)?(0,Ee.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!F&&R.length===0&&L.every(B=>{let D="output"in B?B.output:void 0;return D===void 0||!o||!ju(B.toolName,D,m)})?(0,Ee.jsx)("div",{style:{display:"none"}},T.id):(0,Ee.jsxs)(Rx,{from:T.role,className:x?.message,children:[p!==!1&&!$&&!G&&A.map((B,D)=>(0,Ee.jsxs)(Uu,{isStreaming:B.state==="streaming",children:[(0,Ee.jsx)(Fu,{}),(0,Ee.jsx)(zu,{children:B.text})]},`reasoning-${T.id}-${D}`)),G&&(()=>{let B=W[W.length-1],D=B.type==="reasoning"?{icon:cr,label:S.reasoning.thinking}:{icon:U2(B.toolName),label:B.title??Fx(B.toolName)};return(0,Ee.jsxs)(d2,{isWorking:H&&(t==="streaming"||t==="submitted"),activeStep:D,children:[(0,Ee.jsx)(f2,{workingLabel:S.chainOfThought.working,label:S.chainOfThought.done}),(0,Ee.jsx)(p2,{children:W.map((Q,be)=>{let I=be===W.length-1;if(Q.type==="reasoning")return(0,Ee.jsx)(h2,{isStreaming:Q.state==="streaming",isLast:I,children:Q.text},`reasoning-${T.id}-${be}`);let qe=Q.title??Fx(Q.toolName),lt=U2(Q.toolName);if(p==="titles-only")return(0,Ee.jsx)(Mx,{icon:lt,title:qe,state:Q.state,isLast:I},Q.toolCallId);let v="output"in Q?Q.output:void 0;return(0,Ee.jsxs)(Mx,{icon:lt,title:qe,state:Q.state,isLast:I,children:[(0,Ee.jsx)(Bx,{input:Q.input,debug:f}),v!==void 0&&(0,Ee.jsx)(Ux,{output:v,errorText:"errorText"in Q?Q.errorText:void 0,debug:f})]},Q.toolCallId)})})]})})(),p!==!1&&!$&&!G&&L.length===1&&(()=>{let B=L[0],D=B.title??Fx(B.toolName);if(p==="titles-only")return(0,Ee.jsx)(C2,{title:D,state:B.state});let Q="output"in B?B.output:void 0;return(0,Ee.jsxs)(S2,{children:[(0,Ee.jsx)(I2,{title:D,state:B.state}),(0,Ee.jsxs)(k2,{children:[(0,Ee.jsx)(Bx,{input:B.input,debug:f}),Q!==void 0&&(0,Ee.jsx)(Ux,{output:Q,errorText:"errorText"in B?B.errorText:void 0,debug:f})]})]})})(),L.map(B=>{let D="output"in B?B.output:void 0,Q=ju(B.toolName,D,m),be=T2(B.toolName,D,m),I=B.toolCallId===d;return Q&&o&&D!==void 0?(0,Ee.jsx)("div",{style:I?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:Q&&o&&D!==void 0&&(0,Ee.jsx)(wp,{children:(0,Ee.jsx)(gp,{isFullscreen:I,resourceUri:Q,toolInput:B.input??{},toolResult:{content:D.content,structuredContent:D.structuredContent,_meta:D._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:be,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?qe=>c(qe,{toolCallId:B.toolCallId,resourceUri:Q,toolInput:B.input??{},toolResult:{content:D.content,structuredContent:D.structuredContent,_meta:D._meta},autoHeight:be}):void 0})})},B.toolCallId):null}),!$&&P.length>0&&(0,Ee.jsx)(sk,{documents:P}),!$&&(0,Ee.jsx)("div",{children:(0,Ee.jsxs)(Dx,{className:V(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,Ee.jsx)(ok,{files:R}),F?C.map((B,D)=>{let Q=H&&t==="streaming"&&D===C.length-1;return(0,Ee.jsx)(hp,{isStreaming:Q,children:B.type==="text"?B.text:""},`${T.id}-${D}`)}):null]})})]},T.id)}),b&&(0,Ee.jsx)(A2,{})]})}var Wu=q(ae(),1),a9="https://app.waniwani.ai/assets/waniwani-logo.svg",n9="https://waniwani.ai";function z2(){let{t:e}=Te();return(0,Wu.jsxs)("a",{href:n9,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,Wu.jsx)("span",{children:e.poweredBy.label}),(0,Wu.jsx)("img",{src:a9,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var Rl=q(he(),1);var We=q(ae(),1),q2=20;function r9({label:e}){return(0,We.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,We.jsx)("title",{children:e}),(0,We.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,We.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function o9({label:e}){return(0,We.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,We.jsx)("title",{children:e}),(0,We.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,We.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,We.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,We.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function i9({label:e}){return(0,We.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,We.jsx)("title",{children:e}),(0,We.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,We.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,We.jsx)("path",{d:"M10 11v6"}),(0,We.jsx)("path",{d:"M14 11v6"})]})}function H2({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Te(),[l,s]=(0,Rl.useState)(!1),u=(0,Rl.useRef)(null);(0,Rl.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,q2),d=Math.max(0,e.length-q2);return(0,We.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,We.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,We.jsx)(r9,{label:i.threadMenu.newChat})}),(0,We.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,We.jsx)(o9,{label:i.threadMenu.threadHistory})}),l&&(0,We.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,We.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,We.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,We.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,We.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,We.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":ew(m,o)})]}),(0,We.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,We.jsx)(i9,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,We.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 yp=q(he(),1);function Dl(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 j2(){return{subscribe(){return()=>{}},emit(){}}}var V2=(0,yp.createContext)(j2());function xp(){return(0,yp.useContext)(V2)}var _l=V2.Provider;var vp=q(he(),1);function W2(e){let t=(0,vp.useRef)(e);return t.current=e,(0,vp.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=Ma(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 fn=q(he(),1);var vD="vercel.ai.error",l9=Symbol.for(vD),G2,$2,Ue=class bD extends($2=Error,G2=l9,$2){constructor({name:t,message:a,cause:n}){super(a),this[G2]=!0,this.name=t,this.cause=n}static isInstance(t){return bD.hasMarker(t,vD)}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}},SD="AI_APICallError",ID=`vercel.ai.error.${SD}`,s9=Symbol.for(ID),X2,K2,Die=class extends(K2=Ue,X2=s9,K2){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:SD,message:e,cause:i}),this[X2]=!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 Ue.hasMarker(e,ID)}},CD="AI_EmptyResponseBodyError",kD=`vercel.ai.error.${CD}`,u9=Symbol.for(kD),Y2,Z2,_ie=class extends(Z2=Ue,Y2=u9,Z2){constructor({message:e="Empty response body"}={}){super({name:CD,message:e}),this[Y2]=!0}static isInstance(e){return Ue.hasMarker(e,kD)}};function TD(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var LD="AI_InvalidArgumentError",ED=`vercel.ai.error.${LD}`,c9=Symbol.for(ED),Q2,J2,MD=class extends(J2=Ue,Q2=c9,J2){constructor({message:e,cause:t,argument:a}){super({name:LD,message:e,cause:t}),this[Q2]=!0,this.argument=a}static isInstance(e){return Ue.hasMarker(e,ED)}},AD="AI_InvalidPromptError",RD=`vercel.ai.error.${AD}`,d9=Symbol.for(RD),eD,tD,Oie=class extends(tD=Ue,eD=d9,tD){constructor({prompt:e,message:t,cause:a}){super({name:AD,message:`Invalid prompt: ${t}`,cause:a}),this[eD]=!0,this.prompt=e}static isInstance(e){return Ue.hasMarker(e,RD)}},DD="AI_InvalidResponseDataError",_D=`vercel.ai.error.${DD}`,f9=Symbol.for(_D),aD,nD,Pie=class extends(nD=Ue,aD=f9,nD){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:DD,message:t}),this[aD]=!0,this.data=e}static isInstance(e){return Ue.hasMarker(e,_D)}},OD="AI_JSONParseError",PD=`vercel.ai.error.${OD}`,p9=Symbol.for(PD),rD,oD,qx=class extends(oD=Ue,rD=p9,oD){constructor({text:e,cause:t}){super({name:OD,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
-
Error message: ${
|
|
125
|
-
Error message: ${
|
|
126
|
-
`;break;case"id":l=S.includes("\0")?void 0:S;break;case"retry":/^\d+$/.test(S)?n(parseInt(S,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
|
+
${Ie}`}]}}$.current({...ke,...ge?{modelContext:ge}:{}})}he({jsonrpc:"2.0",id:He,result:{}});return}if(Oe==="ui/update-model-context"&&He!=null){xe=O2(xe,J.params),he({jsonrpc:"2.0",id:He,result:{}});return}if(Oe==="tools/call"&&He!=null){let ke=H.current;if(!ke){he({jsonrpc:"2.0",id:He,error:{code:-32601,message:"tools/call not supported"}});return}let ge=J.params?.name;ke({name:ge,arguments:J.params?.arguments??{}}).then(Ie=>{he({jsonrpc:"2.0",id:He,result:Ie});let X=Ie.content?.map(Ue=>Ue.text??"").join("").trim();X&&u9(ge,Ie,V.current)&&(We&&clearTimeout(We.timer),We={text:X,timer:setTimeout(()=>{if(K)return;let Ue=xe;xe=null,We=null,$.current?.({role:"user",content:[{type:"text",text:X}],...Ue?{modelContext:Ue}:{}})},500)})}).catch(Ie=>{let X=Ie instanceof Error?Ie.message:"Tool call failed";he({jsonrpc:"2.0",id:He,error:{code:-32e3,message:X}})});return}if(Oe==="ui/request-display-mode"&&He!=null){let ke=J.params?.mode,ge=ke==="fullscreen"||ke==="inline"||ke==="pip"?ke:"inline";T.current=ge,he({jsonrpc:"2.0",id:He,result:{mode:ge}}),he({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ge}}),F.current?.(ge);return}if(Oe==="ui/resource-teardown"&&He!=null){he({jsonrpc:"2.0",id:He,result:{}});return}Oe==="ping"&&He!=null&&he({jsonrpc:"2.0",id:He,result:{}})};return window.addEventListener("message",ue),()=>{K=!0,clearTimeout(me),We&&clearTimeout(We.timer),window.removeEventListener("message",ue)}},[l,N]),(0,U2.jsx)("iframe",{ref:m,src:D,onLoad:()=>se.current?.mark("iframeLoad"),sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:q(!f&&"ww:rounded-md ww:border ww:border-border",i),style:{height:f?"100%":C,minWidth:f||!R?void 0:`min(${R}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var so=z(ne(),1);function F2({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,so.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,so.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,so.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,so.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,so.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,so.jsx)("button",{type:"button",onClick:()=>r?.(o),className:q("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 z2=z(we(),1);var Al=z(ne(),1);function c9({onRetry:e}){let{t}=Le();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 yp=class extends z2.Component{constructor(){super(...arguments);ae(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)(c9,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var Me=z(ne(),1);function zx(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function q2(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?nu:Uo}function H2({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:S}=Le(),w=e[e.length-1],y=e.length>0,g=d!=null,b=!g&&D2(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,Me.jsxs)(Me.Fragment,{children:[!g&&(!y&&n?(0,Me.jsx)(F2,{...n,onSuggestionSelect:r}):a&&(0,Me.jsx)(Dx,{from:"assistant",children:(0,Me.jsx)(_x,{children:(0,Me.jsx)(gp,{children:a})})})),e.map(T=>{let C=T.parts.filter(N=>N.type==="text"),M=T.parts.filter(N=>N.type==="reasoning"),R=T.parts.filter(N=>N.type==="file"),P=ck(T.metadata),L=T.parts.filter(N=>"toolCallId"in N),$=T.parts.filter(N=>N.type==="reasoning"||"toolCallId"in N),H=T===w&&T.role==="assistant",F=C.length>0,W=g?L.some(N=>N.toolCallId===d):!1,V=p!==!1&&!W&&$.length>=2;return g&&!W?(0,Me.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!R2(T)?(0,Me.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!F&&R.length===0&&L.every(N=>{let D="output"in N?N.output:void 0;return D===void 0||!o||!ju(N.toolName,D,m)})?(0,Me.jsx)("div",{style:{display:"none"}},T.id):(0,Me.jsxs)(Dx,{from:T.role,className:x?.message,children:[p!==!1&&!W&&!V&&M.map((N,D)=>(0,Me.jsxs)(Uu,{isStreaming:N.state==="streaming",children:[(0,Me.jsx)(Fu,{}),(0,Me.jsx)(zu,{children:N.text})]},`reasoning-${T.id}-${D}`)),V&&(()=>{let N=$[$.length-1],D=N.type==="reasoning"?{icon:cr,label:S.reasoning.thinking}:{icon:q2(N.toolName),label:N.title??zx(N.toolName)};return(0,Me.jsxs)(m2,{isWorking:H&&(t==="streaming"||t==="submitted"),activeStep:D,children:[(0,Me.jsx)(h2,{workingLabel:S.chainOfThought.working,label:S.chainOfThought.done}),(0,Me.jsx)(g2,{children:$.map((G,se)=>{let I=se===$.length-1;if(G.type==="reasoning")return(0,Me.jsx)(y2,{isStreaming:G.state==="streaming",isLast:I,children:G.text},`reasoning-${T.id}-${se}`);let Ve=G.title??zx(G.toolName),rt=q2(G.toolName);if(p==="titles-only")return(0,Me.jsx)(Ax,{icon:rt,title:Ve,state:G.state,isLast:I},G.toolCallId);let v="output"in G?G.output:void 0;return(0,Me.jsxs)(Ax,{icon:rt,title:Ve,state:G.state,isLast:I,children:[(0,Me.jsx)(Ux,{input:G.input,debug:f}),v!==void 0&&(0,Me.jsx)(Fx,{output:v,errorText:"errorText"in G?G.errorText:void 0,debug:f})]},G.toolCallId)})})]})})(),p!==!1&&!W&&!V&&L.length===1&&(()=>{let N=L[0],D=N.title??zx(N.toolName);if(p==="titles-only")return(0,Me.jsx)(L2,{title:D,state:N.state});let G="output"in N?N.output:void 0;return(0,Me.jsxs)(k2,{children:[(0,Me.jsx)(T2,{title:D,state:N.state}),(0,Me.jsxs)(E2,{children:[(0,Me.jsx)(Ux,{input:N.input,debug:f}),G!==void 0&&(0,Me.jsx)(Fx,{output:G,errorText:"errorText"in N?N.errorText:void 0,debug:f})]})]})})(),L.map(N=>{let D="output"in N?N.output:void 0,G=ju(N.toolName,D,m),se=M2(N.toolName,D,m),I=N.toolCallId===d;return G&&o&&D!==void 0?(0,Me.jsx)("div",{style:I?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:G&&o&&D!==void 0&&(0,Me.jsx)(yp,{children:(0,Me.jsx)(wp,{isFullscreen:I,resourceUri:G,toolInput:N.input??{},toolResult:{content:D.content,structuredContent:D.structuredContent,_meta:D._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:se,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?Ve=>c(Ve,{toolCallId:N.toolCallId,resourceUri:G,toolInput:N.input??{},toolResult:{content:D.content,structuredContent:D.structuredContent,_meta:D._meta},autoHeight:se}):void 0})})},N.toolCallId):null}),!W&&P.length>0&&(0,Me.jsx)(dk,{documents:P}),!W&&(0,Me.jsx)("div",{children:(0,Me.jsxs)(_x,{className:q(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,Me.jsx)(sk,{files:R}),F?C.map((N,D)=>{let G=H&&t==="streaming"&&D===C.length-1;return(0,Me.jsx)(gp,{isStreaming:G,children:N.type==="text"?N.text:""},`${T.id}-${D}`)}):null]})})]},T.id)}),b&&(0,Me.jsx)(_2,{})]})}var Wu=z(ne(),1),d9="https://app.waniwani.ai/assets/waniwani-logo.svg",f9="https://waniwani.ai";function j2(){let{t:e}=Le();return(0,Wu.jsxs)("a",{href:f9,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,Wu.jsx)("span",{children:e.poweredBy.label}),(0,Wu.jsx)("img",{src:d9,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var Rl=z(we(),1);var Ke=z(ne(),1),V2=20;function p9({label:e}){return(0,Ke.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,Ke.jsx)("title",{children:e}),(0,Ke.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ke.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function m9({label:e}){return(0,Ke.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,Ke.jsx)("title",{children:e}),(0,Ke.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,Ke.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,Ke.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,Ke.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function h9({label:e}){return(0,Ke.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,Ke.jsx)("title",{children:e}),(0,Ke.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,Ke.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,Ke.jsx)("path",{d:"M10 11v6"}),(0,Ke.jsx)("path",{d:"M14 11v6"})]})}function W2({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Le(),[l,s]=(0,Rl.useState)(!1),u=(0,Rl.useRef)(null);(0,Rl.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,V2),d=Math.max(0,e.length-V2);return(0,Ke.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,Ke.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,Ke.jsx)(p9,{label:i.threadMenu.newChat})}),(0,Ke.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,Ke.jsx)(m9,{label:i.threadMenu.threadHistory})}),l&&(0,Ke.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,Ke.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,Ke.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,Ke.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,Ke.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,Ke.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":tw(m,o)})]}),(0,Ke.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,Ke.jsx)(h9,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,Ke.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 xp=z(we(),1);function Dl(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 G2(){return{subscribe(){return()=>{}},emit(){}}}var $2=(0,xp.createContext)(G2());function vp(){return(0,xp.useContext)($2)}var _l=$2.Provider;var bp=z(we(),1);function X2(e){let t=(0,bp.useRef)(e);return t.current=e,(0,bp.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=Ma(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 fn=z(we(),1);var ID="vercel.ai.error",g9=Symbol.for(ID),K2,Y2,ze=class CD extends(Y2=Error,K2=g9,Y2){constructor({name:t,message:a,cause:n}){super(a),this[K2]=!0,this.name=t,this.cause=n}static isInstance(t){return CD.hasMarker(t,ID)}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}},kD="AI_APICallError",TD=`vercel.ai.error.${kD}`,w9=Symbol.for(TD),Z2,Q2,Wie=class extends(Q2=ze,Z2=w9,Q2){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:kD,message:e,cause:i}),this[Z2]=!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 ze.hasMarker(e,TD)}},LD="AI_EmptyResponseBodyError",ED=`vercel.ai.error.${LD}`,y9=Symbol.for(ED),J2,eD,Gie=class extends(eD=ze,J2=y9,eD){constructor({message:e="Empty response body"}={}){super({name:LD,message:e}),this[J2]=!0}static isInstance(e){return ze.hasMarker(e,ED)}};function MD(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var AD="AI_InvalidArgumentError",RD=`vercel.ai.error.${AD}`,x9=Symbol.for(RD),tD,aD,DD=class extends(aD=ze,tD=x9,aD){constructor({message:e,cause:t,argument:a}){super({name:AD,message:e,cause:t}),this[tD]=!0,this.argument=a}static isInstance(e){return ze.hasMarker(e,RD)}},_D="AI_InvalidPromptError",OD=`vercel.ai.error.${_D}`,v9=Symbol.for(OD),nD,rD,$ie=class extends(rD=ze,nD=v9,rD){constructor({prompt:e,message:t,cause:a}){super({name:_D,message:`Invalid prompt: ${t}`,cause:a}),this[nD]=!0,this.prompt=e}static isInstance(e){return ze.hasMarker(e,OD)}},PD="AI_InvalidResponseDataError",ND=`vercel.ai.error.${PD}`,b9=Symbol.for(ND),oD,iD,Xie=class extends(iD=ze,oD=b9,iD){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:PD,message:t}),this[oD]=!0,this.data=e}static isInstance(e){return ze.hasMarker(e,ND)}},BD="AI_JSONParseError",UD=`vercel.ai.error.${BD}`,S9=Symbol.for(UD),lD,sD,Hx=class extends(sD=ze,lD=S9,sD){constructor({text:e,cause:t}){super({name:BD,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
+
Error message: ${MD(t)}`,cause:t}),this[lD]=!0,this.text=e}static isInstance(e){return ze.hasMarker(e,UD)}},FD="AI_LoadAPIKeyError",zD=`vercel.ai.error.${FD}`,I9=Symbol.for(zD),uD,cD,Kie=class extends(cD=ze,uD=I9,cD){constructor({message:e}){super({name:FD,message:e}),this[uD]=!0}static isInstance(e){return ze.hasMarker(e,zD)}},qD="AI_LoadSettingError",HD=`vercel.ai.error.${qD}`,C9=Symbol.for(HD),dD,fD,Yie=class extends(fD=ze,dD=C9,fD){constructor({message:e}){super({name:qD,message:e}),this[dD]=!0}static isInstance(e){return ze.hasMarker(e,HD)}},jD="AI_NoContentGeneratedError",VD=`vercel.ai.error.${jD}`,k9=Symbol.for(VD),pD,mD,Zie=class extends(mD=ze,pD=k9,mD){constructor({message:e="No content generated."}={}){super({name:jD,message:e}),this[pD]=!0}static isInstance(e){return ze.hasMarker(e,VD)}},WD="AI_NoSuchModelError",GD=`vercel.ai.error.${WD}`,T9=Symbol.for(GD),hD,gD,Qie=class extends(gD=ze,hD=T9,gD){constructor({errorName:e=WD,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[hD]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return ze.hasMarker(e,GD)}},$D="AI_TooManyEmbeddingValuesForCallError",XD=`vercel.ai.error.${$D}`,L9=Symbol.for(XD),wD,yD,Jie=class extends(yD=ze,wD=L9,yD){constructor(e){super({name:$D,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[wD]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return ze.hasMarker(e,XD)}},KD="AI_TypeValidationError",YD=`vercel.ai.error.${KD}`,E9=Symbol.for(YD),xD,vD,zn=class qx extends(vD=ze,xD=E9,vD){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:KD,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
125
|
+
Error message: ${MD(a)}`,cause:a}),this[xD]=!0,this.value=t,this.context=n}static isInstance(t){return ze.hasMarker(t,YD)}static wrap({value:t,cause:a,context:n}){var r,o,i;return qx.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 qx({value:t,cause:a,context:n})}},ZD="AI_UnsupportedFunctionalityError",QD=`vercel.ai.error.${ZD}`,M9=Symbol.for(QD),bD,SD,ele=class extends(SD=ze,bD=M9,SD){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:ZD,message:t}),this[bD]=!0,this.functionality=e}static isInstance(e){return ze.hasMarker(e,QD)}};var Sp=()=>Vx,Vx=new Proxy(Sp,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Sp},apply(){return Vx}}),jx=class extends Error{constructor(){super(...arguments);ae(this,"issues",[])}},h=new Proxy(Sp,{get(e,t){return t==="ZodError"?jx:t==="NEVER"?Symbol("NEVER"):Sp},apply(){return Vx}});var ye={};var Ip=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 Wx(e){}function JD(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=Wx,onError:a=Wx,onRetry:n=Wx,onComment:r}=e,o="",i=!0,l,s="",u="";function c(x){let S=i?x.replace(/^\xEF\xBB\xBF/,""):x,[w,y]=A9(`${o}${S}`);for(let g of w)d(g);o=y,i=!1}function d(x){if(x===""){p();return}if(x.startsWith(":")){r&&r(x.slice(x.startsWith(": ")?2:1));return}let S=x.indexOf(":");if(S!==-1){let w=x.slice(0,S),y=x[S+1]===" "?2:1,g=x.slice(S+y);f(w,g,x);return}f(x,"",x)}function f(x,S,w){switch(x){case"event":u=S;break;case"data":s=`${s}${S}
|
|
126
|
+
`;break;case"id":l=S.includes("\0")?void 0:S;break;case"retry":/^\d+$/.test(S)?n(parseInt(S,10)):a(new Ip(`Invalid \`retry\` value: "${S}"`,{type:"invalid-retry",value:S,line:w}));break;default:a(new Ip(`Unknown field "${x.length>20?`${x.slice(0,20)}\u2026`:x}"`,{type:"unknown-field",field:x,value:S,line:w}));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 A9(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 Ip=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=YD({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:ole,atob:ile}=globalThis;var a_="AI_DownloadError",n_=`vercel.ai.error.${a_}`,S9=Symbol.for(n_),ZD,QD,cn=class extends(QD=Ue,ZD=S9,QD){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:a_,message:r,cause:n}),this[ZD]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Ue.hasMarker(e,n_)}},Yx=2*1024*1024*1024;async function r_({response:e,url:t,maxBytes:a=Yx}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new cn({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 cn({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 Zx(e){let t;try{t=new URL(e)}catch{throw new cn({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new cn({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new cn({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new cn({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(I9(n))throw new cn({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(o_(a)){if($x(a))throw new cn({url:e,message:`URL with IP address ${a} is not allowed`});return}}function o_(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 $x(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 I9(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(o_(a))return $x(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 $x(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var vr=({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 MD({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},i_=vr();function l_(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 uo(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 Cp(e,...t){let a=new Headers(uo(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var C9=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,k9=/"(?: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 JD(e){let t=JSON.parse(e);return t===null||typeof t!="object"||C9.test(e)===!1&&k9.test(e)===!1?t:T9(t)}function T9(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 L9(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return JD(e)}try{return JD(e)}finally{Error.stackTraceLimit=t}}function Qx(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]=ii(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ii):ii(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ii)),e.allOf!=null&&(e.allOf=e.allOf.map(ii)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ii));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=ii(t[a]);return e}function ii(e){return typeof e=="boolean"?e:Qx(e)}var E9=Symbol("Let zodToJsonSchema decide on which parser to use"),e_={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"},M9=e=>typeof e=="string"?{...e_,name:e}:{...e_,...e};function $a(){return{}}function A9(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)!==fe.ZodAny&&(o.items=nt(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 R9(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 D9(){return{type:"boolean"}}function s_(e,t){return nt(e.type._def,t)}var _9=(e,t)=>nt(e.innerType._def,t);function u_(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>u_(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 O9(e)}}var O9=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 P9(e,t){return{...nt(e.innerType._def,t),default:e.defaultValue()}}function N9(e,t){return t.effectStrategy==="input"?nt(e.schema._def,t):$a()}function B9(e){return{type:"string",enum:Array.from(e.values)}}var U9=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function F9(e,t){let a=[nt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),nt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(U9(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 z9(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 Wx=void 0,kn={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:()=>(Wx===void 0&&(Wx=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Wx),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 c_(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":Tn(a,"email",n.message,t);break;case"format:idn-email":Tn(a,"idn-email",n.message,t);break;case"pattern:zod":ya(a,kn.email,n.message,t);break}break;case"url":Tn(a,"uri",n.message,t);break;case"uuid":Tn(a,"uuid",n.message,t);break;case"regex":ya(a,n.regex,n.message,t);break;case"cuid":ya(a,kn.cuid,n.message,t);break;case"cuid2":ya(a,kn.cuid2,n.message,t);break;case"startsWith":ya(a,RegExp(`^${Gx(n.value,t)}`),n.message,t);break;case"endsWith":ya(a,RegExp(`${Gx(n.value,t)}$`),n.message,t);break;case"datetime":Tn(a,"date-time",n.message,t);break;case"date":Tn(a,"date",n.message,t);break;case"time":Tn(a,"time",n.message,t);break;case"duration":Tn(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":{ya(a,RegExp(Gx(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Tn(a,"ipv4",n.message,t),n.version!=="v4"&&Tn(a,"ipv6",n.message,t);break}case"base64url":ya(a,kn.base64url,n.message,t);break;case"jwt":ya(a,kn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ya(a,kn.ipv4Cidr,n.message,t),n.version!=="v4"&&ya(a,kn.ipv6Cidr,n.message,t);break}case"emoji":ya(a,kn.emoji(),n.message,t);break;case"ulid":{ya(a,kn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Tn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{ya(a,kn.base64,n.message,t);break}}break}case"nanoid":ya(a,kn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Gx(e,t){return t.patternStrategy==="escape"?H9(e):e}var q9=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function H9(e){let t="";for(let a=0;a<e.length;a++)q9.has(e[a])||(t+="\\"),t+=e[a];return t}function Tn(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 ya(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:t_(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=t_(t,n)}function t_(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 Cp=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=JD({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:yle,atob:xle}=globalThis;var o_="AI_DownloadError",i_=`vercel.ai.error.${o_}`,R9=Symbol.for(i_),e_,t_,cn=class extends(t_=ze,e_=R9,t_){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:o_,message:r,cause:n}),this[e_]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return ze.hasMarker(e,i_)}},Zx=2*1024*1024*1024;async function l_({response:e,url:t,maxBytes:a=Zx}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new cn({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 cn({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 Qx(e){let t;try{t=new URL(e)}catch{throw new cn({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new cn({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new cn({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new cn({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(D9(n))throw new cn({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(s_(a)){if(Xx(a))throw new cn({url:e,message:`URL with IP address ${a} is not allowed`});return}}function s_(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 Xx(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 D9(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(s_(a))return Xx(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 Xx(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var vr=({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 DD({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},u_=vr();function c_(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 uo(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 kp(e,...t){let a=new Headers(uo(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var _9=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,O9=/"(?: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 a_(e){let t=JSON.parse(e);return t===null||typeof t!="object"||_9.test(e)===!1&&O9.test(e)===!1?t:P9(t)}function P9(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 N9(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return a_(e)}try{return a_(e)}finally{Error.stackTraceLimit=t}}function Jx(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]=ii(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ii):ii(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ii)),e.allOf!=null&&(e.allOf=e.allOf.map(ii)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ii));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=ii(t[a]);return e}function ii(e){return typeof e=="boolean"?e:Jx(e)}var B9=Symbol("Let zodToJsonSchema decide on which parser to use"),n_={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"},U9=e=>typeof e=="string"?{...n_,name:e}:{...n_,...e};function $a(){return{}}function F9(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)!==ye.ZodAny&&(o.items=nt(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 z9(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 q9(){return{type:"boolean"}}function d_(e,t){return nt(e.type._def,t)}var H9=(e,t)=>nt(e.innerType._def,t);function f_(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>f_(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 j9(e)}}var j9=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 V9(e,t){return{...nt(e.innerType._def,t),default:e.defaultValue()}}function W9(e,t){return t.effectStrategy==="input"?nt(e.schema._def,t):$a()}function G9(e){return{type:"string",enum:Array.from(e.values)}}var $9=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function X9(e,t){let a=[nt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),nt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if($9(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 K9(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 Gx=void 0,kn={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:()=>(Gx===void 0&&(Gx=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gx),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 p_(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":Tn(a,"email",n.message,t);break;case"format:idn-email":Tn(a,"idn-email",n.message,t);break;case"pattern:zod":ya(a,kn.email,n.message,t);break}break;case"url":Tn(a,"uri",n.message,t);break;case"uuid":Tn(a,"uuid",n.message,t);break;case"regex":ya(a,n.regex,n.message,t);break;case"cuid":ya(a,kn.cuid,n.message,t);break;case"cuid2":ya(a,kn.cuid2,n.message,t);break;case"startsWith":ya(a,RegExp(`^${$x(n.value,t)}`),n.message,t);break;case"endsWith":ya(a,RegExp(`${$x(n.value,t)}$`),n.message,t);break;case"datetime":Tn(a,"date-time",n.message,t);break;case"date":Tn(a,"date",n.message,t);break;case"time":Tn(a,"time",n.message,t);break;case"duration":Tn(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":{ya(a,RegExp($x(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Tn(a,"ipv4",n.message,t),n.version!=="v4"&&Tn(a,"ipv6",n.message,t);break}case"base64url":ya(a,kn.base64url,n.message,t);break;case"jwt":ya(a,kn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ya(a,kn.ipv4Cidr,n.message,t),n.version!=="v4"&&ya(a,kn.ipv6Cidr,n.message,t);break}case"emoji":ya(a,kn.emoji(),n.message,t);break;case"ulid":{ya(a,kn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Tn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{ya(a,kn.base64,n.message,t);break}}break}case"nanoid":ya(a,kn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function $x(e,t){return t.patternStrategy==="escape"?Z9(e):e}var Y9=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Z9(e){let t="";for(let a=0;a<e.length;a++)Y9.has(e[a])||(t+="\\"),t+=e[a];return t}function Tn(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 ya(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:r_(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=r_(t,n)}function r_(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 d_(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===fe.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=c_(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===fe.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===fe.ZodBranded&&e.keyType._def.type._def.typeName===fe.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=s_(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function j9(e,t){if(t.mapStrategy==="record")return d_(e,t);let a=nt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||$a(),n=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||$a();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function V9(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 W9(){return{not:$a()}}function G9(){return{type:"null"}}var Xx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function $9(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Xx&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Xx[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 X9(e,t)}var X9=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>nt(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 K9(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Xx[e.innerType._def.typeName],"null"]};let a=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function Y9(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 Z9(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=J9(l),u=nt(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=Q9(e,t);return o!==void 0&&(a.additionalProperties=o),a}function Q9(e,t){if(e.catchall._def.typeName!=="ZodNever")return nt(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 J9(e){try{return e.isOptional()}catch{return!0}}var ej=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return nt(e.innerType._def,t);let n=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:$a()},n]}:$a()},tj=(e,t)=>{if(t.pipeStrategy==="input")return nt(e.in._def,t);if(t.pipeStrategy==="output")return nt(e.out._def,t);let a=nt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=nt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function aj(e,t){return nt(e.type._def,t)}function nj(e,t){let n={type:"array",uniqueItems:!0,items:nt(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 rj(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:nt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function oj(){return{not:$a()}}function ij(){return $a()}var lj=(e,t)=>nt(e.innerType._def,t),sj=(e,t,a)=>{switch(t){case fe.ZodString:return c_(e,a);case fe.ZodNumber:return Y9(e);case fe.ZodObject:return Z9(e,a);case fe.ZodBigInt:return R9(e);case fe.ZodBoolean:return D9();case fe.ZodDate:return u_(e,a);case fe.ZodUndefined:return oj();case fe.ZodNull:return G9();case fe.ZodArray:return A9(e,a);case fe.ZodUnion:case fe.ZodDiscriminatedUnion:return $9(e,a);case fe.ZodIntersection:return F9(e,a);case fe.ZodTuple:return rj(e,a);case fe.ZodRecord:return d_(e,a);case fe.ZodLiteral:return z9(e);case fe.ZodEnum:return B9(e);case fe.ZodNativeEnum:return V9(e);case fe.ZodNullable:return K9(e,a);case fe.ZodOptional:return ej(e,a);case fe.ZodMap:return j9(e,a);case fe.ZodSet:return nj(e,a);case fe.ZodLazy:return()=>e.getter()._def;case fe.ZodPromise:return aj(e,a);case fe.ZodNaN:case fe.ZodNever:return W9();case fe.ZodEffects:return N9(e,a);case fe.ZodAny:return $a();case fe.ZodUnknown:return ij();case fe.ZodDefault:return P9(e,a);case fe.ZodBranded:return s_(e,a);case fe.ZodReadonly:return lj(e,a);case fe.ZodCatch:return _9(e,a);case fe.ZodPipeline:return tj(e,a);case fe.ZodFunction:case fe.ZodVoid:case fe.ZodSymbol:return;default:return(n=>{})(t)}},uj=(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 nt(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!==E9)return s}if(r&&!a){let s=cj(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=sj(e,e.typeName,t),l=typeof i=="function"?nt(i(),t):i;if(l&&dj(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var cj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:uj(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`),$a()):t.$refStrategy==="seen"?$a():void 0}},dj=(e,t,a)=>(e.description&&(a.description=e.description),a),fj=e=>{let t=M9(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}]))}},pj=(e,t)=>{var a;let n=fj(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=nt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:$a()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=nt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:$a(),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},Kx=Symbol.for("vercel.ai.schema");function kp(e){let t;return()=>(t==null&&(t=e()),t)}function Tp(e,{validate:t}={}){return{[Kx]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function mj(e){return typeof e=="object"&&e!==null&&Kx in e&&e[Kx]===!0&&"jsonSchema"in e&&"validate"in e}function Lp(e){return e==null?Tp({properties:{},additionalProperties:!1}):mj(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?$u(e):hj(e):e()}function hj(e){return Tp(()=>Qx(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 Fn({value:t,cause:a.issues})}}})}function gj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Tp(()=>pj(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 wj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Tp(()=>Qx((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 yj(e){return"_zod"in e}function $u(e,t){return yj(e)?wj(e,t):gj(e,t)}async function Ep({value:e,schema:t,context:a}){let n=await Ol({value:e,schema:t,context:a});if(!n.success)throw Fn.wrap({value:e,cause:n.error,context:a});return n.value}async function Ol({value:e,schema:t,context:a}){let n=Lp(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:Fn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:Fn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function br({text:e,schema:t}){try{let a=L9(e);return t==null?{success:!0,value:a,rawValue:a}:await Ol({value:a,schema:t})}catch(a){return{success:!1,error:qx.isInstance(a)?a:new qx({text:e,cause:a}),rawValue:void 0}}}function f_({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Ip).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await br({text:a,schema:t}))}}))}async function zn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var vj=Object.defineProperty,bj=(e,t)=>{for(var a in t)vj(e,a,{get:t[a],enumerable:!0})},Sj="AI_InvalidArgumentError",Ij=`vercel.ai.error.${Sj}`,Cj=Symbol.for(Ij),kj;kj=Cj;var Tj="AI_InvalidStreamPartError",Lj=`vercel.ai.error.${Tj}`,Ej=Symbol.for(Lj),Mj;Mj=Ej;var Aj="AI_InvalidToolApprovalError",Rj=`vercel.ai.error.${Aj}`,Dj=Symbol.for(Rj),_j;_j=Dj;var Oj="AI_InvalidToolInputError",Pj=`vercel.ai.error.${Oj}`,Nj=Symbol.for(Pj),Bj;Bj=Nj;var Uj="AI_ToolCallNotFoundForApprovalError",Fj=`vercel.ai.error.${Uj}`,zj=Symbol.for(Fj),qj;qj=zj;var Hj="AI_MissingToolResultsError",jj=`vercel.ai.error.${Hj}`,Vj=Symbol.for(jj),Wj;Wj=Vj;var Gj="AI_NoImageGeneratedError",$j=`vercel.ai.error.${Gj}`,Xj=Symbol.for($j),Kj;Kj=Xj;var m_="AI_NoObjectGeneratedError",h_=`vercel.ai.error.${m_}`,Yj=Symbol.for(h_),g_,co=class extends Ue{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:m_,message:e,cause:t}),this[g_]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Ue.hasMarker(e,h_)}};g_=Yj;var Zj="AI_NoOutputGeneratedError",Qj=`vercel.ai.error.${Zj}`,Jj=Symbol.for(Qj),e8;e8=Jj;var t8="AI_NoSpeechGeneratedError",a8=`vercel.ai.error.${t8}`,n8=Symbol.for(a8),r8;r8=n8;var o8="AI_NoTranscriptGeneratedError",i8=`vercel.ai.error.${o8}`,l8=Symbol.for(i8),s8;s8=l8;var u8="AI_NoVideoGeneratedError",c8=`vercel.ai.error.${u8}`,d8=Symbol.for(c8),f8;f8=d8;var p8="AI_NoSuchToolError",m8=`vercel.ai.error.${p8}`,h8=Symbol.for(m8),g8;g8=h8;var w8="AI_ToolCallRepairError",y8=`vercel.ai.error.${w8}`,x8=Symbol.for(y8),v8;v8=x8;var w_="AI_UIMessageStreamError",y_=`vercel.ai.error.${w_}`,b8=Symbol.for(y_),x_,Pl=class extends Ue{constructor({chunkType:e,chunkId:t,message:a}){super({name:w_,message:a}),this[x_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Ue.hasMarker(e,y_)}};x_=b8;var S8="AI_InvalidDataContentError",I8=`vercel.ai.error.${S8}`,C8=Symbol.for(I8),k8;k8=C8;var T8="AI_InvalidMessageRoleError",L8=`vercel.ai.error.${T8}`,E8=Symbol.for(L8),M8;M8=E8;var A8="AI_MessageConversionError",R8=`vercel.ai.error.${A8}`,D8=Symbol.for(R8),_8;_8=D8;var O8="AI_RetryError",P8=`vercel.ai.error.${O8}`,N8=Symbol.for(P8),B8;B8=N8;var U8="6.0.141",F8=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();Zx(r);try{let o=await fetch(r,{headers:Cp({},`ai-sdk/${U8}`,l_()),signal:a});if(o.redirected&&Zx(o.url),!o.ok)throw new cn({url:r,statusCode:o.status,statusText:o.statusText});return{data:await r_({response:o,url:r,maxBytes:t??Yx}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw cn.isInstance(o)?o:new cn({url:r,cause:o})}};var v_=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 Xu=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),Xu.optional()),h.array(Xu)])),ee=h.record(h.string(),h.record(h.string(),Xu.optional())),b_=h.object({type:h.literal("text"),text:h.string(),providerOptions:ee.optional()}),z8=h.object({type:h.literal("image"),image:h.union([v_,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:ee.optional()}),S_=h.object({type:h.literal("file"),data:h.union([v_,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:ee.optional()}),q8=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:ee.optional()}),H8=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:ee.optional(),providerExecuted:h.boolean().optional()}),j8=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:ee.optional()}),h.object({type:h.literal("json"),value:Xu,providerOptions:ee.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:ee.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:ee.optional()}),h.object({type:h.literal("error-json"),value:Xu,providerOptions:ee.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:ee.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:ee.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:ee.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:ee.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:ee.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:ee.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:ee.optional()}),h.object({type:h.literal("custom"),providerOptions:ee.optional()})]))})]),I_=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:j8,providerOptions:ee.optional()}),V8=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),W8=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),G8=h.object({role:h.literal("system"),content:h.string(),providerOptions:ee.optional()}),$8=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([b_,z8,S_]))]),providerOptions:ee.optional()}),X8=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([b_,S_,q8,H8,I_,V8]))]),providerOptions:ee.optional()}),K8=h.object({role:h.literal("tool"),content:h.array(h.union([I_,W8])),providerOptions:ee.optional()}),Rle=h.union([G8,$8,X8,K8]);function C_(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]=C_(o,r):a[n]=r}return a}var Y8={};bj(Y8,{array:()=>eV,choice:()=>tV,json:()=>aV,object:()=>J8,text:()=>Q8});function Z8(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 Ku(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await br({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await br({text:Z8(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Q8=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),J8=({schema:e,name:t,description:a})=>{let n=Lp(e);return{name:"object",responseFormat:zn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await br({text:r});if(!i.success)throw new co({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 Ol({value:i.value,schema:n});if(!l.success)throw new co({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 Ku(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},eV=({element:e,name:t,description:a})=>{let n=Lp(e);return{name:"array",responseFormat:zn(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 br({text:r});if(!i.success)throw new co({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 co({message:"No object generated: response did not match schema.",cause:new Fn({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 Ol({value:s,schema:n});if(!u.success)throw new co({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 Ku(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 Ol({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])}})}}},tV=({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 br({text:n});if(!o.success)throw new co({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 co({message:"No object generated: response did not match schema.",cause:new Fn({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 Ku(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(){}}),aV=({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 br({text:a});if(!r.success)throw new co({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 Ku(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 Ple=vr({prefix:"aitxt",size:24});var Ble=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 m_(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ye.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=p_(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ye.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ye.ZodBranded&&e.keyType._def.type._def.typeName===ye.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=d_(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function Q9(e,t){if(t.mapStrategy==="record")return m_(e,t);let a=nt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||$a(),n=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||$a();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function J9(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 ej(){return{not:$a()}}function tj(){return{type:"null"}}var Kx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function aj(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Kx&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Kx[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 nj(e,t)}var nj=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>nt(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 rj(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Kx[e.innerType._def.typeName],"null"]};let a=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function oj(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 ij(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=sj(l),u=nt(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=lj(e,t);return o!==void 0&&(a.additionalProperties=o),a}function lj(e,t){if(e.catchall._def.typeName!=="ZodNever")return nt(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 sj(e){try{return e.isOptional()}catch{return!0}}var uj=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return nt(e.innerType._def,t);let n=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:$a()},n]}:$a()},cj=(e,t)=>{if(t.pipeStrategy==="input")return nt(e.in._def,t);if(t.pipeStrategy==="output")return nt(e.out._def,t);let a=nt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=nt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function dj(e,t){return nt(e.type._def,t)}function fj(e,t){let n={type:"array",uniqueItems:!0,items:nt(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 pj(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:nt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function mj(){return{not:$a()}}function hj(){return $a()}var gj=(e,t)=>nt(e.innerType._def,t),wj=(e,t,a)=>{switch(t){case ye.ZodString:return p_(e,a);case ye.ZodNumber:return oj(e);case ye.ZodObject:return ij(e,a);case ye.ZodBigInt:return z9(e);case ye.ZodBoolean:return q9();case ye.ZodDate:return f_(e,a);case ye.ZodUndefined:return mj();case ye.ZodNull:return tj();case ye.ZodArray:return F9(e,a);case ye.ZodUnion:case ye.ZodDiscriminatedUnion:return aj(e,a);case ye.ZodIntersection:return X9(e,a);case ye.ZodTuple:return pj(e,a);case ye.ZodRecord:return m_(e,a);case ye.ZodLiteral:return K9(e);case ye.ZodEnum:return G9(e);case ye.ZodNativeEnum:return J9(e);case ye.ZodNullable:return rj(e,a);case ye.ZodOptional:return uj(e,a);case ye.ZodMap:return Q9(e,a);case ye.ZodSet:return fj(e,a);case ye.ZodLazy:return()=>e.getter()._def;case ye.ZodPromise:return dj(e,a);case ye.ZodNaN:case ye.ZodNever:return ej();case ye.ZodEffects:return W9(e,a);case ye.ZodAny:return $a();case ye.ZodUnknown:return hj();case ye.ZodDefault:return V9(e,a);case ye.ZodBranded:return d_(e,a);case ye.ZodReadonly:return gj(e,a);case ye.ZodCatch:return H9(e,a);case ye.ZodPipeline:return cj(e,a);case ye.ZodFunction:case ye.ZodVoid:case ye.ZodSymbol:return;default:return(n=>{})(t)}},yj=(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 nt(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!==B9)return s}if(r&&!a){let s=xj(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=wj(e,e.typeName,t),l=typeof i=="function"?nt(i(),t):i;if(l&&vj(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var xj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:yj(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`),$a()):t.$refStrategy==="seen"?$a():void 0}},vj=(e,t,a)=>(e.description&&(a.description=e.description),a),bj=e=>{let t=U9(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}]))}},Sj=(e,t)=>{var a;let n=bj(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=nt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:$a()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=nt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:$a(),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},Yx=Symbol.for("vercel.ai.schema");function Tp(e){let t;return()=>(t==null&&(t=e()),t)}function Lp(e,{validate:t}={}){return{[Yx]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Ij(e){return typeof e=="object"&&e!==null&&Yx in e&&e[Yx]===!0&&"jsonSchema"in e&&"validate"in e}function Ep(e){return e==null?Lp({properties:{},additionalProperties:!1}):Ij(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?$u(e):Cj(e):e()}function Cj(e){return Lp(()=>Jx(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 zn({value:t,cause:a.issues})}}})}function kj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Lp(()=>Sj(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 Tj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Lp(()=>Jx((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 Lj(e){return"_zod"in e}function $u(e,t){return Lj(e)?Tj(e,t):kj(e,t)}async function Mp({value:e,schema:t,context:a}){let n=await Ol({value:e,schema:t,context:a});if(!n.success)throw zn.wrap({value:e,cause:n.error,context:a});return n.value}async function Ol({value:e,schema:t,context:a}){let n=Ep(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:zn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:zn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function br({text:e,schema:t}){try{let a=N9(e);return t==null?{success:!0,value:a,rawValue:a}:await Ol({value:a,schema:t})}catch(a){return{success:!1,error:Hx.isInstance(a)?a:new Hx({text:e,cause:a}),rawValue:void 0}}}function h_({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Cp).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await br({text:a,schema:t}))}}))}async function qn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Mj=Object.defineProperty,Aj=(e,t)=>{for(var a in t)Mj(e,a,{get:t[a],enumerable:!0})},Rj="AI_InvalidArgumentError",Dj=`vercel.ai.error.${Rj}`,_j=Symbol.for(Dj),Oj;Oj=_j;var Pj="AI_InvalidStreamPartError",Nj=`vercel.ai.error.${Pj}`,Bj=Symbol.for(Nj),Uj;Uj=Bj;var Fj="AI_InvalidToolApprovalError",zj=`vercel.ai.error.${Fj}`,qj=Symbol.for(zj),Hj;Hj=qj;var jj="AI_InvalidToolInputError",Vj=`vercel.ai.error.${jj}`,Wj=Symbol.for(Vj),Gj;Gj=Wj;var $j="AI_ToolCallNotFoundForApprovalError",Xj=`vercel.ai.error.${$j}`,Kj=Symbol.for(Xj),Yj;Yj=Kj;var Zj="AI_MissingToolResultsError",Qj=`vercel.ai.error.${Zj}`,Jj=Symbol.for(Qj),e8;e8=Jj;var t8="AI_NoImageGeneratedError",a8=`vercel.ai.error.${t8}`,n8=Symbol.for(a8),r8;r8=n8;var w_="AI_NoObjectGeneratedError",y_=`vercel.ai.error.${w_}`,o8=Symbol.for(y_),x_,co=class extends ze{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:w_,message:e,cause:t}),this[x_]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return ze.hasMarker(e,y_)}};x_=o8;var i8="AI_NoOutputGeneratedError",l8=`vercel.ai.error.${i8}`,s8=Symbol.for(l8),u8;u8=s8;var c8="AI_NoSpeechGeneratedError",d8=`vercel.ai.error.${c8}`,f8=Symbol.for(d8),p8;p8=f8;var m8="AI_NoTranscriptGeneratedError",h8=`vercel.ai.error.${m8}`,g8=Symbol.for(h8),w8;w8=g8;var y8="AI_NoVideoGeneratedError",x8=`vercel.ai.error.${y8}`,v8=Symbol.for(x8),b8;b8=v8;var S8="AI_NoSuchToolError",I8=`vercel.ai.error.${S8}`,C8=Symbol.for(I8),k8;k8=C8;var T8="AI_ToolCallRepairError",L8=`vercel.ai.error.${T8}`,E8=Symbol.for(L8),M8;M8=E8;var v_="AI_UIMessageStreamError",b_=`vercel.ai.error.${v_}`,A8=Symbol.for(b_),S_,Pl=class extends ze{constructor({chunkType:e,chunkId:t,message:a}){super({name:v_,message:a}),this[S_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return ze.hasMarker(e,b_)}};S_=A8;var R8="AI_InvalidDataContentError",D8=`vercel.ai.error.${R8}`,_8=Symbol.for(D8),O8;O8=_8;var P8="AI_InvalidMessageRoleError",N8=`vercel.ai.error.${P8}`,B8=Symbol.for(N8),U8;U8=B8;var F8="AI_MessageConversionError",z8=`vercel.ai.error.${F8}`,q8=Symbol.for(z8),H8;H8=q8;var j8="AI_RetryError",V8=`vercel.ai.error.${j8}`,W8=Symbol.for(V8),G8;G8=W8;var $8="6.0.141",X8=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();Qx(r);try{let o=await fetch(r,{headers:kp({},`ai-sdk/${$8}`,c_()),signal:a});if(o.redirected&&Qx(o.url),!o.ok)throw new cn({url:r,statusCode:o.status,statusText:o.statusText});return{data:await l_({response:o,url:r,maxBytes:t??Zx}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw cn.isInstance(o)?o:new cn({url:r,cause:o})}};var I_=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 Xu=h.lazy(()=>h.union([h.null(),h.string(),h.number(),h.boolean(),h.record(h.string(),Xu.optional()),h.array(Xu)])),te=h.record(h.string(),h.record(h.string(),Xu.optional())),C_=h.object({type:h.literal("text"),text:h.string(),providerOptions:te.optional()}),K8=h.object({type:h.literal("image"),image:h.union([I_,h.instanceof(URL)]),mediaType:h.string().optional(),providerOptions:te.optional()}),k_=h.object({type:h.literal("file"),data:h.union([I_,h.instanceof(URL)]),filename:h.string().optional(),mediaType:h.string(),providerOptions:te.optional()}),Y8=h.object({type:h.literal("reasoning"),text:h.string(),providerOptions:te.optional()}),Z8=h.object({type:h.literal("tool-call"),toolCallId:h.string(),toolName:h.string(),input:h.unknown(),providerOptions:te.optional(),providerExecuted:h.boolean().optional()}),Q8=h.discriminatedUnion("type",[h.object({type:h.literal("text"),value:h.string(),providerOptions:te.optional()}),h.object({type:h.literal("json"),value:Xu,providerOptions:te.optional()}),h.object({type:h.literal("execution-denied"),reason:h.string().optional(),providerOptions:te.optional()}),h.object({type:h.literal("error-text"),value:h.string(),providerOptions:te.optional()}),h.object({type:h.literal("error-json"),value:Xu,providerOptions:te.optional()}),h.object({type:h.literal("content"),value:h.array(h.union([h.object({type:h.literal("text"),text:h.string(),providerOptions:te.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:te.optional()}),h.object({type:h.literal("file-url"),url:h.string(),providerOptions:te.optional()}),h.object({type:h.literal("file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:te.optional()}),h.object({type:h.literal("image-data"),data:h.string(),mediaType:h.string(),providerOptions:te.optional()}),h.object({type:h.literal("image-url"),url:h.string(),providerOptions:te.optional()}),h.object({type:h.literal("image-file-id"),fileId:h.union([h.string(),h.record(h.string(),h.string())]),providerOptions:te.optional()}),h.object({type:h.literal("custom"),providerOptions:te.optional()})]))})]),T_=h.object({type:h.literal("tool-result"),toolCallId:h.string(),toolName:h.string(),output:Q8,providerOptions:te.optional()}),J8=h.object({type:h.literal("tool-approval-request"),approvalId:h.string(),toolCallId:h.string()}),eV=h.object({type:h.literal("tool-approval-response"),approvalId:h.string(),approved:h.boolean(),reason:h.string().optional()}),tV=h.object({role:h.literal("system"),content:h.string(),providerOptions:te.optional()}),aV=h.object({role:h.literal("user"),content:h.union([h.string(),h.array(h.union([C_,K8,k_]))]),providerOptions:te.optional()}),nV=h.object({role:h.literal("assistant"),content:h.union([h.string(),h.array(h.union([C_,k_,Y8,Z8,T_,J8]))]),providerOptions:te.optional()}),rV=h.object({role:h.literal("tool"),content:h.array(h.union([T_,eV])),providerOptions:te.optional()}),Vle=h.union([tV,aV,nV,rV]);function L_(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]=L_(o,r):a[n]=r}return a}var oV={};Aj(oV,{array:()=>uV,choice:()=>cV,json:()=>dV,object:()=>sV,text:()=>lV});function iV(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 Ku(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await br({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await br({text:iV(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var lV=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),sV=({schema:e,name:t,description:a})=>{let n=Ep(e);return{name:"object",responseFormat:qn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await br({text:r});if(!i.success)throw new co({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 Ol({value:i.value,schema:n});if(!l.success)throw new co({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 Ku(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},uV=({element:e,name:t,description:a})=>{let n=Ep(e);return{name:"array",responseFormat:qn(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 br({text:r});if(!i.success)throw new co({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 co({message:"No object generated: response did not match schema.",cause:new zn({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 Ol({value:s,schema:n});if(!u.success)throw new co({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 Ku(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 Ol({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])}})}}},cV=({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 br({text:n});if(!o.success)throw new co({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 co({message:"No object generated: response did not match schema.",cause:new zn({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 Ku(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(){}}),dV=({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 br({text:a});if(!r.success)throw new co({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 Ku(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 Xle=vr({prefix:"aitxt",size:24});var Yle=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 ev=kp(()=>$u(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:ee.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:ee.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 nV(e){return e.type.startsWith("data-")}function Jx(e){return e.type.startsWith("tool-")}function rV(e){return e.type==="dynamic-tool"}function Mp(e){return Jx(e)||rV(e)}function p_(e){return e.type.split("-").slice(1).join("-")}function oV({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function iV({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(Mp).find(C=>C.toolCallId===g);if(T==null)throw new Pl({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return T}function S(g){var b;let T=u.message.parts.find(R=>Jx(R)&&R.toolCallId===g.toolCallId),C=g,A=T;if(T!=null){T.state=g.state,A.input=C.input,A.output=C.output,A.errorText=C.errorText,A.rawInput=C.rawInput,A.preliminary=C.preliminary,g.title!==void 0&&(A.title=g.title),A.providerExecuted=(b=C.providerExecuted)!=null?b:T.providerExecuted;let R=C.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let P=T;P.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:C.input,output:C.output,rawInput:C.rawInput,errorText:C.errorText,providerExecuted:C.providerExecuted,preliminary:C.preliminary,...C.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:C.providerMetadata}:{},...C.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:C.providerMetadata}:{}})}function w(g){var b,T;let C=u.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===g.toolCallId),A=g,R=C;if(C!=null){C.state=g.state,R.toolName=g.toolName,R.input=A.input,R.output=A.output,R.errorText=A.errorText,R.rawInput=(b=A.rawInput)!=null?b:R.rawInput,R.preliminary=A.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(T=A.providerExecuted)!=null?T:C.providerExecuted;let P=A.providerMetadata;if(P!=null)if(g.state==="output-available"||g.state==="output-error"){let L=C;L.resultProviderMetadata=P}else C.callProviderMetadata=P}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:A.input,output:A.output,errorText:A.errorText,preliminary:A.preliminary,providerExecuted:A.providerExecuted,title:g.title,...A.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:A.providerMetadata}:{},...A.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:A.providerMetadata}:{}})}async function y(g){if(g!=null){let b=u.message.metadata!=null?C_(u.message.metadata,g):g;t!=null&&await Ep({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 Pl({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 Pl({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 Pl({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 Pl({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(Jx);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:g.length,dynamic:l.dynamic,title:l.title},l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):S({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 Pl({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 Ku(g.text);g.dynamic?w({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}):S({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}),c();break}case"tool-input-available":{l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):S({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(Mp).find(T=>T.toolCallId===l.toolCallId);(g!=null?g.type==="dynamic-tool":!!l.dynamic)?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):S({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"?w({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}):S({toolCallId:l.toolCallId,toolName:p_(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"?w({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):S({toolCallId:l.toolCallId,toolName:p_(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 y(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(nV(l)){if(a?.[l.type]!=null){let T=u.message.parts.findIndex(A=>"id"in A&&"data"in A&&A.id===l.id&&A.type===l.type),C=T>=0?T:u.message.parts.length;await Ep({value:l.data,schema:a[l.type],context:{field:`message.parts[${C}].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 lV({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 qle=vr({prefix:"aitxt",size:24});var Vle=kp(()=>$u(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:ee.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:ee.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:ee.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:ee.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:ee.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:ee.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:ee.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:ee.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:ee.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:ee.optional(),resultProviderMetadata:ee.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:ee.optional(),resultProviderMetadata:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.optional(),resultProviderMetadata:ee.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:ee.optional(),resultProviderMetadata:ee.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:ee.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 Gle=vr({prefix:"aiobj",size:24});function k_(e){return({url:t,abortSignal:a})=>F8({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var sV=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 Xle=vr({prefix:"aiobj",size:24});var Kle=k_();var uV="AI_NoSuchProviderError",cV=`vercel.ai.error.${uV}`,dV=Symbol.for(cV),fV;fV=dV;var Yle=k_();async function pV(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 mV=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 zn(this.body),s=await zn(this.headers),u=await zn(this.credentials),c={...uo(s),...uo(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?uo(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,w=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(!w.ok)throw new Error((i=await w.text())!=null?i:"Failed to fetch the chat response.");if(!w.body)throw new Error("The response body is empty.");return this.processResponseStream(w.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await zn(this.body),l=await zn(this.headers),s=await zn(this.credentials),u={...uo(l),...uo(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?uo(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)}},tv=class extends mV{constructor(e={}){super(e)}processResponseStream(e){return f_({stream:e,schema:ev}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},T_=class{constructor({generateId:e=i_,id:t=e(),transport:a=new tv,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new sV,this.sendMessage=async(d,f)=>{var p,m,x,S;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let w;if("text"in d||"files"in d?w={parts:[...Array.isArray(d.files)?d.files:await pV(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:w=d,d.messageId!=null){let y=this.state.messages.findIndex(g=>g.id===d.messageId);if(y===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[y].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,y+1),this.state.replaceMessage(y,{...w,id:d.messageId,role:(m=w.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...w,id:(x=w.id)!=null?x:this.generateId(),role:(S=w.role)!=null?S:"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,S=x[x.length-1],w=y=>Mp(y)&&y.state==="approval-requested"&&y.approval.id===d?{...y,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:y;this.state.replaceMessage(x.length-1,{...S,parts:S.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(y=>{var g;y&&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 S=this.state.messages,w=S[S.length-1],y=g=>Mp(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(S.length-1,{...w,parts:w.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(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:oV({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=S=>this.jobExecutor.run(()=>S({state:p.state,write:()=>{var w;this.setStatus({status:"streaming"}),p.state.message.id===((w=this.lastMessage)==null?void 0:w.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await lV({stream:iV({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:S=>{throw S}}),onError:S=>{throw S}}),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 R_=q(E_(),1);var Ju=q(he(),1);var Dp=q(he(),1);var A_=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},ht=(e,t,a)=>(A_(e,t,"read from private field"),a?a.call(e):t.get(e)),qn=(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)},fo=(e,t,a,n)=>(A_(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function gV(e,t){return t!=null?(0,R_.default)(e,t):e}var dn,Ap,Rp,Yu,Zu,Qu,Nl,av,nv,wV=class{constructor(e=[]){qn(this,dn,void 0),qn(this,Ap,"ready"),qn(this,Rp,void 0),qn(this,Yu,new Set),qn(this,Zu,new Set),qn(this,Qu,new Set),this.pushMessage=t=>{fo(this,dn,ht(this,dn).concat(t)),ht(this,Nl).call(this)},this.popMessage=()=>{fo(this,dn,ht(this,dn).slice(0,-1)),ht(this,Nl).call(this)},this.replaceMessage=(t,a)=>{fo(this,dn,[...ht(this,dn).slice(0,t),this.snapshot(a),...ht(this,dn).slice(t+1)]),ht(this,Nl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?gV(t,a):t;return ht(this,Yu).add(n),()=>{ht(this,Yu).delete(n)}},this["~registerStatusCallback"]=t=>(ht(this,Zu).add(t),()=>{ht(this,Zu).delete(t)}),this["~registerErrorCallback"]=t=>(ht(this,Qu).add(t),()=>{ht(this,Qu).delete(t)}),qn(this,Nl,()=>{ht(this,Yu).forEach(t=>t())}),qn(this,av,()=>{ht(this,Zu).forEach(t=>t())}),qn(this,nv,()=>{ht(this,Qu).forEach(t=>t())}),fo(this,dn,e)}get status(){return ht(this,Ap)}set status(e){fo(this,Ap,e),ht(this,av).call(this)}get error(){return ht(this,Rp)}set error(e){fo(this,Rp,e),ht(this,nv).call(this)}get messages(){return ht(this,dn)}set messages(e){fo(this,dn,[...e]),ht(this,Nl).call(this)}};dn=new WeakMap;Ap=new WeakMap;Rp=new WeakMap;Yu=new WeakMap;Zu=new WeakMap;Qu=new WeakMap;Nl=new WeakMap;av=new WeakMap;nv=new WeakMap;var Bl,M_=class extends T_{constructor({messages:e,...t}){let a=new wV(e);super({...t,state:a}),qn(this,Bl,void 0),this["~registerMessagesCallback"]=(n,r)=>ht(this,Bl)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>ht(this,Bl)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>ht(this,Bl)["~registerErrorCallback"](n),fo(this,Bl,a)}};Bl=new WeakMap;function D_({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,fn.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,fn.useRef)("chat"in a?a.chat:new M_(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new M_(r));let l=(0,fn.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,fn.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,fn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,fn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,fn.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,fn.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 K=q(he(),1);var yV="/api/mcp/modules/documents",xV=2e4,vV=3e5,pn=class extends Error{constructor(a,n){super(n);te(this,"code");this.name="DocumentUploadError",this.code=a}};function __(e,t){return Vd(e,`${yV}${t}`)}function bV(e){return __(e,"/upload-url")}function O_(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function SV(e){let t=e?.data;if(typeof t?.documentId!="string"||typeof t.uploadUrl!="string"||!(t.documentId&&t.uploadUrl))return null;let a={};for(let[n,r]of Object.entries(t.headers??{}))typeof r=="string"&&(a[n]=r);return{documentId:t.documentId,uploadUrl:t.uploadUrl,headers:a}}function IV(e){return e===403?new pn("upload_disabled","This agent does not accept document uploads."):e===413?new pn("max_file_size","That file is too large."):e===422||e===400?new pn("accept","That file type is not accepted."):new pn("upload_failed",`The upload could not be started (${e}).`)}function CV(e){return new Promise((t,a)=>{let n=new XMLHttpRequest;n.open("PUT",e.url,!0);for(let[i,l]of Object.entries(e.headers))n.setRequestHeader(i,l);n.timeout=vV;let r=()=>n.abort();e.signal.addEventListener("abort",r,{once:!0});let o=()=>e.signal.removeEventListener("abort",r);n.upload.onprogress=i=>{i.lengthComputable&&i.total>0&&e.onProgress?.(i.loaded/i.total)},n.onload=()=>{if(o(),n.status>=200&&n.status<300||n.status===412){e.onProgress?.(1),t();return}a(new pn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new pn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new pn("upload_failed","The upload timed out."))},n.onabort=()=>{o(),a(e.signal.reason instanceof Error?e.signal.reason:new Error("aborted"))},n.send(e.file)})}async function _p(e){let t=__(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:O_(e.headers,e.uploadHeaders)})}catch{}}async function P_(e){e.signal.throwIfAborted();let t=bV(e.api);if(!t)throw new pn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),xV),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let l=O_(e.headers,e.uploadHeaders);l.set("Content-Type","application/json"),o=await fetch(t,{method:"POST",headers:l,signal:a.signal,body:JSON.stringify({filename:e.file.name,contentType:e.file.type,byteSize:e.file.size,...e.sessionId?{sessionId:e.sessionId}:{}})})}catch(l){throw e.signal.aborted?l:new pn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw IV(o.status);let i=SV(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new pn("upload_failed","The upload could not be started.");return await CV({url:i.uploadUrl,headers:i.headers,file:e.file,signal:e.signal,onProgress:e.onProgress}),{documentId:i.documentId,filename:e.file.name,mediaType:e.file.type}}function kV(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 Op=class extends tv{processResponseStream(t){let a="",n=ev(),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=kV(f.error);if(p?.length){let m={...d};for(let S of p)delete m[S];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var N_=50,B_=1e3;function Pp(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 Np(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await qg(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function rv(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function ov(e){return await Np(async a=>{let o=a.transaction(Va,"readonly").objectStore(Va).index(Wd),l=(await rv(o.getAll(e))??[]).filter(Pp);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Bp(e){return await Np(async a=>{let r=a.transaction(Va,"readonly").objectStore(Va),o=await rv(r.get(e));return Pp(o)?o:null})??null}async function iv(e){if(!Pp(e))return;let t=e.messages.length>B_?{...e,messages:e.messages.slice(e.messages.length-B_)}:e;await Np(async a=>{await new Promise((s,u)=>{let c=a.transaction(Va,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Va).put(t)});let n=a.transaction(Va,"readwrite"),r=n.objectStore(Va),o=r.index(Wd),l=(await rv(o.getAll(t.memoryUserId))??[]).filter(Pp);if(l.length>N_){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-N_);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 U_(e){await Np(async t=>(await new Promise((a,n)=>{let r=t.transaction(Va,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Va).delete(e)}),null))}async function lv(e){return(await ov(e))[0]?.threadId??null}function F_(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 TV="x-session-id",LV=250,EV=200;function z_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():cu()}function Up(){return new Date().toISOString()}function q_(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function MV(e,t){let a=Ma(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 H_(e){let{api:t="/api/waniwani",headers:a,uploadHeaders:n,body:r,onMessageSent:o,onResponseReceived:i,enableThreadHistory:l=!1,activeThreadId:s,onThreadChange:u}=e,c=e.visitorId;(0,K.useEffect)(()=>Xs(c),[c]);let d=xp(),f=(0,K.useRef)(a),p=(0,K.useRef)(n),m=(0,K.useRef)(r),x=(0,K.useRef)(l);(0,K.useEffect)(()=>{x.current=l},[l]);let S=(0,K.useRef)(void 0),w=(0,K.useRef)(void 0),y=(0,K.useRef)(null),[g,b]=(0,K.useState)(void 0),T=(0,K.useRef)(g),[C,A]=(0,K.useState)(s),R=(0,K.useRef)(C),[P,L]=(0,K.useState)([]),[W,H]=(0,K.useState)(!l),F=(0,K.useRef)(void 0),$=(0,K.useRef)(void 0),G=(0,K.useRef)(void 0),B=(0,K.useRef)(void 0),D=(0,K.useRef)(0),Q=(0,K.useRef)(u);(0,K.useEffect)(()=>{Q.current=u},[u]);let be=(0,K.useCallback)(O=>{R.current=O,A(O),O&&(Q.current?.(O),d.emit({name:"thread.changed",sessionId:T.current,properties:{threadId:O}}))},[d]),I=(0,K.useCallback)(async()=>{if(!l)return;let O=y.current?.memoryUserId;if(!O)return;let re=await ov(O);L(re)},[l]),qe=(0,K.useCallback)(()=>T.current,[]),lt=(0,K.useCallback)(O=>{let re=q_(O);if(!re||T.current===re)return;let ce=T.current===void 0;T.current=re,b(re),ce&&d.emit({name:"session.started",properties:{sessionId:re}})},[d]),v=(0,K.useCallback)(()=>{T.current=void 0,b(void 0)},[]);(0,K.useEffect)(()=>{f.current=a,p.current=n},[a,n]),(0,K.useEffect)(()=>{m.current=r},[r]),(0,K.useEffect)(()=>{let O=!1,re=D.current;return(async()=>{try{let Ke=await Ks();if(O)return;y.current=Ke}catch{}if(!l)return;let ce=y.current?.memoryUserId;if(!ce){H(!0);return}try{let Ke=s??await lv(ce);if(O||re!==D.current)return;if(Ke){let Vt=await Bp(Ke);if(O||re!==D.current)return;Vt&&Vt.memoryUserId===ce&&(R.current=Vt.threadId,A(Vt.threadId),F.current=Vt.createdAt,$.current=Vt.title,Vt.sessionId&&(T.current=Vt.sessionId,b(Vt.sessionId)),xe(Vt.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[]);let z=(0,K.useRef)(null),J=(0,K.useCallback)(O=>{let re=m.current?.[O];return typeof re=="string"?re:void 0},[]),we=(0,K.useCallback)(()=>({api:t,token:$d(f.current),channelId:J("channelId"),sessionId:T.current}),[t,J]),$e=(0,K.useCallback)(O=>{let re=z.current;z.current=null,re?.report(we(),{mode:J("mode"),outcome:O})},[we,J]),Se=(0,K.useRef)(new Op({api:t,headers:()=>({...f.current}),body:()=>{let O={...m.current??{}},re=Object.hasOwn(O,"sessionId"),ce=q_(O.sessionId);if(ce)lt(ce),O.sessionId=ce;else if(re)v(),delete O.sessionId;else{let $p=qe();$p&&(O.sessionId=$p)}El(S.current)&&(O.modelContext=S.current),w.current?.length&&(O.documents=w.current);let Ke=y.current,Vt=ea();Ke&&(O.visitorContext={timezone:Ke.timezone,language:Ke.language,languages:Ke.languages,deviceType:Ke.deviceType,referrer:Ke.referrer,visitorId:Vt});let Et=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},MO=typeof Et.client=="object"&&Et.client!==null?Et.client:{};O.visitor={...Et,id:Vt,client:{...MO,...Ke&&{memoryUserId:Ke.memoryUserId}}};let vv=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,bv=y.current?.memoryUserId,Sv=y.current?.language,uc={};if(bv&&(uc.memoryUserId=bv),Sv&&(uc.locale=Sv),(Object.keys(uc).length>0||vv)&&(O.extra={...uc,...vv??{}}),x.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(R.current=O.threadId);else{let cc=R.current;cc||(cc=z_(),F.current=Up(),$.current=void 0,be(cc)),O.threadId=cc}return O},fetch:(async(O,re)=>{let ce=z.current;ce?.mark("requestStart");try{let Ke=await fetch(O,re);return S.current=void 0,lt(Ke.headers.get(TV)),ce?ce.instrument(Ke):Ke}finally{w.current=void 0}})})),pe=(0,K.useRef)(null),ue=(0,K.useRef)(null),de=(0,K.useRef)({}),[Z,He]=(0,K.useState)(0),Xe=e.skipRemoteConfig===!0,Re=(0,K.useCallback)(async()=>{if(!Xe)try{let O=await MV(t,f.current);de.current=O,He(re=>re+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,Xe]);(0,K.useEffect)(()=>{Re()},[Re]);let{messages:ye,sendMessage:Ce,setMessages:xe,status:Je,stop:jt}=D_({messages:e.initialMessages,transport:Se.current,onFinish({message:O,isAbort:re,isDisconnect:ce,isError:Ke}){z.current?.mark("streamEnd"),$e(re||ce||Ke?"error":"ok"),i?.(),!re&&!ce&&!Ke&&d.emit({name:"message.received"}),pe.current&&(ue.current=O)},onError(O){$e("error"),console.warn("[Waniwani] Chat error:",O.message),d.emit({name:"chat.error",properties:{message:O.message.slice(0,EV)}}),pe.current&&(pe.current.reject(O),pe.current=null)}}),aa=(0,K.useRef)(ye);(0,K.useEffect)(()=>{aa.current=ye},[ye]);let sa=(0,K.useCallback)(()=>{z.current=RC(aa.current.filter(O=>O.role==="user").length+1)},[]),[Xa,di]=(0,K.useState)(!1),fi=(0,K.useCallback)(async()=>{di(!0);try{await jt();let O=T.current;if(!O)return;await fetch(Ma(t,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json",...f.current},body:JSON.stringify({sessionId:O})})}catch{}finally{di(!1)}},[t,jt]),M=(0,K.useRef)(l);(0,K.useEffect)(()=>{if(!l||M.current||(M.current=!0,aa.current.length>0))return;let O=!1,re=D.current;return H(!1),(async()=>{try{let ce=y.current;if(!ce)try{ce=await Ks(),y.current=ce}catch{}let Ke=ce?.memoryUserId;if(!Ke||O||re!==D.current){O||H(!0);return}let Vt=s??await lv(Ke);if(O||re!==D.current)return;if(Vt){let Et=await Bp(Vt);if(O||re!==D.current)return;Et&&Et.memoryUserId===Ke&&(R.current=Et.threadId,A(Et.threadId),F.current=Et.createdAt,$.current=Et.title,Et.sessionId&&(T.current=Et.sessionId,b(Et.sessionId)),xe(Et.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[l]),(0,K.useEffect)(()=>{if(Je==="ready"&&pe.current&&ue.current){let O=pe.current,re=ue.current;pe.current=null,ue.current=null,O.resolve(re)}},[Je]);let[U,Y]=(0,K.useState)(""),[ne,ke]=(0,K.useState)([]),Ot=(0,K.useRef)([]);Ot.current=ne;let ua=Je==="submitted"||Je==="streaming",va=(0,K.useCallback)(O=>{for(let re of O)for(let ce of re.documents??[])_p({documentId:ce.documentId,api:t,headers:f.current,uploadHeaders:p.current})},[t]),ba=(0,K.useCallback)(()=>{va(Ot.current),ke([])},[va]),ho=(0,K.useCallback)(O=>{let re=Ot.current.find(ce=>ce.id===O);re&&va([re]),ke(ce=>ce.filter(Ke=>Ke.id!==O))},[va]),ca=ua&&ne.length>0,Sr=(0,K.useCallback)(O=>{let re=!!O.text?.trim(),ce=!!(O.files?.length||O.documents?.length);if(re||ce){if(ua){if(ne.length>0)return;ke(Ke=>[...Ke,{id:cu(),text:O.text||"",files:O.files??[],documents:O.documents??[],modelContext:O.modelContext}]),Y("");return}sa(),S.current=O.modelContext,w.current=O.documents,Ce({text:O.text||"",files:O.files,...O.documents?.length&&{metadata:{documents:O.documents}}}),o?.(O.text||""),d.emit({name:"message.sent"}),Y("")}},[Ce,o,ua,ne.length,d,sa]),hn=(0,K.useCallback)(O=>new Promise((re,ce)=>{pe.current={resolve:re,reject:ce},sa(),Ce({text:O}),o?.(O),d.emit({name:"message.sent"})}),[Ce,o,d,sa]);(0,K.useEffect)(()=>{if(Je!=="ready"||Xa||ne.length===0)return;let[O,...re]=ne;ke(re),sa(),S.current=O.modelContext,w.current=O.documents,Ce({text:O.text,files:O.files.length>0?O.files:void 0,...O.documents.length>0&&{metadata:{documents:O.documents}}}),o?.(O.text),d.emit({name:"message.sent"})},[Je,Xa,Ce,o,ne,d,sa]);let IO=(0,K.useCallback)(()=>{xe([]),ba(),v(),Y(""),de.current={},He(O=>O+1),Re()},[xe,v,Re,ba]),lc=(0,K.useCallback)(()=>{if(!x.current)return;let O=y.current?.memoryUserId,re=R.current,ce=aa.current;if(!(!O||!re||ce.length===0)){if(F.current||(F.current=Up()),!$.current){let Ke=ce.find(Et=>Et.role==="user"),Vt=Ke?Ke.parts.map(Et=>"text"in Et&&typeof Et.text=="string"?Et.text:"").join(" "):"";$.current=F_(Vt)}return{threadId:re,memoryUserId:O,title:$.current,messages:ce,sessionId:T.current,createdAt:F.current,updatedAt:Up()}}},[]),wv=(0,K.useCallback)(async()=>{let O=lc();O&&(await iv(O),await I())},[lc,I]);(0,K.useEffect)(()=>{if(l&&W&&!(Je==="submitted"||Je==="streaming")&&ye.length!==0)return G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=void 0;let O=wv().finally(()=>{B.current===O&&(B.current=void 0)});B.current=O},LV),()=>{G.current&&clearTimeout(G.current)}},[l,W,ye,Je,wv]);let sc=(0,K.useCallback)(()=>{let O=B.current,re=G.current,ce=re?lc():void 0;return re&&(clearTimeout(re),G.current=void 0),(async()=>{O&&await O,ce&&(await iv(ce),await I())})()},[lc,I]),CO=(0,K.useCallback)(()=>{D.current+=1,sc(),xe([]),ba(),v(),Y("");let O=z_();return F.current=Up(),$.current=void 0,be(O),I(),O},[xe,v,be,I,sc,ba]),Gp=(0,K.useCallback)(async O=>{D.current+=1;let re=D.current;if(await sc(),re!==D.current)return;let ce=await Bp(O);re===D.current&&ce&&(ce.sessionId?(T.current=ce.sessionId,b(ce.sessionId)):v(),be(ce.threadId),F.current=ce.createdAt,$.current=ce.title,xe(ce.messages),ba(),Y(""))},[xe,v,be,sc,ba]),kO=(0,K.useCallback)(async O=>{if(R.current===O){D.current+=1,G.current&&(clearTimeout(G.current),G.current=void 0);let re=B.current;re&&await re}await U_(O),await I(),R.current===O&&(xe([]),ba(),v(),Y(""),R.current=void 0,A(void 0),F.current=void 0,$.current=void 0)},[xe,v,I,ba]);(0,K.useEffect)(()=>{l&&W&&s!==void 0&&s!==R.current&&Gp(s)},[s,l,W,Gp]);let TO=(0,K.useCallback)(O=>{Y(O.target.value)},[]),yv=ye[ye.length-1],xv=ye.length>0,LO=ua&&(!xv||yv.role==="user"),EO=de.current;return{messages:ye,status:Je,text:U,setText:Y,handleSubmit:Sr,handleTextChange:TO,isLoading:ua,showLoaderBubble:LO,lastMessage:yv,hasMessages:xv,sendMessage:Ce,sendMessageAndWait:hn,stop:fi,reset:IO,queuedMessages:ne,queueFull:ca,removeQueuedMessage:ho,sessionId:g,toolDefinitions:EO,refreshToolDefinitions:Re,threads:P,activeThreadId:C,isThreadHistoryReady:W,startNewThread:CO,switchThread:Gp,deleteThread:kO}}var li=q(he(),1);var AV=6e3;function j_(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[l,s]=(0,li.useState)(null),u=(0,li.useCallback)((f,p,m)=>P_({file:f,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:p,onProgress:m}),[t,a,n,r]),c=(0,li.useCallback)(f=>{_p({documentId:f.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,li.useEffect)(()=>{if(!l)return;let f=setTimeout(()=>s(null),AV);return()=>clearTimeout(f)},[l]);let d=o?.enabled??!1;return{enabled:o?o.enabled:!!i,accept:o?.accept.join(","),maxFileSize:o?.maxBytes,maxPdfPages:o?.maxPdfPages,maxFiles:o?.maxFiles,upload:d?u:void 0,onDiscard:d?c:void 0,error:l,reportError:s}}var xa=q(he(),1);function Ul(e){return e.map(t=>({id:null,text:t}))}function si(e){let{flow:t,followup:a,page:n,channel:r}=e;return t!==null?{origin:"flow",suggestions:t}:a?.length?{origin:"followup",suggestions:a}:n?.length?{origin:"page",suggestions:n}:r?.length?{origin:"channel",suggestions:r}:null}function Fl(e){return typeof e=="object"&&e!==null}function V_(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function RV(e){if(!Fl(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!Fl(t)||!Fl(t._meta))return null;let a=t._meta[Pg];return!Fl(a)||!V_(a.suggestions)?null:a.suggestions}function W_(e){let t=null;for(let a of e.parts){let n=RV(a);n!==null&&(t=n)}return t}function G_(e){for(let t of e.parts){if(!Fl(t)||t.type!=="data-suggestions")continue;let a=t.data;if(Fl(a)&&V_(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function DV(e){return"page"in e||"channel"in e}function _V(e){return typeof e!="object"||e===null?{}:DV(e)?{rungs:e}:{initial:e.initial}}function $_(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=_V(n),l=(0,xa.useMemo)(()=>({page:null,channel:Ul(i??[])}),[i]),s=o??l,u=(0,xa.useMemo)(()=>r?si({flow:null,followup:null,...s}):null,[r,s]),c=(0,xa.useMemo)(()=>u?.suggestions.map(g=>g.text)??[],[u]),[d,f]=(0,xa.useState)(c),[p,m]=(0,xa.useState)(u?.origin??"channel"),x=(0,xa.useRef)(a),S=(0,xa.useCallback)(()=>{f([])},[]),w=t.length>0;(0,xa.useEffect)(()=>{w||(f(c),m(u?.origin??"channel"))},[c,u,w]);let y=t[t.length-1];return(0,xa.useEffect)(()=>{y?.role==="user"&&S()},[y,S]),(0,xa.useEffect)(()=>{let g=x.current;if(x.current=a,g!=="streaming"||a!=="ready"||!r)return;let b=[...t].reverse().find(R=>R.role==="assistant");if(!b)return;let T=W_(b),C=G_(b),A=si({flow:T===null?null:Ul(T),followup:C===null?null:Ul(C),page:null,channel:null});f(A?A.suggestions.map(R=>R.text):[]),m(A?.origin??"channel")},[a,r,t]),{suggestions:d,source:p,isLoading:!1,clear:S}}function X_(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return Ma(e,"/resource",n?{token:n}:void 0)}var OV={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"],glassTint:["--ww-glass-tint"],glassTintStrength:["--ww-glass-tint-opacity"]};function zl(e){let t={};for(let[a,n]of Object.entries(OV)){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 je=q(ae(),1),ql=(0,Fe.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,je.jsx)(Fo,{locale:n,messages:r,children:(0,je.jsx)(PV,{...t,ref:a})})}),PV=(0,Fe.forwardRef)(function(t,a){let{t:n,ready:r}=Te(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,documentUpload:u,welcomeMessage:c,welcome:d,placeholder:f=n.promptInput.placeholder,triggerEvent:p="triggerDemoRequest",api:m,mcp:x,debug:S=!1,readOnly:w=!1,title:y,headerActions:g,hideHeader:b=!1,enableThreadHistory:T=!1,showToolCalls:C=!0,initializing:A=!1,onScreen:R=!0,disclaimer:P}=t,L=o?.theme,W=o?.variables,H=o?.assistantBubble??!1,F=W?zl(W):{},[$,G]=(0,Fe.useState)(!1);(0,Fe.useEffect)(()=>{if(L!=="auto"||typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");G(M.matches);let U=()=>G(M.matches);return M.addEventListener("change",U),()=>M.removeEventListener("change",U)},[L]);let B=L==="dark"||L==="auto"&&$,D=H_({...t,api:m}),Q=xp(),be=W2({...t,api:m,sessionId:D.sessionId,onCallTool:x?.onCallTool}),I=x?.resourceEndpoint??X_(m,t.headers),qe=(0,Fe.useRef)({});qe.current={api:m,token:$d(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:D.sessionId};let lt=(0,Fe.useCallback)(M=>{Xd("widget",qe.current,{widget:M.widget,outcome:M.outcome},M.metrics)},[]),v=pl(f,!D.text),z=j_({api:m,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:D.sessionId,documentUpload:u,allowAttachments:s}),[J,we]=(0,Fe.useState)(null),[$e,Se]=(0,Fe.useState)(null),pe=(0,Fe.useRef)(null),ue=(0,Fe.useRef)(null),de=(0,Fe.useRef)(null),Z=(0,Fe.useRef)(null),[He,Xe]=(0,Fe.useState)(!0),Re=(0,Fe.useRef)(He);Re.current=He;let ye=(0,Fe.useCallback)(()=>{let M=pe.current;if(!M)return;let U=M.querySelector("textarea");U&&U.focus()},[]),Ce=(0,Fe.useCallback)((M="smooth")=>{let U=ue.current;U&&U.scrollTo({top:U.scrollHeight,behavior:M})},[]);(0,Fe.useEffect)(()=>{let M=Z.current,U=ue.current;if(!M||!U)return;let Y=new IntersectionObserver(([ne])=>Xe(ne.isIntersecting),{root:U,rootMargin:"0px 0px 200px 0px",threshold:0});return Y.observe(M),()=>Y.disconnect()},[]),(0,Fe.useEffect)(()=>{let M=ue.current;if(!M)return;let U=Y=>{let ke=(Y.target instanceof Element?Y.target:null)?.closest("a");ke?.href&&Q.emit({name:"link.clicked",properties:{url:ke.href}})};return M.addEventListener("click",U),()=>M.removeEventListener("click",U)},[Q]),(0,Fe.useEffect)(()=>{(D.messages[D.messages.length-1]?.role==="user"||Re.current)&&Ce("smooth")},[D.messages.length,D.messages[D.messages.length-1]]),(0,Fe.useEffect)(()=>{Ce("auto")},[Ce]),(0,Fe.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let M=ue.current,U=de.current;if(!M&&!U)return;let Y=M?.scrollHeight??0,ne=M?.clientHeight??0,ke=new ResizeObserver(()=>{let Ot=ue.current;if(!Ot)return;let ua=Ot.scrollTop+ne>=Y-5;Y=Ot.scrollHeight,ne=Ot.clientHeight,ua&&Ce("auto")});return M&&ke.observe(M),U&&ke.observe(U),()=>ke.disconnect()},[Ce]);let xe=$_({messages:D.messages,status:D.status,suggestions:t.suggestions}),Je=(0,Fe.useRef)(null);(0,Fe.useEffect)(()=>{let M=xe.suggestions;!R||M.length===0||Je.current===M||(Je.current=M,Q.emit({name:"suggestions.shown",properties:{texts:M,origin:xe.source}}))},[xe.suggestions,xe.source,Q,R]);let jt=d?.suggestions,aa=(0,Fe.useRef)(null);(0,Fe.useEffect)(()=>{!R||D.messages.length>0||!jt?.length||aa.current===jt||(aa.current=jt,Q.emit({name:"suggestions.shown",properties:{texts:jt,origin:"channel"}}))},[jt,D.messages.length,Q,R]);let sa=(0,Fe.useCallback)(M=>{let U=M.content.map(Y=>Y.text??"").join("").trim();U&&D.handleSubmit({text:U,files:[],modelContext:M.modelContext})},[D.handleSubmit]),Xa=(0,Fe.useCallback)(M=>{let U=xe.suggestions.indexOf(M),Y=U>=0?U:d?.suggestions?.indexOf(M)??-1,ne=U>=0?xe.source:"channel";Q.emit({name:"suggestion.clicked",properties:{text:M,index:Y,origin:ne}}),xe.clear(),D.handleSubmit({text:M,files:[]})},[xe.suggestions,xe.source,xe.clear,D.handleSubmit,d,Q]);(0,Fe.useImperativeHandle)(a,()=>({sendMessage:M=>{D.handleSubmit({text:M,files:[]}),ye()},sendMessageAndWait:M=>D.sendMessageAndWait(M),reset:D.reset,focus:ye,get messages(){return D.messages},get sessionId(){return D.sessionId}}),[D.handleSubmit,D.sendMessageAndWait,D.reset,D.messages,D.sessionId,ye]),(0,Fe.useEffect)(()=>{if(!p)return;let M=U=>{let Y=U.detail,ne=typeof Y?.message=="string"?Y.message:void 0;ne&&D.handleSubmit({text:ne,files:[]}),ye()};return window.addEventListener(p,M),()=>window.removeEventListener(p,M)},[p,D.handleSubmit,ye]);let di=!b&&!!(y||T||g),fi=A||!r;return(0,je.jsxs)("div",{ref:pe,style:{...F,maxHeight:"inherit",...J&&$e?{height:$e}:{},opacity:fi?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":H?"true":void 0,"data-color-scheme":L==="auto"?"auto":void 0,...fi?{"data-waniwani-initializing":""}:{},...B?{"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",L==="dark"&&"dark",i,l?.root),children:[di&&(0,je.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,je.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,je.jsx)("div",{className:"ww:flex-1"}),T&&(0,je.jsx)(H2,{threads:D.threads,activeThreadId:D.activeThreadId,onNewThread:D.startNewThread,onSelectThread:M=>{D.switchThread(M)},onDeleteThread:M=>{D.deleteThread(M)}}),g]}),(0,je.jsxs)("div",{ref:ue,className:V("ww:relative ww:flex-1 ww:min-h-0",J?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,je.jsxs)("div",{ref:de,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",J&&"ww:!py-0"),children:[(0,je.jsx)(O2,{value:lt,children:(0,je.jsx)(F2,{messages:D.messages,status:D.status,welcomeMessage:c,welcome:d,onSuggestionSelect:Xa,resourceEndpoint:I,chatSessionId:D.sessionId,isDark:B,onFollowUp:sa,onCallTool:be,fullscreenToolCallId:J,debug:S,showToolCalls:C,toolDefinitions:D.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(M,U)=>{if(M==="fullscreen"){let Y=pe.current?.getBoundingClientRect().height??0;Se(Y>0?Y:null),we(U.toolCallId)}else Se(null),we(null)}})}),(0,je.jsx)("div",{ref:Z,"aria-hidden":!0,style:{height:1}})]}),!He&&!J&&(0,je.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,je.jsx)(Pn,{type:"button",onClick:()=>Ce("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,je.jsx)(Qs,{className:"ww:size-4"})})})]}),!w&&(0,je.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:J?{display:"none"}:void 0,children:[(0,je.jsx)(cl,{suggestions:xe.suggestions,isLoading:xe.isLoading,onSelect:Xa}),(0,je.jsx)(Lk,{queuedMessages:D.queuedMessages,onRemove:D.removeQueuedMessage}),(0,je.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,je.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,je.jsxs)(dk,{onSubmit:D.handleSubmit,attachmentsEnabled:z.enabled,globalDrop:z.enabled,multiple:z.enabled,accept:z.accept,maxFileSize:z.maxFileSize,maxPdfPages:z.maxPdfPages,maxFiles:z.maxFiles,upload:z.upload,onDiscard:z.onDiscard,onError:z.reportError,className:V("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:[(0,je.jsx)(wk,{enabled:z.enabled}),z.enabled&&(0,je.jsx)(gk,{className:"ww:px-4 ww:pt-3"}),(0,je.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[z.enabled&&(0,je.jsx)(hk,{}),(0,je.jsx)(pk,{onChange:D.handleTextChange,value:D.text,placeholder:v,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,je.jsx)(mk,{status:D.status,disabled:D.queueFull,onStop:D.stop})]})]}),z.error&&(0,je.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:z.error.message}),(0,je.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,je.jsx)(z2,{}),(0,je.jsx)(yk,{text:P})]})]})})]})]})});var nc=q(he(),1);var K_="500px",NV="https://app.waniwani.ai/api/mcp/chat",BV={api:NV};function uv(){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 Fp(){let e=uv();if(!e)return{};let t=W=>e.getAttribute(W)??void 0,a=W=>{let H=e.getAttribute(W);if(H==null)return;let F=H.trim().toLowerCase();if(F==="true"||F==="1"||F==="")return!0;if(F==="false"||F==="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-webmcp");d&&(n.webmcp={enabled:d!=="false"&&d!=="off"});let f=t("data-channel-id");if(f&&(n.channelId=f),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let W=a("data-show-tool-calls");W!==void 0&&(n.showToolCalls=W)}let m=t("data-css");m&&(n.css=m);let x=t("data-suggestions");x&&(n.suggestions=x.split(",").map(W=>W.trim()).filter(Boolean));let S=a("data-enable-thread-history");S!==void 0&&(n.enableThreadHistory=S);let w=a("data-disable-page-view");w!==void 0&&(n.disablePageView=w);let y=a("data-hide-header");y!==void 0&&(n.hideHeader=y);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 C=t("data-mode");(C==="inline"||C==="floating"||C==="composer"||C==="off")&&(n.mode=C);let A=t("data-height");A&&(n.height=A);let R=t("data-launcher-text");R&&(n.launcherText=R);let P=t("data-appear-delay");if(P!==void 0){let W=Number.parseInt(P.trim(),10);Number.isFinite(W)&&W>=0&&(n.appearDelay=W)}let L=t("data-disclaimer");if(L!==void 0){let W=L.trim(),H=W.toLowerCase();H==="false"||H==="0"?n.disclaimer=!1:W&&(n.disclaimer=W)}return n}function sv(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function ec(e,t,a){let n=a??Fp(),r=UV(t,n,e),o={token:"",...BV,...sv(t),...sv(n),...sv(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 UV(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 tO=q(he(),1);var zp=q(he(),1);function FV(e){return e?.patterns??e?.rules??[]}var Y_="\0\0";function zV(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,Y_).replace(/\\\*/g,"[^/]*").split(Y_).join(".*");return new RegExp(`^${a}$`)}function Z_(e,t){try{return zV(e).test(t)}catch{return!1}}function tc(e,t){if(!e)return!0;let a=!1;for(let n of FV(e))if(Z_(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function Q_(e,t){for(let a of e?.appearRules??[])if(Z_(a.glob,t))return a.appearAfter;return null}var cv="waniwani:locationchange",J_=!1;function qV(){if(!(J_||typeof history>"u")){J_=!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(cv)),r}}}}function HV(e){return qV(),window.addEventListener(cv,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(cv,e),window.removeEventListener("popstate",e)}}function jV(){return window.location.pathname}function VV(){return"/"}function ac(){return(0,zp.useSyncExternalStore)(HV,jV,VV)}function Hl(e,t){let a=ac(),n=t&&tc(e,a);return(0,zp.useEffect)(()=>{ma("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var WV=3,GV=["low","medium","high"];function dv(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function $V(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 GV){let i=dv(t.get(o)??[])??dv(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(WV,e.length);){let o=dv(r);if(!o)break;n.push(o)}return n}function eO(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function aO(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 jl(e){let{pageSuggestions:t,suggestions:a}=e,n=ac();return(0,tO.useMemo)(()=>{let r=eO(n),o=t?.find(l=>eO(l.url)===r),i=o?$V(o.prompts).map(({id:l,text:s})=>({id:l,text:s})):null;return ma("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:Ul(a??[])}},[n,t,a])}var XV="waniwani:config:";function nO(e,t,a){return`${XV}${e}|${t}|${a??""}`}function po(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(nO(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function KV(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(nO(e,t,a),JSON.stringify(n))}catch{}}var YV=600;function ZV(e){if(typeof e!="object"||e===null||typeof e.enabled!="boolean")return null;let t=Array.isArray(e.accept)?e.accept.filter(n=>typeof n=="string"):[],a=n=>typeof n=="number"&&Number.isFinite(n)&&n>0;return e.enabled?a(e.maxBytes)&&a(e.maxPdfPages)&&a(e.maxFiles)&&t.length>0?{enabled:!0,maxBytes:e.maxBytes,maxPdfPages:e.maxPdfPages,maxFiles:e.maxFiles,accept:t}:null:{enabled:!1,maxBytes:0,maxPdfPages:0,maxFiles:0,accept:t}}async function QV(e,t,a,n){No("configStart");let r=await JV(e,t,a,n);return No("configEnd"),a?.aborted||Wg(r.metadata),r}async function JV(e,t,a,n){try{let r=Ma(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?e7(l):{}}catch{return{}}}function e7(e){let t={};e.source!=null&&(t.source=e.source),e.channelId!=null&&(t.channelId=e.channelId),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=aO(e.pageSuggestions);a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),typeof e.webmcp?.enabled=="boolean"&&(t.webmcp={enabled:e.webmcp.enabled}),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);let n=ZV(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function Vl(e,t,a){let[n,r]=(0,nc.useState)(e),[o,i]=(0,nc.useState)(!1);return(0,nc.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||_C({api:l,token:s,channelId:u??m.channelId,mode:e.mode==="off"?void 0:e.mode,source:m.source})},d=po(l,s,u);if(d)try{let m=ec(t,d,a);r(m),Kd("cache"),Wg(d.metadata),i(!0),ma("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d)}catch{}let f=new AbortController,p=setTimeout(()=>{Kd("timeout"),i(!0)},YV);return QV(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ma("remote /config response",m),Object.keys(m).length>0){KV(l,s,u,m);try{let x=ec(t,m,a);r(x),ma("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}Kd("remote"),i(!0),c(m)}}).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 ta=q(ae(),1),oO=(0,Ge.forwardRef)(function(t,a){return(0,ta.jsx)(Fo,{locale:t.config.locale,children:(0,ta.jsx)(t7,{...t,ref:a})})}),t7=(0,Ge.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:l}=Te(),{config:s,ready:u}=Vl(t,a,n),c=Hl(s.visibility,u);(0,Ge.useEffect)(()=>{o?.(c)},[c,o]),Ml({api:s.api,token:s.token,channelId:s.channelId,mode:"composer",paintMark:"chatVisible",painted:u});let d=(0,Ge.useRef)(null),f=(0,Ge.useMemo)(()=>Dl({mode:"composer",getSessionId:()=>d.current?.sessionId}),[]),p=s.onEvent;(0,Ge.useEffect)(()=>{if(p)return f.subscribe(p)},[p,f]);let m=(0,Ge.useRef)(null),[x,S]=(0,Ge.useState)(!1),[w,y]=(0,Ge.useState)(""),[g,b]=(0,Ge.useState)(0),T=s.appearance?.theme,C=s.appearance?.variables,A=(0,Ge.useMemo)(()=>C?zl(C):{},[C]),R=jl(s),P=(0,Ge.useMemo)(()=>si({flow:null,followup:null,...R}),[R]),L=(0,Ge.useMemo)(()=>P?.suggestions.map(z=>z.text)??[],[P]);dl({widgetEvents:f,api:s.api,token:s.token,channelId:s.channelId,source:s.source,mode:"composer",pagePrompts:R.page,getSessionId:()=>d.current?.sessionId});let W=(0,Ge.useRef)(null);(0,Ge.useEffect)(()=>{!c||!P||W.current!==P&&(W.current=P,f.emit({name:"suggestions.shown",properties:{texts:L,origin:P.origin}}))},[c,P,L,f]);let H=s.launcherText??s.placeholder??l.launcher.prompt,F=pl(H,w.length===0),$="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ge.useEffect)(()=>{let z=m.current;if(z){if(!w){z.style.height="";return}z.style.height="auto",z.style.height=`${z.scrollHeight}px`}},[w]),(0,Ge.useEffect)(()=>{g>0&&x&&d.current?.focus()},[g,x]);let G=(0,Ge.useRef)(!1);(0,Ge.useEffect)(()=>{u&&!G.current&&(G.current=!0,f.emit({name:"chat.ready"}))},[u,f]);let B=(0,Ge.useRef)(!1);(0,Ge.useEffect)(()=>{let z=c&&x;z!==B.current&&(B.current=z,f.emit({name:z?"chat.opened":"chat.closed"}))},[c,x,f]);let D=(0,Ge.useCallback)(z=>{S(!0),b(we=>we+1);let J=z.trim();J&&d.current?.sendMessage(J)},[]);(0,Ge.useImperativeHandle)(i,()=>({open:()=>S(!0),close:()=>S(!1),toggle:()=>S(z=>!z),sendMessage:z=>D(z),sendMessageAndWait:async z=>{S(!0);let J=d.current;if(J)return await J.sendMessageAndWait(z)},reset:()=>d.current?.reset(),focus:()=>{x?b(z=>z+1):m.current?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[D,x]);let Q=(0,Ge.useCallback)(()=>{w.trim()&&(D(w),y(""))},[w,D]),be=(0,Ge.useCallback)(()=>{(d.current?.messages.length??0)>0&&(S(!0),b(z=>z+1))},[]),I={mode:"composer"};s.mcpServerUrl&&(I.mcpServerUrl=s.mcpServerUrl),s.channelId&&(I.channelId=s.channelId);let qe=(0,ta.jsx)("button",{type:"button",onClick:()=>S(!1),"aria-label":l.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,ta.jsx)(Bo,{className:"ww:size-4"})}),lt=(0,ta.jsxs)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,"data-waniwani-composer":"input",inert:x,className:V("ww:w-full ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:A,children:[(0,ta.jsx)(ef,{animated:u,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:$},children:(0,ta.jsxs)("div",{className:"ww:flex ww:items-end 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,ta.jsx)("textarea",{ref:m,rows:1,value:w,placeholder:F,onChange:z=>y(z.target.value),onFocus:be,onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),Q())},className:"ww:min-w-0 ww:flex-1 ww:resize-none ww:bg-transparent ww:py-1.5 ww:max-h-36 ww:text-base ww:sm:text-sm ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground"}),(0,ta.jsx)("button",{type:"button",onClick:Q,disabled:!w.trim(),"aria-label":l.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,ta.jsx)(ur,{className:"ww:size-4"})})]})}),L.length>0&&(0,ta.jsx)(cl,{suggestions:L,onSelect:z=>{f.emit({name:"suggestion.clicked",properties:{text:z,index:L.indexOf(z),origin:P?.origin??"channel"}}),D(z)},className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),v=(0,ta.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:A,children:(0,ta.jsx)("div",{role:"dialog","aria-label":s.title??H,"data-waniwani-floating":"panel","data-state":c&&x?"shown":"hidden",style:{boxShadow:$},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,ta.jsx)(ql,{ref:d,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:I,appearance:s.appearance,title:s.title,headerActions:qe,hideHeader:!1,onScreen:x,welcomeMessage:s.welcomeMessage,placeholder:s.placeholder,suggestions:R,enableThreadHistory:s.enableThreadHistory,documentUpload:s.documentUpload,showToolCalls:s.showToolCalls,locale:s.locale,initializing:!u})})});return(0,ta.jsxs)(_l,{value:f,children:[lt,(0,rO.createPortal)(v,r)]})});var fv="/*! 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-black:#000;--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-md:12px;--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\\: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-0{bottom:calc(var(--ww-spacing)*0)}.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-\\[2147483000\\]{z-index:2147483000}.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\\:block{display:block}.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-10{width:calc(var(--ww-spacing)*10);height:calc(var(--ww-spacing)*10)}.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-0\\.5{height:calc(var(--ww-spacing)*.5)}.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-36{max-height:calc(var(--ww-spacing)*36)}.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-60{width:calc(var(--ww-spacing)*60)}.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-72{max-width:calc(var(--ww-spacing)*72)}.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-default{cursor:default}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:list-none{list-style-type: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\\:justify-end{justify-content:flex-end}.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-2\\.5{gap:calc(var(--ww-spacing)*2.5)}.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-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-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-2{border-style:var(--tw-border-style);border-width:2px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.ww\\:border-none{--tw-border-style:none;border-style:none}.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-primary{border-color:var(--ww-color-primary,#6366f1)}.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-background\\/85{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/85{background-color:color-mix(in oklab,var(--ww-color-background,#fff)85%,transparent)}}.ww\\:bg-black\\/45{background-color:var(--ww-color-black)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-black\\/45{background-color:color-mix(in oklab,var(--ww-color-black)45%,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-contain{object-fit:contain}.ww\\:object-cover{object-fit:cover}.ww\\:object-center{object-position:center}.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-2\\.5{padding:calc(var(--ww-spacing)*2.5)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-0\\.5{padding-inline:calc(var(--ww-spacing)*.5)}.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-1\\.5{padding-top:calc(var(--ww-spacing)*1.5)}.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-0{padding-bottom:calc(var(--ww-spacing)*0)}.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\\: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\\:underline{text-decoration-line:underline}.ww\\:underline-offset-2{text-underline-offset:2px}.ww\\:opacity-0{opacity:0}.ww\\:opacity-60{opacity:.6}.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-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);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\\: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\\:backdrop-blur-md{--tw-backdrop-blur:blur(var(--ww-blur-md));-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-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-\\[width\\]{transition-property: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-border:hover{background-color:var(--ww-color-border,#e5e7eb)}.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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#eceef499)}}[data-waniwani-chat]{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}[data-waniwani-chat][data-color-scheme=auto]{--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}}";function a7(e){return e.startsWith("__WANIWANI")}function qp(e){if(!fv||a7(fv))return;let t=document.createElement("style");t.textContent=fv,e.appendChild(t)}var Me=q(he(),1);var Hp=q(he(),1),n7=3e3,r7=120,o7=24;function iO(e){let[t,a]=(0,Hp.useState)(!1);return(0,Hp.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 -${o7}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,r7)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},n7),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var gt=q(ae(),1),i7=2e3,l7=90,s7=1e3,lO=(0,Me.forwardRef)(function(t,a){return(0,gt.jsx)(Fo,{locale:t.config.locale,children:(0,gt.jsx)(u7,{...t,ref:a})})}),u7=(0,Me.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Te(),{config:i,ready:l}=Vl(t,a,n),s=Hl(i.visibility,l),u=ac(),c=s?Q_(i.visibility,u):null,d=iO(c),f=(0,Me.useRef)(null),p=(0,Me.useMemo)(()=>Dl({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),S=(0,Me.useRef)(null),w=(0,Me.useRef)(!1),[y,g]=(0,Me.useState)("input"),[b,T]=(0,Me.useState)(""),[C,A]=(0,Me.useState)(!1),[R,P]=(0,Me.useState)(!1),[L,W]=(0,Me.useState)(0),H=i.appearance?.theme,F=i.appearance?.variables,$=(0,Me.useMemo)(()=>F?zl(F):{},[F]),G=jl(i),B=(0,Me.useMemo)(()=>si({flow:null,followup:null,...G}),[G]),D=(0,Me.useMemo)(()=>B?.suggestions.map(Z=>Z.text)??[],[B]);dl({widgetEvents:p,api:i.api,token:i.token,channelId:i.channelId,source:i.source,mode:"floating",pagePrompts:G.page,getSessionId:()=>f.current?.sessionId});let Q=(0,Me.useRef)(null);(0,Me.useEffect)(()=>{!R||!B||Q.current!==B&&(Q.current=B,p.emit({name:"suggestions.shown",properties:{texts:D,origin:B.origin}}))},[R,B,D,p]);let be=i.launcherText??i.placeholder??o.launcher.prompt,I=pl(be,b.length===0),qe="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Me.useEffect)(()=>{if(!s){A(!1);return}if(c){A(d);return}let Z=i.appearDelay??i7,He=setTimeout(()=>A(!0),Math.max(0,Z));return()=>clearTimeout(He)},[s,i.appearDelay,c,d]),(0,Me.useEffect)(()=>{if(!C||D.length===0)return;let Z=setTimeout(()=>{w.current||g(He=>He==="input"?"expanded":He)},s7);return()=>clearTimeout(Z)},[C,D.length]),(0,Me.useEffect)(()=>{L>0&&y==="open"&&f.current?.focus()},[L,y]);let lt=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{l&&!lt.current&&(lt.current=!0,p.emit({name:"chat.ready"}))},[l,p]),Ml({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:l&&s});let v=(0,Me.useRef)(!1);(0,Me.useEffect)(()=>{let Z=s&&y==="open";Z!==v.current&&(v.current=Z,p.emit({name:Z?"chat.opened":"chat.closed"}))},[s,y,p]);let z=(0,Me.useCallback)(()=>{g("open")},[]),J=(0,Me.useCallback)(()=>{w.current=!0,g("input")},[]);(0,Me.useEffect)(()=>{if(y!=="expanded"){P(!1);return}let Z=setTimeout(()=>P(!0),l7);return()=>clearTimeout(Z)},[y]);let we=(0,Me.useCallback)(Z=>{z();let He=Z.trim();He&&f.current?.sendMessage(He)},[z]);(0,Me.useImperativeHandle)(r,()=>({open:()=>z(),close:()=>J(),toggle:()=>{g(Z=>Z==="open"?"input":"open")},sendMessage:Z=>we(Z),sendMessageAndWait:async Z=>{z();let He=f.current;if(He)return await He.sendMessageAndWait(Z)},reset:()=>f.current?.reset(),focus:()=>{z(),W(Z=>Z+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[we,z,J]);let $e=(0,Me.useCallback)(()=>{b.trim()&&(we(b),T(""))},[b,we]),Se=(0,Me.useCallback)(()=>{(f.current?.messages.length??0)>0?(g("open"),W(Z=>Z+1)):(w.current=!1,g(Z=>Z==="input"?"expanded":Z))},[]),pe={mode:"floating"};i.mcpServerUrl&&(pe.mcpServerUrl=i.mcpServerUrl),i.channelId&&(pe.channelId=i.channelId);let ue=D.length>0&&y!=="input",de=(0,gt.jsx)("button",{type:"button",onClick:J,"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,gt.jsx)(Bo,{className:"ww:size-4"})});return(0,gt.jsx)(_l,{value:p,children:(0,gt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":H==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",H==="dark"&&"dark"),style:$,children:s&&(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("div",{ref:S,"data-waniwani-floating":"dock","data-state":y==="open"?"hidden":"shown","data-appeared":C?"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",ue?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,gt.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",ue?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:ue?{boxShadow:qe,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[ue&&y!=="open"&&(0,gt.jsx)("button",{type:"button",onClick:J,"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,gt.jsx)(On,{className:"ww:size-4"})}),D.length>0&&(0,gt.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,gt.jsx)("div",{className:"ww:overflow-hidden",children:(0,gt.jsx)(cl,{suggestions:D,onSelect:Z=>{p.emit({name:"suggestion.clicked",properties:{text:Z,index:D.indexOf(Z),origin:B?.origin??"channel"}}),we(Z)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,gt.jsx)(ef,{animated:C,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:qe},children:(0,gt.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,gt.jsx)("input",{ref:x,type:"text",value:b,placeholder:I,onChange:Z=>T(Z.target.value),onFocus:Se,onKeyDown:Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),$e())},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,gt.jsx)("button",{type:"button",onClick:$e,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,gt.jsx)(ur,{className:"ww:size-4"})})]})})]})}),(0,gt.jsx)("div",{role:"dialog","aria-label":i.title??be,"data-waniwani-floating":"panel","data-state":y==="open"?"shown":"hidden",style:{boxShadow:qe},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,gt.jsx)(ql,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:pe,appearance:i.appearance,title:i.title,headerActions:de,hideHeader:!1,onScreen:y==="open",welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:G,enableThreadHistory:i.enableThreadHistory,documentUpload:i.documentUpload,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var _a=q(he(),1);var pv=q(ae(),1),sO=(0,_a.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Vl(t,a,n),u=(0,_a.useRef)(null),c=(0,_a.useMemo)(()=>Dl({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,_a.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,_a.useRef)(!1);(0,_a.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,_a.useEffect)(()=>{r?.()},[]);let p=Hl(l.visibility,s);(0,_a.useEffect)(()=>{o?.(p)},[p,o]),Ml({api:l.api,token:l.token,channelId:l.channelId,mode:"inline",paintMark:"chatVisible",painted:s}),(0,_a.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=jl(l);dl({widgetEvents:c,api:l.api,token:l.token,channelId:l.channelId,source:l.source,mode:"inline",pagePrompts:m.page,getSessionId:()=>u.current?.sessionId});let x={mode:"inline"};return l.mcpServerUrl&&(x.mcpServerUrl=l.mcpServerUrl),l.channelId&&(x.channelId=l.channelId),(0,pv.jsx)(_l,{value:c,children:(0,pv.jsx)(ql,{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:m,enableThreadHistory:l.enableThreadHistory,documentUpload:l.documentUpload,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var rc=q(he(),1),hO=q(Og(),1);function uO(){if(typeof document>"u"&&typeof navigator>"u")return null;let e=(typeof document<"u"?document.modelContext:void 0)??(typeof navigator<"u"?navigator.modelContext:void 0);return e&&typeof e.registerTool=="function"?e:null}function mv(){return uO()!==null}function c7(){return{url:location.href,title:document.title}}async function hv(e){let{endpoint:t,headers:a,sessionId:n,visitorId:r,channelId:o,onWidget:i}=e,l=e.logger??console,s=uO();if(!s)return null;let u=new AbortController,c=()=>u.abort();window.addEventListener("pagehide",c);let d=!1,f=()=>{d||(d=!0,window.removeEventListener("pagehide",c),u.abort())};function p(){return{sessionId:n,visitorId:r,channelId:o,page:c7()}}async function m(w,y){let g=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...a},body:JSON.stringify(w),...y?{signal:y}:{}});if(!g.ok)throw new Error(`webmcp ${w.action} failed: ${g.status}`);return await g.json()}let x=[];try{x=(await m({...p(),action:"list"}))?.tools??[]}catch(w){return l.error("[webmcp] could not list site tools",w),f(),null}let S=[];return await Promise.all(x.map(async w=>{try{await s.registerTool({name:w.name,description:w.description??"",...w.inputSchema?{inputSchema:w.inputSchema}:{},...w.annotations?{annotations:w.annotations}:{},execute:async(y,g)=>{let b=await m({...p(),action:"call",name:w.name,arguments:y??{}},g?.signal);return b?.widget&&i?.(b.widget),{content:b?.content??[]}}},{signal:u.signal}),S.push(w)}catch(y){l.error(`[webmcp] could not register ${w.name}`,y)}})),l.info(`[webmcp] registered ${S.length} site tool(s)`),{get tools(){return S},dispose:f}}function cO(e,t,a){if(e.webmcp?.enabled===!1||t===!1)return null;let n=e.api??"";if(!e.token)return null;let r=e.mcpServerUrl?{mcpServerUrl:e.mcpServerUrl}:void 0;return{toolsEndpoint:Ma(n,"/webmcp",r),...(e.channelId??a)&&{channelId:e.channelId??a},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:Ma(n,"/resource",{token:e.token,...r})}}var mo=q(he(),1);var Wl=q(ae(),1),dO=672,fO=32;function pO({widget:e,toolsEndpoint:t,resourceEndpoint:a,headers:n,onClose:r,isDark:o=!1}){let[i,l]=(0,mo.useState)(null);(0,mo.useEffect)(()=>{let f=()=>l({width:window.innerWidth,height:window.innerHeight});return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);let s=e?.preview===!0;(0,mo.useEffect)(()=>{if(!e||!s)return;let f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,s,r]),(0,mo.useEffect)(()=>{if(!e)return;let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[e]);let u=(0,mo.useCallback)(async f=>{let p=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...f})});if(!p.ok)throw new Error(`webmcp tool call failed: ${p.status}`);return await p.json()},[t,n]);if(!e)return null;let c=i?Math.min(dO,i.width-fO):dO,d=i?i.height-fO:void 0;return(0,Wl.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Waniwani",className:V("ww:fixed ww:inset-0 ww:z-[2147483000] ww:flex ww:items-center ww:justify-center ww:bg-black/45 ww:backdrop-blur-md",o&&"dark"),children:[s&&(0,Wl.jsx)("button",{type:"button","aria-label":"Close",onClick:r,className:"ww:absolute ww:inset-0 ww:h-full ww:w-full ww:cursor-pointer ww:border-none ww:bg-transparent ww:p-0"}),(0,Wl.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:c,maxHeight:d},children:(0,Wl.jsx)(gp,{resourceUri:e.viewUri,resourceEndpoint:a,toolInput:e.data,toolResult:e.result,autoHeight:Hu(e.result._meta),isDark:o,onCallTool:u,onOpenLink:f=>window.open(f,"_blank","noopener")},`${a}|${e.viewUri}`)})]})}var gv=q(ae(),1),mO="waniwani:webmcp:session";function d7(){try{let e=sessionStorage.getItem(mO);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(mO,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function f7(e){let t=e.token?po(e.api??"",e.token,e.channelId):null,a=cO(e,t?.webmcp?.enabled,t?.channelId);return a||ma("[webmcp] not publishing site tools: switched off, or no token"),a}function p7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function m7({toolsEndpoint:e,resourceEndpoint:t,headers:a,channelId:n,onBridge:r}){let[o,i]=rc.default.useState(null),[l,s]=rc.default.useState(p7);return rc.default.useEffect(()=>{let u=!1,c=null;return hv({endpoint:e,headers:a,channelId:n,sessionId:d7(),visitorId:ea(),onWidget:d=>i(d)}).then(d=>{if(c=d,u){d?.dispose();return}r(d)}),()=>{u=!0,c?.dispose()}},[e,a,n,r]),rc.default.useEffect(()=>{let u;try{u=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let c=()=>s(u.matches);return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),(0,gv.jsx)(pO,{widget:o,toolsEndpoint:e,resourceEndpoint:t,isDark:l,onClose:()=>i(null)})}function gO(e){if(!mv())return null;let t=f7(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),document.body.appendChild(a);let n=a.attachShadow({mode:"open"});qp(n);let r=document.createElement("div");n.appendChild(r);let o=null,i=hO.default.createRoot(r);return i.render((0,gv.jsx)(m7,{toolsEndpoint:t.toolsEndpoint,resourceEndpoint:t.resourceEndpoint,headers:t.headers,channelId:t.channelId,onBridge:l=>{o=l}})),{getTools:()=>(o?.tools??[]).map(l=>l.name),destroy:()=>{o?.dispose(),i.unmount(),a.remove()}}}var xt=null,mn=null,Lt=null,ui=null,jp=null,h7="waniwani-chat-sizing",g7="waniwani-chat-defaults",w7="waniwani-chat-chrome",y7="waniwani-chat-auto-card",x7=`:where([data-waniwani-embed]){height:${K_}}`,v7=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",b7=":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)}",S7=":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))}",I7="waniwani-chat-composer-auto",C7=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:40rem;margin-inline:auto}";function oc(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 xO(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 Vp(e,t){qp(e);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 wO="data-waniwani-embed",ic="data-waniwani-auto";function vO(e){let t=document.querySelector(`[${wO}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(wO,""),a.setAttribute(ic,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function k7(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function T7(e,t,a,n){let r=vO(n);oc(h7,x7),e.height&&r instanceof HTMLElement&&(r.style.height=k7(e.height)),e.appearance?.theme&&oc(g7,v7),oc(w7,b7),r.hasAttribute(ic)&&oc(y7,S7),xO(r,e),Lt=document.createElement("div"),Lt.id="waniwani-chat-embed",Lt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Lt);let o=Lt,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(),jp=new ResizeObserver(i),jp.observe(r);let l=Lt.attachShadow({mode:"open"});Vp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=ci.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=po(e.api??"",e.token,e.channelId);d?.visibility&&!tc(d.visibility,window.location.pathname)&&c(!1)}return mn=Wp.default.createRoot(s),mn.render(ci.default.createElement(sO,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{jp?.disconnect(),jp=null,mn?.unmount(),mn=null,Lt?.remove(),Lt=null,r.hasAttribute(ic)&&r.remove(),xt=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 L7(e,t,a){Lt=document.createElement("div"),Lt.id="waniwani-chat-embed",Lt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Lt);let n=Lt.attachShadow({mode:"open"});Vp(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=ci.default.createRef();return mn=Wp.default.createRoot(r),mn.render(ci.default.createElement(lO,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{mn?.unmount(),mn=null,Lt?.remove(),Lt=null,xt=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 E7(){return{destroy:()=>{xt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function M7(e,t,a,n){let r=vO(n);r.hasAttribute(ic)&&oc(I7,C7),xO(r,e),Lt=document.createElement("div"),Lt.id="waniwani-chat-embed",Lt.style.cssText="display:block;width:100%;",r.appendChild(Lt);let o=Lt.attachShadow({mode:"open"});Vp(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),ui=document.createElement("div"),ui.id="waniwani-chat-panel",ui.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(ui);let l=ui.attachShadow({mode:"open"});Vp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=ci.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=po(e.api??"",e.token,e.channelId);d?.visibility&&!tc(d.visibility,window.location.pathname)&&c(!1)}return mn=Wp.default.createRoot(i),mn.render(ci.default.createElement(oO,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:s,onVisibilityChange:c})),{destroy:()=>{mn?.unmount(),mn=null,Lt?.remove(),Lt=null,ui?.remove(),ui=null,r.hasAttribute(ic)&&r.remove(),xt=null},open:()=>u.current?.open(),close:()=>u.current?.close(),toggle:()=>u.current?.toggle(),sendMessage:d=>u.current?.sendMessage(d),sendMessageAndWait:async d=>{if(u.current)return u.current.sendMessageAndWait(d)},reset:()=>u.current?.reset(),focus:()=>u.current?.focus(),getMessages:()=>u.current?.getMessages()??[],getSessionId:()=>u.current?.getSessionId()}}function bO(e){if(xt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),xt;let t=uv(),a=Fp(),n=ec(e,void 0,a);Xs(n.visitorId);let r;n.mode==="off"?r=E7():n.mode==="floating"?r=L7(n,e,a):n.mode==="composer"?r=M7(n,e,a,t):r=T7(n,e,a,t);let o=n.api??"",i=n.token?OC({api:o,token:n.token,channelId:()=>n.channelId??po(o,n.token,n.channelId)?.channelId,getSource:()=>po(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):Yd("no public token configured (set data-token or pass token to init())"),l=null;try{l=gO(n)}catch(s){console.error("[Waniwani] WebMCP setup failed",s)}return xt={...r,track:i.track,identify:(s,u)=>i.identify(s,u),setVisitorId:s=>il(s),getVisitorId:()=>ea(),destroy:()=>{i.shutdown(),l?.destroy(),r.destroy()}},xt}function A7(){xt&&xt.destroy()}var SO=Yd("chat widget is not initialized (call WaniWani.chat.init() first)"),Gl=()=>xt?xt.track:SO.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:bO,destroy:A7,open:()=>xt?.open(),close:()=>xt?.close(),toggle:()=>xt?.toggle(),sendMessage:e=>xt?.sendMessage(e),sendMessageAndWait:async e=>{if(xt)return xt.sendMessageAndWait(e)},reset:()=>xt?.reset(),focus:()=>xt?.focus(),getMessages:()=>xt?.getMessages()??[],getSessionId:()=>xt?.getSessionId(),track:Object.assign(e=>Gl()(e),{priceShown:e=>Gl().priceShown(e),pricesCompared:e=>Gl().pricesCompared(e),optionSelected:e=>Gl().optionSelected(e),leadQualified:e=>Gl().leadQualified(e),converted:e=>Gl().converted(e)}),identify:(e,t)=>xt?xt.identify(e,t):SO.identify(e,t),setVisitorId:e=>il(e),getVisitorId:()=>ea()};function yO(){if(Fp().token)try{bO()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",yO):yO();})();
|
|
137
|
+
`)}})}};var tv=Tp(()=>$u(h.union([h.strictObject({type:h.literal("text-start"),id:h.string(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("text-delta"),id:h.string(),delta:h.string(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("text-end"),id:h.string(),providerMetadata:te.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:te.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:te.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:te.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:te.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:te.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:te.optional()}),h.strictObject({type:h.literal("reasoning-delta"),id:h.string(),delta:h.string(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("reasoning-end"),id:h.string(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:te.optional()}),h.strictObject({type:h.literal("file"),url:h.string(),mediaType:h.string(),providerMetadata:te.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 fV(e){return e.type.startsWith("data-")}function ev(e){return e.type.startsWith("tool-")}function pV(e){return e.type==="dynamic-tool"}function Ap(e){return ev(e)||pV(e)}function g_(e){return e.type.split("-").slice(1).join("-")}function mV({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function hV({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(Ap).find(C=>C.toolCallId===g);if(T==null)throw new Pl({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return T}function S(g){var b;let T=u.message.parts.find(R=>ev(R)&&R.toolCallId===g.toolCallId),C=g,M=T;if(T!=null){T.state=g.state,M.input=C.input,M.output=C.output,M.errorText=C.errorText,M.rawInput=C.rawInput,M.preliminary=C.preliminary,g.title!==void 0&&(M.title=g.title),M.providerExecuted=(b=C.providerExecuted)!=null?b:T.providerExecuted;let R=C.providerMetadata;if(R!=null)if(g.state==="output-available"||g.state==="output-error"){let P=T;P.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:C.input,output:C.output,rawInput:C.rawInput,errorText:C.errorText,providerExecuted:C.providerExecuted,preliminary:C.preliminary,...C.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:C.providerMetadata}:{},...C.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:C.providerMetadata}:{}})}function w(g){var b,T;let C=u.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===g.toolCallId),M=g,R=C;if(C!=null){C.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:C.providerExecuted;let P=M.providerMetadata;if(P!=null)if(g.state==="output-available"||g.state==="output-error"){let L=C;L.resultProviderMetadata=P}else C.callProviderMetadata=P}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 y(g){if(g!=null){let b=u.message.metadata!=null?L_(u.message.metadata,g):g;t!=null&&await Mp({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 Pl({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 Pl({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 Pl({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 Pl({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(ev);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:g.length,dynamic:l.dynamic,title:l.title},l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):S({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 Pl({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 Ku(g.text);g.dynamic?w({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}):S({toolCallId:l.toolCallId,toolName:g.toolName,state:"input-streaming",input:b,title:g.title}),c();break}case"tool-input-available":{l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):S({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(Ap).find(T=>T.toolCallId===l.toolCallId);(g!=null?g.type==="dynamic-tool":!!l.dynamic)?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):S({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"?w({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}):S({toolCallId:l.toolCallId,toolName:g_(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"?w({toolCallId:l.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:g.title}):S({toolCallId:l.toolCallId,toolName:g_(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 y(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(fV(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),C=T>=0?T:u.message.parts.length;await Mp({value:l.data,schema:a[l.type],context:{field:`message.parts[${C}].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 gV({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 ese=vr({prefix:"aitxt",size:24});var nse=Tp(()=>$u(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:te.optional()}),h.object({type:h.literal("reasoning"),text:h.string(),state:h.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),h.object({type:h.literal("source-url"),sourceId:h.string(),url:h.string(),title:h.string().optional(),providerMetadata:te.optional()}),h.object({type:h.literal("source-document"),sourceId:h.string(),mediaType:h.string(),title:h.string(),filename:h.string().optional(),providerMetadata:te.optional()}),h.object({type:h.literal("file"),mediaType:h.string(),filename:h.string().optional(),url:h.string(),providerMetadata:te.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:te.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:te.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:te.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:te.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:te.optional(),resultProviderMetadata:te.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:te.optional(),resultProviderMetadata:te.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:te.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:te.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:te.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:te.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:te.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:te.optional(),resultProviderMetadata:te.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:te.optional(),resultProviderMetadata:te.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:te.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 ose=vr({prefix:"aiobj",size:24});function E_(e){return({url:t,abortSignal:a})=>X8({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var wV=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 lse=vr({prefix:"aiobj",size:24});var sse=E_();var yV="AI_NoSuchProviderError",xV=`vercel.ai.error.${yV}`,vV=Symbol.for(xV),bV;bV=vV;var use=E_();async function SV(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 IV=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 qn(this.body),s=await qn(this.headers),u=await qn(this.credentials),c={...uo(s),...uo(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?uo(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,w=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(!w.ok)throw new Error((i=await w.text())!=null?i:"Failed to fetch the chat response.");if(!w.body)throw new Error("The response body is empty.");return this.processResponseStream(w.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await qn(this.body),l=await qn(this.headers),s=await qn(this.credentials),u={...uo(l),...uo(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?uo(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)}},av=class extends IV{constructor(e={}){super(e)}processResponseStream(e){return h_({stream:e,schema:tv}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},M_=class{constructor({generateId:e=u_,id:t=e(),transport:a=new av,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new wV,this.sendMessage=async(d,f)=>{var p,m,x,S;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let w;if("text"in d||"files"in d?w={parts:[...Array.isArray(d.files)?d.files:await SV(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:w=d,d.messageId!=null){let y=this.state.messages.findIndex(g=>g.id===d.messageId);if(y===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[y].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,y+1),this.state.replaceMessage(y,{...w,id:d.messageId,role:(m=w.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...w,id:(x=w.id)!=null?x:this.generateId(),role:(S=w.role)!=null?S:"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,S=x[x.length-1],w=y=>Ap(y)&&y.state==="approval-requested"&&y.approval.id===d?{...y,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:y;this.state.replaceMessage(x.length-1,{...S,parts:S.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(y=>{var g;y&&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 S=this.state.messages,w=S[S.length-1],y=g=>Ap(g)&&g.toolCallId===f?{...g,state:d,output:p,errorText:m}:g;this.state.replaceMessage(S.length-1,{...w,parts:w.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(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:mV({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=S=>this.jobExecutor.run(()=>S({state:p.state,write:()=>{var w;this.setStatus({status:"streaming"}),p.state.message.id===((w=this.lastMessage)==null?void 0:w.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await gV({stream:hV({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:S=>{throw S}}),onError:S=>{throw S}}),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 O_=z(R_(),1);var Ju=z(we(),1);var _p=z(we(),1);var __=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},ht=(e,t,a)=>(__(e,t,"read from private field"),a?a.call(e):t.get(e)),Hn=(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)},fo=(e,t,a,n)=>(__(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function kV(e,t){return t!=null?(0,O_.default)(e,t):e}var dn,Rp,Dp,Yu,Zu,Qu,Nl,nv,rv,TV=class{constructor(e=[]){Hn(this,dn,void 0),Hn(this,Rp,"ready"),Hn(this,Dp,void 0),Hn(this,Yu,new Set),Hn(this,Zu,new Set),Hn(this,Qu,new Set),this.pushMessage=t=>{fo(this,dn,ht(this,dn).concat(t)),ht(this,Nl).call(this)},this.popMessage=()=>{fo(this,dn,ht(this,dn).slice(0,-1)),ht(this,Nl).call(this)},this.replaceMessage=(t,a)=>{fo(this,dn,[...ht(this,dn).slice(0,t),this.snapshot(a),...ht(this,dn).slice(t+1)]),ht(this,Nl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?kV(t,a):t;return ht(this,Yu).add(n),()=>{ht(this,Yu).delete(n)}},this["~registerStatusCallback"]=t=>(ht(this,Zu).add(t),()=>{ht(this,Zu).delete(t)}),this["~registerErrorCallback"]=t=>(ht(this,Qu).add(t),()=>{ht(this,Qu).delete(t)}),Hn(this,Nl,()=>{ht(this,Yu).forEach(t=>t())}),Hn(this,nv,()=>{ht(this,Zu).forEach(t=>t())}),Hn(this,rv,()=>{ht(this,Qu).forEach(t=>t())}),fo(this,dn,e)}get status(){return ht(this,Rp)}set status(e){fo(this,Rp,e),ht(this,nv).call(this)}get error(){return ht(this,Dp)}set error(e){fo(this,Dp,e),ht(this,rv).call(this)}get messages(){return ht(this,dn)}set messages(e){fo(this,dn,[...e]),ht(this,Nl).call(this)}};dn=new WeakMap;Rp=new WeakMap;Dp=new WeakMap;Yu=new WeakMap;Zu=new WeakMap;Qu=new WeakMap;Nl=new WeakMap;nv=new WeakMap;rv=new WeakMap;var Bl,D_=class extends M_{constructor({messages:e,...t}){let a=new TV(e);super({...t,state:a}),Hn(this,Bl,void 0),this["~registerMessagesCallback"]=(n,r)=>ht(this,Bl)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>ht(this,Bl)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>ht(this,Bl)["~registerErrorCallback"](n),fo(this,Bl,a)}};Bl=new WeakMap;function P_({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,fn.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,fn.useRef)("chat"in a?a.chat:new D_(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new D_(r));let l=(0,fn.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,fn.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,fn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,fn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,fn.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,fn.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 Z=z(we(),1);var LV="/api/mcp/modules/documents",EV=2e4,MV=3e5,pn=class extends Error{constructor(a,n){super(n);ae(this,"code");this.name="DocumentUploadError",this.code=a}};function N_(e,t){return Wd(e,`${LV}${t}`)}function AV(e){return N_(e,"/upload-url")}function B_(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function RV(e){let t=e?.data;if(typeof t?.documentId!="string"||typeof t.uploadUrl!="string"||!(t.documentId&&t.uploadUrl))return null;let a={};for(let[n,r]of Object.entries(t.headers??{}))typeof r=="string"&&(a[n]=r);return{documentId:t.documentId,uploadUrl:t.uploadUrl,headers:a}}function DV(e){return e===403?new pn("upload_disabled","This agent does not accept document uploads."):e===413?new pn("max_file_size","That file is too large."):e===422||e===400?new pn("accept","That file type is not accepted."):new pn("upload_failed",`The upload could not be started (${e}).`)}function _V(e){return new Promise((t,a)=>{let n=new XMLHttpRequest;n.open("PUT",e.url,!0);for(let[i,l]of Object.entries(e.headers))n.setRequestHeader(i,l);n.timeout=MV;let r=()=>n.abort();e.signal.addEventListener("abort",r,{once:!0});let o=()=>e.signal.removeEventListener("abort",r);n.upload.onprogress=i=>{i.lengthComputable&&i.total>0&&e.onProgress?.(i.loaded/i.total)},n.onload=()=>{if(o(),n.status>=200&&n.status<300||n.status===412){e.onProgress?.(1),t();return}a(new pn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new pn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new pn("upload_failed","The upload timed out."))},n.onabort=()=>{o(),a(e.signal.reason instanceof Error?e.signal.reason:new Error("aborted"))},n.send(e.file)})}async function Op(e){let t=N_(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:B_(e.headers,e.uploadHeaders)})}catch{}}async function U_(e){e.signal.throwIfAborted();let t=AV(e.api);if(!t)throw new pn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),EV),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let l=B_(e.headers,e.uploadHeaders);l.set("Content-Type","application/json"),o=await fetch(t,{method:"POST",headers:l,signal:a.signal,body:JSON.stringify({filename:e.file.name,contentType:e.file.type,byteSize:e.file.size,...e.sessionId?{sessionId:e.sessionId}:{}})})}catch(l){throw e.signal.aborted?l:new pn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw DV(o.status);let i=RV(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new pn("upload_failed","The upload could not be started.");return await _V({url:i.uploadUrl,headers:i.headers,file:e.file,signal:e.signal,onProgress:e.onProgress}),{documentId:i.documentId,filename:e.file.name,mediaType:e.file.type}}function OV(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 Pp=class extends av{processResponseStream(t){let a="",n=tv(),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=OV(f.error);if(p?.length){let m={...d};for(let S of p)delete m[S];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var F_=50,z_=1e3;function Np(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 Bp(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await Hg(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function ov(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function iv(e){return await Bp(async a=>{let o=a.transaction(Va,"readonly").objectStore(Va).index(Gd),l=(await ov(o.getAll(e))??[]).filter(Np);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Up(e){return await Bp(async a=>{let r=a.transaction(Va,"readonly").objectStore(Va),o=await ov(r.get(e));return Np(o)?o:null})??null}async function lv(e){if(!Np(e))return;let t=e.messages.length>z_?{...e,messages:e.messages.slice(e.messages.length-z_)}:e;await Bp(async a=>{await new Promise((s,u)=>{let c=a.transaction(Va,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Va).put(t)});let n=a.transaction(Va,"readwrite"),r=n.objectStore(Va),o=r.index(Gd),l=(await ov(o.getAll(t.memoryUserId))??[]).filter(Np);if(l.length>F_){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-F_);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 q_(e){await Bp(async t=>(await new Promise((a,n)=>{let r=t.transaction(Va,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Va).delete(e)}),null))}async function sv(e){return(await iv(e))[0]?.threadId??null}function H_(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 PV="x-session-id",NV=250,BV=200;function j_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():cu()}function Fp(){return new Date().toISOString()}function V_(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function UV(e,t){let a=Ma(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 W_(e){let{api:t="/api/waniwani",headers:a,uploadHeaders:n,body:r,onMessageSent:o,onResponseReceived:i,enableThreadHistory:l=!1,activeThreadId:s,onThreadChange:u}=e,c=e.visitorId;(0,Z.useEffect)(()=>Xs(c),[c]);let d=vp(),f=(0,Z.useRef)(a),p=(0,Z.useRef)(n),m=(0,Z.useRef)(r),x=(0,Z.useRef)(l);(0,Z.useEffect)(()=>{x.current=l},[l]);let S=(0,Z.useRef)(void 0),w=(0,Z.useRef)(void 0),y=(0,Z.useRef)(null),[g,b]=(0,Z.useState)(void 0),T=(0,Z.useRef)(g),[C,M]=(0,Z.useState)(s),R=(0,Z.useRef)(C),[P,L]=(0,Z.useState)([]),[$,H]=(0,Z.useState)(!l),F=(0,Z.useRef)(void 0),W=(0,Z.useRef)(void 0),V=(0,Z.useRef)(void 0),N=(0,Z.useRef)(void 0),D=(0,Z.useRef)(0),G=(0,Z.useRef)(u);(0,Z.useEffect)(()=>{G.current=u},[u]);let se=(0,Z.useCallback)(O=>{R.current=O,M(O),O&&(G.current?.(O),d.emit({name:"thread.changed",sessionId:T.current,properties:{threadId:O}}))},[d]),I=(0,Z.useCallback)(async()=>{if(!l)return;let O=y.current?.memoryUserId;if(!O)return;let oe=await iv(O);L(oe)},[l]),Ve=(0,Z.useCallback)(()=>T.current,[]),rt=(0,Z.useCallback)(O=>{let oe=V_(O);if(!oe||T.current===oe)return;let pe=T.current===void 0;T.current=oe,b(oe),pe&&d.emit({name:"session.started",properties:{sessionId:oe}})},[d]),v=(0,Z.useCallback)(()=>{T.current=void 0,b(void 0)},[]);(0,Z.useEffect)(()=>{f.current=a,p.current=n},[a,n]),(0,Z.useEffect)(()=>{m.current=r},[r]),(0,Z.useEffect)(()=>{let O=!1,oe=D.current;return(async()=>{try{let Ye=await Ks();if(O)return;y.current=Ye}catch{}if(!l)return;let pe=y.current?.memoryUserId;if(!pe){H(!0);return}try{let Ye=s??await sv(pe);if(O||oe!==D.current)return;if(Ye){let Wt=await Up(Ye);if(O||oe!==D.current)return;Wt&&Wt.memoryUserId===pe&&(R.current=Wt.threadId,M(Wt.threadId),F.current=Wt.createdAt,W.current=Wt.title,Wt.sessionId&&(T.current=Wt.sessionId,b(Wt.sessionId)),X(Wt.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[]);let K=(0,Z.useRef)(null),ee=(0,Z.useCallback)(O=>{let oe=m.current?.[O];return typeof oe=="string"?oe:void 0},[]),xe=(0,Z.useCallback)(()=>({api:t,token:Xd(f.current),channelId:ee("channelId"),sessionId:T.current}),[t,ee]),We=(0,Z.useCallback)(O=>{let oe=K.current;K.current=null,oe?.report(xe(),{mode:ee("mode"),outcome:O})},[xe,ee]),me=(0,Z.useRef)(new Pp({api:t,headers:()=>({...f.current}),body:()=>{let O={...m.current??{}},oe=Object.hasOwn(O,"sessionId"),pe=V_(O.sessionId);if(pe)rt(pe),O.sessionId=pe;else if(oe)v(),delete O.sessionId;else{let Xp=Ve();Xp&&(O.sessionId=Xp)}El(S.current)&&(O.modelContext=S.current),w.current?.length&&(O.documents=w.current);let Ye=y.current,Wt=ta();Ye&&(O.visitorContext={timezone:Ye.timezone,language:Ye.language,languages:Ye.languages,deviceType:Ye.deviceType,referrer:Ye.referrer,visitorId:Wt});let Mt=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},PO=typeof Mt.client=="object"&&Mt.client!==null?Mt.client:{};O.visitor={...Mt,id:Wt,client:{...PO,...Ye&&{memoryUserId:Ye.memoryUserId}}};let vv=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,bv=y.current?.memoryUserId,Sv=y.current?.language,cc={};if(bv&&(cc.memoryUserId=bv),Sv&&(cc.locale=Sv),(Object.keys(cc).length>0||vv)&&(O.extra={...cc,...vv??{}}),x.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(R.current=O.threadId);else{let dc=R.current;dc||(dc=j_(),F.current=Fp(),W.current=void 0,se(dc)),O.threadId=dc}return O},fetch:(async(O,oe)=>{let pe=K.current;pe?.mark("requestStart");try{let Ye=await fetch(O,oe);return S.current=void 0,rt(Ye.headers.get(PV)),pe?pe.instrument(Ye):Ye}finally{w.current=void 0}})})),he=(0,Z.useRef)(null),ue=(0,Z.useRef)(null),fe=(0,Z.useRef)({}),[J,Oe]=(0,Z.useState)(0),He=e.skipRemoteConfig===!0,ke=(0,Z.useCallback)(async()=>{if(!He)try{let O=await UV(t,f.current);fe.current=O,Oe(oe=>oe+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,He]);(0,Z.useEffect)(()=>{ke()},[ke]);let{messages:ge,sendMessage:Ie,setMessages:X,status:Ue,stop:Pt}=P_({messages:e.initialMessages,transport:me.current,onFinish({message:O,isAbort:oe,isDisconnect:pe,isError:Ye}){K.current?.mark("streamEnd"),We(oe||pe||Ye?"error":"ok"),i?.(),!oe&&!pe&&!Ye&&d.emit({name:"message.received"}),he.current&&(ue.current=O)},onError(O){We("error"),console.warn("[Waniwani] Chat error:",O.message),d.emit({name:"chat.error",properties:{message:O.message.slice(0,BV)}}),he.current&&(he.current.reject(O),he.current=null)}}),aa=(0,Z.useRef)(ge);(0,Z.useEffect)(()=>{aa.current=ge},[ge]);let sa=(0,Z.useCallback)(()=>{K.current=RC(aa.current.filter(O=>O.role==="user").length+1)},[]),[Xa,di]=(0,Z.useState)(!1),fi=(0,Z.useCallback)(async()=>{di(!0);try{await Pt();let O=T.current;if(!O)return;await fetch(Ma(t,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json",...f.current},body:JSON.stringify({sessionId:O})})}catch{}finally{di(!1)}},[t,Pt]),A=(0,Z.useRef)(l);(0,Z.useEffect)(()=>{if(!l||A.current||(A.current=!0,aa.current.length>0))return;let O=!1,oe=D.current;return H(!1),(async()=>{try{let pe=y.current;if(!pe)try{pe=await Ks(),y.current=pe}catch{}let Ye=pe?.memoryUserId;if(!Ye||O||oe!==D.current){O||H(!0);return}let Wt=s??await sv(Ye);if(O||oe!==D.current)return;if(Wt){let Mt=await Up(Wt);if(O||oe!==D.current)return;Mt&&Mt.memoryUserId===Ye&&(R.current=Mt.threadId,M(Mt.threadId),F.current=Mt.createdAt,W.current=Mt.title,Mt.sessionId&&(T.current=Mt.sessionId,b(Mt.sessionId)),X(Mt.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[l]),(0,Z.useEffect)(()=>{if(Ue==="ready"&&he.current&&ue.current){let O=he.current,oe=ue.current;he.current=null,ue.current=null,O.resolve(oe)}},[Ue]);let[U,Q]=(0,Z.useState)(""),[re,Te]=(0,Z.useState)([]),Nt=(0,Z.useRef)([]);Nt.current=re;let ua=Ue==="submitted"||Ue==="streaming",va=(0,Z.useCallback)(O=>{for(let oe of O)for(let pe of oe.documents??[])Op({documentId:pe.documentId,api:t,headers:f.current,uploadHeaders:p.current})},[t]),ba=(0,Z.useCallback)(()=>{va(Nt.current),Te([])},[va]),ho=(0,Z.useCallback)(O=>{let oe=Nt.current.find(pe=>pe.id===O);oe&&va([oe]),Te(pe=>pe.filter(Ye=>Ye.id!==O))},[va]),ca=ua&&re.length>0,Sr=(0,Z.useCallback)(O=>{let oe=!!O.text?.trim(),pe=!!(O.files?.length||O.documents?.length);if(oe||pe){if(ua){if(re.length>0)return;Te(Ye=>[...Ye,{id:cu(),text:O.text||"",files:O.files??[],documents:O.documents??[],modelContext:O.modelContext}]),Q("");return}sa(),S.current=O.modelContext,w.current=O.documents,Ie({text:O.text||"",files:O.files,...O.documents?.length&&{metadata:{documents:O.documents}}}),o?.(O.text||""),d.emit({name:"message.sent"}),Q("")}},[Ie,o,ua,re.length,d,sa]),hn=(0,Z.useCallback)(O=>new Promise((oe,pe)=>{he.current={resolve:oe,reject:pe},sa(),Ie({text:O}),o?.(O),d.emit({name:"message.sent"})}),[Ie,o,d,sa]);(0,Z.useEffect)(()=>{if(Ue!=="ready"||Xa||re.length===0)return;let[O,...oe]=re;Te(oe),sa(),S.current=O.modelContext,w.current=O.documents,Ie({text:O.text,files:O.files.length>0?O.files:void 0,...O.documents.length>0&&{metadata:{documents:O.documents}}}),o?.(O.text),d.emit({name:"message.sent"})},[Ue,Xa,Ie,o,re,d,sa]);let MO=(0,Z.useCallback)(()=>{X([]),ba(),v(),Q(""),fe.current={},Oe(O=>O+1),ke()},[X,v,ke,ba]),sc=(0,Z.useCallback)(()=>{if(!x.current)return;let O=y.current?.memoryUserId,oe=R.current,pe=aa.current;if(!(!O||!oe||pe.length===0)){if(F.current||(F.current=Fp()),!W.current){let Ye=pe.find(Mt=>Mt.role==="user"),Wt=Ye?Ye.parts.map(Mt=>"text"in Mt&&typeof Mt.text=="string"?Mt.text:"").join(" "):"";W.current=H_(Wt)}return{threadId:oe,memoryUserId:O,title:W.current,messages:pe,sessionId:T.current,createdAt:F.current,updatedAt:Fp()}}},[]),wv=(0,Z.useCallback)(async()=>{let O=sc();O&&(await lv(O),await I())},[sc,I]);(0,Z.useEffect)(()=>{if(l&&$&&!(Ue==="submitted"||Ue==="streaming")&&ge.length!==0)return V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=void 0;let O=wv().finally(()=>{N.current===O&&(N.current=void 0)});N.current=O},NV),()=>{V.current&&clearTimeout(V.current)}},[l,$,ge,Ue,wv]);let uc=(0,Z.useCallback)(()=>{let O=N.current,oe=V.current,pe=oe?sc():void 0;return oe&&(clearTimeout(oe),V.current=void 0),(async()=>{O&&await O,pe&&(await lv(pe),await I())})()},[sc,I]),AO=(0,Z.useCallback)(()=>{D.current+=1,uc(),X([]),ba(),v(),Q("");let O=j_();return F.current=Fp(),W.current=void 0,se(O),I(),O},[X,v,se,I,uc,ba]),$p=(0,Z.useCallback)(async O=>{D.current+=1;let oe=D.current;if(await uc(),oe!==D.current)return;let pe=await Up(O);oe===D.current&&pe&&(pe.sessionId?(T.current=pe.sessionId,b(pe.sessionId)):v(),se(pe.threadId),F.current=pe.createdAt,W.current=pe.title,X(pe.messages),ba(),Q(""))},[X,v,se,uc,ba]),RO=(0,Z.useCallback)(async O=>{if(R.current===O){D.current+=1,V.current&&(clearTimeout(V.current),V.current=void 0);let oe=N.current;oe&&await oe}await q_(O),await I(),R.current===O&&(X([]),ba(),v(),Q(""),R.current=void 0,M(void 0),F.current=void 0,W.current=void 0)},[X,v,I,ba]);(0,Z.useEffect)(()=>{l&&$&&s!==void 0&&s!==R.current&&$p(s)},[s,l,$,$p]);let DO=(0,Z.useCallback)(O=>{Q(O.target.value)},[]),yv=ge[ge.length-1],xv=ge.length>0,_O=ua&&(!xv||yv.role==="user"),OO=fe.current;return{messages:ge,status:Ue,text:U,setText:Q,handleSubmit:Sr,handleTextChange:DO,isLoading:ua,showLoaderBubble:_O,lastMessage:yv,hasMessages:xv,sendMessage:Ie,sendMessageAndWait:hn,stop:fi,reset:MO,queuedMessages:re,queueFull:ca,removeQueuedMessage:ho,sessionId:g,toolDefinitions:OO,refreshToolDefinitions:ke,threads:P,activeThreadId:C,isThreadHistoryReady:$,startNewThread:AO,switchThread:$p,deleteThread:RO}}var li=z(we(),1);var FV=6e3;function G_(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[l,s]=(0,li.useState)(null),u=(0,li.useCallback)((f,p,m)=>U_({file:f,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:p,onProgress:m}),[t,a,n,r]),c=(0,li.useCallback)(f=>{Op({documentId:f.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,li.useEffect)(()=>{if(!l)return;let f=setTimeout(()=>s(null),FV);return()=>clearTimeout(f)},[l]);let d=o?.enabled??!1;return{enabled:o?o.enabled:!!i,accept:o?.accept.join(","),maxFileSize:o?.maxBytes,maxPdfPages:o?.maxPdfPages,maxFiles:o?.maxFiles,upload:d?u:void 0,onDiscard:d?c:void 0,error:l,reportError:s}}var xa=z(we(),1);function Ul(e){return e.map(t=>({id:null,text:t}))}function si(e){let{flow:t,followup:a,page:n,channel:r}=e;return t!==null?{origin:"flow",suggestions:t}:a?.length?{origin:"followup",suggestions:a}:n?.length?{origin:"page",suggestions:n}:r?.length?{origin:"channel",suggestions:r}:null}function Fl(e){return typeof e=="object"&&e!==null}function $_(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function zV(e){if(!Fl(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!Fl(t)||!Fl(t._meta))return null;let a=t._meta[Ng];return!Fl(a)||!$_(a.suggestions)?null:a.suggestions}function X_(e){let t=null;for(let a of e.parts){let n=zV(a);n!==null&&(t=n)}return t}function K_(e){for(let t of e.parts){if(!Fl(t)||t.type!=="data-suggestions")continue;let a=t.data;if(Fl(a)&&$_(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function qV(e){return"page"in e||"channel"in e}function HV(e){return typeof e!="object"||e===null?{}:qV(e)?{rungs:e}:{initial:e.initial}}function Y_(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=HV(n),l=(0,xa.useMemo)(()=>({page:null,channel:Ul(i??[])}),[i]),s=o??l,u=(0,xa.useMemo)(()=>r?si({flow:null,followup:null,...s}):null,[r,s]),c=(0,xa.useMemo)(()=>u?.suggestions.map(g=>g.text)??[],[u]),[d,f]=(0,xa.useState)(c),[p,m]=(0,xa.useState)(u?.origin??"channel"),x=(0,xa.useRef)(a),S=(0,xa.useCallback)(()=>{f([])},[]),w=t.length>0;(0,xa.useEffect)(()=>{w||(f(c),m(u?.origin??"channel"))},[c,u,w]);let y=t[t.length-1];return(0,xa.useEffect)(()=>{y?.role==="user"&&S()},[y,S]),(0,xa.useEffect)(()=>{let g=x.current;if(x.current=a,g!=="streaming"||a!=="ready"||!r)return;let b=[...t].reverse().find(R=>R.role==="assistant");if(!b)return;let T=X_(b),C=K_(b),M=si({flow:T===null?null:Ul(T),followup:C===null?null:Ul(C),page:null,channel:null});f(M?M.suggestions.map(R=>R.text):[]),m(M?.origin??"channel")},[a,r,t]),{suggestions:d,source:p,isLoading:!1,clear:S}}function Z_(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return Ma(e,"/resource",n?{token:n}:void 0)}var jV={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"],glassTint:["--ww-glass-tint"],glassTintStrength:["--ww-glass-tint-opacity"]};function zl(e){let t={};for(let[a,n]of Object.entries(jV)){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 Ge=z(ne(),1),ql=(0,qe.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ge.jsx)(Fo,{locale:n,messages:r,children:(0,Ge.jsx)(VV,{...t,ref:a})})}),VV=(0,qe.forwardRef)(function(t,a){let{t:n,ready:r}=Le(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,documentUpload:u,welcomeMessage:c,welcome:d,placeholder:f=n.promptInput.placeholder,triggerEvent:p="triggerDemoRequest",api:m,mcp:x,debug:S=!1,readOnly:w=!1,title:y,headerActions:g,hideHeader:b=!1,enableThreadHistory:T=!1,showToolCalls:C=!0,initializing:M=!1,onScreen:R=!0,disclaimer:P}=t,L=o?.theme,$=o?.variables,H=o?.assistantBubble??!1,F=$?zl($):{},[W,V]=(0,qe.useState)(!1);(0,qe.useEffect)(()=>{if(L!=="auto"||typeof window>"u")return;let A=window.matchMedia("(prefers-color-scheme: dark)");V(A.matches);let U=()=>V(A.matches);return A.addEventListener("change",U),()=>A.removeEventListener("change",U)},[L]);let N=L==="dark"||L==="auto"&&W,D=W_({...t,api:m}),G=vp(),se=X2({...t,api:m,sessionId:D.sessionId,onCallTool:x?.onCallTool}),I=x?.resourceEndpoint??Z_(m,t.headers),Ve=(0,qe.useRef)({});Ve.current={api:m,token:Xd(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:D.sessionId};let rt=(0,qe.useCallback)(A=>{Kd("widget",Ve.current,{widget:A.widget,outcome:A.outcome},A.metrics)},[]),v=pl(f,!D.text),K=G_({api:m,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:D.sessionId,documentUpload:u,allowAttachments:s}),[ee,xe]=(0,qe.useState)(null),[We,me]=(0,qe.useState)(null),he=(0,qe.useRef)(null),ue=(0,qe.useRef)(null),fe=(0,qe.useRef)(null),J=(0,qe.useRef)(null),[Oe,He]=(0,qe.useState)(!0),ke=(0,qe.useRef)(Oe);ke.current=Oe;let ge=(0,qe.useCallback)(()=>{let A=he.current;if(!A)return;let U=A.querySelector("textarea");U&&U.focus()},[]),Ie=(0,qe.useCallback)((A="smooth")=>{let U=ue.current;U&&U.scrollTo({top:U.scrollHeight,behavior:A})},[]);(0,qe.useEffect)(()=>{let A=J.current,U=ue.current;if(!A||!U)return;let Q=new IntersectionObserver(([re])=>He(re.isIntersecting),{root:U,rootMargin:"0px 0px 200px 0px",threshold:0});return Q.observe(A),()=>Q.disconnect()},[]),(0,qe.useEffect)(()=>{let A=ue.current;if(!A)return;let U=Q=>{let Te=(Q.target instanceof Element?Q.target:null)?.closest("a");Te?.href&&G.emit({name:"link.clicked",properties:{url:Te.href}})};return A.addEventListener("click",U),()=>A.removeEventListener("click",U)},[G]),(0,qe.useEffect)(()=>{(D.messages[D.messages.length-1]?.role==="user"||ke.current)&&Ie("smooth")},[D.messages.length,D.messages[D.messages.length-1]]),(0,qe.useEffect)(()=>{Ie("auto")},[Ie]),(0,qe.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let A=ue.current,U=fe.current;if(!A&&!U)return;let Q=A?.scrollHeight??0,re=A?.clientHeight??0,Te=new ResizeObserver(()=>{let Nt=ue.current;if(!Nt)return;let ua=Nt.scrollTop+re>=Q-5;Q=Nt.scrollHeight,re=Nt.clientHeight,ua&&Ie("auto")});return A&&Te.observe(A),U&&Te.observe(U),()=>Te.disconnect()},[Ie]);let X=Y_({messages:D.messages,status:D.status,suggestions:t.suggestions}),Ue=(0,qe.useRef)(null);(0,qe.useEffect)(()=>{let A=X.suggestions;!R||A.length===0||Ue.current===A||(Ue.current=A,G.emit({name:"suggestions.shown",properties:{texts:A,origin:X.source}}))},[X.suggestions,X.source,G,R]);let Pt=d?.suggestions,aa=(0,qe.useRef)(null);(0,qe.useEffect)(()=>{!R||D.messages.length>0||!Pt?.length||aa.current===Pt||(aa.current=Pt,G.emit({name:"suggestions.shown",properties:{texts:Pt,origin:"channel"}}))},[Pt,D.messages.length,G,R]);let sa=(0,qe.useCallback)(A=>{let U=A.content.map(Q=>Q.text??"").join("").trim();U&&D.handleSubmit({text:U,files:[],modelContext:A.modelContext})},[D.handleSubmit]),Xa=(0,qe.useCallback)(A=>{let U=X.suggestions.indexOf(A),Q=U>=0?U:d?.suggestions?.indexOf(A)??-1,re=U>=0?X.source:"channel";G.emit({name:"suggestion.clicked",properties:{text:A,index:Q,origin:re}}),X.clear(),D.handleSubmit({text:A,files:[]})},[X.suggestions,X.source,X.clear,D.handleSubmit,d,G]);(0,qe.useImperativeHandle)(a,()=>({sendMessage:A=>{D.handleSubmit({text:A,files:[]}),ge()},sendMessageAndWait:A=>D.sendMessageAndWait(A),reset:D.reset,focus:ge,get messages(){return D.messages},get sessionId(){return D.sessionId}}),[D.handleSubmit,D.sendMessageAndWait,D.reset,D.messages,D.sessionId,ge]),(0,qe.useEffect)(()=>{if(!p)return;let A=U=>{let Q=U.detail,re=typeof Q?.message=="string"?Q.message:void 0;re&&D.handleSubmit({text:re,files:[]}),ge()};return window.addEventListener(p,A),()=>window.removeEventListener(p,A)},[p,D.handleSubmit,ge]);let di=!b&&!!(y||T||g),fi=M||!r;return(0,Ge.jsxs)("div",{ref:he,style:{...F,maxHeight:"inherit",...ee&&We?{height:We}:{},opacity:fi?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":H?"true":void 0,"data-color-scheme":L==="auto"?"auto":void 0,...fi?{"data-waniwani-initializing":""}:{},...N?{"data-waniwani-dark":""}:{},className:q("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",L==="dark"&&"dark",i,l?.root),children:[di&&(0,Ge.jsxs)("div",{className:q("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,Ge.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ge.jsx)("div",{className:"ww:flex-1"}),T&&(0,Ge.jsx)(W2,{threads:D.threads,activeThreadId:D.activeThreadId,onNewThread:D.startNewThread,onSelectThread:A=>{D.switchThread(A)},onDeleteThread:A=>{D.deleteThread(A)}}),g]}),(0,Ge.jsxs)("div",{ref:ue,className:q("ww:relative ww:flex-1 ww:min-h-0",ee?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ge.jsxs)("div",{ref:fe,className:q("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",ee&&"ww:!py-0"),children:[(0,Ge.jsx)(B2,{value:rt,children:(0,Ge.jsx)(H2,{messages:D.messages,status:D.status,welcomeMessage:c,welcome:d,onSuggestionSelect:Xa,resourceEndpoint:I,chatSessionId:D.sessionId,isDark:N,onFollowUp:sa,onCallTool:se,fullscreenToolCallId:ee,debug:S,showToolCalls:C,toolDefinitions:D.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(A,U)=>{if(A==="fullscreen"){let Q=he.current?.getBoundingClientRect().height??0;me(Q>0?Q:null),xe(U.toolCallId)}else me(null),xe(null)}})}),(0,Ge.jsx)("div",{ref:J,"aria-hidden":!0,style:{height:1}})]}),!Oe&&!ee&&(0,Ge.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ge.jsx)(Nn,{type:"button",onClick:()=>Ie("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ge.jsx)(Qs,{className:"ww:size-4"})})})]}),!w&&(0,Ge.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:ee?{display:"none"}:void 0,children:[(0,Ge.jsx)(cl,{suggestions:X.suggestions,isLoading:X.isLoading,onSelect:Xa}),(0,Ge.jsx)(Ak,{queuedMessages:D.queuedMessages,onRemove:D.removeQueuedMessage}),(0,Ge.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ge.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ge.jsxs)(mk,{onSubmit:D.handleSubmit,attachmentsEnabled:K.enabled,globalDrop:K.enabled,multiple:K.enabled,accept:K.accept,maxFileSize:K.maxFileSize,maxPdfPages:K.maxPdfPages,maxFiles:K.maxFiles,upload:K.upload,onDiscard:K.onDiscard,onError:K.reportError,className:q("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:[(0,Ge.jsx)(vk,{enabled:K.enabled}),K.enabled&&(0,Ge.jsx)(xk,{className:"ww:px-4 ww:pt-3"}),(0,Ge.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[K.enabled&&(0,Ge.jsx)(yk,{}),(0,Ge.jsx)(gk,{onChange:D.handleTextChange,value:D.text,placeholder:v,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ge.jsx)(wk,{status:D.status,disabled:D.queueFull,onStop:D.stop})]})]}),K.error&&(0,Ge.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:K.error.message}),(0,Ge.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,Ge.jsx)(j2,{}),(0,Ge.jsx)(bk,{text:P})]})]})})]})]})});var rc=z(we(),1);var Q_="500px",WV="https://app.waniwani.ai/api/mcp/chat",GV={api:WV};function uv(){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 zp(){let e=uv();if(!e)return{};let t=G=>e.getAttribute(G)??void 0,a=G=>{let se=e.getAttribute(G);if(se==null)return;let I=se.trim().toLowerCase();if(I==="true"||I==="1"||I==="")return!0;if(I==="false"||I==="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-webmcp");d&&(n.webmcp={enabled:d!=="false"&&d!=="off"});let f=t("data-channel-id");if(f&&(n.channelId=f),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let G=a("data-show-tool-calls");G!==void 0&&(n.showToolCalls=G)}let m=t("data-css");m&&(n.css=m);let x=t("data-suggestions");x&&(n.suggestions=x.split(",").map(G=>G.trim()).filter(Boolean));let S=a("data-enable-thread-history");S!==void 0&&(n.enableThreadHistory=S);let w=a("data-disable-page-view");w!==void 0&&(n.disablePageView=w);let y=a("data-hide-header");y!==void 0&&(n.hideHeader=y);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 C=t("data-mode");(C==="inline"||C==="floating"||C==="composer"||C==="off")&&(n.mode=C);let M={},R=t("data-composer-variant")?.trim().toLowerCase();(R==="glow"||R==="outline")&&(M.variant=R);let P=t("data-composer-size")?.trim().toLowerCase();(P==="sm"||P==="md"||P==="lg")&&(M.size=P);let L=a("data-composer-suggestions");L!==void 0&&(M.showSuggestions=L);let $=t("data-composer-align")?.trim().toLowerCase();($==="start"||$==="center")&&(M.align=$);let H=a("data-composer-trigger");H!==void 0&&(M.trigger=H);let F=a("data-composer-mobile-trigger");F!==void 0&&(M.mobileTrigger=F),Object.keys(M).length>0&&(n.composer=M);let W=t("data-height");W&&(n.height=W);let V=t("data-launcher-text");V&&(n.launcherText=V);let N=t("data-appear-delay");if(N!==void 0){let G=Number.parseInt(N.trim(),10);Number.isFinite(G)&&G>=0&&(n.appearDelay=G)}let D=t("data-disclaimer");if(D!==void 0){let G=D.trim(),se=G.toLowerCase();se==="false"||se==="0"?n.disclaimer=!1:G&&(n.disclaimer=G)}return n}function ec(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function tc(e,t,a){let n=a??zp(),r=$V(t,n,e),o={...t?.composer??{},...ec(n.composer),...ec(e?.composer)},i=Object.keys(o).length>0,l={token:"",...GV,...ec(t),...ec(n),...ec(e),...r?{appearance:r}:{},...i?{composer:o}:{}};if(!l.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return l}function $V(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 rO=z(we(),1);var qp=z(we(),1);function XV(e){return e?.patterns??e?.rules??[]}var J_="\0\0";function KV(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,J_).replace(/\\\*/g,"[^/]*").split(J_).join(".*");return new RegExp(`^${a}$`)}function eO(e,t){try{return KV(e).test(t)}catch{return!1}}function ac(e,t){if(!e)return!0;let a=!1;for(let n of XV(e))if(eO(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function tO(e,t){for(let a of e?.appearRules??[])if(eO(a.glob,t))return a.appearAfter;return null}var cv="waniwani:locationchange",aO=!1;function YV(){if(!(aO||typeof history>"u")){aO=!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(cv)),r}}}}function ZV(e){return YV(),window.addEventListener(cv,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(cv,e),window.removeEventListener("popstate",e)}}function QV(){return window.location.pathname}function JV(){return"/"}function nc(){return(0,qp.useSyncExternalStore)(ZV,QV,JV)}function Hl(e,t){let a=nc(),n=t&&ac(e,a);return(0,qp.useEffect)(()=>{ma("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var e7=3,t7=["low","medium","high"];function dv(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function a7(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 t7){let i=dv(t.get(o)??[])??dv(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(e7,e.length);){let o=dv(r);if(!o)break;n.push(o)}return n}function nO(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function oO(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 jl(e){let{pageSuggestions:t,suggestions:a}=e,n=nc();return(0,rO.useMemo)(()=>{let r=nO(n),o=t?.find(l=>nO(l.url)===r),i=o?a7(o.prompts).map(({id:l,text:s})=>({id:l,text:s})):null;return ma("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:Ul(a??[])}},[n,t,a])}var n7="waniwani:config:";function iO(e,t,a){return`${n7}${e}|${t}|${a??""}`}function po(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(iO(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function r7(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(iO(e,t,a),JSON.stringify(n))}catch{}}var o7=600;function i7(e){if(typeof e!="object"||e===null||typeof e.enabled!="boolean")return null;let t=Array.isArray(e.accept)?e.accept.filter(n=>typeof n=="string"):[],a=n=>typeof n=="number"&&Number.isFinite(n)&&n>0;return e.enabled?a(e.maxBytes)&&a(e.maxPdfPages)&&a(e.maxFiles)&&t.length>0?{enabled:!0,maxBytes:e.maxBytes,maxPdfPages:e.maxPdfPages,maxFiles:e.maxFiles,accept:t}:null:{enabled:!1,maxBytes:0,maxPdfPages:0,maxFiles:0,accept:t}}async function l7(e,t,a,n){No("configStart");let r=await s7(e,t,a,n);return No("configEnd"),a?.aborted||Gg(r.metadata),r}async function s7(e,t,a,n){try{let r=Ma(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?u7(l):{}}catch{return{}}}function u7(e){let t={};e.source!=null&&(t.source=e.source),e.channelId!=null&&(t.channelId=e.channelId),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=oO(e.pageSuggestions);a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),typeof e.webmcp?.enabled=="boolean"&&(t.webmcp={enabled:e.webmcp.enabled}),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);let n=i7(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function Vl(e,t,a){let[n,r]=(0,rc.useState)(e),[o,i]=(0,rc.useState)(!1);return(0,rc.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||_C({api:l,token:s,channelId:u??m.channelId,mode:e.mode==="off"?void 0:e.mode,source:m.source})},d=po(l,s,u);if(d)try{let m=tc(t,d,a);r(m),Yd("cache"),Gg(d.metadata),i(!0),ma("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d)}catch{}let f=new AbortController,p=setTimeout(()=>{Yd("timeout"),i(!0)},o7);return l7(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ma("remote /config response",m),Object.keys(m).length>0){r7(l,s,u,m);try{let x=tc(t,m,a);r(x),ma("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}Yd("remote"),i(!0),c(m)}}).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 Lt=z(ne(),1),c7={sm:{row:"ww:gap-1 ww:pl-3 ww:pr-1 ww:py-1",field:"ww:py-1 ww:text-base ww:sm:text-sm",send:"ww:size-7",sendIcon:"ww:size-3.5",radius:12},md:{row:"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",field:"ww:py-1.5 ww:text-base ww:sm:text-sm",send:"ww:size-8",sendIcon:"ww:size-4",radius:16},lg:{row:"ww:gap-2 ww:pl-5 ww:pr-2 ww:py-2.5 ww:sm:pl-6 ww:sm:pr-2.5 ww:sm:py-3",field:"ww:py-2 ww:text-base",send:"ww:size-10",sendIcon:"ww:size-5",radius:20}},lO="var(--ww-composer-bg, var(--ww-color-input))",d7="var(--ww-composer-border-color, var(--ww-color-border))",f7="var(--ww-composer-border-width, 1px)",sO="var(--ww-composer-send-bg, var(--ww-color-foreground))",uO="var(--ww-composer-send-fg, var(--ww-color-background))",dO=(0,$e.forwardRef)(function(t,a){return(0,Lt.jsx)(Fo,{locale:t.config.locale,children:(0,Lt.jsx)(p7,{...t,ref:a})})}),p7=(0,$e.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:l}=Le(),{config:s,ready:u}=Vl(t,a,n),c=Hl(s.visibility,u);(0,$e.useEffect)(()=>{o?.(c)},[c,o]),Ml({api:s.api,token:s.token,channelId:s.channelId,mode:"composer",paintMark:"chatVisible",painted:u});let d=(0,$e.useRef)(null),f=(0,$e.useMemo)(()=>Dl({mode:"composer",getSessionId:()=>d.current?.sessionId}),[]),p=s.onEvent;(0,$e.useEffect)(()=>{if(p)return f.subscribe(p)},[p,f]);let m=(0,$e.useRef)(null),x=(0,$e.useRef)(null),[S,w]=(0,$e.useState)(!1),[y,g]=(0,$e.useState)(""),[b,T]=(0,$e.useState)(0),C=s.appearance?.theme,M=s.appearance?.variables,R=(0,$e.useMemo)(()=>M?zl(M):{},[M]),P=jl(s),L=(0,$e.useMemo)(()=>si({flow:null,followup:null,...P}),[P]),$=(0,$e.useMemo)(()=>L?.suggestions.map(X=>X.text)??[],[L]);dl({widgetEvents:f,api:s.api,token:s.token,channelId:s.channelId,source:s.source,mode:"composer",pagePrompts:P.page,getSessionId:()=>d.current?.sessionId});let H=(0,$e.useRef)(null);(0,$e.useEffect)(()=>{!c||!L||H.current!==L&&(H.current=L,f.emit({name:"suggestions.shown",properties:{texts:$,origin:L.origin}}))},[c,L,$,f]);let F=s.composer??{},W=F.variant??"glow",V=c7[F.size??"md"],N=F.showSuggestions??!0,D=F.align==="center",G=$C(),se=(F.trigger??!1)||G&&(F.mobileTrigger??!0),I=s.launcherText??s.placeholder??l.launcher.prompt,Ve=pl(I,!se&&y.length===0),rt="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,$e.useEffect)(()=>{let X=m.current;if(X){if(!y){X.style.height="";return}X.style.height="auto",X.style.height=`${X.scrollHeight}px`}},[y]),(0,$e.useEffect)(()=>{b>0&&S&&d.current?.focus()},[b,S]);let v=(0,$e.useRef)(!1);(0,$e.useEffect)(()=>{u&&!v.current&&(v.current=!0,f.emit({name:"chat.ready"}))},[u,f]);let K=(0,$e.useRef)(!1);(0,$e.useEffect)(()=>{let X=c&&S;X!==K.current&&(K.current=X,f.emit({name:X?"chat.opened":"chat.closed"}))},[c,S,f]);let ee=(0,$e.useCallback)(X=>{w(!0),T(Pt=>Pt+1);let Ue=X.trim();Ue&&d.current?.sendMessage(Ue)},[]);(0,$e.useImperativeHandle)(i,()=>({open:()=>w(!0),close:()=>w(!1),toggle:()=>w(X=>!X),sendMessage:X=>ee(X),sendMessageAndWait:async X=>{w(!0);let Ue=d.current;if(Ue)return await Ue.sendMessageAndWait(X)},reset:()=>d.current?.reset(),focus:()=>{S?T(X=>X+1):(m.current??x.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[ee,S]);let xe=(0,$e.useCallback)(()=>{y.trim()&&(ee(y),g(""))},[y,ee]),We=(0,$e.useCallback)(()=>{(d.current?.messages.length??0)>0&&(w(!0),T(X=>X+1))},[]),me={mode:"composer"};s.mcpServerUrl&&(me.mcpServerUrl=s.mcpServerUrl),s.channelId&&(me.channelId=s.channelId);let he=(0,Lt.jsx)("button",{type:"button",onClick:()=>w(!1),"aria-label":l.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,Lt.jsx)(Bo,{className:"ww:size-4"})}),ue=(0,Lt.jsxs)("div",{className:q("ww:flex ww:items-end",V.row),children:[(0,Lt.jsx)("textarea",{ref:m,rows:1,value:y,placeholder:Ve,onChange:X=>g(X.target.value),onFocus:We,onKeyDown:X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),xe())},className:q("ww:min-w-0 ww:flex-1 ww:resize-none ww:bg-transparent ww:max-h-36 ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground",V.field,!y&&"ww:overflow-hidden ww:whitespace-nowrap ww:text-ellipsis ww:placeholder:overflow-hidden ww:placeholder:text-ellipsis")}),(0,Lt.jsx)("button",{type:"button",onClick:xe,disabled:!y.trim(),"aria-label":l.promptInput.submit,className:q("ww:relative ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",V.send),style:{background:sO,color:uO},children:(0,Lt.jsx)(On,{className:V.sendIcon})})]}),fe=(0,Lt.jsxs)("button",{ref:x,type:"button",onClick:()=>ee(""),className:q("ww:flex ww:w-full ww:items-center ww:text-left ww:cursor-pointer",V.row,D&&"ww:justify-center"),children:[(0,Lt.jsx)("span",{className:q("ww:min-w-0 ww:flex-1 ww:truncate ww:text-muted-foreground",V.field,D&&"ww:flex-none"),children:I}),(0,Lt.jsx)("span",{"aria-hidden":!0,className:q("ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full",V.send,D&&"ww:ml-3"),style:{background:sO,color:uO},children:(0,Lt.jsx)(On,{className:V.sendIcon})})]}),J=se?fe:ue,Oe=`var(--ww-composer-radius, ${V.radius}px)`,He={borderRadius:Oe,background:lO,borderColor:d7,borderWidth:f7,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${rt})`},ke=W==="glow"?(0,Lt.jsx)(tf,{animated:u,backgroundColor:lO,borderRadius:Oe,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:He,children:J}):(0,Lt.jsx)("div",{className:q(se&&"ww:transition-colors hover:ww:border-primary/40"),style:He,children:J}),ge=(0,Lt.jsxs)("div",{"data-waniwani-chat":"","data-color-scheme":C==="auto"?"auto":void 0,"data-waniwani-composer":"input","data-composer-variant":W,inert:S,className:q("ww:w-full ww:font-[family-name:var(--ww-font-sans)]",C==="dark"&&"dark"),style:R,children:[ke,N&&$.length>0&&(0,Lt.jsx)(cl,{suggestions:$,onSelect:X=>{f.emit({name:"suggestion.clicked",properties:{text:X,index:$.indexOf(X),origin:L?.origin??"channel"}}),ee(X)},align:D?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),Ie=(0,Lt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":C==="auto"?"auto":void 0,className:q("ww:contents ww:font-[family-name:var(--ww-font-sans)]",C==="dark"&&"dark"),style:R,children:(0,Lt.jsx)("div",{role:"dialog","aria-label":s.title??I,"data-waniwani-floating":"panel","data-state":c&&S?"shown":"hidden",style:{boxShadow:rt},className:q("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,Lt.jsx)(ql,{ref:d,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:me,appearance:s.appearance,title:s.title,headerActions:he,hideHeader:!1,onScreen:S,welcomeMessage:s.welcomeMessage,placeholder:s.placeholder,suggestions:P,enableThreadHistory:s.enableThreadHistory,documentUpload:s.documentUpload,showToolCalls:s.showToolCalls,locale:s.locale,initializing:!u})})});return(0,Lt.jsxs)(_l,{value:f,children:[ge,(0,cO.createPortal)(Ie,r)]})});var fv="/*! 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-black:#000;--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-md:12px;--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\\: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-0{bottom:calc(var(--ww-spacing)*0)}.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-\\[2147483000\\]{z-index:2147483000}.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-3{margin-left:calc(var(--ww-spacing)*3)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:block{display:block}.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-10{width:calc(var(--ww-spacing)*10);height:calc(var(--ww-spacing)*10)}.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-0\\.5{height:calc(var(--ww-spacing)*.5)}.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-36{max-height:calc(var(--ww-spacing)*36)}.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-60{width:calc(var(--ww-spacing)*60)}.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-72{max-width:calc(var(--ww-spacing)*72)}.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\\:flex-none{flex:none}.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-default{cursor:default}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:list-none{list-style-type: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\\:justify-end{justify-content:flex-end}.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-2\\.5{gap:calc(var(--ww-spacing)*2.5)}.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-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-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-2{border-style:var(--tw-border-style);border-width:2px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.ww\\:border-none{--tw-border-style:none;border-style:none}.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-primary{border-color:var(--ww-color-primary,#6366f1)}.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-background\\/85{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/85{background-color:color-mix(in oklab,var(--ww-color-background,#fff)85%,transparent)}}.ww\\:bg-black\\/45{background-color:var(--ww-color-black)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-black\\/45{background-color:color-mix(in oklab,var(--ww-color-black)45%,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-contain{object-fit:contain}.ww\\:object-cover{object-fit:cover}.ww\\:object-center{object-position:center}.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-2\\.5{padding:calc(var(--ww-spacing)*2.5)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-0\\.5{padding-inline:calc(var(--ww-spacing)*.5)}.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-1\\.5{padding-top:calc(var(--ww-spacing)*1.5)}.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{padding-right:calc(var(--ww-spacing)*1)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-0{padding-bottom:calc(var(--ww-spacing)*0)}.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\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3{padding-left:calc(var(--ww-spacing)*3)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:pl-5{padding-left:calc(var(--ww-spacing)*5)}.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\\:text-ellipsis{text-overflow:ellipsis}.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\\:underline{text-decoration-line:underline}.ww\\:underline-offset-2{text-underline-offset:2px}.ww\\:opacity-0{opacity:0}.ww\\:opacity-60{opacity:.6}.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-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);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\\: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\\:backdrop-blur-md{--tw-backdrop-blur:blur(var(--ww-blur-md));-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-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-\\[width\\]{transition-property: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\\:overflow-hidden::placeholder{overflow:hidden}.ww\\:placeholder\\:text-ellipsis::placeholder{text-overflow:ellipsis}.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-border:hover{background-color:var(--ww-color-border,#e5e7eb)}.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\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2\\.5{padding-right:calc(var(--ww-spacing)*2.5)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:pl-6{padding-left:calc(var(--ww-spacing)*6)}.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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#eceef499)}}[data-waniwani-chat]{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}[data-waniwani-chat][data-color-scheme=auto]{--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}}";function m7(e){return e.startsWith("__WANIWANI")}function Hp(e){if(!fv||m7(fv))return;let t=document.createElement("style");t.textContent=fv,e.appendChild(t)}var Ae=z(we(),1);var jp=z(we(),1),h7=3e3,g7=120,w7=24;function fO(e){let[t,a]=(0,jp.useState)(!1);return(0,jp.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 -${w7}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,g7)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},h7),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var gt=z(ne(),1),y7=2e3,x7=90,v7=1e3,pO=(0,Ae.forwardRef)(function(t,a){return(0,gt.jsx)(Fo,{locale:t.config.locale,children:(0,gt.jsx)(b7,{...t,ref:a})})}),b7=(0,Ae.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Le(),{config:i,ready:l}=Vl(t,a,n),s=Hl(i.visibility,l),u=nc(),c=s?tO(i.visibility,u):null,d=fO(c),f=(0,Ae.useRef)(null),p=(0,Ae.useMemo)(()=>Dl({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Ae.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Ae.useRef)(null),S=(0,Ae.useRef)(null),w=(0,Ae.useRef)(!1),[y,g]=(0,Ae.useState)("input"),[b,T]=(0,Ae.useState)(""),[C,M]=(0,Ae.useState)(!1),[R,P]=(0,Ae.useState)(!1),[L,$]=(0,Ae.useState)(0),H=i.appearance?.theme,F=i.appearance?.variables,W=(0,Ae.useMemo)(()=>F?zl(F):{},[F]),V=jl(i),N=(0,Ae.useMemo)(()=>si({flow:null,followup:null,...V}),[V]),D=(0,Ae.useMemo)(()=>N?.suggestions.map(J=>J.text)??[],[N]);dl({widgetEvents:p,api:i.api,token:i.token,channelId:i.channelId,source:i.source,mode:"floating",pagePrompts:V.page,getSessionId:()=>f.current?.sessionId});let G=(0,Ae.useRef)(null);(0,Ae.useEffect)(()=>{!R||!N||G.current!==N&&(G.current=N,p.emit({name:"suggestions.shown",properties:{texts:D,origin:N.origin}}))},[R,N,D,p]);let se=i.launcherText??i.placeholder??o.launcher.prompt,I=pl(se,b.length===0),Ve="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ae.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let J=i.appearDelay??y7,Oe=setTimeout(()=>M(!0),Math.max(0,J));return()=>clearTimeout(Oe)},[s,i.appearDelay,c,d]),(0,Ae.useEffect)(()=>{if(!C||D.length===0)return;let J=setTimeout(()=>{w.current||g(Oe=>Oe==="input"?"expanded":Oe)},v7);return()=>clearTimeout(J)},[C,D.length]),(0,Ae.useEffect)(()=>{L>0&&y==="open"&&f.current?.focus()},[L,y]);let rt=(0,Ae.useRef)(!1);(0,Ae.useEffect)(()=>{l&&!rt.current&&(rt.current=!0,p.emit({name:"chat.ready"}))},[l,p]),Ml({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:l&&s});let v=(0,Ae.useRef)(!1);(0,Ae.useEffect)(()=>{let J=s&&y==="open";J!==v.current&&(v.current=J,p.emit({name:J?"chat.opened":"chat.closed"}))},[s,y,p]);let K=(0,Ae.useCallback)(()=>{g("open")},[]),ee=(0,Ae.useCallback)(()=>{w.current=!0,g("input")},[]);(0,Ae.useEffect)(()=>{if(y!=="expanded"){P(!1);return}let J=setTimeout(()=>P(!0),x7);return()=>clearTimeout(J)},[y]);let xe=(0,Ae.useCallback)(J=>{K();let Oe=J.trim();Oe&&f.current?.sendMessage(Oe)},[K]);(0,Ae.useImperativeHandle)(r,()=>({open:()=>K(),close:()=>ee(),toggle:()=>{g(J=>J==="open"?"input":"open")},sendMessage:J=>xe(J),sendMessageAndWait:async J=>{K();let Oe=f.current;if(Oe)return await Oe.sendMessageAndWait(J)},reset:()=>f.current?.reset(),focus:()=>{K(),$(J=>J+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[xe,K,ee]);let We=(0,Ae.useCallback)(()=>{b.trim()&&(xe(b),T(""))},[b,xe]),me=(0,Ae.useCallback)(()=>{(f.current?.messages.length??0)>0?(g("open"),$(J=>J+1)):(w.current=!1,g(J=>J==="input"?"expanded":J))},[]),he={mode:"floating"};i.mcpServerUrl&&(he.mcpServerUrl=i.mcpServerUrl),i.channelId&&(he.channelId=i.channelId);let ue=D.length>0&&y!=="input",fe=(0,gt.jsx)("button",{type:"button",onClick:ee,"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,gt.jsx)(Bo,{className:"ww:size-4"})});return(0,gt.jsx)(_l,{value:p,children:(0,gt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":H==="auto"?"auto":void 0,className:q("ww:contents ww:font-[family-name:var(--ww-font-sans)]",H==="dark"&&"dark"),style:W,children:s&&(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("div",{ref:S,"data-waniwani-floating":"dock","data-state":y==="open"?"hidden":"shown","data-appeared":C?"true":"false",className:q("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",ue?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,gt.jsxs)("div",{className:q("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",ue?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:ue?{boxShadow:Ve,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[ue&&y!=="open"&&(0,gt.jsx)("button",{type:"button",onClick:ee,"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,gt.jsx)(Pn,{className:"ww:size-4"})}),D.length>0&&(0,gt.jsx)("div",{className:q("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,gt.jsx)("div",{className:"ww:overflow-hidden",children:(0,gt.jsx)(cl,{suggestions:D,onSelect:J=>{p.emit({name:"suggestion.clicked",properties:{text:J,index:D.indexOf(J),origin:N?.origin??"channel"}}),xe(J)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,gt.jsx)(tf,{animated:C,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:Ve},children:(0,gt.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,gt.jsx)("input",{ref:x,type:"text",value:b,placeholder:I,onChange:J=>T(J.target.value),onFocus:me,onKeyDown:J=>{J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),We())},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,gt.jsx)("button",{type:"button",onClick:We,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,gt.jsx)(On,{className:"ww:size-4"})})]})})]})}),(0,gt.jsx)("div",{role:"dialog","aria-label":i.title??se,"data-waniwani-floating":"panel","data-state":y==="open"?"shown":"hidden",style:{boxShadow:Ve},className:q("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,gt.jsx)(ql,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:he,appearance:i.appearance,title:i.title,headerActions:fe,hideHeader:!1,onScreen:y==="open",welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:V,enableThreadHistory:i.enableThreadHistory,documentUpload:i.documentUpload,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var _a=z(we(),1);var pv=z(ne(),1),mO=(0,_a.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Vl(t,a,n),u=(0,_a.useRef)(null),c=(0,_a.useMemo)(()=>Dl({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,_a.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,_a.useRef)(!1);(0,_a.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,_a.useEffect)(()=>{r?.()},[]);let p=Hl(l.visibility,s);(0,_a.useEffect)(()=>{o?.(p)},[p,o]),Ml({api:l.api,token:l.token,channelId:l.channelId,mode:"inline",paintMark:"chatVisible",painted:s}),(0,_a.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=jl(l);dl({widgetEvents:c,api:l.api,token:l.token,channelId:l.channelId,source:l.source,mode:"inline",pagePrompts:m.page,getSessionId:()=>u.current?.sessionId});let x={mode:"inline"};return l.mcpServerUrl&&(x.mcpServerUrl=l.mcpServerUrl),l.channelId&&(x.channelId=l.channelId),(0,pv.jsx)(_l,{value:c,children:(0,pv.jsx)(ql,{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:m,enableThreadHistory:l.enableThreadHistory,documentUpload:l.documentUpload,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var oc=z(we(),1),bO=z(Pg(),1);function hO(){if(typeof document>"u"&&typeof navigator>"u")return null;let e=(typeof document<"u"?document.modelContext:void 0)??(typeof navigator<"u"?navigator.modelContext:void 0);return e&&typeof e.registerTool=="function"?e:null}function mv(){return hO()!==null}function S7(){return{url:location.href,title:document.title}}async function hv(e){let{endpoint:t,headers:a,sessionId:n,visitorId:r,channelId:o,onWidget:i}=e,l=e.logger??console,s=hO();if(!s)return null;let u=new AbortController,c=()=>u.abort();window.addEventListener("pagehide",c);let d=!1,f=()=>{d||(d=!0,window.removeEventListener("pagehide",c),u.abort())};function p(){return{sessionId:n,visitorId:r,channelId:o,page:S7()}}async function m(w,y){let g=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...a},body:JSON.stringify(w),...y?{signal:y}:{}});if(!g.ok)throw new Error(`webmcp ${w.action} failed: ${g.status}`);return await g.json()}let x=[];try{x=(await m({...p(),action:"list"}))?.tools??[]}catch(w){return l.error("[webmcp] could not list site tools",w),f(),null}let S=[];return await Promise.all(x.map(async w=>{try{await s.registerTool({name:w.name,description:w.description??"",...w.inputSchema?{inputSchema:w.inputSchema}:{},...w.annotations?{annotations:w.annotations}:{},execute:async(y,g)=>{let b=await m({...p(),action:"call",name:w.name,arguments:y??{}},g?.signal);return b?.widget&&i?.(b.widget),{content:b?.content??[]}}},{signal:u.signal}),S.push(w)}catch(y){l.error(`[webmcp] could not register ${w.name}`,y)}})),l.info(`[webmcp] registered ${S.length} site tool(s)`),{get tools(){return S},dispose:f}}function gO(e,t,a){if(e.webmcp?.enabled===!1||t===!1)return null;let n=e.api??"";if(!e.token)return null;let r=e.mcpServerUrl?{mcpServerUrl:e.mcpServerUrl}:void 0;return{toolsEndpoint:Ma(n,"/webmcp",r),...(e.channelId??a)&&{channelId:e.channelId??a},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:Ma(n,"/resource",{token:e.token,...r})}}var mo=z(we(),1);var Wl=z(ne(),1),wO=672,yO=32;function xO({widget:e,toolsEndpoint:t,resourceEndpoint:a,headers:n,onClose:r,isDark:o=!1}){let[i,l]=(0,mo.useState)(null);(0,mo.useEffect)(()=>{let f=()=>l({width:window.innerWidth,height:window.innerHeight});return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);let s=e?.preview===!0;(0,mo.useEffect)(()=>{if(!e||!s)return;let f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,s,r]),(0,mo.useEffect)(()=>{if(!e)return;let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[e]);let u=(0,mo.useCallback)(async f=>{let p=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...f})});if(!p.ok)throw new Error(`webmcp tool call failed: ${p.status}`);return await p.json()},[t,n]);if(!e)return null;let c=i?Math.min(wO,i.width-yO):wO,d=i?i.height-yO:void 0;return(0,Wl.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Waniwani",className:q("ww:fixed ww:inset-0 ww:z-[2147483000] ww:flex ww:items-center ww:justify-center ww:bg-black/45 ww:backdrop-blur-md",o&&"dark"),children:[s&&(0,Wl.jsx)("button",{type:"button","aria-label":"Close",onClick:r,className:"ww:absolute ww:inset-0 ww:h-full ww:w-full ww:cursor-pointer ww:border-none ww:bg-transparent ww:p-0"}),(0,Wl.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:c,maxHeight:d},children:(0,Wl.jsx)(wp,{resourceUri:e.viewUri,resourceEndpoint:a,toolInput:e.data,toolResult:e.result,autoHeight:Hu(e.result._meta),isDark:o,onCallTool:u,onOpenLink:f=>window.open(f,"_blank","noopener")},`${a}|${e.viewUri}`)})]})}var gv=z(ne(),1),vO="waniwani:webmcp:session";function I7(){try{let e=sessionStorage.getItem(vO);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(vO,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function C7(e){let t=e.token?po(e.api??"",e.token,e.channelId):null,a=gO(e,t?.webmcp?.enabled,t?.channelId);return a||ma("[webmcp] not publishing site tools: switched off, or no token"),a}function k7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function T7({toolsEndpoint:e,resourceEndpoint:t,headers:a,channelId:n,onBridge:r}){let[o,i]=oc.default.useState(null),[l,s]=oc.default.useState(k7);return oc.default.useEffect(()=>{let u=!1,c=null;return hv({endpoint:e,headers:a,channelId:n,sessionId:I7(),visitorId:ta(),onWidget:d=>i(d)}).then(d=>{if(c=d,u){d?.dispose();return}r(d)}),()=>{u=!0,c?.dispose()}},[e,a,n,r]),oc.default.useEffect(()=>{let u;try{u=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let c=()=>s(u.matches);return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),(0,gv.jsx)(xO,{widget:o,toolsEndpoint:e,resourceEndpoint:t,isDark:l,onClose:()=>i(null)})}function SO(e){if(!mv())return null;let t=C7(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),document.body.appendChild(a);let n=a.attachShadow({mode:"open"});Hp(n);let r=document.createElement("div");n.appendChild(r);let o=null,i=bO.default.createRoot(r);return i.render((0,gv.jsx)(T7,{toolsEndpoint:t.toolsEndpoint,resourceEndpoint:t.resourceEndpoint,headers:t.headers,channelId:t.channelId,onBridge:l=>{o=l}})),{getTools:()=>(o?.tools??[]).map(l=>l.name),destroy:()=>{o?.dispose(),i.unmount(),a.remove()}}}var xt=null,mn=null,Et=null,ui=null,Vp=null,L7="waniwani-chat-sizing",E7="waniwani-chat-defaults",M7="waniwani-chat-chrome",A7="waniwani-chat-auto-card",R7=`:where([data-waniwani-embed]){height:${Q_}}`,D7=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",_7=":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)}",O7=":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))}",P7="waniwani-chat-composer-auto",N7=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:40rem;margin-inline:auto}";function ic(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 kO(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 Wp(e,t){Hp(e);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 IO="data-waniwani-embed",lc="data-waniwani-auto";function TO(e){let t=document.querySelector(`[${IO}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(IO,""),a.setAttribute(lc,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function B7(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function U7(e,t,a,n){let r=TO(n);ic(L7,R7),e.height&&r instanceof HTMLElement&&(r.style.height=B7(e.height)),e.appearance?.theme&&ic(E7,D7),ic(M7,_7),r.hasAttribute(lc)&&ic(A7,O7),kO(r,e),Et=document.createElement("div"),Et.id="waniwani-chat-embed",Et.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Et);let o=Et,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(),Vp=new ResizeObserver(i),Vp.observe(r);let l=Et.attachShadow({mode:"open"});Wp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=ci.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=po(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return mn=Gp.default.createRoot(s),mn.render(ci.default.createElement(mO,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Vp?.disconnect(),Vp=null,mn?.unmount(),mn=null,Et?.remove(),Et=null,r.hasAttribute(lc)&&r.remove(),xt=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 F7(e,t,a){Et=document.createElement("div"),Et.id="waniwani-chat-embed",Et.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Et);let n=Et.attachShadow({mode:"open"});Wp(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=ci.default.createRef();return mn=Gp.default.createRoot(r),mn.render(ci.default.createElement(pO,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{mn?.unmount(),mn=null,Et?.remove(),Et=null,xt=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 z7(){return{destroy:()=>{xt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function q7(e,t,a,n){let r=TO(n);r.hasAttribute(lc)&&ic(P7,N7),kO(r,e),Et=document.createElement("div"),Et.id="waniwani-chat-embed",Et.style.cssText="display:block;width:100%;",r.appendChild(Et);let o=Et.attachShadow({mode:"open"});Wp(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),ui=document.createElement("div"),ui.id="waniwani-chat-panel",ui.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(ui);let l=ui.attachShadow({mode:"open"});Wp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=ci.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=po(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return mn=Gp.default.createRoot(i),mn.render(ci.default.createElement(dO,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:s,onVisibilityChange:c})),{destroy:()=>{mn?.unmount(),mn=null,Et?.remove(),Et=null,ui?.remove(),ui=null,r.hasAttribute(lc)&&r.remove(),xt=null},open:()=>u.current?.open(),close:()=>u.current?.close(),toggle:()=>u.current?.toggle(),sendMessage:d=>u.current?.sendMessage(d),sendMessageAndWait:async d=>{if(u.current)return u.current.sendMessageAndWait(d)},reset:()=>u.current?.reset(),focus:()=>u.current?.focus(),getMessages:()=>u.current?.getMessages()??[],getSessionId:()=>u.current?.getSessionId()}}function LO(e){if(xt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),xt;let t=uv(),a=zp(),n=tc(e,void 0,a);Xs(n.visitorId);let r;n.mode==="off"?r=z7():n.mode==="floating"?r=F7(n,e,a):n.mode==="composer"?r=q7(n,e,a,t):r=U7(n,e,a,t);let o=n.api??"",i=n.token?OC({api:o,token:n.token,channelId:()=>n.channelId??po(o,n.token,n.channelId)?.channelId,getSource:()=>po(o,n.token,n.channelId)?.source??void 0,getSessionId:()=>r.getSessionId()}):Zd("no public token configured (set data-token or pass token to init())"),l=null;try{l=SO(n)}catch(s){console.error("[Waniwani] WebMCP setup failed",s)}return xt={...r,track:i.track,identify:(s,u)=>i.identify(s,u),setVisitorId:s=>il(s),getVisitorId:()=>ta(),destroy:()=>{i.shutdown(),l?.destroy(),r.destroy()}},xt}function H7(){xt&&xt.destroy()}var EO=Zd("chat widget is not initialized (call WaniWani.chat.init() first)"),Gl=()=>xt?xt.track:EO.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:LO,destroy:H7,open:()=>xt?.open(),close:()=>xt?.close(),toggle:()=>xt?.toggle(),sendMessage:e=>xt?.sendMessage(e),sendMessageAndWait:async e=>{if(xt)return xt.sendMessageAndWait(e)},reset:()=>xt?.reset(),focus:()=>xt?.focus(),getMessages:()=>xt?.getMessages()??[],getSessionId:()=>xt?.getSessionId(),track:Object.assign(e=>Gl()(e),{priceShown:e=>Gl().priceShown(e),pricesCompared:e=>Gl().pricesCompared(e),optionSelected:e=>Gl().optionSelected(e),leadQualified:e=>Gl().leadQualified(e),converted:e=>Gl().converted(e)}),identify:(e,t)=>xt?xt.identify(e,t):EO.identify(e,t),setVisitorId:e=>il(e),getVisitorId:()=>ta()};function CO(){if(zp().token)try{LO()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",CO):CO();})();
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
react/cjs/react.production.js:
|