@waniwani/sdk 0.22.0-beta.1 → 0.22.0-beta.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 +60 -60
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.js +12 -12
- package/dist/chat/index.js.map +1 -1
- package/package.json +3 -3
package/dist/chat/embed.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var UO=Object.create;var dc=Object.defineProperty;var FO=Object.getOwnPropertyDescriptor;var zO=Object.getOwnPropertyNames;var qO=Object.getPrototypeOf,HO=Object.prototype.hasOwnProperty;var jO=(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 oa=(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})},VO=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of zO(t))!HO.call(e,r)&&r!==a&&dc(e,r,{get:()=>t[r],enumerable:!(n=FO(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?UO(qO(e)):{},VO(t||!e||!e.__esModule?dc(a,"default",{value:e,enumerable:!0}):a,e));var ne=(e,t,a)=>jO(e,typeof t!="symbol"?t+"":t,a);var Ov=oa(xe=>{"use strict";var Yp=Symbol.for("react.transitional.element"),WO=Symbol.for("react.portal"),GO=Symbol.for("react.fragment"),$O=Symbol.for("react.strict_mode"),XO=Symbol.for("react.profiler"),KO=Symbol.for("react.consumer"),YO=Symbol.for("react.context"),ZO=Symbol.for("react.forward_ref"),QO=Symbol.for("react.suspense"),JO=Symbol.for("react.memo"),Ev=Symbol.for("react.lazy"),eP=Symbol.for("react.activity"),Cv=Symbol.iterator;function tP(e){return e===null||typeof e!="object"?null:(e=Cv&&e[Cv]||e["@@iterator"],typeof e=="function"?e:null)}var Mv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Av=Object.assign,Rv={};function mi(e,t,a){this.props=e,this.context=t,this.refs=Rv,this.updater=a||Mv}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 Dv(){}Dv.prototype=mi.prototype;function Zp(e,t,a){this.props=e,this.context=t,this.refs=Rv,this.updater=a||Mv}var Qp=Zp.prototype=new Dv;Qp.constructor=Zp;Av(Qp,mi.prototype);Qp.isPureReactComponent=!0;var kv=Array.isArray;function Kp(){}var dt={H:null,A:null,T:null,S:null},_v=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 aP(e,t){return Jp(e.type,t,e.props)}function em(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yp}function nP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Tv=/\/+/g;function Xp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?nP(""+e.key):t.toString(36)}function rP(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 WO:i=!0;break;case Ev:return i=e._init,pi(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Xp(e,0):n,kv(r)?(a="",i!=null&&(a=i.replace(Tv,"$&/")+"/"),pi(r,t,a,"",function(u){return u})):r!=null&&(em(r)&&(r=aP(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Tv,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(kv(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=tP(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(rP(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 oP(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 Lv=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)},iP={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}};xe.Activity=eP;xe.Children=iP;xe.Component=mi;xe.Fragment=GO;xe.Profiler=XO;xe.PureComponent=Zp;xe.StrictMode=$O;xe.Suspense=QO;xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dt;xe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return dt.H.useMemoCache(e)}};xe.cache=function(e){return function(){return e.apply(null,arguments)}};xe.cacheSignal=function(){return null};xe.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Av({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!_v.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)};xe.createContext=function(e){return e={$$typeof:YO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:KO,_context:e},e};xe.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)_v.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)};xe.createRef=function(){return{current:null}};xe.forwardRef=function(e){return{$$typeof:ZO,render:e}};xe.isValidElement=em;xe.lazy=function(e){return{$$typeof:Ev,_payload:{_status:-1,_result:e},_init:oP}};xe.memo=function(e,t){return{$$typeof:JO,type:e,compare:t===void 0?null:t}};xe.startTransition=function(e){var t=dt.T,a={};dt.T=a;try{var n=e(),r=dt.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Kp,Lv)}catch(o){Lv(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),dt.T=t}};xe.unstable_useCacheRefresh=function(){return dt.H.useCacheRefresh()};xe.use=function(e){return dt.H.use(e)};xe.useActionState=function(e,t,a){return dt.H.useActionState(e,t,a)};xe.useCallback=function(e,t){return dt.H.useCallback(e,t)};xe.useContext=function(e){return dt.H.useContext(e)};xe.useDebugValue=function(){};xe.useDeferredValue=function(e,t){return dt.H.useDeferredValue(e,t)};xe.useEffect=function(e,t){return dt.H.useEffect(e,t)};xe.useEffectEvent=function(e){return dt.H.useEffectEvent(e)};xe.useId=function(){return dt.H.useId()};xe.useImperativeHandle=function(e,t,a){return dt.H.useImperativeHandle(e,t,a)};xe.useInsertionEffect=function(e,t){return dt.H.useInsertionEffect(e,t)};xe.useLayoutEffect=function(e,t){return dt.H.useLayoutEffect(e,t)};xe.useMemo=function(e,t){return dt.H.useMemo(e,t)};xe.useOptimistic=function(e,t){return dt.H.useOptimistic(e,t)};xe.useReducer=function(e,t,a){return dt.H.useReducer(e,t,a)};xe.useRef=function(e){return dt.H.useRef(e)};xe.useState=function(e){return dt.H.useState(e)};xe.useSyncExternalStore=function(e,t,a){return dt.H.useSyncExternalStore(e,t,a)};xe.useTransition=function(){return dt.H.useTransition()};xe.version="19.2.4"});var he=oa((X7,Pv)=>{"use strict";Pv.exports=Ov()});var Wv=oa(yt=>{"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 Mn(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}yt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Nv=performance,yt.unstable_now=function(){return Nv.now()}):(tm=Date,Bv=tm.now(),yt.unstable_now=function(){return tm.now()-Bv});var Nv,tm,Bv,Wn=[],Cr=[],lP=1,Ya=null,ia=3,om=!1,Gl=!1,$l=!1,im=!1,zv=typeof setTimeout=="function"?setTimeout:null,qv=typeof clearTimeout=="function"?clearTimeout:null,Uv=typeof setImmediate<"u"?setImmediate:null;function hc(e){for(var t=Mn(Cr);t!==null;){if(t.callback===null)gc(Cr);else if(t.startTime<=e)gc(Cr),t.sortIndex=t.expirationTime,rm(Wn,t);else break;t=Mn(Cr)}}function lm(e){if($l=!1,hc(e),!Gl)if(Mn(Wn)!==null)Gl=!0,gi||(gi=!0,hi());else{var t=Mn(Cr);t!==null&&sm(lm,t.startTime-e)}}var gi=!1,Xl=-1,Hv=5,jv=-1;function Vv(){return im?!0:!(yt.unstable_now()-jv<Hv)}function am(){if(im=!1,gi){var e=yt.unstable_now();jv=e;var t=!0;try{e:{Gl=!1,$l&&($l=!1,qv(Xl),Xl=-1),om=!0;var a=ia;try{t:{for(hc(e),Ya=Mn(Wn);Ya!==null&&!(Ya.expirationTime>e&&Vv());){var n=Ya.callback;if(typeof n=="function"){Ya.callback=null,ia=Ya.priorityLevel;var r=n(Ya.expirationTime<=e);if(e=yt.unstable_now(),typeof r=="function"){Ya.callback=r,hc(e),t=!0;break t}Ya===Mn(Wn)&&gc(Wn),hc(e)}else gc(Wn);Ya=Mn(Wn)}if(Ya!==null)t=!0;else{var o=Mn(Cr);o!==null&&sm(lm,o.startTime-e),t=!1}}break e}finally{Ya=null,ia=a,om=!1}t=void 0}}finally{t?hi():gi=!1}}}var hi;typeof Uv=="function"?hi=function(){Uv(am)}:typeof MessageChannel<"u"?(nm=new MessageChannel,Fv=nm.port2,nm.port1.onmessage=am,hi=function(){Fv.postMessage(null)}):hi=function(){zv(am,0)};var nm,Fv;function sm(e,t){Xl=zv(function(){e(yt.unstable_now())},t)}yt.unstable_IdlePriority=5;yt.unstable_ImmediatePriority=1;yt.unstable_LowPriority=4;yt.unstable_NormalPriority=3;yt.unstable_Profiling=null;yt.unstable_UserBlockingPriority=2;yt.unstable_cancelCallback=function(e){e.callback=null};yt.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"):Hv=0<e?Math.floor(1e3/e):5};yt.unstable_getCurrentPriorityLevel=function(){return ia};yt.unstable_next=function(e){switch(ia){case 1:case 2:case 3:var t=3;break;default:t=ia}var a=ia;ia=t;try{return e()}finally{ia=a}};yt.unstable_requestPaint=function(){im=!0};yt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ia;ia=e;try{return t()}finally{ia=a}};yt.unstable_scheduleCallback=function(e,t,a){var n=yt.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:lP++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,rm(Cr,e),Mn(Wn)===null&&e===Mn(Cr)&&($l?(qv(Xl),Xl=-1):$l=!0,sm(lm,a-n))):(e.sortIndex=r,rm(Wn,e),Gl||om||(Gl=!0,gi||(gi=!0,hi()))),e};yt.unstable_shouldYield=Vv;yt.unstable_wrapCallback=function(e){var t=ia;return function(){var a=ia;ia=t;try{return e.apply(this,arguments)}finally{ia=a}}}});var $v=oa((Y7,Gv)=>{"use strict";Gv.exports=Wv()});var Kv=oa(fa=>{"use strict";var sP=he();function Xv(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 kr(){}var da={d:{f:kr,r:function(){throw Error(Xv(522))},D:kr,C:kr,L:kr,m:kr,X:kr,S:kr,M:kr},p:0,findDOMNode:null},uP=Symbol.for("react.portal");function cP(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:uP,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Kl=sP.__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(Xv(299));return cP(e,t,null,a)};fa.flushSync=function(e){var t=Kl.T,a=da.p;try{if(Kl.T=null,da.p=2,e)return e()}finally{Kl.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 Kl.H.useFormState(e,t,a)};fa.useFormStatus=function(){return Kl.H.useHostTransitionStatus()};fa.version="19.2.4"});var um=oa((Q7,Zv)=>{"use strict";function Yv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Yv)}catch(e){console.error(e)}}Yv(),Zv.exports=Kv()});var uC=oa(Hd=>{"use strict";var Ht=$v(),IS=he(),dP=um();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 CS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ps(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 kS(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 TS(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 Qv(e){if(Ps(e)!==e)throw Error(B(188))}function fP(e){var t=e.alternate;if(!t){if(t=Ps(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 Qv(r),e;if(o===n)return Qv(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 LS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=LS(e),t!==null)return t;e=e.sibling}return null}var mt=Object.assign,pP=Symbol.for("react.element"),yc=Symbol.for("react.transitional.element"),ns=Symbol.for("react.portal"),Si=Symbol.for("react.fragment"),ES=Symbol.for("react.strict_mode"),jm=Symbol.for("react.profiler"),MS=Symbol.for("react.consumer"),Jn=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"),Tr=Symbol.for("react.lazy"),Gm=Symbol.for("react.activity"),mP=Symbol.for("react.memo_cache_sentinel"),Jv=Symbol.iterator;function Yl(e){return e===null||typeof e!="object"?null:(e=Jv&&e[Jv]||e["@@iterator"],typeof e=="function"?e:null)}var hP=Symbol.for("react.client.reference");function $m(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===hP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Si:return"Fragment";case jm:return"Profiler";case ES:return"StrictMode";case Vm:return"Suspense";case Wm:return"SuspenseList";case Gm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ns:return"Portal";case Jn:return e.displayName||"Context";case MS: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 Tr:t=e._payload,e=e._init;try{return $m(e(t))}catch{}}return null}var rs=Array.isArray,fe=IS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qe=dP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,So={pending:!1,data:null,method:null,action:null},Xm=[],Ii=-1;function On(e){return{current:e}}function Yt(e){0>Ii||(e.current=Xm[Ii],Xm[Ii]=null,Ii--)}function ct(e,t){Ii++,Xm[Ii]=e.current,e.current=t}var _n=On(null),bs=On(null),Br=On(null),Zc=On(null);function Qc(e,t){switch(ct(Br,t),ct(bs,e),ct(_n,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?iS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=iS(t),e=K0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Yt(_n),ct(_n,e)}function qi(){Yt(_n),Yt(bs),Yt(Br)}function Km(e){e.memoizedState!==null&&ct(Zc,e);var t=_n.current,a=K0(t,e.type);t!==a&&(ct(bs,e),ct(_n,a))}function Jc(e){bs.current===e&&(Yt(_n),Yt(bs)),Zc.current===e&&(Yt(Zc),Ds._currentValue=So)}var cm,eb;function yo(e){if(cm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);cm=t&&t[1]||"",eb=-1<a.stack.indexOf(`
|
|
1
|
+
"use strict";var WaniWaniChatEmbed=(()=>{var zO=Object.create;var fc=Object.defineProperty;var qO=Object.getOwnPropertyDescriptor;var HO=Object.getOwnPropertyNames;var jO=Object.getPrototypeOf,VO=Object.prototype.hasOwnProperty;var WO=(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 oa=(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})},GO=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of HO(t))!VO.call(e,r)&&r!==a&&fc(e,r,{get:()=>t[r],enumerable:!(n=qO(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?zO(jO(e)):{},GO(t||!e||!e.__esModule?fc(a,"default",{value:e,enumerable:!0}):a,e));var re=(e,t,a)=>WO(e,typeof t!="symbol"?t+"":t,a);var Nv=oa(ve=>{"use strict";var Qp=Symbol.for("react.transitional.element"),$O=Symbol.for("react.portal"),XO=Symbol.for("react.fragment"),KO=Symbol.for("react.strict_mode"),YO=Symbol.for("react.profiler"),ZO=Symbol.for("react.consumer"),QO=Symbol.for("react.context"),JO=Symbol.for("react.forward_ref"),eP=Symbol.for("react.suspense"),tP=Symbol.for("react.memo"),Av=Symbol.for("react.lazy"),aP=Symbol.for("react.activity"),Tv=Symbol.iterator;function nP(e){return e===null||typeof e!="object"?null:(e=Tv&&e[Tv]||e["@@iterator"],typeof e=="function"?e:null)}var Rv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dv=Object.assign,_v={};function hi(e,t,a){this.props=e,this.context=t,this.refs=_v,this.updater=a||Rv}hi.prototype.isReactComponent={};hi.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")};hi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ov(){}Ov.prototype=hi.prototype;function Jp(e,t,a){this.props=e,this.context=t,this.refs=_v,this.updater=a||Rv}var em=Jp.prototype=new Ov;em.constructor=Jp;Dv(em,hi.prototype);em.isPureReactComponent=!0;var Lv=Array.isArray;function Zp(){}var dt={H:null,A:null,T:null,S:null},Pv=Object.prototype.hasOwnProperty;function tm(e,t,a){var n=a.ref;return{$$typeof:Qp,type:e,key:t,ref:n!==void 0?n:null,props:a}}function rP(e,t){return tm(e.type,t,e.props)}function am(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qp}function oP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Ev=/\/+/g;function Yp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?oP(""+e.key):t.toString(36)}function iP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Zp,Zp):(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 mi(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 Qp:case $O:i=!0;break;case Av:return i=e._init,mi(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Yp(e,0):n,Lv(r)?(a="",i!=null&&(a=i.replace(Ev,"$&/")+"/"),mi(r,t,a,"",function(u){return u})):r!=null&&(am(r)&&(r=rP(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ev,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(Lv(e))for(var s=0;s<e.length;s++)n=e[s],o=l+Yp(n,s),i+=mi(n,t,a,o,r);else if(s=nP(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+Yp(n,s++),i+=mi(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return mi(iP(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 mi(e,n,"","",function(o){return t.call(a,o,r++)}),n}function lP(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 Mv=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)},sP={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(!am(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Activity=aP;ve.Children=sP;ve.Component=hi;ve.Fragment=XO;ve.Profiler=YO;ve.PureComponent=Jp;ve.StrictMode=KO;ve.Suspense=eP;ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dt;ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return dt.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=Dv({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Pv.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 tm(e.type,r,n)};ve.createContext=function(e){return e={$$typeof:QO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ZO,_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)Pv.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 tm(e,o,r)};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:JO,render:e}};ve.isValidElement=am;ve.lazy=function(e){return{$$typeof:Av,_payload:{_status:-1,_result:e},_init:lP}};ve.memo=function(e,t){return{$$typeof:tP,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=dt.T,a={};dt.T=a;try{var n=e(),r=dt.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Zp,Mv)}catch(o){Mv(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),dt.T=t}};ve.unstable_useCacheRefresh=function(){return dt.H.useCacheRefresh()};ve.use=function(e){return dt.H.use(e)};ve.useActionState=function(e,t,a){return dt.H.useActionState(e,t,a)};ve.useCallback=function(e,t){return dt.H.useCallback(e,t)};ve.useContext=function(e){return dt.H.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e,t){return dt.H.useDeferredValue(e,t)};ve.useEffect=function(e,t){return dt.H.useEffect(e,t)};ve.useEffectEvent=function(e){return dt.H.useEffectEvent(e)};ve.useId=function(){return dt.H.useId()};ve.useImperativeHandle=function(e,t,a){return dt.H.useImperativeHandle(e,t,a)};ve.useInsertionEffect=function(e,t){return dt.H.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return dt.H.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return dt.H.useMemo(e,t)};ve.useOptimistic=function(e,t){return dt.H.useOptimistic(e,t)};ve.useReducer=function(e,t,a){return dt.H.useReducer(e,t,a)};ve.useRef=function(e){return dt.H.useRef(e)};ve.useState=function(e){return dt.H.useState(e)};ve.useSyncExternalStore=function(e,t,a){return dt.H.useSyncExternalStore(e,t,a)};ve.useTransition=function(){return dt.H.useTransition()};ve.version="19.2.4"});var he=oa((Y7,Bv)=>{"use strict";Bv.exports=Nv()});var $v=oa(yt=>{"use strict";function im(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 Mn(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}yt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Uv=performance,yt.unstable_now=function(){return Uv.now()}):(nm=Date,Fv=nm.now(),yt.unstable_now=function(){return nm.now()-Fv});var Uv,nm,Fv,Wn=[],Cr=[],uP=1,Ya=null,ia=3,lm=!1,$l=!1,Xl=!1,sm=!1,Hv=typeof setTimeout=="function"?setTimeout:null,jv=typeof clearTimeout=="function"?clearTimeout:null,zv=typeof setImmediate<"u"?setImmediate:null;function gc(e){for(var t=Mn(Cr);t!==null;){if(t.callback===null)wc(Cr);else if(t.startTime<=e)wc(Cr),t.sortIndex=t.expirationTime,im(Wn,t);else break;t=Mn(Cr)}}function um(e){if(Xl=!1,gc(e),!$l)if(Mn(Wn)!==null)$l=!0,wi||(wi=!0,gi());else{var t=Mn(Cr);t!==null&&cm(um,t.startTime-e)}}var wi=!1,Kl=-1,Vv=5,Wv=-1;function Gv(){return sm?!0:!(yt.unstable_now()-Wv<Vv)}function rm(){if(sm=!1,wi){var e=yt.unstable_now();Wv=e;var t=!0;try{e:{$l=!1,Xl&&(Xl=!1,jv(Kl),Kl=-1),lm=!0;var a=ia;try{t:{for(gc(e),Ya=Mn(Wn);Ya!==null&&!(Ya.expirationTime>e&&Gv());){var n=Ya.callback;if(typeof n=="function"){Ya.callback=null,ia=Ya.priorityLevel;var r=n(Ya.expirationTime<=e);if(e=yt.unstable_now(),typeof r=="function"){Ya.callback=r,gc(e),t=!0;break t}Ya===Mn(Wn)&&wc(Wn),gc(e)}else wc(Wn);Ya=Mn(Wn)}if(Ya!==null)t=!0;else{var o=Mn(Cr);o!==null&&cm(um,o.startTime-e),t=!1}}break e}finally{Ya=null,ia=a,lm=!1}t=void 0}}finally{t?gi():wi=!1}}}var gi;typeof zv=="function"?gi=function(){zv(rm)}:typeof MessageChannel<"u"?(om=new MessageChannel,qv=om.port2,om.port1.onmessage=rm,gi=function(){qv.postMessage(null)}):gi=function(){Hv(rm,0)};var om,qv;function cm(e,t){Kl=Hv(function(){e(yt.unstable_now())},t)}yt.unstable_IdlePriority=5;yt.unstable_ImmediatePriority=1;yt.unstable_LowPriority=4;yt.unstable_NormalPriority=3;yt.unstable_Profiling=null;yt.unstable_UserBlockingPriority=2;yt.unstable_cancelCallback=function(e){e.callback=null};yt.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"):Vv=0<e?Math.floor(1e3/e):5};yt.unstable_getCurrentPriorityLevel=function(){return ia};yt.unstable_next=function(e){switch(ia){case 1:case 2:case 3:var t=3;break;default:t=ia}var a=ia;ia=t;try{return e()}finally{ia=a}};yt.unstable_requestPaint=function(){sm=!0};yt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ia;ia=e;try{return t()}finally{ia=a}};yt.unstable_scheduleCallback=function(e,t,a){var n=yt.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:uP++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,im(Cr,e),Mn(Wn)===null&&e===Mn(Cr)&&(Xl?(jv(Kl),Kl=-1):Xl=!0,cm(um,a-n))):(e.sortIndex=r,im(Wn,e),$l||lm||($l=!0,wi||(wi=!0,gi()))),e};yt.unstable_shouldYield=Gv;yt.unstable_wrapCallback=function(e){var t=ia;return function(){var a=ia;ia=t;try{return e.apply(this,arguments)}finally{ia=a}}}});var Kv=oa((Q7,Xv)=>{"use strict";Xv.exports=$v()});var Zv=oa(fa=>{"use strict";var cP=he();function Yv(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 kr(){}var da={d:{f:kr,r:function(){throw Error(Yv(522))},D:kr,C:kr,L:kr,m:kr,X:kr,S:kr,M:kr},p:0,findDOMNode:null},dP=Symbol.for("react.portal");function fP(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dP,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Yl=cP.__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(Yv(299));return fP(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 dm=oa((eW,Jv)=>{"use strict";function Qv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qv)}catch(e){console.error(e)}}Qv(),Jv.exports=Zv()});var dC=oa(jd=>{"use strict";var Ht=Kv(),kS=he(),pP=dm();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 TS(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 LS(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 ES(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 eb(e){if(Ns(e)!==e)throw Error(B(188))}function mP(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 eb(r),e;if(o===n)return eb(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 MS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=MS(e),t!==null)return t;e=e.sibling}return null}var mt=Object.assign,hP=Symbol.for("react.element"),xc=Symbol.for("react.transitional.element"),rs=Symbol.for("react.portal"),Ii=Symbol.for("react.fragment"),AS=Symbol.for("react.strict_mode"),Wm=Symbol.for("react.profiler"),RS=Symbol.for("react.consumer"),Jn=Symbol.for("react.context"),zh=Symbol.for("react.forward_ref"),Gm=Symbol.for("react.suspense"),$m=Symbol.for("react.suspense_list"),qh=Symbol.for("react.memo"),Tr=Symbol.for("react.lazy"),Xm=Symbol.for("react.activity"),gP=Symbol.for("react.memo_cache_sentinel"),tb=Symbol.iterator;function Zl(e){return e===null||typeof e!="object"?null:(e=tb&&e[tb]||e["@@iterator"],typeof e=="function"?e:null)}var wP=Symbol.for("react.client.reference");function Km(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===wP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ii:return"Fragment";case Wm:return"Profiler";case AS:return"StrictMode";case Gm:return"Suspense";case $m:return"SuspenseList";case Xm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case rs:return"Portal";case Jn:return e.displayName||"Context";case RS:return(e._context.displayName||"Context")+".Consumer";case zh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qh:return t=e.displayName||null,t!==null?t:Km(e.type)||"Memo";case Tr:t=e._payload,e=e._init;try{return Km(e(t))}catch{}}return null}var os=Array.isArray,fe=kS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ze=pP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Io={pending:!1,data:null,method:null,action:null},Ym=[],Ci=-1;function On(e){return{current:e}}function Yt(e){0>Ci||(e.current=Ym[Ci],Ym[Ci]=null,Ci--)}function ct(e,t){Ci++,Ym[Ci]=e.current,e.current=t}var _n=On(null),Ss=On(null),Br=On(null),Qc=On(null);function Jc(e,t){switch(ct(Br,t),ct(Ss,e),ct(_n,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sS(t),e=Z0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Yt(_n),ct(_n,e)}function Hi(){Yt(_n),Yt(Ss),Yt(Br)}function Zm(e){e.memoizedState!==null&&ct(Qc,e);var t=_n.current,a=Z0(t,e.type);t!==a&&(ct(Ss,e),ct(_n,a))}function ed(e){Ss.current===e&&(Yt(_n),Yt(Ss)),Qc.current===e&&(Yt(Qc),_s._currentValue=Io)}var fm,ab;function xo(e){if(fm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);fm=t&&t[1]||"",ab=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+fm+e+ab}var pm=!1;function mm(e,t){if(!e||pm)return"";pm=!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{pm=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?xo(a):""}function yP(e,t){switch(e.tag){case 26:case 27:case 5:return xo(e.type);case 16:return xo("Lazy");case 13:return e.child!==t&&t!==null?xo("Suspense Fallback"):xo("Suspense");case 19:return xo("SuspenseList");case 0:case 15:return mm(e.type,!1);case 11:return mm(e.type.render,!1);case 1:return mm(e.type,!0);case 31:return xo("Activity");default:return""}}function nb(e){try{var t="",a=null;do t+=yP(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=Ht.unstable_scheduleCallback,pm=Ht.unstable_cancelCallback,wP=Ht.unstable_shouldYield,yP=Ht.unstable_requestPaint,Fa=Ht.unstable_now,xP=Ht.unstable_getCurrentPriorityLevel,AS=Ht.unstable_ImmediatePriority,RS=Ht.unstable_UserBlockingPriority,ed=Ht.unstable_NormalPriority,vP=Ht.unstable_LowPriority,DS=Ht.unstable_IdlePriority,bP=Ht.log,SP=Ht.unstable_setDisableYieldValue,Ns=null,za=null;function Dr(e){if(typeof bP=="function"&&SP(e),za&&typeof za.setStrictMode=="function")try{za.setStrictMode(Ns,e)}catch{}}var qa=Math.clz32?Math.clz32:kP,IP=Math.log,CP=Math.LN2;function kP(e){return e>>>=0,e===0?32:31-(IP(e)/CP|0)|0}var xc=256,vc=262144,bc=4194304;function xo(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=xo(n):(i&=l,i!==0?r=xo(i):a||(a=l&~e,a!==0&&(r=xo(a))))):(l=n&~o,l!==0?r=xo(l):i!==0?r=xo(i):a||(a=n&~e,a!==0&&(r=xo(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 Bs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function TP(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 _S(){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 Us(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function LP(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-qa(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&&OS(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function OS(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-qa(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function PS(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-qa(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function NS(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 BS(){var e=Qe.p;return e!==0?e:(e=window.event,e===void 0?32:iC(e.type))}function ab(e,t){var a=Qe.p;try{return Qe.p=e,t()}finally{Qe.p=a}}var Yr=Math.random().toString(36).slice(2),ea="__reactFiber$"+Yr,Ma="__reactProps$"+Yr,Qi="__reactContainer$"+Yr,Zm="__reactEvents$"+Yr,EP="__reactListeners$"+Yr,MP="__reactHandles$"+Yr,nb="__reactResources$"+Yr,Fs="__reactMarker$"+Yr;function jh(e){delete e[ea],delete e[Ma],delete e[Zm],delete e[EP],delete e[MP]}function Ci(e){var t=e[ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Qi]||a[ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=dS(e);e!==null;){if(a=e[ea])return a;e=dS(e)}return t}e=a,a=e.parentNode}return null}function Ji(e){if(e=e[ea]||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 os(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[nb];return t||(t=e[nb]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[Fs]=!0}var US=new Set,FS={};function Do(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(FS[e]=t,e=0;e<t.length;e++)US.add(t[e])}var AP=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]*$"),rb={},ob={};function RP(e){return Ym.call(ob,e)?!0:Ym.call(rb,e)?!1:AP.test(e)?ob[e]=!0:(rb[e]=!0,!1)}function Nc(e,t,a){if(RP(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 Gn(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 Qa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DP(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=zS(e)?"checked":"value";e._valueTracker=DP(e,t,""+e[t])}}function qS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=zS(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 _P=/[\n"\\]/g;function tn(e){return e.replace(_P,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=""+Qa(t)):e.value!==""+Qa(t)&&(e.value=""+Qa(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?eh(e,i,Qa(t)):a!=null?eh(e,i,Qa(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=""+Qa(l):e.removeAttribute("name")}function HS(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?""+Qa(a):"",t=t!=null?""+Qa(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=""+Qa(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 jS(e,t,a){if(t!=null&&(t=""+Qa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Qa(a):""}function VS(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(B(92));if(rs(n)){if(1<n.length)throw Error(B(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Qa(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 OP=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 ib(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||OP.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function WS(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&&ib(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&ib(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 PP=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"]]),NP=/^[\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 NP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}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 lb(e){var t=Ji(e);if(t&&(e=t.stateNode)){var a=e[Ma]||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="'+tn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Ma]||null;if(!r)throw Error(B(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&&qS(n)}break e;case"textarea":jS(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Pi(e,!!a.multiple,t,!1)}}}var hm=!1;function GS(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,lb(t),e)))for(t=0;t<e.length;t++)lb(e[t])}}function Ss(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ma]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(B(231,t,typeof a));return a}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ah=!1;if(or)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,_r=null,Gh=null,Uc=null;function $S(){if(Uc)return Uc;var e,t=Gh,a=t.length,n,r="value"in _r?_r.value:_r.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 sb(){return!1}function Aa(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:sb,this.isPropagationStopped=sb,this}return mt(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 _o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ld=Aa(_o),zs=mt({},_o,{view:0,detail:0}),BP=Aa(zs),gm,wm,Zl,Ed=mt({},zs,{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!==Zl&&(Zl&&e.type==="mousemove"?(gm=e.screenX-Zl.screenX,wm=e.screenY-Zl.screenY):wm=gm=0,Zl=e),gm)},movementY:function(e){return"movementY"in e?e.movementY:wm}}),ub=Aa(Ed),UP=mt({},Ed,{dataTransfer:0}),FP=Aa(UP),zP=mt({},zs,{relatedTarget:0}),ym=Aa(zP),qP=mt({},_o,{animationName:0,elapsedTime:0,pseudoElement:0}),HP=Aa(qP),jP=mt({},_o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VP=Aa(jP),WP=mt({},_o,{data:0}),cb=Aa(WP),GP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$P={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"},XP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=XP[e])?!!t[e]:!1}function $h(){return KP}var YP=mt({},zs,{key:function(e){if(e.key){var t=GP[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"?$P[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}}),ZP=Aa(YP),QP=mt({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),db=Aa(QP),JP=mt({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$h}),eN=Aa(JP),tN=mt({},_o,{propertyName:0,elapsedTime:0,pseudoElement:0}),aN=Aa(tN),nN=mt({},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}),rN=Aa(nN),oN=mt({},_o,{newState:0,oldState:0}),iN=Aa(oN),lN=[9,13,27,32],Xh=or&&"CompositionEvent"in window,ss=null;or&&"documentMode"in document&&(ss=document.documentMode);var sN=or&&"TextEvent"in window&&!ss,XS=or&&(!Xh||ss&&8<ss&&11>=ss),fb=" ",pb=!1;function KS(e,t){switch(e){case"keyup":return lN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function YS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ti=!1;function uN(e,t){switch(e){case"compositionend":return YS(t);case"keypress":return t.which!==32?null:(pb=!0,fb);case"textInput":return e=t.data,e===fb&&pb?null:e;default:return null}}function cN(e,t){if(Ti)return e==="compositionend"||!Xh&&KS(e,t)?(e=$S(),Uc=Gh=_r=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 XS&&t.locale!=="ko"?null:t.data;default:return null}}var dN={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 mb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dN[e.type]:t==="textarea"}function ZS(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 us=null,Is=null;function fN(e){G0(e,0)}function Md(e){var t=os(e);if(qS(t))return e}function hb(e,t){if(e==="change")return t}var QS=!1;or&&(or?(kc="oninput"in document,kc||(xm=document.createElement("div"),xm.setAttribute("oninput","return;"),kc=typeof xm.oninput=="function"),Cc=kc):Cc=!1,QS=Cc&&(!document.documentMode||9<document.documentMode));var Cc,kc,xm;function gb(){us&&(us.detachEvent("onpropertychange",JS),Is=us=null)}function JS(e){if(e.propertyName==="value"&&Md(Is)){var t=[];ZS(t,Is,e,Wh(e)),GS(fN,t)}}function pN(e,t,a){e==="focusin"?(gb(),us=t,Is=a,us.attachEvent("onpropertychange",JS)):e==="focusout"&&gb()}function mN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Md(Is)}function hN(e,t){if(e==="click")return Md(t)}function gN(e,t){if(e==="input"||e==="change")return Md(t)}function wN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ja=typeof Object.is=="function"?Object.is:wN;function Cs(e,t){if(ja(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)||!ja(e[r],t[r]))return!1}return!0}function wb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yb(e,t){var a=wb(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=wb(a)}}function eI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?eI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tI(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 yN=or&&"documentMode"in document&&11>=document.documentMode,Li=null,nh=null,cs=null,rh=!1;function xb(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}),cs&&Cs(cs,n)||(cs=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 wo(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ei={animationend:wo("Animation","AnimationEnd"),animationiteration:wo("Animation","AnimationIteration"),animationstart:wo("Animation","AnimationStart"),transitionrun:wo("Transition","TransitionRun"),transitionstart:wo("Transition","TransitionStart"),transitioncancel:wo("Transition","TransitionCancel"),transitionend:wo("Transition","TransitionEnd")},vm={},aI={};or&&(aI=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 Oo(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 aI)return vm[e]=t[a];return e}var nI=Oo("animationend"),rI=Oo("animationiteration"),oI=Oo("animationstart"),xN=Oo("transitionrun"),vN=Oo("transitionstart"),bN=Oo("transitioncancel"),iI=Oo("transitionend"),lI=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 vn(e,t){lI.set(e,t),Do(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)},Za=[],Mi=0,Yh=0;function Ad(){for(var e=Mi,t=Yh=Mi=0;t<e;){var a=Za[t];Za[t++]=null;var n=Za[t];Za[t++]=null;var r=Za[t];Za[t++]=null;var o=Za[t];if(Za[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&&sI(a,r,o)}}function Rd(e,t,a,n){Za[Mi++]=e,Za[Mi++]=t,Za[Mi++]=a,Za[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 Po(e,t){return Rd(e,null,null,t),nd(e)}function sI(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-qa(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<xs)throw xs=0,Th=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 SN(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 Ba(e,t,a,n){return new SN(e,t,a,n)}function Qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=Ba(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 uI(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=kB(e,a,_n.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Gm:return e=Ba(31,a,t,r),e.elementType=Gm,e.lanes=o,e;case Si:return Io(a.children,r,o,t);case ES:i=8,r|=24;break;case jm:return e=Ba(12,a,t,r|2),e.elementType=jm,e.lanes=o,e;case Vm:return e=Ba(13,a,t,r),e.elementType=Vm,e.lanes=o,e;case Wm:return e=Ba(19,a,t,r),e.elementType=Wm,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jn:i=10;break e;case MS:i=9;break e;case Uh:i=11;break e;case Fh:i=14;break e;case Tr:i=16,n=null;break e}i=29,a=Error(B(130,e===null?"null":typeof e,"")),n=null}return t=Ba(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function Io(e,t,a,n){return e=Ba(7,e,n,t),e.lanes=a,e}function bm(e,t,a){return e=Ba(6,e,null,t),e.lanes=a,e}function cI(e){var t=Ba(18,null,null,0);return t.stateNode=e,t}function Sm(e,t,a){return t=Ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vb=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var a=vb.get(e);return a!==void 0?a:(t={value:e,source:t,stack:tb(t)},vb.set(e,t),t)}return{value:e,source:t,stack:tb(t)}}var Ri=[],Di=0,rd=null,ks=0,Ja=[],en=0,Gr=null,An=1,Rn="";function Zn(e,t){Ri[Di++]=ks,Ri[Di++]=rd,rd=e,ks=t}function dI(e,t,a){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,Gr=e;var n=An;e=Rn;var r=32-qa(n)-1;n&=~(1<<r),a+=1;var o=32-qa(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,An=1<<32-qa(t)+r|a<<r|n,Rn=o+e}else An=1<<o|a<<r|n,Rn=e}function Jh(e){e.return!==null&&(Zn(e,1),dI(e,1,0))}function eg(e){for(;e===rd;)rd=Ri[--Di],Ri[Di]=null,ks=Ri[--Di],Ri[Di]=null;for(;e===Gr;)Gr=Ja[--en],Ja[en]=null,Rn=Ja[--en],Ja[en]=null,An=Ja[--en],Ja[en]=null}function fI(e,t){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,An=t.id,Rn=t.overflow,Gr=e}var ta=null,pt=null,Ue=!1,Ur=null,nn=!1,ih=Error(B(519));function $r(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ts(an(t,e)),ih}function bb(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ea]=e,t[Ma]=n,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<As.length;a++)Re(As[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),HS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),VS(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||X0(t.textContent,a)?(n.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),n.onScroll!=null&&Re("scroll",t),n.onScrollEnd!=null&&Re("scrollend",t),n.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||$r(e,!0)}function Sb(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:nn=!1;return;case 27:case 3:nn=!0;return;default:ta=ta.return}}function yi(e){if(e!==ta)return!1;if(!Ue)return Sb(e),Ue=!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&&pt&&$r(e),Sb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=cS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=cS(e)}else t===27?(t=pt,Zr(e.type)?(e=Ph,Ph=null,pt=e):pt=t):pt=ta?on(e.stateNode.nextSibling):null;return!0}function Lo(){pt=ta=null,Ue=!1}function Im(){var e=Ur;return e!==null&&(La===null?La=e:La.push.apply(La,e),Ur=null),e}function Ts(e){Ur===null?Ur=[e]:Ur.push(e)}var lh=On(null),No=null,tr=null;function Er(e,t,a){ct(lh,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=lh.current,Yt(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(B(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(B(387));if(i=i.memoizedProps,i!==null){var l=r.type;ja(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(B(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Ds):e=[Ds])}r=r.return}e!==null&&uh(t,e,a,n),t.flags|=262144}function od(e){for(e=e.firstContext;e!==null;){if(!ja(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Eo(e){No=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function aa(e){return pI(No,e)}function Tc(e,t){return No===null&&Eo(e),pI(e,t)}function pI(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(B(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var IN=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()})}},CN=Ht.unstable_scheduleCallback,kN=Ht.unstable_NormalPriority,Ut={$$typeof:Jn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tg(){return{controller:new IN,data:new Map,refCount:0}}function qs(e){e.refCount--,e.refCount===0&&CN(kN,function(){e.controller.abort()})}var ds=null,ch=0,Vi=0,Bi=null;function TN(e,t){if(ds===null){var a=ds=[];ch=0,Vi=Tg(),Bi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return ch++,t.then(Ib,Ib),t}function Ib(){if(--ch===0&&ds!==null){Bi!==null&&(Bi.status="fulfilled");var e=ds;ds=null,Vi=0,Bi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function LN(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 Cb=fe.S;fe.S=function(e,t){L0=Fa(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&TN(e,t),Cb!==null&&Cb(e,t)};var Co=On(null);function ag(){var e=Co.current;return e!==null?e:ut.pooledCache}function qc(e,t){t===null?ct(Co,Co.current):ct(Co,t.pool)}function mI(){var e=ag();return e===null?null:{parent:Ut._currentValue,pool:e}}var tl=Error(B(460)),ng=Error(B(474)),Dd=Error(B(542)),id={then:function(){}};function kb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hI(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Lb(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=ut,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,Lb(e),e}throw ko=t,tl}}function vo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ko=a,tl):a}}var ko=null;function Tb(){if(ko===null)throw Error(B(459));var e=ko;return ko=null,e}function Lb(e){if(e===tl||e===Dd)throw Error(B(483))}var Ui=null,Ls=0;function Lc(e){var t=Ls;return Ls+=1,Ui===null&&(Ui=[]),hI(Ui,e,t)}function Ql(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ec(e,t){throw t.$$typeof===pP?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gI(e){function t(w,y){if(e){var h=w.deletions;h===null?(w.deletions=[y],w.flags|=16):h.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=ar(w,y),w.index=0,w.sibling=null,w}function o(w,y,h){return w.index=h,e?(h=w.alternate,h!==null?(h=h.index,h<y?(w.flags|=67108866,y):h):(w.flags|=67108866,y)):(w.flags|=1048576,y)}function i(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function l(w,y,h,b){return y===null||y.tag!==6?(y=bm(h,w.mode,b),y.return=w,y):(y=r(y,h),y.return=w,y)}function s(w,y,h,b){var T=h.type;return T===Si?c(w,y,h.props.children,b,h.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&vo(T)===y.type)?(y=r(y,h.props),Ql(y,h),y.return=w,y):(y=zc(h.type,h.key,h.props,null,w.mode,b),Ql(y,h),y.return=w,y)}function u(w,y,h,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==h.containerInfo||y.stateNode.implementation!==h.implementation?(y=Sm(h,w.mode,b),y.return=w,y):(y=r(y,h.children||[]),y.return=w,y)}function c(w,y,h,b,T){return y===null||y.tag!==7?(y=Io(h,w.mode,b,T),y.return=w,y):(y=r(y,h),y.return=w,y)}function d(w,y,h){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=bm(""+y,w.mode,h),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yc:return h=zc(y.type,y.key,y.props,null,w.mode,h),Ql(h,y),h.return=w,h;case ns:return y=Sm(y,w.mode,h),y.return=w,y;case Tr:return y=vo(y),d(w,y,h)}if(rs(y)||Yl(y))return y=Io(y,w.mode,h,null),y.return=w,y;if(typeof y.then=="function")return d(w,Lc(y),h);if(y.$$typeof===Jn)return d(w,Tc(w,y),h);Ec(w,y)}return null}function f(w,y,h,b){var T=y!==null?y.key:null;if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return T!==null?null:l(w,y,""+h,b);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case yc:return h.key===T?s(w,y,h,b):null;case ns:return h.key===T?u(w,y,h,b):null;case Tr:return h=vo(h),f(w,y,h,b)}if(rs(h)||Yl(h))return T!==null?null:c(w,y,h,b,null);if(typeof h.then=="function")return f(w,y,Lc(h),b);if(h.$$typeof===Jn)return f(w,y,Tc(w,h),b);Ec(w,h)}return null}function p(w,y,h,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w=w.get(h)||null,l(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yc:return w=w.get(b.key===null?h:b.key)||null,s(y,w,b,T);case ns:return w=w.get(b.key===null?h:b.key)||null,u(y,w,b,T);case Tr:return b=vo(b),p(w,y,h,b,T)}if(rs(b)||Yl(b))return w=w.get(h)||null,c(y,w,b,T,null);if(typeof b.then=="function")return p(w,y,h,Lc(b),T);if(b.$$typeof===Jn)return p(w,y,h,Tc(y,b),T);Ec(y,b)}return null}function m(w,y,h,b){for(var T=null,C=null,M=y,R=y=0,P=null;M!==null&&R<h.length;R++){M.index>R?(P=M,M=null):P=M.sibling;var L=f(w,M,h[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===h.length)return a(w,M),Ue&&Zn(w,R),T;if(M===null){for(;R<h.length;R++)M=d(w,h[R],b),M!==null&&(y=o(M,y,R),C===null?T=M:C.sibling=M,C=M);return Ue&&Zn(w,R),T}for(M=n(M);R<h.length;R++)P=p(M,w,R,h[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,$)}),Ue&&Zn(w,R),T}function x(w,y,h,b){if(h==null)throw Error(B(151));for(var T=null,C=null,M=y,R=y=0,P=null,L=h.next();M!==null&&!L.done;R++,L=h.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),Ue&&Zn(w,R),T;if(M===null){for(;!L.done;R++,L=h.next())L=d(w,L.value,b),L!==null&&(y=o(L,y,R),C===null?T=L:C.sibling=L,C=L);return Ue&&Zn(w,R),T}for(M=n(M);!L.done;R++,L=h.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)}),Ue&&Zn(w,R),T}function S(w,y,h,b){if(typeof h=="object"&&h!==null&&h.type===Si&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case yc:e:{for(var T=h.key;y!==null;){if(y.key===T){if(T=h.type,T===Si){if(y.tag===7){a(w,y.sibling),b=r(y,h.props.children),b.return=w,w=b;break e}}else if(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&vo(T)===y.type){a(w,y.sibling),b=r(y,h.props),Ql(b,h),b.return=w,w=b;break e}a(w,y);break}else t(w,y);y=y.sibling}h.type===Si?(b=Io(h.props.children,w.mode,b,h.key),b.return=w,w=b):(b=zc(h.type,h.key,h.props,null,w.mode,b),Ql(b,h),b.return=w,w=b)}return i(w);case ns:e:{for(T=h.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===h.containerInfo&&y.stateNode.implementation===h.implementation){a(w,y.sibling),b=r(y,h.children||[]),b.return=w,w=b;break e}else{a(w,y);break}else t(w,y);y=y.sibling}b=Sm(h,w.mode,b),b.return=w,w=b}return i(w);case Tr:return h=vo(h),S(w,y,h,b)}if(rs(h))return m(w,y,h,b);if(Yl(h)){if(T=Yl(h),typeof T!="function")throw Error(B(150));return h=T.call(h),x(w,y,h,b)}if(typeof h.then=="function")return S(w,y,Lc(h),b);if(h.$$typeof===Jn)return S(w,y,Tc(w,h),b);Ec(w,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,y!==null&&y.tag===6?(a(w,y.sibling),b=r(y,h),b.return=w,w=b):(a(w,y),b=bm(h,w.mode,b),b.return=w,w=b),i(w)):a(w,y)}return function(w,y,h,b){try{Ls=0;var T=S(w,y,h,b);return Ui=null,T}catch(M){if(M===tl||M===Dd)throw M;var C=Ba(29,M,null,w.mode);return C.lanes=b,C.return=w,C}}}var Mo=gI(!0),wI=gI(!1),Lr=!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 Fr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zr(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=nd(e),sI(e,null,a),t}return Rd(e,n,t,a),nd(e)}function fs(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,PS(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 ps(){if(fh){var e=Bi;if(e!==null)throw e}}function ms(e,t,a,n){fh=!1;var r=e.updateQueue;Lr=!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&&(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=mt({},d,f);break e;case 2:Lr=!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),Kr|=i,e.lanes=i,e.memoizedState=d}}function yI(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function xI(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)yI(a[e],t)}var Wi=On(null),ld=On(0);function Eb(e,t){e=ur,ct(ld,e),ct(Wi,t),ur=e|t.baseLanes}function ph(){ct(ld,ur),ct(Wi,Wi.current)}function og(){ur=ld.current,Yt(Wi),Yt(ld)}var Va=On(null),rn=null;function Mr(e){var t=e.alternate;ct(Rt,Rt.current&1),ct(Va,e),rn===null&&(t===null||Wi.current!==null||t.memoizedState!==null)&&(rn=e)}function mh(e){ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)}function vI(e){e.tag===22?(ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)):Ar(e)}function Ar(){ct(Rt,Rt.current),ct(Va,Va.current)}function Na(e){Yt(Va),rn===e&&(rn=null),Yt(Rt)}var Rt=On(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 ir=0,Se=null,lt=null,Nt=null,ud=!1,Fi=!1,Ao=!1,cd=0,Es=0,zi=null,EN=0;function It(){throw Error(B(321))}function ig(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ja(e[a],t[a]))return!1;return!0}function lg(e,t,a,n,r,o){return ir=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?ZI:yg,Ao=!1,o=a(n,r),Ao=!1,Fi&&(o=SI(t,a,n,r)),bI(e),o}function bI(e){fe.H=Ms;var t=lt!==null&<.next!==null;if(ir=0,Nt=lt=Se=null,ud=!1,Es=0,zi=null,t)throw Error(B(300));e===null||Ft||(e=e.dependencies,e!==null&&od(e)&&(Ft=!0))}function SI(e,t,a,n){Se=e;var r=0;do{if(Fi&&(zi=null),Es=0,Fi=!1,25<=r)throw Error(B(301));if(r+=1,Nt=lt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}fe.H=QI,o=t(a,n)}while(Fi);return o}function MN(){var e=fe.H,t=e.useState()[0];return t=typeof t.then=="function"?Hs(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Se.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}ir=0,Nt=lt=Se=null,Fi=!1,Es=cd=0,zi=null}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Dt(){if(lt===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Nt===null?Se.memoizedState:Nt.next;if(t!==null)Nt=t,lt=e;else{if(e===null)throw Se.alternate===null?Error(B(467)):Error(B(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function _d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hs(e){var t=Es;return Es+=1,zi===null&&(zi=[]),e=hI(zi,e,t),t=Se,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?ZI:yg),e}function Od(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hs(e);if(e.$$typeof===Jn)return aa(e)}throw Error(B(438,String(e)))}function dg(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=_d(),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]=mP;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function Hc(e){var t=Dt();return fg(t,lt,e)}function fg(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:(ir&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((ir&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,Kr|=f;d=u.action,Ao&&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,Kr|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!ja(o,e.memoizedState)&&(Ft=!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=Dt(),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);ja(o,t.memoizedState)||(Ft=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function II(e,t,a){var n=Se,r=Dt(),o=Ue;if(o){if(a===void 0)throw Error(B(407));a=a()}else a=t();var i=!ja((lt||r).memoizedState,a);if(i&&(r.memoizedState=a,Ft=!0),r=r.queue,pg(TI.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Nt!==null&&Nt.memoizedState.tag&1){if(n.flags|=2048,Gi(9,{destroy:void 0},kI.bind(null,n,r,a,t),null),ut===null)throw Error(B(349));o||(ir&127)!==0||CI(n,t,a)}return a}function CI(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Se.updateQueue,t===null?(t=_d(),Se.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function kI(e,t,a,n){t.value=a,t.getSnapshot=n,LI(t)&&EI(e)}function TI(e,t,a){return a(function(){LI(t)&&EI(e)})}function LI(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ja(e,a)}catch{return!0}}function EI(e){var t=Po(e,2);t!==null&&Ea(t,e,2)}function hh(e){var t=pa();if(typeof e=="function"){var a=e;if(e=a(),Ao){Dr(!0);try{a()}finally{Dr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function MI(e,t,a,n){return e.baseState=a,fg(e,lt,typeof n=="function"?n:lr)}function AN(e,t,a,n,r){if(Nd(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)}};fe.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,AI(t,o)):(o.next=a.next,t.pending=a.next=o)}}function AI(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=fe.T,i={};fe.T=i;try{var l=a(r,n),s=fe.S;s!==null&&s(i,l),Mb(e,t,l)}catch(u){gh(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),fe.T=o}}else try{o=a(r,n),Mb(e,t,o)}catch(u){gh(e,t,u)}}function Mb(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Ab(e,t,n)},function(n){return gh(e,t,n)}):Ab(e,t,a)}function Ab(e,t,a){t.status="fulfilled",t.value=a,RI(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,AI(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,RI(t),t=t.next;while(t!==n)}e.action=null}function RI(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function DI(e,t){return t}function Rb(e,t){if(Ue){var a=ut.formState;if(a!==null){e:{var n=Se;if(Ue){if(pt){t:{for(var r=pt,o=nn;r.nodeType!==8;){if(!o){r=null;break t}if(r=on(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){pt=on(r.nextSibling),n=r.data==="F!";break e}}$r(n)}n=!1}n&&(t=a[0])}}return a=pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DI,lastRenderedState:t},a.queue=n,a=XI.bind(null,Se,n),n.dispatch=a,n=hh(!1),o=wg.bind(null,Se,!1,n.queue),n=pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=AN.bind(null,Se,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Db(e){var t=Dt();return _I(t,lt,e)}function _I(e,t,a){if(t=fg(e,t,DI)[0],e=Hc(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Hs(t)}catch(i){throw i===tl?Dd:i}else n=t;t=Dt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Se.flags|=2048,Gi(9,{destroy:void 0},RN.bind(null,r,a),null)),[n,o,e]}function RN(e,t){e.action=t}function _b(e){var t=Dt(),a=lt;if(a!==null)return _I(t,a,e);Dt(),t=t.memoizedState,a=Dt();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=_d(),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 OI(){return Dt().memoizedState}function jc(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 Pd(e,t,a,n){var r=Dt();n=n===void 0?null:n;var o=r.memoizedState.inst;lt!==null&&n!==null&&ig(n,lt.memoizedState.deps)?r.memoizedState=Gi(t,o,a,n):(Se.flags|=e,r.memoizedState=Gi(1|t,o,a,n))}function Ob(e,t){jc(8390656,8,e,t)}function pg(e,t){Pd(2048,8,e,t)}function DN(e){Se.flags|=4;var t=Se.updateQueue;if(t===null)t=_d(),Se.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function PI(e){var t=Dt().memoizedState;return DN({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function NI(e,t){return Pd(4,2,e,t)}function BI(e,t){return Pd(4,4,e,t)}function UI(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 FI(e,t,a){a=a!=null?a.concat([e]):null,Pd(4,4,UI.bind(null,t,e),a)}function mg(){}function zI(e,t){var a=Dt();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 qI(e,t){var a=Dt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&ig(t,n[1]))return n[0];if(n=e(),Ao){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n}function hg(e,t,a){return a===void 0||(ir&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=M0(),Se.lanes|=e,Kr|=e,a)}function HI(e,t,a,n){return ja(a,t)?a:Wi.current!==null?(e=hg(e,a,n),ja(e,t)||(Ft=!0),e):(ir&42)===0||(ir&1073741824)!==0&&(Pe&261930)===0?(Ft=!0,e.memoizedState=a):(e=M0(),Se.lanes|=e,Kr|=e,t)}function jI(e,t,a,n,r){var o=Qe.p;Qe.p=o!==0&&8>o?o:8;var i=fe.T,l={};fe.T=l,wg(e,!1,t,a);try{var s=r(),u=fe.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=LN(s,n);hs(e,t,c,Ha(e))}else hs(e,t,n,Ha(e))}catch(d){hs(e,t,{then:function(){},status:"rejected",reason:d},Ha())}finally{Qe.p=o,i!==null&&l.types!==null&&(i.types=l.types),fe.T=i}}function _N(){}function wh(e,t,a,n){if(e.tag!==5)throw Error(B(476));var r=VI(e).queue;jI(e,r,t,So,a===null?_N:function(){return WI(e),a(n)})}function VI(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:So,baseState:So,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:So},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function WI(e){var t=VI(e);t.next===null&&(t=e.alternate.memoizedState),hs(e,t.next.queue,{},Ha())}function gg(){return aa(Ds)}function GI(){return Dt().memoizedState}function $I(){return Dt().memoizedState}function ON(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ha();e=Fr(a);var n=zr(t,e,a);n!==null&&(Ea(n,t,a),fs(n,t,a)),t={cache:tg()},e.payload=t;return}t=t.return}}function PN(e,t,a){var n=Ha();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Nd(e)?KI(t,a):(a=Zh(e,t,a,n),a!==null&&(Ea(a,e,n),YI(a,t,n)))}function XI(e,t,a){var n=Ha();hs(e,t,a,n)}function hs(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Nd(e))KI(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,ja(l,i))return Rd(e,t,r,0),ut===null&&Ad(),!1}catch{}if(a=Zh(e,t,r,n),a!==null)return Ea(a,e,n),YI(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(B(479))}else t=Zh(e,a,n,2),t!==null&&Ea(t,e,2)}function Nd(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function KI(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 YI(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,PS(e,a)}}var Ms={readContext:aa,use:Od,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Ms.useEffectEvent=It;var ZI={readContext:aa,use:Od,useCallback:function(e,t){return pa().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:Ob,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,jc(4194308,4,UI.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(Ao){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=pa();if(a!==void 0){var r=a(t);if(Ao){Dr(!0);try{a(t)}finally{Dr(!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=PN.bind(null,Se,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=XI.bind(null,Se,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=jI.bind(null,Se,e.queue,!0,!1),pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Se,r=pa();if(Ue){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),ut===null)throw Error(B(349));(Pe&127)!==0||CI(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Ob(TI.bind(null,n,o,e),[e]),n.flags|=2048,Gi(9,{destroy:void 0},kI.bind(null,n,o,a,t),null),a},useId:function(){var e=pa(),t=ut.identifierPrefix;if(Ue){var a=Rn,n=An;a=(n&~(1<<32-qa(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cd++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=EN++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gg,useFormState:Rb,useActionState:Rb,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,Se,!0,a),a.dispatch=t,[e,t]},useMemoCache:dg,useCacheRefresh:function(){return pa().memoizedState=ON.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)}}},yg={readContext:aa,use:Od,useCallback:zI,useContext:aa,useEffect:pg,useImperativeHandle:FI,useInsertionEffect:NI,useLayoutEffect:BI,useMemo:qI,useReducer:Hc,useRef:OI,useState:function(){return Hc(lr)},useDebugValue:mg,useDeferredValue:function(e,t){var a=Dt();return HI(a,lt.memoizedState,e,t)},useTransition:function(){var e=Hc(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Hs(e),t]},useSyncExternalStore:II,useId:GI,useHostTransitionStatus:gg,useFormState:Db,useActionState:Db,useOptimistic:function(e,t){var a=Dt();return MI(a,lt,e,t)},useMemoCache:dg,useCacheRefresh:$I};yg.useEffectEvent=PI;var QI={readContext:aa,use:Od,useCallback:zI,useContext:aa,useEffect:pg,useImperativeHandle:FI,useInsertionEffect:NI,useLayoutEffect:BI,useMemo:qI,useReducer:km,useRef:OI,useState:function(){return km(lr)},useDebugValue:mg,useDeferredValue:function(e,t){var a=Dt();return lt===null?hg(a,e,t):HI(a,lt.memoizedState,e,t)},useTransition:function(){var e=km(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Hs(e),t]},useSyncExternalStore:II,useId:GI,useHostTransitionStatus:gg,useFormState:_b,useActionState:_b,useOptimistic:function(e,t){var a=Dt();return lt!==null?MI(a,lt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:dg,useCacheRefresh:$I};QI.useEffectEvent=PI;function Tm(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:mt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var yh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),fs(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),fs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ha(),n=Fr(a);n.tag=2,t!=null&&(n.callback=t),t=zr(e,n,a),t!==null&&(Ea(t,e,a),fs(t,e,a))}};function Pb(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?!Cs(a,n)||!Cs(r,o):!0}function Nb(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 Ro(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=mt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function JI(e){ad(e)}function e0(e){console.error(e)}function t0(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 Bb(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=Fr(a),a.tag=3,a.payload={element:null},a.callback=function(){dd(e,t)},a}function a0(e){return e=Fr(e),e.tag=3,e}function n0(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(){Bb(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Bb(t,a,n),typeof r!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function NN(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=Va.current,a!==null){switch(a.tag){case 31:case 13:return rn===null?gd():a.alternate===null&&Ct===0&&(Ct=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(B(435,a.tag))}return Bm(e,n,r),gd(),!1}if(Ue)return t=Va.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==ih&&(e=Error(B(422),{cause:n}),Ts(an(e,a)))):(n!==ih&&(t=Error(B(423),{cause:n}),Ts(an(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=an(n,a),r=xh(e.stateNode,n,r),Cm(e,r),Ct!==4&&(Ct=2)),!1;var o=Error(B(520),{cause:n});if(o=an(o,a),ys===null?ys=[o]:ys.push(o),Ct!==4&&(Ct=2),t===null)return!0;n=an(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"&&(qr===null||!qr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=a0(r),n0(r,e,a,n),Cm(a,r),!1}a=a.return}while(a!==null);return!1}var xg=Error(B(461)),Ft=!1;function Jt(e,t,a,n){t.child=e===null?wI(t,null,a,n):Mo(t,e.child,a,n)}function Ub(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 Eo(t),n=lg(e,t,a,i,o,r),l=sg(),e!==null&&!Ft?(ug(e,t,r),sr(e,t,r)):(Ue&&l&&Jh(t),t.flags|=1,Jt(e,t,n,r),t.child)}function Fb(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,r0(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:Cs,a(i,n)&&e.ref===t.ref)return sr(e,t,r)}return t.flags|=1,e=ar(o,n),e.ref=t.ref,e.return=t,t.child=e}function r0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Cs(o,n)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=n=o,vg(e,r))(e.flags&131072)!==0&&(Ft=!0);else return t.lanes=e.lanes,sr(e,t,r)}return vh(e,t,a,n,r)}function o0(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 zb(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?Eb(t,o):ph(),vI(t);else return n=t.lanes=536870912,zb(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(qc(t,o.cachePool),Eb(t,o),Ar(t),t.memoizedState=null):(e!==null&&qc(t,null),ph(),Ar(t));return Jt(e,t,r,a),t.child}function is(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zb(e,t,a,n,r){var o=ag();return o=o===null?null:{parent:Ut._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&qc(t,null),ph(),vI(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 qb(e,t,a){return Mo(t,e.child,null,a),e=Vc(t,t.pendingProps),e.flags|=2,Na(t),t.memoizedState=null,e}function BN(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(n.mode==="hidden")return e=Vc(t,n),t.lanes=536870912,is(null,e);if(mh(t),(e=pt)?(e=Z0(e,nn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=cI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(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=qb(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(Ft||el(e,t,a,!1),r=(a&e.childLanes)!==0,Ft||r){if(n=ut,n!==null&&(i=NS(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Po(e,i),Ea(n,e,i),xg;gd(),t=qb(e,t,a)}else e=o.treeContext,pt=on(i.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&fI(t,e),t=Vc(t,n),t.flags|=4096;return t}return e=ar(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function vh(e,t,a,n,r){return Eo(t),a=lg(e,t,a,n,void 0,r),n=sg(),e!==null&&!Ft?(ug(e,t,r),sr(e,t,r)):(Ue&&n&&Jh(t),t.flags|=1,Jt(e,t,a,r),t.child)}function Hb(e,t,a,n,r,o){return Eo(t),t.updateQueue=null,a=SI(t,n,a,r),bI(e),n=sg(),e!==null&&!Ft?(ug(e,t,o),sr(e,t,o)):(Ue&&n&&Jh(t),t.flags|=1,Jt(e,t,a,o),t.child)}function jb(e,t,a,n,r){if(Eo(t),t.stateNode===null){var o=Ai,i=a.contextType;typeof i=="object"&&i!==null&&(o=aa(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?aa(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),ms(t,n,o,r),ps(),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=Ro(a,l);o.props=s;var u=o.context,c=a.contextType;i=Ai,typeof c=="object"&&c!==null&&(i=aa(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)&&Nb(t,o,n,i),Lr=!1;var f=t.memoizedState;o.state=f,ms(t,n,o,r),ps(),u=t.memoizedState,l||f!==u||Lr?(typeof d=="function"&&(Tm(t,a,d,n),u=t.memoizedState),(s=Lr||Pb(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=Ro(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=Ai,typeof u=="object"&&u!==null&&(s=aa(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)&&Nb(t,o,n,s),Lr=!1,f=t.memoizedState,o.state=f,ms(t,n,o,r),ps();var p=t.memoizedState;i!==d||f!==p||Lr||e!==null&&e.dependencies!==null&&od(e.dependencies)?(typeof l=="function"&&(Tm(t,a,l,n),p=t.memoizedState),(c=Lr||Pb(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=Mo(t,e.child,null,r),t.child=Mo(t,null,a,r)):Jt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=sr(e,t,r),e}function Vb(e,t,a,n){return Lo(),t.flags|=256,Jt(e,t,a,n),t.child}var Lm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Em(e){return{baseLanes:e,cachePool:mI()}}function Mm(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ua),e}function i0(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:(Rt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Mr(t):Ar(t),(e=pt)?(e=Z0(e,nn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=cI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(t);return Oh(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(Ar(t),r=t.mode,l=fd({mode:"hidden",children:l},r),n=Io(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,is(null,n)):(Mr(t),bh(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(Mr(t),t.flags&=-257,t=Am(e,t,a)):t.memoizedState!==null?(Ar(t),t.child=e.child,t.flags|=128,t=null):(Ar(t),l=n.fallback,r=t.mode,n=fd({mode:"visible",children:n.children},r),l=Io(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,Mo(t,e.child,null,a),n=t.child,n.memoizedState=Em(a),n.childLanes=Mm(e,i,a),t.memoizedState=Lm,t=is(null,n));else if(Mr(t),Oh(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(B(419)),n.stack="",n.digest=i,Ts({value:n,source:null,stack:null}),t=Am(e,t,a)}else if(Ft||el(e,t,a,!1),i=(a&e.childLanes)!==0,Ft||i){if(i=ut,i!==null&&(n=NS(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,Po(e,n),Ea(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,pt=on(l.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&fI(t,e),t=bh(t,n.children),t.flags|=4096);return t}return r?(Ar(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=ar(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=ar(u,l):(l=Io(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,is(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Em(a):(r=l.cachePool,r!==null?(s=Ut._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=mI(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Mm(e,i,a),t.memoizedState=Lm,is(e.child,n)):(Mr(t),a=e.child,e=a.sibling,a=ar(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=Ba(22,e,null,t),e.lanes=0,e}function Am(e,t,a){return Mo(t,e.child,null,a),e=bh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wb(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 l0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Rt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,ct(Rt,i),Jt(e,t,n,a),n=Ue?ks:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wb(e,a,t);else if(e.tag===19)Wb(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 sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Kr|=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=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(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 UN(e,t,a){switch(t.tag){case 3:Qc(t,t.stateNode.containerInfo),Er(t,Ut,e.memoizedState.cache),Lo();break;case 27:case 5:Km(t);break;case 4:Qc(t,t.stateNode.containerInfo);break;case 10:Er(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?(Mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?i0(e,t,a):(Mr(t),e=sr(e,t,a),e!==null?e.sibling:null);Mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(el(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return l0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ct(Rt,Rt.current),n)break;return null;case 22:return t.lanes=0,o0(e,t,a,t.pendingProps);case 24:Er(t,Ut,e.memoizedState.cache)}return sr(e,t,a)}function s0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ft=!0;else{if(!vg(e,a)&&(t.flags&128)===0)return Ft=!1,UN(e,t,a);Ft=(e.flags&131072)!==0}else Ft=!1,Ue&&(t.flags&1048576)!==0&&dI(t,ks,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=vo(t.elementType),t.type=e,typeof e=="function")Qh(e)?(n=Ro(e,n),t.tag=1,t=jb(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=Ub(null,t,e,n,a);break e}else if(r===Fh){t.tag=14,t=Fb(null,t,e,n,a);break e}}throw t=$m(e)||e,Error(B(306,t,""))}}return t;case 0:return vh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Ro(n,t.pendingProps),jb(e,t,n,r,a);case 3:e:{if(Qc(t,t.stateNode.containerInfo),e===null)throw Error(B(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,dh(e,t),ms(t,n,null,a);var i=t.memoizedState;if(n=i.cache,Er(t,Ut,n),n!==o.cache&&uh(t,[Ut],a,!0),ps(),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=Vb(e,t,n,a);break e}else if(n!==r){r=an(Error(B(424)),t),Ts(r),t=Vb(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,pt=on(e.firstChild),ta=t,Ue=!0,Ur=null,nn=!0,a=wI(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Lo(),n===r){t=sr(e,t,a);break e}Jt(e,t,n,a)}t=t.child}return t;case 26:return Wc(e,t),e===null?(a=pS(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,n=vd(Br.current).createElement(a),n[ea]=t,n[Ma]=e,na(n,a,e),Kt(n),t.stateNode=n):t.memoizedState=pS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Km(t),e===null&&Ue&&(n=t.stateNode=Q0(t.type,t.pendingProps,Br.current),ta=t,nn=!0,r=pt,Zr(t.type)?(Ph=r,pt=on(n.firstChild)):pt=r),Jt(e,t,t.pendingProps.children,a),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=n=pt)&&(n=fB(n,t.type,t.pendingProps,nn),n!==null?(t.stateNode=n,ta=t,pt=on(n.firstChild),nn=!1,r=!0):r=!1),r||$r(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,MN,null,null,a),Ds._currentValue=r),Wc(e,t),Jt(e,t,n,a),t.child;case 6:return e===null&&Ue&&((e=a=pt)&&(a=pB(a,t.pendingProps,nn),a!==null?(t.stateNode=a,ta=t,pt=null,e=!0):e=!1),e||$r(t)),null;case 13:return i0(e,t,a);case 4:return Qc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Mo(t,null,n,a):Jt(e,t,n,a),t.child;case 11:return Ub(e,t,t.type,t.pendingProps,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Er(t,t.type,n.value),Jt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Eo(t),r=aa(r),n=n(r),t.flags|=1,Jt(e,t,n,a),t.child;case 14:return Fb(e,t,t.type,t.pendingProps,a);case 15:return r0(e,t,t.type,t.pendingProps,a);case 19:return l0(e,t,a);case 31:return BN(e,t,a);case 22:return o0(e,t,a,t.pendingProps);case 24:return Eo(t),n=aa(Ut),e===null?(r=ag(),r===null&&(r=ut,o=tg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},rg(t),Er(t,Ut,r)):((e.lanes&a)!==0&&(dh(e,t),ms(t,null,null,a),ps()),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),Er(t,Ut,n)):(n=o.cache,Er(t,Ut,n),n!==r.cache&&uh(t,[Ut],a,!0))),Jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function $n(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(D0())e.flags|=8192;else throw ko=id,ng}else e.flags&=-16777217}function Gb(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!tC(t))if(D0())e.flags|=8192;else throw ko=id,ng}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_S():536870912,e.lanes|=t,$i|=t)}function Jl(e,t){if(!Ue)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 ft(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 FN(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 ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),nr(Ut),qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(yi(t)?$n(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Im())),ft(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?($n(t),o!==null?(ft(t),Gb(t,o)):(ft(t),Dm(t,r,null,n,a))):o?o!==e.memoizedState?($n(t),ft(t),Gb(t,o)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&$n(t),ft(t),Dm(t,r,e,n,a)),null;case 27:if(Jc(t),a=Br.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}e=_n.current,yi(t)?bb(t,e):(e=Q0(r,n,a),t.stateNode=e,$n(t))}return ft(t),null;case 5:if(Jc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}if(o=_n.current,yi(t))bb(t,o);else{var i=vd(Br.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[ea]=t,o[Ma]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(na(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&&$n(t)}}return ft(t),Dm(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(e=Br.current,yi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=ta,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[ea]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||X0(e.nodeValue,a)),e||$r(t,!0)}else e=vd(e).createTextNode(n),e[ea]=t,t.stateNode=e}return ft(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[ea]=t}else Lo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=Im(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(B(558))}return ft(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[ea]=t}else Lo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),r=!1}else r=Im(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(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),ft(t),null);case 4:return qi(),e===null&&Lg(t.stateNode.containerInfo),ft(t),null;case 10:return nr(t.type),ft(t),null;case 19:if(Yt(Rt),n=t.memoizedState,n===null)return ft(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)Jl(n,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=sd(e),o!==null){for(t.flags|=128,Jl(n,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)uI(a,e),a=a.sibling;return ct(Rt,Rt.current&1|2),Ue&&Zn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Fa()>md&&(t.flags|=128,r=!0,Jl(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),Jl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Ue)return ft(t),null}else 2*Fa()-n.renderingStartTime>md&&a!==536870912&&(t.flags|=128,r=!0,Jl(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=Fa(),e.sibling=null,a=Rt.current,ct(Rt,r?a&1|2:a&1),Ue&&Zn(t,n.treeForkCount),e):(ft(t),null);case 22:case 23:return Na(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&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(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&&Yt(Co),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(Ut),ft(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function zN(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 nr(Ut),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(Na(t),t.alternate===null)throw Error(B(340));Lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Na(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(Rt),null;case 4:return qi(),null;case 10:return nr(t.type),null;case 22:case 23:return Na(t),og(),e!==null&&Yt(Co),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(Ut),null;case 25:return null;default:return null}}function u0(e,t){switch(eg(t),t.tag){case 3:nr(Ut),qi();break;case 26:case 27:case 5:Jc(t);break;case 4:qi();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:Yt(Rt);break;case 10:nr(t.type);break;case 22:case 23:Na(t),og(),e!==null&&Yt(Co);break;case 24:nr(Ut)}}function js(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){at(t,t.return,l)}}function Xr(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){at(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){at(t,t.return,c)}}function c0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{xI(t,a)}catch(n){at(e,e.return,n)}}}function d0(e,t,a){a.props=Ro(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){at(e,t,n)}}function gs(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){at(e,t,r)}}function Dn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){at(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){at(e,t,r)}else a.current=null}function f0(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){at(e,e.return,r)}}function _m(e,t,a){try{var n=e.stateNode;iB(n,e.type,a,t),n[Ma]=t}catch(r){at(e,e.return,r)}}function p0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zr(e.type)||e.tag===4}function Om(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||p0(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&&Zr(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=er));else if(n!==4&&(n===27&&Zr(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&&Zr(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 m0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);na(t,n,a),t[ea]=e,t[Ma]=a}catch(o){at(e,e.return,o)}}var Qn=!1,Bt=!1,Pm=!1,$b=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function qN(e,t){if(e=e.containerInfo,Mh=Cd,e=tI(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,Xt=t;Xt!==null;)if(t=Xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xt=e;else for(;Xt!==null;){switch(t=Xt,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=Ro(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){at(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,Xt=e;break}Xt=t.return}}function h0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(e,a),n&4&&js(5,a);break;case 1:if(Kn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){at(a,a.return,i)}else{var r=Ro(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){at(a,a.return,i)}}n&64&&c0(a),n&512&&gs(a,a.return);break;case 3:if(Kn(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{xI(e,t)}catch(i){at(a,a.return,i)}}break;case 27:t===null&&n&4&&m0(a);case 26:case 5:Kn(e,a),t===null&&n&4&&f0(a),n&512&&gs(a,a.return);break;case 12:Kn(e,a);break;case 31:Kn(e,a),n&4&&y0(e,a);break;case 13:Kn(e,a),n&4&&x0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=YN.bind(null,a),mB(e,a))));break;case 22:if(n=a.memoizedState!==null||Qn,!n){t=t!==null&&t.memoizedState!==null||Bt,r=Qn;var o=Bt;Qn=n,(Bt=t)&&!o?Yn(e,a,(a.subtreeFlags&8772)!==0):Kn(e,a),Qn=r,Bt=o}break;case 30:break;default:Kn(e,a)}}function g0(e){var t=e.alternate;t!==null&&(e.alternate=null,g0(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 xt=null,Ta=!1;function Xn(e,t,a){for(a=a.child;a!==null;)w0(e,t,a),a=a.sibling}function w0(e,t,a){if(za&&typeof za.onCommitFiberUnmount=="function")try{za.onCommitFiberUnmount(Ns,a)}catch{}switch(a.tag){case 26:Bt||Dn(a,t),Xn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||Dn(a,t);var n=xt,r=Ta;Zr(a.type)&&(xt=a.stateNode,Ta=!1),Xn(e,t,a),vs(a.stateNode),xt=n,Ta=r;break;case 5:Bt||Dn(a,t);case 6:if(n=xt,r=Ta,xt=null,Xn(e,t,a),xt=n,Ta=r,xt!==null)if(Ta)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(a.stateNode)}catch(o){at(a,t,o)}else try{xt.removeChild(a.stateNode)}catch(o){at(a,t,o)}break;case 18:xt!==null&&(Ta?(e=xt,sS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Zi(e)):sS(xt,a.stateNode));break;case 4:n=xt,r=Ta,xt=a.stateNode.containerInfo,Ta=!0,Xn(e,t,a),xt=n,Ta=r;break;case 0:case 11:case 14:case 15:Xr(2,a,t),Bt||Xr(4,a,t),Xn(e,t,a);break;case 1:Bt||(Dn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&d0(a,t,n)),Xn(e,t,a);break;case 21:Xn(e,t,a);break;case 22:Bt=(n=Bt)||a.memoizedState!==null,Xn(e,t,a),Bt=n;break;default:Xn(e,t,a)}}function y0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zi(e)}catch(a){at(t,t.return,a)}}}function x0(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){at(t,t.return,a)}}function HN(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $b),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $b),t;default:throw Error(B(435,e.tag))}}function Ac(e,t){var a=HN(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=ZN.bind(null,e,n);n.then(r,r)}})}function Ca(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Zr(l.type)){xt=l.stateNode,Ta=!1;break e}break;case 5:xt=l.stateNode,Ta=!1;break e;case 3:case 4:xt=l.stateNode.containerInfo,Ta=!0;break e}l=l.return}if(xt===null)throw Error(B(160));w0(o,i,r),xt=null,Ta=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)v0(t,e),t=t.sibling}var xn=null;function v0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ca(t,e),ka(e),n&4&&(Xr(3,e,e.return),js(3,e),Xr(5,e,e.return));break;case 1:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),n&64&&Qn&&(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=xn;if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(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[Fs]||o[ea]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),na(o,n,a),o[ea]=e,Kt(o),n=o;break e;case"link":var i=hS("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),na(o,n,a),r.head.appendChild(o);break;case"meta":if(i=hS("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),na(o,n,a),r.head.appendChild(o);break;default:throw Error(B(468,n))}o[ea]=e,Kt(o),n=o}e.stateNode=n}else gS(r,e.type,e.stateNode);else e.stateNode=mS(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?gS(r,e.type,e.stateNode):mS(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&_m(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),a!==null&&n&4&&_m(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),e.flags&32){r=e.stateNode;try{ji(r,"")}catch(m){at(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(Ca(t,e),ka(e),n&4){if(e.stateNode===null)throw Error(B(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){at(e,e.return,m)}}break;case 3:if(Xc=null,r=xn,xn=bd(t.containerInfo),Ca(t,e),xn=r,ka(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(m){at(e,e.return,m)}Pm&&(Pm=!1,b0(e));break;case 4:n=xn,xn=bd(e.stateNode.containerInfo),Ca(t,e),ka(e),xn=n;break;case 12:Ca(t,e),ka(e);break;case 31:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ac(e,n)));break;case 13:Ca(t,e),ka(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bd=Fa()),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=Qn,c=Bt;if(Qn=u||r,Bt=c||s,Ca(t,e),Bt=c,Qn=u,ka(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Qn||Bt||bo(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){at(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){at(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?uS(p,!0):uS(s.stateNode,!1)}catch(m){at(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:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ac(e,n)));break;case 30:break;case 21:break;default:Ca(t,e),ka(e)}}function ka(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(p0(n)){a=n;break}n=n.return}if(a==null)throw Error(B(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(B(161))}}catch(c){at(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function b0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;b0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Kn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)h0(e,t.alternate,t),t=t.sibling}function bo(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xr(4,t,t.return),bo(t);break;case 1:Dn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&d0(t,t.return,a),bo(t);break;case 27:vs(t.stateNode);case 26:case 5:Dn(t,t.return),bo(t);break;case 22:t.memoizedState===null&&bo(t);break;case 30:bo(t);break;default:bo(t)}e=e.sibling}}function Yn(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:Yn(r,o,a),js(4,o);break;case 1:if(Yn(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){at(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++)yI(s[r],l)}catch(u){at(n,n.return,u)}}a&&i&64&&c0(o),gs(o,o.return);break;case 27:m0(o);case 26:case 5:Yn(r,o,a),a&&n===null&&i&4&&f0(o),gs(o,o.return);break;case 12:Yn(r,o,a);break;case 31:Yn(r,o,a),a&&i&4&&y0(r,o);break;case 13:Yn(r,o,a),a&&i&4&&x0(r,o);break;case 22:o.memoizedState===null&&Yn(r,o,a),gs(o,o.return);break;case 30:break;default:Yn(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&&qs(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&&qs(e))}function yn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)S0(e,t,a,n),t=t.sibling}function S0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:yn(e,t,a,n),r&2048&&js(9,t);break;case 1:yn(e,t,a,n);break;case 3:yn(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&&qs(e)));break;case 12:if(r&2048){yn(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){at(t,t.return,s)}}else yn(e,t,a,n);break;case 31:yn(e,t,a,n);break;case 13:yn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?yn(e,t,a,n):ws(e,t):o._visibility&2?yn(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:yn(e,t,a,n),r&2048&&Sg(t.alternate,t);break;default:yn(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),js(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?vi(o,i,l,s,r):ws(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 ws(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:ws(a,n),r&2048&&bg(n.alternate,n);break;case 24:ws(a,n),r&2048&&Sg(n.alternate,n);break;default:ws(a,n)}t=t.sibling}}var ls=8192;function xi(e,t,a){if(e.subtreeFlags&ls)for(e=e.child;e!==null;)I0(e,t,a),e=e.sibling}function I0(e,t,a){switch(e.tag){case 26:xi(e,t,a),e.flags&ls&&e.memoizedState!==null&&TB(a,xn,e.memoizedState,e.memoizedProps);break;case 5:xi(e,t,a);break;case 3:case 4:var n=xn;xn=bd(e.stateNode.containerInfo),xi(e,t,a),xn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ls,ls=16777216,xi(e,t,a),ls=n):xi(e,t,a));break;default:xi(e,t,a)}}function C0(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 es(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];Xt=n,T0(n,e)}C0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)k0(e),e=e.sibling}function k0(e){switch(e.tag){case 0:case 11:case 15:es(e),e.flags&2048&&Xr(9,e,e.return);break;case 3:es(e);break;case 12:es(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)):es(e);break;default:es(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];Xt=n,T0(n,e)}C0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xr(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 T0(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Xr(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:qs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Xt=n;else e:for(a=e;Xt!==null;){n=Xt;var r=n.sibling,o=n.return;if(g0(n),n===a){Xt=null;break e}if(r!==null){r.return=o,Xt=r;break e}Xt=o}}}var jN={getCacheForType:function(e){var t=aa(Ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return aa(Ut).controller.signal}},VN=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ut=null,De=null,Pe=0,tt=0,Pa=null,Or=!1,al=!1,Ig=!1,ur=0,Ct=0,Kr=0,To=0,Cg=0,Ua=0,$i=0,ys=null,La=null,Ih=!1,Bd=0,L0=0,md=1/0,hd=null,qr=null,qt=0,Hr=null,Xi=null,rr=0,Ch=0,kh=null,E0=null,xs=0,Th=null;function Ha(){return(Ze&2)!==0&&Pe!==0?Pe&-Pe:fe.T!==null?Tg():BS()}function M0(){if(Ua===0)if((Pe&536870912)===0||Ue){var e=vc;vc<<=1,(vc&3932160)===0&&(vc=262144),Ua=e}else Ua=536870912;return e=Va.current,e!==null&&(e.flags|=32),Ua}function Ea(e,t,a){(e===ut&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(Ki(e,0),Pr(e,Pe,Ua,!1)),Us(e,a),((Ze&2)===0||e!==ut)&&(e===ut&&((Ze&2)===0&&(To|=a),Ct===4&&Pr(e,Pe,Ua,!1)),Pn(e))}function A0(e,t,a){if((Ze&6)!==0)throw Error(B(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Bs(e,t),r=n?$N(e,t):Nm(e,t,!0),o=n;do{if(r===0){al&&!n&&Pr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!WN(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=ys;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,To|=o,r=4;break e}o=La,La=r,o!==null&&(La===null?La=o:La.push.apply(La,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Ki(e,0),Pr(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:Pr(n,t,Ua,!Or);break e;case 2:La=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(r=Bd+300-Fa(),10<r)){if(Pr(n,t,Ua,!Or),Td(n,0,!0)!==0)break e;rr=t,n.timeoutHandle=Y0(Xb.bind(null,n,a,La,hd,Ih,t,Ua,To,$i,Or,o,"Throttled",-0,0),r);break e}Xb(n,a,La,hd,Ih,t,Ua,To,$i,Or,o,null,-0,0)}}break}while(!0);Pn(e)}function Xb(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:er},I0(t,o,d);var m=(o&62914560)===o?Bd-Fa():(o&4194048)===o?L0-Fa():0;if(m=LB(d,m),m!==null){rr=o,e.cancelPendingCommit=m(Yb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),Pr(e,o,i,!u);return}}Yb(e,t,o,a,n,r,i,l,s)}function WN(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(!ja(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 Pr(e,t,a,n){t&=~Cg,t&=~To,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-qa(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&OS(e,a,t)}function Ud(){return(Ze&6)===0?(Vs(0,!1),!1):!0}function kg(){if(De!==null){if(tt===0)var e=De.return;else e=De,tr=No=null,cg(e),Ui=null,Ls=0,e=De;for(;e!==null;)u0(e.alternate,e),e=e.return;De=null}}function Ki(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,uB(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),rr=0,kg(),ut=e,De=a=ar(e.current,null),Pe=t,tt=0,Pa=null,Or=!1,al=Bs(e,t),Ig=!1,$i=Ua=Cg=To=Kr=Ct=0,La=ys=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-qa(n),o=1<<r;t|=e[r],n&=~o}return ur=t,Ad(),a}function R0(e,t){Se=null,fe.H=Ms,t===tl||t===Dd?(t=Tb(),tt=3):t===ng?(t=Tb(),tt=4):tt=t===xg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pa=t,De===null&&(Ct=1,dd(e,an(t,e.current)))}function D0(){var e=Va.current;return e===null?!0:(Pe&4194048)===Pe?rn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===rn:!1}function _0(){var e=fe.H;return fe.H=Ms,e===null?Ms:e}function O0(){var e=fe.A;return fe.A=jN,e}function gd(){Ct=4,Or||(Pe&4194048)!==Pe&&Va.current!==null||(al=!0),(Kr&134217727)===0&&(To&134217727)===0||ut===null||Pr(ut,Pe,Ua,!1)}function Nm(e,t,a){var n=Ze;Ze|=2;var r=_0(),o=O0();(ut!==e||Pe!==t)&&(hd=null,Ki(e,t)),t=!1;var i=Ct;e:do try{if(tt!==0&&De!==null){var l=De,s=Pa;switch(tt){case 8:kg(),i=6;break e;case 3:case 2:case 9:case 6:Va.current===null&&(t=!0);var u=tt;if(tt=0,Pa=null,_i(e,l,s,u),a&&al){i=0;break e}break;default:u=tt,tt=0,Pa=null,_i(e,l,s,u)}}GN(),i=Ct;break}catch(c){R0(e,c)}while(!0);return t&&e.shellSuspendCounter++,tr=No=null,Ze=n,fe.H=r,fe.A=o,De===null&&(ut=null,Pe=0,Ad()),i}function GN(){for(;De!==null;)P0(De)}function $N(e,t){var a=Ze;Ze|=2;var n=_0(),r=O0();ut!==e||Pe!==t?(hd=null,md=Fa()+500,Ki(e,t)):al=Bs(e,t);e:do try{if(tt!==0&&De!==null){t=De;var o=Pa;t:switch(tt){case 1:tt=0,Pa=null,_i(e,t,o,1);break;case 2:case 9:if(kb(o)){tt=0,Pa=null,Kb(t);break}t=function(){tt!==2&&tt!==9||ut!==e||(tt=7),Pn(e)},o.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:kb(o)?(tt=0,Pa=null,Kb(t)):(tt=0,Pa=null,_i(e,t,o,7));break;case 5:var i=null;switch(De.tag){case 26:i=De.memoizedState;case 5:case 27:var l=De;if(i?tC(i):l.stateNode.complete){tt=0,Pa=null;var s=l.sibling;if(s!==null)De=s;else{var u=l.return;u!==null?(De=u,Fd(u)):De=null}break t}}tt=0,Pa=null,_i(e,t,o,5);break;case 6:tt=0,Pa=null,_i(e,t,o,6);break;case 8:kg(),Ct=6;break e;default:throw Error(B(462))}}XN();break}catch(c){R0(e,c)}while(!0);return tr=No=null,fe.H=n,fe.A=r,Ze=a,De!==null?0:(ut=null,Pe=0,Ad(),Ct)}function XN(){for(;De!==null&&!wP();)P0(De)}function P0(e){var t=s0(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?Fd(e):De=t}function Kb(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Hb(a,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=Hb(a,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:cg(t);default:u0(a,t),t=De=uI(t,ur),t=s0(a,t,ur)}e.memoizedProps=e.pendingProps,t===null?Fd(e):De=t}function _i(e,t,a,n){tr=No=null,cg(t),Ui=null,Ls=0;var r=t.return;try{if(NN(e,r,t,a,Pe)){Ct=1,dd(e,an(a,e.current)),De=null;return}}catch(o){if(r!==null)throw De=r,o;Ct=1,dd(e,an(a,e.current)),De=null;return}t.flags&32768?(Ue||n===1?e=!0:al||(Pe&536870912)!==0?e=!1:(Or=e=!0,(n===2||n===9||n===3||n===6)&&(n=Va.current,n!==null&&n.tag===13&&(n.flags|=16384))),N0(t,e)):Fd(t)}function Fd(e){var t=e;do{if((t.flags&32768)!==0){N0(t,Or);return}e=t.return;var a=FN(t.alternate,t,ur);if(a!==null){De=a;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ct===0&&(Ct=5)}function N0(e,t){do{var a=zN(e.alternate,e);if(a!==null){a.flags&=32767,De=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=a}while(e!==null);Ct=6,De=null}function Yb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do zd();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|=Yh,LP(e,a,o,i,l,s),e===ut&&(De=ut=null,Pe=0),Xi=t,Hr=e,rr=a,Ch=o,kh=r,E0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,QN(ed,function(){return q0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=fe.T,fe.T=null,r=Qe.p,Qe.p=2,i=Ze,Ze|=4;try{qN(e,t,a)}finally{Ze=i,Qe.p=r,fe.T=n}}qt=1,B0(),U0(),F0()}}function B0(){if(qt===1){qt=0;var e=Hr,t=Xi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var n=Qe.p;Qe.p=2;var r=Ze;Ze|=4;try{v0(t,e);var o=Ah,i=tI(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&eI(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=yb(l,x),y=yb(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 h=d.createRange();h.setStart(w.node,w.offset),p.removeAllRanges(),x>S?(p.addRange(h),p.extend(y.node,y.offset)):(h.setEnd(y.node,y.offset),p.addRange(h))}}}}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{Ze=r,Qe.p=n,fe.T=a}}e.current=t,qt=2}}function U0(){if(qt===2){qt=0;var e=Hr,t=Xi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=fe.T,fe.T=null;var n=Qe.p;Qe.p=2;var r=Ze;Ze|=4;try{h0(e,t.alternate,t)}finally{Ze=r,Qe.p=n,fe.T=a}}qt=3}}function F0(){if(qt===4||qt===3){qt=0,yP();var e=Hr,t=Xi,a=rr,n=E0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?qt=5:(qt=0,Xi=Hr=null,z0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(qr=null),Hh(a),t=t.stateNode,za&&typeof za.onCommitFiberRoot=="function")try{za.onCommitFiberRoot(Ns,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=fe.T,r=Qe.p,Qe.p=2,fe.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{fe.T=t,Qe.p=r}}(rr&3)!==0&&zd(),Pn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Th?xs++:(xs=0,Th=e):xs=0,Vs(0,!1)}}function z0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qs(t)))}function zd(){return B0(),U0(),F0(),q0()}function q0(){if(qt!==5)return!1;var e=Hr,t=Ch;Ch=0;var a=Hh(rr),n=fe.T,r=Qe.p;try{Qe.p=32>a?32:a,fe.T=null,a=kh,kh=null;var o=Hr,i=rr;if(qt=0,Xi=Hr=null,rr=0,(Ze&6)!==0)throw Error(B(331));var l=Ze;if(Ze|=4,k0(o.current),S0(o,o.current,i,a),Ze=l,Vs(0,!1),za&&typeof za.onPostCommitFiberRoot=="function")try{za.onPostCommitFiberRoot(Ns,o)}catch{}return!0}finally{Qe.p=r,fe.T=n,z0(e,t)}}function Zb(e,t,a){t=an(a,t),t=xh(e.stateNode,t,2),e=zr(e,t,2),e!==null&&(Us(e,2),Pn(e))}function at(e,t,a){if(e.tag===3)Zb(e,e,a);else for(;t!==null;){if(t.tag===3){Zb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(qr===null||!qr.has(n))){e=an(a,e),a=a0(2),n=zr(t,a,2),n!==null&&(n0(a,n,t,e),Us(n,2),Pn(n));break}}t=t.return}}function Bm(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new VN;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=KN.bind(null,e,t,a),t.then(e,e))}function KN(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ut===e&&(Pe&a)===a&&(Ct===4||Ct===3&&(Pe&62914560)===Pe&&300>Fa()-Bd?(Ze&2)===0&&Ki(e,0):Cg|=a,$i===Pe&&($i=0)),Pn(e)}function H0(e,t){t===0&&(t=_S()),e=Po(e,t),e!==null&&(Us(e,t),Pn(e))}function YN(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),H0(e,a)}function ZN(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),H0(e,a)}function QN(e,t){return zh(e,t)}var wd=null,bi=null,Lh=!1,yd=!1,Um=!1,Nr=0;function Pn(e){e!==bi&&e.next===null&&(bi===null?wd=bi=e:bi=bi.next=e),yd=!0,Lh||(Lh=!0,eB())}function Vs(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-qa(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Qb(n,o))}else o=Pe,o=Td(n,n===ut?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||Bs(n,o)||(a=!0,Qb(n,o));n=n.next}while(a);Um=!1}}function JN(){j0()}function j0(){yd=Lh=!1;var e=0;Nr!==0&&sB()&&(e=Nr);for(var t=Fa(),a=null,n=wd;n!==null;){var r=n.next,o=V0(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}qt!==0&&qt!==5||Vs(e,!1),Nr!==0&&(Nr=0)}function V0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-qa(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=TP(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=ut,a=Pe,a=Td(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pm(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Bs(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&pm(n),Hh(a)){case 2:case 8:a=RS;break;case 32:a=ed;break;case 268435456:a=DS;break;default:a=ed}return n=W0.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 W0(e,t){if(qt!==0&&qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(zd()&&e.callbackNode!==a)return null;var n=Pe;return n=Td(e,e===ut?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(A0(e,n,t),V0(e,Fa()),e.callbackNode!=null&&e.callbackNode===a?W0.bind(null,e):null)}function Qb(e,t){if(zd())return null;A0(e,t,!0)}function eB(){cB(function(){(Ze&6)!==0?zh(AS,JN):j0()})}function Tg(){if(Nr===0){var e=Vi;e===0&&(e=xc,xc<<=1,(xc&261888)===0&&(xc=256)),Nr=e}return Nr}function Jb(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bc(""+e)}function eS(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 tB(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=Jb((r[Ma]||null).action),i=n.submitter;i&&(t=(t=i[Ma]||null)?Jb(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(Nr!==0){var s=i?eS(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?eS(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],tS=Dc.toLowerCase(),aS=Dc[0].toUpperCase()+Dc.slice(1),vn(tS,"on"+aS);var Dc,tS,aS,Rc;vn(nI,"onAnimationEnd");vn(rI,"onAnimationIteration");vn(oI,"onAnimationStart");vn("dblclick","onDoubleClick");vn("focusin","onFocus");vn("focusout","onBlur");vn(xN,"onTransitionRun");vn(vN,"onTransitionStart");vn(bN,"onTransitionCancel");vn(iI,"onTransitionEnd");Hi("onMouseEnter",["mouseout","mouseover"]);Hi("onMouseLeave",["mouseout","mouseover"]);Hi("onPointerEnter",["pointerout","pointerover"]);Hi("onPointerLeave",["pointerout","pointerover"]);Do("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Do("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Do("onBeforeInput",["compositionend","keypress","textInput","paste"]);Do("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Do("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Do("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var As="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(" "),aB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(As));function G0(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 Re(e,t){var a=t[Zm];a===void 0&&(a=t[Zm]=new Set);var n=e+"__bubble";a.has(n)||($0(t,e,2,!1),a.add(n))}function Fm(e,t,a){var n=0;t&&(n|=4),$0(a,e,n,t)}var _c="_reactListening"+Math.random().toString(36).slice(2);function Lg(e){if(!e[_c]){e[_c]=!0,US.forEach(function(a){a!=="selectionchange"&&(aB.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 $0(e,t,a,n){switch(iC(t)){case 2:var r=AB;break;case 8:r=RB;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}GS(function(){var u=o,c=Wh(a),d=[];e:{var f=lI.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=ZP;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=ub;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=FP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=eN;break;case nI:case rI:case oI:p=HP;break;case iI:p=aN;break;case"scroll":case"scrollend":p=BP;break;case"wheel":p=rN;break;case"copy":case"cut":case"paste":p=VP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=db;break;case"toggle":case"beforetoggle":p=iN}var x=(t&4)!==0,S=!x&&(e==="scroll"||e==="scrollend"),w=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,h;y!==null;){var b=y;if(h=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||h===null||w===null||(b=Ss(y,w),b!=null&&x.push(Rs(y,b,h))),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=Ps(m),x=m.tag,m!==S||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=ub,b="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=db,b="onPointerLeave",w="onPointerEnter",y="pointer"),S=p==null?f:os(p),h=m==null?f:os(m),f=new x(b,y+"leave",p,a,c),f.target=S,f.relatedTarget=h,b=null,Ci(c)===u&&(x=new x(w,y+"enter",m,a,c),x.target=h,x.relatedTarget=S,b=x),S=b,p&&m)t:{for(x=nB,w=p,y=m,h=0,b=w;b;b=x(b))h++;b=0;for(var T=y;T;T=x(T))b++;for(;0<h-b;)w=x(w),h--;for(;0<b-h;)y=x(y),b--;for(;h--;){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&&nS(d,f,p,x,!1),m!==null&&S!==null&&nS(d,S,m,x,!0)}}e:{if(f=u?os(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=hb;else if(mb(f))if(QS)C=gN;else{C=mN;var M=pN}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Vh(u.elementType)&&(C=hb):C=hN;if(C&&(C=C(e,u))){ZS(d,C,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&eh(f,"number",f.value)}switch(M=u?os(u):window,e){case"focusin":(mb(M)||M.contentEditable==="true")&&(Li=M,nh=u,cs=null);break;case"focusout":cs=nh=Li=null;break;case"mousedown":rh=!0;break;case"contextmenu":case"mouseup":case"dragend":rh=!1,xb(d,a,c);break;case"selectionchange":if(yN)break;case"keydown":case"keyup":xb(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?KS(e,a)&&(P="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(P="onCompositionStart");P&&(XS&&a.locale!=="ko"&&(Ti||P!=="onCompositionStart"?P==="onCompositionEnd"&&Ti&&(R=$S()):(_r=c,Gh="value"in _r?_r.value:_r.textContent,Ti=!0)),M=xd(u,P),0<M.length&&(P=new cb(P,e,null,a,c),d.push({event:P,listeners:M}),R?P.data=R:(R=YS(a),R!==null&&(P.data=R)))),(R=sN?uN(e,a):cN(e,a))&&(P=xd(u,"onBeforeInput"),0<P.length&&(M=new cb("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:P}),M.data=R)),tB(d,e,u,a,c)}G0(d,t)})}function Rs(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=Ss(e,a),r!=null&&n.unshift(Rs(e,r,o)),r=Ss(e,t),r!=null&&n.push(Rs(e,r,o))),e.tag===3)return n;e=e.return}return[]}function nB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function nS(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=Ss(a,o),u!=null&&i.unshift(Rs(a,u,s))):r||(u=Ss(a,o),u!=null&&i.push(Rs(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var rB=/\r\n?/g,oB=/\u0000|\uFFFD/g;function rS(e){return(typeof e=="string"?e:""+e).replace(rB,`
|
|
9
|
-
`).replace(oB,"")}function X0(e,t){return t=rS(t),rS(e)===t}function it(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":WS(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"&&it(e,t,"name",r.name,r,null),it(e,t,"formEncType",r.formEncType,r,null),it(e,t,"formMethod",r.formMethod,r,null),it(e,t,"formTarget",r.formTarget,r,null)):(it(e,t,"encType",r.encType,r,null),it(e,t,"method",r.method,r,null),it(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=er);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("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=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":Re("beforetoggle",e),Re("toggle",e),Nc(e,"popover",n);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Gn(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=PP.get(a)||a,Nc(e,a,n))}}function Eh(e,t,a,n,r,o){switch(a){case"style":WS(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&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"onClick":n!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!FS.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[Ma]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Nc(e,a,n)}}}function na(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("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:it(e,t,o,i,a,null)}}r&&it(e,t,"srcSet",a.srcSet,a,null),n&&it(e,t,"src",a.src,a,null);return;case"input":Re("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:it(e,t,n,c,a,null)}}HS(e,o,l,s,u,i,r,!1);return;case"select":Re("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:it(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":Re("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:it(e,t,i,l,a,null)}VS(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":it(e,t,s,n,a,null));return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(n=0;n<As.length;n++)Re(As[n],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("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:it(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&&it(e,t,l,n,a,null))}function iB(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)||it(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&&it(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)||it(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&&it(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:it(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&&it(e,t,i,r,n,o)}jS(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:it(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":it(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)&&it(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:it(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)&&it(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||it(e,t,d,f,n,p)}function oS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lB(){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&&oS(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&&oS(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 iS(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 K0(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 sB(){var e=window.event;return e&&e.type==="popstate"?e===qm?!1:(qm=e,!0):(qm=null,!1)}var Y0=typeof setTimeout=="function"?setTimeout:void 0,uB=typeof clearTimeout=="function"?clearTimeout:void 0,lS=typeof Promise=="function"?Promise:void 0,cB=typeof queueMicrotask=="function"?queueMicrotask:typeof lS<"u"?function(e){return lS.resolve(null).then(e).catch(dB)}:Y0;function dB(e){setTimeout(function(){throw e})}function Zr(e){return e==="head"}function sS(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")vs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,vs(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[Fs]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&vs(e.ownerDocument.body);a=r}while(a);Zi(t)}function uS(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 fB(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[Fs])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=on(e.nextSibling),e===null)break}return null}function pB(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=on(e.nextSibling),e===null))return null;return e}function Z0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=on(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 mB(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 on(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 cS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return on(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function dS(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 Q0(e,t,a){switch(t=vd(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 vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jh(e)}var ln=new Map,fS=new Set;function bd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cr=Qe.d;Qe.d={f:hB,r:gB,D:wB,C:yB,L:xB,m:vB,X:SB,S:bB,M:IB};function hB(){var e=cr.f(),t=Ud();return e||t}function gB(e){var t=Ji(e);t!==null&&t.tag===5&&t.type==="form"?WI(t):cr.r(e)}var nl=typeof document>"u"?null:document;function J0(e,t,a){var n=nl;if(n&&typeof t=="string"&&t){var r=tn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),fS.has(r)||(fS.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function wB(e){cr.D(e),J0("dns-prefetch",e,null)}function yB(e,t){cr.C(e,t),J0("preconnect",e,t)}function xB(e,t,a){cr.L(e,t,a);var n=nl;if(n&&e&&t){var r='link[rel="preload"][as="'+tn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+tn(a.imageSizes)+'"]')):r+='[href="'+tn(e)+'"]';var o=r;switch(t){case"style":o=Yi(e);break;case"script":o=rl(e)}ln.has(o)||(e=mt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ln.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Ws(o))||t==="script"&&n.querySelector(Gs(o))||(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function vB(e,t){cr.m(e,t);var a=nl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+tn(n)+'"][href="'+tn(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=rl(e)}if(!ln.has(o)&&(e=mt({rel:"modulepreload",href:e},t),ln.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Gs(o)))return}n=a.createElement("link"),na(n,"link",e),Kt(n),a.head.appendChild(n)}}}function bB(e,t,a){cr.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(Ws(o)))l.loading=5;else{e=mt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ln.get(o))&&Eg(e,a);var s=i=n.createElement("link");Kt(s),na(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 SB(e,t){cr.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(Gs(r)),o||(e=mt({src:e,async:!0},t),(t=ln.get(r))&&Mg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function IB(e,t){cr.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(Gs(r)),o||(e=mt({src:e,async:!0,type:"module"},t),(t=ln.get(r))&&Mg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function pS(e,t,a,n){var r=(r=Br.current)?bd(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(Ws(e)))&&!o._p&&(i.instance=o,i.state.loading=5),ln.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},ln.set(e,a),o||CB(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="'+tn(e)+'"'}function Ws(e){return'link[rel="stylesheet"]['+e+"]"}function eC(e){return mt({},e,{"data-precedence":e.precedence,precedence:null})}function CB(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}),na(t,"link",a),Kt(t),e.head.appendChild(t))}function rl(e){return'[src="'+tn(e)+'"]'}function Gs(e){return"script[async]"+e}function mS(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+tn(a.href)+'"]');if(n)return t.instance=n,Kt(n),n;var r=mt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Kt(n),na(n,"style",r),$c(n,a.precedence,e),t.instance=n;case"stylesheet":r=Yi(a.href);var o=e.querySelector(Ws(r));if(o)return t.state.loading|=4,t.instance=o,Kt(o),o;n=eC(a),(r=ln.get(r))&&Eg(n,r),o=(e.ownerDocument||e).createElement("link"),Kt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(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(Gs(o)))?(t.instance=r,Kt(r),r):(n=a,(r=ln.get(o))&&(n=mt({},a),Mg(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),Kt(r),na(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,$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 hS(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[Fs]||o[ea]||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 gS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function kB(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 tC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function TB(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(Ws(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,Kt(o);return}o=t.ownerDocument||t,n=eC(n),(r=ln.get(r))&&Eg(n,r),o=o.createElement("link"),Kt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(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 LB(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*lB());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(EB,e),Id=null,Sd.call(e))}function EB(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 Ds={$$typeof:Jn,Provider:null,Consumer:null,_currentValue:So,_currentValue2:So,_threadCount:0};function MB(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 aC(e,t,a,n,r,o,i,l,s,u,c,d){return e=new MB(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ba(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 nC(e){return e?(e=Ai,e):Ai}function rC(e,t,a,n,r,o){r=nC(r),n.context===null?n.context=r:n.pendingContext=r,n=Fr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=zr(e,n,t),a!==null&&(Ea(a,e,t),fs(a,e,t))}function wS(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){wS(e,t),(e=e.alternate)&&wS(e,t)}function oC(e){if(e.tag===13||e.tag===31){var t=Po(e,67108864);t!==null&&Ea(t,e,67108864),Ag(e,67108864)}}function yS(e){if(e.tag===13||e.tag===31){var t=Ha();t=qh(t);var a=Po(e,t);a!==null&&Ea(a,e,t),Ag(e,t)}}var Cd=!0;function AB(e,t,a,n){var r=fe.T;fe.T=null;var o=Qe.p;try{Qe.p=2,Rg(e,t,a,n)}finally{Qe.p=o,fe.T=r}}function RB(e,t,a,n){var r=fe.T;fe.T=null;var o=Qe.p;try{Qe.p=8,Rg(e,t,a,n)}finally{Qe.p=o,fe.T=r}}function Rg(e,t,a,n){if(Cd){var r=Nh(n);if(r===null)zm(e,t,n,kd,a),xS(e,n);else if(_B(r,e,t,a,n))n.stopPropagation();else if(xS(e,n),t&4&&-1<DB.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=xo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-qa(i);l.entanglements[1]|=s,i&=~s}Pn(o),(Ze&6)===0&&(md=Fa()+500,Vs(0,!1))}}break;case 31:case 13:l=Po(o,2),l!==null&&Ea(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=Ps(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=kS(t),e!==null)return e;e=null}else if(a===31){if(e=TS(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 iC(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(xP()){case AS:return 2;case RS:return 8;case ed:case vP:return 32;case DS:return 268435456;default:return 32}default:return 32}}var Bh=!1,jr=null,Vr=null,Wr=null,_s=new Map,Os=new Map,Rr=[],DB="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 xS(e,t){switch(e){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":_s.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Os.delete(t.pointerId)}}function ts(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&&oC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function _B(e,t,a,n,r){switch(t){case"focusin":return jr=ts(jr,e,t,a,n,r),!0;case"dragenter":return Vr=ts(Vr,e,t,a,n,r),!0;case"mouseover":return Wr=ts(Wr,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return _s.set(o,ts(_s.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Os.set(o,ts(Os.get(o)||null,e,t,a,n,r)),!0}return!1}function lC(e){var t=Ci(e.target);if(t!==null){var a=Ps(t);if(a!==null){if(t=a.tag,t===13){if(t=kS(a),t!==null){e.blockedOn=t,ab(e.priority,function(){yS(a)});return}}else if(t===31){if(t=TS(a),t!==null){e.blockedOn=t,ab(e.priority,function(){yS(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&&oC(t),e.blockedOn=a,!1;t.shift()}return!0}function vS(e,t,a){Yc(e)&&a.delete(t)}function OB(){Bh=!1,jr!==null&&Yc(jr)&&(jr=null),Vr!==null&&Yc(Vr)&&(Vr=null),Wr!==null&&Yc(Wr)&&(Wr=null),_s.forEach(vS),Os.forEach(vS)}function Oc(e,t){e.blockedOn===t&&(e.blockedOn=null,Bh||(Bh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,OB)))}var Pc=null;function bS(e){Pc!==e&&(Pc=e,Ht.unstable_scheduleCallback(Ht.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)}jr!==null&&Oc(jr,e),Vr!==null&&Oc(Vr,e),Wr!==null&&Oc(Wr,e),_s.forEach(t),Os.forEach(t);for(var a=0;a<Rr.length;a++){var n=Rr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Rr.length&&(a=Rr[0],a.blockedOn===null);)lC(a),a.blockedOn===null&&Rr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[Ma]||null;if(typeof o=="function")i||bS(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Ma]||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),bS(a)}}}function sC(){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(B(409));var a=t.current,n=Ha();rC(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;rC(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=BS();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Rr.length&&t!==0&&t<Rr[a].priority;a++);Rr.splice(a,0,e),a===0&&lC(e)}};var SS=IS.version;if(SS!=="19.2.4")throw Error(B(527,SS,"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=fP(t),e=e!==null?LS(e):null,e=e===null?null:e.stateNode,e};var PB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(as=__REACT_DEVTOOLS_GLOBAL_HOOK__,!as.isDisabled&&as.supportsFiber))try{Ns=as.inject(PB),za=as}catch{}var as;Hd.createRoot=function(e,t){if(!CS(e))throw Error(B(299));var a=!1,n="",r=JI,o=e0,i=t0;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=aC(e,1,!1,null,null,a,n,null,r,o,i,sC),e[Qi]=t.current,Lg(e),new _g(t)};Hd.hydrateRoot=function(e,t,a){if(!CS(e))throw Error(B(299));var n=!1,r="",o=JI,i=e0,l=t0,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=aC(e,1,!0,t,a??null,n,r,s,o,i,l,sC),t.context=nC(null),a=t.current,n=Ha(),n=qh(n),r=Fr(n),r.callback=null,zr(a,r,n),a=n,t.current.lanes=a,Us(t,a),Pn(t),e[Qi]=t.current,Lg(e),new qd(t)};Hd.version="19.2.4"});var Og=oa((eW,dC)=>{"use strict";function cC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cC)}catch(e){console.error(e)}}cC(),dC.exports=uC()});var zC=oa(Jd=>{"use strict";var e3=Symbol.for("react.transitional.element"),t3=Symbol.for("react.fragment");function FC(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:e3,type:e,key:n,ref:t!==void 0?t:null,props:a}}Jd.Fragment=t3;Jd.jsx=FC;Jd.jsxs=FC});var re=oa((JG,qC)=>{"use strict";qC.exports=zC()});function HC(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=HC(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=HC(e))&&(n&&(n+=" "),n+=t);return n}var Xg=k(()=>{"use strict"});function Kg(...e){return e.filter(Boolean).join(" ")}function jC(){return Kg}var Yg=k(()=>{"use strict"});function I3(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Jr(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 C3(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 k3(e){return lf(t);function t(a){return a&&a.type===e}}function lf(e){return t;function t(a,n,r){return!!(L3(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function T3(){return!0}function L3(e){return e!==null&&typeof e=="object"&&"type"in e}var Jr,Ak=k(()=>{"use strict";Jr=(function(e){if(e==null)return T3;if(typeof e=="function")return lf(e);if(typeof e=="object")return Array.isArray(e)?I3(e):C3(e);if(typeof e=="string")return k3(e);throw new Error("Expected function, string, or object as test")})});var sf=k(()=>{"use strict";Ak()});function cu(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Jr(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=Rk,m,x,S;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=E3(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 E3(e){return Array.isArray(e)?e:typeof e=="number"?[pr,e]:e==null?Rk:[e]}var Rk,pr,Ho,jo,Dk=k(()=>{"use strict";sf();Rk=[],pr=!0,Ho=!1,jo="skip"});var uf=k(()=>{"use strict";Dk()});function mr(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),cu(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 _k=k(()=>{"use strict";uf();uf()});var cf=k(()=>{"use strict";_k()});function Nk({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=D3(e,t,a,n,r,o,i);mr(u,c)}}function Ok(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 M3(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function Pk(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=Ok(e,a);if(!i||R3.has(i.protocol)||!(A3.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=M3(e);return i&&t.some(u=>{let c=Ok(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 A3,R3,aw,D3,Bk=k(()=>{"use strict";cf();A3=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),R3=new Set(["javascript:","data:","file:","vbscript:"]);aw=Symbol("node-seen"),D3=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[aw])return pr;if(s.tagName==="a"){let d=Pk(s.properties.href,t,e,!1,!1,r);return d===null?(s[aw]=!0,mr(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",pr)}if(s.tagName==="img"){let d=Pk(s.properties.src,a,e,n,!0,r);return d===null?(s[aw]=!0,mr(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,pr)}return pr};return l}});function _3(){return e=>e}var Uk,Fk=k(()=>{"use strict";Uk=_3});var zk,B3,ow,Wk=k(()=>{"use strict";zk=typeof self=="object"?self:globalThis,B3=(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 zk[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 zk[o](i),r)};return n},ow=e=>B3(new Map,e)(0)});var gl,U3,F3,du,ff,z3,iw,Gk=k(()=>{"use strict";gl="",{toString:U3}={},{keys:F3}=Object,du=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=U3.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"),z3=(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]=du(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 F3(i))(e||!ff(du(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(du(f))||ff(du(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(du(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 z3(!(t||a),!!t,new Map,n)(e),n}});var eo,pf=k(()=>{"use strict";Wk();Gk();eo=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 $k(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 fu(e){let t=wl(e),a=mf(e);if(t&&a)return{start:t,end:a}}var mf,wl,Xk=k(()=>{"use strict";mf=$k("end"),wl=$k("start")});var pu=k(()=>{"use strict";Xk()});var Vo,lw,Kk=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=Qk(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function Qk(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return q3(e,a);case"doctype":return H3(e,a);case"element":return j3(e,a);case"root":return V3(e,a);case"text":return W3(e,a);default:}}}function q3(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 mu(o,t),o}}function H3(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return mu(a,t),a}}function j3(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=Jk(e,t.children),r=G3(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&&to.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 mu(i,t),i}function V3(e,t){let n={type:"root",children:Jk(e,t.children)};return mu(n,t),n}function W3(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return mu(n,t),n}function Jk(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=Qk(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function G3(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&to.call(n,a)?n[a]:void 0,i=n&&to.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(to.call(l,u)){let c=l[u],d=Yk(e,Zk(o,u),u,c);d==null&&(d=Yk(e,Zk(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&to.call(r,a)){let c=r[a];for(u in c)to.call(c,u)&&!to.call(s,u)&&(s[u]=c[u])}return s}function Yk(e,t,a,n){return t?Array.isArray(n)?$3(e,t,a,n):eT(e,t,a,n):void 0}function $3(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=eT(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function eT(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&X3(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 X3(e,t,a){let n=e.schema.protocols&&to.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 mu(e,t){let a=fu(t);t.data&&(e.data=eo(t.data)),a&&(e.position=a)}function Zk(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 to,tT=k(()=>{"use strict";pf();pu();Kk();to={}.hasOwnProperty});var aT=k(()=>{"use strict";tT()});function hf(e){return function(t){return sw(t,e)}}var nT=k(()=>{"use strict";aT()});var rT=k(()=>{"use strict";nT()});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 oT=k(()=>{"use strict"});function Wo(e){return e!==null&&(e<32||e===127)}function Z(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}function ao(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var jt,kt,iT,hu,lT,sT,Go,Un,je=k(()=>{"use strict";jt=ao(/[A-Za-z]/),kt=ao(/[\dA-Za-z]/),iT=ao(/[#-'*+\--9=?A-Z^-~]/);hu=ao(/\d/),lT=ao(/[\dA-Fa-f]/),sT=ao(/[!-/:-@[-`{-~]/);Go=ao(/\p{P}|\p{S}/u),Un=ao(/\s/)});function cw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var uT=k(()=>{"use strict"});function dw(e,t,a){let r=Jr((a||{}).ignore||[]),o=K3(t),i=-1;for(;++i<o.length;)cu(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 h=f.exec(u.value);for(;h;){let b=h.index,T={index:h.index,input:h.input,stack:[...c,u]},C=p(...h,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+h[0].length,w=!0),!f.global)break;h=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 K3(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([Y3(r[0]),Z3(r[1])])}return t}function Y3(e){return typeof e=="string"?new RegExp(cw(e),"g"):e}function Z3(e){return typeof e=="function"?e:function(){return e}}var cT=k(()=>{"use strict";uT();uf();sf()});var dT=k(()=>{"use strict";cT()});function hw(){return{transforms:[nF],enter:{literalAutolink:Q3,literalAutolinkEmail:mw,literalAutolinkHttp:mw,literalAutolinkWww:mw},exit:{literalAutolink:aF,literalAutolinkEmail:tF,literalAutolinkHttp:J3,literalAutolinkWww:eF}}}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 Q3(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 eF(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 tF(e){this.config.exit.autolinkEmail.call(this,e)}function aF(e){this.exit(e)}function nF(e){dw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oF]],{ignore:["link","linkReference"]})}function rF(e,t,a,n,r){let o="";if(!fT(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!iF(a)))return!1;let i=lF(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 oF(e,t,a,n){return!fT(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function iF(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 lF(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 fT(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Un(a)||Go(a))&&(!t||a!==47)}var fw,pw,pT=k(()=>{"use strict";oT();je();dT();fw="phrasing",pw=["autolink","link","image","label"]});var mT=k(()=>{"use strict";pT()});function la(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var yl=k(()=>{"use strict"});function sF(){this.buffer()}function uF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cF(){this.buffer()}function dF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function fF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function pF(e){this.exit(e)}function mF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function hF(e){this.exit(e)}function gF(){return"["}function hT(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:sF,gfmFootnoteCall:uF,gfmFootnoteDefinitionLabelString:cF,gfmFootnoteDefinition:dF},exit:{gfmFootnoteCallString:fF,gfmFootnoteCall:pF,gfmFootnoteDefinitionLabelString:mF,gfmFootnoteDefinition:hF}}}function yw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:hT},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 Qm=Object.prototype.hasOwnProperty,Hh=Ht.unstable_scheduleCallback,hm=Ht.unstable_cancelCallback,xP=Ht.unstable_shouldYield,vP=Ht.unstable_requestPaint,Fa=Ht.unstable_now,bP=Ht.unstable_getCurrentPriorityLevel,DS=Ht.unstable_ImmediatePriority,_S=Ht.unstable_UserBlockingPriority,td=Ht.unstable_NormalPriority,SP=Ht.unstable_LowPriority,OS=Ht.unstable_IdlePriority,IP=Ht.log,CP=Ht.unstable_setDisableYieldValue,Bs=null,za=null;function Dr(e){if(typeof IP=="function"&&CP(e),za&&typeof za.setStrictMode=="function")try{za.setStrictMode(Bs,e)}catch{}}var qa=Math.clz32?Math.clz32:LP,kP=Math.log,TP=Math.LN2;function LP(e){return e>>>=0,e===0?32:31-(kP(e)/TP|0)|0}var vc=256,bc=262144,Sc=4194304;function vo(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=vo(n):(i&=l,i!==0?r=vo(i):a||(a=l&~e,a!==0&&(r=vo(a))))):(l=n&~o,l!==0?r=vo(l):i!==0?r=vo(i):a||(a=n&~e,a!==0&&(r=vo(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 EP(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 PS(){var e=Sc;return Sc<<=1,(Sc&62914560)===0&&(Sc=4194304),e}function gm(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 MP(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-qa(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&&NS(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function NS(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-qa(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function BS(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-qa(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function US(e,t){var a=t&-t;return a=(a&42)!==0?1:jh(a),(a&(e.suspendedLanes|t))!==0?0:a}function jh(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 Vh(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function FS(){var e=Ze.p;return e!==0?e:(e=window.event,e===void 0?32:sC(e.type))}function rb(e,t){var a=Ze.p;try{return Ze.p=e,t()}finally{Ze.p=a}}var Yr=Math.random().toString(36).slice(2),ea="__reactFiber$"+Yr,Ma="__reactProps$"+Yr,Ji="__reactContainer$"+Yr,Jm="__reactEvents$"+Yr,AP="__reactListeners$"+Yr,RP="__reactHandles$"+Yr,ob="__reactResources$"+Yr,zs="__reactMarker$"+Yr;function Wh(e){delete e[ea],delete e[Ma],delete e[Jm],delete e[AP],delete e[RP]}function ki(e){var t=e[ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ji]||a[ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=pS(e);e!==null;){if(a=e[ea])return a;e=pS(e)}return t}e=a,a=e.parentNode}return null}function el(e){if(e=e[ea]||e[Ji]){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 Pi(e){var t=e[ob];return t||(t=e[ob]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[zs]=!0}var zS=new Set,qS={};function _o(e,t){ji(e,t),ji(e+"Capture",t)}function ji(e,t){for(qS[e]=t,e=0;e<t.length;e++)zS.add(t[e])}var DP=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]*$"),ib={},lb={};function _P(e){return Qm.call(lb,e)?!0:Qm.call(ib,e)?!1:DP.test(e)?lb[e]=!0:(ib[e]=!0,!1)}function Bc(e,t,a){if(_P(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 Gn(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 Qa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function HS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OP(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 eh(e){if(!e._valueTracker){var t=HS(e)?"checked":"value";e._valueTracker=OP(e,t,""+e[t])}}function jS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=HS(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 PP=/[\n"\\]/g;function tn(e){return e.replace(PP,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function th(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=""+Qa(t)):e.value!==""+Qa(t)&&(e.value=""+Qa(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ah(e,i,Qa(t)):a!=null?ah(e,i,Qa(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=""+Qa(l):e.removeAttribute("name")}function VS(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)){eh(e);return}a=a!=null?""+Qa(a):"",t=t!=null?""+Qa(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),eh(e)}function ah(e,t,a){t==="number"&&ad(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ni(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=""+Qa(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 WS(e,t,a){if(t!=null&&(t=""+Qa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Qa(a):""}function GS(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=Qa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),eh(e)}function Vi(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var NP=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 sb(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||NP.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function $S(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&&sb(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&sb(e,o,t[o])}function Gh(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 BP=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"]]),UP=/^[\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 UP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var nh=null;function $h(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ti=null,Bi=null;function ub(e){var t=el(e);if(t&&(e=t.stateNode)){var a=e[Ma]||null;e:switch(e=t.stateNode,t.type){case"input":if(th(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="'+tn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Ma]||null;if(!r)throw Error(B(90));th(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&&jS(n)}break e;case"textarea":WS(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ni(e,!!a.multiple,t,!1)}}}var wm=!1;function XS(e,t,a){if(wm)return e(t,a);wm=!0;try{var n=e(t);return n}finally{if(wm=!1,(Ti!==null||Bi!==null)&&(Fd(),Ti&&(t=Ti,e=Bi,Bi=Ti=null,ub(t),e)))for(t=0;t<e.length;t++)ub(e[t])}}function Is(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ma]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(B(231,t,typeof a));return a}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rh=!1;if(or)try{yi={},Object.defineProperty(yi,"passive",{get:function(){rh=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{rh=!1}var yi,_r=null,Xh=null,Fc=null;function KS(){if(Fc)return Fc;var e,t=Xh,a=t.length,n,r="value"in _r?_r.value:_r.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 cb(){return!1}function Aa(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:cb,this.isPropagationStopped=cb,this}return mt(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 Oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=Aa(Oo),qs=mt({},Oo,{view:0,detail:0}),FP=Aa(qs),ym,xm,Ql,Md=mt({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kh,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"?(ym=e.screenX-Ql.screenX,xm=e.screenY-Ql.screenY):xm=ym=0,Ql=e),ym)},movementY:function(e){return"movementY"in e?e.movementY:xm}}),db=Aa(Md),zP=mt({},Md,{dataTransfer:0}),qP=Aa(zP),HP=mt({},qs,{relatedTarget:0}),vm=Aa(HP),jP=mt({},Oo,{animationName:0,elapsedTime:0,pseudoElement:0}),VP=Aa(jP),WP=mt({},Oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GP=Aa(WP),$P=mt({},Oo,{data:0}),fb=Aa($P),XP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KP={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"},YP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=YP[e])?!!t[e]:!1}function Kh(){return ZP}var QP=mt({},qs,{key:function(e){if(e.key){var t=XP[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"?KP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kh,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}}),JP=Aa(QP),eN=mt({},Md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pb=Aa(eN),tN=mt({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kh}),aN=Aa(tN),nN=mt({},Oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),rN=Aa(nN),oN=mt({},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}),iN=Aa(oN),lN=mt({},Oo,{newState:0,oldState:0}),sN=Aa(lN),uN=[9,13,27,32],Yh=or&&"CompositionEvent"in window,us=null;or&&"documentMode"in document&&(us=document.documentMode);var cN=or&&"TextEvent"in window&&!us,YS=or&&(!Yh||us&&8<us&&11>=us),mb=" ",hb=!1;function ZS(e,t){switch(e){case"keyup":return uN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Li=!1;function dN(e,t){switch(e){case"compositionend":return QS(t);case"keypress":return t.which!==32?null:(hb=!0,mb);case"textInput":return e=t.data,e===mb&&hb?null:e;default:return null}}function fN(e,t){if(Li)return e==="compositionend"||!Yh&&ZS(e,t)?(e=KS(),Fc=Xh=_r=null,Li=!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 YS&&t.locale!=="ko"?null:t.data;default:return null}}var pN={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 gb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pN[e.type]:t==="textarea"}function JS(e,t,a,n){Ti?Bi?Bi.push(n):Bi=[n]:Ti=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 mN(e){X0(e,0)}function Ad(e){var t=is(e);if(jS(t))return e}function wb(e,t){if(e==="change")return t}var eI=!1;or&&(or?(Tc="oninput"in document,Tc||(bm=document.createElement("div"),bm.setAttribute("oninput","return;"),Tc=typeof bm.oninput=="function"),kc=Tc):kc=!1,eI=kc&&(!document.documentMode||9<document.documentMode));var kc,Tc,bm;function yb(){cs&&(cs.detachEvent("onpropertychange",tI),Cs=cs=null)}function tI(e){if(e.propertyName==="value"&&Ad(Cs)){var t=[];JS(t,Cs,e,$h(e)),XS(mN,t)}}function hN(e,t,a){e==="focusin"?(yb(),cs=t,Cs=a,cs.attachEvent("onpropertychange",tI)):e==="focusout"&&yb()}function gN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ad(Cs)}function wN(e,t){if(e==="click")return Ad(t)}function yN(e,t){if(e==="input"||e==="change")return Ad(t)}function xN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ja=typeof Object.is=="function"?Object.is:xN;function ks(e,t){if(ja(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(!Qm.call(t,r)||!ja(e[r],t[r]))return!1}return!0}function xb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vb(e,t){var a=xb(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=xb(a)}}function aI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nI(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 Zh(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 vN=or&&"documentMode"in document&&11>=document.documentMode,Ei=null,oh=null,ds=null,ih=!1;function bb(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ih||Ei==null||Ei!==ad(n)||(n=Ei,"selectionStart"in n&&Zh(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(oh,"onSelect"),0<n.length&&(t=new Ed("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Ei)))}function yo(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Mi={animationend:yo("Animation","AnimationEnd"),animationiteration:yo("Animation","AnimationIteration"),animationstart:yo("Animation","AnimationStart"),transitionrun:yo("Transition","TransitionRun"),transitionstart:yo("Transition","TransitionStart"),transitioncancel:yo("Transition","TransitionCancel"),transitionend:yo("Transition","TransitionEnd")},Sm={},rI={};or&&(rI=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);function Po(e){if(Sm[e])return Sm[e];if(!Mi[e])return e;var t=Mi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in rI)return Sm[e]=t[a];return e}var oI=Po("animationend"),iI=Po("animationiteration"),lI=Po("animationstart"),bN=Po("transitionrun"),SN=Po("transitionstart"),IN=Po("transitioncancel"),sI=Po("transitionend"),uI=new Map,lh="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(" ");lh.push("scrollEnd");function vn(e,t){uI.set(e,t),_o(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)},Za=[],Ai=0,Qh=0;function Rd(){for(var e=Ai,t=Qh=Ai=0;t<e;){var a=Za[t];Za[t++]=null;var n=Za[t];Za[t++]=null;var r=Za[t];Za[t++]=null;var o=Za[t];if(Za[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&&cI(a,r,o)}}function Dd(e,t,a,n){Za[Ai++]=e,Za[Ai++]=t,Za[Ai++]=a,Za[Ai++]=n,Qh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Jh(e,t,a,n){return Dd(e,t,a,n),rd(e)}function No(e,t){return Dd(e,null,null,t),rd(e)}function cI(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-qa(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,Eh=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function CN(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 Ba(e,t,a,n){return new CN(e,t,a,n)}function eg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=Ba(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 dI(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")eg(e)&&(i=1);else if(typeof e=="string")i=LB(e,a,_n.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Xm:return e=Ba(31,a,t,r),e.elementType=Xm,e.lanes=o,e;case Ii:return Co(a.children,r,o,t);case AS:i=8,r|=24;break;case Wm:return e=Ba(12,a,t,r|2),e.elementType=Wm,e.lanes=o,e;case Gm:return e=Ba(13,a,t,r),e.elementType=Gm,e.lanes=o,e;case $m:return e=Ba(19,a,t,r),e.elementType=$m,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jn:i=10;break e;case RS:i=9;break e;case zh:i=11;break e;case qh:i=14;break e;case Tr:i=16,n=null;break e}i=29,a=Error(B(130,e===null?"null":typeof e,"")),n=null}return t=Ba(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function Co(e,t,a,n){return e=Ba(7,e,n,t),e.lanes=a,e}function Im(e,t,a){return e=Ba(6,e,null,t),e.lanes=a,e}function fI(e){var t=Ba(18,null,null,0);return t.stateNode=e,t}function Cm(e,t,a){return t=Ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Sb=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var a=Sb.get(e);return a!==void 0?a:(t={value:e,source:t,stack:nb(t)},Sb.set(e,t),t)}return{value:e,source:t,stack:nb(t)}}var Di=[],_i=0,od=null,Ts=0,Ja=[],en=0,Gr=null,An=1,Rn="";function Zn(e,t){Di[_i++]=Ts,Di[_i++]=od,od=e,Ts=t}function pI(e,t,a){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,Gr=e;var n=An;e=Rn;var r=32-qa(n)-1;n&=~(1<<r),a+=1;var o=32-qa(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,An=1<<32-qa(t)+r|a<<r|n,Rn=o+e}else An=1<<o|a<<r|n,Rn=e}function tg(e){e.return!==null&&(Zn(e,1),pI(e,1,0))}function ag(e){for(;e===od;)od=Di[--_i],Di[_i]=null,Ts=Di[--_i],Di[_i]=null;for(;e===Gr;)Gr=Ja[--en],Ja[en]=null,Rn=Ja[--en],Ja[en]=null,An=Ja[--en],Ja[en]=null}function mI(e,t){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,An=t.id,Rn=t.overflow,Gr=e}var ta=null,pt=null,Ue=!1,Ur=null,nn=!1,sh=Error(B(519));function $r(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(an(t,e)),sh}function Ib(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ea]=e,t[Ma]=n,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<Rs.length;a++)Re(Rs[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),VS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),GS(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||Y0(t.textContent,a)?(n.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),n.onScroll!=null&&Re("scroll",t),n.onScrollEnd!=null&&Re("scrollend",t),n.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||$r(e,!0)}function Cb(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:nn=!1;return;case 27:case 3:nn=!0;return;default:ta=ta.return}}function xi(e){if(e!==ta)return!1;if(!Ue)return Cb(e),Ue=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||_h(e.type,e.memoizedProps)),a=!a),a&&pt&&$r(e),Cb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=fS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=fS(e)}else t===27?(t=pt,Zr(e.type)?(e=Bh,Bh=null,pt=e):pt=t):pt=ta?on(e.stateNode.nextSibling):null;return!0}function Eo(){pt=ta=null,Ue=!1}function km(){var e=Ur;return e!==null&&(La===null?La=e:La.push.apply(La,e),Ur=null),e}function Ls(e){Ur===null?Ur=[e]:Ur.push(e)}var uh=On(null),Bo=null,tr=null;function Er(e,t,a){ct(uh,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=uh.current,Yt(uh)}function ch(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 dh(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),ch(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),ch(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 tl(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;ja(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&&dh(t,e,a,n),t.flags|=262144}function id(e){for(e=e.firstContext;e!==null;){if(!ja(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Mo(e){Bo=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function aa(e){return hI(Bo,e)}function Lc(e,t){return Bo===null&&Mo(e),hI(e,t)}function hI(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(B(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var kN=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()})}},TN=Ht.unstable_scheduleCallback,LN=Ht.unstable_NormalPriority,Ut={$$typeof:Jn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ng(){return{controller:new kN,data:new Map,refCount:0}}function Hs(e){e.refCount--,e.refCount===0&&TN(LN,function(){e.controller.abort()})}var fs=null,fh=0,Wi=0,Ui=null;function EN(e,t){if(fs===null){var a=fs=[];fh=0,Wi=Eg(),Ui={status:"pending",value:void 0,then:function(n){a.push(n)}}}return fh++,t.then(kb,kb),t}function kb(){if(--fh===0&&fs!==null){Ui!==null&&(Ui.status="fulfilled");var e=fs;fs=null,Wi=0,Ui=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function MN(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 Tb=fe.S;fe.S=function(e,t){M0=Fa(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&EN(e,t),Tb!==null&&Tb(e,t)};var ko=On(null);function rg(){var e=ko.current;return e!==null?e:st.pooledCache}function Hc(e,t){t===null?ct(ko,ko.current):ct(ko,t.pool)}function gI(){var e=rg();return e===null?null:{parent:Ut._currentValue,pool:e}}var al=Error(B(460)),og=Error(B(474)),_d=Error(B(542)),ld={then:function(){}};function Lb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wI(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mb(e),e;default:if(typeof t.status=="string")t.then(er,er);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,Mb(e),e}throw To=t,al}}function bo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(To=a,al):a}}var To=null;function Eb(){if(To===null)throw Error(B(459));var e=To;return To=null,e}function Mb(e){if(e===al||e===_d)throw Error(B(483))}var Fi=null,Es=0;function Ec(e){var t=Es;return Es+=1,Fi===null&&(Fi=[]),wI(Fi,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mc(e,t){throw t.$$typeof===hP?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yI(e){function t(w,y){if(e){var h=w.deletions;h===null?(w.deletions=[y],w.flags|=16):h.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=ar(w,y),w.index=0,w.sibling=null,w}function o(w,y,h){return w.index=h,e?(h=w.alternate,h!==null?(h=h.index,h<y?(w.flags|=67108866,y):h):(w.flags|=67108866,y)):(w.flags|=1048576,y)}function i(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function l(w,y,h,b){return y===null||y.tag!==6?(y=Im(h,w.mode,b),y.return=w,y):(y=r(y,h),y.return=w,y)}function s(w,y,h,b){var T=h.type;return T===Ii?c(w,y,h.props.children,b,h.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&bo(T)===y.type)?(y=r(y,h.props),Jl(y,h),y.return=w,y):(y=qc(h.type,h.key,h.props,null,w.mode,b),Jl(y,h),y.return=w,y)}function u(w,y,h,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==h.containerInfo||y.stateNode.implementation!==h.implementation?(y=Cm(h,w.mode,b),y.return=w,y):(y=r(y,h.children||[]),y.return=w,y)}function c(w,y,h,b,T){return y===null||y.tag!==7?(y=Co(h,w.mode,b,T),y.return=w,y):(y=r(y,h),y.return=w,y)}function d(w,y,h){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Im(""+y,w.mode,h),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xc:return h=qc(y.type,y.key,y.props,null,w.mode,h),Jl(h,y),h.return=w,h;case rs:return y=Cm(y,w.mode,h),y.return=w,y;case Tr:return y=bo(y),d(w,y,h)}if(os(y)||Zl(y))return y=Co(y,w.mode,h,null),y.return=w,y;if(typeof y.then=="function")return d(w,Ec(y),h);if(y.$$typeof===Jn)return d(w,Lc(w,y),h);Mc(w,y)}return null}function f(w,y,h,b){var T=y!==null?y.key:null;if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return T!==null?null:l(w,y,""+h,b);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case xc:return h.key===T?s(w,y,h,b):null;case rs:return h.key===T?u(w,y,h,b):null;case Tr:return h=bo(h),f(w,y,h,b)}if(os(h)||Zl(h))return T!==null?null:c(w,y,h,b,null);if(typeof h.then=="function")return f(w,y,Ec(h),b);if(h.$$typeof===Jn)return f(w,y,Lc(w,h),b);Mc(w,h)}return null}function p(w,y,h,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w=w.get(h)||null,l(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case xc:return w=w.get(b.key===null?h:b.key)||null,s(y,w,b,T);case rs:return w=w.get(b.key===null?h:b.key)||null,u(y,w,b,T);case Tr:return b=bo(b),p(w,y,h,b,T)}if(os(b)||Zl(b))return w=w.get(h)||null,c(y,w,b,T,null);if(typeof b.then=="function")return p(w,y,h,Ec(b),T);if(b.$$typeof===Jn)return p(w,y,h,Lc(y,b),T);Mc(y,b)}return null}function m(w,y,h,b){for(var T=null,C=null,M=y,D=y=0,P=null;M!==null&&D<h.length;D++){M.index>D?(P=M,M=null):P=M.sibling;var L=f(w,M,h[D],b);if(L===null){M===null&&(M=P);break}e&&M&&L.alternate===null&&t(w,M),y=o(L,y,D),C===null?T=L:C.sibling=L,C=L,M=P}if(D===h.length)return a(w,M),Ue&&Zn(w,D),T;if(M===null){for(;D<h.length;D++)M=d(w,h[D],b),M!==null&&(y=o(M,y,D),C===null?T=M:C.sibling=M,C=M);return Ue&&Zn(w,D),T}for(M=n(M);D<h.length;D++)P=p(M,w,D,h[D],b),P!==null&&(e&&P.alternate!==null&&M.delete(P.key===null?D:P.key),y=o(P,y,D),C===null?T=P:C.sibling=P,C=P);return e&&M.forEach(function($){return t(w,$)}),Ue&&Zn(w,D),T}function x(w,y,h,b){if(h==null)throw Error(B(151));for(var T=null,C=null,M=y,D=y=0,P=null,L=h.next();M!==null&&!L.done;D++,L=h.next()){M.index>D?(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,D),C===null?T=$:C.sibling=$,C=$,M=P}if(L.done)return a(w,M),Ue&&Zn(w,D),T;if(M===null){for(;!L.done;D++,L=h.next())L=d(w,L.value,b),L!==null&&(y=o(L,y,D),C===null?T=L:C.sibling=L,C=L);return Ue&&Zn(w,D),T}for(M=n(M);!L.done;D++,L=h.next())L=p(M,w,D,L.value,b),L!==null&&(e&&L.alternate!==null&&M.delete(L.key===null?D:L.key),y=o(L,y,D),C===null?T=L:C.sibling=L,C=L);return e&&M.forEach(function(H){return t(w,H)}),Ue&&Zn(w,D),T}function S(w,y,h,b){if(typeof h=="object"&&h!==null&&h.type===Ii&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case xc:e:{for(var T=h.key;y!==null;){if(y.key===T){if(T=h.type,T===Ii){if(y.tag===7){a(w,y.sibling),b=r(y,h.props.children),b.return=w,w=b;break e}}else if(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&bo(T)===y.type){a(w,y.sibling),b=r(y,h.props),Jl(b,h),b.return=w,w=b;break e}a(w,y);break}else t(w,y);y=y.sibling}h.type===Ii?(b=Co(h.props.children,w.mode,b,h.key),b.return=w,w=b):(b=qc(h.type,h.key,h.props,null,w.mode,b),Jl(b,h),b.return=w,w=b)}return i(w);case rs:e:{for(T=h.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===h.containerInfo&&y.stateNode.implementation===h.implementation){a(w,y.sibling),b=r(y,h.children||[]),b.return=w,w=b;break e}else{a(w,y);break}else t(w,y);y=y.sibling}b=Cm(h,w.mode,b),b.return=w,w=b}return i(w);case Tr:return h=bo(h),S(w,y,h,b)}if(os(h))return m(w,y,h,b);if(Zl(h)){if(T=Zl(h),typeof T!="function")throw Error(B(150));return h=T.call(h),x(w,y,h,b)}if(typeof h.then=="function")return S(w,y,Ec(h),b);if(h.$$typeof===Jn)return S(w,y,Lc(w,h),b);Mc(w,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,y!==null&&y.tag===6?(a(w,y.sibling),b=r(y,h),b.return=w,w=b):(a(w,y),b=Im(h,w.mode,b),b.return=w,w=b),i(w)):a(w,y)}return function(w,y,h,b){try{Es=0;var T=S(w,y,h,b);return Fi=null,T}catch(M){if(M===al||M===_d)throw M;var C=Ba(29,M,null,w.mode);return C.lanes=b,C.return=w,C}}}var Ao=yI(!0),xI=yI(!1),Lr=!1;function ig(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ph(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 Fr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zr(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=rd(e),cI(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,BS(e,a)}}function Tm(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 mh=!1;function ms(){if(mh){var e=Ui;if(e!==null)throw e}}function hs(e,t,a,n){mh=!1;var r=e.updateQueue;Lr=!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===Wi&&(mh=!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=mt({},d,f);break e;case 2:Lr=!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),Kr|=i,e.lanes=i,e.memoizedState=d}}function vI(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function bI(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)vI(a[e],t)}var Gi=On(null),sd=On(0);function Ab(e,t){e=ur,ct(sd,e),ct(Gi,t),ur=e|t.baseLanes}function hh(){ct(sd,ur),ct(Gi,Gi.current)}function lg(){ur=sd.current,Yt(Gi),Yt(sd)}var Va=On(null),rn=null;function Mr(e){var t=e.alternate;ct(Rt,Rt.current&1),ct(Va,e),rn===null&&(t===null||Gi.current!==null||t.memoizedState!==null)&&(rn=e)}function gh(e){ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)}function SI(e){e.tag===22?(ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)):Ar(e)}function Ar(){ct(Rt,Rt.current),ct(Va,Va.current)}function Na(e){Yt(Va),rn===e&&(rn=null),Yt(Rt)}var Rt=On(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||Ph(a)||Nh(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 ir=0,Se=null,it=null,Nt=null,cd=!1,zi=!1,Ro=!1,dd=0,Ms=0,qi=null,AN=0;function It(){throw Error(B(321))}function sg(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ja(e[a],t[a]))return!1;return!0}function ug(e,t,a,n,r,o){return ir=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?JI:vg,Ro=!1,o=a(n,r),Ro=!1,zi&&(o=CI(t,a,n,r)),II(e),o}function II(e){fe.H=As;var t=it!==null&&it.next!==null;if(ir=0,Nt=it=Se=null,cd=!1,Ms=0,qi=null,t)throw Error(B(300));e===null||Ft||(e=e.dependencies,e!==null&&id(e)&&(Ft=!0))}function CI(e,t,a,n){Se=e;var r=0;do{if(zi&&(qi=null),Ms=0,zi=!1,25<=r)throw Error(B(301));if(r+=1,Nt=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)}fe.H=e0,o=t(a,n)}while(zi);return o}function RN(){var e=fe.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 cg(){var e=dd!==0;return dd=0,e}function dg(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function fg(e){if(cd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cd=!1}ir=0,Nt=it=Se=null,zi=!1,Ms=dd=0,qi=null}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Dt(){if(it===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Nt===null?Se.memoizedState:Nt.next;if(t!==null)Nt=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},Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function js(e){var t=Ms;return Ms+=1,qi===null&&(qi=[]),e=wI(qi,e,t),t=Se,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?JI:vg),e}function Pd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return js(e);if(e.$$typeof===Jn)return aa(e)}throw Error(B(438,String(e)))}function pg(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]=gP;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function jc(e){var t=Dt();return mg(t,it,e)}function mg(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:(ir&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===Wi&&(c=!0);else if((ir&f)===f){u=u.next,f===Wi&&(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,Kr|=f;d=u.action,Ro&&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,Kr|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!ja(o,e.memoizedState)&&(Ft=!0,c&&(a=Ui,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 Lm(e){var t=Dt(),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);ja(o,t.memoizedState)||(Ft=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function kI(e,t,a){var n=Se,r=Dt(),o=Ue;if(o){if(a===void 0)throw Error(B(407));a=a()}else a=t();var i=!ja((it||r).memoizedState,a);if(i&&(r.memoizedState=a,Ft=!0),r=r.queue,hg(EI.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Nt!==null&&Nt.memoizedState.tag&1){if(n.flags|=2048,$i(9,{destroy:void 0},LI.bind(null,n,r,a,t),null),st===null)throw Error(B(349));o||(ir&127)!==0||TI(n,t,a)}return a}function TI(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 LI(e,t,a,n){t.value=a,t.getSnapshot=n,MI(t)&&AI(e)}function EI(e,t,a){return a(function(){MI(t)&&AI(e)})}function MI(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ja(e,a)}catch{return!0}}function AI(e){var t=No(e,2);t!==null&&Ea(t,e,2)}function wh(e){var t=pa();if(typeof e=="function"){var a=e;if(e=a(),Ro){Dr(!0);try{a()}finally{Dr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function RI(e,t,a,n){return e.baseState=a,mg(e,it,typeof n=="function"?n:lr)}function DN(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)}};fe.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,DI(t,o)):(o.next=a.next,t.pending=a.next=o)}}function DI(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=fe.T,i={};fe.T=i;try{var l=a(r,n),s=fe.S;s!==null&&s(i,l),Rb(e,t,l)}catch(u){yh(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),fe.T=o}}else try{o=a(r,n),Rb(e,t,o)}catch(u){yh(e,t,u)}}function Rb(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Db(e,t,n)},function(n){return yh(e,t,n)}):Db(e,t,a)}function Db(e,t,a){t.status="fulfilled",t.value=a,_I(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,DI(e,a)))}function yh(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,_I(t),t=t.next;while(t!==n)}e.action=null}function _I(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function OI(e,t){return t}function _b(e,t){if(Ue){var a=st.formState;if(a!==null){e:{var n=Se;if(Ue){if(pt){t:{for(var r=pt,o=nn;r.nodeType!==8;){if(!o){r=null;break t}if(r=on(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){pt=on(r.nextSibling),n=r.data==="F!";break e}}$r(n)}n=!1}n&&(t=a[0])}}return a=pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:OI,lastRenderedState:t},a.queue=n,a=YI.bind(null,Se,n),n.dispatch=a,n=wh(!1),o=xg.bind(null,Se,!1,n.queue),n=pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=DN.bind(null,Se,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Ob(e){var t=Dt();return PI(t,it,e)}function PI(e,t,a){if(t=mg(e,t,OI)[0],e=jc(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=js(t)}catch(i){throw i===al?_d:i}else n=t;t=Dt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Se.flags|=2048,$i(9,{destroy:void 0},_N.bind(null,r,a),null)),[n,o,e]}function _N(e,t){e.action=t}function Pb(e){var t=Dt(),a=it;if(a!==null)return PI(t,a,e);Dt(),t=t.memoizedState,a=Dt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function $i(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 NI(){return Dt().memoizedState}function Vc(e,t,a,n){var r=pa();Se.flags|=e,r.memoizedState=$i(1|t,{destroy:void 0},a,n===void 0?null:n)}function Nd(e,t,a,n){var r=Dt();n=n===void 0?null:n;var o=r.memoizedState.inst;it!==null&&n!==null&&sg(n,it.memoizedState.deps)?r.memoizedState=$i(t,o,a,n):(Se.flags|=e,r.memoizedState=$i(1|t,o,a,n))}function Nb(e,t){Vc(8390656,8,e,t)}function hg(e,t){Nd(2048,8,e,t)}function ON(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 BI(e){var t=Dt().memoizedState;return ON({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function UI(e,t){return Nd(4,2,e,t)}function FI(e,t){return Nd(4,4,e,t)}function zI(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 qI(e,t,a){a=a!=null?a.concat([e]):null,Nd(4,4,zI.bind(null,t,e),a)}function gg(){}function HI(e,t){var a=Dt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&sg(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function jI(e,t){var a=Dt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&sg(t,n[1]))return n[0];if(n=e(),Ro){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n}function wg(e,t,a){return a===void 0||(ir&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=R0(),Se.lanes|=e,Kr|=e,a)}function VI(e,t,a,n){return ja(a,t)?a:Gi.current!==null?(e=wg(e,a,n),ja(e,t)||(Ft=!0),e):(ir&42)===0||(ir&1073741824)!==0&&(Pe&261930)===0?(Ft=!0,e.memoizedState=a):(e=R0(),Se.lanes|=e,Kr|=e,t)}function WI(e,t,a,n,r){var o=Ze.p;Ze.p=o!==0&&8>o?o:8;var i=fe.T,l={};fe.T=l,xg(e,!1,t,a);try{var s=r(),u=fe.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=MN(s,n);gs(e,t,c,Ha(e))}else gs(e,t,n,Ha(e))}catch(d){gs(e,t,{then:function(){},status:"rejected",reason:d},Ha())}finally{Ze.p=o,i!==null&&l.types!==null&&(i.types=l.types),fe.T=i}}function PN(){}function xh(e,t,a,n){if(e.tag!==5)throw Error(B(476));var r=GI(e).queue;WI(e,r,t,Io,a===null?PN:function(){return $I(e),a(n)})}function GI(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Io,baseState:Io,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:Io},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $I(e){var t=GI(e);t.next===null&&(t=e.alternate.memoizedState),gs(e,t.next.queue,{},Ha())}function yg(){return aa(_s)}function XI(){return Dt().memoizedState}function KI(){return Dt().memoizedState}function NN(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ha();e=Fr(a);var n=zr(t,e,a);n!==null&&(Ea(n,t,a),ps(n,t,a)),t={cache:ng()},e.payload=t;return}t=t.return}}function BN(e,t,a){var n=Ha();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bd(e)?ZI(t,a):(a=Jh(e,t,a,n),a!==null&&(Ea(a,e,n),QI(a,t,n)))}function YI(e,t,a){var n=Ha();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))ZI(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,ja(l,i))return Dd(e,t,r,0),st===null&&Rd(),!1}catch{}if(a=Jh(e,t,r,n),a!==null)return Ea(a,e,n),QI(a,t,n),!0}return!1}function xg(e,t,a,n){if(n={lane:2,revertLane:Eg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bd(e)){if(t)throw Error(B(479))}else t=Jh(e,a,n,2),t!==null&&Ea(t,e,2)}function Bd(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function ZI(e,t){zi=cd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function QI(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,BS(e,a)}}var As={readContext:aa,use:Pd,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};As.useEffectEvent=It;var JI={readContext:aa,use:Pd,useCallback:function(e,t){return pa().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:Nb,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Vc(4194308,4,zI.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(Ro){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=pa();if(a!==void 0){var r=a(t);if(Ro){Dr(!0);try{a(t)}finally{Dr(!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=BN.bind(null,Se,e),[n.memoizedState,e]},useRef:function(e){var t=pa();return e={current:e},t.memoizedState=e},useState:function(e){e=wh(e);var t=e.queue,a=YI.bind(null,Se,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:gg,useDeferredValue:function(e,t){var a=pa();return wg(a,e,t)},useTransition:function(){var e=wh(!1);return e=WI.bind(null,Se,e.queue,!0,!1),pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Se,r=pa();if(Ue){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),st===null)throw Error(B(349));(Pe&127)!==0||TI(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Nb(EI.bind(null,n,o,e),[e]),n.flags|=2048,$i(9,{destroy:void 0},LI.bind(null,n,o,a,t),null),a},useId:function(){var e=pa(),t=st.identifierPrefix;if(Ue){var a=Rn,n=An;a=(n&~(1<<32-qa(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=dd++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=AN++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:yg,useFormState:_b,useActionState:_b,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=xg.bind(null,Se,!0,a),a.dispatch=t,[e,t]},useMemoCache:pg,useCacheRefresh:function(){return pa().memoizedState=NN.bind(null,Se)},useEffectEvent:function(e){var t=pa(),a={impl:e};return t.memoizedState=a,function(){if((Ye&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},vg={readContext:aa,use:Pd,useCallback:HI,useContext:aa,useEffect:hg,useImperativeHandle:qI,useInsertionEffect:UI,useLayoutEffect:FI,useMemo:jI,useReducer:jc,useRef:NI,useState:function(){return jc(lr)},useDebugValue:gg,useDeferredValue:function(e,t){var a=Dt();return VI(a,it.memoizedState,e,t)},useTransition:function(){var e=jc(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:kI,useId:XI,useHostTransitionStatus:yg,useFormState:Ob,useActionState:Ob,useOptimistic:function(e,t){var a=Dt();return RI(a,it,e,t)},useMemoCache:pg,useCacheRefresh:KI};vg.useEffectEvent=BI;var e0={readContext:aa,use:Pd,useCallback:HI,useContext:aa,useEffect:hg,useImperativeHandle:qI,useInsertionEffect:UI,useLayoutEffect:FI,useMemo:jI,useReducer:Lm,useRef:NI,useState:function(){return Lm(lr)},useDebugValue:gg,useDeferredValue:function(e,t){var a=Dt();return it===null?wg(a,e,t):VI(a,it.memoizedState,e,t)},useTransition:function(){var e=Lm(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:kI,useId:XI,useHostTransitionStatus:yg,useFormState:Pb,useActionState:Pb,useOptimistic:function(e,t){var a=Dt();return it!==null?RI(a,it,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:pg,useCacheRefresh:KI};e0.useEffectEvent=BI;function Em(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:mt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var vh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),ps(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),ps(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ha(),n=Fr(a);n.tag=2,t!=null&&(n.callback=t),t=zr(e,n,a),t!==null&&(Ea(t,e,a),ps(t,e,a))}};function Bb(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 Ub(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&&vh.enqueueReplaceState(t,t.state,null)}function Do(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=mt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function t0(e){nd(e)}function a0(e){console.error(e)}function n0(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 Fb(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 bh(e,t,a){return a=Fr(a),a.tag=3,a.payload={element:null},a.callback=function(){fd(e,t)},a}function r0(e){return e=Fr(e),e.tag=3,e}function o0(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(){Fb(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Fb(t,a,n),typeof r!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function UN(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&tl(t,a,r,!0),a=Va.current,a!==null){switch(a.tag){case 31:case 13:return rn===null?wd():a.alternate===null&&Ct===0&&(Ct=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),Fm(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)),Fm(e,n,r)),!1}throw Error(B(435,a.tag))}return Fm(e,n,r),wd(),!1}if(Ue)return t=Va.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==sh&&(e=Error(B(422),{cause:n}),Ls(an(e,a)))):(n!==sh&&(t=Error(B(423),{cause:n}),Ls(an(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=an(n,a),r=bh(e.stateNode,n,r),Tm(e,r),Ct!==4&&(Ct=2)),!1;var o=Error(B(520),{cause:n});if(o=an(o,a),xs===null?xs=[o]:xs.push(o),Ct!==4&&(Ct=2),t===null)return!0;n=an(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=bh(a.stateNode,n,e),Tm(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"&&(qr===null||!qr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=r0(r),o0(r,e,a,n),Tm(a,r),!1}a=a.return}while(a!==null);return!1}var bg=Error(B(461)),Ft=!1;function Jt(e,t,a,n){t.child=e===null?xI(t,null,a,n):Ao(t,e.child,a,n)}function zb(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}else i=n;return Mo(t),n=ug(e,t,a,i,o,r),l=cg(),e!==null&&!Ft?(dg(e,t,r),sr(e,t,r)):(Ue&&l&&tg(t),t.flags|=1,Jt(e,t,n,r),t.child)}function qb(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!eg(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,i0(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,!Sg(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:ks,a(i,n)&&e.ref===t.ref)return sr(e,t,r)}return t.flags|=1,e=ar(o,n),e.ref=t.ref,e.return=t,t.child=e}function i0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(ks(o,n)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=n=o,Sg(e,r))(e.flags&131072)!==0&&(Ft=!0);else return t.lanes=e.lanes,sr(e,t,r)}return Sh(e,t,a,n,r)}function l0(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 Hb(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?Ab(t,o):hh(),SI(t);else return n=t.lanes=536870912,Hb(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Hc(t,o.cachePool),Ab(t,o),Ar(t),t.memoizedState=null):(e!==null&&Hc(t,null),hh(),Ar(t));return Jt(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 Hb(e,t,a,n,r){var o=rg();return o=o===null?null:{parent:Ut._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Hc(t,null),hh(),SI(t),e!==null&&tl(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 jb(e,t,a){return Ao(t,e.child,null,a),e=Wc(t,t.pendingProps),e.flags|=2,Na(t),t.memoizedState=null,e}function FN(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(n.mode==="hidden")return e=Wc(t,n),t.lanes=536870912,ls(null,e);if(gh(t),(e=pt)?(e=J0(e,nn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=fI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(t);return t.lanes=536870912,null}return Wc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(gh(t),r)if(t.flags&256)t.flags&=-257,t=jb(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(Ft||tl(e,t,a,!1),r=(a&e.childLanes)!==0,Ft||r){if(n=st,n!==null&&(i=US(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,No(e,i),Ea(n,e,i),bg;wd(),t=jb(e,t,a)}else e=o.treeContext,pt=on(i.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&mI(t,e),t=Wc(t,n),t.flags|=4096;return t}return e=ar(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 Sh(e,t,a,n,r){return Mo(t),a=ug(e,t,a,n,void 0,r),n=cg(),e!==null&&!Ft?(dg(e,t,r),sr(e,t,r)):(Ue&&n&&tg(t),t.flags|=1,Jt(e,t,a,r),t.child)}function Vb(e,t,a,n,r,o){return Mo(t),t.updateQueue=null,a=CI(t,n,a,r),II(e),n=cg(),e!==null&&!Ft?(dg(e,t,o),sr(e,t,o)):(Ue&&n&&tg(t),t.flags|=1,Jt(e,t,a,o),t.child)}function Wb(e,t,a,n,r){if(Mo(t),t.stateNode===null){var o=Ri,i=a.contextType;typeof i=="object"&&i!==null&&(o=aa(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=vh,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},ig(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?aa(i):Ri,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Em(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&&vh.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=Do(a,l);o.props=s;var u=o.context,c=a.contextType;i=Ri,typeof c=="object"&&c!==null&&(i=aa(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)&&Ub(t,o,n,i),Lr=!1;var f=t.memoizedState;o.state=f,hs(t,n,o,r),ms(),u=t.memoizedState,l||f!==u||Lr?(typeof d=="function"&&(Em(t,a,d,n),u=t.memoizedState),(s=Lr||Bb(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,ph(e,t),i=t.memoizedProps,c=Do(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=Ri,typeof u=="object"&&u!==null&&(s=aa(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)&&Ub(t,o,n,s),Lr=!1,f=t.memoizedState,o.state=f,hs(t,n,o,r),ms();var p=t.memoizedState;i!==d||f!==p||Lr||e!==null&&e.dependencies!==null&&id(e.dependencies)?(typeof l=="function"&&(Em(t,a,l,n),p=t.memoizedState),(c=Lr||Bb(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=Ao(t,e.child,null,r),t.child=Ao(t,null,a,r)):Jt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=sr(e,t,r),e}function Gb(e,t,a,n){return Eo(),t.flags|=256,Jt(e,t,a,n),t.child}var Mm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Am(e){return{baseLanes:e,cachePool:gI()}}function Rm(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ua),e}function s0(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:(Rt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Mr(t):Ar(t),(e=pt)?(e=J0(e,nn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=fI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(t);return Nh(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(Ar(t),r=t.mode,l=pd({mode:"hidden",children:l},r),n=Co(n,r,a,null),l.return=t,n.return=t,l.sibling=n,t.child=l,n=t.child,n.memoizedState=Am(a),n.childLanes=Rm(e,i,a),t.memoizedState=Mm,ls(null,n)):(Mr(t),Ih(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(Mr(t),t.flags&=-257,t=Dm(e,t,a)):t.memoizedState!==null?(Ar(t),t.child=e.child,t.flags|=128,t=null):(Ar(t),l=n.fallback,r=t.mode,n=pd({mode:"visible",children:n.children},r),l=Co(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,Ao(t,e.child,null,a),n=t.child,n.memoizedState=Am(a),n.childLanes=Rm(e,i,a),t.memoizedState=Mm,t=ls(null,n));else if(Mr(t),Nh(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=Dm(e,t,a)}else if(Ft||tl(e,t,a,!1),i=(a&e.childLanes)!==0,Ft||i){if(i=st,i!==null&&(n=US(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,No(e,n),Ea(i,e,n),bg;Ph(l)||wd(),t=Dm(e,t,a)}else Ph(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,pt=on(l.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&mI(t,e),t=Ih(t,n.children),t.flags|=4096);return t}return r?(Ar(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=ar(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=ar(u,l):(l=Co(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=Am(a):(r=l.cachePool,r!==null?(s=Ut._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=gI(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Rm(e,i,a),t.memoizedState=Mm,ls(e.child,n)):(Mr(t),a=e.child,e=a.sibling,a=ar(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 Ih(e,t){return t=pd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pd(e,t){return e=Ba(22,e,null,t),e.lanes=0,e}function Dm(e,t,a){return Ao(t,e.child,null,a),e=Ih(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $b(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ch(e.return,t,a)}function _m(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 u0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Rt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,ct(Rt,i),Jt(e,t,n,a),n=Ue?Ts:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$b(e,a,t);else if(e.tag===19)$b(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),_m(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}_m(t,!0,a,null,o,n);break;case"together":_m(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Kr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(tl(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=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Sg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&id(e)))}function zN(e,t,a){switch(t.tag){case 3:Jc(t,t.stateNode.containerInfo),Er(t,Ut,e.memoizedState.cache),Eo();break;case 27:case 5:Zm(t);break;case 4:Jc(t,t.stateNode.containerInfo);break;case 10:Er(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gh(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?s0(e,t,a):(Mr(t),e=sr(e,t,a),e!==null?e.sibling:null);Mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(tl(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return u0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ct(Rt,Rt.current),n)break;return null;case 22:return t.lanes=0,l0(e,t,a,t.pendingProps);case 24:Er(t,Ut,e.memoizedState.cache)}return sr(e,t,a)}function c0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ft=!0;else{if(!Sg(e,a)&&(t.flags&128)===0)return Ft=!1,zN(e,t,a);Ft=(e.flags&131072)!==0}else Ft=!1,Ue&&(t.flags&1048576)!==0&&pI(t,Ts,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=bo(t.elementType),t.type=e,typeof e=="function")eg(e)?(n=Do(e,n),t.tag=1,t=Wb(null,t,e,n,a)):(t.tag=0,t=Sh(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===zh){t.tag=11,t=zb(null,t,e,n,a);break e}else if(r===qh){t.tag=14,t=qb(null,t,e,n,a);break e}}throw t=Km(e)||e,Error(B(306,t,""))}}return t;case 0:return Sh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Do(n,t.pendingProps),Wb(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,ph(e,t),hs(t,n,null,a);var i=t.memoizedState;if(n=i.cache,Er(t,Ut,n),n!==o.cache&&dh(t,[Ut],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=Gb(e,t,n,a);break e}else if(n!==r){r=an(Error(B(424)),t),Ls(r),t=Gb(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,pt=on(e.firstChild),ta=t,Ue=!0,Ur=null,nn=!0,a=xI(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Eo(),n===r){t=sr(e,t,a);break e}Jt(e,t,n,a)}t=t.child}return t;case 26:return Gc(e,t),e===null?(a=hS(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,n=bd(Br.current).createElement(a),n[ea]=t,n[Ma]=e,na(n,a,e),Kt(n),t.stateNode=n):t.memoizedState=hS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Zm(t),e===null&&Ue&&(n=t.stateNode=eC(t.type,t.pendingProps,Br.current),ta=t,nn=!0,r=pt,Zr(t.type)?(Bh=r,pt=on(n.firstChild)):pt=r),Jt(e,t,t.pendingProps.children,a),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=n=pt)&&(n=mB(n,t.type,t.pendingProps,nn),n!==null?(t.stateNode=n,ta=t,pt=on(n.firstChild),nn=!1,r=!0):r=!1),r||$r(t)),Zm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,_h(r,o)?n=null:i!==null&&_h(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=ug(e,t,RN,null,null,a),_s._currentValue=r),Gc(e,t),Jt(e,t,n,a),t.child;case 6:return e===null&&Ue&&((e=a=pt)&&(a=hB(a,t.pendingProps,nn),a!==null?(t.stateNode=a,ta=t,pt=null,e=!0):e=!1),e||$r(t)),null;case 13:return s0(e,t,a);case 4:return Jc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ao(t,null,n,a):Jt(e,t,n,a),t.child;case 11:return zb(e,t,t.type,t.pendingProps,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Er(t,t.type,n.value),Jt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Mo(t),r=aa(r),n=n(r),t.flags|=1,Jt(e,t,n,a),t.child;case 14:return qb(e,t,t.type,t.pendingProps,a);case 15:return i0(e,t,t.type,t.pendingProps,a);case 19:return u0(e,t,a);case 31:return FN(e,t,a);case 22:return l0(e,t,a,t.pendingProps);case 24:return Mo(t),n=aa(Ut),e===null?(r=rg(),r===null&&(r=st,o=ng(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},ig(t),Er(t,Ut,r)):((e.lanes&a)!==0&&(ph(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),Er(t,Ut,n)):(n=o.cache,Er(t,Ut,n),n!==r.cache&&dh(t,[Ut],a,!0))),Jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function $n(e){e.flags|=4}function Om(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(O0())e.flags|=8192;else throw To=ld,og}else e.flags&=-16777217}function Xb(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nC(t))if(O0())e.flags|=8192;else throw To=ld,og}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?PS():536870912,e.lanes|=t,Xi|=t)}function es(e,t){if(!Ue)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 ft(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 qN(e,t,a){var n=t.pendingProps;switch(ag(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),nr(Ut),Hi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xi(t)?$n(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,km())),ft(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?($n(t),o!==null?(ft(t),Xb(t,o)):(ft(t),Om(t,r,null,n,a))):o?o!==e.memoizedState?($n(t),ft(t),Xb(t,o)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&$n(t),ft(t),Om(t,r,e,n,a)),null;case 27:if(ed(t),a=Br.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}e=_n.current,xi(t)?Ib(t,e):(e=eC(r,n,a),t.stateNode=e,$n(t))}return ft(t),null;case 5:if(ed(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}if(o=_n.current,xi(t))Ib(t,o);else{var i=bd(Br.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[ea]=t,o[Ma]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(na(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&&$n(t)}}return ft(t),Om(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(e=Br.current,xi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=ta,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[ea]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Y0(e.nodeValue,a)),e||$r(t,!0)}else e=bd(e).createTextNode(n),e[ea]=t,t.stateNode=e}return ft(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=xi(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[ea]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(B(558))}return ft(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=xi(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[ea]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),r=!1}else r=km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(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),ft(t),null);case 4:return Hi(),e===null&&Mg(t.stateNode.containerInfo),ft(t),null;case 10:return nr(t.type),ft(t),null;case 19:if(Yt(Rt),n=t.memoizedState,n===null)return ft(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)es(n,!1);else{if(Ct!==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;)dI(a,e),a=a.sibling;return ct(Rt,Rt.current&1|2),Ue&&Zn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Fa()>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&&!Ue)return ft(t),null}else 2*Fa()-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=Fa(),e.sibling=null,a=Rt.current,ct(Rt,r?a&1|2:a&1),Ue&&Zn(t,n.treeForkCount),e):(ft(t),null);case 22:case 23:return Na(t),lg(),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&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(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&&Yt(ko),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(Ut),ft(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function HN(e,t){switch(ag(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(Ut),Hi(),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(Na(t),t.alternate===null)throw Error(B(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Na(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(Rt),null;case 4:return Hi(),null;case 10:return nr(t.type),null;case 22:case 23:return Na(t),lg(),e!==null&&Yt(ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(Ut),null;case 25:return null;default:return null}}function d0(e,t){switch(ag(t),t.tag){case 3:nr(Ut),Hi();break;case 26:case 27:case 5:ed(t);break;case 4:Hi();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:Yt(Rt);break;case 10:nr(t.type);break;case 22:case 23:Na(t),lg(),e!==null&&Yt(ko);break;case 24:nr(Ut)}}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 Xr(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 f0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{bI(t,a)}catch(n){tt(e,e.return,n)}}}function p0(e,t,a){a.props=Do(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 Dn(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 m0(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 Pm(e,t,a){try{var n=e.stateNode;sB(n,e.type,a,t),n[Ma]=t}catch(r){tt(e,e.return,r)}}function h0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zr(e.type)||e.tag===4}function Nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||h0(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&&Zr(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 Ch(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=er));else if(n!==4&&(n===27&&Zr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ch(e,t,a),e=e.sibling;e!==null;)Ch(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&&Zr(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 g0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);na(t,n,a),t[ea]=e,t[Ma]=a}catch(o){tt(e,e.return,o)}}var Qn=!1,Bt=!1,Bm=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function jN(e,t){if(e=e.containerInfo,Rh=kd,e=nI(e),Zh(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(Dh={focusedElem:e,selectionRange:a},kd=!1,Xt=t;Xt!==null;)if(t=Xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xt=e;else for(;Xt!==null;){switch(t=Xt,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=Do(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)Oh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oh(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,Xt=e;break}Xt=t.return}}function w0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(e,a),n&4&&Vs(5,a);break;case 1:if(Kn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){tt(a,a.return,i)}else{var r=Do(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){tt(a,a.return,i)}}n&64&&f0(a),n&512&&ws(a,a.return);break;case 3:if(Kn(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{bI(e,t)}catch(i){tt(a,a.return,i)}}break;case 27:t===null&&n&4&&g0(a);case 26:case 5:Kn(e,a),t===null&&n&4&&m0(a),n&512&&ws(a,a.return);break;case 12:Kn(e,a);break;case 31:Kn(e,a),n&4&&v0(e,a);break;case 13:Kn(e,a),n&4&&b0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=QN.bind(null,a),gB(e,a))));break;case 22:if(n=a.memoizedState!==null||Qn,!n){t=t!==null&&t.memoizedState!==null||Bt,r=Qn;var o=Bt;Qn=n,(Bt=t)&&!o?Yn(e,a,(a.subtreeFlags&8772)!==0):Kn(e,a),Qn=r,Bt=o}break;case 30:break;default:Kn(e,a)}}function y0(e){var t=e.alternate;t!==null&&(e.alternate=null,y0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wh(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 xt=null,Ta=!1;function Xn(e,t,a){for(a=a.child;a!==null;)x0(e,t,a),a=a.sibling}function x0(e,t,a){if(za&&typeof za.onCommitFiberUnmount=="function")try{za.onCommitFiberUnmount(Bs,a)}catch{}switch(a.tag){case 26:Bt||Dn(a,t),Xn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||Dn(a,t);var n=xt,r=Ta;Zr(a.type)&&(xt=a.stateNode,Ta=!1),Xn(e,t,a),bs(a.stateNode),xt=n,Ta=r;break;case 5:Bt||Dn(a,t);case 6:if(n=xt,r=Ta,xt=null,Xn(e,t,a),xt=n,Ta=r,xt!==null)if(Ta)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(a.stateNode)}catch(o){tt(a,t,o)}else try{xt.removeChild(a.stateNode)}catch(o){tt(a,t,o)}break;case 18:xt!==null&&(Ta?(e=xt,cS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Qi(e)):cS(xt,a.stateNode));break;case 4:n=xt,r=Ta,xt=a.stateNode.containerInfo,Ta=!0,Xn(e,t,a),xt=n,Ta=r;break;case 0:case 11:case 14:case 15:Xr(2,a,t),Bt||Xr(4,a,t),Xn(e,t,a);break;case 1:Bt||(Dn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&p0(a,t,n)),Xn(e,t,a);break;case 21:Xn(e,t,a);break;case 22:Bt=(n=Bt)||a.memoizedState!==null,Xn(e,t,a),Bt=n;break;default:Xn(e,t,a)}}function v0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qi(e)}catch(a){tt(t,t.return,a)}}}function b0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qi(e)}catch(a){tt(t,t.return,a)}}function VN(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kb),t;default:throw Error(B(435,e.tag))}}function Rc(e,t){var a=VN(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=JN.bind(null,e,n);n.then(r,r)}})}function Ca(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Zr(l.type)){xt=l.stateNode,Ta=!1;break e}break;case 5:xt=l.stateNode,Ta=!1;break e;case 3:case 4:xt=l.stateNode.containerInfo,Ta=!0;break e}l=l.return}if(xt===null)throw Error(B(160));x0(o,i,r),xt=null,Ta=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)S0(t,e),t=t.sibling}var xn=null;function S0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ca(t,e),ka(e),n&4&&(Xr(3,e,e.return),Vs(3,e),Xr(5,e,e.return));break;case 1:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),n&64&&Qn&&(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=xn;if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(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[ea]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),na(o,n,a),o[ea]=e,Kt(o),n=o;break e;case"link":var i=wS("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),na(o,n,a),r.head.appendChild(o);break;case"meta":if(i=wS("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),na(o,n,a),r.head.appendChild(o);break;default:throw Error(B(468,n))}o[ea]=e,Kt(o),n=o}e.stateNode=n}else yS(r,e.type,e.stateNode);else e.stateNode=gS(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?yS(r,e.type,e.stateNode):gS(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pm(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),a!==null&&n&4&&Pm(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),e.flags&32){r=e.stateNode;try{Vi(r,"")}catch(m){tt(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Pm(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Bm=!0);break;case 6:if(Ca(t,e),ka(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=xn,xn=Sd(t.containerInfo),Ca(t,e),xn=r,ka(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(m){tt(e,e.return,m)}Bm&&(Bm=!1,I0(e));break;case 4:n=xn,xn=Sd(e.stateNode.containerInfo),Ca(t,e),ka(e),xn=n;break;case 12:Ca(t,e),ka(e);break;case 31:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 13:Ca(t,e),ka(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ud=Fa()),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=Qn,c=Bt;if(Qn=u||r,Bt=c||s,Ca(t,e),Bt=c,Qn=u,ka(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Qn||Bt||So(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?dS(p,!0):dS(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:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 30:break;case 21:break;default:Ca(t,e),ka(e)}}function ka(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(h0(n)){a=n;break}n=n.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var r=a.stateNode,o=Nm(e);md(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Vi(i,""),a.flags&=-33);var l=Nm(e);md(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Nm(e);Ch(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 I0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;I0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Kn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)w0(e,t.alternate,t),t=t.sibling}function So(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xr(4,t,t.return),So(t);break;case 1:Dn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&p0(t,t.return,a),So(t);break;case 27:bs(t.stateNode);case 26:case 5:Dn(t,t.return),So(t);break;case 22:t.memoizedState===null&&So(t);break;case 30:So(t);break;default:So(t)}e=e.sibling}}function Yn(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:Yn(r,o,a),Vs(4,o);break;case 1:if(Yn(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++)vI(s[r],l)}catch(u){tt(n,n.return,u)}}a&&i&64&&f0(o),ws(o,o.return);break;case 27:g0(o);case 26:case 5:Yn(r,o,a),a&&n===null&&i&4&&m0(o),ws(o,o.return);break;case 12:Yn(r,o,a);break;case 31:Yn(r,o,a),a&&i&4&&v0(r,o);break;case 13:Yn(r,o,a),a&&i&4&&b0(r,o);break;case 22:o.memoizedState===null&&Yn(r,o,a),ws(o,o.return);break;case 30:break;default:Yn(r,o,a)}t=t.sibling}}function Ig(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 Cg(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 yn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)C0(e,t,a,n),t=t.sibling}function C0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:yn(e,t,a,n),r&2048&&Vs(9,t);break;case 1:yn(e,t,a,n);break;case 3:yn(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){yn(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 yn(e,t,a,n);break;case 31:yn(e,t,a,n);break;case 13:yn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?yn(e,t,a,n):ys(e,t):o._visibility&2?yn(e,t,a,n):(o._visibility|=2,bi(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ig(i,t);break;case 24:yn(e,t,a,n),r&2048&&Cg(t.alternate,t);break;default:yn(e,t,a,n)}}function bi(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:bi(o,i,l,s,r),Vs(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?bi(o,i,l,s,r):ys(o,i):(c._visibility|=2,bi(o,i,l,s,r)),r&&u&2048&&Ig(i.alternate,i);break;case 24:bi(o,i,l,s,r),r&&u&2048&&Cg(i.alternate,i);break;default:bi(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&&Ig(n.alternate,n);break;case 24:ys(a,n),r&2048&&Cg(n.alternate,n);break;default:ys(a,n)}t=t.sibling}}var ss=8192;function vi(e,t,a){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)k0(e,t,a),e=e.sibling}function k0(e,t,a){switch(e.tag){case 26:vi(e,t,a),e.flags&ss&&e.memoizedState!==null&&EB(a,xn,e.memoizedState,e.memoizedProps);break;case 5:vi(e,t,a);break;case 3:case 4:var n=xn;xn=Sd(e.stateNode.containerInfo),vi(e,t,a),xn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ss,ss=16777216,vi(e,t,a),ss=n):vi(e,t,a));break;default:vi(e,t,a)}}function T0(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];Xt=n,E0(n,e)}T0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)L0(e),e=e.sibling}function L0(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&Xr(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];Xt=n,E0(n,e)}T0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xr(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 E0(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Xr(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,Xt=n;else e:for(a=e;Xt!==null;){n=Xt;var r=n.sibling,o=n.return;if(y0(n),n===a){Xt=null;break e}if(r!==null){r.return=o,Xt=r;break e}Xt=o}}}var WN={getCacheForType:function(e){var t=aa(Ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return aa(Ut).controller.signal}},GN=typeof WeakMap=="function"?WeakMap:Map,Ye=0,st=null,De=null,Pe=0,et=0,Pa=null,Or=!1,nl=!1,kg=!1,ur=0,Ct=0,Kr=0,Lo=0,Tg=0,Ua=0,Xi=0,xs=null,La=null,kh=!1,Ud=0,M0=0,hd=1/0,gd=null,qr=null,qt=0,Hr=null,Ki=null,rr=0,Th=0,Lh=null,A0=null,vs=0,Eh=null;function Ha(){return(Ye&2)!==0&&Pe!==0?Pe&-Pe:fe.T!==null?Eg():FS()}function R0(){if(Ua===0)if((Pe&536870912)===0||Ue){var e=bc;bc<<=1,(bc&3932160)===0&&(bc=262144),Ua=e}else Ua=536870912;return e=Va.current,e!==null&&(e.flags|=32),Ua}function Ea(e,t,a){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Yi(e,0),Pr(e,Pe,Ua,!1)),Fs(e,a),((Ye&2)===0||e!==st)&&(e===st&&((Ye&2)===0&&(Lo|=a),Ct===4&&Pr(e,Pe,Ua,!1)),Pn(e))}function D0(e,t,a){if((Ye&6)!==0)throw Error(B(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Us(e,t),r=n?KN(e,t):Um(e,t,!0),o=n;do{if(r===0){nl&&!n&&Pr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!$N(a)){r=Um(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&&(Yi(l,i).flags|=256),i=Um(l,i,!1),i!==2){if(kg&&!s){l.errorRecoveryDisabledLanes|=o,Lo|=o,r=4;break e}o=La,La=r,o!==null&&(La===null?La=o:La.push.apply(La,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Yi(e,0),Pr(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:Pr(n,t,Ua,!Or);break e;case 2:La=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(r=Ud+300-Fa(),10<r)){if(Pr(n,t,Ua,!Or),Ld(n,0,!0)!==0)break e;rr=t,n.timeoutHandle=Q0(Yb.bind(null,n,a,La,gd,kh,t,Ua,Lo,Xi,Or,o,"Throttled",-0,0),r);break e}Yb(n,a,La,gd,kh,t,Ua,Lo,Xi,Or,o,null,-0,0)}}break}while(!0);Pn(e)}function Yb(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:er},k0(t,o,d);var m=(o&62914560)===o?Ud-Fa():(o&4194048)===o?M0-Fa():0;if(m=MB(d,m),m!==null){rr=o,e.cancelPendingCommit=m(Qb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),Pr(e,o,i,!u);return}}Qb(e,t,o,a,n,r,i,l,s)}function $N(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(!ja(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 Pr(e,t,a,n){t&=~Tg,t&=~Lo,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-qa(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&NS(e,a,t)}function Fd(){return(Ye&6)===0?(Ws(0,!1),!1):!0}function Lg(){if(De!==null){if(et===0)var e=De.return;else e=De,tr=Bo=null,fg(e),Fi=null,Es=0,e=De;for(;e!==null;)d0(e.alternate,e),e=e.return;De=null}}function Yi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,dB(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),rr=0,Lg(),st=e,De=a=ar(e.current,null),Pe=t,et=0,Pa=null,Or=!1,nl=Us(e,t),kg=!1,Xi=Ua=Tg=Lo=Kr=Ct=0,La=xs=null,kh=!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-qa(n),o=1<<r;t|=e[r],n&=~o}return ur=t,Rd(),a}function _0(e,t){Se=null,fe.H=As,t===al||t===_d?(t=Eb(),et=3):t===og?(t=Eb(),et=4):et=t===bg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pa=t,De===null&&(Ct=1,fd(e,an(t,e.current)))}function O0(){var e=Va.current;return e===null?!0:(Pe&4194048)===Pe?rn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===rn:!1}function P0(){var e=fe.H;return fe.H=As,e===null?As:e}function N0(){var e=fe.A;return fe.A=WN,e}function wd(){Ct=4,Or||(Pe&4194048)!==Pe&&Va.current!==null||(nl=!0),(Kr&134217727)===0&&(Lo&134217727)===0||st===null||Pr(st,Pe,Ua,!1)}function Um(e,t,a){var n=Ye;Ye|=2;var r=P0(),o=N0();(st!==e||Pe!==t)&&(gd=null,Yi(e,t)),t=!1;var i=Ct;e:do try{if(et!==0&&De!==null){var l=De,s=Pa;switch(et){case 8:Lg(),i=6;break e;case 3:case 2:case 9:case 6:Va.current===null&&(t=!0);var u=et;if(et=0,Pa=null,Oi(e,l,s,u),a&&nl){i=0;break e}break;default:u=et,et=0,Pa=null,Oi(e,l,s,u)}}XN(),i=Ct;break}catch(c){_0(e,c)}while(!0);return t&&e.shellSuspendCounter++,tr=Bo=null,Ye=n,fe.H=r,fe.A=o,De===null&&(st=null,Pe=0,Rd()),i}function XN(){for(;De!==null;)B0(De)}function KN(e,t){var a=Ye;Ye|=2;var n=P0(),r=N0();st!==e||Pe!==t?(gd=null,hd=Fa()+500,Yi(e,t)):nl=Us(e,t);e:do try{if(et!==0&&De!==null){t=De;var o=Pa;t:switch(et){case 1:et=0,Pa=null,Oi(e,t,o,1);break;case 2:case 9:if(Lb(o)){et=0,Pa=null,Zb(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),Pn(e)},o.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Lb(o)?(et=0,Pa=null,Zb(t)):(et=0,Pa=null,Oi(e,t,o,7));break;case 5:var i=null;switch(De.tag){case 26:i=De.memoizedState;case 5:case 27:var l=De;if(i?nC(i):l.stateNode.complete){et=0,Pa=null;var s=l.sibling;if(s!==null)De=s;else{var u=l.return;u!==null?(De=u,zd(u)):De=null}break t}}et=0,Pa=null,Oi(e,t,o,5);break;case 6:et=0,Pa=null,Oi(e,t,o,6);break;case 8:Lg(),Ct=6;break e;default:throw Error(B(462))}}YN();break}catch(c){_0(e,c)}while(!0);return tr=Bo=null,fe.H=n,fe.A=r,Ye=a,De!==null?0:(st=null,Pe=0,Rd(),Ct)}function YN(){for(;De!==null&&!xP();)B0(De)}function B0(e){var t=c0(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?zd(e):De=t}function Zb(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Vb(a,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=Vb(a,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:fg(t);default:d0(a,t),t=De=dI(t,ur),t=c0(a,t,ur)}e.memoizedProps=e.pendingProps,t===null?zd(e):De=t}function Oi(e,t,a,n){tr=Bo=null,fg(t),Fi=null,Es=0;var r=t.return;try{if(UN(e,r,t,a,Pe)){Ct=1,fd(e,an(a,e.current)),De=null;return}}catch(o){if(r!==null)throw De=r,o;Ct=1,fd(e,an(a,e.current)),De=null;return}t.flags&32768?(Ue||n===1?e=!0:nl||(Pe&536870912)!==0?e=!1:(Or=e=!0,(n===2||n===9||n===3||n===6)&&(n=Va.current,n!==null&&n.tag===13&&(n.flags|=16384))),U0(t,e)):zd(t)}function zd(e){var t=e;do{if((t.flags&32768)!==0){U0(t,Or);return}e=t.return;var a=qN(t.alternate,t,ur);if(a!==null){De=a;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ct===0&&(Ct=5)}function U0(e,t){do{var a=HN(e.alternate,e);if(a!==null){a.flags&=32767,De=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=a}while(e!==null);Ct=6,De=null}function Qb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do qd();while(qt!==0);if((Ye&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(o=t.lanes|t.childLanes,o|=Qh,MP(e,a,o,i,l,s),e===st&&(De=st=null,Pe=0),Ki=t,Hr=e,rr=a,Th=o,Lh=r,A0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eB(td,function(){return j0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=fe.T,fe.T=null,r=Ze.p,Ze.p=2,i=Ye,Ye|=4;try{jN(e,t,a)}finally{Ye=i,Ze.p=r,fe.T=n}}qt=1,F0(),z0(),q0()}}function F0(){if(qt===1){qt=0;var e=Hr,t=Ki,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{S0(t,e);var o=Dh,i=nI(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&aI(l.ownerDocument.documentElement,l)){if(s!==null&&Zh(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=vb(l,x),y=vb(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 h=d.createRange();h.setStart(w.node,w.offset),p.removeAllRanges(),x>S?(p.addRange(h),p.extend(y.node,y.offset)):(h.setEnd(y.node,y.offset),p.addRange(h))}}}}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=!!Rh,Dh=Rh=null}finally{Ye=r,Ze.p=n,fe.T=a}}e.current=t,qt=2}}function z0(){if(qt===2){qt=0;var e=Hr,t=Ki,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=fe.T,fe.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{w0(e,t.alternate,t)}finally{Ye=r,Ze.p=n,fe.T=a}}qt=3}}function q0(){if(qt===4||qt===3){qt=0,vP();var e=Hr,t=Ki,a=rr,n=A0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?qt=5:(qt=0,Ki=Hr=null,H0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(qr=null),Vh(a),t=t.stateNode,za&&typeof za.onCommitFiberRoot=="function")try{za.onCommitFiberRoot(Bs,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=fe.T,r=Ze.p,Ze.p=2,fe.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{fe.T=t,Ze.p=r}}(rr&3)!==0&&qd(),Pn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Eh?vs++:(vs=0,Eh=e):vs=0,Ws(0,!1)}}function H0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hs(t)))}function qd(){return F0(),z0(),q0(),j0()}function j0(){if(qt!==5)return!1;var e=Hr,t=Th;Th=0;var a=Vh(rr),n=fe.T,r=Ze.p;try{Ze.p=32>a?32:a,fe.T=null,a=Lh,Lh=null;var o=Hr,i=rr;if(qt=0,Ki=Hr=null,rr=0,(Ye&6)!==0)throw Error(B(331));var l=Ye;if(Ye|=4,L0(o.current),C0(o,o.current,i,a),Ye=l,Ws(0,!1),za&&typeof za.onPostCommitFiberRoot=="function")try{za.onPostCommitFiberRoot(Bs,o)}catch{}return!0}finally{Ze.p=r,fe.T=n,H0(e,t)}}function Jb(e,t,a){t=an(a,t),t=bh(e.stateNode,t,2),e=zr(e,t,2),e!==null&&(Fs(e,2),Pn(e))}function tt(e,t,a){if(e.tag===3)Jb(e,e,a);else for(;t!==null;){if(t.tag===3){Jb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(qr===null||!qr.has(n))){e=an(a,e),a=r0(2),n=zr(t,a,2),n!==null&&(o0(a,n,t,e),Fs(n,2),Pn(n));break}}t=t.return}}function Fm(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new GN;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)||(kg=!0,r.add(a),e=ZN.bind(null,e,t,a),t.then(e,e))}function ZN(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&&(Ct===4||Ct===3&&(Pe&62914560)===Pe&&300>Fa()-Ud?(Ye&2)===0&&Yi(e,0):Tg|=a,Xi===Pe&&(Xi=0)),Pn(e)}function V0(e,t){t===0&&(t=PS()),e=No(e,t),e!==null&&(Fs(e,t),Pn(e))}function QN(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),V0(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(B(314))}n!==null&&n.delete(t),V0(e,a)}function eB(e,t){return Hh(e,t)}var yd=null,Si=null,Mh=!1,xd=!1,zm=!1,Nr=0;function Pn(e){e!==Si&&e.next===null&&(Si===null?yd=Si=e:Si=Si.next=e),xd=!0,Mh||(Mh=!0,aB())}function Ws(e,t){if(!zm&&xd){zm=!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-qa(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,eS(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,eS(n,o));n=n.next}while(a);zm=!1}}function tB(){W0()}function W0(){xd=Mh=!1;var e=0;Nr!==0&&cB()&&(e=Nr);for(var t=Fa(),a=null,n=yd;n!==null;){var r=n.next,o=G0(n,t);o===0?(n.next=null,a===null?yd=r:a.next=r,r===null&&(Si=a)):(a=n,(e!==0||(o&3)!==0)&&(xd=!0)),n=r}qt!==0&&qt!==5||Ws(e,!1),Nr!==0&&(Nr=0)}function G0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-qa(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=EP(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&&hm(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&&hm(n),Vh(a)){case 2:case 8:a=_S;break;case 32:a=td;break;case 268435456:a=OS;break;default:a=td}return n=$0.bind(null,e),a=Hh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&hm(n),e.callbackPriority=2,e.callbackNode=null,2}function $0(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:(D0(e,n,t),G0(e,Fa()),e.callbackNode!=null&&e.callbackNode===a?$0.bind(null,e):null)}function eS(e,t){if(qd())return null;D0(e,t,!0)}function aB(){fB(function(){(Ye&6)!==0?Hh(DS,tB):W0()})}function Eg(){if(Nr===0){var e=Wi;e===0&&(e=vc,vc<<=1,(vc&261888)===0&&(vc=256)),Nr=e}return Nr}function tS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uc(""+e)}function aS(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 nB(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=tS((r[Ma]||null).action),i=n.submitter;i&&(t=(t=i[Ma]||null)?tS(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(Nr!==0){var s=i?aS(r,i):new FormData(r);xh(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?aS(r,i):new FormData(r),xh(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Dc=0;Dc<lh.length;Dc++)_c=lh[Dc],nS=_c.toLowerCase(),rS=_c[0].toUpperCase()+_c.slice(1),vn(nS,"on"+rS);var _c,nS,rS,Dc;vn(oI,"onAnimationEnd");vn(iI,"onAnimationIteration");vn(lI,"onAnimationStart");vn("dblclick","onDoubleClick");vn("focusin","onFocus");vn("focusout","onBlur");vn(bN,"onTransitionRun");vn(SN,"onTransitionStart");vn(IN,"onTransitionCancel");vn(sI,"onTransitionEnd");ji("onMouseEnter",["mouseout","mouseover"]);ji("onMouseLeave",["mouseout","mouseover"]);ji("onPointerEnter",["pointerout","pointerover"]);ji("onPointerLeave",["pointerout","pointerover"]);_o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));_o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));_o("onBeforeInput",["compositionend","keypress","textInput","paste"]);_o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));_o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));_o("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(" "),rB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rs));function X0(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 Re(e,t){var a=t[Jm];a===void 0&&(a=t[Jm]=new Set);var n=e+"__bubble";a.has(n)||(K0(t,e,2,!1),a.add(n))}function qm(e,t,a){var n=0;t&&(n|=4),K0(a,e,n,t)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function Mg(e){if(!e[Oc]){e[Oc]=!0,zS.forEach(function(a){a!=="selectionchange"&&(rB.has(a)||qm(a,!1,e),qm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oc]||(t[Oc]=!0,qm("selectionchange",!1,t))}}function K0(e,t,a,n){switch(sC(t)){case 2:var r=DB;break;case 8:r=_B;break;default:r=_g}a=r.bind(null,t,a,e),r=void 0,!rh||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 Hm(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=ki(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}XS(function(){var u=o,c=$h(a),d=[];e:{var f=uI.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=JP;break;case"focusin":m="focus",p=vm;break;case"focusout":m="blur",p=vm;break;case"beforeblur":case"afterblur":p=vm;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=db;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=qP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=aN;break;case oI:case iI:case lI:p=VP;break;case sI:p=rN;break;case"scroll":case"scrollend":p=FP;break;case"wheel":p=iN;break;case"copy":case"cut":case"paste":p=GP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pb;break;case"toggle":case"beforetoggle":p=sN}var x=(t&4)!==0,S=!x&&(e==="scroll"||e==="scrollend"),w=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,h;y!==null;){var b=y;if(h=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||h===null||w===null||(b=Is(y,w),b!=null&&x.push(Ds(y,b,h))),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!==nh&&(m=a.relatedTarget||a.fromElement)&&(ki(m)||m[Ji]))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?ki(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=db,b="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=pb,b="onPointerLeave",w="onPointerEnter",y="pointer"),S=p==null?f:is(p),h=m==null?f:is(m),f=new x(b,y+"leave",p,a,c),f.target=S,f.relatedTarget=h,b=null,ki(c)===u&&(x=new x(w,y+"enter",m,a,c),x.target=h,x.relatedTarget=S,b=x),S=b,p&&m)t:{for(x=oB,w=p,y=m,h=0,b=w;b;b=x(b))h++;b=0;for(var T=y;T;T=x(T))b++;for(;0<h-b;)w=x(w),h--;for(;0<b-h;)y=x(y),b--;for(;h--;){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&&oS(d,f,p,x,!1),m!==null&&S!==null&&oS(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=wb;else if(gb(f))if(eI)C=yN;else{C=gN;var M=hN}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Gh(u.elementType)&&(C=wb):C=wN;if(C&&(C=C(e,u))){JS(d,C,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&ah(f,"number",f.value)}switch(M=u?is(u):window,e){case"focusin":(gb(M)||M.contentEditable==="true")&&(Ei=M,oh=u,ds=null);break;case"focusout":ds=oh=Ei=null;break;case"mousedown":ih=!0;break;case"contextmenu":case"mouseup":case"dragend":ih=!1,bb(d,a,c);break;case"selectionchange":if(vN)break;case"keydown":case"keyup":bb(d,a,c)}var D;if(Yh)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 Li?ZS(e,a)&&(P="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(P="onCompositionStart");P&&(YS&&a.locale!=="ko"&&(Li||P!=="onCompositionStart"?P==="onCompositionEnd"&&Li&&(D=KS()):(_r=c,Xh="value"in _r?_r.value:_r.textContent,Li=!0)),M=vd(u,P),0<M.length&&(P=new fb(P,e,null,a,c),d.push({event:P,listeners:M}),D?P.data=D:(D=QS(a),D!==null&&(P.data=D)))),(D=cN?dN(e,a):fN(e,a))&&(P=vd(u,"onBeforeInput"),0<P.length&&(M=new fb("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:P}),M.data=D)),nB(d,e,u,a,c)}X0(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 oB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function oS(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 iB=/\r\n?/g,lB=/\u0000|\uFFFD/g;function iS(e){return(typeof e=="string"?e:""+e).replace(iB,`
|
|
9
|
+
`).replace(lB,"")}function Y0(e,t){return t=iS(t),iS(e)===t}function ot(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Vi(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Vi(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":$S(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=er);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("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":Re("beforetoggle",e),Re("toggle",e),Bc(e,"popover",n);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Gn(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=BP.get(a)||a,Bc(e,a,n))}}function Ah(e,t,a,n,r,o){switch(a){case"style":$S(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"?Vi(e,n):(typeof n=="number"||typeof n=="bigint")&&Vi(e,""+n);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"onClick":n!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qS.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[Ma]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Bc(e,a,n)}}}function na(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("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":Re("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)}}VS(e,o,l,s,u,i,r,!1);return;case"select":Re("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?Ni(e,!!n,t,!1):a!=null&&Ni(e,!!n,a,!0);return;case"textarea":Re("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)}GS(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":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(n=0;n<Rs.length;n++)Re(Rs[n],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("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(Gh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Ah(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 sB(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)}}th(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?Ni(e,!!a,f,!1):!!n!=!!a&&(t!=null?Ni(e,!!a,t,!0):Ni(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)}WS(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(Gh(t)){for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!==void 0&&!n.hasOwnProperty(S)&&Ah(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||Ah(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 lS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uB(){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&&lS(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&&lS(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 Rh=null,Dh=null;function bd(e){return e.nodeType===9?e:e.ownerDocument}function sS(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 Z0(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 _h(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 jm=null;function cB(){var e=window.event;return e&&e.type==="popstate"?e===jm?!1:(jm=e,!0):(jm=null,!1)}var Q0=typeof setTimeout=="function"?setTimeout:void 0,dB=typeof clearTimeout=="function"?clearTimeout:void 0,uS=typeof Promise=="function"?Promise:void 0,fB=typeof queueMicrotask=="function"?queueMicrotask:typeof uS<"u"?function(e){return uS.resolve(null).then(e).catch(pB)}:Q0;function pB(e){setTimeout(function(){throw e})}function Zr(e){return e==="head"}function cS(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),Qi(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);Qi(t)}function dS(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 Oh(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":Oh(a),Wh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function mB(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=on(e.nextSibling),e===null)break}return null}function hB(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=on(e.nextSibling),e===null))return null;return e}function J0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=on(e.nextSibling),e===null))return null;return e}function Ph(e){return e.data==="$?"||e.data==="$~"}function Nh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gB(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 on(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 Bh=null;function fS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return on(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function pS(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 eC(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]);Wh(e)}var ln=new Map,mS=new Set;function Sd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cr=Ze.d;Ze.d={f:wB,r:yB,D:xB,C:vB,L:bB,m:SB,X:CB,S:IB,M:kB};function wB(){var e=cr.f(),t=Fd();return e||t}function yB(e){var t=el(e);t!==null&&t.tag===5&&t.type==="form"?$I(t):cr.r(e)}var rl=typeof document>"u"?null:document;function tC(e,t,a){var n=rl;if(n&&typeof t=="string"&&t){var r=tn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),mS.has(r)||(mS.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function xB(e){cr.D(e),tC("dns-prefetch",e,null)}function vB(e,t){cr.C(e,t),tC("preconnect",e,t)}function bB(e,t,a){cr.L(e,t,a);var n=rl;if(n&&e&&t){var r='link[rel="preload"][as="'+tn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+tn(a.imageSizes)+'"]')):r+='[href="'+tn(e)+'"]';var o=r;switch(t){case"style":o=Zi(e);break;case"script":o=ol(e)}ln.has(o)||(e=mt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ln.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Gs(o))||t==="script"&&n.querySelector($s(o))||(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function SB(e,t){cr.m(e,t);var a=rl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+tn(n)+'"][href="'+tn(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ol(e)}if(!ln.has(o)&&(e=mt({rel:"modulepreload",href:e},t),ln.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"),na(n,"link",e),Kt(n),a.head.appendChild(n)}}}function IB(e,t,a){cr.S(e,t,a);var n=rl;if(n&&e){var r=Pi(n).hoistableStyles,o=Zi(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=mt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ln.get(o))&&Ag(e,a);var s=i=n.createElement("link");Kt(s),na(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 CB(e,t){cr.X(e,t);var a=rl;if(a&&e){var n=Pi(a).hoistableScripts,r=ol(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=mt({src:e,async:!0},t),(t=ln.get(r))&&Rg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function kB(e,t){cr.M(e,t);var a=rl;if(a&&e){var n=Pi(a).hoistableScripts,r=ol(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=mt({src:e,async:!0,type:"module"},t),(t=ln.get(r))&&Rg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function hS(e,t,a,n){var r=(r=Br.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=Zi(a.href),a=Pi(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Zi(a.href);var o=Pi(r).hoistableStyles,i=o.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=r.querySelector(Gs(e)))&&!o._p&&(i.instance=o,i.state.loading=5),ln.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},ln.set(e,a),o||TB(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=ol(a),a=Pi(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(B(444,e))}}function Zi(e){return'href="'+tn(e)+'"'}function Gs(e){return'link[rel="stylesheet"]['+e+"]"}function aC(e){return mt({},e,{"data-precedence":e.precedence,precedence:null})}function TB(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}),na(t,"link",a),Kt(t),e.head.appendChild(t))}function ol(e){return'[src="'+tn(e)+'"]'}function $s(e){return"script[async]"+e}function gS(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+tn(a.href)+'"]');if(n)return t.instance=n,Kt(n),n;var r=mt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Kt(n),na(n,"style",r),Xc(n,a.precedence,e),t.instance=n;case"stylesheet":r=Zi(a.href);var o=e.querySelector(Gs(r));if(o)return t.state.loading|=4,t.instance=o,Kt(o),o;n=aC(a),(r=ln.get(r))&&Ag(n,r),o=(e.ownerDocument||e).createElement("link"),Kt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(o,"link",n),t.state.loading|=4,Xc(o,a.precedence,e),t.instance=o;case"script":return o=ol(a.src),(r=e.querySelector($s(o)))?(t.instance=r,Kt(r),r):(n=a,(r=ln.get(o))&&(n=mt({},a),Rg(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),Kt(r),na(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 Ag(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rg(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 wS(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[ea]||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 yS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function LB(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 nC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function EB(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=Zi(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,Kt(o);return}o=t.ownerDocument||t,n=aC(n),(r=ln.get(r))&&Ag(n,r),o=o.createElement("link"),Kt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(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 Vm=0;function MB(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&&Vm===0&&(Vm=62500*uB());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>Vm?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(AB,e),Cd=null,Id.call(e))}function AB(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:Jn,Provider:null,Consumer:null,_currentValue:Io,_currentValue2:Io,_threadCount:0};function RB(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=gm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gm(0),this.hiddenUpdates=gm(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 rC(e,t,a,n,r,o,i,l,s,u,c,d){return e=new RB(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ba(3,null,null,t),e.current=o,o.stateNode=e,t=ng(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},ig(o),e}function oC(e){return e?(e=Ri,e):Ri}function iC(e,t,a,n,r,o){r=oC(r),n.context===null?n.context=r:n.pendingContext=r,n=Fr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=zr(e,n,t),a!==null&&(Ea(a,e,t),ps(a,e,t))}function xS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dg(e,t){xS(e,t),(e=e.alternate)&&xS(e,t)}function lC(e){if(e.tag===13||e.tag===31){var t=No(e,67108864);t!==null&&Ea(t,e,67108864),Dg(e,67108864)}}function vS(e){if(e.tag===13||e.tag===31){var t=Ha();t=jh(t);var a=No(e,t);a!==null&&Ea(a,e,t),Dg(e,t)}}var kd=!0;function DB(e,t,a,n){var r=fe.T;fe.T=null;var o=Ze.p;try{Ze.p=2,_g(e,t,a,n)}finally{Ze.p=o,fe.T=r}}function _B(e,t,a,n){var r=fe.T;fe.T=null;var o=Ze.p;try{Ze.p=8,_g(e,t,a,n)}finally{Ze.p=o,fe.T=r}}function _g(e,t,a,n){if(kd){var r=Uh(n);if(r===null)Hm(e,t,n,Td,a),bS(e,n);else if(PB(r,e,t,a,n))n.stopPropagation();else if(bS(e,n),t&4&&-1<OB.indexOf(e)){for(;r!==null;){var o=el(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=vo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-qa(i);l.entanglements[1]|=s,i&=~s}Pn(o),(Ye&6)===0&&(hd=Fa()+500,Ws(0,!1))}}break;case 31:case 13:l=No(o,2),l!==null&&Ea(l,o,2),Fd(),Dg(o,2)}if(o=Uh(n),o===null&&Hm(e,t,n,Td,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Hm(e,t,n,null,a)}}function Uh(e){return e=$h(e),Og(e)}var Td=null;function Og(e){if(Td=null,e=ki(e),e!==null){var t=Ns(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=LS(t),e!==null)return e;e=null}else if(a===31){if(e=ES(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 sC(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(bP()){case DS:return 2;case _S:return 8;case td:case SP:return 32;case OS:return 268435456;default:return 32}default:return 32}}var Fh=!1,jr=null,Vr=null,Wr=null,Os=new Map,Ps=new Map,Rr=[],OB="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 bS(e,t){switch(e){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Wr=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=el(t),t!==null&&lC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function PB(e,t,a,n,r){switch(t){case"focusin":return jr=as(jr,e,t,a,n,r),!0;case"dragenter":return Vr=as(Vr,e,t,a,n,r),!0;case"mouseover":return Wr=as(Wr,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 uC(e){var t=ki(e.target);if(t!==null){var a=Ns(t);if(a!==null){if(t=a.tag,t===13){if(t=LS(a),t!==null){e.blockedOn=t,rb(e.priority,function(){vS(a)});return}}else if(t===31){if(t=ES(a),t!==null){e.blockedOn=t,rb(e.priority,function(){vS(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=Uh(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);nh=n,a.target.dispatchEvent(n),nh=null}else return t=el(a),t!==null&&lC(t),e.blockedOn=a,!1;t.shift()}return!0}function SS(e,t,a){Zc(e)&&a.delete(t)}function NB(){Fh=!1,jr!==null&&Zc(jr)&&(jr=null),Vr!==null&&Zc(Vr)&&(Vr=null),Wr!==null&&Zc(Wr)&&(Wr=null),Os.forEach(SS),Ps.forEach(SS)}function Pc(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,NB)))}var Nc=null;function IS(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(Og(n||a)===null)continue;break}var o=el(a);o!==null&&(e.splice(t,3),t-=3,xh(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Qi(e){function t(s){return Pc(s,e)}jr!==null&&Pc(jr,e),Vr!==null&&Pc(Vr,e),Wr!==null&&Pc(Wr,e),Os.forEach(t),Ps.forEach(t);for(var a=0;a<Rr.length;a++){var n=Rr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Rr.length&&(a=Rr[0],a.blockedOn===null);)uC(a),a.blockedOn===null&&Rr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[Ma]||null;if(typeof o=="function")i||IS(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Ma]||null)l=i.formAction;else if(Og(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),IS(a)}}}function cC(){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 Pg(e){this._internalRoot=e}Hd.prototype.render=Pg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,n=Ha();iC(a,n,e,t,null,null)};Hd.prototype.unmount=Pg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;iC(e.current,2,null,e,null,null),Fd(),t[Ji]=null}};function Hd(e){this._internalRoot=e}Hd.prototype.unstable_scheduleHydration=function(e){if(e){var t=FS();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Rr.length&&t!==0&&t<Rr[a].priority;a++);Rr.splice(a,0,e),a===0&&uC(e)}};var CS=kS.version;if(CS!=="19.2.4")throw Error(B(527,CS,"19.2.4"));Ze.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=mP(t),e=e!==null?MS(e):null,e=e===null?null:e.stateNode,e};var BB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ns.isDisabled&&ns.supportsFiber))try{Bs=ns.inject(BB),za=ns}catch{}var ns;jd.createRoot=function(e,t){if(!TS(e))throw Error(B(299));var a=!1,n="",r=t0,o=a0,i=n0;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=rC(e,1,!1,null,null,a,n,null,r,o,i,cC),e[Ji]=t.current,Mg(e),new Pg(t)};jd.hydrateRoot=function(e,t,a){if(!TS(e))throw Error(B(299));var n=!1,r="",o=t0,i=a0,l=n0,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=rC(e,1,!0,t,a??null,n,r,s,o,i,l,cC),t.context=oC(null),a=t.current,n=Ha(),n=jh(n),r=Fr(n),r.callback=null,zr(a,r,n),a=n,t.current.lanes=a,Fs(t,a),Pn(t),e[Ji]=t.current,Mg(e),new Hd(t)};jd.version="19.2.4"});var Ng=oa((aW,pC)=>{"use strict";function fC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fC)}catch(e){console.error(e)}}fC(),pC.exports=dC()});var HC=oa(ef=>{"use strict";var a3=Symbol.for("react.transitional.element"),n3=Symbol.for("react.fragment");function qC(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:a3,type:e,key:n,ref:t!==void 0?t:null,props:a}}ef.Fragment=n3;ef.jsx=qC;ef.jsxs=qC});var ae=oa((t$,jC)=>{"use strict";jC.exports=HC()});function VC(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=VC(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=VC(e))&&(n&&(n+=" "),n+=t);return n}var Yg=k(()=>{"use strict"});function Zg(...e){return e.filter(Boolean).join(" ")}function WC(){return Zg}var Qg=k(()=>{"use strict"});function k3(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Jr(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 T3(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 L3(e){return sf(t);function t(a){return a&&a.type===e}}function sf(e){return t;function t(a,n,r){return!!(M3(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function E3(){return!0}function M3(e){return e!==null&&typeof e=="object"&&"type"in e}var Jr,Dk=k(()=>{"use strict";Jr=(function(e){if(e==null)return E3;if(typeof e=="function")return sf(e);if(typeof e=="object")return Array.isArray(e)?k3(e):T3(e);if(typeof e=="string")return L3(e);throw new Error("Expected function, string, or object as test")})});var uf=k(()=>{"use strict";Dk()});function du(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Jr(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=_k,m,x,S;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=A3(a(s,c)),p[0]===jo))return p;if("children"in s&&s.children){let w=s;if(w.children&&p[0]!==Vo)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]===jo)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function A3(e){return Array.isArray(e)?e:typeof e=="number"?[pr,e]:e==null?_k:[e]}var _k,pr,jo,Vo,Ok=k(()=>{"use strict";uf();_k=[],pr=!0,jo=!1,Vo="skip"});var cf=k(()=>{"use strict";Ok()});function mr(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 Pk=k(()=>{"use strict";cf();cf()});var df=k(()=>{"use strict";Pk()});function Uk({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=O3(e,t,a,n,r,o,i);mr(u,c)}}function Nk(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 R3(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function Bk(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=Nk(e,a);if(!i||_3.has(i.protocol)||!(D3.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=R3(e);return i&&t.some(u=>{let c=Nk(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 D3,_3,rw,O3,Fk=k(()=>{"use strict";df();D3=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),_3=new Set(["javascript:","data:","file:","vbscript:"]);rw=Symbol("node-seen"),O3=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[rw])return pr;if(s.tagName==="a"){let d=Bk(s.properties.href,t,e,!1,!1,r);return d===null?(s[rw]=!0,mr(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]"}]}),Vo):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",pr)}if(s.tagName==="img"){let d=Bk(s.properties.src,a,e,n,!0,r);return d===null?(s[rw]=!0,mr(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")+"]"}]}),Vo):(s.properties.src=d,pr)}return pr};return l}});function P3(){return e=>e}var zk,qk=k(()=>{"use strict";zk=P3});var Hk,F3,lw,$k=k(()=>{"use strict";Hk=typeof self=="object"?self:globalThis,F3=(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 Hk[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 Hk[o](i),r)};return n},lw=e=>F3(new Map,e)(0)});var wl,z3,q3,fu,pf,H3,sw,Xk=k(()=>{"use strict";wl="",{toString:z3}={},{keys:q3}=Object,fu=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=z3.call(e).slice(8,-1);switch(a){case"Array":return[1,wl];case"Object":return[2,wl];case"Date":return[3,wl];case"RegExp":return[4,wl];case"Map":return[5,wl];case"Set":return[6,wl];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"),H3=(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 q3(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},sw=(e,{json:t,lossy:a}={})=>{let n=[];return H3(!(t||a),!!t,new Map,n)(e),n}});var eo,mf=k(()=>{"use strict";$k();Xk();eo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lw(sw(e,t)):structuredClone(e):(e,t)=>lw(sw(e,t))});function Kk(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=yl(e),a=hf(e);if(t&&a)return{start:t,end:a}}var hf,yl,Yk=k(()=>{"use strict";hf=Kk("end"),yl=Kk("start")});var mu=k(()=>{"use strict";Yk()});var Wo,uw,Zk=k(()=>{"use strict";Wo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],uw={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Wo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Wo],h2:[["className","sr-only"]],img:[...Wo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Wo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Wo],table:[...Wo],ul:[...Wo,["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 cw(e,t){let a={type:"root",children:[]},n={schema:t?{...uw,...t}:uw,stack:[]},r=eT(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function eT(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return j3(e,a);case"doctype":return V3(e,a);case"element":return W3(e,a);case"root":return G3(e,a);case"text":return $3(e,a);default:}}}function j3(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 V3(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return hu(a,t),a}}function W3(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=tT(e,t.children),r=X3(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&&to.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 G3(e,t){let n={type:"root",children:tT(e,t.children)};return hu(n,t),n}function $3(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return hu(n,t),n}function tT(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=eT(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function X3(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&to.call(n,a)?n[a]:void 0,i=n&&to.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(to.call(l,u)){let c=l[u],d=Qk(e,Jk(o,u),u,c);d==null&&(d=Qk(e,Jk(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&to.call(r,a)){let c=r[a];for(u in c)to.call(c,u)&&!to.call(s,u)&&(s[u]=c[u])}return s}function Qk(e,t,a,n){return t?Array.isArray(n)?K3(e,t,a,n):aT(e,t,a,n):void 0}function K3(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=aT(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function aT(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&Y3(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 Y3(e,t,a){let n=e.schema.protocols&&to.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=eo(t.data)),a&&(e.position=a)}function Jk(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 to,nT=k(()=>{"use strict";mf();mu();Zk();to={}.hasOwnProperty});var rT=k(()=>{"use strict";nT()});function gf(e){return function(t){return cw(t,e)}}var oT=k(()=>{"use strict";rT()});var iT=k(()=>{"use strict";oT()});function dw(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 lT=k(()=>{"use strict"});function Go(e){return e!==null&&(e<32||e===127)}function Z(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}function ao(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var jt,kt,sT,gu,uT,cT,$o,Un,je=k(()=>{"use strict";jt=ao(/[A-Za-z]/),kt=ao(/[\dA-Za-z]/),sT=ao(/[#-'*+\--9=?A-Z^-~]/);gu=ao(/\d/),uT=ao(/[\dA-Fa-f]/),cT=ao(/[!-/:-@[-`{-~]/);$o=ao(/\p{P}|\p{S}/u),Un=ao(/\s/)});function fw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var dT=k(()=>{"use strict"});function pw(e,t,a){let r=Jr((a||{}).ignore||[]),o=Z3(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 h=f.exec(u.value);for(;h;){let b=h.index,T={index:h.index,input:h.input,stack:[...c,u]},C=p(...h,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+h[0].length,w=!0),!f.global)break;h=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 Z3(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([Q3(r[0]),J3(r[1])])}return t}function Q3(e){return typeof e=="string"?new RegExp(fw(e),"g"):e}function J3(e){return typeof e=="function"?e:function(){return e}}var fT=k(()=>{"use strict";dT();cf();uf()});var pT=k(()=>{"use strict";fT()});function ww(){return{transforms:[oF],enter:{literalAutolink:eF,literalAutolinkEmail:gw,literalAutolinkHttp:gw,literalAutolinkWww:gw},exit:{literalAutolink:rF,literalAutolinkEmail:nF,literalAutolinkHttp:tF,literalAutolinkWww:aF}}}function yw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mw,notInConstruct:hw},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mw,notInConstruct:hw},{character:":",before:"[ps]",after:"\\/",inConstruct:mw,notInConstruct:hw}]}}function eF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gw(e){this.config.enter.autolinkProtocol.call(this,e)}function tF(e){this.config.exit.autolinkProtocol.call(this,e)}function aF(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 nF(e){this.config.exit.autolinkEmail.call(this,e)}function rF(e){this.exit(e)}function oF(e){pw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,lF]],{ignore:["link","linkReference"]})}function iF(e,t,a,n,r){let o="";if(!mT(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!sF(a)))return!1;let i=uF(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 lF(e,t,a,n){return!mT(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function sF(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 uF(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=dw(e,"("),o=dw(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 mT(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Un(a)||$o(a))&&(!t||a!==47)}var mw,hw,hT=k(()=>{"use strict";lT();je();pT();mw="phrasing",hw=["autolink","link","image","label"]});var gT=k(()=>{"use strict";hT()});function la(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xl=k(()=>{"use strict"});function cF(){this.buffer()}function dF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fF(){this.buffer()}function pF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function hF(e){this.exit(e)}function gF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function wF(e){this.exit(e)}function yF(){return"["}function wT(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 xw(){return{enter:{gfmFootnoteCallString:cF,gfmFootnoteCall:dF,gfmFootnoteDefinitionLabelString:fF,gfmFootnoteDefinition:pF},exit:{gfmFootnoteCallString:mF,gfmFootnoteCall:hF,gfmFootnoteDefinitionLabelString:gF,gfmFootnoteDefinition:wF}}}function vw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:wT},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?yT:xF))),u(),s}}function xF(e,t,a){return t===0?e:yT(e,t,a)}function yT(e,t,a){return(a?"":" ")+e}var xT=k(()=>{"use strict";xl();wT.peek=yF});var vT=k(()=>{"use strict";xT()});function bw(){return{canContainEols:["delete"],enter:{strikethrough:bF},exit:{strikethrough:SF}}}function Sw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vF}],handlers:{delete:bT}}}function bF(e){this.enter({type:"delete",children:[]},e)}function SF(e){this.exit(e)}function bT(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 IF(){return"~"}var vF,ST=k(()=>{"use strict";vF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bT.peek=IF});var IT=k(()=>{"use strict";ST()});function CF(e){return e.length}function kT(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||CF,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=kF(e[c][w]);if(a.alignDelimiters!==!1){let h=r(y);S[w]=h,(s[w]===void 0||h>s[w])&&(s[w]=h)}x.push(y)}i[c]=x,l[c]=S}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)o[d]=CT(n[d]);else{let x=CT(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),h=S+"-".repeat(y)+w;a.alignDelimiters!==!1&&(y=S.length+y+w.length,y>s[d]&&(s[d]=y),p[d]=y),f[d]=h}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]||"",h="",b="";if(a.alignDelimiters!==!1){let T=s[d]-(S[d]||0),C=o[d];C===114?h=" ".repeat(T):C===99?T%2?(h=" ".repeat(T/2+.5),b=" ".repeat(T/2-.5)):(h=" ".repeat(T/2),b=h):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(h),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 kF(e){return e==null?"":String(e)}function CT(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 TT=k(()=>{"use strict"});function LT(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()),TF);return r(),i}function TF(e,t,a){return">"+(a?"":" ")+e}var ET=k(()=>{"use strict"});function AT(e,t){return MT(e,t.inConstruct,!0)&&!MT(e,t.notInConstruct,!1)}function MT(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 RT=k(()=>{"use strict"});function Iw(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&AT(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var DT=k(()=>{"use strict";RT()});function _T(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 OT=k(()=>{"use strict"});function PT(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 NT=k(()=>{"use strict"});function BT(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 UT=k(()=>{"use strict"});function FT(e,t,a,n){let r=BT(a),o=e.value||"",i=r==="`"?"GraveAccent":"Tilde";if(PT(e,a)){let d=a.enter("codeIndented"),f=a.indentLines(o,LF);return d(),f}let l=a.createTracker(n),s=r.repeat(Math.max(_T(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 LF(e,t,a){return(a?"":" ")+e}var zT=k(()=>{"use strict";OT();NT();UT()});function vl(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 qT(e,t,a,n){let r=vl(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 HT=k(()=>{"use strict";wf()});function jT(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 VT=k(()=>{"use strict"});function no(e){return"&#x"+e.toString(16).toUpperCase()+";"}var yf=k(()=>{"use strict"});function hr(e){if(e===null||Me(e)||Un(e))return 1;if($o(e))return 2}var xf=k(()=>{"use strict";je()});function bl(e,t,a){let n=hr(e),r=hr(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 Cw=k(()=>{"use strict";xf()});function kw(e,t,a,n){let r=jT(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=bl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=no(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=bl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+no(d));let p=i.move(r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function EF(e,t,a){return a.options.emphasis||"*"}var WT=k(()=>{"use strict";VT();yf();Cw();kw.peek=EF});function Xo(e,t){let a=t||MF,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return $T(e,n,r)}function $T(e,t,a){if(AF(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 GT(e.children,t,a)}return Array.isArray(e)?GT(e,t,a):""}function GT(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=$T(e[r],t,a);return n.join("")}function AF(e){return!!(e&&typeof e=="object")}var MF,XT=k(()=>{"use strict";MF={}});var vf=k(()=>{"use strict";XT()});function KT(e,t){let a=!1;return mr(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,jo}),!!((!e.depth||e.depth<3)&&Xo(e)&&(t.options.setext||a))}var YT=k(()=>{"use strict";df();vf()});function ZT(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(KT(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=no(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var YT=k(()=>{"use strict";wf();XT()});function Cw(e){return e.value||""}function MF(){return"<"}var ZT=k(()=>{"use strict";Cw.peek=MF});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 AF(){return"!"}var QT=k(()=>{"use strict";gf();kw.peek=AF});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 RF(){return"!"}var JT=k(()=>{"use strict";Tw.peek=RF});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 DF(){return"`"}var e1=k(()=>{"use strict";Lw.peek=DF});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 t1=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 _F(e,t,a){return Ew(e,a)?"<":"["}var a1=k(()=>{"use strict";gf();t1();Mw.peek=_F});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 OF(){return"["}var n1=k(()=>{"use strict";Aw.peek=OF});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 r1(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 o1=k(()=>{"use strict";vf()});function i1(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 l1=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 s1(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?i1(a):bl(a),l=e.ordered?i==="."?")":".":r1(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 u1=k(()=>{"use strict";vf();o1();l1();Rw()});function c1(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 d1=k(()=>{"use strict"});function f1(e,t,a,n){let r=c1(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 p1=k(()=>{"use strict";vf();d1()});function m1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var h1=k(()=>{"use strict"});var Dw,g1=k(()=>{"use strict";sf();Dw=Jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var w1=k(()=>{"use strict";g1()});function y1(e,t,a,n){return(e.children.some(function(i){return Dw(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var x1=k(()=>{"use strict";w1()});function v1(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 b1=k(()=>{"use strict"});function _w(e,t,a,n){let r=v1(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=no(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)+no(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function PF(e,t,a){return a.options.strong||"*"}var S1=k(()=>{"use strict";b1();wf();Sw();_w.peek=PF});function I1(e,t,a,n){return a.safe(e.value,n)}var C1=k(()=>{"use strict"});function k1(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 T1=k(()=>{"use strict"});function L1(e,t,a){let n=(bf(a)+(a.options.ruleSpaces?" ":"")).repeat(k1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var E1=k(()=>{"use strict";T1();Rw()});var gu,M1=k(()=>{"use strict";TT();AT();UT();zT();jT();YT();ZT();QT();JT();e1();a1();n1();u1();p1();h1();x1();S1();C1();E1();gu={blockquote:kT,break:bw,code:BT,definition:FT,emphasis:Iw,hardBreak:bw,heading:KT,html:Cw,image:kw,imageReference:Tw,inlineCode:Lw,link:Mw,linkReference:Aw,list:s1,listItem:f1,paragraph:m1,root:y1,strong:_w,text:I1,thematicBreak:L1}});function Sl(e){let t="&"+e+";";A1.innerHTML=t;let a=A1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var A1,Sf=k(()=>{"use strict";A1=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 R1(e){return e.replace(NF,BF)}function BF(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 NF,D1=k(()=>{"use strict";Sf();Ow();NF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Pw=k(()=>{"use strict";M1()});function Bw(){return{enter:{table:UF,tableData:_1,tableHeader:_1,tableRow:zF},exit:{codeText:qF,table:FF,tableData:Nw,tableHeader:Nw,tableRow:Nw}}}function UF(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 FF(e){this.exit(e),this.data.inTable=void 0}function zF(e){this.enter({type:"tableRow",children:[]},e)}function Nw(e){this.exit(e)}function _1(e){this.enter({type:"tableCell",children:[]},e)}function qF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,HF));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function HF(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=no(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var QT=k(()=>{"use strict";yf();YT()});function Tw(e){return e.value||""}function RF(){return"<"}var JT=k(()=>{"use strict";Tw.peek=RF});function Lw(e,t,a,n){let r=vl(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 DF(){return"!"}var e1=k(()=>{"use strict";wf();Lw.peek=DF});function Ew(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 _F(){return"!"}var t1=k(()=>{"use strict";Ew.peek=_F});function Mw(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 OF(){return"`"}var a1=k(()=>{"use strict";Mw.peek=OF});function Aw(e,t){let a=Xo(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 n1=k(()=>{"use strict";vf()});function Rw(e,t,a,n){let r=vl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(Aw(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 PF(e,t,a){return Aw(e,a)?"<":"["}var r1=k(()=>{"use strict";wf();n1();Rw.peek=PF});function Dw(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 NF(){return"["}var o1=k(()=>{"use strict";Dw.peek=NF});function Sl(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 i1(e){let t=Sl(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 l1=k(()=>{"use strict";bf()});function s1(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 u1=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 _w=k(()=>{"use strict"});function c1(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?s1(a):Sl(a),l=e.ordered?i==="."?")":".":i1(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 d1=k(()=>{"use strict";bf();l1();u1();_w()});function f1(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 p1=k(()=>{"use strict"});function m1(e,t,a,n){let r=f1(a),o=a.bulletCurrent||Sl(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 h1=k(()=>{"use strict";bf();p1()});function g1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var w1=k(()=>{"use strict"});var Ow,y1=k(()=>{"use strict";uf();Ow=Jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var x1=k(()=>{"use strict";y1()});function v1(e,t,a,n){return(e.children.some(function(i){return Ow(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var b1=k(()=>{"use strict";x1()});function S1(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 I1=k(()=>{"use strict"});function Pw(e,t,a,n){let r=S1(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=bl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=no(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=bl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+no(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function BF(e,t,a){return a.options.strong||"*"}var C1=k(()=>{"use strict";I1();yf();Cw();Pw.peek=BF});function k1(e,t,a,n){return a.safe(e.value,n)}var T1=k(()=>{"use strict"});function L1(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 E1=k(()=>{"use strict"});function M1(e,t,a){let n=(Sf(a)+(a.options.ruleSpaces?" ":"")).repeat(L1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var A1=k(()=>{"use strict";E1();_w()});var wu,R1=k(()=>{"use strict";ET();DT();zT();HT();WT();QT();JT();e1();t1();a1();r1();o1();d1();h1();w1();b1();C1();T1();A1();wu={blockquote:LT,break:Iw,code:FT,definition:qT,emphasis:kw,hardBreak:Iw,heading:ZT,html:Tw,image:Lw,imageReference:Ew,inlineCode:Mw,link:Rw,linkReference:Dw,list:c1,listItem:m1,paragraph:g1,root:v1,strong:Pw,text:k1,thematicBreak:M1}});function Il(e){let t="&"+e+";";D1.innerHTML=t;let a=D1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var D1,If=k(()=>{"use strict";D1=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 Nw=k(()=>{"use strict"});function _1(e){return e.replace(UF,FF)}function FF(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 Il(a)||e}var UF,O1=k(()=>{"use strict";If();Nw();UF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Bw=k(()=>{"use strict";R1()});function Fw(){return{enter:{table:zF,tableData:P1,tableHeader:P1,tableRow:HF},exit:{codeText:jF,table:qF,tableData:Uw,tableHeader:Uw,tableRow:Uw}}}function zF(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 qF(e){this.exit(e),this.data.inTable=void 0}function HF(e){this.enter({type:"tableRow",children:[]},e)}function Uw(e){this.exit(e)}function P1(e){this.enter({type:"tableCell",children:[]},e)}function jF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VF));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function VF(e,t){return t==="|"?t:e}function zw(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"),h=x.containerPhrasing(p,{...S,before:o,after:o});return y(),w(),h}function u(p,m){return IT(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("table");for(;++w<S.length;)y[w]=d(S[w],m,x);return h(),y}function d(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("tableRow");for(;++w<S.length;)y[w]=s(S[w],p,m,x);return h(),y}function f(p,m,x){let S=gu.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}var O1=k(()=>{"use strict";CT();Pw()});var P1=k(()=>{"use strict";O1()});function Fw(){return{exit:{taskListCheckValueChecked:N1,taskListCheckValueUnchecked:N1,paragraph:jF}}}function zw(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VF}}}function N1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jF(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 VF(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=gu.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 B1=k(()=>{"use strict";Pw()});var U1=k(()=>{"use strict";B1()});function qw(){return[hw(),ww(),xw(),Bw(),Fw()]}function Hw(e){return{extensions:[gw(),yw(e),vw(),Uw(e),zw()]}}var F1=k(()=>{"use strict";mT();yT();bT();P1();U1()});var z1=k(()=>{"use strict";F1()});function _t(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 ga(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}var gr=k(()=>{"use strict"});function Cf(e){let t={},a=-1;for(;++a<e.length;)WF(t,e[a]);return t}function WF(e,t){let a;for(a in t){let r=(q1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){q1.call(r,i)||(r[i]=[]);let l=o[i];GF(r[i],Array.isArray(l)?l:l?[l]:[])}}}function GF(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);_t(e,0,0,n)}var q1,jw=k(()=>{"use strict";gr();q1={}.hasOwnProperty});function Ww(){return{text:Fn}}function KF(e,t,a){let n=this,r,o;return i;function i(d){return!Vw(d)||!K1.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(XF,c,u)(d):d===45||d===95||kt(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 YF(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!$1.call(n,n.previous)||Gw(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($F,e.attempt(H1,e.attempt(j1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function ZF(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&X1.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(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)||Me(d)||Un(d)||Go(d)?a(d):e.attempt(H1,e.attempt(j1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function QF(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(V1,s,l)(u):u===null||Me(u)||Un(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 ez(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(V1,t,o)(i):i===null||Me(i)||Un(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function tz(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||Me(l)||Un(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||Me(l)||Un(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 az(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return kt(o)?a(o):t(o)}}function $1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function X1(e){return!jt(e)}function K1(e){return!(e===47||Vw(e))}function Vw(e){return e===43||e===45||e===46||e===95||kt(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 $F,H1,j1,V1,XF,W1,G1,wr,Fn,Xo,Y1=k(()=>{"use strict";je();$F={tokenize:QF,partial:!0},H1={tokenize:JF,partial:!0},j1={tokenize:ez,partial:!0},V1={tokenize:tz,partial:!0},XF={tokenize:az,partial:!0},W1={name:"wwwAutolink",tokenize:YF,previous:$1},G1={name:"protocolAutolink",tokenize:ZF,previous:X1},wr={name:"emailAutolink",tokenize:KF,previous:K1},Fn={};Xo=48;for(;Xo<123;)Fn[Xo]=wr,Xo++,Xo===58?Xo=65:Xo===91&&(Xo=97);Fn[43]=wr;Fn[45]=wr;Fn[46]=wr;Fn[95]=wr;Fn[72]=[wr,G1];Fn[104]=[wr,G1];Fn[87]=[wr,W1];Fn[119]=[wr,W1]});function un(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&kt(e.charCodeAt(a+1))&&kt(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 Z1=k(()=>{"use strict";Y1()});function ro(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 wu=k(()=>{"use strict"});function nz(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};Q1(d,-s),Q1(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=ga(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ga(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ga(u,ro(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ga(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=ga(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,_t(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 rz(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=hr(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=hr(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 Q1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var yu,J1=k(()=>{"use strict";gr();yf();wu();yu={name:"attention",resolveAll:nz,tokenize:rz}});function oz(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||kt(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||kt(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):iT(p)?(e.consume(p),u):a(p)}function c(p){return kt(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||kt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var $w,eL=k(()=>{"use strict";je();$w={name:"autolink",tokenize:oz}});function ie(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return se(s)?(e.enter(a),l(s)):t(s)}function l(s){return se(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Ot=k(()=>{"use strict";je()});function iz(e,t,a){return n;function n(o){return se(o)?ie(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||Z(o)?t(o):a(o)}}var zn,kf=k(()=>{"use strict";Ot();je();zn={partial:!0,tokenize:iz}});function lz(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 se(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function sz(e,t,a){let n=this;return r;function r(i){return se(i)?ie(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 uz(e){e.exit("blockQuote")}var Tf,tL=k(()=>{"use strict";Ot();je();Tf={continuation:{tokenize:sz},exit:uz,name:"blockQuote",tokenize:lz}});function cz(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 sT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Lf,aL=k(()=>{"use strict";je();Lf={name:"characterEscape",tokenize:cz}});function dz(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=kt,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=lT,c):(e.enter("characterReferenceValue"),o=7,i=hu,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===kt&&!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,nL=k(()=>{"use strict";Sf();je();Ef={name:"characterReference",tokenize:dz}});function fz(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"),se(C)?ie(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Z(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(rL,x,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):se(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||Z(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Z(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&&se(C)?ie(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||Z(C)?e.check(rL,x,b)(C):(e.enter("codeFlowValue"),h(C))}function h(C){return C===null||Z(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),h)}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"),se(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"),se(V)?ie(C,W,"whitespace")(V):W(V)):R(V)}function W(V){return V===null||Z(V)?(C.exit("codeFencedFence"),M(V)):R(V)}}}function pz(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 rL,Mf,oL=k(()=>{"use strict";Ot();je();rL={partial:!0,tokenize:pz},Mf={concrete:!0,name:"codeFenced",tokenize:fz}});function hz(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):Z(u)?e.attempt(mz,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Z(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function gz(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):Z(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):Z(i)?r(i):a(i)}}var xu,mz,iL=k(()=>{"use strict";Ot();je();xu={name:"codeIndented",tokenize:hz},mz={partial:!0,tokenize:gz}});function wz(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 yz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xz(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)):Z(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||Z(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,lL=k(()=>{"use strict";je();Xw={name:"codeText",previous:yz,resolve:wz,tokenize:xz}});function vu(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,sL=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&&vu(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),vu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vu(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);vu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vu(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,vz(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 _t(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function vz(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";gr();sL()});function Sz(e){return Rf(e),e}function Iz(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):Z(l)?e.check(bz,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 Cz(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||Z(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,bz,uL=k(()=>{"use strict";Ot();je();Kw();Yw={resolve:Sz,tokenize:Iz},bz={partial:!0,tokenize:Cz}});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||Z(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||Me(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";je()});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):Z(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||Z(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!se(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";je()});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):Z(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||Z(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";Ot();je()});function Yo(e,t){let a;return n;function n(r){return Z(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):se(r)?ie(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var ey=k(()=>{"use strict";Ot();je()});function Tz(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=la(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 Me(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(kz,d,d)(p)}function d(p){return se(p)?ie(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Z(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function Lz(e,t,a){return n;function n(l){return Me(l)?Yo(e,r)(l):a(l)}function r(l){return Of(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return se(l)?ie(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Z(l)?t(l):a(l)}}var ty,kz,cL=k(()=>{"use strict";Zw();Qw();Ot();Jw();ey();je();yl();ty={name:"definition",tokenize:Tz},kz={partial:!0,tokenize:Lz}});function Ez(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return Z(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ay,dL=k(()=>{"use strict";je();ay={name:"hardBreakEscape",tokenize:Ez}});function Mz(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"},_t(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function Az(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||Me(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||Z(c)?(e.exit("atxHeading"),t(c)):se(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||Me(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var ny,fL=k(()=>{"use strict";Ot();je();gr();ny={name:"headingAtx",resolve:Mz,tokenize:Az}});var pL,ry,mL=k(()=>{"use strict";pL=["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 _z(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 Oz(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||Me(v)){let K=v===47,ee=i.toLowerCase();return!K&&!o&&ry.includes(ee)?(r=1,n.interrupt?t(v):H(v)):pL.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):h(v))}return v===45||kt(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 se(v)?(e.consume(v),y):L(v)}function h(v){return v===47?(e.consume(v),L):v===58||v===95||jt(v)?(e.consume(v),b):se(v)?(e.consume(v),h):L(v)}function b(v){return v===45||v===46||v===58||v===95||kt(v)?(e.consume(v),b):T(v)}function T(v){return v===61?(e.consume(v),C):se(v)?(e.consume(v),T):h(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):se(v)?(e.consume(v),C):R(v)}function M(v){return v===s?(e.consume(v),s=null,P):v===null||Z(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||Me(v)?T(v):(e.consume(v),R)}function P(v){return v===47||v===62||se(v)?h(v):a(v)}function L(v){return v===62?(e.consume(v),$):a(v)}function $(v){return v===null||Z(v)?H(v):se(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),ue):Z(v)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Rz,et,F)(v)):v===null||Z(v)?(e.exit("htmlFlowData"),F(v)):(e.consume(v),H)}function F(v){return e.check(Dz,W,et)(v)}function W(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),V}function V(v){return v===null||Z(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 ry.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 ue(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||Z(v)?(e.exit("htmlFlowData"),et(v)):(e.consume(v),Ve)}function et(v){return e.exit("htmlFlow"),t(v)}}function Pz(e,t,a){let n=this;return r;function r(i){return Z(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 Nz(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zn,t,a)}}var oy,Rz,Dz,hL=k(()=>{"use strict";je();mL();kf();oy={concrete:!0,name:"htmlFlow",resolveTo:_z,tokenize:Oz},Rz={partial:!0,tokenize:Nz},Dz={partial:!0,tokenize:Pz}});function Bz(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),h):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):Z(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):Z(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):Z(I)?(i=y,D(I)):(e.consume(I),y)}function h(I){return I===null?a(I):I===63?(e.consume(I),b):Z(I)?(i=h,D(I)):(e.consume(I),h)}function b(I){return I===62?N(I):h(I)}function T(I){return jt(I)?(e.consume(I),C):a(I)}function C(I){return I===45||kt(I)?(e.consume(I),C):M(I)}function M(I){return Z(I)?(i=M,D(I)):se(I)?(e.consume(I),M):N(I)}function R(I){return I===45||kt(I)?(e.consume(I),R):I===47||I===62||Me(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):Z(I)?(i=P,D(I)):se(I)?(e.consume(I),P):N(I)}function L(I){return I===45||I===46||I===58||I===95||kt(I)?(e.consume(I),L):$(I)}function $(I){return I===61?(e.consume(I),H):Z(I)?(i=$,D(I)):se(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):Z(I)?(i=H,D(I)):se(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):Z(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||Me(I)?P(I):(e.consume(I),W)}function V(I){return I===47||I===62||Me(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 se(I)?ie(e,ue,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ue(I)}function ue(I){return e.enter("htmlTextData"),i(I)}}var iy,gL=k(()=>{"use strict";Ot();je();iy={name:"htmlText",tokenize:Bz}});function qz(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&&_t(e,0,e.length,a),e}function Hz(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=ga(l,e.slice(o+1,o+n+3)),l=ga(l,[["enter",c,t]]),l=ga(l,ro(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ga(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ga(l,e.slice(i+1)),l=ga(l,[["exit",s,t]]),_t(e,o,e.length,l),e}function jz(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(la(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(Uz,c,i?c:d)(f):f===91?e.attempt(Fz,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(zz,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function Vz(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 Me(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 Me(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 Me(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 Wz(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(la(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function Gz(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,Uz,Fz,zz,Pf=k(()=>{"use strict";Zw();Qw();Jw();ey();je();gr();yl();wu();Zo={name:"labelEnd",resolveAll:qz,resolveTo:Hz,tokenize:jz},Uz={tokenize:Vz},Fz={tokenize:Wz},zz={tokenize:Gz}});function $z(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,wL=k(()=>{"use strict";Pf();ly={name:"labelStartImage",resolveAll:Zo.resolveAll,tokenize:$z}});function Xz(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,yL=k(()=>{"use strict";Pf();sy={name:"labelStartLink",resolveAll:Zo.resolveAll,tokenize:Xz}});function Kz(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ie(e,t,"linePrefix")}}var bu,xL=k(()=>{"use strict";Ot();bu={name:"lineEnding",tokenize:Kz}});function Yz(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||Z(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),se(u)?ie(e,l,"whitespace")(u):l(u))}}var Qo,uy=k(()=>{"use strict";Ot();je();Qo={name:"thematicBreak",tokenize:Yz}});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:hu(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 hu(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(zn,n.interrupt?a:c,e.attempt(Zz,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return se(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 e4(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(zn,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||!se(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(Qz,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(e,e.attempt(sa,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function t4(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 a4(e){e.exit(this.containerState.type)}function n4(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!se(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var sa,Zz,Qz,vL=k(()=>{"use strict";Ot();je();kf();uy();sa={continuation:{tokenize:e4},exit:a4,name:"list",tokenize:Jz},Zz={partial:!0,tokenize:n4},Qz={partial:!0,tokenize:t4}});function r4(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 o4(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"),se(u)?ie(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||Z(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Nf,bL=k(()=>{"use strict";Ot();je();Nf={name:"setextUnderline",resolveTo:r4,tokenize:o4}});var Bf=k(()=>{"use strict";J1();eL();kf();tL();aL();nL();oL();iL();lL();uL();cL();dL();fL();hL();gL();Pf();wL();yL();xL();vL();bL();uy()});function cy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:c4,continuation:{tokenize:d4},exit:f4}},text:{91:{name:"gfmFootnoteCall",tokenize:u4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:l4,resolveTo:s4}}}}function l4(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=la(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 s4(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 u4(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||Me(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(la(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return Me(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 c4(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||Me(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=la(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Me(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 d4(e,t,a){return e.check(zn,t,e.attempt(i4,t,a))}function f4(e){e.exit("gfmFootnoteDefinition")}function p4(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 i4,SL=k(()=>{"use strict";Bf();Ot();je();yl();i4={tokenize:p4,partial:!0}});var IL=k(()=>{"use strict";SL()});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&&_t(f,f.length,0,ro(p,i.slice(u+1,s),l)),_t(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),_t(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=hr(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=hr(m);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,l(m)}}}var CL=k(()=>{"use strict";gr();yf();wu()});var kL=k(()=>{"use strict";CL()});function m4(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,TL=k(()=>{"use strict";Uf=class{constructor(){this.map=[]}add(t,a,n){m4(this,t,a,n)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let a=this.map.length,n=[];for(;a>0;)a-=1,n.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];n.push(t.slice()),t.length=0;let r=n.pop();for(;r;){for(let o of r)t.push(o);r=n.pop()}this.map.length=0}}});function LL(e,t){let a=!1,n=[];for(;t<e.length;){let r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return n}var EL=k(()=>{"use strict"});function fy(){return{flow:{null:{name:"table",tokenize:h4,resolveAll:g4}}}}function h4(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):Z(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):se(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||Me(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,se(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 se(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||Z(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"),h):(e.exit("tableDelimiterFiller"),h(L))}function h(L){return se(L)?ie(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||Z(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||Z(L)?(e.exit("tableRow"),t(L)):se(L)?ie(e,M,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||Me(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 g4(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&&(ML(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&&ML(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=LL(t.events,a))}return e}function 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 ML(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 AL=k(()=>{"use strict";Ot();je();TL();EL()});var RL=k(()=>{"use strict";AL()});function py(){return{text:{91:w4}}}function y4(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 Me(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 Z(s)?t(s):se(s)?e.check({tokenize:x4},t,a)(s):a(s)}}function x4(e,t,a){return ie(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var w4,DL=k(()=>{"use strict";Ot();je();w4={name:"tasklistCheck",tokenize:y4}});var _L=k(()=>{"use strict";DL()});function OL(e){return Cf([Ww(),cy(),dy(e),fy(),py()])}var PL=k(()=>{"use strict";jw();Z1();IL();kL();RL();_L()});function zf(e){let t=this,a=e||v4,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(OL(a)),o.push(qw()),i.push(Hw(a))}var v4,NL=k(()=>{"use strict";z1();PL();v4={}});var BL=k(()=>{"use strict";NL()});var b4,S4,I4,UL,C4,k4,FL,HL,jL,T4,L4,E4,M4,A4,R4,D4,Jo,VL,_4,O4,P4,N4,B4,U4,zL,oo,Cl,F4,WL,Hf,z4,GL,hy,q4,H4,$L,j4,V4,W4,G4,$4,X4,K4,Y4,Z4,XL,Q4,J4,eq,tq,aq,nq,qf,rq,oq,iq,lq,sq,uq,cq,dq,fq,pq,qL,mq,KL,hq,gq,wq,yq,xq,vq,my,$a,bq,Sq,Iq,YL,ZL=k(()=>{"use strict";b4=Object.defineProperty,S4=Object.defineProperties,I4=Object.getOwnPropertyDescriptors,UL=Object.getOwnPropertySymbols,C4=Object.prototype.hasOwnProperty,k4=Object.prototype.propertyIsEnumerable,FL=(e,t,a)=>t in e?b4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,HL=(e,t)=>{for(var a in t||(t={}))C4.call(t,a)&&FL(e,a,t[a]);if(UL)for(var a of UL(t))k4.call(t,a)&&FL(e,a,t[a]);return e},jL=(e,t)=>S4(e,I4(t)),T4=/(\*\*)([^*]*\*?)$/,L4=/(__)([^_]*?)$/,E4=/(\*\*\*)([^*]*?)$/,M4=/(\*)([^*]*?)$/,A4=/(_)([^_]*?)$/,R4=/(`)([^`]*?)$/,D4=/(~~)([^~]*?)$/,Jo=/^[\s_~*`]*$/,VL=/^[\s]*[-*+][\s]+$/,_4=/[\p{L}\p{N}_]/u,O4=/^```[^`\n]*```?$/,P4=/^\*{4,}$/,N4=/(__)([^_]+)_$/,B4=/(~~)([^~]+)~$/,U4=/__/g,zL=/~~/g,oo=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:_4.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},F4=(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},WL=(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},z4=(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"),h=x.containerPhrasing(p,{...S,before:o,after:o});return y(),w(),h}function u(p,m){return kT(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("table");for(;++w<S.length;)y[w]=d(S[w],m,x);return h(),y}function d(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("tableRow");for(;++w<S.length;)y[w]=s(S[w],p,m,x);return h(),y}function f(p,m,x){let S=wu.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}var N1=k(()=>{"use strict";TT();Bw()});var B1=k(()=>{"use strict";N1()});function qw(){return{exit:{taskListCheckValueChecked:U1,taskListCheckValueUnchecked:U1,paragraph:WF}}}function Hw(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GF}}}function U1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WF(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 GF(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 F1=k(()=>{"use strict";Bw()});var z1=k(()=>{"use strict";F1()});function jw(){return[ww(),xw(),bw(),Fw(),qw()]}function Vw(e){return{extensions:[yw(),vw(e),Sw(),zw(e),Hw()]}}var q1=k(()=>{"use strict";gT();vT();IT();B1();z1()});var H1=k(()=>{"use strict";q1()});function _t(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 ga(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}var gr=k(()=>{"use strict"});function kf(e){let t={},a=-1;for(;++a<e.length;)$F(t,e[a]);return t}function $F(e,t){let a;for(a in t){let r=(j1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){j1.call(r,i)||(r[i]=[]);let l=o[i];XF(r[i],Array.isArray(l)?l:l?[l]:[])}}}function XF(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);_t(e,0,0,n)}var j1,Ww=k(()=>{"use strict";gr();j1={}.hasOwnProperty});function $w(){return{text:Fn}}function ZF(e,t,a){let n=this,r,o;return i;function i(d){return!Gw(d)||!Z1.call(n,n.previous)||Xw(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Gw(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(YF,c,u)(d):d===45||d===95||kt(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 QF(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!K1.call(n,n.previous)||Xw(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KF,e.attempt(V1,e.attempt(W1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function JF(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&Y1.call(n,n.previous)&&!Xw(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||Go(d)||Me(d)||Un(d)||$o(d)?a(d):e.attempt(V1,e.attempt(W1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function ez(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 tz(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(G1,s,l)(u):u===null||Me(u)||Un(u)||u!==45&&$o(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 az(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(G1,t,o)(i):i===null||Me(i)||Un(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function nz(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||Me(l)||Un(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||Me(l)||Un(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 rz(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return kt(o)?a(o):t(o)}}function K1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function Y1(e){return!jt(e)}function Z1(e){return!(e===47||Gw(e))}function Gw(e){return e===43||e===45||e===46||e===95||kt(e)}function Xw(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 KF,V1,W1,G1,YF,$1,X1,wr,Fn,Ko,Q1=k(()=>{"use strict";je();KF={tokenize:ez,partial:!0},V1={tokenize:tz,partial:!0},W1={tokenize:az,partial:!0},G1={tokenize:nz,partial:!0},YF={tokenize:rz,partial:!0},$1={name:"wwwAutolink",tokenize:QF,previous:K1},X1={name:"protocolAutolink",tokenize:JF,previous:Y1},wr={name:"emailAutolink",tokenize:ZF,previous:Z1},Fn={};Ko=48;for(;Ko<123;)Fn[Ko]=wr,Ko++,Ko===58?Ko=65:Ko===91&&(Ko=97);Fn[43]=wr;Fn[45]=wr;Fn[46]=wr;Fn[95]=wr;Fn[72]=[wr,X1];Fn[104]=[wr,X1];Fn[87]=[wr,$1];Fn[119]=[wr,$1]});function un(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&kt(e.charCodeAt(a+1))&&kt(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 Yo=k(()=>{"use strict";je()});var J1=k(()=>{"use strict";Q1()});function ro(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 oz(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};eL(d,-s),eL(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=ga(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ga(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ga(u,ro(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ga(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=ga(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,_t(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 iz(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=hr(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=hr(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 eL(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var xu,tL=k(()=>{"use strict";gr();xf();yu();xu={name:"attention",resolveAll:oz,tokenize:iz}});function lz(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||kt(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||kt(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||Go(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):sT(p)?(e.consume(p),u):a(p)}function c(p){return kt(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||kt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Kw,aL=k(()=>{"use strict";je();Kw={name:"autolink",tokenize:lz}});function ie(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return se(s)?(e.enter(a),l(s)):t(s)}function l(s){return se(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Ot=k(()=>{"use strict";je()});function sz(e,t,a){return n;function n(o){return se(o)?ie(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||Z(o)?t(o):a(o)}}var zn,Tf=k(()=>{"use strict";Ot();je();zn={partial:!0,tokenize:sz}});function uz(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 se(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function cz(e,t,a){let n=this;return r;function r(i){return se(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 dz(e){e.exit("blockQuote")}var Lf,nL=k(()=>{"use strict";Ot();je();Lf={continuation:{tokenize:cz},exit:dz,name:"blockQuote",tokenize:uz}});function fz(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 cT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Ef,rL=k(()=>{"use strict";je();Ef={name:"characterEscape",tokenize:fz}});function pz(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=kt,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=uT,c):(e.enter("characterReferenceValue"),o=7,i=gu,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===kt&&!Il(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,oL=k(()=>{"use strict";If();je();Mf={name:"characterReference",tokenize:pz}});function mz(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"),se(C)?ie(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Z(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(iL,x,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):se(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||Z(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Z(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&&se(C)?ie(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||Z(C)?e.check(iL,x,b)(C):(e.enter("codeFlowValue"),h(C))}function h(C){return C===null||Z(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),h)}function b(C){return e.exit("codeFenced"),t(C)}function T(C,M,D){let P=0;return L;function L(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),$}function $(V){return C.enter("codeFencedFence"),se(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)):D(V)}function F(V){return V===l?(P++,C.consume(V),F):P>=i?(C.exit("codeFencedFenceSequence"),se(V)?ie(C,W,"whitespace")(V):W(V)):D(V)}function W(V){return V===null||Z(V)?(C.exit("codeFencedFence"),M(V)):D(V)}}}function hz(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 iL,Af,lL=k(()=>{"use strict";Ot();je();iL={partial:!0,tokenize:hz},Af={concrete:!0,name:"codeFenced",tokenize:mz}});function wz(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):Z(u)?e.attempt(gz,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Z(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function yz(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):Z(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):Z(i)?r(i):a(i)}}var vu,gz,sL=k(()=>{"use strict";Ot();je();vu={name:"codeIndented",tokenize:wz},gz={partial:!0,tokenize:yz}});function xz(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 vz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bz(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)):Z(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||Z(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 Yw,uL=k(()=>{"use strict";je();Yw={name:"codeText",previous:vz,resolve:xz,tokenize:bz}});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,cL=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,Sz(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 _t(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Sz(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 Zw=k(()=>{"use strict";gr();cL()});function Cz(e){return Df(e),e}function kz(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):Z(l)?e.check(Iz,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 Tz(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||Z(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 Qw,Iz,dL=k(()=>{"use strict";Ot();je();Zw();Qw={resolve:Cz,tokenize:kz},Iz={partial:!0,tokenize:Tz}});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||Go(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||Z(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||Me(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||Go(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 Jw=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):Z(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||Z(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!se(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var ey=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):Z(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||Z(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 ty=k(()=>{"use strict";Ot();je()});function Zo(e,t){let a;return n;function n(r){return Z(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):se(r)?ie(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var ay=k(()=>{"use strict";Ot();je()});function Ez(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=la(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 Me(p)?Zo(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(Lz,d,d)(p)}function d(p){return se(p)?ie(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Z(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function Mz(e,t,a){return n;function n(l){return Me(l)?Zo(e,r)(l):a(l)}function r(l){return Pf(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return se(l)?ie(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Z(l)?t(l):a(l)}}var ny,Lz,fL=k(()=>{"use strict";Jw();ey();Ot();ty();ay();je();xl();ny={name:"definition",tokenize:Ez},Lz={partial:!0,tokenize:Mz}});function Az(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return Z(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ry,pL=k(()=>{"use strict";je();ry={name:"hardBreakEscape",tokenize:Az}});function Rz(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"},_t(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function Dz(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||Me(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||Z(c)?(e.exit("atxHeading"),t(c)):se(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||Me(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var oy,mL=k(()=>{"use strict";Ot();je();gr();oy={name:"headingAtx",resolve:Rz,tokenize:Dz}});var hL,iy,gL=k(()=>{"use strict";hL=["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"],iy=["pre","script","style","textarea"]});function Pz(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 Nz(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||Me(v)){let K=v===47,ee=i.toLowerCase();return!K&&!o&&iy.includes(ee)?(r=1,n.interrupt?t(v):H(v)):hL.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):h(v))}return v===45||kt(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 se(v)?(e.consume(v),y):L(v)}function h(v){return v===47?(e.consume(v),L):v===58||v===95||jt(v)?(e.consume(v),b):se(v)?(e.consume(v),h):L(v)}function b(v){return v===45||v===46||v===58||v===95||kt(v)?(e.consume(v),b):T(v)}function T(v){return v===61?(e.consume(v),C):se(v)?(e.consume(v),T):h(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):se(v)?(e.consume(v),C):D(v)}function M(v){return v===s?(e.consume(v),s=null,P):v===null||Z(v)?a(v):(e.consume(v),M)}function D(v){return v===null||v===34||v===39||v===47||v===60||v===61||v===62||v===96||Me(v)?T(v):(e.consume(v),D)}function P(v){return v===47||v===62||se(v)?h(v):a(v)}function L(v){return v===62?(e.consume(v),$):a(v)}function $(v){return v===null||Z(v)?H(v):se(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),R):v===62&&r===4?(e.consume(v),We):v===63&&r===3?(e.consume(v),I):v===93&&r===5?(e.consume(v),ue):Z(v)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(_z,Je,F)(v)):v===null||Z(v)?(e.exit("htmlFlowData"),F(v)):(e.consume(v),H)}function F(v){return e.check(Oz,W,Je)(v)}function W(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),V}function V(v){return v===null||Z(v)?F(v):(e.enter("htmlFlowData"),H(v))}function N(v){return v===45?(e.consume(v),I):H(v)}function R(v){return v===47?(e.consume(v),i="",G):H(v)}function G(v){if(v===62){let K=i.toLowerCase();return iy.includes(K)?(e.consume(v),We):H(v)}return jt(v)&&i.length<8?(e.consume(v),i+=String.fromCharCode(v),G):H(v)}function ue(v){return v===93?(e.consume(v),I):H(v)}function I(v){return v===62?(e.consume(v),We):v===45&&r===2?(e.consume(v),I):H(v)}function We(v){return v===null||Z(v)?(e.exit("htmlFlowData"),Je(v)):(e.consume(v),We)}function Je(v){return e.exit("htmlFlow"),t(v)}}function Bz(e,t,a){let n=this;return r;function r(i){return Z(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 Uz(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zn,t,a)}}var ly,_z,Oz,wL=k(()=>{"use strict";je();gL();Tf();ly={concrete:!0,name:"htmlFlow",resolveTo:Pz,tokenize:Nz},_z={partial:!0,tokenize:Uz},Oz={partial:!0,tokenize:Bz}});function Fz(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),h):jt(I)?(e.consume(I),D):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):Z(I)?(i=d,R(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 We="CDATA[";return I===We.charCodeAt(o++)?(e.consume(I),o===We.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),S):Z(I)?(i=x,R(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):Z(I)?(i=y,R(I)):(e.consume(I),y)}function h(I){return I===null?a(I):I===63?(e.consume(I),b):Z(I)?(i=h,R(I)):(e.consume(I),h)}function b(I){return I===62?N(I):h(I)}function T(I){return jt(I)?(e.consume(I),C):a(I)}function C(I){return I===45||kt(I)?(e.consume(I),C):M(I)}function M(I){return Z(I)?(i=M,R(I)):se(I)?(e.consume(I),M):N(I)}function D(I){return I===45||kt(I)?(e.consume(I),D):I===47||I===62||Me(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):Z(I)?(i=P,R(I)):se(I)?(e.consume(I),P):N(I)}function L(I){return I===45||I===46||I===58||I===95||kt(I)?(e.consume(I),L):$(I)}function $(I){return I===61?(e.consume(I),H):Z(I)?(i=$,R(I)):se(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):Z(I)?(i=H,R(I)):se(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):Z(I)?(i=F,R(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||Me(I)?P(I):(e.consume(I),W)}function V(I){return I===47||I===62||Me(I)?P(I):a(I)}function N(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function R(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return se(I)?ie(e,ue,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ue(I)}function ue(I){return e.enter("htmlTextData"),i(I)}}var sy,yL=k(()=>{"use strict";Ot();je();sy={name:"htmlText",tokenize:Fz}});function jz(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&&_t(e,0,e.length,a),e}function Vz(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=ga(l,e.slice(o+1,o+n+3)),l=ga(l,[["enter",c,t]]),l=ga(l,ro(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ga(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ga(l,e.slice(i+1)),l=ga(l,[["exit",s,t]]),_t(e,o,e.length,l),e}function Wz(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(la(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(zz,c,i?c:d)(f):f===91?e.attempt(qz,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(Hz,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function Gz(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 Me(d)?Zo(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 Me(d)?Zo(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 Me(d)?Zo(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 $z(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(la(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function Xz(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 Qo,zz,qz,Hz,Nf=k(()=>{"use strict";Jw();ey();ty();ay();je();gr();xl();yu();Qo={name:"labelEnd",resolveAll:jz,resolveTo:Vz,tokenize:Wz},zz={tokenize:Gz},qz={tokenize:$z},Hz={tokenize:Xz}});function Kz(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 uy,xL=k(()=>{"use strict";Nf();uy={name:"labelStartImage",resolveAll:Qo.resolveAll,tokenize:Kz}});function Yz(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 cy,vL=k(()=>{"use strict";Nf();cy={name:"labelStartLink",resolveAll:Qo.resolveAll,tokenize:Yz}});function Zz(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ie(e,t,"linePrefix")}}var Su,bL=k(()=>{"use strict";Ot();Su={name:"lineEnding",tokenize:Zz}});function Qz(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||Z(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),se(u)?ie(e,l,"whitespace")(u):l(u))}}var Jo,dy=k(()=>{"use strict";Ot();je();Jo={name:"thematicBreak",tokenize:Qz}});function t4(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(Jo,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(zn,n.interrupt?a:c,e.attempt(Jz,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return se(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 a4(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(zn,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||!se(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(e4,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(e,e.attempt(sa,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function n4(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 r4(e){e.exit(this.containerState.type)}function o4(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!se(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var sa,Jz,e4,SL=k(()=>{"use strict";Ot();je();Tf();dy();sa={continuation:{tokenize:a4},exit:r4,name:"list",tokenize:t4},Jz={partial:!0,tokenize:o4},e4={partial:!0,tokenize:n4}});function i4(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 l4(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"),se(u)?ie(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||Z(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Bf,IL=k(()=>{"use strict";Ot();je();Bf={name:"setextUnderline",resolveTo:i4,tokenize:l4}});var Uf=k(()=>{"use strict";tL();aL();Tf();nL();rL();oL();lL();sL();uL();dL();fL();pL();mL();wL();yL();Nf();xL();vL();bL();SL();IL();dy()});function fy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:f4,continuation:{tokenize:p4},exit:m4}},text:{91:{name:"gfmFootnoteCall",tokenize:d4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:u4,resolveTo:c4}}}}function u4(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=la(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 c4(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 d4(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||Me(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(la(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return Me(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 f4(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||Me(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=la(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Me(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 p4(e,t,a){return e.check(zn,t,e.attempt(s4,t,a))}function m4(e){e.exit("gfmFootnoteDefinition")}function h4(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 s4,CL=k(()=>{"use strict";Uf();Ot();je();xl();s4={tokenize:h4,partial:!0}});var kL=k(()=>{"use strict";CL()});function py(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&&_t(f,f.length,0,ro(p,i.slice(u+1,s),l)),_t(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),_t(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=hr(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=hr(m);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,l(m)}}}var TL=k(()=>{"use strict";gr();xf();yu()});var LL=k(()=>{"use strict";TL()});function g4(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,EL=k(()=>{"use strict";Ff=class{constructor(){this.map=[]}add(t,a,n){g4(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 ML(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 AL=k(()=>{"use strict"});function my(){return{flow:{null:{name:"table",tokenize:w4,resolveAll:y4}}}}function w4(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):Z(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):se(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||Me(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,se(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 se(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||Z(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"),h):(e.exit("tableDelimiterFiller"),h(L))}function h(L){return se(L)?ie(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||Z(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||Z(L)?(e.exit("tableRow"),t(L)):se(L)?ie(e,M,"whitespace")(L):(e.enter("data"),D(L))}function D(L){return L===null||L===124||Me(L)?(e.exit("data"),M(L)):(e.consume(L),L===92?P:D)}function P(L){return L===92||L===124?(e.consume(L),D):D(L)}}function y4(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&&(RL(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&&RL(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=ML(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({},Cl(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Cl(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=Cl(t.events,a[2]),c=Cl(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({},Cl(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function RL(e,t,a,n,r){let o=[],i=Cl(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 Cl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var DL=k(()=>{"use strict";Ot();je();EL();AL()});var _L=k(()=>{"use strict";DL()});function hy(){return{text:{91:x4}}}function v4(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 Me(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 Z(s)?t(s):se(s)?e.check({tokenize:b4},t,a)(s):a(s)}}function b4(e,t,a){return ie(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var x4,OL=k(()=>{"use strict";Ot();je();x4={name:"tasklistCheck",tokenize:v4}});var PL=k(()=>{"use strict";OL()});function NL(e){return kf([$w(),fy(),py(e),my(),hy()])}var BL=k(()=>{"use strict";Ww();J1();kL();LL();_L();PL()});function qf(e){let t=this,a=e||S4,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(NL(a)),o.push(jw()),i.push(Vw(a))}var S4,UL=k(()=>{"use strict";H1();BL();S4={}});var FL=k(()=>{"use strict";UL()});var I4,C4,k4,zL,T4,L4,qL,VL,WL,E4,M4,A4,R4,D4,_4,O4,ei,GL,P4,N4,B4,U4,F4,z4,HL,oo,kl,q4,$L,jf,H4,XL,wy,j4,V4,KL,W4,G4,$4,X4,K4,Y4,Z4,Q4,J4,YL,eq,tq,aq,nq,rq,oq,Hf,iq,lq,sq,uq,cq,dq,fq,pq,mq,hq,jL,gq,ZL,wq,yq,xq,vq,bq,Sq,gy,$a,Iq,Cq,kq,QL,JL=k(()=>{"use strict";I4=Object.defineProperty,C4=Object.defineProperties,k4=Object.getOwnPropertyDescriptors,zL=Object.getOwnPropertySymbols,T4=Object.prototype.hasOwnProperty,L4=Object.prototype.propertyIsEnumerable,qL=(e,t,a)=>t in e?I4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,VL=(e,t)=>{for(var a in t||(t={}))T4.call(t,a)&&qL(e,a,t[a]);if(zL)for(var a of zL(t))L4.call(t,a)&&qL(e,a,t[a]);return e},WL=(e,t)=>C4(e,k4(t)),E4=/(\*\*)([^*]*\*?)$/,M4=/(__)([^_]*?)$/,A4=/(\*\*\*)([^*]*?)$/,R4=/(\*)([^*]*?)$/,D4=/(_)([^_]*?)$/,_4=/(`)([^`]*?)$/,O4=/(~~)([^~]*?)$/,ei=/^[\s_~*`]*$/,GL=/^[\s]*[-*+][\s]+$/,P4=/[\p{L}\p{N}_]/u,N4=/^```[^`\n]*```?$/,B4=/^\*{4,}$/,U4=/(__)([^_]+)_$/,F4=/(~~)([^~]+)~$/,z4=/__/g,HL=/~~/g,oo=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:P4.test(e)},kl=(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},q4=(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},$L=(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},H4=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
+
`)return!1}return!1},XL=(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]==="]"?H4(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},wy=(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},j4=(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},V4=(e,t,a,n)=>a==="\\"||e.includes("$")&&jf(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&oo(a)&&oo(n)||j4(e,t,n)),KL=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]:"";V4(e,n,r,o)||(t+=1)}return t},W4=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&jf(e,t)||XL(e,t)||a==="_"||n==="_"||a&&n&&oo(a)&&oo(n)),G4=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]:"";W4(e,n,r,o)||(t+=1)}return t},$4=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},X4=(e,t,a)=>{if(!t||ei.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
30
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return GL.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:wy(e,a,"*")},K4=e=>{let t=e.match(E4);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return kl(e,n)||X4(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},Y4=(e,t,a)=>{if(!t||ei.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
32
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return GL.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:wy(e,a,"_")},Z4=e=>{let t=e.match(M4);if(!t){let r=e.match(U4);if(r){let o=e.lastIndexOf(r[1]);if(!kl(e,o)&&(e.match(z4)||[]).length%2===1)return`${e}_`}return e}let a=t[2],n=e.lastIndexOf(t[1]);return kl(e,n)||Y4(e,a,n)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},Q4=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&&oo(a)&&oo(n))continue;return t}return-1},J4=e=>{if(!e.match(R4))return e;let t=Q4(e);if(t===-1||kl(e,t))return e;let a=e.substring(t+1);return!a||ei.test(a)?e:KL(e)%2===1?`${e}*`:e},YL=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)&&!XL(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&oo(a)&&oo(n))continue;return t}return-1},eq=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}_`},tq=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=YL(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},aq=e=>{if(!e.match(D4))return e;let t=YL(e);if(t===-1||kl(e,t))return e;let a=e.substring(t+1);if(!a||ei.test(a))return e;if(G4(e)%2===1){let n=tq(e);return n!==null?n:eq(e)}return e},nq=e=>{let t=(e.match(/\*\*/g)||[]).length,a=KL(e);return t%2===0&&a%2===0},rq=(e,t,a)=>!t||ei.test(t)||kl(e,a)?!0:wy(e,a,"*"),oq=e=>{if(B4.test(e))return e;let t=e.match(A4);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return rq(e,a,n)?e:$4(e)%2===1?nq(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},iq=(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},lq=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!iq(e,a)&&(t+=1);return t},sq=e=>!e.match(N4)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,uq=e=>(e.match(/```/g)||[]).length%2===1,cq=e=>{let t=sq(e);if(t!==null)return t;let a=e.match(_4);if(a&&!uq(e)){let n=a[2];if(!n||ei.test(n))return e;if(lq(e)%2===1)return`${e}\``}return e},dq=(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)==="```",fq=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!dq(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},pq=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},vq=e=>{let t=e.match(D4);if(t){let a=t[2];if(!a||Jo.test(a))return e;if((e.match(zL)||[]).length%2===1)return`${e}~~`}else if(e.match(B4)&&(e.match(zL)||[]).length%2===1)return`${e}~`;return e},my=e=>e!==!1,$a={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},bq=[{handler:{name:"setextHeadings",handle:xq,priority:$a.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:KL,priority:$a.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:nq,priority:$a.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:$4,priority:$a.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:K4,priority:$a.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:Z4,priority:$a.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:eq,priority:$a.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:sq,priority:$a.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:vq,priority:$a.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:fq,priority:$a.KATEX},optionKey:"katex"}],Sq=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return bq.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:jL(HL({},n),{handle:o=>KL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},Iq=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=Sq(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:jL(HL({},l),{priority:(s=l.priority)!=null?s:$a.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:$a.DEFAULT)-((c=s.handler.priority)!=null?c:$a.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},YL=Iq});function QL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var JL=k(()=>{"use strict"});function jf(e,t){return((t||Tq).jsx?kq:Cq).test(e)}var Cq,kq,Tq,eE=k(()=>{"use strict";Cq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tq={}});var tE=k(()=>{"use strict";eE()});function gy(e){return typeof e=="object"?e.type==="text"?aE(e.value):!1:aE(e)}function aE(e){return e.replace(Lq,"")===""}var Lq,nE=k(()=>{"use strict";Lq=/[ \t\n\f\r]/g});var rE=k(()=>{"use strict";nE()});var yr,wy=k(()=>{"use strict";yr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};yr.prototype.normal={};yr.prototype.property={};yr.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 yr(a,n,t)}var oE=k(()=>{"use strict";wy()});function Su(e){return e.toLowerCase()}var xy=k(()=>{"use strict"});var Qt,vy=k(()=>{"use strict";Qt=class{constructor(t,a){this.attribute=a,this.property=t}};Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0});var Iu={};fc(Iu,{boolean:()=>ve,booleanish:()=>Tt,commaOrSpaceSeparated:()=>Ra,commaSeparated:()=>io,number:()=>j,overloadedBoolean:()=>Vf,spaceSeparated:()=>nt});function ei(){return 2**++Eq}var Eq,ve,Tt,Vf,j,nt,io,Ra,Cu=k(()=>{"use strict";Eq=0,ve=ei(),Tt=ei(),Vf=ei(),j=ei(),nt=ei(),io=ei(),Ra=ei()});function iE(e,t,a){a&&(e[t]=a)}var by,ti,Sy=k(()=>{"use strict";vy();Cu();by=Object.keys(Iu),ti=class extends Qt{constructor(t,a,n,r){let o=-1;if(super(t,a),iE(this,"space",r),typeof n=="number")for(;++o<by.length;){let i=by[o];iE(this,by[o],(n&Iu[i])===Iu[i])}}};ti.prototype.defined=!0});function cn(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[Su(n)]=n,a[Su(o.attribute)]=n}return new yr(t,a,e.space)}var ai=k(()=>{"use strict";xy();Sy();wy()});var Iy,lE=k(()=>{"use strict";ai();Cu();Iy=cn({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:nt,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:j,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:nt,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:Tt,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 sE,uE=k(()=>{"use strict";ky();ai();Cu();sE=cn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:io,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:ve,allowPaymentRequest:ve,allowUserMedia:ve,alt:null,as:null,async:ve,autoCapitalize:null,autoComplete:nt,autoFocus:ve,autoPlay:ve,blocking:nt,capture:null,charSet:null,checked:ve,cite:null,className:nt,cols:j,colSpan:null,content:null,contentEditable:Tt,controls:ve,controlsList:nt,coords:j|io,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ve,defer:ve,dir:null,dirName:null,disabled:ve,download:Vf,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ve,formTarget:null,headers:nt,height:j,hidden:Vf,high:j,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:ve,inputMode:null,integrity:null,is:null,isMap:ve,itemId:null,itemProp:nt,itemRef:nt,itemScope:ve,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ve,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:ve,muted:ve,name:null,nonce:null,noModule:ve,noValidate:ve,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:ve,optimum:j,pattern:null,ping:nt,placeholder:null,playsInline:ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ve,referrerPolicy:null,rel:nt,required:ve,reversed:ve,rows:j,rowSpan:j,sandbox:nt,scope:null,scoped:ve,seamless:ve,selected:ve,shadowRootClonable:ve,shadowRootDelegatesFocus:ve,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:Tt,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:ve,useMap:null,value:Tt,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,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:ve,declare:ve,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:ve,noHref:ve,noShade:ve,noWrap:ve,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:Tt,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:ve,disableRemotePlayback:ve,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:Gf})});var cE,dE=k(()=>{"use strict";Cy();ai();Cu();cE=cn({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:Ra,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:nt,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:ve,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:io,g2:io,glyphName:io,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:Ra,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:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ra,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ra,rev:Ra,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ra,requiredFeatures:Ra,requiredFonts:Ra,requiredFormats:Ra,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:Ra,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:Ra,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:Ra,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,fE=k(()=>{"use strict";ai();Ty=cn({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,pE=k(()=>{"use strict";ai();ky();Ly=cn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gf})});var Ey,mE=k(()=>{"use strict";ai();Ey=cn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var My,hE=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=Su(t),n=t,r=Qt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Aq.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(gE,Dq);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!gE.test(o)){let i=o.replace(Mq,Rq);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=ti}return new r(n,t)}function Rq(e){return"-"+e.toLowerCase()}function Dq(e){return e.charAt(1).toUpperCase()}var Mq,gE,Aq,wE=k(()=>{"use strict";Sy();vy();xy();Mq=/[A-Z]/g,gE=/-[a-z]/g,Aq=/^data[-\w.:]+$/i});var yE,$f,xE=k(()=>{"use strict";oE();lE();uE();dE();fE();pE();mE();hE();wE();yE=yy([Iy,sE,Ty,Ly,Ey],"html"),$f=yy([Iy,cE,Ty,Ly,Ey],"svg")});function vE(e){return e.join(" ").trim()}var bE=k(()=>{"use strict"});var LE=oa((Hte,TE)=>{"use strict";var SE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,_q=/\n/g,Oq=/^\s*/,Pq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Nq=/^:\s*/,Bq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Uq=/^[;\s]*/,Fq=/^\s+|\s+$/g,zq=`
|
|
42
|
-
`,IE="/",CE="*",ni="",qq="comment",Hq="declaration";function jq(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(_q);x&&(a+=x.length);var S=m.lastIndexOf(zq);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(Oq)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(IE!=e.charAt(0)||CE!=e.charAt(1))){for(var x=2;ni!=e.charAt(x)&&(CE!=e.charAt(x)||IE!=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:qq,comment:S})}}function f(){var m=o(),x=s(Pq);if(x){if(d(),!s(Nq))return l("property missing ':'");var S=s(Bq),w=m({type:Hq,property:kE(x[0].replace(SE,ni)),value:S?kE(S[0].replace(SE,ni)):ni});return s(Uq),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 kE(e){return e?e.replace(Fq,ni):ni}TE.exports=jq});var EE=oa(ku=>{"use strict";var Vq=ku&&ku.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ku,"__esModule",{value:!0});ku.default=Gq;var Wq=Vq(LE());function Gq(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,Wq.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 AE=oa(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.camelCase=void 0;var $q=/^--[a-zA-Z0-9_-]+$/,Xq=/-([a-z])/g,Kq=/^[^-]+$/,Yq=/^-(webkit|moz|ms|o|khtml)-/,Zq=/^-(ms)-/,Qq=function(e){return!e||Kq.test(e)||$q.test(e)},Jq=function(e,t){return t.toUpperCase()},ME=function(e,t){return"".concat(t,"-")},e5=function(e,t){return t===void 0&&(t={}),Qq(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Zq,ME):e=e.replace(Yq,ME),e.replace(Xq,Jq))};Xf.camelCase=e5});var DE=oa((Dy,RE)=>{"use strict";var t5=Dy&&Dy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},a5=t5(EE()),n5=AE();function Ry(e,t){var a={};return!e||typeof e!="string"||(0,a5.default)(e,function(n,r){n&&r&&(a[(0,n5.camelCase)(n,t)]=r)}),a}Ry.default=Ry;RE.exports=Ry});function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_E(e.position):"start"in e||"end"in e?_E(e):"line"in e||"column"in e?_y(e):""}function _y(e){return OE(e&&e.line)+":"+OE(e&&e.column)}function _E(e){return _y(e&&e.start)+"-"+_y(e&&e.end)}function OE(e){return e&&typeof e=="number"?e:1}var PE=k(()=>{"use strict"});var Oy=k(()=>{"use strict";PE()});var Pt,NE=k(()=>{"use strict";Oy();Pt=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=lo(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}};Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0});var Py=k(()=>{"use strict";NE()});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=h5(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=m5(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:yE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=FE(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function FE(e,t,a){if(t.type==="element")return s5(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return d5(e,t,a);if(t.type==="mdxjsEsm")return c5(e,t);if(t.type==="root")return f5(e,t,a);if(t.type==="text")return p5(e,t)}function s5(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=qE(e,t.tagName,!1),i=g5(e,t),l=Fy(e,t);return i5.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!gy(s):!0})),zE(e,i,o,t),Uy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function u5(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)}Tu(e,t.position)}function c5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tu(e,t.position)}function d5(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:qE(e,t.name,!0),i=w5(e,t),l=Fy(e,t);return zE(e,i,o,t),Uy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function f5(e,t,a){let n={};return Uy(n,Fy(e,t)),e.create(t,e.Fragment,n,a)}function p5(e,t){return t.value}function zE(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 m5(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 h5(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 g5(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Ny.call(t.properties,r)){let o=y5(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&l5.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 w5(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 Tu(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 Tu(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:r5;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=FE(e,o,i);l!==void 0&&a.push(l)}return a}function y5(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?QL(a):vE(a)),n.property==="style"){let r=typeof a=="object"?a:x5(e,String(a));return e.stylePropertyNameCase==="css"&&(r=v5(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?My[n.property]||n.property:n.attribute,a]}}function x5(e,t){try{return(0,BE.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Pt("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=UE+"#cannot-parse-style-attribute",r}}function qE(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);Tu(e)}function Tu(e,t){let a=new Pt("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=UE+"#cannot-handle-mdx-estrees-without-createevaluater",a}function v5(e){let t={},a;for(a in e)Ny.call(e,a)&&(t[b5(a)]=e[a]);return t}function b5(e){let t=e.replace(o5,S5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function S5(e){return"-"+e.toLowerCase()}var BE,Ny,r5,o5,i5,l5,UE,HE=k(()=>{"use strict";JL();tE();rE();xE();bE();BE=z(DE(),1);pu();Py();Ny={}.hasOwnProperty,r5=new Map,o5=/[A-Z]/g,i5=new Set(["table","tbody","thead","tfoot","tr"]),l5=new Set(["td","th"]),UE="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var jE=k(()=>{"use strict";HE()});function I5(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 Z(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var VE,WE=k(()=>{"use strict";Ot();je();VE={tokenize:I5}});function C5(e){let t=this,a=[],n=0,r,o,i;return l;function l(h){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(h)}return u(h)}function s(h){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 _t(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(h)}return l(h)}function u(h){if(n===a.length){if(!r)return f(h);if(r.currentConstruct&&r.currentConstruct.concrete)return m(h);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(GE,c,d)(h)}function c(h){return r&&y(),w(n),f(h)}function d(h){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(h)}function f(h){return t.containerState={},e.attempt(GE,p,m)(h)}function p(h){return n++,a.push([t.currentConstruct,t.containerState]),f(h)}function m(h){if(h===null){r&&y(),w(0),e.consume(h);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(h)}function x(h){if(h===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(h);return}return Z(h)?(e.consume(h),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(h),x)}function S(h,b){let T=t.sliceStream(h);if(b&&T.push(null),h.previous=o,o&&(o.next=h),o=h,r.defineSkip(h.start),r.write(T),t.parser.lazy[h.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++;_t(t.events,R+1,0,t.events.slice(M)),t.events.length=C}}function w(h){let b=a.length;for(;b-- >h;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=h}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function k5(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 $E,GE,XE=k(()=>{"use strict";Ot();je();gr();$E={tokenize:C5},GE={tokenize:k5}});function T5(e){let t=this,a=e.attempt(zn,n,e.attempt(this.parser.constructs.flowInitial,r,ie(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 KE,YE=k(()=>{"use strict";Bf();Ot();KE={tokenize:T5}});function eM(e){return{resolveAll:tM(e==="text"?L5: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 tM(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 L5(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 ZE,QE,JE,zy=k(()=>{"use strict";ZE={resolveAll:tM()},QE=eM("string"),JE=eM("text")});var qy={};fc(qy,{attentionMarkers:()=>P5,contentInitial:()=>M5,disable:()=>N5,document:()=>E5,flow:()=>R5,flowInitial:()=>A5,insideSpan:()=>O5,string:()=>D5,text:()=>_5});var E5,M5,A5,R5,D5,_5,O5,P5,N5,aM=k(()=>{"use strict";Bf();zy();E5={42:sa,43:sa,45:sa,48:sa,49:sa,50:sa,51:sa,52:sa,53:sa,54:sa,55:sa,56:sa,57:sa,62:Tf},M5={91:ty},A5={[-2]:xu,[-1]:xu,32:xu},R5={35:ny,42:Qo,45:[Nf,Qo],60:oy,61:Nf,95:Qo,96:Mf,126:Mf},D5={38:Ef,92:Lf},_5={[-5]:bu,[-4]:bu,[-3]:bu,33:ly,38:Ef,42:yu,60:[$w,iy],91:sy,92:[ay,Lf],93:Zo,95:yu,96:Xw},O5={null:[yu,ZE]},P5={null:[42,95]},N5={null:[]}});function nM(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=ga(i,F),y(),i[i.length-1]!==null?[]:(L(t,0),c.events=ro(o,c.events,c),c.events)}function m(F,W){return U5(x(F),W)}function x(F){return B5(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;)h(W.charCodeAt(n._bufferIndex));else h(W)}}function h(F){s=void 0,f=F,d=d(F)}function b(F){Z(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 ue,I,Ve,et;return Array.isArray(N)?K(N):"tokenize"in N?K([N]):v(N);function v(me){return be;function be(le){let de=le!==null&&me[le],Q=le!==null&&me.null,Be=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return K(Be)(le)}}function K(me){return ue=me,I=0,me.length===0?G:ee(me[I])}function ee(me){return be;function be(le){return et=$(),Ve=me,me.partial||(c.currentConstruct=me),me.name&&c.parser.constructs.disable.null.includes(me.name)?We(le):me.tokenize.call(W?Object.assign(Object.create(c),W):c,u,we,We)(le)}}function we(me){return s=!0,F(Ve,et),D}function We(me){return s=!0,et.restore(),++I<ue.length?ee(ue[I]):G}}}function L(F,W){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&_t(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 B5(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 U5(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}$$`},mq=e=>fq(e)%2===0?e:pq(e),hq=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=q4(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)`},jL=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!Hf(e,a)){if(a>0&&e[a-1]==="!")continue;let n=$L(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},gq=(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=jL(e,t);return l!==-1?e.substring(0,l)+e.substring(l+1):`${i}${o}`}return`${e}](streamdown:incomplete-link)`}if($L(e,t)===-1){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let l=jL(e,t);if(l!==-1)return e.substring(0,l)+e.substring(l+1);let s=e.substring(t+1);return`${i}${s}`}return`${e}](streamdown:incomplete-link)`}return null},ZL=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!Hf(e,a)){let n=hq(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=gq(e,n,t);if(r!==null)return r}return e},wq=/^-{1,2}$/,yq=/^[\s]*-{1,2}[\s]+$/,xq=/^={1,2}$/,vq=/^[\s]*={1,2}[\s]+$/,bq=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(wq.test(r)&&!a.match(yq)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(xq.test(r)&&!a.match(vq)){let o=n.split(`
|
|
41
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},Sq=e=>{let t=e.match(O4);if(t){let a=t[2];if(!a||ei.test(a))return e;if((e.match(HL)||[]).length%2===1)return`${e}~~`}else if(e.match(F4)&&(e.match(HL)||[]).length%2===1)return`${e}~`;return e},gy=e=>e!==!1,$a={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},Iq=[{handler:{name:"setextHeadings",handle:bq,priority:$a.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ZL,priority:$a.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:oq,priority:$a.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:K4,priority:$a.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Z4,priority:$a.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:J4,priority:$a.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:aq,priority:$a.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:cq,priority:$a.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Sq,priority:$a.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:mq,priority:$a.KATEX},optionKey:"katex"}],Cq=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return Iq.filter(({handler:n,optionKey:r})=>n.name==="links"?gy(e?.links)||gy(e?.images):gy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:WL(VL({},n),{handle:o=>ZL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},kq=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=Cq(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:WL(VL({},l),{priority:(s=l.priority)!=null?s:$a.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:$a.DEFAULT)-((c=s.handler.priority)!=null?c:$a.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},QL=kq});function eE(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var tE=k(()=>{"use strict"});function Vf(e,t){return((t||Eq).jsx?Lq:Tq).test(e)}var Tq,Lq,Eq,aE=k(()=>{"use strict";Tq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eq={}});var nE=k(()=>{"use strict";aE()});function yy(e){return typeof e=="object"?e.type==="text"?rE(e.value):!1:rE(e)}function rE(e){return e.replace(Mq,"")===""}var Mq,oE=k(()=>{"use strict";Mq=/[ \t\n\f\r]/g});var iE=k(()=>{"use strict";oE()});var yr,xy=k(()=>{"use strict";yr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0});function vy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new yr(a,n,t)}var lE=k(()=>{"use strict";xy()});function Iu(e){return e.toLowerCase()}var by=k(()=>{"use strict"});var Qt,Sy=k(()=>{"use strict";Qt=class{constructor(t,a){this.attribute=a,this.property=t}};Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0});var Cu={};pc(Cu,{boolean:()=>be,booleanish:()=>Tt,commaOrSpaceSeparated:()=>Ra,commaSeparated:()=>io,number:()=>j,overloadedBoolean:()=>Wf,spaceSeparated:()=>at});function ti(){return 2**++Aq}var Aq,be,Tt,Wf,j,at,io,Ra,ku=k(()=>{"use strict";Aq=0,be=ti(),Tt=ti(),Wf=ti(),j=ti(),at=ti(),io=ti(),Ra=ti()});function sE(e,t,a){a&&(e[t]=a)}var Iy,ai,Cy=k(()=>{"use strict";Sy();ku();Iy=Object.keys(Cu),ai=class extends Qt{constructor(t,a,n,r){let o=-1;if(super(t,a),sE(this,"space",r),typeof n=="number")for(;++o<Iy.length;){let i=Iy[o];sE(this,Iy[o],(n&Cu[i])===Cu[i])}}};ai.prototype.defined=!0});function cn(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new ai(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 yr(t,a,e.space)}var ni=k(()=>{"use strict";by();Cy();xy()});var ky,uE=k(()=>{"use strict";ni();ku();ky=cn({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:at,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:j,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:at,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:Tt,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 Ty=k(()=>{"use strict"});function $f(e,t){return Gf(e,t.toLowerCase())}var Ly=k(()=>{"use strict";Ty()});var cE,dE=k(()=>{"use strict";Ly();ni();ku();cE=cn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:io,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:Tt,controls:be,controlsList:at,coords:j|io,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Wf,draggable:Tt,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:Tt,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:Tt,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:Tt,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 fE,pE=k(()=>{"use strict";Ty();ni();ku();fE=cn({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:Ra,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:io,g2:io,glyphName:io,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:Ra,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:Ra,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ra,rev:Ra,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ra,requiredFeatures:Ra,requiredFonts:Ra,requiredFormats:Ra,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:Ra,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:Ra,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:Ra,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 Ey,mE=k(()=>{"use strict";ni();Ey=cn({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 My,hE=k(()=>{"use strict";ni();Ly();My=cn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$f})});var Ay,gE=k(()=>{"use strict";ni();Ay=cn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Ry,wE=k(()=>{"use strict";Ry={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 Dy(e,t){let a=Iu(t),n=t,r=Qt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Dq.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(yE,Oq);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!yE.test(o)){let i=o.replace(Rq,_q);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=ai}return new r(n,t)}function _q(e){return"-"+e.toLowerCase()}function Oq(e){return e.charAt(1).toUpperCase()}var Rq,yE,Dq,xE=k(()=>{"use strict";Cy();Sy();by();Rq=/[A-Z]/g,yE=/-[a-z]/g,Dq=/^data[-\w.:]+$/i});var vE,Xf,bE=k(()=>{"use strict";lE();uE();dE();pE();mE();hE();gE();wE();xE();vE=vy([ky,cE,Ey,My,Ay],"html"),Xf=vy([ky,fE,Ey,My,Ay],"svg")});function SE(e){return e.join(" ").trim()}var IE=k(()=>{"use strict"});var ME=oa((Vte,EE)=>{"use strict";var CE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Pq=/\n/g,Nq=/^\s*/,Bq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Uq=/^:\s*/,Fq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zq=/^[;\s]*/,qq=/^\s+|\s+$/g,Hq=`
|
|
42
|
+
`,kE="/",TE="*",ri="",jq="comment",Vq="declaration";function Wq(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(Pq);x&&(a+=x.length);var S=m.lastIndexOf(Hq);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(Nq)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(kE!=e.charAt(0)||TE!=e.charAt(1))){for(var x=2;ri!=e.charAt(x)&&(TE!=e.charAt(x)||kE!=e.charAt(x+1));)++x;if(x+=2,ri===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:jq,comment:S})}}function f(){var m=o(),x=s(Bq);if(x){if(d(),!s(Uq))return l("property missing ':'");var S=s(Fq),w=m({type:Vq,property:LE(x[0].replace(CE,ri)),value:S?LE(S[0].replace(CE,ri)):ri});return s(zq),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 LE(e){return e?e.replace(qq,ri):ri}EE.exports=Wq});var AE=oa(Tu=>{"use strict";var Gq=Tu&&Tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=Xq;var $q=Gq(ME());function Xq(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,$q.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 DE=oa(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.camelCase=void 0;var Kq=/^--[a-zA-Z0-9_-]+$/,Yq=/-([a-z])/g,Zq=/^[^-]+$/,Qq=/^-(webkit|moz|ms|o|khtml)-/,Jq=/^-(ms)-/,e5=function(e){return!e||Zq.test(e)||Kq.test(e)},t5=function(e,t){return t.toUpperCase()},RE=function(e,t){return"".concat(t,"-")},a5=function(e,t){return t===void 0&&(t={}),e5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Jq,RE):e=e.replace(Qq,RE),e.replace(Yq,t5))};Kf.camelCase=a5});var OE=oa((Oy,_E)=>{"use strict";var n5=Oy&&Oy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r5=n5(AE()),o5=DE();function _y(e,t){var a={};return!e||typeof e!="string"||(0,r5.default)(e,function(n,r){n&&r&&(a[(0,o5.camelCase)(n,t)]=r)}),a}_y.default=_y;_E.exports=_y});function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PE(e.position):"start"in e||"end"in e?PE(e):"line"in e||"column"in e?Py(e):""}function Py(e){return NE(e&&e.line)+":"+NE(e&&e.column)}function PE(e){return Py(e&&e.start)+"-"+Py(e&&e.end)}function NE(e){return e&&typeof e=="number"?e:1}var BE=k(()=>{"use strict"});var Ny=k(()=>{"use strict";BE()});var Pt,UE=k(()=>{"use strict";Ny();Pt=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=lo(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}};Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0});var By=k(()=>{"use strict";UE()});function Fy(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=w5(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=g5(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:vE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qE(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function qE(e,t,a){if(t.type==="element")return c5(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return d5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return p5(e,t,a);if(t.type==="mdxjsEsm")return f5(e,t);if(t.type==="root")return m5(e,t,a);if(t.type==="text")return h5(e,t)}function c5(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=jE(e,t.tagName,!1),i=y5(e,t),l=qy(e,t);return s5.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!yy(s):!0})),HE(e,i,o,t),zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function d5(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 f5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function p5(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:jE(e,t.name,!0),i=x5(e,t),l=qy(e,t);return HE(e,i,o,t),zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function m5(e,t,a){let n={};return zy(n,qy(e,t)),e.create(t,e.Fragment,n,a)}function h5(e,t){return t.value}function HE(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function zy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function g5(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 w5(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=yl(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 y5(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Uy.call(t.properties,r)){let o=v5(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&u5.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 x5(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 qy(e,t){let a=[],n=-1,r=e.passKeys?new Map:i5;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=qE(e,o,i);l!==void 0&&a.push(l)}return a}function v5(e,t,a){let n=Dy(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?eE(a):SE(a)),n.property==="style"){let r=typeof a=="object"?a:b5(e,String(a));return e.stylePropertyNameCase==="css"&&(r=S5(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Ry[n.property]||n.property:n.attribute,a]}}function b5(e,t){try{return(0,FE.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Pt("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=zE+"#cannot-parse-style-attribute",r}}function jE(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 Uy.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 Pt("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=zE+"#cannot-handle-mdx-estrees-without-createevaluater",a}function S5(e){let t={},a;for(a in e)Uy.call(e,a)&&(t[I5(a)]=e[a]);return t}function I5(e){let t=e.replace(l5,C5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C5(e){return"-"+e.toLowerCase()}var FE,Uy,i5,l5,s5,u5,zE,VE=k(()=>{"use strict";tE();nE();iE();bE();IE();FE=z(OE(),1);mu();By();Uy={}.hasOwnProperty,i5=new Map,l5=/[A-Z]/g,s5=new Set(["table","tbody","thead","tfoot","tr"]),u5=new Set(["td","th"]),zE="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var WE=k(()=>{"use strict";VE()});function k5(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 Z(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var GE,$E=k(()=>{"use strict";Ot();je();GE={tokenize:k5}});function T5(e){let t=this,a=[],n=0,r,o,i;return l;function l(h){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(h)}return u(h)}function s(h){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 _t(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(h)}return l(h)}function u(h){if(n===a.length){if(!r)return f(h);if(r.currentConstruct&&r.currentConstruct.concrete)return m(h);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(XE,c,d)(h)}function c(h){return r&&y(),w(n),f(h)}function d(h){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(h)}function f(h){return t.containerState={},e.attempt(XE,p,m)(h)}function p(h){return n++,a.push([t.currentConstruct,t.containerState]),f(h)}function m(h){if(h===null){r&&y(),w(0),e.consume(h);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(h)}function x(h){if(h===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(h);return}return Z(h)?(e.consume(h),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(h),x)}function S(h,b){let T=t.sliceStream(h);if(b&&T.push(null),h.previous=o,o&&(o.next=h),o=h,r.defineSkip(h.start),r.write(T),t.parser.lazy[h.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,D=M,P,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(P){L=t.events[D][1].end;break}P=!0}for(w(n),C=M;C<t.events.length;)t.events[C][1].end={...L},C++;_t(t.events,D+1,0,t.events.slice(M)),t.events.length=C}}function w(h){let b=a.length;for(;b-- >h;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=h}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function L5(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 KE,XE,YE=k(()=>{"use strict";Ot();je();gr();KE={tokenize:T5},XE={tokenize:L5}});function E5(e){let t=this,a=e.attempt(zn,n,e.attempt(this.parser.constructs.flowInitial,r,ie(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Qw,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 ZE,QE=k(()=>{"use strict";Uf();Ot();ZE={tokenize:E5}});function aM(e){return{resolveAll:nM(e==="text"?M5: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 nM(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 M5(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 JE,eM,tM,Hy=k(()=>{"use strict";JE={resolveAll:nM()},eM=aM("string"),tM=aM("text")});var jy={};pc(jy,{attentionMarkers:()=>B5,contentInitial:()=>R5,disable:()=>U5,document:()=>A5,flow:()=>_5,flowInitial:()=>D5,insideSpan:()=>N5,string:()=>O5,text:()=>P5});var A5,R5,D5,_5,O5,P5,N5,B5,U5,rM=k(()=>{"use strict";Uf();Hy();A5={42:sa,43:sa,45:sa,48:sa,49:sa,50:sa,51:sa,52:sa,53:sa,54:sa,55:sa,56:sa,57:sa,62:Lf},R5={91:ny},D5={[-2]:vu,[-1]:vu,32:vu},_5={35:oy,42:Jo,45:[Bf,Jo],60:ly,61:Bf,95:Jo,96:Af,126:Af},O5={38:Mf,92:Ef},P5={[-5]:Su,[-4]:Su,[-3]:Su,33:uy,38:Mf,42:xu,60:[Kw,sy],91:cy,92:[ry,Ef],93:Qo,95:xu,96:Yw},N5={null:[xu,JE]},B5={null:[42,95]},U5={null:[]}});function oM(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(D),consume:b,enter:T,exit:C,interrupt:P(D,{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=ga(i,F),y(),i[i.length-1]!==null?[]:(L(t,0),c.events=ro(o,c.events,c),c.events)}function m(F,W){return z5(x(F),W)}function x(F){return F5(i,F)}function S(){let{_bufferIndex:F,_index:W,line:V,column:N,offset:R}=n;return{_bufferIndex:F,_index:W,line:V,column:N,offset:R}}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;)h(W.charCodeAt(n._bufferIndex));else h(W)}}function h(F){s=void 0,f=F,d=d(F)}function b(F){Z(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 D(F,W){W.restore()}function P(F,W){return V;function V(N,R,G){let ue,I,We,Je;return Array.isArray(N)?K(N):"tokenize"in N?K([N]):v(N);function v(me){return ye;function ye(le){let de=le!==null&&me[le],Q=le!==null&&me.null,Be=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return K(Be)(le)}}function K(me){return ue=me,I=0,me.length===0?G:ee(me[I])}function ee(me){return ye;function ye(le){return Je=$(),We=me,me.partial||(c.currentConstruct=me),me.name&&c.parser.constructs.disable.null.includes(me.name)?Ge(le):me.tokenize.call(W?Object.assign(Object.create(c),W):c,u,we,Ge)(le)}}function we(me){return s=!0,F(We,Je),R}function Ge(me){return s=!0,Je.restore(),++I<ue.length?ee(ue[I]):G}}}function L(F,W){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&_t(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,R=Array.from(l);return{from:N,restore:G};function G(){n=F,c.previous=W,c.currentConstruct=V,c.events.length=N,l=R,H()}}function H(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function F5(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 z5(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 rM=k(()=>{"use strict";je();gr();wu()});function Hy(e){let n={constructs:Cf([qy,...(e||{}).extensions||[]]),content:r(VE),defined:[],document:r($E),flow:r(KE),lazy:{},string:r(QE),text:r(JE)};return n;function r(o){return i;function i(l){return nM(n,o,l)}}}var oM=k(()=>{"use strict";jw();WE();XE();YE();zy();aM();rM()});function jy(e){for(;!Rf(e););return e}var iM=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(lM.lastIndex=d,u=lM.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 lM,sM=k(()=>{"use strict";lM=/[\0\t\n\r]/g});var uM=k(()=>{"use strict";oM();iM();sM()});function Wy(e,t,a){return typeof t!="string"&&(a=t,t=void 0),F5(a)(jy(Hy(a).document().write(Vy()(e,t,!0))))}function F5(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(_e),blockQuote:o(le),characterEscape:P,characterReference:P,codeFenced:o(de),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(de,i),codeText:o(Q,i),codeTextData:P,data:P,codeFlowValue:P,definition:o(Be),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(qe),hardBreakEscape:o(Ce),hardBreakTrailing:o(Ce),htmlFlow:o(ye,i),htmlFlowData:P,htmlText:o(ye,i),htmlTextData:P,image:o(Y),label:i,link:o(Oe),listItem:o(ba),listItemValue:f,listOrdered:o(ot,d),listUnordered:o(ot),paragraph:o(Sa),reference:v,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(_e),strong:o(ra),thematicBreak:o(go)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:be,autolinkProtocol:me,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:we,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:h,emphasis:s(),hardBreakEscape:s(H),hardBreakTrailing:s(H),htmlFlow:s(F),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s(D),label:ue,labelText:G,lineEnding:$,link:s(N),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:K,resourceDestinationString:I,resourceTitleString:Ve,resource:et,setextHeading:s(R),setextHeadingLineSequence:M,setextHeadingText:C,strong:s(),thematicBreak:s()}};fM(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(A){let U={type:"root",children:[]},J={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},oe=[],Ae=-1;for(;++Ae<A.length;)if(A[Ae][1].type==="listOrdered"||A[Ae][1].type==="listUnordered")if(A[Ae][0]==="enter")oe.push(Ae);else{let zt=oe.pop();Ae=r(A,zt,Ae)}for(Ae=-1;++Ae<A.length;){let zt=t[A[Ae][0]];dM.call(zt,A[Ae][1].type)&&zt[A[Ae][1].type].call(Object.assign({sliceSerialize:A[Ae][2].sliceSerialize},J),A[Ae][1])}if(J.tokenStack.length>0){let zt=J.tokenStack[J.tokenStack.length-1];(zt[1]||cM).call(J,void 0,zt[0])}for(U.position={start:so(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:so(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)U=t.transforms[Ae](U)||U;return U}function r(A,U,J){let oe=U-1,Ae=-1,zt=!1,Wt,Ia,Vn,gn;for(;++oe<=J;){let Gt=A[oe];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?Ae++:Ae--,gn=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Wt&&!gn&&!Ae&&!Vn&&(Vn=oe),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!Ae&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||Ae===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Wt){let ca=oe;for(Ia=void 0;ca--;){let wn=A[ca];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ia&&(A[Ia][1].type="lineEndingBlank",zt=!0),wn[1].type="lineEnding",Ia=ca}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Vn&&(!Ia||Vn<Ia)&&(Wt._spread=!0),Wt.end=Object.assign({},Ia?A[Ia][1].start:Gt[1].end),A.splice(Ia||oe,0,["exit",Wt,Gt[2]]),oe++,J++}if(Gt[1].type==="listItemPrefix"){let ca={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Wt=ca,A.splice(oe,0,["enter",ca,Gt[2]]),oe++,J++,Vn=void 0,gn=!0}}}return A[U][1]._spread=zt,J}function o(A,U){return J;function J(oe){l.call(this,A(oe),oe),U&&U.call(this,oe)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(A,U,J){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([U,J||void 0]),A.position={start:so(U.start),end:void 0}}function s(A){return U;function U(J){A&&A.call(this,J),u.call(this,J)}}function u(A,U){let J=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==A.type&&(U?U.call(this,A,oe[0]):(oe[1]||cM).call(this,A,oe[0]));else throw new Error("Cannot close `"+A.type+"` ("+lo({start:A.start,end:A.end})+"): it\u2019s not open");J.position.end=so(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(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase()}function h(){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 J=this.sliceSerialize(A).length;U.depth=J}}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 J=this.stack[this.stack.length-1].children,oe=J[J.length-1];(!oe||oe.type!=="text")&&(oe=fi(),oe.position={start:so(A.start),end:void 0},J.push(oe)),this.stack.push(oe)}function L(A){let U=this.stack.pop();U.value+=this.sliceSerialize(A),U.position.end=so(A.end)}function $(A){let U=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=U.children[U.children.length-1];J.position.end=so(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),J=this.stack[this.stack.length-2];J.label=R1(U),J.identifier=la(U).toLowerCase()}function ue(){let A=this.stack[this.stack.length-1],U=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let oe=A.children;J.children=oe}else J.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 et(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function K(A){let U=this.resume(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function ee(A){this.data.characterReferenceType=A.type}function we(A){let U=this.sliceSerialize(A),J=this.data.characterReferenceType,oe;J?(oe=If(U,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Sl(U);let Ae=this.stack[this.stack.length-1];Ae.value+=oe}function We(A){let U=this.stack.pop();U.position.end=so(A.end)}function me(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(A)}function be(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(A)}function le(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Ce(){return{type:"break"}}function ye(){return{type:"html",value:""}}function Y(){return{type:"image",title:null,url:"",alt:null}}function Oe(){return{type:"link",title:null,url:"",children:[]}}function ot(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function ba(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Sa(){return{type:"paragraph",children:[]}}function ra(){return{type:"strong",children:[]}}function fi(){return{type:"text",value:""}}function go(){return{type:"thematicBreak"}}}function so(e){return{line:e.line,column:e.column,offset:e.offset}}function fM(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?fM(e,n):z5(e,n)}}function z5(e,t){let a;for(a in t)if(dM.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 cM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is still open")}var dM,pM=k(()=>{"use strict";xf();uM();Ow();D1();yl();Sf();Oy();dM={}.hasOwnProperty});var mM=k(()=>{"use strict";pM()});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 hM=k(()=>{"use strict";mM()});var gM=k(()=>{"use strict";hM()});function wM(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 yM=k(()=>{"use strict"});function xM(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 iM=k(()=>{"use strict";je();gr();yu()});function Vy(e){let n={constructs:kf([jy,...(e||{}).extensions||[]]),content:r(GE),defined:[],document:r(KE),flow:r(ZE),lazy:{},string:r(eM),text:r(tM)};return n;function r(o){return i;function i(l){return oM(n,o,l)}}}var lM=k(()=>{"use strict";Ww();$E();YE();QE();Hy();rM();iM()});function Wy(e){for(;!Df(e););return e}var sM=k(()=>{"use strict";Zw()});function Gy(){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(uM.lastIndex=d,u=uM.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 uM,cM=k(()=>{"use strict";uM=/[\0\t\n\r]/g});var dM=k(()=>{"use strict";lM();sM();cM()});function $y(e,t,a){return typeof t!="string"&&(a=t,t=void 0),q5(a)(Wy(Vy(a).document().write(Gy()(e,t,!0))))}function q5(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(_e),blockQuote:o(le),characterEscape:P,characterReference:P,codeFenced:o(de),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(de,i),codeText:o(Q,i),codeTextData:P,data:P,codeFlowValue:P,definition:o(Be),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(qe),hardBreakEscape:o(ke),hardBreakTrailing:o(ke),htmlFlow:o(xe,i),htmlFlowData:P,htmlText:o(xe,i),htmlTextData:P,image:o(Y),label:i,link:o(Oe),listItem:o(ba),listItemValue:f,listOrdered:o(rt,d),listUnordered:o(rt),paragraph:o(Sa),reference:v,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(_e),strong:o(ra),thematicBreak:o(wo)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:ye,autolinkProtocol:me,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:we,characterReference:Ge,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:h,emphasis:s(),hardBreakEscape:s(H),hardBreakTrailing:s(H),htmlFlow:s(F),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s(R),label:ue,labelText:G,lineEnding:$,link:s(N),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:K,resourceDestinationString:I,resourceTitleString:We,resource:Je,setextHeading:s(D),setextHeadingLineSequence:M,setextHeadingText:C,strong:s(),thematicBreak:s()}};mM(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(A){let U={type:"root",children:[]},J={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},oe=[],Ae=-1;for(;++Ae<A.length;)if(A[Ae][1].type==="listOrdered"||A[Ae][1].type==="listUnordered")if(A[Ae][0]==="enter")oe.push(Ae);else{let zt=oe.pop();Ae=r(A,zt,Ae)}for(Ae=-1;++Ae<A.length;){let zt=t[A[Ae][0]];pM.call(zt,A[Ae][1].type)&&zt[A[Ae][1].type].call(Object.assign({sliceSerialize:A[Ae][2].sliceSerialize},J),A[Ae][1])}if(J.tokenStack.length>0){let zt=J.tokenStack[J.tokenStack.length-1];(zt[1]||fM).call(J,void 0,zt[0])}for(U.position={start:so(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:so(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)U=t.transforms[Ae](U)||U;return U}function r(A,U,J){let oe=U-1,Ae=-1,zt=!1,Wt,Ia,Vn,gn;for(;++oe<=J;){let Gt=A[oe];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?Ae++:Ae--,gn=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Wt&&!gn&&!Ae&&!Vn&&(Vn=oe),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!Ae&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||Ae===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Wt){let ca=oe;for(Ia=void 0;ca--;){let wn=A[ca];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ia&&(A[Ia][1].type="lineEndingBlank",zt=!0),wn[1].type="lineEnding",Ia=ca}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Vn&&(!Ia||Vn<Ia)&&(Wt._spread=!0),Wt.end=Object.assign({},Ia?A[Ia][1].start:Gt[1].end),A.splice(Ia||oe,0,["exit",Wt,Gt[2]]),oe++,J++}if(Gt[1].type==="listItemPrefix"){let ca={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Wt=ca,A.splice(oe,0,["enter",ca,Gt[2]]),oe++,J++,Vn=void 0,gn=!0}}}return A[U][1]._spread=zt,J}function o(A,U){return J;function J(oe){l.call(this,A(oe),oe),U&&U.call(this,oe)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(A,U,J){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([U,J||void 0]),A.position={start:so(U.start),end:void 0}}function s(A){return U;function U(J){A&&A.call(this,J),u.call(this,J)}}function u(A,U){let J=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==A.type&&(U?U.call(this,A,oe[0]):(oe[1]||fM).call(this,A,oe[0]));else throw new Error("Cannot close `"+A.type+"` ("+lo({start:A.start,end:A.end})+"): it\u2019s not open");J.position.end=so(A.end)}function c(){return Xo(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(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase()}function h(){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 J=this.sliceSerialize(A).length;U.depth=J}}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 D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(A){let J=this.stack[this.stack.length-1].children,oe=J[J.length-1];(!oe||oe.type!=="text")&&(oe=pi(),oe.position={start:so(A.start),end:void 0},J.push(oe)),this.stack.push(oe)}function L(A){let U=this.stack.pop();U.value+=this.sliceSerialize(A),U.position.end=so(A.end)}function $(A){let U=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=U.children[U.children.length-1];J.position.end=so(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 R(){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),J=this.stack[this.stack.length-2];J.label=_1(U),J.identifier=la(U).toLowerCase()}function ue(){let A=this.stack[this.stack.length-1],U=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let oe=A.children;J.children=oe}else J.alt=U}function I(){let A=this.resume(),U=this.stack[this.stack.length-1];U.url=A}function We(){let A=this.resume(),U=this.stack[this.stack.length-1];U.title=A}function Je(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function K(A){let U=this.resume(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function ee(A){this.data.characterReferenceType=A.type}function we(A){let U=this.sliceSerialize(A),J=this.data.characterReferenceType,oe;J?(oe=Cf(U,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Il(U);let Ae=this.stack[this.stack.length-1];Ae.value+=oe}function Ge(A){let U=this.stack.pop();U.position.end=so(A.end)}function me(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(A)}function ye(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(A)}function le(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function xe(){return{type:"html",value:""}}function Y(){return{type:"image",title:null,url:"",alt:null}}function Oe(){return{type:"link",title:null,url:"",children:[]}}function rt(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function ba(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Sa(){return{type:"paragraph",children:[]}}function ra(){return{type:"strong",children:[]}}function pi(){return{type:"text",value:""}}function wo(){return{type:"thematicBreak"}}}function so(e){return{line:e.line,column:e.column,offset:e.offset}}function mM(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?mM(e,n):H5(e,n)}}function H5(e,t){let a;for(a in t)if(pM.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 fM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is still open")}var pM,hM=k(()=>{"use strict";vf();dM();Nw();O1();xl();If();Ny();pM={}.hasOwnProperty});var gM=k(()=>{"use strict";hM()});function Yf(e){let t=this;t.parser=a;function a(n){return $y(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var wM=k(()=>{"use strict";gM()});var yM=k(()=>{"use strict";wM()});function xM(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 vM=k(()=>{"use strict"});function bM(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
+
`}]}var SM=k(()=>{"use strict"});function IM(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 CM=k(()=>{"use strict"});function kM(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var TM=k(()=>{"use strict"});function LM(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var EM=k(()=>{"use strict"});function MM(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=un(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 AM=k(()=>{"use strict";Yo()});function RM(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 DM=k(()=>{"use strict"});function _M(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var OM=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 Xy=k(()=>{"use strict"});function PM(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Zf(e,t);let r={src:un(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 NM=k(()=>{"use strict";Yo();Xy()});function BM(e,t){let a={src:un(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 UM=k(()=>{"use strict";Yo()});function FM(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 zM=k(()=>{"use strict"});function qM(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return Zf(e,t);let r={href:un(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 HM=k(()=>{"use strict";Yo();Xy()});function jM(e,t){let a={href:un(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 VM=k(()=>{"use strict";Yo()});function WM(e,t,a){let n=e.all(t),r=a?j5(a):GM(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 j5(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=GM(a[n])}return t}function GM(e){let t=e.spread;return t??e.children.length>1}var $M=k(()=>{"use strict"});function XM(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 KM=k(()=>{"use strict"});function YM(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var ZM=k(()=>{"use strict"});function QM(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var JM=k(()=>{"use strict"});function eA(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var tA=k(()=>{"use strict"});function aA(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=yl(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 nA=k(()=>{"use strict";mu()});function rA(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 oA=k(()=>{"use strict"});function iA(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var lA=k(()=>{"use strict"});function uA(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(sA(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(sA(t.slice(r),r>0,!1)),o.join("")}function sA(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 cA=k(()=>{"use strict"});function dA(e,t){let a={type:"text",value:uA(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var fA=k(()=>{"use strict";cA()});function pA(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var mA=k(()=>{"use strict"});function Qf(){}var hA,gA=k(()=>{"use strict";vM();SM();CM();TM();EM();AM();DM();OM();NM();UM();zM();HM();VM();$M();KM();ZM();JM();tA();nA();oA();lA();fA();mA();hA={blockquote:xM,break:bM,code:IM,delete:kM,emphasis:LM,footnoteReference:MM,heading:RM,html:_M,imageReference:PM,image:BM,inlineCode:FM,linkReference:qM,link:jM,listItem:WM,list:XM,paragraph:YM,root:QM,strong:eA,table:aA,tableCell:iA,tableRow:rA,text:dA,thematicBreak:pA,toml:Qf,yaml:Qf,definition:Qf,footnoteDefinition:Qf}});function V5(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 W5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wA(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||V5,n=e.options.footnoteBackLabel||W5,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=un(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:{...eo(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 yA=k(()=>{"use strict";mf();Yo()});function vA(e,t){let a=t||G5,n=new Map,r=new Map,o=new Map,i={...hA,...a.handlers},l={all:u,applyData:X5,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:i,one:s,options:a,patch:$5,wrap:Y5};return mr(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(Ky.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=eo(S);return w.children=l.all(c),w}return eo(c)}return(l.options.unknownHandler||K5)(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=xA(m.value)),!Array.isArray(m)&&m.type==="element")){let x=m.children[0];x&&x.type==="text"&&(x.value=xA(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function $5(e,t){e.position&&(t.position=pu(e))}function X5(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,eo(o)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function K5(e,t){let a=t.data||{},n="value"in t&&!(Ky.call(a,"hProperties")||Ky.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 Y5(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 vA=k(()=>{"use strict";gA();xA()});var bA=k(()=>{"use strict";vA()});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 SA=k(()=>{"use strict";bA()});var IA=k(()=>{"use strict";SA()});function Xy(e){if(e)throw e}var CA=k(()=>{"use strict"});var _A=oa((bre,DA)=>{"use strict";var ep=Object.prototype.hasOwnProperty,RA=Object.prototype.toString,kA=Object.defineProperty,TA=Object.getOwnPropertyDescriptor,LA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):RA.call(t)==="[object Array]"},EA=function(t){if(!t||RA.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)},MA=function(t,a){kA&&a.name==="__proto__"?kA(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},AA=function(t,a){if(a==="__proto__")if(ep.call(t,a)){if(TA)return TA(t,a).value}else return;return t[a]};DA.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=AA(l,a),r=AA(t,a),l!==r&&(c&&r&&(EA(r)||(o=LA(r)))?(o?(o=!1,i=n&&LA(n)?n:[]):i=n&&EA(n)?n:{},MA(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&MA(l,{name:a,newValue:r}));return l}});function Lu(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 OA=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?PA(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 PA(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 NA=k(()=>{"use strict"});var BA=k(()=>{"use strict";NA()});function K5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Eu(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 Y5(e){if(Eu(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 Z5(e){Eu(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 Q5(...e){let t=-1,a;for(;++t<e.length;)Eu(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":J5(a)}function J5(e){Eu(e);let t=e.codePointAt(0)===47,a=eH(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function eH(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 Eu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var In,UA=k(()=>{"use strict";In={basename:K5,dirname:Y5,extname:Z5,join:Q5,sep:"/"}});function tH(){return"/"}var FA,zA=k(()=>{"use strict";FA={cwd:tH}});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 qA(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 aH(e)}function aH(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 HA=k(()=>{"use strict";Yy();Yy()});function Qy(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function Jy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Zy,Mu,VA=k(()=>{"use strict";Py();UA();zA();HA();Zy=["history","path","basename","stem","extname","dirname"],Mu=class{constructor(t){let a;t?kl(t)?a={path:t}:typeof t=="string"||nH(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":FA.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"?In.basename(this.path):void 0}set basename(t){Jy(t,"basename"),Qy(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){jA(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(Qy(t,"extname"),jA(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=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){kl(t)&&(t=qA(t)),Jy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){Jy(t,"stem"),Qy(t,"stem"),this.path=In.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 Pt(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 WA=k(()=>{"use strict";VA()});var GA,$A=k(()=>{"use strict";GA=(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 XA(e){if(!Lu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function KA(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tp(e){return oH(e)?e:new Mu(e)}function oH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iH(e){return typeof e=="string"||lH(e)}function lH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ap,rH,nx,rx,YA=k(()=>{"use strict";CA();ap=z(_A(),1);OA();BA();WA();$A();rH={}.hasOwnProperty,nx=class e extends GA{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):rH.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);iH(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),KA("processSync","process",a),n;function r(o,i){a=!0,Xy(o),n=i}}run(t,a,n){XA(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),KA("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),XA(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];Lu(x)&&Lu(p)&&(p=(0,ap.default)(!0,x,p)),n[f]=[u,p,...m]}}}},rx=new nx().freeze()});var ZA=k(()=>{"use strict";YA()});function sx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function rR(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(wa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function xr(e,t){if(t){if(wa.escapeTest.test(e))return e.replace(wa.escapeReplace,eR)}else if(wa.escapeTestNoEncode.test(e))return e.replace(wa.escapeReplaceNoEncode,eR);return e}function tR(e){try{e=encodeURI(e).replace(wa.percentDecode,"%")}catch{return null}return e}function aR(e,t){let a=e.replace(wa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(wa.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(wa.slashPipe,"|");return n}function Ru(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 HH(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 nR(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 jH(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 xA(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var Ky,G5,bA=k(()=>{"use strict";mf();df();mu();gA();Ky={}.hasOwnProperty,G5={}});function Jf(e,t){let a=vA(e,t),n=a.one(e,void 0),r=wA(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 SA=k(()=>{"use strict";yA();bA()});var IA=k(()=>{"use strict";SA()});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 CA=k(()=>{"use strict";IA()});var kA=k(()=>{"use strict";CA()});function Yy(e){if(e)throw e}var TA=k(()=>{"use strict"});var PA=oa((Ire,OA)=>{"use strict";var tp=Object.prototype.hasOwnProperty,_A=Object.prototype.toString,LA=Object.defineProperty,EA=Object.getOwnPropertyDescriptor,MA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_A.call(t)==="[object Array]"},AA=function(t){if(!t||_A.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)},RA=function(t,a){LA&&a.name==="__proto__"?LA(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},DA=function(t,a){if(a==="__proto__")if(tp.call(t,a)){if(EA)return EA(t,a).value}else return;return t[a]};OA.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=DA(l,a),r=DA(t,a),l!==r&&(c&&r&&(AA(r)||(o=MA(r)))?(o?(o=!1,i=n&&MA(n)?n:[]):i=n&&AA(n)?n:{},RA(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&RA(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 NA=k(()=>{"use strict"});function Zy(){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?BA(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 BA(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 UA=k(()=>{"use strict"});var FA=k(()=>{"use strict";UA()});function Z5(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 Q5(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 J5(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 eH(...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?".":tH(a)}function tH(e){Mu(e);let t=e.codePointAt(0)===47,a=aH(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function aH(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 In,zA=k(()=>{"use strict";In={basename:Z5,dirname:Q5,extname:J5,join:eH,sep:"/"}});function nH(){return"/"}var qA,HA=k(()=>{"use strict";qA={cwd:nH}});function Tl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Qy=k(()=>{"use strict"});function jA(e){if(typeof e=="string")e=new URL(e);else if(!Tl(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 rH(e)}function rH(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 VA=k(()=>{"use strict";Qy();Qy()});function ex(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function tx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function WA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function oH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Jy,Au,GA=k(()=>{"use strict";By();zA();HA();VA();Jy=["history","path","basename","stem","extname","dirname"],Au=class{constructor(t){let a;t?Tl(t)?a={path:t}:typeof t=="string"||oH(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":qA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Jy.length;){let o=Jy[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)Jy.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(t){tx(t,"basename"),ex(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){WA(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(ex(t,"extname"),WA(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=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tl(t)&&(t=jA(t)),tx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){tx(t,"stem"),ex(t,"stem"),this.path=In.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 Pt(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 $A=k(()=>{"use strict";GA()});var XA,KA=k(()=>{"use strict";XA=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function ax(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function nx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rx(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 YA(e){if(!Eu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ZA(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ap(e){return lH(e)?e:new Au(e)}function lH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sH(e){return typeof e=="string"||uH(e)}function uH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var np,iH,ox,ix,QA=k(()=>{"use strict";TA();np=z(PA(),1);NA();FA();$A();KA();iH={}.hasOwnProperty,ox=class e extends XA{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=Zy()}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?(rx("data",this.frozen),this.namespace[t]=a,this):iH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(rx("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 ax("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),ax("process",this.parser||this.Parser),nx("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);sH(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(),ax("processSync",this.parser||this.Parser),nx("processSync",this.compiler||this.Compiler),this.process(t,r),ZA("processSync","process",a),n;function r(o,i){a=!0,Yy(o),n=i}}run(t,a,n){YA(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),ZA("runSync","run",n),r;function o(i,l){Yy(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=ap(a),r=this.compiler||this.Compiler;return nx("stringify",r),YA(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(rx("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]}}}},ix=new ox().freeze()});var JA=k(()=>{"use strict";QA()});function cx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function iR(e){ii=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(wa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function xr(e,t){if(t){if(wa.escapeTest.test(e))return e.replace(wa.escapeReplace,aR)}else if(wa.escapeTestNoEncode.test(e))return e.replace(wa.escapeReplaceNoEncode,aR);return e}function nR(e){try{e=encodeURI(e).replace(wa.percentDecode,"%")}catch{return null}return e}function rR(e,t){let a=e.replace(wa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(wa.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(wa.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 VH(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 oR(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 WH(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
55
|
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[l]=i;return l.length>=r.length?o.slice(r.length):o}).join(`
|
|
56
|
-
`)}function
|
|
57
|
-
]`).replace("lheading",
|
|
58
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=
|
|
59
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=
|
|
56
|
+
`)}function lt(e,t){return oi.parse(e,t)}var ii,Ou,cH,wa,dH,fH,pH,Pu,mH,dx,lR,sR,hH,fx,gH,px,wH,yH,up,mx,xH,uR,vH,hx,eR,bH,SH,IH,CH,cR,kH,cp,gx,dR,TH,fR,LH,EH,MH,pR,AH,RH,mR,DH,_H,OH,PH,NH,BH,UH,ip,FH,hR,gR,zH,tR,wx,qH,lx,HH,rp,Ru,jH,aR,lp,Xa,sp,yx,Cn,op,_u,GH,oi,Yre,Zre,Qre,Jre,eoe,toe,aoe,wR=k(()=>{"use strict";ii=cx();Ou={exec:()=>null};cH=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),wa={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")},dH=/^(?:[ \t]*(?:\n|$))+/,fH=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pH=/^ {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+|$)/,mH=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,dx=/(?:[*+-]|\d{1,9}[.)])/,lR=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sR=Xe(lR).replace(/bull/g,dx).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(),hH=Xe(lR).replace(/bull/g,dx).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(),fx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,gH=/^[^\n]+/,px=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wH=Xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",px).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yH=Xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,dx).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",mx=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xH=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",mx).replace("tag",up).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),uR=Xe(fx).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(),vH=Xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",uR).getRegex(),hx={blockquote:vH,code:fH,def:wH,fences:pH,heading:mH,hr:Pu,html:xH,lheading:sR,list:yH,newline:dH,paragraph:uR,table:Ou,text:gH},eR=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(),bH={...hx,lheading:hH,table:eR,paragraph:Xe(fx).replace("hr",Pu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",eR).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()},SH={...hx,html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mx).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(fx).replace("hr",Pu).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",sR).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IH=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,CH=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cR=/^( {2,}|\\)\n(?!\s*$)/,kH=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cp=/[\p{P}\p{S}]/u,gx=/[\s\p{P}\p{S}]/u,dR=/[^\s\p{P}\p{S}]/u,TH=Xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gx).getRegex(),fR=/(?!~)[\p{P}\p{S}]/u,LH=/(?!~)[\s\p{P}\p{S}]/u,EH=/(?:[^\s\p{P}\p{S}]|~)/u,MH=Xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cH?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pR=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,AH=Xe(pR,"u").replace(/punct/g,cp).getRegex(),RH=Xe(pR,"u").replace(/punct/g,fR).getRegex(),mR="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",DH=Xe(mR,"gu").replace(/notPunctSpace/g,dR).replace(/punctSpace/g,gx).replace(/punct/g,cp).getRegex(),_H=Xe(mR,"gu").replace(/notPunctSpace/g,EH).replace(/punctSpace/g,LH).replace(/punct/g,fR).getRegex(),OH=Xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dR).replace(/punctSpace/g,gx).replace(/punct/g,cp).getRegex(),PH=Xe(/\\(punct)/,"gu").replace(/punct/g,cp).getRegex(),NH=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(),BH=Xe(mx).replace("(?:-->|$)","-->").getRegex(),UH=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",BH).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ip=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,FH=Xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ip).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hR=Xe(/^!?\[(label)\]\[(ref)\]/).replace("label",ip).replace("ref",px).getRegex(),gR=Xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",px).getRegex(),zH=Xe("reflink|nolink(?!\\()","g").replace("reflink",hR).replace("nolink",gR).getRegex(),tR=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wx={_backpedal:Ou,anyPunctuation:PH,autolink:NH,blockSkip:MH,br:cR,code:CH,del:Ou,emStrongLDelim:AH,emStrongRDelimAst:DH,emStrongRDelimUnd:OH,escape:IH,link:FH,nolink:gR,punctuation:TH,reflink:hR,reflinkSearch:zH,tag:UH,text:kH,url:Ou},qH={...wx,link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",ip).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ip).getRegex()},lx={...wx,emStrongRDelimAst:_H,emStrongLDelim:RH,url:Xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",tR).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",tR).getRegex()},HH={...lx,br:Xe(cR).replace("{2,}","*").getRegex(),text:Xe(lx.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},rp={normal:hx,gfm:bH,pedantic:SH},Ru={normal:wx,gfm:lx,breaks:HH,pedantic:qH},jH={"&":"&","<":"<",">":">",'"':""","'":"'"},aR=e=>jH[e];lp=class{constructor(e){re(this,"options");re(this,"rules");re(this,"lexer");this.options=e||ii}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=WH(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
|
+
`)}}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(`
|
|
62
62
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -74,9 +74,9 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
74
74
|
`,1)[0],T;if(f=b,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),w.test(f)||y.test(f)||h.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=
|
|
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=rR(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(rR(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=VH(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)),oR(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 oR(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}}}},Xa=class sx{constructor(t){re(this,"tokens");re(this,"options");re(this,"state");re(this,"inlineQueue");re(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ii,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:wa,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 sx(a).lex(t)}static lexInline(t,a){return new sx(a).inlineTokens(t)}lex(t){t=t.replace(wa.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(wa.tabCharGlobal," ").replace(wa.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){re(this,"options");re(this,"parser");this.options=e||ii}space(e){return""}code({text:e,lang:t,escaped:a}){let n=(t||"").match(wa.notSpaceStart)?.[0],r=e.replace(wa.endingNewline,"")+`
|
|
94
94
|
`;return n?'<pre><code class="language-'+xr(n)+'">'+(a?r:xr(r,!0))+`</code></pre>
|
|
95
95
|
`:"<pre><code>"+(a?r:xr(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>${xr(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>"+xr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},
|
|
113
|
-
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,kn.useState)(l);return(0,kn.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,Da.jsx)(wx.Provider,{value:{code:e},children:(0,Da.jsxs)($H,{language:t,children:[(0,Da.jsx)(XH,{language:t,children:n}),(0,Da.jsx)(GH,{className:a,language:t,result:s,...r})]})})}});var xR={};fc(xR,{Mermaid:()=>yx});var vR=k(()=>{"use strict";"use client";cp()});function JH(e={}){let{immediate:t=!1,debounceDelay:a=YH,rootMargin:n=ZH,idleTimeout:r=QH}=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=h=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),h.disconnect()):u.current=d(()=>{i(!0),h.disconnect()},{timeout:r/2})},{timeout:r})},S=h=>{m(),s.current=window.setTimeout(()=>{var b,T;let C=h.takeRecords();(C.length===0||(T=(b=C.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(h)},a)},w=(h,b)=>{h.isIntersecting?S(b):m()},y=new IntersectionObserver(h=>{for(let b of h)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 Lt(e,t){return e.className===t.className&&mp(e.node,t.node)}var _,E,YH,ZH,QH,Cx,kx,pp,e6,t6,a6,ER,bR,n6,r6,ce,Tl,wx,MR,SR,IR,o6,CR,i6,l6,Pu,s6,u6,c6,Sx,AR,yR,Tx,d6,f6,Nu,p6,m6,h6,RR,DR,g6,xx,w6,y6,x6,v6,b6,S6,I6,Ix,dp,Lx,_R,OR,PR,NR,C6,BR,UR,FR,zR,qR,HR,jR,VR,WR,GR,$R,XR,KR,YR,ZR,QR,JR,k6,e2,t2,a2,T6,kR,TR,fp,L6,LR,n2,E6,M6,A6,R6,D6,_6,O6,vx,P6,bx,r2,o2,i2,N6,B6,U6,F6,ya,Ex,z6,Ll,q6,yx,cp=k(()=>{"use strict";"use client";_=z(he(),1);Bk();Fk();rT();BL();ZL();E=z(re(),1);Xg();Yg();jE();gM();IA();ZA();hR();YH=300,ZH="300px",QH=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"})}),e6=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"})]}),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:"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"})}),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:"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"})}),ER=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"})}),bR=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"})}),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:"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"})}),r6=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)=>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:""}),MR=()=>(0,_.useContext)(wx),SR=({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}=MR(),{isAnimating:d}=(0,_.useContext)(ya),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: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})})},IR={"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"},o6=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=MR(),{isAnimating:s}=(0,_.useContext)(ya),u=o??l,c=`file.${a&&a in IR?IR[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)(pp,{size:14})})},CR=()=>(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)(e6,{className:"size-4 animate-spin"})})]}),i6=/\.[^/.]+$/,l6=({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(i6,"")}.${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)(pp,{size:14})})]}):null},Pu=0,s6=()=>{Pu+=1,Pu===1&&(document.body.style.overflow="hidden")},u6=()=>{Pu=Math.max(0,Pu-1),Pu===0&&(document.body.style.overflow="")},c6=({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){s6();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),u6()}}},[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)(ER,{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)(bR,{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)(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)(bR,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Sx=(0,_.createContext)(null),AR=()=>(0,_.useContext)(Sx),yR=()=>{var e;let t=AR();return(e=t?.code)!=null?e:null},Tx=()=>{var e;let t=AR();return(e=t?.mermaid)!=null?e:null},d6=(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})},f6=({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)(ya),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 d6(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)(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]})},Nu=0,p6=()=>{Nu+=1,Nu===1&&(document.body.style.overflow="hidden")},m6=()=>{Nu=Math.max(0,Nu-1),Nu===0&&(document.body.style.overflow="")},h6=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(ya),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){p6();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),m6()}}},[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)(t6,{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)(ER,{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]})},RR=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}},DR=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>${xr(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=nR(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+xr(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=nR(e);if(r===null)return xr(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${xr(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:xr(e.text)}},yx=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}},Cn=class ux{constructor(t){re(this,"options");re(this,"renderer");re(this,"textRenderer");this.options=t||ii,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 yx}static parse(t,a){return new ux(a).parse(t)}static parseInline(t,a){return new ux(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){re(this,"options");re(this,"block");this.options=e||ii}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Xa.lex:Xa.lexInline}provideParser(){return this.block?Cn.parse:Cn.parseInline}},re(op,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),re(op,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),op),GH=class{constructor(...e){re(this,"defaults",cx());re(this,"options",this.setOptions);re(this,"parse",this.parseMarkdown(!0));re(this,"parseInline",this.parseMarkdown(!1));re(this,"Parser",Cn);re(this,"Renderer",sp);re(this,"TextRenderer",yx);re(this,"Lexer",Xa);re(this,"Tokenizer",lp);re(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 Xa.lex(e,t??this.defaults)}parser(e,t){return Cn.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?Xa.lex:Xa.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?Cn.parse:Cn.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?Xa.lex:Xa.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?Cn.parse:Cn.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>"+xr(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},oi=new GH;lt.options=lt.setOptions=function(e){return oi.setOptions(e),lt.defaults=oi.defaults,iR(lt.defaults),lt};lt.getDefaults=cx;lt.defaults=ii;lt.use=function(...e){return oi.use(...e),lt.defaults=oi.defaults,iR(lt.defaults),lt};lt.walkTokens=function(e,t){return oi.walkTokens(e,t)};lt.parseInline=oi.parseInline;lt.Parser=Cn;lt.parser=Cn.parse;lt.Renderer=sp;lt.TextRenderer=yx;lt.Lexer=Xa;lt.lexer=Xa.lex;lt.Tokenizer=lp;lt.Hooks=_u;lt.parse=lt;Yre=lt.options,Zre=lt.setOptions,Qre=lt.use,Jre=lt.walkTokens,eoe=lt.parseInline,toe=Cn.parse,aoe=Xa.lex});var yR={};pc(yR,{CodeBlock:()=>ZH});var kn,Da,$H,XH,KH,YH,ZH,xR=k(()=>{"use strict";"use client";dp();kn=z(he(),1),Da=z(ae(),1),$H=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"),XH=(0,kn.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,kn.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,Da.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,Da.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((i,l)=>(0,Da.jsx)("span",{className:$H,children:i.map((s,u)=>(0,Da.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),KH=({className:e,language:t,style:a,...n})=>(0,Da.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}),YH=({language:e,children:t})=>(0,Da.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,Da.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,Da.jsx)("div",{className:"flex items-center gap-2",children:t})]}),ZH=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,kn.useContext)(ya),i=vR(),l=(0,kn.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
113
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[s,u]=(0,kn.useState)(l);return(0,kn.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,Da.jsx)(xx.Provider,{value:{code:e},children:(0,Da.jsxs)(KH,{language:t,children:[(0,Da.jsx)(YH,{language:t,children:n}),(0,Da.jsx)(XH,{className:a,language:t,result:s,...r})]})})}});var bR={};pc(bR,{Mermaid:()=>vx});var SR=k(()=>{"use strict";"use client";dp()});function t6(e={}){let{immediate:t=!1,debounceDelay:a=QH,rootMargin:n=JH,idleTimeout:r=e6}=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=h=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),h.disconnect()):u.current=d(()=>{i(!0),h.disconnect()},{timeout:r/2})},{timeout:r})},S=h=>{m(),s.current=window.setTimeout(()=>{var b,T;let C=h.takeRecords();(C.length===0||(T=(b=C.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(h)},a)},w=(h,b)=>{h.isIntersecting?S(b):m()},y=new IntersectionObserver(h=>{for(let b of h)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 Lt(e,t){return e.className===t.className&&hp(e.node,t.node)}var _,E,QH,JH,e6,Tx,Lx,mp,a6,n6,r6,AR,IR,o6,i6,ce,Ll,xx,RR,CR,kR,l6,TR,s6,u6,Nu,c6,d6,f6,Cx,DR,vR,Ex,p6,m6,Bu,h6,g6,w6,_R,OR,y6,bx,x6,v6,b6,S6,I6,C6,k6,kx,fp,Mx,PR,NR,BR,UR,T6,FR,zR,qR,HR,jR,VR,WR,GR,$R,XR,KR,YR,ZR,QR,JR,e2,t2,L6,a2,n2,r2,E6,LR,ER,pp,M6,MR,o2,A6,R6,D6,_6,O6,P6,N6,Sx,B6,Ix,i2,l2,s2,U6,F6,z6,q6,ya,Ax,H6,El,j6,vx,dp=k(()=>{"use strict";"use client";_=z(he(),1);Fk();qk();iT();FL();JL();E=z(ae(),1);Yg();Qg();WE();yM();kA();JA();wR();QH=300,JH="300px",e6=500;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:"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"})}),Lx=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"})}),a6=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"})]}),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:"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"})}),r6=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"})}),AR=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"})}),IR=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"})}),o6=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"})}),i6=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)=>Zg(af(e)),Ll=(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)},xx=(0,_.createContext)({code:""}),RR=()=>(0,_.useContext)(xx),CR=({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}=RR(),{isAnimating:d}=(0,_.useContext)(ya),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?Tx:Lx;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})})},kR={"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"},l6=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=RR(),{isAnimating:s}=(0,_.useContext)(ya),u=o??l,c=`file.${a&&a in kR?kR[a]:"txt"}`,d="text/plain",f=()=>{try{Ll(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})})},TR=()=>(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)(a6,{className:"size-4 animate-spin"})})]}),s6=/\.[^/.]+$/,u6=({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(s6,"")}.${f}`}Ll(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,c6=()=>{Nu+=1,Nu===1&&(document.body.style.overflow="hidden")},d6=()=>{Nu=Math.max(0,Nu-1),Nu===0&&(document.body.style.overflow="")},f6=({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){c6();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),d6()}}},[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)(AR,{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)(IR,{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)(Tx,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Lx,{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)(IR,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Cx=(0,_.createContext)(null),DR=()=>(0,_.useContext)(Cx),vR=()=>{var e;let t=DR();return(e=t?.code)!=null?e:null},Ex=()=>{var e;let t=DR();return(e=t?.mermaid)!=null?e:null},p6=(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})},m6=({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)(ya),c=Ex(),d=async f=>{try{if(f==="mmd"){Ll("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"){Ll("diagram.svg",S,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let w=await p6(S);Ll("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,h6=()=>{Bu+=1,Bu===1&&(document.body.style.overflow="hidden")},g6=()=>{Bu=Math.max(0,Bu-1),Bu===0&&(document.body.style.overflow="")},w6=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(ya),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){h6();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),g6()}}},[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)(n6,{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)(AR,{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)(vx,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},_R=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}},OR=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
|
+
`)},y6=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
|
-
`)},y6=({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)(ya),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 h=RR(y),b=m==="csv"?DR(h):g6(h),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: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]})},x6=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useRef)(null),{isAnimating:l}=(0,_.useContext)(ya),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=RR(f),m=u==="csv"?DR(p):w6(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)(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]})},v6=({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)(y6,{}),(0,E.jsx)(x6,{})]}):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})})]}),b6=(0,_.lazy)(()=>Promise.resolve().then(()=>(wR(),gR)).then(e=>({default:e.CodeBlock}))),S6=(0,_.lazy)(()=>Promise.resolve().then(()=>(vR(),xR)).then(e=>({default:e.Mermaid}))),I6=/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:ce("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Lt(e,t));Lx.displayName="MarkdownOl";_R=(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&&mp(e.node,t.node));_R.displayName="MarkdownLi";OR=(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)=>Lt(e,t));OR.displayName="MarkdownUl";PR=(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)=>Lt(e,t));PR.displayName="MarkdownHr";NR=(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)=>Lt(e,t));NR.displayName="MarkdownStrong";C6=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(ya),[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)(c6,{...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})},BR=(0,_.memo)(C6,(e,t)=>Lt(e,t)&&e.href===t.href);BR.displayName="MarkdownA";UR=(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)=>Lt(e,t));UR.displayName="MarkdownH1";FR=(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)=>Lt(e,t));FR.displayName="MarkdownH2";zR=(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)=>Lt(e,t));zR.displayName="MarkdownH3";qR=(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)=>Lt(e,t));qR.displayName="MarkdownH4";HR=(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)=>Lt(e,t));HR.displayName="MarkdownH5";jR=(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)=>Lt(e,t));jR.displayName="MarkdownH6";VR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(ya),o=Ix(r,"table");return(0,E.jsx)(v6,{className:t,showControls:o,...n,children:e})},(e,t)=>Lt(e,t));VR.displayName="MarkdownTable";WR=(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)=>Lt(e,t));WR.displayName="MarkdownThead";GR=(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)=>Lt(e,t));GR.displayName="MarkdownTbody";$R=(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)=>Lt(e,t));$R.displayName="MarkdownTr";XR=(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)=>Lt(e,t));XR.displayName="MarkdownTh";KR=(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)=>Lt(e,t));KR.displayName="MarkdownTd";YR=(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)=>Lt(e,t));YR.displayName="MarkdownBlockquote";ZR=(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)=>Lt(e,t));ZR.displayName="MarkdownSup";QR=(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)=>Lt(e,t));QR.displayName="MarkdownSub";JR=(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)=>Lt(e,t));JR.displayName="MarkdownSection";k6=({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)(ya),c=Tx();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(I6),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"),h=dp(u,"panZoom"),b=x&&(S||w||y);return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(CR,{}),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)(f6,{chart:p,config:s?.config}):null,w?(0,E.jsx)(SR,{code:p}):null,y?(0,E.jsx)(h6,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(S6,{chart:p,config:s?.config,showControls:h})]})})}let m=Ix(u,"code");return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(CR,{}),children:(0,E.jsx)(b6,{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)(o6,{code:p,language:f}),(0,E.jsx)(SR,{})]}):null})})},e2=(0,_.memo)(k6,(e,t)=>e.className===t.className&&mp(e.node,t.node));e2.displayName="MarkdownCode";t2=(0,_.memo)(l6,(e,t)=>e.className===t.className&&mp(e.node,t.node));t2.displayName="MarkdownImg";a2=(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)=>Lt(e,t));a2.displayName="MarkdownParagraph";T6={ol:Lx,li:_R,ul:OR,hr:PR,strong:NR,a:BR,h1:UR,h2:FR,h3:zR,h4:qR,h5:HR,h6:jR,table:VR,thead:WR,tbody:GR,tr:$R,th:XR,td:KR,blockquote:YR,code:e2,img:t2,pre:({children:e})=>e,sup:ZR,sub:QR,p:a2,section:JR},kR=[],TR={allowDangerousHtml:!0},fp=new WeakMap,L6=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()}},LR=new L6,n2=e=>{let t=E6(e),a=e.children||"";return A6(t.runSync(t.parse(a),a),e)},E6=e=>{let t=LR.get(e);if(t)return t;let a=M6(e);return LR.set(e,a),a},M6=e=>{let t=e.rehypePlugins||kR,a=e.remarkPlugins||kR,n=e.remarkRehypeOptions?{...TR,...e.remarkRehypeOptions}:TR;return rx().use(Kf).use(a).use(Jf,n).use(t)},A6=(e,t)=>By(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),R6=/\[\^[^\]\s]{1,200}\](?!:)/,D6=/\[\^[^\]\s]{1,200}\]:/,_6=/<\/(\w+)>/,O6=/<(\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},r2=e=>{let t=R6.test(e),a=D6.test(e);if(t||a)return[e];let n=Xa.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(_6);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(O6);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&&P6(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},o2={raw:Uk,sanitize:[hf,{}],harden:[Nk,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},i2={gfm:[zf,{}]},N6=Object.values(o2),B6=Object.values(i2),U6={block:" \u258B",circle:" \u25CF"},F6={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ya=(0,_.createContext)(F6),Ex=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(n2,{...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";z6=["github-light","github-dark"],Ll=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=N6,remarkPlugins:o=B6,className:i,shikiTheme:l=z6,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Ex,parseMarkdownIntoBlocksFn:f=r2,caret:p,plugins:m,remend:x,linkSafety:S={enabled:!0},...w})=>{let y=(0,_.useId)(),[h,b]=(0,_.useTransition)(),T=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?YL(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)(()=>({...T6,...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":`"${U6[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Sx.Provider,{value:m??null,children:(0,E.jsx)(ya.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)(n2,{components:H,rehypePlugins:W,remarkPlugins:F,...w,children:e})})})}):(0,E.jsx)(Sx.Provider,{value:m??null,children:(0,E.jsx)(ya.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";q6=({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,h]=(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}),h(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)(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 disabled:cursor-not-allowed disabled:opacity-50",disabled:c<=a,onClick:C,title:"Zoom out",type:"button",children:(0,E.jsx)(r6,{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)(a6,{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})]})},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)(ya),S=Tx(),w=x?.errorComponent,{shouldRender:y,containerRef:h}=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),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:h});if(l&&!u&&!d)return(0,E.jsx)("div",{className:ce("my-4 flex justify-center p-4",t),ref:h,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:h,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:h,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:h,children:(0,E.jsx)(q6,{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 A_=oa((vse,M_)=>{"use strict";function kV(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)}}M_.exports=kV});var Sv=typeof performance>"u"?0:performance.now(),Iv=typeof window<"u"&&!!window.WaniWani?.chat;var di=z(he(),1),Wp=z(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 NB=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],BB=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],UB=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],FB=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],zB=["waniwani/visitorId","visitorId"],qB=["correlationId","openai/requestId"];function fC(e){return e?ol(e,NB):void 0}function pC(e){return e?ol(e,BB):void 0}function mC(e){return e?ol(e,UB):void 0}function hC(e){return e?ol(e,FB):void 0}function gC(e){return e?ol(e,zB):void 0}function wC(e){return e?ol(e,qB):void 0}var HB=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],jB=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function yC(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 HB){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 jB)if(n.includes(r))return o}}var VB="@waniwani/sdk";function xC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??WB,r=XB(e),o=jd(e.meta),i=jd(e.metadata),l=KB(e,o),s=bn(e.eventId)??n(),u=YB(e.timestamp,a),c=bn(e.source)??yC(o)??t.source??VB,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:GB(e,r),metadata:f,rawLegacy:d}}function WB(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function GB(e,t){if(!Ng(e))return jd(e.properties);let a=$B(e,t),n=jd(e.properties);return{...a,...n}}function $B(e,t){switch(t){case"tool.called":{let a={};return bn(e.toolName)&&(a.name=e.toolName),bn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return bn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function XB(e){return Ng(e)?e.eventType:e.event}function KB(e,t){let a=bn(e.requestId)??pC(t),n=bn(e.sessionId)??fC(t),r=bn(e.traceId)??mC(t),o=bn(e.externalUserId)??hC(t),i=bn(e.visitorId)??gC(t),l=bn(e.correlationId)??wC(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 YB(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 bn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Ng(e){return"eventType"in e}function vC(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 ZB="/api/mcp/events/v2/batch";var bC="@waniwani/sdk";var QB=new Set([401,403]),JB=new Set([408,425,429,500,502,503,504]),eU=(e,t)=>globalThis.fetch(e,t);function SC(e){return new Bg(e)}var Bg=class{constructor(t){ne(this,"endpointUrl");ne(this,"flushIntervalMs");ne(this,"maxBatchSize");ne(this,"maxBufferSize");ne(this,"maxRetries");ne(this,"retryBaseDelayMs");ne(this,"retryMaxDelayMs");ne(this,"shutdownTimeoutMs");ne(this,"sdkVersion");ne(this,"fetchFn");ne(this,"logger");ne(this,"now");ne(this,"sleep");ne(this,"apiKey");ne(this,"buffer",[]);ne(this,"flushTimer");ne(this,"flushScheduled",!1);ne(this,"flushScheduledTimer");ne(this,"flushInFlight");ne(this,"inFlightCount",0);ne(this,"isStopped",!1);ne(this,"isShuttingDown",!1);this.endpointUrl=nU(t.apiUrl,t.endpointPath??ZB),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??eU,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":bC};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:rU(o)}}if(QB.has(a.status))return{kind:"auth",status:a.status};if(JB.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await aU(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:bC,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(tU(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 tU(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 aU(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function nU(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function rU(e){return e instanceof Error?e.message:String(e)}function IC(e){let{apiUrl:t,endpointPath:a}=oU(e.endpoint),n=SC({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=xC({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,vC(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function oU(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 iU="/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(iU)?`${n}${t}`:null}function lU(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ha(...e){lU()&&console.log("[Waniwani]",...e)}var Ug="waniwani-visitor-id";function sU(){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 Zt(){try{let t=localStorage.getItem(Ug);if(t)return t}catch{}let e=sU();try{localStorage.setItem(Ug,e)}catch{}return e}function il(e){let t=typeof e=="string"?e.trim():"";if(!t)return Zt();try{localStorage.setItem(Ug,t)}catch{}return t}function uU(e){return e!=null&&typeof e.then=="function"}function $s(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 uU(n)?n.then(r=>{t||il(r??"")},()=>{}):il(n??""),a}var cU="waniwani-memory";var Wa="threads",Wd="by_memoryUserId",dU="by_updatedAt";var kC="memoryUserId",CC="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 fU(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Wa)){let a=e.createObjectStore(Wa,{keyPath:"threadId"});a.createIndex(Wd,"memoryUserId",{unique:!1}),a.createIndex(dU,"updatedAt",{unique:!1})}}async function qg(){return new Promise((e,t)=>{let a=indexedDB.open(cU,2);a.onupgradeneeded=n=>{fU(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function pU(){return qg()}async function mU(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(kC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function hU(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,kC);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function gU(){if(typeof indexedDB>"u")return null;try{let e=await pU();try{let t=await mU(e);if(t)return t;let a=zg();return await hU(e,a),a}finally{e.close()}}catch{return null}}function wU(){try{let e=localStorage.getItem(CC);if(e)return e;let t=zg();return localStorage.setItem(CC,t),t}catch{return null}}async function TC(){let e=await gU();if(e)return e;let t=wU();return t||(Fg||(Fg=zg()),Fg)}function LC(e,t){return e.match(t)?.[1]??null}function yU(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=LC(e,n);if(r)return{name:a,version:r}}return null}function xU(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=LC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function vU(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 Xs(){let e=navigator.userAgent,t=Zt(),a=await TC();return{userAgent:e,browser:yU(e),os:xU(e),deviceType:vU(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 bU="0.22.0-beta.1",SU=40,IU=10,CU=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 kU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=SU)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>CU||(t[a]=r)}return t}function TU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=IU)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function LU(){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 EU(e,t,a,n){return{kind:e,sdkVersion:bU,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:Zt(),pageHost:window.location.hostname,connection:LU(),tags:TU(a),metrics:kU(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=EU(e,t,a,n),l=()=>{ha("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 dr=Vg("boot",0),EC;function Bo(e,t){dr.mark(e,t)}function Kd(e){EC??(EC=e)}var MU=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,AU=/\/embed\.js(\?|$)/;function RU(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&dr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&dr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)MU.test(a.name)?(dr.mark("bundleStart",a.startTime),dr.mark("bundleEnd",a.responseEnd)):AU.test(a.name)&&(dr.mark("loaderStart",a.startTime),dr.mark("loaderEnd",a.responseEnd))}function DU(){if(Iv)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function MC(e){RU(),dr.mark("bundleExecuted",Sv),Xd("boot",e,{configSource:EC,mode:e.mode,secondSdk:DU()},dr.metrics)}var _U=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function AC(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 _U)!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 OU(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function RC(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:OU(e),outcome:r,metrics:a.metrics}))}}}var PU="/api/mcp/events/v2/batch",Gg=new Set;function NU(e,t,a){return`${e}|${t}|${a??""}`}function Ks(e){return Vd(e,PU)}async function DC(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Ks(t);if(!i){ha("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){ha("page.viewed skipped: no channelId or source to attribute it");return}let l=NU(t,a,n);if(!Gg.has(l)){Gg.add(l);try{let s=await Xs(),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});Bo("pageViewSent"),await d}catch{Gg.delete(l)}}}function _C(e){let t=Ks(e.api);return t?IC({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Zt()})}):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=z(he());var Zd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var OC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var PC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var $g=e=>{let t=PC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ys=z(he());var NC={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 BC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var UC=(0,Ys.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,Ys.createElement)("svg",{ref:s,...NC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Zd("lucide",r),...!o&&!BC(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,Ys.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var He=(e,t)=>{let a=(0,Qd.forwardRef)(({className:n,...r},o)=>(0,Qd.createElement)(UC,{ref:o,iconNode:t,className:Zd(`lucide-${OC($g(e))}`,`lucide-${e}`,n),...r}));return a.displayName=$g(e),a};var BU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Zs=He("arrow-down",BU);var UU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Nn=He("arrow-up",UU);var FU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qs=He("check",FU);var zU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qr=He("chevron-down",zU);var qU=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Js=He("chevron-right",qU);var HU=[["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"}]],eu=He("clipboard-copy",HU);var jU=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fr=He("clock",jU);var VU=[["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"}]],tu=He("file-text",VU);var WU=[["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=He("file",WU);var GU=[["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"}]],au=He("globe",GU);var $U=[["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"}]],nu=He("image",$U);var XU=[["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"}]],ru=He("loader",XU);var KU=[["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=He("paperclip",KU);var YU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ou=He("square",YU);var ZU=[["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=He("wrench",ZU);var QU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ga=He("x",QU);var JU=[["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"}]],iu=He("zap",JU);var $e=z(he(),1),uO=z(um(),1);var ul=z(he(),1),lu=z(re(),1);function a3(e){return 1-(1-e)**3}function n3({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=a3,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 r3=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],o3=[0,1,2,0,1,2,1];function i3(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(o3[a],e.length-1)];t.push(`radial-gradient(at ${r3[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var l3=({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),n3({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=i3(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,lu.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,lu.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,lu.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},ef=l3;Xg();Yg();var s3=jC({prefix:"ww"});function q(...e){return s3(tf(e))}var su=z(re(),1);function cl({suggestions:e,isLoading:t,onSelect:a,align:n="start",className:r,...o}){return e.length===0&&!t?null:(0,su.jsx)("div",{className:q("ww:px-4 ww:py-2",r),...o,children:(0,su.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,su.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,su.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 VC=z(he(),1),WC="(max-width: 639px)";function u3(e){let t=window.matchMedia(WC);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function c3(){return window.matchMedia(WC).matches}function d3(){return!1}function GC(){return(0,VC.useSyncExternalStore)(u3,c3,d3)}var af=z(he(),1);function Zg(e,t){return e.find(a=>a.text===t)?.id??null}async function $C(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let l=Ks(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:Zt(),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 XC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:l,origin:s,text:u,index:c}=e;await $C({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 KC(e,t){return t.map(a=>({id:Zg(e,a),text:a}))}async function YC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:l,origin:s}=e;l.length!==0&&await $C({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;XC({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;YC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),prompts:KC(l??[],c),origin:d})}})},[t,a,n,r,o,i,l])}var fl=z(he(),1),f3=80,p3=50,m3=15e3,ZC=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,ZC)):r.current=setTimeout(s,p3)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,m3)):r.current=setTimeout(s,f3)))};return r.current=setTimeout(s,ZC),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var Sn=z(he(),1);var QC=["en","fr","es"];function ml(e){return QC.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 JC={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 ek={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:ek,es:JC};var ak=z(re(),1),tk=(0,Sn.createContext)(null);function h3(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&&g3(t)),r=n?t:"en",[o,i]=(0,Sn.useState)(r),[l,s]=(0,Sn.useState)(n);(0,Sn.useEffect)(()=>{i(Qg(t)),s(!0)},[t]);let u=(0,Sn.useMemo)(()=>{let c=Jg[o]??Jg["en"];return{locale:o,t:h3(c,a),ready:l}},[o,a,l]);return(0,ak.jsx)(tk.Provider,{value:u,children:e})}function g3(e){return e==="en"||e==="fr"||e==="es"}function ke(){let e=(0,Sn.useContext)(tk);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 ze=z(he(),1);var uu=(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=z(he(),1);var zo=new Map;function nk(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 rk(e){return zo.get(e)}var ok=z(re(),1),Bn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,ok.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 ik=z(he(),1);var bt=z(re(),1),lk=({files:e,className:t,...a})=>e.length===0?null:(0,bt.jsx)("div",{className:q("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,bt.jsx)(w3,{file:n},r))});function w3({file:e}){let{t}=ke();return e.mediaType?.startsWith("image/")&&e.url?(0,bt.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,bt.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,bt.jsx)(ll,{className:"ww:size-3 ww:shrink-0"}),(0,bt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function sk(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function y3({mediaType:e}){return e.startsWith("image/")?(0,bt.jsx)(nu,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,bt.jsx)(tu,{className:"ww:size-5 ww:text-muted-foreground"}):(0,bt.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}=ke(),s=sk(t,l);return(0,bt.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,bt.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,bt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,bt.jsx)(y3,{mediaType:t})}),(0,bt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,bt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,bt.jsx)("span",{className:q("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??s})]}),o]})}function uk(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 ck=({documents:e,className:t,...a})=>e.length===0?null:(0,bt.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,bt.jsx)(x3,{document:n},`${n.documentId}-${r}`))});function x3({document:e}){let{t}=ke(),[a,n]=(0,ik.useState)(!1),r=e.mediaType.startsWith("image/")?rk(e.documentId):void 0;return r&&!a?(0,bt.jsx)("li",{children:(0,bt.jsx)("img",{alt:`${e.filename}, ${sk(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,bt.jsx)(tw,{filename:e.filename,mediaType:e.mediaType})}var ht=z(re(),1),v3=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}},b3=(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)},fk=(0,Ie.createContext)(null),rf=()=>{let e=(0,Ie.useContext)(fk);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},pk=({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}=ke(),S=(0,Ie.useRef)(null),w=(0,Ie.useRef)(null),[y,h]=(0,Ie.useState)([]),b=(0,Ie.useRef)(y),T=(0,Ie.useRef)(new Map),C=(0,Ie.useRef)(s),M=(0,Ie.useRef)(c),R=(0,Ie.useRef)(u);(0,Ie.useEffect)(()=>{C.current=s,M.current=c,R.current=u},[s,c,u]);let P=(0,Ie.useCallback)(v=>{b.current=v,h(v)},[]),L=(0,Ie.useCallback)(()=>{S.current?.click()},[]),$=(0,Ie.useCallback)((v,K)=>{P(b.current.map(ee=>ee.id===v?{...ee,...K}:ee))},[P]),H=(0,Ie.useCallback)((v,K)=>{let ee=C.current;if(!ee)return;let we=new AbortController,We=ee(K,we.signal,me=>{$(v,{progress:me})}).then(me=>($(v,{status:"ready",progress:1,documentId:me.documentId,error:void 0}),me)).catch(me=>{if(we.signal.aborted)return null;let be=me instanceof Error?me.message:m.promptInput.uploadFailed;return $(v,{status:"failed",error:be}),M.current?.({code:"upload_failed",message:be}),null});T.current.set(v,{file:K,controller:we,done:We})},[$,m]),F=(0,Ie.useCallback)(v=>{let K=[...v];if(!l||K.length===0)return;let ee=(de,Q)=>M.current?.({code:de,message:Q}),we=[];for(let de of K){if(!b3(de,t)){ee("accept",m.promptInput.errorAccept.replace("{name}",de.name));continue}if(o&&de.size>o){ee("max_file_size",m.promptInput.errorTooLarge.replace("{name}",de.name).replace("{limit}",mk(o,x)));continue}we.push(de)}if(we.length===0)return;let We=typeof r=="number"?Math.max(0,r-b.current.length):void 0,me=typeof We=="number"?we.slice(0,We):we;if(me.length<we.length&&ee("max_files",m.promptInput.errorTooMany.replace("{limit}",String(r))),me.length===0)return;let be=!!C.current,le=me.map(de=>({file:de,item:{filename:de.name,id:uu(),mediaType:de.type,type:"file",url:URL.createObjectURL(de),status:be?"uploading":"ready",progress:0}}));P([...b.current,...le.map(de=>de.item)]);for(let de of le)H(de.item.id,de.file)},[r,o,t,l,H,P,m,x]),W=(0,Ie.useCallback)(v=>{let K=T.current.get(v);K&&($(v,{status:"uploading",progress:0,error:void 0}),H(v,K.file))},[$,H]),V=(0,Ie.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?nk(v.documentId,v.url):URL.revokeObjectURL(v.url)),K&&v.documentId&&R.current?.({documentId:v.documentId,filename:v.filename??"",mediaType:v.mediaType??""})},[]),N=(0,Ie.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,Ie.useCallback)(()=>{for(let v of b.current)V(v,!0);P([])},[V,P]),G=(0,Ie.useRef)(l);(0,Ie.useEffect)(()=>{let v=G.current;G.current=l,v&&!l&&D()},[l,D]);let ue=(0,Ie.useCallback)(()=>{for(let v of b.current)V(v,!1);P([])},[V,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=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,Ie.useCallback)(async v=>{v.preventDefault();let K=v.currentTarget,ee=new FormData(K).get("message")||"",we=new Map;for(;we.size<T.current.size;)await Promise.all([...T.current.entries()].filter(([le])=>!we.has(le)).map(async([le,de])=>{we.set(le,await de.done)}));for(let le of we.keys())T.current.has(le)||we.delete(le);if([...we.values()].some(le=>le===null)){M.current?.({code:"upload_failed",message:m.promptInput.uploadFailed});return}let We=[...we.values()].filter(le=>le!==null),me=C.current?[]:b.current,be=await Promise.all(me.map(async({id:le,status:de,progress:Q,error:Be,...qe})=>{if(qe.url?.startsWith("blob:")){let _e=await v3(qe.url);return{...qe,url:_e??qe.url}}return qe}));try{let le=d({documents:We,files:be,text:ee},v);le instanceof Promise&&await le,K.reset(),ue()}catch{}},[d,ue,m]),et=(0,Ie.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,ht.jsxs)(fk.Provider,{value:et,children:[(0,ht.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,ht.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})]})},dk=1024*1024;function mk(e,t){let a=e>=dk;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/dk:Math.max(1,e/1024))}var hk=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=ke(),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,ht.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})},gk=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:l}=ke(),s=t==="submitted"||t==="streaming",u=s&&a!==void 0,c=(0,ht.jsx)(Nn,{className:"ww:size-4"});t==="submitted"?c=(0,ht.jsx)(ru,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,ht.jsx)(ou,{className:"ww:size-4"}));let d=(0,Ie.useCallback)(f=>{if(s&&a){f.preventDefault(),a();return}n?.(f)},[s,a,n]);return(0,ht.jsx)(Bn,{"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})},wk=({className:e,children:t,...a})=>{let{t:n,locale:r}=ke(),o=rf();if(o.files.length>0)return(0,ht.jsxs)(Bn,{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,ht.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,ht.jsx)(Ga,{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}",mk(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,ht.jsx)(Bn,{"aria-label":l,className:q(e),title:l,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,ht.jsx)(sl,{className:"ww:size-4"})})},yk=({className:e,...t})=>{let a=rf();return a.files.length===0?null:(0,ht.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,ht.jsx)(S3,{file:n},n.id))})};function S3({file:e}){let{t}=ke(),a=rf(),n=e.status==="failed",r=e.status==="uploading";return(0,ht.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,ht.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,ht.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,ht.jsx)(Ga,{className:"ww:size-3.5"})}),r?(0,ht.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 xk=({enabled:e=!0})=>{let{t}=ke(),[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,ht.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,ht.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,ht.jsx)(sl,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var bk=z(re(),1);function vk({text:e}){let{t}=ke();return e===!1?null:(0,bk.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=z(he(),1);var qo=z(re(),1),Sk=({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}),Ik=({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}),Ck=({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}),kk=({className:e,...t})=>(0,qo.jsx)("span",{className:q("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),Tk=({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}),Lk=({className:e,...t})=>(0,qo.jsx)(Bn,{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 sn=z(re(),1),Ek=(0,of.memo)(({message:e,onRemove:t})=>{let{t:a}=ke(),n=(0,of.useCallback)(()=>t(e.id),[t,e.id]);return(0,sn.jsxs)(Ik,{children:[(0,sn.jsx)(Ck,{}),(0,sn.jsx)(kk,{children:e.text||a.chatQueue.attachmentFallback}),(0,sn.jsx)(Tk,{children:(0,sn.jsx)(Lk,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,sn.jsx)(Ga,{className:"ww:size-3"})})})]})});Ek.displayName="ChatQueueItem";function Mk({queuedMessages:e,onRemove:t,className:a}){let{t:n}=ke();return e.length===0?null:(0,sn.jsxs)(Sk,{className:q("ww:border-t ww:border-border",a),children:[(0,sn.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,sn.jsx)("ul",{children:e.map(r=>(0,sn.jsx)(Ek,{message:r,onRemove:t},r.id))})]})}var _a=z(he(),1);var St=z(he(),1);cp();var l2=z(he(),1);var s2=z(re(),1),H6=({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,s2.jsx)(e,{"data-waniwani-shimmer":"",className:q("ww:inline-block",t),style:i,...o,children:r})},Tn=(0,l2.memo)(H6);Tn.displayName="Shimmer";var ua=z(re(),1),u2=(0,St.createContext)(null);function c2(){let e=(0,St.useContext)(u2);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var j6=1e3,V6=1e3,Bu=(0,St.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,St.useState)(s),p=c?a:d,m=(0,St.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,S]=(0,St.useState)(void 0),w=o??x,y=(0,St.useRef)(t),[h,b]=(0,St.useState)(!1),T=(0,St.useRef)(null);(0,St.useEffect)(()=>{t?(y.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(S(Math.ceil((Date.now()-T.current)/V6)),T.current=null)},[t]),(0,St.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,St.useEffect)(()=>{if(y.current&&!t&&p&&!h){let M=setTimeout(()=>{m(!1),b(!0)},j6);return()=>clearTimeout(M)}},[t,p,h,m]);let C=(0,St.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:w}),[t,p,m,w]);return(0,ua.jsx)(u2.Provider,{value:C,children:(0,ua.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})})});Bu.displayName="Reasoning";var Uu=(0,St.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=ke(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=c2(),f=a??((p,m)=>p||m===0?(0,ua.jsx)(Tn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,ua.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,ua.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,ua.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,ua.jsxs)(ua.Fragment,{children:[!n&&(0,ua.jsx)(fr,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});Uu.displayName="ReasoningTrigger";var Fu=(0,St.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=c2();return(0,ua.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,ua.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ua.jsx)("div",{className:q("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,ua.jsx)(Ll,{children:t})})})})});Fu.displayName="ReasoningContent";var Ne=z(re(),1),W6=500,d2=(0,_a.createContext)(null);function f2(){let e=(0,_a.useContext)(d2);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function p2({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,_a.useState)(r),d=s?n:u,f=(0,_a.useCallback)(S=>{s||c(S),o?.(S)},[s,o]),[p,m]=(0,_a.useState)(!t);(0,_a.useEffect)(()=>{if(t){m(!1);return}let S=setTimeout(()=>m(!0),W6);return()=>clearTimeout(S)},[t]);let x=(0,_a.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ne.jsx)(d2.Provider,{value:x,children:(0,Ne.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 m2({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=f2();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ne.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,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:q("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ne.jsx)("span",{className:"ww:truncate",children:l?(0,Ne.jsx)(Tn,{duration:2.6,children:d}):d})]},d)})}return(0,Ne.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,Ne.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ne.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function h2({className:e,children:t,...a}){let{open:n}=f2();return(0,Ne.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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.jsx)("div",{className:q("ww:flex ww:flex-col",e),...a,children:t})})})}function g2({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:q("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,_a.useState)(!1),f=a??"",p=l?(0,Ne.jsx)(Tn,{duration:1.6,children:f}):(0,Ne.jsx)("span",{className:"ww:truncate",children:f});return(0,Ne.jsxs)("div",{className:q("ww:flex ww:gap-2",e),...i,children:[(0,Ne.jsx)(g2,{icon:t,isLast:r,running:l,error:s}),(0,Ne.jsxs)("div",{className:q("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)(Qr,{className:q("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: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,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 w2({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ne.jsx)(g2,{icon:fr,isLast:t,running:e}),(0,Ne.jsx)("div",{className:q("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ne.jsxs)(Bu,{isStreaming:e,className:"ww:mb-0",children:[(0,Ne.jsx)(Uu,{hideIcon:!0}),(0,Ne.jsx)(Fu,{children:a})]})})]})}var Ax={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var y2={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var b2=z(he(),1);var vr=z(he(),1),G6=5,x2=400;function v2(e,t,a={}){let{msPerChar:n=G6}=a,[r,o]=(0,vr.useState)(t?"":e),i=(0,vr.useRef)(e),l=(0,vr.useRef)(t?0:e.length),s=(0,vr.useRef)(0),u=(0,vr.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,vr.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>x2&&(l.current=i.current.length-x2),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 zu=z(re(),1),Rx=({className:e,from:t,children:a,...n})=>(0,zu.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,zu.jsx)("div",{className:q("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Dx=({children:e,className:t,...a})=>(0,zu.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}),$6={cjk:Ax,code:y2},X6={cjk:Ax},K6={enabled:!1};function Y6({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=v2(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,zu.jsx)(Ll,{className:q("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??K6,plugins:a?X6:$6,...r,children:l})}var hp=(0,b2.memo)(Y6,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);hp.displayName="MessageResponse";var Vt=z(he(),1);function _x(e){if(!(typeof e!="object"||e===null))return e}function S2(e){return _x(e?.ui)}function Ox(e){if(!e)return;let t=S2(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 qu(e){return S2(e)?.autoHeight===!0}function Px(e){return _x(_x(e)?._meta)}var Te=z(re(),1);function Z6(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 Q6({text:e,className:t}){let{t:a}=ke(),[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,Te.jsx)(Bn,{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,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(Qs,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copied})]}):(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(eu,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copy})]})})}function I2({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=Z6(e);return(0,Te.jsxs)("div",{className:q("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,Te.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,Te.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,Te.jsx)(Q6,{text:i})]}),(0,Te.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,Te.jsx)(Js,{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,Te.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,Te.jsx)("code",{children:i})}):(0,Te.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Nx=(0,Vt.createContext)({open:!1,toggle:()=>{}});function C2({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Vt.useState)(t);return(0,Te.jsx)(Nx.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,Te.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 k2({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Vt.useContext)(Nx),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,Te.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,Te.jsx)(Uo,{className:"ww:size-4 ww:shrink-0"}),(0,Te.jsx)("span",{className:"ww:truncate",children:i?(0,Te.jsx)(Tn,{duration:1.6,children:l}):l}),(0,Te.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function T2({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,Te.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,Te.jsx)("span",{className:"ww:truncate",children:r?(0,Te.jsx)(Tn,{duration:1.6,children:o}):o})})}function L2({className:e,children:t,...a}){let{open:n}=(0,Vt.useContext)(Nx);return(0,Te.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,Te.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Te.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 Bx({className:e,input:t,debug:a,...n}){let{t:r}=ke(),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,Te.jsx)(I2,{data:o,label:r.tool.request,className:e,...n})}function Hu(e,t,a){if(e){let n=Ox(a?.[e]?._meta);if(n)return n}return Ox(Px(t))}function E2(e,t,a){return e&&qu(a?.[e]?._meta)?!0:qu(Px(t))}function Ux({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=ke(),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,Te.jsxs)("div",{className:q("ww:space-y-2",e),...r,children:[(0,Te.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,Te.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,Te.jsx)(I2,{data:i,label:o.tool.response,className:e,...r}):null}var ju=z(re(),1);function M2(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function A2(e){return e.parts.some(M2)}function R2(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=>!(!M2(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function D2({className:e,...t}){let{t:a}=ke();return(0,ju.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,ju.jsx)(iu,{className:"ww:size-4 ww:shrink-0"}),(0,ju.jsx)(Tn,{duration:1.6,children:a.workingIndicator.default})]})}var Je=z(he(),1);function ii(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 _2(e,t){return!ii(e)&&!ii(t)?null:ii(e)?ii(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 br=z(he(),1);var O2=(0,br.createContext)(()=>{});function P2(){return(0,br.useContext)(O2)}var N2=O2.Provider;function J6(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function El(e){let t=(0,br.useRef)(e);t.current=e;let a=(0,br.useRef)(!1);(0,br.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;Bo(r.paintMark),J6(()=>MC(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var B2=z(re(),1),e9="/api/mcp/resource",t9=500,a9=0,n9=16,r9="2026-01-26",o9=300,i9=3e3,l9=3,s9=2e3;function u9(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function c9(e,t,a){return Hu(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function gp({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=e9,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),h=(0,Je.useRef)(!1),b=(0,Je.useRef)(0),T=(0,Je.useRef)("inline"),[C,M]=(0,Je.useState)(a9),[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+n9,0):Math.min(Math.max(v,50),t9),[l]),D=(0,Je.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),G=P2(),ue=(0,Je.useRef)(null),I=(0,Je.useRef)(void 0);(0,Je.useEffect)(()=>{let v=RC(e,G);return ue.current=v,()=>{clearTimeout(I.current),v.has("initialized")||v.report("timeout",b.current),ue.current=null}},[e,G]);let Ve=(0,Je.useRef)(o);Ve.current=o;let et=(0,Je.useRef)(f);return(0,Je.useEffect)(()=>{et.current=f,w.current.height=-1,y.current&&(y.current.cancel(),y.current=null)},[f]),(0,Je.useEffect)(()=>{if(!h.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,we=null,We=null,me=setTimeout(()=>{if(K||ee||b.current>=l9)return;b.current+=1;let de=new URL(v.src);de.searchParams.set("_retry",String(b.current)),v.src=de.toString()},i9),be=de=>{v.contentWindow?.postMessage(de,"*")},le=de=>{if(K||de.source!==v.contentWindow)return;let Q=de.data;if(!Q||typeof Q!="object"||Q.jsonrpc!=="2.0")return;let Be=Q.method,qe=Q.id;if(Be==="ui/initialize"&&qe!=null){ee=!0,ue.current?.mark("initialize"),clearTimeout(me),be({jsonrpc:"2.0",id:qe,result:{protocolVersion:Q.params?.protocolVersion??r9,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(Be==="ui/notifications/initialized"){h.current=!0,ue.current?.mark("initialized"),I.current=setTimeout(()=>ue.current?.report("ok",b.current),s9);let _e=x.current,Ce=S.current,ye=Ce._meta&&typeof Ce._meta=="object"?Ce._meta:null,Y=u9(W.current),Oe=ye&&typeof ye.waniwani=="object"&&ye.waniwani!==null?ye.waniwani:null,ot=Oe||Y?{...Oe??{},...Y?{sessionId:Y}:{}}:void 0,ba=ye||ot?{...ye??{},...ot?{waniwani:ot}:{}}:void 0;be({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:_e}});let Sa=Ce.content??[{type:"text",text:JSON.stringify(Ce)}];be({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:Sa,structuredContent:Ce.structuredContent,_meta:ba,meta:ba}});return}if(Be==="ui/notifications/size-changed"){clearTimeout(I.current),ue.current?.mark("firstSize"),ue.current?.report("ok",b.current);let _e=Q.params,Ce=typeof _e?.height=="number"?_e.height:void 0,ye=typeof _e?.width=="number"?_e.width:void 0,Y=w.current,Oe=Ce!==void 0&&Ce!==Y.height,ot=ye!==void 0&&ye!==Y.width;if(!Oe&&!ot)return;if(Oe&&Ce!==void 0){if(Y.height=Ce,et.current)return;let ba=N(Ce),Sa=v.getBoundingClientRect().height;if(y.current&&(y.current.cancel(),y.current=null),M(ba),v.animate&&Math.abs(Sa-ba)>2){let ra=v.animate([{height:`${Sa}px`},{height:`${ba}px`}],{duration:o9,easing:"ease-out",fill:"forwards"});y.current=ra,ra.onfinish=()=>{y.current===ra&&(ra.cancel(),y.current=null)}}}ot&&l&&ye!==void 0&&(Y.width=ye,P(ye));return}if(Be==="ui/open-link"&&qe!=null){let _e=Q.params?.url;typeof _e=="string"&&(L.current?L.current(_e):window.open(_e,"_blank","noopener,noreferrer")),be({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/message"&&qe!=null){if($.current&&Q.params){let _e=Q.params,Ce=we;if(we=null,We){clearTimeout(We.timer);let ye=We.text;We=null;let Y=(_e.content??[]).map(Oe=>Oe.text??"").join("").trim();_e={..._e,content:[{type:"text",text:`${Y}
|
|
118
|
+
`)},bx=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("")},x6=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=>bx(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?bx(l[u]):"";n[r]=`| ${s.join(" | ")} |`,r+=1}else{let s=l.map(u=>bx(u));n[r]=`| ${s.join(" | ")} |`,r+=1}return n.join(`
|
|
119
|
+
`)},v6=({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)(ya),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 h=_R(y),b=m==="csv"?OR(h):y6(h),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?Tx:Lx;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]})},b6=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useRef)(null),{isAnimating:l}=(0,_.useContext)(ya),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=_R(f),m=u==="csv"?OR(p):x6(p);Ll(`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]})},S6=({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)(v6,{}),(0,E.jsx)(b6,{})]}):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})})]}),I6=(0,_.lazy)(()=>Promise.resolve().then(()=>(xR(),yR)).then(e=>({default:e.CodeBlock}))),C6=(0,_.lazy)(()=>Promise.resolve().then(()=>(SR(),bR)).then(e=>({default:e.Mermaid}))),k6=/language-([^\s]+)/;kx=(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},Mx=(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)=>Lt(e,t));Mx.displayName="MarkdownOl";PR=(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));PR.displayName="MarkdownLi";NR=(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)=>Lt(e,t));NR.displayName="MarkdownUl";BR=(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)=>Lt(e,t));BR.displayName="MarkdownHr";UR=(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)=>Lt(e,t));UR.displayName="MarkdownStrong";T6=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(ya),[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)(f6,{...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})},FR=(0,_.memo)(T6,(e,t)=>Lt(e,t)&&e.href===t.href);FR.displayName="MarkdownA";zR=(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)=>Lt(e,t));zR.displayName="MarkdownH1";qR=(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)=>Lt(e,t));qR.displayName="MarkdownH2";HR=(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)=>Lt(e,t));HR.displayName="MarkdownH3";jR=(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)=>Lt(e,t));jR.displayName="MarkdownH4";VR=(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)=>Lt(e,t));VR.displayName="MarkdownH5";WR=(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)=>Lt(e,t));WR.displayName="MarkdownH6";GR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(ya),o=kx(r,"table");return(0,E.jsx)(S6,{className:t,showControls:o,...n,children:e})},(e,t)=>Lt(e,t));GR.displayName="MarkdownTable";$R=(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)=>Lt(e,t));$R.displayName="MarkdownThead";XR=(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)=>Lt(e,t));XR.displayName="MarkdownTbody";KR=(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)=>Lt(e,t));KR.displayName="MarkdownTr";YR=(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)=>Lt(e,t));YR.displayName="MarkdownTh";ZR=(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)=>Lt(e,t));ZR.displayName="MarkdownTd";QR=(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)=>Lt(e,t));QR.displayName="MarkdownBlockquote";JR=(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)=>Lt(e,t));JR.displayName="MarkdownSup";e2=(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)=>Lt(e,t));e2.displayName="MarkdownSub";t2=(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===Mx){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)=>Lt(e,t));t2.displayName="MarkdownSection";L6=({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)(ya),c=Ex();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(k6),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=kx(u,"mermaid"),S=fp(u,"download"),w=fp(u,"copy"),y=fp(u,"fullscreen"),h=fp(u,"panZoom"),b=x&&(S||w||y);return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(TR,{}),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)(m6,{chart:p,config:s?.config}):null,w?(0,E.jsx)(CR,{code:p}):null,y?(0,E.jsx)(w6,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(C6,{chart:p,config:s?.config,showControls:h})]})})}let m=kx(u,"code");return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(TR,{}),children:(0,E.jsx)(I6,{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)(l6,{code:p,language:f}),(0,E.jsx)(CR,{})]}):null})})},a2=(0,_.memo)(L6,(e,t)=>e.className===t.className&&hp(e.node,t.node));a2.displayName="MarkdownCode";n2=(0,_.memo)(u6,(e,t)=>e.className===t.className&&hp(e.node,t.node));n2.displayName="MarkdownImg";r2=(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)=>Lt(e,t));r2.displayName="MarkdownParagraph";E6={ol:Mx,li:PR,ul:NR,hr:BR,strong:UR,a:FR,h1:zR,h2:qR,h3:HR,h4:jR,h5:VR,h6:WR,table:GR,thead:$R,tbody:XR,tr:KR,th:YR,td:ZR,blockquote:QR,code:a2,img:n2,pre:({children:e})=>e,sup:JR,sub:e2,p:r2,section:t2},LR=[],ER={allowDangerousHtml:!0},pp=new WeakMap,M6=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()}},MR=new M6,o2=e=>{let t=A6(e),a=e.children||"";return D6(t.runSync(t.parse(a),a),e)},A6=e=>{let t=MR.get(e);if(t)return t;let a=R6(e);return MR.set(e,a),a},R6=e=>{let t=e.rehypePlugins||LR,a=e.remarkPlugins||LR,n=e.remarkRehypeOptions?{...ER,...e.remarkRehypeOptions}:ER;return ix().use(Yf).use(a).use(ep,n).use(t)},D6=(e,t)=>Fy(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),_6=/\[\^[^\]\s]{1,200}\](?!:)/,O6=/\[\^[^\]\s]{1,200}\]:/,P6=/<\/(\w+)>/,N6=/<(\w+)[\s>]/,Sx=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]==="$"},B6=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]==="$"},Ix=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},i2=e=>{let t=_6.test(e),a=O6.test(e);if(t||a)return[e];let n=Xa.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(P6);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(N6);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=Sx(u),d=Ix(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&B6(l)){let u=r[s-1],c=Sx(u),d=Ix(u),f=Ix(l);if(c&&d%2===1&&!Sx(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},l2={raw:zk,sanitize:[gf,{}],harden:[Uk,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},s2={gfm:[qf,{}]},U6=Object.values(l2),F6=Object.values(s2),z6={block:" \u258B",circle:" \u25CF"},q6={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ya=(0,_.createContext)(q6),Ax=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(o2,{...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)});Ax.displayName="Block";H6=["github-light","github-dark"],El=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=U6,remarkPlugins:o=F6,className:i,shikiTheme:l=H6,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Ax,parseMarkdownIntoBlocksFn:f=i2,caret:p,plugins:m,remend:x,linkSafety:S={enabled:!0},...w})=>{let y=(0,_.useId)(),[h,b]=(0,_.useTransition)(),T=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?QL(e,x):e,[e,t,a,x]),C=(0,_.useMemo)(()=>f(T),[T,f]),[M,D]=(0,_.useState)(C);(0,_.useEffect)(()=>{t==="streaming"?b(()=>{D(C)}):D(C)},[C,t]);let P=t==="streaming"?M:C,L=(0,_.useMemo)(()=>P.map((N,R)=>`${y}-${R}`),[P.length,y]),$=(0,_.useMemo)(()=>{var N,R;return{shikiTheme:(R=(N=m?.code)==null?void 0:N.getThemes())!=null?R:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:S}},[l,u,c,t,s,S,m?.code]),H=(0,_.useMemo)(()=>({...E6,...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":`"${z6[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Cx.Provider,{value:m??null,children:(0,E.jsx)(ya.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)(o2,{components:H,rehypePlugins:W,remarkPlugins:F,...w,children:e})})})}):(0,E.jsx)(Cx.Provider,{value:m??null,children:(0,E.jsx)(ya.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,R)=>(0,E.jsx)(d,{components:H,content:N,index:R,rehypePlugins:W,remarkPlugins:F,shouldParseIncompleteMarkdown:a,...w},L[R]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);El.displayName="Streamdown";j6=({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,h]=(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]),D=(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}),h(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",D,{passive:!1}),()=>{H.removeEventListener("wheel",D)}},[D]),(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)(o6,{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)(i6,{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)(r6,{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})]})},vx=({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)(ya),S=Ex(),w=x?.errorComponent,{shouldRender:y,containerRef:h}=t6({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:D}=await T.render(M,e);c(D),f(D)}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:h});if(l&&!u&&!d)return(0,E.jsx)("div",{className:ce("my-4 flex justify-center p-4",t),ref:h,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:h,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:h,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:h,children:(0,E.jsx)(j6,{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 D_=oa((kse,R_)=>{"use strict";function LV(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)}}R_.exports=LV});var Cv=typeof performance>"u"?0:performance.now(),kv=typeof window<"u"&&!!window.WaniWani?.chat;var fi=z(he(),1),$p=z(Ng(),1);var Bg="waniwani/suggestions";function il(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var UB=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],FB=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],zB=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],qB=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],HB=["waniwani/visitorId","visitorId"],jB=["correlationId","openai/requestId"];function mC(e){return e?il(e,UB):void 0}function hC(e){return e?il(e,FB):void 0}function gC(e){return e?il(e,zB):void 0}function wC(e){return e?il(e,qB):void 0}function yC(e){return e?il(e,HB):void 0}function xC(e){return e?il(e,jB):void 0}var VB=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],WB=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function vC(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 VB){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 WB)if(n.includes(r))return o}}var GB="@waniwani/sdk";function bC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??$B,r=YB(e),o=Vd(e.meta),i=Vd(e.metadata),l=ZB(e,o),s=bn(e.eventId)??n(),u=QB(e.timestamp,a),c=bn(e.source)??vC(o)??t.source??GB,d=Ug(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:XB(e,r),metadata:f,rawLegacy:d}}function $B(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function XB(e,t){if(!Ug(e))return Vd(e.properties);let a=KB(e,t),n=Vd(e.properties);return{...a,...n}}function KB(e,t){switch(t){case"tool.called":{let a={};return bn(e.toolName)&&(a.name=e.toolName),bn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return bn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function YB(e){return Ug(e)?e.eventType:e.event}function ZB(e,t){let a=bn(e.requestId)??hC(t),n=bn(e.sessionId)??mC(t),r=bn(e.traceId)??gC(t),o=bn(e.externalUserId)??wC(t),i=bn(e.visitorId)??yC(t),l=bn(e.correlationId)??xC(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 QB(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 bn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Ug(e){return"eventType"in e}function SC(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 IC="@waniwani/sdk";var eU=new Set([401,403]),tU=new Set([408,425,429,500,502,503,504]),aU=(e,t)=>globalThis.fetch(e,t);function CC(e){return new Fg(e)}var Fg=class{constructor(t){re(this,"endpointUrl");re(this,"flushIntervalMs");re(this,"maxBatchSize");re(this,"maxBufferSize");re(this,"maxRetries");re(this,"retryBaseDelayMs");re(this,"retryMaxDelayMs");re(this,"shutdownTimeoutMs");re(this,"sdkVersion");re(this,"fetchFn");re(this,"logger");re(this,"now");re(this,"sleep");re(this,"apiKey");re(this,"buffer",[]);re(this,"flushTimer");re(this,"flushScheduled",!1);re(this,"flushScheduledTimer");re(this,"flushInFlight");re(this,"inFlightCount",0);re(this,"isStopped",!1);re(this,"isShuttingDown",!1);this.endpointUrl=oU(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??aU,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":IC};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:iU(o)}}if(eU.has(a.status))return{kind:"auth",status:a.status};if(tU.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await rU(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:IC,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(nU(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 nU(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 rU(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function oU(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function iU(e){return e instanceof Error?e.message:String(e)}function kC(e){let{apiUrl:t,endpointPath:a}=lU(e.endpoint),n=CC({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=bC({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,SC(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function lU(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 sU="/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(sU)?`${n}${t}`:null}function uU(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ha(...e){uU()&&console.log("[Waniwani]",...e)}var zg="waniwani-visitor-id";function cU(){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 Zt(){try{let t=localStorage.getItem(zg);if(t)return t}catch{}let e=cU();try{localStorage.setItem(zg,e)}catch{}return e}function ll(e){let t=typeof e=="string"?e.trim():"";if(!t)return Zt();try{localStorage.setItem(zg,t)}catch{}return t}function dU(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 dU(n)?n.then(r=>{t||ll(r??"")},()=>{}):ll(n??""),a}var fU="waniwani-memory";var Wa="threads",Gd="by_memoryUserId",pU="by_updatedAt";var LC="memoryUserId",TC="waniwani-memory-user-id",qg=null;function Hg(){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 mU(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Wa)){let a=e.createObjectStore(Wa,{keyPath:"threadId"});a.createIndex(Gd,"memoryUserId",{unique:!1}),a.createIndex(pU,"updatedAt",{unique:!1})}}async function jg(){return new Promise((e,t)=>{let a=indexedDB.open(fU,2);a.onupgradeneeded=n=>{mU(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function hU(){return jg()}async function gU(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(LC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function wU(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,LC);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function yU(){if(typeof indexedDB>"u")return null;try{let e=await hU();try{let t=await gU(e);if(t)return t;let a=Hg();return await wU(e,a),a}finally{e.close()}}catch{return null}}function xU(){try{let e=localStorage.getItem(TC);if(e)return e;let t=Hg();return localStorage.setItem(TC,t),t}catch{return null}}async function EC(){let e=await yU();if(e)return e;let t=xU();return t||(qg||(qg=Hg()),qg)}function MC(e,t){return e.match(t)?.[1]??null}function vU(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=MC(e,n);if(r)return{name:a,version:r}}return null}function bU(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=MC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function SU(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=Zt(),a=await EC();return{userAgent:e,browser:vU(e),os:bU(e),deviceType:SU(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 IU="0.22.0-beta.3",CU=40,kU=10,TU=6e5;function Wg(){return typeof performance>"u"?0:performance.now()}function Gg(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=Wg()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function LU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=CU)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>TU||(t[a]=r)}return t}function EU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=kU)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function MU(){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 AU(e,t,a,n){return{kind:e,sdkVersion:IU,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:Zt(),pageHost:window.location.hostname,connection:MU(),tags:EU(a),metrics:LU(n)}}var Vg,$d=[];function $g(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";Vg=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||Vg===!1))try{let i=AU(e,t,a,n),l=()=>{ha("timing",i),fetch(ma(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};Vg?l():$d.length<20&&$d.push(l)}catch{}}var dr=Gg("boot",0),AC;function Uo(e,t){dr.mark(e,t)}function Yd(e){AC??(AC=e)}var RU=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,DU=/\/embed\.js(\?|$)/;function _U(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&dr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&dr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)RU.test(a.name)?(dr.mark("bundleStart",a.startTime),dr.mark("bundleEnd",a.responseEnd)):DU.test(a.name)&&(dr.mark("loaderStart",a.startTime),dr.mark("loaderEnd",a.responseEnd))}function OU(){if(kv)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function RC(e){_U(),dr.mark("bundleExecuted",Cv),Kd("boot",e,{configSource:AC,mode:e.mode,secondSdk:OU()},dr.metrics)}var PU=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function DC(e){let t=Gg("turn",Wg());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 PU)!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 NU(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function _C(e,t){let a=Gg("widget",Wg()),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:NU(e),outcome:r,metrics:a.metrics}))}}}var BU="/api/mcp/events/v2/batch",Xg=new Set;function UU(e,t,a){return`${e}|${t}|${a??""}`}function Ys(e){return Wd(e,BU)}async function OC(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){ha("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){ha("page.viewed skipped: no channelId or source to attribute it");return}let l=UU(t,a,n);if(!Xg.has(l)){Xg.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});Uo("pageViewSent"),await d}catch{Xg.delete(l)}}}function PC(e){let t=Ys(e.api);return t?kC({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Zt()})}):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(he());var Qd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var NC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var BC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Kg=e=>{let t=BC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Zs=z(he());var UC={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 FC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var zC=(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,...UC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Qd("lucide",r),...!o&&!FC(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,Zs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var He=(e,t)=>{let a=(0,Jd.forwardRef)(({className:n,...r},o)=>(0,Jd.createElement)(zC,{ref:o,iconNode:t,className:Qd(`lucide-${NC(Kg(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Kg(e),a};var FU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=He("arrow-down",FU);var zU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Nn=He("arrow-up",zU);var qU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=He("check",qU);var HU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qr=He("chevron-down",HU);var jU=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eu=He("chevron-right",jU);var VU=[["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=He("clipboard-copy",VU);var WU=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fr=He("clock",WU);var GU=[["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=He("file-text",GU);var $U=[["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"}]],sl=He("file",$U);var XU=[["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=He("globe",XU);var KU=[["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=He("image",KU);var YU=[["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=He("loader",YU);var ZU=[["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"}]],ul=He("paperclip",ZU);var QU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],iu=He("square",QU);var JU=[["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"}]],Fo=He("wrench",JU);var e3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ga=He("x",e3);var t3=[["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=He("zap",t3);var $e=z(he(),1),dO=z(dm(),1);var cl=z(he(),1),su=z(ae(),1);function r3(e){return 1-(1-e)**3}function o3({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=r3,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 i3=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],l3=[0,1,2,0,1,2,1];function s3(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(l3[a],e.length-1)];t.push(`radial-gradient(at ${i3[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var u3=({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,cl.useState)(110),[d,f]=(0,cl.useState)(0),[p,m]=(0,cl.useState)(!1);(0,cl.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),o3({ease:C=>C,duration:2e3,onUpdate:C=>{let M=C/100;c(T+360*M);let D=Math.min(M/.1,1),P=M>.85?(1-M)/.15:1;f(Math.min(D,P))},onEnd:()=>m(!1)})},[l]);let x=n+20,S=p?Math.max(0,(d*100-x)/(100-x)):0,y=s3(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=u3;Yg();Qg();var c3=WC({prefix:"ww"});function q(...e){return c3(af(e))}var uu=z(ae(),1);function dl({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 GC=z(he(),1),$C="(max-width: 639px)";function d3(e){let t=window.matchMedia($C);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function f3(){return window.matchMedia($C).matches}function p3(){return!1}function XC(){return(0,GC.useSyncExternalStore)(d3,f3,p3)}var nf=z(he(),1);function Jg(e,t){return e.find(a=>a.text===t)?.id??null}async function KC(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:Zt(),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 YC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:l,origin:s,text:u,index:c}=e;await KC({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 ZC(e,t){return t.map(a=>({id:Jg(e,a),text:a}))}async function QC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:l,origin:s}=e;l.length!==0&&await KC({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:l,count:l.length,origin:s,channelId:n,mode:r}})}function fl(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;YC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),promptId:Jg(l??[],c),origin:d,text:c,index:f});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;QC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),prompts:ZC(l??[],c),origin:d})}})},[t,a,n,r,o,i,l])}var pl=z(he(),1),m3=80,h3=50,g3=15e3,JC=500;function ml(e,t=!0){let[a,n]=(0,pl.useState)(""),r=(0,pl.useRef)(void 0);return(0,pl.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,JC)):r.current=setTimeout(s,h3)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,g3)):r.current=setTimeout(s,m3)))};return r.current=setTimeout(s,JC),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var Sn=z(he(),1);var ek=["en","fr","es"];function hl(e){return ek.includes(e)}function ew(e){if(e&&hl(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&hl(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(hl(n))return n;let r=n.split("-")[0];if(r&&hl(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 tk={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 ak={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 tw={en:rf,fr:ak,es:tk};var rk=z(ae(),1),nk=(0,Sn.createContext)(null);function w3(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 zo({children:e,locale:t,messages:a}){let n=!!(t&&y3(t)),r=n?t:"en",[o,i]=(0,Sn.useState)(r),[l,s]=(0,Sn.useState)(n);(0,Sn.useEffect)(()=>{i(ew(t)),s(!0)},[t]);let u=(0,Sn.useMemo)(()=>{let c=tw[o]??tw["en"];return{locale:o,t:w3(c,a),ready:l}},[o,a,l]);return(0,rk.jsx)(nk.Provider,{value:u,children:e})}function y3(e){return e==="en"||e==="fr"||e==="es"}function Ie(){let e=(0,Sn.useContext)(nk);return e||{locale:"en",t:rf,ready:!0}}function aw(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 ze=z(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 Ce=z(he(),1);var qo=new Map;function ok(e,t){if(qo.has(e)){URL.revokeObjectURL(t);return}for(qo.set(e,t);qo.size>20;){let a=qo.keys().next();if(a.done)return;let n=qo.get(a.value);qo.delete(a.value),n&&URL.revokeObjectURL(n)}}function ik(e){return qo.get(e)}var lk=z(ae(),1),Bn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,lk.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 sk=z(he(),1);var bt=z(ae(),1),uk=({files:e,className:t,...a})=>e.length===0?null:(0,bt.jsx)("div",{className:q("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,bt.jsx)(x3,{file:n},r))});function x3({file:e}){let{t}=Ie();return e.mediaType?.startsWith("image/")&&e.url?(0,bt.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,bt.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,bt.jsx)(sl,{className:"ww:size-3 ww:shrink-0"}),(0,bt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function ck(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function v3({mediaType:e}){return e.startsWith("image/")?(0,bt.jsx)(ru,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,bt.jsx)(au,{className:"ww:size-5 ww:text-muted-foreground"}):(0,bt.jsx)(sl,{className:"ww:size-5 ww:text-muted-foreground"})}function nw({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:l}=Ie(),s=ck(t,l);return(0,bt.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,bt.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,bt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,bt.jsx)(v3,{mediaType:t})}),(0,bt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,bt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,bt.jsx)("span",{className:q("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??s})]}),o]})}function dk(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 fk=({documents:e,className:t,...a})=>e.length===0?null:(0,bt.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,bt.jsx)(b3,{document:n},`${n.documentId}-${r}`))});function b3({document:e}){let{t}=Ie(),[a,n]=(0,sk.useState)(!1),r=e.mediaType.startsWith("image/")?ik(e.documentId):void 0;return r&&!a?(0,bt.jsx)("li",{children:(0,bt.jsx)("img",{alt:`${e.filename}, ${ck(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,bt.jsx)(nw,{filename:e.filename,mediaType:e.mediaType})}var ht=z(ae(),1),S3=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}},I3=(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)},mk=(0,Ce.createContext)(null),of=()=>{let e=(0,Ce.useContext)(mk);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},hk=({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}=Ie(),S=(0,Ce.useRef)(null),w=(0,Ce.useRef)(null),[y,h]=(0,Ce.useState)([]),b=(0,Ce.useRef)(y),T=(0,Ce.useRef)(new Map),C=(0,Ce.useRef)(s),M=(0,Ce.useRef)(c),D=(0,Ce.useRef)(u);(0,Ce.useEffect)(()=>{C.current=s,M.current=c,D.current=u},[s,c,u]);let P=(0,Ce.useCallback)(v=>{b.current=v,h(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 we=new AbortController,Ge=ee(K,we.signal,me=>{$(v,{progress:me})}).then(me=>($(v,{status:"ready",progress:1,documentId:me.documentId,error:void 0}),me)).catch(me=>{if(we.signal.aborted)return null;let ye=me instanceof Error?me.message:m.promptInput.uploadFailed;return $(v,{status:"failed",error:ye}),M.current?.({code:"upload_failed",message:ye}),null});T.current.set(v,{file:K,controller:we,done:Ge})},[$,m]),F=(0,Ce.useCallback)(v=>{let K=[...v];if(!l||K.length===0)return;let ee=(de,Q)=>M.current?.({code:de,message:Q}),we=[];for(let de of K){if(!I3(de,t)){ee("accept",m.promptInput.errorAccept.replace("{name}",de.name));continue}if(o&&de.size>o){ee("max_file_size",m.promptInput.errorTooLarge.replace("{name}",de.name).replace("{limit}",gk(o,x)));continue}we.push(de)}if(we.length===0)return;let Ge=typeof r=="number"?Math.max(0,r-b.current.length):void 0,me=typeof Ge=="number"?we.slice(0,Ge):we;if(me.length<we.length&&ee("max_files",m.promptInput.errorTooMany.replace("{limit}",String(r))),me.length===0)return;let ye=!!C.current,le=me.map(de=>({file:de,item:{filename:de.name,id:cu(),mediaType:de.type,type:"file",url:URL.createObjectURL(de),status:ye?"uploading":"ready",progress:0}}));P([...b.current,...le.map(de=>de.item)]);for(let de of le)H(de.item.id,de.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?ok(v.documentId,v.url):URL.revokeObjectURL(v.url)),K&&v.documentId&&D.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]),R=(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&&R()},[l,R]);let ue=(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 We=(0,Ce.useCallback)(async v=>{v.preventDefault();let K=v.currentTarget,ee=new FormData(K).get("message")||"",we=new Map;for(;we.size<T.current.size;)await Promise.all([...T.current.entries()].filter(([le])=>!we.has(le)).map(async([le,de])=>{we.set(le,await de.done)}));for(let le of we.keys())T.current.has(le)||we.delete(le);if([...we.values()].some(le=>le===null)){M.current?.({code:"upload_failed",message:m.promptInput.uploadFailed});return}let Ge=[...we.values()].filter(le=>le!==null),me=C.current?[]:b.current,ye=await Promise.all(me.map(async({id:le,status:de,progress:Q,error:Be,...qe})=>{if(qe.url?.startsWith("blob:")){let _e=await S3(qe.url);return{...qe,url:_e??qe.url}}return qe}));try{let le=d({documents:Ge,files:ye,text:ee},v);le instanceof Promise&&await le,K.reset(),ue()}catch{}},[d,ue,m]),Je=(0,Ce.useMemo)(()=>({add:F,clear:R,files:y,openFileDialog:L,remove:N,retry:W,maxFileSize:o,maxPdfPages:i}),[y,F,N,W,R,L,o,i]);return(0,ht.jsxs)(mk.Provider,{value:Je,children:[(0,ht.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,ht.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:We,ref:w,...p,children:f})]})},pk=1024*1024;function gk(e,t){let a=e>=pk;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/pk:Math.max(1,e/1024))}var wk=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Ie(),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,ht.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})},yk=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:l}=Ie(),s=t==="submitted"||t==="streaming",u=s&&a!==void 0,c=(0,ht.jsx)(Nn,{className:"ww:size-4"});t==="submitted"?c=(0,ht.jsx)(ou,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,ht.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,ht.jsx)(Bn,{"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})},xk=({className:e,children:t,...a})=>{let{t:n,locale:r}=Ie(),o=of();if(o.files.length>0)return(0,ht.jsxs)(Bn,{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,ht.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,ht.jsx)(Ga,{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}",gk(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,ht.jsx)(Bn,{"aria-label":l,className:q(e),title:l,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,ht.jsx)(ul,{className:"ww:size-4"})})},vk=({className:e,...t})=>{let a=of();return a.files.length===0?null:(0,ht.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,ht.jsx)(C3,{file:n},n.id))})};function C3({file:e}){let{t}=Ie(),a=of(),n=e.status==="failed",r=e.status==="uploading";return(0,ht.jsxs)(nw,{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,ht.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,ht.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,ht.jsx)(Ga,{className:"ww:size-3.5"})}),r?(0,ht.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 bk=({enabled:e=!0})=>{let{t}=Ie(),[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,ht.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,ht.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,ht.jsx)(ul,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var Ik=z(ae(),1);function Sk({text:e}){let{t}=Ie();return e===!1?null:(0,Ik.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(he(),1);var Ho=z(ae(),1),Ck=({className:e,...t})=>(0,Ho.jsx)("div",{className:q("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),kk=({className:e,...t})=>(0,Ho.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}),Tk=({className:e,...t})=>(0,Ho.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}),Lk=({className:e,...t})=>(0,Ho.jsx)("span",{className:q("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),Ek=({className:e,...t})=>(0,Ho.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}),Mk=({className:e,...t})=>(0,Ho.jsx)(Bn,{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 sn=z(ae(),1),Ak=(0,lf.memo)(({message:e,onRemove:t})=>{let{t:a}=Ie(),n=(0,lf.useCallback)(()=>t(e.id),[t,e.id]);return(0,sn.jsxs)(kk,{children:[(0,sn.jsx)(Tk,{}),(0,sn.jsx)(Lk,{children:e.text||a.chatQueue.attachmentFallback}),(0,sn.jsx)(Ek,{children:(0,sn.jsx)(Mk,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,sn.jsx)(Ga,{className:"ww:size-3"})})})]})});Ak.displayName="ChatQueueItem";function Rk({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Ie();return e.length===0?null:(0,sn.jsxs)(Ck,{className:q("ww:border-t ww:border-border",a),children:[(0,sn.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,sn.jsx)("ul",{children:e.map(r=>(0,sn.jsx)(Ak,{message:r,onRemove:t},r.id))})]})}var _a=z(he(),1);var St=z(he(),1);dp();var u2=z(he(),1);var c2=z(ae(),1),V6=({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,c2.jsx)(e,{"data-waniwani-shimmer":"",className:q("ww:inline-block",t),style:i,...o,children:r})},Tn=(0,u2.memo)(V6);Tn.displayName="Shimmer";var ua=z(ae(),1),d2=(0,St.createContext)(null);function f2(){let e=(0,St.useContext)(d2);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var W6=1e3,G6=1e3,Uu=(0,St.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,St.useState)(s),p=c?a:d,m=(0,St.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,S]=(0,St.useState)(void 0),w=o??x,y=(0,St.useRef)(t),[h,b]=(0,St.useState)(!1),T=(0,St.useRef)(null);(0,St.useEffect)(()=>{t?(y.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(S(Math.ceil((Date.now()-T.current)/G6)),T.current=null)},[t]),(0,St.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,St.useEffect)(()=>{if(y.current&&!t&&p&&!h){let M=setTimeout(()=>{m(!1),b(!0)},W6);return()=>clearTimeout(M)}},[t,p,h,m]);let C=(0,St.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:w}),[t,p,m,w]);return(0,ua.jsx)(d2.Provider,{value:C,children:(0,ua.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,St.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Ie(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=f2(),f=a??((p,m)=>p||m===0?(0,ua.jsx)(Tn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,ua.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,ua.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,ua.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,ua.jsxs)(ua.Fragment,{children:[!n&&(0,ua.jsx)(fr,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});Fu.displayName="ReasoningTrigger";var zu=(0,St.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=f2();return(0,ua.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,ua.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ua.jsx)("div",{className:q("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,ua.jsx)(El,{children:t})})})})});zu.displayName="ReasoningContent";var Ne=z(ae(),1),$6=500,p2=(0,_a.createContext)(null);function m2(){let e=(0,_a.useContext)(p2);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function h2({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,_a.useState)(r),d=s?n:u,f=(0,_a.useCallback)(S=>{s||c(S),o?.(S)},[s,o]),[p,m]=(0,_a.useState)(!t);(0,_a.useEffect)(()=>{if(t){m(!1);return}let S=setTimeout(()=>m(!0),$6);return()=>clearTimeout(S)},[t]);let x=(0,_a.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ne.jsx)(p2.Provider,{value:x,children:(0,Ne.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 g2({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=m2();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ne.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,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:q("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ne.jsx)("span",{className:"ww:truncate",children:l?(0,Ne.jsx)(Tn,{duration:2.6,children:d}):d})]},d)})}return(0,Ne.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,Ne.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ne.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function w2({className:e,children:t,...a}){let{open:n}=m2();return(0,Ne.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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.jsx)("div",{className:q("ww:flex ww:flex-col",e),...a,children:t})})})}function y2({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:q("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 Rx({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,_a.useState)(!1),f=a??"",p=l?(0,Ne.jsx)(Tn,{duration:1.6,children:f}):(0,Ne.jsx)("span",{className:"ww:truncate",children:f});return(0,Ne.jsxs)("div",{className:q("ww:flex ww:gap-2",e),...i,children:[(0,Ne.jsx)(y2,{icon:t,isLast:r,running:l,error:s}),(0,Ne.jsxs)("div",{className:q("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)(Qr,{className:q("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: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,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 x2({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ne.jsx)(y2,{icon:fr,isLast:t,running:e}),(0,Ne.jsx)("div",{className:q("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 Dx={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var v2={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var I2=z(he(),1);var vr=z(he(),1),X6=5,b2=400;function S2(e,t,a={}){let{msPerChar:n=X6}=a,[r,o]=(0,vr.useState)(t?"":e),i=(0,vr.useRef)(e),l=(0,vr.useRef)(t?0:e.length),s=(0,vr.useRef)(0),u=(0,vr.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,vr.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>b2&&(l.current=i.current.length-b2),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(ae(),1),_x=({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})}),Ox=({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}),K6={cjk:Dx,code:v2},Y6={cjk:Dx},Z6={enabled:!1};function Q6({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=S2(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,qu.jsx)(El,{className:q("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??Z6,plugins:a?Y6:K6,...r,children:l})}var gp=(0,I2.memo)(Q6,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);gp.displayName="MessageResponse";var Vt=z(he(),1);function Px(e){if(!(typeof e!="object"||e===null))return e}function C2(e){return Px(e?.ui)}function Nx(e){if(!e)return;let t=C2(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 C2(e)?.autoHeight===!0}function Bx(e){return Px(Px(e)?._meta)}var Te=z(ae(),1);function J6(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 e9({text:e,className:t}){let{t:a}=Ie(),[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,Te.jsx)(Bn,{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,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(Js,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copied})]}):(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(tu,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copy})]})})}function k2({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=J6(e);return(0,Te.jsxs)("div",{className:q("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,Te.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,Te.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,Te.jsx)(e9,{text:i})]}),(0,Te.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,Te.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,Te.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,Te.jsx)("code",{children:i})}):(0,Te.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Ux=(0,Vt.createContext)({open:!1,toggle:()=>{}});function T2({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Vt.useState)(t);return(0,Te.jsx)(Ux.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,Te.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 L2({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Vt.useContext)(Ux),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,Te.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,Te.jsx)(Fo,{className:"ww:size-4 ww:shrink-0"}),(0,Te.jsx)("span",{className:"ww:truncate",children:i?(0,Te.jsx)(Tn,{duration:1.6,children:l}):l}),(0,Te.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function E2({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,Te.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,Te.jsx)("span",{className:"ww:truncate",children:r?(0,Te.jsx)(Tn,{duration:1.6,children:o}):o})})}function M2({className:e,children:t,...a}){let{open:n}=(0,Vt.useContext)(Ux);return(0,Te.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,Te.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Te.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 Fx({className:e,input:t,debug:a,...n}){let{t:r}=Ie(),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,Te.jsx)(k2,{data:o,label:r.tool.request,className:e,...n})}function ju(e,t,a){if(e){let n=Nx(a?.[e]?._meta);if(n)return n}return Nx(Bx(t))}function A2(e,t,a){return e&&Hu(a?.[e]?._meta)?!0:Hu(Bx(t))}function zx({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Ie(),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,Te.jsxs)("div",{className:q("ww:space-y-2",e),...r,children:[(0,Te.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,Te.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,Te.jsx)(k2,{data:i,label:o.tool.response,className:e,...r}):null}var Vu=z(ae(),1);function R2(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function D2(e){return e.parts.some(R2)}function _2(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=>!(!R2(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function O2({className:e,...t}){let{t:a}=Ie();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)(Tn,{duration:1.6,children:a.workingIndicator.default})]})}var Qe=z(he(),1);function li(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 P2(e,t){return!li(e)&&!li(t)?null:li(e)?li(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 br=z(he(),1);var N2=(0,br.createContext)(()=>{});function B2(){return(0,br.useContext)(N2)}var U2=N2.Provider;function t9(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function Ml(e){let t=(0,br.useRef)(e);t.current=e;let a=(0,br.useRef)(!1);(0,br.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;Uo(r.paintMark),t9(()=>RC(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var F2=z(ae(),1),a9="/api/mcp/resource",n9=500,r9=0,o9=16,i9="2026-01-26",l9=300,s9=3e3,u9=3,c9=2e3;function d9(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function f9(e,t,a){return ju(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function wp({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=a9,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),h=(0,Qe.useRef)(!1),b=(0,Qe.useRef)(0),T=(0,Qe.useRef)("inline"),[C,M]=(0,Qe.useState)(r9),[D,P]=(0,Qe.useState)(void 0),L=(0,Qe.useRef)(s),$=(0,Qe.useRef)(u),H=(0,Qe.useRef)(c),F=(0,Qe.useRef)(d),W=(0,Qe.useRef)(r),V=(0,Qe.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,Qe.useCallback)(v=>l?Math.max(v+o9,0):Math.min(Math.max(v,50),n9),[l]),R=(0,Qe.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),G=B2(),ue=(0,Qe.useRef)(null),I=(0,Qe.useRef)(void 0);(0,Qe.useEffect)(()=>{let v=_C(e,G);return ue.current=v,()=>{clearTimeout(I.current),v.has("initialized")||v.report("timeout",b.current),ue.current=null}},[e,G]);let We=(0,Qe.useRef)(o);We.current=o;let Je=(0,Qe.useRef)(f);return(0,Qe.useEffect)(()=>{Je.current=f,w.current.height=-1,y.current&&(y.current.cancel(),y.current=null)},[f]),(0,Qe.useEffect)(()=>{if(!h.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 K=!1,ee=!1,we=null,Ge=null,me=setTimeout(()=>{if(K||ee||b.current>=u9)return;b.current+=1;let de=new URL(v.src);de.searchParams.set("_retry",String(b.current)),v.src=de.toString()},s9),ye=de=>{v.contentWindow?.postMessage(de,"*")},le=de=>{if(K||de.source!==v.contentWindow)return;let Q=de.data;if(!Q||typeof Q!="object"||Q.jsonrpc!=="2.0")return;let Be=Q.method,qe=Q.id;if(Be==="ui/initialize"&&qe!=null){ee=!0,ue.current?.mark("initialize"),clearTimeout(me),ye({jsonrpc:"2.0",id:qe,result:{protocolVersion:Q.params?.protocolVersion??i9,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:We.current?"dark":"light",displayMode:T.current}}});return}if(Be==="ui/notifications/initialized"){h.current=!0,ue.current?.mark("initialized"),I.current=setTimeout(()=>ue.current?.report("ok",b.current),c9);let _e=x.current,ke=S.current,xe=ke._meta&&typeof ke._meta=="object"?ke._meta:null,Y=d9(W.current),Oe=xe&&typeof xe.waniwani=="object"&&xe.waniwani!==null?xe.waniwani:null,rt=Oe||Y?{...Oe??{},...Y?{sessionId:Y}:{}}:void 0,ba=xe||rt?{...xe??{},...rt?{waniwani:rt}:{}}:void 0;ye({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:_e}});let Sa=ke.content??[{type:"text",text:JSON.stringify(ke)}];ye({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:Sa,structuredContent:ke.structuredContent,_meta:ba,meta:ba}});return}if(Be==="ui/notifications/size-changed"){clearTimeout(I.current),ue.current?.mark("firstSize"),ue.current?.report("ok",b.current);let _e=Q.params,ke=typeof _e?.height=="number"?_e.height:void 0,xe=typeof _e?.width=="number"?_e.width:void 0,Y=w.current,Oe=ke!==void 0&&ke!==Y.height,rt=xe!==void 0&&xe!==Y.width;if(!Oe&&!rt)return;if(Oe&&ke!==void 0){if(Y.height=ke,Je.current)return;let ba=N(ke),Sa=v.getBoundingClientRect().height;if(y.current&&(y.current.cancel(),y.current=null),M(ba),v.animate&&Math.abs(Sa-ba)>2){let ra=v.animate([{height:`${Sa}px`},{height:`${ba}px`}],{duration:l9,easing:"ease-out",fill:"forwards"});y.current=ra,ra.onfinish=()=>{y.current===ra&&(ra.cancel(),y.current=null)}}}rt&&l&&xe!==void 0&&(Y.width=xe,P(xe));return}if(Be==="ui/open-link"&&qe!=null){let _e=Q.params?.url;typeof _e=="string"&&(L.current?L.current(_e):window.open(_e,"_blank","noopener,noreferrer")),ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/message"&&qe!=null){if($.current&&Q.params){let _e=Q.params,ke=we;if(we=null,Ge){clearTimeout(Ge.timer);let xe=Ge.text;Ge=null;let Y=(_e.content??[]).map(Oe=>Oe.text??"").join("").trim();_e={..._e,content:[{type:"text",text:`${Y}
|
|
122
122
|
|
|
123
|
-
${ye}`}]}}$.current({..._e,...Ce?{modelContext:Ce}:{}})}be({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/update-model-context"&&qe!=null){we=_2(we,Q.params),be({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="tools/call"&&qe!=null){let _e=H.current;if(!_e){be({jsonrpc:"2.0",id:qe,error:{code:-32601,message:"tools/call not supported"}});return}let Ce=Q.params?.name;_e({name:Ce,arguments:Q.params?.arguments??{}}).then(ye=>{be({jsonrpc:"2.0",id:qe,result:ye});let Y=ye.content?.map(Oe=>Oe.text??"").join("").trim();Y&&c9(Ce,ye,V.current)&&(We&&clearTimeout(We.timer),We={text:Y,timer:setTimeout(()=>{if(K)return;let Oe=we;we=null,We=null,$.current?.({role:"user",content:[{type:"text",text:Y}],...Oe?{modelContext:Oe}:{}})},500)})}).catch(ye=>{let Y=ye instanceof Error?ye.message:"Tool call failed";be({jsonrpc:"2.0",id:qe,error:{code:-32e3,message:Y}})});return}if(Be==="ui/request-display-mode"&&qe!=null){let _e=Q.params?.mode,Ce=_e==="fullscreen"||_e==="inline"||_e==="pip"?_e:"inline";T.current=Ce,be({jsonrpc:"2.0",id:qe,result:{mode:Ce}}),be({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:Ce}}),F.current?.(Ce);return}if(Be==="ui/resource-teardown"&&qe!=null){be({jsonrpc:"2.0",id:qe,result:{}});return}Be==="ping"&&qe!=null&&be({jsonrpc:"2.0",id:qe,result:{}})};return window.addEventListener("message",le),()=>{K=!0,clearTimeout(me),We&&clearTimeout(We.timer),window.removeEventListener("message",le)}},[l,N]),(0,B2.jsx)("iframe",{ref:m,src:D,onLoad:()=>ue.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 uo=z(re(),1);function U2({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,uo.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,uo.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,uo.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,uo.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,uo.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,uo.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 F2=z(he(),1);var Ml=z(re(),1);function d9({onRetry:e}){let{t}=ke();return(0,Ml.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,Ml.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,Ml.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 F2.Component{constructor(){super(...arguments);ne(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,Ml.jsx)(d9,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var Le=z(re(),1);function Fx(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function z2(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?au:Uo}function q2({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}=ke(),w=e[e.length-1],y=e.length>0,h=d!=null,b=!h&&R2(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,Le.jsxs)(Le.Fragment,{children:[!h&&(!y&&n?(0,Le.jsx)(U2,{...n,onSuggestionSelect:r}):a&&(0,Le.jsx)(Rx,{from:"assistant",children:(0,Le.jsx)(Dx,{children:(0,Le.jsx)(hp,{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=uk(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=h?L.some(N=>N.toolCallId===d):!1,V=p!==!1&&!W&&$.length>=2;return h&&!W?(0,Le.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!A2(T)?(0,Le.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||!Hu(N.toolName,D,m)})?(0,Le.jsx)("div",{style:{display:"none"}},T.id):(0,Le.jsxs)(Rx,{from:T.role,className:x?.message,children:[p!==!1&&!W&&!V&&M.map((N,D)=>(0,Le.jsxs)(Bu,{isStreaming:N.state==="streaming",children:[(0,Le.jsx)(Uu,{}),(0,Le.jsx)(Fu,{children:N.text})]},`reasoning-${T.id}-${D}`)),V&&(()=>{let N=$[$.length-1],D=N.type==="reasoning"?{icon:fr,label:S.reasoning.thinking}:{icon:z2(N.toolName),label:N.title??Fx(N.toolName)};return(0,Le.jsxs)(p2,{isWorking:H&&(t==="streaming"||t==="submitted"),activeStep:D,children:[(0,Le.jsx)(m2,{workingLabel:S.chainOfThought.working,label:S.chainOfThought.done}),(0,Le.jsx)(h2,{children:$.map((G,ue)=>{let I=ue===$.length-1;if(G.type==="reasoning")return(0,Le.jsx)(w2,{isStreaming:G.state==="streaming",isLast:I,children:G.text},`reasoning-${T.id}-${ue}`);let Ve=G.title??Fx(G.toolName),et=z2(G.toolName);if(p==="titles-only")return(0,Le.jsx)(Mx,{icon:et,title:Ve,state:G.state,isLast:I},G.toolCallId);let v="output"in G?G.output:void 0;return(0,Le.jsxs)(Mx,{icon:et,title:Ve,state:G.state,isLast:I,children:[(0,Le.jsx)(Bx,{input:G.input,debug:f}),v!==void 0&&(0,Le.jsx)(Ux,{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??Fx(N.toolName);if(p==="titles-only")return(0,Le.jsx)(T2,{title:D,state:N.state});let G="output"in N?N.output:void 0;return(0,Le.jsxs)(C2,{children:[(0,Le.jsx)(k2,{title:D,state:N.state}),(0,Le.jsxs)(L2,{children:[(0,Le.jsx)(Bx,{input:N.input,debug:f}),G!==void 0&&(0,Le.jsx)(Ux,{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=Hu(N.toolName,D,m),ue=E2(N.toolName,D,m),I=N.toolCallId===d;return G&&o&&D!==void 0?(0,Le.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,Le.jsx)(wp,{children:(0,Le.jsx)(gp,{isFullscreen:I,resourceUri:G,toolInput:N.input??{},toolResult:{content:D.content,structuredContent:D.structuredContent,_meta:D._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:ue,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:ue}):void 0})})},N.toolCallId):null}),!W&&P.length>0&&(0,Le.jsx)(ck,{documents:P}),!W&&(0,Le.jsx)("div",{children:(0,Le.jsxs)(Dx,{className:q(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[R.length>0&&(0,Le.jsx)(lk,{files:R}),F?C.map((N,D)=>{let G=H&&t==="streaming"&&D===C.length-1;return(0,Le.jsx)(hp,{isStreaming:G,children:N.type==="text"?N.text:""},`${T.id}-${D}`)}):null]})})]},T.id)}),b&&(0,Le.jsx)(D2,{})]})}var Vu=z(re(),1),f9="https://app.waniwani.ai/assets/waniwani-logo.svg",p9="https://waniwani.ai";function H2(){let{t:e}=ke();return(0,Vu.jsxs)("a",{href:p9,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,Vu.jsx)("span",{children:e.poweredBy.label}),(0,Vu.jsx)("img",{src:f9,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var Al=z(he(),1);var Ke=z(re(),1),j2=20;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)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ke.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function h9({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 g9({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 V2({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=ke(),[l,s]=(0,Al.useState)(!1),u=(0,Al.useRef)(null);(0,Al.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,j2),d=Math.max(0,e.length-j2);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)(m9,{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)(h9,{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)?"":ew(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)(g9,{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 yp=z(he(),1);function Rl(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 W2(){return{subscribe(){return()=>{}},emit(){}}}var G2=(0,yp.createContext)(W2());function xp(){return(0,yp.useContext)(G2)}var Dl=G2.Provider;var vp=z(he(),1);function $2(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 pn=z(he(),1);var SD="vercel.ai.error",w9=Symbol.for(SD),X2,K2,Fe=class ID extends(K2=Error,X2=w9,K2){constructor({name:t,message:a,cause:n}){super(a),this[X2]=!0,this.name=t,this.cause=n}static isInstance(t){return ID.hasMarker(t,SD)}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}},CD="AI_APICallError",kD=`vercel.ai.error.${CD}`,y9=Symbol.for(kD),Y2,Z2,Vie=class extends(Z2=Fe,Y2=y9,Z2){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:CD,message:e,cause:i}),this[Y2]=!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 Fe.hasMarker(e,kD)}},TD="AI_EmptyResponseBodyError",LD=`vercel.ai.error.${TD}`,x9=Symbol.for(LD),Q2,J2,Wie=class extends(J2=Fe,Q2=x9,J2){constructor({message:e="Empty response body"}={}){super({name:TD,message:e}),this[Q2]=!0}static isInstance(e){return Fe.hasMarker(e,LD)}};function ED(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var MD="AI_InvalidArgumentError",AD=`vercel.ai.error.${MD}`,v9=Symbol.for(AD),eD,tD,RD=class extends(tD=Fe,eD=v9,tD){constructor({message:e,cause:t,argument:a}){super({name:MD,message:e,cause:t}),this[eD]=!0,this.argument=a}static isInstance(e){return Fe.hasMarker(e,AD)}},DD="AI_InvalidPromptError",_D=`vercel.ai.error.${DD}`,b9=Symbol.for(_D),aD,nD,Gie=class extends(nD=Fe,aD=b9,nD){constructor({prompt:e,message:t,cause:a}){super({name:DD,message:`Invalid prompt: ${t}`,cause:a}),this[aD]=!0,this.prompt=e}static isInstance(e){return Fe.hasMarker(e,_D)}},OD="AI_InvalidResponseDataError",PD=`vercel.ai.error.${OD}`,S9=Symbol.for(PD),rD,oD,$ie=class extends(oD=Fe,rD=S9,oD){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:OD,message:t}),this[rD]=!0,this.data=e}static isInstance(e){return Fe.hasMarker(e,PD)}},ND="AI_JSONParseError",BD=`vercel.ai.error.${ND}`,I9=Symbol.for(BD),iD,lD,qx=class extends(lD=Fe,iD=I9,lD){constructor({text:e,cause:t}){super({name:ND,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
|
+
${xe}`}]}}$.current({..._e,...ke?{modelContext:ke}:{}})}ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/update-model-context"&&qe!=null){we=P2(we,Q.params),ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="tools/call"&&qe!=null){let _e=H.current;if(!_e){ye({jsonrpc:"2.0",id:qe,error:{code:-32601,message:"tools/call not supported"}});return}let ke=Q.params?.name;_e({name:ke,arguments:Q.params?.arguments??{}}).then(xe=>{ye({jsonrpc:"2.0",id:qe,result:xe});let Y=xe.content?.map(Oe=>Oe.text??"").join("").trim();Y&&f9(ke,xe,V.current)&&(Ge&&clearTimeout(Ge.timer),Ge={text:Y,timer:setTimeout(()=>{if(K)return;let Oe=we;we=null,Ge=null,$.current?.({role:"user",content:[{type:"text",text:Y}],...Oe?{modelContext:Oe}:{}})},500)})}).catch(xe=>{let Y=xe instanceof Error?xe.message:"Tool call failed";ye({jsonrpc:"2.0",id:qe,error:{code:-32e3,message:Y}})});return}if(Be==="ui/request-display-mode"&&qe!=null){let _e=Q.params?.mode,ke=_e==="fullscreen"||_e==="inline"||_e==="pip"?_e:"inline";T.current=ke,ye({jsonrpc:"2.0",id:qe,result:{mode:ke}}),ye({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ke}}),F.current?.(ke);return}if(Be==="ui/resource-teardown"&&qe!=null){ye({jsonrpc:"2.0",id:qe,result:{}});return}Be==="ping"&&qe!=null&&ye({jsonrpc:"2.0",id:qe,result:{}})};return window.addEventListener("message",le),()=>{K=!0,clearTimeout(me),Ge&&clearTimeout(Ge.timer),window.removeEventListener("message",le)}},[l,N]),(0,F2.jsx)("iframe",{ref:m,src:R,onLoad:()=>ue.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||!D?void 0:`min(${D}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var uo=z(ae(),1);function z2({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,uo.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,uo.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,uo.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,uo.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,uo.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,uo.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 q2=z(he(),1);var Al=z(ae(),1);function p9({onRetry:e}){let{t}=Ie();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 q2.Component{constructor(){super(...arguments);re(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)(p9,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var Le=z(ae(),1);function qx(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function H2(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?nu:Fo}function j2({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}=Ie(),w=e[e.length-1],y=e.length>0,h=d!=null,b=!h&&_2(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,Le.jsxs)(Le.Fragment,{children:[!h&&(!y&&n?(0,Le.jsx)(z2,{...n,onSuggestionSelect:r}):a&&(0,Le.jsx)(_x,{from:"assistant",children:(0,Le.jsx)(Ox,{children:(0,Le.jsx)(gp,{children:a})})})),e.map(T=>{let C=T.parts.filter(N=>N.type==="text"),M=T.parts.filter(N=>N.type==="reasoning"),D=T.parts.filter(N=>N.type==="file"),P=dk(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=h?L.some(N=>N.toolCallId===d):!1,V=p!==!1&&!W&&$.length>=2;return h&&!W?(0,Le.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!D2(T)?(0,Le.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!F&&D.length===0&&L.every(N=>{let R="output"in N?N.output:void 0;return R===void 0||!o||!ju(N.toolName,R,m)})?(0,Le.jsx)("div",{style:{display:"none"}},T.id):(0,Le.jsxs)(_x,{from:T.role,className:x?.message,children:[p!==!1&&!W&&!V&&M.map((N,R)=>(0,Le.jsxs)(Uu,{isStreaming:N.state==="streaming",children:[(0,Le.jsx)(Fu,{}),(0,Le.jsx)(zu,{children:N.text})]},`reasoning-${T.id}-${R}`)),V&&(()=>{let N=$[$.length-1],R=N.type==="reasoning"?{icon:fr,label:S.reasoning.thinking}:{icon:H2(N.toolName),label:N.title??qx(N.toolName)};return(0,Le.jsxs)(h2,{isWorking:H&&(t==="streaming"||t==="submitted"),activeStep:R,children:[(0,Le.jsx)(g2,{workingLabel:S.chainOfThought.working,label:S.chainOfThought.done}),(0,Le.jsx)(w2,{children:$.map((G,ue)=>{let I=ue===$.length-1;if(G.type==="reasoning")return(0,Le.jsx)(x2,{isStreaming:G.state==="streaming",isLast:I,children:G.text},`reasoning-${T.id}-${ue}`);let We=G.title??qx(G.toolName),Je=H2(G.toolName);if(p==="titles-only")return(0,Le.jsx)(Rx,{icon:Je,title:We,state:G.state,isLast:I},G.toolCallId);let v="output"in G?G.output:void 0;return(0,Le.jsxs)(Rx,{icon:Je,title:We,state:G.state,isLast:I,children:[(0,Le.jsx)(Fx,{input:G.input,debug:f}),v!==void 0&&(0,Le.jsx)(zx,{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],R=N.title??qx(N.toolName);if(p==="titles-only")return(0,Le.jsx)(E2,{title:R,state:N.state});let G="output"in N?N.output:void 0;return(0,Le.jsxs)(T2,{children:[(0,Le.jsx)(L2,{title:R,state:N.state}),(0,Le.jsxs)(M2,{children:[(0,Le.jsx)(Fx,{input:N.input,debug:f}),G!==void 0&&(0,Le.jsx)(zx,{output:G,errorText:"errorText"in N?N.errorText:void 0,debug:f})]})]})})(),L.map(N=>{let R="output"in N?N.output:void 0,G=ju(N.toolName,R,m),ue=A2(N.toolName,R,m),I=N.toolCallId===d;return G&&o&&R!==void 0?(0,Le.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&&R!==void 0&&(0,Le.jsx)(yp,{children:(0,Le.jsx)(wp,{isFullscreen:I,resourceUri:G,toolInput:N.input??{},toolResult:{content:R.content,structuredContent:R.structuredContent,_meta:R._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:ue,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?We=>c(We,{toolCallId:N.toolCallId,resourceUri:G,toolInput:N.input??{},toolResult:{content:R.content,structuredContent:R.structuredContent,_meta:R._meta},autoHeight:ue}):void 0})})},N.toolCallId):null}),!W&&P.length>0&&(0,Le.jsx)(fk,{documents:P}),!W&&(0,Le.jsx)("div",{children:(0,Le.jsxs)(Ox,{className:q(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[D.length>0&&(0,Le.jsx)(uk,{files:D}),F?C.map((N,R)=>{let G=H&&t==="streaming"&&R===C.length-1;return(0,Le.jsx)(gp,{isStreaming:G,children:N.type==="text"?N.text:""},`${T.id}-${R}`)}):null]})})]},T.id)}),b&&(0,Le.jsx)(O2,{})]})}var co=z(ae(),1);function m9({label:e}){return(0,co.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,co.jsx)("title",{children:e}),(0,co.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,co.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function xp({onClick:e}){let{t}=Ie();return(0,co.jsx)("button",{type:"button",onClick:e,title:t.threadMenu.newChat,"aria-label":t.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,co.jsx)(m9,{label:t.threadMenu.newChat})})}var Wu=z(ae(),1),h9="https://app.waniwani.ai/assets/waniwani-logo.svg",g9="https://waniwani.ai";function V2(){let{t:e}=Ie();return(0,Wu.jsxs)("a",{href:g9,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:h9,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var Rl=z(he(),1);var ut=z(ae(),1),W2=20;function w9({label:e}){return(0,ut.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,ut.jsx)("title",{children:e}),(0,ut.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,ut.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,ut.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,ut.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function y9({label:e}){return(0,ut.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,ut.jsx)("title",{children:e}),(0,ut.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,ut.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,ut.jsx)("path",{d:"M10 11v6"}),(0,ut.jsx)("path",{d:"M14 11v6"})]})}function G2({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Ie(),[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,W2),d=Math.max(0,e.length-W2);return(0,ut.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,ut.jsx)(xp,{onClick:a}),(0,ut.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,ut.jsx)(w9,{label:i.threadMenu.threadHistory})}),l&&(0,ut.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,ut.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,ut.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,ut.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,ut.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,ut.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":aw(m,o)})]}),(0,ut.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,ut.jsx)(y9,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,ut.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 vp=z(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 $2(){return{subscribe(){return()=>{}},emit(){}}}var X2=(0,vp.createContext)($2());function bp(){return(0,vp.useContext)(X2)}var _l=X2.Provider;var Sp=z(he(),1);function K2(e){let t=(0,Sp.useRef)(e);return t.current=e,(0,Sp.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 pn=z(he(),1);var CD="vercel.ai.error",x9=Symbol.for(CD),Y2,Z2,Fe=class kD extends(Z2=Error,Y2=x9,Z2){constructor({name:t,message:a,cause:n}){super(a),this[Y2]=!0,this.name=t,this.cause=n}static isInstance(t){return kD.hasMarker(t,CD)}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}},TD="AI_APICallError",LD=`vercel.ai.error.${TD}`,v9=Symbol.for(LD),Q2,J2,Kie=class extends(J2=Fe,Q2=v9,J2){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:TD,message:e,cause:i}),this[Q2]=!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 Fe.hasMarker(e,LD)}},ED="AI_EmptyResponseBodyError",MD=`vercel.ai.error.${ED}`,b9=Symbol.for(MD),eD,tD,Yie=class extends(tD=Fe,eD=b9,tD){constructor({message:e="Empty response body"}={}){super({name:ED,message:e}),this[eD]=!0}static isInstance(e){return Fe.hasMarker(e,MD)}};function AD(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var RD="AI_InvalidArgumentError",DD=`vercel.ai.error.${RD}`,S9=Symbol.for(DD),aD,nD,_D=class extends(nD=Fe,aD=S9,nD){constructor({message:e,cause:t,argument:a}){super({name:RD,message:e,cause:t}),this[aD]=!0,this.argument=a}static isInstance(e){return Fe.hasMarker(e,DD)}},OD="AI_InvalidPromptError",PD=`vercel.ai.error.${OD}`,I9=Symbol.for(PD),rD,oD,Zie=class extends(oD=Fe,rD=I9,oD){constructor({prompt:e,message:t,cause:a}){super({name:OD,message:`Invalid prompt: ${t}`,cause:a}),this[rD]=!0,this.prompt=e}static isInstance(e){return Fe.hasMarker(e,PD)}},ND="AI_InvalidResponseDataError",BD=`vercel.ai.error.${ND}`,C9=Symbol.for(BD),iD,lD,Qie=class extends(lD=Fe,iD=C9,lD){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:ND,message:t}),this[iD]=!0,this.data=e}static isInstance(e){return Fe.hasMarker(e,BD)}},UD="AI_JSONParseError",FD=`vercel.ai.error.${UD}`,k9=Symbol.for(FD),sD,uD,jx=class extends(uD=Fe,sD=k9,uD){constructor({text:e,cause:t}){super({name:UD,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
+
Error message: ${AD(t)}`,cause:t}),this[sD]=!0,this.text=e}static isInstance(e){return Fe.hasMarker(e,FD)}},zD="AI_LoadAPIKeyError",qD=`vercel.ai.error.${zD}`,T9=Symbol.for(qD),cD,dD,Jie=class extends(dD=Fe,cD=T9,dD){constructor({message:e}){super({name:zD,message:e}),this[cD]=!0}static isInstance(e){return Fe.hasMarker(e,qD)}},HD="AI_LoadSettingError",jD=`vercel.ai.error.${HD}`,L9=Symbol.for(jD),fD,pD,ele=class extends(pD=Fe,fD=L9,pD){constructor({message:e}){super({name:HD,message:e}),this[fD]=!0}static isInstance(e){return Fe.hasMarker(e,jD)}},VD="AI_NoContentGeneratedError",WD=`vercel.ai.error.${VD}`,E9=Symbol.for(WD),mD,hD,tle=class extends(hD=Fe,mD=E9,hD){constructor({message:e="No content generated."}={}){super({name:VD,message:e}),this[mD]=!0}static isInstance(e){return Fe.hasMarker(e,WD)}},GD="AI_NoSuchModelError",$D=`vercel.ai.error.${GD}`,M9=Symbol.for($D),gD,wD,ale=class extends(wD=Fe,gD=M9,wD){constructor({errorName:e=GD,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[gD]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return Fe.hasMarker(e,$D)}},XD="AI_TooManyEmbeddingValuesForCallError",KD=`vercel.ai.error.${XD}`,A9=Symbol.for(KD),yD,xD,nle=class extends(xD=Fe,yD=A9,xD){constructor(e){super({name:XD,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[yD]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Fe.hasMarker(e,KD)}},YD="AI_TypeValidationError",ZD=`vercel.ai.error.${YD}`,R9=Symbol.for(ZD),vD,bD,qn=class Hx extends(bD=Fe,vD=R9,bD){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:YD,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
125
|
+
Error message: ${AD(a)}`,cause:a}),this[vD]=!0,this.value=t,this.context=n}static isInstance(t){return Fe.hasMarker(t,ZD)}static wrap({value:t,cause:a,context:n}){var r,o,i;return Hx.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 Hx({value:t,cause:a,context:n})}},QD="AI_UnsupportedFunctionalityError",JD=`vercel.ai.error.${QD}`,D9=Symbol.for(JD),SD,ID,rle=class extends(ID=Fe,SD=D9,ID){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:QD,message:t}),this[SD]=!0,this.functionality=e}static isInstance(e){return Fe.hasMarker(e,JD)}};var Ip=()=>Wx,Wx=new Proxy(Ip,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Ip},apply(){return Wx}}),Vx=class extends Error{constructor(){super(...arguments);re(this,"issues",[])}},g=new Proxy(Ip,{get(e,t){return t==="ZodError"?Vx:t==="NEVER"?Symbol("NEVER"):Ip},apply(){return Wx}});var ge={};var Cp=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 Gx(e){}function e_(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=Gx,onError:a=Gx,onRetry:n=Gx,onComment:r}=e,o="",i=!0,l,s="",u="";function c(x){let S=i?x.replace(/^\xEF\xBB\xBF/,""):x,[w,y]=_9(`${o}${S}`);for(let h of w)d(h);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,h=x.slice(S+y);f(w,h,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 Cp(`Invalid \`retry\` value: "${S}"`,{type:"invalid-retry",value:S,line:w}));break;default:a(new Cp(`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 _9(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=QD({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:wle,atob:yle}=globalThis;var r_="AI_DownloadError",o_=`vercel.ai.error.${r_}`,D9=Symbol.for(o_),JD,e_,dn=class extends(e_=Fe,JD=D9,e_){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:r_,message:r,cause:n}),this[JD]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Fe.hasMarker(e,o_)}},Yx=2*1024*1024*1024;async function i_({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 dn({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 dn({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 dn({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new dn({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new dn({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new dn({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(_9(n))throw new dn({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(l_(a)){if($x(a))throw new dn({url:e,message:`URL with IP address ${a} is not allowed`});return}}function l_(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 _9(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(l_(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 Sr=({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 RD({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},s_=Sr();function u_(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 co(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(co(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var O9=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,P9=/"(?: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 t_(e){let t=JSON.parse(e);return t===null||typeof t!="object"||O9.test(e)===!1&&P9.test(e)===!1?t:N9(t)}function N9(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 B9(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return t_(e)}try{return t_(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]=li(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(li):li(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(li)),e.allOf!=null&&(e.allOf=e.allOf.map(li)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(li));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=li(t[a]);return e}function li(e){return typeof e=="boolean"?e:Qx(e)}var U9=Symbol("Let zodToJsonSchema decide on which parser to use"),a_={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"},F9=e=>typeof e=="string"?{...a_,name:e}:{...a_,...e};function Ka(){return{}}function z9(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)!==ge.ZodAny&&(o.items=rt(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 q9(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 H9(){return{type:"boolean"}}function c_(e,t){return rt(e.type._def,t)}var j9=(e,t)=>rt(e.innerType._def,t);function d_(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>d_(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 V9(e)}}var V9=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 W9(e,t){return{...rt(e.innerType._def,t),default:e.defaultValue()}}function G9(e,t){return t.effectStrategy==="input"?rt(e.schema._def,t):Ka()}function $9(e){return{type:"string",enum:Array.from(e.values)}}var X9=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function K9(e,t){let a=[rt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),rt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(X9(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 Y9(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,Ln={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 f_(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":En(a,"email",n.message,t);break;case"format:idn-email":En(a,"idn-email",n.message,t);break;case"pattern:zod":xa(a,Ln.email,n.message,t);break}break;case"url":En(a,"uri",n.message,t);break;case"uuid":En(a,"uuid",n.message,t);break;case"regex":xa(a,n.regex,n.message,t);break;case"cuid":xa(a,Ln.cuid,n.message,t);break;case"cuid2":xa(a,Ln.cuid2,n.message,t);break;case"startsWith":xa(a,RegExp(`^${Gx(n.value,t)}`),n.message,t);break;case"endsWith":xa(a,RegExp(`${Gx(n.value,t)}$`),n.message,t);break;case"datetime":En(a,"date-time",n.message,t);break;case"date":En(a,"date",n.message,t);break;case"time":En(a,"time",n.message,t);break;case"duration":En(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":{xa(a,RegExp(Gx(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&En(a,"ipv4",n.message,t),n.version!=="v4"&&En(a,"ipv6",n.message,t);break}case"base64url":xa(a,Ln.base64url,n.message,t);break;case"jwt":xa(a,Ln.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&xa(a,Ln.ipv4Cidr,n.message,t),n.version!=="v4"&&xa(a,Ln.ipv6Cidr,n.message,t);break}case"emoji":xa(a,Ln.emoji(),n.message,t);break;case"ulid":{xa(a,Ln.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{En(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{xa(a,Ln.base64,n.message,t);break}}break}case"nanoid":xa(a,Ln.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Gx(e,t){return t.patternStrategy==="escape"?Q9(e):e}var Z9=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Q9(e){let t="";for(let a=0;a<e.length;a++)Z9.has(e[a])||(t+="\\"),t+=e[a];return t}function En(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 xa(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:n_(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=n_(t,n)}function n_(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 kp=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=e_({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:Sle,atob:Ile}=globalThis;var i_="AI_DownloadError",l_=`vercel.ai.error.${i_}`,O9=Symbol.for(l_),t_,a_,dn=class extends(a_=Fe,t_=O9,a_){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:i_,message:r,cause:n}),this[t_]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Fe.hasMarker(e,l_)}},Qx=2*1024*1024*1024;async function s_({response:e,url:t,maxBytes:a=Qx}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new dn({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 dn({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 Jx(e){let t;try{t=new URL(e)}catch{throw new dn({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new dn({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new dn({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new dn({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(P9(n))throw new dn({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(u_(a)){if(Kx(a))throw new dn({url:e,message:`URL with IP address ${a} is not allowed`});return}}function u_(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 Kx(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 P9(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(u_(a))return Kx(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 Kx(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var Sr=({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 _D({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},c_=Sr();function d_(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 fo(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 Tp(e,...t){let a=new Headers(fo(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var N9=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,B9=/"(?: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 n_(e){let t=JSON.parse(e);return t===null||typeof t!="object"||N9.test(e)===!1&&B9.test(e)===!1?t:U9(t)}function U9(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 F9(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return n_(e)}try{return n_(e)}finally{Error.stackTraceLimit=t}}function ev(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]=si(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(si):si(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(si)),e.allOf!=null&&(e.allOf=e.allOf.map(si)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(si));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=si(t[a]);return e}function si(e){return typeof e=="boolean"?e:ev(e)}var z9=Symbol("Let zodToJsonSchema decide on which parser to use"),r_={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"},q9=e=>typeof e=="string"?{...r_,name:e}:{...r_,...e};function Ka(){return{}}function H9(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)!==ge.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 j9(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 V9(){return{type:"boolean"}}function f_(e,t){return nt(e.type._def,t)}var W9=(e,t)=>nt(e.innerType._def,t);function p_(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>p_(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 G9(e)}}var G9=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 $9(e,t){return{...nt(e.innerType._def,t),default:e.defaultValue()}}function X9(e,t){return t.effectStrategy==="input"?nt(e.schema._def,t):Ka()}function K9(e){return{type:"string",enum:Array.from(e.values)}}var Y9=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Z9(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(Y9(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 Q9(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 $x=void 0,Ln={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:()=>($x===void 0&&($x=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$x),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 m_(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":En(a,"email",n.message,t);break;case"format:idn-email":En(a,"idn-email",n.message,t);break;case"pattern:zod":xa(a,Ln.email,n.message,t);break}break;case"url":En(a,"uri",n.message,t);break;case"uuid":En(a,"uuid",n.message,t);break;case"regex":xa(a,n.regex,n.message,t);break;case"cuid":xa(a,Ln.cuid,n.message,t);break;case"cuid2":xa(a,Ln.cuid2,n.message,t);break;case"startsWith":xa(a,RegExp(`^${Xx(n.value,t)}`),n.message,t);break;case"endsWith":xa(a,RegExp(`${Xx(n.value,t)}$`),n.message,t);break;case"datetime":En(a,"date-time",n.message,t);break;case"date":En(a,"date",n.message,t);break;case"time":En(a,"time",n.message,t);break;case"duration":En(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":{xa(a,RegExp(Xx(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&En(a,"ipv4",n.message,t),n.version!=="v4"&&En(a,"ipv6",n.message,t);break}case"base64url":xa(a,Ln.base64url,n.message,t);break;case"jwt":xa(a,Ln.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&xa(a,Ln.ipv4Cidr,n.message,t),n.version!=="v4"&&xa(a,Ln.ipv6Cidr,n.message,t);break}case"emoji":xa(a,Ln.emoji(),n.message,t);break;case"ulid":{xa(a,Ln.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{En(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{xa(a,Ln.base64,n.message,t);break}}break}case"nanoid":xa(a,Ln.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Xx(e,t){return t.patternStrategy==="escape"?ej(e):e}var J9=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ej(e){let t="";for(let a=0;a<e.length;a++)J9.has(e[a])||(t+="\\"),t+=e[a];return t}function En(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 xa(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:o_(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=o_(t,n)}function o_(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 p_(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ge.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=f_(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ge.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ge.ZodBranded&&e.keyType._def.type._def.typeName===ge.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=c_(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function J9(e,t){if(t.mapStrategy==="record")return p_(e,t);let a=rt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ka(),n=rt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ka();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function ej(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 tj(){return{not:Ka()}}function aj(){return{type:"null"}}var Xx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function nj(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 rj(e,t)}var rj=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>rt(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 oj(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=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function ij(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 lj(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=uj(l),u=rt(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=sj(e,t);return o!==void 0&&(a.additionalProperties=o),a}function sj(e,t){if(e.catchall._def.typeName!=="ZodNever")return rt(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 uj(e){try{return e.isOptional()}catch{return!0}}var cj=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return rt(e.innerType._def,t);let n=rt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Ka()},n]}:Ka()},dj=(e,t)=>{if(t.pipeStrategy==="input")return rt(e.in._def,t);if(t.pipeStrategy==="output")return rt(e.out._def,t);let a=rt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=rt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function fj(e,t){return rt(e.type._def,t)}function pj(e,t){let n={type:"array",uniqueItems:!0,items:rt(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 mj(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>rt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:rt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>rt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function hj(){return{not:Ka()}}function gj(){return Ka()}var wj=(e,t)=>rt(e.innerType._def,t),yj=(e,t,a)=>{switch(t){case ge.ZodString:return f_(e,a);case ge.ZodNumber:return ij(e);case ge.ZodObject:return lj(e,a);case ge.ZodBigInt:return q9(e);case ge.ZodBoolean:return H9();case ge.ZodDate:return d_(e,a);case ge.ZodUndefined:return hj();case ge.ZodNull:return aj();case ge.ZodArray:return z9(e,a);case ge.ZodUnion:case ge.ZodDiscriminatedUnion:return nj(e,a);case ge.ZodIntersection:return K9(e,a);case ge.ZodTuple:return mj(e,a);case ge.ZodRecord:return p_(e,a);case ge.ZodLiteral:return Y9(e);case ge.ZodEnum:return $9(e);case ge.ZodNativeEnum:return ej(e);case ge.ZodNullable:return oj(e,a);case ge.ZodOptional:return cj(e,a);case ge.ZodMap:return J9(e,a);case ge.ZodSet:return pj(e,a);case ge.ZodLazy:return()=>e.getter()._def;case ge.ZodPromise:return fj(e,a);case ge.ZodNaN:case ge.ZodNever:return tj();case ge.ZodEffects:return G9(e,a);case ge.ZodAny:return Ka();case ge.ZodUnknown:return gj();case ge.ZodDefault:return W9(e,a);case ge.ZodBranded:return c_(e,a);case ge.ZodReadonly:return wj(e,a);case ge.ZodCatch:return j9(e,a);case ge.ZodPipeline:return dj(e,a);case ge.ZodFunction:case ge.ZodVoid:case ge.ZodSymbol:return;default:return(n=>{})(t)}},xj=(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 rt(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!==U9)return s}if(r&&!a){let s=vj(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=yj(e,e.typeName,t),l=typeof i=="function"?rt(i(),t):i;if(l&&bj(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var vj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:xj(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`),Ka()):t.$refStrategy==="seen"?Ka():void 0}},bj=(e,t,a)=>(e.description&&(a.description=e.description),a),Sj=e=>{let t=F9(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}]))}},Ij=(e,t)=>{var a;let n=Sj(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=rt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Ka()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=rt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Ka(),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 Cj(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}):Cj(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Gu(e):kj(e):e()}function kj(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 qn({value:t,cause:a.issues})}}})}function Tj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Tp(()=>Ij(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 Lj(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 Ej(e){return"_zod"in e}function Gu(e,t){return Ej(e)?Lj(e,t):Tj(e,t)}async function Ep({value:e,schema:t,context:a}){let n=await _l({value:e,schema:t,context:a});if(!n.success)throw qn.wrap({value:e,cause:n.error,context:a});return n.value}async function _l({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:qn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:qn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function Ir({text:e,schema:t}){try{let a=B9(e);return t==null?{success:!0,value:a,rawValue:a}:await _l({value:a,schema:t})}catch(a){return{success:!1,error:qx.isInstance(a)?a:new qx({text:e,cause:a}),rawValue:void 0}}}function m_({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 Ir({text:a,schema:t}))}}))}async function Hn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Aj=Object.defineProperty,Rj=(e,t)=>{for(var a in t)Aj(e,a,{get:t[a],enumerable:!0})},Dj="AI_InvalidArgumentError",_j=`vercel.ai.error.${Dj}`,Oj=Symbol.for(_j),Pj;Pj=Oj;var Nj="AI_InvalidStreamPartError",Bj=`vercel.ai.error.${Nj}`,Uj=Symbol.for(Bj),Fj;Fj=Uj;var zj="AI_InvalidToolApprovalError",qj=`vercel.ai.error.${zj}`,Hj=Symbol.for(qj),jj;jj=Hj;var Vj="AI_InvalidToolInputError",Wj=`vercel.ai.error.${Vj}`,Gj=Symbol.for(Wj),$j;$j=Gj;var Xj="AI_ToolCallNotFoundForApprovalError",Kj=`vercel.ai.error.${Xj}`,Yj=Symbol.for(Kj),Zj;Zj=Yj;var Qj="AI_MissingToolResultsError",Jj=`vercel.ai.error.${Qj}`,e8=Symbol.for(Jj),t8;t8=e8;var a8="AI_NoImageGeneratedError",n8=`vercel.ai.error.${a8}`,r8=Symbol.for(n8),o8;o8=r8;var g_="AI_NoObjectGeneratedError",w_=`vercel.ai.error.${g_}`,i8=Symbol.for(w_),y_,fo=class extends Fe{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:g_,message:e,cause:t}),this[y_]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Fe.hasMarker(e,w_)}};y_=i8;var l8="AI_NoOutputGeneratedError",s8=`vercel.ai.error.${l8}`,u8=Symbol.for(s8),c8;c8=u8;var d8="AI_NoSpeechGeneratedError",f8=`vercel.ai.error.${d8}`,p8=Symbol.for(f8),m8;m8=p8;var h8="AI_NoTranscriptGeneratedError",g8=`vercel.ai.error.${h8}`,w8=Symbol.for(g8),y8;y8=w8;var x8="AI_NoVideoGeneratedError",v8=`vercel.ai.error.${x8}`,b8=Symbol.for(v8),S8;S8=b8;var I8="AI_NoSuchToolError",C8=`vercel.ai.error.${I8}`,k8=Symbol.for(C8),T8;T8=k8;var L8="AI_ToolCallRepairError",E8=`vercel.ai.error.${L8}`,M8=Symbol.for(E8),A8;A8=M8;var x_="AI_UIMessageStreamError",v_=`vercel.ai.error.${x_}`,R8=Symbol.for(v_),b_,Ol=class extends Fe{constructor({chunkType:e,chunkId:t,message:a}){super({name:x_,message:a}),this[b_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Fe.hasMarker(e,v_)}};b_=R8;var D8="AI_InvalidDataContentError",_8=`vercel.ai.error.${D8}`,O8=Symbol.for(_8),P8;P8=O8;var N8="AI_InvalidMessageRoleError",B8=`vercel.ai.error.${N8}`,U8=Symbol.for(B8),F8;F8=U8;var z8="AI_MessageConversionError",q8=`vercel.ai.error.${z8}`,H8=Symbol.for(q8),j8;j8=H8;var V8="AI_RetryError",W8=`vercel.ai.error.${V8}`,G8=Symbol.for(W8),$8;$8=G8;var X8="6.0.141",K8=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/${X8}`,u_()),signal:a});if(o.redirected&&Zx(o.url),!o.ok)throw new dn({url:r,statusCode:o.status,statusText:o.statusText});return{data:await i_({response:o,url:r,maxBytes:t??Yx}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw dn.isInstance(o)?o:new dn({url:r,cause:o})}};var S_=g.union([g.string(),g.instanceof(Uint8Array),g.instanceof(ArrayBuffer),g.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 $u=g.lazy(()=>g.union([g.null(),g.string(),g.number(),g.boolean(),g.record(g.string(),$u.optional()),g.array($u)])),te=g.record(g.string(),g.record(g.string(),$u.optional())),I_=g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),Y8=g.object({type:g.literal("image"),image:g.union([S_,g.instanceof(URL)]),mediaType:g.string().optional(),providerOptions:te.optional()}),C_=g.object({type:g.literal("file"),data:g.union([S_,g.instanceof(URL)]),filename:g.string().optional(),mediaType:g.string(),providerOptions:te.optional()}),Z8=g.object({type:g.literal("reasoning"),text:g.string(),providerOptions:te.optional()}),Q8=g.object({type:g.literal("tool-call"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerOptions:te.optional(),providerExecuted:g.boolean().optional()}),J8=g.discriminatedUnion("type",[g.object({type:g.literal("text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("json"),value:$u,providerOptions:te.optional()}),g.object({type:g.literal("execution-denied"),reason:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("error-text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("error-json"),value:$u,providerOptions:te.optional()}),g.object({type:g.literal("content"),value:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("media"),data:g.string(),mediaType:g.string()}),g.object({type:g.literal("file-data"),data:g.string(),mediaType:g.string(),filename:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("file-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("image-data"),data:g.string(),mediaType:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("custom"),providerOptions:te.optional()})]))})]),k_=g.object({type:g.literal("tool-result"),toolCallId:g.string(),toolName:g.string(),output:J8,providerOptions:te.optional()}),eV=g.object({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),tV=g.object({type:g.literal("tool-approval-response"),approvalId:g.string(),approved:g.boolean(),reason:g.string().optional()}),aV=g.object({role:g.literal("system"),content:g.string(),providerOptions:te.optional()}),nV=g.object({role:g.literal("user"),content:g.union([g.string(),g.array(g.union([I_,Y8,C_]))]),providerOptions:te.optional()}),rV=g.object({role:g.literal("assistant"),content:g.union([g.string(),g.array(g.union([I_,C_,Z8,Q8,k_,eV]))]),providerOptions:te.optional()}),oV=g.object({role:g.literal("tool"),content:g.array(g.union([k_,tV])),providerOptions:te.optional()}),jle=g.union([aV,nV,rV,oV]);function T_(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]=T_(o,r):a[n]=r}return a}var iV={};Rj(iV,{array:()=>cV,choice:()=>dV,json:()=>fV,object:()=>uV,text:()=>sV});function lV(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 Xu(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Ir({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Ir({text:lV(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var sV=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),uV=({schema:e,name:t,description:a})=>{let n=Lp(e);return{name:"object",responseFormat:Hn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await Ir({text:r});if(!i.success)throw new fo({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 _l({value:i.value,schema:n});if(!l.success)throw new fo({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 Xu(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},cV=({element:e,name:t,description:a})=>{let n=Lp(e);return{name:"array",responseFormat:Hn(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 Ir({text:r});if(!i.success)throw new fo({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 fo({message:"No object generated: response did not match schema.",cause:new qn({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 _l({value:s,schema:n});if(!u.success)throw new fo({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 Xu(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 _l({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])}})}}},dV=({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 Ir({text:n});if(!o.success)throw new fo({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 fo({message:"No object generated: response did not match schema.",cause:new qn({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 Xu(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(){}}),fV=({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 Ir({text:a});if(!r.success)throw new fo({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 Xu(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 $le=Sr({prefix:"aitxt",size:24});var Kle=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 h_(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)===ge.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=m_(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ge.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ge.ZodBranded&&e.keyType._def.type._def.typeName===ge.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=f_(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function tj(e,t){if(t.mapStrategy==="record")return h_(e,t);let a=nt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ka(),n=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ka();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function aj(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 nj(){return{not:Ka()}}function rj(){return{type:"null"}}var Yx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function oj(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Yx&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Yx[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 ij(e,t)}var ij=(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 lj(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Yx[e.innerType._def.typeName],"null"]};let a=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function sj(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 uj(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=dj(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=cj(e,t);return o!==void 0&&(a.additionalProperties=o),a}function cj(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 dj(e){try{return e.isOptional()}catch{return!0}}var fj=(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:Ka()},n]}:Ka()},pj=(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 mj(e,t){return nt(e.type._def,t)}function hj(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 gj(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 wj(){return{not:Ka()}}function yj(){return Ka()}var xj=(e,t)=>nt(e.innerType._def,t),vj=(e,t,a)=>{switch(t){case ge.ZodString:return m_(e,a);case ge.ZodNumber:return sj(e);case ge.ZodObject:return uj(e,a);case ge.ZodBigInt:return j9(e);case ge.ZodBoolean:return V9();case ge.ZodDate:return p_(e,a);case ge.ZodUndefined:return wj();case ge.ZodNull:return rj();case ge.ZodArray:return H9(e,a);case ge.ZodUnion:case ge.ZodDiscriminatedUnion:return oj(e,a);case ge.ZodIntersection:return Z9(e,a);case ge.ZodTuple:return gj(e,a);case ge.ZodRecord:return h_(e,a);case ge.ZodLiteral:return Q9(e);case ge.ZodEnum:return K9(e);case ge.ZodNativeEnum:return aj(e);case ge.ZodNullable:return lj(e,a);case ge.ZodOptional:return fj(e,a);case ge.ZodMap:return tj(e,a);case ge.ZodSet:return hj(e,a);case ge.ZodLazy:return()=>e.getter()._def;case ge.ZodPromise:return mj(e,a);case ge.ZodNaN:case ge.ZodNever:return nj();case ge.ZodEffects:return X9(e,a);case ge.ZodAny:return Ka();case ge.ZodUnknown:return yj();case ge.ZodDefault:return $9(e,a);case ge.ZodBranded:return f_(e,a);case ge.ZodReadonly:return xj(e,a);case ge.ZodCatch:return W9(e,a);case ge.ZodPipeline:return pj(e,a);case ge.ZodFunction:case ge.ZodVoid:case ge.ZodSymbol:return;default:return(n=>{})(t)}},bj=(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!==z9)return s}if(r&&!a){let s=Sj(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=vj(e,e.typeName,t),l=typeof i=="function"?nt(i(),t):i;if(l&&Ij(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var Sj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:bj(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`),Ka()):t.$refStrategy==="seen"?Ka():void 0}},Ij=(e,t,a)=>(e.description&&(a.description=e.description),a),Cj=e=>{let t=q9(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}]))}},kj=(e,t)=>{var a;let n=Cj(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:Ka()}},{}):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:Ka(),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},Zx=Symbol.for("vercel.ai.schema");function Lp(e){let t;return()=>(t==null&&(t=e()),t)}function Ep(e,{validate:t}={}){return{[Zx]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Tj(e){return typeof e=="object"&&e!==null&&Zx in e&&e[Zx]===!0&&"jsonSchema"in e&&"validate"in e}function Mp(e){return e==null?Ep({properties:{},additionalProperties:!1}):Tj(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?$u(e):Lj(e):e()}function Lj(e){return Ep(()=>ev(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 qn({value:t,cause:a.issues})}}})}function Ej(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ep(()=>kj(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 Mj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ep(()=>ev((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 Aj(e){return"_zod"in e}function $u(e,t){return Aj(e)?Mj(e,t):Ej(e,t)}async function Ap({value:e,schema:t,context:a}){let n=await Ol({value:e,schema:t,context:a});if(!n.success)throw qn.wrap({value:e,cause:n.error,context:a});return n.value}async function Ol({value:e,schema:t,context:a}){let n=Mp(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:qn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:qn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function Ir({text:e,schema:t}){try{let a=F9(e);return t==null?{success:!0,value:a,rawValue:a}:await Ol({value:a,schema:t})}catch(a){return{success:!1,error:jx.isInstance(a)?a:new jx({text:e,cause:a}),rawValue:void 0}}}function g_({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new kp).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await Ir({text:a,schema:t}))}}))}async function Hn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Dj=Object.defineProperty,_j=(e,t)=>{for(var a in t)Dj(e,a,{get:t[a],enumerable:!0})},Oj="AI_InvalidArgumentError",Pj=`vercel.ai.error.${Oj}`,Nj=Symbol.for(Pj),Bj;Bj=Nj;var Uj="AI_InvalidStreamPartError",Fj=`vercel.ai.error.${Uj}`,zj=Symbol.for(Fj),qj;qj=zj;var Hj="AI_InvalidToolApprovalError",jj=`vercel.ai.error.${Hj}`,Vj=Symbol.for(jj),Wj;Wj=Vj;var Gj="AI_InvalidToolInputError",$j=`vercel.ai.error.${Gj}`,Xj=Symbol.for($j),Kj;Kj=Xj;var Yj="AI_ToolCallNotFoundForApprovalError",Zj=`vercel.ai.error.${Yj}`,Qj=Symbol.for(Zj),Jj;Jj=Qj;var e8="AI_MissingToolResultsError",t8=`vercel.ai.error.${e8}`,a8=Symbol.for(t8),n8;n8=a8;var r8="AI_NoImageGeneratedError",o8=`vercel.ai.error.${r8}`,i8=Symbol.for(o8),l8;l8=i8;var y_="AI_NoObjectGeneratedError",x_=`vercel.ai.error.${y_}`,s8=Symbol.for(x_),v_,po=class extends Fe{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:y_,message:e,cause:t}),this[v_]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Fe.hasMarker(e,x_)}};v_=s8;var u8="AI_NoOutputGeneratedError",c8=`vercel.ai.error.${u8}`,d8=Symbol.for(c8),f8;f8=d8;var p8="AI_NoSpeechGeneratedError",m8=`vercel.ai.error.${p8}`,h8=Symbol.for(m8),g8;g8=h8;var w8="AI_NoTranscriptGeneratedError",y8=`vercel.ai.error.${w8}`,x8=Symbol.for(y8),v8;v8=x8;var b8="AI_NoVideoGeneratedError",S8=`vercel.ai.error.${b8}`,I8=Symbol.for(S8),C8;C8=I8;var k8="AI_NoSuchToolError",T8=`vercel.ai.error.${k8}`,L8=Symbol.for(T8),E8;E8=L8;var M8="AI_ToolCallRepairError",A8=`vercel.ai.error.${M8}`,R8=Symbol.for(A8),D8;D8=R8;var b_="AI_UIMessageStreamError",S_=`vercel.ai.error.${b_}`,_8=Symbol.for(S_),I_,Pl=class extends Fe{constructor({chunkType:e,chunkId:t,message:a}){super({name:b_,message:a}),this[I_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Fe.hasMarker(e,S_)}};I_=_8;var O8="AI_InvalidDataContentError",P8=`vercel.ai.error.${O8}`,N8=Symbol.for(P8),B8;B8=N8;var U8="AI_InvalidMessageRoleError",F8=`vercel.ai.error.${U8}`,z8=Symbol.for(F8),q8;q8=z8;var H8="AI_MessageConversionError",j8=`vercel.ai.error.${H8}`,V8=Symbol.for(j8),W8;W8=V8;var G8="AI_RetryError",$8=`vercel.ai.error.${G8}`,X8=Symbol.for($8),K8;K8=X8;var Y8="6.0.141",Z8=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();Jx(r);try{let o=await fetch(r,{headers:Tp({},`ai-sdk/${Y8}`,d_()),signal:a});if(o.redirected&&Jx(o.url),!o.ok)throw new dn({url:r,statusCode:o.status,statusText:o.statusText});return{data:await s_({response:o,url:r,maxBytes:t??Qx}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw dn.isInstance(o)?o:new dn({url:r,cause:o})}};var C_=g.union([g.string(),g.instanceof(Uint8Array),g.instanceof(ArrayBuffer),g.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=g.lazy(()=>g.union([g.null(),g.string(),g.number(),g.boolean(),g.record(g.string(),Xu.optional()),g.array(Xu)])),te=g.record(g.string(),g.record(g.string(),Xu.optional())),k_=g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),Q8=g.object({type:g.literal("image"),image:g.union([C_,g.instanceof(URL)]),mediaType:g.string().optional(),providerOptions:te.optional()}),T_=g.object({type:g.literal("file"),data:g.union([C_,g.instanceof(URL)]),filename:g.string().optional(),mediaType:g.string(),providerOptions:te.optional()}),J8=g.object({type:g.literal("reasoning"),text:g.string(),providerOptions:te.optional()}),eV=g.object({type:g.literal("tool-call"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerOptions:te.optional(),providerExecuted:g.boolean().optional()}),tV=g.discriminatedUnion("type",[g.object({type:g.literal("text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("json"),value:Xu,providerOptions:te.optional()}),g.object({type:g.literal("execution-denied"),reason:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("error-text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("error-json"),value:Xu,providerOptions:te.optional()}),g.object({type:g.literal("content"),value:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("media"),data:g.string(),mediaType:g.string()}),g.object({type:g.literal("file-data"),data:g.string(),mediaType:g.string(),filename:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("file-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("image-data"),data:g.string(),mediaType:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("custom"),providerOptions:te.optional()})]))})]),L_=g.object({type:g.literal("tool-result"),toolCallId:g.string(),toolName:g.string(),output:tV,providerOptions:te.optional()}),aV=g.object({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),nV=g.object({type:g.literal("tool-approval-response"),approvalId:g.string(),approved:g.boolean(),reason:g.string().optional()}),rV=g.object({role:g.literal("system"),content:g.string(),providerOptions:te.optional()}),oV=g.object({role:g.literal("user"),content:g.union([g.string(),g.array(g.union([k_,Q8,T_]))]),providerOptions:te.optional()}),iV=g.object({role:g.literal("assistant"),content:g.union([g.string(),g.array(g.union([k_,T_,J8,eV,L_,aV]))]),providerOptions:te.optional()}),lV=g.object({role:g.literal("tool"),content:g.array(g.union([L_,nV])),providerOptions:te.optional()}),Xle=g.union([rV,oV,iV,lV]);function E_(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]=E_(o,r):a[n]=r}return a}var sV={};_j(sV,{array:()=>fV,choice:()=>pV,json:()=>mV,object:()=>dV,text:()=>cV});function uV(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 Ir({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Ir({text:uV(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var cV=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),dV=({schema:e,name:t,description:a})=>{let n=Mp(e);return{name:"object",responseFormat:Hn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await Ir({text:r});if(!i.success)throw new po({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 po({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(){}}},fV=({element:e,name:t,description:a})=>{let n=Mp(e);return{name:"array",responseFormat:Hn(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 Ir({text:r});if(!i.success)throw new po({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 po({message:"No object generated: response did not match schema.",cause:new qn({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 po({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])}})}}},pV=({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 Ir({text:n});if(!o.success)throw new po({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 po({message:"No object generated: response did not match schema.",cause:new qn({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(){}}),mV=({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 Ir({text:a});if(!r.success)throw new po({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 Qle=Sr({prefix:"aitxt",size:24});var ese=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(()=>Gu(g.union([g.strictObject({type:g.literal("text-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("error"),errorText:g.string()}),g.strictObject({type:g.literal("tool-input-start"),toolCallId:g.string(),toolName:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-delta"),toolCallId:g.string(),inputTextDelta:g.string()}),g.strictObject({type:g.literal("tool-input-available"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-error"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),errorText:g.string(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),g.strictObject({type:g.literal("tool-output-available"),toolCallId:g.string(),output:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),preliminary:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-error"),toolCallId:g.string(),errorText:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-denied"),toolCallId:g.string()}),g.strictObject({type:g.literal("reasoning-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("file"),url:g.string(),mediaType:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:g.string().optional(),data:g.unknown(),transient:g.boolean().optional()}),g.strictObject({type:g.literal("start-step")}),g.strictObject({type:g.literal("finish-step")}),g.strictObject({type:g.literal("start"),messageId:g.string().optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("finish"),finishReason:g.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("abort"),reason:g.string().optional()}),g.strictObject({type:g.literal("message-metadata"),messageMetadata:g.unknown()})])));function pV(e){return e.type.startsWith("data-")}function Jx(e){return e.type.startsWith("tool-")}function mV(e){return e.type==="dynamic-tool"}function Mp(e){return Jx(e)||mV(e)}function h_(e){return e.type.split("-").slice(1).join("-")}function hV({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function gV({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(h){let T=u.message.parts.filter(Mp).find(C=>C.toolCallId===h);if(T==null)throw new Ol({chunkType:"tool-invocation",chunkId:h,message:`No tool invocation found for tool call ID "${h}".`});return T}function S(h){var b;let T=u.message.parts.find(R=>Jx(R)&&R.toolCallId===h.toolCallId),C=h,M=T;if(T!=null){T.state=h.state,M.input=C.input,M.output=C.output,M.errorText=C.errorText,M.rawInput=C.rawInput,M.preliminary=C.preliminary,h.title!==void 0&&(M.title=h.title),M.providerExecuted=(b=C.providerExecuted)!=null?b:T.providerExecuted;let R=C.providerMetadata;if(R!=null)if(h.state==="output-available"||h.state==="output-error"){let P=T;P.resultProviderMetadata=R}else T.callProviderMetadata=R}else u.message.parts.push({type:`tool-${h.toolName}`,toolCallId:h.toolCallId,state:h.state,title:h.title,input:C.input,output:C.output,rawInput:C.rawInput,errorText:C.errorText,providerExecuted:C.providerExecuted,preliminary:C.preliminary,...C.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:C.providerMetadata}:{},...C.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:C.providerMetadata}:{}})}function w(h){var b,T;let C=u.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===h.toolCallId),M=h,R=C;if(C!=null){C.state=h.state,R.toolName=h.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,h.title!==void 0&&(R.title=h.title),R.providerExecuted=(T=M.providerExecuted)!=null?T:C.providerExecuted;let P=M.providerMetadata;if(P!=null)if(h.state==="output-available"||h.state==="output-error"){let L=C;L.resultProviderMetadata=P}else C.callProviderMetadata=P}else u.message.parts.push({type:"dynamic-tool",toolName:h.toolName,toolCallId:h.toolCallId,state:h.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:h.title,...M.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function y(h){if(h!=null){let b=u.message.metadata!=null?T_(u.message.metadata,h):h;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 h={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=h,u.message.parts.push(h),c();break}case"text-delta":{let h=u.activeTextParts[l.id];if(h==null)throw new Ol({chunkType:"text-delta",chunkId:l.id,message:`Received text-delta for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});h.text+=l.delta,h.providerMetadata=(d=l.providerMetadata)!=null?d:h.providerMetadata,c();break}case"text-end":{let h=u.activeTextParts[l.id];if(h==null)throw new Ol({chunkType:"text-end",chunkId:l.id,message:`Received text-end for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});h.state="done",h.providerMetadata=(f=l.providerMetadata)!=null?f:h.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let h={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=h,u.message.parts.push(h),c();break}case"reasoning-delta":{let h=u.activeReasoningParts[l.id];if(h==null)throw new Ol({chunkType:"reasoning-delta",chunkId:l.id,message:`Received reasoning-delta for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});h.text+=l.delta,h.providerMetadata=(p=l.providerMetadata)!=null?p:h.providerMetadata,c();break}case"reasoning-end":{let h=u.activeReasoningParts[l.id];if(h==null)throw new Ol({chunkType:"reasoning-end",chunkId:l.id,message:`Received reasoning-end for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});h.providerMetadata=(m=l.providerMetadata)!=null?m:h.providerMetadata,h.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 h=u.message.parts.filter(Jx);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:h.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 h=u.partialToolCalls[l.toolCallId];if(h==null)throw new Ol({chunkType:"tool-input-delta",chunkId:l.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${l.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});h.text+=l.inputTextDelta;let{value:b}=await Xu(h.text);h.dynamic?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.title}):S({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.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 h=u.message.parts.filter(Mp).find(T=>T.toolCallId===l.toolCallId);(h!=null?h.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 h=x(l.toolCallId);h.state="approval-requested",h.approval={id:l.approvalId},c();break}case"tool-output-denied":{let h=x(l.toolCallId);h.state="output-denied",c();break}case"tool-output-available":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-available",input:h.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:h_(h),state:"output-available",input:h.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:h.title}),c();break}case"tool-output-error":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-error",input:h.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:h_(h),state:"output-error",input:h.input,rawInput:h.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.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(pV(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 Ep({value:l.data,schema:a[l.type],context:{field:`message.parts[${C}].data`,entityName:l.type,entityId:l.id}})}let h=l;if(h.transient){i?.(h);break}let b=h.id!=null?u.message.parts.find(T=>h.type===T.type&&h.id===T.id):void 0;b!=null?b.data=h.data:u.message.parts.push(h),i?.(h),c()}}s.enqueue(l)})}}))}async function wV({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 Jle=Sr({prefix:"aitxt",size:24});var ase=kp(()=>Gu(g.array(g.object({id:g.string(),role:g.enum(["system","user","assistant"]),metadata:g.unknown().optional(),parts:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("reasoning"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("file"),mediaType:g.string(),filename:g.string().optional(),url:g.string(),providerMetadata:te.optional()}),g.object({type:g.literal("step-start")}),g.object({type:g.string().startsWith("data-"),id:g.string().optional(),data:g.unknown()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-streaming"),input:g.unknown().optional(),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-error"),input:g.unknown(),rawInput:g.unknown().optional(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-denied"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-streaming"),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),input:g.unknown().optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-error"),providerExecuted:g.boolean().optional(),input:g.unknown(),rawInput:g.unknown().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-denied"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var rse=Sr({prefix:"aiobj",size:24});function L_(e){return({url:t,abortSignal:a})=>K8({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var yV=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 ise=Sr({prefix:"aiobj",size:24});var lse=L_();var xV="AI_NoSuchProviderError",vV=`vercel.ai.error.${xV}`,bV=Symbol.for(vV),SV;SV=bV;var sse=L_();async function IV(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 CV=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 Hn(this.body),s=await Hn(this.headers),u=await Hn(this.credentials),c={...co(s),...co(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?co(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 Hn(this.body),l=await Hn(this.headers),s=await Hn(this.credentials),u={...co(l),...co(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?co(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 CV{constructor(e={}){super(e)}processResponseStream(e){return m_({stream:e,schema:ev}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},E_=class{constructor({generateId:e=s_,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 yV,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 IV(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:w=d,d.messageId!=null){let y=this.state.messages.findIndex(h=>h.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 h;y&&this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.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=h=>Mp(h)&&h.toolCallId===f?{...h,state:d,output:p,errorText:m}:h;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(h=>{var b;h&&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:hV({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 wV({stream:gV({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 __=z(A_(),1);var Qu=z(he(),1);var Dp=z(he(),1);var D_=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},gt=(e,t,a)=>(D_(e,t,"read from private field"),a?a.call(e):t.get(e)),jn=(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)},po=(e,t,a,n)=>(D_(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function TV(e,t){return t!=null?(0,__.default)(e,t):e}var fn,Ap,Rp,Ku,Yu,Zu,Pl,av,nv,LV=class{constructor(e=[]){jn(this,fn,void 0),jn(this,Ap,"ready"),jn(this,Rp,void 0),jn(this,Ku,new Set),jn(this,Yu,new Set),jn(this,Zu,new Set),this.pushMessage=t=>{po(this,fn,gt(this,fn).concat(t)),gt(this,Pl).call(this)},this.popMessage=()=>{po(this,fn,gt(this,fn).slice(0,-1)),gt(this,Pl).call(this)},this.replaceMessage=(t,a)=>{po(this,fn,[...gt(this,fn).slice(0,t),this.snapshot(a),...gt(this,fn).slice(t+1)]),gt(this,Pl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?TV(t,a):t;return gt(this,Ku).add(n),()=>{gt(this,Ku).delete(n)}},this["~registerStatusCallback"]=t=>(gt(this,Yu).add(t),()=>{gt(this,Yu).delete(t)}),this["~registerErrorCallback"]=t=>(gt(this,Zu).add(t),()=>{gt(this,Zu).delete(t)}),jn(this,Pl,()=>{gt(this,Ku).forEach(t=>t())}),jn(this,av,()=>{gt(this,Yu).forEach(t=>t())}),jn(this,nv,()=>{gt(this,Zu).forEach(t=>t())}),po(this,fn,e)}get status(){return gt(this,Ap)}set status(e){po(this,Ap,e),gt(this,av).call(this)}get error(){return gt(this,Rp)}set error(e){po(this,Rp,e),gt(this,nv).call(this)}get messages(){return gt(this,fn)}set messages(e){po(this,fn,[...e]),gt(this,Pl).call(this)}};fn=new WeakMap;Ap=new WeakMap;Rp=new WeakMap;Ku=new WeakMap;Yu=new WeakMap;Zu=new WeakMap;Pl=new WeakMap;av=new WeakMap;nv=new WeakMap;var Nl,R_=class extends E_{constructor({messages:e,...t}){let a=new LV(e);super({...t,state:a}),jn(this,Nl,void 0),this["~registerMessagesCallback"]=(n,r)=>gt(this,Nl)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>gt(this,Nl)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>gt(this,Nl)["~registerErrorCallback"](n),po(this,Nl,a)}};Nl=new WeakMap;function O_({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,pn.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,pn.useRef)("chat"in a?a.chat:new R_(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new R_(r));let l=(0,pn.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,pn.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,pn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,pn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,pn.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,pn.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 X=z(he(),1);var EV="/api/mcp/modules/documents",MV=2e4,AV=3e5,mn=class extends Error{constructor(a,n){super(n);ne(this,"code");this.name="DocumentUploadError",this.code=a}};function P_(e,t){return Vd(e,`${EV}${t}`)}function RV(e){return P_(e,"/upload-url")}function N_(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function DV(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 _V(e){return e===403?new mn("upload_disabled","This agent does not accept document uploads."):e===413?new mn("max_file_size","That file is too large."):e===422||e===400?new mn("accept","That file type is not accepted."):new mn("upload_failed",`The upload could not be started (${e}).`)}function OV(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=AV;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 mn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new mn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new mn("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=P_(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:N_(e.headers,e.uploadHeaders)})}catch{}}async function B_(e){e.signal.throwIfAborted();let t=RV(e.api);if(!t)throw new mn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),MV),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let l=N_(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 mn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw _V(o.status);let i=DV(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new mn("upload_failed","The upload could not be started.");return await OV({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 PV(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=PV(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 U_=50,F_=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(Wa,"readonly").objectStore(Wa).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(Wa,"readonly").objectStore(Wa),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>F_?{...e,messages:e.messages.slice(e.messages.length-F_)}:e;await Np(async a=>{await new Promise((s,u)=>{let c=a.transaction(Wa,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Wa).put(t)});let n=a.transaction(Wa,"readwrite"),r=n.objectStore(Wa),o=r.index(Wd),l=(await rv(o.getAll(t.memoryUserId))??[]).filter(Pp);if(l.length>U_){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-U_);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 z_(e){await Np(async t=>(await new Promise((a,n)=>{let r=t.transaction(Wa,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Wa).delete(e)}),null))}async function lv(e){return(await ov(e))[0]?.threadId??null}function q_(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 NV="x-session-id",BV=250,UV=200;function H_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():uu()}function Up(){return new Date().toISOString()}function j_(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function FV(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 V_(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,X.useEffect)(()=>$s(c),[c]);let d=xp(),f=(0,X.useRef)(a),p=(0,X.useRef)(n),m=(0,X.useRef)(r),x=(0,X.useRef)(l);(0,X.useEffect)(()=>{x.current=l},[l]);let S=(0,X.useRef)(void 0),w=(0,X.useRef)(void 0),y=(0,X.useRef)(null),[h,b]=(0,X.useState)(void 0),T=(0,X.useRef)(h),[C,M]=(0,X.useState)(s),R=(0,X.useRef)(C),[P,L]=(0,X.useState)([]),[$,H]=(0,X.useState)(!l),F=(0,X.useRef)(void 0),W=(0,X.useRef)(void 0),V=(0,X.useRef)(void 0),N=(0,X.useRef)(void 0),D=(0,X.useRef)(0),G=(0,X.useRef)(u);(0,X.useEffect)(()=>{G.current=u},[u]);let ue=(0,X.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,X.useCallback)(async()=>{if(!l)return;let O=y.current?.memoryUserId;if(!O)return;let ae=await ov(O);L(ae)},[l]),Ve=(0,X.useCallback)(()=>T.current,[]),et=(0,X.useCallback)(O=>{let ae=j_(O);if(!ae||T.current===ae)return;let pe=T.current===void 0;T.current=ae,b(ae),pe&&d.emit({name:"session.started",properties:{sessionId:ae}})},[d]),v=(0,X.useCallback)(()=>{T.current=void 0,b(void 0)},[]);(0,X.useEffect)(()=>{f.current=a,p.current=n},[a,n]),(0,X.useEffect)(()=>{m.current=r},[r]),(0,X.useEffect)(()=>{let O=!1,ae=D.current;return(async()=>{try{let Ye=await Xs();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 lv(pe);if(O||ae!==D.current)return;if(Ye){let $t=await Bp(Ye);if(O||ae!==D.current)return;$t&&$t.memoryUserId===pe&&(R.current=$t.threadId,M($t.threadId),F.current=$t.createdAt,W.current=$t.title,$t.sessionId&&(T.current=$t.sessionId,b($t.sessionId)),Oe($t.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[]);let K=(0,X.useRef)(null),ee=(0,X.useCallback)(O=>{let ae=m.current?.[O];return typeof ae=="string"?ae:void 0},[]),we=(0,X.useCallback)(()=>({api:t,token:$d(f.current),channelId:ee("channelId"),sessionId:T.current}),[t,ee]),We=(0,X.useCallback)(O=>{let ae=K.current;K.current=null,ae?.report(we(),{mode:ee("mode"),outcome:O})},[we,ee]),me=(0,X.useRef)(new Op({api:t,headers:()=>({...f.current}),body:()=>{let O={...m.current??{}},ae=Object.hasOwn(O,"sessionId"),pe=j_(O.sessionId);if(pe)et(pe),O.sessionId=pe;else if(ae)v(),delete O.sessionId;else{let $p=Ve();$p&&(O.sessionId=$p)}ii(S.current)&&(O.modelContext=S.current),w.current?.length&&(O.documents=w.current);let Ye=y.current,$t=Zt();Ye&&(O.visitorContext={timezone:Ye.timezone,language:Ye.language,languages:Ye.languages,deviceType:Ye.deviceType,referrer:Ye.referrer,visitorId:$t});let At=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},BO=typeof At.client=="object"&&At.client!==null?At.client:{};O.visitor={...At,id:$t,client:{...BO,...Ye&&{memoryUserId:Ye.memoryUserId}}};let xv=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,vv=y.current?.memoryUserId,bv=y.current?.language,uc={};if(vv&&(uc.memoryUserId=vv),bv&&(uc.locale=bv),(Object.keys(uc).length>0||xv)&&(O.extra={...uc,...xv??{}}),x.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(R.current=O.threadId);else{let cc=R.current;cc||(cc=H_(),F.current=Up(),W.current=void 0,ue(cc)),O.threadId=cc}return O},fetch:(async(O,ae)=>{let pe=K.current;pe?.mark("requestStart");try{let Ye=await fetch(O,ae);return S.current=void 0,et(Ye.headers.get(NV)),pe?pe.instrument(Ye):Ye}finally{w.current=void 0}})})),be=(0,X.useRef)(e.transport?.({fallback:me.current,headers:()=>f.current,body:()=>({channelId:ee("channelId"),visitor:{id:Zt()}}),needsFallback:()=>x.current||!!w.current?.length||ii(S.current),onSession:et})??me.current),le=(0,X.useRef)(null),de=(0,X.useRef)(null),Q=(0,X.useRef)({}),[Be,qe]=(0,X.useState)(0),_e=e.skipRemoteConfig===!0,Ce=(0,X.useCallback)(async()=>{if(!_e)try{let O=await FV(t,f.current);Q.current=O,qe(ae=>ae+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,_e]);(0,X.useEffect)(()=>{Ce()},[Ce]);let{messages:ye,sendMessage:Y,setMessages:Oe,status:ot,stop:ba}=O_({messages:e.initialMessages,transport:be.current,onFinish({message:O,isAbort:ae,isDisconnect:pe,isError:Ye}){K.current?.mark("streamEnd"),We(ae||pe||Ye?"error":"ok"),i?.(),!ae&&!pe&&!Ye&&d.emit({name:"message.received"}),le.current&&(de.current=O)},onError(O){We("error"),console.warn("[Waniwani] Chat error:",O.message),d.emit({name:"chat.error",properties:{message:O.message.slice(0,UV)}}),le.current&&(le.current.reject(O),le.current=null)}}),Sa=(0,X.useRef)(ye);(0,X.useEffect)(()=>{Sa.current=ye},[ye]),(0,X.useEffect)(()=>{let O=be.current;return O.restore?.().then(ae=>{ae.length>0&&Sa.current.length===0&&Oe(ae)}).catch(()=>{}),()=>O.dispose?.()},[]);let ra=(0,X.useCallback)(()=>{K.current=AC(Sa.current.filter(O=>O.role==="user").length+1)},[]),[fi,go]=(0,X.useState)(!1),A=(0,X.useCallback)(async()=>{go(!0);try{await ba();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{go(!1)}},[t,ba]),U=(0,X.useRef)(l);(0,X.useEffect)(()=>{if(!l||U.current||(U.current=!0,Sa.current.length>0))return;let O=!1,ae=D.current;return H(!1),(async()=>{try{let pe=y.current;if(!pe)try{pe=await Xs(),y.current=pe}catch{}let Ye=pe?.memoryUserId;if(!Ye||O||ae!==D.current){O||H(!0);return}let $t=s??await lv(Ye);if(O||ae!==D.current)return;if($t){let At=await Bp($t);if(O||ae!==D.current)return;At&&At.memoryUserId===Ye&&(R.current=At.threadId,M(At.threadId),F.current=At.createdAt,W.current=At.title,At.sessionId&&(T.current=At.sessionId,b(At.sessionId)),Oe(At.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[l]),(0,X.useEffect)(()=>{if(ot==="ready"&&le.current&&de.current){let O=le.current,ae=de.current;le.current=null,de.current=null,O.resolve(ae)}},[ot]);let[J,oe]=(0,X.useState)(""),Ae=typeof c!="function",zt=J.length>0;(0,X.useEffect)(()=>{Ae&&zt&&be.current.prepare?.()},[Ae,zt]);let[Wt,Ia]=(0,X.useState)([]),Vn=(0,X.useRef)([]);Vn.current=Wt;let gn=ot==="submitted"||ot==="streaming",Gt=(0,X.useCallback)(O=>{for(let ae of O)for(let pe of ae.documents??[])_p({documentId:pe.documentId,api:t,headers:f.current,uploadHeaders:p.current})},[t]),ca=(0,X.useCallback)(()=>{Gt(Vn.current),Ia([])},[Gt]),wn=(0,X.useCallback)(O=>{let ae=Vn.current.find(pe=>pe.id===O);ae&&Gt([ae]),Ia(pe=>pe.filter(Ye=>Ye.id!==O))},[Gt]),EO=gn&&Wt.length>0,MO=(0,X.useCallback)(O=>{let ae=!!O.text?.trim(),pe=!!(O.files?.length||O.documents?.length);if(ae||pe){if(gn){if(Wt.length>0)return;Ia(Ye=>[...Ye,{id:uu(),text:O.text||"",files:O.files??[],documents:O.documents??[],modelContext:O.modelContext}]),oe("");return}ra(),S.current=O.modelContext,w.current=O.documents,Y({text:O.text||"",files:O.files,...O.documents?.length&&{metadata:{documents:O.documents}}}),o?.(O.text||""),d.emit({name:"message.sent"}),oe("")}},[Y,o,gn,Wt.length,d,ra]),AO=(0,X.useCallback)(O=>new Promise((ae,pe)=>{le.current={resolve:ae,reject:pe},ra(),Y({text:O}),o?.(O),d.emit({name:"message.sent"})}),[Y,o,d,ra]);(0,X.useEffect)(()=>{if(ot!=="ready"||fi||Wt.length===0)return;let[O,...ae]=Wt;Ia(ae),ra(),S.current=O.modelContext,w.current=O.documents,Y({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"})},[ot,fi,Y,o,Wt,d,ra]);let RO=(0,X.useCallback)(()=>{be.current.reset?.(),Oe([]),ca(),v(),oe(""),Q.current={},qe(O=>O+1),Ce()},[Oe,v,Ce,ca]),lc=(0,X.useCallback)(()=>{if(!x.current)return;let O=y.current?.memoryUserId,ae=R.current,pe=Sa.current;if(!(!O||!ae||pe.length===0)){if(F.current||(F.current=Up()),!W.current){let Ye=pe.find(At=>At.role==="user"),$t=Ye?Ye.parts.map(At=>"text"in At&&typeof At.text=="string"?At.text:"").join(" "):"";W.current=q_($t)}return{threadId:ae,memoryUserId:O,title:W.current,messages:pe,sessionId:T.current,createdAt:F.current,updatedAt:Up()}}},[]),gv=(0,X.useCallback)(async()=>{let O=lc();O&&(await iv(O),await I())},[lc,I]);(0,X.useEffect)(()=>{if(l&&$&&!(ot==="submitted"||ot==="streaming")&&ye.length!==0)return V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=void 0;let O=gv().finally(()=>{N.current===O&&(N.current=void 0)});N.current=O},BV),()=>{V.current&&clearTimeout(V.current)}},[l,$,ye,ot,gv]);let sc=(0,X.useCallback)(()=>{let O=N.current,ae=V.current,pe=ae?lc():void 0;return ae&&(clearTimeout(ae),V.current=void 0),(async()=>{O&&await O,pe&&(await iv(pe),await I())})()},[lc,I]),DO=(0,X.useCallback)(()=>{D.current+=1,sc(),be.current.reset?.(),Oe([]),ca(),v(),oe("");let O=H_();return F.current=Up(),W.current=void 0,ue(O),I(),O},[Oe,v,ue,I,sc,ca]),Gp=(0,X.useCallback)(async O=>{D.current+=1;let ae=D.current;if(await sc(),ae!==D.current)return;let pe=await Bp(O);ae===D.current&&pe&&(pe.sessionId?(T.current=pe.sessionId,b(pe.sessionId)):v(),ue(pe.threadId),F.current=pe.createdAt,W.current=pe.title,Oe(pe.messages),ca(),oe(""))},[Oe,v,ue,sc,ca]),_O=(0,X.useCallback)(async O=>{if(R.current===O){D.current+=1,V.current&&(clearTimeout(V.current),V.current=void 0);let ae=N.current;ae&&await ae}await z_(O),await I(),R.current===O&&(Oe([]),ca(),v(),oe(""),R.current=void 0,M(void 0),F.current=void 0,W.current=void 0)},[Oe,v,I,ca]);(0,X.useEffect)(()=>{l&&$&&s!==void 0&&s!==R.current&&Gp(s)},[s,l,$,Gp]);let OO=(0,X.useCallback)(O=>{oe(O.target.value)},[]),wv=ye[ye.length-1],yv=ye.length>0,PO=gn&&(!yv||wv.role==="user"),NO=Q.current;return{messages:ye,status:ot,text:J,setText:oe,handleSubmit:MO,handleTextChange:OO,isLoading:gn,showLoaderBubble:PO,lastMessage:wv,hasMessages:yv,sendMessage:Y,sendMessageAndWait:AO,stop:A,reset:RO,queuedMessages:Wt,queueFull:EO,removeQueuedMessage:wn,sessionId:h,toolDefinitions:NO,refreshToolDefinitions:Ce,threads:P,activeThreadId:C,isThreadHistoryReady:$,startNewThread:DO,switchThread:Gp,deleteThread:_O}}var si=z(he(),1);var zV=6e3;function W_(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[l,s]=(0,si.useState)(null),u=(0,si.useCallback)((f,p,m)=>B_({file:f,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:p,onProgress:m}),[t,a,n,r]),c=(0,si.useCallback)(f=>{_p({documentId:f.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,si.useEffect)(()=>{if(!l)return;let f=setTimeout(()=>s(null),zV);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 va=z(he(),1);function Bl(e){return e.map(t=>({id:null,text:t}))}function ui(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 Ul(e){return typeof e=="object"&&e!==null}function G_(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function qV(e){if(!Ul(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!Ul(t)||!Ul(t._meta))return null;let a=t._meta[Pg];return!Ul(a)||!G_(a.suggestions)?null:a.suggestions}function $_(e){let t=null;for(let a of e.parts){let n=qV(a);n!==null&&(t=n)}return t}function X_(e){for(let t of e.parts){if(!Ul(t)||t.type!=="data-suggestions")continue;let a=t.data;if(Ul(a)&&G_(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function HV(e){return"page"in e||"channel"in e}function jV(e){return typeof e!="object"||e===null?{}:HV(e)?{rungs:e}:{initial:e.initial}}function K_(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=jV(n),l=(0,va.useMemo)(()=>({page:null,channel:Bl(i??[])}),[i]),s=o??l,u=(0,va.useMemo)(()=>r?ui({flow:null,followup:null,...s}):null,[r,s]),c=(0,va.useMemo)(()=>u?.suggestions.map(h=>h.text)??[],[u]),[d,f]=(0,va.useState)(c),[p,m]=(0,va.useState)(u?.origin??"channel"),x=(0,va.useRef)(a),S=(0,va.useCallback)(()=>{f([])},[]),w=t.length>0;(0,va.useEffect)(()=>{w||(f(c),m(u?.origin??"channel"))},[c,u,w]);let y=t[t.length-1];return(0,va.useEffect)(()=>{y?.role==="user"&&S()},[y,S]),(0,va.useEffect)(()=>{let h=x.current;if(x.current=a,h!=="streaming"||a!=="ready"||!r)return;let b=[...t].reverse().find(R=>R.role==="assistant");if(!b)return;let T=$_(b),C=X_(b),M=ui({flow:T===null?null:Bl(T),followup:C===null?null:Bl(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 Y_(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 VV={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 Fl(e){let t={};for(let[a,n]of Object.entries(VV)){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(re(),1),zl=(0,ze.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ge.jsx)(Fo,{locale:n,messages:r,children:(0,Ge.jsx)(WV,{...t,ref:a})})}),WV=(0,ze.forwardRef)(function(t,a){let{t:n,ready:r}=ke(),{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:h,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=$?Fl($):{},[W,V]=(0,ze.useState)(!1);(0,ze.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=V_({...t,api:m}),G=xp(),ue=$2({...t,api:m,sessionId:D.sessionId,onCallTool:x?.onCallTool}),I=x?.resourceEndpoint??Y_(m,t.headers),Ve=(0,ze.useRef)({});Ve.current={api:m,token:$d(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:D.sessionId};let et=(0,ze.useCallback)(A=>{Xd("widget",Ve.current,{widget:A.widget,outcome:A.outcome},A.metrics)},[]),v=pl(f,!D.text),K=W_({api:m,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:D.sessionId,documentUpload:u,allowAttachments:s}),[ee,we]=(0,ze.useState)(null),[We,me]=(0,ze.useState)(null),be=(0,ze.useRef)(null),le=(0,ze.useRef)(null),de=(0,ze.useRef)(null),Q=(0,ze.useRef)(null),[Be,qe]=(0,ze.useState)(!0),_e=(0,ze.useRef)(Be);_e.current=Be;let Ce=(0,ze.useCallback)(()=>{let A=be.current;if(!A)return;let U=A.querySelector("textarea");U&&U.focus()},[]),ye=(0,ze.useCallback)((A="smooth")=>{let U=le.current;U&&U.scrollTo({top:U.scrollHeight,behavior:A})},[]);(0,ze.useEffect)(()=>{let A=Q.current,U=le.current;if(!A||!U)return;let J=new IntersectionObserver(([oe])=>qe(oe.isIntersecting),{root:U,rootMargin:"0px 0px 200px 0px",threshold:0});return J.observe(A),()=>J.disconnect()},[]),(0,ze.useEffect)(()=>{let A=le.current;if(!A)return;let U=J=>{let Ae=(J.target instanceof Element?J.target:null)?.closest("a");Ae?.href&&G.emit({name:"link.clicked",properties:{url:Ae.href}})};return A.addEventListener("click",U),()=>A.removeEventListener("click",U)},[G]),(0,ze.useEffect)(()=>{(D.messages[D.messages.length-1]?.role==="user"||_e.current)&&ye("smooth")},[D.messages.length,D.messages[D.messages.length-1]]),(0,ze.useEffect)(()=>{ye("auto")},[ye]),(0,ze.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let A=le.current,U=de.current;if(!A&&!U)return;let J=A?.scrollHeight??0,oe=A?.clientHeight??0,Ae=new ResizeObserver(()=>{let zt=le.current;if(!zt)return;let Wt=zt.scrollTop+oe>=J-5;J=zt.scrollHeight,oe=zt.clientHeight,Wt&&ye("auto")});return A&&Ae.observe(A),U&&Ae.observe(U),()=>Ae.disconnect()},[ye]);let Y=K_({messages:D.messages,status:D.status,suggestions:t.suggestions}),Oe=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{let A=Y.suggestions;!R||A.length===0||Oe.current===A||(Oe.current=A,G.emit({name:"suggestions.shown",properties:{texts:A,origin:Y.source}}))},[Y.suggestions,Y.source,G,R]);let ot=d?.suggestions,ba=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{!R||D.messages.length>0||!ot?.length||ba.current===ot||(ba.current=ot,G.emit({name:"suggestions.shown",properties:{texts:ot,origin:"channel"}}))},[ot,D.messages.length,G,R]);let Sa=(0,ze.useCallback)(A=>{let U=A.content.map(J=>J.text??"").join("").trim();U&&D.handleSubmit({text:U,files:[],modelContext:A.modelContext})},[D.handleSubmit]),ra=(0,ze.useCallback)(A=>{let U=Y.suggestions.indexOf(A),J=U>=0?U:d?.suggestions?.indexOf(A)??-1,oe=U>=0?Y.source:"channel";G.emit({name:"suggestion.clicked",properties:{text:A,index:J,origin:oe}}),Y.clear(),D.handleSubmit({text:A,files:[]})},[Y.suggestions,Y.source,Y.clear,D.handleSubmit,d,G]);(0,ze.useImperativeHandle)(a,()=>({sendMessage:A=>{D.handleSubmit({text:A,files:[]}),Ce()},sendMessageAndWait:A=>D.sendMessageAndWait(A),reset:D.reset,focus:Ce,get messages(){return D.messages},get sessionId(){return D.sessionId}}),[D.handleSubmit,D.sendMessageAndWait,D.reset,D.messages,D.sessionId,Ce]),(0,ze.useEffect)(()=>{if(!p)return;let A=U=>{let J=U.detail,oe=typeof J?.message=="string"?J.message:void 0;oe&&D.handleSubmit({text:oe,files:[]}),Ce()};return window.addEventListener(p,A),()=>window.removeEventListener(p,A)},[p,D.handleSubmit,Ce]);let fi=!b&&!!(y||T||h),go=M||!r;return(0,Ge.jsxs)("div",{ref:be,style:{...F,maxHeight:"inherit",...ee&&We?{height:We}:{},opacity:go?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,...go?{"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:[fi&&(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)(V2,{threads:D.threads,activeThreadId:D.activeThreadId,onNewThread:D.startNewThread,onSelectThread:A=>{D.switchThread(A)},onDeleteThread:A=>{D.deleteThread(A)}}),h]}),(0,Ge.jsxs)("div",{ref:le,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:de,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)(N2,{value:et,children:(0,Ge.jsx)(q2,{messages:D.messages,status:D.status,welcomeMessage:c,welcome:d,onSuggestionSelect:ra,resourceEndpoint:I,chatSessionId:D.sessionId,isDark:N,onFollowUp:Sa,onCallTool:ue,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 J=be.current?.getBoundingClientRect().height??0;me(J>0?J:null),we(U.toolCallId)}else me(null),we(null)}})}),(0,Ge.jsx)("div",{ref:Q,"aria-hidden":!0,style:{height:1}})]}),!Be&&!ee&&(0,Ge.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ge.jsx)(Bn,{type:"button",onClick:()=>ye("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ge.jsx)(Zs,{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:Y.suggestions,isLoading:Y.isLoading,onSelect:ra}),(0,Ge.jsx)(Mk,{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)(pk,{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)(xk,{enabled:K.enabled}),K.enabled&&(0,Ge.jsx)(yk,{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)(wk,{}),(0,Ge.jsx)(hk,{onChange:D.handleTextChange,value:D.text,placeholder:v,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ge.jsx)(gk,{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)(H2,{}),(0,Ge.jsx)(vk,{text:P})]})]})})]})]})});var nc=z(he(),1);var Z_="500px",GV="https://app.waniwani.ai/api/mcp/chat",$V={api:GV};function sv(){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=sv();if(!e)return{};let t=G=>e.getAttribute(G)??void 0,a=G=>{let ue=e.getAttribute(G);if(ue==null)return;let I=ue.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 h=t("data-theme");(h==="light"||h==="dark"||h==="auto")&&(n.appearance={...n.appearance,theme:h});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(),ue=G.toLowerCase();ue==="false"||ue==="0"?n.disclaimer=!1:G&&(n.disclaimer=G)}return n}function Ju(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=XV(t,n,e),o={...t?.composer??{},...Ju(n.composer),...Ju(e?.composer)},i=Object.keys(o).length>0,l={token:"",...$V,...Ju(t),...Ju(n),...Ju(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 XV(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 nO=z(he(),1);var zp=z(he(),1);function KV(e){return e?.patterns??e?.rules??[]}var Q_="\0\0";function YV(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,Q_).replace(/\\\*/g,"[^/]*").split(Q_).join(".*");return new RegExp(`^${a}$`)}function J_(e,t){try{return YV(e).test(t)}catch{return!1}}function tc(e,t){if(!e)return!0;let a=!1;for(let n of KV(e))if(J_(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function eO(e,t){for(let a of e?.appearRules??[])if(J_(a.glob,t))return a.appearAfter;return null}var uv="waniwani:locationchange",tO=!1;function ZV(){if(!(tO||typeof history>"u")){tO=!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(uv)),r}}}}function QV(e){return ZV(),window.addEventListener(uv,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(uv,e),window.removeEventListener("popstate",e)}}function JV(){return window.location.pathname}function e7(){return"/"}function ac(){return(0,zp.useSyncExternalStore)(QV,JV,e7)}function ql(e,t){let a=ac(),n=t&&tc(e,a);return(0,zp.useEffect)(()=>{ha("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var t7=3,a7=["low","medium","high"];function cv(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function n7(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 a7){let i=cv(t.get(o)??[])??cv(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(t7,e.length);){let o=cv(r);if(!o)break;n.push(o)}return n}function aO(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function rO(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 Hl(e){let{pageSuggestions:t,suggestions:a}=e,n=ac();return(0,nO.useMemo)(()=>{let r=aO(n),o=t?.find(l=>aO(l.url)===r),i=o?n7(o.prompts).map(({id:l,text:s})=>({id:l,text:s})):null;return ha("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:Bl(a??[])}},[n,t,a])}var r7="waniwani:config:";function oO(e,t,a){return`${r7}${e}|${t}|${a??""}`}function mo(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(oO(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function o7(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(oO(e,t,a),JSON.stringify(n))}catch{}}var i7=600;function l7(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 s7(e,t,a,n){Bo("configStart");let r=await u7(e,t,a,n);return Bo("configEnd"),a?.aborted||Wg(r.metadata),r}async function u7(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?c7(l):{}}catch{return{}}}function c7(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=rO(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=l7(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function jl(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||DC({api:l,token:s,channelId:u??m.channelId,mode:e.mode==="off"?void 0:e.mode,source:m.source})},d=mo(l,s,u);if(d)try{let m=ec(t,d,a);r(m),Kd("cache"),Wg(d.metadata),i(!0),ha("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d)}catch{}let f=new AbortController,p=setTimeout(()=>{Kd("timeout"),i(!0)},i7);return s7(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ha("remote /config response",m),Object.keys(m).length>0){o7(l,s,u,m);try{let x=ec(t,m,a);r(x),ha("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 Et=z(re(),1),d7={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}},iO="var(--ww-composer-bg, var(--ww-color-input))",f7="var(--ww-composer-border-color, var(--ww-color-border))",p7="var(--ww-composer-border-width, 1px)",lO="var(--ww-composer-send-bg, var(--ww-color-foreground))",sO="var(--ww-composer-send-fg, var(--ww-color-background))",cO=(0,$e.forwardRef)(function(t,a){return(0,Et.jsx)(Fo,{locale:t.config.locale,children:(0,Et.jsx)(m7,{...t,ref:a})})}),m7=(0,$e.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:l}=ke(),{config:s,ready:u}=jl(t,a,n),c=ql(s.visibility,u);(0,$e.useEffect)(()=>{o?.(c)},[c,o]),El({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)(()=>Rl({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,h]=(0,$e.useState)(""),[b,T]=(0,$e.useState)(0),C=s.appearance?.theme,M=s.appearance?.variables,R=(0,$e.useMemo)(()=>M?Fl(M):{},[M]),P=Hl(s),L=(0,$e.useMemo)(()=>ui({flow:null,followup:null,...P}),[P]),$=(0,$e.useMemo)(()=>L?.suggestions.map(Y=>Y.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=d7[F.size??"md"],N=F.showSuggestions??!0,D=F.align==="center",G=GC(),ue=(F.trigger??!1)||G&&(F.mobileTrigger??!0),I=s.launcherText??s.placeholder??l.launcher.prompt,Ve=pl(I,!ue&&y.length===0),et="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,$e.useEffect)(()=>{let Y=m.current;if(Y){if(!y){Y.style.height="";return}Y.style.height="auto",Y.style.height=`${Y.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 Y=c&&S;Y!==K.current&&(K.current=Y,f.emit({name:Y?"chat.opened":"chat.closed"}))},[c,S,f]);let ee=(0,$e.useCallback)(Y=>{w(!0),T(ot=>ot+1);let Oe=Y.trim();Oe&&d.current?.sendMessage(Oe)},[]);(0,$e.useImperativeHandle)(i,()=>({open:()=>w(!0),close:()=>w(!1),toggle:()=>w(Y=>!Y),sendMessage:Y=>ee(Y),sendMessageAndWait:async Y=>{w(!0);let Oe=d.current;if(Oe)return await Oe.sendMessageAndWait(Y)},reset:()=>d.current?.reset(),focus:()=>{S?T(Y=>Y+1):(m.current??x.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[ee,S]);let we=(0,$e.useCallback)(()=>{y.trim()&&(ee(y),h(""))},[y,ee]),We=(0,$e.useCallback)(()=>{(d.current?.messages.length??0)>0&&(w(!0),T(Y=>Y+1))},[]),me={mode:"composer"};s.mcpServerUrl&&(me.mcpServerUrl=s.mcpServerUrl),s.channelId&&(me.channelId=s.channelId);let be=(0,Et.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,Et.jsx)(Ga,{className:"ww:size-4"})}),le=(0,Et.jsxs)("div",{className:q("ww:flex ww:items-end",V.row),children:[(0,Et.jsx)("textarea",{ref:m,rows:1,value:y,placeholder:Ve,onChange:Y=>h(Y.target.value),onFocus:We,onKeyDown:Y=>{Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),we())},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,Et.jsx)("button",{type:"button",onClick:we,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:lO,color:sO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),de=(0,Et.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,Et.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,Et.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:lO,color:sO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),Q=ue?de:le,Be=`var(--ww-composer-radius, ${V.radius}px)`,qe={borderRadius:Be,background:iO,borderColor:f7,borderWidth:p7,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${et})`},_e=W==="glow"?(0,Et.jsx)(ef,{animated:u,backgroundColor:iO,borderRadius:Be,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:qe,children:Q}):(0,Et.jsx)("div",{className:q(ue&&"ww:transition-colors hover:ww:border-primary/40"),style:qe,children:Q}),Ce=(0,Et.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:[_e,N&&$.length>0&&(0,Et.jsx)(cl,{suggestions:$,onSelect:Y=>{f.emit({name:"suggestion.clicked",properties:{text:Y,index:$.indexOf(Y),origin:L?.origin??"channel"}}),ee(Y)},align:D?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),ye=(0,Et.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,Et.jsx)("div",{role:"dialog","aria-label":s.title??I,"data-waniwani-floating":"panel","data-state":c&&S?"shown":"hidden",style:{boxShadow:et},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,Et.jsx)(zl,{ref:d,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:me,appearance:s.appearance,title:s.title,headerActions:be,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,Et.jsxs)(Dl,{value:f,children:[Ce,(0,uO.createPortal)(ye,r)]})});var dv="/*! 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 h7(e){return e.startsWith("__WANIWANI")}function qp(e){if(!dv||h7(dv))return;let t=document.createElement("style");t.textContent=dv,e.appendChild(t)}var Ee=z(he(),1);var Hp=z(he(),1),g7=3e3,w7=120,y7=24;function dO(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 -${y7}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,w7)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},g7),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var wt=z(re(),1),x7=2e3,v7=90,b7=1e3,fO=(0,Ee.forwardRef)(function(t,a){return(0,wt.jsx)(Fo,{locale:t.config.locale,children:(0,wt.jsx)(S7,{...t,ref:a})})}),S7=(0,Ee.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=ke(),{config:i,ready:l}=jl(t,a,n),s=ql(i.visibility,l),u=ac(),c=s?eO(i.visibility,u):null,d=dO(c),f=(0,Ee.useRef)(null),p=(0,Ee.useMemo)(()=>Rl({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Ee.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Ee.useRef)(null),S=(0,Ee.useRef)(null),w=(0,Ee.useRef)(!1),[y,h]=(0,Ee.useState)("input"),[b,T]=(0,Ee.useState)(""),[C,M]=(0,Ee.useState)(!1),[R,P]=(0,Ee.useState)(!1),[L,$]=(0,Ee.useState)(0),H=i.appearance?.theme,F=i.appearance?.variables,W=(0,Ee.useMemo)(()=>F?Fl(F):{},[F]),V=Hl(i),N=(0,Ee.useMemo)(()=>ui({flow:null,followup:null,...V}),[V]),D=(0,Ee.useMemo)(()=>N?.suggestions.map(Q=>Q.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,Ee.useRef)(null);(0,Ee.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 ue=i.launcherText??i.placeholder??o.launcher.prompt,I=pl(ue,b.length===0),Ve="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ee.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let Q=i.appearDelay??x7,Be=setTimeout(()=>M(!0),Math.max(0,Q));return()=>clearTimeout(Be)},[s,i.appearDelay,c,d]),(0,Ee.useEffect)(()=>{if(!C||D.length===0)return;let Q=setTimeout(()=>{w.current||h(Be=>Be==="input"?"expanded":Be)},b7);return()=>clearTimeout(Q)},[C,D.length]),(0,Ee.useEffect)(()=>{L>0&&y==="open"&&f.current?.focus()},[L,y]);let et=(0,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{l&&!et.current&&(et.current=!0,p.emit({name:"chat.ready"}))},[l,p]),El({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:l&&s});let v=(0,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{let Q=s&&y==="open";Q!==v.current&&(v.current=Q,p.emit({name:Q?"chat.opened":"chat.closed"}))},[s,y,p]);let K=(0,Ee.useCallback)(()=>{h("open")},[]),ee=(0,Ee.useCallback)(()=>{w.current=!0,h("input")},[]);(0,Ee.useEffect)(()=>{if(y!=="expanded"){P(!1);return}let Q=setTimeout(()=>P(!0),v7);return()=>clearTimeout(Q)},[y]);let we=(0,Ee.useCallback)(Q=>{K();let Be=Q.trim();Be&&f.current?.sendMessage(Be)},[K]);(0,Ee.useImperativeHandle)(r,()=>({open:()=>K(),close:()=>ee(),toggle:()=>{h(Q=>Q==="open"?"input":"open")},sendMessage:Q=>we(Q),sendMessageAndWait:async Q=>{K();let Be=f.current;if(Be)return await Be.sendMessageAndWait(Q)},reset:()=>f.current?.reset(),focus:()=>{K(),$(Q=>Q+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[we,K,ee]);let We=(0,Ee.useCallback)(()=>{b.trim()&&(we(b),T(""))},[b,we]),me=(0,Ee.useCallback)(()=>{(f.current?.messages.length??0)>0?(h("open"),$(Q=>Q+1)):(w.current=!1,h(Q=>Q==="input"?"expanded":Q))},[]),be={mode:"floating"};i.mcpServerUrl&&(be.mcpServerUrl=i.mcpServerUrl),i.channelId&&(be.channelId=i.channelId);let le=D.length>0&&y!=="input",de=(0,wt.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,wt.jsx)(Ga,{className:"ww:size-4"})});return(0,wt.jsx)(Dl,{value:p,children:(0,wt.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,wt.jsxs)(wt.Fragment,{children:[(0,wt.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",le?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,wt.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",le?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:le?{boxShadow:Ve,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[le&&y!=="open"&&(0,wt.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,wt.jsx)(Ga,{className:"ww:size-4"})}),D.length>0&&(0,wt.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,wt.jsx)("div",{className:"ww:overflow-hidden",children:(0,wt.jsx)(cl,{suggestions:D,onSelect:Q=>{p.emit({name:"suggestion.clicked",properties:{text:Q,index:D.indexOf(Q),origin:N?.origin??"channel"}}),we(Q)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,wt.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:Ve},children:(0,wt.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,wt.jsx)("input",{ref:x,type:"text",value:b,placeholder:I,onChange:Q=>T(Q.target.value),onFocus:me,onKeyDown:Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.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,wt.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,wt.jsx)(Nn,{className:"ww:size-4"})})]})})]})}),(0,wt.jsx)("div",{role:"dialog","aria-label":i.title??ue,"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,wt.jsx)(zl,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:be,appearance:i.appearance,title:i.title,headerActions:de,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 Oa=z(he(),1);var fv=z(re(),1),pO=(0,Oa.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=jl(t,a,n),u=(0,Oa.useRef)(null),c=(0,Oa.useMemo)(()=>Rl({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,Oa.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,Oa.useRef)(!1);(0,Oa.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,Oa.useEffect)(()=>{r?.()},[]);let p=ql(l.visibility,s);(0,Oa.useEffect)(()=>{o?.(p)},[p,o]),El({api:l.api,token:l.token,channelId:l.channelId,mode:"inline",paintMark:"chatVisible",painted:s}),(0,Oa.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=Hl(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,fv.jsx)(Dl,{value:c,children:(0,fv.jsx)(zl,{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=z(he(),1),vO=z(Og(),1);function mO(){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 pv(){return mO()!==null}function I7(){return{url:location.href,title:document.title}}async function mv(e){let{endpoint:t,listEndpoint:a,headers:n,sessionId:r,visitorId:o,channelId:i,onWidget:l}=e,s=e.logger??console,u=mO();if(!u)return null;let c=new AbortController,d=()=>c.abort();window.addEventListener("pagehide",d);let f=!1,p=()=>{f||(f=!0,window.removeEventListener("pagehide",d),c.abort())};function m(){return{sessionId:r,visitorId:o,channelId:i,page:I7()}}async function x(h,b){let T=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify(h),...b?{signal:b}:{}});if(!T.ok)throw new Error(`webmcp ${h.action} failed: ${T.status}`);return await T.json()}async function S(){if(a)try{let h=await fetch(a);if(h.ok)return await h.json();s.info(`[webmcp] list GET answered ${h.status}, using POST`)}catch(h){s.info("[webmcp] list GET failed, using POST",h)}return x({...m(),action:"list"})}let w=[];try{let h=await S();w=Array.isArray(h?.tools)?h.tools:[]}catch(h){return s.error("[webmcp] could not list site tools",h),p(),null}let y=[];return await Promise.all(w.map(async h=>{try{await u.registerTool({name:h.name,description:h.description??"",...h.inputSchema?{inputSchema:h.inputSchema}:{},...h.annotations?{annotations:h.annotations}:{},execute:async(b,T)=>{let C=await x({...m(),action:"call",name:h.name,arguments:b??{}},T?.signal);return C?.widget&&l?.(C.widget),{content:C?.content??[]}}},{signal:c.signal}),y.push(h)}catch(b){s.error(`[webmcp] could not register ${h.name}`,b)}})),s.info(`[webmcp] registered ${y.length} site tool(s)`),{get tools(){return y},callTool:({name:h,arguments:b})=>x({...m(),action:"call",name:h,arguments:b??{}}),dispose:p}}function hO(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,o=e.channelId??a;return{toolsEndpoint:ma(n,"/webmcp",r),listEndpoint:ma(n,"/webmcp/tools",{token:e.token,...o&&{channel:o},...r}),...o&&{channelId:o},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:ma(n,"/resource",{token:e.token,...r})}}var ho=z(he(),1);var Vl=z(re(),1),gO=672,wO=32;function yO({widget:e,onCallTool:t,toolsEndpoint:a,headers:n,resourceEndpoint:r,onClose:o,isDark:i=!1}){let[l,s]=(0,ho.useState)(null);(0,ho.useEffect)(()=>{let p=()=>s({width:window.innerWidth,height:window.innerHeight});return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let u=e?.preview===!0;(0,ho.useEffect)(()=>{if(!e||!u)return;let p=m=>{m.key==="Escape"&&o()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,u,o]),(0,ho.useEffect)(()=>{if(!e)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[e]);let c=(0,ho.useCallback)(async p=>{if(t)return t(p);if(!a)throw new Error("webmcp overlay needs onCallTool");let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...p})});if(!m.ok)throw new Error(`webmcp tool call failed: ${m.status}`);return await m.json()},[t,a,n]);if(!e)return null;let d=l?Math.min(gO,l.width-wO):gO,f=l?l.height-wO:void 0;return(0,Vl.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",i&&"dark"),children:[u&&(0,Vl.jsx)("button",{type:"button","aria-label":"Close",onClick:o,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,Vl.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:d,maxHeight:f},children:(0,Vl.jsx)(gp,{resourceUri:e.viewUri,resourceEndpoint:r,toolInput:e.data,toolResult:e.result,autoHeight:qu(e.result._meta),isDark:i,onCallTool:c,onOpenLink:p=>window.open(p,"_blank","noopener")},`${r}|${e.viewUri}`)})]})}var hv=z(re(),1),xO="waniwani:webmcp:session";function C7(){try{let e=sessionStorage.getItem(xO);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(xO,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function k7(e){let t=e.token?mo(e.api??"",e.token,e.channelId):null,a=hO(e,t?.webmcp?.enabled,t?.channelId);return a||ha("[webmcp] not publishing site tools: switched off, or no token"),a}function T7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function L7(){let e=null,t=null;return{emit(a){e?e(a):t=a},subscribe(a){return e=a,t&&(a(t),t=null),()=>{e===a&&(e=null)}}}}function E7({resourceEndpoint:e,subscribe:t,callTool:a}){let[n,r]=rc.default.useState(null),[o,i]=rc.default.useState(T7);return rc.default.useEffect(()=>t(r),[t]),rc.default.useEffect(()=>{let l;try{l=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let s=()=>i(l.matches);return l.addEventListener("change",s),()=>l.removeEventListener("change",s)},[]),(0,hv.jsx)(yO,{widget:n,onCallTool:a,resourceEndpoint:e,isDark:o,onClose:()=>r(null)})}function bO(e){if(!pv())return null;let t=k7(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),a.style.cssText="position:relative;z-index:2147483001;",document.body.appendChild(a);let n=a.attachShadow({mode:"open"});qp(n);let r=document.createElement("div");n.appendChild(r);let o=L7(),i=null,l=!1;mv({endpoint:t.toolsEndpoint,listEndpoint:t.listEndpoint,headers:t.headers,channelId:t.channelId,sessionId:C7(),visitorId:Zt(),onWidget:o.emit}).then(c=>{if(l){c?.dispose();return}i=c}).catch(c=>{console.error("[webmcp] could not publish site tools",c)});let s=async c=>{if(!i)throw new Error("webmcp bridge is not registered");let d=await i.callTool(c);return d.widget?.interactive&&o.emit(d.widget),d},u=vO.default.createRoot(r);return u.render((0,hv.jsx)(E7,{resourceEndpoint:t.resourceEndpoint,subscribe:o.subscribe,callTool:s})),{getTools:()=>(i?.tools??[]).map(c=>c.name),destroy:()=>{l=!0,i?.dispose(),u.unmount(),a.remove()}}}var vt=null,hn=null,Mt=null,ci=null,jp=null,M7="waniwani-chat-sizing",A7="waniwani-chat-defaults",R7="waniwani-chat-chrome",D7="waniwani-chat-auto-card",_7=`:where([data-waniwani-embed]){height:${Z_}}`,O7=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",P7=":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)}",N7=":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))}",B7="waniwani-chat-composer-auto",U7=":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 CO(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 SO="data-waniwani-embed",ic="data-waniwani-auto";function kO(e){let t=document.querySelector(`[${SO}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(SO,""),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 F7(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function z7(e,t,a,n){let r=kO(n);oc(M7,_7),e.height&&r instanceof HTMLElement&&(r.style.height=F7(e.height)),e.appearance?.theme&&oc(A7,O7),oc(R7,P7),r.hasAttribute(ic)&&oc(D7,N7),CO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Mt);let o=Mt,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=Mt.attachShadow({mode:"open"});Vp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=di.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=mo(e.api??"",e.token,e.channelId);d?.visibility&&!tc(d.visibility,window.location.pathname)&&c(!1)}return hn=Wp.default.createRoot(s),hn.render(di.default.createElement(pO,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{jp?.disconnect(),jp=null,hn?.unmount(),hn=null,Mt?.remove(),Mt=null,r.hasAttribute(ic)&&r.remove(),vt=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 q7(e,t,a){Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Mt);let n=Mt.attachShadow({mode:"open"});Vp(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=di.default.createRef();return hn=Wp.default.createRoot(r),hn.render(di.default.createElement(fO,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,vt=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 H7(){return{destroy:()=>{vt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function j7(e,t,a,n){let r=kO(n);r.hasAttribute(ic)&&oc(B7,U7),CO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="display:block;width:100%;",r.appendChild(Mt);let o=Mt.attachShadow({mode:"open"});Vp(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),ci=document.createElement("div"),ci.id="waniwani-chat-panel",ci.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(ci);let l=ci.attachShadow({mode:"open"});Vp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=di.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=mo(e.api??"",e.token,e.channelId);d?.visibility&&!tc(d.visibility,window.location.pathname)&&c(!1)}return hn=Wp.default.createRoot(i),hn.render(di.default.createElement(cO,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:s,onVisibilityChange:c})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,ci?.remove(),ci=null,r.hasAttribute(ic)&&r.remove(),vt=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 TO(e){if(vt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),vt;let t=sv(),a=Fp(),n=ec(e,void 0,a);$s(n.visitorId);let r=null;try{r=bO(n)}catch(s){console.error("[Waniwani] WebMCP setup failed",s)}let o;n.mode==="off"?o=H7():n.mode==="floating"?o=q7(n,e,a):n.mode==="composer"?o=j7(n,e,a,t):o=z7(n,e,a,t);let i=n.api??"",l=n.token?_C({api:i,token:n.token,channelId:()=>n.channelId??mo(i,n.token,n.channelId)?.channelId,getSource:()=>mo(i,n.token,n.channelId)?.source??void 0,getSessionId:()=>o.getSessionId()}):Yd("no public token configured (set data-token or pass token to init())");return vt={...o,track:l.track,identify:(s,u)=>l.identify(s,u),setVisitorId:s=>il(s),getVisitorId:()=>Zt(),destroy:()=>{l.shutdown(),r?.destroy(),o.destroy()}},vt}function V7(){vt&&vt.destroy()}var LO=Yd("chat widget is not initialized (call WaniWani.chat.init() first)"),Wl=()=>vt?vt.track:LO.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:TO,destroy:V7,open:()=>vt?.open(),close:()=>vt?.close(),toggle:()=>vt?.toggle(),sendMessage:e=>vt?.sendMessage(e),sendMessageAndWait:async e=>{if(vt)return vt.sendMessageAndWait(e)},reset:()=>vt?.reset(),focus:()=>vt?.focus(),getMessages:()=>vt?.getMessages()??[],getSessionId:()=>vt?.getSessionId(),track:Object.assign(e=>Wl()(e),{priceShown:e=>Wl().priceShown(e),pricesCompared:e=>Wl().pricesCompared(e),optionSelected:e=>Wl().optionSelected(e),leadQualified:e=>Wl().leadQualified(e),converted:e=>Wl().converted(e)}),identify:(e,t)=>vt?vt.identify(e,t):LO.identify(e,t),setVisitorId:e=>il(e),getVisitorId:()=>Zt()};function IO(){if(Fp().token)try{TO()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",IO):IO();})();
|
|
137
|
+
`)}})}};var av=Lp(()=>$u(g.union([g.strictObject({type:g.literal("text-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("error"),errorText:g.string()}),g.strictObject({type:g.literal("tool-input-start"),toolCallId:g.string(),toolName:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-delta"),toolCallId:g.string(),inputTextDelta:g.string()}),g.strictObject({type:g.literal("tool-input-available"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-error"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),errorText:g.string(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),g.strictObject({type:g.literal("tool-output-available"),toolCallId:g.string(),output:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),preliminary:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-error"),toolCallId:g.string(),errorText:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-denied"),toolCallId:g.string()}),g.strictObject({type:g.literal("reasoning-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("file"),url:g.string(),mediaType:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:g.string().optional(),data:g.unknown(),transient:g.boolean().optional()}),g.strictObject({type:g.literal("start-step")}),g.strictObject({type:g.literal("finish-step")}),g.strictObject({type:g.literal("start"),messageId:g.string().optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("finish"),finishReason:g.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("abort"),reason:g.string().optional()}),g.strictObject({type:g.literal("message-metadata"),messageMetadata:g.unknown()})])));function hV(e){return e.type.startsWith("data-")}function tv(e){return e.type.startsWith("tool-")}function gV(e){return e.type==="dynamic-tool"}function Rp(e){return tv(e)||gV(e)}function w_(e){return e.type.split("-").slice(1).join("-")}function wV({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function yV({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(h){let T=u.message.parts.filter(Rp).find(C=>C.toolCallId===h);if(T==null)throw new Pl({chunkType:"tool-invocation",chunkId:h,message:`No tool invocation found for tool call ID "${h}".`});return T}function S(h){var b;let T=u.message.parts.find(D=>tv(D)&&D.toolCallId===h.toolCallId),C=h,M=T;if(T!=null){T.state=h.state,M.input=C.input,M.output=C.output,M.errorText=C.errorText,M.rawInput=C.rawInput,M.preliminary=C.preliminary,h.title!==void 0&&(M.title=h.title),M.providerExecuted=(b=C.providerExecuted)!=null?b:T.providerExecuted;let D=C.providerMetadata;if(D!=null)if(h.state==="output-available"||h.state==="output-error"){let P=T;P.resultProviderMetadata=D}else T.callProviderMetadata=D}else u.message.parts.push({type:`tool-${h.toolName}`,toolCallId:h.toolCallId,state:h.state,title:h.title,input:C.input,output:C.output,rawInput:C.rawInput,errorText:C.errorText,providerExecuted:C.providerExecuted,preliminary:C.preliminary,...C.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:C.providerMetadata}:{},...C.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:C.providerMetadata}:{}})}function w(h){var b,T;let C=u.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===h.toolCallId),M=h,D=C;if(C!=null){C.state=h.state,D.toolName=h.toolName,D.input=M.input,D.output=M.output,D.errorText=M.errorText,D.rawInput=(b=M.rawInput)!=null?b:D.rawInput,D.preliminary=M.preliminary,h.title!==void 0&&(D.title=h.title),D.providerExecuted=(T=M.providerExecuted)!=null?T:C.providerExecuted;let P=M.providerMetadata;if(P!=null)if(h.state==="output-available"||h.state==="output-error"){let L=C;L.resultProviderMetadata=P}else C.callProviderMetadata=P}else u.message.parts.push({type:"dynamic-tool",toolName:h.toolName,toolCallId:h.toolCallId,state:h.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:h.title,...M.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function y(h){if(h!=null){let b=u.message.metadata!=null?E_(u.message.metadata,h):h;t!=null&&await Ap({value:b,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=b}}switch(l.type){case"text-start":{let h={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=h,u.message.parts.push(h),c();break}case"text-delta":{let h=u.activeTextParts[l.id];if(h==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.`});h.text+=l.delta,h.providerMetadata=(d=l.providerMetadata)!=null?d:h.providerMetadata,c();break}case"text-end":{let h=u.activeTextParts[l.id];if(h==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.`});h.state="done",h.providerMetadata=(f=l.providerMetadata)!=null?f:h.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let h={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=h,u.message.parts.push(h),c();break}case"reasoning-delta":{let h=u.activeReasoningParts[l.id];if(h==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.`});h.text+=l.delta,h.providerMetadata=(p=l.providerMetadata)!=null?p:h.providerMetadata,c();break}case"reasoning-end":{let h=u.activeReasoningParts[l.id];if(h==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.`});h.providerMetadata=(m=l.providerMetadata)!=null?m:h.providerMetadata,h.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 h=u.message.parts.filter(tv);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:h.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 h=u.partialToolCalls[l.toolCallId];if(h==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.`});h.text+=l.inputTextDelta;let{value:b}=await Ku(h.text);h.dynamic?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.title}):S({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.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 h=u.message.parts.filter(Rp).find(T=>T.toolCallId===l.toolCallId);(h!=null?h.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 h=x(l.toolCallId);h.state="approval-requested",h.approval={id:l.approvalId},c();break}case"tool-output-denied":{let h=x(l.toolCallId);h.state="output-denied",c();break}case"tool-output-available":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-available",input:h.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:w_(h),state:"output-available",input:h.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:h.title}),c();break}case"tool-output-error":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-error",input:h.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:w_(h),state:"output-error",input:h.input,rawInput:h.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.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(hV(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 Ap({value:l.data,schema:a[l.type],context:{field:`message.parts[${C}].data`,entityName:l.type,entityId:l.id}})}let h=l;if(h.transient){i?.(h);break}let b=h.id!=null?u.message.parts.find(T=>h.type===T.type&&h.id===T.id):void 0;b!=null?b.data=h.data:u.message.parts.push(h),i?.(h),c()}}s.enqueue(l)})}}))}async function xV({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 rse=Sr({prefix:"aitxt",size:24});var lse=Lp(()=>$u(g.array(g.object({id:g.string(),role:g.enum(["system","user","assistant"]),metadata:g.unknown().optional(),parts:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("reasoning"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("file"),mediaType:g.string(),filename:g.string().optional(),url:g.string(),providerMetadata:te.optional()}),g.object({type:g.literal("step-start")}),g.object({type:g.string().startsWith("data-"),id:g.string().optional(),data:g.unknown()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-streaming"),input:g.unknown().optional(),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-error"),input:g.unknown(),rawInput:g.unknown().optional(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-denied"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-streaming"),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),input:g.unknown().optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-error"),providerExecuted:g.boolean().optional(),input:g.unknown(),rawInput:g.unknown().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-denied"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var use=Sr({prefix:"aiobj",size:24});function M_(e){return({url:t,abortSignal:a})=>Z8({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var vV=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 dse=Sr({prefix:"aiobj",size:24});var fse=M_();var bV="AI_NoSuchProviderError",SV=`vercel.ai.error.${bV}`,IV=Symbol.for(SV),CV;CV=IV;var pse=M_();async function kV(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 TV=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 Hn(this.body),s=await Hn(this.headers),u=await Hn(this.credentials),c={...fo(s),...fo(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?fo(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 Hn(this.body),l=await Hn(this.headers),s=await Hn(this.credentials),u={...fo(l),...fo(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?fo(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)}},nv=class extends TV{constructor(e={}){super(e)}processResponseStream(e){return g_({stream:e,schema:av}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},A_=class{constructor({generateId:e=c_,id:t=e(),transport:a=new nv,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new vV,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 kV(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:w=d,d.messageId!=null){let y=this.state.messages.findIndex(h=>h.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=>Rp(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 h;y&&this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.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=h=>Rp(h)&&h.toolCallId===f?{...h,state:d,output:p,errorText:m}:h;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(h=>{var b;h&&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:wV({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 xV({stream:yV({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 P_=z(D_(),1);var Ju=z(he(),1);var Op=z(he(),1);var O_=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},gt=(e,t,a)=>(O_(e,t,"read from private field"),a?a.call(e):t.get(e)),jn=(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)},mo=(e,t,a,n)=>(O_(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function EV(e,t){return t!=null?(0,P_.default)(e,t):e}var fn,Dp,_p,Yu,Zu,Qu,Nl,rv,ov,MV=class{constructor(e=[]){jn(this,fn,void 0),jn(this,Dp,"ready"),jn(this,_p,void 0),jn(this,Yu,new Set),jn(this,Zu,new Set),jn(this,Qu,new Set),this.pushMessage=t=>{mo(this,fn,gt(this,fn).concat(t)),gt(this,Nl).call(this)},this.popMessage=()=>{mo(this,fn,gt(this,fn).slice(0,-1)),gt(this,Nl).call(this)},this.replaceMessage=(t,a)=>{mo(this,fn,[...gt(this,fn).slice(0,t),this.snapshot(a),...gt(this,fn).slice(t+1)]),gt(this,Nl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?EV(t,a):t;return gt(this,Yu).add(n),()=>{gt(this,Yu).delete(n)}},this["~registerStatusCallback"]=t=>(gt(this,Zu).add(t),()=>{gt(this,Zu).delete(t)}),this["~registerErrorCallback"]=t=>(gt(this,Qu).add(t),()=>{gt(this,Qu).delete(t)}),jn(this,Nl,()=>{gt(this,Yu).forEach(t=>t())}),jn(this,rv,()=>{gt(this,Zu).forEach(t=>t())}),jn(this,ov,()=>{gt(this,Qu).forEach(t=>t())}),mo(this,fn,e)}get status(){return gt(this,Dp)}set status(e){mo(this,Dp,e),gt(this,rv).call(this)}get error(){return gt(this,_p)}set error(e){mo(this,_p,e),gt(this,ov).call(this)}get messages(){return gt(this,fn)}set messages(e){mo(this,fn,[...e]),gt(this,Nl).call(this)}};fn=new WeakMap;Dp=new WeakMap;_p=new WeakMap;Yu=new WeakMap;Zu=new WeakMap;Qu=new WeakMap;Nl=new WeakMap;rv=new WeakMap;ov=new WeakMap;var Bl,__=class extends A_{constructor({messages:e,...t}){let a=new MV(e);super({...t,state:a}),jn(this,Bl,void 0),this["~registerMessagesCallback"]=(n,r)=>gt(this,Bl)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>gt(this,Bl)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>gt(this,Bl)["~registerErrorCallback"](n),mo(this,Bl,a)}};Bl=new WeakMap;function N_({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,pn.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,pn.useRef)("chat"in a?a.chat:new __(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new __(r));let l=(0,pn.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,pn.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,pn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,pn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,pn.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,pn.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 X=z(he(),1);var AV="/api/mcp/modules/documents",RV=2e4,DV=3e5,mn=class extends Error{constructor(a,n){super(n);re(this,"code");this.name="DocumentUploadError",this.code=a}};function B_(e,t){return Wd(e,`${AV}${t}`)}function _V(e){return B_(e,"/upload-url")}function U_(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function OV(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 PV(e){return e===403?new mn("upload_disabled","This agent does not accept document uploads."):e===413?new mn("max_file_size","That file is too large."):e===422||e===400?new mn("accept","That file type is not accepted."):new mn("upload_failed",`The upload could not be started (${e}).`)}function NV(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=DV;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 mn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new mn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new mn("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 Pp(e){let t=B_(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:U_(e.headers,e.uploadHeaders)})}catch{}}async function F_(e){e.signal.throwIfAborted();let t=_V(e.api);if(!t)throw new mn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),RV),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let l=U_(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 mn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw PV(o.status);let i=OV(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new mn("upload_failed","The upload could not be started.");return await NV({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 BV(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 Np=class extends nv{processResponseStream(t){let a="",n=av(),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=BV(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 z_=50,q_=1e3;function Bp(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 Up(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await jg(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function iv(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function lv(e){return await Up(async a=>{let o=a.transaction(Wa,"readonly").objectStore(Wa).index(Gd),l=(await iv(o.getAll(e))??[]).filter(Bp);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Fp(e){return await Up(async a=>{let r=a.transaction(Wa,"readonly").objectStore(Wa),o=await iv(r.get(e));return Bp(o)?o:null})??null}async function sv(e){if(!Bp(e))return;let t=e.messages.length>q_?{...e,messages:e.messages.slice(e.messages.length-q_)}:e;await Up(async a=>{await new Promise((s,u)=>{let c=a.transaction(Wa,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Wa).put(t)});let n=a.transaction(Wa,"readwrite"),r=n.objectStore(Wa),o=r.index(Gd),l=(await iv(o.getAll(t.memoryUserId))??[]).filter(Bp);if(l.length>z_){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-z_);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 H_(e){await Up(async t=>(await new Promise((a,n)=>{let r=t.transaction(Wa,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Wa).delete(e)}),null))}async function uv(e){return(await lv(e))[0]?.threadId??null}function j_(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 UV="x-session-id",FV=250,zV=200;function V_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():cu()}function zp(){return new Date().toISOString()}function W_(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function qV(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 G_(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,X.useEffect)(()=>Xs(c),[c]);let d=bp(),f=(0,X.useRef)(a),p=(0,X.useRef)(n),m=(0,X.useRef)(r),x=(0,X.useRef)(l);(0,X.useEffect)(()=>{x.current=l},[l]);let S=(0,X.useRef)(void 0),w=(0,X.useRef)(void 0),y=(0,X.useRef)(null),[h,b]=(0,X.useState)(void 0),T=(0,X.useRef)(h),[C,M]=(0,X.useState)(s),D=(0,X.useRef)(C),[P,L]=(0,X.useState)([]),[$,H]=(0,X.useState)(!l),F=(0,X.useRef)(void 0),W=(0,X.useRef)(void 0),V=(0,X.useRef)(void 0),N=(0,X.useRef)(void 0),R=(0,X.useRef)(0),G=(0,X.useRef)(u);(0,X.useEffect)(()=>{G.current=u},[u]);let ue=(0,X.useCallback)(O=>{D.current=O,M(O),O&&(G.current?.(O),d.emit({name:"thread.changed",sessionId:T.current,properties:{threadId:O}}))},[d]),I=(0,X.useCallback)(async()=>{if(!l)return;let O=y.current?.memoryUserId;if(!O)return;let ne=await lv(O);L(ne)},[l]),We=(0,X.useCallback)(()=>T.current,[]),Je=(0,X.useCallback)(O=>{let ne=W_(O);if(!ne||T.current===ne)return;let pe=T.current===void 0;T.current=ne,b(ne),pe&&d.emit({name:"session.started",properties:{sessionId:ne}})},[d]),v=(0,X.useCallback)(()=>{T.current=void 0,b(void 0)},[]);(0,X.useEffect)(()=>{f.current=a,p.current=n},[a,n]),(0,X.useEffect)(()=>{m.current=r},[r]),(0,X.useEffect)(()=>{let O=!1,ne=R.current;return(async()=>{try{let Ke=await Ks();if(O)return;y.current=Ke}catch{}if(!l)return;let pe=y.current?.memoryUserId;if(!pe){H(!0);return}try{let Ke=s??await uv(pe);if(O||ne!==R.current)return;if(Ke){let $t=await Fp(Ke);if(O||ne!==R.current)return;$t&&$t.memoryUserId===pe&&(D.current=$t.threadId,M($t.threadId),F.current=$t.createdAt,W.current=$t.title,$t.sessionId&&(T.current=$t.sessionId,b($t.sessionId)),Oe($t.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[]);let K=(0,X.useRef)(null),ee=(0,X.useCallback)(O=>{let ne=m.current?.[O];return typeof ne=="string"?ne:void 0},[]),we=(0,X.useCallback)(()=>({api:t,token:Xd(f.current),channelId:ee("channelId"),sessionId:T.current}),[t,ee]),Ge=(0,X.useCallback)(O=>{let ne=K.current;K.current=null,ne?.report(we(),{mode:ee("mode"),outcome:O})},[we,ee]),me=(0,X.useRef)(new Np({api:t,headers:()=>({...f.current}),body:()=>{let O={...m.current??{}},ne=Object.hasOwn(O,"sessionId"),pe=W_(O.sessionId);if(pe)Je(pe),O.sessionId=pe;else if(ne)v(),delete O.sessionId;else{let Kp=We();Kp&&(O.sessionId=Kp)}li(S.current)&&(O.modelContext=S.current),w.current?.length&&(O.documents=w.current);let Ke=y.current,$t=Zt();Ke&&(O.visitorContext={timezone:Ke.timezone,language:Ke.language,languages:Ke.languages,deviceType:Ke.deviceType,referrer:Ke.referrer,visitorId:$t});let At=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},FO=typeof At.client=="object"&&At.client!==null?At.client:{};O.visitor={...At,id:$t,client:{...FO,...Ke&&{memoryUserId:Ke.memoryUserId}}};let bv=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,Sv=y.current?.memoryUserId,Iv=y.current?.language,cc={};if(Sv&&(cc.memoryUserId=Sv),Iv&&(cc.locale=Iv),(Object.keys(cc).length>0||bv)&&(O.extra={...cc,...bv??{}}),x.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(D.current=O.threadId);else{let dc=D.current;dc||(dc=V_(),F.current=zp(),W.current=void 0,ue(dc)),O.threadId=dc}return O},fetch:(async(O,ne)=>{let pe=K.current;pe?.mark("requestStart");try{let Ke=await fetch(O,ne);return S.current=void 0,Je(Ke.headers.get(UV)),pe?pe.instrument(Ke):Ke}finally{w.current=void 0}})})),ye=(0,X.useRef)(e.transport?.({fallback:me.current,headers:()=>f.current,body:()=>({channelId:ee("channelId"),visitor:{id:Zt()}}),needsFallback:()=>x.current||!!w.current?.length||li(S.current),onSession:Je})??me.current),le=(0,X.useRef)(null),de=(0,X.useRef)(null),Q=(0,X.useRef)({}),[Be,qe]=(0,X.useState)(0),_e=e.skipRemoteConfig===!0,ke=(0,X.useCallback)(async()=>{if(!_e)try{let O=await qV(t,f.current);Q.current=O,qe(ne=>ne+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,_e]);(0,X.useEffect)(()=>{ke()},[ke]);let{messages:xe,sendMessage:Y,setMessages:Oe,status:rt,stop:ba}=N_({messages:e.initialMessages,transport:ye.current,onFinish({message:O,isAbort:ne,isDisconnect:pe,isError:Ke}){K.current?.mark("streamEnd"),Ge(ne||pe||Ke?"error":"ok"),i?.(),!ne&&!pe&&!Ke&&d.emit({name:"message.received"}),le.current&&(de.current=O)},onError(O){Ge("error"),console.warn("[Waniwani] Chat error:",O.message),d.emit({name:"chat.error",properties:{message:O.message.slice(0,zV)}}),le.current&&(le.current.reject(O),le.current=null)}}),Sa=(0,X.useRef)(xe);(0,X.useEffect)(()=>{Sa.current=xe},[xe]),(0,X.useEffect)(()=>{let O=ye.current;return O.restore?.().then(ne=>{ne.length>0&&Sa.current.length===0&&Oe(ne)}).catch(()=>{}),()=>O.dispose?.()},[]);let ra=(0,X.useCallback)(()=>{K.current=DC(Sa.current.filter(O=>O.role==="user").length+1)},[]),[pi,wo]=(0,X.useState)(!1),A=(0,X.useCallback)(async()=>{wo(!0);try{await ba();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{wo(!1)}},[t,ba]),U=(0,X.useRef)(l);(0,X.useEffect)(()=>{if(!l||U.current||(U.current=!0,Sa.current.length>0))return;let O=!1,ne=R.current;return H(!1),(async()=>{try{let pe=y.current;if(!pe)try{pe=await Ks(),y.current=pe}catch{}let Ke=pe?.memoryUserId;if(!Ke||O||ne!==R.current){O||H(!0);return}let $t=s??await uv(Ke);if(O||ne!==R.current)return;if($t){let At=await Fp($t);if(O||ne!==R.current)return;At&&At.memoryUserId===Ke&&(D.current=At.threadId,M(At.threadId),F.current=At.createdAt,W.current=At.title,At.sessionId&&(T.current=At.sessionId,b(At.sessionId)),Oe(At.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[l]),(0,X.useEffect)(()=>{if(rt==="ready"&&le.current&&de.current){let O=le.current,ne=de.current;le.current=null,de.current=null,O.resolve(ne)}},[rt]);let[J,oe]=(0,X.useState)(""),Ae=typeof c!="function",zt=J.length>0;(0,X.useEffect)(()=>{Ae&&zt&&ye.current.prepare?.()},[Ae,zt]);let[Wt,Ia]=(0,X.useState)([]),Vn=(0,X.useRef)([]);Vn.current=Wt;let gn=rt==="submitted"||rt==="streaming",Gt=(0,X.useCallback)(O=>{for(let ne of O)for(let pe of ne.documents??[])Pp({documentId:pe.documentId,api:t,headers:f.current,uploadHeaders:p.current})},[t]),ca=(0,X.useCallback)(()=>{Gt(Vn.current),Ia([])},[Gt]),wn=(0,X.useCallback)(O=>{let ne=Vn.current.find(pe=>pe.id===O);ne&&Gt([ne]),Ia(pe=>pe.filter(Ke=>Ke.id!==O))},[Gt]),AO=gn&&Wt.length>0,RO=(0,X.useCallback)(O=>{let ne=!!O.text?.trim(),pe=!!(O.files?.length||O.documents?.length);if(ne||pe){if(gn){if(Wt.length>0)return;Ia(Ke=>[...Ke,{id:cu(),text:O.text||"",files:O.files??[],documents:O.documents??[],modelContext:O.modelContext}]),oe("");return}ra(),S.current=O.modelContext,w.current=O.documents,Y({text:O.text||"",files:O.files,...O.documents?.length&&{metadata:{documents:O.documents}}}),o?.(O.text||""),d.emit({name:"message.sent"}),oe("")}},[Y,o,gn,Wt.length,d,ra]),DO=(0,X.useCallback)(O=>new Promise((ne,pe)=>{le.current={resolve:ne,reject:pe},ra(),Y({text:O}),o?.(O),d.emit({name:"message.sent"})}),[Y,o,d,ra]);(0,X.useEffect)(()=>{if(rt!=="ready"||pi||Wt.length===0)return;let[O,...ne]=Wt;Ia(ne),ra(),S.current=O.modelContext,w.current=O.documents,Y({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"})},[rt,pi,Y,o,Wt,d,ra]);let _O=(0,X.useCallback)(()=>{ye.current.reset?.(),Oe([]),ca(),v(),oe(""),Q.current={},qe(O=>O+1),ke()},[Oe,v,ke,ca]),sc=(0,X.useCallback)(()=>{if(!x.current)return;let O=y.current?.memoryUserId,ne=D.current,pe=Sa.current;if(!(!O||!ne||pe.length===0)){if(F.current||(F.current=zp()),!W.current){let Ke=pe.find(At=>At.role==="user"),$t=Ke?Ke.parts.map(At=>"text"in At&&typeof At.text=="string"?At.text:"").join(" "):"";W.current=j_($t)}return{threadId:ne,memoryUserId:O,title:W.current,messages:pe,sessionId:T.current,createdAt:F.current,updatedAt:zp()}}},[]),yv=(0,X.useCallback)(async()=>{let O=sc();O&&(await sv(O),await I())},[sc,I]);(0,X.useEffect)(()=>{if(l&&$&&!(rt==="submitted"||rt==="streaming")&&xe.length!==0)return V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=void 0;let O=yv().finally(()=>{N.current===O&&(N.current=void 0)});N.current=O},FV),()=>{V.current&&clearTimeout(V.current)}},[l,$,xe,rt,yv]);let uc=(0,X.useCallback)(()=>{let O=N.current,ne=V.current,pe=ne?sc():void 0;return ne&&(clearTimeout(ne),V.current=void 0),(async()=>{O&&await O,pe&&(await sv(pe),await I())})()},[sc,I]),OO=(0,X.useCallback)(()=>{R.current+=1,uc(),ye.current.reset?.(),Oe([]),ca(),v(),oe("");let O=V_();return F.current=zp(),W.current=void 0,ue(O),I(),O},[Oe,v,ue,I,uc,ca]),Xp=(0,X.useCallback)(async O=>{R.current+=1;let ne=R.current;if(await uc(),ne!==R.current)return;let pe=await Fp(O);ne===R.current&&pe&&(pe.sessionId?(T.current=pe.sessionId,b(pe.sessionId)):v(),ue(pe.threadId),F.current=pe.createdAt,W.current=pe.title,Oe(pe.messages),ca(),oe(""))},[Oe,v,ue,uc,ca]),PO=(0,X.useCallback)(async O=>{if(D.current===O){R.current+=1,V.current&&(clearTimeout(V.current),V.current=void 0);let ne=N.current;ne&&await ne}await H_(O),await I(),D.current===O&&(Oe([]),ca(),v(),oe(""),D.current=void 0,M(void 0),F.current=void 0,W.current=void 0)},[Oe,v,I,ca]);(0,X.useEffect)(()=>{l&&$&&s!==void 0&&s!==D.current&&Xp(s)},[s,l,$,Xp]);let NO=(0,X.useCallback)(O=>{oe(O.target.value)},[]),xv=xe[xe.length-1],vv=xe.length>0,BO=gn&&(!vv||xv.role==="user"),UO=Q.current;return{messages:xe,status:rt,text:J,setText:oe,handleSubmit:RO,handleTextChange:NO,isLoading:gn,showLoaderBubble:BO,lastMessage:xv,hasMessages:vv,sendMessage:Y,sendMessageAndWait:DO,stop:A,reset:_O,queuedMessages:Wt,queueFull:AO,removeQueuedMessage:wn,sessionId:h,toolDefinitions:UO,refreshToolDefinitions:ke,threads:P,activeThreadId:C,isThreadHistoryReady:$,startNewThread:OO,switchThread:Xp,deleteThread:PO,keepsConversation:!!ye.current.restore}}var ui=z(he(),1);var HV=6e3;function $_(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[l,s]=(0,ui.useState)(null),u=(0,ui.useCallback)((f,p,m)=>F_({file:f,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:p,onProgress:m}),[t,a,n,r]),c=(0,ui.useCallback)(f=>{Pp({documentId:f.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,ui.useEffect)(()=>{if(!l)return;let f=setTimeout(()=>s(null),HV);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 va=z(he(),1);function Ul(e){return e.map(t=>({id:null,text:t}))}function ci(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 X_(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function jV(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[Bg];return!Fl(a)||!X_(a.suggestions)?null:a.suggestions}function K_(e){let t=null;for(let a of e.parts){let n=jV(a);n!==null&&(t=n)}return t}function Y_(e){for(let t of e.parts){if(!Fl(t)||t.type!=="data-suggestions")continue;let a=t.data;if(Fl(a)&&X_(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function VV(e){return"page"in e||"channel"in e}function WV(e){return typeof e!="object"||e===null?{}:VV(e)?{rungs:e}:{initial:e.initial}}function Z_(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=WV(n),l=(0,va.useMemo)(()=>({page:null,channel:Ul(i??[])}),[i]),s=o??l,u=(0,va.useMemo)(()=>r?ci({flow:null,followup:null,...s}):null,[r,s]),c=(0,va.useMemo)(()=>u?.suggestions.map(h=>h.text)??[],[u]),[d,f]=(0,va.useState)(c),[p,m]=(0,va.useState)(u?.origin??"channel"),x=(0,va.useRef)(a),S=(0,va.useCallback)(()=>{f([])},[]),w=t.length>0;(0,va.useEffect)(()=>{w||(f(c),m(u?.origin??"channel"))},[c,u,w]);let y=t[t.length-1];return(0,va.useEffect)(()=>{y?.role==="user"&&S()},[y,S]),(0,va.useEffect)(()=>{let h=x.current;if(x.current=a,h!=="streaming"||a!=="ready"||!r)return;let b=[...t].reverse().find(D=>D.role==="assistant");if(!b)return;let T=K_(b),C=Y_(b),M=ci({flow:T===null?null:Ul(T),followup:C===null?null:Ul(C),page:null,channel:null});f(M?M.suggestions.map(D=>D.text):[]),m(M?.origin??"channel")},[a,r,t]),{suggestions:d,source:p,isLoading:!1,clear:S}}function Q_(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 GV={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(GV)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let i of n)t[i]=o}return t}var Ve=z(ae(),1),ql=(0,ze.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ve.jsx)(zo,{locale:n,messages:r,children:(0,Ve.jsx)($V,{...t,ref:a})})}),$V=(0,ze.forwardRef)(function(t,a){let{t:n,ready:r}=Ie(),{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:h,hideHeader:b=!1,enableThreadHistory:T=!1,showToolCalls:C=!0,initializing:M=!1,onScreen:D=!0,disclaimer:P}=t,L=o?.theme,$=o?.variables,H=o?.assistantBubble??!1,F=$?zl($):{},[W,V]=(0,ze.useState)(!1);(0,ze.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,R=G_({...t,api:m}),G=bp(),ue=K2({...t,api:m,sessionId:R.sessionId,onCallTool:x?.onCallTool}),I=x?.resourceEndpoint??Q_(m,t.headers),We=(0,ze.useRef)({});We.current={api:m,token:Xd(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:R.sessionId};let Je=(0,ze.useCallback)(A=>{Kd("widget",We.current,{widget:A.widget,outcome:A.outcome},A.metrics)},[]),v=ml(f,!R.text),K=$_({api:m,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:R.sessionId,documentUpload:u,allowAttachments:s}),[ee,we]=(0,ze.useState)(null),[Ge,me]=(0,ze.useState)(null),ye=(0,ze.useRef)(null),le=(0,ze.useRef)(null),de=(0,ze.useRef)(null),Q=(0,ze.useRef)(null),[Be,qe]=(0,ze.useState)(!0),_e=(0,ze.useRef)(Be);_e.current=Be;let ke=(0,ze.useCallback)(()=>{let A=ye.current;if(!A)return;let U=A.querySelector("textarea");U&&U.focus()},[]),xe=(0,ze.useCallback)((A="smooth")=>{let U=le.current;U&&U.scrollTo({top:U.scrollHeight,behavior:A})},[]);(0,ze.useEffect)(()=>{let A=Q.current,U=le.current;if(!A||!U)return;let J=new IntersectionObserver(([oe])=>qe(oe.isIntersecting),{root:U,rootMargin:"0px 0px 200px 0px",threshold:0});return J.observe(A),()=>J.disconnect()},[]),(0,ze.useEffect)(()=>{let A=le.current;if(!A)return;let U=J=>{let Ae=(J.target instanceof Element?J.target:null)?.closest("a");Ae?.href&&G.emit({name:"link.clicked",properties:{url:Ae.href}})};return A.addEventListener("click",U),()=>A.removeEventListener("click",U)},[G]),(0,ze.useEffect)(()=>{(R.messages[R.messages.length-1]?.role==="user"||_e.current)&&xe("smooth")},[R.messages.length,R.messages[R.messages.length-1]]),(0,ze.useEffect)(()=>{xe("auto")},[xe]),(0,ze.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let A=le.current,U=de.current;if(!A&&!U)return;let J=A?.scrollHeight??0,oe=A?.clientHeight??0,Ae=new ResizeObserver(()=>{let zt=le.current;if(!zt)return;let Wt=zt.scrollTop+oe>=J-5;J=zt.scrollHeight,oe=zt.clientHeight,Wt&&xe("auto")});return A&&Ae.observe(A),U&&Ae.observe(U),()=>Ae.disconnect()},[xe]);let Y=Z_({messages:R.messages,status:R.status,suggestions:t.suggestions}),Oe=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{let A=Y.suggestions;!D||A.length===0||Oe.current===A||(Oe.current=A,G.emit({name:"suggestions.shown",properties:{texts:A,origin:Y.source}}))},[Y.suggestions,Y.source,G,D]);let rt=d?.suggestions,ba=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{!D||R.messages.length>0||!rt?.length||ba.current===rt||(ba.current=rt,G.emit({name:"suggestions.shown",properties:{texts:rt,origin:"channel"}}))},[rt,R.messages.length,G,D]);let Sa=(0,ze.useCallback)(A=>{let U=A.content.map(J=>J.text??"").join("").trim();U&&R.handleSubmit({text:U,files:[],modelContext:A.modelContext})},[R.handleSubmit]),ra=(0,ze.useCallback)(A=>{let U=Y.suggestions.indexOf(A),J=U>=0?U:d?.suggestions?.indexOf(A)??-1,oe=U>=0?Y.source:"channel";G.emit({name:"suggestion.clicked",properties:{text:A,index:J,origin:oe}}),Y.clear(),R.handleSubmit({text:A,files:[]})},[Y.suggestions,Y.source,Y.clear,R.handleSubmit,d,G]);(0,ze.useImperativeHandle)(a,()=>({sendMessage:A=>{R.handleSubmit({text:A,files:[]}),ke()},sendMessageAndWait:A=>R.sendMessageAndWait(A),reset:R.reset,focus:ke,get messages(){return R.messages},get sessionId(){return R.sessionId}}),[R.handleSubmit,R.sendMessageAndWait,R.reset,R.messages,R.sessionId,ke]),(0,ze.useEffect)(()=>{if(!p)return;let A=U=>{let J=U.detail,oe=typeof J?.message=="string"?J.message:void 0;oe&&R.handleSubmit({text:oe,files:[]}),ke()};return window.addEventListener(p,A),()=>window.removeEventListener(p,A)},[p,R.handleSubmit,ke]);let pi=!b&&!!(y||T||R.keepsConversation||h),wo=M||!r;return(0,Ve.jsxs)("div",{ref:ye,style:{...F,maxHeight:"inherit",...ee&&Ge?{height:Ge}:{},opacity:wo?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,...wo?{"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:[pi&&(0,Ve.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,Ve.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ve.jsx)("div",{className:"ww:flex-1"}),!T&&R.keepsConversation&&(0,Ve.jsx)(xp,{onClick:R.reset}),T&&(0,Ve.jsx)(G2,{threads:R.threads,activeThreadId:R.activeThreadId,onNewThread:R.startNewThread,onSelectThread:A=>{R.switchThread(A)},onDeleteThread:A=>{R.deleteThread(A)}}),h]}),(0,Ve.jsxs)("div",{ref:le,className:q("ww:relative ww:flex-1 ww:min-h-0",ee?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ve.jsxs)("div",{ref:de,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,Ve.jsx)(U2,{value:Je,children:(0,Ve.jsx)(j2,{messages:R.messages,status:R.status,welcomeMessage:c,welcome:d,onSuggestionSelect:ra,resourceEndpoint:I,chatSessionId:R.sessionId,isDark:N,onFollowUp:Sa,onCallTool:ue,fullscreenToolCallId:ee,debug:S,showToolCalls:C,toolDefinitions:R.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(A,U)=>{if(A==="fullscreen"){let J=ye.current?.getBoundingClientRect().height??0;me(J>0?J:null),we(U.toolCallId)}else me(null),we(null)}})}),(0,Ve.jsx)("div",{ref:Q,"aria-hidden":!0,style:{height:1}})]}),!Be&&!ee&&(0,Ve.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ve.jsx)(Bn,{type:"button",onClick:()=>xe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ve.jsx)(Qs,{className:"ww:size-4"})})})]}),!w&&(0,Ve.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:ee?{display:"none"}:void 0,children:[(0,Ve.jsx)(dl,{suggestions:Y.suggestions,isLoading:Y.isLoading,onSelect:ra}),(0,Ve.jsx)(Rk,{queuedMessages:R.queuedMessages,onRemove:R.removeQueuedMessage}),(0,Ve.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ve.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ve.jsxs)(hk,{onSubmit:R.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,Ve.jsx)(bk,{enabled:K.enabled}),K.enabled&&(0,Ve.jsx)(vk,{className:"ww:px-4 ww:pt-3"}),(0,Ve.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,Ve.jsx)(xk,{}),(0,Ve.jsx)(wk,{onChange:R.handleTextChange,value:R.text,placeholder:v,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ve.jsx)(yk,{status:R.status,disabled:R.queueFull,onStop:R.stop})]})]}),K.error&&(0,Ve.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:K.error.message}),(0,Ve.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Ve.jsx)(V2,{}),(0,Ve.jsx)(Sk,{text:P})]})]})})]})]})});var rc=z(he(),1);var J_="500px",XV="https://app.waniwani.ai/api/mcp/chat",KV={api:XV};function cv(){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 qp(){let e=cv();if(!e)return{};let t=G=>e.getAttribute(G)??void 0,a=G=>{let ue=e.getAttribute(G);if(ue==null)return;let I=ue.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 h=t("data-theme");(h==="light"||h==="dark"||h==="auto")&&(n.appearance={...n.appearance,theme:h});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={},D=t("data-composer-variant")?.trim().toLowerCase();(D==="glow"||D==="outline")&&(M.variant=D);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 R=t("data-disclaimer");if(R!==void 0){let G=R.trim(),ue=G.toLowerCase();ue==="false"||ue==="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??qp(),r=YV(t,n,e),o={...t?.composer??{},...ec(n.composer),...ec(e?.composer)},i=Object.keys(o).length>0,l={token:"",...KV,...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 YV(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 oO=z(he(),1);var Hp=z(he(),1);function ZV(e){return e?.patterns??e?.rules??[]}var eO="\0\0";function QV(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,eO).replace(/\\\*/g,"[^/]*").split(eO).join(".*");return new RegExp(`^${a}$`)}function tO(e,t){try{return QV(e).test(t)}catch{return!1}}function ac(e,t){if(!e)return!0;let a=!1;for(let n of ZV(e))if(tO(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function aO(e,t){for(let a of e?.appearRules??[])if(tO(a.glob,t))return a.appearAfter;return null}var dv="waniwani:locationchange",nO=!1;function JV(){if(!(nO||typeof history>"u")){nO=!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(dv)),r}}}}function e7(e){return JV(),window.addEventListener(dv,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(dv,e),window.removeEventListener("popstate",e)}}function t7(){return window.location.pathname}function a7(){return"/"}function nc(){return(0,Hp.useSyncExternalStore)(e7,t7,a7)}function Hl(e,t){let a=nc(),n=t&&ac(e,a);return(0,Hp.useEffect)(()=>{ha("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var n7=3,r7=["low","medium","high"];function fv(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function o7(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 r7){let i=fv(t.get(o)??[])??fv(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(n7,e.length);){let o=fv(r);if(!o)break;n.push(o)}return n}function rO(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function iO(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,oO.useMemo)(()=>{let r=rO(n),o=t?.find(l=>rO(l.url)===r),i=o?o7(o.prompts).map(({id:l,text:s})=>({id:l,text:s})):null;return ha("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:Ul(a??[])}},[n,t,a])}var i7="waniwani:config:";function lO(e,t,a){return`${i7}${e}|${t}|${a??""}`}function ho(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(lO(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function l7(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(lO(e,t,a),JSON.stringify(n))}catch{}}var s7=600;function u7(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 c7(e,t,a,n){Uo("configStart");let r=await d7(e,t,a,n);return Uo("configEnd"),a?.aborted||$g(r.metadata),r}async function d7(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?f7(l):{}}catch{return{}}}function f7(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=iO(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=u7(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||OC({api:l,token:s,channelId:u??m.channelId,mode:e.mode==="off"?void 0:e.mode,source:m.source})},d=ho(l,s,u);if(d)try{let m=tc(t,d,a);r(m),Yd("cache"),$g(d.metadata),i(!0),ha("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d)}catch{}let f=new AbortController,p=setTimeout(()=>{Yd("timeout"),i(!0)},s7);return c7(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ha("remote /config response",m),Object.keys(m).length>0){l7(l,s,u,m);try{let x=tc(t,m,a);r(x),ha("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 Et=z(ae(),1),p7={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}},sO="var(--ww-composer-bg, var(--ww-color-input))",m7="var(--ww-composer-border-color, var(--ww-color-border))",h7="var(--ww-composer-border-width, 1px)",uO="var(--ww-composer-send-bg, var(--ww-color-foreground))",cO="var(--ww-composer-send-fg, var(--ww-color-background))",fO=(0,$e.forwardRef)(function(t,a){return(0,Et.jsx)(zo,{locale:t.config.locale,children:(0,Et.jsx)(g7,{...t,ref:a})})}),g7=(0,$e.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:l}=Ie(),{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,h]=(0,$e.useState)(""),[b,T]=(0,$e.useState)(0),C=s.appearance?.theme,M=s.appearance?.variables,D=(0,$e.useMemo)(()=>M?zl(M):{},[M]),P=jl(s),L=(0,$e.useMemo)(()=>ci({flow:null,followup:null,...P}),[P]),$=(0,$e.useMemo)(()=>L?.suggestions.map(Y=>Y.text)??[],[L]);fl({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=p7[F.size??"md"],N=F.showSuggestions??!0,R=F.align==="center",G=XC(),ue=(F.trigger??!1)||G&&(F.mobileTrigger??!0),I=s.launcherText??s.placeholder??l.launcher.prompt,We=ml(I,!ue&&y.length===0),Je="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,$e.useEffect)(()=>{let Y=m.current;if(Y){if(!y){Y.style.height="";return}Y.style.height="auto",Y.style.height=`${Y.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 Y=c&&S;Y!==K.current&&(K.current=Y,f.emit({name:Y?"chat.opened":"chat.closed"}))},[c,S,f]);let ee=(0,$e.useCallback)(Y=>{w(!0),T(rt=>rt+1);let Oe=Y.trim();Oe&&d.current?.sendMessage(Oe)},[]);(0,$e.useImperativeHandle)(i,()=>({open:()=>w(!0),close:()=>w(!1),toggle:()=>w(Y=>!Y),sendMessage:Y=>ee(Y),sendMessageAndWait:async Y=>{w(!0);let Oe=d.current;if(Oe)return await Oe.sendMessageAndWait(Y)},reset:()=>d.current?.reset(),focus:()=>{S?T(Y=>Y+1):(m.current??x.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[ee,S]);let we=(0,$e.useCallback)(()=>{y.trim()&&(ee(y),h(""))},[y,ee]),Ge=(0,$e.useCallback)(()=>{(d.current?.messages.length??0)>0&&(w(!0),T(Y=>Y+1))},[]),me={mode:"composer"};s.mcpServerUrl&&(me.mcpServerUrl=s.mcpServerUrl),s.channelId&&(me.channelId=s.channelId);let ye=(0,Et.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,Et.jsx)(Ga,{className:"ww:size-4"})}),le=(0,Et.jsxs)("div",{className:q("ww:flex ww:items-end",V.row),children:[(0,Et.jsx)("textarea",{ref:m,rows:1,value:y,placeholder:We,onChange:Y=>h(Y.target.value),onFocus:Ge,onKeyDown:Y=>{Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),we())},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,Et.jsx)("button",{type:"button",onClick:we,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:uO,color:cO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),de=(0,Et.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,R&&"ww:justify-center"),children:[(0,Et.jsx)("span",{className:q("ww:min-w-0 ww:flex-1 ww:truncate ww:text-muted-foreground",V.field,R&&"ww:flex-none"),children:I}),(0,Et.jsx)("span",{"aria-hidden":!0,className:q("ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full",V.send,R&&"ww:ml-3"),style:{background:uO,color:cO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),Q=ue?de:le,Be=`var(--ww-composer-radius, ${V.radius}px)`,qe={borderRadius:Be,background:sO,borderColor:m7,borderWidth:h7,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${Je})`},_e=W==="glow"?(0,Et.jsx)(tf,{animated:u,backgroundColor:sO,borderRadius:Be,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:qe,children:Q}):(0,Et.jsx)("div",{className:q(ue&&"ww:transition-colors hover:ww:border-primary/40"),style:qe,children:Q}),ke=(0,Et.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:D,children:[_e,N&&$.length>0&&(0,Et.jsx)(dl,{suggestions:$,onSelect:Y=>{f.emit({name:"suggestion.clicked",properties:{text:Y,index:$.indexOf(Y),origin:L?.origin??"channel"}}),ee(Y)},align:R?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),xe=(0,Et.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:D,children:(0,Et.jsx)("div",{role:"dialog","aria-label":s.title??I,"data-waniwani-floating":"panel","data-state":c&&S?"shown":"hidden",style:{boxShadow:Je},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,Et.jsx)(ql,{ref:d,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:me,appearance:s.appearance,title:s.title,headerActions:ye,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,Et.jsxs)(_l,{value:f,children:[ke,(0,dO.createPortal)(xe,r)]})});var pv="/*! 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 w7(e){return e.startsWith("__WANIWANI")}function jp(e){if(!pv||w7(pv))return;let t=document.createElement("style");t.textContent=pv,e.appendChild(t)}var Ee=z(he(),1);var Vp=z(he(),1),y7=3e3,x7=120,v7=24;function pO(e){let[t,a]=(0,Vp.useState)(!1);return(0,Vp.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 -${v7}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,x7)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},y7),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var wt=z(ae(),1),b7=2e3,S7=90,I7=1e3,mO=(0,Ee.forwardRef)(function(t,a){return(0,wt.jsx)(zo,{locale:t.config.locale,children:(0,wt.jsx)(C7,{...t,ref:a})})}),C7=(0,Ee.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Ie(),{config:i,ready:l}=Vl(t,a,n),s=Hl(i.visibility,l),u=nc(),c=s?aO(i.visibility,u):null,d=pO(c),f=(0,Ee.useRef)(null),p=(0,Ee.useMemo)(()=>Dl({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Ee.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Ee.useRef)(null),S=(0,Ee.useRef)(null),w=(0,Ee.useRef)(!1),[y,h]=(0,Ee.useState)("input"),[b,T]=(0,Ee.useState)(""),[C,M]=(0,Ee.useState)(!1),[D,P]=(0,Ee.useState)(!1),[L,$]=(0,Ee.useState)(0),H=i.appearance?.theme,F=i.appearance?.variables,W=(0,Ee.useMemo)(()=>F?zl(F):{},[F]),V=jl(i),N=(0,Ee.useMemo)(()=>ci({flow:null,followup:null,...V}),[V]),R=(0,Ee.useMemo)(()=>N?.suggestions.map(Q=>Q.text)??[],[N]);fl({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,Ee.useRef)(null);(0,Ee.useEffect)(()=>{!D||!N||G.current!==N&&(G.current=N,p.emit({name:"suggestions.shown",properties:{texts:R,origin:N.origin}}))},[D,N,R,p]);let ue=i.launcherText??i.placeholder??o.launcher.prompt,I=ml(ue,b.length===0),We="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ee.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let Q=i.appearDelay??b7,Be=setTimeout(()=>M(!0),Math.max(0,Q));return()=>clearTimeout(Be)},[s,i.appearDelay,c,d]),(0,Ee.useEffect)(()=>{if(!C||R.length===0)return;let Q=setTimeout(()=>{w.current||h(Be=>Be==="input"?"expanded":Be)},I7);return()=>clearTimeout(Q)},[C,R.length]),(0,Ee.useEffect)(()=>{L>0&&y==="open"&&f.current?.focus()},[L,y]);let Je=(0,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{l&&!Je.current&&(Je.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,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{let Q=s&&y==="open";Q!==v.current&&(v.current=Q,p.emit({name:Q?"chat.opened":"chat.closed"}))},[s,y,p]);let K=(0,Ee.useCallback)(()=>{h("open")},[]),ee=(0,Ee.useCallback)(()=>{w.current=!0,h("input")},[]);(0,Ee.useEffect)(()=>{if(y!=="expanded"){P(!1);return}let Q=setTimeout(()=>P(!0),S7);return()=>clearTimeout(Q)},[y]);let we=(0,Ee.useCallback)(Q=>{K();let Be=Q.trim();Be&&f.current?.sendMessage(Be)},[K]);(0,Ee.useImperativeHandle)(r,()=>({open:()=>K(),close:()=>ee(),toggle:()=>{h(Q=>Q==="open"?"input":"open")},sendMessage:Q=>we(Q),sendMessageAndWait:async Q=>{K();let Be=f.current;if(Be)return await Be.sendMessageAndWait(Q)},reset:()=>f.current?.reset(),focus:()=>{K(),$(Q=>Q+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[we,K,ee]);let Ge=(0,Ee.useCallback)(()=>{b.trim()&&(we(b),T(""))},[b,we]),me=(0,Ee.useCallback)(()=>{(f.current?.messages.length??0)>0?(h("open"),$(Q=>Q+1)):(w.current=!1,h(Q=>Q==="input"?"expanded":Q))},[]),ye={mode:"floating"};i.mcpServerUrl&&(ye.mcpServerUrl=i.mcpServerUrl),i.channelId&&(ye.channelId=i.channelId);let le=R.length>0&&y!=="input",de=(0,wt.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,wt.jsx)(Ga,{className:"ww:size-4"})});return(0,wt.jsx)(_l,{value:p,children:(0,wt.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,wt.jsxs)(wt.Fragment,{children:[(0,wt.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",le?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,wt.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",le?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:le?{boxShadow:We,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[le&&y!=="open"&&(0,wt.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,wt.jsx)(Ga,{className:"ww:size-4"})}),R.length>0&&(0,wt.jsx)("div",{className:q("ww:grid ww:transition-all ww:duration-300 ww:ease-out",D?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,wt.jsx)("div",{className:"ww:overflow-hidden",children:(0,wt.jsx)(dl,{suggestions:R,onSelect:Q=>{p.emit({name:"suggestion.clicked",properties:{text:Q,index:R.indexOf(Q),origin:N?.origin??"channel"}}),we(Q)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,wt.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:We},children:(0,wt.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,wt.jsx)("input",{ref:x,type:"text",value:b,placeholder:I,onChange:Q=>T(Q.target.value),onFocus:me,onKeyDown:Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),Ge())},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,wt.jsx)("button",{type:"button",onClick:Ge,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,wt.jsx)(Nn,{className:"ww:size-4"})})]})})]})}),(0,wt.jsx)("div",{role:"dialog","aria-label":i.title??ue,"data-waniwani-floating":"panel","data-state":y==="open"?"shown":"hidden",style:{boxShadow:We},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,wt.jsx)(ql,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:ye,appearance:i.appearance,title:i.title,headerActions:de,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 Oa=z(he(),1);var mv=z(ae(),1),hO=(0,Oa.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Vl(t,a,n),u=(0,Oa.useRef)(null),c=(0,Oa.useMemo)(()=>Dl({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,Oa.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,Oa.useRef)(!1);(0,Oa.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,Oa.useEffect)(()=>{r?.()},[]);let p=Hl(l.visibility,s);(0,Oa.useEffect)(()=>{o?.(p)},[p,o]),Ml({api:l.api,token:l.token,channelId:l.channelId,mode:"inline",paintMark:"chatVisible",painted:s}),(0,Oa.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=jl(l);fl({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,mv.jsx)(_l,{value:c,children:(0,mv.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(he(),1),SO=z(Ng(),1);function gO(){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 hv(){return gO()!==null}function k7(){return{url:location.href,title:document.title}}async function gv(e){let{endpoint:t,listEndpoint:a,headers:n,sessionId:r,visitorId:o,channelId:i,onWidget:l}=e,s=e.logger??console,u=gO();if(!u)return null;let c=new AbortController,d=()=>c.abort();window.addEventListener("pagehide",d);let f=!1,p=()=>{f||(f=!0,window.removeEventListener("pagehide",d),c.abort())};function m(){return{sessionId:r,visitorId:o,channelId:i,page:k7()}}async function x(h,b){let T=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify(h),...b?{signal:b}:{}});if(!T.ok)throw new Error(`webmcp ${h.action} failed: ${T.status}`);return await T.json()}async function S(){if(a)try{let h=await fetch(a);if(h.ok)return await h.json();s.info(`[webmcp] list GET answered ${h.status}, using POST`)}catch(h){s.info("[webmcp] list GET failed, using POST",h)}return x({...m(),action:"list"})}let w=[];try{let h=await S();w=Array.isArray(h?.tools)?h.tools:[]}catch(h){return s.error("[webmcp] could not list site tools",h),p(),null}let y=[];return await Promise.all(w.map(async h=>{try{await u.registerTool({name:h.name,description:h.description??"",...h.inputSchema?{inputSchema:h.inputSchema}:{},...h.annotations?{annotations:h.annotations}:{},execute:async(b,T)=>{let C=await x({...m(),action:"call",name:h.name,arguments:b??{}},T?.signal);return C?.widget&&l?.(C.widget),{content:C?.content??[]}}},{signal:c.signal}),y.push(h)}catch(b){s.error(`[webmcp] could not register ${h.name}`,b)}})),s.info(`[webmcp] registered ${y.length} site tool(s)`),{get tools(){return y},callTool:({name:h,arguments:b})=>x({...m(),action:"call",name:h,arguments:b??{}}),dispose:p}}function wO(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,o=e.channelId??a;return{toolsEndpoint:ma(n,"/webmcp",r),listEndpoint:ma(n,"/webmcp/tools",{token:e.token,...o&&{channel:o},...r}),...o&&{channelId:o},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:ma(n,"/resource",{token:e.token,...r})}}var go=z(he(),1);var Wl=z(ae(),1),yO=672,xO=32;function vO({widget:e,onCallTool:t,toolsEndpoint:a,headers:n,resourceEndpoint:r,onClose:o,isDark:i=!1}){let[l,s]=(0,go.useState)(null);(0,go.useEffect)(()=>{let p=()=>s({width:window.innerWidth,height:window.innerHeight});return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let u=e?.preview===!0;(0,go.useEffect)(()=>{if(!e||!u)return;let p=m=>{m.key==="Escape"&&o()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,u,o]),(0,go.useEffect)(()=>{if(!e)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[e]);let c=(0,go.useCallback)(async p=>{if(t)return t(p);if(!a)throw new Error("webmcp overlay needs onCallTool");let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...p})});if(!m.ok)throw new Error(`webmcp tool call failed: ${m.status}`);return await m.json()},[t,a,n]);if(!e)return null;let d=l?Math.min(yO,l.width-xO):yO,f=l?l.height-xO: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",i&&"dark"),children:[u&&(0,Wl.jsx)("button",{type:"button","aria-label":"Close",onClick:o,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:d,maxHeight:f},children:(0,Wl.jsx)(wp,{resourceUri:e.viewUri,resourceEndpoint:r,toolInput:e.data,toolResult:e.result,autoHeight:Hu(e.result._meta),isDark:i,onCallTool:c,onOpenLink:p=>window.open(p,"_blank","noopener")},`${r}|${e.viewUri}`)})]})}var wv=z(ae(),1),bO="waniwani:webmcp:session";function T7(){try{let e=sessionStorage.getItem(bO);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(bO,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function L7(e){let t=e.token?ho(e.api??"",e.token,e.channelId):null,a=wO(e,t?.webmcp?.enabled,t?.channelId);return a||ha("[webmcp] not publishing site tools: switched off, or no token"),a}function E7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function M7(){let e=null,t=null;return{emit(a){e?e(a):t=a},subscribe(a){return e=a,t&&(a(t),t=null),()=>{e===a&&(e=null)}}}}function A7({resourceEndpoint:e,subscribe:t,callTool:a}){let[n,r]=oc.default.useState(null),[o,i]=oc.default.useState(E7);return oc.default.useEffect(()=>t(r),[t]),oc.default.useEffect(()=>{let l;try{l=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let s=()=>i(l.matches);return l.addEventListener("change",s),()=>l.removeEventListener("change",s)},[]),(0,wv.jsx)(vO,{widget:n,onCallTool:a,resourceEndpoint:e,isDark:o,onClose:()=>r(null)})}function IO(e){if(!hv())return null;let t=L7(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),a.style.cssText="position:relative;z-index:2147483001;",document.body.appendChild(a);let n=a.attachShadow({mode:"open"});jp(n);let r=document.createElement("div");n.appendChild(r);let o=M7(),i=null,l=!1;gv({endpoint:t.toolsEndpoint,listEndpoint:t.listEndpoint,headers:t.headers,channelId:t.channelId,sessionId:T7(),visitorId:Zt(),onWidget:o.emit}).then(c=>{if(l){c?.dispose();return}i=c}).catch(c=>{console.error("[webmcp] could not publish site tools",c)});let s=async c=>{if(!i)throw new Error("webmcp bridge is not registered");let d=await i.callTool(c);return d.widget?.interactive&&o.emit(d.widget),d},u=SO.default.createRoot(r);return u.render((0,wv.jsx)(A7,{resourceEndpoint:t.resourceEndpoint,subscribe:o.subscribe,callTool:s})),{getTools:()=>(i?.tools??[]).map(c=>c.name),destroy:()=>{l=!0,i?.dispose(),u.unmount(),a.remove()}}}var vt=null,hn=null,Mt=null,di=null,Wp=null,R7="waniwani-chat-sizing",D7="waniwani-chat-defaults",_7="waniwani-chat-chrome",O7="waniwani-chat-auto-card",P7=`:where([data-waniwani-embed]){height:${J_}}`,N7=":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)}",U7=":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))}",F7="waniwani-chat-composer-auto",z7=":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 TO(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 Gp(e,t){jp(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 CO="data-waniwani-embed",lc="data-waniwani-auto";function LO(e){let t=document.querySelector(`[${CO}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(CO,""),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 q7(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function H7(e,t,a,n){let r=LO(n);ic(R7,P7),e.height&&r instanceof HTMLElement&&(r.style.height=q7(e.height)),e.appearance?.theme&&ic(D7,N7),ic(_7,B7),r.hasAttribute(lc)&&ic(O7,U7),TO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Mt);let o=Mt,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(),Wp=new ResizeObserver(i),Wp.observe(r);let l=Mt.attachShadow({mode:"open"});Gp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=fi.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ho(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return hn=$p.default.createRoot(s),hn.render(fi.default.createElement(hO,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Wp?.disconnect(),Wp=null,hn?.unmount(),hn=null,Mt?.remove(),Mt=null,r.hasAttribute(lc)&&r.remove(),vt=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 j7(e,t,a){Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Mt);let n=Mt.attachShadow({mode:"open"});Gp(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=fi.default.createRef();return hn=$p.default.createRoot(r),hn.render(fi.default.createElement(mO,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,vt=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 V7(){return{destroy:()=>{vt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function W7(e,t,a,n){let r=LO(n);r.hasAttribute(lc)&&ic(F7,z7),TO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="display:block;width:100%;",r.appendChild(Mt);let o=Mt.attachShadow({mode:"open"});Gp(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),di=document.createElement("div"),di.id="waniwani-chat-panel",di.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(di);let l=di.attachShadow({mode:"open"});Gp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=fi.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ho(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return hn=$p.default.createRoot(i),hn.render(fi.default.createElement(fO,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:s,onVisibilityChange:c})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,di?.remove(),di=null,r.hasAttribute(lc)&&r.remove(),vt=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 EO(e){if(vt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),vt;let t=cv(),a=qp(),n=tc(e,void 0,a);Xs(n.visitorId);let r=null;try{r=IO(n)}catch(s){console.error("[Waniwani] WebMCP setup failed",s)}let o;n.mode==="off"?o=V7():n.mode==="floating"?o=j7(n,e,a):n.mode==="composer"?o=W7(n,e,a,t):o=H7(n,e,a,t);let i=n.api??"",l=n.token?PC({api:i,token:n.token,channelId:()=>n.channelId??ho(i,n.token,n.channelId)?.channelId,getSource:()=>ho(i,n.token,n.channelId)?.source??void 0,getSessionId:()=>o.getSessionId()}):Zd("no public token configured (set data-token or pass token to init())");return vt={...o,track:l.track,identify:(s,u)=>l.identify(s,u),setVisitorId:s=>ll(s),getVisitorId:()=>Zt(),destroy:()=>{l.shutdown(),r?.destroy(),o.destroy()}},vt}function G7(){vt&&vt.destroy()}var MO=Zd("chat widget is not initialized (call WaniWani.chat.init() first)"),Gl=()=>vt?vt.track:MO.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:EO,destroy:G7,open:()=>vt?.open(),close:()=>vt?.close(),toggle:()=>vt?.toggle(),sendMessage:e=>vt?.sendMessage(e),sendMessageAndWait:async e=>{if(vt)return vt.sendMessageAndWait(e)},reset:()=>vt?.reset(),focus:()=>vt?.focus(),getMessages:()=>vt?.getMessages()??[],getSessionId:()=>vt?.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)=>vt?vt.identify(e,t):MO.identify(e,t),setVisitorId:e=>ll(e),getVisitorId:()=>Zt()};function kO(){if(qp().token)try{EO()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",kO):kO();})();
|
|
139
139
|
/*! Bundled license information:
|
|
140
140
|
|
|
141
141
|
react/cjs/react.production.js:
|